var Rw=Object.defineProperty;var Aw=(r,n,i)=>n in r?Rw(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i;var Dt=(r,n,i)=>Aw(r,typeof n!="symbol"?n+"":n,i);function Dw(r,n){for(var i=0;i<n.length;i++){const l=n[i];if(typeof l!="string"&&!Array.isArray(l)){for(const o in l)if(o!=="default"&&!(o in r)){const d=Object.getOwnPropertyDescriptor(l,o);d&&Object.defineProperty(r,o,d.get?d:{enumerable:!0,get:()=>l[o]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(o){if(o.ep)return;o.ep=!0;const d=i(o);fetch(o.href,d)}})();function Mw(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var kf={exports:{}},vi={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Vg;function Ow(){if(Vg)return vi;Vg=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(l,o,d){var f=null;if(d!==void 0&&(f=""+d),o.key!==void 0&&(f=""+o.key),"key"in o){d={};for(var h in o)h!=="key"&&(d[h]=o[h])}else d=o;return o=d.ref,{$$typeof:r,type:l,key:f,ref:o!==void 0?o:null,props:d}}return vi.Fragment=n,vi.jsx=i,vi.jsxs=i,vi}var Kg;function zw(){return Kg||(Kg=1,kf.exports=Ow()),kf.exports}var t=zw(),Sf={exports:{}},$e={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Yg;function Lw(){if(Yg)return $e;Yg=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.iterator;function j(v){return v===null||typeof v!="object"?null:(v=b&&v[b]||v["@@iterator"],typeof v=="function"?v:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function E(v,M,I){this.props=v,this.context=M,this.refs=S,this.updater=I||N}E.prototype.isReactComponent={},E.prototype.setState=function(v,M){if(typeof v!="object"&&typeof v!="function"&&v!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,v,M,"setState")},E.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function k(){}k.prototype=E.prototype;function A(v,M,I){this.props=v,this.context=M,this.refs=S,this.updater=I||N}var O=A.prototype=new k;O.constructor=A,w(O,E.prototype),O.isPureReactComponent=!0;var L=Array.isArray,B={H:null,A:null,T:null,S:null,V:null},V=Object.prototype.hasOwnProperty;function $(v,M,I,ee,xe,je){return I=je.ref,{$$typeof:r,type:v,key:M,ref:I!==void 0?I:null,props:je}}function le(v,M){return $(v.type,M,void 0,void 0,void 0,v.props)}function q(v){return typeof v=="object"&&v!==null&&v.$$typeof===r}function K(v){var M={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(I){return M[I]})}var ae=/\/+/g;function G(v,M){return typeof v=="object"&&v!==null&&v.key!=null?K(""+v.key):M.toString(36)}function Z(){}function z(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status=="string"?v.then(Z,Z):(v.status="pending",v.then(function(M){v.status==="pending"&&(v.status="fulfilled",v.value=M)},function(M){v.status==="pending"&&(v.status="rejected",v.reason=M)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function H(v,M,I,ee,xe){var je=typeof v;(je==="undefined"||je==="boolean")&&(v=null);var ve=!1;if(v===null)ve=!0;else switch(je){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(v.$$typeof){case r:case n:ve=!0;break;case y:return ve=v._init,H(ve(v._payload),M,I,ee,xe)}}if(ve)return xe=xe(v),ve=ee===""?"."+G(v,0):ee,L(xe)?(I="",ve!=null&&(I=ve.replace(ae,"$&/")+"/"),H(xe,M,I,"",function(be){return be})):xe!=null&&(q(xe)&&(xe=le(xe,I+(xe.key==null||v&&v.key===xe.key?"":(""+xe.key).replace(ae,"$&/")+"/")+ve)),M.push(xe)),1;ve=0;var ye=ee===""?".":ee+":";if(L(v))for(var ge=0;ge<v.length;ge++)ee=v[ge],je=ye+G(ee,ge),ve+=H(ee,M,I,je,xe);else if(ge=j(v),typeof ge=="function")for(v=ge.call(v),ge=0;!(ee=v.next()).done;)ee=ee.value,je=ye+G(ee,ge++),ve+=H(ee,M,I,je,xe);else if(je==="object"){if(typeof v.then=="function")return H(z(v),M,I,ee,xe);throw M=String(v),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ve}function C(v,M,I){if(v==null)return v;var ee=[],xe=0;return H(v,ee,"","",function(je){return M.call(I,je,xe++)}),ee}function U(v){if(v._status===-1){var M=v._result;M=M(),M.then(function(I){(v._status===0||v._status===-1)&&(v._status=1,v._result=I)},function(I){(v._status===0||v._status===-1)&&(v._status=2,v._result=I)}),v._status===-1&&(v._status=0,v._result=M)}if(v._status===1)return v._result.default;throw v._result}var T=typeof reportError=="function"?reportError:function(v){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v=="object"&&v!==null&&typeof v.message=="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",v);return}console.error(v)};function R(){}return $e.Children={map:C,forEach:function(v,M,I){C(v,function(){M.apply(this,arguments)},I)},count:function(v){var M=0;return C(v,function(){M++}),M},toArray:function(v){return C(v,function(M){return M})||[]},only:function(v){if(!q(v))throw Error("React.Children.only expected to receive a single React element child.");return v}},$e.Component=E,$e.Fragment=i,$e.Profiler=o,$e.PureComponent=A,$e.StrictMode=l,$e.Suspense=g,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,$e.__COMPILER_RUNTIME={__proto__:null,c:function(v){return B.H.useMemoCache(v)}},$e.cache=function(v){return function(){return v.apply(null,arguments)}},$e.cloneElement=function(v,M,I){if(v==null)throw Error("The argument must be a React element, but you passed "+v+".");var ee=w({},v.props),xe=v.key,je=void 0;if(M!=null)for(ve in M.ref!==void 0&&(je=void 0),M.key!==void 0&&(xe=""+M.key),M)!V.call(M,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&M.ref===void 0||(ee[ve]=M[ve]);var ve=arguments.length-2;if(ve===1)ee.children=I;else if(1<ve){for(var ye=Array(ve),ge=0;ge<ve;ge++)ye[ge]=arguments[ge+2];ee.children=ye}return $(v.type,xe,void 0,void 0,je,ee)},$e.createContext=function(v){return v={$$typeof:f,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null},v.Provider=v,v.Consumer={$$typeof:d,_context:v},v},$e.createElement=function(v,M,I){var ee,xe={},je=null;if(M!=null)for(ee in M.key!==void 0&&(je=""+M.key),M)V.call(M,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(xe[ee]=M[ee]);var ve=arguments.length-2;if(ve===1)xe.children=I;else if(1<ve){for(var ye=Array(ve),ge=0;ge<ve;ge++)ye[ge]=arguments[ge+2];xe.children=ye}if(v&&v.defaultProps)for(ee in ve=v.defaultProps,ve)xe[ee]===void 0&&(xe[ee]=ve[ee]);return $(v,je,void 0,void 0,null,xe)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(v){return{$$typeof:h,render:v}},$e.isValidElement=q,$e.lazy=function(v){return{$$typeof:y,_payload:{_status:-1,_result:v},_init:U}},$e.memo=function(v,M){return{$$typeof:p,type:v,compare:M===void 0?null:M}},$e.startTransition=function(v){var M=B.T,I={};B.T=I;try{var ee=v(),xe=B.S;xe!==null&&xe(I,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(R,T)}catch(je){T(je)}finally{B.T=M}},$e.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},$e.use=function(v){return B.H.use(v)},$e.useActionState=function(v,M,I){return B.H.useActionState(v,M,I)},$e.useCallback=function(v,M){return B.H.useCallback(v,M)},$e.useContext=function(v){return B.H.useContext(v)},$e.useDebugValue=function(){},$e.useDeferredValue=function(v,M){return B.H.useDeferredValue(v,M)},$e.useEffect=function(v,M,I){var ee=B.H;if(typeof I=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(v,M)},$e.useId=function(){return B.H.useId()},$e.useImperativeHandle=function(v,M,I){return B.H.useImperativeHandle(v,M,I)},$e.useInsertionEffect=function(v,M){return B.H.useInsertionEffect(v,M)},$e.useLayoutEffect=function(v,M){return B.H.useLayoutEffect(v,M)},$e.useMemo=function(v,M){return B.H.useMemo(v,M)},$e.useOptimistic=function(v,M){return B.H.useOptimistic(v,M)},$e.useReducer=function(v,M,I){return B.H.useReducer(v,M,I)},$e.useRef=function(v){return B.H.useRef(v)},$e.useState=function(v){return B.H.useState(v)},$e.useSyncExternalStore=function(v,M,I){return B.H.useSyncExternalStore(v,M,I)},$e.useTransition=function(){return B.H.useTransition()},$e.version="19.1.0",$e}var Xg;function jh(){return Xg||(Xg=1,Sf.exports=Lw()),Sf.exports}var x=jh();const mr=Mw(x),Uw=Dw({__proto__:null,default:mr},[x]);var _f={exports:{}},ji={},Tf={exports:{}},Cf={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Qg;function Gw(){return Qg||(Qg=1,function(r){function n(C,U){var T=C.length;C.push(U);e:for(;0<T;){var R=T-1>>>1,v=C[R];if(0<o(v,U))C[R]=U,C[T]=v,T=R;else break e}}function i(C){return C.length===0?null:C[0]}function l(C){if(C.length===0)return null;var U=C[0],T=C.pop();if(T!==U){C[0]=T;e:for(var R=0,v=C.length,M=v>>>1;R<M;){var I=2*(R+1)-1,ee=C[I],xe=I+1,je=C[xe];if(0>o(ee,T))xe<v&&0>o(je,ee)?(C[R]=je,C[xe]=T,R=xe):(C[R]=ee,C[I]=T,R=I);else if(xe<v&&0>o(je,T))C[R]=je,C[xe]=T,R=xe;else break e}}return U}function o(C,U){var T=C.sortIndex-U.sortIndex;return T!==0?T:C.id-U.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var f=Date,h=f.now();r.unstable_now=function(){return f.now()-h}}var g=[],p=[],y=1,b=null,j=3,N=!1,w=!1,S=!1,E=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function L(C){for(var U=i(p);U!==null;){if(U.callback===null)l(p);else if(U.startTime<=C)l(p),U.sortIndex=U.expirationTime,n(g,U);else break;U=i(p)}}function B(C){if(S=!1,L(C),!w)if(i(g)!==null)w=!0,V||(V=!0,G());else{var U=i(p);U!==null&&H(B,U.startTime-C)}}var V=!1,$=-1,le=5,q=-1;function K(){return E?!0:!(r.unstable_now()-q<le)}function ae(){if(E=!1,V){var C=r.unstable_now();q=C;var U=!0;try{e:{w=!1,S&&(S=!1,A($),$=-1),N=!0;var T=j;try{t:{for(L(C),b=i(g);b!==null&&!(b.expirationTime>C&&K());){var R=b.callback;if(typeof R=="function"){b.callback=null,j=b.priorityLevel;var v=R(b.expirationTime<=C);if(C=r.unstable_now(),typeof v=="function"){b.callback=v,L(C),U=!0;break t}b===i(g)&&l(g),L(C)}else l(g);b=i(g)}if(b!==null)U=!0;else{var M=i(p);M!==null&&H(B,M.startTime-C),U=!1}}break e}finally{b=null,j=T,N=!1}U=void 0}}finally{U?G():V=!1}}}var G;if(typeof O=="function")G=function(){O(ae)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,z=Z.port2;Z.port1.onmessage=ae,G=function(){z.postMessage(null)}}else G=function(){k(ae,0)};function H(C,U){$=k(function(){C(r.unstable_now())},U)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(C){C.callback=null},r.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<C?Math.floor(1e3/C):5},r.unstable_getCurrentPriorityLevel=function(){return j},r.unstable_next=function(C){switch(j){case 1:case 2:case 3:var U=3;break;default:U=j}var T=j;j=U;try{return C()}finally{j=T}},r.unstable_requestPaint=function(){E=!0},r.unstable_runWithPriority=function(C,U){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var T=j;j=C;try{return U()}finally{j=T}},r.unstable_scheduleCallback=function(C,U,T){var R=r.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?R+T:R):T=R,C){case 1:var v=-1;break;case 2:v=250;break;case 5:v=1073741823;break;case 4:v=1e4;break;default:v=5e3}return v=T+v,C={id:y++,callback:U,priorityLevel:C,startTime:T,expirationTime:v,sortIndex:-1},T>R?(C.sortIndex=T,n(p,C),i(g)===null&&C===i(p)&&(S?(A($),$=-1):S=!0,H(B,T-R))):(C.sortIndex=v,n(g,C),w||N||(w=!0,V||(V=!0,G()))),C},r.unstable_shouldYield=K,r.unstable_wrapCallback=function(C){var U=j;return function(){var T=j;j=U;try{return C.apply(this,arguments)}finally{j=T}}}}(Cf)),Cf}var Wg;function Fw(){return Wg||(Wg=1,Tf.exports=Gw()),Tf.exports}var Ef={exports:{}},ha={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Jg;function Bw(){if(Jg)return ha;Jg=1;var r=jh();function n(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,p,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:g,containerInfo:p,implementation:y}}var f=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ha.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,ha.createPortal=function(g,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return d(g,p,null,y)},ha.flushSync=function(g){var p=f.T,y=l.p;try{if(f.T=null,l.p=2,g)return g()}finally{f.T=p,l.p=y,l.d.f()}},ha.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},ha.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},ha.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var y=p.as,b=h(y,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:j,fetchPriority:N}):y==="script"&&l.d.X(g,{crossOrigin:b,integrity:j,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ha.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=h(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},ha.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,b=h(y,p.crossOrigin);l.d.L(g,y,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ha.preloadModule=function(g,p){if(typeof g=="string")if(p){var y=h(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},ha.requestFormReset=function(g){l.d.r(g)},ha.unstable_batchedUpdates=function(g,p){return g(p)},ha.useFormState=function(g,p,y){return f.H.useFormState(g,p,y)},ha.useFormStatus=function(){return f.H.useHostTransitionStatus()},ha.version="19.1.0",ha}var ex;function Oy(){if(ex)return Ef.exports;ex=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Ef.exports=Bw(),Ef.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var tx;function Iw(){if(tx)return ji;tx=1;var r=Fw(),n=jh(),i=Oy();function l(e){var a="https://react.dev/errors/"+e;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var a=e,s=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(s=a.return),e=a.return;while(e)}return a.tag===3?s:null}function f(e){if(e.tag===13){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function h(e){if(d(e)!==e)throw Error(l(188))}function g(e){var a=e.alternate;if(!a){if(a=d(e),a===null)throw Error(l(188));return a!==e?null:e}for(var s=e,c=a;;){var u=s.return;if(u===null)break;var m=u.alternate;if(m===null){if(c=u.return,c!==null){s=c;continue}break}if(u.child===m.child){for(m=u.child;m;){if(m===s)return h(u),e;if(m===c)return h(u),a;m=m.sibling}throw Error(l(188))}if(s.return!==c.return)s=u,c=m;else{for(var _=!1,D=u.child;D;){if(D===s){_=!0,s=u,c=m;break}if(D===c){_=!0,c=u,s=m;break}D=D.sibling}if(!_){for(D=m.child;D;){if(D===s){_=!0,s=m,c=u;break}if(D===c){_=!0,c=m,s=u;break}D=D.sibling}if(!_)throw Error(l(189))}}if(s.alternate!==c)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:a}function p(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=p(e),a!==null)return a;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case B:return"Suspense";case V:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case O:return(e.displayName||"Context")+".Provider";case A:return(e._context.displayName||"Context")+".Consumer";case L:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return a=e.displayName||null,a!==null?a:z(e.type)||"Memo";case le:a=e._payload,e=e._init;try{return z(e(a))}catch{}}return null}var H=Array.isArray,C=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T={pending:!1,data:null,method:null,action:null},R=[],v=-1;function M(e){return{current:e}}function I(e){0>v||(e.current=R[v],R[v]=null,v--)}function ee(e,a){v++,R[v]=e.current,e.current=a}var xe=M(null),je=M(null),ve=M(null),ye=M(null);function ge(e,a){switch(ee(ve,a),ee(je,e),ee(xe,null),a.nodeType){case 9:case 11:e=(e=a.documentElement)&&(e=e.namespaceURI)?jg(e):0;break;default:if(e=a.tagName,a=a.namespaceURI)a=jg(a),e=wg(a,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(xe),ee(xe,e)}function be(){I(xe),I(je),I(ve)}function Se(e){e.memoizedState!==null&&ee(ye,e);var a=xe.current,s=wg(a,e.type);a!==s&&(ee(je,e),ee(xe,s))}function Ee(e){je.current===e&&(I(xe),I(je)),ye.current===e&&(I(ye),mi._currentValue=T)}var Ge=Object.prototype.hasOwnProperty,it=r.unstable_scheduleCallback,dt=r.unstable_cancelCallback,st=r.unstable_shouldYield,gt=r.unstable_requestPaint,ce=r.unstable_now,pe=r.unstable_getCurrentPriorityLevel,ie=r.unstable_ImmediatePriority,Re=r.unstable_UserBlockingPriority,we=r.unstable_NormalPriority,ke=r.unstable_LowPriority,ft=r.unstable_IdlePriority,Mt=r.log,qt=r.unstable_setDisableYieldValue,Wt=null,ht=null;function Ut(e){if(typeof Mt=="function"&&qt(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(Wt,e)}catch{}}var Tt=Math.clz32?Math.clz32:Q,Yr=Math.log,us=Math.LN2;function Q(e){return e>>>=0,e===0?32:31-(Yr(e)/us|0)|0}var Ne=256,De=4194304;function Ga(e){var a=e&42;if(a!==0)return a;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function On(e,a,s){var c=e.pendingLanes;if(c===0)return 0;var u=0,m=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var D=c&134217727;return D!==0?(c=D&~m,c!==0?u=Ga(c):(_&=D,_!==0?u=Ga(_):s||(s=D&~e,s!==0&&(u=Ga(s))))):(D=c&~m,D!==0?u=Ga(D):_!==0?u=Ga(_):s||(s=c&~e,s!==0&&(u=Ga(s)))),u===0?0:a!==0&&a!==u&&(a&m)===0&&(m=u&-u,s=a&-a,m>=s||m===32&&(s&4194048)!==0)?a:u}function Xr(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function x1(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function np(){var e=Ne;return Ne<<=1,(Ne&4194048)===0&&(Ne=256),e}function sp(){var e=De;return De<<=1,(De&62914560)===0&&(De=4194304),e}function fd(e){for(var a=[],s=0;31>s;s++)a.push(e);return a}function Sl(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function y1(e,a,s,c,u,m){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var D=e.entanglements,F=e.expirationTimes,J=e.hiddenUpdates;for(s=_&~s;0<s;){var oe=31-Tt(s),me=1<<oe;D[oe]=0,F[oe]=-1;var te=J[oe];if(te!==null)for(J[oe]=null,oe=0;oe<te.length;oe++){var re=te[oe];re!==null&&(re.lane&=-536870913)}s&=~me}c!==0&&lp(e,c,0),m!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=m&~(_&~a))}function lp(e,a,s){e.pendingLanes|=a,e.suspendedLanes&=~a;var c=31-Tt(a);e.entangledLanes|=a,e.entanglements[c]=e.entanglements[c]|1073741824|s&4194090}function ip(e,a){var s=e.entangledLanes|=a;for(e=e.entanglements;s;){var c=31-Tt(s),u=1<<c;u&a|e[c]&a&&(e[c]|=a),s&=~u}}function hd(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pd(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function op(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Ig(e.type))}function b1(e,a){var s=U.p;try{return U.p=e,a()}finally{U.p=s}}var Qr=Math.random().toString(36).slice(2),ua="__reactFiber$"+Qr,ya="__reactProps$"+Qr,fs="__reactContainer$"+Qr,md="__reactEvents$"+Qr,v1="__reactListeners$"+Qr,j1="__reactHandles$"+Qr,cp="__reactResources$"+Qr,_l="__reactMarker$"+Qr;function gd(e){delete e[ua],delete e[ya],delete e[md],delete e[v1],delete e[j1]}function hs(e){var a=e[ua];if(a)return a;for(var s=e.parentNode;s;){if(a=s[fs]||s[ua]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(e=_g(e);e!==null;){if(s=e[ua])return s;e=_g(e)}return a}e=s,s=e.parentNode}return null}function ps(e){if(e=e[ua]||e[fs]){var a=e.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return e}return null}function Tl(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e.stateNode;throw Error(l(33))}function ms(e){var a=e[cp];return a||(a=e[cp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Jt(e){e[_l]=!0}var dp=new Set,up={};function zn(e,a){gs(e,a),gs(e+"Capture",a)}function gs(e,a){for(up[e]=a,e=0;e<a.length;e++)dp.add(a[e])}var w1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),fp={},hp={};function N1(e){return Ge.call(hp,e)?!0:Ge.call(fp,e)?!1:w1.test(e)?hp[e]=!0:(fp[e]=!0,!1)}function Xi(e,a,s){if(N1(a))if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){e.removeAttribute(a);return}}e.setAttribute(a,""+s)}}function Qi(e,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttribute(a,""+s)}}function kr(e,a,s,c){if(c===null)e.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(a,s,""+c)}}var xd,pp;function xs(e){if(xd===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);xd=a&&a[1]||"",pp=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+xd+e+pp}var yd=!1;function bd(e,a){if(!e||yd)return"";yd=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(re){var te=re}Reflect.construct(e,[],me)}else{try{me.call()}catch(re){te=re}e.call(me.prototype)}}else{try{throw Error()}catch(re){te=re}(me=e())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(re){if(re&&te&&typeof re.stack=="string")return[re.stack,te.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=c.DetermineComponentFrameRoot(),_=m[0],D=m[1];if(_&&D){var F=_.split(`
`),J=D.split(`
`);for(u=c=0;c<F.length&&!F[c].includes("DetermineComponentFrameRoot");)c++;for(;u<J.length&&!J[u].includes("DetermineComponentFrameRoot");)u++;if(c===F.length||u===J.length)for(c=F.length-1,u=J.length-1;1<=c&&0<=u&&F[c]!==J[u];)u--;for(;1<=c&&0<=u;c--,u--)if(F[c]!==J[u]){if(c!==1||u!==1)do if(c--,u--,0>u||F[c]!==J[u]){var oe=`
`+F[c].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=c&&0<=u);break}}}finally{yd=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?xs(s):""}function k1(e){switch(e.tag){case 26:case 27:case 5:return xs(e.type);case 16:return xs("Lazy");case 13:return xs("Suspense");case 19:return xs("SuspenseList");case 0:case 15:return bd(e.type,!1);case 11:return bd(e.type.render,!1);case 1:return bd(e.type,!0);case 31:return xs("Activity");default:return""}}function mp(e){try{var a="";do a+=k1(e),e=e.return;while(e);return a}catch(s){return`
Error generating stack: `+s.message+`
`+s.stack}}function Fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gp(e){var a=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function S1(e){var a=gp(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,a),c=""+e[a];if(!e.hasOwnProperty(a)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,m=s.set;return Object.defineProperty(e,a,{configurable:!0,get:function(){return u.call(this)},set:function(_){c=""+_,m.call(this,_)}}),Object.defineProperty(e,a,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(_){c=""+_},stopTracking:function(){e._valueTracker=null,delete e[a]}}}}function Wi(e){e._valueTracker||(e._valueTracker=S1(e))}function xp(e){if(!e)return!1;var a=e._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return e&&(c=gp(e)?e.checked?"true":"false":e.value),e=c,e!==s?(a.setValue(e),!0):!1}function Ji(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _1=/[\n"\\]/g;function Ba(e){return e.replace(_1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function vd(e,a,s,c,u,m,_,D){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),a!=null?_==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+Fa(a)):e.value!==""+Fa(a)&&(e.value=""+Fa(a)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),a!=null?jd(e,_,Fa(a)):s!=null?jd(e,_,Fa(s)):c!=null&&e.removeAttribute("value"),u==null&&m!=null&&(e.defaultChecked=!!m),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.name=""+Fa(D):e.removeAttribute("name")}function yp(e,a,s,c,u,m,_,D){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),a!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||a!=null))return;s=s!=null?""+Fa(s):"",a=a!=null?""+Fa(a):s,D||a===e.value||(e.value=a),e.defaultValue=a}c=c??u,c=typeof c!="function"&&typeof c!="symbol"&&!!c,e.checked=D?e.checked:!!c,e.defaultChecked=!!c,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_)}function jd(e,a,s){a==="number"&&Ji(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function ys(e,a,s,c){if(e=e.options,a){a={};for(var u=0;u<s.length;u++)a["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=a.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&c&&(e[s].defaultSelected=!0)}else{for(s=""+Fa(s),a=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,c&&(e[u].defaultSelected=!0);return}a!==null||e[u].disabled||(a=e[u])}a!==null&&(a.selected=!0)}}function bp(e,a,s){if(a!=null&&(a=""+Fa(a),a!==e.value&&(e.value=a),s==null)){e.defaultValue!==a&&(e.defaultValue=a);return}e.defaultValue=s!=null?""+Fa(s):""}function vp(e,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(l(92));if(H(c)){if(1<c.length)throw Error(l(93));c=c[0]}s=c}s==null&&(s=""),a=s}s=Fa(a),e.defaultValue=s,c=e.textContent,c===s&&c!==""&&c!==null&&(e.value=c)}function bs(e,a){if(a){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=a;return}}e.textContent=a}var T1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function jp(e,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="":c?e.setProperty(a,s):typeof s!="number"||s===0||T1.has(a)?a==="float"?e.cssFloat=s:e[a]=(""+s).trim():e[a]=s+"px"}function wp(e,a,s){if(a!=null&&typeof a!="object")throw Error(l(62));if(e=e.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?e.setProperty(c,""):c==="float"?e.cssFloat="":e[c]="");for(var u in a)c=a[u],a.hasOwnProperty(u)&&s[u]!==c&&jp(e,u,c)}else for(var m in a)a.hasOwnProperty(m)&&jp(e,m,a[m])}function wd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var C1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),E1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function eo(e){return E1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Nd=null;function kd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vs=null,js=null;function Np(e){var a=ps(e);if(a&&(e=a.stateNode)){var s=e[ya]||null;e:switch(e=a.stateNode,a.type){case"input":if(vd(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ba(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==e&&c.form===e.form){var u=c[ya]||null;if(!u)throw Error(l(90));vd(c,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===e.form&&xp(c)}break e;case"textarea":bp(e,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&ys(e,!!s.multiple,a,!1)}}}var Sd=!1;function kp(e,a,s){if(Sd)return e(a,s);Sd=!0;try{var c=e(a);return c}finally{if(Sd=!1,(vs!==null||js!==null)&&(Bo(),vs&&(a=vs,e=js,js=vs=null,Np(a),e)))for(a=0;a<e.length;a++)Np(e[a])}}function Cl(e,a){var s=e.stateNode;if(s===null)return null;var c=s[ya]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,a,typeof s));return s}var Sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_d=!1;if(Sr)try{var El={};Object.defineProperty(El,"passive",{get:function(){_d=!0}}),window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{_d=!1}var Wr=null,Td=null,to=null;function Sp(){if(to)return to;var e,a=Td,s=a.length,c,u="value"in Wr?Wr.value:Wr.textContent,m=u.length;for(e=0;e<s&&a[e]===u[e];e++);var _=s-e;for(c=1;c<=_&&a[s-c]===u[m-c];c++);return to=u.slice(e,1<c?1-c:void 0)}function ao(e){var a=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&a===13&&(e=13)):e=a,e===10&&(e=13),32<=e||e===13?e:0}function ro(){return!0}function _p(){return!1}function ba(e){function a(s,c,u,m,_){this._reactName=s,this._targetInst=u,this.type=c,this.nativeEvent=m,this.target=_,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(s=e[D],this[D]=s?s(m):m[D]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?ro:_p,this.isPropagationStopped=_p,this}return y(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ro)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ro)},persist:function(){},isPersistent:ro}),a}var Ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},no=ba(Ln),Rl=y({},Ln,{view:0,detail:0}),R1=ba(Rl),Cd,Ed,Al,so=y({},Rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,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!==Al&&(Al&&e.type==="mousemove"?(Cd=e.screenX-Al.screenX,Ed=e.screenY-Al.screenY):Ed=Cd=0,Al=e),Cd)},movementY:function(e){return"movementY"in e?e.movementY:Ed}}),Tp=ba(so),A1=y({},so,{dataTransfer:0}),D1=ba(A1),M1=y({},Rl,{relatedTarget:0}),Rd=ba(M1),O1=y({},Ln,{animationName:0,elapsedTime:0,pseudoElement:0}),z1=ba(O1),L1=y({},Ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),U1=ba(L1),G1=y({},Ln,{data:0}),Cp=ba(G1),F1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},B1={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"},I1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function H1(e){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(e):(e=I1[e])?!!a[e]:!1}function Ad(){return H1}var P1=y({},Rl,{key:function(e){if(e.key){var a=F1[e.key]||e.key;if(a!=="Unidentified")return a}return e.type==="keypress"?(e=ao(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?B1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(e){return e.type==="keypress"?ao(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ao(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),q1=ba(P1),$1=y({},so,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ep=ba($1),Z1=y({},Rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),V1=ba(Z1),K1=y({},Ln,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y1=ba(K1),X1=y({},so,{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}),Q1=ba(X1),W1=y({},Ln,{newState:0,oldState:0}),J1=ba(W1),ej=[9,13,27,32],Dd=Sr&&"CompositionEvent"in window,Dl=null;Sr&&"documentMode"in document&&(Dl=document.documentMode);var tj=Sr&&"TextEvent"in window&&!Dl,Rp=Sr&&(!Dd||Dl&&8<Dl&&11>=Dl),Ap=" ",Dp=!1;function Mp(e,a){switch(e){case"keyup":return ej.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Op(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ws=!1;function aj(e,a){switch(e){case"compositionend":return Op(a);case"keypress":return a.which!==32?null:(Dp=!0,Ap);case"textInput":return e=a.data,e===Ap&&Dp?null:e;default:return null}}function rj(e,a){if(ws)return e==="compositionend"||!Dd&&Mp(e,a)?(e=Sp(),to=Td=Wr=null,ws=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Rp&&a.locale!=="ko"?null:a.data;default:return null}}var nj={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 zp(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a==="input"?!!nj[e.type]:a==="textarea"}function Lp(e,a,s,c){vs?js?js.push(c):js=[c]:vs=c,a=Zo(a,"onChange"),0<a.length&&(s=new no("onChange","change",null,s,c),e.push({event:s,listeners:a}))}var Ml=null,Ol=null;function sj(e){gg(e,0)}function lo(e){var a=Tl(e);if(xp(a))return e}function Up(e,a){if(e==="change")return a}var Gp=!1;if(Sr){var Md;if(Sr){var Od="oninput"in document;if(!Od){var Fp=document.createElement("div");Fp.setAttribute("oninput","return;"),Od=typeof Fp.oninput=="function"}Md=Od}else Md=!1;Gp=Md&&(!document.documentMode||9<document.documentMode)}function Bp(){Ml&&(Ml.detachEvent("onpropertychange",Ip),Ol=Ml=null)}function Ip(e){if(e.propertyName==="value"&&lo(Ol)){var a=[];Lp(a,Ol,e,kd(e)),kp(sj,a)}}function lj(e,a,s){e==="focusin"?(Bp(),Ml=a,Ol=s,Ml.attachEvent("onpropertychange",Ip)):e==="focusout"&&Bp()}function ij(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lo(Ol)}function oj(e,a){if(e==="click")return lo(a)}function cj(e,a){if(e==="input"||e==="change")return lo(a)}function dj(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}var Ta=typeof Object.is=="function"?Object.is:dj;function zl(e,a){if(Ta(e,a))return!0;if(typeof e!="object"||e===null||typeof a!="object"||a===null)return!1;var s=Object.keys(e),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var u=s[c];if(!Ge.call(a,u)||!Ta(e[u],a[u]))return!1}return!0}function Hp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pp(e,a){var s=Hp(e);e=0;for(var c;s;){if(s.nodeType===3){if(c=e+s.textContent.length,e<=a&&c>=a)return{node:s,offset:a-e};e=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Hp(s)}}function qp(e,a){return e&&a?e===a?!0:e&&e.nodeType===3?!1:a&&a.nodeType===3?qp(e,a.parentNode):"contains"in e?e.contains(a):e.compareDocumentPosition?!!(e.compareDocumentPosition(a)&16):!1:!1}function $p(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var a=Ji(e.document);a instanceof e.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)e=a.contentWindow;else break;a=Ji(e.document)}return a}function zd(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a&&(a==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||a==="textarea"||e.contentEditable==="true")}var uj=Sr&&"documentMode"in document&&11>=document.documentMode,Ns=null,Ld=null,Ll=null,Ud=!1;function Zp(e,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ud||Ns==null||Ns!==Ji(c)||(c=Ns,"selectionStart"in c&&zd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ll&&zl(Ll,c)||(Ll=c,c=Zo(Ld,"onSelect"),0<c.length&&(a=new no("onSelect","select",null,a,s),e.push({event:a,listeners:c}),a.target=Ns)))}function Un(e,a){var s={};return s[e.toLowerCase()]=a.toLowerCase(),s["Webkit"+e]="webkit"+a,s["Moz"+e]="moz"+a,s}var ks={animationend:Un("Animation","AnimationEnd"),animationiteration:Un("Animation","AnimationIteration"),animationstart:Un("Animation","AnimationStart"),transitionrun:Un("Transition","TransitionRun"),transitionstart:Un("Transition","TransitionStart"),transitioncancel:Un("Transition","TransitionCancel"),transitionend:Un("Transition","TransitionEnd")},Gd={},Vp={};Sr&&(Vp=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Gn(e){if(Gd[e])return Gd[e];if(!ks[e])return e;var a=ks[e],s;for(s in a)if(a.hasOwnProperty(s)&&s in Vp)return Gd[e]=a[s];return e}var Kp=Gn("animationend"),Yp=Gn("animationiteration"),Xp=Gn("animationstart"),fj=Gn("transitionrun"),hj=Gn("transitionstart"),pj=Gn("transitioncancel"),Qp=Gn("transitionend"),Wp=new Map,Fd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Fd.push("scrollEnd");function Ja(e,a){Wp.set(e,a),zn(a,[e])}var Jp=new WeakMap;function Ia(e,a){if(typeof e=="object"&&e!==null){var s=Jp.get(e);return s!==void 0?s:(a={value:e,source:a,stack:mp(a)},Jp.set(e,a),a)}return{value:e,source:a,stack:mp(a)}}var Ha=[],Ss=0,Bd=0;function io(){for(var e=Ss,a=Bd=Ss=0;a<e;){var s=Ha[a];Ha[a++]=null;var c=Ha[a];Ha[a++]=null;var u=Ha[a];Ha[a++]=null;var m=Ha[a];if(Ha[a++]=null,c!==null&&u!==null){var _=c.pending;_===null?u.next=u:(u.next=_.next,_.next=u),c.pending=u}m!==0&&em(s,u,m)}}function oo(e,a,s,c){Ha[Ss++]=e,Ha[Ss++]=a,Ha[Ss++]=s,Ha[Ss++]=c,Bd|=c,e.lanes|=c,e=e.alternate,e!==null&&(e.lanes|=c)}function Id(e,a,s,c){return oo(e,a,s,c),co(e)}function _s(e,a){return oo(e,null,null,a),co(e)}function em(e,a,s){e.lanes|=s;var c=e.alternate;c!==null&&(c.lanes|=s);for(var u=!1,m=e.return;m!==null;)m.childLanes|=s,c=m.alternate,c!==null&&(c.childLanes|=s),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(u=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,u&&a!==null&&(u=31-Tt(s),e=m.hiddenUpdates,c=e[u],c===null?e[u]=[a]:c.push(a),a.lane=s|536870912),m):null}function co(e){if(50<ii)throw ii=0,Vu=null,Error(l(185));for(var a=e.return;a!==null;)e=a,a=e.return;return e.tag===3?e.stateNode:null}var Ts={};function mj(e,a,s,c){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ca(e,a,s,c){return new mj(e,a,s,c)}function Hd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _r(e,a){var s=e.alternate;return s===null?(s=Ca(e.tag,a,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=a,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,a=e.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function tm(e,a){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=a,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,a=s.dependencies,e.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),e}function uo(e,a,s,c,u,m){var _=0;if(c=e,typeof e=="function")Hd(e)&&(_=1);else if(typeof e=="string")_=xw(e,s,xe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=Ca(31,s,a,u),e.elementType=q,e.lanes=m,e;case w:return Fn(s.children,u,m,a);case S:_=8,u|=24;break;case E:return e=Ca(12,s,a,u|2),e.elementType=E,e.lanes=m,e;case B:return e=Ca(13,s,a,u),e.elementType=B,e.lanes=m,e;case V:return e=Ca(19,s,a,u),e.elementType=V,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:case O:_=10;break e;case A:_=9;break e;case L:_=11;break e;case $:_=14;break e;case le:_=16,c=null;break e}_=29,s=Error(l(130,e===null?"null":typeof e,"")),c=null}return a=Ca(_,s,a,u),a.elementType=e,a.type=c,a.lanes=m,a}function Fn(e,a,s,c){return e=Ca(7,e,c,a),e.lanes=s,e}function Pd(e,a,s){return e=Ca(6,e,null,a),e.lanes=s,e}function qd(e,a,s){return a=Ca(4,e.children!==null?e.children:[],e.key,a),a.lanes=s,a.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},a}var Cs=[],Es=0,fo=null,ho=0,Pa=[],qa=0,Bn=null,Tr=1,Cr="";function In(e,a){Cs[Es++]=ho,Cs[Es++]=fo,fo=e,ho=a}function am(e,a,s){Pa[qa++]=Tr,Pa[qa++]=Cr,Pa[qa++]=Bn,Bn=e;var c=Tr;e=Cr;var u=32-Tt(c)-1;c&=~(1<<u),s+=1;var m=32-Tt(a)+u;if(30<m){var _=u-u%5;m=(c&(1<<_)-1).toString(32),c>>=_,u-=_,Tr=1<<32-Tt(a)+u|s<<u|c,Cr=m+e}else Tr=1<<m|s<<u|c,Cr=e}function $d(e){e.return!==null&&(In(e,1),am(e,1,0))}function Zd(e){for(;e===fo;)fo=Cs[--Es],Cs[Es]=null,ho=Cs[--Es],Cs[Es]=null;for(;e===Bn;)Bn=Pa[--qa],Pa[qa]=null,Cr=Pa[--qa],Pa[qa]=null,Tr=Pa[--qa],Pa[qa]=null}var ga=null,Ot=null,ut=!1,Hn=null,ir=!1,Vd=Error(l(519));function Pn(e){var a=Error(l(418,""));throw Fl(Ia(a,e)),Vd}function rm(e){var a=e.stateNode,s=e.type,c=e.memoizedProps;switch(a[ua]=e,a[ya]=c,s){case"dialog":tt("cancel",a),tt("close",a);break;case"iframe":case"object":case"embed":tt("load",a);break;case"video":case"audio":for(s=0;s<ci.length;s++)tt(ci[s],a);break;case"source":tt("error",a);break;case"img":case"image":case"link":tt("error",a),tt("load",a);break;case"details":tt("toggle",a);break;case"input":tt("invalid",a),yp(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),Wi(a);break;case"select":tt("invalid",a);break;case"textarea":tt("invalid",a),vp(a,c.value,c.defaultValue,c.children),Wi(a)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||vg(a.textContent,s)?(c.popover!=null&&(tt("beforetoggle",a),tt("toggle",a)),c.onScroll!=null&&tt("scroll",a),c.onScrollEnd!=null&&tt("scrollend",a),c.onClick!=null&&(a.onclick=Vo),a=!0):a=!1,a||Pn(e)}function nm(e){for(ga=e.return;ga;)switch(ga.tag){case 5:case 13:ir=!1;return;case 27:case 3:ir=!0;return;default:ga=ga.return}}function Ul(e){if(e!==ga)return!1;if(!ut)return nm(e),ut=!0,!1;var a=e.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||df(e.type,e.memoizedProps)),s=!s),s&&Ot&&Pn(e),nm(e),a===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));e:{for(e=e.nextSibling,a=0;e;){if(e.nodeType===8)if(s=e.data,s==="/$"){if(a===0){Ot=tr(e.nextSibling);break e}a--}else s!=="$"&&s!=="$!"&&s!=="$?"||a++;e=e.nextSibling}Ot=null}}else a===27?(a=Ot,mn(e.type)?(e=pf,pf=null,Ot=e):Ot=a):Ot=ga?tr(e.stateNode.nextSibling):null;return!0}function Gl(){Ot=ga=null,ut=!1}function sm(){var e=Hn;return e!==null&&(wa===null?wa=e:wa.push.apply(wa,e),Hn=null),e}function Fl(e){Hn===null?Hn=[e]:Hn.push(e)}var Kd=M(null),qn=null,Er=null;function Jr(e,a,s){ee(Kd,a._currentValue),a._currentValue=s}function Rr(e){e._currentValue=Kd.current,I(Kd)}function Yd(e,a,s){for(;e!==null;){var c=e.alternate;if((e.childLanes&a)!==a?(e.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),e===s)break;e=e.return}}function Xd(e,a,s,c){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var m=u.dependencies;if(m!==null){var _=u.child;m=m.firstContext;e:for(;m!==null;){var D=m;m=u;for(var F=0;F<a.length;F++)if(D.context===a[F]){m.lanes|=s,D=m.alternate,D!==null&&(D.lanes|=s),Yd(m.return,s,e),c||(_=null);break e}m=D.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(l(341));_.lanes|=s,m=_.alternate,m!==null&&(m.lanes|=s),Yd(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function Bl(e,a,s,c){e=null;for(var u=a,m=!1;u!==null;){if(!m){if((u.flags&524288)!==0)m=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(l(387));if(_=_.memoizedProps,_!==null){var D=u.type;Ta(u.pendingProps.value,_.value)||(e!==null?e.push(D):e=[D])}}else if(u===ye.current){if(_=u.alternate,_===null)throw Error(l(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(mi):e=[mi])}u=u.return}e!==null&&Xd(a,e,s,c),a.flags|=262144}function po(e){for(e=e.firstContext;e!==null;){if(!Ta(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $n(e){qn=e,Er=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function fa(e){return lm(qn,e)}function mo(e,a){return qn===null&&$n(e),lm(e,a)}function lm(e,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Er===null){if(e===null)throw Error(l(308));Er=a,e.dependencies={lanes:0,firstContext:a},e.flags|=524288}else Er=Er.next=a;return s}var gj=typeof AbortController<"u"?AbortController:function(){var e=[],a=this.signal={aborted:!1,addEventListener:function(s,c){e.push(c)}};this.abort=function(){a.aborted=!0,e.forEach(function(s){return s()})}},xj=r.unstable_scheduleCallback,yj=r.unstable_NormalPriority,$t={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qd(){return{controller:new gj,data:new Map,refCount:0}}function Il(e){e.refCount--,e.refCount===0&&xj(yj,function(){e.controller.abort()})}var Hl=null,Wd=0,Rs=0,As=null;function bj(e,a){if(Hl===null){var s=Hl=[];Wd=0,Rs=ef(),As={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Wd++,a.then(im,im),a}function im(){if(--Wd===0&&Hl!==null){As!==null&&(As.status="fulfilled");var e=Hl;Hl=null,Rs=0,As=null;for(var a=0;a<e.length;a++)(0,e[a])()}}function vj(e,a){var s=[],c={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){c.status="fulfilled",c.value=a;for(var u=0;u<s.length;u++)(0,s[u])(a)},function(u){for(c.status="rejected",c.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),c}var om=C.S;C.S=function(e,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&bj(e,a),om!==null&&om(e,a)};var Zn=M(null);function Jd(){var e=Zn.current;return e!==null?e:Nt.pooledCache}function go(e,a){a===null?ee(Zn,Zn.current):ee(Zn,a.pool)}function cm(){var e=Jd();return e===null?null:{parent:$t._currentValue,pool:e}}var Pl=Error(l(460)),dm=Error(l(474)),xo=Error(l(542)),eu={then:function(){}};function um(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yo(){}function fm(e,a,s){switch(s=e[s],s===void 0?e.push(a):s!==a&&(a.then(yo,yo),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,pm(e),e;default:if(typeof a.status=="string")a.then(yo,yo);else{if(e=Nt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=a,e.status="pending",e.then(function(c){if(a.status==="pending"){var u=a;u.status="fulfilled",u.value=c}},function(c){if(a.status==="pending"){var u=a;u.status="rejected",u.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,pm(e),e}throw ql=a,Pl}}var ql=null;function hm(){if(ql===null)throw Error(l(459));var e=ql;return ql=null,e}function pm(e){if(e===Pl||e===xo)throw Error(l(483))}var en=!1;function tu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function au(e,a){e=e.updateQueue,a.updateQueue===e&&(a.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function tn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function an(e,a,s){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(pt&2)!==0){var u=c.pending;return u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a,a=co(e),em(e,null,s),a}return oo(e,c,a,s),co(e)}function $l(e,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=e.pendingLanes,s|=c,a.lanes=s,ip(e,s)}}function ru(e,a){var s=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var u=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?u=m=_:m=m.next=_,s=s.next}while(s!==null);m===null?u=m=a:m=m.next=a}else u=m=a;s={baseState:c.baseState,firstBaseUpdate:u,lastBaseUpdate:m,shared:c.shared,callbacks:c.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=a:e.next=a,s.lastBaseUpdate=a}var nu=!1;function Zl(){if(nu){var e=As;if(e!==null)throw e}}function Vl(e,a,s,c){nu=!1;var u=e.updateQueue;en=!1;var m=u.firstBaseUpdate,_=u.lastBaseUpdate,D=u.shared.pending;if(D!==null){u.shared.pending=null;var F=D,J=F.next;F.next=null,_===null?m=J:_.next=J,_=F;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,D=oe.lastBaseUpdate,D!==_&&(D===null?oe.firstBaseUpdate=J:D.next=J,oe.lastBaseUpdate=F))}if(m!==null){var me=u.baseState;_=0,oe=J=F=null,D=m;do{var te=D.lane&-536870913,re=te!==D.lane;if(re?(ot&te)===te:(c&te)===te){te!==0&&te===Rs&&(nu=!0),oe!==null&&(oe=oe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Ie=e,Fe=D;te=a;var bt=s;switch(Fe.tag){case 1:if(Ie=Fe.payload,typeof Ie=="function"){me=Ie.call(bt,me,te);break e}me=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Fe.payload,te=typeof Ie=="function"?Ie.call(bt,me,te):Ie,te==null)break e;me=y({},me,te);break e;case 2:en=!0}}te=D.callback,te!==null&&(e.flags|=64,re&&(e.flags|=8192),re=u.callbacks,re===null?u.callbacks=[te]:re.push(te))}else re={lane:te,tag:D.tag,payload:D.payload,callback:D.callback,next:null},oe===null?(J=oe=re,F=me):oe=oe.next=re,_|=te;if(D=D.next,D===null){if(D=u.shared.pending,D===null)break;re=D,D=re.next,re.next=null,u.lastBaseUpdate=re,u.shared.pending=null}}while(!0);oe===null&&(F=me),u.baseState=F,u.firstBaseUpdate=J,u.lastBaseUpdate=oe,m===null&&(u.shared.lanes=0),un|=_,e.lanes=_,e.memoizedState=me}}function mm(e,a){if(typeof e!="function")throw Error(l(191,e));e.call(a)}function gm(e,a){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)mm(s[e],a)}var Ds=M(null),bo=M(0);function xm(e,a){e=Ur,ee(bo,e),ee(Ds,a),Ur=e|a.baseLanes}function su(){ee(bo,Ur),ee(Ds,Ds.current)}function lu(){Ur=bo.current,I(Ds),I(bo)}var rn=0,Ye=null,xt=null,Bt=null,vo=!1,Ms=!1,Vn=!1,jo=0,Kl=0,Os=null,jj=0;function Gt(){throw Error(l(321))}function iu(e,a){if(a===null)return!1;for(var s=0;s<a.length&&s<e.length;s++)if(!Ta(e[s],a[s]))return!1;return!0}function ou(e,a,s,c,u,m){return rn=m,Ye=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,C.H=e===null||e.memoizedState===null?e0:t0,Vn=!1,m=s(c,u),Vn=!1,Ms&&(m=bm(a,s,c,u)),ym(e),m}function ym(e){C.H=To;var a=xt!==null&&xt.next!==null;if(rn=0,Bt=xt=Ye=null,vo=!1,Kl=0,Os=null,a)throw Error(l(300));e===null||ea||(e=e.dependencies,e!==null&&po(e)&&(ea=!0))}function bm(e,a,s,c){Ye=e;var u=0;do{if(Ms&&(Os=null),Kl=0,Ms=!1,25<=u)throw Error(l(301));if(u+=1,Bt=xt=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}C.H=Cj,m=a(s,c)}while(Ms);return m}function wj(){var e=C.H,a=e.useState()[0];return a=typeof a.then=="function"?Yl(a):a,e=e.useState()[0],(xt!==null?xt.memoizedState:null)!==e&&(Ye.flags|=1024),a}function cu(){var e=jo!==0;return jo=0,e}function du(e,a,s){a.updateQueue=e.updateQueue,a.flags&=-2053,e.lanes&=~s}function uu(e){if(vo){for(e=e.memoizedState;e!==null;){var a=e.queue;a!==null&&(a.pending=null),e=e.next}vo=!1}rn=0,Bt=xt=Ye=null,Ms=!1,Kl=jo=0,Os=null}function va(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ye.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function It(){if(xt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=xt.next;var a=Bt===null?Ye.memoizedState:Bt.next;if(a!==null)Bt=a,xt=e;else{if(e===null)throw Ye.alternate===null?Error(l(467)):Error(l(310));xt=e,e={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Bt===null?Ye.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function fu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yl(e){var a=Kl;return Kl+=1,Os===null&&(Os=[]),e=fm(Os,e,a),a=Ye,(Bt===null?a.memoizedState:Bt.next)===null&&(a=a.alternate,C.H=a===null||a.memoizedState===null?e0:t0),e}function wo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yl(e);if(e.$$typeof===O)return fa(e)}throw Error(l(438,String(e)))}function hu(e){var a=null,s=Ye.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Ye.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(u){return u.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=fu(),Ye.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(e),c=0;c<e;c++)s[c]=K;return a.index++,s}function Ar(e,a){return typeof a=="function"?a(e):a}function No(e){var a=It();return pu(a,xt,e)}function pu(e,a,s){var c=e.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=s;var u=e.baseQueue,m=c.pending;if(m!==null){if(u!==null){var _=u.next;u.next=m.next,m.next=_}a.baseQueue=u=m,c.pending=null}if(m=e.baseState,u===null)e.memoizedState=m;else{a=u.next;var D=_=null,F=null,J=a,oe=!1;do{var me=J.lane&-536870913;if(me!==J.lane?(ot&me)===me:(rn&me)===me){var te=J.revertLane;if(te===0)F!==null&&(F=F.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),me===Rs&&(oe=!0);else if((rn&te)===te){J=J.next,te===Rs&&(oe=!0);continue}else me={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},F===null?(D=F=me,_=m):F=F.next=me,Ye.lanes|=te,un|=te;me=J.action,Vn&&s(m,me),m=J.hasEagerState?J.eagerState:s(m,me)}else te={lane:me,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},F===null?(D=F=te,_=m):F=F.next=te,Ye.lanes|=me,un|=me;J=J.next}while(J!==null&&J!==a);if(F===null?_=m:F.next=D,!Ta(m,e.memoizedState)&&(ea=!0,oe&&(s=As,s!==null)))throw s;e.memoizedState=m,e.baseState=_,e.baseQueue=F,c.lastRenderedState=m}return u===null&&(c.lanes=0),[e.memoizedState,c.dispatch]}function mu(e){var a=It(),s=a.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var c=s.dispatch,u=s.pending,m=a.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do m=e(m,_.action),_=_.next;while(_!==u);Ta(m,a.memoizedState)||(ea=!0),a.memoizedState=m,a.baseQueue===null&&(a.baseState=m),s.lastRenderedState=m}return[m,c]}function vm(e,a,s){var c=Ye,u=It(),m=ut;if(m){if(s===void 0)throw Error(l(407));s=s()}else s=a();var _=!Ta((xt||u).memoizedState,s);_&&(u.memoizedState=s,ea=!0),u=u.queue;var D=Nm.bind(null,c,u,e);if(Xl(2048,8,D,[e]),u.getSnapshot!==a||_||Bt!==null&&Bt.memoizedState.tag&1){if(c.flags|=2048,zs(9,ko(),wm.bind(null,c,u,s,a),null),Nt===null)throw Error(l(349));m||(rn&124)!==0||jm(c,a,s)}return s}function jm(e,a,s){e.flags|=16384,e={getSnapshot:a,value:s},a=Ye.updateQueue,a===null?(a=fu(),Ye.updateQueue=a,a.stores=[e]):(s=a.stores,s===null?a.stores=[e]:s.push(e))}function wm(e,a,s,c){a.value=s,a.getSnapshot=c,km(a)&&Sm(e)}function Nm(e,a,s){return s(function(){km(a)&&Sm(e)})}function km(e){var a=e.getSnapshot;e=e.value;try{var s=a();return!Ta(e,s)}catch{return!0}}function Sm(e){var a=_s(e,2);a!==null&&Ma(a,e,2)}function gu(e){var a=va();if(typeof e=="function"){var s=e;if(e=s(),Vn){Ut(!0);try{s()}finally{Ut(!1)}}}return a.memoizedState=a.baseState=e,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ar,lastRenderedState:e},a}function _m(e,a,s,c){return e.baseState=s,pu(e,xt,typeof c=="function"?c:Ar)}function Nj(e,a,s,c,u){if(_o(e))throw Error(l(485));if(e=a.action,e!==null){var m={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){m.listeners.push(_)}};C.T!==null?s(!0):m.isTransition=!1,c(m),s=a.pending,s===null?(m.next=a.pending=m,Tm(a,m)):(m.next=s.next,a.pending=s.next=m)}}function Tm(e,a){var s=a.action,c=a.payload,u=e.state;if(a.isTransition){var m=C.T,_={};C.T=_;try{var D=s(u,c),F=C.S;F!==null&&F(_,D),Cm(e,a,D)}catch(J){xu(e,a,J)}finally{C.T=m}}else try{m=s(u,c),Cm(e,a,m)}catch(J){xu(e,a,J)}}function Cm(e,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Em(e,a,c)},function(c){return xu(e,a,c)}):Em(e,a,s)}function Em(e,a,s){a.status="fulfilled",a.value=s,Rm(a),e.state=s,a=e.pending,a!==null&&(s=a.next,s===a?e.pending=null:(s=s.next,a.next=s,Tm(e,s)))}function xu(e,a,s){var c=e.pending;if(e.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,Rm(a),a=a.next;while(a!==c)}e.action=null}function Rm(e){e=e.listeners;for(var a=0;a<e.length;a++)(0,e[a])()}function Am(e,a){return a}function Dm(e,a){if(ut){var s=Nt.formState;if(s!==null){e:{var c=Ye;if(ut){if(Ot){t:{for(var u=Ot,m=ir;u.nodeType!==8;){if(!m){u=null;break t}if(u=tr(u.nextSibling),u===null){u=null;break t}}m=u.data,u=m==="F!"||m==="F"?u:null}if(u){Ot=tr(u.nextSibling),c=u.data==="F!";break e}}Pn(c)}c=!1}c&&(a=s[0])}}return s=va(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Am,lastRenderedState:a},s.queue=c,s=Qm.bind(null,Ye,c),c.dispatch=s,c=gu(!1),m=wu.bind(null,Ye,!1,c.queue),c=va(),u={state:a,dispatch:null,action:e,pending:null},c.queue=u,s=Nj.bind(null,Ye,u,m,s),u.dispatch=s,c.memoizedState=e,[a,s,!1]}function Mm(e){var a=It();return Om(a,xt,e)}function Om(e,a,s){if(a=pu(e,a,Am)[0],e=No(Ar)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=Yl(a)}catch(_){throw _===Pl?xo:_}else c=a;a=It();var u=a.queue,m=u.dispatch;return s!==a.memoizedState&&(Ye.flags|=2048,zs(9,ko(),kj.bind(null,u,s),null)),[c,m,e]}function kj(e,a){e.action=a}function zm(e){var a=It(),s=xt;if(s!==null)return Om(a,s,e);It(),a=a.memoizedState,s=It();var c=s.queue.dispatch;return s.memoizedState=e,[a,c,!1]}function zs(e,a,s,c){return e={tag:e,create:s,deps:c,inst:a,next:null},a=Ye.updateQueue,a===null&&(a=fu(),Ye.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=e.next=e:(c=s.next,s.next=e,e.next=c,a.lastEffect=e),e}function ko(){return{destroy:void 0,resource:void 0}}function Lm(){return It().memoizedState}function So(e,a,s,c){var u=va();c=c===void 0?null:c,Ye.flags|=e,u.memoizedState=zs(1|a,ko(),s,c)}function Xl(e,a,s,c){var u=It();c=c===void 0?null:c;var m=u.memoizedState.inst;xt!==null&&c!==null&&iu(c,xt.memoizedState.deps)?u.memoizedState=zs(a,m,s,c):(Ye.flags|=e,u.memoizedState=zs(1|a,m,s,c))}function Um(e,a){So(8390656,8,e,a)}function Gm(e,a){Xl(2048,8,e,a)}function Fm(e,a){return Xl(4,2,e,a)}function Bm(e,a){return Xl(4,4,e,a)}function Im(e,a){if(typeof a=="function"){e=e();var s=a(e);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return e=e(),a.current=e,function(){a.current=null}}function Hm(e,a,s){s=s!=null?s.concat([e]):null,Xl(4,4,Im.bind(null,a,e),s)}function yu(){}function Pm(e,a){var s=It();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&iu(a,c[1])?c[0]:(s.memoizedState=[e,a],e)}function qm(e,a){var s=It();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&iu(a,c[1]))return c[0];if(c=e(),Vn){Ut(!0);try{e()}finally{Ut(!1)}}return s.memoizedState=[c,a],c}function bu(e,a,s){return s===void 0||(rn&1073741824)!==0?e.memoizedState=a:(e.memoizedState=s,e=V0(),Ye.lanes|=e,un|=e,s)}function $m(e,a,s,c){return Ta(s,a)?s:Ds.current!==null?(e=bu(e,s,c),Ta(e,a)||(ea=!0),e):(rn&42)===0?(ea=!0,e.memoizedState=s):(e=V0(),Ye.lanes|=e,un|=e,a)}function Zm(e,a,s,c,u){var m=U.p;U.p=m!==0&&8>m?m:8;var _=C.T,D={};C.T=D,wu(e,!1,a,s);try{var F=u(),J=C.S;if(J!==null&&J(D,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var oe=vj(F,c);Ql(e,a,oe,Da(e))}else Ql(e,a,c,Da(e))}catch(me){Ql(e,a,{then:function(){},status:"rejected",reason:me},Da())}finally{U.p=m,C.T=_}}function Sj(){}function vu(e,a,s,c){if(e.tag!==5)throw Error(l(476));var u=Vm(e).queue;Zm(e,u,a,T,s===null?Sj:function(){return Km(e),s(c)})}function Vm(e){var a=e.memoizedState;if(a!==null)return a;a={memoizedState:T,baseState:T,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ar,lastRenderedState:T},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ar,lastRenderedState:s},next:null},e.memoizedState=a,e=e.alternate,e!==null&&(e.memoizedState=a),a}function Km(e){var a=Vm(e).next.queue;Ql(e,a,{},Da())}function ju(){return fa(mi)}function Ym(){return It().memoizedState}function Xm(){return It().memoizedState}function _j(e){for(var a=e.return;a!==null;){switch(a.tag){case 24:case 3:var s=Da();e=tn(s);var c=an(a,e,s);c!==null&&(Ma(c,a,s),$l(c,a,s)),a={cache:Qd()},e.payload=a;return}a=a.return}}function Tj(e,a,s){var c=Da();s={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},_o(e)?Wm(a,s):(s=Id(e,a,s,c),s!==null&&(Ma(s,e,c),Jm(s,a,c)))}function Qm(e,a,s){var c=Da();Ql(e,a,s,c)}function Ql(e,a,s,c){var u={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(_o(e))Wm(a,u);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=a.lastRenderedReducer,m!==null))try{var _=a.lastRenderedState,D=m(_,s);if(u.hasEagerState=!0,u.eagerState=D,Ta(D,_))return oo(e,a,u,0),Nt===null&&io(),!1}catch{}finally{}if(s=Id(e,a,u,c),s!==null)return Ma(s,e,c),Jm(s,a,c),!0}return!1}function wu(e,a,s,c){if(c={lane:2,revertLane:ef(),action:c,hasEagerState:!1,eagerState:null,next:null},_o(e)){if(a)throw Error(l(479))}else a=Id(e,s,c,2),a!==null&&Ma(a,e,2)}function _o(e){var a=e.alternate;return e===Ye||a!==null&&a===Ye}function Wm(e,a){Ms=vo=!0;var s=e.pending;s===null?a.next=a:(a.next=s.next,s.next=a),e.pending=a}function Jm(e,a,s){if((s&4194048)!==0){var c=a.lanes;c&=e.pendingLanes,s|=c,a.lanes=s,ip(e,s)}}var To={readContext:fa,use:wo,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt},e0={readContext:fa,use:wo,useCallback:function(e,a){return va().memoizedState=[e,a===void 0?null:a],e},useContext:fa,useEffect:Um,useImperativeHandle:function(e,a,s){s=s!=null?s.concat([e]):null,So(4194308,4,Im.bind(null,a,e),s)},useLayoutEffect:function(e,a){return So(4194308,4,e,a)},useInsertionEffect:function(e,a){So(4,2,e,a)},useMemo:function(e,a){var s=va();a=a===void 0?null:a;var c=e();if(Vn){Ut(!0);try{e()}finally{Ut(!1)}}return s.memoizedState=[c,a],c},useReducer:function(e,a,s){var c=va();if(s!==void 0){var u=s(a);if(Vn){Ut(!0);try{s(a)}finally{Ut(!1)}}}else u=a;return c.memoizedState=c.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},c.queue=e,e=e.dispatch=Tj.bind(null,Ye,e),[c.memoizedState,e]},useRef:function(e){var a=va();return e={current:e},a.memoizedState=e},useState:function(e){e=gu(e);var a=e.queue,s=Qm.bind(null,Ye,a);return a.dispatch=s,[e.memoizedState,s]},useDebugValue:yu,useDeferredValue:function(e,a){var s=va();return bu(s,e,a)},useTransition:function(){var e=gu(!1);return e=Zm.bind(null,Ye,e.queue,!0,!1),va().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,a,s){var c=Ye,u=va();if(ut){if(s===void 0)throw Error(l(407));s=s()}else{if(s=a(),Nt===null)throw Error(l(349));(ot&124)!==0||jm(c,a,s)}u.memoizedState=s;var m={value:s,getSnapshot:a};return u.queue=m,Um(Nm.bind(null,c,m,e),[e]),c.flags|=2048,zs(9,ko(),wm.bind(null,c,m,s,a),null),s},useId:function(){var e=va(),a=Nt.identifierPrefix;if(ut){var s=Cr,c=Tr;s=(c&~(1<<32-Tt(c)-1)).toString(32)+s,a="«"+a+"R"+s,s=jo++,0<s&&(a+="H"+s.toString(32)),a+="»"}else s=jj++,a="«"+a+"r"+s.toString(32)+"»";return e.memoizedState=a},useHostTransitionStatus:ju,useFormState:Dm,useActionState:Dm,useOptimistic:function(e){var a=va();a.memoizedState=a.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=wu.bind(null,Ye,!0,s),s.dispatch=a,[e,a]},useMemoCache:hu,useCacheRefresh:function(){return va().memoizedState=_j.bind(null,Ye)}},t0={readContext:fa,use:wo,useCallback:Pm,useContext:fa,useEffect:Gm,useImperativeHandle:Hm,useInsertionEffect:Fm,useLayoutEffect:Bm,useMemo:qm,useReducer:No,useRef:Lm,useState:function(){return No(Ar)},useDebugValue:yu,useDeferredValue:function(e,a){var s=It();return $m(s,xt.memoizedState,e,a)},useTransition:function(){var e=No(Ar)[0],a=It().memoizedState;return[typeof e=="boolean"?e:Yl(e),a]},useSyncExternalStore:vm,useId:Ym,useHostTransitionStatus:ju,useFormState:Mm,useActionState:Mm,useOptimistic:function(e,a){var s=It();return _m(s,xt,e,a)},useMemoCache:hu,useCacheRefresh:Xm},Cj={readContext:fa,use:wo,useCallback:Pm,useContext:fa,useEffect:Gm,useImperativeHandle:Hm,useInsertionEffect:Fm,useLayoutEffect:Bm,useMemo:qm,useReducer:mu,useRef:Lm,useState:function(){return mu(Ar)},useDebugValue:yu,useDeferredValue:function(e,a){var s=It();return xt===null?bu(s,e,a):$m(s,xt.memoizedState,e,a)},useTransition:function(){var e=mu(Ar)[0],a=It().memoizedState;return[typeof e=="boolean"?e:Yl(e),a]},useSyncExternalStore:vm,useId:Ym,useHostTransitionStatus:ju,useFormState:zm,useActionState:zm,useOptimistic:function(e,a){var s=It();return xt!==null?_m(s,xt,e,a):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:hu,useCacheRefresh:Xm},Ls=null,Wl=0;function Co(e){var a=Wl;return Wl+=1,Ls===null&&(Ls=[]),fm(Ls,e,a)}function Jl(e,a){a=a.props.ref,e.ref=a!==void 0?a:null}function Eo(e,a){throw a.$$typeof===b?Error(l(525)):(e=Object.prototype.toString.call(a),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":e)))}function a0(e){var a=e._init;return a(e._payload)}function r0(e){function a(Y,P){if(e){var W=Y.deletions;W===null?(Y.deletions=[P],Y.flags|=16):W.push(P)}}function s(Y,P){if(!e)return null;for(;P!==null;)a(Y,P),P=P.sibling;return null}function c(Y){for(var P=new Map;Y!==null;)Y.key!==null?P.set(Y.key,Y):P.set(Y.index,Y),Y=Y.sibling;return P}function u(Y,P){return Y=_r(Y,P),Y.index=0,Y.sibling=null,Y}function m(Y,P,W){return Y.index=W,e?(W=Y.alternate,W!==null?(W=W.index,W<P?(Y.flags|=67108866,P):W):(Y.flags|=67108866,P)):(Y.flags|=1048576,P)}function _(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function D(Y,P,W,de){return P===null||P.tag!==6?(P=Pd(W,Y.mode,de),P.return=Y,P):(P=u(P,W),P.return=Y,P)}function F(Y,P,W,de){var Ae=W.type;return Ae===w?oe(Y,P,W.props.children,de,W.key):P!==null&&(P.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===le&&a0(Ae)===P.type)?(P=u(P,W.props),Jl(P,W),P.return=Y,P):(P=uo(W.type,W.key,W.props,null,Y.mode,de),Jl(P,W),P.return=Y,P)}function J(Y,P,W,de){return P===null||P.tag!==4||P.stateNode.containerInfo!==W.containerInfo||P.stateNode.implementation!==W.implementation?(P=qd(W,Y.mode,de),P.return=Y,P):(P=u(P,W.children||[]),P.return=Y,P)}function oe(Y,P,W,de,Ae){return P===null||P.tag!==7?(P=Fn(W,Y.mode,de,Ae),P.return=Y,P):(P=u(P,W),P.return=Y,P)}function me(Y,P,W){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Pd(""+P,Y.mode,W),P.return=Y,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case j:return W=uo(P.type,P.key,P.props,null,Y.mode,W),Jl(W,P),W.return=Y,W;case N:return P=qd(P,Y.mode,W),P.return=Y,P;case le:var de=P._init;return P=de(P._payload),me(Y,P,W)}if(H(P)||G(P))return P=Fn(P,Y.mode,W,null),P.return=Y,P;if(typeof P.then=="function")return me(Y,Co(P),W);if(P.$$typeof===O)return me(Y,mo(Y,P),W);Eo(Y,P)}return null}function te(Y,P,W,de){var Ae=P!==null?P.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ae!==null?null:D(Y,P,""+W,de);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case j:return W.key===Ae?F(Y,P,W,de):null;case N:return W.key===Ae?J(Y,P,W,de):null;case le:return Ae=W._init,W=Ae(W._payload),te(Y,P,W,de)}if(H(W)||G(W))return Ae!==null?null:oe(Y,P,W,de,null);if(typeof W.then=="function")return te(Y,P,Co(W),de);if(W.$$typeof===O)return te(Y,P,mo(Y,W),de);Eo(Y,W)}return null}function re(Y,P,W,de,Ae){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Y=Y.get(W)||null,D(P,Y,""+de,Ae);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case j:return Y=Y.get(de.key===null?W:de.key)||null,F(P,Y,de,Ae);case N:return Y=Y.get(de.key===null?W:de.key)||null,J(P,Y,de,Ae);case le:var We=de._init;return de=We(de._payload),re(Y,P,W,de,Ae)}if(H(de)||G(de))return Y=Y.get(W)||null,oe(P,Y,de,Ae,null);if(typeof de.then=="function")return re(Y,P,W,Co(de),Ae);if(de.$$typeof===O)return re(Y,P,W,mo(P,de),Ae);Eo(P,de)}return null}function Ie(Y,P,W,de){for(var Ae=null,We=null,Oe=P,Be=P=0,aa=null;Oe!==null&&Be<W.length;Be++){Oe.index>Be?(aa=Oe,Oe=null):aa=Oe.sibling;var ct=te(Y,Oe,W[Be],de);if(ct===null){Oe===null&&(Oe=aa);break}e&&Oe&&ct.alternate===null&&a(Y,Oe),P=m(ct,P,Be),We===null?Ae=ct:We.sibling=ct,We=ct,Oe=aa}if(Be===W.length)return s(Y,Oe),ut&&In(Y,Be),Ae;if(Oe===null){for(;Be<W.length;Be++)Oe=me(Y,W[Be],de),Oe!==null&&(P=m(Oe,P,Be),We===null?Ae=Oe:We.sibling=Oe,We=Oe);return ut&&In(Y,Be),Ae}for(Oe=c(Oe);Be<W.length;Be++)aa=re(Oe,Y,Be,W[Be],de),aa!==null&&(e&&aa.alternate!==null&&Oe.delete(aa.key===null?Be:aa.key),P=m(aa,P,Be),We===null?Ae=aa:We.sibling=aa,We=aa);return e&&Oe.forEach(function(vn){return a(Y,vn)}),ut&&In(Y,Be),Ae}function Fe(Y,P,W,de){if(W==null)throw Error(l(151));for(var Ae=null,We=null,Oe=P,Be=P=0,aa=null,ct=W.next();Oe!==null&&!ct.done;Be++,ct=W.next()){Oe.index>Be?(aa=Oe,Oe=null):aa=Oe.sibling;var vn=te(Y,Oe,ct.value,de);if(vn===null){Oe===null&&(Oe=aa);break}e&&Oe&&vn.alternate===null&&a(Y,Oe),P=m(vn,P,Be),We===null?Ae=vn:We.sibling=vn,We=vn,Oe=aa}if(ct.done)return s(Y,Oe),ut&&In(Y,Be),Ae;if(Oe===null){for(;!ct.done;Be++,ct=W.next())ct=me(Y,ct.value,de),ct!==null&&(P=m(ct,P,Be),We===null?Ae=ct:We.sibling=ct,We=ct);return ut&&In(Y,Be),Ae}for(Oe=c(Oe);!ct.done;Be++,ct=W.next())ct=re(Oe,Y,Be,ct.value,de),ct!==null&&(e&&ct.alternate!==null&&Oe.delete(ct.key===null?Be:ct.key),P=m(ct,P,Be),We===null?Ae=ct:We.sibling=ct,We=ct);return e&&Oe.forEach(function(Ew){return a(Y,Ew)}),ut&&In(Y,Be),Ae}function bt(Y,P,W,de){if(typeof W=="object"&&W!==null&&W.type===w&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case j:e:{for(var Ae=W.key;P!==null;){if(P.key===Ae){if(Ae=W.type,Ae===w){if(P.tag===7){s(Y,P.sibling),de=u(P,W.props.children),de.return=Y,Y=de;break e}}else if(P.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===le&&a0(Ae)===P.type){s(Y,P.sibling),de=u(P,W.props),Jl(de,W),de.return=Y,Y=de;break e}s(Y,P);break}else a(Y,P);P=P.sibling}W.type===w?(de=Fn(W.props.children,Y.mode,de,W.key),de.return=Y,Y=de):(de=uo(W.type,W.key,W.props,null,Y.mode,de),Jl(de,W),de.return=Y,Y=de)}return _(Y);case N:e:{for(Ae=W.key;P!==null;){if(P.key===Ae)if(P.tag===4&&P.stateNode.containerInfo===W.containerInfo&&P.stateNode.implementation===W.implementation){s(Y,P.sibling),de=u(P,W.children||[]),de.return=Y,Y=de;break e}else{s(Y,P);break}else a(Y,P);P=P.sibling}de=qd(W,Y.mode,de),de.return=Y,Y=de}return _(Y);case le:return Ae=W._init,W=Ae(W._payload),bt(Y,P,W,de)}if(H(W))return Ie(Y,P,W,de);if(G(W)){if(Ae=G(W),typeof Ae!="function")throw Error(l(150));return W=Ae.call(W),Fe(Y,P,W,de)}if(typeof W.then=="function")return bt(Y,P,Co(W),de);if(W.$$typeof===O)return bt(Y,P,mo(Y,W),de);Eo(Y,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,P!==null&&P.tag===6?(s(Y,P.sibling),de=u(P,W),de.return=Y,Y=de):(s(Y,P),de=Pd(W,Y.mode,de),de.return=Y,Y=de),_(Y)):s(Y,P)}return function(Y,P,W,de){try{Wl=0;var Ae=bt(Y,P,W,de);return Ls=null,Ae}catch(Oe){if(Oe===Pl||Oe===xo)throw Oe;var We=Ca(29,Oe,null,Y.mode);return We.lanes=de,We.return=Y,We}finally{}}}var Us=r0(!0),n0=r0(!1),$a=M(null),or=null;function nn(e){var a=e.alternate;ee(Zt,Zt.current&1),ee($a,e),or===null&&(a===null||Ds.current!==null||a.memoizedState!==null)&&(or=e)}function s0(e){if(e.tag===22){if(ee(Zt,Zt.current),ee($a,e),or===null){var a=e.alternate;a!==null&&a.memoizedState!==null&&(or=e)}}else sn()}function sn(){ee(Zt,Zt.current),ee($a,$a.current)}function Dr(e){I($a),or===e&&(or=null),I(Zt)}var Zt=M(0);function Ro(e){for(var a=e;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||hf(s)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Nu(e,a,s,c){a=e.memoizedState,s=s(c,a),s=s==null?a:y({},a,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var ku={enqueueSetState:function(e,a,s){e=e._reactInternals;var c=Da(),u=tn(c);u.payload=a,s!=null&&(u.callback=s),a=an(e,u,c),a!==null&&(Ma(a,e,c),$l(a,e,c))},enqueueReplaceState:function(e,a,s){e=e._reactInternals;var c=Da(),u=tn(c);u.tag=1,u.payload=a,s!=null&&(u.callback=s),a=an(e,u,c),a!==null&&(Ma(a,e,c),$l(a,e,c))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var s=Da(),c=tn(s);c.tag=2,a!=null&&(c.callback=a),a=an(e,c,s),a!==null&&(Ma(a,e,s),$l(a,e,s))}};function l0(e,a,s,c,u,m,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,m,_):a.prototype&&a.prototype.isPureReactComponent?!zl(s,c)||!zl(u,m):!0}function i0(e,a,s,c){e=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==e&&ku.enqueueReplaceState(a,a.state,null)}function Kn(e,a){var s=a;if("ref"in a){s={};for(var c in a)c!=="ref"&&(s[c]=a[c])}if(e=e.defaultProps){s===a&&(s=y({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}var Ao=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function o0(e){Ao(e)}function c0(e){console.error(e)}function d0(e){Ao(e)}function Do(e,a){try{var s=e.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function u0(e,a,s){try{var c=e.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Su(e,a,s){return s=tn(s),s.tag=3,s.payload={element:null},s.callback=function(){Do(e,a)},s}function f0(e){return e=tn(e),e.tag=3,e}function h0(e,a,s,c){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var m=c.value;e.payload=function(){return u(m)},e.callback=function(){u0(a,s,c)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){u0(a,s,c),typeof u!="function"&&(fn===null?fn=new Set([this]):fn.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})})}function Ej(e,a,s,c,u){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Bl(a,s,u,!0),s=$a.current,s!==null){switch(s.tag){case 13:return or===null?Yu():s.alternate===null&&zt===0&&(zt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,c===eu?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),Qu(e,c,u)),!1;case 22:return s.flags|=65536,c===eu?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),Qu(e,c,u)),!1}throw Error(l(435,s.tag))}return Qu(e,c,u),Yu(),!1}if(ut)return a=$a.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,c!==Vd&&(e=Error(l(422),{cause:c}),Fl(Ia(e,s)))):(c!==Vd&&(a=Error(l(423),{cause:c}),Fl(Ia(a,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,c=Ia(c,s),u=Su(e.stateNode,c,u),ru(e,u),zt!==4&&(zt=2)),!1;var m=Error(l(520),{cause:c});if(m=Ia(m,s),li===null?li=[m]:li.push(m),zt!==4&&(zt=2),a===null)return!0;c=Ia(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Su(s.stateNode,c,e),ru(s,e),!1;case 1:if(a=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(fn===null||!fn.has(m))))return s.flags|=65536,u&=-u,s.lanes|=u,u=f0(u),h0(u,e,s,c),ru(s,u),!1}s=s.return}while(s!==null);return!1}var p0=Error(l(461)),ea=!1;function sa(e,a,s,c){a.child=e===null?n0(a,null,s,c):Us(a,e.child,s,c)}function m0(e,a,s,c,u){s=s.render;var m=a.ref;if("ref"in c){var _={};for(var D in c)D!=="ref"&&(_[D]=c[D])}else _=c;return $n(a),c=ou(e,a,s,_,m,u),D=cu(),e!==null&&!ea?(du(e,a,u),Mr(e,a,u)):(ut&&D&&$d(a),a.flags|=1,sa(e,a,c,u),a.child)}function g0(e,a,s,c,u){if(e===null){var m=s.type;return typeof m=="function"&&!Hd(m)&&m.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=m,x0(e,a,m,c,u)):(e=uo(s.type,null,c,a,a.mode,u),e.ref=a.ref,e.return=a,a.child=e)}if(m=e.child,!Mu(e,u)){var _=m.memoizedProps;if(s=s.compare,s=s!==null?s:zl,s(_,c)&&e.ref===a.ref)return Mr(e,a,u)}return a.flags|=1,e=_r(m,c),e.ref=a.ref,e.return=a,a.child=e}function x0(e,a,s,c,u){if(e!==null){var m=e.memoizedProps;if(zl(m,c)&&e.ref===a.ref)if(ea=!1,a.pendingProps=c=m,Mu(e,u))(e.flags&131072)!==0&&(ea=!0);else return a.lanes=e.lanes,Mr(e,a,u)}return _u(e,a,s,c,u)}function y0(e,a,s){var c=a.pendingProps,u=c.children,m=e!==null?e.memoizedState:null;if(c.mode==="hidden"){if((a.flags&128)!==0){if(c=m!==null?m.baseLanes|s:s,e!==null){for(u=a.child=e.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;a.childLanes=m&~c}else a.childLanes=0,a.child=null;return b0(e,a,c,s)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},e!==null&&go(a,m!==null?m.cachePool:null),m!==null?xm(a,m):su(),s0(a);else return a.lanes=a.childLanes=536870912,b0(e,a,m!==null?m.baseLanes|s:s,s)}else m!==null?(go(a,m.cachePool),xm(a,m),sn(),a.memoizedState=null):(e!==null&&go(a,null),su(),sn());return sa(e,a,u,s),a.child}function b0(e,a,s,c){var u=Jd();return u=u===null?null:{parent:$t._currentValue,pool:u},a.memoizedState={baseLanes:s,cachePool:u},e!==null&&go(a,null),su(),s0(a),e!==null&&Bl(e,a,c,!0),null}function Mo(e,a){var s=a.ref;if(s===null)e!==null&&e.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(a.flags|=4194816)}}function _u(e,a,s,c,u){return $n(a),s=ou(e,a,s,c,void 0,u),c=cu(),e!==null&&!ea?(du(e,a,u),Mr(e,a,u)):(ut&&c&&$d(a),a.flags|=1,sa(e,a,s,u),a.child)}function v0(e,a,s,c,u,m){return $n(a),a.updateQueue=null,s=bm(a,c,s,u),ym(e),c=cu(),e!==null&&!ea?(du(e,a,m),Mr(e,a,m)):(ut&&c&&$d(a),a.flags|=1,sa(e,a,s,m),a.child)}function j0(e,a,s,c,u){if($n(a),a.stateNode===null){var m=Ts,_=s.contextType;typeof _=="object"&&_!==null&&(m=fa(_)),m=new s(c,m),a.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=ku,a.stateNode=m,m._reactInternals=a,m=a.stateNode,m.props=c,m.state=a.memoizedState,m.refs={},tu(a),_=s.contextType,m.context=typeof _=="object"&&_!==null?fa(_):Ts,m.state=a.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Nu(a,s,_,c),m.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(_=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),_!==m.state&&ku.enqueueReplaceState(m,m.state,null),Vl(a,c,m,u),Zl(),m.state=a.memoizedState),typeof m.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(e===null){m=a.stateNode;var D=a.memoizedProps,F=Kn(s,D);m.props=F;var J=m.context,oe=s.contextType;_=Ts,typeof oe=="object"&&oe!==null&&(_=fa(oe));var me=s.getDerivedStateFromProps;oe=typeof me=="function"||typeof m.getSnapshotBeforeUpdate=="function",D=a.pendingProps!==D,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(D||J!==_)&&i0(a,m,c,_),en=!1;var te=a.memoizedState;m.state=te,Vl(a,c,m,u),Zl(),J=a.memoizedState,D||te!==J||en?(typeof me=="function"&&(Nu(a,s,me,c),J=a.memoizedState),(F=en||l0(a,s,F,c,te,J,_))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(a.flags|=4194308)):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=J),m.props=c,m.state=J,m.context=_,c=F):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{m=a.stateNode,au(e,a),_=a.memoizedProps,oe=Kn(s,_),m.props=oe,me=a.pendingProps,te=m.context,J=s.contextType,F=Ts,typeof J=="object"&&J!==null&&(F=fa(J)),D=s.getDerivedStateFromProps,(J=typeof D=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(_!==me||te!==F)&&i0(a,m,c,F),en=!1,te=a.memoizedState,m.state=te,Vl(a,c,m,u),Zl();var re=a.memoizedState;_!==me||te!==re||en||e!==null&&e.dependencies!==null&&po(e.dependencies)?(typeof D=="function"&&(Nu(a,s,D,c),re=a.memoizedState),(oe=en||l0(a,s,oe,c,te,re,F)||e!==null&&e.dependencies!==null&&po(e.dependencies))?(J||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(c,re,F),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(c,re,F)),typeof m.componentDidUpdate=="function"&&(a.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof m.componentDidUpdate!="function"||_===e.memoizedProps&&te===e.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&te===e.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=re),m.props=c,m.state=re,m.context=F,c=oe):(typeof m.componentDidUpdate!="function"||_===e.memoizedProps&&te===e.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&te===e.memoizedState||(a.flags|=1024),c=!1)}return m=c,Mo(e,a),c=(a.flags&128)!==0,m||c?(m=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:m.render(),a.flags|=1,e!==null&&c?(a.child=Us(a,e.child,null,u),a.child=Us(a,null,s,u)):sa(e,a,s,u),a.memoizedState=m.state,e=a.child):e=Mr(e,a,u),e}function w0(e,a,s,c){return Gl(),a.flags|=256,sa(e,a,s,c),a.child}var Tu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cu(e){return{baseLanes:e,cachePool:cm()}}function Eu(e,a,s){return e=e!==null?e.childLanes&~s:0,a&&(e|=Za),e}function N0(e,a,s){var c=a.pendingProps,u=!1,m=(a.flags&128)!==0,_;if((_=m)||(_=e!==null&&e.memoizedState===null?!1:(Zt.current&2)!==0),_&&(u=!0,a.flags&=-129),_=(a.flags&32)!==0,a.flags&=-33,e===null){if(ut){if(u?nn(a):sn(),ut){var D=Ot,F;if(F=D){e:{for(F=D,D=ir;F.nodeType!==8;){if(!D){D=null;break e}if(F=tr(F.nextSibling),F===null){D=null;break e}}D=F}D!==null?(a.memoizedState={dehydrated:D,treeContext:Bn!==null?{id:Tr,overflow:Cr}:null,retryLane:536870912,hydrationErrors:null},F=Ca(18,null,null,0),F.stateNode=D,F.return=a,a.child=F,ga=a,Ot=null,F=!0):F=!1}F||Pn(a)}if(D=a.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return hf(D)?a.lanes=32:a.lanes=536870912,null;Dr(a)}return D=c.children,c=c.fallback,u?(sn(),u=a.mode,D=Oo({mode:"hidden",children:D},u),c=Fn(c,u,s,null),D.return=a,c.return=a,D.sibling=c,a.child=D,u=a.child,u.memoizedState=Cu(s),u.childLanes=Eu(e,_,s),a.memoizedState=Tu,c):(nn(a),Ru(a,D))}if(F=e.memoizedState,F!==null&&(D=F.dehydrated,D!==null)){if(m)a.flags&256?(nn(a),a.flags&=-257,a=Au(e,a,s)):a.memoizedState!==null?(sn(),a.child=e.child,a.flags|=128,a=null):(sn(),u=c.fallback,D=a.mode,c=Oo({mode:"visible",children:c.children},D),u=Fn(u,D,s,null),u.flags|=2,c.return=a,u.return=a,c.sibling=u,a.child=c,Us(a,e.child,null,s),c=a.child,c.memoizedState=Cu(s),c.childLanes=Eu(e,_,s),a.memoizedState=Tu,a=u);else if(nn(a),hf(D)){if(_=D.nextSibling&&D.nextSibling.dataset,_)var J=_.dgst;_=J,c=Error(l(419)),c.stack="",c.digest=_,Fl({value:c,source:null,stack:null}),a=Au(e,a,s)}else if(ea||Bl(e,a,s,!1),_=(s&e.childLanes)!==0,ea||_){if(_=Nt,_!==null&&(c=s&-s,c=(c&42)!==0?1:hd(c),c=(c&(_.suspendedLanes|s))!==0?0:c,c!==0&&c!==F.retryLane))throw F.retryLane=c,_s(e,c),Ma(_,e,c),p0;D.data==="$?"||Yu(),a=Au(e,a,s)}else D.data==="$?"?(a.flags|=192,a.child=e.child,a=null):(e=F.treeContext,Ot=tr(D.nextSibling),ga=a,ut=!0,Hn=null,ir=!1,e!==null&&(Pa[qa++]=Tr,Pa[qa++]=Cr,Pa[qa++]=Bn,Tr=e.id,Cr=e.overflow,Bn=a),a=Ru(a,c.children),a.flags|=4096);return a}return u?(sn(),u=c.fallback,D=a.mode,F=e.child,J=F.sibling,c=_r(F,{mode:"hidden",children:c.children}),c.subtreeFlags=F.subtreeFlags&65011712,J!==null?u=_r(J,u):(u=Fn(u,D,s,null),u.flags|=2),u.return=a,c.return=a,c.sibling=u,a.child=c,c=u,u=a.child,D=e.child.memoizedState,D===null?D=Cu(s):(F=D.cachePool,F!==null?(J=$t._currentValue,F=F.parent!==J?{parent:J,pool:J}:F):F=cm(),D={baseLanes:D.baseLanes|s,cachePool:F}),u.memoizedState=D,u.childLanes=Eu(e,_,s),a.memoizedState=Tu,c):(nn(a),s=e.child,e=s.sibling,s=_r(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,e!==null&&(_=a.deletions,_===null?(a.deletions=[e],a.flags|=16):_.push(e)),a.child=s,a.memoizedState=null,s)}function Ru(e,a){return a=Oo({mode:"visible",children:a},e.mode),a.return=e,e.child=a}function Oo(e,a){return e=Ca(22,e,null,a),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Au(e,a,s){return Us(a,e.child,null,s),e=Ru(a,a.pendingProps.children),e.flags|=2,a.memoizedState=null,e}function k0(e,a,s){e.lanes|=a;var c=e.alternate;c!==null&&(c.lanes|=a),Yd(e.return,a,s)}function Du(e,a,s,c,u){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:u}:(m.isBackwards=a,m.rendering=null,m.renderingStartTime=0,m.last=c,m.tail=s,m.tailMode=u)}function S0(e,a,s){var c=a.pendingProps,u=c.revealOrder,m=c.tail;if(sa(e,a,c.children,s),c=Zt.current,(c&2)!==0)c=c&1|2,a.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=a.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&k0(e,s,a);else if(e.tag===19)k0(e,s,a);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===a)break e;for(;e.sibling===null;){if(e.return===null||e.return===a)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}c&=1}switch(ee(Zt,c),u){case"forwards":for(s=a.child,u=null;s!==null;)e=s.alternate,e!==null&&Ro(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),Du(a,!1,u,s,m);break;case"backwards":for(s=null,u=a.child,a.child=null;u!==null;){if(e=u.alternate,e!==null&&Ro(e)===null){a.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Du(a,!0,s,null,m);break;case"together":Du(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Mr(e,a,s){if(e!==null&&(a.dependencies=e.dependencies),un|=a.lanes,(s&a.childLanes)===0)if(e!==null){if(Bl(e,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(e!==null&&a.child!==e.child)throw Error(l(153));if(a.child!==null){for(e=a.child,s=_r(e,e.pendingProps),a.child=s,s.return=a;e.sibling!==null;)e=e.sibling,s=s.sibling=_r(e,e.pendingProps),s.return=a;s.sibling=null}return a.child}function Mu(e,a){return(e.lanes&a)!==0?!0:(e=e.dependencies,!!(e!==null&&po(e)))}function Rj(e,a,s){switch(a.tag){case 3:ge(a,a.stateNode.containerInfo),Jr(a,$t,e.memoizedState.cache),Gl();break;case 27:case 5:Se(a);break;case 4:ge(a,a.stateNode.containerInfo);break;case 10:Jr(a,a.type,a.memoizedProps.value);break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(nn(a),a.flags|=128,null):(s&a.child.childLanes)!==0?N0(e,a,s):(nn(a),e=Mr(e,a,s),e!==null?e.sibling:null);nn(a);break;case 19:var u=(e.flags&128)!==0;if(c=(s&a.childLanes)!==0,c||(Bl(e,a,s,!1),c=(s&a.childLanes)!==0),u){if(c)return S0(e,a,s);a.flags|=128}if(u=a.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ee(Zt,Zt.current),c)break;return null;case 22:case 23:return a.lanes=0,y0(e,a,s);case 24:Jr(a,$t,e.memoizedState.cache)}return Mr(e,a,s)}function _0(e,a,s){if(e!==null)if(e.memoizedProps!==a.pendingProps)ea=!0;else{if(!Mu(e,s)&&(a.flags&128)===0)return ea=!1,Rj(e,a,s);ea=(e.flags&131072)!==0}else ea=!1,ut&&(a.flags&1048576)!==0&&am(a,ho,a.index);switch(a.lanes=0,a.tag){case 16:e:{e=a.pendingProps;var c=a.elementType,u=c._init;if(c=u(c._payload),a.type=c,typeof c=="function")Hd(c)?(e=Kn(c,e),a.tag=1,a=j0(null,a,c,e,s)):(a.tag=0,a=_u(null,a,c,e,s));else{if(c!=null){if(u=c.$$typeof,u===L){a.tag=11,a=m0(null,a,c,e,s);break e}else if(u===$){a.tag=14,a=g0(null,a,c,e,s);break e}}throw a=z(c)||c,Error(l(306,a,""))}}return a;case 0:return _u(e,a,a.type,a.pendingProps,s);case 1:return c=a.type,u=Kn(c,a.pendingProps),j0(e,a,c,u,s);case 3:e:{if(ge(a,a.stateNode.containerInfo),e===null)throw Error(l(387));c=a.pendingProps;var m=a.memoizedState;u=m.element,au(e,a),Vl(a,c,null,s);var _=a.memoizedState;if(c=_.cache,Jr(a,$t,c),c!==m.cache&&Xd(a,[$t],s,!0),Zl(),c=_.element,m.isDehydrated)if(m={element:c,isDehydrated:!1,cache:_.cache},a.updateQueue.baseState=m,a.memoizedState=m,a.flags&256){a=w0(e,a,c,s);break e}else if(c!==u){u=Ia(Error(l(424)),a),Fl(u),a=w0(e,a,c,s);break e}else{switch(e=a.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ot=tr(e.firstChild),ga=a,ut=!0,Hn=null,ir=!0,s=n0(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Gl(),c===u){a=Mr(e,a,s);break e}sa(e,a,c,s)}a=a.child}return a;case 26:return Mo(e,a),e===null?(s=Rg(a.type,null,a.pendingProps,null))?a.memoizedState=s:ut||(s=a.type,e=a.pendingProps,c=Ko(ve.current).createElement(s),c[ua]=a,c[ya]=e,ia(c,s,e),Jt(c),a.stateNode=c):a.memoizedState=Rg(a.type,e.memoizedProps,a.pendingProps,e.memoizedState),null;case 27:return Se(a),e===null&&ut&&(c=a.stateNode=Tg(a.type,a.pendingProps,ve.current),ga=a,ir=!0,u=Ot,mn(a.type)?(pf=u,Ot=tr(c.firstChild)):Ot=u),sa(e,a,a.pendingProps.children,s),Mo(e,a),e===null&&(a.flags|=4194304),a.child;case 5:return e===null&&ut&&((u=c=Ot)&&(c=nw(c,a.type,a.pendingProps,ir),c!==null?(a.stateNode=c,ga=a,Ot=tr(c.firstChild),ir=!1,u=!0):u=!1),u||Pn(a)),Se(a),u=a.type,m=a.pendingProps,_=e!==null?e.memoizedProps:null,c=m.children,df(u,m)?c=null:_!==null&&df(u,_)&&(a.flags|=32),a.memoizedState!==null&&(u=ou(e,a,wj,null,null,s),mi._currentValue=u),Mo(e,a),sa(e,a,c,s),a.child;case 6:return e===null&&ut&&((e=s=Ot)&&(s=sw(s,a.pendingProps,ir),s!==null?(a.stateNode=s,ga=a,Ot=null,e=!0):e=!1),e||Pn(a)),null;case 13:return N0(e,a,s);case 4:return ge(a,a.stateNode.containerInfo),c=a.pendingProps,e===null?a.child=Us(a,null,c,s):sa(e,a,c,s),a.child;case 11:return m0(e,a,a.type,a.pendingProps,s);case 7:return sa(e,a,a.pendingProps,s),a.child;case 8:return sa(e,a,a.pendingProps.children,s),a.child;case 12:return sa(e,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Jr(a,a.type,c.value),sa(e,a,c.children,s),a.child;case 9:return u=a.type._context,c=a.pendingProps.children,$n(a),u=fa(u),c=c(u),a.flags|=1,sa(e,a,c,s),a.child;case 14:return g0(e,a,a.type,a.pendingProps,s);case 15:return x0(e,a,a.type,a.pendingProps,s);case 19:return S0(e,a,s);case 31:return c=a.pendingProps,s=a.mode,c={mode:c.mode,children:c.children},e===null?(s=Oo(c,s),s.ref=a.ref,a.child=s,s.return=a,a=s):(s=_r(e.child,c),s.ref=a.ref,a.child=s,s.return=a,a=s),a;case 22:return y0(e,a,s);case 24:return $n(a),c=fa($t),e===null?(u=Jd(),u===null&&(u=Nt,m=Qd(),u.pooledCache=m,m.refCount++,m!==null&&(u.pooledCacheLanes|=s),u=m),a.memoizedState={parent:c,cache:u},tu(a),Jr(a,$t,u)):((e.lanes&s)!==0&&(au(e,a),Vl(a,null,null,s),Zl()),u=e.memoizedState,m=a.memoizedState,u.parent!==c?(u={parent:c,cache:c},a.memoizedState=u,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=u),Jr(a,$t,c)):(c=m.cache,Jr(a,$t,c),c!==u.cache&&Xd(a,[$t],s,!0))),sa(e,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(l(156,a.tag))}function Or(e){e.flags|=4}function T0(e,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!zg(a)){if(a=$a.current,a!==null&&((ot&4194048)===ot?or!==null:(ot&62914560)!==ot&&(ot&536870912)===0||a!==or))throw ql=eu,dm;e.flags|=8192}}function zo(e,a){a!==null&&(e.flags|=4),e.flags&16384&&(a=e.tag!==22?sp():536870912,e.lanes|=a,Is|=a)}function ei(e,a){if(!ut)switch(e.tailMode){case"hidden":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function At(e){var a=e.alternate!==null&&e.alternate.child===e.child,s=0,c=0;if(a)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,c|=u.subtreeFlags&65011712,c|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,c|=u.subtreeFlags,c|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=c,e.childLanes=s,a}function Aj(e,a,s){var c=a.pendingProps;switch(Zd(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(a),null;case 1:return At(a),null;case 3:return s=a.stateNode,c=null,e!==null&&(c=e.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Rr($t),be(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ul(a)?Or(a):e===null||e.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,sm())),At(a),null;case 26:return s=a.memoizedState,e===null?(Or(a),s!==null?(At(a),T0(a,s)):(At(a),a.flags&=-16777217)):s?s!==e.memoizedState?(Or(a),At(a),T0(a,s)):(At(a),a.flags&=-16777217):(e.memoizedProps!==c&&Or(a),At(a),a.flags&=-16777217),null;case 27:Ee(a),s=ve.current;var u=a.type;if(e!==null&&a.stateNode!=null)e.memoizedProps!==c&&Or(a);else{if(!c){if(a.stateNode===null)throw Error(l(166));return At(a),null}e=xe.current,Ul(a)?rm(a):(e=Tg(u,c,s),a.stateNode=e,Or(a))}return At(a),null;case 5:if(Ee(a),s=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==c&&Or(a);else{if(!c){if(a.stateNode===null)throw Error(l(166));return At(a),null}if(e=xe.current,Ul(a))rm(a);else{switch(u=Ko(ve.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof c.is=="string"?u.createElement("select",{is:c.is}):u.createElement("select"),c.multiple?e.multiple=!0:c.size&&(e.size=c.size);break;default:e=typeof c.is=="string"?u.createElement(s,{is:c.is}):u.createElement(s)}}e[ua]=a,e[ya]=c;e:for(u=a.child;u!==null;){if(u.tag===5||u.tag===6)e.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break e;for(;u.sibling===null;){if(u.return===null||u.return===a)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}a.stateNode=e;e:switch(ia(e,s,c),s){case"button":case"input":case"select":case"textarea":e=!!c.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Or(a)}}return At(a),a.flags&=-16777217,null;case 6:if(e&&a.stateNode!=null)e.memoizedProps!==c&&Or(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(l(166));if(e=ve.current,Ul(a)){if(e=a.stateNode,s=a.memoizedProps,c=null,u=ga,u!==null)switch(u.tag){case 27:case 5:c=u.memoizedProps}e[ua]=a,e=!!(e.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||vg(e.nodeValue,s)),e||Pn(a)}else e=Ko(e).createTextNode(c),e[ua]=a,a.stateNode=e}return At(a),null;case 13:if(c=a.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ul(a),c!==null&&c.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=a.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[ua]=a}else Gl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;At(a),u=!1}else u=sm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return a.flags&256?(Dr(a),a):(Dr(a),null)}if(Dr(a),(a.flags&128)!==0)return a.lanes=s,a;if(s=c!==null,e=e!==null&&e.memoizedState!==null,s){c=a.child,u=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(u=c.alternate.memoizedState.cachePool.pool);var m=null;c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==u&&(c.flags|=2048)}return s!==e&&s&&(a.child.flags|=8192),zo(a,a.updateQueue),At(a),null;case 4:return be(),e===null&&nf(a.stateNode.containerInfo),At(a),null;case 10:return Rr(a.type),At(a),null;case 19:if(I(Zt),u=a.memoizedState,u===null)return At(a),null;if(c=(a.flags&128)!==0,m=u.rendering,m===null)if(c)ei(u,!1);else{if(zt!==0||e!==null&&(e.flags&128)!==0)for(e=a.child;e!==null;){if(m=Ro(e),m!==null){for(a.flags|=128,ei(u,!1),e=m.updateQueue,a.updateQueue=e,zo(a,e),a.subtreeFlags=0,e=s,s=a.child;s!==null;)tm(s,e),s=s.sibling;return ee(Zt,Zt.current&1|2),a.child}e=e.sibling}u.tail!==null&&ce()>Go&&(a.flags|=128,c=!0,ei(u,!1),a.lanes=4194304)}else{if(!c)if(e=Ro(m),e!==null){if(a.flags|=128,c=!0,e=e.updateQueue,a.updateQueue=e,zo(a,e),ei(u,!0),u.tail===null&&u.tailMode==="hidden"&&!m.alternate&&!ut)return At(a),null}else 2*ce()-u.renderingStartTime>Go&&s!==536870912&&(a.flags|=128,c=!0,ei(u,!1),a.lanes=4194304);u.isBackwards?(m.sibling=a.child,a.child=m):(e=u.last,e!==null?e.sibling=m:a.child=m,u.last=m)}return u.tail!==null?(a=u.tail,u.rendering=a,u.tail=a.sibling,u.renderingStartTime=ce(),a.sibling=null,e=Zt.current,ee(Zt,c?e&1|2:e&1),a):(At(a),null);case 22:case 23:return Dr(a),lu(),c=a.memoizedState!==null,e!==null?e.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(At(a),a.subtreeFlags&6&&(a.flags|=8192)):At(a),s=a.updateQueue,s!==null&&zo(a,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),e!==null&&I(Zn),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Rr($t),At(a),null;case 25:return null;case 30:return null}throw Error(l(156,a.tag))}function Dj(e,a){switch(Zd(a),a.tag){case 1:return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 3:return Rr($t),be(),e=a.flags,(e&65536)!==0&&(e&128)===0?(a.flags=e&-65537|128,a):null;case 26:case 27:case 5:return Ee(a),null;case 13:if(Dr(a),e=a.memoizedState,e!==null&&e.dehydrated!==null){if(a.alternate===null)throw Error(l(340));Gl()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 19:return I(Zt),null;case 4:return be(),null;case 10:return Rr(a.type),null;case 22:case 23:return Dr(a),lu(),e!==null&&I(Zn),e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 24:return Rr($t),null;case 25:return null;default:return null}}function C0(e,a){switch(Zd(a),a.tag){case 3:Rr($t),be();break;case 26:case 27:case 5:Ee(a);break;case 4:be();break;case 13:Dr(a);break;case 19:I(Zt);break;case 10:Rr(a.type);break;case 22:case 23:Dr(a),lu(),e!==null&&I(Zn);break;case 24:Rr($t)}}function ti(e,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var u=c.next;s=u;do{if((s.tag&e)===e){c=void 0;var m=s.create,_=s.inst;c=m(),_.destroy=c}s=s.next}while(s!==u)}}catch(D){vt(a,a.return,D)}}function ln(e,a,s){try{var c=a.updateQueue,u=c!==null?c.lastEffect:null;if(u!==null){var m=u.next;c=m;do{if((c.tag&e)===e){var _=c.inst,D=_.destroy;if(D!==void 0){_.destroy=void 0,u=a;var F=s,J=D;try{J()}catch(oe){vt(u,F,oe)}}}c=c.next}while(c!==m)}}catch(oe){vt(a,a.return,oe)}}function E0(e){var a=e.updateQueue;if(a!==null){var s=e.stateNode;try{gm(a,s)}catch(c){vt(e,e.return,c)}}}function R0(e,a,s){s.props=Kn(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(c){vt(e,a,c)}}function ai(e,a){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var c=e.stateNode;break;case 30:c=e.stateNode;break;default:c=e.stateNode}typeof s=="function"?e.refCleanup=s(c):s.current=c}}catch(u){vt(e,a,u)}}function cr(e,a){var s=e.ref,c=e.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(u){vt(e,a,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){vt(e,a,u)}else s.current=null}function A0(e){var a=e.type,s=e.memoizedProps,c=e.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(u){vt(e,e.return,u)}}function Ou(e,a,s){try{var c=e.stateNode;Jj(c,e.type,s,a),c[ya]=a}catch(u){vt(e,e.return,u)}}function D0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mn(e.type)||e.tag===4}function zu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,a,s){var c=e.tag;if(c===5||c===6)e=e.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(e),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Vo));else if(c!==4&&(c===27&&mn(e.type)&&(s=e.stateNode,a=null),e=e.child,e!==null))for(Lu(e,a,s),e=e.sibling;e!==null;)Lu(e,a,s),e=e.sibling}function Lo(e,a,s){var c=e.tag;if(c===5||c===6)e=e.stateNode,a?s.insertBefore(e,a):s.appendChild(e);else if(c!==4&&(c===27&&mn(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Lo(e,a,s),e=e.sibling;e!==null;)Lo(e,a,s),e=e.sibling}function M0(e){var a=e.stateNode,s=e.memoizedProps;try{for(var c=e.type,u=a.attributes;u.length;)a.removeAttributeNode(u[0]);ia(a,c,s),a[ua]=e,a[ya]=s}catch(m){vt(e,e.return,m)}}var zr=!1,Ft=!1,Uu=!1,O0=typeof WeakSet=="function"?WeakSet:Set,ta=null;function Mj(e,a){if(e=e.containerInfo,of=ec,e=$p(e),zd(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var u=c.anchorOffset,m=c.focusNode;c=c.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var _=0,D=-1,F=-1,J=0,oe=0,me=e,te=null;t:for(;;){for(var re;me!==s||u!==0&&me.nodeType!==3||(D=_+u),me!==m||c!==0&&me.nodeType!==3||(F=_+c),me.nodeType===3&&(_+=me.nodeValue.length),(re=me.firstChild)!==null;)te=me,me=re;for(;;){if(me===e)break t;if(te===s&&++J===u&&(D=_),te===m&&++oe===c&&(F=_),(re=me.nextSibling)!==null)break;me=te,te=me.parentNode}me=re}s=D===-1||F===-1?null:{start:D,end:F}}else s=null}s=s||{start:0,end:0}}else s=null;for(cf={focusedElem:e,selectionRange:s},ec=!1,ta=a;ta!==null;)if(a=ta,e=a.child,(a.subtreeFlags&1024)!==0&&e!==null)e.return=a,ta=e;else for(;ta!==null;){switch(a=ta,m=a.alternate,e=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,s=a,u=m.memoizedProps,m=m.memoizedState,c=s.stateNode;try{var Ie=Kn(s.type,u,s.elementType===s.type);e=c.getSnapshotBeforeUpdate(Ie,m),c.__reactInternalSnapshotBeforeUpdate=e}catch(Fe){vt(s,s.return,Fe)}}break;case 3:if((e&1024)!==0){if(e=a.stateNode.containerInfo,s=e.nodeType,s===9)ff(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ff(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=a.sibling,e!==null){e.return=a.return,ta=e;break}ta=a.return}}function z0(e,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:on(e,s),c&4&&ti(5,s);break;case 1:if(on(e,s),c&4)if(e=s.stateNode,a===null)try{e.componentDidMount()}catch(_){vt(s,s.return,_)}else{var u=Kn(s.type,a.memoizedProps);a=a.memoizedState;try{e.componentDidUpdate(u,a,e.__reactInternalSnapshotBeforeUpdate)}catch(_){vt(s,s.return,_)}}c&64&&E0(s),c&512&&ai(s,s.return);break;case 3:if(on(e,s),c&64&&(e=s.updateQueue,e!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{gm(e,a)}catch(_){vt(s,s.return,_)}}break;case 27:a===null&&c&4&&M0(s);case 26:case 5:on(e,s),a===null&&c&4&&A0(s),c&512&&ai(s,s.return);break;case 12:on(e,s);break;case 13:on(e,s),c&4&&G0(e,s),c&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Hj.bind(null,s),lw(e,s))));break;case 22:if(c=s.memoizedState!==null||zr,!c){a=a!==null&&a.memoizedState!==null||Ft,u=zr;var m=Ft;zr=c,(Ft=a)&&!m?cn(e,s,(s.subtreeFlags&8772)!==0):on(e,s),zr=u,Ft=m}break;case 30:break;default:on(e,s)}}function L0(e){var a=e.alternate;a!==null&&(e.alternate=null,L0(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&gd(a)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ct=null,ja=!1;function Lr(e,a,s){for(s=s.child;s!==null;)U0(e,a,s),s=s.sibling}function U0(e,a,s){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Wt,s)}catch{}switch(s.tag){case 26:Ft||cr(s,a),Lr(e,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ft||cr(s,a);var c=Ct,u=ja;mn(s.type)&&(Ct=s.stateNode,ja=!1),Lr(e,a,s),ui(s.stateNode),Ct=c,ja=u;break;case 5:Ft||cr(s,a);case 6:if(c=Ct,u=ja,Ct=null,Lr(e,a,s),Ct=c,ja=u,Ct!==null)if(ja)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(s.stateNode)}catch(m){vt(s,a,m)}else try{Ct.removeChild(s.stateNode)}catch(m){vt(s,a,m)}break;case 18:Ct!==null&&(ja?(e=Ct,Sg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),bi(e)):Sg(Ct,s.stateNode));break;case 4:c=Ct,u=ja,Ct=s.stateNode.containerInfo,ja=!0,Lr(e,a,s),Ct=c,ja=u;break;case 0:case 11:case 14:case 15:Ft||ln(2,s,a),Ft||ln(4,s,a),Lr(e,a,s);break;case 1:Ft||(cr(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&R0(s,a,c)),Lr(e,a,s);break;case 21:Lr(e,a,s);break;case 22:Ft=(c=Ft)||s.memoizedState!==null,Lr(e,a,s),Ft=c;break;default:Lr(e,a,s)}}function G0(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bi(e)}catch(s){vt(a,a.return,s)}}function Oj(e){switch(e.tag){case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new O0),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new O0),a;default:throw Error(l(435,e.tag))}}function Gu(e,a){var s=Oj(e);a.forEach(function(c){var u=Pj.bind(null,e,c);s.has(c)||(s.add(c),c.then(u,u))})}function Ea(e,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var u=s[c],m=e,_=a,D=_;e:for(;D!==null;){switch(D.tag){case 27:if(mn(D.type)){Ct=D.stateNode,ja=!1;break e}break;case 5:Ct=D.stateNode,ja=!1;break e;case 3:case 4:Ct=D.stateNode.containerInfo,ja=!0;break e}D=D.return}if(Ct===null)throw Error(l(160));U0(m,_,u),Ct=null,ja=!1,m=u.alternate,m!==null&&(m.return=null),u.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)F0(a,e),a=a.sibling}var er=null;function F0(e,a){var s=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ea(a,e),Ra(e),c&4&&(ln(3,e,e.return),ti(3,e),ln(5,e,e.return));break;case 1:Ea(a,e),Ra(e),c&512&&(Ft||s===null||cr(s,s.return)),c&64&&zr&&(e=e.updateQueue,e!==null&&(c=e.callbacks,c!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var u=er;if(Ea(a,e),Ra(e),c&512&&(Ft||s===null||cr(s,s.return)),c&4){var m=s!==null?s.memoizedState:null;if(c=e.memoizedState,s===null)if(c===null)if(e.stateNode===null){e:{c=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(c){case"title":m=u.getElementsByTagName("title")[0],(!m||m[_l]||m[ua]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=u.createElement(c),u.head.insertBefore(m,u.querySelector("head > title"))),ia(m,c,s),m[ua]=e,Jt(m),c=m;break e;case"link":var _=Mg("link","href",u).get(c+(s.href||""));if(_){for(var D=0;D<_.length;D++)if(m=_[D],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(D,1);break t}}m=u.createElement(c),ia(m,c,s),u.head.appendChild(m);break;case"meta":if(_=Mg("meta","content",u).get(c+(s.content||""))){for(D=0;D<_.length;D++)if(m=_[D],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(D,1);break t}}m=u.createElement(c),ia(m,c,s),u.head.appendChild(m);break;default:throw Error(l(468,c))}m[ua]=e,Jt(m),c=m}e.stateNode=c}else Og(u,e.type,e.stateNode);else e.stateNode=Dg(u,c,e.memoizedProps);else m!==c?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,c===null?Og(u,e.type,e.stateNode):Dg(u,c,e.memoizedProps)):c===null&&e.stateNode!==null&&Ou(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ea(a,e),Ra(e),c&512&&(Ft||s===null||cr(s,s.return)),s!==null&&c&4&&Ou(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ea(a,e),Ra(e),c&512&&(Ft||s===null||cr(s,s.return)),e.flags&32){u=e.stateNode;try{bs(u,"")}catch(re){vt(e,e.return,re)}}c&4&&e.stateNode!=null&&(u=e.memoizedProps,Ou(e,u,s!==null?s.memoizedProps:u)),c&1024&&(Uu=!0);break;case 6:if(Ea(a,e),Ra(e),c&4){if(e.stateNode===null)throw Error(l(162));c=e.memoizedProps,s=e.stateNode;try{s.nodeValue=c}catch(re){vt(e,e.return,re)}}break;case 3:if(Qo=null,u=er,er=Yo(a.containerInfo),Ea(a,e),er=u,Ra(e),c&4&&s!==null&&s.memoizedState.isDehydrated)try{bi(a.containerInfo)}catch(re){vt(e,e.return,re)}Uu&&(Uu=!1,B0(e));break;case 4:c=er,er=Yo(e.stateNode.containerInfo),Ea(a,e),Ra(e),er=c;break;case 12:Ea(a,e),Ra(e);break;case 13:Ea(a,e),Ra(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(qu=ce()),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,Gu(e,c)));break;case 22:u=e.memoizedState!==null;var F=s!==null&&s.memoizedState!==null,J=zr,oe=Ft;if(zr=J||u,Ft=oe||F,Ea(a,e),Ft=oe,zr=J,Ra(e),c&8192)e:for(a=e.stateNode,a._visibility=u?a._visibility&-2:a._visibility|1,u&&(s===null||F||zr||Ft||Yn(e)),s=null,a=e;;){if(a.tag===5||a.tag===26){if(s===null){F=s=a;try{if(m=F.stateNode,u)_=m.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{D=F.stateNode;var me=F.memoizedProps.style,te=me!=null&&me.hasOwnProperty("display")?me.display:null;D.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(re){vt(F,F.return,re)}}}else if(a.tag===6){if(s===null){F=a;try{F.stateNode.nodeValue=u?"":F.memoizedProps}catch(re){vt(F,F.return,re)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=e.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Gu(e,s))));break;case 19:Ea(a,e),Ra(e),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,Gu(e,c)));break;case 30:break;case 21:break;default:Ea(a,e),Ra(e)}}function Ra(e){var a=e.flags;if(a&2){try{for(var s,c=e.return;c!==null;){if(D0(c)){s=c;break}c=c.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,m=zu(e);Lo(e,m,u);break;case 5:var _=s.stateNode;s.flags&32&&(bs(_,""),s.flags&=-33);var D=zu(e);Lo(e,D,_);break;case 3:case 4:var F=s.stateNode.containerInfo,J=zu(e);Lu(e,J,F);break;default:throw Error(l(161))}}catch(oe){vt(e,e.return,oe)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function B0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;B0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),e=e.sibling}}function on(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)z0(e,a.alternate,a),a=a.sibling}function Yn(e){for(e=e.child;e!==null;){var a=e;switch(a.tag){case 0:case 11:case 14:case 15:ln(4,a,a.return),Yn(a);break;case 1:cr(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&R0(a,a.return,s),Yn(a);break;case 27:ui(a.stateNode);case 26:case 5:cr(a,a.return),Yn(a);break;case 22:a.memoizedState===null&&Yn(a);break;case 30:Yn(a);break;default:Yn(a)}e=e.sibling}}function cn(e,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,u=e,m=a,_=m.flags;switch(m.tag){case 0:case 11:case 15:cn(u,m,s),ti(4,m);break;case 1:if(cn(u,m,s),c=m,u=c.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(J){vt(c,c.return,J)}if(c=m,u=c.updateQueue,u!==null){var D=c.stateNode;try{var F=u.shared.hiddenCallbacks;if(F!==null)for(u.shared.hiddenCallbacks=null,u=0;u<F.length;u++)mm(F[u],D)}catch(J){vt(c,c.return,J)}}s&&_&64&&E0(m),ai(m,m.return);break;case 27:M0(m);case 26:case 5:cn(u,m,s),s&&c===null&&_&4&&A0(m),ai(m,m.return);break;case 12:cn(u,m,s);break;case 13:cn(u,m,s),s&&_&4&&G0(u,m);break;case 22:m.memoizedState===null&&cn(u,m,s),ai(m,m.return);break;case 30:break;default:cn(u,m,s)}a=a.sibling}}function Fu(e,a){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Il(s))}function Bu(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&Il(e))}function dr(e,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)I0(e,a,s,c),a=a.sibling}function I0(e,a,s,c){var u=a.flags;switch(a.tag){case 0:case 11:case 15:dr(e,a,s,c),u&2048&&ti(9,a);break;case 1:dr(e,a,s,c);break;case 3:dr(e,a,s,c),u&2048&&(e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&Il(e)));break;case 12:if(u&2048){dr(e,a,s,c),e=a.stateNode;try{var m=a.memoizedProps,_=m.id,D=m.onPostCommit;typeof D=="function"&&D(_,a.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(F){vt(a,a.return,F)}}else dr(e,a,s,c);break;case 13:dr(e,a,s,c);break;case 23:break;case 22:m=a.stateNode,_=a.alternate,a.memoizedState!==null?m._visibility&2?dr(e,a,s,c):ri(e,a):m._visibility&2?dr(e,a,s,c):(m._visibility|=2,Gs(e,a,s,c,(a.subtreeFlags&10256)!==0)),u&2048&&Fu(_,a);break;case 24:dr(e,a,s,c),u&2048&&Bu(a.alternate,a);break;default:dr(e,a,s,c)}}function Gs(e,a,s,c,u){for(u=u&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var m=e,_=a,D=s,F=c,J=_.flags;switch(_.tag){case 0:case 11:case 15:Gs(m,_,D,F,u),ti(8,_);break;case 23:break;case 22:var oe=_.stateNode;_.memoizedState!==null?oe._visibility&2?Gs(m,_,D,F,u):ri(m,_):(oe._visibility|=2,Gs(m,_,D,F,u)),u&&J&2048&&Fu(_.alternate,_);break;case 24:Gs(m,_,D,F,u),u&&J&2048&&Bu(_.alternate,_);break;default:Gs(m,_,D,F,u)}a=a.sibling}}function ri(e,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=e,c=a,u=c.flags;switch(c.tag){case 22:ri(s,c),u&2048&&Fu(c.alternate,c);break;case 24:ri(s,c),u&2048&&Bu(c.alternate,c);break;default:ri(s,c)}a=a.sibling}}var ni=8192;function Fs(e){if(e.subtreeFlags&ni)for(e=e.child;e!==null;)H0(e),e=e.sibling}function H0(e){switch(e.tag){case 26:Fs(e),e.flags&ni&&e.memoizedState!==null&&bw(er,e.memoizedState,e.memoizedProps);break;case 5:Fs(e);break;case 3:case 4:var a=er;er=Yo(e.stateNode.containerInfo),Fs(e),er=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ni,ni=16777216,Fs(e),ni=a):Fs(e));break;default:Fs(e)}}function P0(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function si(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];ta=c,$0(c,e)}P0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)q0(e),e=e.sibling}function q0(e){switch(e.tag){case 0:case 11:case 15:si(e),e.flags&2048&&ln(9,e,e.return);break;case 3:si(e);break;case 12:si(e);break;case 22:var a=e.stateNode;e.memoizedState!==null&&a._visibility&2&&(e.return===null||e.return.tag!==13)?(a._visibility&=-3,Uo(e)):si(e);break;default:si(e)}}function Uo(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];ta=c,$0(c,e)}P0(e)}for(e=e.child;e!==null;){switch(a=e,a.tag){case 0:case 11:case 15:ln(8,a,a.return),Uo(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,Uo(a));break;default:Uo(a)}e=e.sibling}}function $0(e,a){for(;ta!==null;){var s=ta;switch(s.tag){case 0:case 11:case 15:ln(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Il(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,ta=c;else e:for(s=e;ta!==null;){c=ta;var u=c.sibling,m=c.return;if(L0(c),c===s){ta=null;break e}if(u!==null){u.return=m,ta=u;break e}ta=m}}}var zj={getCacheForType:function(e){var a=fa($t),s=a.data.get(e);return s===void 0&&(s=e(),a.data.set(e,s)),s}},Lj=typeof WeakMap=="function"?WeakMap:Map,pt=0,Nt=null,et=null,ot=0,mt=0,Aa=null,dn=!1,Bs=!1,Iu=!1,Ur=0,zt=0,un=0,Xn=0,Hu=0,Za=0,Is=0,li=null,wa=null,Pu=!1,qu=0,Go=1/0,Fo=null,fn=null,la=0,hn=null,Hs=null,Ps=0,$u=0,Zu=null,Z0=null,ii=0,Vu=null;function Da(){if((pt&2)!==0&&ot!==0)return ot&-ot;if(C.T!==null){var e=Rs;return e!==0?e:ef()}return op()}function V0(){Za===0&&(Za=(ot&536870912)===0||ut?np():536870912);var e=$a.current;return e!==null&&(e.flags|=32),Za}function Ma(e,a,s){(e===Nt&&(mt===2||mt===9)||e.cancelPendingCommit!==null)&&(qs(e,0),pn(e,ot,Za,!1)),Sl(e,s),((pt&2)===0||e!==Nt)&&(e===Nt&&((pt&2)===0&&(Xn|=s),zt===4&&pn(e,ot,Za,!1)),ur(e))}function K0(e,a,s){if((pt&6)!==0)throw Error(l(327));var c=!s&&(a&124)===0&&(a&e.expiredLanes)===0||Xr(e,a),u=c?Fj(e,a):Xu(e,a,!0),m=c;do{if(u===0){Bs&&!c&&pn(e,a,0,!1);break}else{if(s=e.current.alternate,m&&!Uj(s)){u=Xu(e,a,!1),m=!1;continue}if(u===2){if(m=a,e.errorRecoveryDisabledLanes&m)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){a=_;e:{var D=e;u=li;var F=D.current.memoizedState.isDehydrated;if(F&&(qs(D,_).flags|=256),_=Xu(D,_,!1),_!==2){if(Iu&&!F){D.errorRecoveryDisabledLanes|=m,Xn|=m,u=4;break e}m=wa,wa=u,m!==null&&(wa===null?wa=m:wa.push.apply(wa,m))}u=_}if(m=!1,u!==2)continue}}if(u===1){qs(e,0),pn(e,a,0,!0);break}e:{switch(c=e,m=u,m){case 0:case 1:throw Error(l(345));case 4:if((a&4194048)!==a)break;case 6:pn(c,a,Za,!dn);break e;case 2:wa=null;break;case 3:case 5:break;default:throw Error(l(329))}if((a&62914560)===a&&(u=qu+300-ce(),10<u)){if(pn(c,a,Za,!dn),On(c,0,!0)!==0)break e;c.timeoutHandle=Ng(Y0.bind(null,c,s,wa,Fo,Pu,a,Za,Xn,Is,dn,m,2,-0,0),u);break e}Y0(c,s,wa,Fo,Pu,a,Za,Xn,Is,dn,m,0,-0,0)}}break}while(!0);ur(e)}function Y0(e,a,s,c,u,m,_,D,F,J,oe,me,te,re){if(e.timeoutHandle=-1,me=a.subtreeFlags,(me&8192||(me&16785408)===16785408)&&(pi={stylesheets:null,count:0,unsuspend:yw},H0(a),me=vw(),me!==null)){e.cancelPendingCommit=me(ag.bind(null,e,a,m,s,c,u,_,D,F,oe,1,te,re)),pn(e,m,_,!J);return}ag(e,a,m,s,c,u,_,D,F)}function Uj(e){for(var a=e;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var u=s[c],m=u.getSnapshot;u=u.value;try{if(!Ta(m(),u))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function pn(e,a,s,c){a&=~Hu,a&=~Xn,e.suspendedLanes|=a,e.pingedLanes&=~a,c&&(e.warmLanes|=a),c=e.expirationTimes;for(var u=a;0<u;){var m=31-Tt(u),_=1<<m;c[m]=-1,u&=~_}s!==0&&lp(e,s,a)}function Bo(){return(pt&6)===0?(oi(0),!1):!0}function Ku(){if(et!==null){if(mt===0)var e=et.return;else e=et,Er=qn=null,uu(e),Ls=null,Wl=0,e=et;for(;e!==null;)C0(e.alternate,e),e=e.return;et=null}}function qs(e,a){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,tw(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Ku(),Nt=e,et=s=_r(e.current,null),ot=a,mt=0,Aa=null,dn=!1,Bs=Xr(e,a),Iu=!1,Is=Za=Hu=Xn=un=zt=0,wa=li=null,Pu=!1,(a&8)!==0&&(a|=a&32);var c=e.entangledLanes;if(c!==0)for(e=e.entanglements,c&=a;0<c;){var u=31-Tt(c),m=1<<u;a|=e[u],c&=~m}return Ur=a,io(),s}function X0(e,a){Ye=null,C.H=To,a===Pl||a===xo?(a=hm(),mt=3):a===dm?(a=hm(),mt=4):mt=a===p0?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Aa=a,et===null&&(zt=1,Do(e,Ia(a,e.current)))}function Q0(){var e=C.H;return C.H=To,e===null?To:e}function W0(){var e=C.A;return C.A=zj,e}function Yu(){zt=4,dn||(ot&4194048)!==ot&&$a.current!==null||(Bs=!0),(un&134217727)===0&&(Xn&134217727)===0||Nt===null||pn(Nt,ot,Za,!1)}function Xu(e,a,s){var c=pt;pt|=2;var u=Q0(),m=W0();(Nt!==e||ot!==a)&&(Fo=null,qs(e,a)),a=!1;var _=zt;e:do try{if(mt!==0&&et!==null){var D=et,F=Aa;switch(mt){case 8:Ku(),_=6;break e;case 3:case 2:case 9:case 6:$a.current===null&&(a=!0);var J=mt;if(mt=0,Aa=null,$s(e,D,F,J),s&&Bs){_=0;break e}break;default:J=mt,mt=0,Aa=null,$s(e,D,F,J)}}Gj(),_=zt;break}catch(oe){X0(e,oe)}while(!0);return a&&e.shellSuspendCounter++,Er=qn=null,pt=c,C.H=u,C.A=m,et===null&&(Nt=null,ot=0,io()),_}function Gj(){for(;et!==null;)J0(et)}function Fj(e,a){var s=pt;pt|=2;var c=Q0(),u=W0();Nt!==e||ot!==a?(Fo=null,Go=ce()+500,qs(e,a)):Bs=Xr(e,a);e:do try{if(mt!==0&&et!==null){a=et;var m=Aa;t:switch(mt){case 1:mt=0,Aa=null,$s(e,a,m,1);break;case 2:case 9:if(um(m)){mt=0,Aa=null,eg(a);break}a=function(){mt!==2&&mt!==9||Nt!==e||(mt=7),ur(e)},m.then(a,a);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:um(m)?(mt=0,Aa=null,eg(a)):(mt=0,Aa=null,$s(e,a,m,7));break;case 5:var _=null;switch(et.tag){case 26:_=et.memoizedState;case 5:case 27:var D=et;if(!_||zg(_)){mt=0,Aa=null;var F=D.sibling;if(F!==null)et=F;else{var J=D.return;J!==null?(et=J,Io(J)):et=null}break t}}mt=0,Aa=null,$s(e,a,m,5);break;case 6:mt=0,Aa=null,$s(e,a,m,6);break;case 8:Ku(),zt=6;break e;default:throw Error(l(462))}}Bj();break}catch(oe){X0(e,oe)}while(!0);return Er=qn=null,C.H=c,C.A=u,pt=s,et!==null?0:(Nt=null,ot=0,io(),zt)}function Bj(){for(;et!==null&&!st();)J0(et)}function J0(e){var a=_0(e.alternate,e,Ur);e.memoizedProps=e.pendingProps,a===null?Io(e):et=a}function eg(e){var a=e,s=a.alternate;switch(a.tag){case 15:case 0:a=v0(s,a,a.pendingProps,a.type,void 0,ot);break;case 11:a=v0(s,a,a.pendingProps,a.type.render,a.ref,ot);break;case 5:uu(a);default:C0(s,a),a=et=tm(a,Ur),a=_0(s,a,Ur)}e.memoizedProps=e.pendingProps,a===null?Io(e):et=a}function $s(e,a,s,c){Er=qn=null,uu(a),Ls=null,Wl=0;var u=a.return;try{if(Ej(e,u,a,s,ot)){zt=1,Do(e,Ia(s,e.current)),et=null;return}}catch(m){if(u!==null)throw et=u,m;zt=1,Do(e,Ia(s,e.current)),et=null;return}a.flags&32768?(ut||c===1?e=!0:Bs||(ot&536870912)!==0?e=!1:(dn=e=!0,(c===2||c===9||c===3||c===6)&&(c=$a.current,c!==null&&c.tag===13&&(c.flags|=16384))),tg(a,e)):Io(a)}function Io(e){var a=e;do{if((a.flags&32768)!==0){tg(a,dn);return}e=a.return;var s=Aj(a.alternate,a,Ur);if(s!==null){et=s;return}if(a=a.sibling,a!==null){et=a;return}et=a=e}while(a!==null);zt===0&&(zt=5)}function tg(e,a){do{var s=Dj(e.alternate,e);if(s!==null){s.flags&=32767,et=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(e=e.sibling,e!==null)){et=e;return}et=e=s}while(e!==null);zt=6,et=null}function ag(e,a,s,c,u,m,_,D,F){e.cancelPendingCommit=null;do Ho();while(la!==0);if((pt&6)!==0)throw Error(l(327));if(a!==null){if(a===e.current)throw Error(l(177));if(m=a.lanes|a.childLanes,m|=Bd,y1(e,s,m,_,D,F),e===Nt&&(et=Nt=null,ot=0),Hs=a,hn=e,Ps=s,$u=m,Zu=u,Z0=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,qj(we,function(){return ig(),null})):(e.callbackNode=null,e.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=C.T,C.T=null,u=U.p,U.p=2,_=pt,pt|=4;try{Mj(e,a,s)}finally{pt=_,U.p=u,C.T=c}}la=1,rg(),ng(),sg()}}function rg(){if(la===1){la=0;var e=hn,a=Hs,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=C.T,C.T=null;var c=U.p;U.p=2;var u=pt;pt|=4;try{F0(a,e);var m=cf,_=$p(e.containerInfo),D=m.focusedElem,F=m.selectionRange;if(_!==D&&D&&D.ownerDocument&&qp(D.ownerDocument.documentElement,D)){if(F!==null&&zd(D)){var J=F.start,oe=F.end;if(oe===void 0&&(oe=J),"selectionStart"in D)D.selectionStart=J,D.selectionEnd=Math.min(oe,D.value.length);else{var me=D.ownerDocument||document,te=me&&me.defaultView||window;if(te.getSelection){var re=te.getSelection(),Ie=D.textContent.length,Fe=Math.min(F.start,Ie),bt=F.end===void 0?Fe:Math.min(F.end,Ie);!re.extend&&Fe>bt&&(_=bt,bt=Fe,Fe=_);var Y=Pp(D,Fe),P=Pp(D,bt);if(Y&&P&&(re.rangeCount!==1||re.anchorNode!==Y.node||re.anchorOffset!==Y.offset||re.focusNode!==P.node||re.focusOffset!==P.offset)){var W=me.createRange();W.setStart(Y.node,Y.offset),re.removeAllRanges(),Fe>bt?(re.addRange(W),re.extend(P.node,P.offset)):(W.setEnd(P.node,P.offset),re.addRange(W))}}}}for(me=[],re=D;re=re.parentNode;)re.nodeType===1&&me.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<me.length;D++){var de=me[D];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}ec=!!of,cf=of=null}finally{pt=u,U.p=c,C.T=s}}e.current=a,la=2}}function ng(){if(la===2){la=0;var e=hn,a=Hs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=C.T,C.T=null;var c=U.p;U.p=2;var u=pt;pt|=4;try{z0(e,a.alternate,a)}finally{pt=u,U.p=c,C.T=s}}la=3}}function sg(){if(la===4||la===3){la=0,gt();var e=hn,a=Hs,s=Ps,c=Z0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?la=5:(la=0,Hs=hn=null,lg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(fn=null),pd(s),a=a.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Wt,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=C.T,u=U.p,U.p=2,C.T=null;try{for(var m=e.onRecoverableError,_=0;_<c.length;_++){var D=c[_];m(D.value,{componentStack:D.stack})}}finally{C.T=a,U.p=u}}(Ps&3)!==0&&Ho(),ur(e),u=e.pendingLanes,(s&4194090)!==0&&(u&42)!==0?e===Vu?ii++:(ii=0,Vu=e):ii=0,oi(0)}}function lg(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,Il(a)))}function Ho(e){return rg(),ng(),sg(),ig()}function ig(){if(la!==5)return!1;var e=hn,a=$u;$u=0;var s=pd(Ps),c=C.T,u=U.p;try{U.p=32>s?32:s,C.T=null,s=Zu,Zu=null;var m=hn,_=Ps;if(la=0,Hs=hn=null,Ps=0,(pt&6)!==0)throw Error(l(331));var D=pt;if(pt|=4,q0(m.current),I0(m,m.current,_,s),pt=D,oi(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Wt,m)}catch{}return!0}finally{U.p=u,C.T=c,lg(e,a)}}function og(e,a,s){a=Ia(s,a),a=Su(e.stateNode,a,2),e=an(e,a,2),e!==null&&(Sl(e,2),ur(e))}function vt(e,a,s){if(e.tag===3)og(e,e,s);else for(;a!==null;){if(a.tag===3){og(a,e,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(fn===null||!fn.has(c))){e=Ia(s,e),s=f0(2),c=an(a,s,2),c!==null&&(h0(s,c,a,e),Sl(c,2),ur(c));break}}a=a.return}}function Qu(e,a,s){var c=e.pingCache;if(c===null){c=e.pingCache=new Lj;var u=new Set;c.set(a,u)}else u=c.get(a),u===void 0&&(u=new Set,c.set(a,u));u.has(s)||(Iu=!0,u.add(s),e=Ij.bind(null,e,a,s),a.then(e,e))}function Ij(e,a,s){var c=e.pingCache;c!==null&&c.delete(a),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Nt===e&&(ot&s)===s&&(zt===4||zt===3&&(ot&62914560)===ot&&300>ce()-qu?(pt&2)===0&&qs(e,0):Hu|=s,Is===ot&&(Is=0)),ur(e)}function cg(e,a){a===0&&(a=sp()),e=_s(e,a),e!==null&&(Sl(e,a),ur(e))}function Hj(e){var a=e.memoizedState,s=0;a!==null&&(s=a.retryLane),cg(e,s)}function Pj(e,a){var s=0;switch(e.tag){case 13:var c=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:c=e.stateNode;break;case 22:c=e.stateNode._retryCache;break;default:throw Error(l(314))}c!==null&&c.delete(a),cg(e,s)}function qj(e,a){return it(e,a)}var Po=null,Zs=null,Wu=!1,qo=!1,Ju=!1,Qn=0;function ur(e){e!==Zs&&e.next===null&&(Zs===null?Po=Zs=e:Zs=Zs.next=e),qo=!0,Wu||(Wu=!0,Zj())}function oi(e,a){if(!Ju&&qo){Ju=!0;do for(var s=!1,c=Po;c!==null;){if(e!==0){var u=c.pendingLanes;if(u===0)var m=0;else{var _=c.suspendedLanes,D=c.pingedLanes;m=(1<<31-Tt(42|e)+1)-1,m&=u&~(_&~D),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,hg(c,m))}else m=ot,m=On(c,c===Nt?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(m&3)===0||Xr(c,m)||(s=!0,hg(c,m));c=c.next}while(s);Ju=!1}}function $j(){dg()}function dg(){qo=Wu=!1;var e=0;Qn!==0&&(ew()&&(e=Qn),Qn=0);for(var a=ce(),s=null,c=Po;c!==null;){var u=c.next,m=ug(c,a);m===0?(c.next=null,s===null?Po=u:s.next=u,u===null&&(Zs=s)):(s=c,(e!==0||(m&3)!==0)&&(qo=!0)),c=u}oi(e)}function ug(e,a){for(var s=e.suspendedLanes,c=e.pingedLanes,u=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var _=31-Tt(m),D=1<<_,F=u[_];F===-1?((D&s)===0||(D&c)!==0)&&(u[_]=x1(D,a)):F<=a&&(e.expiredLanes|=D),m&=~D}if(a=Nt,s=ot,s=On(e,e===a?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),c=e.callbackNode,s===0||e===a&&(mt===2||mt===9)||e.cancelPendingCommit!==null)return c!==null&&c!==null&&dt(c),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Xr(e,s)){if(a=s&-s,a===e.callbackPriority)return a;switch(c!==null&&dt(c),pd(s)){case 2:case 8:s=Re;break;case 32:s=we;break;case 268435456:s=ft;break;default:s=we}return c=fg.bind(null,e),s=it(s,c),e.callbackPriority=a,e.callbackNode=s,a}return c!==null&&c!==null&&dt(c),e.callbackPriority=2,e.callbackNode=null,2}function fg(e,a){if(la!==0&&la!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Ho()&&e.callbackNode!==s)return null;var c=ot;return c=On(e,e===Nt?c:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),c===0?null:(K0(e,c,a),ug(e,ce()),e.callbackNode!=null&&e.callbackNode===s?fg.bind(null,e):null)}function hg(e,a){if(Ho())return null;K0(e,a,!0)}function Zj(){aw(function(){(pt&6)!==0?it(ie,$j):dg()})}function ef(){return Qn===0&&(Qn=np()),Qn}function pg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:eo(""+e)}function mg(e,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,e.id&&s.setAttribute("form",e.id),a.parentNode.insertBefore(s,a),e=new FormData(e),s.parentNode.removeChild(s),e}function Vj(e,a,s,c,u){if(a==="submit"&&s&&s.stateNode===u){var m=pg((u[ya]||null).action),_=c.submitter;_&&(a=(a=_[ya]||null)?pg(a.formAction):_.getAttribute("formAction"),a!==null&&(m=a,_=null));var D=new no("action","action",null,c,u);e.push({event:D,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Qn!==0){var F=_?mg(u,_):new FormData(u);vu(s,{pending:!0,data:F,method:u.method,action:m},null,F)}}else typeof m=="function"&&(D.preventDefault(),F=_?mg(u,_):new FormData(u),vu(s,{pending:!0,data:F,method:u.method,action:m},m,F))},currentTarget:u}]})}}for(var tf=0;tf<Fd.length;tf++){var af=Fd[tf],Kj=af.toLowerCase(),Yj=af[0].toUpperCase()+af.slice(1);Ja(Kj,"on"+Yj)}Ja(Kp,"onAnimationEnd"),Ja(Yp,"onAnimationIteration"),Ja(Xp,"onAnimationStart"),Ja("dblclick","onDoubleClick"),Ja("focusin","onFocus"),Ja("focusout","onBlur"),Ja(fj,"onTransitionRun"),Ja(hj,"onTransitionStart"),Ja(pj,"onTransitionCancel"),Ja(Qp,"onTransitionEnd"),gs("onMouseEnter",["mouseout","mouseover"]),gs("onMouseLeave",["mouseout","mouseover"]),gs("onPointerEnter",["pointerout","pointerover"]),gs("onPointerLeave",["pointerout","pointerover"]),zn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zn("onBeforeInput",["compositionend","keypress","textInput","paste"]),zn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ci="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(" "),Xj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ci));function gg(e,a){a=(a&4)!==0;for(var s=0;s<e.length;s++){var c=e[s],u=c.event;c=c.listeners;e:{var m=void 0;if(a)for(var _=c.length-1;0<=_;_--){var D=c[_],F=D.instance,J=D.currentTarget;if(D=D.listener,F!==m&&u.isPropagationStopped())break e;m=D,u.currentTarget=J;try{m(u)}catch(oe){Ao(oe)}u.currentTarget=null,m=F}else for(_=0;_<c.length;_++){if(D=c[_],F=D.instance,J=D.currentTarget,D=D.listener,F!==m&&u.isPropagationStopped())break e;m=D,u.currentTarget=J;try{m(u)}catch(oe){Ao(oe)}u.currentTarget=null,m=F}}}}function tt(e,a){var s=a[md];s===void 0&&(s=a[md]=new Set);var c=e+"__bubble";s.has(c)||(xg(a,e,2,!1),s.add(c))}function rf(e,a,s){var c=0;a&&(c|=4),xg(s,e,c,a)}var $o="_reactListening"+Math.random().toString(36).slice(2);function nf(e){if(!e[$o]){e[$o]=!0,dp.forEach(function(s){s!=="selectionchange"&&(Xj.has(s)||rf(s,!1,e),rf(s,!0,e))});var a=e.nodeType===9?e:e.ownerDocument;a===null||a[$o]||(a[$o]=!0,rf("selectionchange",!1,a))}}function xg(e,a,s,c){switch(Ig(a)){case 2:var u=Nw;break;case 8:u=kw;break;default:u=bf}s=u.bind(null,a,s,e),u=void 0,!_d||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(u=!0),c?u!==void 0?e.addEventListener(a,s,{capture:!0,passive:u}):e.addEventListener(a,s,!0):u!==void 0?e.addEventListener(a,s,{passive:u}):e.addEventListener(a,s,!1)}function sf(e,a,s,c,u){var m=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var _=c.tag;if(_===3||_===4){var D=c.stateNode.containerInfo;if(D===u)break;if(_===4)for(_=c.return;_!==null;){var F=_.tag;if((F===3||F===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;D!==null;){if(_=hs(D),_===null)return;if(F=_.tag,F===5||F===6||F===26||F===27){c=m=_;continue e}D=D.parentNode}}c=c.return}kp(function(){var J=m,oe=kd(s),me=[];e:{var te=Wp.get(e);if(te!==void 0){var re=no,Ie=e;switch(e){case"keypress":if(ao(s)===0)break e;case"keydown":case"keyup":re=q1;break;case"focusin":Ie="focus",re=Rd;break;case"focusout":Ie="blur",re=Rd;break;case"beforeblur":case"afterblur":re=Rd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=D1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=V1;break;case Kp:case Yp:case Xp:re=z1;break;case Qp:re=Y1;break;case"scroll":case"scrollend":re=R1;break;case"wheel":re=Q1;break;case"copy":case"cut":case"paste":re=U1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Ep;break;case"toggle":case"beforetoggle":re=J1}var Fe=(a&4)!==0,bt=!Fe&&(e==="scroll"||e==="scrollend"),Y=Fe?te!==null?te+"Capture":null:te;Fe=[];for(var P=J,W;P!==null;){var de=P;if(W=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||W===null||Y===null||(de=Cl(P,Y),de!=null&&Fe.push(di(P,de,W))),bt)break;P=P.return}0<Fe.length&&(te=new re(te,Ie,null,s,oe),me.push({event:te,listeners:Fe}))}}if((a&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",re=e==="mouseout"||e==="pointerout",te&&s!==Nd&&(Ie=s.relatedTarget||s.fromElement)&&(hs(Ie)||Ie[fs]))break e;if((re||te)&&(te=oe.window===oe?oe:(te=oe.ownerDocument)?te.defaultView||te.parentWindow:window,re?(Ie=s.relatedTarget||s.toElement,re=J,Ie=Ie?hs(Ie):null,Ie!==null&&(bt=d(Ie),Fe=Ie.tag,Ie!==bt||Fe!==5&&Fe!==27&&Fe!==6)&&(Ie=null)):(re=null,Ie=J),re!==Ie)){if(Fe=Tp,de="onMouseLeave",Y="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(Fe=Ep,de="onPointerLeave",Y="onPointerEnter",P="pointer"),bt=re==null?te:Tl(re),W=Ie==null?te:Tl(Ie),te=new Fe(de,P+"leave",re,s,oe),te.target=bt,te.relatedTarget=W,de=null,hs(oe)===J&&(Fe=new Fe(Y,P+"enter",Ie,s,oe),Fe.target=W,Fe.relatedTarget=bt,de=Fe),bt=de,re&&Ie)t:{for(Fe=re,Y=Ie,P=0,W=Fe;W;W=Vs(W))P++;for(W=0,de=Y;de;de=Vs(de))W++;for(;0<P-W;)Fe=Vs(Fe),P--;for(;0<W-P;)Y=Vs(Y),W--;for(;P--;){if(Fe===Y||Y!==null&&Fe===Y.alternate)break t;Fe=Vs(Fe),Y=Vs(Y)}Fe=null}else Fe=null;re!==null&&yg(me,te,re,Fe,!1),Ie!==null&&bt!==null&&yg(me,bt,Ie,Fe,!0)}}e:{if(te=J?Tl(J):window,re=te.nodeName&&te.nodeName.toLowerCase(),re==="select"||re==="input"&&te.type==="file")var Ae=Up;else if(zp(te))if(Gp)Ae=cj;else{Ae=ij;var We=lj}else re=te.nodeName,!re||re.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&wd(J.elementType)&&(Ae=Up):Ae=oj;if(Ae&&(Ae=Ae(e,J))){Lp(me,Ae,s,oe);break e}We&&We(e,te,J),e==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&jd(te,"number",te.value)}switch(We=J?Tl(J):window,e){case"focusin":(zp(We)||We.contentEditable==="true")&&(Ns=We,Ld=J,Ll=null);break;case"focusout":Ll=Ld=Ns=null;break;case"mousedown":Ud=!0;break;case"contextmenu":case"mouseup":case"dragend":Ud=!1,Zp(me,s,oe);break;case"selectionchange":if(uj)break;case"keydown":case"keyup":Zp(me,s,oe)}var Oe;if(Dd)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else ws?Mp(e,s)&&(Be="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(Rp&&s.locale!=="ko"&&(ws||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&ws&&(Oe=Sp()):(Wr=oe,Td="value"in Wr?Wr.value:Wr.textContent,ws=!0)),We=Zo(J,Be),0<We.length&&(Be=new Cp(Be,e,null,s,oe),me.push({event:Be,listeners:We}),Oe?Be.data=Oe:(Oe=Op(s),Oe!==null&&(Be.data=Oe)))),(Oe=tj?aj(e,s):rj(e,s))&&(Be=Zo(J,"onBeforeInput"),0<Be.length&&(We=new Cp("onBeforeInput","beforeinput",null,s,oe),me.push({event:We,listeners:Be}),We.data=Oe)),Vj(me,e,J,s,oe)}gg(me,a)})}function di(e,a,s){return{instance:e,listener:a,currentTarget:s}}function Zo(e,a){for(var s=a+"Capture",c=[];e!==null;){var u=e,m=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||m===null||(u=Cl(e,s),u!=null&&c.unshift(di(e,u,m)),u=Cl(e,a),u!=null&&c.push(di(e,u,m))),e.tag===3)return c;e=e.return}return[]}function Vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function yg(e,a,s,c,u){for(var m=a._reactName,_=[];s!==null&&s!==c;){var D=s,F=D.alternate,J=D.stateNode;if(D=D.tag,F!==null&&F===c)break;D!==5&&D!==26&&D!==27||J===null||(F=J,u?(J=Cl(s,m),J!=null&&_.unshift(di(s,J,F))):u||(J=Cl(s,m),J!=null&&_.push(di(s,J,F)))),s=s.return}_.length!==0&&e.push({event:a,listeners:_})}var Qj=/\r\n?/g,Wj=/\u0000|\uFFFD/g;function bg(e){return(typeof e=="string"?e:""+e).replace(Qj,`
`).replace(Wj,"")}function vg(e,a){return a=bg(a),bg(e)===a}function Vo(){}function yt(e,a,s,c,u,m){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||bs(e,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&bs(e,""+c);break;case"className":Qi(e,"class",c);break;case"tabIndex":Qi(e,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Qi(e,s,c);break;case"style":wp(e,c,m);break;case"data":if(a!=="object"){Qi(e,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){e.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){e.removeAttribute(s);break}c=eo(""+c),e.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(s==="formAction"?(a!=="input"&&yt(e,a,"name",u.name,u,null),yt(e,a,"formEncType",u.formEncType,u,null),yt(e,a,"formMethod",u.formMethod,u,null),yt(e,a,"formTarget",u.formTarget,u,null)):(yt(e,a,"encType",u.encType,u,null),yt(e,a,"method",u.method,u,null),yt(e,a,"target",u.target,u,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){e.removeAttribute(s);break}c=eo(""+c),e.setAttribute(s,c);break;case"onClick":c!=null&&(e.onclick=Vo);break;case"onScroll":c!=null&&tt("scroll",e);break;case"onScrollEnd":c!=null&&tt("scrollend",e);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(s=c.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":e.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){e.removeAttribute("xlink:href");break}s=eo(""+c),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(s,""+c):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":c===!0?e.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(s,c):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?e.setAttribute(s,c):e.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?e.removeAttribute(s):e.setAttribute(s,c);break;case"popover":tt("beforetoggle",e),tt("toggle",e),Xi(e,"popover",c);break;case"xlinkActuate":kr(e,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":kr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":kr(e,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":kr(e,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":kr(e,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":kr(e,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":kr(e,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":kr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":kr(e,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Xi(e,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=C1.get(s)||s,Xi(e,s,c))}}function lf(e,a,s,c,u,m){switch(s){case"style":wp(e,c,m);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(s=c.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof c=="string"?bs(e,c):(typeof c=="number"||typeof c=="bigint")&&bs(e,""+c);break;case"onScroll":c!=null&&tt("scroll",e);break;case"onScrollEnd":c!=null&&tt("scrollend",e);break;case"onClick":c!=null&&(e.onclick=Vo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!up.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),a=s.slice(2,u?s.length-7:void 0),m=e[ya]||null,m=m!=null?m[s]:null,typeof m=="function"&&e.removeEventListener(a,m,u),typeof c=="function")){typeof m!="function"&&m!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(a,c,u);break e}s in e?e[s]=c:c===!0?e.setAttribute(s,""):Xi(e,s,c)}}}function ia(e,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",e),tt("load",e);var c=!1,u=!1,m;for(m in s)if(s.hasOwnProperty(m)){var _=s[m];if(_!=null)switch(m){case"src":c=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:yt(e,a,m,_,s,null)}}u&&yt(e,a,"srcSet",s.srcSet,s,null),c&&yt(e,a,"src",s.src,s,null);return;case"input":tt("invalid",e);var D=m=_=u=null,F=null,J=null;for(c in s)if(s.hasOwnProperty(c)){var oe=s[c];if(oe!=null)switch(c){case"name":u=oe;break;case"type":_=oe;break;case"checked":F=oe;break;case"defaultChecked":J=oe;break;case"value":m=oe;break;case"defaultValue":D=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,a));break;default:yt(e,a,c,oe,s,null)}}yp(e,m,D,F,J,_,u,!1),Wi(e);return;case"select":tt("invalid",e),c=_=m=null;for(u in s)if(s.hasOwnProperty(u)&&(D=s[u],D!=null))switch(u){case"value":m=D;break;case"defaultValue":_=D;break;case"multiple":c=D;default:yt(e,a,u,D,s,null)}a=m,s=_,e.multiple=!!c,a!=null?ys(e,!!c,a,!1):s!=null&&ys(e,!!c,s,!0);return;case"textarea":tt("invalid",e),m=u=c=null;for(_ in s)if(s.hasOwnProperty(_)&&(D=s[_],D!=null))switch(_){case"value":c=D;break;case"defaultValue":u=D;break;case"children":m=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(l(91));break;default:yt(e,a,_,D,s,null)}vp(e,c,u,m),Wi(e);return;case"option":for(F in s)if(s.hasOwnProperty(F)&&(c=s[F],c!=null))switch(F){case"selected":e.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:yt(e,a,F,c,s,null)}return;case"dialog":tt("beforetoggle",e),tt("toggle",e),tt("cancel",e),tt("close",e);break;case"iframe":case"object":tt("load",e);break;case"video":case"audio":for(c=0;c<ci.length;c++)tt(ci[c],e);break;case"image":tt("error",e),tt("load",e);break;case"details":tt("toggle",e);break;case"embed":case"source":case"link":tt("error",e),tt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in s)if(s.hasOwnProperty(J)&&(c=s[J],c!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:yt(e,a,J,c,s,null)}return;default:if(wd(a)){for(oe in s)s.hasOwnProperty(oe)&&(c=s[oe],c!==void 0&&lf(e,a,oe,c,s,void 0));return}}for(D in s)s.hasOwnProperty(D)&&(c=s[D],c!=null&&yt(e,a,D,c,s,null))}function Jj(e,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,m=null,_=null,D=null,F=null,J=null,oe=null;for(re in s){var me=s[re];if(s.hasOwnProperty(re)&&me!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":F=me;default:c.hasOwnProperty(re)||yt(e,a,re,null,c,me)}}for(var te in c){var re=c[te];if(me=s[te],c.hasOwnProperty(te)&&(re!=null||me!=null))switch(te){case"type":m=re;break;case"name":u=re;break;case"checked":J=re;break;case"defaultChecked":oe=re;break;case"value":_=re;break;case"defaultValue":D=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(l(137,a));break;default:re!==me&&yt(e,a,te,re,c,me)}}vd(e,_,D,F,J,oe,m,u);return;case"select":re=_=D=te=null;for(m in s)if(F=s[m],s.hasOwnProperty(m)&&F!=null)switch(m){case"value":break;case"multiple":re=F;default:c.hasOwnProperty(m)||yt(e,a,m,null,c,F)}for(u in c)if(m=c[u],F=s[u],c.hasOwnProperty(u)&&(m!=null||F!=null))switch(u){case"value":te=m;break;case"defaultValue":D=m;break;case"multiple":_=m;default:m!==F&&yt(e,a,u,m,c,F)}a=D,s=_,c=re,te!=null?ys(e,!!s,te,!1):!!c!=!!s&&(a!=null?ys(e,!!s,a,!0):ys(e,!!s,s?[]:"",!1));return;case"textarea":re=te=null;for(D in s)if(u=s[D],s.hasOwnProperty(D)&&u!=null&&!c.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:yt(e,a,D,null,c,u)}for(_ in c)if(u=c[_],m=s[_],c.hasOwnProperty(_)&&(u!=null||m!=null))switch(_){case"value":te=u;break;case"defaultValue":re=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==m&&yt(e,a,_,u,c,m)}bp(e,te,re);return;case"option":for(var Ie in s)if(te=s[Ie],s.hasOwnProperty(Ie)&&te!=null&&!c.hasOwnProperty(Ie))switch(Ie){case"selected":e.selected=!1;break;default:yt(e,a,Ie,null,c,te)}for(F in c)if(te=c[F],re=s[F],c.hasOwnProperty(F)&&te!==re&&(te!=null||re!=null))switch(F){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:yt(e,a,F,te,c,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Fe in s)te=s[Fe],s.hasOwnProperty(Fe)&&te!=null&&!c.hasOwnProperty(Fe)&&yt(e,a,Fe,null,c,te);for(J in c)if(te=c[J],re=s[J],c.hasOwnProperty(J)&&te!==re&&(te!=null||re!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(l(137,a));break;default:yt(e,a,J,te,c,re)}return;default:if(wd(a)){for(var bt in s)te=s[bt],s.hasOwnProperty(bt)&&te!==void 0&&!c.hasOwnProperty(bt)&&lf(e,a,bt,void 0,c,te);for(oe in c)te=c[oe],re=s[oe],!c.hasOwnProperty(oe)||te===re||te===void 0&&re===void 0||lf(e,a,oe,te,c,re);return}}for(var Y in s)te=s[Y],s.hasOwnProperty(Y)&&te!=null&&!c.hasOwnProperty(Y)&&yt(e,a,Y,null,c,te);for(me in c)te=c[me],re=s[me],!c.hasOwnProperty(me)||te===re||te==null&&re==null||yt(e,a,me,te,c,re)}var of=null,cf=null;function Ko(e){return e.nodeType===9?e:e.ownerDocument}function jg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wg(e,a){if(e===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&a==="foreignObject"?0:e}function df(e,a){return e==="textarea"||e==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var uf=null;function ew(){var e=window.event;return e&&e.type==="popstate"?e===uf?!1:(uf=e,!0):(uf=null,!1)}var Ng=typeof setTimeout=="function"?setTimeout:void 0,tw=typeof clearTimeout=="function"?clearTimeout:void 0,kg=typeof Promise=="function"?Promise:void 0,aw=typeof queueMicrotask=="function"?queueMicrotask:typeof kg<"u"?function(e){return kg.resolve(null).then(e).catch(rw)}:Ng;function rw(e){setTimeout(function(){throw e})}function mn(e){return e==="head"}function Sg(e,a){var s=a,c=0,u=0;do{var m=s.nextSibling;if(e.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"){if(0<c&&8>c){s=c;var _=e.ownerDocument;if(s&1&&ui(_.documentElement),s&2&&ui(_.body),s&4)for(s=_.head,ui(s),_=s.firstChild;_;){var D=_.nextSibling,F=_.nodeName;_[_l]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=D}}if(u===0){e.removeChild(m),bi(a);return}u--}else s==="$"||s==="$?"||s==="$!"?u++:c=s.charCodeAt(0)-48;else c=0;s=m}while(s);bi(a)}function ff(e){var a=e.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ff(s),gd(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function nw(e,a,s,c){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(c){if(!e[_l])switch(a){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(a==="input"&&e.type==="hidden"){var m=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=tr(e.nextSibling),e===null)break}return null}function sw(e,a,s){if(a==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=tr(e.nextSibling),e===null))return null;return e}function hf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function lw(e,a){var s=e.ownerDocument;if(e.data!=="$?"||s.readyState==="complete")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),e._reactRetry=c}}function tr(e){for(;e!=null;e=e.nextSibling){var a=e.nodeType;if(a===1||a===3)break;if(a===8){if(a=e.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return e}var pf=null;function _g(e){e=e.previousSibling;for(var a=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(a===0)return e;a--}else s==="/$"&&a++}e=e.previousSibling}return null}function Tg(e,a,s){switch(a=Ko(s),e){case"html":if(e=a.documentElement,!e)throw Error(l(452));return e;case"head":if(e=a.head,!e)throw Error(l(453));return e;case"body":if(e=a.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function ui(e){for(var a=e.attributes;a.length;)e.removeAttributeNode(a[0]);gd(e)}var Va=new Map,Cg=new Set;function Yo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Gr=U.d;U.d={f:iw,r:ow,D:cw,C:dw,L:uw,m:fw,X:pw,S:hw,M:mw};function iw(){var e=Gr.f(),a=Bo();return e||a}function ow(e){var a=ps(e);a!==null&&a.tag===5&&a.type==="form"?Km(a):Gr.r(e)}var Ks=typeof document>"u"?null:document;function Eg(e,a,s){var c=Ks;if(c&&typeof a=="string"&&a){var u=Ba(a);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Cg.has(u)||(Cg.add(u),e={rel:e,crossOrigin:s,href:a},c.querySelector(u)===null&&(a=c.createElement("link"),ia(a,"link",e),Jt(a),c.head.appendChild(a)))}}function cw(e){Gr.D(e),Eg("dns-prefetch",e,null)}function dw(e,a){Gr.C(e,a),Eg("preconnect",e,a)}function uw(e,a,s){Gr.L(e,a,s);var c=Ks;if(c&&e&&a){var u='link[rel="preload"][as="'+Ba(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Ba(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Ba(s.imageSizes)+'"]')):u+='[href="'+Ba(e)+'"]';var m=u;switch(a){case"style":m=Ys(e);break;case"script":m=Xs(e)}Va.has(m)||(e=y({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:e,as:a},s),Va.set(m,e),c.querySelector(u)!==null||a==="style"&&c.querySelector(fi(m))||a==="script"&&c.querySelector(hi(m))||(a=c.createElement("link"),ia(a,"link",e),Jt(a),c.head.appendChild(a)))}}function fw(e,a){Gr.m(e,a);var s=Ks;if(s&&e){var c=a&&typeof a.as=="string"?a.as:"script",u='link[rel="modulepreload"][as="'+Ba(c)+'"][href="'+Ba(e)+'"]',m=u;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Xs(e)}if(!Va.has(m)&&(e=y({rel:"modulepreload",href:e},a),Va.set(m,e),s.querySelector(u)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(hi(m)))return}c=s.createElement("link"),ia(c,"link",e),Jt(c),s.head.appendChild(c)}}}function hw(e,a,s){Gr.S(e,a,s);var c=Ks;if(c&&e){var u=ms(c).hoistableStyles,m=Ys(e);a=a||"default";var _=u.get(m);if(!_){var D={loading:0,preload:null};if(_=c.querySelector(fi(m)))D.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":a},s),(s=Va.get(m))&&mf(e,s);var F=_=c.createElement("link");Jt(F),ia(F,"link",e),F._p=new Promise(function(J,oe){F.onload=J,F.onerror=oe}),F.addEventListener("load",function(){D.loading|=1}),F.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Xo(_,a,c)}_={type:"stylesheet",instance:_,count:1,state:D},u.set(m,_)}}}function pw(e,a){Gr.X(e,a);var s=Ks;if(s&&e){var c=ms(s).hoistableScripts,u=Xs(e),m=c.get(u);m||(m=s.querySelector(hi(u)),m||(e=y({src:e,async:!0},a),(a=Va.get(u))&&gf(e,a),m=s.createElement("script"),Jt(m),ia(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(u,m))}}function mw(e,a){Gr.M(e,a);var s=Ks;if(s&&e){var c=ms(s).hoistableScripts,u=Xs(e),m=c.get(u);m||(m=s.querySelector(hi(u)),m||(e=y({src:e,async:!0,type:"module"},a),(a=Va.get(u))&&gf(e,a),m=s.createElement("script"),Jt(m),ia(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(u,m))}}function Rg(e,a,s,c){var u=(u=ve.current)?Yo(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Ys(s.href),s=ms(u).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ys(s.href);var m=ms(u).hoistableStyles,_=m.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,_),(m=u.querySelector(fi(e)))&&!m._p&&(_.instance=m,_.state.loading=5),Va.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Va.set(e,s),m||gw(u,e,s,_.state))),a&&c===null)throw Error(l(528,""));return _}if(a&&c!==null)throw Error(l(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Xs(s),s=ms(u).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Ys(e){return'href="'+Ba(e)+'"'}function fi(e){return'link[rel="stylesheet"]['+e+"]"}function Ag(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function gw(e,a,s,c){e.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=e.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),ia(a,"link",s),Jt(a),e.head.appendChild(a))}function Xs(e){return'[src="'+Ba(e)+'"]'}function hi(e){return"script[async]"+e}function Dg(e,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=e.querySelector('style[data-href~="'+Ba(s.href)+'"]');if(c)return a.instance=c,Jt(c),c;var u=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(e.ownerDocument||e).createElement("style"),Jt(c),ia(c,"style",u),Xo(c,s.precedence,e),a.instance=c;case"stylesheet":u=Ys(s.href);var m=e.querySelector(fi(u));if(m)return a.state.loading|=4,a.instance=m,Jt(m),m;c=Ag(s),(u=Va.get(u))&&mf(c,u),m=(e.ownerDocument||e).createElement("link"),Jt(m);var _=m;return _._p=new Promise(function(D,F){_.onload=D,_.onerror=F}),ia(m,"link",c),a.state.loading|=4,Xo(m,s.precedence,e),a.instance=m;case"script":return m=Xs(s.src),(u=e.querySelector(hi(m)))?(a.instance=u,Jt(u),u):(c=s,(u=Va.get(m))&&(c=y({},s),gf(c,u)),e=e.ownerDocument||e,u=e.createElement("script"),Jt(u),ia(u,"link",c),e.head.appendChild(u),a.instance=u);case"void":return null;default:throw Error(l(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Xo(c,s.precedence,e));return a.instance}function Xo(e,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=c.length?c[c.length-1]:null,m=u,_=0;_<c.length;_++){var D=c[_];if(D.dataset.precedence===a)m=D;else if(m!==u)break}m?m.parentNode.insertBefore(e,m.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(e,a.firstChild))}function mf(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.title==null&&(e.title=a.title)}function gf(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.integrity==null&&(e.integrity=a.integrity)}var Qo=null;function Mg(e,a,s){if(Qo===null){var c=new Map,u=Qo=new Map;u.set(s,c)}else u=Qo,c=u.get(s),c||(c=new Map,u.set(s,c));if(c.has(e))return c;for(c.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var m=s[u];if(!(m[_l]||m[ua]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var _=m.getAttribute(a)||"";_=e+_;var D=c.get(_);D?D.push(m):c.set(_,[m])}}return c}function Og(e,a,s){e=e.ownerDocument||e,e.head.insertBefore(s,a==="title"?e.querySelector("head > title"):null)}function xw(e,a,s){if(s===1||a.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return e=a.disabled,typeof a.precedence=="string"&&e==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function zg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var pi=null;function yw(){}function bw(e,a,s){if(pi===null)throw Error(l(475));var c=pi;if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Ys(s.href),m=e.querySelector(fi(u));if(m){e=m._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(c.count++,c=Wo.bind(c),e.then(c,c)),a.state.loading|=4,a.instance=m,Jt(m);return}m=e.ownerDocument||e,s=Ag(s),(u=Va.get(u))&&mf(s,u),m=m.createElement("link"),Jt(m);var _=m;_._p=new Promise(function(D,F){_.onload=D,_.onerror=F}),ia(m,"link",s),a.instance=m}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(c.count++,a=Wo.bind(c),e.addEventListener("load",a),e.addEventListener("error",a))}}function vw(){if(pi===null)throw Error(l(475));var e=pi;return e.stylesheets&&e.count===0&&xf(e,e.stylesheets),0<e.count?function(a){var s=setTimeout(function(){if(e.stylesheets&&xf(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s)}}:null}function Wo(){if(this.count--,this.count===0){if(this.stylesheets)xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jo=null;function xf(e,a){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jo=new Map,a.forEach(jw,e),Jo=null,Wo.call(e))}function jw(e,a){if(!(a.state.loading&4)){var s=Jo.get(e);if(s)var c=s.get(null);else{s=new Map,Jo.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<u.length;m++){var _=u[m];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),c=_)}c&&s.set(null,c)}u=a.instance,_=u.getAttribute("data-precedence"),m=s.get(_)||c,m===c&&s.set(null,u),s.set(_,u),this.count++,c=Wo.bind(this),u.addEventListener("load",c),u.addEventListener("error",c),m?m.parentNode.insertBefore(u,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),a.state.loading|=4}}var mi={$$typeof:O,Provider:null,Consumer:null,_currentValue:T,_currentValue2:T,_threadCount:0};function ww(e,a,s,c,u,m,_,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fd(0),this.hiddenUpdates=fd(null),this.identifierPrefix=c,this.onUncaughtError=u,this.onCaughtError=m,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Lg(e,a,s,c,u,m,_,D,F,J,oe,me){return e=new ww(e,a,s,_,D,F,J,me),a=1,m===!0&&(a|=24),m=Ca(3,null,null,a),e.current=m,m.stateNode=e,a=Qd(),a.refCount++,e.pooledCache=a,a.refCount++,m.memoizedState={element:c,isDehydrated:s,cache:a},tu(m),e}function Ug(e){return e?(e=Ts,e):Ts}function Gg(e,a,s,c,u,m){u=Ug(u),c.context===null?c.context=u:c.pendingContext=u,c=tn(a),c.payload={element:s},m=m===void 0?null:m,m!==null&&(c.callback=m),s=an(e,c,a),s!==null&&(Ma(s,e,a),$l(s,e,a))}function Fg(e,a){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<a?s:a}}function yf(e,a){Fg(e,a),(e=e.alternate)&&Fg(e,a)}function Bg(e){if(e.tag===13){var a=_s(e,67108864);a!==null&&Ma(a,e,67108864),yf(e,67108864)}}var ec=!0;function Nw(e,a,s,c){var u=C.T;C.T=null;var m=U.p;try{U.p=2,bf(e,a,s,c)}finally{U.p=m,C.T=u}}function kw(e,a,s,c){var u=C.T;C.T=null;var m=U.p;try{U.p=8,bf(e,a,s,c)}finally{U.p=m,C.T=u}}function bf(e,a,s,c){if(ec){var u=vf(c);if(u===null)sf(e,a,c,tc,s),Hg(e,c);else if(_w(u,e,a,s,c))c.stopPropagation();else if(Hg(e,c),a&4&&-1<Sw.indexOf(e)){for(;u!==null;){var m=ps(u);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var _=Ga(m.pendingLanes);if(_!==0){var D=m;for(D.pendingLanes|=2,D.entangledLanes|=2;_;){var F=1<<31-Tt(_);D.entanglements[1]|=F,_&=~F}ur(m),(pt&6)===0&&(Go=ce()+500,oi(0))}}break;case 13:D=_s(m,2),D!==null&&Ma(D,m,2),Bo(),yf(m,2)}if(m=vf(c),m===null&&sf(e,a,c,tc,s),m===u)break;u=m}u!==null&&c.stopPropagation()}else sf(e,a,c,null,s)}}function vf(e){return e=kd(e),jf(e)}var tc=null;function jf(e){if(tc=null,e=hs(e),e!==null){var a=d(e);if(a===null)e=null;else{var s=a.tag;if(s===13){if(e=f(a),e!==null)return e;e=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;e=null}else a!==e&&(e=null)}}return tc=e,null}function Ig(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pe()){case ie:return 2;case Re:return 8;case we:case ke:return 32;case ft:return 268435456;default:return 32}default:return 32}}var wf=!1,gn=null,xn=null,yn=null,gi=new Map,xi=new Map,bn=[],Sw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hg(e,a){switch(e){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":xn=null;break;case"mouseover":case"mouseout":yn=null;break;case"pointerover":case"pointerout":gi.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":xi.delete(a.pointerId)}}function yi(e,a,s,c,u,m){return e===null||e.nativeEvent!==m?(e={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:m,targetContainers:[u]},a!==null&&(a=ps(a),a!==null&&Bg(a)),e):(e.eventSystemFlags|=c,a=e.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),e)}function _w(e,a,s,c,u){switch(a){case"focusin":return gn=yi(gn,e,a,s,c,u),!0;case"dragenter":return xn=yi(xn,e,a,s,c,u),!0;case"mouseover":return yn=yi(yn,e,a,s,c,u),!0;case"pointerover":var m=u.pointerId;return gi.set(m,yi(gi.get(m)||null,e,a,s,c,u)),!0;case"gotpointercapture":return m=u.pointerId,xi.set(m,yi(xi.get(m)||null,e,a,s,c,u)),!0}return!1}function Pg(e){var a=hs(e.target);if(a!==null){var s=d(a);if(s!==null){if(a=s.tag,a===13){if(a=f(s),a!==null){e.blockedOn=a,b1(e.priority,function(){if(s.tag===13){var c=Da();c=hd(c);var u=_s(s,c);u!==null&&Ma(u,s,c),yf(s,c)}});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ac(e){if(e.blockedOn!==null)return!1;for(var a=e.targetContainers;0<a.length;){var s=vf(e.nativeEvent);if(s===null){s=e.nativeEvent;var c=new s.constructor(s.type,s);Nd=c,s.target.dispatchEvent(c),Nd=null}else return a=ps(s),a!==null&&Bg(a),e.blockedOn=s,!1;a.shift()}return!0}function qg(e,a,s){ac(e)&&s.delete(a)}function Tw(){wf=!1,gn!==null&&ac(gn)&&(gn=null),xn!==null&&ac(xn)&&(xn=null),yn!==null&&ac(yn)&&(yn=null),gi.forEach(qg),xi.forEach(qg)}function rc(e,a){e.blockedOn===a&&(e.blockedOn=null,wf||(wf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Tw)))}var nc=null;function $g(e){nc!==e&&(nc=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){nc===e&&(nc=null);for(var a=0;a<e.length;a+=3){var s=e[a],c=e[a+1],u=e[a+2];if(typeof c!="function"){if(jf(c||s)===null)continue;break}var m=ps(s);m!==null&&(e.splice(a,3),a-=3,vu(m,{pending:!0,data:u,method:s.method,action:c},c,u))}}))}function bi(e){function a(F){return rc(F,e)}gn!==null&&rc(gn,e),xn!==null&&rc(xn,e),yn!==null&&rc(yn,e),gi.forEach(a),xi.forEach(a);for(var s=0;s<bn.length;s++){var c=bn[s];c.blockedOn===e&&(c.blockedOn=null)}for(;0<bn.length&&(s=bn[0],s.blockedOn===null);)Pg(s),s.blockedOn===null&&bn.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var u=s[c],m=s[c+1],_=u[ya]||null;if(typeof m=="function")_||$g(s);else if(_){var D=null;if(m&&m.hasAttribute("formAction")){if(u=m,_=m[ya]||null)D=_.formAction;else if(jf(u)!==null)continue}else D=_.action;typeof D=="function"?s[c+1]=D:(s.splice(c,3),c-=3),$g(s)}}}function Nf(e){this._internalRoot=e}sc.prototype.render=Nf.prototype.render=function(e){var a=this._internalRoot;if(a===null)throw Error(l(409));var s=a.current,c=Da();Gg(s,c,e,a,null,null)},sc.prototype.unmount=Nf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var a=e.containerInfo;Gg(e.current,2,null,e,null,null),Bo(),a[fs]=null}};function sc(e){this._internalRoot=e}sc.prototype.unstable_scheduleHydration=function(e){if(e){var a=op();e={blockedOn:null,target:e,priority:a};for(var s=0;s<bn.length&&a!==0&&a<bn[s].priority;s++);bn.splice(s,0,e),s===0&&Pg(e)}};var Zg=n.version;if(Zg!=="19.1.0")throw Error(l(527,Zg,"19.1.0"));U.findDOMNode=function(e){var a=e._reactInternals;if(a===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=g(a),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var Cw={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lc.isDisabled&&lc.supportsFiber)try{Wt=lc.inject(Cw),ht=lc}catch{}}return ji.createRoot=function(e,a){if(!o(e))throw Error(l(299));var s=!1,c="",u=o0,m=c0,_=d0,D=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(m=a.onCaughtError),a.onRecoverableError!==void 0&&(_=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(D=a.unstable_transitionCallbacks)),a=Lg(e,1,!1,null,null,s,c,u,m,_,D,null),e[fs]=a.current,nf(e),new Nf(a)},ji.hydrateRoot=function(e,a,s){if(!o(e))throw Error(l(299));var c=!1,u="",m=o0,_=c0,D=d0,F=null,J=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(D=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(F=s.unstable_transitionCallbacks),s.formState!==void 0&&(J=s.formState)),a=Lg(e,1,!0,a,s??null,c,u,m,_,D,F,J),a.context=Ug(null),s=a.current,c=Da(),c=hd(c),u=tn(c),u.callback=null,an(s,u,c),s=c,a.current.lanes=s,Sl(a,s),ur(a),e[fs]=a.current,nf(e),new sc(a)},ji.version="19.1.0",ji}var ax;function Hw(){if(ax)return _f.exports;ax=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),_f.exports=Iw(),_f.exports}var Pw=Hw(),wi={},rx;function qw(){if(rx)return wi;rx=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.parse=f,wi.serialize=p;const r=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,n=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,l=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,d=(()=>{const j=function(){};return j.prototype=Object.create(null),j})();function f(j,N){const w=new d,S=j.length;if(S<2)return w;const E=(N==null?void 0:N.decode)||y;let k=0;do{const A=j.indexOf("=",k);if(A===-1)break;const O=j.indexOf(";",k),L=O===-1?S:O;if(A>L){k=j.lastIndexOf(";",A-1)+1;continue}const B=h(j,k,A),V=g(j,A,B),$=j.slice(B,V);if(w[$]===void 0){let le=h(j,A+1,L),q=g(j,L,le);const K=E(j.slice(le,q));w[$]=K}k=L+1}while(k<S);return w}function h(j,N,w){do{const S=j.charCodeAt(N);if(S!==32&&S!==9)return N}while(++N<w);return w}function g(j,N,w){for(;N>w;){const S=j.charCodeAt(--N);if(S!==32&&S!==9)return N+1}return w}function p(j,N,w){const S=(w==null?void 0:w.encode)||encodeURIComponent;if(!r.test(j))throw new TypeError(`argument name is invalid: ${j}`);const E=S(N);if(!n.test(E))throw new TypeError(`argument val is invalid: ${N}`);let k=j+"="+E;if(!w)return k;if(w.maxAge!==void 0){if(!Number.isInteger(w.maxAge))throw new TypeError(`option maxAge is invalid: ${w.maxAge}`);k+="; Max-Age="+w.maxAge}if(w.domain){if(!i.test(w.domain))throw new TypeError(`option domain is invalid: ${w.domain}`);k+="; Domain="+w.domain}if(w.path){if(!l.test(w.path))throw new TypeError(`option path is invalid: ${w.path}`);k+="; Path="+w.path}if(w.expires){if(!b(w.expires)||!Number.isFinite(w.expires.valueOf()))throw new TypeError(`option expires is invalid: ${w.expires}`);k+="; Expires="+w.expires.toUTCString()}if(w.httpOnly&&(k+="; HttpOnly"),w.secure&&(k+="; Secure"),w.partitioned&&(k+="; Partitioned"),w.priority)switch(typeof w.priority=="string"?w.priority.toLowerCase():void 0){case"low":k+="; Priority=Low";break;case"medium":k+="; Priority=Medium";break;case"high":k+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${w.priority}`)}if(w.sameSite)switch(typeof w.sameSite=="string"?w.sameSite.toLowerCase():w.sameSite){case!0:case"strict":k+="; SameSite=Strict";break;case"lax":k+="; SameSite=Lax";break;case"none":k+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${w.sameSite}`)}return k}function y(j){if(j.indexOf("%")===-1)return j;try{return decodeURIComponent(j)}catch{return j}}function b(j){return o.call(j)==="[object Date]"}return wi}qw();var nx="popstate";function $w(r={}){function n(l,o){let{pathname:d,search:f,hash:h}=l.location;return Yf("",{pathname:d,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function i(l,o){return typeof o=="string"?o:Oi(o)}return Vw(n,i,null,r)}function Rt(r,n){if(r===!1||r===null||typeof r>"u")throw new Error(n)}function Ya(r,n){if(!r){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Zw(){return Math.random().toString(36).substring(2,10)}function sx(r,n){return{usr:r.state,key:r.key,idx:n}}function Yf(r,n,i=null,l){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof n=="string"?dl(n):n,state:i,key:n&&n.key||l||Zw()}}function Oi({pathname:r="/",search:n="",hash:i=""}){return n&&n!=="?"&&(r+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(r+=i.charAt(0)==="#"?i:"#"+i),r}function dl(r){let n={};if(r){let i=r.indexOf("#");i>=0&&(n.hash=r.substring(i),r=r.substring(0,i));let l=r.indexOf("?");l>=0&&(n.search=r.substring(l),r=r.substring(0,l)),r&&(n.pathname=r)}return n}function Vw(r,n,i,l={}){let{window:o=document.defaultView,v5Compat:d=!1}=l,f=o.history,h="POP",g=null,p=y();p==null&&(p=0,f.replaceState({...f.state,idx:p},""));function y(){return(f.state||{idx:null}).idx}function b(){h="POP";let E=y(),k=E==null?null:E-p;p=E,g&&g({action:h,location:S.location,delta:k})}function j(E,k){h="PUSH";let A=Yf(S.location,E,k);p=y()+1;let O=sx(A,p),L=S.createHref(A);try{f.pushState(O,"",L)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;o.location.assign(L)}d&&g&&g({action:h,location:S.location,delta:1})}function N(E,k){h="REPLACE";let A=Yf(S.location,E,k);p=y();let O=sx(A,p),L=S.createHref(A);f.replaceState(O,"",L),d&&g&&g({action:h,location:S.location,delta:0})}function w(E){return Kw(E)}let S={get action(){return h},get location(){return r(o,f)},listen(E){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(nx,b),g=E,()=>{o.removeEventListener(nx,b),g=null}},createHref(E){return n(o,E)},createURL:w,encodeLocation(E){let k=w(E);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:j,replace:N,go(E){return f.go(E)}};return S}function Kw(r,n=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Rt(i,"No window.location.(origin|href) available to create URL");let l=typeof r=="string"?r:Oi(r);return l=l.replace(/ $/,"%20"),!n&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function zy(r,n,i="/"){return Yw(r,n,i,!1)}function Yw(r,n,i,l){let o=typeof n=="string"?dl(n):n,d=qr(o.pathname||"/",i);if(d==null)return null;let f=Ly(r);Xw(f);let h=null;for(let g=0;h==null&&g<f.length;++g){let p=i2(d);h=s2(f[g],p,l)}return h}function Ly(r,n=[],i=[],l=""){let o=(d,f,h)=>{let g={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};g.relativePath.startsWith("/")&&(Rt(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length));let p=Ir([l,g.relativePath]),y=i.concat(g);d.children&&d.children.length>0&&(Rt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Ly(d.children,n,y,p)),!(d.path==null&&!d.index)&&n.push({path:p,score:r2(p,d.index),routesMeta:y})};return r.forEach((d,f)=>{var h;if(d.path===""||!((h=d.path)!=null&&h.includes("?")))o(d,f);else for(let g of Uy(d.path))o(d,f,g)}),n}function Uy(r){let n=r.split("/");if(n.length===0)return[];let[i,...l]=n,o=i.endsWith("?"),d=i.replace(/\?$/,"");if(l.length===0)return o?[d,""]:[d];let f=Uy(l.join("/")),h=[];return h.push(...f.map(g=>g===""?d:[d,g].join("/"))),o&&h.push(...f),h.map(g=>r.startsWith("/")&&g===""?"/":g)}function Xw(r){r.sort((n,i)=>n.score!==i.score?i.score-n.score:n2(n.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var Qw=/^:[\w-]+$/,Ww=3,Jw=2,e2=1,t2=10,a2=-2,lx=r=>r==="*";function r2(r,n){let i=r.split("/"),l=i.length;return i.some(lx)&&(l+=a2),n&&(l+=Jw),i.filter(o=>!lx(o)).reduce((o,d)=>o+(Qw.test(d)?Ww:d===""?e2:t2),l)}function n2(r,n){return r.length===n.length&&r.slice(0,-1).every((l,o)=>l===n[o])?r[r.length-1]-n[n.length-1]:0}function s2(r,n,i=!1){let{routesMeta:l}=r,o={},d="/",f=[];for(let h=0;h<l.length;++h){let g=l[h],p=h===l.length-1,y=d==="/"?n:n.slice(d.length)||"/",b=Sc({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},y),j=g.route;if(!b&&p&&i&&!l[l.length-1].route.index&&(b=Sc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!b)return null;Object.assign(o,b.params),f.push({params:o,pathname:Ir([d,b.pathname]),pathnameBase:u2(Ir([d,b.pathnameBase])),route:j}),b.pathnameBase!=="/"&&(d=Ir([d,b.pathnameBase]))}return f}function Sc(r,n){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[i,l]=l2(r.path,r.caseSensitive,r.end),o=n.match(i);if(!o)return null;let d=o[0],f=d.replace(/(.)\/+$/,"$1"),h=o.slice(1);return{params:l.reduce((p,{paramName:y,isOptional:b},j)=>{if(y==="*"){let w=h[j]||"";f=d.slice(0,d.length-w.length).replace(/(.)\/+$/,"$1")}const N=h[j];return b&&!N?p[y]=void 0:p[y]=(N||"").replace(/%2F/g,"/"),p},{}),pathname:d,pathnameBase:f,pattern:r}}function l2(r,n=!1,i=!0){Ya(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let l=[],o="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,g)=>(l.push({paramName:h,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(l.push({paramName:"*"}),o+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":r!==""&&r!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),l]}function i2(r){try{return r.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Ya(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),r}}function qr(r,n){if(n==="/")return r;if(!r.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,l=r.charAt(i);return l&&l!=="/"?null:r.slice(i)||"/"}function o2(r,n="/"){let{pathname:i,search:l="",hash:o=""}=typeof r=="string"?dl(r):r;return{pathname:i?i.startsWith("/")?i:c2(i,n):n,search:f2(l),hash:h2(o)}}function c2(r,n){let i=n.replace(/\/+$/,"").split("/");return r.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function Rf(r,n,i,l){return`Cannot include a '${r}' character in a manually specified \`to.${n}\` field [${JSON.stringify(l)}].  Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function d2(r){return r.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function wh(r){let n=d2(r);return n.map((i,l)=>l===n.length-1?i.pathname:i.pathnameBase)}function Nh(r,n,i,l=!1){let o;typeof r=="string"?o=dl(r):(o={...r},Rt(!o.pathname||!o.pathname.includes("?"),Rf("?","pathname","search",o)),Rt(!o.pathname||!o.pathname.includes("#"),Rf("#","pathname","hash",o)),Rt(!o.search||!o.search.includes("#"),Rf("#","search","hash",o)));let d=r===""||o.pathname==="",f=d?"/":o.pathname,h;if(f==null)h=i;else{let b=n.length-1;if(!l&&f.startsWith("..")){let j=f.split("/");for(;j[0]==="..";)j.shift(),b-=1;o.pathname=j.join("/")}h=b>=0?n[b]:"/"}let g=o2(o,h),p=f&&f!=="/"&&f.endsWith("/"),y=(d||f===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(p||y)&&(g.pathname+="/"),g}var Ir=r=>r.join("/").replace(/\/\/+/g,"/"),u2=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),f2=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,h2=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function p2(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}var Gy=["POST","PUT","PATCH","DELETE"];new Set(Gy);var m2=["GET",...Gy];new Set(m2);var ul=x.createContext(null);ul.displayName="DataRouter";var Hc=x.createContext(null);Hc.displayName="DataRouterState";var Fy=x.createContext({isTransitioning:!1});Fy.displayName="ViewTransition";var g2=x.createContext(new Map);g2.displayName="Fetchers";var x2=x.createContext(null);x2.displayName="Await";var sr=x.createContext(null);sr.displayName="Navigation";var Fi=x.createContext(null);Fi.displayName="Location";var Wa=x.createContext({outlet:null,matches:[],isDataRoute:!1});Wa.displayName="Route";var kh=x.createContext(null);kh.displayName="RouteError";function y2(r,{relative:n}={}){Rt(fl(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=x.useContext(sr),{hash:o,pathname:d,search:f}=Bi(r,{relative:n}),h=d;return i!=="/"&&(h=d==="/"?i:Ir([i,d])),l.createHref({pathname:h,search:f,hash:o})}function fl(){return x.useContext(Fi)!=null}function za(){return Rt(fl(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Fi).location}var By="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Iy(r){x.useContext(sr).static||x.useLayoutEffect(r)}function St(){let{isDataRoute:r}=x.useContext(Wa);return r?D2():b2()}function b2(){Rt(fl(),"useNavigate() may be used only in the context of a <Router> component.");let r=x.useContext(ul),{basename:n,navigator:i}=x.useContext(sr),{matches:l}=x.useContext(Wa),{pathname:o}=za(),d=JSON.stringify(wh(l)),f=x.useRef(!1);return Iy(()=>{f.current=!0}),x.useCallback((g,p={})=>{if(Ya(f.current,By),!f.current)return;if(typeof g=="number"){i.go(g);return}let y=Nh(g,JSON.parse(d),o,p.relative==="path");r==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Ir([n,y.pathname])),(p.replace?i.replace:i.push)(y,p.state,p)},[n,i,d,o,r])}var Hy=x.createContext(null);function Sh(){return x.useContext(Hy)}function v2(r){let n=x.useContext(Wa).outlet;return n&&x.createElement(Hy.Provider,{value:r},n)}function da(){let{matches:r}=x.useContext(Wa),n=r[r.length-1];return n?n.params:{}}function Bi(r,{relative:n}={}){let{matches:i}=x.useContext(Wa),{pathname:l}=za(),o=JSON.stringify(wh(i));return x.useMemo(()=>Nh(r,JSON.parse(o),l,n==="path"),[r,o,l,n])}function j2(r,n){return Py(r,n)}function Py(r,n,i,l){var k;Rt(fl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(sr),{matches:d}=x.useContext(Wa),f=d[d.length-1],h=f?f.params:{},g=f?f.pathname:"/",p=f?f.pathnameBase:"/",y=f&&f.route;{let A=y&&y.path||"";qy(g,!y||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=za(),j;if(n){let A=typeof n=="string"?dl(n):n;Rt(p==="/"||((k=A.pathname)==null?void 0:k.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${A.pathname}" was given in the \`location\` prop.`),j=A}else j=b;let N=j.pathname||"/",w=N;if(p!=="/"){let A=p.replace(/^\//,"").split("/");w="/"+N.replace(/^\//,"").split("/").slice(A.length).join("/")}let S=zy(r,{pathname:w});Ya(y||S!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),Ya(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=_2(S&&S.map(A=>Object.assign({},A,{params:Object.assign({},h,A.params),pathname:Ir([p,o.encodeLocation?o.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?p:Ir([p,o.encodeLocation?o.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),d,i,l);return n&&E?x.createElement(Fi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...j},navigationType:"POP"}},E):E}function w2(){let r=A2(),n=p2(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),i=r instanceof Error?r.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",r),f=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:d},"ErrorBoundary")," or"," ",x.createElement("code",{style:d},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),i?x.createElement("pre",{style:o},i):null,f)}var N2=x.createElement(w2,null),k2=class extends x.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,n){return n.location!==r.location||n.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:n.error,location:n.location,revalidation:r.revalidation||n.revalidation}}componentDidCatch(r,n){console.error("React Router caught the following error during render",r,n)}render(){return this.state.error!==void 0?x.createElement(Wa.Provider,{value:this.props.routeContext},x.createElement(kh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function S2({routeContext:r,match:n,children:i}){let l=x.useContext(ul);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Wa.Provider,{value:r},i)}function _2(r,n=[],i=null,l=null){if(r==null){if(!i)return null;if(i.errors)r=i.matches;else if(n.length===0&&!i.initialized&&i.matches.length>0)r=i.matches;else return null}let o=r,d=i==null?void 0:i.errors;if(d!=null){let g=o.findIndex(p=>p.route.id&&(d==null?void 0:d[p.route.id])!==void 0);Rt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),o=o.slice(0,Math.min(o.length,g+1))}let f=!1,h=-1;if(i)for(let g=0;g<o.length;g++){let p=o[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=g),p.route.id){let{loaderData:y,errors:b}=i,j=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||j){f=!0,h>=0?o=o.slice(0,h+1):o=[o[0]];break}}}return o.reduceRight((g,p,y)=>{let b,j=!1,N=null,w=null;i&&(b=d&&p.route.id?d[p.route.id]:void 0,N=p.route.errorElement||N2,f&&(h<0&&y===0?(qy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,w=null):h===y&&(j=!0,w=p.route.hydrateFallbackElement||null)));let S=n.concat(o.slice(0,y+1)),E=()=>{let k;return b?k=N:j?k=w:p.route.Component?k=x.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=g,x.createElement(S2,{match:p,routeContext:{outlet:g,matches:S,isDataRoute:i!=null},children:k})};return i&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?x.createElement(k2,{location:i.location,revalidation:i.revalidation,component:N,error:b,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):E()},null)}function _h(r){return`${r} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function T2(r){let n=x.useContext(ul);return Rt(n,_h(r)),n}function C2(r){let n=x.useContext(Hc);return Rt(n,_h(r)),n}function E2(r){let n=x.useContext(Wa);return Rt(n,_h(r)),n}function Th(r){let n=E2(r),i=n.matches[n.matches.length-1];return Rt(i.route.id,`${r} can only be used on routes that contain a unique "id"`),i.route.id}function R2(){return Th("useRouteId")}function A2(){var l;let r=x.useContext(kh),n=C2("useRouteError"),i=Th("useRouteError");return r!==void 0?r:(l=n.errors)==null?void 0:l[i]}function D2(){let{router:r}=T2("useNavigate"),n=Th("useNavigate"),i=x.useRef(!1);return Iy(()=>{i.current=!0}),x.useCallback(async(o,d={})=>{Ya(i.current,By),i.current&&(typeof o=="number"?r.navigate(o):await r.navigate(o,{fromRouteId:n,...d}))},[r,n])}var ix={};function qy(r,n,i){!n&&!ix[r]&&(ix[r]=!0,Ya(!1,i))}x.memo(M2);function M2({routes:r,future:n,state:i}){return Py(r,void 0,i,n)}function Js({to:r,replace:n,state:i,relative:l}){Rt(fl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=x.useContext(sr);Ya(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=x.useContext(Wa),{pathname:f}=za(),h=St(),g=Nh(r,wh(d),f,l==="path"),p=JSON.stringify(g);return x.useEffect(()=>{h(JSON.parse(p),{replace:n,state:i,relative:l})},[h,p,l,n,i]),null}function Ch(r){return v2(r.context)}function ze(r){Rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function O2({basename:r="/",children:n=null,location:i,navigationType:l="POP",navigator:o,static:d=!1}){Rt(!fl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=r.replace(/^\/*/,"/"),h=x.useMemo(()=>({basename:f,navigator:o,static:d,future:{}}),[f,o,d]);typeof i=="string"&&(i=dl(i));let{pathname:g="/",search:p="",hash:y="",state:b=null,key:j="default"}=i,N=x.useMemo(()=>{let w=qr(g,f);return w==null?null:{location:{pathname:w,search:p,hash:y,state:b,key:j},navigationType:l}},[f,g,p,y,b,j,l]);return Ya(N!=null,`<Router basename="${f}"> is not able to match the URL "${g}${p}${y}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:x.createElement(sr.Provider,{value:h},x.createElement(Fi.Provider,{children:n,value:N}))}function z2({children:r,location:n}){return j2(Xf(r),n)}function Xf(r,n=[]){let i=[];return x.Children.forEach(r,(l,o)=>{if(!x.isValidElement(l))return;let d=[...n,o];if(l.type===x.Fragment){i.push.apply(i,Xf(l.props.children,d));return}Rt(l.type===ze,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Rt(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Xf(l.props.children,d)),i.push(f)}),i}var gc="get",xc="application/x-www-form-urlencoded";function Pc(r){return r!=null&&typeof r.tagName=="string"}function L2(r){return Pc(r)&&r.tagName.toLowerCase()==="button"}function U2(r){return Pc(r)&&r.tagName.toLowerCase()==="form"}function G2(r){return Pc(r)&&r.tagName.toLowerCase()==="input"}function F2(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function B2(r,n){return r.button===0&&(!n||n==="_self")&&!F2(r)}function Qf(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((n,i)=>{let l=r[i];return n.concat(Array.isArray(l)?l.map(o=>[i,o]):[[i,l]])},[]))}function I2(r,n){let i=Qf(r);return n&&n.forEach((l,o)=>{i.has(o)||n.getAll(o).forEach(d=>{i.append(o,d)})}),i}var ic=null;function H2(){if(ic===null)try{new FormData(document.createElement("form"),0),ic=!1}catch{ic=!0}return ic}var P2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Af(r){return r!=null&&!P2.has(r)?(Ya(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xc}"`),null):r}function q2(r,n){let i,l,o,d,f;if(U2(r)){let h=r.getAttribute("action");l=h?qr(h,n):null,i=r.getAttribute("method")||gc,o=Af(r.getAttribute("enctype"))||xc,d=new FormData(r)}else if(L2(r)||G2(r)&&(r.type==="submit"||r.type==="image")){let h=r.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=r.getAttribute("formaction")||h.getAttribute("action");if(l=g?qr(g,n):null,i=r.getAttribute("formmethod")||h.getAttribute("method")||gc,o=Af(r.getAttribute("formenctype"))||Af(h.getAttribute("enctype"))||xc,d=new FormData(h,r),!H2()){let{name:p,type:y,value:b}=r;if(y==="image"){let j=p?`${p}.`:"";d.append(`${j}x`,"0"),d.append(`${j}y`,"0")}else p&&d.append(p,b)}}else{if(Pc(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=gc,l=null,o=xc,f=r}return d&&o==="text/plain"&&(f=d,d=void 0),{action:l,method:i.toLowerCase(),encType:o,formData:d,body:f}}function Eh(r,n){if(r===!1||r===null||typeof r>"u")throw new Error(n)}async function $2(r,n){if(r.id in n)return n[r.id];try{let i=await import(r.module);return n[r.id]=i,i}catch(i){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Z2(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function V2(r,n,i){let l=await Promise.all(r.map(async o=>{let d=n.routes[o.route.id];if(d){let f=await $2(d,i);return f.links?f.links():[]}return[]}));return Q2(l.flat(1).filter(Z2).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function ox(r,n,i,l,o,d){let f=(g,p)=>i[p]?g.route.id!==i[p].route.id:!0,h=(g,p)=>{var y;return i[p].pathname!==g.pathname||((y=i[p].route.path)==null?void 0:y.endsWith("*"))&&i[p].params["*"]!==g.params["*"]};return d==="assets"?n.filter((g,p)=>f(g,p)||h(g,p)):d==="data"?n.filter((g,p)=>{var b;let y=l.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(f(g,p)||h(g,p))return!0;if(g.route.shouldRevalidate){let j=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(r,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function K2(r,n,{includeHydrateFallback:i}={}){return Y2(r.map(l=>{let o=n.routes[l.route.id];if(!o)return[];let d=[o.module];return o.clientActionModule&&(d=d.concat(o.clientActionModule)),o.clientLoaderModule&&(d=d.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(d=d.concat(o.hydrateFallbackModule)),o.imports&&(d=d.concat(o.imports)),d}).flat(1))}function Y2(r){return[...new Set(r)]}function X2(r){let n={},i=Object.keys(r).sort();for(let l of i)n[l]=r[l];return n}function Q2(r,n){let i=new Set;return new Set(n),r.reduce((l,o)=>{let d=JSON.stringify(X2(o));return i.has(d)||(i.add(d),l.push({key:d,link:o})),l},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var W2=new Set([100,101,204,205]);function J2(r,n){let i=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return i.pathname==="/"?i.pathname="_root.data":n&&qr(i.pathname,n)==="/"?i.pathname=`${n.replace(/\/$/,"")}/_root.data`:i.pathname=`${i.pathname.replace(/\/$/,"")}.data`,i}function $y(){let r=x.useContext(ul);return Eh(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function eN(){let r=x.useContext(Hc);return Eh(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Rh=x.createContext(void 0);Rh.displayName="FrameworkContext";function Zy(){let r=x.useContext(Rh);return Eh(r,"You must render this element inside a <HydratedRouter> element"),r}function tN(r,n){let i=x.useContext(Rh),[l,o]=x.useState(!1),[d,f]=x.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:p,onMouseLeave:y,onTouchStart:b}=n,j=x.useRef(null);x.useEffect(()=>{if(r==="render"&&f(!0),r==="viewport"){let S=k=>{k.forEach(A=>{f(A.isIntersecting)})},E=new IntersectionObserver(S,{threshold:.5});return j.current&&E.observe(j.current),()=>{E.disconnect()}}},[r]),x.useEffect(()=>{if(l){let S=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(S)}}},[l]);let N=()=>{o(!0)},w=()=>{o(!1),f(!1)};return i?r!=="intent"?[d,j,{}]:[d,j,{onFocus:Ni(h,N),onBlur:Ni(g,w),onMouseEnter:Ni(p,N),onMouseLeave:Ni(y,w),onTouchStart:Ni(b,N)}]:[!1,j,{}]}function Ni(r,n){return i=>{r&&r(i),i.defaultPrevented||n(i)}}function aN({page:r,...n}){let{router:i}=$y(),l=x.useMemo(()=>zy(i.routes,r,i.basename),[i.routes,r,i.basename]);return l?x.createElement(nN,{page:r,matches:l,...n}):null}function rN(r){let{manifest:n,routeModules:i}=Zy(),[l,o]=x.useState([]);return x.useEffect(()=>{let d=!1;return V2(r,n,i).then(f=>{d||o(f)}),()=>{d=!0}},[r,n,i]),l}function nN({page:r,matches:n,...i}){let l=za(),{manifest:o,routeModules:d}=Zy(),{basename:f}=$y(),{loaderData:h,matches:g}=eN(),p=x.useMemo(()=>ox(r,n,g,o,l,"data"),[r,n,g,o,l]),y=x.useMemo(()=>ox(r,n,g,o,l,"assets"),[r,n,g,o,l]),b=x.useMemo(()=>{if(r===l.pathname+l.search+l.hash)return[];let w=new Set,S=!1;if(n.forEach(k=>{var O;let A=o.routes[k.route.id];!A||!A.hasLoader||(!p.some(L=>L.route.id===k.route.id)&&k.route.id in h&&((O=d[k.route.id])!=null&&O.shouldRevalidate)||A.hasClientLoader?S=!0:w.add(k.route.id))}),w.size===0)return[];let E=J2(r,f);return S&&w.size>0&&E.searchParams.set("_routes",n.filter(k=>w.has(k.route.id)).map(k=>k.route.id).join(",")),[E.pathname+E.search]},[f,h,l,o,p,n,r,d]),j=x.useMemo(()=>K2(y,o),[y,o]),N=rN(y);return x.createElement(x.Fragment,null,b.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...i})),j.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...i})),N.map(({key:w,link:S})=>x.createElement("link",{key:w,...S})))}function sN(...r){return n=>{r.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var Vy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Vy&&(window.__reactRouterVersion="7.6.3")}catch{}function lN({basename:r,children:n,window:i}){let l=x.useRef();l.current==null&&(l.current=$w({window:i,v5Compat:!0}));let o=l.current,[d,f]=x.useState({action:o.action,location:o.location}),h=x.useCallback(g=>{x.startTransition(()=>f(g))},[f]);return x.useLayoutEffect(()=>o.listen(h),[o,h]),x.createElement(O2,{basename:r,children:n,location:d.location,navigationType:d.action,navigator:o})}var Ky=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Je=x.forwardRef(function({onClick:n,discover:i="render",prefetch:l="none",relative:o,reloadDocument:d,replace:f,state:h,target:g,to:p,preventScrollReset:y,viewTransition:b,...j},N){let{basename:w}=x.useContext(sr),S=typeof p=="string"&&Ky.test(p),E,k=!1;if(typeof p=="string"&&S&&(E=p,Vy))try{let q=new URL(window.location.href),K=p.startsWith("//")?new URL(q.protocol+p):new URL(p),ae=qr(K.pathname,w);K.origin===q.origin&&ae!=null?p=ae+K.search+K.hash:k=!0}catch{Ya(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let A=y2(p,{relative:o}),[O,L,B]=tN(l,j),V=dN(p,{replace:f,state:h,target:g,preventScrollReset:y,relative:o,viewTransition:b});function $(q){n&&n(q),q.defaultPrevented||V(q)}let le=x.createElement("a",{...j,...B,href:E||A,onClick:k||d?n:$,ref:sN(N,L),target:g,"data-discover":!S&&i==="render"?"true":void 0});return O&&!S?x.createElement(x.Fragment,null,le,x.createElement(aN,{page:A})):le});Je.displayName="Link";var iN=x.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:l="",end:o=!1,style:d,to:f,viewTransition:h,children:g,...p},y){let b=Bi(f,{relative:p.relative}),j=za(),N=x.useContext(Hc),{navigator:w,basename:S}=x.useContext(sr),E=N!=null&&mN(b)&&h===!0,k=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,A=j.pathname,O=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;i||(A=A.toLowerCase(),O=O?O.toLowerCase():null,k=k.toLowerCase()),O&&S&&(O=qr(O,S)||O);const L=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let B=A===k||!o&&A.startsWith(k)&&A.charAt(L)==="/",V=O!=null&&(O===k||!o&&O.startsWith(k)&&O.charAt(k.length)==="/"),$={isActive:B,isPending:V,isTransitioning:E},le=B?n:void 0,q;typeof l=="function"?q=l($):q=[l,B?"active":null,V?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let K=typeof d=="function"?d($):d;return x.createElement(Je,{...p,"aria-current":le,className:q,ref:y,style:K,to:f,viewTransition:h},typeof g=="function"?g($):g)});iN.displayName="NavLink";var oN=x.forwardRef(({discover:r="render",fetcherKey:n,navigate:i,reloadDocument:l,replace:o,state:d,method:f=gc,action:h,onSubmit:g,relative:p,preventScrollReset:y,viewTransition:b,...j},N)=>{let w=hN(),S=pN(h,{relative:p}),E=f.toLowerCase()==="get"?"get":"post",k=typeof h=="string"&&Ky.test(h),A=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let L=O.nativeEvent.submitter,B=(L==null?void 0:L.getAttribute("formmethod"))||f;w(L||O.currentTarget,{fetcherKey:n,method:B,navigate:i,replace:o,state:d,relative:p,preventScrollReset:y,viewTransition:b})};return x.createElement("form",{ref:N,method:E,action:S,onSubmit:l?g:A,...j,"data-discover":!k&&r==="render"?"true":void 0})});oN.displayName="Form";function cN(r){return`${r} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yy(r){let n=x.useContext(ul);return Rt(n,cN(r)),n}function dN(r,{target:n,replace:i,state:l,preventScrollReset:o,relative:d,viewTransition:f}={}){let h=St(),g=za(),p=Bi(r,{relative:d});return x.useCallback(y=>{if(B2(y,n)){y.preventDefault();let b=i!==void 0?i:Oi(g)===Oi(p);h(r,{replace:b,state:l,preventScrollReset:o,relative:d,viewTransition:f})}},[g,h,p,i,l,n,r,o,d,f])}function hl(r){Ya(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=x.useRef(Qf(r)),i=x.useRef(!1),l=za(),o=x.useMemo(()=>I2(l.search,i.current?null:n.current),[l.search]),d=St(),f=x.useCallback((h,g)=>{const p=Qf(typeof h=="function"?h(o):h);i.current=!0,d("?"+p,g)},[d,o]);return[o,f]}var uN=0,fN=()=>`__${String(++uN)}__`;function hN(){let{router:r}=Yy("useSubmit"),{basename:n}=x.useContext(sr),i=R2();return x.useCallback(async(l,o={})=>{let{action:d,method:f,encType:h,formData:g,body:p}=q2(l,n);if(o.navigate===!1){let y=o.fetcherKey||fN();await r.fetch(y,i,o.action||d,{preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||f,formEncType:o.encType||h,flushSync:o.flushSync})}else await r.navigate(o.action||d,{preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||f,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:i,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,n,i])}function pN(r,{relative:n}={}){let{basename:i}=x.useContext(sr),l=x.useContext(Wa);Rt(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),d={...Bi(r||".",{relative:n})},f=za();if(r==null){d.search=f.search;let h=new URLSearchParams(d.search),g=h.getAll("index");if(g.some(y=>y==="")){h.delete("index"),g.filter(b=>b).forEach(b=>h.append("index",b));let y=h.toString();d.search=y?`?${y}`:""}}return(!r||r===".")&&o.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(d.pathname=d.pathname==="/"?i:Ir([i,d.pathname])),Oi(d)}function mN(r,n={}){let i=x.useContext(Fy);Rt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=Yy("useViewTransitionState"),o=Bi(r,{relative:n.relative});if(!i.isTransitioning)return!1;let d=qr(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=qr(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Sc(o.pathname,f)!=null||Sc(o.pathname,d)!=null}[...W2];var Xy=Oy();function ue(r,n){const i=n.split(".");let l=r;for(const o of i){if(typeof l=="boolean"||typeof l=="string")return l;if(l==null||typeof l!="object")return;l=l[o]}return l}function gN(r){const{theme:n,clearTheme:i,applyTheme:l,...o}=r;return o}function Qe(r,n){let i=gN(r);return n&&(i={...n,...r}),i}const An={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};An.defaultMerge;function xN(r,n){return n}function yN(r,n){return r.filter(i=>i!==void 0)}var cx;(function(r){r[r.NOT=0]="NOT",r[r.RECORD=1]="RECORD",r[r.ARRAY=2]="ARRAY",r[r.SET=3]="SET",r[r.MAP=4]="MAP",r[r.OTHER=5]="OTHER"})(cx||(cx={}));function dx(r){return typeof r!="object"||r===null?0:Array.isArray(r)?2:jN(r)?1:r instanceof Set?3:r instanceof Map?4:5}function bN(r){const n=new Set;for(const i of r)for(const l of[...Object.keys(i),...Object.getOwnPropertySymbols(i)])n.add(l);return n}function vN(r,n){return typeof r=="object"&&Object.prototype.propertyIsEnumerable.call(r,n)}function Qy(r){var l;let n=0,i=(l=r[0])==null?void 0:l[Symbol.iterator]();return{[Symbol.iterator](){return{next(){var o;do{if(i===void 0)return{done:!0,value:void 0};const d=i.next();if(d.done===!0){n+=1,i=(o=r[n])==null?void 0:o[Symbol.iterator]();continue}return{done:!1,value:d.value}}while(!0)}}}}}const ux=["[object Object]","[object Module]"];function jN(r){if(!ux.includes(Object.prototype.toString.call(r)))return!1;const{constructor:n}=r;if(n===void 0)return!0;const i=n.prototype;return!(i===null||typeof i!="object"||!ux.includes(Object.prototype.toString.call(i))||!i.hasOwnProperty("isPrototypeOf"))}function wN(r,n,i){const l={};for(const o of bN(r)){const d=[];for(const g of r)vN(g,o)&&d.push(g[o]);if(d.length===0)continue;const f=n.metaDataUpdater(i,{key:o,parents:r}),h=Jy(d,n,f);h!==An.skip&&(o==="__proto__"?Object.defineProperty(l,o,{value:h,configurable:!0,enumerable:!0,writable:!0}):l[o]=h)}return l}function NN(r){return r.flat()}function kN(r){return new Set(Qy(r))}function SN(r){return new Map(Qy(r))}function _N(r){return r.at(-1)}const oc={mergeRecords:wN,mergeArrays:NN,mergeSets:kN,mergeMaps:SN,mergeOthers:_N};function TN(...r){return Wy({})(...r)}function Wy(r,n){const i=CN(r,l);function l(...o){return Jy(o,i,n)}return l}function CN(r,n){return{defaultMergeFunctions:oc,mergeFunctions:{...oc,...Object.fromEntries(Object.entries(r).filter(([i,l])=>Object.hasOwn(oc,i)).map(([i,l])=>l===!1?[i,oc.mergeOthers]:[i,l]))},metaDataUpdater:r.metaDataUpdater??xN,deepmerge:n,useImplicitDefaultMerging:r.enableImplicitDefaultMerging??!1,filterValues:r.filterValues===!1?void 0:r.filterValues??yN,actions:An}}function Jy(r,n,i){var d;const l=((d=n.filterValues)==null?void 0:d.call(n,r,i))??r;if(l.length===0)return;if(l.length===1)return Df(l,n,i);const o=dx(l[0]);if(o!==0&&o!==5){for(let f=1;f<l.length;f++)if(dx(l[f])!==o)return Df(l,n,i)}switch(o){case 1:return EN(l,n,i);case 2:return RN(l,n,i);case 3:return AN(l,n,i);case 4:return DN(l,n,i);default:return Df(l,n,i)}}function EN(r,n,i){const l=n.mergeFunctions.mergeRecords(r,n,i);return l===An.defaultMerge||n.useImplicitDefaultMerging&&l===void 0&&n.mergeFunctions.mergeRecords!==n.defaultMergeFunctions.mergeRecords?n.defaultMergeFunctions.mergeRecords(r,n,i):l}function RN(r,n,i){const l=n.mergeFunctions.mergeArrays(r,n,i);return l===An.defaultMerge||n.useImplicitDefaultMerging&&l===void 0&&n.mergeFunctions.mergeArrays!==n.defaultMergeFunctions.mergeArrays?n.defaultMergeFunctions.mergeArrays(r):l}function AN(r,n,i){const l=n.mergeFunctions.mergeSets(r,n,i);return l===An.defaultMerge||n.useImplicitDefaultMerging&&l===void 0&&n.mergeFunctions.mergeSets!==n.defaultMergeFunctions.mergeSets?n.defaultMergeFunctions.mergeSets(r):l}function DN(r,n,i){const l=n.mergeFunctions.mergeMaps(r,n,i);return l===An.defaultMerge||n.useImplicitDefaultMerging&&l===void 0&&n.mergeFunctions.mergeMaps!==n.defaultMergeFunctions.mergeMaps?n.defaultMergeFunctions.mergeMaps(r):l}function Df(r,n,i){const l=n.mergeFunctions.mergeOthers(r,n,i);return l===An.defaultMerge||n.useImplicitDefaultMerging&&l===void 0&&n.mergeFunctions.mergeOthers!==n.defaultMergeFunctions.mergeOthers?n.defaultMergeFunctions.mergeOthers(r):l}function yc(r){var n,i,l;if(Array.isArray(r)){for(i=Array(n=r.length);n--;)i[n]=(l=r[n])&&typeof l=="object"?yc(l):l;return i}if(Object.prototype.toString.call(r)==="[object Object]"){i={};for(n in r)n==="__proto__"?Object.defineProperty(i,n,{value:yc(r[n]),configurable:!0,enumerable:!0,writable:!0}):i[n]=(l=r[n])&&typeof l=="object"?yc(l):l;return i}return r}const Ah={dark:void 0,mode:void 0,prefix:void 0};function MN(){return Ah.dark}function ON(){return Ah.mode}function eb(){return Ah.prefix}const fx=new Map;function zN(r){if(!r.trim().length)return r;const n=r,i=fx.get(n);if(i)return i;const o=r.split(/(\s+)/).map(d=>{if(/^\s+$/.test(d))return d;const f=d,h=f.match(/^([^:]+:)?(.+)$/);if(h){const[,g="",p]=h;for(const[y,b]of LN)if(y.test(p))return g+p.replace(y,b)}return f}).join("");return fx.set(n,o),o}const LN=[[/^shadow-sm$/,"shadow-xs"],[/^shadow$/,"shadow-sm"],[/^drop-shadow-sm$/,"drop-shadow-xs"],[/^drop-shadow$/,"drop-shadow-sm"],[/^blur-sm$/,"blur-xs"],[/^blur$/,"blur-sm"],[/^rounded-sm$/,"rounded-xs"],[/^rounded$/,"rounded-sm"],[/^ring$/,"ring-3"]];function UN(r){return Wy({mergeOthers:(n,i)=>{if(n.some(l=>typeof l=="string")){const l=n.filter(f=>typeof f=="string"),o=new Set,d=[];for(const f of l){const h=[...new Set(f.split(/\s+/))];d.push(h.filter(g=>!o.has(g)).join(" "));for(const g of h)o.add(g)}return r(d)}return i.actions.defaultMerge}})}const GN="4.1.11";function tb(){try{return parseInt(GN.split(".")[0],10)}catch{return}}function Wf(r,n){if(r===n)return!0;if(r&&n&&typeof r=="object"&&typeof n=="object"){if(r.constructor!==n.constructor)return!1;if(Array.isArray(r))return r.length!==n.length?!1:r.every((l,o)=>Wf(l,n[o]));if(r.constructor===RegExp)return r.source===n.source&&r.flags===n.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===n.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===n.toString();const i=Object.keys(r);return i.length!==Object.keys(n).length?!1:i.every(l=>Object.prototype.hasOwnProperty.call(n,l)&&Wf(r[l],n[l]))}return r!==r&&n!==n}const Dh="-",FN=r=>{const n=IN(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=r;return{getClassGroupId:f=>{const h=f.split(Dh);return h[0]===""&&h.length!==1&&h.shift(),ab(h,n)||BN(f)},getConflictingClassGroupIds:(f,h)=>{const g=i[f]||[];return h&&l[f]?[...g,...l[f]]:g}}},ab=(r,n)=>{var f;if(r.length===0)return n.classGroupId;const i=r[0],l=n.nextPart.get(i),o=l?ab(r.slice(1),l):void 0;if(o)return o;if(n.validators.length===0)return;const d=r.join(Dh);return(f=n.validators.find(({validator:h})=>h(d)))==null?void 0:f.classGroupId},hx=/^\[(.+)\]$/,BN=r=>{if(hx.test(r)){const n=hx.exec(r)[1],i=n==null?void 0:n.substring(0,n.indexOf(":"));if(i)return"arbitrary.."+i}},IN=r=>{const{theme:n,prefix:i}=r,l={nextPart:new Map,validators:[]};return PN(Object.entries(r.classGroups),i).forEach(([d,f])=>{Jf(f,l,d,n)}),l},Jf=(r,n,i,l)=>{r.forEach(o=>{if(typeof o=="string"){const d=o===""?n:px(n,o);d.classGroupId=i;return}if(typeof o=="function"){if(HN(o)){Jf(o(l),n,i,l);return}n.validators.push({validator:o,classGroupId:i});return}Object.entries(o).forEach(([d,f])=>{Jf(f,px(n,d),i,l)})})},px=(r,n)=>{let i=r;return n.split(Dh).forEach(l=>{i.nextPart.has(l)||i.nextPart.set(l,{nextPart:new Map,validators:[]}),i=i.nextPart.get(l)}),i},HN=r=>r.isThemeGetter,PN=(r,n)=>n?r.map(([i,l])=>{const o=l.map(d=>typeof d=="string"?n+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([f,h])=>[n+f,h])):d);return[i,o]}):r,qN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let n=0,i=new Map,l=new Map;const o=(d,f)=>{i.set(d,f),n++,n>r&&(n=0,l=i,i=new Map)};return{get(d){let f=i.get(d);if(f!==void 0)return f;if((f=l.get(d))!==void 0)return o(d,f),f},set(d,f){i.has(d)?i.set(d,f):o(d,f)}}},rb="!",$N=r=>{const{separator:n,experimentalParseClassName:i}=r,l=n.length===1,o=n[0],d=n.length,f=h=>{const g=[];let p=0,y=0,b;for(let E=0;E<h.length;E++){let k=h[E];if(p===0){if(k===o&&(l||h.slice(E,E+d)===n)){g.push(h.slice(y,E)),y=E+d;continue}if(k==="/"){b=E;continue}}k==="["?p++:k==="]"&&p--}const j=g.length===0?h:h.substring(y),N=j.startsWith(rb),w=N?j.substring(1):j,S=b&&b>y?b-y:void 0;return{modifiers:g,hasImportantModifier:N,baseClassName:w,maybePostfixModifierPosition:S}};return i?h=>i({className:h,parseClassName:f}):f},ZN=r=>{if(r.length<=1)return r;const n=[];let i=[];return r.forEach(l=>{l[0]==="["?(n.push(...i.sort(),l),i=[]):i.push(l)}),n.push(...i.sort()),n},VN=r=>({cache:qN(r.cacheSize),parseClassName:$N(r),...FN(r)}),KN=/\s+/,YN=(r,n)=>{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:o}=n,d=[],f=r.trim().split(KN);let h="";for(let g=f.length-1;g>=0;g-=1){const p=f[g],{modifiers:y,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:N}=i(p);let w=!!N,S=l(w?j.substring(0,N):j);if(!S){if(!w){h=p+(h.length>0?" "+h:h);continue}if(S=l(j),!S){h=p+(h.length>0?" "+h:h);continue}w=!1}const E=ZN(y).join(":"),k=b?E+rb:E,A=k+S;if(d.includes(A))continue;d.push(A);const O=o(S,w);for(let L=0;L<O.length;++L){const B=O[L];d.push(k+B)}h=p+(h.length>0?" "+h:h)}return h};function XN(){let r=0,n,i,l="";for(;r<arguments.length;)(n=arguments[r++])&&(i=nb(n))&&(l&&(l+=" "),l+=i);return l}const nb=r=>{if(typeof r=="string")return r;let n,i="";for(let l=0;l<r.length;l++)r[l]&&(n=nb(r[l]))&&(i&&(i+=" "),i+=n);return i};function mx(r,...n){let i,l,o,d=f;function f(g){const p=n.reduce((y,b)=>b(y),r());return i=VN(p),l=i.cache.get,o=i.cache.set,d=h,h(g)}function h(g){const p=l(g);if(p)return p;const y=YN(g,i);return o(g,y),y}return function(){return d(XN.apply(null,arguments))}}const _t=r=>{const n=i=>i[r]||[];return n.isThemeGetter=!0,n},sb=/^\[(?:([a-z-]+):)?(.+)\]$/i,QN=/^\d+\/\d+$/,WN=new Set(["px","full","screen"]),JN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ek=/\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$/,tk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ak=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fr=r=>tl(r)||WN.has(r)||QN.test(r),jn=r=>pl(r,"length",uk),tl=r=>!!r&&!Number.isNaN(Number(r)),Mf=r=>pl(r,"number",tl),ki=r=>!!r&&Number.isInteger(Number(r)),nk=r=>r.endsWith("%")&&tl(r.slice(0,-1)),Ze=r=>sb.test(r),wn=r=>JN.test(r),sk=new Set(["length","size","percentage"]),lk=r=>pl(r,sk,lb),ik=r=>pl(r,"position",lb),ok=new Set(["image","url"]),ck=r=>pl(r,ok,hk),dk=r=>pl(r,"",fk),Si=()=>!0,pl=(r,n,i)=>{const l=sb.exec(r);return l?l[1]?typeof n=="string"?l[1]===n:n.has(l[1]):i(l[2]):!1},uk=r=>ek.test(r)&&!tk.test(r),lb=()=>!1,fk=r=>ak.test(r),hk=r=>rk.test(r),gx=()=>{const r=_t("colors"),n=_t("spacing"),i=_t("blur"),l=_t("brightness"),o=_t("borderColor"),d=_t("borderRadius"),f=_t("borderSpacing"),h=_t("borderWidth"),g=_t("contrast"),p=_t("grayscale"),y=_t("hueRotate"),b=_t("invert"),j=_t("gap"),N=_t("gradientColorStops"),w=_t("gradientColorStopPositions"),S=_t("inset"),E=_t("margin"),k=_t("opacity"),A=_t("padding"),O=_t("saturate"),L=_t("scale"),B=_t("sepia"),V=_t("skew"),$=_t("space"),le=_t("translate"),q=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto",Ze,n],G=()=>[Ze,n],Z=()=>["",Fr,jn],z=()=>["auto",tl,Ze],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",Ze],v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[tl,Ze];return{cacheSize:500,separator:":",theme:{colors:[Si],spacing:[Fr,jn],blur:["none","",wn,Ze],brightness:M(),borderColor:[r],borderRadius:["none","","full",wn,Ze],borderSpacing:G(),borderWidth:Z(),contrast:M(),grayscale:R(),hueRotate:M(),invert:R(),gap:G(),gradientColorStops:[r],gradientColorStopPositions:[nk,jn],inset:ae(),margin:ae(),opacity:M(),padding:G(),saturate:M(),scale:M(),sepia:R(),skew:M(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Ze]}],container:["container"],columns:[{columns:[wn]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"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:[...H(),Ze]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ki,Ze]}],basis:[{basis:ae()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ze]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",ki,Ze]}],"grid-cols":[{"grid-cols":[Si]}],"col-start-end":[{col:["auto",{span:["full",ki,Ze]},Ze]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[Si]}],"row-start-end":[{row:["auto",{span:[ki,Ze]},Ze]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ze]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ze,n]}],"min-w":[{"min-w":[Ze,n,"min","max","fit"]}],"max-w":[{"max-w":[Ze,n,"none","full","min","max","fit","prose",{screen:[wn]},wn]}],h:[{h:[Ze,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ze,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ze,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ze,n,"auto","min","max","fit"]}],"font-size":[{text:["base",wn,jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mf]}],"font-family":[{font:[Si]}],"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",Ze]}],"line-clamp":[{"line-clamp":["none",tl,Mf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fr,Ze]}],"list-image":[{"list-image":["none",Ze]}],"list-style-type":[{list:["none","disc","decimal",Ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fr,jn]}],"underline-offset":[{"underline-offset":["auto",Fr,Ze]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze]}],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",Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),ik]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ck]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[N]}],"gradient-via":[{via:[N]}],"gradient-to":[{to:[N]}],rounded:[{rounded:[d]}],"rounded-s":[{"rounded-s":[d]}],"rounded-e":[{"rounded-e":[d]}],"rounded-t":[{"rounded-t":[d]}],"rounded-r":[{"rounded-r":[d]}],"rounded-b":[{"rounded-b":[d]}],"rounded-l":[{"rounded-l":[d]}],"rounded-ss":[{"rounded-ss":[d]}],"rounded-se":[{"rounded-se":[d]}],"rounded-ee":[{"rounded-ee":[d]}],"rounded-es":[{"rounded-es":[d]}],"rounded-tl":[{"rounded-tl":[d]}],"rounded-tr":[{"rounded-tr":[d]}],"rounded-br":[{"rounded-br":[d]}],"rounded-bl":[{"rounded-bl":[d]}],"border-w":[{border:[h]}],"border-w-x":[{"border-x":[h]}],"border-w-y":[{"border-y":[h]}],"border-w-s":[{"border-s":[h]}],"border-w-e":[{"border-e":[h]}],"border-w-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:C()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[Fr,Ze]}],"outline-w":[{outline:[Fr,jn]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Fr,jn]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",wn,dk]}],"shadow-color":[{shadow:[Si]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[l]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",wn,Ze]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[y]}],invert:[{invert:[b]}],saturate:[{saturate:[O]}],sepia:[{sepia:[B]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[l]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[y]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[O]}],"backdrop-sepia":[{"backdrop-sepia":[B]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ze]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Ze]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[ki,Ze]}],"translate-x":[{"translate-x":[le]}],"translate-y":[{"translate-y":[le]}],"skew-x":[{"skew-x":[V]}],"skew-y":[{"skew-y":[V]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ze]}],accent:[{accent:["auto",r]}],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",Ze]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",Ze]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[Fr,jn,Mf]}],stroke:[{stroke:[r,"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"]}}},pk=(r,{cacheSize:n,prefix:i,separator:l,experimentalParseClassName:o,extend:d={},override:f={}})=>{Ci(r,"cacheSize",n),Ci(r,"prefix",i),Ci(r,"separator",l),Ci(r,"experimentalParseClassName",o);for(const h in f)mk(r[h],f[h]);for(const h in d)gk(r[h],d[h]);return r},Ci=(r,n,i)=>{i!==void 0&&(r[n]=i)},mk=(r,n)=>{if(n)for(const i in n)Ci(r,i,n[i])},gk=(r,n)=>{if(n)for(const i in n){const l=n[i];l!==void 0&&(r[i]=(r[i]||[]).concat(l))}},xk=(r,...n)=>typeof r=="function"?mx(gx,r,...n):mx(()=>pk(gx(),r),...n),Mh="-",yk=r=>{const n=vk(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=r;return{getClassGroupId:f=>{const h=f.split(Mh);return h[0]===""&&h.length!==1&&h.shift(),ib(h,n)||bk(f)},getConflictingClassGroupIds:(f,h)=>{const g=i[f]||[];return h&&l[f]?[...g,...l[f]]:g}}},ib=(r,n)=>{var f;if(r.length===0)return n.classGroupId;const i=r[0],l=n.nextPart.get(i),o=l?ib(r.slice(1),l):void 0;if(o)return o;if(n.validators.length===0)return;const d=r.join(Mh);return(f=n.validators.find(({validator:h})=>h(d)))==null?void 0:f.classGroupId},xx=/^\[(.+)\]$/,bk=r=>{if(xx.test(r)){const n=xx.exec(r)[1],i=n==null?void 0:n.substring(0,n.indexOf(":"));if(i)return"arbitrary.."+i}},vk=r=>{const{theme:n,classGroups:i}=r,l={nextPart:new Map,validators:[]};for(const o in i)eh(i[o],l,o,n);return l},eh=(r,n,i,l)=>{r.forEach(o=>{if(typeof o=="string"){const d=o===""?n:yx(n,o);d.classGroupId=i;return}if(typeof o=="function"){if(jk(o)){eh(o(l),n,i,l);return}n.validators.push({validator:o,classGroupId:i});return}Object.entries(o).forEach(([d,f])=>{eh(f,yx(n,d),i,l)})})},yx=(r,n)=>{let i=r;return n.split(Mh).forEach(l=>{i.nextPart.has(l)||i.nextPart.set(l,{nextPart:new Map,validators:[]}),i=i.nextPart.get(l)}),i},jk=r=>r.isThemeGetter,wk=r=>{if(r<1)return{get:()=>{},set:()=>{}};let n=0,i=new Map,l=new Map;const o=(d,f)=>{i.set(d,f),n++,n>r&&(n=0,l=i,i=new Map)};return{get(d){let f=i.get(d);if(f!==void 0)return f;if((f=l.get(d))!==void 0)return o(d,f),f},set(d,f){i.has(d)?i.set(d,f):o(d,f)}}},th="!",ah=":",Nk=ah.length,kk=r=>{const{prefix:n,experimentalParseClassName:i}=r;let l=o=>{const d=[];let f=0,h=0,g=0,p;for(let w=0;w<o.length;w++){let S=o[w];if(f===0&&h===0){if(S===ah){d.push(o.slice(g,w)),g=w+Nk;continue}if(S==="/"){p=w;continue}}S==="["?f++:S==="]"?f--:S==="("?h++:S===")"&&h--}const y=d.length===0?o:o.substring(g),b=Sk(y),j=b!==y,N=p&&p>g?p-g:void 0;return{modifiers:d,hasImportantModifier:j,baseClassName:b,maybePostfixModifierPosition:N}};if(n){const o=n+ah,d=l;l=f=>f.startsWith(o)?d(f.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:f,maybePostfixModifierPosition:void 0}}if(i){const o=l;l=d=>i({className:d,parseClassName:o})}return l},Sk=r=>r.endsWith(th)?r.substring(0,r.length-1):r.startsWith(th)?r.substring(1):r,_k=r=>{const n=Object.fromEntries(r.orderSensitiveModifiers.map(l=>[l,!0]));return l=>{if(l.length<=1)return l;const o=[];let d=[];return l.forEach(f=>{f[0]==="["||n[f]?(o.push(...d.sort(),f),d=[]):d.push(f)}),o.push(...d.sort()),o}},Tk=r=>({cache:wk(r.cacheSize),parseClassName:kk(r),sortModifiers:_k(r),...yk(r)}),Ck=/\s+/,Ek=(r,n)=>{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:o,sortModifiers:d}=n,f=[],h=r.trim().split(Ck);let g="";for(let p=h.length-1;p>=0;p-=1){const y=h[p],{isExternal:b,modifiers:j,hasImportantModifier:N,baseClassName:w,maybePostfixModifierPosition:S}=i(y);if(b){g=y+(g.length>0?" "+g:g);continue}let E=!!S,k=l(E?w.substring(0,S):w);if(!k){if(!E){g=y+(g.length>0?" "+g:g);continue}if(k=l(w),!k){g=y+(g.length>0?" "+g:g);continue}E=!1}const A=d(j).join(":"),O=N?A+th:A,L=O+k;if(f.includes(L))continue;f.push(L);const B=o(k,E);for(let V=0;V<B.length;++V){const $=B[V];f.push(O+$)}g=y+(g.length>0?" "+g:g)}return g};function Rk(){let r=0,n,i,l="";for(;r<arguments.length;)(n=arguments[r++])&&(i=ob(n))&&(l&&(l+=" "),l+=i);return l}const ob=r=>{if(typeof r=="string")return r;let n,i="";for(let l=0;l<r.length;l++)r[l]&&(n=ob(r[l]))&&(i&&(i+=" "),i+=n);return i};function bx(r,...n){let i,l,o,d=f;function f(g){const p=n.reduce((y,b)=>b(y),r());return i=Tk(p),l=i.cache.get,o=i.cache.set,d=h,h(g)}function h(g){const p=l(g);if(p)return p;const y=Ek(g,i);return o(g,y),y}return function(){return d(Rk.apply(null,arguments))}}const ra=r=>{const n=i=>i[r]||[];return n.isThemeGetter=!0,n},cb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,db=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ak=/^\d+\/\d+$/,Dk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mk=/\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$/,Ok=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,zk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qs=r=>Ak.test(r),lt=r=>!!r&&!Number.isNaN(Number(r)),Wn=r=>!!r&&Number.isInteger(Number(r)),vx=r=>r.endsWith("%")&&lt(r.slice(0,-1)),Nn=r=>Dk.test(r),Uk=()=>!0,Gk=r=>Mk.test(r)&&!Ok.test(r),Oh=()=>!1,Fk=r=>zk.test(r),Bk=r=>Lk.test(r),Ik=r=>!_e(r)&&!Te(r),Hk=r=>ml(r,hb,Oh),_e=r=>cb.test(r),Jn=r=>ml(r,pb,Gk),Of=r=>ml(r,Jk,lt),Pk=r=>ml(r,ub,Oh),qk=r=>ml(r,fb,Bk),$k=r=>ml(r,Oh,Fk),Te=r=>db.test(r),cc=r=>gl(r,pb),Zk=r=>gl(r,eS),Vk=r=>gl(r,ub),Kk=r=>gl(r,hb),Yk=r=>gl(r,fb),Xk=r=>gl(r,tS,!0),ml=(r,n,i)=>{const l=cb.exec(r);return l?l[1]?n(l[1]):i(l[2]):!1},gl=(r,n,i=!1)=>{const l=db.exec(r);return l?l[1]?n(l[1]):i:!1},ub=r=>r==="position",Qk=new Set(["image","url"]),fb=r=>Qk.has(r),Wk=new Set(["length","size","percentage"]),hb=r=>Wk.has(r),pb=r=>r==="length",Jk=r=>r==="number",eS=r=>r==="family-name",tS=r=>r==="shadow",jx=()=>{const r=ra("color"),n=ra("font"),i=ra("text"),l=ra("font-weight"),o=ra("tracking"),d=ra("leading"),f=ra("breakpoint"),h=ra("container"),g=ra("spacing"),p=ra("radius"),y=ra("shadow"),b=ra("inset-shadow"),j=ra("drop-shadow"),N=ra("blur"),w=ra("perspective"),S=ra("aspect"),E=ra("ease"),k=ra("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],V=()=>[Qs,"px","full","auto",Te,_e,g],$=()=>[Wn,"none","subgrid",Te,_e],le=()=>["auto",{span:["full",Wn,Te,_e]},Te,_e],q=()=>[Wn,"auto",Te,_e],K=()=>["auto","min","max","fr",Te,_e],ae=()=>[Te,_e,g],G=()=>["start","end","center","between","around","evenly","stretch","baseline"],Z=()=>["start","end","center","stretch"],z=()=>[Te,_e,g],H=()=>["px",...z()],C=()=>["px","auto",...z()],U=()=>[Qs,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Te,_e,g],T=()=>[r,Te,_e],R=()=>[vx,Jn],v=()=>["","none","full",p,Te,_e],M=()=>["",lt,cc,Jn],I=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>["","none",N,Te,_e],je=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Te,_e],ve=()=>["none",lt,Te,_e],ye=()=>["none",lt,Te,_e],ge=()=>[lt,Te,_e],be=()=>[Qs,"full","px",Te,_e,g];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Nn],breakpoint:[Nn],color:[Uk],container:[Nn],"drop-shadow":[Nn],ease:["in","out","in-out"],font:[Ik],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Nn],shadow:[Nn],spacing:[lt],text:[Nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qs,_e,Te,S]}],container:["container"],columns:[{columns:[lt,_e,Te,h]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),_e,Te]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset: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:[Wn,"auto",Te,_e]}],basis:[{basis:[Qs,"full","auto",Te,_e,h,g]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,Qs,"auto","initial","none",_e]}],grow:[{grow:["",lt,Te,_e]}],shrink:[{shrink:["",lt,Te,_e]}],order:[{order:[Wn,"first","last","none",Te,_e]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:ae()}],"gap-x":[{"gap-x":ae()}],"gap-y":[{"gap-y":ae()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Z(),"baseline"]}],"align-self":[{self:["auto",...Z(),"baseline"]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[h,"screen",...U()]}],"min-w":[{"min-w":[h,"screen","none",...U()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[f]},...U()]}],h:[{h:["screen",...U()]}],"min-h":[{"min-h":["screen","none",...U()]}],"max-h":[{"max-h":["screen",...U()]}],"font-size":[{text:["base",i,cc,Jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,Te,Of]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vx,_e]}],"font-family":[{font:[Zk,_e,n]}],"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:[o,Te,_e]}],"line-clamp":[{"line-clamp":[lt,"none",Te,Of]}],leading:[{leading:[Te,_e,d,g]}],"list-image":[{"list-image":["none",Te,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",Te,Jn]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[lt,"auto",Te,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...z()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,_e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),Vk,Pk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",Kk,Hk]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wn,Te,_e],radial:["",Te,_e],conic:[Wn,Te,_e]},Yk,qk]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:v()}],"rounded-s":[{"rounded-s":v()}],"rounded-e":[{"rounded-e":v()}],"rounded-t":[{"rounded-t":v()}],"rounded-r":[{"rounded-r":v()}],"rounded-b":[{"rounded-b":v()}],"rounded-l":[{"rounded-l":v()}],"rounded-ss":[{"rounded-ss":v()}],"rounded-se":[{"rounded-se":v()}],"rounded-ee":[{"rounded-ee":v()}],"rounded-es":[{"rounded-es":v()}],"rounded-tl":[{"rounded-tl":v()}],"rounded-tr":[{"rounded-tr":v()}],"rounded-br":[{"rounded-br":v()}],"rounded-bl":[{"rounded-bl":v()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,Te,_e]}],"outline-w":[{outline:["",lt,cc,Jn]}],"outline-color":[{outline:[r]}],shadow:[{shadow:["","none",y,Xk,$k]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",Te,_e,b]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[lt,Jn]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":T()}],opacity:[{opacity:[lt,Te,_e]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none",Te,_e]}],blur:[{blur:xe()}],brightness:[{brightness:[lt,Te,_e]}],contrast:[{contrast:[lt,Te,_e]}],"drop-shadow":[{"drop-shadow":["","none",j,Te,_e]}],grayscale:[{grayscale:["",lt,Te,_e]}],"hue-rotate":[{"hue-rotate":[lt,Te,_e]}],invert:[{invert:["",lt,Te,_e]}],saturate:[{saturate:[lt,Te,_e]}],sepia:[{sepia:["",lt,Te,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,_e]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[lt,Te,_e]}],"backdrop-contrast":[{"backdrop-contrast":[lt,Te,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,Te,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,Te,_e]}],"backdrop-invert":[{"backdrop-invert":["",lt,Te,_e]}],"backdrop-opacity":[{"backdrop-opacity":[lt,Te,_e]}],"backdrop-saturate":[{"backdrop-saturate":[lt,Te,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,Te,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",Te,_e]}],ease:[{ease:["linear","initial",E,Te,_e]}],delay:[{delay:[lt,Te,_e]}],animate:[{animate:["none",k,Te,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Te,_e]}],"perspective-origin":[{"perspective-origin":je()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Te,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:je()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te,_e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Te,_e]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[lt,cc,Jn,Of]}],stroke:[{stroke:["none",...T()]}],"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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},aS=(r,{cacheSize:n,prefix:i,experimentalParseClassName:l,extend:o={},override:d={}})=>(Ei(r,"cacheSize",n),Ei(r,"prefix",i),Ei(r,"experimentalParseClassName",l),dc(r.theme,d.theme),dc(r.classGroups,d.classGroups),dc(r.conflictingClassGroups,d.conflictingClassGroups),dc(r.conflictingClassGroupModifiers,d.conflictingClassGroupModifiers),Ei(r,"orderSensitiveModifiers",d.orderSensitiveModifiers),uc(r.theme,o.theme),uc(r.classGroups,o.classGroups),uc(r.conflictingClassGroups,o.conflictingClassGroups),uc(r.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),mb(r,o,"orderSensitiveModifiers"),r),Ei=(r,n,i)=>{i!==void 0&&(r[n]=i)},dc=(r,n)=>{if(n)for(const i in n)Ei(r,i,n[i])},uc=(r,n)=>{if(n)for(const i in n)mb(r,n,i)},mb=(r,n,i)=>{const l=n[i];l!==void 0&&(r[i]=r[i]?r[i].concat(l):l)},rS=(r,...n)=>typeof r=="function"?bx(jx,r,...n):bx(()=>aS(jx(),r),...n),wx=new Map;function Ce(...r){const n=eb(),i=tb(),l=`${n}.${i}`,o=wx.get(l);if(o)return o(...r);const d=(i===3?xk:rS)({extend:{classGroups:{"bg-image":["bg-arrow-down-icon","bg-check-icon","bg-dash-icon","bg-dot-icon"],shadow:["shadow-sm-light"]}},prefix:n});return wx.set(l,d),d(...r)}function Ve(...r){return nS(()=>sS(...r),r)}function nS(r,n){const i=x.useRef(),l=x.useRef();return(!i.current||!Wf(i.current,n))&&(i.current=n,l.current=r()),l.current}function sS([r,...n],i,l){const o=MN(),d=eb(),f=tb(),h=n!=null&&n.length?n==null?void 0:n.filter(j=>j!==void 0):void 0,g=i!=null&&i.length?i==null?void 0:i.filter(j=>j!==void 0):void 0,p=l!=null&&l.length?l==null?void 0:l.filter(j=>j!==void 0):void 0,y=g!=null&&g.length||o===!1||f===4||d?yc(r):r;if(g!=null&&g.length){const j=rh(y,!1);let N=!1;for(const w of g)w&&(N=!0),lS(j,w);N&&oS(y,j)}(f===4||d)&&dS(y,j=>(f===4&&(j=zN(j)),j));let b=y;if(h!=null&&h.length&&(b=UN(Ce)(y,...h)),p!=null&&p.length&&(h!=null&&h.length)){const j=rh(y,"merge");let N=!1;for(const w of p)w!=="merge"&&(N=!0),iS(j,w);N&&cS(b,TN(y,...n),j)}return b}function lS(r,n){function i(l,o){if(typeof o=="boolean")if(typeof l=="object"&&l!==null)for(const d in l)l[d]=i(l[d],o);else return o;if(typeof o=="object"&&o!==null)for(const d in o)l[d]=i(l[d],o[d]);return l}i(r,n)}function iS(r,n){function i(l,o){if(typeof o=="string")if(typeof l=="object"&&l!==null)for(const d in l)l[d]=i(l[d],o);else return o;if(typeof o=="object"&&o!==null)for(const d in o)l[d]=i(l[d],o[d]);return l}i(r,n)}function oS(r,n){function i(l,o){if(o===!0)if(typeof l=="object"&&l!==null)for(const d in l)l[d]=i(l[d],o);else return"";if(typeof o=="object"&&o!==null)for(const d in o)l[d]=i(l[d],o[d]);return l}i(r,n)}function cS(r,n,i){function l(o,d,f){if(f==="replace")if(typeof o=="object"&&o!==null)for(const h in o)o[h]=l(o[h],d[h],f);else return d;if(typeof f=="object"&&f!==null)for(const h in f)o[h]=l(o[h],d[h],f[h]);return o}l(r,n,i)}function dS(r,n){function i(l){if(typeof l=="string")return n(l);if(Array.isArray(l))for(let o=0;o<l.length;o++)l[o]=i(l[o]);else if(typeof l=="object"&&l!==null)for(const o in l)l[o]=i(l[o]);return l}i(r)}function rh(r,n){if(r===null||typeof r!="object")return n;const i={};for(const l in r)i[l]=rh(r[l],n);return i}const zh=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 20 20",ref:n,...r,children:t.jsx("path",{fillRule:"evenodd",stroke:"none",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})}));zh.displayName="ChevronDownIcon";const uS=x.createContext(void 0);function Ke(){return x.useContext(uS)??{}}const gb=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 20 20",ref:n,...r,children:t.jsx("path",{fillRule:"evenodd",stroke:"none",d:"M4.293 4.293a1 1 0 0 1 1.414 0L10 8.586l4.293-4.293a1 1 0 1 1 1.414 1.414L11.414 10l4.293 4.293a1 1 0 0 1-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 0 1-1.414-1.414L8.586 10 4.293 5.707a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})}));gb.displayName="XIcon";const fS={base:"flex flex-col gap-2 p-4 text-sm",borderAccent:"border-t-4",closeButton:{base:"-m-1.5 ml-auto inline-flex h-8 w-8 rounded-lg p-1.5 focus:ring-2",icon:"h-5 w-5",color:{info:"bg-cyan-100 text-cyan-500 hover:bg-cyan-200 focus:ring-cyan-400 dark:bg-cyan-200 dark:text-cyan-600 dark:hover:bg-cyan-300",gray:"bg-gray-100 text-gray-500 hover:bg-gray-200 focus:ring-gray-400 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-white",failure:"bg-red-100 text-red-500 hover:bg-red-200 focus:ring-red-400 dark:bg-red-200 dark:text-red-600 dark:hover:bg-red-300",success:"bg-green-100 text-green-500 hover:bg-green-200 focus:ring-green-400 dark:bg-green-200 dark:text-green-600 dark:hover:bg-green-300",warning:"bg-yellow-100 text-yellow-500 hover:bg-yellow-200 focus:ring-yellow-400 dark:bg-yellow-200 dark:text-yellow-600 dark:hover:bg-yellow-300",red:"bg-red-100 text-red-500 hover:bg-red-200 focus:ring-red-400 dark:bg-red-200 dark:text-red-600 dark:hover:bg-red-300",green:"bg-green-100 text-green-500 hover:bg-green-200 focus:ring-green-400 dark:bg-green-200 dark:text-green-600 dark:hover:bg-green-300",yellow:"bg-yellow-100 text-yellow-500 hover:bg-yellow-200 focus:ring-yellow-400 dark:bg-yellow-200 dark:text-yellow-600 dark:hover:bg-yellow-300",blue:"bg-blue-100 text-blue-500 hover:bg-blue-200 focus:ring-blue-400 dark:bg-blue-200 dark:text-blue-600 dark:hover:bg-blue-300",cyan:"bg-cyan-100 text-cyan-500 hover:bg-cyan-200 focus:ring-cyan-400 dark:bg-cyan-200 dark:text-cyan-600 dark:hover:bg-cyan-300",pink:"bg-pink-100 text-pink-500 hover:bg-pink-200 focus:ring-pink-400 dark:bg-pink-200 dark:text-pink-600 dark:hover:bg-pink-300",lime:"bg-lime-100 text-lime-500 hover:bg-lime-200 focus:ring-lime-400 dark:bg-lime-200 dark:text-lime-600 dark:hover:bg-lime-300",dark:"bg-gray-100 text-gray-500 hover:bg-gray-200 focus:ring-gray-400 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300",indigo:"bg-indigo-100 text-indigo-500 hover:bg-indigo-200 focus:ring-indigo-400 dark:bg-indigo-200 dark:text-indigo-600 dark:hover:bg-indigo-300",purple:"bg-purple-100 text-purple-500 hover:bg-purple-200 focus:ring-purple-400 dark:bg-purple-200 dark:text-purple-600 dark:hover:bg-purple-300",teal:"bg-teal-100 text-teal-500 hover:bg-teal-200 focus:ring-teal-400 dark:bg-teal-200 dark:text-teal-600 dark:hover:bg-teal-300",light:"bg-gray-50 text-gray-500 hover:bg-gray-100 focus:ring-gray-200 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:hover:text-white"}},color:{info:"border-cyan-500 bg-cyan-100 text-cyan-700 dark:bg-cyan-200 dark:text-cyan-800",gray:"border-gray-500 bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",failure:"border-red-500 bg-red-100 text-red-700 dark:bg-red-200 dark:text-red-800",success:"border-green-500 bg-green-100 text-green-700 dark:bg-green-200 dark:text-green-800",warning:"border-yellow-500 bg-yellow-100 text-yellow-700 dark:bg-yellow-200 dark:text-yellow-800",red:"border-red-500 bg-red-100 text-red-700 dark:bg-red-200 dark:text-red-800",green:"border-green-500 bg-green-100 text-green-700 dark:bg-green-200 dark:text-green-800",yellow:"border-yellow-500 bg-yellow-100 text-yellow-700 dark:bg-yellow-200 dark:text-yellow-800",blue:"border-blue-500 bg-blue-100 text-blue-700 dark:bg-blue-200 dark:text-blue-800",cyan:"border-cyan-500 bg-cyan-100 text-cyan-700 dark:bg-cyan-200 dark:text-cyan-800",pink:"border-pink-500 bg-pink-100 text-pink-700 dark:bg-pink-200 dark:text-pink-800",lime:"border-lime-500 bg-lime-100 text-lime-700 dark:bg-lime-200 dark:text-lime-800",dark:"border-gray-600 bg-gray-800 text-gray-200 dark:bg-gray-900 dark:text-gray-300",indigo:"border-indigo-500 bg-indigo-100 text-indigo-700 dark:bg-indigo-200 dark:text-indigo-800",purple:"border-purple-500 bg-purple-100 text-purple-700 dark:bg-purple-200 dark:text-purple-800",teal:"border-teal-500 bg-teal-100 text-teal-700 dark:bg-teal-200 dark:text-teal-800",light:"border-gray-400 bg-gray-50 text-gray-600 dark:bg-gray-500 dark:text-gray-200"},icon:"mr-3 inline h-5 w-5 shrink-0",rounded:"rounded-lg",wrapper:"flex items-center"},Xe=x.forwardRef((r,n)=>{var N,w;const i=Ke(),l=Ve([fS,(N=i.theme)==null?void 0:N.alert,r.theme],[ue(i.clearTheme,"alert"),r.clearTheme],[ue(i.applyTheme,"alert"),r.applyTheme]),{additionalContent:o,children:d,className:f,color:h="info",icon:g,onDismiss:p,rounded:y=!0,withBorderAccent:b,...j}=Qe(r,(w=i.props)==null?void 0:w.alert);return t.jsxs("div",{ref:n,className:Ce(l.base,l.color[h],y&&l.rounded,b&&l.borderAccent,f),role:"alert",...j,children:[t.jsxs("div",{className:l.wrapper,"data-testid":"flowbite-alert-wrapper",children:[g&&t.jsx(g,{className:l.icon,"data-testid":"flowbite-alert-icon"}),t.jsx("div",{children:d}),typeof p=="function"&&t.jsx("button",{"aria-label":"Dismiss",className:Ce(l.closeButton.base,l.closeButton.color[h]),onClick:p,type:"button",children:t.jsx(gb,{"aria-hidden":!0,className:l.closeButton.icon})})]}),o&&t.jsx("div",{children:o})]})});Xe.displayName="Alert";const hS={root:{base:"flex items-center justify-center space-x-4 rounded",inner:"relative",bordered:"p-1 ring-2",rounded:"rounded-full",color:{dark:"ring-gray-800 dark:ring-gray-800",failure:"ring-red-500 dark:ring-red-700",gray:"ring-gray-500 dark:ring-gray-400",info:"ring-cyan-400 dark:ring-cyan-800",light:"ring-gray-300 dark:ring-gray-500",purple:"ring-purple-500 dark:ring-purple-600",success:"ring-green-500 dark:ring-green-500",warning:"ring-yellow-300 dark:ring-yellow-500",pink:"ring-pink-500 dark:ring-pink-500"},img:{base:"rounded",off:"relative overflow-hidden bg-gray-100 dark:bg-gray-600",on:"",placeholder:"absolute -bottom-1 h-auto w-auto text-gray-400"},size:{xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-20 w-20",xl:"h-36 w-36"},stacked:"ring-2 ring-gray-300 dark:ring-gray-500",statusPosition:{"bottom-left":"-bottom-1 -left-1","bottom-center":"-bottom-1","bottom-right":"-bottom-1 -right-1","top-left":"-left-1 -top-1","top-center":"-top-1","top-right":"-right-1 -top-1","center-right":"-right-1",center:"","center-left":"-left-1"},status:{away:"bg-yellow-400",base:"absolute h-3.5 w-3.5 rounded-full border-2 border-white dark:border-gray-800",busy:"bg-red-400",offline:"bg-gray-400",online:"bg-green-400"},initials:{text:"font-medium text-gray-600 dark:text-gray-300",base:"relative inline-flex items-center justify-center overflow-hidden bg-gray-100 dark:bg-gray-600"}},group:{base:"flex -space-x-4"},groupCounter:{base:"relative flex h-10 w-10 items-center justify-center rounded-full bg-gray-700 text-xs font-medium text-white ring-2 ring-gray-300 hover:bg-gray-600 dark:ring-gray-500"}},xb=x.forwardRef((r,n)=>{var O,L;const i=Ke(),l=Ve([hS,(O=i.theme)==null?void 0:O.avatar,r.theme],[ue(i.clearTheme,"avatar"),r.clearTheme],[ue(i.applyTheme,"avatar"),r.applyTheme]),{alt:o="",bordered:d=!1,children:f,className:h,color:g="light",img:p,placeholderInitials:y="",rounded:b=!1,size:j="md",stacked:N=!1,status:w,statusPosition:S="top-left",...E}=Qe(r,(L=i.props)==null?void 0:L.avatar),k=Ce(l.root.img.base,d&&l.root.bordered,d&&l.root.color[g],b&&l.root.rounded,N&&l.root.stacked,l.root.img.on,l.root.size[j]),A={className:Ce(k,l.root.img.on),"data-testid":"flowbite-avatar-img"};return t.jsxs("div",{ref:n,className:Ce(l.root.base,h),"data-testid":"flowbite-avatar",...E,children:[t.jsxs("div",{className:l.root.inner,children:[p?typeof p=="string"?t.jsx("img",{alt:o,src:p,...A}):p({alt:o,...A}):y?t.jsx("div",{className:Ce(l.root.img.off,l.root.initials.base,N&&l.root.stacked,d&&l.root.bordered,d&&l.root.color[g],l.root.size[j],b&&l.root.rounded),"data-testid":"flowbite-avatar-initials-placeholder",children:t.jsx("span",{className:Ce(l.root.initials.text),"data-testid":"flowbite-avatar-initials-placeholder-text",children:y})}):t.jsx("div",{className:Ce(k,l.root.img.off),"data-testid":"flowbite-avatar-img",children:t.jsx("svg",{className:l.root.img.placeholder,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),w&&t.jsx("span",{"data-testid":"flowbite-avatar-status",className:Ce(l.root.status.base,l.root.status[w],l.root.statusPosition[S])})]}),f&&t.jsx("div",{children:f})]})});xb.displayName="Avatar";const pS={root:{base:"flex h-fit items-center gap-1 font-semibold",color:{info:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200 dark:bg-cyan-200 dark:text-cyan-800 dark:hover:bg-cyan-300",gray:"bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600",failure:"bg-red-100 text-red-800 hover:bg-red-200 dark:bg-red-200 dark:text-red-900 dark:hover:bg-red-300",success:"bg-green-100 text-green-800 hover:bg-green-200 dark:bg-green-200 dark:text-green-900 dark:hover:bg-green-300",warning:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200 dark:bg-yellow-200 dark:text-yellow-900 dark:hover:bg-yellow-300",indigo:"bg-indigo-100 text-indigo-800 hover:bg-indigo-200 dark:bg-indigo-200 dark:text-indigo-900 dark:hover:bg-indigo-300",purple:"bg-purple-100 text-purple-800 hover:bg-purple-200 dark:bg-purple-200 dark:text-purple-900 dark:hover:bg-purple-300",pink:"bg-pink-100 text-pink-800 hover:bg-pink-200 dark:bg-pink-200 dark:text-pink-900 dark:hover:bg-pink-300",blue:"bg-blue-100 text-blue-800 hover:bg-blue-200 dark:bg-blue-200 dark:text-blue-900 dark:hover:bg-blue-300",cyan:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200 dark:bg-cyan-200 dark:text-cyan-900 dark:hover:bg-cyan-300",dark:"bg-gray-600 text-gray-100 hover:bg-gray-500 dark:bg-gray-900 dark:text-gray-200 dark:hover:bg-gray-700",light:"bg-gray-200 text-gray-800 hover:bg-gray-300 dark:bg-gray-400 dark:text-gray-900 dark:hover:bg-gray-500",green:"bg-green-100 text-green-800 hover:bg-green-200 dark:bg-green-200 dark:text-green-900 dark:hover:bg-green-300",lime:"bg-lime-100 text-lime-800 hover:bg-lime-200 dark:bg-lime-200 dark:text-lime-900 dark:hover:bg-lime-300",red:"bg-red-100 text-red-800 hover:bg-red-200 dark:bg-red-200 dark:text-red-900 dark:hover:bg-red-300",teal:"bg-teal-100 text-teal-800 hover:bg-teal-200 dark:bg-teal-200 dark:text-teal-900 dark:hover:bg-teal-300",yellow:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200 dark:bg-yellow-200 dark:text-yellow-900 dark:hover:bg-yellow-300"},size:{xs:"p-1 text-xs",sm:"p-1.5 text-sm"}},icon:{off:"rounded px-2 py-0.5",on:"rounded-full p-1.5",size:{xs:"h-3 w-3",sm:"h-3.5 w-3.5"}}},jt=x.forwardRef((r,n)=>{var y,b;const i=Ke(),l=Ve([pS,(y=i.theme)==null?void 0:y.badge,r.theme],[ue(i.clearTheme,"badge"),r.clearTheme],[ue(i.applyTheme,"badge"),r.applyTheme]),{children:o,color:d="info",icon:f,size:h="xs",className:g,...p}=Qe(r,(b=i.props)==null?void 0:b.badge);return t.jsxs("span",{ref:n,className:Ce(l.root.base,l.root.color[d],l.root.size[h],l.icon[f?"on":"off"],g),"data-testid":"flowbite-badge",...p,children:[f&&t.jsx(f,{"aria-hidden":!0,className:l.icon.size[h],"data-testid":"flowbite-badge-icon"}),o&&t.jsx("span",{children:o})]})});jt.displayName="Badge";const Lh=x.forwardRef(({children:r,as:n,href:i,type:l="button",...o},d)=>{const f=n||(i?"a":"button");return x.createElement(f,{ref:d,href:i,type:l,...o},r)});Lh.displayName="ButtonBase";const mS=x.createContext(void 0);function gS(){return x.useContext(mS)}const xS={base:"relative flex items-center justify-center rounded-lg text-center font-medium focus:outline-none focus:ring-4",disabled:"pointer-events-none opacity-50",fullSized:"w-full",grouped:"rounded-none border-l-0 first:rounded-s-lg first:border-l last:rounded-e-lg focus:ring-2",pill:"rounded-full",size:{xs:"h-8 px-3 text-xs",sm:"h-9 px-3 text-sm",md:"h-10 px-5 text-sm",lg:"h-12 px-5 text-base",xl:"h-[52px] px-6 text-base"},color:{default:"bg-primary-700 text-white hover:bg-primary-800 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",alternative:"border border-gray-200 bg-white text-gray-900 hover:bg-gray-100 hover:text-primary-700 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700",blue:"bg-blue-700 text-white hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",cyan:"bg-cyan-700 text-white hover:bg-cyan-800 focus:ring-cyan-300 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-800",dark:"bg-gray-800 text-white hover:bg-gray-900 focus:ring-gray-300 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700",gray:"bg-gray-700 text-white hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",green:"bg-green-700 text-white hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800",indigo:"bg-indigo-700 text-white hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800",light:"border border-gray-300 bg-white text-gray-900 hover:bg-gray-100 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:hover:border-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-700",lime:"bg-lime-700 text-white hover:bg-lime-800 focus:ring-lime-300 dark:bg-lime-600 dark:hover:bg-lime-700 dark:focus:ring-lime-800",pink:"bg-pink-700 text-white hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800",purple:"bg-purple-700 text-white hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800",red:"bg-red-700 text-white hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800",teal:"bg-teal-700 text-white hover:bg-teal-800 focus:ring-teal-300 dark:bg-teal-600 dark:hover:bg-teal-700 dark:focus:ring-teal-800",yellow:"bg-yellow-400 text-white hover:bg-yellow-500 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-400 dark:focus:ring-yellow-900"},outlineColor:{default:"border border-primary-700 text-primary-700 hover:border-primary-800 hover:bg-primary-800 hover:text-white focus:ring-primary-300 dark:border-primary-600 dark:text-primary-500 dark:hover:border-primary-700 dark:hover:bg-primary-700 dark:hover:text-white dark:focus:ring-primary-800",blue:"border border-blue-700 text-blue-700 hover:border-blue-800 hover:bg-blue-800 hover:text-white focus:ring-blue-300 dark:border-blue-500 dark:text-blue-500 dark:hover:border-blue-700 dark:hover:bg-blue-700 dark:hover:text-white dark:focus:ring-blue-800",cyan:"border border-cyan-700 text-cyan-700 hover:border-cyan-800 hover:bg-cyan-800 hover:text-white focus:ring-cyan-300 dark:border-cyan-500 dark:text-cyan-500 dark:hover:border-cyan-700 dark:hover:bg-cyan-700 dark:hover:text-white dark:focus:ring-cyan-800",dark:"border border-gray-800 text-gray-800 hover:border-gray-900 hover:bg-gray-900 hover:text-white focus:ring-gray-300 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:ring-gray-800",gray:"border border-gray-700 text-gray-700 hover:border-gray-800 hover:bg-gray-800 hover:text-white focus:ring-gray-300 dark:border-gray-600 dark:text-gray-400 dark:hover:border-gray-700 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-800",green:"border border-green-700 text-green-700 hover:border-green-800 hover:bg-green-800 hover:text-white focus:ring-green-300 dark:border-green-600 dark:text-green-500 dark:hover:border-green-700 dark:hover:bg-green-700 dark:hover:text-white dark:focus:ring-green-800",indigo:"border border-indigo-700 text-indigo-700 hover:border-indigo-800 hover:bg-indigo-800 hover:text-white focus:ring-indigo-300 dark:border-indigo-600 dark:text-indigo-400 dark:hover:border-indigo-700 dark:hover:bg-indigo-700 dark:hover:text-white dark:focus:ring-indigo-800",lime:"border border-lime-700 text-lime-700 hover:border-lime-800 hover:bg-lime-800 hover:text-white focus:ring-lime-300 dark:border-lime-600 dark:text-lime-500 dark:hover:border-lime-700 dark:hover:bg-lime-700 dark:hover:text-white dark:focus:ring-lime-800",pink:"border border-pink-700 text-pink-700 hover:border-pink-800 hover:bg-pink-800 hover:text-white focus:ring-pink-300 dark:border-pink-600 dark:text-pink-500 dark:hover:border-pink-700 dark:hover:bg-pink-700 dark:hover:text-white dark:focus:ring-pink-800",purple:"border border-purple-700 text-purple-700 hover:border-purple-800 hover:bg-purple-800 hover:text-white focus:ring-purple-300 dark:border-purple-600 dark:text-purple-400 dark:hover:border-purple-700 dark:hover:bg-purple-700 dark:hover:text-white dark:focus:ring-purple-800",red:"border border-red-700 text-red-700 hover:border-red-800 hover:bg-red-800 hover:text-white focus:ring-red-300 dark:border-red-600 dark:text-red-500 dark:hover:border-red-700 dark:hover:bg-red-700 dark:hover:text-white dark:focus:ring-red-800",teal:"border border-teal-700 text-teal-700 hover:border-teal-800 hover:bg-teal-800 hover:text-white focus:ring-teal-300 dark:border-teal-600 dark:text-teal-400 dark:hover:border-teal-700 dark:hover:bg-teal-700 dark:hover:text-white dark:focus:ring-teal-800",yellow:"border border-yellow-400 text-yellow-400 hover:border-yellow-500 hover:bg-yellow-500 hover:text-white focus:ring-yellow-300 dark:border-yellow-300 dark:text-yellow-300 dark:hover:border-yellow-400 dark:hover:bg-yellow-400 dark:hover:text-white dark:focus:ring-yellow-900"}},X=x.forwardRef((r,n)=>{var E,k;const i=Ke(),l=Ve([xS,(E=i.theme)==null?void 0:E.button,r.theme],[ue(i.clearTheme,"button"),r.clearTheme],[ue(i.applyTheme,"button"),r.applyTheme]),{children:o,className:d,color:f="default",disabled:h,fullSized:g,outline:p,pill:y,size:b="md",...j}=Qe(r,(k=i.props)==null?void 0:k.button),N=gS(),w=(N==null?void 0:N.outline)??p,S=(N==null?void 0:N.pill)??y;return t.jsx(Lh,{ref:n,disabled:h,className:Ce(l.base,l.size[b],S&&l.pill,h&&l.disabled,g&&l.fullSized,w?l.outlineColor[f]:l.color[f],N&&l.grouped,d),...j,children:o})});X.displayName="Button";const yb={root:{base:"",list:"flex items-center"},item:{base:"group flex items-center",chevron:"mx-1 h-4 w-4 text-gray-400 group-first:hidden md:mx-2",href:{off:"flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",on:"flex items-center text-sm font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"},icon:"mr-2 h-4 w-4"}},La=x.forwardRef((r,n)=>{var h,g,p;const i=Ke(),l=Ve([yb.root,(g=(h=i.theme)==null?void 0:h.breadcrumb)==null?void 0:g.root,r.theme],[ue(i.clearTheme,"breadcrumb.root"),r.clearTheme],[ue(i.applyTheme,"breadcrumb.root"),r.applyTheme]),{children:o,className:d,...f}=Qe(r,(p=i.props)==null?void 0:p.breadcrumb);return t.jsx("nav",{ref:n,"aria-label":"Breadcrumb",className:Ce(l.base,d),...f,children:t.jsx("ol",{className:l.list,children:o})})});La.displayName="Breadcrumb";const Ii=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",ref:n,...r,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 5 7 7-7 7"})}));Ii.displayName="ChevronRightIcon";const Le=x.forwardRef((r,n)=>{var b,j,N;const i=Ke(),l=Ve([yb.item,(j=(b=i.theme)==null?void 0:b.breadcrumb)==null?void 0:j.item,r.theme],[ue(i.clearTheme,"breadcrumb.item"),r.clearTheme],[ue(i.applyTheme,"breadcrumb.item"),r.applyTheme]),{children:o,className:d,href:f,icon:h,...g}=Qe(r,(N=i.props)==null?void 0:N.breadcrumbItem),p=typeof f<"u",y=p?"a":"span";return t.jsxs("li",{className:Ce(l.base,d),...g,children:[t.jsx(Ii,{"aria-hidden":!0,className:l.chevron,"data-testid":"flowbite-breadcrumb-separator"}),t.jsxs(y,{ref:n,className:l.href[p?"on":"off"],"data-testid":"flowbite-breadcrumb-item",href:f,children:[h&&t.jsx(h,{"aria-hidden":!0,className:l.icon}),o]})]})});Le.displayName="BreadcrumbItem";const yS={root:{base:"flex rounded-lg border border-gray-200 bg-white shadow-md dark:border-gray-700 dark:bg-gray-800",children:"flex h-full flex-col justify-center gap-4 p-6",horizontal:{off:"flex-col",on:"flex-col md:max-w-xl md:flex-row"},href:"hover:bg-gray-100 dark:hover:bg-gray-700"},img:{base:"",horizontal:{off:"rounded-t-lg",on:"h-96 w-full rounded-t-lg object-cover md:h-auto md:w-48 md:rounded-none md:rounded-l-lg"}}},qe=x.forwardRef((r,n)=>{var N,w;const i=Ke(),l=Ve([yS,(N=i.theme)==null?void 0:N.card,r.theme],[ue(i.clearTheme,"card"),r.clearTheme],[ue(i.applyTheme,"card"),r.applyTheme]),{children:o,className:d,horizontal:f,href:h,imgAlt:g,imgSrc:p,renderImage:y,...b}=Qe(r,(w=i.props)==null?void 0:w.card),j=typeof h>"u"?"div":"a";return t.jsxs(j,{ref:n,"data-testid":"flowbite-card",href:h,className:Ce(l.root.base,l.root.horizontal[f?"on":"off"],h&&l.root.href,d),...b,children:[(y==null?void 0:y(l,!!f))??(p&&t.jsx("img",{"data-testid":"flowbite-card-image",alt:g??"",src:p,className:Ce(l.img.base,l.img.horizontal[r.horizontal?"on":"off"])})),t.jsx("div",{className:l.root.children,children:o})]})});qe.displayName="Card";function bb(){return typeof window<"u"}const qc=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",ref:n,...r,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 19-7-7 7-7"})}));qc.displayName="ChevronLeftIcon";const bS={base:"h-4 w-4 appearance-none rounded border border-gray-300 bg-gray-100 bg-[length:0.55em_0.55em] bg-center bg-no-repeat checked:border-transparent checked:bg-current checked:bg-check-icon focus:outline-none focus:ring-2 focus:ring-offset-2 dark:border-gray-600 dark:bg-gray-700 dark:checked:border-transparent dark:checked:bg-current",color:{default:"text-primary-600 focus:ring-primary-600 dark:ring-offset-gray-800 dark:focus:ring-primary-600",dark:"text-gray-800 focus:ring-gray-800 dark:ring-offset-gray-800 dark:focus:ring-gray-800",failure:"text-red-900 focus:ring-red-900 dark:ring-offset-red-900 dark:focus:ring-red-900",gray:"text-gray-900 focus:ring-gray-900 dark:ring-offset-gray-900 dark:focus:ring-gray-900",info:"text-cyan-800 focus:ring-cyan-800 dark:ring-offset-gray-800 dark:focus:ring-cyan-800",light:"text-gray-900 focus:ring-gray-900 dark:ring-offset-gray-900 dark:focus:ring-gray-900",purple:"text-purple-600 focus:ring-purple-600 dark:ring-offset-purple-600 dark:focus:ring-purple-600",success:"text-green-800 focus:ring-green-800 dark:ring-offset-green-800 dark:focus:ring-green-800",warning:"text-yellow-400 focus:ring-yellow-400 dark:ring-offset-yellow-400 dark:focus:ring-yellow-400",blue:"text-blue-700 focus:ring-blue-600 dark:ring-offset-blue-700 dark:focus:ring-blue-700",cyan:"text-cyan-600 focus:ring-cyan-600 dark:ring-offset-cyan-600 dark:focus:ring-cyan-600",green:"text-green-600 focus:ring-green-600 dark:ring-offset-green-600 dark:focus:ring-green-600",indigo:"text-indigo-700 focus:ring-indigo-700 dark:ring-offset-indigo-700 dark:focus:ring-indigo-700",lime:"text-lime-700 focus:ring-lime-700 dark:ring-offset-lime-700 dark:focus:ring-lime-700",pink:"text-pink-600 focus:ring-pink-600 dark:ring-offset-pink-600 dark:focus:ring-pink-600",red:"text-red-600 focus:ring-red-600 dark:ring-offset-red-600 dark:focus:ring-red-600",teal:"text-teal-600 focus:ring-teal-600 dark:ring-offset-teal-600 dark:focus:ring-teal-600",yellow:"text-yellow-400 focus:ring-yellow-400 dark:ring-offset-yellow-400 dark:focus:ring-yellow-400"},indeterminate:"border-transparent bg-current bg-dash-icon dark:border-transparent dark:bg-current"},vb=x.forwardRef((r,n)=>{var g,p;const i=Ke(),l=Ve([bS,(g=i.theme)==null?void 0:g.checkbox,r.theme],[ue(i.clearTheme,"checkbox"),r.clearTheme],[ue(i.applyTheme,"checkbox"),r.applyTheme]),{className:o,color:d="default",indeterminate:f,...h}=Qe(r,(p=i.props)==null?void 0:p.checkbox);return t.jsx("input",{ref:n,type:"checkbox",className:Ce(l.base,l.color[d],f&&l.indeterminate,o),...h})});vb.displayName="Checkbox";function $c(){return typeof window<"u"}function Dn(r){return jb(r)?(r.nodeName||"").toLowerCase():"#document"}function Na(r){var n;return(r==null||(n=r.ownerDocument)==null?void 0:n.defaultView)||window}function wr(r){var n;return(n=(jb(r)?r.ownerDocument:r.document)||window.document)==null?void 0:n.documentElement}function jb(r){return $c()?r instanceof Node||r instanceof Na(r).Node:!1}function wt(r){return $c()?r instanceof Element||r instanceof Na(r).Element:!1}function Pt(r){return $c()?r instanceof HTMLElement||r instanceof Na(r).HTMLElement:!1}function nh(r){return!$c()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Na(r).ShadowRoot}const vS=new Set(["inline","contents"]);function Hi(r){const{overflow:n,overflowX:i,overflowY:l,display:o}=Xa(r);return/auto|scroll|overlay|hidden|clip/.test(n+l+i)&&!vS.has(o)}const jS=new Set(["table","td","th"]);function wS(r){return jS.has(Dn(r))}const NS=[":popover-open",":modal"];function Zc(r){return NS.some(n=>{try{return r.matches(n)}catch{return!1}})}const kS=["transform","translate","scale","rotate","perspective"],SS=["transform","translate","scale","rotate","perspective","filter"],_S=["paint","layout","strict","content"];function Uh(r){const n=Vc(),i=wt(r)?Xa(r):r;return kS.some(l=>i[l]?i[l]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||SS.some(l=>(i.willChange||"").includes(l))||_S.some(l=>(i.contain||"").includes(l))}function TS(r){let n=$r(r);for(;Pt(n)&&!Hr(n);){if(Uh(n))return n;if(Zc(n))return null;n=$r(n)}return null}function Vc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const CS=new Set(["html","body","#document"]);function Hr(r){return CS.has(Dn(r))}function Xa(r){return Na(r).getComputedStyle(r)}function Kc(r){return wt(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function $r(r){if(Dn(r)==="html")return r;const n=r.assignedSlot||r.parentNode||nh(r)&&r.host||wr(r);return nh(n)?n.host:n}function wb(r){const n=$r(r);return Hr(n)?r.ownerDocument?r.ownerDocument.body:r.body:Pt(n)&&Hi(n)?n:wb(n)}function Tn(r,n,i){var l;n===void 0&&(n=[]),i===void 0&&(i=!0);const o=wb(r),d=o===((l=r.ownerDocument)==null?void 0:l.body),f=Na(o);if(d){const h=sh(f);return n.concat(f,f.visualViewport||[],Hi(o)?o:[],h&&i?Tn(h):[])}return n.concat(o,Tn(o,[],i))}function sh(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function rr(r){let n=r.activeElement;for(;((i=n)==null||(i=i.shadowRoot)==null?void 0:i.activeElement)!=null;){var i;n=n.shadowRoot.activeElement}return n}function Ht(r,n){if(!r||!n)return!1;const i=n.getRootNode==null?void 0:n.getRootNode();if(r.contains(n))return!0;if(i&&nh(i)){let l=n;for(;l;){if(r===l)return!0;l=l.parentNode||l.host}}return!1}function Gh(){const r=navigator.userAgentData;return r!=null&&r.platform?r.platform:navigator.platform}function Nb(){const r=navigator.userAgentData;return r&&Array.isArray(r.brands)?r.brands.map(n=>{let{brand:i,version:l}=n;return i+"/"+l}).join(" "):navigator.userAgent}function kb(r){return r.mozInputSource===0&&r.isTrusted?!0:lh()&&r.pointerType?r.type==="click"&&r.buttons===1:r.detail===0&&!r.pointerType}function Fh(r){return RS()?!1:!lh()&&r.width===0&&r.height===0||lh()&&r.width===1&&r.height===1&&r.pressure===0&&r.detail===0&&r.pointerType==="mouse"||r.width<1&&r.height<1&&r.pressure===0&&r.detail===0&&r.pointerType==="touch"}function Sb(){return/apple/i.test(navigator.vendor)}function lh(){const r=/android/i;return r.test(Gh())||r.test(Nb())}function ES(){return Gh().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function RS(){return Nb().includes("jsdom/")}function zi(r,n){const i=["mouse","pen"];return n||i.push("",void 0),i.includes(r)}function AS(r){return"nativeEvent"in r}function DS(r){return r.matches("html,body")}function ca(r){return(r==null?void 0:r.ownerDocument)||document}function zf(r,n){if(n==null)return!1;if("composedPath"in r)return r.composedPath().includes(n);const i=r;return i.target!=null&&n.contains(i.target)}function Br(r){return"composedPath"in r?r.composedPath()[0]:r.target}const MS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Bh(r){return Pt(r)&&r.matches(MS)}function oa(r){r.preventDefault(),r.stopPropagation()}function _b(r){return r?r.getAttribute("role")==="combobox"&&Bh(r):!1}const OS=["top","right","bottom","left"],Nx=["start","end"],kx=OS.reduce((r,n)=>r.concat(n,n+"-"+Nx[0],n+"-"+Nx[1]),[]),rl=Math.min,ns=Math.max,_c=Math.round,el=Math.floor,gr=r=>({x:r,y:r}),zS={left:"right",right:"left",bottom:"top",top:"bottom"},LS={start:"end",end:"start"};function ih(r,n,i){return ns(r,rl(n,i))}function xl(r,n){return typeof r=="function"?r(n):r}function Zr(r){return r.split("-")[0]}function xr(r){return r.split("-")[1]}function Tb(r){return r==="x"?"y":"x"}function Ih(r){return r==="y"?"height":"width"}const US=new Set(["top","bottom"]);function Sn(r){return US.has(Zr(r))?"y":"x"}function Hh(r){return Tb(Sn(r))}function Cb(r,n,i){i===void 0&&(i=!1);const l=xr(r),o=Hh(r),d=Ih(o);let f=o==="x"?l===(i?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[d]>n.floating[d]&&(f=Cc(f)),[f,Cc(f)]}function GS(r){const n=Cc(r);return[Tc(r),n,Tc(n)]}function Tc(r){return r.replace(/start|end/g,n=>LS[n])}const Sx=["left","right"],_x=["right","left"],FS=["top","bottom"],BS=["bottom","top"];function IS(r,n,i){switch(r){case"top":case"bottom":return i?n?_x:Sx:n?Sx:_x;case"left":case"right":return n?FS:BS;default:return[]}}function HS(r,n,i,l){const o=xr(r);let d=IS(Zr(r),i==="start",l);return o&&(d=d.map(f=>f+"-"+o),n&&(d=d.concat(d.map(Tc)))),d}function Cc(r){return r.replace(/left|right|bottom|top/g,n=>zS[n])}function PS(r){return{top:0,right:0,bottom:0,left:0,...r}}function Eb(r){return typeof r!="number"?PS(r):{top:r,right:r,bottom:r,left:r}}function Ec(r){const{x:n,y:i,width:l,height:o}=r;return{width:l,height:o,top:i,left:n,right:n+l,bottom:i+o,x:n,y:i}}/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var qS=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Rc=qS.join(","),Rb=typeof Element>"u",nl=Rb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ac=!Rb&&Element.prototype.getRootNode?function(r){var n;return r==null||(n=r.getRootNode)===null||n===void 0?void 0:n.call(r)}:function(r){return r==null?void 0:r.ownerDocument},Dc=function r(n,i){var l;i===void 0&&(i=!0);var o=n==null||(l=n.getAttribute)===null||l===void 0?void 0:l.call(n,"inert"),d=o===""||o==="true",f=d||i&&n&&r(n.parentNode);return f},$S=function(n){var i,l=n==null||(i=n.getAttribute)===null||i===void 0?void 0:i.call(n,"contenteditable");return l===""||l==="true"},ZS=function(n,i,l){if(Dc(n))return[];var o=Array.prototype.slice.apply(n.querySelectorAll(Rc));return i&&nl.call(n,Rc)&&o.unshift(n),o=o.filter(l),o},VS=function r(n,i,l){for(var o=[],d=Array.from(n);d.length;){var f=d.shift();if(!Dc(f,!1))if(f.tagName==="SLOT"){var h=f.assignedElements(),g=h.length?h:f.children,p=r(g,!0,l);l.flatten?o.push.apply(o,p):o.push({scopeParent:f,candidates:p})}else{var y=nl.call(f,Rc);y&&l.filter(f)&&(i||!n.includes(f))&&o.push(f);var b=f.shadowRoot||typeof l.getShadowRoot=="function"&&l.getShadowRoot(f),j=!Dc(b,!1)&&(!l.shadowRootFilter||l.shadowRootFilter(f));if(b&&j){var N=r(b===!0?f.children:b.children,!0,l);l.flatten?o.push.apply(o,N):o.push({scopeParent:f,candidates:N})}else d.unshift.apply(d,f.children)}}return o},Ab=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},Db=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||$S(n))&&!Ab(n)?0:n.tabIndex},KS=function(n,i){var l=Db(n);return l<0&&i&&!Ab(n)?0:l},YS=function(n,i){return n.tabIndex===i.tabIndex?n.documentOrder-i.documentOrder:n.tabIndex-i.tabIndex},Mb=function(n){return n.tagName==="INPUT"},XS=function(n){return Mb(n)&&n.type==="hidden"},QS=function(n){var i=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(l){return l.tagName==="SUMMARY"});return i},WS=function(n,i){for(var l=0;l<n.length;l++)if(n[l].checked&&n[l].form===i)return n[l]},JS=function(n){if(!n.name)return!0;var i=n.form||Ac(n),l=function(h){return i.querySelectorAll('input[type="radio"][name="'+h+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=l(window.CSS.escape(n.name));else try{o=l(n.name)}catch(f){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",f.message),!1}var d=WS(o,n.form);return!d||d===n},e_=function(n){return Mb(n)&&n.type==="radio"},t_=function(n){return e_(n)&&!JS(n)},a_=function(n){var i,l=n&&Ac(n),o=(i=l)===null||i===void 0?void 0:i.host,d=!1;if(l&&l!==n){var f,h,g;for(d=!!((f=o)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(o)||n!=null&&(g=n.ownerDocument)!==null&&g!==void 0&&g.contains(n));!d&&o;){var p,y,b;l=Ac(o),o=(p=l)===null||p===void 0?void 0:p.host,d=!!((y=o)!==null&&y!==void 0&&(b=y.ownerDocument)!==null&&b!==void 0&&b.contains(o))}}return d},Tx=function(n){var i=n.getBoundingClientRect(),l=i.width,o=i.height;return l===0&&o===0},r_=function(n,i){var l=i.displayCheck,o=i.getShadowRoot;if(getComputedStyle(n).visibility==="hidden")return!0;var d=nl.call(n,"details>summary:first-of-type"),f=d?n.parentElement:n;if(nl.call(f,"details:not([open]) *"))return!0;if(!l||l==="full"||l==="legacy-full"){if(typeof o=="function"){for(var h=n;n;){var g=n.parentElement,p=Ac(n);if(g&&!g.shadowRoot&&o(g)===!0)return Tx(n);n.assignedSlot?n=n.assignedSlot:!g&&p!==n.ownerDocument?n=p.host:n=g}n=h}if(a_(n))return!n.getClientRects().length;if(l!=="legacy-full")return!0}else if(l==="non-zero-area")return Tx(n);return!1},n_=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var i=n.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var l=0;l<i.children.length;l++){var o=i.children.item(l);if(o.tagName==="LEGEND")return nl.call(i,"fieldset[disabled] *")?!0:!o.contains(n)}return!0}i=i.parentElement}return!1},s_=function(n,i){return!(i.disabled||Dc(i)||XS(i)||r_(i,n)||QS(i)||n_(i))},oh=function(n,i){return!(t_(i)||Db(i)<0||!s_(n,i))},l_=function(n){var i=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(i)||i>=0)},i_=function r(n){var i=[],l=[];return n.forEach(function(o,d){var f=!!o.scopeParent,h=f?o.scopeParent:o,g=KS(h,f),p=f?r(o.candidates):h;g===0?f?i.push.apply(i,p):i.push(h):l.push({documentOrder:d,tabIndex:g,item:o,isScope:f,content:p})}),l.sort(YS).reduce(function(o,d){return d.isScope?o.push.apply(o,d.content):o.push(d.content),o},[]).concat(i)},Yc=function(n,i){i=i||{};var l;return i.getShadowRoot?l=VS([n],i.includeContainer,{filter:oh.bind(null,i),flatten:!1,getShadowRoot:i.getShadowRoot,shadowRootFilter:l_}):l=ZS(n,i.includeContainer,oh.bind(null,i)),i_(l)},o_=function(n,i){if(i=i||{},!n)throw new Error("No node provided");return nl.call(n,Rc)===!1?!1:oh(i,n)};function Cx(r,n,i){let{reference:l,floating:o}=r;const d=Sn(n),f=Hh(n),h=Ih(f),g=Zr(n),p=d==="y",y=l.x+l.width/2-o.width/2,b=l.y+l.height/2-o.height/2,j=l[h]/2-o[h]/2;let N;switch(g){case"top":N={x:y,y:l.y-o.height};break;case"bottom":N={x:y,y:l.y+l.height};break;case"right":N={x:l.x+l.width,y:b};break;case"left":N={x:l.x-o.width,y:b};break;default:N={x:l.x,y:l.y}}switch(xr(n)){case"start":N[f]-=j*(i&&p?-1:1);break;case"end":N[f]+=j*(i&&p?-1:1);break}return N}const c_=async(r,n,i)=>{const{placement:l="bottom",strategy:o="absolute",middleware:d=[],platform:f}=i,h=d.filter(Boolean),g=await(f.isRTL==null?void 0:f.isRTL(n));let p=await f.getElementRects({reference:r,floating:n,strategy:o}),{x:y,y:b}=Cx(p,l,g),j=l,N={},w=0;for(let S=0;S<h.length;S++){const{name:E,fn:k}=h[S],{x:A,y:O,data:L,reset:B}=await k({x:y,y:b,initialPlacement:l,placement:j,strategy:o,middlewareData:N,rects:p,platform:f,elements:{reference:r,floating:n}});y=A??y,b=O??b,N={...N,[E]:{...N[E],...L}},B&&w<=50&&(w++,typeof B=="object"&&(B.placement&&(j=B.placement),B.rects&&(p=B.rects===!0?await f.getElementRects({reference:r,floating:n,strategy:o}):B.rects),{x:y,y:b}=Cx(p,j,g)),S=-1)}return{x:y,y:b,placement:j,strategy:o,middlewareData:N}};async function Ph(r,n){var i;n===void 0&&(n={});const{x:l,y:o,platform:d,rects:f,elements:h,strategy:g}=r,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:b="floating",altBoundary:j=!1,padding:N=0}=xl(n,r),w=Eb(N),E=h[j?b==="floating"?"reference":"floating":b],k=Ec(await d.getClippingRect({element:(i=await(d.isElement==null?void 0:d.isElement(E)))==null||i?E:E.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(h.floating)),boundary:p,rootBoundary:y,strategy:g})),A=b==="floating"?{x:l,y:o,width:f.floating.width,height:f.floating.height}:f.reference,O=await(d.getOffsetParent==null?void 0:d.getOffsetParent(h.floating)),L=await(d.isElement==null?void 0:d.isElement(O))?await(d.getScale==null?void 0:d.getScale(O))||{x:1,y:1}:{x:1,y:1},B=Ec(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:O,strategy:g}):A);return{top:(k.top-B.top+w.top)/L.y,bottom:(B.bottom-k.bottom+w.bottom)/L.y,left:(k.left-B.left+w.left)/L.x,right:(B.right-k.right+w.right)/L.x}}const d_=r=>({name:"arrow",options:r,async fn(n){const{x:i,y:l,placement:o,rects:d,platform:f,elements:h,middlewareData:g}=n,{element:p,padding:y=0}=xl(r,n)||{};if(p==null)return{};const b=Eb(y),j={x:i,y:l},N=Hh(o),w=Ih(N),S=await f.getDimensions(p),E=N==="y",k=E?"top":"left",A=E?"bottom":"right",O=E?"clientHeight":"clientWidth",L=d.reference[w]+d.reference[N]-j[N]-d.floating[w],B=j[N]-d.reference[N],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p));let $=V?V[O]:0;(!$||!await(f.isElement==null?void 0:f.isElement(V)))&&($=h.floating[O]||d.floating[w]);const le=L/2-B/2,q=$/2-S[w]/2-1,K=rl(b[k],q),ae=rl(b[A],q),G=K,Z=$-S[w]-ae,z=$/2-S[w]/2+le,H=ih(G,z,Z),C=!g.arrow&&xr(o)!=null&&z!==H&&d.reference[w]/2-(z<G?K:ae)-S[w]/2<0,U=C?z<G?z-G:z-Z:0;return{[N]:j[N]+U,data:{[N]:H,centerOffset:z-H-U,...C&&{alignmentOffset:U}},reset:C}}});function u_(r,n,i){return(r?[...i.filter(o=>xr(o)===r),...i.filter(o=>xr(o)!==r)]:i.filter(o=>Zr(o)===o)).filter(o=>r?xr(o)===r||(n?Tc(o)!==o:!1):!0)}const f_=function(r){return r===void 0&&(r={}),{name:"autoPlacement",options:r,async fn(n){var i,l,o;const{rects:d,middlewareData:f,placement:h,platform:g,elements:p}=n,{crossAxis:y=!1,alignment:b,allowedPlacements:j=kx,autoAlignment:N=!0,...w}=xl(r,n),S=b!==void 0||j===kx?u_(b||null,N,j):j,E=await Ph(n,w),k=((i=f.autoPlacement)==null?void 0:i.index)||0,A=S[k];if(A==null)return{};const O=Cb(A,d,await(g.isRTL==null?void 0:g.isRTL(p.floating)));if(h!==A)return{reset:{placement:S[0]}};const L=[E[Zr(A)],E[O[0]],E[O[1]]],B=[...((l=f.autoPlacement)==null?void 0:l.overflows)||[],{placement:A,overflows:L}],V=S[k+1];if(V)return{data:{index:k+1,overflows:B},reset:{placement:V}};const $=B.map(K=>{const ae=xr(K.placement);return[K.placement,ae&&y?K.overflows.slice(0,2).reduce((G,Z)=>G+Z,0):K.overflows[0],K.overflows]}).sort((K,ae)=>K[1]-ae[1]),q=((o=$.filter(K=>K[2].slice(0,xr(K[0])?2:3).every(ae=>ae<=0))[0])==null?void 0:o[0])||$[0][0];return q!==h?{data:{index:k+1,overflows:B},reset:{placement:q}}:{}}}},h_=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(n){var i,l;const{placement:o,middlewareData:d,rects:f,initialPlacement:h,platform:g,elements:p}=n,{mainAxis:y=!0,crossAxis:b=!0,fallbackPlacements:j,fallbackStrategy:N="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...E}=xl(r,n);if((i=d.arrow)!=null&&i.alignmentOffset)return{};const k=Zr(o),A=Sn(h),O=Zr(h)===h,L=await(g.isRTL==null?void 0:g.isRTL(p.floating)),B=j||(O||!S?[Cc(h)]:GS(h)),V=w!=="none";!j&&V&&B.push(...HS(h,S,w,L));const $=[h,...B],le=await Ph(n,E),q=[];let K=((l=d.flip)==null?void 0:l.overflows)||[];if(y&&q.push(le[k]),b){const z=Cb(o,f,L);q.push(le[z[0]],le[z[1]])}if(K=[...K,{placement:o,overflows:q}],!q.every(z=>z<=0)){var ae,G;const z=(((ae=d.flip)==null?void 0:ae.index)||0)+1,H=$[z];if(H&&(!(b==="alignment"?A!==Sn(H):!1)||K.every(T=>T.overflows[0]>0&&Sn(T.placement)===A)))return{data:{index:z,overflows:K},reset:{placement:H}};let C=(G=K.filter(U=>U.overflows[0]<=0).sort((U,T)=>U.overflows[1]-T.overflows[1])[0])==null?void 0:G.placement;if(!C)switch(N){case"bestFit":{var Z;const U=(Z=K.filter(T=>{if(V){const R=Sn(T.placement);return R===A||R==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(R=>R>0).reduce((R,v)=>R+v,0)]).sort((T,R)=>T[1]-R[1])[0])==null?void 0:Z[0];U&&(C=U);break}case"initialPlacement":C=h;break}if(o!==C)return{reset:{placement:C}}}return{}}}},p_=new Set(["left","top"]);async function m_(r,n){const{placement:i,platform:l,elements:o}=r,d=await(l.isRTL==null?void 0:l.isRTL(o.floating)),f=Zr(i),h=xr(i),g=Sn(i)==="y",p=p_.has(f)?-1:1,y=d&&g?-1:1,b=xl(n,r);let{mainAxis:j,crossAxis:N,alignmentAxis:w}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return h&&typeof w=="number"&&(N=h==="end"?w*-1:w),g?{x:N*y,y:j*p}:{x:j*p,y:N*y}}const g_=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(n){var i,l;const{x:o,y:d,placement:f,middlewareData:h}=n,g=await m_(n,r);return f===((i=h.offset)==null?void 0:i.placement)&&(l=h.arrow)!=null&&l.alignmentOffset?{}:{x:o+g.x,y:d+g.y,data:{...g,placement:f}}}}},x_=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(n){const{x:i,y:l,placement:o}=n,{mainAxis:d=!0,crossAxis:f=!1,limiter:h={fn:E=>{let{x:k,y:A}=E;return{x:k,y:A}}},...g}=xl(r,n),p={x:i,y:l},y=await Ph(n,g),b=Sn(Zr(o)),j=Tb(b);let N=p[j],w=p[b];if(d){const E=j==="y"?"top":"left",k=j==="y"?"bottom":"right",A=N+y[E],O=N-y[k];N=ih(A,N,O)}if(f){const E=b==="y"?"top":"left",k=b==="y"?"bottom":"right",A=w+y[E],O=w-y[k];w=ih(A,w,O)}const S=h.fn({...n,[j]:N,[b]:w});return{...S,data:{x:S.x-i,y:S.y-l,enabled:{[j]:d,[b]:f}}}}}};function Ob(r){const n=Xa(r);let i=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const o=Pt(r),d=o?r.offsetWidth:i,f=o?r.offsetHeight:l,h=_c(i)!==d||_c(l)!==f;return h&&(i=d,l=f),{width:i,height:l,$:h}}function qh(r){return wt(r)?r:r.contextElement}function al(r){const n=qh(r);if(!Pt(n))return gr(1);const i=n.getBoundingClientRect(),{width:l,height:o,$:d}=Ob(n);let f=(d?_c(i.width):i.width)/l,h=(d?_c(i.height):i.height)/o;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const y_=gr(0);function zb(r){const n=Na(r);return!Vc()||!n.visualViewport?y_:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function b_(r,n,i){return n===void 0&&(n=!1),!i||n&&i!==Na(r)?!1:n}function is(r,n,i,l){n===void 0&&(n=!1),i===void 0&&(i=!1);const o=r.getBoundingClientRect(),d=qh(r);let f=gr(1);n&&(l?wt(l)&&(f=al(l)):f=al(r));const h=b_(d,i,l)?zb(d):gr(0);let g=(o.left+h.x)/f.x,p=(o.top+h.y)/f.y,y=o.width/f.x,b=o.height/f.y;if(d){const j=Na(d),N=l&&wt(l)?Na(l):l;let w=j,S=sh(w);for(;S&&l&&N!==w;){const E=al(S),k=S.getBoundingClientRect(),A=Xa(S),O=k.left+(S.clientLeft+parseFloat(A.paddingLeft))*E.x,L=k.top+(S.clientTop+parseFloat(A.paddingTop))*E.y;g*=E.x,p*=E.y,y*=E.x,b*=E.y,g+=O,p+=L,w=Na(S),S=sh(w)}}return Ec({width:y,height:b,x:g,y:p})}function $h(r,n){const i=Kc(r).scrollLeft;return n?n.left+i:is(wr(r)).left+i}function Lb(r,n,i){i===void 0&&(i=!1);const l=r.getBoundingClientRect(),o=l.left+n.scrollLeft-(i?0:$h(r,l)),d=l.top+n.scrollTop;return{x:o,y:d}}function v_(r){let{elements:n,rect:i,offsetParent:l,strategy:o}=r;const d=o==="fixed",f=wr(l),h=n?Zc(n.floating):!1;if(l===f||h&&d)return i;let g={scrollLeft:0,scrollTop:0},p=gr(1);const y=gr(0),b=Pt(l);if((b||!b&&!d)&&((Dn(l)!=="body"||Hi(f))&&(g=Kc(l)),Pt(l))){const N=is(l);p=al(l),y.x=N.x+l.clientLeft,y.y=N.y+l.clientTop}const j=f&&!b&&!d?Lb(f,g,!0):gr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-g.scrollLeft*p.x+y.x+j.x,y:i.y*p.y-g.scrollTop*p.y+y.y+j.y}}function j_(r){return Array.from(r.getClientRects())}function w_(r){const n=wr(r),i=Kc(r),l=r.ownerDocument.body,o=ns(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),d=ns(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let f=-i.scrollLeft+$h(r);const h=-i.scrollTop;return Xa(l).direction==="rtl"&&(f+=ns(n.clientWidth,l.clientWidth)-o),{width:o,height:d,x:f,y:h}}function N_(r,n){const i=Na(r),l=wr(r),o=i.visualViewport;let d=l.clientWidth,f=l.clientHeight,h=0,g=0;if(o){d=o.width,f=o.height;const p=Vc();(!p||p&&n==="fixed")&&(h=o.offsetLeft,g=o.offsetTop)}return{width:d,height:f,x:h,y:g}}const k_=new Set(["absolute","fixed"]);function S_(r,n){const i=is(r,!0,n==="fixed"),l=i.top+r.clientTop,o=i.left+r.clientLeft,d=Pt(r)?al(r):gr(1),f=r.clientWidth*d.x,h=r.clientHeight*d.y,g=o*d.x,p=l*d.y;return{width:f,height:h,x:g,y:p}}function Ex(r,n,i){let l;if(n==="viewport")l=N_(r,i);else if(n==="document")l=w_(wr(r));else if(wt(n))l=S_(n,i);else{const o=zb(r);l={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return Ec(l)}function Ub(r,n){const i=$r(r);return i===n||!wt(i)||Hr(i)?!1:Xa(i).position==="fixed"||Ub(i,n)}function __(r,n){const i=n.get(r);if(i)return i;let l=Tn(r,[],!1).filter(h=>wt(h)&&Dn(h)!=="body"),o=null;const d=Xa(r).position==="fixed";let f=d?$r(r):r;for(;wt(f)&&!Hr(f);){const h=Xa(f),g=Uh(f);!g&&h.position==="fixed"&&(o=null),(d?!g&&!o:!g&&h.position==="static"&&!!o&&k_.has(o.position)||Hi(f)&&!g&&Ub(r,f))?l=l.filter(y=>y!==f):o=h,f=$r(f)}return n.set(r,l),l}function T_(r){let{element:n,boundary:i,rootBoundary:l,strategy:o}=r;const f=[...i==="clippingAncestors"?Zc(n)?[]:__(n,this._c):[].concat(i),l],h=f[0],g=f.reduce((p,y)=>{const b=Ex(n,y,o);return p.top=ns(b.top,p.top),p.right=rl(b.right,p.right),p.bottom=rl(b.bottom,p.bottom),p.left=ns(b.left,p.left),p},Ex(n,h,o));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function C_(r){const{width:n,height:i}=Ob(r);return{width:n,height:i}}function E_(r,n,i){const l=Pt(n),o=wr(n),d=i==="fixed",f=is(r,!0,d,n);let h={scrollLeft:0,scrollTop:0};const g=gr(0);function p(){g.x=$h(o)}if(l||!l&&!d)if((Dn(n)!=="body"||Hi(o))&&(h=Kc(n)),l){const N=is(n,!0,d,n);g.x=N.x+n.clientLeft,g.y=N.y+n.clientTop}else o&&p();d&&!l&&o&&p();const y=o&&!l&&!d?Lb(o,h):gr(0),b=f.left+h.scrollLeft-g.x-y.x,j=f.top+h.scrollTop-g.y-y.y;return{x:b,y:j,width:f.width,height:f.height}}function Lf(r){return Xa(r).position==="static"}function Rx(r,n){if(!Pt(r)||Xa(r).position==="fixed")return null;if(n)return n(r);let i=r.offsetParent;return wr(r)===i&&(i=i.ownerDocument.body),i}function Gb(r,n){const i=Na(r);if(Zc(r))return i;if(!Pt(r)){let o=$r(r);for(;o&&!Hr(o);){if(wt(o)&&!Lf(o))return o;o=$r(o)}return i}let l=Rx(r,n);for(;l&&wS(l)&&Lf(l);)l=Rx(l,n);return l&&Hr(l)&&Lf(l)&&!Uh(l)?i:l||TS(r)||i}const R_=async function(r){const n=this.getOffsetParent||Gb,i=this.getDimensions,l=await i(r.floating);return{reference:E_(r.reference,await n(r.floating),r.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function A_(r){return Xa(r).direction==="rtl"}const D_={convertOffsetParentRelativeRectToViewportRelativeRect:v_,getDocumentElement:wr,getClippingRect:T_,getOffsetParent:Gb,getElementRects:R_,getClientRects:j_,getDimensions:C_,getScale:al,isElement:wt,isRTL:A_};function Fb(r,n){return r.x===n.x&&r.y===n.y&&r.width===n.width&&r.height===n.height}function M_(r,n){let i=null,l;const o=wr(r);function d(){var h;clearTimeout(l),(h=i)==null||h.disconnect(),i=null}function f(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),d();const p=r.getBoundingClientRect(),{left:y,top:b,width:j,height:N}=p;if(h||n(),!j||!N)return;const w=el(b),S=el(o.clientWidth-(y+j)),E=el(o.clientHeight-(b+N)),k=el(y),O={rootMargin:-w+"px "+-S+"px "+-E+"px "+-k+"px",threshold:ns(0,rl(1,g))||1};let L=!0;function B(V){const $=V[0].intersectionRatio;if($!==g){if(!L)return f();$?f(!1,$):l=setTimeout(()=>{f(!1,1e-7)},1e3)}$===1&&!Fb(p,r.getBoundingClientRect())&&f(),L=!1}try{i=new IntersectionObserver(B,{...O,root:o.ownerDocument})}catch{i=new IntersectionObserver(B,O)}i.observe(r)}return f(!0),d}function Bb(r,n,i,l){l===void 0&&(l={});const{ancestorScroll:o=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=l,p=qh(r),y=o||d?[...p?Tn(p):[],...Tn(n)]:[];y.forEach(k=>{o&&k.addEventListener("scroll",i,{passive:!0}),d&&k.addEventListener("resize",i)});const b=p&&h?M_(p,i):null;let j=-1,N=null;f&&(N=new ResizeObserver(k=>{let[A]=k;A&&A.target===p&&N&&(N.unobserve(n),cancelAnimationFrame(j),j=requestAnimationFrame(()=>{var O;(O=N)==null||O.observe(n)})),i()}),p&&!g&&N.observe(p),N.observe(n));let w,S=g?is(r):null;g&&E();function E(){const k=is(r);S&&!Fb(S,k)&&i(),S=k,w=requestAnimationFrame(E)}return i(),()=>{var k;y.forEach(A=>{o&&A.removeEventListener("scroll",i),d&&A.removeEventListener("resize",i)}),b==null||b(),(k=N)==null||k.disconnect(),N=null,g&&cancelAnimationFrame(w)}}const O_=g_,z_=f_,L_=x_,U_=h_,Ax=d_,G_=(r,n,i)=>{const l=new Map,o={platform:D_,...i},d={...o.platform,_c:l};return c_(r,n,{...o,platform:d})};var F_=typeof document<"u",B_=function(){},bc=F_?x.useLayoutEffect:B_;function Mc(r,n){if(r===n)return!0;if(typeof r!=typeof n)return!1;if(typeof r=="function"&&r.toString()===n.toString())return!0;let i,l,o;if(r&&n&&typeof r=="object"){if(Array.isArray(r)){if(i=r.length,i!==n.length)return!1;for(l=i;l--!==0;)if(!Mc(r[l],n[l]))return!1;return!0}if(o=Object.keys(r),i=o.length,i!==Object.keys(n).length)return!1;for(l=i;l--!==0;)if(!{}.hasOwnProperty.call(n,o[l]))return!1;for(l=i;l--!==0;){const d=o[l];if(!(d==="_owner"&&r.$$typeof)&&!Mc(r[d],n[d]))return!1}return!0}return r!==r&&n!==n}function Ib(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Dx(r,n){const i=Ib(r);return Math.round(n*i)/i}function Uf(r){const n=x.useRef(r);return bc(()=>{n.current=r}),n}function I_(r){r===void 0&&(r={});const{placement:n="bottom",strategy:i="absolute",middleware:l=[],platform:o,elements:{reference:d,floating:f}={},transform:h=!0,whileElementsMounted:g,open:p}=r,[y,b]=x.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[j,N]=x.useState(l);Mc(j,l)||N(l);const[w,S]=x.useState(null),[E,k]=x.useState(null),A=x.useCallback(T=>{T!==V.current&&(V.current=T,S(T))},[]),O=x.useCallback(T=>{T!==$.current&&($.current=T,k(T))},[]),L=d||w,B=f||E,V=x.useRef(null),$=x.useRef(null),le=x.useRef(y),q=g!=null,K=Uf(g),ae=Uf(o),G=Uf(p),Z=x.useCallback(()=>{if(!V.current||!$.current)return;const T={placement:n,strategy:i,middleware:j};ae.current&&(T.platform=ae.current),G_(V.current,$.current,T).then(R=>{const v={...R,isPositioned:G.current!==!1};z.current&&!Mc(le.current,v)&&(le.current=v,Xy.flushSync(()=>{b(v)}))})},[j,n,i,ae,G]);bc(()=>{p===!1&&le.current.isPositioned&&(le.current.isPositioned=!1,b(T=>({...T,isPositioned:!1})))},[p]);const z=x.useRef(!1);bc(()=>(z.current=!0,()=>{z.current=!1}),[]),bc(()=>{if(L&&(V.current=L),B&&($.current=B),L&&B){if(K.current)return K.current(L,B,Z);Z()}},[L,B,Z,K,q]);const H=x.useMemo(()=>({reference:V,floating:$,setReference:A,setFloating:O}),[A,O]),C=x.useMemo(()=>({reference:L,floating:B}),[L,B]),U=x.useMemo(()=>{const T={position:i,left:0,top:0};if(!C.floating)return T;const R=Dx(C.floating,y.x),v=Dx(C.floating,y.y);return h?{...T,transform:"translate("+R+"px, "+v+"px)",...Ib(C.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:R,top:v}},[i,h,C.floating,y.x,y.y]);return x.useMemo(()=>({...y,update:Z,refs:H,elements:C,floatingStyles:U}),[y,Z,H,C,U])}const H_=r=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:r,fn(i){const{element:l,padding:o}=typeof r=="function"?r(i):r;return l&&n(l)?l.current!=null?Ax({element:l.current,padding:o}).fn(i):{}:l?Ax({element:l,padding:o}).fn(i):{}}}},P_=(r,n)=>({...O_(r),options:[r,n]}),q_=(r,n)=>({...L_(r),options:[r,n]}),$_=(r,n)=>({...U_(r),options:[r,n]}),Z_=(r,n)=>({...z_(r),options:[r,n]}),V_=(r,n)=>({...H_(r),options:[r,n]});function Oc(r){return x.useMemo(()=>r.every(n=>n==null)?null:n=>{r.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})},r)}const Hb={...Uw},K_=Hb.useInsertionEffect,Y_=K_||(r=>r());function Kt(r){const n=x.useRef(()=>{});return Y_(()=>{n.current=r}),x.useCallback(function(){for(var i=arguments.length,l=new Array(i),o=0;o<i;o++)l[o]=arguments[o];return n.current==null?void 0:n.current(...l)},[])}const Zh="ArrowUp",Pi="ArrowDown",Cn="ArrowLeft",En="ArrowRight";function fc(r,n,i){return Math.floor(r/n)!==i}function Ri(r,n){return n<0||n>=r.current.length}function Gf(r,n){return pa(r,{disabledIndices:n})}function Mx(r,n){return pa(r,{decrement:!0,startingIndex:r.current.length,disabledIndices:n})}function pa(r,n){let{startingIndex:i=-1,decrement:l=!1,disabledIndices:o,amount:d=1}=n===void 0?{}:n;const f=r.current;let h=i;do h+=l?-d:d;while(h>=0&&h<=f.length-1&&vc(f,h,o));return h}function X_(r,n){let{event:i,orientation:l,loop:o,rtl:d,cols:f,disabledIndices:h,minIndex:g,maxIndex:p,prevIndex:y,stopEvent:b=!1}=n,j=y;if(i.key===Zh){if(b&&oa(i),y===-1)j=p;else if(j=pa(r,{startingIndex:j,amount:f,decrement:!0,disabledIndices:h}),o&&(y-f<g||j<0)){const N=y%f,w=p%f,S=p-(w-N);w===N?j=p:j=w>N?S:S-f}Ri(r,j)&&(j=y)}if(i.key===Pi&&(b&&oa(i),y===-1?j=g:(j=pa(r,{startingIndex:y,amount:f,disabledIndices:h}),o&&y+f>p&&(j=pa(r,{startingIndex:y%f-f,amount:f,disabledIndices:h}))),Ri(r,j)&&(j=y)),l==="both"){const N=el(y/f);i.key===(d?Cn:En)&&(b&&oa(i),y%f!==f-1?(j=pa(r,{startingIndex:y,disabledIndices:h}),o&&fc(j,f,N)&&(j=pa(r,{startingIndex:y-y%f-1,disabledIndices:h}))):o&&(j=pa(r,{startingIndex:y-y%f-1,disabledIndices:h})),fc(j,f,N)&&(j=y)),i.key===(d?En:Cn)&&(b&&oa(i),y%f!==0?(j=pa(r,{startingIndex:y,decrement:!0,disabledIndices:h}),o&&fc(j,f,N)&&(j=pa(r,{startingIndex:y+(f-y%f),decrement:!0,disabledIndices:h}))):o&&(j=pa(r,{startingIndex:y+(f-y%f),decrement:!0,disabledIndices:h})),fc(j,f,N)&&(j=y));const w=el(p/f)===N;Ri(r,j)&&(o&&w?j=i.key===(d?En:Cn)?p:pa(r,{startingIndex:y-y%f-1,disabledIndices:h}):j=y)}return j}function Q_(r,n,i){const l=[];let o=0;return r.forEach((d,f)=>{let{width:h,height:g}=d,p=!1;for(i&&(o=0);!p;){const y=[];for(let b=0;b<h;b++)for(let j=0;j<g;j++)y.push(o+b+j*n);o%n+h<=n&&y.every(b=>l[b]==null)?(y.forEach(b=>{l[b]=f}),p=!0):o++}}),[...l]}function W_(r,n,i,l,o){if(r===-1)return-1;const d=i.indexOf(r),f=n[r];switch(o){case"tl":return d;case"tr":return f?d+f.width-1:d;case"bl":return f?d+(f.height-1)*l:d;case"br":return i.lastIndexOf(r)}}function J_(r,n){return n.flatMap((i,l)=>r.includes(i)?[l]:[])}function vc(r,n,i){if(i)return i.includes(n);const l=r[n];return l==null||l.hasAttribute("disabled")||l.getAttribute("aria-disabled")==="true"}var kt=typeof document<"u"?x.useLayoutEffect:x.useEffect;function e4(r,n){const i=r.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_FOLLOWING||i&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:i&Node.DOCUMENT_POSITION_PRECEDING||i&Node.DOCUMENT_POSITION_CONTAINS?1:0}function t4(r,n){if(r.size!==n.size)return!1;for(const[i,l]of r.entries())if(l!==n.get(i))return!1;return!0}const Pb=x.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function a4(r){const{children:n,elementsRef:i,labelsRef:l}=r,[o,d]=x.useState(()=>new Map),f=x.useCallback(g=>{d(p=>new Map(p).set(g,null))},[]),h=x.useCallback(g=>{d(p=>{const y=new Map(p);return y.delete(g),y})},[]);return kt(()=>{const g=new Map(o);Array.from(g.keys()).sort(e4).forEach((y,b)=>{g.set(y,b)}),t4(o,g)||d(g)},[o]),t.jsx(Pb.Provider,{value:x.useMemo(()=>({register:f,unregister:h,map:o,elementsRef:i,labelsRef:l}),[f,h,o,i,l]),children:n})}function r4(r){r===void 0&&(r={});const{label:n}=r,{register:i,unregister:l,map:o,elementsRef:d,labelsRef:f}=x.useContext(Pb),[h,g]=x.useState(null),p=x.useRef(null),y=x.useCallback(b=>{if(p.current=b,h!==null&&(d.current[h]=b,f)){var j;const N=n!==void 0;f.current[h]=N?n:(j=b==null?void 0:b.textContent)!=null?j:null}},[h,d,f,n]);return kt(()=>{const b=p.current;if(b)return i(b),()=>{l(b)}},[i,l]),kt(()=>{const b=p.current?o.get(p.current):null;b!=null&&g(b)},[o]),x.useMemo(()=>({ref:y,index:h??-1}),[h,y])}let Ox=!1,n4=0;const zx=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+n4++;function s4(){const[r,n]=x.useState(()=>Ox?zx():void 0);return kt(()=>{r==null&&n(zx())},[]),x.useEffect(()=>{Ox=!0},[]),r}const l4=Hb.useId,Vh=l4||s4;function i4(){const r=new Map;return{emit(n,i){var l;(l=r.get(n))==null||l.forEach(o=>o(i))},on(n,i){r.set(n,[...r.get(n)||[],i])},off(n,i){var l;r.set(n,((l=r.get(n))==null?void 0:l.filter(o=>o!==i))||[])}}}const o4=x.createContext(null),c4=x.createContext(null),Xc=()=>{var r;return((r=x.useContext(o4))==null?void 0:r.id)||null},qi=()=>x.useContext(c4);function os(r){return"data-floating-ui-"+r}function Oa(r){const n=x.useRef(r);return kt(()=>{n.current=r}),n}const Lx=os("safe-polygon");function Ff(r,n,i){return i&&!zi(i)?0:typeof r=="number"?r:r==null?void 0:r[n]}function d4(r,n){n===void 0&&(n={});const{open:i,onOpenChange:l,dataRef:o,events:d,elements:f}=r,{enabled:h=!0,delay:g=0,handleClose:p=null,mouseOnly:y=!1,restMs:b=0,move:j=!0}=n,N=qi(),w=Xc(),S=Oa(p),E=Oa(g),k=Oa(i),A=x.useRef(),O=x.useRef(-1),L=x.useRef(),B=x.useRef(-1),V=x.useRef(!0),$=x.useRef(!1),le=x.useRef(()=>{}),q=x.useRef(!1),K=x.useCallback(()=>{var U;const T=(U=o.current.openEvent)==null?void 0:U.type;return(T==null?void 0:T.includes("mouse"))&&T!=="mousedown"},[o]);x.useEffect(()=>{if(!h)return;function U(T){let{open:R}=T;R||(clearTimeout(O.current),clearTimeout(B.current),V.current=!0,q.current=!1)}return d.on("openchange",U),()=>{d.off("openchange",U)}},[h,d]),x.useEffect(()=>{if(!h||!S.current||!i)return;function U(R){K()&&l(!1,R,"hover")}const T=ca(f.floating).documentElement;return T.addEventListener("mouseleave",U),()=>{T.removeEventListener("mouseleave",U)}},[f.floating,i,l,h,S,K]);const ae=x.useCallback(function(U,T,R){T===void 0&&(T=!0),R===void 0&&(R="hover");const v=Ff(E.current,"close",A.current);v&&!L.current?(clearTimeout(O.current),O.current=window.setTimeout(()=>l(!1,U,R),v)):T&&(clearTimeout(O.current),l(!1,U,R))},[E,l]),G=Kt(()=>{le.current(),L.current=void 0}),Z=Kt(()=>{if($.current){const U=ca(f.floating).body;U.style.pointerEvents="",U.removeAttribute(Lx),$.current=!1}}),z=Kt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);x.useEffect(()=>{if(!h)return;function U(M){if(clearTimeout(O.current),V.current=!1,y&&!zi(A.current)||b>0&&!Ff(E.current,"open"))return;const I=Ff(E.current,"open",A.current);I?O.current=window.setTimeout(()=>{k.current||l(!0,M,"hover")},I):i||l(!0,M,"hover")}function T(M){if(z())return;le.current();const I=ca(f.floating);if(clearTimeout(B.current),q.current=!1,S.current&&o.current.floatingContext){i||clearTimeout(O.current),L.current=S.current({...o.current.floatingContext,tree:N,x:M.clientX,y:M.clientY,onClose(){Z(),G(),z()||ae(M,!0,"safe-polygon")}});const xe=L.current;I.addEventListener("mousemove",xe),le.current=()=>{I.removeEventListener("mousemove",xe)};return}(A.current==="touch"?!Ht(f.floating,M.relatedTarget):!0)&&ae(M)}function R(M){z()||o.current.floatingContext&&(S.current==null||S.current({...o.current.floatingContext,tree:N,x:M.clientX,y:M.clientY,onClose(){Z(),G(),z()||ae(M)}})(M))}if(wt(f.domReference)){var v;const M=f.domReference;return i&&M.addEventListener("mouseleave",R),(v=f.floating)==null||v.addEventListener("mouseleave",R),j&&M.addEventListener("mousemove",U,{once:!0}),M.addEventListener("mouseenter",U),M.addEventListener("mouseleave",T),()=>{var I;i&&M.removeEventListener("mouseleave",R),(I=f.floating)==null||I.removeEventListener("mouseleave",R),j&&M.removeEventListener("mousemove",U),M.removeEventListener("mouseenter",U),M.removeEventListener("mouseleave",T)}}},[f,h,r,y,b,j,ae,G,Z,l,i,k,N,E,S,o,z]),kt(()=>{var U;if(h&&i&&(U=S.current)!=null&&U.__options.blockPointerEvents&&K()){$.current=!0;const R=f.floating;if(wt(f.domReference)&&R){var T;const v=ca(f.floating).body;v.setAttribute(Lx,"");const M=f.domReference,I=N==null||(T=N.nodesRef.current.find(ee=>ee.id===w))==null||(T=T.context)==null?void 0:T.elements.floating;return I&&(I.style.pointerEvents=""),v.style.pointerEvents="none",M.style.pointerEvents="auto",R.style.pointerEvents="auto",()=>{v.style.pointerEvents="",M.style.pointerEvents="",R.style.pointerEvents=""}}}},[h,i,w,f,N,S,K]),kt(()=>{i||(A.current=void 0,q.current=!1,G(),Z())},[i,G,Z]),x.useEffect(()=>()=>{G(),clearTimeout(O.current),clearTimeout(B.current),Z()},[h,f.domReference,G,Z]);const H=x.useMemo(()=>{function U(T){A.current=T.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove(T){const{nativeEvent:R}=T;function v(){!V.current&&!k.current&&l(!0,R,"hover")}y&&!zi(A.current)||i||b===0||q.current&&T.movementX**2+T.movementY**2<2||(clearTimeout(B.current),A.current==="touch"?v():(q.current=!0,B.current=window.setTimeout(v,b)))}}},[y,l,i,k,b]),C=x.useMemo(()=>({onMouseEnter(){clearTimeout(O.current)},onMouseLeave(U){z()||ae(U.nativeEvent,!1)}}),[ae,z]);return x.useMemo(()=>h?{reference:H,floating:C}:{},[h,H,C])}let Ux=0;function es(r,n){n===void 0&&(n={});const{preventScroll:i=!1,cancelPrevious:l=!0,sync:o=!1}=n;l&&cancelAnimationFrame(Ux);const d=()=>r==null?void 0:r.focus({preventScroll:i});o?d():Ux=requestAnimationFrame(d)}function Gx(r,n){var i;let l=[],o=(i=r.find(d=>d.id===n))==null?void 0:i.parentId;for(;o;){const d=r.find(f=>f.id===o);o=d==null?void 0:d.parentId,d&&(l=l.concat(d))}return l}function ss(r,n){let i=r.filter(o=>{var d;return o.parentId===n&&((d=o.context)==null?void 0:d.open)}),l=i;for(;l.length;)l=r.filter(o=>{var d;return(d=l)==null?void 0:d.some(f=>{var h;return o.parentId===f.id&&((h=o.context)==null?void 0:h.open)})}),i=i.concat(l);return i}function u4(r,n){let i,l=-1;function o(d,f){f>l&&(i=d,l=f),ss(r,d).forEach(g=>{o(g.id,f+1)})}return o(n,0),r.find(d=>d.id===i)}let Ws=new WeakMap,hc=new WeakSet,pc={},Bf=0;const f4=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,qb=r=>r&&(r.host||qb(r.parentNode)),h4=(r,n)=>n.map(i=>{if(r.contains(i))return i;const l=qb(i);return r.contains(l)?l:null}).filter(i=>i!=null);function p4(r,n,i,l){const o="data-floating-ui-inert",d=l?"inert":i?"aria-hidden":null,f=h4(n,r),h=new Set,g=new Set(f),p=[];pc[o]||(pc[o]=new WeakMap);const y=pc[o];f.forEach(b),j(n),h.clear();function b(N){!N||h.has(N)||(h.add(N),N.parentNode&&b(N.parentNode))}function j(N){!N||g.has(N)||[].forEach.call(N.children,w=>{if(Dn(w)!=="script")if(h.has(w))j(w);else{const S=d?w.getAttribute(d):null,E=S!==null&&S!=="false",k=Ws.get(w)||0,A=d?k+1:k,O=(y.get(w)||0)+1;Ws.set(w,A),y.set(w,O),p.push(w),A===1&&E&&hc.add(w),O===1&&w.setAttribute(o,""),!E&&d&&w.setAttribute(d,"true")}})}return Bf++,()=>{p.forEach(N=>{const w=Ws.get(N)||0,S=d?w-1:w,E=(y.get(N)||0)-1;Ws.set(N,S),y.set(N,E),S||(!hc.has(N)&&d&&N.removeAttribute(d),hc.delete(N)),E||N.removeAttribute(o)}),Bf--,Bf||(Ws=new WeakMap,Ws=new WeakMap,hc=new WeakSet,pc={})}}function Fx(r,n,i){n===void 0&&(n=!1),i===void 0&&(i=!1);const l=ca(r[0]).body;return p4(r.concat(Array.from(l.querySelectorAll("[aria-live]"))),l,n,i)}const Qc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function $b(r,n){const i=Yc(r,Qc());n==="prev"&&i.reverse();const l=i.indexOf(rr(ca(r)));return i.slice(l+1)[0]}function Zb(){return $b(document.body,"next")}function Vb(){return $b(document.body,"prev")}function Ai(r,n){const i=n||r.currentTarget,l=r.relatedTarget;return!l||!Ht(i,l)}function m4(r){Yc(r,Qc()).forEach(i=>{i.dataset.tabindex=i.getAttribute("tabindex")||"",i.setAttribute("tabindex","-1")})}function Bx(r){r.querySelectorAll("[data-tabindex]").forEach(i=>{const l=i.dataset.tabindex;delete i.dataset.tabindex,l?i.setAttribute("tabindex",l):i.removeAttribute("tabindex")})}const Wc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let g4;function Ix(r){r.key==="Tab"&&(r.target,clearTimeout(g4))}const zc=x.forwardRef(function(n,i){const[l,o]=x.useState();kt(()=>(Sb()&&o("button"),document.addEventListener("keydown",Ix),()=>{document.removeEventListener("keydown",Ix)}),[]);const d={ref:i,tabIndex:0,role:l,"aria-hidden":l?void 0:!0,[os("focus-guard")]:"",style:Wc};return t.jsx("span",{...n,...d})}),Kb=x.createContext(null),Hx=os("portal");function x4(r){r===void 0&&(r={});const{id:n,root:i}=r,l=Vh(),o=Yb(),[d,f]=x.useState(null),h=x.useRef(null);return kt(()=>()=>{d==null||d.remove(),queueMicrotask(()=>{h.current=null})},[d]),kt(()=>{if(!l||h.current)return;const g=n?document.getElementById(n):null;if(!g)return;const p=document.createElement("div");p.id=l,p.setAttribute(Hx,""),g.appendChild(p),h.current=p,f(p)},[n,l]),kt(()=>{if(i===null||!l||h.current)return;let g=i||(o==null?void 0:o.portalNode);g&&!wt(g)&&(g=g.current),g=g||document.body;let p=null;n&&(p=document.createElement("div"),p.id=n,g.appendChild(p));const y=document.createElement("div");y.id=l,y.setAttribute(Hx,""),g=p||g,g.appendChild(y),h.current=y,f(y)},[n,i,l,o]),d}function y4(r){const{children:n,id:i,root:l,preserveTabOrder:o=!0}=r,d=x4({id:i,root:l}),[f,h]=x.useState(null),g=x.useRef(null),p=x.useRef(null),y=x.useRef(null),b=x.useRef(null),j=f==null?void 0:f.modal,N=f==null?void 0:f.open,w=!!f&&!f.modal&&f.open&&o&&!!(l||d);return x.useEffect(()=>{if(!d||!o||j)return;function S(E){d&&Ai(E)&&(E.type==="focusin"?Bx:m4)(d)}return d.addEventListener("focusin",S,!0),d.addEventListener("focusout",S,!0),()=>{d.removeEventListener("focusin",S,!0),d.removeEventListener("focusout",S,!0)}},[d,o,j]),x.useEffect(()=>{d&&(N||Bx(d))},[N,d]),t.jsxs(Kb.Provider,{value:x.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:g,afterOutsideRef:p,beforeInsideRef:y,afterInsideRef:b,portalNode:d,setFocusManagerState:h}),[o,d]),children:[w&&d&&t.jsx(zc,{"data-type":"outside",ref:g,onFocus:S=>{if(Ai(S,d)){var E;(E=y.current)==null||E.focus()}else{const k=Vb()||(f==null?void 0:f.domReference);k==null||k.focus()}}}),w&&d&&t.jsx("span",{"aria-owns":d.id,style:Wc}),d&&Xy.createPortal(n,d),w&&d&&t.jsx(zc,{"data-type":"outside",ref:p,onFocus:S=>{if(Ai(S,d)){var E;(E=b.current)==null||E.focus()}else{const k=Zb()||(f==null?void 0:f.domReference);k==null||k.focus(),f!=null&&f.closeOnFocusOut&&(f==null||f.onOpenChange(!1,S.nativeEvent,"focus-out"))}}})]})}const Yb=()=>x.useContext(Kb),ch="data-floating-ui-focusable";function dh(r){return r?r.hasAttribute(ch)?r:r.querySelector("["+ch+"]")||r:null}const Px=20;let ts=[];function If(r){ts=ts.filter(n=>n.isConnected),r&&Dn(r)!=="body"&&(ts.push(r),ts.length>Px&&(ts=ts.slice(-Px)))}function qx(){return ts.slice().reverse().find(r=>r.isConnected)}function b4(r){const n=Qc();return o_(r,n)?r:Yc(r,n)[0]||r}const v4=x.forwardRef(function(n,i){return t.jsx("button",{...n,type:"button",ref:i,tabIndex:-1,style:Wc})});function Xb(r){const{context:n,children:i,disabled:l=!1,order:o=["content"],guards:d=!0,initialFocus:f=0,returnFocus:h=!0,restoreFocus:g=!1,modal:p=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:b=!0,outsideElementsInert:j=!1}=r,{open:N,onOpenChange:w,events:S,dataRef:E,elements:{domReference:k,floating:A}}=n,O=Kt(()=>{var be;return(be=E.current.floatingContext)==null?void 0:be.nodeId}),L=typeof f=="number"&&f<0,B=_b(k)&&L,V=f4(),$=V?d:!0,le=!$||V&&j,q=Oa(o),K=Oa(f),ae=Oa(h),G=qi(),Z=Yb(),z=x.useRef(null),H=x.useRef(null),C=x.useRef(!1),U=x.useRef(!1),T=x.useRef(-1),R=Z!=null,v=dh(A),M=Kt(function(be){return be===void 0&&(be=v),be?Yc(be,Qc()):[]}),I=Kt(be=>{const Se=M(be);return q.current.map(Ee=>k&&Ee==="reference"?k:v&&Ee==="floating"?v:Se).filter(Boolean).flat()});x.useEffect(()=>{if(l||!p)return;function be(Ee){if(Ee.key==="Tab"){Ht(v,rr(ca(v)))&&M().length===0&&!B&&oa(Ee);const Ge=I(),it=Br(Ee);q.current[0]==="reference"&&it===k&&(oa(Ee),Ee.shiftKey?es(Ge[Ge.length-1]):es(Ge[1])),q.current[1]==="floating"&&it===v&&Ee.shiftKey&&(oa(Ee),es(Ge[0]))}}const Se=ca(v);return Se.addEventListener("keydown",be),()=>{Se.removeEventListener("keydown",be)}},[l,k,v,p,q,B,M,I]),x.useEffect(()=>{if(l||!A)return;function be(Se){const Ee=Br(Se),it=M().indexOf(Ee);it!==-1&&(T.current=it)}return A.addEventListener("focusin",be),()=>{A.removeEventListener("focusin",be)}},[l,A,M]),x.useEffect(()=>{if(l||!b)return;function be(){U.current=!0,setTimeout(()=>{U.current=!1})}function Se(Ee){const Ge=Ee.relatedTarget;queueMicrotask(()=>{const it=O(),dt=!(Ht(k,Ge)||Ht(A,Ge)||Ht(Ge,A)||Ht(Z==null?void 0:Z.portalNode,Ge)||Ge!=null&&Ge.hasAttribute(os("focus-guard"))||G&&(ss(G.nodesRef.current,it).find(st=>{var gt,ce;return Ht((gt=st.context)==null?void 0:gt.elements.floating,Ge)||Ht((ce=st.context)==null?void 0:ce.elements.domReference,Ge)})||Gx(G.nodesRef.current,it).find(st=>{var gt,ce,pe;return[(gt=st.context)==null?void 0:gt.elements.floating,dh((ce=st.context)==null?void 0:ce.elements.floating)].includes(Ge)||((pe=st.context)==null?void 0:pe.elements.domReference)===Ge})));if(g&&dt&&rr(ca(v))===ca(v).body){Pt(v)&&v.focus();const st=T.current,gt=M(),ce=gt[st]||gt[gt.length-1]||v;Pt(ce)&&ce.focus()}(B||!p)&&Ge&&dt&&!U.current&&Ge!==qx()&&(C.current=!0,w(!1,Ee,"focus-out"))})}if(A&&Pt(k))return k.addEventListener("focusout",Se),k.addEventListener("pointerdown",be),A.addEventListener("focusout",Se),()=>{k.removeEventListener("focusout",Se),k.removeEventListener("pointerdown",be),A.removeEventListener("focusout",Se)}},[l,k,A,v,p,G,Z,w,b,g,M,B,O]);const ee=x.useRef(null),xe=x.useRef(null),je=Oc([ee,Z==null?void 0:Z.beforeInsideRef]),ve=Oc([xe,Z==null?void 0:Z.afterInsideRef]);x.useEffect(()=>{var be;if(l||!A)return;const Se=Array.from((Z==null||(be=Z.portalNode)==null?void 0:be.querySelectorAll("["+os("portal")+"]"))||[]),Ee=G&&!p?Gx(G==null?void 0:G.nodesRef.current,O()).map(dt=>{var st;return(st=dt.context)==null?void 0:st.elements.floating}):[],Ge=[A,...Se,...Ee,z.current,H.current,ee.current,xe.current,Z==null?void 0:Z.beforeOutsideRef.current,Z==null?void 0:Z.afterOutsideRef.current,q.current.includes("reference")||B?k:null].filter(dt=>dt!=null),it=p||B?Fx(Ge,!le,le):Fx(Ge);return()=>{it()}},[l,k,A,p,q,Z,B,$,le,G,O]),kt(()=>{if(l||!Pt(v))return;const be=ca(v),Se=rr(be);queueMicrotask(()=>{const Ee=I(v),Ge=K.current,it=(typeof Ge=="number"?Ee[Ge]:Ge.current)||v,dt=Ht(v,Se);!L&&!dt&&N&&es(it,{preventScroll:it===v})})},[l,N,v,L,I,K]),kt(()=>{if(l||!v)return;let be=!1;const Se=ca(v),Ee=rr(Se);let it=E.current.openEvent;If(Ee);function dt(ce){let{open:pe,reason:ie,event:Re,nested:we}=ce;pe&&(it=Re),ie==="escape-key"&&k&&If(k),["hover","safe-polygon"].includes(ie)&&Re.type==="mouseleave"&&(C.current=!0),ie==="outside-press"&&(we?(C.current=!1,be=!0):C.current=!(kb(Re)||Fh(Re)))}S.on("openchange",dt);const st=Se.createElement("span");st.setAttribute("tabindex","-1"),st.setAttribute("aria-hidden","true"),Object.assign(st.style,Wc),R&&k&&k.insertAdjacentElement("afterend",st);function gt(){return typeof ae.current=="boolean"?qx()||st:ae.current.current||st}return()=>{S.off("openchange",dt);const ce=rr(Se),pe=Ht(A,ce)||G&&ss(G.nodesRef.current,O()).some(we=>{var ke;return Ht((ke=we.context)==null?void 0:ke.elements.floating,ce)});(pe||it&&["click","mousedown"].includes(it.type))&&k&&If(k);const Re=gt();queueMicrotask(()=>{const we=b4(Re);ae.current&&!C.current&&Pt(we)&&(!(we!==ce&&ce!==Se.body)||pe)&&we.focus({preventScroll:be}),st.remove()})}},[l,A,v,ae,E,S,G,R,k,O]),x.useEffect(()=>{queueMicrotask(()=>{C.current=!1})},[l]),kt(()=>{if(!l&&Z)return Z.setFocusManagerState({modal:p,closeOnFocusOut:b,open:N,onOpenChange:w,domReference:k}),()=>{Z.setFocusManagerState(null)}},[l,Z,p,N,w,b,k]),kt(()=>{if(l||!v||typeof MutationObserver!="function"||L)return;const be=()=>{const Ee=v.getAttribute("tabindex"),Ge=M(),it=rr(ca(A)),dt=Ge.indexOf(it);dt!==-1&&(T.current=dt),q.current.includes("floating")||it!==k&&Ge.length===0?Ee!=="0"&&v.setAttribute("tabindex","0"):Ee!=="-1"&&v.setAttribute("tabindex","-1")};be();const Se=new MutationObserver(be);return Se.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{Se.disconnect()}},[l,A,v,k,q,M,L]);function ye(be){return l||!y||!p?null:t.jsx(v4,{ref:be==="start"?z:H,onClick:Se=>w(!1,Se.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const ge=!l&&$&&(p?!B:!0)&&(R||p);return t.jsxs(t.Fragment,{children:[ge&&t.jsx(zc,{"data-type":"inside",ref:je,onFocus:be=>{if(p){const Ee=I();es(o[0]==="reference"?Ee[0]:Ee[Ee.length-1])}else if(Z!=null&&Z.preserveTabOrder&&Z.portalNode)if(C.current=!1,Ai(be,Z.portalNode)){const Ee=Zb()||k;Ee==null||Ee.focus()}else{var Se;(Se=Z.beforeOutsideRef.current)==null||Se.focus()}}}),!B&&ye("start"),i,ye("end"),ge&&t.jsx(zc,{"data-type":"inside",ref:ve,onFocus:be=>{if(p)es(I()[0]);else if(Z!=null&&Z.preserveTabOrder&&Z.portalNode)if(b&&(C.current=!0),Ai(be,Z.portalNode)){const Ee=Vb()||k;Ee==null||Ee.focus()}else{var Se;(Se=Z.afterOutsideRef.current)==null||Se.focus()}}})]})}let mc=0;function j4(){const r=/iP(hone|ad|od)|iOS/.test(Gh()),n=document.body.style,l=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,d=n.left?parseFloat(n.left):window.scrollX,f=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",o&&(n[l]=o+"px"),r){var h,g;const p=((h=window.visualViewport)==null?void 0:h.offsetLeft)||0,y=((g=window.visualViewport)==null?void 0:g.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(f-Math.floor(y))+"px",left:-(d-Math.floor(p))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[l]:""}),r&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(d,f))}}let $x=()=>{};const w4=x.forwardRef(function(n,i){const{lockScroll:l=!1,...o}=n;return kt(()=>{if(l)return mc++,mc===1&&($x=j4()),()=>{mc--,mc===0&&$x()}},[l]),t.jsx("div",{ref:i,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Zx(r){return Pt(r.target)&&r.target.tagName==="BUTTON"}function Vx(r){return Bh(r)}function Qb(r,n){n===void 0&&(n={});const{open:i,onOpenChange:l,dataRef:o,elements:{domReference:d}}=r,{enabled:f=!0,event:h="click",toggle:g=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:b=!0}=n,j=x.useRef(),N=x.useRef(!1),w=x.useMemo(()=>({onPointerDown(S){j.current=S.pointerType},onMouseDown(S){const E=j.current;S.button===0&&h!=="click"&&(zi(E,!0)&&p||(i&&g&&(!(o.current.openEvent&&b)||o.current.openEvent.type==="mousedown")?l(!1,S.nativeEvent,"click"):(S.preventDefault(),l(!0,S.nativeEvent,"click"))))},onClick(S){const E=j.current;if(h==="mousedown"&&j.current){j.current=void 0;return}zi(E,!0)&&p||(i&&g&&(!(o.current.openEvent&&b)||o.current.openEvent.type==="click")?l(!1,S.nativeEvent,"click"):l(!0,S.nativeEvent,"click"))},onKeyDown(S){j.current=void 0,!(S.defaultPrevented||!y||Zx(S))&&(S.key===" "&&!Vx(d)&&(S.preventDefault(),N.current=!0),S.key==="Enter"&&l(!(i&&g),S.nativeEvent,"click"))},onKeyUp(S){S.defaultPrevented||!y||Zx(S)||Vx(d)||S.key===" "&&N.current&&(N.current=!1,l(!(i&&g),S.nativeEvent,"click"))}}),[o,d,h,p,y,l,i,b,g]);return x.useMemo(()=>f?{reference:w}:{},[f,w])}const N4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},k4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Kx=r=>{var n,i;return{escapeKey:typeof r=="boolean"?r:(n=r==null?void 0:r.escapeKey)!=null?n:!1,outsidePress:typeof r=="boolean"?r:(i=r==null?void 0:r.outsidePress)!=null?i:!0}};function Wb(r,n){n===void 0&&(n={});const{open:i,onOpenChange:l,elements:o,dataRef:d}=r,{enabled:f=!0,escapeKey:h=!0,outsidePress:g=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:b="pointerdown",ancestorScroll:j=!1,bubbles:N,capture:w}=n,S=qi(),E=Kt(typeof g=="function"?g:()=>!1),k=typeof g=="function"?E:g,A=x.useRef(!1),O=x.useRef(!1),{escapeKey:L,outsidePress:B}=Kx(N),{escapeKey:V,outsidePress:$}=Kx(w),le=x.useRef(!1),q=Kt(H=>{var C;if(!i||!f||!h||H.key!=="Escape"||le.current)return;const U=(C=d.current.floatingContext)==null?void 0:C.nodeId,T=S?ss(S.nodesRef.current,U):[];if(!L&&(H.stopPropagation(),T.length>0)){let R=!0;if(T.forEach(v=>{var M;if((M=v.context)!=null&&M.open&&!v.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}l(!1,AS(H)?H.nativeEvent:H,"escape-key")}),K=Kt(H=>{var C;const U=()=>{var T;q(H),(T=Br(H))==null||T.removeEventListener("keydown",U)};(C=Br(H))==null||C.addEventListener("keydown",U)}),ae=Kt(H=>{var C;const U=A.current;A.current=!1;const T=O.current;if(O.current=!1,p==="click"&&T||U||typeof k=="function"&&!k(H))return;const R=Br(H),v="["+os("inert")+"]",M=ca(o.floating).querySelectorAll(v);let I=wt(R)?R:null;for(;I&&!Hr(I);){const ve=$r(I);if(Hr(ve)||!wt(ve))break;I=ve}if(M.length&&wt(R)&&!DS(R)&&!Ht(R,o.floating)&&Array.from(M).every(ve=>!Ht(I,ve)))return;if(Pt(R)&&z){const ve=Hr(R),ye=Xa(R),ge=/auto|scroll/,be=ve||ge.test(ye.overflowX),Se=ve||ge.test(ye.overflowY),Ee=be&&R.clientWidth>0&&R.scrollWidth>R.clientWidth,Ge=Se&&R.clientHeight>0&&R.scrollHeight>R.clientHeight,it=ye.direction==="rtl",dt=Ge&&(it?H.offsetX<=R.offsetWidth-R.clientWidth:H.offsetX>R.clientWidth),st=Ee&&H.offsetY>R.clientHeight;if(dt||st)return}const ee=(C=d.current.floatingContext)==null?void 0:C.nodeId,xe=S&&ss(S.nodesRef.current,ee).some(ve=>{var ye;return zf(H,(ye=ve.context)==null?void 0:ye.elements.floating)});if(zf(H,o.floating)||zf(H,o.domReference)||xe)return;const je=S?ss(S.nodesRef.current,ee):[];if(je.length>0){let ve=!0;if(je.forEach(ye=>{var ge;if((ge=ye.context)!=null&&ge.open&&!ye.context.dataRef.current.__outsidePressBubbles){ve=!1;return}}),!ve)return}l(!1,H,"outside-press")}),G=Kt(H=>{var C;const U=()=>{var T;ae(H),(T=Br(H))==null||T.removeEventListener(p,U)};(C=Br(H))==null||C.addEventListener(p,U)});x.useEffect(()=>{if(!i||!f)return;d.current.__escapeKeyBubbles=L,d.current.__outsidePressBubbles=B;let H=-1;function C(M){l(!1,M,"ancestor-scroll")}function U(){window.clearTimeout(H),le.current=!0}function T(){H=window.setTimeout(()=>{le.current=!1},Vc()?5:0)}const R=ca(o.floating);h&&(R.addEventListener("keydown",V?K:q,V),R.addEventListener("compositionstart",U),R.addEventListener("compositionend",T)),k&&R.addEventListener(p,$?G:ae,$);let v=[];return j&&(wt(o.domReference)&&(v=Tn(o.domReference)),wt(o.floating)&&(v=v.concat(Tn(o.floating))),!wt(o.reference)&&o.reference&&o.reference.contextElement&&(v=v.concat(Tn(o.reference.contextElement)))),v=v.filter(M=>{var I;return M!==((I=R.defaultView)==null?void 0:I.visualViewport)}),v.forEach(M=>{M.addEventListener("scroll",C,{passive:!0})}),()=>{h&&(R.removeEventListener("keydown",V?K:q,V),R.removeEventListener("compositionstart",U),R.removeEventListener("compositionend",T)),k&&R.removeEventListener(p,$?G:ae,$),v.forEach(M=>{M.removeEventListener("scroll",C)}),window.clearTimeout(H)}},[d,o,h,k,p,i,l,j,f,L,B,q,V,K,ae,$,G]),x.useEffect(()=>{A.current=!1},[k,p]);const Z=x.useMemo(()=>({onKeyDown:q,...y&&{[N4[b]]:H=>{l(!1,H.nativeEvent,"reference-press")},...b!=="click"&&{onClick(H){l(!1,H.nativeEvent,"reference-press")}}}}),[q,l,y,b]),z=x.useMemo(()=>({onKeyDown:q,onMouseDown(){O.current=!0},onMouseUp(){O.current=!0},[k4[p]]:()=>{A.current=!0}}),[q,p]);return x.useMemo(()=>f?{reference:Z,floating:z}:{},[f,Z,z])}function S4(r){const{open:n=!1,onOpenChange:i,elements:l}=r,o=Vh(),d=x.useRef({}),[f]=x.useState(()=>i4()),h=Xc()!=null,[g,p]=x.useState(l.reference),y=Kt((N,w,S)=>{d.current.openEvent=N?w:void 0,f.emit("openchange",{open:N,event:w,reason:S,nested:h}),i==null||i(N,w,S)}),b=x.useMemo(()=>({setPositionReference:p}),[]),j=x.useMemo(()=>({reference:g||l.reference||null,floating:l.floating||null,domReference:l.reference}),[g,l.reference,l.floating]);return x.useMemo(()=>({dataRef:d,open:n,onOpenChange:y,elements:j,events:f,floatingId:o,refs:b}),[n,y,j,f,o,b])}function Jb(r){r===void 0&&(r={});const{nodeId:n}=r,i=S4({...r,elements:{reference:null,floating:null,...r.elements}}),l=r.rootContext||i,o=l.elements,[d,f]=x.useState(null),[h,g]=x.useState(null),y=(o==null?void 0:o.domReference)||d,b=x.useRef(null),j=qi();kt(()=>{y&&(b.current=y)},[y]);const N=I_({...r,elements:{...o,...h&&{reference:h}}}),w=x.useCallback(O=>{const L=wt(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),contextElement:O}:O;g(L),N.refs.setReference(L)},[N.refs]),S=x.useCallback(O=>{(wt(O)||O===null)&&(b.current=O,f(O)),(wt(N.refs.reference.current)||N.refs.reference.current===null||O!==null&&!wt(O))&&N.refs.setReference(O)},[N.refs]),E=x.useMemo(()=>({...N.refs,setReference:S,setPositionReference:w,domReference:b}),[N.refs,S,w]),k=x.useMemo(()=>({...N.elements,domReference:y}),[N.elements,y]),A=x.useMemo(()=>({...N,...l,refs:E,elements:k,nodeId:n}),[N,E,k,n,l]);return kt(()=>{l.dataRef.current.floatingContext=A;const O=j==null?void 0:j.nodesRef.current.find(L=>L.id===n);O&&(O.context=A)}),x.useMemo(()=>({...N,context:A,refs:E,elements:k}),[N,E,k,A])}function _4(r,n){n===void 0&&(n={});const{open:i,onOpenChange:l,events:o,dataRef:d,elements:f}=r,{enabled:h=!0,visibleOnly:g=!0}=n,p=x.useRef(!1),y=x.useRef(),b=x.useRef(!0);x.useEffect(()=>{if(!h)return;const N=Na(f.domReference);function w(){!i&&Pt(f.domReference)&&f.domReference===rr(ca(f.domReference))&&(p.current=!0)}function S(){b.current=!0}return N.addEventListener("blur",w),N.addEventListener("keydown",S,!0),()=>{N.removeEventListener("blur",w),N.removeEventListener("keydown",S,!0)}},[f.domReference,i,h]),x.useEffect(()=>{if(!h)return;function N(w){let{reason:S}=w;(S==="reference-press"||S==="escape-key")&&(p.current=!0)}return o.on("openchange",N),()=>{o.off("openchange",N)}},[o,h]),x.useEffect(()=>()=>{clearTimeout(y.current)},[]);const j=x.useMemo(()=>({onPointerDown(N){Fh(N.nativeEvent)||(b.current=!1)},onMouseLeave(){p.current=!1},onFocus(N){if(p.current)return;const w=Br(N.nativeEvent);if(g&&wt(w))try{if(Sb()&&ES())throw Error();if(!w.matches(":focus-visible"))return}catch{if(!b.current&&!Bh(w))return}l(!0,N.nativeEvent,"focus")},onBlur(N){p.current=!1;const w=N.relatedTarget,S=N.nativeEvent,E=wt(w)&&w.hasAttribute(os("focus-guard"))&&w.getAttribute("data-type")==="outside";y.current=window.setTimeout(()=>{var k;const A=rr(f.domReference?f.domReference.ownerDocument:document);!w&&A===f.domReference||Ht((k=d.current.floatingContext)==null?void 0:k.refs.floating.current,A)||Ht(f.domReference,A)||E||l(!1,S,"focus")})}}),[d,f.domReference,l,g]);return x.useMemo(()=>h?{reference:j}:{},[h,j])}const Yx="active",Xx="selected";function Hf(r,n,i){const l=new Map,o=i==="item";let d=r;if(o&&r){const{[Yx]:f,[Xx]:h,...g}=r;d=g}return{...i==="floating"&&{tabIndex:-1,[ch]:""},...d,...n.map(f=>{const h=f?f[i]:null;return typeof h=="function"?r?h(r):null:h}).concat(r).reduce((f,h)=>(h&&Object.entries(h).forEach(g=>{let[p,y]=g;if(!(o&&[Yx,Xx].includes(p)))if(p.indexOf("on")===0){if(l.has(p)||l.set(p,[]),typeof y=="function"){var b;(b=l.get(p))==null||b.push(y),f[p]=function(){for(var j,N=arguments.length,w=new Array(N),S=0;S<N;S++)w[S]=arguments[S];return(j=l.get(p))==null?void 0:j.map(E=>E(...w)).find(E=>E!==void 0)}}}else f[p]=y}),f),{})}}function ev(r){r===void 0&&(r=[]);const n=r.map(h=>h==null?void 0:h.reference),i=r.map(h=>h==null?void 0:h.floating),l=r.map(h=>h==null?void 0:h.item),o=x.useCallback(h=>Hf(h,r,"reference"),n),d=x.useCallback(h=>Hf(h,r,"floating"),i),f=x.useCallback(h=>Hf(h,r,"item"),l);return x.useMemo(()=>({getReferenceProps:o,getFloatingProps:d,getItemProps:f}),[o,d,f])}function Jc(r,n,i){switch(r){case"vertical":return n;case"horizontal":return i;default:return n||i}}function Qx(r,n){return Jc(n,r===Zh||r===Pi,r===Cn||r===En)}function Pf(r,n,i){return Jc(n,r===Pi,i?r===Cn:r===En)||r==="Enter"||r===" "||r===""}function T4(r,n,i){return Jc(n,i?r===Cn:r===En,r===Pi)}function Wx(r,n,i){return Jc(n,i?r===En:r===Cn,r===Zh)}function C4(r,n){const{open:i,onOpenChange:l,elements:o}=r,{listRef:d,activeIndex:f,onNavigate:h=()=>{},enabled:g=!0,selectedIndex:p=null,allowEscape:y=!1,loop:b=!1,nested:j=!1,rtl:N=!1,virtual:w=!1,focusItemOnOpen:S="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:k=!0,disabledIndices:A=void 0,orientation:O="vertical",cols:L=1,scrollItemIntoView:B=!0,virtualItemRef:V,itemSizes:$,dense:le=!1}=n,q=dh(o.floating),K=Oa(q),ae=Xc(),G=qi(),Z=Kt(()=>{h(C.current===-1?null:C.current)}),z=_b(o.domReference),H=x.useRef(S),C=x.useRef(p??-1),U=x.useRef(null),T=x.useRef(!0),R=x.useRef(Z),v=x.useRef(!!o.floating),M=x.useRef(i),I=x.useRef(!1),ee=x.useRef(!1),xe=Oa(A),je=Oa(i),ve=Oa(B),ye=Oa(p),[ge,be]=x.useState(),[Se,Ee]=x.useState(),Ge=Kt(()=>{function ie(ke){w?(be(ke.id),G==null||G.events.emit("virtualfocus",ke),V&&(V.current=ke)):es(ke,{sync:I.current,preventScroll:!0})}const Re=d.current[C.current];Re&&ie(Re),(I.current?ke=>ke():requestAnimationFrame)(()=>{const ke=d.current[C.current]||Re;if(!ke)return;Re||ie(ke);const ft=ve.current;ft&&dt&&(ee.current||!T.current)&&(ke.scrollIntoView==null||ke.scrollIntoView(typeof ft=="boolean"?{block:"nearest",inline:"nearest"}:ft))})});kt(()=>{g&&(i&&o.floating?H.current&&p!=null&&(ee.current=!0,C.current=p,Z()):v.current&&(C.current=-1,R.current()))},[g,i,o.floating,p,Z]),kt(()=>{if(g&&i&&o.floating)if(f==null){if(I.current=!1,ye.current!=null)return;if(v.current&&(C.current=-1,Ge()),(!M.current||!v.current)&&H.current&&(U.current!=null||H.current===!0&&U.current==null)){let ie=0;const Re=()=>{d.current[0]==null?(ie<2&&(ie?requestAnimationFrame:queueMicrotask)(Re),ie++):(C.current=U.current==null||Pf(U.current,O,N)||j?Gf(d,xe.current):Mx(d,xe.current),U.current=null,Z())};Re()}}else Ri(d,f)||(C.current=f,Ge(),ee.current=!1)},[g,i,o.floating,f,ye,j,d,O,N,Z,Ge,xe]),kt(()=>{var ie;if(!g||o.floating||!G||w||!v.current)return;const Re=G.nodesRef.current,we=(ie=Re.find(Mt=>Mt.id===ae))==null||(ie=ie.context)==null?void 0:ie.elements.floating,ke=rr(ca(o.floating)),ft=Re.some(Mt=>Mt.context&&Ht(Mt.context.elements.floating,ke));we&&!ft&&T.current&&we.focus({preventScroll:!0})},[g,o.floating,G,ae,w]),kt(()=>{if(!g||!G||!w||ae)return;function ie(Re){Ee(Re.id),V&&(V.current=Re)}return G.events.on("virtualfocus",ie),()=>{G.events.off("virtualfocus",ie)}},[g,G,w,ae,V]),kt(()=>{R.current=Z,M.current=i,v.current=!!o.floating}),kt(()=>{i||(U.current=null)},[i]);const it=f!=null,dt=x.useMemo(()=>{function ie(we){if(!i)return;const ke=d.current.indexOf(we);ke!==-1&&C.current!==ke&&(C.current=ke,Z())}return{onFocus(we){let{currentTarget:ke}=we;I.current=!0,ie(ke)},onClick:we=>{let{currentTarget:ke}=we;return ke.focus({preventScroll:!0})},...E&&{onMouseMove(we){let{currentTarget:ke}=we;I.current=!0,ee.current=!1,ie(ke)},onPointerLeave(we){let{pointerType:ke}=we;if(!(!T.current||ke==="touch")&&(I.current=!0,C.current=-1,Z(),!w)){var ft;(ft=K.current)==null||ft.focus({preventScroll:!0})}}}}},[i,K,E,d,Z,w]),st=Kt(ie=>{if(T.current=!1,I.current=!0,ie.which===229||!je.current&&ie.currentTarget===K.current)return;if(j&&Wx(ie.key,O,N)){oa(ie),l(!1,ie.nativeEvent,"list-navigation"),Pt(o.domReference)&&(w?G==null||G.events.emit("virtualfocus",o.domReference):o.domReference.focus());return}const Re=C.current,we=Gf(d,A),ke=Mx(d,A);if(z||(ie.key==="Home"&&(oa(ie),C.current=we,Z()),ie.key==="End"&&(oa(ie),C.current=ke,Z())),L>1){const ft=$||Array.from({length:d.current.length},()=>({width:1,height:1})),Mt=Q_(ft,L,le),qt=Mt.findIndex(Ut=>Ut!=null&&!vc(d.current,Ut,A)),Wt=Mt.reduce((Ut,Tt,Yr)=>Tt!=null&&!vc(d.current,Tt,A)?Yr:Ut,-1),ht=Mt[X_({current:Mt.map(Ut=>Ut!=null?d.current[Ut]:null)},{event:ie,orientation:O,loop:b,rtl:N,cols:L,disabledIndices:J_([...A||d.current.map((Ut,Tt)=>vc(d.current,Tt)?Tt:void 0),void 0],Mt),minIndex:qt,maxIndex:Wt,prevIndex:W_(C.current>ke?we:C.current,ft,Mt,L,ie.key===Pi?"bl":ie.key===(N?Cn:En)?"tr":"tl"),stopEvent:!0})];if(ht!=null&&(C.current=ht,Z()),O==="both")return}if(Qx(ie.key,O)){if(oa(ie),i&&!w&&rr(ie.currentTarget.ownerDocument)===ie.currentTarget){C.current=Pf(ie.key,O,N)?we:ke,Z();return}Pf(ie.key,O,N)?b?C.current=Re>=ke?y&&Re!==d.current.length?-1:we:pa(d,{startingIndex:Re,disabledIndices:A}):C.current=Math.min(ke,pa(d,{startingIndex:Re,disabledIndices:A})):b?C.current=Re<=we?y&&Re!==-1?d.current.length:ke:pa(d,{startingIndex:Re,decrement:!0,disabledIndices:A}):C.current=Math.max(we,pa(d,{startingIndex:Re,decrement:!0,disabledIndices:A})),Ri(d,C.current)&&(C.current=-1),Z()}}),gt=x.useMemo(()=>w&&i&&it&&{"aria-activedescendant":Se||ge},[w,i,it,Se,ge]),ce=x.useMemo(()=>({"aria-orientation":O==="both"?void 0:O,...z?{}:gt,onKeyDown:st,onPointerMove(){T.current=!0}}),[gt,st,O,z]),pe=x.useMemo(()=>{function ie(we){S==="auto"&&kb(we.nativeEvent)&&(H.current=!0)}function Re(we){H.current=S,S==="auto"&&Fh(we.nativeEvent)&&(H.current=!0)}return{...gt,onKeyDown(we){T.current=!1;const ke=we.key.startsWith("Arrow"),ft=["Home","End"].includes(we.key),Mt=ke||ft,qt=T4(we.key,O,N),Wt=Wx(we.key,O,N),ht=Qx(we.key,O),Ut=(j?qt:ht)||we.key==="Enter"||we.key.trim()==="";if(w&&i){const Q=G==null?void 0:G.nodesRef.current.find(De=>De.parentId==null),Ne=G&&Q?u4(G.nodesRef.current,Q.id):null;if(Mt&&Ne&&V){const De=new KeyboardEvent("keydown",{key:we.key,bubbles:!0});if(qt||Wt){var Tt,Yr;const Ga=((Tt=Ne.context)==null?void 0:Tt.elements.domReference)===we.currentTarget,On=Wt&&!Ga?(Yr=Ne.context)==null?void 0:Yr.elements.domReference:qt?d.current.find(Xr=>(Xr==null?void 0:Xr.id)===ge):null;On&&(oa(we),On.dispatchEvent(De),Ee(void 0))}if((ht||ft)&&Ne.context&&Ne.context.open&&Ne.parentId&&we.currentTarget!==Ne.context.elements.domReference){var us;oa(we),(us=Ne.context.elements.domReference)==null||us.dispatchEvent(De);return}}return st(we)}if(!(!i&&!k&&ke)){if(Ut&&(U.current=j&&ht?null:we.key),j){qt&&(oa(we),i?(C.current=Gf(d,xe.current),Z()):l(!0,we.nativeEvent,"list-navigation"));return}ht&&(p!=null&&(C.current=p),oa(we),!i&&k?l(!0,we.nativeEvent,"list-navigation"):st(we),i&&Z())}},onFocus(){i&&!w&&(C.current=-1,Z())},onPointerDown:Re,onPointerEnter:Re,onMouseDown:ie,onClick:ie}},[ge,gt,st,xe,S,d,j,Z,l,i,k,O,N,p,G,w,V]);return x.useMemo(()=>g?{reference:pe,floating:ce,item:dt}:{},[g,pe,ce,dt])}const E4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function tv(r,n){var i;n===void 0&&(n={});const{open:l,floatingId:o}=r,{enabled:d=!0,role:f="dialog"}=n,h=(i=E4.get(f))!=null?i:f,g=Vh(),y=Xc()!=null,b=x.useMemo(()=>h==="tooltip"||f==="label"?{["aria-"+(f==="label"?"labelledby":"describedby")]:l?o:void 0}:{"aria-expanded":l?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":l?o:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:g},...h==="menu"&&y&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[h,o,y,l,g,f]),j=x.useMemo(()=>{const w={id:o,...h&&{role:h}};return h==="tooltip"||f==="label"?w:{...w,...h==="menu"&&{"aria-labelledby":g}}},[h,o,g,f]),N=x.useCallback(w=>{let{active:S,selected:E}=w;const k={role:"option",...S&&{id:o+"-option"}};switch(f){case"select":return{...k,"aria-selected":S&&E};case"combobox":return{...k,...S&&{"aria-selected":!0}}}return{}},[o,f]);return x.useMemo(()=>d?{reference:b,floating:j,item:N}:{},[d,b,j,N])}function R4(r,n){var i;const{open:l,dataRef:o}=r,{listRef:d,activeIndex:f,onMatch:h,onTypingChange:g,enabled:p=!0,findMatch:y=null,resetMs:b=750,ignoreKeys:j=[],selectedIndex:N=null}=n,w=x.useRef(),S=x.useRef(""),E=x.useRef((i=N??f)!=null?i:-1),k=x.useRef(null),A=Kt(h),O=Kt(g),L=Oa(y),B=Oa(j);kt(()=>{l&&(clearTimeout(w.current),k.current=null,S.current="")},[l]),kt(()=>{if(l&&S.current===""){var K;E.current=(K=N??f)!=null?K:-1}},[l,N,f]);const V=Kt(K=>{K?o.current.typing||(o.current.typing=K,O(K)):o.current.typing&&(o.current.typing=K,O(K))}),$=Kt(K=>{function ae(C,U,T){const R=L.current?L.current(U,T):U.find(v=>(v==null?void 0:v.toLocaleLowerCase().indexOf(T.toLocaleLowerCase()))===0);return R?C.indexOf(R):-1}const G=d.current;if(S.current.length>0&&S.current[0]!==" "&&(ae(G,G,S.current)===-1?V(!1):K.key===" "&&oa(K)),G==null||B.current.includes(K.key)||K.key.length!==1||K.ctrlKey||K.metaKey||K.altKey)return;l&&K.key!==" "&&(oa(K),V(!0)),G.every(C=>{var U,T;return C?((U=C[0])==null?void 0:U.toLocaleLowerCase())!==((T=C[1])==null?void 0:T.toLocaleLowerCase()):!0})&&S.current===K.key&&(S.current="",E.current=k.current),S.current+=K.key,clearTimeout(w.current),w.current=setTimeout(()=>{S.current="",E.current=k.current,V(!1)},b);const z=E.current,H=ae(G,[...G.slice((z||0)+1),...G.slice(0,(z||0)+1)],S.current);H!==-1?(A(H),k.current=H):K.key!==" "&&(S.current="",V(!1))}),le=x.useMemo(()=>({onKeyDown:$}),[$]),q=x.useMemo(()=>({onKeyDown:$,onKeyUp(K){K.key===" "&&V(!1)}}),[$,V]);return x.useMemo(()=>p?{reference:le,floating:q}:{},[p,le,q])}function Jx(r,n){const[i,l]=r;let o=!1;const d=n.length;for(let f=0,h=d-1;f<d;h=f++){const[g,p]=n[f]||[0,0],[y,b]=n[h]||[0,0];p>=l!=b>=l&&i<=(y-g)*(l-p)/(b-p)+g&&(o=!o)}return o}function A4(r,n){return r[0]>=n.x&&r[0]<=n.x+n.width&&r[1]>=n.y&&r[1]<=n.y+n.height}function D4(r){r===void 0&&(r={});const{buffer:n=.5,blockPointerEvents:i=!1,requireIntent:l=!0}=r;let o,d=!1,f=null,h=null,g=performance.now();function p(b,j){const N=performance.now(),w=N-g;if(f===null||h===null||w===0)return f=b,h=j,g=N,null;const S=b-f,E=j-h,A=Math.sqrt(S*S+E*E)/w;return f=b,h=j,g=N,A}const y=b=>{let{x:j,y:N,placement:w,elements:S,onClose:E,nodeId:k,tree:A}=b;return function(L){function B(){clearTimeout(o),E()}if(clearTimeout(o),!S.domReference||!S.floating||w==null||j==null||N==null)return;const{clientX:V,clientY:$}=L,le=[V,$],q=Br(L),K=L.type==="mouseleave",ae=Ht(S.floating,q),G=Ht(S.domReference,q),Z=S.domReference.getBoundingClientRect(),z=S.floating.getBoundingClientRect(),H=w.split("-")[0],C=j>z.right-z.width/2,U=N>z.bottom-z.height/2,T=A4(le,Z),R=z.width>Z.width,v=z.height>Z.height,M=(R?Z:z).left,I=(R?Z:z).right,ee=(v?Z:z).top,xe=(v?Z:z).bottom;if(ae&&(d=!0,!K))return;if(G&&(d=!1),G&&!K){d=!0;return}if(K&&wt(L.relatedTarget)&&Ht(S.floating,L.relatedTarget)||A&&ss(A.nodesRef.current,k).some(ye=>{let{context:ge}=ye;return ge==null?void 0:ge.open}))return;if(H==="top"&&N>=Z.bottom-1||H==="bottom"&&N<=Z.top+1||H==="left"&&j>=Z.right-1||H==="right"&&j<=Z.left+1)return B();let je=[];switch(H){case"top":je=[[M,Z.top+1],[M,z.bottom-1],[I,z.bottom-1],[I,Z.top+1]];break;case"bottom":je=[[M,z.top+1],[M,Z.bottom-1],[I,Z.bottom-1],[I,z.top+1]];break;case"left":je=[[z.right-1,xe],[z.right-1,ee],[Z.left+1,ee],[Z.left+1,xe]];break;case"right":je=[[Z.right-1,xe],[Z.right-1,ee],[z.left+1,ee],[z.left+1,xe]];break}function ve(ye){let[ge,be]=ye;switch(H){case"top":{const Se=[R?ge+n/2:C?ge+n*4:ge-n*4,be+n+1],Ee=[R?ge-n/2:C?ge+n*4:ge-n*4,be+n+1],Ge=[[z.left,C||R?z.bottom-n:z.top],[z.right,C?R?z.bottom-n:z.top:z.bottom-n]];return[Se,Ee,...Ge]}case"bottom":{const Se=[R?ge+n/2:C?ge+n*4:ge-n*4,be-n],Ee=[R?ge-n/2:C?ge+n*4:ge-n*4,be-n],Ge=[[z.left,C||R?z.top+n:z.bottom],[z.right,C?R?z.top+n:z.bottom:z.top+n]];return[Se,Ee,...Ge]}case"left":{const Se=[ge+n+1,v?be+n/2:U?be+n*4:be-n*4],Ee=[ge+n+1,v?be-n/2:U?be+n*4:be-n*4];return[...[[U||v?z.right-n:z.left,z.top],[U?v?z.right-n:z.left:z.right-n,z.bottom]],Se,Ee]}case"right":{const Se=[ge-n,v?be+n/2:U?be+n*4:be-n*4],Ee=[ge-n,v?be-n/2:U?be+n*4:be-n*4],Ge=[[U||v?z.left+n:z.right,z.top],[U?v?z.left+n:z.right:z.left+n,z.bottom]];return[Se,Ee,...Ge]}}}if(!Jx([V,$],je)){if(d&&!T)return B();if(!K&&l){const ye=p(L.clientX,L.clientY);if(ye!==null&&ye<.1)return B()}Jx([V,$],ve([j,N]))?!d&&l&&(o=window.setTimeout(B,40)):B()}}};return y.__options={blockPointerEvents:i},y}const M4=({arrowRef:r,placement:n})=>{const i=[];return i.push(P_(8)),i.push(n==="auto"?Z_():$_()),i.push(q_({padding:8})),r!=null&&r.current&&i.push(V_({element:r.current})),i},O4=({placement:r})=>r==="auto"?void 0:r,z4=({placement:r})=>({top:"bottom",right:"left",bottom:"top",left:"right"})[r.split("-")[0]],av=({open:r,arrowRef:n,placement:i="top",setOpen:l})=>Jb({placement:O4({placement:i}),open:r,onOpenChange:l,whileElementsMounted:Bb,middleware:M4({placement:i,arrowRef:n})}),rv=({context:r,trigger:n,role:i="tooltip",interactions:l=[]})=>ev([Qb(r,{enabled:n==="click"}),d4(r,{enabled:n==="hover",handleClose:D4()}),Wb(r),tv(r,{role:i}),...l]);function nv({animation:r="duration-300",arrow:n=!0,children:i,className:l,content:o,placement:d="top",style:f="dark",theme:h,trigger:g="hover",minWidth:p,...y}){const b=x.useRef(null),[j,N]=x.useState(!1),w=av({open:j,placement:d,arrowRef:b,setOpen:N}),{context:S,middlewareData:{arrow:{x:E,y:k}={}},refs:A,strategy:O,update:L,x:B,y:V}=w,$=_4(S),{getFloatingProps:le,getReferenceProps:q}=rv({context:S,role:"tooltip",trigger:g,interactions:[$]});return x.useEffect(()=>{if(A.reference.current&&A.floating.current&&j)return Bb(A.reference.current,A.floating.current,L)},[j,A.floating,A.reference,L]),t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:A.setReference,className:h.target,"data-testid":"flowbite-tooltip-target",...q(),children:i}),t.jsxs("div",{ref:A.setFloating,"data-testid":"flowbite-tooltip",...le({className:Ce(h.base,r&&`${h.animation} ${r}`,!j&&h.hidden,h.style[f],l),style:{position:O,top:V??" ",left:B??" ",minWidth:p},...y}),children:[t.jsx("div",{className:h.content,children:o}),n&&t.jsx("div",{className:Ce(h.arrow.base,f==="dark"&&h.arrow.style.dark,f==="light"&&h.arrow.style.light,f==="auto"&&h.arrow.style.auto),"data-testid":"flowbite-tooltip-arrow",ref:b,style:{top:k??" ",left:E??" ",right:" ",bottom:" ",[z4({placement:w.placement})]:h.arrow.placement},children:" "})]})]})}nv.displayName="Floating";const L4={target:"w-fit",animation:"transition-opacity",arrow:{base:"absolute z-10 h-2 w-2 rotate-45",style:{dark:"bg-gray-900 dark:bg-gray-700",light:"bg-white",auto:"bg-white dark:bg-gray-700"},placement:"-4px"},base:"absolute z-10 inline-block rounded-lg px-3 py-2 text-sm font-medium shadow-sm",hidden:"invisible opacity-0",style:{dark:"bg-gray-900 text-white dark:bg-gray-700",light:"border border-gray-200 bg-white text-gray-900",auto:"border border-gray-200 bg-white text-gray-900 dark:border-none dark:bg-gray-700 dark:text-white"},content:"relative z-20"};function sv(r){var j,N;const n=Ke(),i=Ve([L4,(j=n.theme)==null?void 0:j.tooltip,r.theme],[ue(n.clearTheme,"tooltip"),r.clearTheme],[ue(n.applyTheme,"tooltip"),r.applyTheme]),{animation:l="duration-300",arrow:o=!0,children:d,className:f,content:h,placement:g="top",style:p="dark",trigger:y="hover",...b}=Qe(r,(N=n.props)==null?void 0:N.tooltip);return t.jsx(nv,{animation:l,arrow:o,content:h,placement:g,style:p,theme:i,trigger:y,className:f,...b,children:d})}sv.displayName="Tooltip";function U4({key:r,onChange:n}){function i({key:l,newValue:o}){l===r&&n(o)}x.useEffect(()=>(window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)),[])}const sl="auto",Kh="flowbite-theme-mode",uh="flowbite-theme-mode-sync";function G4(){const[r,n]=x.useState(H4(ON()));U4({key:Kh,onChange(d){n(lv(d??sl))}}),F4(d=>n(d));function i(d){n(d),B4(d),I4(d),document.dispatchEvent(new CustomEvent(uh,{detail:d}))}function l(){let d=r;d==="auto"&&(d=fh(d)),d=d==="dark"?"light":"dark",i(d)}function o(){i(r??sl)}return{mode:r,computedMode:fh(r),setMode:i,toggleMode:l,clearMode:o}}function F4(r){x.useEffect(()=>{function n(i){const l=i.detail;r(l)}return document.addEventListener(uh,n),()=>document.removeEventListener(uh,n)},[])}function B4(r){localStorage.setItem(Kh,r)}function I4(r){const n="";fh(r)==="dark"?document.documentElement.classList.add(`${n}dark`):document.documentElement.classList.remove(`${n}dark`)}function H4(r){if(!bb())return sl;const n=localStorage.getItem(Kh);return lv(n??r??sl)}function fh(r){return bb()?r==="auto"?P4():r:sl}function P4(){var r;return(r=window.matchMedia)!=null&&r.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}function lv(r){return["light","dark","auto"].includes(r)?r:sl}const iv=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 20 20",ref:n,...r,children:t.jsx("path",{stroke:"none",d:"M17.293 13.293A8 8 0 0 1 6.707 2.707a8.001 8.001 0 1 0 10.586 10.586z"})}));iv.displayName="MoonIcon";const ov=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 20 20",ref:n,...r,children:t.jsx("path",{fillRule:"evenodd",stroke:"none",d:"M10 2a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1zm4 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0zm-.464 4.95.707.707a1 1 0 0 0 1.414-1.414l-.707-.707a1 1 0 0 0-1.414 1.414zm2.12-10.607a1 1 0 0 1 0 1.414l-.706.707a1 1 0 1 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 0zM17 11a1 1 0 1 0 0-2h-1a1 1 0 1 0 0 2h1zm-7 4a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1zM5.05 6.464A1 1 0 1 0 6.465 5.05l-.708-.707a1 1 0 0 0-1.414 1.414l.707.707zm1.414 8.486-.707.707a1 1 0 0 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 1.414zM4 11a1 1 0 1 0 0-2H3a1 1 0 0 0 0 2h1z",clipRule:"evenodd"})}));ov.displayName="SunIcon";const q4={root:{base:"rounded-lg p-2.5 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-700",icon:{base:"h-5 w-5",dark:"hidden dark:block",light:"dark:hidden"}}},cv=x.forwardRef((r,n)=>{var p,y;const i=Ke(),l=Ve([q4,(p=i.theme)==null?void 0:p.darkThemeToggle,r.theme],[ue(i.clearTheme,"darkThemeToggle"),r.clearTheme],[ue(i.applyTheme,"darkThemeToggle"),r.applyTheme]),{className:o,iconDark:d=ov,iconLight:f=iv,...h}=Qe(r,(y=i.props)==null?void 0:y.darkThemeToggle),{toggleMode:g}=G4();return t.jsxs("button",{ref:n,type:"button","aria-label":"Toggle dark mode","data-testid":"dark-theme-toggle",className:Ce(l.root.base,o),onClick:g,...h,children:[t.jsx(d,{"aria-label":"Currently dark mode",className:Ce(l.root.icon.base,l.root.icon.dark)}),t.jsx(f,{"aria-label":"Currently light mode",className:Ce(l.root.icon.base,l.root.icon.light)})]})});cv.displayName="DarkThemeToggle";const $4={base:"flex",addon:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400",field:{base:"relative w-full",icon:{base:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",svg:"h-5 w-5 text-gray-500 dark:text-gray-400"},rightIcon:{base:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",svg:"h-5 w-5 text-gray-500 dark:text-gray-400"},input:{base:"block w-full border focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50",sizes:{sm:"p-2 sm:text-xs",md:"p-2.5 text-sm",lg:"p-4 sm:text-base"},colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 placeholder-gray-500 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"},withRightIcon:{on:"pr-10",off:""},withIcon:{on:"pl-10",off:""},withAddon:{on:"rounded-r-lg",off:"rounded-lg"},withShadow:{on:"shadow-sm dark:shadow-sm-light",off:""}}}},Me=x.forwardRef((r,n)=>{var N,w;const i=Ke(),l=Ve([$4,(N=i.theme)==null?void 0:N.textInput,r.theme],[ue(i.clearTheme,"textInput"),r.clearTheme],[ue(i.applyTheme,"textInput"),r.applyTheme]),{addon:o,className:d,color:f="gray",icon:h,rightIcon:g,shadow:p,sizing:y="md",type:b="text",...j}=Qe(r,(w=i.props)==null?void 0:w.textInput);return t.jsxs("div",{className:Ce(l.base,d),children:[o&&t.jsx("span",{className:l.addon,children:o}),t.jsxs("div",{className:l.field.base,children:[h&&t.jsx("div",{className:l.field.icon.base,children:t.jsx(h,{className:l.field.icon.svg})}),g&&t.jsx("div",{"data-testid":"right-icon",className:l.field.rightIcon.base,children:t.jsx(g,{className:l.field.rightIcon.svg})}),t.jsx("input",{className:Ce(l.field.input.base,l.field.input.colors[f],l.field.input.sizes[y],l.field.input.withIcon[h?"on":"off"],l.field.input.withRightIcon[g?"on":"off"],l.field.input.withAddon[o?"on":"off"],l.field.input.withShadow[p?"on":"off"]),type:b,...j,ref:n})]})]})});Me.displayName="TextInput";const dv=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",ref:n,...r,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m5 15 7-7 7 7"})}));dv.displayName="ChevronUpIcon";const uv=x.createContext(void 0);function fv(){const r=x.useContext(uv);if(!r)throw new Error("useDropdownContext should be used within the DropdownContext provider!");return r}const Yh={arrowIcon:"ml-2 h-4 w-4",content:"py-1 focus:outline-none",floating:{animation:"transition-opacity",arrow:{base:"absolute z-10 h-2 w-2 rotate-45",style:{dark:"bg-gray-900 dark:bg-gray-700",light:"bg-white",auto:"bg-white dark:bg-gray-700"},placement:"-4px"},base:"z-10 w-fit divide-y divide-gray-100 rounded shadow focus:outline-none",content:"py-1 text-sm text-gray-700 dark:text-gray-200",divider:"my-1 h-px bg-gray-100 dark:bg-gray-600",header:"block px-4 py-2 text-sm text-gray-700 dark:text-gray-200",hidden:"invisible opacity-0",item:{container:"",base:"flex w-full cursor-pointer items-center justify-start px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:bg-gray-600 dark:focus:text-white",icon:"mr-2 h-4 w-4"},style:{dark:"bg-gray-900 text-white dark:bg-gray-700",light:"border border-gray-200 bg-white text-gray-900",auto:"border border-gray-200 bg-white text-gray-900 dark:border-none dark:bg-gray-700 dark:text-white"},target:"w-fit"},inlineWrapper:"flex items-center"},Z4={top:dv,right:Ii,bottom:zh,left:qc};function V4({refs:r,children:n,inline:i,theme:l,disabled:o,setButtonWidth:d,getReferenceProps:f,renderTrigger:h,...g}){const p=r.reference,y=f();if(x.useEffect(()=>{p.current&&(d==null||d(p.current.clientWidth))},[p,d]),h){const b=h(l);return x.cloneElement(b,{ref:r.setReference,disabled:o,...y,...b.props})}return i?t.jsx("button",{type:"button",ref:r.setReference,className:l==null?void 0:l.inlineWrapper,disabled:o,...y,children:n}):t.jsx(X,{...g,disabled:o,type:"button",ref:r.setReference,...y,children:n})}function hv(r){var M,I;const[n,i]=x.useState(!1),[l,o]=x.useState(null),[d,f]=x.useState(null),[h,g]=x.useState(void 0),p=x.useRef([]),y=x.useRef([]),b=Ke(),j=Ve([Yh,(M=b.theme)==null?void 0:M.dropdown,r.theme],[ue(b.clearTheme,"dropdown"),r.clearTheme],[ue(b.applyTheme,"dropdown"),r.applyTheme]),{children:N,className:w,dismissOnClick:S=!0,enableTypeAhead:E=!0,renderTrigger:k,...A}=Qe(r,(I=b.props)==null?void 0:I.dropdown),{placement:O=A.inline?"bottom-start":"bottom",trigger:L="click",label:B,inline:V,arrowIcon:$=!0,...le}=A,q=A["data-testid"]||"flowbite-dropdown-target",K=x.useCallback(ee=>{f(ee),i(!1)},[]),ae=x.useCallback(ee=>{n?o(ee):K(ee)},[n,K]),{context:G,floatingStyles:Z,refs:z}=av({open:n,setOpen:i,placement:O}),H=C4(G,{listRef:p,activeIndex:l,selectedIndex:d,onNavigate:o}),C=R4(G,{listRef:y,activeIndex:l,selectedIndex:d,onMatch:ae,enabled:E}),{getReferenceProps:U,getFloatingProps:T,getItemProps:R}=rv({context:G,role:"menu",trigger:L,interactions:[H,C]}),v=x.useMemo(()=>{const[ee]=O.split("-");return Z4[ee]??zh},[O]);return t.jsxs(uv.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme,activeIndex:l,dismissOnClick:S,getItemProps:R,handleSelect:K},children:[t.jsxs(V4,{...le,refs:z,inline:V,theme:j,"data-testid":q,className:Ce(j.floating.target,w),setButtonWidth:g,getReferenceProps:U,renderTrigger:k,children:[B,$&&t.jsx(v,{className:j.arrowIcon})]}),n&&t.jsx(Xb,{context:G,modal:!1,children:t.jsx("div",{ref:z.setFloating,style:{...Z,minWidth:h},"data-testid":"flowbite-dropdown","aria-expanded":n,...T({className:Ce(j.floating.base,j.floating.animation,"duration-100",!n&&j.floating.hidden,j.floating.style.auto,w)}),children:t.jsx(a4,{elementsRef:p,labelsRef:y,children:t.jsx("ul",{className:j.content,tabIndex:-1,children:N})})})})]})}hv.displayName="Dropdown";const pv=x.forwardRef((r,n)=>{var p,y,b;const{theme:i,clearTheme:l,applyTheme:o}=fv(),d=Ke(),f=Ve([Yh.floating,(y=(p=d.theme)==null?void 0:p.dropdown)==null?void 0:y.floating,i==null?void 0:i.floating,r.theme],[ue(d.clearTheme,"dropdown.floating"),ue(l,"floating"),r.clearTheme],[ue(d.applyTheme,"dropdown.floating"),ue(o,"floating"),r.applyTheme]),{className:h,...g}=Qe(r,(b=d.props)==null?void 0:b.dropdownHeader);return t.jsx("div",{ref:n,className:Ce(f.header,h),...g})});pv.displayName="DropdownHeader";const mv=x.forwardRef((r,n)=>{var L,B,V,$,le;const{theme:i,clearTheme:l,applyTheme:o,activeIndex:d,dismissOnClick:f,getItemProps:h,handleSelect:g}=fv(),p=Ke(),y=Ve([Yh.floating.item,(V=(B=(L=p.theme)==null?void 0:L.dropdown)==null?void 0:B.floating)==null?void 0:V.item,($=i==null?void 0:i.floating)==null?void 0:$.item,r.theme],[ue(p.clearTheme,"dropdown.floating.item"),ue(l,"floating.item"),r.clearTheme],[ue(p.applyTheme,"dropdown.floating.item"),ue(o,"floating.item"),r.applyTheme]),{children:b,className:j,icon:N,onClick:w,...S}=Qe(r,(le=p.props)==null?void 0:le.dropdownItem),{ref:E,index:k}=r4({label:typeof b=="string"?b:void 0}),A=Oc([n,E]),O=d===k;return t.jsx("li",{role:"menuitem",className:y.container,children:t.jsxs(Lh,{ref:A,className:Ce(y.base,j),...S,...h({onClick:()=>{w==null||w(),f&&g(null)}}),tabIndex:O?0:-1,children:[N&&t.jsx(N,{className:y.icon}),b]})})});mv.displayName="DropdownItem";const K4={root:{base:"text-sm font-medium",disabled:"opacity-50",colors:{default:"text-gray-900 dark:text-white",info:"text-cyan-500 dark:text-cyan-600",failure:"text-red-700 dark:text-red-500",warning:"text-yellow-500 dark:text-yellow-600",success:"text-green-700 dark:text-green-500"}}},se=x.forwardRef((r,n)=>{var g,p;const i=Ke(),l=Ve([K4,(g=i.theme)==null?void 0:g.label,r.theme],[ue(i.clearTheme,"label"),r.clearTheme],[ue(i.applyTheme,"label"),r.applyTheme]),{className:o,color:d="default",disabled:f=!1,...h}=Qe(r,(p=i.props)==null?void 0:p.label);return t.jsx("label",{ref:n,className:Ce(l.root.base,l.root.colors[d],f&&l.root.disabled,o),"data-testid":"flowbite-label",...h})});se.displayName="Label";const gv=x.createContext(void 0);function xv(){const r=x.useContext(gv);if(!r)throw new Error("useNavBarContext should be used within the NavbarContext provider!");return r}const Xh={root:{base:"bg-white px-2 py-2.5 sm:px-4 dark:border-gray-700 dark:bg-gray-800",rounded:{on:"rounded",off:""},bordered:{on:"border",off:""},inner:{base:"mx-auto flex flex-wrap items-center justify-between",fluid:{on:"",off:"container"}}},brand:{base:"flex items-center"},collapse:{base:"w-full md:block md:w-auto",list:"mt-4 flex flex-col md:mt-0 md:flex-row md:space-x-8 md:text-sm md:font-medium",hidden:{on:"hidden",off:""}},link:{base:"block py-2 pl-3 pr-4 md:p-0",active:{on:"bg-primary-700 text-white md:bg-transparent md:text-primary-700 dark:text-white",off:"border-b border-gray-100 text-gray-700 hover:bg-gray-50 md:border-0 md:hover:bg-transparent md:hover:text-primary-700 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent md:dark:hover:text-white"},disabled:{on:"text-gray-400 hover:cursor-not-allowed dark:text-gray-600",off:""}},toggle:{base:"inline-flex items-center rounded-lg p-2 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 md:hidden dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600",icon:"h-6 w-6 shrink-0",title:"sr-only"}},yv=x.forwardRef((r,n)=>{var N,w;const i=Ke(),l=Ve([Xh,(N=i.theme)==null?void 0:N.navbar,r.theme],[ue(i.clearTheme,"navbar"),r.clearTheme],[ue(i.applyTheme,"navbar"),r.applyTheme]),{border:o,children:d,className:f,fluid:h=!1,menuOpen:g,rounded:p,...y}=Qe(r,(w=i.props)==null?void 0:w.navbar),[b,j]=x.useState(g);return t.jsx(gv.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme,isOpen:b,setIsOpen:j},children:t.jsx("nav",{ref:n,className:Ce(l.root.base,l.root.bordered[o?"on":"off"],l.root.rounded[p?"on":"off"],f),...y,children:t.jsx("div",{className:Ce(l.root.inner.base,l.root.inner.fluid[h?"on":"off"]),children:d})})})});yv.displayName="Navbar";const bv=x.forwardRef((r,n)=>{var b,j,N;const{theme:i,clearTheme:l,applyTheme:o,isOpen:d}=xv(),f=Ke(),h=Ve([Xh.collapse,(j=(b=f.theme)==null?void 0:b.navbar)==null?void 0:j.collapse,i==null?void 0:i.collapse,r.theme],[ue(f.clearTheme,"navbar.collapse"),ue(l,"collapse"),r.clearTheme],[ue(f.applyTheme,"navbar.collapse"),ue(o,"collapse"),r.applyTheme]),{children:g,className:p,...y}=Qe(r,(N=f.props)==null?void 0:N.navbarCollapse);return t.jsx("div",{ref:n,"data-testid":"flowbite-navbar-collapse",className:Ce(h.base,h.hidden[d?"off":"on"],p),...y,children:t.jsx("ul",{className:h.list,children:g})})});bv.displayName="NavbarCollapse";const vv=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 448 512",ref:n,...r,children:t.jsx("path",{stroke:"none",d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}));vv.displayName="BarsIcon";const jv=x.forwardRef((r,n)=>{var N,w,S;const{theme:i,clearTheme:l,applyTheme:o,isOpen:d,setIsOpen:f}=xv(),h=Ke(),g=Ve([Xh.toggle,(w=(N=h.theme)==null?void 0:N.navbar)==null?void 0:w.toggle,i==null?void 0:i.toggle,r.theme],[ue(h.clearTheme,"navbar.toggle"),ue(l,"toggle"),r.clearTheme],[ue(h.applyTheme,"navbar.toggle"),ue(o,"toggle"),r.applyTheme]),{barIcon:p=vv,className:y,...b}=Qe(r,(S=h.props)==null?void 0:S.navbarToggle);function j(){f(!d)}return t.jsxs("button",{ref:n,"data-testid":"flowbite-navbar-toggle",onClick:j,className:Ce(g.base,y),...b,children:[t.jsx("span",{className:g.title,children:"Open main menu"}),t.jsx(p,{"aria-hidden":!0,className:g.icon})]})});jv.displayName="NavbarToggle";const wv=x.createContext(void 0);function Qh(){const r=x.useContext(wv);if(!r)throw new Error("useModalContext should be used within the ModalContext provider!");return r}const ed={root:{base:"fixed inset-x-0 top-0 z-50 h-screen overflow-y-auto overflow-x-hidden md:inset-0 md:h-full",show:{on:"flex bg-gray-900/50 dark:bg-gray-900/80",off:"hidden"},sizes:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl"},positions:{"top-left":"items-start justify-start","top-center":"items-start justify-center","top-right":"items-start justify-end","center-left":"items-center justify-start",center:"items-center justify-center","center-right":"items-center justify-end","bottom-right":"items-end justify-end","bottom-center":"items-end justify-center","bottom-left":"items-end justify-start"}},content:{base:"relative h-full w-full p-4 md:h-auto",inner:"relative flex max-h-[90dvh] flex-col rounded-lg bg-white shadow dark:bg-gray-700"},body:{base:"flex-1 overflow-auto p-6",popup:"pt-0"},header:{base:"flex items-start justify-between rounded-t border-b p-5 dark:border-gray-600",popup:"border-b-0 p-2",title:"text-xl font-medium text-gray-900 dark:text-white",close:{base:"ml-auto inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white",icon:"h-5 w-5"}},footer:{base:"flex items-center space-x-2 rounded-b border-gray-200 p-6 dark:border-gray-600",popup:"border-t"}},Lt=x.forwardRef((r,n)=>{var $,le;const[i,l]=x.useState(void 0),o=Ke(),d=Ve([ed,($=o.theme)==null?void 0:$.modal,r.theme],[ue(o.clearTheme,"modal"),r.clearTheme],[ue(o.applyTheme,"modal"),r.applyTheme]),{children:f,className:h,dismissible:g=!1,onClose:p,popup:y,position:b="center",root:j,show:N,size:w="2xl",initialFocus:S,...E}=Qe(r,(le=o.props)==null?void 0:le.modal),{context:k}=Jb({open:N,onOpenChange:()=>p&&p()}),A=Oc([k.refs.setFloating,n]),O=Qb(k),L=Wb(k,{outsidePressEvent:"mousedown",enabled:g}),B=tv(k),{getFloatingProps:V}=ev([O,L,B]);return N?t.jsx(wv.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme,popup:y,onClose:p,setHeaderId:l},children:t.jsx(y4,{root:j,children:t.jsx(w4,{lockScroll:!0,"data-testid":"modal-overlay",className:Ce(d.root.base,d.root.positions[b],N?d.root.show.on:d.root.show.off,h),...E,children:t.jsx(Xb,{context:k,initialFocus:S,children:t.jsx("div",{ref:A,...V(E),"aria-labelledby":i,className:Ce(d.content.base,d.root.sizes[w]),children:t.jsx("div",{className:d.content.inner,children:f})})})})})}):null});Lt.displayName="Modal";const br=x.forwardRef((r,n)=>{var y,b,j;const{theme:i,clearTheme:l,applyTheme:o,popup:d}=Qh(),f=Ke(),h=Ve([ed.body,(b=(y=f.theme)==null?void 0:y.modal)==null?void 0:b.body,i==null?void 0:i.body,r.theme],[ue(f.clearTheme,"modal.body"),ue(l,"body"),r.clearTheme],[ue(f.applyTheme,"modal.body"),ue(o,"body"),r.applyTheme]),{className:g,...p}=Qe(r,(j=f.props)==null?void 0:j.modalBody);return t.jsx("div",{ref:n,className:Ce(h.base,d&&h.popup,g),...p})});br.displayName="ModalBody";const vr=x.forwardRef((r,n)=>{var y,b,j;const{theme:i,clearTheme:l,applyTheme:o,popup:d}=Qh(),f=Ke(),h=Ve([ed.footer,(b=(y=f.theme)==null?void 0:y.modal)==null?void 0:b.footer,i==null?void 0:i.footer,r.theme],[ue(f.clearTheme,"modal.footer"),ue(l,"footer"),r.clearTheme],[ue(f.applyTheme,"modal.footer"),ue(o,"footer"),r.applyTheme]),{className:g,...p}=Qe(r,(j=f.props)==null?void 0:j.modalFooter);return t.jsx("div",{ref:n,className:Ce(h.base,!d&&h.popup,g),...p})});vr.displayName="ModalFooter";const Nv=x.forwardRef((r,n)=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",ref:n,...r,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}));Nv.displayName="OutlineXIcon";const jr=x.forwardRef((r,n)=>{var k,A,O;const{theme:i,clearTheme:l,applyTheme:o,popup:d,onClose:f,setHeaderId:h}=Qh(),g=Ke(),p=Ve([ed.header,(A=(k=g.theme)==null?void 0:k.modal)==null?void 0:A.header,i==null?void 0:i.header,r.theme],[ue(g.clearTheme,"modal.header"),ue(l,"header"),r.clearTheme],[ue(g.applyTheme,"modal.header"),ue(o,"header"),r.applyTheme]),{as:y="h3",children:b,className:j,id:N,...w}=Qe(r,(O=g.props)==null?void 0:O.modalHeader),S=x.useId(),E=N||S;return x.useLayoutEffect(()=>(h(E),()=>h(void 0)),[E,h]),t.jsxs("div",{ref:n,className:Ce(p.base,d&&p.popup,j),...w,children:[t.jsx(y,{id:E,className:p.title,children:b}),t.jsx("button",{"aria-label":"Close",className:p.close.base,type:"button",onClick:f,children:t.jsx(Nv,{"aria-hidden":!0,className:p.close.icon})})]})});jr.displayName="ModalHeader";function Y4(r,n){return r>=n?[]:[...Array(n-r+1).keys()].map(i=>i+r)}const td={base:"",layout:{table:{base:"text-sm text-gray-700 dark:text-gray-400",span:"font-semibold text-gray-900 dark:text-white"}},pages:{base:"xs:mt-0 mt-2 inline-flex items-center -space-x-px",showIcon:"inline-flex",previous:{base:"ml-0 rounded-l-lg border border-gray-300 bg-white px-3 py-2 leading-tight text-gray-500 enabled:hover:bg-gray-100 enabled:hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 enabled:dark:hover:bg-gray-700 enabled:dark:hover:text-white",icon:"h-5 w-5"},next:{base:"rounded-r-lg border border-gray-300 bg-white px-3 py-2 leading-tight text-gray-500 enabled:hover:bg-gray-100 enabled:hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 enabled:dark:hover:bg-gray-700 enabled:dark:hover:text-white",icon:"h-5 w-5"},selector:{base:"w-12 border border-gray-300 bg-white py-2 leading-tight text-gray-500 enabled:hover:bg-gray-100 enabled:hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 enabled:dark:hover:bg-gray-700 enabled:dark:hover:text-white",active:"bg-cyan-50 text-cyan-600 hover:bg-cyan-100 hover:text-cyan-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white",disabled:"cursor-not-allowed opacity-50"}}},kv=x.forwardRef(({active:r,children:n,className:i,onClick:l,theme:o,clearTheme:d,applyTheme:f,...h},g)=>{var b;const p=Ke(),y=Ve([td,(b=p.theme)==null?void 0:b.pagination,o],[ue(p.clearTheme,"pagination"),d],[ue(p.applyTheme,"pagination"),f]);return t.jsx("button",{ref:g,type:"button",className:Ce(r&&y.pages.selector.active,i),onClick:l,...h,children:n})});kv.displayName="PaginationButton";function Li({children:r,className:n,onClick:i,disabled:l=!1,theme:o,clearTheme:d,applyTheme:f,...h}){var y;const g=Ke(),p=Ve([td,(y=g.theme)==null?void 0:y.pagination,o],[ue(g.clearTheme,"pagination"),d],[ue(g.applyTheme,"pagination"),f]);return t.jsx("button",{type:"button",className:Ce(l&&p.pages.selector.disabled,n),disabled:l,onClick:i,...h,children:r})}Li.displayName="PaginationNavigation";const yl=x.forwardRef((r,n)=>r.layout==="table"?t.jsx(Q4,{...r,ref:n}):t.jsx(X4,{...r,ref:n})),X4=x.forwardRef((r,n)=>{var A,O;const i=Ke(),l=Ve([td,(A=i.theme)==null?void 0:A.pagination,r.theme],[ue(i.clearTheme,"pagination"),r.clearTheme],[ue(i.applyTheme,"pagination"),r.applyTheme]),{className:o,currentPage:d,layout:f="pagination",nextLabel:h="Next",onPageChange:g,previousLabel:p="Previous",renderPaginationButton:y=L=>t.jsx(kv,{...L}),totalPages:b,showIcons:j=!1,...N}=Qe(r,(O=i.props)==null?void 0:O.pagination);if(!Number.isInteger(d)||d<1)throw new Error("Invalid props: currentPage must be a positive integer");if(!Number.isInteger(b)||b<1)throw new Error("Invalid props: totalPages must be a positive integer");const w=Math.min(Math.max(f==="pagination"?d+2:d+4,5),b),S=Math.max(1,w-4);function E(){g(Math.min(d+1,b))}function k(){g(Math.max(d-1,1))}return t.jsx("nav",{ref:n,className:Ce(l.base,o),...N,children:t.jsxs("ul",{className:l.pages.base,children:[t.jsx("li",{children:t.jsxs(Li,{className:Ce(l.pages.previous.base,j&&l.pages.showIcon),onClick:k,disabled:d===1,children:[j&&t.jsx(qc,{"aria-hidden":!0,className:l.pages.previous.icon}),p]})}),f==="pagination"&&Y4(S,w).map(L=>t.jsx("li",{"aria-current":L===d?"page":void 0,children:y({className:Ce(l.pages.selector.base,d===L&&l.pages.selector.active),active:L===d,onClick:()=>g(L),children:L})},L)),t.jsx("li",{children:t.jsxs(Li,{className:Ce(l.pages.next.base,j&&l.pages.showIcon),onClick:E,disabled:d===b,children:[h,j&&t.jsx(Ii,{"aria-hidden":!0,className:l.pages.next.icon})]})})]})})}),Q4=x.forwardRef((r,n)=>{var O,L;const i=Ke(),l=Ve([td,(O=i.theme)==null?void 0:O.pagination,r.theme],[ue(i.clearTheme,"pagination"),r.clearTheme],[ue(i.applyTheme,"pagination"),r.applyTheme]),{className:o,currentPage:d,nextLabel:f="Next",onPageChange:h,previousLabel:g="Previous",showIcons:p=!1,itemsPerPage:y,totalItems:b,...j}=Qe(r,(L=i.props)==null?void 0:L.pagination);if(!Number.isInteger(d)||d<1)throw new Error("Invalid props: currentPage must be a positive integer");if(!Number.isInteger(y)||y<1)throw new Error("Invalid props: itemsPerPage must be a positive integer");if(!Number.isInteger(b)||b<0)throw new Error("Invalid props: totalItems must be a non-negative integer");const N=b>0?Math.ceil(b/y):1,w=(d-1)*y,S=b>0?w+1:0,E=d===N?b:w+y;function k(){h(Math.min(d+1,N))}function A(){h(Math.max(d-1,1))}return t.jsxs("nav",{ref:n,className:Ce(l.base,o),...j,children:[t.jsxs("div",{role:"status","aria-live":"polite","aria-label":"Table Pagination",className:l.layout.table.base,children:["Showing ",t.jsx("span",{className:l.layout.table.span,children:S})," to ",t.jsx("span",{className:l.layout.table.span,children:E})," of ",t.jsx("span",{className:l.layout.table.span,children:b})," Entries"]}),t.jsxs("ul",{className:l.pages.base,children:[t.jsx("li",{children:t.jsxs(Li,{className:Ce(l.pages.previous.base,p&&l.pages.showIcon),onClick:A,disabled:d===1,children:[p&&t.jsx(qc,{"aria-hidden":!0,className:l.pages.previous.icon}),g]})}),t.jsx("li",{children:t.jsxs(Li,{className:Ce(l.pages.next.base,p&&l.pages.showIcon),onClick:k,disabled:d===N,children:[f,p&&t.jsx(Ii,{"aria-hidden":!0,className:l.pages.next.icon})]})})]})]})});yl.displayName="Pagination";const W4={base:"w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700",label:"mb-1 flex justify-between font-medium dark:text-white",bar:"space-x-2 rounded-full text-center font-medium leading-none text-primary-300 dark:text-primary-100",color:{default:"bg-primary-600",dark:"bg-gray-600 dark:bg-gray-300",blue:"bg-blue-600",red:"bg-red-600 dark:bg-red-500",green:"bg-green-600 dark:bg-green-500",yellow:"bg-yellow-400",indigo:"bg-indigo-600 dark:bg-indigo-500",purple:"bg-purple-600 dark:bg-purple-500",cyan:"bg-cyan-600",gray:"bg-gray-500",lime:"bg-lime-600",pink:"bg-pink-500",teal:"bg-teal-600"},size:{sm:"h-1.5",md:"h-2.5",lg:"h-4",xl:"h-6"}},yr=x.forwardRef((r,n)=>{var S,E;const i=x.useId(),l=Ke(),o=Ve([W4,(S=l.theme)==null?void 0:S.progress,r.theme],[ue(l.clearTheme,"progress"),r.clearTheme],[ue(l.applyTheme,"progress"),r.applyTheme]),{className:d,color:f="default",labelProgress:h=!1,labelText:g=!1,progress:p,progressLabelPosition:y="inside",size:b="md",textLabel:j="progressbar",textLabelPosition:N="inside",...w}=Qe(r,(E=l.props)==null?void 0:E.progress);return t.jsxs("div",{ref:n,id:i,"aria-label":j,"aria-valuenow":p,role:"progressbar",...w,children:[(j&&g&&N==="outside"||p>0&&h&&y==="outside")&&t.jsxs("div",{className:o.label,"data-testid":"flowbite-progress-outer-label-container",children:[j&&g&&N==="outside"&&t.jsx("span",{"data-testid":"flowbite-progress-outer-text-label",children:j}),h&&y==="outside"&&t.jsxs("span",{"data-testid":"flowbite-progress-outer-progress-label",children:[p,"%"]})]}),t.jsx("div",{className:Ce(o.base,o.size[b],d),children:t.jsxs("div",{style:{width:`${p}%`},className:Ce(o.bar,o.color[f],o.size[b]),children:[j&&g&&N==="inside"&&t.jsx("span",{"data-testid":"flowbite-progress-inner-text-label",children:j}),p>0&&h&&y==="inside"&&t.jsxs("span",{"data-testid":"flowbite-progress-inner-progress-label",children:[p,"%"]})]})})]})});yr.displayName="Progress";const J4={base:"flex",addon:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400",field:{base:"relative w-full",icon:{base:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",svg:"h-5 w-5 text-gray-500 dark:text-gray-400"},select:{base:"block w-full appearance-none border bg-arrow-down-icon bg-[length:0.75em_0.75em] bg-[position:right_12px_center] bg-no-repeat pr-10 focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50",withIcon:{on:"pl-10",off:""},withAddon:{on:"rounded-r-lg",off:"rounded-lg"},withShadow:{on:"shadow-sm dark:shadow-sm-light",off:""},sizes:{sm:"p-2 sm:text-xs",md:"p-2.5 text-sm",lg:"p-4 sm:text-base"},colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"}}}},rt=x.forwardRef((r,n)=>{var b,j;const i=Ke(),l=Ve([J4,(b=i.theme)==null?void 0:b.select,r.theme],[ue(i.clearTheme,"select"),r.clearTheme],[ue(i.applyTheme,"select"),r.applyTheme]),{addon:o,className:d,color:f="gray",icon:h,shadow:g,sizing:p="md",...y}=Qe(r,(j=i.props)==null?void 0:j.select);return t.jsxs("div",{className:Ce(l.base,d),children:[o&&t.jsx("span",{className:l.addon,children:o}),t.jsxs("div",{className:l.field.base,children:[h&&t.jsx("div",{className:l.field.icon.base,children:t.jsx(h,{className:l.field.icon.svg})}),t.jsx("select",{ref:n,className:Ce(l.field.select.base,l.field.select.colors[f],l.field.select.sizes[p],l.field.select.withIcon[h?"on":"off"],l.field.select.withAddon[o?"on":"off"],l.field.select.withShadow[g?"on":"off"]),...y})]})]})});rt.displayName="Select";const Sv=x.createContext(void 0);function Wh(){const r=x.useContext(Sv);if(!r)throw new Error("useSidebarContext should be used within the SidebarContext provider!");return r}const ad={root:{base:"h-full",collapsed:{on:"w-16",off:"w-64"},inner:"h-full overflow-y-auto overflow-x-hidden rounded bg-gray-50 px-3 py-4 dark:bg-gray-800"},collapse:{button:"group flex w-full items-center rounded-lg p-2 text-base font-normal text-gray-900 transition duration-75 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",icon:{base:"h-6 w-6 text-gray-500 transition duration-75 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",open:{off:"",on:"text-gray-900"}},label:{base:"ml-3 flex-1 whitespace-nowrap text-left",title:"sr-only",icon:{base:"h-6 w-6 transition delay-0 ease-in-out",open:{on:"rotate-180",off:""}}},list:"space-y-2 py-2"},cta:{base:"mt-6 rounded-lg bg-gray-100 p-4 dark:bg-gray-700",color:{blue:"bg-cyan-50 dark:bg-cyan-900",dark:"bg-dark-50 dark:bg-dark-900",failure:"bg-red-50 dark:bg-red-900",gray:"bg-gray-50 dark:bg-gray-900",green:"bg-green-50 dark:bg-green-900",light:"bg-light-50 dark:bg-light-900",red:"bg-red-50 dark:bg-red-900",purple:"bg-purple-50 dark:bg-purple-900",success:"bg-green-50 dark:bg-green-900",yellow:"bg-yellow-50 dark:bg-yellow-900",warning:"bg-yellow-50 dark:bg-yellow-900"}},item:{base:"flex items-center justify-center rounded-lg p-2 text-base font-normal text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",active:"bg-gray-100 dark:bg-gray-700",collapsed:{insideCollapse:"group w-full pl-8 transition duration-75",noIcon:"font-bold"},content:{base:"flex-1 whitespace-nowrap px-3"},icon:{base:"h-6 w-6 shrink-0 text-gray-500 transition duration-75 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",active:"text-gray-700 dark:text-gray-100"},label:"",listItem:""},items:{base:""},itemGroup:{base:"mt-4 space-y-2 border-t border-gray-200 pt-4 first:mt-0 first:border-t-0 first:pt-0 dark:border-gray-700"},logo:{base:"mb-5 flex items-center pl-2.5",collapsed:{on:"hidden",off:"self-center whitespace-nowrap text-xl font-semibold dark:text-white"},img:"mr-3 h-6 sm:h-7"}},_v=x.forwardRef((r,n)=>{var y,b;const i=Ke(),l=Ve([ad,(y=i.theme)==null?void 0:y.sidebar,r.theme],[ue(i.clearTheme,"sidebar"),r.clearTheme],[ue(i.applyTheme,"sidebar"),r.applyTheme]),{as:o="nav",children:d,className:f,collapseBehavior:h="collapse",collapsed:g=!1,...p}=Qe(r,(b=i.props)==null?void 0:b.sidebar);return t.jsx(Sv.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme,isCollapsed:g},children:t.jsx(o,{ref:n,"aria-label":"Sidebar",hidden:g&&h==="hide",className:Ce(l.root.base,l.root.collapsed[g?"on":"off"],f),...p,children:t.jsx("div",{className:l.root.inner,children:d})})})});_v.displayName="Sidebar";const Tv=x.createContext(void 0);function eT(){const r=x.useContext(Tv);if(!r)throw new Error("useSidebarItemContext should be used within the SidebarItemContext provider!");return r}const ar=x.forwardRef((r,n)=>{var A,O,L;const i=x.useId(),{theme:l,clearTheme:o,applyTheme:d,isCollapsed:f}=Wh(),{isInsideCollapse:h}=eT(),g=Ke(),p=Ve([ad.item,(O=(A=g.theme)==null?void 0:A.sidebar)==null?void 0:O.item,l==null?void 0:l.item,r.theme],[ue(g.clearTheme,"sidebar.item"),ue(o,"item"),r.clearTheme],[ue(g.applyTheme,"sidebar.item"),ue(d,"item"),r.applyTheme]),{active:y,as:b="a",children:j,className:N,icon:w,label:S,labelColor:E="info",...k}=Qe(r,(L=g.props)==null?void 0:L.sidebarItem);return t.jsx(Jh,{theme:p,className:p.listItem,id:i,isCollapsed:f,tooltipChildren:j,children:t.jsxs(b,{"aria-labelledby":`flowbite-sidebar-item-${i}`,ref:n,className:Ce(p.base,y&&p.active,!f&&h&&p.collapsed.insideCollapse,N),...k,children:[w&&t.jsx(w,{"aria-hidden":!0,"data-testid":"flowbite-sidebar-item-icon",className:Ce(p.icon.base,y&&p.icon.active)}),f&&!w&&t.jsx("span",{className:p.collapsed.noIcon,children:j.charAt(0).toLocaleUpperCase()??"?"}),!f&&t.jsx(Cv,{id:i,theme:p,children:j}),!f&&S&&t.jsx(jt,{color:E,"data-testid":"flowbite-sidebar-label",hidden:f,className:p.label,children:S})]})})});ar.displayName="SidebarItem";function Jh({id:r,theme:n,isCollapsed:i,tooltipChildren:l,children:o,...d}){return t.jsx("li",{...d,children:i?t.jsx(sv,{content:t.jsx(Cv,{id:r,theme:n,children:l}),placement:"right",children:o}):o})}Jh.displayName="SidebarItem.ListItem";function Cv({id:r,theme:n,children:i}){return t.jsx("span",{"data-testid":"flowbite-sidebar-item-content",id:`flowbite-sidebar-item-${r}`,className:Ce(n.content.base),children:i})}Jh.displayName="SidebarItem.Children";const Ev=x.forwardRef((r,n)=>{var p,y,b;const{theme:i,clearTheme:l,applyTheme:o}=Wh(),d=Ke(),f=Ve([ad.itemGroup,(y=(p=d.theme)==null?void 0:p.sidebar)==null?void 0:y.itemGroup,i==null?void 0:i.itemGroup,r.theme],[ue(d.clearTheme,"sidebar.itemGroup"),ue(l,"itemGroup"),r.clearTheme],[ue(d.applyTheme,"sidebar.itemGroup"),ue(o,"itemGroup"),r.applyTheme]),{className:h,...g}=Qe(r,(b=d.props)==null?void 0:b.sidebarItemGroup);return t.jsx(Tv.Provider,{value:{isInsideCollapse:!1},children:t.jsx("ul",{ref:n,"data-testid":"flowbite-sidebar-item-group",className:Ce(f.base,h),...g})})});Ev.displayName="SidebarItemGroup";const Rv=x.forwardRef((r,n)=>{var p,y,b;const{theme:i,clearTheme:l,applyTheme:o}=Wh(),d=Ke(),f=Ve([ad.items,(y=(p=d.theme)==null?void 0:p.sidebar)==null?void 0:y.items,i==null?void 0:i.items,r.theme],[ue(d.clearTheme,"sidebar.items"),ue(l,"items"),r.clearTheme],[ue(d.applyTheme,"sidebar.items"),ue(o,"items"),r.applyTheme]),{className:h,...g}=Qe(r,(b=d.props)==null?void 0:b.sidebarItems);return t.jsx("div",{ref:n,className:Ce(f.base,h),"data-testid":"flowbite-sidebar-items",...g})});Rv.displayName="SidebarItems";const tT={base:"inline animate-spin text-gray-200",color:{default:"fill-primary-600",failure:"fill-red-600",gray:"fill-gray-600",info:"fill-cyan-600",pink:"fill-pink-600",purple:"fill-purple-600",success:"fill-green-500",warning:"fill-yellow-400"},light:{off:{base:"dark:text-gray-600",color:{default:"",failure:"",gray:"dark:fill-gray-300",info:"",pink:"",purple:"",success:"",warning:""}},on:{base:"",color:{default:"",failure:"",gray:"",info:"",pink:"",purple:"",success:"",warning:""}}},size:{xs:"h-3 w-3",sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8",xl:"h-10 w-10"}},He=x.forwardRef((r,n)=>{var p,y;const i=Ke(),l=Ve([tT,(p=i.theme)==null?void 0:p.spinner,r.theme],[ue(i.clearTheme,"spinner"),r.clearTheme],[ue(i.applyTheme,"spinner"),r.applyTheme]),{className:o,color:d="default",light:f,size:h="lg",...g}=Qe(r,(y=i.props)==null?void 0:y.spinner);return t.jsx("span",{ref:n,role:"status",...g,children:t.jsxs("svg",{fill:"none",viewBox:"0 0 100 101",className:Ce(l.base,l.color[d],l.light[f?"on":"off"].base,l.light[f?"on":"off"].color[d],l.size[h],o),children:[t.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),t.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})})});He.displayName="Spinner";const Av=x.createContext(void 0);function $i(){const r=x.useContext(Av);if(!r)throw new Error("useTableContext should be used within the TableContext provider!");return r}const bl={root:{base:"w-full text-left text-sm text-gray-500 dark:text-gray-400",shadow:"absolute left-0 top-0 -z-10 h-full w-full rounded-lg bg-white drop-shadow-md dark:bg-black",wrapper:"relative"},body:{base:"group/body",cell:{base:"px-6 py-4 group-first/body:group-first/row:first:rounded-tl-lg group-first/body:group-first/row:last:rounded-tr-lg group-last/body:group-last/row:first:rounded-bl-lg group-last/body:group-last/row:last:rounded-br-lg"}},head:{base:"group/head text-xs uppercase text-gray-700 dark:text-gray-400",cell:{base:"bg-gray-50 px-6 py-3 group-first/head:first:rounded-tl-lg group-first/head:last:rounded-tr-lg dark:bg-gray-700"}},row:{base:"group/row",hovered:"hover:bg-gray-50 dark:hover:bg-gray-600",striped:"odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700"}},Yt=x.forwardRef((r,n)=>{var g,p;const i=Ke(),l=Ve([bl,(g=i.theme)==null?void 0:g.table,r.theme],[ue(i.clearTheme,"table"),r.clearTheme],[ue(i.applyTheme,"table"),r.applyTheme]),{className:o,striped:d,hoverable:f,...h}=Qe(r,(p=i.props)==null?void 0:p.table);return t.jsx("div",{"data-testid":"table-element",className:Ce(l.root.wrapper),children:t.jsxs(Av.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme,striped:d,hoverable:f},children:[t.jsx("div",{className:Ce(l.root.shadow,o)}),t.jsx("table",{ref:n,className:Ce(l.root.base,o),...h})]})})});Yt.displayName="Table";const Dv=x.createContext(void 0);function aT(){const r=x.useContext(Dv);if(!r)throw new Error("useTableBodyContext should be used within the TableBodyContext provider!");return r}const Xt=x.forwardRef((r,n)=>{var p,y,b;const{theme:i,clearTheme:l,applyTheme:o}=$i(),d=Ke(),f=Ve([bl.body,(y=(p=d.theme)==null?void 0:p.table)==null?void 0:y.body,i==null?void 0:i.body,r.theme],[ue(d.clearTheme,"table.body"),ue(l,"body"),r.clearTheme],[ue(d.applyTheme,"table.body"),ue(o,"body"),r.applyTheme]),{className:h,...g}=Qe(r,(b=d.props)==null?void 0:b.tableBody);return t.jsx(Dv.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme},children:t.jsx("tbody",{ref:n,className:Ce(f.base,h),...g})})});Xt.displayName="TableBody";const fe=x.forwardRef((r,n)=>{var j,N,w,S,E;const{theme:i,clearTheme:l,applyTheme:o}=$i(),{theme:d,clearTheme:f,applyTheme:h}=aT(),g=Ke(),p=Ve([bl.body.cell,(w=(N=(j=g.theme)==null?void 0:j.table)==null?void 0:N.body)==null?void 0:w.cell,(S=i==null?void 0:i.body)==null?void 0:S.cell,d==null?void 0:d.cell,r.theme],[ue(g.clearTheme,"table.body.cell"),ue(l,"body.cell"),ue(f,"cell"),r.clearTheme],[ue(g.applyTheme,"table.body.cell"),ue(o,"body.cell"),ue(h,"cell"),r.applyTheme]),{className:y,...b}=Qe(r,(E=g.props)==null?void 0:E.tableCell);return t.jsx("td",{ref:n,className:Ce(p.base,y),...b})});fe.displayName="TableCell";const Mv=x.createContext(void 0);function rT(){const r=x.useContext(Mv);if(!r)throw new Error("useTableHeadContext should be used within the TableHeadContext provider!");return r}const Qt=x.forwardRef((r,n)=>{var p,y,b;const{theme:i,clearTheme:l,applyTheme:o}=$i(),d=Ke(),f=Ve([bl.head,(y=(p=d.theme)==null?void 0:p.table)==null?void 0:y.head,i==null?void 0:i.head,r.theme],[ue(d.clearTheme,"table.head"),ue(l,"head"),r.clearTheme],[ue(d.applyTheme,"table.head"),ue(o,"head"),r.applyTheme]),{className:h,...g}=Qe(r,(b=d.props)==null?void 0:b.tableHead);return t.jsx(Mv.Provider,{value:{theme:r.theme,clearTheme:r.clearTheme,applyTheme:r.applyTheme},children:t.jsx("thead",{ref:n,className:Ce(f.base,h),...g})})});Qt.displayName="TableHead";const he=x.forwardRef((r,n)=>{var j,N,w,S,E;const{theme:i,clearTheme:l,applyTheme:o}=$i(),{theme:d,clearTheme:f,applyTheme:h}=rT(),g=Ke(),p=Ve([bl.head.cell,(w=(N=(j=g.theme)==null?void 0:j.table)==null?void 0:N.head)==null?void 0:w.cell,(S=i==null?void 0:i.head)==null?void 0:S.cell,d==null?void 0:d.cell,r.theme],[ue(g.clearTheme,"table.head.cell"),ue(l,"head.cell"),ue(f,"cell"),r.clearTheme],[ue(g.applyTheme,"table.head.cell"),ue(o,"head.cell"),ue(h,"cell"),r.applyTheme]),{className:y,...b}=Qe(r,(E=g.props)==null?void 0:E.tableHeadCell);return t.jsx("th",{ref:n,className:Ce(p.base,y),...b})});he.displayName="TableHeadCell";const at=x.forwardRef((r,n)=>{var b,j,N;const{theme:i,clearTheme:l,applyTheme:o,hoverable:d,striped:f}=$i(),h=Ke(),g=Ve([bl.row,(j=(b=h.theme)==null?void 0:b.table)==null?void 0:j.row,i==null?void 0:i.row,r.theme],[ue(h.clearTheme,"table.row"),ue(l,"row"),r.clearTheme],[ue(h.applyTheme,"table.row"),ue(o,"row"),r.applyTheme]),{className:p,...y}=Qe(r,(N=h.props)==null?void 0:N.tableRow);return t.jsx("tr",{ref:n,"data-testid":"table-row-element",className:Ce(g.base,f&&g.striped,d&&g.hovered,p),...y})});at.displayName="TableRow";const qf={defaultMode:"auto",localStorageKey:"flowbite-theme-mode",prefix:""};function nT(r={}){const{mode:n,defaultMode:i=qf.defaultMode,localStorageKey:l=qf.localStorageKey,prefix:o=qf.prefix}=r;try{const d=window.localStorage.getItem(l),h=(d==="light"||d==="dark"||d==="auto"?d:null)??n??i;(h==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h)==="dark"?document.documentElement.classList.add(`${o}dark`):document.documentElement.classList.remove(`${o}dark`),localStorage.setItem(l,h),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",y=>{const b=window.localStorage.getItem(l);(b==="light"||b==="dark"||b==="auto"?b:i)==="auto"&&(y.matches?document.documentElement.classList.add(`${o}dark`):document.documentElement.classList.remove(`${o}dark`))}),window.addEventListener("storage",y=>{if(y.key===l){const b=y.newValue,N=b==="light"||b==="dark"||b==="auto"?b:i;N==="dark"||N==="auto"&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add(`${o}dark`):document.documentElement.classList.remove(`${o}dark`)}})}catch{}}const sT={base:"block w-full rounded-lg border p-2.5 text-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50",colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"},withShadow:{on:"shadow-sm dark:shadow-sm-light",off:""}},_a=x.forwardRef((r,n)=>{var g,p;const i=Ke(),l=Ve([sT,(g=i.theme)==null?void 0:g.textarea,r.theme],[ue(i.clearTheme,"textarea"),r.clearTheme],[ue(i.applyTheme,"textarea"),r.applyTheme]),{className:o,color:d="gray",shadow:f,...h}=Qe(r,(p=i.props)==null?void 0:p.textarea);return t.jsx("textarea",{ref:n,className:Ce(l.base,l.colors[d],l.withShadow[f?"on":"off"],o),...h})});_a.displayName="Textarea";const lT={root:{base:"group flex rounded-lg focus:outline-none",active:{on:"cursor-pointer",off:"cursor-not-allowed opacity-50"},label:"ms-3 mt-0.5 text-start text-sm font-medium text-gray-900 dark:text-gray-300",input:"sr-only"},toggle:{base:"relative rounded-full after:absolute after:rounded-full after:border after:bg-white after:transition-all group-focus:ring-4",checked:{on:"after:translate-x-full after:border-transparent rtl:after:-translate-x-full",off:"bg-gray-200 after:border-gray-300 dark:bg-gray-700",color:{default:"bg-primary-700 group-focus:ring-primary-300 dark:group-focus:ring-primary-800",blue:"bg-blue-700 group-focus:ring-blue-300 dark:group-focus:ring-blue-800",dark:"bg-gray-700 group-focus:ring-gray-300 dark:group-focus:ring-gray-800",failure:"bg-red-700 group-focus:ring-red-300 dark:group-focus:ring-red-800",gray:"bg-gray-500 group-focus:ring-gray-300 dark:group-focus:ring-gray-800",green:"bg-green-600 group-focus:ring-green-300 dark:group-focus:ring-green-800",light:"bg-gray-300 group-focus:ring-gray-300 dark:group-focus:ring-gray-800",red:"bg-red-700 group-focus:ring-red-300 dark:group-focus:ring-red-800",purple:"bg-purple-700 group-focus:ring-purple-300 dark:group-focus:ring-purple-800",success:"bg-green-500 group-focus:ring-green-300 dark:group-focus:ring-green-800",yellow:"bg-yellow-400 group-focus:ring-yellow-300 dark:group-focus:ring-yellow-800",warning:"bg-yellow-600 group-focus:ring-yellow-300 dark:group-focus:ring-yellow-800",cyan:"bg-cyan-500 group-focus:ring-cyan-300 dark:group-focus:ring-cyan-800",lime:"bg-lime-400 group-focus:ring-lime-300 dark:group-focus:ring-lime-800",indigo:"bg-indigo-400 group-focus:ring-indigo-300 dark:group-focus:ring-indigo-800",teal:"bg-teal-400 group-focus:ring-teal-300 dark:group-focus:ring-teal-800",info:"bg-cyan-600 group-focus:ring-cyan-300 dark:group-focus:ring-cyan-800",pink:"bg-pink-600 group-focus:ring-pink-300 dark:group-focus:ring-pink-800"}},sizes:{sm:"h-5 w-9 min-w-9 after:left-0.5 after:top-0.5 after:h-4 after:w-4 rtl:after:right-0.5",md:"h-6 w-11 min-w-11 after:left-0.5 after:top-0.5 after:h-5 after:w-5 rtl:after:right-0.5",lg:"h-7 w-[52px] min-w-[52px] after:left-0.5 after:top-0.5 after:h-6 after:w-6 rtl:after:right-0.5"}}},Ov=x.forwardRef((r,n)=>{var E,k;const i=x.useId(),l=Ke(),o=Ve([lT,(E=l.theme)==null?void 0:E.toggleSwitch,r.theme],[ue(l.clearTheme,"toggleSwitch"),r.clearTheme],[ue(l.applyTheme,"toggleSwitch"),r.applyTheme]),{checked:d,className:f,color:h="default",sizing:g="md",disabled:p,label:y,name:b,onChange:j,...N}=Qe(r,(k=l.props)==null?void 0:k.toggleSwitch);function w(){j(!d)}function S(A){A.code=="Enter"&&A.preventDefault()}return t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:n,checked:d,name:b,type:"checkbox",className:o.root.input,readOnly:!0,hidden:!0}),t.jsxs("button",{"aria-checked":d,"aria-labelledby":`${i}-flowbite-toggleswitch-label`,disabled:p,id:`${i}-flowbite-toggleswitch`,onClick:w,onKeyDown:S,role:"switch",tabIndex:0,type:"button",className:Ce(o.root.base,o.root.active[p?"off":"on"],f),...N,children:[t.jsx("div",{"data-testid":"flowbite-toggleswitch-toggle",className:Ce(o.toggle.base,o.toggle.checked.color[h],o.toggle.checked[d?"on":"off"],o.toggle.sizes[g])}),!!(y!=null&&y.length)&&t.jsx("span",{"data-testid":"flowbite-toggleswitch-label",id:`${i}-flowbite-toggleswitch-label`,className:o.root.label,children:y})]})]})});Ov.displayName="ToggleSwitch";class iT{constructor(){Dt(this,"accessToken",null);Dt(this,"refreshToken",null);Dt(this,"tokenExpiry",null);Dt(this,"refreshTimer",null);Dt(this,"user",null);this.loadStoredTokens()}loadStoredTokens(){try{const n=localStorage.getItem("access_token"),i=localStorage.getItem("refresh_token"),l=localStorage.getItem("token_expiry"),o=localStorage.getItem("auth_user");if(n&&i&&l&&o){const d=new Date(l);d>new Date?(this.accessToken=n,this.refreshToken=i,this.tokenExpiry=d,this.user=JSON.parse(o),this.scheduleTokenRefresh(),console.log("✅ Restored valid tokens from localStorage")):(console.log("⏰ Stored tokens expired, attempting refresh..."),this.refreshToken=i,this.refreshAccessToken())}}catch(n){console.error("Error loading stored tokens:",n),this.clearStoredTokens()}}async login(n,i){try{console.log("🔐 Attempting login with JWT authentication...");const l=await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({username:n,password:i})});if(l.ok){const o=await l.json(),d={username:o.username,full_name:o.full_name,email:o.email,profile_image:o.profile_image,role:o.role};return this.setTokens({access_token:o.access_token,refresh_token:o.refresh_token,token_type:o.token_type,expires_in:o.expires_in},d),console.log("✅ Login successful with JWT tokens"),console.log(`   Access token expires in: ${o.expires_in} seconds`),!0}else return console.error("❌ Login failed:",l.status,l.statusText),!1}catch(l){return console.error("❌ Login error:",l),!1}}setTokens(n,i){this.accessToken=n.access_token,this.refreshToken=n.refresh_token,this.tokenExpiry=new Date(Date.now()+n.expires_in*1e3),i&&(this.user=i),localStorage.setItem("access_token",this.accessToken),localStorage.setItem("refresh_token",this.refreshToken),localStorage.setItem("token_expiry",this.tokenExpiry.toISOString()),this.user&&localStorage.setItem("auth_user",JSON.stringify(this.user)),this.scheduleTokenRefresh()}async refreshAccessToken(){if(!this.refreshToken)return console.warn("⚠️ No refresh token available"),!1;try{console.log("🔄 Refreshing access token...");const n=await fetch("/api/refresh",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.refreshToken}`},body:JSON.stringify({refresh_token:this.refreshToken})});if(n.ok){const i=await n.json();return this.accessToken=i.access_token,this.tokenExpiry=new Date(Date.now()+i.expires_in*1e3),this.accessToken&&localStorage.setItem("access_token",this.accessToken),this.tokenExpiry&&localStorage.setItem("token_expiry",this.tokenExpiry.toISOString()),this.scheduleTokenRefresh(),console.log("✅ Token refresh successful"),console.log(`   New token expires in: ${i.expires_in} seconds`),!0}else return console.error("❌ Token refresh failed:",n.status,n.statusText),this.logout(),!1}catch(n){return console.error("❌ Token refresh error:",n),this.logout(),!1}}scheduleTokenRefresh(){if(this.refreshTimer&&clearTimeout(this.refreshTimer),this.tokenExpiry){const n=this.tokenExpiry.getTime()-Date.now()-3e5;n>0?(this.refreshTimer=setTimeout(()=>{console.log("⏰ Automatic token refresh triggered"),this.refreshAccessToken()},n),console.log(`⏰ Token refresh scheduled in ${Math.round(n/1e3)} seconds`)):(console.log("⚠️ Token expires soon, refreshing immediately"),this.refreshAccessToken())}}getAccessToken(){return this.tokenExpiry&&new Date>=new Date(this.tokenExpiry.getTime()-6e4)&&(console.log("⚠️ Token expired or expires soon, triggering refresh"),this.refreshAccessToken()),this.accessToken}getUser(){return this.user}isAuthenticated(){return!!(this.accessToken&&this.tokenExpiry&&new Date<this.tokenExpiry)}logout(){console.log("🚪 Logging out..."),this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.accessToken&&fetch("/api/logout",{method:"POST",headers:{Authorization:`Bearer ${this.accessToken}`,"Content-Type":"application/json"}}).catch(n=>{console.warn("Logout API call failed (ignored):",n)}),this.accessToken=null,this.refreshToken=null,this.tokenExpiry=null,this.user=null,this.clearStoredTokens(),console.log("✅ Logout complete")}clearStoredTokens(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token"),localStorage.removeItem("token_expiry"),localStorage.removeItem("auth_user"),localStorage.removeItem("auth_token")}getAuthHeader(){const n=this.getAccessToken();return n?{Authorization:`Bearer ${n}`}:{}}async makeAuthenticatedRequest(n,i={}){const l=this.getAccessToken(),o={"Content-Type":"application/json",...i.headers,...l?{Authorization:`Bearer ${l}`}:{}},d=await fetch(n,{...i,headers:o});if(d.status===401&&l){if(console.log("🔄 Received 401, attempting token refresh..."),await this.refreshAccessToken()){const h=this.getAccessToken();if(h){const g={...o,Authorization:`Bearer ${h}`};return fetch(n,{...i,headers:g})}}console.log("🚪 Token refresh failed, redirecting to login"),this.logout(),window.location.href="/login"}return d}}const na=new iT,zv=x.createContext({token:null,user:null,isAuthenticated:!1,isLoading:!0,login:async()=>!1,logout:()=>{},showLoginSuccess:!1,setShowLoginSuccess:()=>{},refreshToken:async()=>!1,getAuthHeader:()=>({})}),vl=()=>x.useContext(zv),oT=({children:r})=>{const[n,i]=x.useState({token:null,user:null,isAuthenticated:!1,isLoading:!0}),[l,o]=x.useState(!1);x.useEffect(()=>{(()=>{const y=na.getAccessToken(),b=na.getUser(),j=na.isAuthenticated();i({token:y,user:b,isAuthenticated:j,isLoading:!1})})()},[]);const d=async(p,y)=>{try{if(console.log("🔐 Attempting JWT login with:",{username:p}),await na.login(p,y)){const j=na.getAccessToken(),N=na.getUser();return i({token:j,user:N,isAuthenticated:!0,isLoading:!1}),o(!0),console.log("✅ Login successful with JWT tokens"),!0}else return console.error("❌ Login failed"),!1}catch(b){return console.error("❌ Login error:",b),!1}},f=()=>{console.log("🚪 Logging out..."),na.logout(),i({token:null,user:null,isAuthenticated:!1,isLoading:!1}),console.log("✅ Logout complete")},h=async()=>{const p=await na.refreshAccessToken();if(p){const y=na.getAccessToken(),b=na.getUser();i(j=>({...j,token:y,user:b,isAuthenticated:!0}))}return p},g=()=>na.getAuthHeader();return t.jsx(zv.Provider,{value:{...n,login:d,logout:f,refreshToken:h,getAuthHeader:g,showLoginSuccess:l,setShowLoginSuccess:o},children:r})};class cT{constructor(){Dt(this,"ws",null);Dt(this,"token",null);Dt(this,"url");Dt(this,"reconnectAttempts",0);Dt(this,"maxReconnectAttempts",10);Dt(this,"reconnectDelay",1e3);Dt(this,"maxReconnectDelay",3e4);Dt(this,"reconnectTimer",null);Dt(this,"isConnected",!1);Dt(this,"shouldReconnect",!0);Dt(this,"messageHandlers",[]);Dt(this,"connectionHandlers",[]);Dt(this,"errorHandlers",[]);Dt(this,"periodicReconnectTimer",null);Dt(this,"reconnectIntervalMs",5*60*1e3);Dt(this,"_manualReconnectInProgress",!1);const n=window.location.protocol==="https:"?"wss:":"ws:";let i;i=window.location.host,this.url=`${n}//${i}/api/ws`,console.log("WebSocket URL configured as:",this.url)}setReconnectInterval(n){this.reconnectIntervalMs=n*60*1e3,console.log(`🔄 Periodic reconnect interval set to ${n} minutes`),this.clearPeriodicReconnectTimer(),this.isConnected&&this.startPeriodicReconnectTimer()}startPeriodicReconnectTimer(){this.clearPeriodicReconnectTimer(),console.log(`🕒 Starting periodic reconnect timer: ${this.reconnectIntervalMs/6e4} minutes`),this.periodicReconnectTimer=setTimeout(async()=>{this.isConnected&&(console.log("🔄 Performing periodic WebSocket reconnect..."),await this.disconnectForReconnect(),setTimeout(()=>{this.token?(console.log("🔄 Reconnecting WebSocket after periodic disconnect..."),this.connect(this.token).catch(n=>{console.error("❌ Error during periodic reconnect:",n)})):console.error("❌ Cannot reconnect: No authentication token available")},1e3))},this.reconnectIntervalMs)}clearPeriodicReconnectTimer(){this.periodicReconnectTimer&&(clearTimeout(this.periodicReconnectTimer),this.periodicReconnectTimer=null)}async connect(n){return this.ws&&this.ws.readyState===WebSocket.OPEN?(console.log("🔗 WebSocket already connected"),!0):!n||n.split(".").length!==3?(console.error("❌ Invalid JWT token format for WebSocket connection"),!1):(this.token=n,this.shouldReconnect=!0,this._manualReconnectInProgress=!1,new Promise(i=>{try{console.log(`🔄 Attempting to connect to WebSocket: ${this.url}`),this.ws=new WebSocket(this.url),console.log(`🔌 Connecting to WebSocket at: ${this.url}`),console.log(`🔍 WebSocket details:
          - URL: ${this.url}
          - Protocol: ${window.location.protocol}
          - Host: ${window.location.host}
          - Origin: ${window.location.origin}
        `),this.ws.onopen=async()=>{console.log("🔌 WebSocket connection opened to:",this.url),this.ws&&(console.log("🔢 WebSocket ready state:",this.ws.readyState),console.log("📊 Connection details:",{protocol:this.ws.protocol||"none",extensions:this.ws.extensions||"none",bufferedAmount:this.ws.bufferedAmount}));const l=()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const d={type:"auth",token:this.token};console.log("🔐 Sending authentication message..."),this.ws.send(JSON.stringify(d))}else setTimeout(l,10)};l();const o=d=>{try{const f=JSON.parse(d.data);console.log("📥 Received WebSocket message:",f),f.type==="auth_success"?(console.log("🔓 WebSocket authentication successful"),console.log("👤 Authenticated as:",f.username),this.isConnected=!0,this.reconnectAttempts=0,this.reconnectDelay=1e3,this.notifyConnectionHandlers(!0),this.startPeriodicReconnectTimer(),i(!0)):f.type==="auth_error"&&(console.error("🔒 WebSocket authentication failed:",f.message),console.error("🔍 Auth error details:",f),this.ws.close(),i(!1)),this.ws.removeEventListener("message",o)}catch(f){console.error("Error parsing auth response:",f),i(!1)}};this.ws.addEventListener("message",o)},this.ws.onmessage=l=>{try{const o=JSON.parse(l.data);this.notifyMessageHandlers(o)}catch(o){console.error("Error parsing WebSocket message:",o)}},this.ws.onclose=l=>{console.log("🔌 WebSocket connection closed:",l.code,l.reason),this.isConnected=!1,this.notifyConnectionHandlers(!1),this.shouldReconnect&&!this._manualReconnectInProgress?(console.log("🔄 Scheduling reconnection..."),this.scheduleReconnect()):this._manualReconnectInProgress?console.log("🛑 Manual reconnect in progress, skipping automatic reconnect"):console.log("🛑 Reconnection disabled, staying disconnected"),this.isConnected||i(!1)},this.ws.onerror=l=>{console.error("❌ WebSocket error:",l),console.error("❌ WebSocket error details:",{url:this.url,readyState:this.ws?this.ws.readyState:"undefined",protocol:window.location.protocol,host:window.location.host,origin:window.location.origin}),this.url.includes("localhost")&&(console.log("🔎 Troubleshooting tips:"),console.log("  1. Confirm backend server is running on the correct port"),console.log("  2. Check CORS settings in backend server"),console.log("  3. Verify WebSocket endpoint is properly registered")),this.notifyErrorHandlers(l),this.shouldReconnect&&console.log("🔄 Will attempt to reconnect after WebSocket error"),this.isConnected||i(!1)}}catch(l){console.error("Error creating WebSocket connection:",l),i(!1)}}))}send(n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("📤 Cannot send message: WebSocket not connected");return}const i=na.getAccessToken();if(!i){console.error("❌ No valid access token available for WebSocket message");return}const l={...n,token:i};try{this.ws.send(JSON.stringify(l)),console.log("📤 Sent WebSocket message:",{...n,token:"[JWT_HIDDEN]"})}catch(o){console.error("❌ Error sending WebSocket message:",o)}}async disconnect(){if(console.log("🔌 Disconnecting WebSocket"),this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearPeriodicReconnectTimer(),!this.ws){console.log("No active WebSocket connection to disconnect");return}return new Promise(n=>{this.ws&&this.ws.readyState===WebSocket.OPEN?(this.ws.onclose=()=>{console.log("WebSocket disconnected by user"),this.isConnected=!1,this.notifyConnectionHandlers(!1),n()},this.ws.close()):(console.log("WebSocket already disconnected"),this.isConnected=!1,this.notifyConnectionHandlers(!1),n())})}async disconnectForReconnect(){if(console.log("🔄 Temporarily disconnecting WebSocket for reconnect"),this._manualReconnectInProgress=!0,!this.ws){console.log("No active WebSocket connection to temporarily disconnect"),this._manualReconnectInProgress=!1;return}if(await new Promise(n=>{this.ws&&this.ws.readyState===WebSocket.OPEN?(this.ws.onclose=()=>{console.log("WebSocket temporarily disconnected for reconnect"),this.isConnected=!1,this.notifyConnectionHandlers(!1),n()},this.ws.close()):(console.log("WebSocket already disconnected"),this.isConnected=!1,this.notifyConnectionHandlers(!1),n())}),await new Promise(n=>setTimeout(n,1e3)),this._manualReconnectInProgress=!1,this.token){console.log("🔄 Reconnecting after manual periodic disconnect...");try{await this.connect(this.token),console.log("✅ Manual reconnect successful")}catch(n){console.error("❌ Error during manual reconnect:",n)}}else console.error("❌ Cannot reconnect: No authentication token available")}ping(){this.send({type:"ping",token:this.token,timestamp:new Date().toISOString()})}echo(n){this.send({type:"echo",token:this.token,message:n})}broadcast(n){this.send({type:"broadcast",token:this.token,message:n,timestamp:new Date().toISOString()})}getStatus(){this.send({type:"get_status",token:this.token})}get connected(){return this.isConnected}onMessage(n){this.messageHandlers.push(n)}offMessage(n){const i=this.messageHandlers.indexOf(n);i>-1&&this.messageHandlers.splice(i,1)}onConnection(n){this.connectionHandlers.push(n)}offConnection(n){const i=this.connectionHandlers.indexOf(n);i>-1&&this.connectionHandlers.splice(i,1)}onError(n){this.errorHandlers.push(n)}offError(n){const i=this.errorHandlers.indexOf(n);i>-1&&this.errorHandlers.splice(i,1)}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.error("Max reconnection attempts reached");return}this.reconnectAttempts++;const n=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay),i=Math.random()*1e3,l=n+i;console.log(`⏰ Scheduling reconnection attempt ${this.reconnectAttempts} in ${Math.round(l)}ms`),this.reconnectTimer=setTimeout(async()=>{if(this.shouldReconnect&&this.token&&!this._manualReconnectInProgress){console.log(`🔄 Reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts}`);const o=await this.connect(this.token);console.log(o?"✅ Reconnection successful!":"❌ Reconnection failed, will try again")}else this._manualReconnectInProgress?console.log("🛑 Reconnection suppressed: manual reconnect in progress"):console.log("🛑 Reconnection cancelled (shouldReconnect=false or no token)")},l)}notifyMessageHandlers(n){this.messageHandlers.forEach(i=>{try{i(n)}catch(l){console.error("Error in message handler:",l)}})}notifyConnectionHandlers(n){this.connectionHandlers.forEach(i=>{try{i(n)}catch(l){console.error("Error in connection handler:",l)}})}notifyErrorHandlers(n){this.errorHandlers.forEach(i=>{try{i(n)}catch(l){console.error("Error in error handler:",l)}})}}const xa=new cT,Lv=x.createContext({isConnected:!1,isConnecting:!1,lastMessage:null,connectionAttempts:0,sendMessage:()=>{},ping:()=>{},echo:()=>{},broadcast:()=>{},getStatus:()=>{}}),dT=()=>x.useContext(Lv),uT=({children:r})=>{const{token:n,isAuthenticated:i}=vl(),[l,o]=x.useState({isConnected:!1,isConnecting:!1,lastMessage:null,connectionAttempts:0});x.useEffect(()=>(i&&n?(console.log("User authenticated, connecting to WebSocket..."),d(n)):(console.log("User not authenticated, disconnecting WebSocket..."),f()),()=>{f()}),[i,n]);const d=async j=>{if(l.isConnecting||l.isConnected){console.log("WebSocket already connecting or connected");return}o(N=>({...N,isConnecting:!0,connectionAttempts:N.connectionAttempts+1}));try{await xa.connect(j)?console.log("WebSocket connected successfully"):(console.error("Failed to connect to WebSocket"),o(w=>({...w,isConnecting:!1})))}catch(N){console.error("Error connecting to WebSocket:",N),o(w=>({...w,isConnecting:!1}))}},f=()=>{xa.disconnect(),o(j=>({...j,isConnected:!1,isConnecting:!1,lastMessage:null}))};x.useEffect(()=>{const j=S=>{console.log("WebSocket message received:",S),o(E=>({...E,lastMessage:S}))},N=S=>{console.log("WebSocket connection status changed:",S),o(E=>({...E,isConnected:S,isConnecting:!1}))},w=S=>{console.error("WebSocket error:",S),o(E=>({...E,isConnecting:!1}))};return xa.onMessage(j),xa.onConnection(N),xa.onError(w),()=>{xa.offMessage(j),xa.offConnection(N),xa.offError(w)}},[]);const h=j=>{xa.send(j)},g=()=>{xa.send({type:"ping",timestamp:new Date().toISOString()})},p=j=>{xa.send({type:"echo",message:j})},y=j=>{xa.send({type:"broadcast",message:j,timestamp:new Date().toISOString()})},b=()=>{xa.send({type:"get_status"})};return t.jsx(Lv.Provider,{value:{...l,sendMessage:h,ping:g,echo:p,broadcast:y,getStatus:b},children:r})};function Uv(r,n){return function(){return r.apply(n,arguments)}}const{toString:fT}=Object.prototype,{getPrototypeOf:ep}=Object,{iterator:rd,toStringTag:Gv}=Symbol,nd=(r=>n=>{const i=fT.call(n);return r[i]||(r[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),lr=r=>(r=r.toLowerCase(),n=>nd(n)===r),sd=r=>n=>typeof n===r,{isArray:jl}=Array,Ui=sd("undefined");function hT(r){return r!==null&&!Ui(r)&&r.constructor!==null&&!Ui(r.constructor)&&ka(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Fv=lr("ArrayBuffer");function pT(r){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(r):n=r&&r.buffer&&Fv(r.buffer),n}const mT=sd("string"),ka=sd("function"),Bv=sd("number"),ld=r=>r!==null&&typeof r=="object",gT=r=>r===!0||r===!1,jc=r=>{if(nd(r)!=="object")return!1;const n=ep(r);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Gv in r)&&!(rd in r)},xT=lr("Date"),yT=lr("File"),bT=lr("Blob"),vT=lr("FileList"),jT=r=>ld(r)&&ka(r.pipe),wT=r=>{let n;return r&&(typeof FormData=="function"&&r instanceof FormData||ka(r.append)&&((n=nd(r))==="formdata"||n==="object"&&ka(r.toString)&&r.toString()==="[object FormData]"))},NT=lr("URLSearchParams"),[kT,ST,_T,TT]=["ReadableStream","Request","Response","Headers"].map(lr),CT=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zi(r,n,{allOwnKeys:i=!1}={}){if(r===null||typeof r>"u")return;let l,o;if(typeof r!="object"&&(r=[r]),jl(r))for(l=0,o=r.length;l<o;l++)n.call(null,r[l],l,r);else{const d=i?Object.getOwnPropertyNames(r):Object.keys(r),f=d.length;let h;for(l=0;l<f;l++)h=d[l],n.call(null,r[h],h,r)}}function Iv(r,n){n=n.toLowerCase();const i=Object.keys(r);let l=i.length,o;for(;l-- >0;)if(o=i[l],n===o.toLowerCase())return o;return null}const rs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hv=r=>!Ui(r)&&r!==rs;function hh(){const{caseless:r}=Hv(this)&&this||{},n={},i=(l,o)=>{const d=r&&Iv(n,o)||o;jc(n[d])&&jc(l)?n[d]=hh(n[d],l):jc(l)?n[d]=hh({},l):jl(l)?n[d]=l.slice():n[d]=l};for(let l=0,o=arguments.length;l<o;l++)arguments[l]&&Zi(arguments[l],i);return n}const ET=(r,n,i,{allOwnKeys:l}={})=>(Zi(n,(o,d)=>{i&&ka(o)?r[d]=Uv(o,i):r[d]=o},{allOwnKeys:l}),r),RT=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),AT=(r,n,i,l)=>{r.prototype=Object.create(n.prototype,l),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:n.prototype}),i&&Object.assign(r.prototype,i)},DT=(r,n,i,l)=>{let o,d,f;const h={};if(n=n||{},r==null)return n;do{for(o=Object.getOwnPropertyNames(r),d=o.length;d-- >0;)f=o[d],(!l||l(f,r,n))&&!h[f]&&(n[f]=r[f],h[f]=!0);r=i!==!1&&ep(r)}while(r&&(!i||i(r,n))&&r!==Object.prototype);return n},MT=(r,n,i)=>{r=String(r),(i===void 0||i>r.length)&&(i=r.length),i-=n.length;const l=r.indexOf(n,i);return l!==-1&&l===i},OT=r=>{if(!r)return null;if(jl(r))return r;let n=r.length;if(!Bv(n))return null;const i=new Array(n);for(;n-- >0;)i[n]=r[n];return i},zT=(r=>n=>r&&n instanceof r)(typeof Uint8Array<"u"&&ep(Uint8Array)),LT=(r,n)=>{const l=(r&&r[rd]).call(r);let o;for(;(o=l.next())&&!o.done;){const d=o.value;n.call(r,d[0],d[1])}},UT=(r,n)=>{let i;const l=[];for(;(i=r.exec(n))!==null;)l.push(i);return l},GT=lr("HTMLFormElement"),FT=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,l,o){return l.toUpperCase()+o}),ey=(({hasOwnProperty:r})=>(n,i)=>r.call(n,i))(Object.prototype),BT=lr("RegExp"),Pv=(r,n)=>{const i=Object.getOwnPropertyDescriptors(r),l={};Zi(i,(o,d)=>{let f;(f=n(o,d,r))!==!1&&(l[d]=f||o)}),Object.defineProperties(r,l)},IT=r=>{Pv(r,(n,i)=>{if(ka(r)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const l=r[i];if(ka(l)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},HT=(r,n)=>{const i={},l=o=>{o.forEach(d=>{i[d]=!0})};return jl(r)?l(r):l(String(r).split(n)),i},PT=()=>{},qT=(r,n)=>r!=null&&Number.isFinite(r=+r)?r:n;function $T(r){return!!(r&&ka(r.append)&&r[Gv]==="FormData"&&r[rd])}const ZT=r=>{const n=new Array(10),i=(l,o)=>{if(ld(l)){if(n.indexOf(l)>=0)return;if(!("toJSON"in l)){n[o]=l;const d=jl(l)?[]:{};return Zi(l,(f,h)=>{const g=i(f,o+1);!Ui(g)&&(d[h]=g)}),n[o]=void 0,d}}return l};return i(r,0)},VT=lr("AsyncFunction"),KT=r=>r&&(ld(r)||ka(r))&&ka(r.then)&&ka(r.catch),qv=((r,n)=>r?setImmediate:n?((i,l)=>(rs.addEventListener("message",({source:o,data:d})=>{o===rs&&d===i&&l.length&&l.shift()()},!1),o=>{l.push(o),rs.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",ka(rs.postMessage)),YT=typeof queueMicrotask<"u"?queueMicrotask.bind(rs):typeof process<"u"&&process.nextTick||qv,XT=r=>r!=null&&ka(r[rd]),ne={isArray:jl,isArrayBuffer:Fv,isBuffer:hT,isFormData:wT,isArrayBufferView:pT,isString:mT,isNumber:Bv,isBoolean:gT,isObject:ld,isPlainObject:jc,isReadableStream:kT,isRequest:ST,isResponse:_T,isHeaders:TT,isUndefined:Ui,isDate:xT,isFile:yT,isBlob:bT,isRegExp:BT,isFunction:ka,isStream:jT,isURLSearchParams:NT,isTypedArray:zT,isFileList:vT,forEach:Zi,merge:hh,extend:ET,trim:CT,stripBOM:RT,inherits:AT,toFlatObject:DT,kindOf:nd,kindOfTest:lr,endsWith:MT,toArray:OT,forEachEntry:LT,matchAll:UT,isHTMLForm:GT,hasOwnProperty:ey,hasOwnProp:ey,reduceDescriptors:Pv,freezeMethods:IT,toObjectSet:HT,toCamelCase:FT,noop:PT,toFiniteNumber:qT,findKey:Iv,global:rs,isContextDefined:Hv,isSpecCompliantForm:$T,toJSONObject:ZT,isAsyncFn:VT,isThenable:KT,setImmediate:qv,asap:YT,isIterable:XT};function Pe(r,n,i,l,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",n&&(this.code=n),i&&(this.config=i),l&&(this.request=l),o&&(this.response=o,this.status=o.status?o.status:null)}ne.inherits(Pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ne.toJSONObject(this.config),code:this.code,status:this.status}}});const $v=Pe.prototype,Zv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Zv[r]={value:r}});Object.defineProperties(Pe,Zv);Object.defineProperty($v,"isAxiosError",{value:!0});Pe.from=(r,n,i,l,o,d)=>{const f=Object.create($v);return ne.toFlatObject(r,f,function(g){return g!==Error.prototype},h=>h!=="isAxiosError"),Pe.call(f,r.message,n,i,l,o),f.cause=r,f.name=r.name,d&&Object.assign(f,d),f};const QT=null;function ph(r){return ne.isPlainObject(r)||ne.isArray(r)}function Vv(r){return ne.endsWith(r,"[]")?r.slice(0,-2):r}function ty(r,n,i){return r?r.concat(n).map(function(o,d){return o=Vv(o),!i&&d?"["+o+"]":o}).join(i?".":""):n}function WT(r){return ne.isArray(r)&&!r.some(ph)}const JT=ne.toFlatObject(ne,{},null,function(n){return/^is[A-Z]/.test(n)});function id(r,n,i){if(!ne.isObject(r))throw new TypeError("target must be an object");n=n||new FormData,i=ne.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,E){return!ne.isUndefined(E[S])});const l=i.metaTokens,o=i.visitor||y,d=i.dots,f=i.indexes,g=(i.Blob||typeof Blob<"u"&&Blob)&&ne.isSpecCompliantForm(n);if(!ne.isFunction(o))throw new TypeError("visitor must be a function");function p(w){if(w===null)return"";if(ne.isDate(w))return w.toISOString();if(ne.isBoolean(w))return w.toString();if(!g&&ne.isBlob(w))throw new Pe("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(w)||ne.isTypedArray(w)?g&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function y(w,S,E){let k=w;if(w&&!E&&typeof w=="object"){if(ne.endsWith(S,"{}"))S=l?S:S.slice(0,-2),w=JSON.stringify(w);else if(ne.isArray(w)&&WT(w)||(ne.isFileList(w)||ne.endsWith(S,"[]"))&&(k=ne.toArray(w)))return S=Vv(S),k.forEach(function(O,L){!(ne.isUndefined(O)||O===null)&&n.append(f===!0?ty([S],L,d):f===null?S:S+"[]",p(O))}),!1}return ph(w)?!0:(n.append(ty(E,S,d),p(w)),!1)}const b=[],j=Object.assign(JT,{defaultVisitor:y,convertValue:p,isVisitable:ph});function N(w,S){if(!ne.isUndefined(w)){if(b.indexOf(w)!==-1)throw Error("Circular reference detected in "+S.join("."));b.push(w),ne.forEach(w,function(k,A){(!(ne.isUndefined(k)||k===null)&&o.call(n,k,ne.isString(A)?A.trim():A,S,j))===!0&&N(k,S?S.concat(A):[A])}),b.pop()}}if(!ne.isObject(r))throw new TypeError("data must be an object");return N(r),n}function ay(r){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(l){return n[l]})}function tp(r,n){this._pairs=[],r&&id(r,this,n)}const Kv=tp.prototype;Kv.append=function(n,i){this._pairs.push([n,i])};Kv.toString=function(n){const i=n?function(l){return n.call(this,l,ay)}:ay;return this._pairs.map(function(o){return i(o[0])+"="+i(o[1])},"").join("&")};function eC(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yv(r,n,i){if(!n)return r;const l=i&&i.encode||eC;ne.isFunction(i)&&(i={serialize:i});const o=i&&i.serialize;let d;if(o?d=o(n,i):d=ne.isURLSearchParams(n)?n.toString():new tp(n,i).toString(l),d){const f=r.indexOf("#");f!==-1&&(r=r.slice(0,f)),r+=(r.indexOf("?")===-1?"?":"&")+d}return r}class ry{constructor(){this.handlers=[]}use(n,i,l){return this.handlers.push({fulfilled:n,rejected:i,synchronous:l?l.synchronous:!1,runWhen:l?l.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){ne.forEach(this.handlers,function(l){l!==null&&n(l)})}}const Xv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tC=typeof URLSearchParams<"u"?URLSearchParams:tp,aC=typeof FormData<"u"?FormData:null,rC=typeof Blob<"u"?Blob:null,nC={isBrowser:!0,classes:{URLSearchParams:tC,FormData:aC,Blob:rC},protocols:["http","https","file","blob","url","data"]},ap=typeof window<"u"&&typeof document<"u",mh=typeof navigator=="object"&&navigator||void 0,sC=ap&&(!mh||["ReactNative","NativeScript","NS"].indexOf(mh.product)<0),lC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iC=ap&&window.location.href||"http://localhost",oC=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ap,hasStandardBrowserEnv:sC,hasStandardBrowserWebWorkerEnv:lC,navigator:mh,origin:iC},Symbol.toStringTag,{value:"Module"})),ma={...oC,...nC};function cC(r,n){return id(r,new ma.classes.URLSearchParams,Object.assign({visitor:function(i,l,o,d){return ma.isNode&&ne.isBuffer(i)?(this.append(l,i.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},n))}function dC(r){return ne.matchAll(/\w+|\[(\w*)]/g,r).map(n=>n[0]==="[]"?"":n[1]||n[0])}function uC(r){const n={},i=Object.keys(r);let l;const o=i.length;let d;for(l=0;l<o;l++)d=i[l],n[d]=r[d];return n}function Qv(r){function n(i,l,o,d){let f=i[d++];if(f==="__proto__")return!0;const h=Number.isFinite(+f),g=d>=i.length;return f=!f&&ne.isArray(o)?o.length:f,g?(ne.hasOwnProp(o,f)?o[f]=[o[f],l]:o[f]=l,!h):((!o[f]||!ne.isObject(o[f]))&&(o[f]=[]),n(i,l,o[f],d)&&ne.isArray(o[f])&&(o[f]=uC(o[f])),!h)}if(ne.isFormData(r)&&ne.isFunction(r.entries)){const i={};return ne.forEachEntry(r,(l,o)=>{n(dC(l),o,i,0)}),i}return null}function fC(r,n,i){if(ne.isString(r))try{return(n||JSON.parse)(r),ne.trim(r)}catch(l){if(l.name!=="SyntaxError")throw l}return(i||JSON.stringify)(r)}const Vi={transitional:Xv,adapter:["xhr","http","fetch"],transformRequest:[function(n,i){const l=i.getContentType()||"",o=l.indexOf("application/json")>-1,d=ne.isObject(n);if(d&&ne.isHTMLForm(n)&&(n=new FormData(n)),ne.isFormData(n))return o?JSON.stringify(Qv(n)):n;if(ne.isArrayBuffer(n)||ne.isBuffer(n)||ne.isStream(n)||ne.isFile(n)||ne.isBlob(n)||ne.isReadableStream(n))return n;if(ne.isArrayBufferView(n))return n.buffer;if(ne.isURLSearchParams(n))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let h;if(d){if(l.indexOf("application/x-www-form-urlencoded")>-1)return cC(n,this.formSerializer).toString();if((h=ne.isFileList(n))||l.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return id(h?{"files[]":n}:n,g&&new g,this.formSerializer)}}return d||o?(i.setContentType("application/json",!1),fC(n)):n}],transformResponse:[function(n){const i=this.transitional||Vi.transitional,l=i&&i.forcedJSONParsing,o=this.responseType==="json";if(ne.isResponse(n)||ne.isReadableStream(n))return n;if(n&&ne.isString(n)&&(l&&!this.responseType||o)){const f=!(i&&i.silentJSONParsing)&&o;try{return JSON.parse(n)}catch(h){if(f)throw h.name==="SyntaxError"?Pe.from(h,Pe.ERR_BAD_RESPONSE,this,null,this.response):h}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ma.classes.FormData,Blob:ma.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],r=>{Vi.headers[r]={}});const hC=ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pC=r=>{const n={};let i,l,o;return r&&r.split(`
`).forEach(function(f){o=f.indexOf(":"),i=f.substring(0,o).trim().toLowerCase(),l=f.substring(o+1).trim(),!(!i||n[i]&&hC[i])&&(i==="set-cookie"?n[i]?n[i].push(l):n[i]=[l]:n[i]=n[i]?n[i]+", "+l:l)}),n},ny=Symbol("internals");function _i(r){return r&&String(r).trim().toLowerCase()}function wc(r){return r===!1||r==null?r:ne.isArray(r)?r.map(wc):String(r)}function mC(r){const n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let l;for(;l=i.exec(r);)n[l[1]]=l[2];return n}const gC=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function $f(r,n,i,l,o){if(ne.isFunction(l))return l.call(this,n,i);if(o&&(n=i),!!ne.isString(n)){if(ne.isString(l))return n.indexOf(l)!==-1;if(ne.isRegExp(l))return l.test(n)}}function xC(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,i,l)=>i.toUpperCase()+l)}function yC(r,n){const i=ne.toCamelCase(" "+n);["get","set","has"].forEach(l=>{Object.defineProperty(r,l+i,{value:function(o,d,f){return this[l].call(this,n,o,d,f)},configurable:!0})})}let Sa=class{constructor(n){n&&this.set(n)}set(n,i,l){const o=this;function d(h,g,p){const y=_i(g);if(!y)throw new Error("header name must be a non-empty string");const b=ne.findKey(o,y);(!b||o[b]===void 0||p===!0||p===void 0&&o[b]!==!1)&&(o[b||g]=wc(h))}const f=(h,g)=>ne.forEach(h,(p,y)=>d(p,y,g));if(ne.isPlainObject(n)||n instanceof this.constructor)f(n,i);else if(ne.isString(n)&&(n=n.trim())&&!gC(n))f(pC(n),i);else if(ne.isObject(n)&&ne.isIterable(n)){let h={},g,p;for(const y of n){if(!ne.isArray(y))throw TypeError("Object iterator must return a key-value pair");h[p=y[0]]=(g=h[p])?ne.isArray(g)?[...g,y[1]]:[g,y[1]]:y[1]}f(h,i)}else n!=null&&d(i,n,l);return this}get(n,i){if(n=_i(n),n){const l=ne.findKey(this,n);if(l){const o=this[l];if(!i)return o;if(i===!0)return mC(o);if(ne.isFunction(i))return i.call(this,o,l);if(ne.isRegExp(i))return i.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,i){if(n=_i(n),n){const l=ne.findKey(this,n);return!!(l&&this[l]!==void 0&&(!i||$f(this,this[l],l,i)))}return!1}delete(n,i){const l=this;let o=!1;function d(f){if(f=_i(f),f){const h=ne.findKey(l,f);h&&(!i||$f(l,l[h],h,i))&&(delete l[h],o=!0)}}return ne.isArray(n)?n.forEach(d):d(n),o}clear(n){const i=Object.keys(this);let l=i.length,o=!1;for(;l--;){const d=i[l];(!n||$f(this,this[d],d,n,!0))&&(delete this[d],o=!0)}return o}normalize(n){const i=this,l={};return ne.forEach(this,(o,d)=>{const f=ne.findKey(l,d);if(f){i[f]=wc(o),delete i[d];return}const h=n?xC(d):String(d).trim();h!==d&&delete i[d],i[h]=wc(o),l[h]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const i=Object.create(null);return ne.forEach(this,(l,o)=>{l!=null&&l!==!1&&(i[o]=n&&ne.isArray(l)?l.join(", "):l)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,i])=>n+": "+i).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...i){const l=new this(n);return i.forEach(o=>l.set(o)),l}static accessor(n){const l=(this[ny]=this[ny]={accessors:{}}).accessors,o=this.prototype;function d(f){const h=_i(f);l[h]||(yC(o,f),l[h]=!0)}return ne.isArray(n)?n.forEach(d):d(n),this}};Sa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ne.reduceDescriptors(Sa.prototype,({value:r},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>r,set(l){this[i]=l}}});ne.freezeMethods(Sa);function Zf(r,n){const i=this||Vi,l=n||i,o=Sa.from(l.headers);let d=l.data;return ne.forEach(r,function(h){d=h.call(i,d,o.normalize(),n?n.status:void 0)}),o.normalize(),d}function Wv(r){return!!(r&&r.__CANCEL__)}function wl(r,n,i){Pe.call(this,r??"canceled",Pe.ERR_CANCELED,n,i),this.name="CanceledError"}ne.inherits(wl,Pe,{__CANCEL__:!0});function Jv(r,n,i){const l=i.config.validateStatus;!i.status||!l||l(i.status)?r(i):n(new Pe("Request failed with status code "+i.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function bC(r){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return n&&n[1]||""}function vC(r,n){r=r||10;const i=new Array(r),l=new Array(r);let o=0,d=0,f;return n=n!==void 0?n:1e3,function(g){const p=Date.now(),y=l[d];f||(f=p),i[o]=g,l[o]=p;let b=d,j=0;for(;b!==o;)j+=i[b++],b=b%r;if(o=(o+1)%r,o===d&&(d=(d+1)%r),p-f<n)return;const N=y&&p-y;return N?Math.round(j*1e3/N):void 0}}function jC(r,n){let i=0,l=1e3/n,o,d;const f=(p,y=Date.now())=>{i=y,o=null,d&&(clearTimeout(d),d=null),r.apply(null,p)};return[(...p)=>{const y=Date.now(),b=y-i;b>=l?f(p,y):(o=p,d||(d=setTimeout(()=>{d=null,f(o)},l-b)))},()=>o&&f(o)]}const Lc=(r,n,i=3)=>{let l=0;const o=vC(50,250);return jC(d=>{const f=d.loaded,h=d.lengthComputable?d.total:void 0,g=f-l,p=o(g),y=f<=h;l=f;const b={loaded:f,total:h,progress:h?f/h:void 0,bytes:g,rate:p||void 0,estimated:p&&h&&y?(h-f)/p:void 0,event:d,lengthComputable:h!=null,[n?"download":"upload"]:!0};r(b)},i)},sy=(r,n)=>{const i=r!=null;return[l=>n[0]({lengthComputable:i,total:r,loaded:l}),n[1]]},ly=r=>(...n)=>ne.asap(()=>r(...n)),wC=ma.hasStandardBrowserEnv?((r,n)=>i=>(i=new URL(i,ma.origin),r.protocol===i.protocol&&r.host===i.host&&(n||r.port===i.port)))(new URL(ma.origin),ma.navigator&&/(msie|trident)/i.test(ma.navigator.userAgent)):()=>!0,NC=ma.hasStandardBrowserEnv?{write(r,n,i,l,o,d){const f=[r+"="+encodeURIComponent(n)];ne.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),ne.isString(l)&&f.push("path="+l),ne.isString(o)&&f.push("domain="+o),d===!0&&f.push("secure"),document.cookie=f.join("; ")},read(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function kC(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function SC(r,n){return n?r.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):r}function e1(r,n,i){let l=!kC(n);return r&&(l||i==!1)?SC(r,n):n}const iy=r=>r instanceof Sa?{...r}:r;function cs(r,n){n=n||{};const i={};function l(p,y,b,j){return ne.isPlainObject(p)&&ne.isPlainObject(y)?ne.merge.call({caseless:j},p,y):ne.isPlainObject(y)?ne.merge({},y):ne.isArray(y)?y.slice():y}function o(p,y,b,j){if(ne.isUndefined(y)){if(!ne.isUndefined(p))return l(void 0,p,b,j)}else return l(p,y,b,j)}function d(p,y){if(!ne.isUndefined(y))return l(void 0,y)}function f(p,y){if(ne.isUndefined(y)){if(!ne.isUndefined(p))return l(void 0,p)}else return l(void 0,y)}function h(p,y,b){if(b in n)return l(p,y);if(b in r)return l(void 0,p)}const g={url:d,method:d,data:d,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:h,headers:(p,y,b)=>o(iy(p),iy(y),b,!0)};return ne.forEach(Object.keys(Object.assign({},r,n)),function(y){const b=g[y]||o,j=b(r[y],n[y],y);ne.isUndefined(j)&&b!==h||(i[y]=j)}),i}const t1=r=>{const n=cs({},r);let{data:i,withXSRFToken:l,xsrfHeaderName:o,xsrfCookieName:d,headers:f,auth:h}=n;n.headers=f=Sa.from(f),n.url=Yv(e1(n.baseURL,n.url,n.allowAbsoluteUrls),r.params,r.paramsSerializer),h&&f.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):"")));let g;if(ne.isFormData(i)){if(ma.hasStandardBrowserEnv||ma.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((g=f.getContentType())!==!1){const[p,...y]=g?g.split(";").map(b=>b.trim()).filter(Boolean):[];f.setContentType([p||"multipart/form-data",...y].join("; "))}}if(ma.hasStandardBrowserEnv&&(l&&ne.isFunction(l)&&(l=l(n)),l||l!==!1&&wC(n.url))){const p=o&&d&&NC.read(d);p&&f.set(o,p)}return n},_C=typeof XMLHttpRequest<"u",TC=_C&&function(r){return new Promise(function(i,l){const o=t1(r);let d=o.data;const f=Sa.from(o.headers).normalize();let{responseType:h,onUploadProgress:g,onDownloadProgress:p}=o,y,b,j,N,w;function S(){N&&N(),w&&w(),o.cancelToken&&o.cancelToken.unsubscribe(y),o.signal&&o.signal.removeEventListener("abort",y)}let E=new XMLHttpRequest;E.open(o.method.toUpperCase(),o.url,!0),E.timeout=o.timeout;function k(){if(!E)return;const O=Sa.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),B={data:!h||h==="text"||h==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:O,config:r,request:E};Jv(function($){i($),S()},function($){l($),S()},B),E=null}"onloadend"in E?E.onloadend=k:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(k)},E.onabort=function(){E&&(l(new Pe("Request aborted",Pe.ECONNABORTED,r,E)),E=null)},E.onerror=function(){l(new Pe("Network Error",Pe.ERR_NETWORK,r,E)),E=null},E.ontimeout=function(){let L=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const B=o.transitional||Xv;o.timeoutErrorMessage&&(L=o.timeoutErrorMessage),l(new Pe(L,B.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,r,E)),E=null},d===void 0&&f.setContentType(null),"setRequestHeader"in E&&ne.forEach(f.toJSON(),function(L,B){E.setRequestHeader(B,L)}),ne.isUndefined(o.withCredentials)||(E.withCredentials=!!o.withCredentials),h&&h!=="json"&&(E.responseType=o.responseType),p&&([j,w]=Lc(p,!0),E.addEventListener("progress",j)),g&&E.upload&&([b,N]=Lc(g),E.upload.addEventListener("progress",b),E.upload.addEventListener("loadend",N)),(o.cancelToken||o.signal)&&(y=O=>{E&&(l(!O||O.type?new wl(null,r,E):O),E.abort(),E=null)},o.cancelToken&&o.cancelToken.subscribe(y),o.signal&&(o.signal.aborted?y():o.signal.addEventListener("abort",y)));const A=bC(o.url);if(A&&ma.protocols.indexOf(A)===-1){l(new Pe("Unsupported protocol "+A+":",Pe.ERR_BAD_REQUEST,r));return}E.send(d||null)})},CC=(r,n)=>{const{length:i}=r=r?r.filter(Boolean):[];if(n||i){let l=new AbortController,o;const d=function(p){if(!o){o=!0,h();const y=p instanceof Error?p:this.reason;l.abort(y instanceof Pe?y:new wl(y instanceof Error?y.message:y))}};let f=n&&setTimeout(()=>{f=null,d(new Pe(`timeout ${n} of ms exceeded`,Pe.ETIMEDOUT))},n);const h=()=>{r&&(f&&clearTimeout(f),f=null,r.forEach(p=>{p.unsubscribe?p.unsubscribe(d):p.removeEventListener("abort",d)}),r=null)};r.forEach(p=>p.addEventListener("abort",d));const{signal:g}=l;return g.unsubscribe=()=>ne.asap(h),g}},EC=function*(r,n){let i=r.byteLength;if(i<n){yield r;return}let l=0,o;for(;l<i;)o=l+n,yield r.slice(l,o),l=o},RC=async function*(r,n){for await(const i of AC(r))yield*EC(i,n)},AC=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const n=r.getReader();try{for(;;){const{done:i,value:l}=await n.read();if(i)break;yield l}}finally{await n.cancel()}},oy=(r,n,i,l)=>{const o=RC(r,n);let d=0,f,h=g=>{f||(f=!0,l&&l(g))};return new ReadableStream({async pull(g){try{const{done:p,value:y}=await o.next();if(p){h(),g.close();return}let b=y.byteLength;if(i){let j=d+=b;i(j)}g.enqueue(new Uint8Array(y))}catch(p){throw h(p),p}},cancel(g){return h(g),o.return()}},{highWaterMark:2})},od=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",a1=od&&typeof ReadableStream=="function",DC=od&&(typeof TextEncoder=="function"?(r=>n=>r.encode(n))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),r1=(r,...n)=>{try{return!!r(...n)}catch{return!1}},MC=a1&&r1(()=>{let r=!1;const n=new Request(ma.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!n}),cy=64*1024,gh=a1&&r1(()=>ne.isReadableStream(new Response("").body)),Uc={stream:gh&&(r=>r.body)};od&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!Uc[n]&&(Uc[n]=ne.isFunction(r[n])?i=>i[n]():(i,l)=>{throw new Pe(`Response type '${n}' is not supported`,Pe.ERR_NOT_SUPPORT,l)})})})(new Response);const OC=async r=>{if(r==null)return 0;if(ne.isBlob(r))return r.size;if(ne.isSpecCompliantForm(r))return(await new Request(ma.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(ne.isArrayBufferView(r)||ne.isArrayBuffer(r))return r.byteLength;if(ne.isURLSearchParams(r)&&(r=r+""),ne.isString(r))return(await DC(r)).byteLength},zC=async(r,n)=>{const i=ne.toFiniteNumber(r.getContentLength());return i??OC(n)},LC=od&&(async r=>{let{url:n,method:i,data:l,signal:o,cancelToken:d,timeout:f,onDownloadProgress:h,onUploadProgress:g,responseType:p,headers:y,withCredentials:b="same-origin",fetchOptions:j}=t1(r);p=p?(p+"").toLowerCase():"text";let N=CC([o,d&&d.toAbortSignal()],f),w;const S=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let E;try{if(g&&MC&&i!=="get"&&i!=="head"&&(E=await zC(y,l))!==0){let B=new Request(n,{method:"POST",body:l,duplex:"half"}),V;if(ne.isFormData(l)&&(V=B.headers.get("content-type"))&&y.setContentType(V),B.body){const[$,le]=sy(E,Lc(ly(g)));l=oy(B.body,cy,$,le)}}ne.isString(b)||(b=b?"include":"omit");const k="credentials"in Request.prototype;w=new Request(n,{...j,signal:N,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:l,duplex:"half",credentials:k?b:void 0});let A=await fetch(w,j);const O=gh&&(p==="stream"||p==="response");if(gh&&(h||O&&S)){const B={};["status","statusText","headers"].forEach(q=>{B[q]=A[q]});const V=ne.toFiniteNumber(A.headers.get("content-length")),[$,le]=h&&sy(V,Lc(ly(h),!0))||[];A=new Response(oy(A.body,cy,$,()=>{le&&le(),S&&S()}),B)}p=p||"text";let L=await Uc[ne.findKey(Uc,p)||"text"](A,r);return!O&&S&&S(),await new Promise((B,V)=>{Jv(B,V,{data:L,headers:Sa.from(A.headers),status:A.status,statusText:A.statusText,config:r,request:w})})}catch(k){throw S&&S(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,r,w),{cause:k.cause||k}):Pe.from(k,k&&k.code,r,w)}}),xh={http:QT,xhr:TC,fetch:LC};ne.forEach(xh,(r,n)=>{if(r){try{Object.defineProperty(r,"name",{value:n})}catch{}Object.defineProperty(r,"adapterName",{value:n})}});const dy=r=>`- ${r}`,UC=r=>ne.isFunction(r)||r===null||r===!1,n1={getAdapter:r=>{r=ne.isArray(r)?r:[r];const{length:n}=r;let i,l;const o={};for(let d=0;d<n;d++){i=r[d];let f;if(l=i,!UC(i)&&(l=xh[(f=String(i)).toLowerCase()],l===void 0))throw new Pe(`Unknown adapter '${f}'`);if(l)break;o[f||"#"+d]=l}if(!l){const d=Object.entries(o).map(([h,g])=>`adapter ${h} `+(g===!1?"is not supported by the environment":"is not available in the build"));let f=n?d.length>1?`since :
`+d.map(dy).join(`
`):" "+dy(d[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return l},adapters:xh};function Vf(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new wl(null,r)}function uy(r){return Vf(r),r.headers=Sa.from(r.headers),r.data=Zf.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),n1.getAdapter(r.adapter||Vi.adapter)(r).then(function(l){return Vf(r),l.data=Zf.call(r,r.transformResponse,l),l.headers=Sa.from(l.headers),l},function(l){return Wv(l)||(Vf(r),l&&l.response&&(l.response.data=Zf.call(r,r.transformResponse,l.response),l.response.headers=Sa.from(l.response.headers))),Promise.reject(l)})}const s1="1.10.0",cd={};["object","boolean","number","function","string","symbol"].forEach((r,n)=>{cd[r]=function(l){return typeof l===r||"a"+(n<1?"n ":" ")+r}});const fy={};cd.transitional=function(n,i,l){function o(d,f){return"[Axios v"+s1+"] Transitional option '"+d+"'"+f+(l?". "+l:"")}return(d,f,h)=>{if(n===!1)throw new Pe(o(f," has been removed"+(i?" in "+i:"")),Pe.ERR_DEPRECATED);return i&&!fy[f]&&(fy[f]=!0,console.warn(o(f," has been deprecated since v"+i+" and will be removed in the near future"))),n?n(d,f,h):!0}};cd.spelling=function(n){return(i,l)=>(console.warn(`${l} is likely a misspelling of ${n}`),!0)};function GC(r,n,i){if(typeof r!="object")throw new Pe("options must be an object",Pe.ERR_BAD_OPTION_VALUE);const l=Object.keys(r);let o=l.length;for(;o-- >0;){const d=l[o],f=n[d];if(f){const h=r[d],g=h===void 0||f(h,d,r);if(g!==!0)throw new Pe("option "+d+" must be "+g,Pe.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Pe("Unknown option "+d,Pe.ERR_BAD_OPTION)}}const Nc={assertOptions:GC,validators:cd},fr=Nc.validators;let ls=class{constructor(n){this.defaults=n||{},this.interceptors={request:new ry,response:new ry}}async request(n,i){try{return await this._request(n,i)}catch(l){if(l instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const d=o.stack?o.stack.replace(/^.+\n/,""):"";try{l.stack?d&&!String(l.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(l.stack+=`
`+d):l.stack=d}catch{}}throw l}}_request(n,i){typeof n=="string"?(i=i||{},i.url=n):i=n||{},i=cs(this.defaults,i);const{transitional:l,paramsSerializer:o,headers:d}=i;l!==void 0&&Nc.assertOptions(l,{silentJSONParsing:fr.transitional(fr.boolean),forcedJSONParsing:fr.transitional(fr.boolean),clarifyTimeoutError:fr.transitional(fr.boolean)},!1),o!=null&&(ne.isFunction(o)?i.paramsSerializer={serialize:o}:Nc.assertOptions(o,{encode:fr.function,serialize:fr.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Nc.assertOptions(i,{baseUrl:fr.spelling("baseURL"),withXsrfToken:fr.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=d&&ne.merge(d.common,d[i.method]);d&&ne.forEach(["delete","get","head","post","put","patch","common"],w=>{delete d[w]}),i.headers=Sa.concat(f,d);const h=[];let g=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(i)===!1||(g=g&&S.synchronous,h.unshift(S.fulfilled,S.rejected))});const p=[];this.interceptors.response.forEach(function(S){p.push(S.fulfilled,S.rejected)});let y,b=0,j;if(!g){const w=[uy.bind(this),void 0];for(w.unshift.apply(w,h),w.push.apply(w,p),j=w.length,y=Promise.resolve(i);b<j;)y=y.then(w[b++],w[b++]);return y}j=h.length;let N=i;for(b=0;b<j;){const w=h[b++],S=h[b++];try{N=w(N)}catch(E){S.call(this,E);break}}try{y=uy.call(this,N)}catch(w){return Promise.reject(w)}for(b=0,j=p.length;b<j;)y=y.then(p[b++],p[b++]);return y}getUri(n){n=cs(this.defaults,n);const i=e1(n.baseURL,n.url,n.allowAbsoluteUrls);return Yv(i,n.params,n.paramsSerializer)}};ne.forEach(["delete","get","head","options"],function(n){ls.prototype[n]=function(i,l){return this.request(cs(l||{},{method:n,url:i,data:(l||{}).data}))}});ne.forEach(["post","put","patch"],function(n){function i(l){return function(d,f,h){return this.request(cs(h||{},{method:n,headers:l?{"Content-Type":"multipart/form-data"}:{},url:d,data:f}))}}ls.prototype[n]=i(),ls.prototype[n+"Form"]=i(!0)});let FC=class l1{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(d){i=d});const l=this;this.promise.then(o=>{if(!l._listeners)return;let d=l._listeners.length;for(;d-- >0;)l._listeners[d](o);l._listeners=null}),this.promise.then=o=>{let d;const f=new Promise(h=>{l.subscribe(h),d=h}).then(o);return f.cancel=function(){l.unsubscribe(d)},f},n(function(d,f,h){l.reason||(l.reason=new wl(d,f,h),i(l.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const i=this._listeners.indexOf(n);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const n=new AbortController,i=l=>{n.abort(l)};return this.subscribe(i),n.signal.unsubscribe=()=>this.unsubscribe(i),n.signal}static source(){let n;return{token:new l1(function(o){n=o}),cancel:n}}};function BC(r){return function(i){return r.apply(null,i)}}function IC(r){return ne.isObject(r)&&r.isAxiosError===!0}const yh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yh).forEach(([r,n])=>{yh[n]=r});function i1(r){const n=new ls(r),i=Uv(ls.prototype.request,n);return ne.extend(i,ls.prototype,n,{allOwnKeys:!0}),ne.extend(i,n,null,{allOwnKeys:!0}),i.create=function(o){return i1(cs(r,o))},i}const Ue=i1(Vi);Ue.Axios=ls;Ue.CanceledError=wl;Ue.CancelToken=FC;Ue.isCancel=Wv;Ue.VERSION=s1;Ue.toFormData=id;Ue.AxiosError=Pe;Ue.Cancel=Ue.CanceledError;Ue.all=function(n){return Promise.all(n)};Ue.spread=BC;Ue.isAxiosError=IC;Ue.mergeConfig=cs;Ue.AxiosHeaders=Sa;Ue.formToJSON=r=>Qv(ne.isHTMLForm(r)?new FormData(r):r);Ue.getAdapter=n1.getAdapter;Ue.HttpStatusCode=yh;Ue.default=Ue;const{Axios:D3,AxiosError:M3,CanceledError:O3,isCancel:z3,CancelToken:L3,VERSION:U3,all:G3,Cancel:F3,isAxiosError:B3,spread:I3,toFormData:H3,AxiosHeaders:P3,HttpStatusCode:q3,formToJSON:$3,getAdapter:Z3,mergeConfig:V3}=Ue,HC=x.createContext({currentPage:{page:"/"},outOfDateState:{isOutOfDate:!1},setCurrentPage:()=>{},setEditingState:()=>{},refreshCurrentData:async()=>{},dismissOutOfDate:()=>{},setOnDataRefresh:()=>{}}),PC=({children:r})=>{const n=za(),{lastMessage:i}=dT(),[l,o]=x.useState({page:"/"}),[d,f]=x.useState({isOutOfDate:!1}),[h,g]=x.useState();x.useEffect(()=>{const E=n.pathname;let k={page:E};if(E.startsWith("/space/")){const A=E.split("/")[2];k={page:E,entityType:"space",entityId:A,isEditing:l.isEditing}}else if(E.startsWith("/user/")){const A=E.split("/")[2];k={page:E,entityType:"user",entityId:A,isEditing:l.isEditing}}else E==="/spaces"?k={page:E,entityType:void 0}:E==="/users"&&(k={page:E,entityType:void 0});o(k),E!==l.page&&f({isOutOfDate:!1})},[n.pathname]),x.useEffect(()=>{if(i&&i.type==="change"){const E=i;console.log("Received change notification:",E),p(E)}},[i]);const p=async E=>{if(y(E,l))if(console.log("Change is relevant to current page, processing..."),l.isEditing)f({isOutOfDate:!0,affectedEntity:E.group==="user"||E.group==="space"?{type:E.group,id:E.userId||E.spaceId||""}:void 0}),console.log("Currently editing - marked as out of date");else try{await b(),console.log("Data refreshed successfully")}catch(A){console.error("Failed to refresh data:",A)}},y=(E,k)=>{switch(E.group){case"users":return k.page==="/users";case"spaces":return k.page==="/spaces";case"user":return k.entityType==="user"&&k.entityId===E.userId;case"space":return k.entityType==="space"&&k.entityId===E.spaceId;default:return!1}},b=async()=>{if(!l.entityType||!l.entityId){h&&h(null);return}try{let E;l.entityType==="space"?E=await Ue.get(`/api/spaces/${l.entityId}`):l.entityType==="user"&&(E=await Ue.get(`/api/users/${l.entityId}`)),E&&h&&h(E.data)}catch(E){throw console.error("Failed to refresh current data:",E),E}},j=E=>{o(E),f({isOutOfDate:!1})},N=E=>{o(k=>({...k,isEditing:E})),E&&f({isOutOfDate:!1})},w=()=>{f({isOutOfDate:!1})},S=E=>{g(()=>E)};return t.jsx(HC.Provider,{value:{currentPage:l,outOfDateState:d,setCurrentPage:j,setEditingState:N,refreshCurrentData:b,dismissOutOfDate:w,onDataRefresh:h,setOnDataRefresh:S},children:r})},qC=()=>{const{isAuthenticated:r,token:n}=vl(),i=x.useCallback(async()=>{if(r&&n){console.log("🔌 Connecting WebSocket with JWT authentication...");try{await xa.connect(n)?console.log("✅ WebSocket connected successfully"):console.error("❌ Failed to connect WebSocket")}catch(o){console.error("❌ WebSocket connection error:",o)}}},[r,n]),l=x.useCallback(async()=>{console.log("🔌 Disconnecting WebSocket..."),await xa.disconnect()},[]);return x.useEffect(()=>(r&&n?i():l(),()=>{l()}),[r,n,i,l]),{connectWebSocket:i,disconnectWebSocket:l,isAuthenticated:r}},$C=()=>{const{isAuthenticated:r}=qC();return x.useEffect(()=>{console.log(`🔌 WebSocket Manager: Authentication status changed to ${r}`)},[r]),null},ZC=()=>{const{isAuthenticated:r,isLoading:n}=vl();return n?t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsx("div",{className:"animate-spin w-12 h-12 border-4 border-blue-600 rounded-full border-t-transparent"})}):r?t.jsx(Ch,{}):t.jsx(Js,{to:"/login",replace:!0})};var o1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},hy=mr.createContext&&mr.createContext(o1),VC=["attr","size","title"];function KC(r,n){if(r==null)return{};var i=YC(r,n),l,o;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(r);for(o=0;o<d.length;o++)l=d[o],!(n.indexOf(l)>=0)&&Object.prototype.propertyIsEnumerable.call(r,l)&&(i[l]=r[l])}return i}function YC(r,n){if(r==null)return{};var i={};for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){if(n.indexOf(l)>=0)continue;i[l]=r[l]}return i}function Gc(){return Gc=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},Gc.apply(this,arguments)}function py(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);n&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,l)}return i}function Fc(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?py(Object(i),!0).forEach(function(l){XC(r,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):py(Object(i)).forEach(function(l){Object.defineProperty(r,l,Object.getOwnPropertyDescriptor(i,l))})}return r}function XC(r,n,i){return n=QC(n),n in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function QC(r){var n=WC(r,"string");return typeof n=="symbol"?n:n+""}function WC(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var l=i.call(r,n);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function c1(r){return r&&r.map((n,i)=>mr.createElement(n.tag,Fc({key:i},n.attr),c1(n.child)))}function nt(r){return n=>mr.createElement(JC,Gc({attr:Fc({},r.attr)},n),c1(r.child))}function JC(r){var n=i=>{var{attr:l,size:o,title:d}=r,f=KC(r,VC),h=o||i.size||"1em",g;return i.className&&(g=i.className),r.className&&(g=(g?g+" ":"")+r.className),mr.createElement("svg",Gc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,l,f,{className:g,style:Fc(Fc({color:r.color||i.color},i.style),r.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),d&&mr.createElement("title",null,d),r.children)};return hy!==void 0?mr.createElement(hy.Consumer,null,i=>n(i)):n(o1)}function Ki(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"},child:[]}]})(r)}function Di(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"},child:[]}]})(r)}function e3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"},child:[]}]})(r)}function bh(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"},child:[]}]})(r)}function rp(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"},child:[]}]})(r)}function d1(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M11 17a1 1 0 001.447.894l4-2A1 1 0 0017 15V9.236a1 1 0 00-1.447-.894l-4 2a1 1 0 00-.553.894V17zM15.211 6.276a1 1 0 000-1.788l-4.764-2.382a1 1 0 00-.894 0L4.789 4.488a1 1 0 000 1.788l4.764 2.382a1 1 0 00.894 0l4.764-2.382zM4.447 8.342A1 1 0 003 9.236V15a1 1 0 00.553.894l4 2A1 1 0 009 17v-5.764a1 1 0 00-.553-.894l-4-2z"},child:[]}]})(r)}function t3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"},child:[]},{tag:"path",attr:{d:"M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"},child:[]},{tag:"path",attr:{d:"M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"},child:[]}]})(r)}function my(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm5 6a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V8z",clipRule:"evenodd"},child:[]}]})(r)}function ll(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M9 2a2 2 0 00-2 2v8a2 2 0 002 2h6a2 2 0 002-2V6.414A2 2 0 0016.414 5L14 2.586A2 2 0 0012.586 2H9z"},child:[]},{tag:"path",attr:{d:"M3 8a2 2 0 012-2v10h8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"},child:[]}]})(r)}function a3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"},child:[]}]})(r)}function r3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",clipRule:"evenodd"},child:[]}]})(r)}function pr(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(r)}function Mn(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{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 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"},child:[]}]})(r)}function vh(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"},child:[]}]})(r)}function gy(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3.707 2.293a1 1 0 00-1.414 1.414l14 14a1 1 0 001.414-1.414l-1.473-1.473A10.014 10.014 0 0019.542 10C18.268 5.943 14.478 3 10 3a9.958 9.958 0 00-4.512 1.074l-1.78-1.781zm4.261 4.26l1.514 1.515a2.003 2.003 0 012.45 2.45l1.514 1.514a4 4 0 00-5.478-5.478z",clipRule:"evenodd"},child:[]},{tag:"path",attr:{d:"M12.454 16.697L9.75 13.992a4 4 0 01-3.742-3.741L2.335 6.578A9.98 9.98 0 00.458 10c1.274 4.057 5.065 7 9.542 7 .847 0 1.669-.105 2.454-.303z"},child:[]}]})(r)}function Ka(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"},child:[]}]})(r)}function n3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M6.625 2.655A9 9 0 0119 11a1 1 0 11-2 0 7 7 0 00-9.625-6.492 1 1 0 11-.75-1.853zM4.662 4.959A1 1 0 014.75 6.37 6.97 6.97 0 003 11a1 1 0 11-2 0 8.97 8.97 0 012.25-5.953 1 1 0 011.412-.088z",clipRule:"evenodd"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M5 11a5 5 0 1110 0 1 1 0 11-2 0 3 3 0 10-6 0c0 1.677-.345 3.276-.968 4.729a1 1 0 11-1.838-.789A9.964 9.964 0 005 11zm8.921 2.012a1 1 0 01.831 1.145 19.86 19.86 0 01-.545 2.436 1 1 0 11-1.92-.558c.207-.713.371-1.445.49-2.192a1 1 0 011.144-.83z",clipRule:"evenodd"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M10 10a1 1 0 011 1c0 2.236-.46 4.368-1.29 6.304a1 1 0 01-1.838-.789A13.952 13.952 0 009 11a1 1 0 011-1z",clipRule:"evenodd"},child:[]}]})(r)}function Ua(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},child:[]}]})(r)}function s3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z",clipRule:"evenodd"},child:[]}]})(r)}function l3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"},child:[]}]})(r)}function Yi(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"},child:[]}]})(r)}function hr(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z",clipRule:"evenodd"},child:[]}]})(r)}function as(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"},child:[]}]})(r)}function Rn(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M7.707 10.293a1 1 0 10-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 11.586V6h5a2 2 0 012 2v7a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2h5v5.586l-1.293-1.293zM9 4a1 1 0 012 0v2H9V4z"},child:[]}]})(r)}function Qa(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"},child:[]}]})(r)}function _n(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z",clipRule:"evenodd"},child:[]}]})(r)}function kc(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M8 5a1 1 0 100 2h5.586l-1.293 1.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L13.586 5H8zM12 15a1 1 0 100-2H6.414l1.293-1.293a1 1 0 10-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L6.414 15H12z"},child:[]}]})(r)}function Et(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"},child:[]}]})(r)}function Mi(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"},child:[]}]})(r)}function Gi(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"},child:[]}]})(r)}function i3(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"},child:[]}]})(r)}function Vr(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M2 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V4zM8 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1H9a1 1 0 01-1-1V4zM15 3a1 1 0 00-1 1v12a1 1 0 001 1h2a1 1 0 001-1V4a1 1 0 00-1-1h-2z"},child:[]}]})(r)}function ds(r){return nt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(r)}const Pr=({className:r="h-5 w-5"})=>t.jsxs("svg",{className:r,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("circle",{cx:"18",cy:"6",r:"3"}),t.jsx("circle",{cx:"6",cy:"18",r:"3"}),t.jsx("circle",{cx:"18",cy:"18",r:"3"}),t.jsx("line",{x1:"15.5",y1:"7.5",x2:"8.5",y2:"16.5",stroke:"currentColor",strokeWidth:"2"}),t.jsx("line",{x1:"18",y1:"9",x2:"18",y2:"15",stroke:"currentColor",strokeWidth:"2"}),t.jsx("line",{x1:"9",y1:"18",x2:"15",y2:"18",stroke:"currentColor",strokeWidth:"2"})]}),il=({className:r="w-5 h-5",size:n=20})=>t.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,children:[t.jsx("path",{d:"M12 2 L19 6 L12 10 L5 6 Z",fill:"currentColor",fillOpacity:"0.2"}),t.jsx("path",{d:"M5 6 L5 15 L12 19 L12 10 Z",fill:"currentColor",fillOpacity:"0.1"}),t.jsx("path",{d:"M12 10 L12 19 L19 15 L19 6 Z",fill:"currentColor",fillOpacity:"0.3"}),t.jsx("path",{d:"M12 2 L19 6 L12 10 L5 6 Z"}),t.jsx("path",{d:"M5 6 L5 15"}),t.jsx("path",{d:"M19 6 L19 15"}),t.jsx("path",{d:"M5 15 L12 19"}),t.jsx("path",{d:"M19 15 L12 19"}),t.jsx("path",{d:"M12 10 L12 19"}),t.jsx("circle",{cx:"12",cy:"2",r:"2",fill:"currentColor"}),t.jsx("circle",{cx:"5",cy:"6",r:"2",fill:"currentColor"}),t.jsx("circle",{cx:"19",cy:"6",r:"2",fill:"currentColor"}),t.jsx("circle",{cx:"12",cy:"19",r:"2",fill:"currentColor"})]}),Bc=({className:r="w-5 h-5",size:n=20})=>t.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,children:[t.jsx("circle",{cx:"4",cy:"12",r:"2.5",fill:"currentColor"}),t.jsx("path",{d:"M7 12 L18 12",strokeWidth:"2.5"}),t.jsx("path",{d:"M15 9 L18 12 L15 15",strokeWidth:"2.5"})]}),Ic=({className:r="h-6 w-6"})=>t.jsxs("svg",{className:r,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),t.jsx("circle",{cx:"7",cy:"9",r:"1.5",fill:"currentColor"}),t.jsx("circle",{cx:"17",cy:"9",r:"1.5",fill:"currentColor"}),t.jsx("circle",{cx:"12",cy:"15",r:"1.5",fill:"currentColor"})]}),nr=({className:r="w-5 h-5"})=>t.jsx("svg",{className:r,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"})}),o3=()=>{const[r,n]=x.useState(!1),{user:i,logout:l}=vl(),o=za(),d=()=>{n(!r)},f=()=>{l()};return t.jsxs("div",{className:"flex flex-col min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs(yv,{fluid:!0,rounded:!0,className:"border-b border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("button",{onClick:d,className:"mr-3 rounded-lg p-2 text-gray-600 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600 md:hidden",children:t.jsx(l3,{className:"h-6 w-6"})}),t.jsx(Je,{to:"/",children:t.jsxs("span",{className:"flex items-center",children:[t.jsx("img",{src:"/images/vital-logo-black.png",className:"mr-3 h-6 sm:h-9 w-auto block dark:hidden",alt:"VitalGraph Logo",style:{maxWidth:"120px"}}),t.jsx("img",{src:"/images/vitallogo_offwhite_normal.png",className:"mr-3 h-6 sm:h-9 w-auto hidden dark:block",alt:"VitalGraph Logo",style:{maxWidth:"120px"}}),t.jsx("span",{className:"self-center whitespace-nowrap text-xl font-semibold dark:text-white",children:"VitalGraph"})]})})]}),t.jsxs("div",{className:"flex md:order-2 items-center",children:[t.jsx(cv,{className:"mr-2"}),i&&t.jsxs(hv,{arrowIcon:!1,inline:!0,label:t.jsx(xb,{alt:"User",img:"/images/generic-user-avatar.svg",rounded:!0,size:"sm"}),children:[t.jsxs(pv,{children:[t.jsx("span",{className:"block text-sm font-medium",children:i.full_name}),t.jsx("span",{className:"block truncate text-sm text-gray-500",children:i.email})]}),t.jsx(mv,{icon:s3,onClick:f,children:"Sign out"})]}),t.jsx(jv,{className:"ml-2"})]}),t.jsxs(bv,{children:[t.jsx(Je,{to:"/",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Home"})}),t.jsx(Je,{to:"/spaces",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/spaces"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Spaces"})}),t.jsx(Je,{to:"/graphs",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/graphs"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Graphs"})}),t.jsx(Je,{to:"/kg-types",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/kg-types"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"KG Types"})}),t.jsx(Je,{to:"/objects",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/objects"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Objects"})}),t.jsx(Je,{to:"/triples",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/triples"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Triples"})}),t.jsx(Je,{to:"/files",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/files"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Files"})}),t.jsx(Je,{to:"/users",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/users"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Users"})}),t.jsx(Je,{to:"/data",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/data"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"Data"})}),t.jsx(Je,{to:"/sparql",className:"block py-2 pr-4 pl-3 md:p-0",children:t.jsx("span",{className:`block py-2 pr-4 pl-3 md:p-0 ${o.pathname==="/sparql"?"text-blue-700 dark:text-blue-500":"text-gray-700 dark:text-white"}`,children:"SPARQL"})})]})]}),t.jsxs("div",{className:"flex flex-1 relative",children:[r&&t.jsx("div",{className:"fixed inset-0 z-40 bg-black bg-opacity-50 md:hidden",onClick:()=>n(!1)}),t.jsx(_v,{"aria-label":"Application sidebar",className:`
            w-fit transition-transform duration-300 ease-in-out z-50
            md:translate-x-0 md:static md:block
            ${r?"translate-x-0":"-translate-x-full"}
            fixed md:relative h-full
          `,children:t.jsx(Rv,{children:t.jsxs(Ev,{children:[t.jsx(Je,{to:"/",style:{display:"block"},children:t.jsx(ar,{icon:Ua,active:o.pathname==="/",as:"div",children:"Home"})}),t.jsx(Je,{to:"/spaces",style:{display:"block"},children:t.jsx(ar,{icon:Vr,active:o.pathname==="/spaces",as:"div",children:"Spaces"})}),t.jsx(Je,{to:"/graphs",style:{display:"block"},children:t.jsx(ar,{icon:Pr,active:o.pathname==="/graphs",as:"div",children:"Graphs"})}),t.jsx(Je,{to:"/kg-types",style:{display:"block"},children:t.jsx(ar,{icon:Ic,active:o.pathname==="/kg-types",as:"div",children:"KG Types"})}),t.jsx(Je,{to:"/objects",style:{display:"block"},children:t.jsx(ar,{icon:il,active:o.pathname==="/objects",as:"div",children:"Objects"})}),t.jsx(Je,{to:"/triples",style:{display:"block"},children:t.jsx(ar,{icon:Bc,active:o.pathname==="/triples",as:"div",children:"Triples"})}),t.jsx(Je,{to:"/files",style:{display:"block"},children:t.jsx(ar,{icon:ll,active:o.pathname==="/files",as:"div",children:"Files"})}),t.jsx(Je,{to:"/users",style:{display:"block"},children:t.jsx(ar,{icon:Gi,active:o.pathname==="/users",as:"div",children:"Users"})}),t.jsx(Je,{to:"/data",style:{display:"block"},children:t.jsx(ar,{icon:nr,active:o.pathname==="/data",as:"div",children:"Data"})}),t.jsx(Je,{to:"/sparql",style:{display:"block"},children:t.jsx(ar,{icon:Qa,active:o.pathname==="/sparql",as:"div",children:"SPARQL"})})]})})}),t.jsx("main",{className:"flex-1 p-4",children:t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800 sm:p-6 lg:p-8",children:t.jsx(Ch,{})})})]})]})},c3=()=>{const[r,n]=x.useState(""),[i,l]=x.useState(""),[o,d]=x.useState(!1),[f,h]=x.useState(null),[g,p]=x.useState(!1),{login:y,isAuthenticated:b}=vl(),j=St();if(b)return t.jsx(Js,{to:"/"});const N=async w=>{if(w.preventDefault(),!r||!i){h("Please enter both username and password");return}p(!0),h(null);try{await y(r,i)?j("/"):h("Invalid username or password")}catch(S){h("An error occurred during login. Please try again."),console.error("Login error:",S)}finally{p(!1)}};return t.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900 px-4",children:t.jsxs(qe,{className:"w-full max-w-md",children:[t.jsxs("div",{className:"flex justify-center mb-4",children:[t.jsx("img",{src:"/images/vital-logo-black.png",className:"h-16 w-auto block dark:hidden",alt:"VitalGraph Logo"}),t.jsx("img",{src:"/images/vitallogo_offwhite_normal.png",className:"h-16 w-auto hidden dark:block",alt:"VitalGraph Logo"})]}),t.jsx("h1",{className:"text-xl font-bold text-center mb-6 dark:text-white",children:"Sign in to VitalGraph"}),f&&t.jsx(Xe,{color:"failure",className:"mb-4",children:f}),t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:N,children:[t.jsxs("div",{children:[t.jsx("div",{className:"mb-2 block",children:t.jsx(se,{htmlFor:"username",children:"Username"})}),t.jsx(Me,{id:"username",placeholder:"Enter your username",required:!0,value:r,onChange:w=>n(w.target.value),disabled:g})]}),t.jsxs("div",{children:[t.jsx("div",{className:"mb-2 block",children:t.jsx(se,{htmlFor:"password",children:"Password"})}),t.jsx(Me,{id:"password",type:"password",placeholder:"••••••••",required:!0,value:i,onChange:w=>l(w.target.value),disabled:g})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(vb,{id:"remember",checked:o,onChange:()=>d(!o),disabled:g}),t.jsx(se,{htmlFor:"remember",children:"Remember me"})]}),t.jsx(X,{type:"submit",disabled:g,children:g?"Signing in...":"Sign in"})]})]})})},u1=({className:r="w-6 h-6"})=>t.jsx("svg",{className:r,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:t.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 15v3c0 .5523.44772 1 1 1h8v-8m-9 4v-4m0 4h9m-9-4V6c0-.55228.44772-1 1-1h16c.5523 0 1 .44772 1 1v4M3 11h11m6.25 5c0 1.2426-1.0073 2.25-2.25 2.25M20.25 16c0-1.2426-1.0073-2.25-2.25-2.25M20.25 16H21m-3 2.25c-1.2426 0-2.25-1.0074-2.25-2.25M18 18.25V19m-2.25-3c0-1.2426 1.0074-2.25 2.25-2.25M15.75 16H15m3-2.25V13m-1.591 1.409-.5303-.5303m4.2426 4.2426-.5303-.5303m-3.182 0-.5303.5303m4.2426-4.2426-.5303.5303"})}),d3=()=>{const{user:r,showLoginSuccess:n,setShowLoginSuccess:i}=vl(),[l,o]=x.useState(!1),[d,f]=x.useState(!1);return x.useEffect(()=>{if(n){o(!0),setTimeout(()=>f(!0),100);const h=setTimeout(()=>{f(!1)},2500),g=setTimeout(()=>{o(!1),i(!1)},3e3);return()=>{clearTimeout(h),clearTimeout(g)}}},[n,i]),t.jsxs("div",{children:[t.jsx("h1",{className:"mb-4 text-xl font-bold text-gray-900 dark:text-white",children:"Welcome to VitalGraph"}),l&&t.jsxs(Xe,{color:"info",className:`mb-4 transition-opacity duration-500 ${d?"opacity-100":"opacity-0"}`,children:[t.jsxs("div",{className:"font-medium",children:["Hello, ",(r==null?void 0:r.full_name)||"Admin User","!"]}),t.jsxs("div",{children:["You are successfully logged in as ",(r==null?void 0:r.role)||"Administrator","."]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mt-8 items-start",children:[t.jsxs(qe,{children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(Vr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Spaces & Users"})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs(Je,{to:"/spaces",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Vr,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Spaces"})]}),t.jsx("span",{className:"text-sm font-medium text-blue-600",children:"Organize your data"})]}),t.jsxs(Je,{to:"/users",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(i3,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"User Management"})]}),t.jsx("span",{className:"text-sm font-medium text-green-600",children:"Control access"})]})]})]}),t.jsxs(qe,{children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(Pr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Graphs & Triples"})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs(Je,{to:"/graphs",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pr,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Knowledge Graphs"})]}),t.jsx("span",{className:"text-sm font-medium text-purple-600",children:"Semantic data"})]}),t.jsxs(Je,{to:"/triples",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Bc,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"RDF Triples"})]}),t.jsx("span",{className:"text-sm font-medium text-indigo-600",children:"Knowledge Assertions"})]})]})]}),t.jsxs(qe,{children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(il,{className:"w-6 h-6 text-blue-600"}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Knowledge Graph & Files"})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs(Je,{to:"/objects",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(il,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Graph Objects"})]}),t.jsx("span",{className:"text-sm font-medium text-orange-600",children:"Graph Objects"})]}),t.jsxs(Je,{to:"/objects/kgentities",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rp,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"KG Entities"})]}),t.jsx("span",{className:"text-sm font-medium text-blue-600",children:"KG Entities"})]}),t.jsxs(Je,{to:"/objects/kgframes",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(u1,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"KG Frames"})]}),t.jsx("span",{className:"text-sm font-medium text-purple-600",children:"KG Frames"})]}),t.jsxs(Je,{to:"/kg-types",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ic,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"KG Types"})]}),t.jsx("span",{className:"text-sm font-medium text-indigo-600",children:"KG Types"})]}),t.jsxs(Je,{to:"/files",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ll,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"File Management"})]}),t.jsx("span",{className:"text-sm font-medium text-teal-600",children:"File Management"})]})]})]}),t.jsxs(qe,{children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(nr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Data Management"})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs(Je,{to:"/data/import",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Mi,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Data Import"})]}),t.jsx("span",{className:"text-sm font-medium text-emerald-600",children:"Ingest data"})]}),t.jsxs(Je,{to:"/data/export",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pr,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Data Export"})]}),t.jsx("span",{className:"text-sm font-medium text-cyan-600",children:"Export data"})]}),t.jsxs(Je,{to:"/data/migrate",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(kc,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Data Migration"})]}),t.jsx("span",{className:"text-sm font-medium text-orange-600",children:"Migrate data"})]}),t.jsxs(Je,{to:"/data/tracking",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ka,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Data Tracking"})]}),t.jsx("span",{className:"text-sm font-medium text-purple-600",children:"Data tracking"})]}),t.jsxs(Je,{to:"/data/checkpoint",className:"flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(bh,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Data Checkpoint"})]}),t.jsx("span",{className:"text-sm font-medium text-indigo-600",children:"Data checkpoint"})]})]})]})]})]})};class u3{constructor(){Dt(this,"baseUrl");this.baseUrl=window.location.origin}async makeRequest(n,i={}){const l=n.startsWith("http")?n:`${this.baseUrl}${n}`,o=na.getAuthHeader(),d={"Content-Type":"application/json",...i.headers,...o},f=await fetch(l,{...i,headers:d});if(f.status===401&&"Authorization"in o){if(console.log("🔄 Received 401, attempting token refresh..."),await na.refreshAccessToken()){const g=na.getAuthHeader(),p={...d,...g};return console.log("🔄 Retrying request with refreshed token..."),fetch(l,{...i,headers:p})}console.log("🚪 Token refresh failed, redirecting to login"),window.location.href="/login"}return f}async get(n,i={}){return this.makeRequest(n,{...i,method:"GET"})}async post(n,i,l={}){return this.makeRequest(n,{...l,method:"POST",body:i?JSON.stringify(i):void 0})}async put(n,i,l={}){return this.makeRequest(n,{...l,method:"PUT",body:i?JSON.stringify(i):void 0})}async delete(n,i={}){return this.makeRequest(n,{...i,method:"DELETE"})}async patch(n,i,l={}){return this.makeRequest(n,{...l,method:"PATCH",body:i?JSON.stringify(i):void 0})}async getSpaces(){const n=await this.get("/api/spaces");if(n.ok)return(await n.json()).spaces||[];throw new Error(`Failed to get spaces: ${n.status} ${n.statusText}`)}async getUsers(){const n=await this.get("/api/users");if(n.ok)return(await n.json()).users||[];throw new Error(`Failed to get users: ${n.status} ${n.statusText}`)}async createSpace(n){const i=await this.post("/api/spaces",n);if(i.ok)return i.json();throw new Error(`Failed to create space: ${i.status} ${i.statusText}`)}async updateSpace(n,i){const l=await this.put(`/api/spaces/${n}`,i);if(l.ok)return l.json();throw new Error(`Failed to update space: ${l.status} ${l.statusText}`)}async deleteSpace(n){const i=await this.delete(`/api/spaces/${n}`);if(i.ok)return i.json();throw new Error(`Failed to delete space: ${i.status} ${i.statusText}`)}async executeSparqlQuery(n,i){const l=await this.post(`/api/graphs/sparql/${n}/query`,{query:i});if(l.ok)return l.json();throw new Error(`Failed to execute SPARQL query: ${l.status} ${l.statusText}`)}async getGraphs(n){const i=await this.get(`/api/graphs/sparql/${n}/graphs`);if(i.ok)return i.json();throw new Error(`Failed to get graphs: ${i.status} ${i.statusText}`)}async getGraph(n,i){const l=encodeURIComponent(i),o=await this.get(`/api/graphs/sparql/${n}/graph/${l}`);if(o.ok)return o.json();throw new Error(`Failed to get graph: ${o.status} ${o.statusText}`)}async createGraph(n,i){const l=encodeURIComponent(i),o=await this.put(`/api/graphs/sparql/${n}/graph/${l}`);if(o.ok)return o.json();throw new Error(`Failed to create graph: ${o.status} ${o.statusText}`)}async deleteGraph(n,i,l=!1){const o=encodeURIComponent(i),d=l?`/api/graphs/sparql/${n}/graph/${o}?silent=true`:`/api/graphs/sparql/${n}/graph/${o}`,f=await this.delete(d);if(f.ok)return f.json();throw new Error(`Failed to delete graph: ${f.status} ${f.statusText}`)}async executeGraphOperation(n,i,l,o,d=!1){const f={operation:i,target_graph_uri:l,source_graph_uri:o,silent:d},h=await this.post(`/api/graphs/sparql/${n}/graph`,f);if(h.ok)return h.json();throw new Error(`Failed to execute graph operation: ${h.status} ${h.statusText}`)}async getTriples(n,i,l={}){const o=new URLSearchParams;o.append("space_id",n),o.append("graph_id",i),l.page_size&&o.append("page_size",l.page_size.toString()),l.offset&&o.append("offset",l.offset.toString()),l.subject&&o.append("subject",l.subject),l.predicate&&o.append("predicate",l.predicate),l.object&&o.append("object",l.object),l.object_filter&&o.append("object_filter",l.object_filter);const d=await this.get(`/api/graphs/triples?${o.toString()}`);if(d.ok)return d.json();throw new Error(`Failed to get triples: ${d.status} ${d.statusText}`)}async addTriples(n,i,l){const o=new URLSearchParams;o.append("space_id",n),o.append("graph_id",i);const d=await this.post(`/api/graphs/triples?${o.toString()}`,{document:l});if(d.ok)return d.json();throw new Error(`Failed to add triples: ${d.status} ${d.statusText}`)}async deleteTriples(n,i,l){const o=new URLSearchParams;o.append("space_id",n),o.append("graph_id",i);const d=await this.delete(`/api/graphs/triples?${o.toString()}`,{body:JSON.stringify({document:l})});if(d.ok)return d.json();throw new Error(`Failed to delete triples: ${d.status} ${d.statusText}`)}async healthCheck(){const n=await this.get("/api/health");if(n.ok)return n.json();throw new Error(`Health check failed: ${n.status} ${n.statusText}`)}}const Vt=new u3,f3=()=>{const r=St(),n=x.useRef(null),i=x.useRef(0),[l,o]=x.useState([]),[d,f]=x.useState(!0),[h,g]=x.useState(null),[p,y]=x.useState(""),[b,j]=x.useState(!1),N=x.useCallback(async()=>{try{f(!0);const k=await Vt.getSpaces();o(k),g(null)}catch(k){console.error("Error fetching spaces:",k),g("Failed to load spaces. Please try again later."),o([])}finally{f(!1)}},[]),w=x.useCallback(async k=>{if(!k.trim()){if(d)return;await N();return}try{j(!0);const A=await Vt.get(`/api/spaces/filter/${encodeURIComponent(k)}`);if(A.ok){const O=await A.json(),L=Array.isArray(O)?O:O.spaces||[];o(L),g(null)}else throw new Error(`Failed to filter spaces: ${A.status} ${A.statusText}`)}catch(A){console.error("Error filtering spaces:",A),g("Failed to filter spaces. Please try again later."),o([])}finally{j(!1)}},[N]);x.useLayoutEffect(()=>{n.current&&document.activeElement!==n.current&&(n.current.focus(),n.current.setSelectionRange(i.current,i.current))}),x.useEffect(()=>{const k=setTimeout(()=>{w(p)},500);return()=>clearTimeout(k)},[p,w]),x.useEffect(()=>{N()},[N]);const S=k=>{r(`/space/${k.id}`)},E=k=>{try{return new Date(k).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return k}};return d&&!b?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{children:[t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(Vr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Spaces"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage your RDF data spaces"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"relative max-w-md",children:[t.jsx(Me,{ref:n,id:"filter",type:"text",icon:Qa,placeholder:"Filter spaces by name...",value:p,onChange:k=>{i.current=k.target.selectionStart||0,y(k.target.value)},disabled:b}),b&&t.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:t.jsx(He,{size:"sm"})})]}),p&&t.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:b?"Filtering...":`Showing results for "${p}"`})]}),h&&t.jsxs(Xe,{color:"failure",className:"mb-6",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",h]}),l.length===0&&!d&&!h?t.jsx(Xe,{color:"info",children:p?`No spaces found matching "${p}". Try a different search term.`:"No spaces found. Create your first space to get started."}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hidden md:block overflow-x-auto",children:t.jsxs(Yt,{striped:!0,children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"ID"}),t.jsx(he,{children:"Name"}),t.jsx(he,{children:"Space ID"}),t.jsx(he,{children:"Tenant"}),t.jsx(he,{children:"Description"}),t.jsx(he,{children:"Last Updated"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:l.map(k=>t.jsxs(at,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:[t.jsx(fe,{className:"whitespace-nowrap font-medium text-gray-900 dark:text-white",children:k.id}),t.jsx(fe,{className:"font-medium text-gray-900 dark:text-white",children:k.space_name}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:k.space}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:k.tenant}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:k.space_description||"No description"}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:E(k.update_time)}),t.jsx(fe,{children:t.jsxs(X,{size:"sm",color:"blue",onClick:()=>S(k),children:[t.jsx(Ka,{className:"mr-2 h-4 w-4"}),"Details"]})})]},k.id))})]})}),t.jsx("div",{className:"md:hidden space-y-4",children:l.map(k=>t.jsx(qe,{className:"w-full",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between items-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:k.space_name}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["ID: ",k.id," • Space ID: ",k.space]})]}),t.jsxs(X,{size:"sm",color:"blue",onClick:()=>S(k),children:[t.jsx(Ka,{className:"mr-1 h-4 w-4"}),"Details"]})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-2 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Tenant:"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:k.tenant})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Description:"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:k.space_description||"No description"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Last Updated:"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:E(k.update_time)})]})]})]})},k.id))})]})]})},h3=()=>{const{id:r}=da(),n=St(),i=r==="new",[l,o]=x.useState(null),[d,f]=x.useState(!0),[h,g]=x.useState(null),[p,y]=x.useState(i),[b,j]=x.useState(!1),[N,w]=x.useState(null),[S,E]=x.useState(!1),[k,A]=x.useState(!1),[O,L]=x.useState({space:"",space_name:"",space_description:"",tenant:""}),[B,V]=x.useState(!1);x.useEffect(()=>{(async()=>{var U;if(!r){g("Space ID is required"),f(!1);return}if(i){L({space:"",space_name:"",space_description:"",tenant:""}),f(!1);return}try{f(!0);const R=(await Ue.get(`/api/spaces/${r}`)).data;o(R),L({space:R.space||"",space_name:R.space_name||"",space_description:R.space_description||"",tenant:R.tenant||""}),g(null)}catch(T){console.error("Error fetching space:",T);let R="Failed to load space details";(U=T.response)!=null&&U.data&&(typeof T.response.data=="string"?R=T.response.data:T.response.data.detail?R=Array.isArray(T.response.data.detail)?T.response.data.detail.map(v=>v.msg||v).join(", "):T.response.data.detail:T.response.data.message&&(R=T.response.data.message)),g(R),o(null)}finally{f(!1)}})()},[r,i]),x.useEffect(()=>{if(i){const C=O.space.trim()!==""&&O.space_name.trim()!=="";V(C)}else{if(!l)return;const C=O.space!==(l.space||"")||O.space_name!==(l.space_name||"")||O.space_description!==(l.space_description||"")||O.tenant!==(l.tenant||"");V(C)}},[O,l,i]);const $=(C,U)=>{w({type:C,message:U}),setTimeout(()=>{w(null)},5e3)},le=()=>{y(!0)},q=()=>{if(i){n("/spaces");return}l&&(L({space:l.space||"",space_name:l.space_name||"",space_description:l.space_description||"",tenant:l.tenant||""}),y(!1),V(!1))},K=async()=>{var C,U;if(B)try{if(j(!0),i){const T={...O},v=(await Ue.post("/api/spaces",T)).data;$("success","Space created successfully!"),n(`/space/${v.id}`)}else{if(!l)return;const T={id:l.id,...O},v=(await Ue.put(`/api/spaces/${l.id}`,T)).data;o(v),y(!1),V(!1),$("success","Space updated successfully!")}}catch(T){console.error("Error saving space:",T);const R=i?"create":"update";$("error",((U=(C=T.response)==null?void 0:C.data)==null?void 0:U.detail)||`Failed to ${R} space`)}finally{j(!1)}},ae=(C,U)=>{L(T=>({...T,[C]:U}))},G=()=>{E(!0)},Z=async()=>{var C,U;if(l)try{A(!0),await Ue.delete(`/api/spaces/${l.id}`),$("success","Space deleted successfully"),setTimeout(()=>{n("/spaces")},1e3)}catch(T){console.error("Error deleting space:",T);const R=((U=(C=T.response)==null?void 0:C.data)==null?void 0:U.detail)||"Failed to delete space";$("error",R)}finally{A(!1),E(!1)}},z=()=>{E(!1)},H=C=>{try{return new Date(C).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return C}};return d?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):h?t.jsxs("div",{children:[t.jsxs(Xe,{color:"failure",className:"mb-6",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",h]}),t.jsx(X,{onClick:()=>n("/spaces"),color:"gray",children:"Back to Spaces"})]}):!l&&!i?t.jsxs("div",{children:[t.jsx(Xe,{color:"warning",className:"mb-6",children:"Space not found"}),t.jsx(X,{onClick:()=>n("/spaces"),color:"gray",children:"Back to Spaces"})]}):t.jsxs("div",{children:[t.jsx("div",{className:"mb-4 min-h-[60px]",children:N&&t.jsxs(Xe,{color:N.type==="success"?"success":"failure",className:"mb-4",onDismiss:()=>w(null),children:[t.jsx("span",{className:"font-medium",children:N.type==="success"?"Success:":"Error:"})," ",N.message]})}),t.jsxs(La,{className:"mb-6",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/spaces",icon:Vr,children:"Spaces"}),t.jsx(Le,{children:i?"New Space":(l==null?void 0:l.space_name)||(l==null?void 0:l.space)||`Space ${l==null?void 0:l.id}`})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Vr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Space Details"})]}),t.jsxs("div",{className:"flex justify-between items-start",children:[t.jsx("div",{children:t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:p?"Modify space information":"View space information and settings"})}),t.jsx("div",{className:"flex flex-col sm:flex-row gap-2",children:p?t.jsxs(t.Fragment,{children:[t.jsx(X,{onClick:K,color:"blue",disabled:b||!B,children:b?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Saving..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Rn,{className:"mr-2 h-4 w-4"}),i?"Create Space":"Save Changes"]})}),t.jsxs(X,{onClick:q,color:"gray",children:[t.jsx(ds,{className:"mr-2 h-4 w-4"}),"Cancel"]})]}):t.jsxs(t.Fragment,{children:[t.jsxs(X,{onClick:le,color:"blue",children:[t.jsx(Yi,{className:"mr-2 h-4 w-4"}),"Edit"]}),!i&&t.jsxs(X,{onClick:G,color:"blue",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete"]})]})})]})]}),t.jsx(qe,{children:t.jsxs("div",{className:"space-y-6",children:[!i&&t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space-id",children:"Space ID"}),t.jsx(Me,{id:"space-id",type:"text",value:(l==null?void 0:l.id)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space-identifier",children:"Space Identifier"}),p?t.jsx(Me,{id:"space-identifier",type:"text",value:O.space,onChange:C=>ae("space",C.target.value),placeholder:"Enter space identifier",className:"mt-1"}):t.jsx(Me,{id:"space-identifier",type:"text",value:(l==null?void 0:l.space)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space-name",children:"Space Name"}),p?t.jsx(Me,{id:"space-name",type:"text",value:O.space_name,onChange:C=>ae("space_name",C.target.value),placeholder:"Enter space name",className:"mt-1"}):t.jsx(Me,{id:"space-name",type:"text",value:(l==null?void 0:l.space_name)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"tenant",children:"Tenant"}),p?t.jsx(Me,{id:"tenant",type:"text",value:O.tenant,onChange:C=>ae("tenant",C.target.value),placeholder:"Enter tenant",className:"mt-1"}):t.jsx(Me,{id:"tenant",type:"text",value:(l==null?void 0:l.tenant)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space-description",children:"Description"}),p?t.jsx(_a,{id:"space-description",value:O.space_description,onChange:C=>ae("space_description",C.target.value),placeholder:"Enter space description",rows:4,className:"mt-1"}):t.jsx(_a,{id:"space-description",value:(l==null?void 0:l.space_description)||"",disabled:!0,rows:4,className:"mt-1"})]}),!i&&t.jsxs("div",{children:[t.jsx(se,{htmlFor:"last-updated",children:"Last Updated"}),t.jsx(Me,{id:"last-updated",type:"text",value:l!=null&&l.update_time?H(l.update_time):"",disabled:!0,className:"mt-1"})]})]})}),t.jsxs(Lt,{show:S,onClose:z,size:"md",dismissible:!0,children:[t.jsx(jr,{children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-500"}),"Confirm Delete"]})}),t.jsx(br,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-700 dark:text-gray-300",children:["Are you sure you want to delete the space ",t.jsxs("strong",{children:['"',(l==null?void 0:l.space_name)||(l==null?void 0:l.space),'"']}),"?"]}),t.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:"This action cannot be undone. All data associated with this space will be permanently removed."})]})}),t.jsx(vr,{children:t.jsxs("div",{className:"flex flex-col-reverse sm:flex-row gap-2 w-full sm:w-auto",children:[t.jsx(X,{onClick:z,color:"gray",className:"w-full sm:w-auto",children:"Cancel"}),t.jsx(X,{onClick:Z,color:"blue",disabled:k,className:"w-full sm:w-auto",children:k?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete Space"]})})]})})]})]})},p3=()=>{const r=St(),n=x.useRef(null),i=x.useRef(0),[l,o]=x.useState([]),[d,f]=x.useState(!0),[h,g]=x.useState(null),[p,y]=x.useState(""),[b,j]=x.useState(!1),N=x.useCallback(async()=>{try{f(!0);const k=await Ue.get("/api/users"),A=Array.isArray(k.data)?k.data:k.data.users||[];console.log("Users API response:",k.data),console.log("Processed users data:",A),o(A),g(null)}catch(k){console.error("Error fetching users:",k),g("Failed to load users. Please try again later."),o([])}finally{f(!1)}},[]),w=x.useCallback(async k=>{if(!k.trim()){if(d)return;await N();return}try{j(!0);const A=await Ue.get(`/api/users/filter/${encodeURIComponent(k)}`),O=Array.isArray(A.data)?A.data:A.data.users||[];o(O),g(null)}catch(A){console.error("Error filtering users:",A),g("Failed to filter users. Please try again later."),o([])}finally{j(!1)}},[N]);x.useLayoutEffect(()=>{n.current&&document.activeElement!==n.current&&(n.current.focus(),n.current.setSelectionRange(i.current,i.current))}),x.useEffect(()=>{const k=setTimeout(()=>{w(p)},500);return()=>clearTimeout(k)},[p,w]),x.useEffect(()=>{N()},[N]);const S=k=>{r(`/user/${k.id}`)},E=k=>{if(console.log("formatDate called with:",k,typeof k),!k)return"Not available";try{const A=new Date(k);return console.log("Parsed date:",A,"isNaN:",isNaN(A.getTime())),isNaN(A.getTime())?"Not available":A.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch(A){return console.log("formatDate error:",A),"Not available"}};return d&&!b?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(Gi,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Users"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage user accounts and permissions"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"relative max-w-md",children:[t.jsx(Me,{ref:n,id:"filter",type:"text",icon:Qa,placeholder:"Filter users by username...",value:p,onChange:k=>{i.current=k.target.selectionStart||0,y(k.target.value)},disabled:b}),b&&t.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:t.jsx(He,{size:"sm"})})]}),p&&t.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:b?"Filtering...":`Showing results for "${p}"`})]}),h&&t.jsxs(Xe,{color:"failure",className:"mb-6",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",h]}),l.length===0&&!d&&!h?t.jsx(Xe,{color:"info",children:p?`No users found matching "${p}". Try a different search term.`:"No users found. Create your first user to get started."}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hidden md:block overflow-x-auto",children:t.jsxs(Yt,{striped:!0,children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"ID"}),t.jsx(he,{children:"Username"}),t.jsx(he,{children:"Email"}),t.jsx(he,{children:"Tenant"}),t.jsx(he,{children:"Last Updated"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:l.map(k=>t.jsxs(at,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:[t.jsx(fe,{className:"whitespace-nowrap font-medium text-gray-900 dark:text-white",children:k.id}),t.jsx(fe,{className:"font-medium text-gray-900 dark:text-white",children:k.username}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:k.email||"No email"}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:k.tenant||"Not specified"}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:E(k.update_time)}),t.jsx(fe,{children:t.jsxs(X,{size:"sm",color:"blue",onClick:()=>S(k),children:[t.jsx(Ka,{className:"mr-2 h-4 w-4"}),"Details"]})})]},k.id))})]})}),t.jsx("div",{className:"md:hidden space-y-4",children:l.map(k=>t.jsx(qe,{className:"w-full",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between items-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:k.username}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["ID: ",k.id]})]}),t.jsxs(X,{size:"sm",color:"blue",onClick:()=>S(k),children:[t.jsx(Ka,{className:"mr-1 h-4 w-4"}),"Details"]})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-2 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Email:"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:k.email||"No email"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Tenant:"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:k.tenant||"Not specified"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Last Updated:"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:E(k.update_time)})]})]})]})},k.id))})]})]})},m3=()=>{const{id:r}=da(),n=St(),i=r==="new",[l,o]=x.useState(null),[d,f]=x.useState(!0),[h,g]=x.useState(null),[p,y]=x.useState(i),[b,j]=x.useState(!1),[N,w]=x.useState(null),[S,E]=x.useState(!1),[k,A]=x.useState(!1),[O,L]=x.useState({username:"",full_name:"",email:"",profile_image:"",role:"",password:"",tenant:""}),[B,V]=x.useState(!1),[$,le]=x.useState(!1);x.useEffect(()=>{(async()=>{var R,v;if(!r){g("User ID is required"),f(!1);return}if(i){L({username:"",full_name:"",email:"",profile_image:"",role:"",password:"",tenant:""}),f(!1);return}try{f(!0);const I=(await Ue.get(`/api/users/${r}`)).data;o(I),L({username:I.username||"",full_name:I.full_name||"",email:I.email||"",profile_image:I.profile_image||"",role:I.role||"",password:"",tenant:""}),g(null)}catch(M){console.error("Error fetching user:",M),g(((v=(R=M.response)==null?void 0:R.data)==null?void 0:v.detail)||"Failed to load user details"),o(null)}finally{f(!1)}})()},[r,i]),x.useEffect(()=>{if(i){const T=O.username.trim()!==""&&O.email.trim()!=="";V(T)}else{if(!l)return;const T=O.username!==(l.username||"")||O.full_name!==(l.full_name||"")||O.email!==(l.email||"")||O.profile_image!==(l.profile_image||"")||O.role!==(l.role||"")||O.password.trim()!==""||O.tenant.trim()!=="";V(T)}},[O,l,i]);const q=(T,R)=>{w({type:T,message:R}),setTimeout(()=>{w(null)},5e3)},K=()=>{y(!0)},ae=()=>{if(i){n("/users");return}l&&(L({username:l.username||"",full_name:l.full_name||"",email:l.email||"",profile_image:l.profile_image||"",role:l.role||"",password:l.password||"",tenant:l.tenant||""}),y(!1),V(!1))},G=async()=>{var T,R;if(B)try{if(j(!0),i){const v={...O},I=(await Ue.post("/api/users",v)).data;q("success","User created successfully!"),n(`/user/${I.id}`)}else{if(!l)return;const v={id:l.id,...O},I=(await Ue.put(`/api/users/${l.id}`,v)).data;o(I),y(!1),V(!1),L({username:I.username||"",full_name:I.full_name||"",email:I.email||"",profile_image:I.profile_image||"",role:I.role||"",password:I.password||"",tenant:I.tenant||""}),q("success","User updated successfully!")}}catch(v){console.error("Error saving user:",v);const M=i?"create":"update";q("error",((R=(T=v.response)==null?void 0:T.data)==null?void 0:R.detail)||`Failed to ${M} user`)}finally{j(!1)}},Z=(T,R)=>{L(v=>({...v,[T]:R}))},z=()=>{E(!0)},H=async()=>{var T,R;if(l)try{A(!0),await Ue.delete(`/api/users/${l.id}`),q("success","User deleted successfully"),setTimeout(()=>{n("/users")},1e3)}catch(v){console.error("Error deleting user:",v);const M=((R=(T=v.response)==null?void 0:T.data)==null?void 0:R.detail)||"Failed to delete user";q("error",M)}finally{A(!1),E(!1)}},C=()=>{E(!1)},U=T=>{if(!T||T===""||T==="undefined"||T==="null")return"Not available";try{const R=new Date(T);return isNaN(R.getTime())?"Not available":R.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return"Not available"}};return d?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):h?t.jsxs("div",{children:[t.jsxs(Xe,{color:"failure",className:"mb-6",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",h]}),t.jsx(X,{onClick:()=>n("/users"),color:"gray",children:"Back to Users"})]}):!l&&!i?t.jsxs("div",{children:[t.jsx(Xe,{color:"warning",className:"mb-6",children:"User not found"}),t.jsx(X,{onClick:()=>n("/users"),color:"gray",children:"Back to Users"})]}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{className:"mb-6",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/users",icon:Gi,children:"Users"}),t.jsx(Le,{children:i?"New User":(l==null?void 0:l.username)||`User ${l==null?void 0:l.id}`})]}),N&&t.jsxs(Xe,{color:N.type==="success"?"success":"failure",className:"mb-6",onDismiss:()=>w(null),children:[t.jsx("span",{className:"font-medium",children:N.type==="success"?"Success:":"Error:"})," ",N.message]}),t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Gi,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"User Details"}),t.jsx("div",{className:"flex flex-col sm:flex-row gap-2",children:p?t.jsxs(t.Fragment,{children:[t.jsxs(X,{onClick:G,disabled:!B||b,color:"blue",children:[t.jsx(Rn,{className:"mr-2 h-4 w-4"}),b?"Saving...":i?"Create":"Save"]}),t.jsxs(X,{onClick:ae,disabled:b,color:"gray",children:[t.jsx(ds,{className:"mr-2 h-4 w-4"}),"Cancel"]})]}):t.jsxs(t.Fragment,{children:[t.jsxs(X,{onClick:K,color:"blue",children:[t.jsx(Yi,{className:"mr-2 h-4 w-4"}),"Edit"]}),!i&&t.jsxs(X,{onClick:z,color:"blue",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete"]})]})})]})}),t.jsx(qe,{children:t.jsxs("div",{className:"space-y-6",children:[!i&&t.jsxs("div",{children:[t.jsx(se,{htmlFor:"user-id",children:"User ID"}),t.jsx(Me,{id:"user-id",type:"text",value:(l==null?void 0:l.id)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"username",children:"Username"}),p?t.jsx(Me,{id:"username",type:"text",value:O.username,onChange:T=>Z("username",T.target.value),placeholder:"Enter username",className:"mt-1",required:!0}):t.jsx(Me,{id:"username",type:"text",value:(l==null?void 0:l.username)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"email",children:"Email"}),p?t.jsx(Me,{id:"email",type:"email",value:O.email,onChange:T=>Z("email",T.target.value),placeholder:"Enter email address",className:"mt-1"}):t.jsx(Me,{id:"email",type:"email",value:(l==null?void 0:l.email)||"",disabled:!0,className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"password",children:"Password"}),p?t.jsxs("div",{className:"relative mt-1",children:[t.jsx(Me,{id:"password",type:$?"text":"password",value:O.password,onChange:T=>Z("password",T.target.value),placeholder:i?"Enter password":"Enter new password (optional)",className:"pr-10",required:i}),t.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600",onClick:()=>le(!$),children:$?t.jsx(gy,{className:"h-5 w-5"}):t.jsx(Ka,{className:"h-5 w-5"})})]}):t.jsxs("div",{className:"relative mt-1",children:[t.jsx(Me,{id:"password",type:$?"text":"password",value:(l==null?void 0:l.password)||"",disabled:!0,className:"pr-10"}),t.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600",onClick:()=>le(!$),children:$?t.jsx(gy,{className:"h-5 w-5"}):t.jsx(Ka,{className:"h-5 w-5"})})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"tenant",children:"Tenant"}),p?t.jsx(Me,{id:"tenant",type:"text",value:O.tenant,onChange:T=>Z("tenant",T.target.value),placeholder:"Enter tenant",className:"mt-1"}):t.jsx(Me,{id:"tenant",type:"text",value:(l==null?void 0:l.tenant)||"",disabled:!0,className:"mt-1"})]}),!i&&t.jsxs("div",{children:[t.jsx(se,{htmlFor:"last-updated",children:"Last Updated"}),t.jsx(Me,{id:"last-updated",type:"text",value:U(l==null?void 0:l.update_time),disabled:!0,className:"mt-1"})]})]})}),t.jsxs(Lt,{show:S,onClose:C,size:"md",dismissible:!0,children:[t.jsx(jr,{children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-500"}),"Confirm Delete"]})}),t.jsx(br,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-700 dark:text-gray-300",children:["Are you sure you want to delete the user ",t.jsxs("strong",{children:['"',l==null?void 0:l.username,'"']}),"?"]}),t.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:"This action cannot be undone. All data associated with this user will be permanently removed."})]})}),t.jsx(vr,{children:t.jsxs("div",{className:"flex flex-col-reverse sm:flex-row gap-2 w-full sm:w-auto",children:[t.jsx(X,{onClick:C,color:"gray",className:"w-full sm:w-auto",children:"Cancel"}),t.jsx(X,{onClick:H,color:"blue",disabled:k,className:"w-full sm:w-auto",children:k?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete User"]})})]})})]})]})};function ol(r){return nt({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",clipRule:"evenodd"},child:[]}]})(r)}function g3(r){return nt({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32L19.513 8.2Z"},child:[]}]})(r)}function Nl(r){return nt({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"},child:[]}]})(r)}function cl(r){return nt({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z",clipRule:"evenodd"},child:[]}]})(r)}const Nr=[{id:1,tenant:"default",space:"space1",space_name:"Default Space",description:"Default workspace for general use",created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z"},{id:2,tenant:"default",space:"space2",space_name:"Research Space",description:"Research and development workspace",created_time:"2024-01-02T00:00:00Z",last_modified:"2024-01-02T00:00:00Z"},{id:3,tenant:"default",space:"space3",space_name:"Analytics Space",description:"Data analytics and reporting workspace",created_time:"2024-01-03T00:00:00Z",last_modified:"2024-01-03T00:00:00Z"}],Kr=[{id:0,space_id:"space1",graph_name:"Global",graph_uri:"http://vital.ai/graph/global",graph_type:"Global Graph",triple_count:0,created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z",description:"Global graph for files not assigned to a specific graph",status:"active"},{id:1,space_id:"space1",graph_name:"knowledge-base",graph_uri:"http://vital.ai/graph/knowledge-base",graph_type:"Knowledge Graph",triple_count:15420,created_time:"2024-01-15T10:30:00Z",last_modified:"2024-01-20T14:15:00Z",description:"Main knowledge base graph",status:"active"},{id:2,space_id:"space1",graph_name:"ontology-core",graph_uri:"http://vital.ai/graph/ontology-core",graph_type:"Ontology",triple_count:8750,created_time:"2024-01-14T14:20:00Z",last_modified:"2024-01-19T11:30:00Z",description:"Core ontology definitions",status:"active"},{id:3,space_id:"space1",graph_name:"user-data",graph_uri:"http://vital.ai/graph/user-data",graph_type:"User Graph",triple_count:2340,created_time:"2024-01-16T09:15:00Z",last_modified:"2024-01-21T16:20:00Z",description:"User-generated content and preferences",status:"active"},{id:0,space_id:"space2",graph_name:"Global",graph_uri:"http://vital.ai/graph/global",graph_type:"Global Graph",triple_count:0,created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z",description:"Global graph for files not assigned to a specific graph",status:"active"},{id:3,space_id:"space2",graph_name:"alpha-entities",graph_uri:"http://vital.ai/graph/alpha-entities",graph_type:"Entity Graph",triple_count:25680,created_time:"2024-01-13T16:45:00Z",last_modified:"2024-01-18T09:20:00Z",description:"Project Alpha entity relationships",status:"active"},{id:4,space_id:"space2",graph_name:"alpha-workflow",graph_uri:"http://vital.ai/graph/alpha-workflow",graph_type:"Process Graph",triple_count:12340,created_time:"2024-01-12T11:20:00Z",last_modified:"2024-01-17T15:45:00Z",description:"Alpha project workflow definitions",status:"processing"},{id:5,space_id:"space2",graph_name:"beta-experiments",graph_uri:"http://vital.ai/graph/beta-experiments",graph_type:"Experimental Graph",triple_count:5670,created_time:"2024-01-11T16:30:00Z",last_modified:"2024-01-18T12:10:00Z",description:"Beta experimental data and results",status:"active"},{id:0,space_id:"space3",graph_name:"Global",graph_uri:"http://vital.ai/graph/global",graph_type:"Global Graph",triple_count:0,created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z",description:"Global graph for files not assigned to a specific graph",status:"active"},{id:5,space_id:"space3",graph_name:"research-dataset",graph_uri:"http://vital.ai/graph/research-dataset",graph_type:"Data Graph",triple_count:45230,created_time:"2024-01-11T09:15:00Z",last_modified:"2024-01-16T13:25:00Z",description:"Research data relationships",status:"active"},{id:6,space_id:"space3",graph_name:"analysis-results",graph_uri:"http://vital.ai/graph/analysis-results",graph_type:"Results Graph",triple_count:18920,created_time:"2024-01-10T13:30:00Z",last_modified:"2024-01-15T10:40:00Z",description:"Analysis results and conclusions",status:"inactive"}],x3=[{id:1,space_id:"space1",graph_id:0,filename:"document1.pdf",file_path:"/uploads/document1.pdf",file_size:2048576,file_type:"application/pdf",upload_time:"2024-01-15T10:30:00Z",last_modified:"2024-01-15T10:30:00Z"},{id:2,space_id:"space1",graph_id:1,filename:"meeting-notes.docx",file_path:"/uploads/meeting-notes.docx",file_size:512e3,file_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",upload_time:"2024-01-14T14:20:00Z",last_modified:"2024-01-16T09:15:00Z"},{id:7,space_id:"space1",graph_id:2,filename:"ontology-spec.owl",file_path:"/uploads/ontology-spec.owl",file_size:1024e3,file_type:"application/rdf+xml",upload_time:"2024-01-13T12:00:00Z",last_modified:"2024-01-18T16:30:00Z"},{id:3,space_id:"space2",graph_id:0,filename:"alpha-requirements.pdf",file_path:"/uploads/alpha-requirements.pdf",file_size:1536e3,file_type:"application/pdf",upload_time:"2024-01-13T16:45:00Z",last_modified:"2024-01-13T16:45:00Z"},{id:4,space_id:"space2",graph_id:3,filename:"alpha-timeline.xlsx",file_path:"/uploads/alpha-timeline.xlsx",file_size:768e3,file_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",upload_time:"2024-01-12T11:20:00Z",last_modified:"2024-01-15T14:30:00Z"},{id:8,space_id:"space2",graph_id:4,filename:"workflow-definition.json",file_path:"/uploads/workflow-definition.json",file_size:256e3,file_type:"application/json",upload_time:"2024-01-11T14:15:00Z",last_modified:"2024-01-17T10:45:00Z"},{id:5,space_id:"space3",graph_id:0,filename:"research-data.csv",file_path:"/uploads/research-data.csv",file_size:3072e3,file_type:"text/csv",upload_time:"2024-01-11T09:15:00Z",last_modified:"2024-01-14T16:45:00Z"},{id:6,space_id:"space3",graph_id:5,filename:"analysis-report.pdf",file_path:"/uploads/analysis-report.pdf",file_size:256e4,file_type:"application/pdf",upload_time:"2024-01-10T13:30:00Z",last_modified:"2024-01-12T10:20:00Z"},{id:9,space_id:"space3",graph_id:6,filename:"statistical-output.txt",file_path:"/uploads/statistical-output.txt",file_size:128e3,file_type:"text/plain",upload_time:"2024-01-09T11:00:00Z",last_modified:"2024-01-15T09:20:00Z"}],kl=({spaceId:r,graphId:n,currentPageName:i,currentPageIcon:l,className:o="mb-6",parentPageName:d,parentPagePath:f,parentPageIcon:h})=>{if(!(r&&n))return null;const g=Nr.find(b=>b.space===r),p=parseInt(n),y=Kr.find(b=>b.id===p&&b.space_id===r);return!g||!y?null:t.jsxs(La,{className:o,children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/spaces",icon:Vr,children:"Spaces"}),t.jsx(Le,{href:`/space/${r}`,children:g.space_name}),t.jsx(Le,{href:`/space/${r}/graphs`,icon:Pr,children:"Graphs"}),t.jsx(Le,{href:`/space/${r}/graph/${n}`,children:y.graph_name}),d&&f&&h?t.jsxs(t.Fragment,{children:[t.jsx(Le,{href:f,icon:h,children:d}),t.jsx(Le,{children:i})]}):t.jsx(Le,{icon:l,children:i})]})},xy=()=>{const r=St(),{spaceId:n,graphId:i}=da(),l=x.useRef(null),o=x.useRef(0),[d,f]=x.useState([]),[h,g]=x.useState(!0),[p,y]=x.useState(null),[b,j]=x.useState(""),[N,w]=x.useState(!1),[S,E]=x.useState([]),[k,A]=x.useState(n||""),[O,L]=x.useState(!0),[B,V]=x.useState([]),[$,le]=x.useState(i?parseInt(i):"");x.useEffect(()=>{k&&$!==""&&!n&&!i&&r(`/space/${k}/graph/${$}/files`)},[k,$,r,n,i]);const[q,K]=x.useState(!1),ae=x.useCallback(async()=>{E([{id:1,tenant:"default",space:"space1",space_name:"Default Space",space_description:"Default workspace for general files",update_time:"2024-01-15T10:00:00Z"},{id:2,tenant:"default",space:"space2",space_name:"Project Alpha",space_description:"Files related to Project Alpha",update_time:"2024-01-14T15:30:00Z"},{id:3,tenant:"default",space:"space3",space_name:"Research Data",space_description:"Research datasets and documentation",update_time:"2024-01-13T09:20:00Z"}]),L(!1)},[]);x.useEffect(()=>{ae()},[ae]);const G=x.useCallback(async()=>{if(!k){V([]);return}K(!0);const R=[{id:0,space_id:"space1",graph_name:"Global",graph_uri:"http://vital.ai/graph/global",graph_type:"Global Graph",triple_count:0,created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z",description:"Global graph for files not assigned to a specific graph",status:"active"},{id:1,space_id:"space1",graph_name:"knowledge-base",graph_uri:"http://vital.ai/graph/knowledge-base",graph_type:"Knowledge Graph",triple_count:15420,created_time:"2024-01-15T10:30:00Z",last_modified:"2024-01-20T14:15:00Z",description:"Main knowledge base graph",status:"active"},{id:2,space_id:"space1",graph_name:"ontology-core",graph_uri:"http://vital.ai/graph/ontology-core",graph_type:"Ontology",triple_count:8750,created_time:"2024-01-14T14:20:00Z",last_modified:"2024-01-19T11:30:00Z",description:"Core ontology definitions",status:"active"},{id:0,space_id:"space2",graph_name:"Global",graph_uri:"http://vital.ai/graph/global",graph_type:"Global Graph",triple_count:0,created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z",description:"Global graph for files not assigned to a specific graph",status:"active"},{id:3,space_id:"space2",graph_name:"alpha-entities",graph_uri:"http://vital.ai/graph/alpha-entities",graph_type:"Entity Graph",triple_count:25680,created_time:"2024-01-13T16:45:00Z",last_modified:"2024-01-18T09:20:00Z",description:"Project Alpha entity relationships",status:"active"},{id:4,space_id:"space2",graph_name:"alpha-workflow",graph_uri:"http://vital.ai/graph/alpha-workflow",graph_type:"Process Graph",triple_count:12340,created_time:"2024-01-12T11:20:00Z",last_modified:"2024-01-17T15:45:00Z",description:"Alpha project workflow definitions",status:"processing"},{id:0,space_id:"space3",graph_name:"Global",graph_uri:"http://vital.ai/graph/global",graph_type:"Global Graph",triple_count:0,created_time:"2024-01-01T00:00:00Z",last_modified:"2024-01-01T00:00:00Z",description:"Global graph for files not assigned to a specific graph",status:"active"},{id:5,space_id:"space3",graph_name:"research-dataset",graph_uri:"http://vital.ai/graph/research-dataset",graph_type:"Data Graph",triple_count:45230,created_time:"2024-01-11T09:15:00Z",last_modified:"2024-01-16T13:25:00Z",description:"Research data relationships",status:"active"},{id:6,space_id:"space3",graph_name:"analysis-results",graph_uri:"http://vital.ai/graph/analysis-results",graph_type:"Results Graph",triple_count:18920,created_time:"2024-01-10T13:30:00Z",last_modified:"2024-01-15T10:40:00Z",description:"Analysis results and conclusions",status:"inactive"}].filter(v=>v.space_id===k);V(R),K(!1)},[k]);x.useEffect(()=>{G(),i||le("")},[G,i]);const Z=x.useCallback(async()=>{if(k)try{g(!0);const T=[{id:1,space_id:"space1",graph_id:0,filename:"document1.pdf",file_path:"/uploads/document1.pdf",file_size:2048576,file_type:"application/pdf",upload_time:"2024-01-15T10:30:00Z",last_modified:"2024-01-15T10:30:00Z"},{id:2,space_id:"space1",graph_id:1,filename:"meeting-notes.docx",file_path:"/uploads/meeting-notes.docx",file_size:512e3,file_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",upload_time:"2024-01-14T14:20:00Z",last_modified:"2024-01-16T09:15:00Z"},{id:7,space_id:"space1",graph_id:2,filename:"ontology-spec.owl",file_path:"/uploads/ontology-spec.owl",file_size:1024e3,file_type:"application/rdf+xml",upload_time:"2024-01-13T12:00:00Z",last_modified:"2024-01-18T16:30:00Z"},{id:3,space_id:"space2",graph_id:0,filename:"alpha-requirements.pdf",file_path:"/uploads/alpha-requirements.pdf",file_size:1536e3,file_type:"application/pdf",upload_time:"2024-01-13T16:45:00Z",last_modified:"2024-01-13T16:45:00Z"},{id:4,space_id:"space2",graph_id:3,filename:"alpha-timeline.xlsx",file_path:"/uploads/alpha-timeline.xlsx",file_size:768e3,file_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",upload_time:"2024-01-12T11:20:00Z",last_modified:"2024-01-15T14:30:00Z"},{id:8,space_id:"space2",graph_id:4,filename:"workflow-definition.json",file_path:"/uploads/workflow-definition.json",file_size:256e3,file_type:"application/json",upload_time:"2024-01-11T14:15:00Z",last_modified:"2024-01-17T10:45:00Z"},{id:5,space_id:"space3",graph_id:0,filename:"research-data.csv",file_path:"/uploads/research-data.csv",file_size:3072e3,file_type:"text/csv",upload_time:"2024-01-11T09:15:00Z",last_modified:"2024-01-14T16:45:00Z"},{id:6,space_id:"space3",graph_id:5,filename:"analysis-report.pdf",file_path:"/uploads/analysis-report.pdf",file_size:256e4,file_type:"application/pdf",upload_time:"2024-01-10T13:30:00Z",last_modified:"2024-01-12T10:20:00Z"},{id:9,space_id:"space3",graph_id:6,filename:"statistical-output.txt",file_path:"/uploads/statistical-output.txt",file_size:128e3,file_type:"text/plain",upload_time:"2024-01-09T11:00:00Z",last_modified:"2024-01-15T09:20:00Z"}],R=T.filter(M=>M.space_id===k),v=$!==""?R.filter(M=>M.graph_id===$):[];console.log("Files Debug:",{selectedSpace:k,selectedGraph:$,totalFiles:T.length,spaceFiles:R.length,filteredFiles:v.length,mockFiles:v}),f(v),y(null)}catch{y("Failed to load files. Please try again later."),f([])}finally{g(!1)}},[k,$]),z=x.useCallback(async T=>{if(!(!k||$==="")){if(!T.trim()){if(h)return;await Z();return}try{w(!0);const M=[{id:1,space_id:"space1",graph_id:0,filename:"document1.pdf",file_path:"/uploads/document1.pdf",file_size:2048576,file_type:"application/pdf",upload_time:"2024-01-15T10:30:00Z",last_modified:"2024-01-15T10:30:00Z"},{id:2,space_id:"space1",graph_id:1,filename:"meeting-notes.docx",file_path:"/uploads/meeting-notes.docx",file_size:512e3,file_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",upload_time:"2024-01-14T14:20:00Z",last_modified:"2024-01-16T09:15:00Z"},{id:7,space_id:"space1",graph_id:2,filename:"ontology-spec.owl",file_path:"/uploads/ontology-spec.owl",file_size:1024e3,file_type:"application/rdf+xml",upload_time:"2024-01-13T12:00:00Z",last_modified:"2024-01-18T16:30:00Z"},{id:3,space_id:"space2",graph_id:0,filename:"alpha-requirements.pdf",file_path:"/uploads/alpha-requirements.pdf",file_size:1536e3,file_type:"application/pdf",upload_time:"2024-01-13T16:45:00Z",last_modified:"2024-01-13T16:45:00Z"},{id:4,space_id:"space2",graph_id:3,filename:"alpha-timeline.xlsx",file_path:"/uploads/alpha-timeline.xlsx",file_size:768e3,file_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",upload_time:"2024-01-12T11:20:00Z",last_modified:"2024-01-15T14:30:00Z"},{id:8,space_id:"space2",graph_id:4,filename:"workflow-definition.json",file_path:"/uploads/workflow-definition.json",file_size:256e3,file_type:"application/json",upload_time:"2024-01-11T14:15:00Z",last_modified:"2024-01-17T10:45:00Z"},{id:5,space_id:"space3",graph_id:0,filename:"research-data.csv",file_path:"/uploads/research-data.csv",file_size:3072e3,file_type:"text/csv",upload_time:"2024-01-11T09:15:00Z",last_modified:"2024-01-14T16:45:00Z"},{id:6,space_id:"space3",graph_id:5,filename:"analysis-report.pdf",file_path:"/uploads/analysis-report.pdf",file_size:256e4,file_type:"application/pdf",upload_time:"2024-01-10T13:30:00Z",last_modified:"2024-01-12T10:20:00Z"},{id:9,space_id:"space3",graph_id:6,filename:"statistical-output.txt",file_path:"/uploads/statistical-output.txt",file_size:128e3,file_type:"text/plain",upload_time:"2024-01-09T11:00:00Z",last_modified:"2024-01-15T09:20:00Z"}].filter(I=>I.space_id===k&&I.graph_id===$).filter(I=>I.filename.toLowerCase().includes(T.toLowerCase()));f(M),y(null)}catch(R){console.error("Error filtering files:",R),y("Failed to filter files. Please try again later."),f([])}finally{w(!1)}}},[k,$,h,Z]);x.useEffect(()=>{k&&$!==""?Z():f([])},[k,$,Z]),x.useEffect(()=>{const T=setTimeout(()=>{z(b)},300);return()=>clearTimeout(T)},[b,z]),x.useLayoutEffect(()=>{l.current&&l.current.setSelectionRange(o.current,o.current)},[b]);const H=T=>{r(n&&i?`/space/${n}/graph/${i}/file/${T.id}`:`/file/${T.id}`)},C=T=>{try{return new Date(T).toLocaleString()}catch{return"Invalid date"}},U=T=>{if(T===0)return"0 Bytes";const R=1024,v=["Bytes","KB","MB","GB"],M=Math.floor(Math.log(T)/Math.log(R));return parseFloat((T/Math.pow(R,M)).toFixed(2))+" "+v[M]};return t.jsxs("div",{className:"space-y-6",children:[t.jsx(kl,{spaceId:n,graphId:i,currentPageName:"Files",currentPageIcon:ll}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(ll,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Files"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage files and documents within your graphs"})]}),k&&$!==""&&t.jsxs(X,{color:"blue",className:"mt-4 sm:mt-0",onClick:()=>r(`/space/${k}/graph/${$}/file/new`),children:[t.jsx(Nl,{className:"mr-2 h-4 w-4"}),"Upload File"]})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"space-select",children:"Select Space"}),t.jsxs(rt,{id:"space-select",value:k,onChange:T=>A(T.target.value),disabled:O,children:[t.jsx("option",{value:"",children:"Choose a space..."}),O?t.jsx("option",{value:"",disabled:!0,children:"Loading spaces..."}):S.length===0?t.jsx("option",{value:"",disabled:!0,children:"No spaces available"}):S.map(T=>t.jsx("option",{value:T.space,children:T.space_name||T.space},T.space))]})]}),t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"graph-select",children:"Select Graph"}),t.jsxs(rt,{id:"graph-select",value:$,onChange:T=>le(T.target.value===""?"":parseInt(T.target.value)),disabled:!k||q,children:[t.jsx("option",{value:"",children:"Choose a graph..."}),q?t.jsx("option",{value:"",disabled:!0,children:"Loading graphs..."}):B.length===0?t.jsx("option",{value:"",disabled:!0,children:"No graphs available"}):B.map(T=>t.jsx("option",{value:T.id,children:T.graph_name},T.id))]})]})]}),k&&$!==""&&t.jsxs("div",{className:"relative",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Qa,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),t.jsx(Me,{ref:l,type:"text",placeholder:"Search files by name...",value:b,onChange:T=>{o.current=T.target.selectionStart||0,j(T.target.value)},className:"pl-10",onKeyDown:T=>{o.current=T.currentTarget.selectionStart||0},onClick:T=>{o.current=T.currentTarget.selectionStart||0},disabled:N}),N&&t.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:t.jsx(He,{size:"sm"})})]}),b&&t.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:N?"Filtering...":`Showing results for "${b}"`})]}),p&&t.jsxs(Xe,{color:"failure",className:"mb-6",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",p]}),!k&&!O&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view files"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see available graphs."})]})}),k&&$===""&&!q&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a graph to view files"}),t.jsx("p",{className:"text-sm",children:"Choose a graph from the dropdown above to see its files."})]})}),k&&$!==""&&d.length===0&&!h&&!p?t.jsx(Xe,{color:"info",children:b?`No files found matching "${b}". Try a different search term.`:"No files found in this graph. Upload your first file to get started."}):k&&$!==""&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hidden md:block overflow-x-auto",children:t.jsxs(Yt,{striped:!0,children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"ID"}),t.jsx(he,{children:"Filename"}),t.jsx(he,{children:"Type"}),t.jsx(he,{children:"Size"}),t.jsx(he,{children:"Upload Time"}),t.jsx(he,{children:"Last Modified"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:d.map(T=>t.jsxs(at,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:[t.jsx(fe,{className:"whitespace-nowrap font-medium text-gray-900 dark:text-white",children:T.id}),t.jsx(fe,{className:"font-medium text-gray-900 dark:text-white",children:T.filename}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:T.file_type||"Unknown"}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:U(T.file_size)}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:C(T.upload_time)}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:C(T.last_modified)}),t.jsx(fe,{children:t.jsxs(X,{size:"sm",color:"blue",onClick:()=>H(T),children:[t.jsx(ol,{className:"mr-2 h-4 w-4"}),"Details"]})})]},T.id))})]})}),t.jsx("div",{className:"md:hidden space-y-4",children:d.map(T=>t.jsx(qe,{className:"w-full",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between items-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:T.filename}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["ID: ",T.id]})]}),t.jsxs(X,{size:"sm",color:"blue",onClick:()=>H(T),children:[t.jsx(ol,{className:"mr-1 h-4 w-4"}),"Details"]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:"Type:"}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:T.file_type||"Unknown"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:"Size:"}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:U(T.file_size)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:"Uploaded:"}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:C(T.upload_time)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:"Modified:"}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:C(T.last_modified)})]})]})]})},T.id))})]}),h&&k&&$!==""&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsx(He,{size:"lg"})})]})},y3=()=>{var K;const{spaceId:r,graphId:n,fileId:i}=da(),l=St(),[o,d]=x.useState(null),[f,h]=x.useState(!0),[g]=x.useState(null),[p,y]=x.useState(!1),[b]=x.useState(!1),[j]=x.useState(!1),[N,w]=x.useState(!1),[S,E]=x.useState(!1),[k,A]=x.useState({filename:"",file_type:"",description:""});x.useEffect(()=>{setTimeout(()=>{const ae=parseInt(i||"0"),G=x3.find(Z=>Z.id===ae);d(G||null),A({filename:(G==null?void 0:G.filename)||"",file_type:(G==null?void 0:G.file_type)||"",description:""}),h(!1)},500)},[i,r,n]),x.useEffect(()=>{if(!o)return;const ae=k.filename!==o.filename||k.description!==""||k.file_type!==o.file_type;E(ae)},[k,o]);const O=()=>{y(!0)},L=()=>{o&&A({filename:o.filename,description:"",file_type:o.file_type}),y(!1)},B=()=>{alert("Save functionality will be available when backend is ready"),y(!1)},V=()=>{alert("Delete functionality will be available when backend is ready"),w(!1)},$=()=>{alert("Download functionality will be available when backend is ready")},le=ae=>{try{return new Date(ae).toLocaleString()}catch{return"Invalid date"}},q=ae=>{if(ae===0)return"0 Bytes";const G=1024,Z=["Bytes","KB","MB","GB"],z=Math.floor(Math.log(ae)/Math.log(G));return parseFloat((ae/Math.pow(G,z)).toFixed(2))+" "+Z[z]};return f?t.jsx("div",{className:"flex justify-center items-center min-h-64",children:t.jsx(He,{size:"lg"})}):o?t.jsxs("div",{className:"space-y-6",children:[t.jsx(kl,{spaceId:r,graphId:n,currentPageName:o.filename,currentPageIcon:r3,parentPageName:"Files",parentPagePath:r&&n?`/space/${r}/graph/${n}/files`:"/files",parentPageIcon:ll}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(X,{color:"gray",size:"sm",onClick:()=>{l(r&&n?`/space/${r}/graph/${n}/files`:"/files")},children:"← Back to Files"})}),g&&t.jsxs(Xe,{color:"failure",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",g]}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ll,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:o.filename})]}),t.jsx("p",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300",children:"View and manage file details"})]}),t.jsxs("div",{className:"flex gap-2 mt-4 sm:mt-0",children:[t.jsxs(X,{color:"blue",onClick:$,children:[t.jsx(pr,{className:"mr-2 h-4 w-4"}),"Download"]}),!p&&t.jsxs(X,{color:"blue",onClick:O,children:[t.jsx(Yi,{className:"mr-2 h-4 w-4"}),"Edit"]}),!p&&t.jsxs(X,{color:"red",onClick:()=>w(!0),children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),t.jsx(qe,{children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"File Information"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"filename",children:"Filename"}),t.jsx(Me,{id:"filename",type:"text",value:k.filename,onChange:ae=>A({...k,filename:ae.target.value}),disabled:!p,required:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"file_type",children:"File Type"}),t.jsx(Me,{id:"file_type",type:"text",value:k.file_type,onChange:ae=>A({...k,file_type:ae.target.value}),disabled:!p})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"file_size",children:"File Size"}),t.jsx(Me,{id:"file_size",type:"text",value:q(o.file_size),disabled:!0})]}),r&&t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space",children:"Space"}),t.jsx(Me,{id:"space",type:"text",value:((K=Nr.find(ae=>ae.space===r))==null?void 0:K.space_name)||r,disabled:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"upload_time",children:"Upload Time"}),t.jsx(Me,{id:"upload_time",type:"text",value:le(o.upload_time),disabled:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"last_modified",children:"Last Modified"}),t.jsx(Me,{id:"last_modified",type:"text",value:le(o.last_modified),disabled:!0})]})]}),t.jsxs("div",{className:"mt-6",children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",rows:4,value:k.description,onChange:ae=>A({...k,description:ae.target.value}),disabled:!p,placeholder:"Enter file description..."})]})]}),p&&t.jsxs("div",{className:"flex gap-3 pt-4 border-t border-gray-200 dark:border-gray-700",children:[t.jsx(X,{color:"blue",onClick:B,disabled:b||!S,children:b?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Saving..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Rn,{className:"mr-2 h-4 w-4"}),"Save Changes"]})}),t.jsxs(X,{color:"gray",onClick:L,disabled:b,children:[t.jsx(ds,{className:"mr-2 h-4 w-4"}),"Cancel"]})]})]})}),t.jsxs(Lt,{show:N,onClose:()=>w(!1),children:[t.jsxs(jr,{children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-600"}),"Confirm Deletion"]}),t.jsxs(br,{children:[t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to delete this file? This action cannot be undone."}),t.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:o.filename}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Size: ",q(o.file_size)]})]})]}),t.jsxs(vr,{children:[t.jsx(X,{color:"red",onClick:V,disabled:j,children:j?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete File"]})}),t.jsx(X,{color:"gray",onClick:()=>w(!1),disabled:j,children:"Cancel"})]})]})]}):t.jsx("div",{className:"space-y-6",children:t.jsxs(Xe,{color:"failure",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," File not found"]})})},b3=()=>{const{spaceId:r,graphId:n}=da(),i=St(),l=x.useRef(null),[o,d]=x.useState(null),[f,h]=x.useState(null),[g,p]=x.useState({name:"",description:"",file:null}),[y,b]=x.useState(!1),[j,N]=x.useState(!1),[w,S]=x.useState(0),[E,k]=x.useState(null),[A,O]=x.useState(!1);mr.useEffect(()=>{if(r){const z=Nr.find(H=>H.space===r);d(z||null)}if(n){const z=Kr.find(H=>H.id===parseInt(n));h(z||null)}},[r,n]);const L=z=>{if(!z||z.length===0)return;const H=z[0];p(C=>({...C,file:H})),k(null)},B=z=>{z.preventDefault(),b(!0)},V=z=>{z.preventDefault(),b(!1)},$=z=>{z.preventDefault(),b(!1),L(z.dataTransfer.files)},le=()=>{p(z=>({...z,file:null})),l.current&&(l.current.value="")},q=()=>{i(`/space/${r}/graph/${n}/files`)},K=async()=>{var z,H;if(!g.file||!g.name.trim()){k("Please provide a file name and select a file to upload.");return}N(!0),k(null),S(0);try{const C=new FormData;C.append("file",g.file),C.append("name",g.name.trim()),C.append("description",g.description.trim()),C.append("space_id",r||""),C.append("graph_id",n||"");const U=await Ue.post("/api/files/upload",C,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:T=>{if(T.total){const R=Math.round(T.loaded*100/T.total);S(R)}}});O(!0),console.log("Upload successful:",U.data)}catch(C){console.error("Upload failed:",C),k(((H=(z=C.response)==null?void 0:z.data)==null?void 0:H.detail)||"Failed to upload file. Please try again.")}finally{N(!1)}},ae=()=>{p({name:"",description:"",file:null}),O(!1),k(null),S(0),l.current&&(l.current.value="")},G=z=>{if(z===0)return"0 Bytes";const H=1024,C=["Bytes","KB","MB","GB"],U=Math.floor(Math.log(z)/Math.log(H));return parseFloat((z/Math.pow(H,U)).toFixed(2))+" "+C[U]},Z=g.file&&g.name.trim().length>0;return t.jsxs("div",{className:"p-6",children:[t.jsxs(La,{className:"mb-6",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),o&&t.jsx(Le,{href:`/spaces/${r}`,children:o.space_name}),t.jsx(Le,{href:`/space/${r}/graphs`,children:"Graphs"}),f&&t.jsx(Le,{href:`/space/${r}/graph/${n}`,children:f.graph_name}),t.jsx(Le,{href:`/space/${r}/graph/${n}/files`,children:"Files"}),t.jsx(Le,{children:"Upload"})]}),t.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[t.jsx(Mi,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Upload Files"})]}),o&&f&&t.jsx("div",{className:"mb-6",children:t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Uploading to ",t.jsx("span",{className:"font-medium",children:o.space_name})," → ",t.jsx("span",{className:"font-medium",children:f.graph_name})]})}),t.jsxs("div",{className:"max-w-4xl",children:[t.jsx(qe,{className:"mb-6",children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs(se,{htmlFor:"fileName",className:"mb-2 block",children:["File Name ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx(Me,{id:"fileName",placeholder:"Enter a short descriptive name for this file",value:g.name,onChange:z=>p(H=>({...H,name:z.target.value})),disabled:j||A,required:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"fileDescription",className:"mb-2 block",children:"Description"}),t.jsx(_a,{id:"fileDescription",placeholder:"Enter a longer description of this file's contents and purpose",value:g.description,onChange:z=>p(H=>({...H,description:z.target.value})),disabled:j||A,rows:3})]}),t.jsxs("div",{children:[t.jsxs(se,{className:"mb-2 block",children:["File ",t.jsx("span",{className:"text-red-500",children:"*"})]}),g.file?t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(my,{className:"h-5 w-5 text-blue-500"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:g.file.name}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[G(g.file.size)," • ",g.file.type||"Unknown type"]})]})]}),!j&&!A&&t.jsx(X,{size:"xs",color:"gray",onClick:le,children:t.jsx(ds,{className:"h-3 w-3"})})]}):t.jsxs("div",{className:`border-2 border-dashed rounded-lg p-8 text-center transition-colors ${y?"border-blue-400 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}`,onDragOver:B,onDragLeave:V,onDrop:$,children:[t.jsx(Mi,{className:"mx-auto h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"Drop a file here or click to browse"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Supported formats: RDF/XML, Turtle, N-Triples, JSON-LD, N-Quads"}),t.jsxs(X,{color:"blue",onClick:()=>{var z;return(z=l.current)==null?void 0:z.click()},disabled:j||A,children:[t.jsx(my,{className:"mr-2 h-4 w-4"}),"Choose File"]}),t.jsx("input",{ref:l,type:"file",accept:".rdf,.xml,.ttl,.nt,.jsonld,.nq,.n3",onChange:z=>L(z.target.files),className:"hidden"})]})]}),j&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-2",children:[t.jsx("span",{children:"Uploading..."}),t.jsxs("span",{children:[w,"%"]})]}),t.jsx(yr,{progress:w,size:"sm"})]}),E&&t.jsxs(Xe,{color:"failure",children:[t.jsx(Mn,{className:"h-4 w-4"}),t.jsx("span",{className:"font-medium",children:"Upload failed:"})," ",E]}),t.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-200 dark:border-gray-600",children:[t.jsx(X,{color:"gray",onClick:q,disabled:j,children:"Cancel"}),t.jsx(X,{color:"blue",onClick:K,disabled:!Z||j||A,children:j?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Uploading..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Mi,{className:"mr-2 h-4 w-4"}),"Upload File"]})})]})]})}),A&&t.jsx(qe,{children:t.jsxs("div",{className:"text-center",children:[t.jsx(e3,{className:"mx-auto h-12 w-12 text-green-500 mb-4"}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"Upload Complete!"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"Your file has been uploaded successfully."}),t.jsxs("div",{className:"flex justify-center gap-3",children:[t.jsx(X,{color:"blue",onClick:q,children:"View Files"}),t.jsx(X,{color:"gray",onClick:ae,children:"Upload Another File"})]})]})})]})]})},yy=r=>{if(!r)return"Unknown Graph";const n=r.split(/[/#]/),i=n[n.length-1];return!i||i.length===0?r.includes("global")?"Global":r.includes("default")?"Default":"Graph":i.replace(/[-_]/g," ").replace(/\b\w/g,l=>l.toUpperCase())},by=r=>{if(!r)return"Graph";const n=r.toLowerCase();return n.includes("global")?"Global Graph":n.includes("ontology")?"Ontology":n.includes("knowledge")?"Knowledge Graph":n.includes("user")?"User Graph":n.includes("entity")?"Entity Graph":n.includes("process")||n.includes("workflow")?"Process Graph":n.includes("experiment")?"Experimental Graph":n.includes("data")||n.includes("dataset")?"Data Graph":n.includes("result")||n.includes("analysis")?"Results Graph":"Graph"},vy=()=>{const r=St(),{spaceId:n}=da(),[i,l]=x.useState([]),[o,d]=x.useState([]),[f,h]=x.useState(n||""),[g,p]=x.useState(null),[y,b]=x.useState(""),[j,N]=x.useState(!1),[w,S]=x.useState(!0),[E,k]=x.useState(!1),[A,O]=x.useState(null);x.useEffect(()=>{f&&!n&&r(`/space/${f}/graphs`)},[f,r,n]),x.useEffect(()=>{(async()=>{try{S(!0),O(null);const z=(await Vt.getSpaces()).map(H=>({id:H.id||0,tenant:H.tenant||"default",space:H.space,space_name:H.space_name,description:H.space_description||"",created_time:H.created_time,last_modified:H.updated_time}));d(z)}catch(Z){console.error("Error fetching spaces:",Z),O("Failed to load spaces. Please try again later."),d([])}finally{S(!1)}})()},[]);const L=x.useCallback(async()=>{if(!f){l([]);return}try{N(!0),O(null);const Z=(await Vt.getGraphs(f)).map((z,H)=>({id:H,space_id:f,graph_name:yy(z.graph_uri),graph_uri:z.graph_uri,graph_type:by(z.graph_uri),triple_count:z.triple_count||0,created_time:z.created_time||new Date().toISOString(),last_modified:z.updated_time||new Date().toISOString(),description:`Graph containing ${z.triple_count||0} triples`,status:"active"}));l(Z)}catch(G){console.error("Error fetching graphs:",G),O("Failed to load graphs. Please try again later."),l([])}finally{N(!1)}},[f]);x.useEffect(()=>{L()},[L]),x.useEffect(()=>{if(f&&o.length>0){const G=o.find(Z=>Z.space===f);p(G||null)}},[f,o]);const B=x.useCallback(async G=>{if(f){if(!G.trim()){if(j)return;await L();return}try{k(!0),O(null);const z=(await Vt.getGraphs(f)).map((H,C)=>({id:C,space_id:f,graph_name:yy(H.graph_uri),graph_uri:H.graph_uri,graph_type:by(H.graph_uri),triple_count:H.triple_count||0,created_time:H.created_time||new Date().toISOString(),last_modified:H.updated_time||new Date().toISOString(),description:`Graph containing ${H.triple_count||0} triples`,status:"active"})).filter(H=>H.graph_name.toLowerCase().includes(G.toLowerCase())||H.graph_uri.toLowerCase().includes(G.toLowerCase()));l(z)}catch(Z){console.error("Error filtering graphs:",Z),O("Failed to filter graphs. Please try again later."),l([])}finally{k(!1)}}},[f,j,L]),V=()=>{B(y)},$=G=>{G.key==="Enter"&&V()},le=G=>G>=1e6?`${(G/1e6).toFixed(1)}M`:G>=1e3?`${(G/1e3).toFixed(1)}K`:G.toString(),q=G=>new Date(G).toLocaleString(),K=G=>{const Z={active:{color:"success",text:"Active"},inactive:{color:"failure",text:"Inactive"},processing:{color:"warning",text:"Processing"}},z=Z[G]||Z.inactive;return t.jsx(jt,{color:z.color,children:z.text})},ae=async G=>{if(!(!f||!window.confirm(`Are you sure you want to delete the graph "${G.graph_name}"? This action cannot be undone.`)))try{N(!0),O(null),await Vt.deleteGraph(f,G.graph_uri,!0),await L(),console.log(`Graph "${G.graph_name}" deleted successfully`)}catch(z){console.error("Error deleting graph:",z),O(`Failed to delete graph "${G.graph_name}". Please try again later.`)}finally{N(!1)}};return t.jsxs("div",{className:"space-y-6",children:[n&&t.jsxs(La,{className:"mb-6",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/spaces",icon:Vr,children:"Spaces"}),g&&t.jsx(Le,{href:`/space/${g.id}`,children:g.space_name}),t.jsx(Le,{icon:Pr,children:"Graphs"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(Pr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Graphs"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage RDF graphs within your spaces"})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"space-select",children:"Select Space"}),t.jsxs(rt,{id:"space-select",value:f,onChange:G=>h(G.target.value),disabled:w,children:[t.jsx("option",{value:"",children:"Choose a space..."}),w?t.jsx("option",{value:"",disabled:!0,children:"Loading spaces..."}):o.length===0?t.jsx("option",{value:"",disabled:!0,children:"No spaces available"}):o.map(G=>t.jsx("option",{value:G.space,children:G.space_name||G.space},G.space))]})]}),f&&t.jsxs(X,{color:"blue",onClick:()=>r(`/space/${f}/graph/new`),children:[t.jsx(Nl,{className:"mr-2 h-4 w-4"}),"Add Graph"]})]}),f&&t.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsxs("div",{className:"flex-1 max-w-md",children:[t.jsx(se,{htmlFor:"search-input",children:"Search Graphs"}),t.jsx(Me,{id:"search-input",type:"text",placeholder:"Enter graph name...",value:y,onChange:G=>b(G.target.value),onKeyPress:$,disabled:j||E})]}),t.jsxs(X,{onClick:V,disabled:j||E,className:"whitespace-nowrap",children:[t.jsx(Qa,{className:"mr-2 h-4 w-4"}),E?"Searching...":"Search"]})]}),A&&t.jsx("div",{className:"mt-4 p-4 bg-red-50 border border-red-200 rounded-lg dark:bg-red-900/20 dark:border-red-800",children:t.jsx("p",{className:"text-red-800 dark:text-red-200",children:A})}),f&&j&&t.jsxs("div",{className:"mt-8 flex justify-center",children:[t.jsx(He,{size:"lg"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:"Loading graphs..."})]}),f&&!j&&i.length>0&&t.jsx("div",{className:"mt-6",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Graph Name"}),t.jsx(he,{children:"Type"}),t.jsx(he,{children:"Triples"}),t.jsx(he,{children:"Status"}),t.jsx(he,{children:"Last Modified"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:i.map(G=>t.jsxs(at,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:[t.jsx(fe,{className:"whitespace-nowrap font-medium text-gray-900 dark:text-white",children:t.jsxs("div",{children:[t.jsx("div",{className:"font-semibold",children:G.graph_name}),t.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 truncate max-w-xs",children:G.description})]})}),t.jsx(fe,{children:t.jsx(jt,{color:"info",children:G.graph_type})}),t.jsx(fe,{className:"font-mono",children:le(G.triple_count)}),t.jsx(fe,{children:K(G.status)}),t.jsx(fe,{className:"text-sm text-gray-600 dark:text-gray-400",children:q(G.last_modified)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{size:"xs",color:"blue",onClick:()=>r(`/space/${f}/graph/${G.id}`),children:[t.jsx(ol,{className:"h-3 w-3 mr-1"}),"Details"]}),t.jsx(X,{size:"xs",color:"failure",onClick:()=>ae(G),disabled:j,children:t.jsx(cl,{className:"h-3 w-3"})})]})})]},G.id))})]})})}),f&&!j&&i.length===0&&!A&&t.jsx("div",{className:"mt-8 text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"No graphs found"}),t.jsx("p",{className:"text-sm",children:y?`No graphs match "${y}" in the selected space.`:"No graphs are available in the selected space."})]})}),!f&&!w&&t.jsx("div",{className:"mt-8 text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view graphs"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see its graphs."})]})})]})},v3=r=>{if(!r)return"Unknown Graph";const n=r.split(/[/#]/),i=n[n.length-1];return!i||i.length===0?r.includes("global")?"Global":r.includes("default")?"Default":"Graph":i.replace(/[-_]/g," ").replace(/\b\w/g,l=>l.toUpperCase())},j3=r=>{if(!r)return"Graph";const n=r.toLowerCase();return n.includes("global")?"Global Graph":n.includes("ontology")?"Ontology":n.includes("knowledge")?"Knowledge Graph":n.includes("user")?"User Graph":n.includes("entity")?"Entity Graph":n.includes("process")||n.includes("workflow")?"Process Graph":n.includes("experiment")?"Experimental Graph":n.includes("data")||n.includes("dataset")?"Data Graph":n.includes("result")||n.includes("analysis")?"Results Graph":"Graph"},jy=()=>{const{spaceId:r,graphId:n}=da(),i=St(),l=n==="new",o=r,[d,f]=x.useState(null),[h,g]=x.useState(null),[p,y]=x.useState(!0),[b,j]=x.useState(l),[N,w]=x.useState(!1),[S,E]=x.useState(null),[k,A]=x.useState(!1),[O,L]=x.useState(!1),[B,V]=x.useState({graph_name:"",graph_uri:"",graph_type:"Knowledge Graph",description:"",space_id:o||""}),[$,le]=x.useState(!1);x.useEffect(()=>{(async()=>{if(!n||!r){y(!1);return}if(l){try{const T=(await Vt.getSpaces()).find(R=>R.space===r);if(T){const R={id:T.id||0,tenant:T.tenant||"default",space:T.space,space_name:T.space_name,description:T.space_description||"",created_time:T.created_time,last_modified:T.updated_time};g(R)}}catch(U){console.error("Error fetching space info:",U)}f(null),V({graph_name:"",graph_uri:"",graph_type:"Knowledge Graph",description:"",space_id:o||""}),y(!1);return}try{y(!0);const U=await Vt.getGraphs(r),T=parseInt(n),R=U[T];if(!R){E({type:"error",message:"Graph not found"}),y(!1);return}const v={id:T,space_id:r,graph_name:v3(R.graph_uri),graph_uri:R.graph_uri,graph_type:j3(R.graph_uri),triple_count:R.triple_count||0,created_time:R.created_time||new Date().toISOString(),last_modified:R.updated_time||new Date().toISOString(),description:`Graph containing ${R.triple_count||0} triples`,status:"active"},I=(await Vt.getSpaces()).find(ee=>ee.space===r);if(I){const ee={id:I.id||0,tenant:I.tenant||"default",space:I.space,space_name:I.space_name,description:I.space_description||"",created_time:I.created_time,last_modified:I.updated_time};g(ee)}f(v),V({graph_name:v.graph_name,graph_uri:v.graph_uri,graph_type:v.graph_type,description:v.description,space_id:v.space_id})}catch(U){console.error("Error fetching graph:",U),E({type:"error",message:"Failed to load graph data"})}finally{y(!1)}})()},[n,l,o,r]);const q=C=>new Date(C).toLocaleString(),K=C=>{const U={active:{color:"success",text:"Active"},inactive:{color:"failure",text:"Inactive"},processing:{color:"warning",text:"Processing"}},T=U[C]||U.inactive;return t.jsx(jt,{color:T.color,children:T.text})},ae=(C,U)=>{V(T=>({...T,[C]:U})),le(!0)},G=async()=>{if(r){w(!0);try{l?(await Vt.createGraph(r,B.graph_uri),E({type:"success",message:"Graph created successfully!"}),setTimeout(()=>{i(`/space/${r}/graphs`)},2e3)):(E({type:"error",message:"Graph updates not yet supported by backend API"}),j(!1),le(!1))}catch(C){console.error("Error saving graph:",C),E({type:"error",message:`Failed to ${l?"create":"update"} graph. Please try again.`})}finally{w(!1)}}},Z=()=>{l?i("/graphs"):(j(!1),le(!1),d&&V({graph_name:d.graph_name,graph_uri:d.graph_uri,graph_type:d.graph_type,description:d.description,space_id:d.space_id}))},z=async()=>{if(!(!r||!d))try{await Vt.executeGraphOperation(r,"CLEAR",d.graph_uri,void 0,!0),E({type:"success",message:"Graph purged successfully!"}),A(!1),setTimeout(()=>E(null),3e3)}catch(C){console.error("Error purging graph:",C),E({type:"error",message:"Failed to purge graph. Please try again."}),A(!1)}},H=async()=>{if(!(!r||!d))try{await Vt.deleteGraph(r,d.graph_uri,!0),E({type:"success",message:"Graph deleted successfully!"}),L(!1),setTimeout(()=>i(`/space/${r}/graphs`),1500)}catch(C){console.error("Error deleting graph:",C),E({type:"error",message:"Failed to delete graph. Please try again."}),L(!1)}};return p?t.jsx("div",{className:"p-6",children:t.jsxs("div",{className:"flex justify-center items-center h-64",children:[t.jsx(He,{size:"xl"}),t.jsx("span",{className:"ml-3 text-lg text-gray-600 dark:text-gray-400",children:"Loading graph details..."})]})}):!l&&!d&&!p?t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Pr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Graph Details"})]}),t.jsx(Je,{to:"/graphs",children:t.jsx(X,{children:"Back to Graphs"})})]}):t.jsxs("div",{className:"p-6",children:[t.jsxs(La,{className:"mb-6",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/spaces",icon:Vr,children:"Spaces"}),r&&h&&t.jsx(Le,{href:`/space/${h.id}`,children:h.space_name}),t.jsx(Le,{href:r?`/space/${r}/graphs`:"/graphs",icon:Pr,children:"Graphs"}),!l&&n&&t.jsx(Le,{children:(d==null?void 0:d.graph_name)||n}),l&&t.jsx(Le,{children:"New Graph"})]}),S&&t.jsx("div",{className:`mb-6 p-4 rounded-lg ${S.type==="success"?"bg-green-50 border border-green-200 text-green-800 dark:bg-green-900/20 dark:border-green-800 dark:text-green-200":"bg-red-50 border border-red-200 text-red-800 dark:bg-red-900/20 dark:border-red-800 dark:text-red-200"}`,children:S.message}),t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pr,{className:"w-8 h-8 text-blue-600"}),t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-2",children:l?"Create New Graph":(d==null?void 0:d.graph_name)||"Loading..."}),!l&&d&&t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(jt,{color:"info",children:d.graph_type}),K(d.status)]})]}),!l&&d&&t.jsx("div",{className:"flex gap-2",children:b?t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"gray",onClick:Z,disabled:N,children:[t.jsx(ds,{className:"mr-2 h-4 w-4"}),"Cancel"]}),t.jsxs(X,{color:"blue",onClick:G,disabled:N||!$,children:[t.jsx(Rn,{className:"mr-2 h-4 w-4"}),N?"Saving...":"Save"]})]}):t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"blue",onClick:()=>i(`/data/import/new?spaceId=${r}&graphId=${n}`),children:[t.jsx(pr,{className:"mr-2 h-4 w-4"}),"Import"]}),t.jsxs(X,{color:"gray",onClick:()=>i(`/data/export/new?spaceId=${r}&graphId=${n}`),children:[t.jsx(pr,{className:"mr-2 h-4 w-4"}),"Export"]}),t.jsxs(X,{color:"blue",onClick:()=>j(!0),children:[t.jsx(Yi,{className:"mr-2 h-4 w-4"}),"Edit"]}),t.jsxs(X,{color:"red",onClick:()=>A(!0),children:[t.jsx(vh,{className:"mr-2 h-4 w-4"}),"Purge"]}),t.jsxs(X,{color:"red",onClick:()=>L(!0),children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete"]})]})}),l&&t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{color:"success",onClick:G,disabled:N||!B.graph_name||!B.space_id,children:[t.jsx(Rn,{className:"mr-2 h-4 w-4"}),N?"Creating...":"Create Graph"]}),t.jsxs(X,{color:"gray",onClick:Z,disabled:N,children:[t.jsx(ds,{className:"mr-2 h-4 w-4"}),"Cancel"]})]})]}),t.jsxs("div",{className:"mb-6",children:[!l&&!b&&t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Basic Information"}),t.jsxs(qe,{children:[(l||b)&&t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Graph Information"}),l||b?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph_name",children:"Graph Name *"}),t.jsx(Me,{id:"graph_name",type:"text",value:B.graph_name,onChange:C=>ae("graph_name",C.target.value),placeholder:"Enter graph name",required:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph_uri",children:"Graph URI"}),t.jsx(Me,{id:"graph_uri",type:"text",value:B.graph_uri,onChange:C=>ae("graph_uri",C.target.value),placeholder:"http://example.com/graph/my-graph"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph_type",children:"Graph Type"}),t.jsxs(rt,{id:"graph_type",value:B.graph_type,onChange:C=>ae("graph_type",C.target.value),children:[t.jsx("option",{value:"Knowledge Graph",children:"Knowledge Graph"}),t.jsx("option",{value:"Ontology",children:"Ontology"}),t.jsx("option",{value:"Dataset",children:"Dataset"}),t.jsx("option",{value:"Workflow",children:"Workflow"})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",rows:3,value:B.description,onChange:C=>ae("description",C.target.value),placeholder:"Enter graph description"})]})]}):t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 w-full",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Space:"}),t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[(h==null?void 0:h.space_name)||"Unknown Space"," (",(h==null?void 0:h.space)||"N/A",")"]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Graph Name:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:d==null?void 0:d.graph_name})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Type:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:d==null?void 0:d.graph_type})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Status:"}),t.jsx("div",{className:"text-sm",children:d&&K(d.status)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Triple Count:"}),t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[d==null?void 0:d.triple_count.toLocaleString()," triples"]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Created:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:d!=null&&d.created_time?q(d.created_time):"N/A"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Last Modified:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:d!=null&&d.last_modified?q(d.last_modified):"N/A"})]}),t.jsxs("div",{className:"sm:col-span-2",children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Graph URI:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono break-all",children:d==null?void 0:d.graph_uri})]}),t.jsxs("div",{className:"sm:col-span-2",children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Description:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:(d==null?void 0:d.description)||"No description provided"})]})]})]})]}),l&&t.jsxs(qe,{className:"mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Space Assignment"}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space_id",children:"Target Space *"}),t.jsxs(rt,{id:"space_id",value:B.space_id,onChange:C=>ae("space_id",C.target.value),required:!0,children:[t.jsx("option",{value:"",children:"Select a space..."}),t.jsx("option",{value:"space1",children:"Default Space"}),t.jsx("option",{value:"space2",children:"Project Alpha"}),t.jsx("option",{value:"space3",children:"Research Data"})]})]})]}),!l&&d&&t.jsxs(qe,{children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Quick Actions"}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[t.jsxs(X,{color:"blue",onClick:()=>i(`/data/import/new?spaceId=${r}&graphId=${n}`),className:"w-full",children:[t.jsx(pr,{className:"mr-2 h-4 w-4"}),"Import"]}),t.jsxs(X,{color:"gray",onClick:()=>i(`/data/export/new?spaceId=${r}&graphId=${n}`),className:"w-full",children:[t.jsx(pr,{className:"mr-2 h-4 w-4"}),"Export"]}),t.jsxs(X,{color:"purple",onClick:()=>i(`/space/${r}/graph/${n}/analysis`),className:"w-full",children:[t.jsx(Di,{className:"mr-2 h-4 w-4"}),"Analysis"]})]})]}),k&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full mx-4",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Confirm Graph Purge"}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex justify-center",children:t.jsx(vh,{className:"h-14 w-14 text-yellow-400"})}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to purge this graph? This action will remove all data from the graph but keep the graph structure intact."}),t.jsxs("p",{className:"text-sm text-red-600 dark:text-red-400",children:[t.jsx("strong",{children:"Warning:"})," This action cannot be undone."]})]}),t.jsxs("div",{className:"flex gap-2 mt-6",children:[t.jsx(X,{color:"red",onClick:z,className:"flex-1",children:"Yes, Purge Graph"}),t.jsx(X,{color:"gray",onClick:()=>A(!1),className:"flex-1",children:"Cancel"})]})]})})}),O&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full mx-4",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Confirm Graph Deletion"}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex justify-center",children:t.jsx(Et,{className:"h-14 w-14 text-red-400"})}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to delete this graph? This action will permanently remove the graph and all its data."}),t.jsxs("p",{className:"text-sm text-red-600 dark:text-red-400",children:[t.jsx("strong",{children:"Warning:"})," This action cannot be undone."]})]}),t.jsxs("div",{className:"flex gap-2 mt-6",children:[t.jsx(X,{color:"red",onClick:H,className:"flex-1",children:"Yes, Delete Graph"}),t.jsx(X,{color:"gray",onClick:()=>L(!1),className:"flex-1",children:"Cancel"})]})]})})})]})},kn=[{type:"Person",count:1250,color:"#3B82F6"},{type:"Organization",count:890,color:"#10B981"},{type:"Location",count:650,color:"#F59E0B"},{type:"Event",count:420,color:"#EF4444"},{type:"Document",count:380,color:"#8B5CF6"},{type:"Product",count:290,color:"#06B6D4"},{type:"Concept",count:180,color:"#84CC16"},{type:"Relationship",count:120,color:"#F97316"}],w3=()=>{const{spaceId:r,graphId:n}=da(),[i,l]=x.useState(null),[o,d]=x.useState(null),[f,h]=x.useState(!0),[g,p]=x.useState(null);x.useEffect(()=>{r&&n&&(async()=>{try{h(!0),await new Promise(w=>setTimeout(w,300));const j=Nr.find(w=>w.space===r),N=Kr.find(w=>w.id===parseInt(n||"0"));if(!j||!N){p("Space or Graph not found");return}l(j),d(N),p(null)}catch(j){console.error("Error fetching data:",j),p("Failed to load analysis data. Please try again later.")}finally{h(!1)}})()},[r,n]);const y=Math.max(...kn.map(b=>b.count));return f?t.jsx("div",{className:"flex justify-center items-center h-64",children:t.jsx(He,{size:"xl"})}):g?t.jsx(Xe,{color:"failure",className:"mb-6",children:g}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{"aria-label":"Graph analysis breadcrumb",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/spaces",children:"Spaces"}),t.jsx(Le,{href:`/space/${r}`,children:(i==null?void 0:i.space_name)||r}),t.jsx(Le,{href:`/space/${r}/graph/${n}`,children:(o==null?void 0:o.graph_name)||`Graph ${n}`}),t.jsx(Le,{children:"Analysis"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:"Graph Analysis"}),t.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:["Analysis for ",o==null?void 0:o.graph_name," in ",i==null?void 0:i.space_name]})]}),t.jsx("div",{className:"flex items-center",children:t.jsx(Di,{className:"h-8 w-8 text-purple-600 dark:text-purple-400"})})]}),t.jsxs(qe,{children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Entity Type Distribution"}),t.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Total: ",kn.reduce((b,j)=>b+j.count,0)," entities"]})]}),t.jsx("div",{className:"space-y-4",children:kn.map((b,j)=>t.jsxs("div",{className:"flex items-center space-x-4",children:[t.jsx("div",{className:"w-24 text-sm font-medium text-gray-700 dark:text-gray-300 text-right",children:b.type}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-8 bg-gray-200 dark:bg-gray-700 rounded-lg overflow-hidden",children:t.jsx("div",{className:"h-full rounded-lg transition-all duration-300 ease-in-out flex items-center justify-end pr-3",style:{backgroundColor:b.color,width:`${b.count/y*100}%`,minWidth:"60px"},children:t.jsx("span",{className:"text-white text-sm font-medium",children:b.count})})})}),t.jsxs("div",{className:"w-16 text-sm text-gray-500 dark:text-gray-400 text-right",children:[(b.count/kn.reduce((N,w)=>N+w.count,0)*100).toFixed(1),"%"]})]},j))})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[t.jsx(qe,{children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-blue-600 dark:text-blue-400",children:kn.reduce((b,j)=>b+j.count,0)}),t.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"Total Entities"})]})}),t.jsx(qe,{children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-green-600 dark:text-green-400",children:kn.length}),t.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"Entity Types"})]})}),t.jsx(qe,{children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-purple-600 dark:text-purple-400",children:Math.round(kn.reduce((b,j)=>b+j.count,0)/kn.length)}),t.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"Avg per Type"})]})})]})]})},wy=()=>{var ce;const r=St(),{spaceId:n,graphId:i}=da(),[l,o]=x.useState([]),[d,f]=x.useState(n||""),[h,g]=x.useState(!0),[p,y]=x.useState([]),[b,j]=x.useState("");x.useEffect(()=>{if(d&&b!==""&&!n&&!i){const pe=p.find(Re=>Re.id===b),ie=pe?pe.graph_uri:b;r(`/space/${d}/graph/${encodeURIComponent(ie)}/kg-types`)}},[d,b,r,n,i,p]);const[N,w]=x.useState(""),[S,E]=x.useState(1),[k,A]=x.useState(10),[O,L]=x.useState([]),[B,V]=x.useState([]),[$,le]=x.useState(!1),[q,K]=x.useState(!1),[ae,G]=x.useState(null),[Z,z]=x.useState(!1),[H,C]=x.useState(!1),[U,T]=x.useState(!1),[R,v]=x.useState(null),[M,I]=x.useState({uri:"",type_name:"",description:"",type_uri:""}),ee=x.useCallback(async()=>{try{g(!0);const pe=await Ue.get("/api/spaces"),ie=Array.isArray(pe.data)?pe.data:pe.data.spaces||[];o(ie),G(null)}catch(pe){console.error("Error fetching spaces:",pe),G("Failed to load spaces. Please try again later."),o([])}finally{g(!1)}},[]),xe=x.useCallback(async pe=>{try{K(!0);const ie=await Ue.get(`/api/graphs/sparql/${pe}/graphs`),Re=Array.isArray(ie.data)?ie.data:[];console.log("Fetched graphs for space",pe,":",Re);const we=Re.map((ke,ft)=>(console.log(`Processing graph ${ft}:`,ke),{id:ft,space_id:pe,graph_name:ke.graph_uri?ke.graph_uri.split("/").pop()||ke.graph_uri:`Graph ${ft}`,graph_uri:ke.graph_uri||`http://example.org/graph${ft}`,graph_type:"Graph",triple_count:ke.triple_count||0,created_time:ke.created_time||new Date().toISOString(),last_modified:ke.updated_time||new Date().toISOString(),description:`Graph: ${ke.graph_uri||"Unknown"}`,status:"active"}));we.length===0&&(console.log("No graphs found, adding default graph"),we.push({id:0,space_id:pe,graph_name:"Default Graph",graph_uri:"http://vital.ai/graph/default",graph_type:"Default",triple_count:0,created_time:new Date().toISOString(),last_modified:new Date().toISOString(),description:"Default graph for this space",status:"active"})),console.log("Final transformed graphs:",we),y(we),G(null)}catch(ie){console.error("Error fetching graphs:",ie),G("Failed to load graphs. Please try again later."),y([])}finally{K(!1)}},[]),je=x.useCallback(async()=>{if(!d||b===""){L([]),le(!1);return}try{le(!0);const pe=p.find(ft=>ft.id===b),ie=pe?pe.graph_uri:b;console.log("Using graph ID:",ie,"for selected graph:",b);const we=(await Ue.get("/api/graphs/kgtypes",{params:{space_id:d,graph_id:ie,page_size:100,offset:0}})).data;let ke=[];we.data&&we.data["@graph"]?ke=we.data["@graph"]:Array.isArray(we)?ke=we:we.kgtypes&&(ke=we.kgtypes),console.log("Loaded",ke.length,"KG types for space:",d,"graph:",b),console.log("Raw KG types data:",ke),L(ke),G(null)}catch(pe){console.error("Error fetching KG types:",pe),G("Failed to load KG types. Please try again later."),L([])}finally{le(!1)}},[d,b,p]);x.useEffect(()=>{const pe=O.filter(ie=>{const Re=ie.type_name||ie["@id"]||"",we=ie.description||"",ke=ie.uri||ie["@id"]||"",ft=ie.type_uri||ie["@type"]||"";return Re.toLowerCase().includes(N.toLowerCase())||we.toLowerCase().includes(N.toLowerCase())||ke.toLowerCase().includes(N.toLowerCase())||ft.toLowerCase().includes(N.toLowerCase())});V(pe),E(1)},[O,N,k]);const ve=pe=>{f(pe),j(""),pe?xe(pe):y([])},ye=pe=>{j(pe)};x.useEffect(()=>{ee()},[ee]),x.useEffect(()=>{d&&xe(d)},[d,xe]),x.useEffect(()=>{if(i&&p.length>0&&b===""){console.log("Looking for graph with URI:",decodeURIComponent(i)),console.log("Available graphs:",p);const pe=p.find(ie=>ie.graph_uri===decodeURIComponent(i));if(pe)console.log("Found matching graph:",pe),j(pe.id);else{console.log("No matching graph found, trying as index");const ie=parseInt(i);!isNaN(ie)&&p[ie]&&j(ie)}}},[i,p,b]),x.useEffect(()=>{je()},[je]);const ge=Math.ceil(B.length/k),be=(S-1)*k,Se=be+k,Ee=B.slice(be,Se),Ge=()=>{const pe=p.find(Re=>Re.id===b),ie=pe?pe.graph_uri:b;r(`/space/${d}/graph/${encodeURIComponent(ie)}/kg-types/new?mode=create`)},it=pe=>{v(pe),T(!0)},dt=pe=>{const ie=pe.id||pe["@id"]||"unknown",Re=p.find(ke=>ke.id===b),we=Re?Re.graph_uri:b;r(`/space/${d}/graph/${encodeURIComponent(we)}/kg-types/${encodeURIComponent(ie)}?mode=view`)},st=()=>{R&&(L(pe=>pe.filter(ie=>ie.id!==R.id)),T(!1),v(null))},gt=()=>{const pe={id:H&&R?R.id:Date.now(),space_id:d,graph_id:b,uri:M.uri,type_name:M.type_name,description:M.description,type_uri:M.type_uri,properties:[],created_at:H&&R?R.created_at:new Date().toISOString(),updated_at:new Date().toISOString()};H&&R?(L(ie=>ie.map(Re=>Re.id===R.id?{...pe,id:R.id,created_at:R.created_at}:Re)),C(!1)):(L(ie=>[...ie,pe]),z(!1),I({uri:"",type_name:"",description:"",type_uri:""})),v(null)};return t.jsxs("div",{className:"space-y-6",children:[t.jsx(kl,{spaceId:n,graphId:i,currentPageName:"KG Types",currentPageIcon:Ic}),t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Ic,{className:"w-6 h-6 text-indigo-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"KG Types"})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end mb-6",children:[t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"space-select",children:"Select Space"}),t.jsxs(rt,{id:"space-select",value:d,onChange:pe=>ve(pe.target.value),disabled:h,children:[t.jsx("option",{value:"",children:"Choose a space..."}),l.map(pe=>t.jsx("option",{value:pe.space,children:pe.space_name},pe.space))]})]}),t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"graph-select",children:"Select Graph"}),t.jsxs(rt,{id:"graph-select",value:b,onChange:pe=>ye(pe.target.value?parseInt(pe.target.value):""),disabled:!d||q,children:[t.jsx("option",{value:"",children:"Choose a graph..."}),p.map(pe=>t.jsx("option",{value:pe.id,children:pe.graph_name},pe.id))]})]})]}),d&&b!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs(X,{onClick:Ge,color:"blue",children:[t.jsx(as,{className:"mr-2 h-4 w-4"}),"Add KG Type"]})}),d&&b!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"relative",children:[t.jsx(Qa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),t.jsx(Me,{type:"text",placeholder:"Search KG types by name, description, or URI...",value:N,onChange:pe=>w(pe.target.value),className:"pl-10"})]})}),t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx(se,{htmlFor:"page-size",children:"Items per page"}),t.jsxs(rt,{id:"page-size",value:k,onChange:pe=>{A(parseInt(pe.target.value)),E(1)},children:[t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"})]})]})]})}),h&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx(He,{size:"xl"}),t.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:"Loading spaces..."})]}),!d&&!h&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view KG types"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see available graphs."})]})}),d&&b===""&&p.length>0&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a graph to view KG types"}),t.jsx("p",{className:"text-sm",children:"Choose a graph from the dropdown above to see its knowledge graph types."})]})}),d&&b!==""&&$&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx(He,{size:"xl"}),t.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:"Loading KG types..."})]}),ae&&t.jsx(Xe,{color:"failure",children:ae}),d&&b!==""&&!$&&B.length===0&&!ae?t.jsx(Xe,{color:"info",children:N?`No KG types found matching "${N}". Try a different search term.`:"No KG types found in this graph. Add your first KG type to get started."}):d&&b!==""&&!$&&Ee.length>0?t.jsxs(t.Fragment,{children:[console.log("Rendering table with KG types:",Ee),Ee.length>0&&console.log("First KG type properties:",Object.keys(Ee[0])),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"URI"}),t.jsx(he,{children:"Type Name"}),t.jsx(he,{className:"hidden md:table-cell",children:"Description"}),t.jsx(he,{className:"hidden lg:table-cell",children:"Type URI"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:Ee.map((pe,ie)=>{var Re;return t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:t.jsxs("div",{className:"max-w-xs",children:[t.jsx("div",{className:"font-mono text-sm text-blue-600 truncate",children:pe["@id"]||pe.uri||"No URI"}),t.jsx("div",{className:"text-xs text-gray-500 truncate",children:pe["@type"]||pe.type_uri||"No Type"})]})}),t.jsx(fe,{children:pe.type_name||pe["rdfs:label"]||((Re=pe["@id"])==null?void 0:Re.split("/").pop())||"Unnamed"}),t.jsx(fe,{className:"hidden md:table-cell",children:t.jsx("div",{className:"max-w-xs truncate",children:pe.description||pe["rdfs:comment"]||"No description"})}),t.jsx(fe,{className:"hidden lg:table-cell",children:t.jsx("div",{className:"max-w-xs",children:t.jsx("div",{className:"font-mono text-xs text-gray-600 truncate",children:pe["@type"]||pe.type_uri||"No type URI"})})}),t.jsx(fe,{children:t.jsxs("div",{className:"flex space-x-2",children:[t.jsx(X,{size:"xs",color:"gray",onClick:()=>dt(pe),title:"View Details",children:t.jsx(Qa,{className:"h-3 w-3"})}),t.jsx(X,{size:"xs",color:"red",onClick:()=>it(pe),title:"Delete",children:t.jsx(Et,{className:"h-3 w-3"})})]})})]},pe.id||pe["@id"]||ie)})})]})}),ge>1&&t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(yl,{currentPage:S,totalPages:ge,onPageChange:E,showIcons:!0})})]}):null,t.jsxs(Lt,{show:Z||H,onClose:()=>{z(!1),C(!1),v(null)},children:[t.jsx(jr,{children:H?"Edit KG Type":"Add KG Type"}),t.jsx(br,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"uri",children:"URI"}),t.jsx(Me,{id:"uri",value:M.uri,onChange:pe=>I(ie=>({...ie,uri:pe.target.value})),required:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"type-name",children:"Type Name"}),t.jsx(Me,{id:"type-name",value:M.type_name,onChange:pe=>I(ie=>({...ie,type_name:pe.target.value})),required:!0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",value:M.description,onChange:pe=>I(ie=>({...ie,description:pe.target.value})),rows:3})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"type-uri",children:"Type URI"}),t.jsx(Me,{id:"type-uri",value:M.type_uri,onChange:pe=>I(ie=>({...ie,type_uri:pe.target.value})),required:!0})]})]})}),t.jsxs(vr,{children:[t.jsx(X,{onClick:gt,disabled:!((ce=M.type_name)!=null&&ce.trim()),children:H?"Update":"Create"}),t.jsx(X,{color:"gray",onClick:()=>{z(!1),C(!1),v(null)},children:"Cancel"})]})]}),t.jsxs(Lt,{show:U,onClose:()=>T(!1),children:[t.jsx(jr,{children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(vh,{className:"h-6 w-6 text-red-600 mr-2"}),"Confirm Delete"]})}),t.jsx(br,{children:t.jsxs("p",{children:['Are you sure you want to delete the KG type "',R==null?void 0:R.type_name,'"? This action cannot be undone.']})}),t.jsxs(vr,{children:[t.jsx(X,{color:"red",onClick:st,children:"Delete"}),t.jsx(X,{color:"gray",onClick:()=>T(!1),children:"Cancel"})]})]})]})};function dd(r){const{config:n,object:i,loading:l,saving:o,error:d,showDeleteObjectModal:f,newProperty:h,spaceId:g,graphId:p,mode:y,isCreateMode:b,setShowDeleteObjectModal:j,setNewProperty:N,setSearchParams:w,navigate:S,extractLocalName:E,formatDateTime:k,getObjectTypeBadge:A,updateProperty:O,removeProperty:L,handleAddProperty:B,handleSave:V,getPageTitle:$,getObjectDisplayName:le}=r;return l?t.jsxs("div",{className:"flex justify-center items-center h-64",children:[t.jsx(He,{size:"xl"}),t.jsxs("span",{className:"ml-3 text-lg text-gray-600 dark:text-gray-400",children:["Loading ",n.objectTypeName.toLowerCase()," details..."]})]}):d?t.jsxs("div",{className:"p-6",children:[t.jsx(Xe,{color:"failure",className:"mb-4",children:t.jsx("span",{children:d})}),t.jsx(X,{color:"blue",onClick:()=>S(-1),children:"Go Back"})]}):i?t.jsxs("div",{className:"space-y-6",children:[t.jsx(kl,{spaceId:g,graphId:p,currentPageName:$(),currentPageIcon:n.icon}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(X,{color:"gray",size:"sm",onClick:()=>S(`/space/${g}/graph/${p}${n.listRoute}`),children:["← Back to ",n.objectTypeName,"s"]}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:$()}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:le()})]})]}),t.jsxs("div",{className:"flex gap-2",children:[y==="view"&&!b&&t.jsxs(X,{color:"blue",onClick:()=>w({mode:"edit"}),children:[t.jsx(g3,{className:"w-4 h-4 mr-2"}),"Edit"]}),(y==="edit"||b)&&t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"gray",onClick:()=>b?S(`/space/${g}/graph/${p}${n.listRoute}`):w({mode:"view"}),children:[t.jsx(ds,{className:"w-4 h-4 mr-2"}),"Cancel"]}),t.jsxs(X,{color:"green",onClick:V,disabled:o,children:[o?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(Rn,{className:"w-4 h-4 mr-2"}),b?"Create":"Save"]})]})]})]}),d&&t.jsx(Xe,{color:"failure",children:d}),t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[mr.createElement(n.icon,{className:`w-8 h-8 text-${n.objectTypeColor}-600`}),t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-2",children:E((i==null?void 0:i.object_uri)||"")}),t.jsxs("div",{className:"flex items-center gap-3",children:[A((i==null?void 0:i.object_type)||"Node"),t.jsx(jt,{color:"info",children:E((i==null?void 0:i.rdf_type)||"")})]})]}),t.jsx("div",{className:"flex gap-4",children:t.jsxs(X,{color:"red",onClick:()=>j(!0),children:[t.jsx(cl,{className:"mr-2 h-4 w-4"}),"Delete ",n.objectTypeName]})})]}),t.jsxs("div",{className:"mb-6",children:[t.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-4",children:"Basic Information"}),t.jsx(qe,{children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Space:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:g||"Unknown Space"})]}),t.jsxs("div",{children:[t.jsxs("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:[n.uriFieldName,":"]}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono break-all",children:(i==null?void 0:i.object_uri)||""})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"RDF Type:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono break-all",children:(i==null?void 0:i.rdf_type)||""})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Context:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono break-all",children:(i==null?void 0:i.context)||""})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Object Type:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:A((i==null?void 0:i.object_type)||"Node")})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Properties Count:"}),t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[(i==null?void 0:i.properties_count)||0," properties"]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Created:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:k((i==null?void 0:i.created_time)||"")})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:"Last Modified:"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:k((i==null?void 0:i.last_modified)||"")})]})]})})]}),t.jsxs("div",{className:"mb-6",children:[t.jsx("div",{className:"flex items-center justify-between mb-4",children:t.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Properties"})}),y==="view"?t.jsx(qe,{children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Predicate"}),t.jsx(he,{children:"Object"}),t.jsx(he,{children:"Type"})]})}),t.jsx(Xt,{children:((i==null?void 0:i.properties)||[]).map((q,K)=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-mono text-sm break-all",children:q.predicate}),t.jsx(fe,{className:"text-sm break-all",children:q.object}),t.jsx(fe,{children:t.jsx(jt,{color:q.object_type==="uri"?"blue":"green",children:q.object_type})})]},K))})]})})}):t.jsxs(qe,{children:[t.jsx("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 items-end",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"new-predicate",children:"Property Name"}),t.jsx(Me,{id:"new-predicate",placeholder:"Enter property name",value:h.predicate,onChange:q=>N({...h,predicate:q.target.value})})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"new-value",children:"Property Value"}),t.jsx(Me,{id:"new-value",placeholder:"Enter property value",value:h.value,onChange:q=>N({...h,value:q.target.value})})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"new-type",children:"Type"}),t.jsxs(rt,{id:"new-type",value:h.type,onChange:q=>N({...h,type:q.target.value}),children:[t.jsx("option",{value:"literal",children:"Literal"}),t.jsx("option",{value:"uri",children:"URI"})]})]}),t.jsx("div",{children:t.jsxs(X,{color:"blue",onClick:B,disabled:!h.predicate||!h.value,className:"w-full",children:[t.jsx(Nl,{className:"mr-2 h-4 w-4"}),"Add"]})})]})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Predicate"}),t.jsx(he,{children:"Object"}),t.jsx(he,{children:"Type"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{children:((i==null?void 0:i.properties)||[]).map((q,K)=>t.jsxs(at,{children:[t.jsx(fe,{children:t.jsx(Me,{value:q.predicate,onChange:ae=>O(K,"predicate",ae.target.value),className:"font-mono text-sm"})}),t.jsx(fe,{children:t.jsx(Me,{value:q.object,onChange:ae=>O(K,"object",ae.target.value),className:"text-sm"})}),t.jsx(fe,{children:t.jsxs(rt,{value:q.object_type,onChange:ae=>O(K,"object_type",ae.target.value),children:[t.jsx("option",{value:"literal",children:"Literal"}),t.jsx("option",{value:"uri",children:"URI"})]})}),t.jsx(fe,{children:t.jsx(X,{size:"xs",color:"red",onClick:()=>L(K),children:t.jsx(cl,{className:"h-3 w-3"})})})]},K))})]})})]})]}),t.jsx(Lt,{show:f,onClose:()=>j(!1),children:t.jsxs("div",{className:"p-6",children:[t.jsxs("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:["Delete ",n.objectTypeName]}),t.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:["Are you sure you want to delete this ",n.objectTypeName.toLowerCase(),"? This action cannot be undone."]}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx(X,{color:"red",onClick:()=>{j(!1),S(-1)},children:"Delete"}),t.jsx(X,{color:"gray",onClick:()=>j(!1),children:"Cancel"})]})]})})]}):t.jsx("div",{className:"p-6",children:t.jsxs("div",{className:"text-center py-12",children:[t.jsxs("p",{className:"text-lg text-gray-600 dark:text-gray-400 mb-4",children:[n.objectTypeName," not found"]}),t.jsx(X,{color:"blue",onClick:()=>S(-1),children:"Go Back"})]})})}function ud(r,n,i){const l=St(),[o,d]=hl(),f=da(),h=f.spaceId,g=f.graphId,p=f[r.paramName],y=o.get("mode")||"view",b=y==="create"||p==="new",[j,N]=x.useState(null),[w,S]=x.useState(!0),[E,k]=x.useState(!1),[A,O]=x.useState(null),[L,B]=x.useState(!1),[V,$]=x.useState({predicate:"",value:"",type:"literal"}),le=R=>{if(!R)return"";const v=R.split(/[#/]/);return v[v.length-1]||R},q=R=>{if(!R)return"N/A";try{return new Date(R).toLocaleString()}catch{return"Invalid Date"}},K=R=>{const v=R==="Node"?{color:"blue",text:"Node"}:{color:"green",text:"Edge"};return t.jsx(jt,{color:v.color,children:v.text})},ae=async()=>{var R,v;if(b){const M=n();N(M),S(!1);return}if(!h||!g||!p){O("Missing required parameters"),S(!1);return}try{S(!0);const M=r.apiEndpoint.includes("kgtypes");let I;M?I=await Ue.get(r.apiEndpoint,{params:{space_id:h,graph_id:decodeURIComponent(g),uri:decodeURIComponent(p),page_size:1,offset:0}}):I=await Ue.get(r.apiEndpoint,{params:{space_id:h,graph_id:decodeURIComponent(g),uri:decodeURIComponent(p)}});const ee=I.data;let xe=null;if(M){let je=[];ee.data&&ee.data["@graph"]?je=ee.data["@graph"]:Array.isArray(ee)&&(je=ee),je.length>0&&(xe=je[0])}else xe=ee&&(ee["@id"]||ee.URI)?ee:null;if(xe){const je=G(xe);N(je)}else O(`${r.objectTypeName} not found`)}catch(M){O(((v=(R=M.response)==null?void 0:R.data)==null?void 0:v.detail)||`Failed to load ${r.objectTypeName.toLowerCase()}`)}finally{S(!1)}},G=R=>{var M;const v={id:0,space_id:h||"",graph_id:0,object_uri:R["@id"]||R.URI||decodeURIComponent(p||""),object_type:(M=R["@type"])!=null&&M.includes("Edge")?"Edge":"Node",rdf_type:R["@type"]||"Unknown",subject:R["@id"]||R.URI||decodeURIComponent(p||""),predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:R["@type"]||"Unknown",context:decodeURIComponent(g||""),created_time:R.created_time||new Date().toISOString(),last_modified:R.last_modified||new Date().toISOString(),properties_count:Object.keys(R).length-1,properties:[]};return Object.entries(R).forEach(([I,ee])=>{if(I!=="@context"&&I!=="@graph"&&ee!==null&&ee!==void 0){const xe=typeof ee=="object"?JSON.stringify(ee):String(ee),je={predicate:I,object:xe,object_type:I.startsWith("http")||I==="@id"||I==="@type"||I==="URI"?"uri":"literal"};v.properties.push(je)}}),v},Z=(R,v,M)=>{if(!j||!j.properties)return;const I=[...j.properties];I[R]={...I[R],[v]:M},N({...j,properties:I})},z=R=>{if(!j||!j.properties)return;const v=j.properties.filter((M,I)=>I!==R);N({...j,properties:v,properties_count:v.length})},H=()=>{var M;if(!j||!V.predicate||!V.value)return;const R={predicate:V.predicate,object:V.value,object_type:V.type},v={...j,properties:[...j.properties||[],R],properties_count:(((M=j.properties)==null?void 0:M.length)||0)+1};N(v),$({predicate:"",value:"",type:"literal"})},C=async()=>{var R,v;if(j)try{k(!0),O(null);const M=i(j),I=r.apiEndpoint.includes("kgtypes");b?I?await Ue.post(`${r.apiEndpoint}?space_id=${h}&graph_id=${encodeURIComponent(g)}`,M):await Ue.post(r.apiEndpoint,M,{params:{space_id:h,graph_id:decodeURIComponent(g||"")}}):I?await Ue.put(`${r.apiEndpoint}?space_id=${h}&graph_id=${encodeURIComponent(g)}`,M):await Ue.put(r.apiEndpoint,M,{params:{space_id:h,graph_id:decodeURIComponent(g||""),uri:decodeURIComponent(p)}}),b?l(`/space/${h}/graph/${g}${r.listRoute}`):(await ae(),d({mode:"view"}))}catch(M){O(((v=(R=M.response)==null?void 0:R.data)==null?void 0:v.detail)||`Failed to save ${r.objectTypeName.toLowerCase()}`)}finally{k(!1)}},U=()=>b?`Create ${r.objectTypeName}`:y==="edit"?`Edit ${r.objectTypeName}`:`${r.objectTypeName} Details`,T=()=>b?`New ${r.objectTypeName}`:le((j==null?void 0:j.object_uri)||p||`Unknown ${r.objectTypeName}`);return x.useEffect(()=>{ae()},[h,g,p,b]),{object:j,loading:w,saving:E,error:A,showDeleteObjectModal:L,newProperty:V,spaceId:h,graphId:g,objectId:p,mode:y,isCreateMode:b,setObject:N,setError:O,setShowDeleteObjectModal:B,setNewProperty:$,setSearchParams:d,navigate:l,extractLocalName:le,formatDateTime:q,getObjectTypeBadge:K,updateProperty:Z,removeProperty:z,handleAddProperty:H,handleSave:C,getPageTitle:U,getObjectDisplayName:T,fetchObject:ae}}const Ny=()=>{const r={objectTypeName:"KG Type",objectTypeColor:"purple",apiEndpoint:"/api/graphs/kgtypes",listRoute:"/kg-types",defaultRdfType:"http://vital.ai/ontology/haley-ai-kg#KGEntityType",paramName:"kgTypeId",uriFieldName:"Type URI",icon:d1},l=ud(r,()=>({id:0,space_id:"",graph_id:0,object_uri:"",object_type:"Node",rdf_type:r.defaultRdfType,subject:"",predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:"",context:"",created_time:new Date().toISOString(),last_modified:new Date().toISOString(),properties_count:3,properties:[{predicate:"@id",object:"",object_type:"uri"},{predicate:"@type",object:r.defaultRdfType,object_type:"uri"},{predicate:"http://vital.ai/ontology/haley-ai-kg#hasKGraphDescription",object:"",object_type:"literal"}]}),o=>{const d={};return o.properties&&o.properties.forEach(f=>{if(f.predicate&&f.object)try{const h=JSON.parse(f.object);d[f.predicate]=h}catch{d[f.predicate]=f.object}}),{document:{"@context":{rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",vital:"http://vital.ai/ontology/vital-core#",haley:"http://vital.ai/ontology/haley-ai-kg#"},"@graph":[d]}}});return t.jsx(dd,{...l,config:r})},ky=()=>{const r=St(),{spaceId:n,graphId:i}=da(),l=za(),[o,d]=x.useState([]),[f,h]=x.useState([]),[g,p]=x.useState(n||""),[y,b]=x.useState(""),[j,N]=x.useState(!0),[w,S]=x.useState(!1),[E,k]=x.useState(null),A=()=>{const q=l.pathname;return q.includes("/kgentities")?"kgentities":q.includes("/kgframes")?"kgframes":"graphobjects"},O=q=>{const K=n&&i?`/space/${n}/graph/${i}/objects`:"/objects";r(`${K}/${q}`)},L=x.useCallback(async()=>{try{N(!0);const q=await Ue.get("/api/spaces"),K=Array.isArray(q.data)?q.data:q.data.spaces||[];d(K),k(null)}catch(q){console.error("Error fetching spaces:",q),k("Failed to load spaces. Please try again later."),d([])}finally{N(!1)}},[]),B=x.useCallback(async q=>{try{S(!0);const K=await Ue.get(`/api/graphs/sparql/${q}/graphs`),G=(Array.isArray(K.data)?K.data:[]).map((Z,z)=>({id:z,space_id:q,graph_name:Z.graph_uri?Z.graph_uri.split("/").pop()||Z.graph_uri:`Graph ${z}`,graph_uri:Z.graph_uri||`http://example.org/graph${z}`,graph_type:"Graph",triple_count:Z.triple_count||0,created_time:Z.created_time||new Date().toISOString(),last_modified:Z.updated_time||new Date().toISOString(),description:`Graph: ${Z.graph_uri||"Unknown"}`,status:"active"}));G.length===0&&G.push({id:0,space_id:q,graph_name:"Default Graph",graph_uri:"http://vital.ai/haley.ai/graph/default",graph_type:"Default",triple_count:0,created_time:new Date().toISOString(),last_modified:new Date().toISOString(),description:"Default graph for this space",status:"active"}),h(G),k(null)}catch(K){console.error("Error fetching graphs:",K),k("Failed to load graphs. Please try again later."),h([])}finally{S(!1)}},[]),V=q=>{p(q),b(""),h([]);const K=A();r(`/objects/${K}`)},$=q=>{if(b(q),g&&q!==""){const K=f.find(Z=>Z.id===q),ae=K?K.graph_uri:q,G=A();r(`/space/${g}/graph/${encodeURIComponent(ae)}/objects/${G}`)}};x.useEffect(()=>{L()},[L]),x.useEffect(()=>{g&&B(g)},[g,B]),x.useEffect(()=>{if(i&&n&&f.length>0&&y===""){console.log("Looking for graph with URI:",decodeURIComponent(i));const q=f.find(K=>K.graph_uri===decodeURIComponent(i));if(q)console.log("Found matching graph:",q),b(q.id);else{console.log("No matching graph found, trying as index");const K=parseInt(i);!isNaN(K)&&f[K]&&b(K)}}},[i,n,f,y]);const le=A();return t.jsxs("div",{className:"space-y-6",children:[t.jsx(kl,{spaceId:n,graphId:i,currentPageName:"Objects",currentPageIcon:il}),t.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between",children:t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(il,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Objects"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage RDF objects, entities, and frames within your graphs"})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end mb-6",children:[t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"space-select",children:"Select Space"}),t.jsxs(rt,{id:"space-select",value:g,onChange:q=>V(q.target.value),disabled:j,children:[t.jsx("option",{value:"",children:"Choose a space..."}),o.map(q=>t.jsx("option",{value:q.space,children:q.space_name},q.space))]})]}),t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"graph-select",children:"Select Graph"}),t.jsxs(rt,{id:"graph-select",value:y,onChange:q=>$(q.target.value?parseInt(q.target.value):""),disabled:!g||w,children:[t.jsx("option",{value:"",children:"Choose a graph..."}),f.map(q=>t.jsx("option",{value:q.id,children:q.graph_name},q.id))]})]})]}),t.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700",children:t.jsxs("nav",{className:"-mb-px flex space-x-8",children:[t.jsxs("button",{onClick:()=>O("graphobjects"),className:`flex items-center gap-2 py-2 px-1 border-b-2 font-medium text-sm ${le==="graphobjects"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:[t.jsx(d1,{className:"w-5 h-5"}),"Graph Objects"]}),t.jsxs("button",{onClick:()=>O("kgentities"),className:`flex items-center gap-2 py-2 px-1 border-b-2 font-medium text-sm ${le==="kgentities"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:[t.jsx(rp,{className:"w-5 h-5"}),"KG Entities"]}),t.jsxs("button",{onClick:()=>O("kgframes"),className:`flex items-center gap-2 py-2 px-1 border-b-2 font-medium text-sm ${le==="kgframes"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:[t.jsx(u1,{className:"w-5 h-5"}),"KG Frames"]})]})}),t.jsx("div",{className:"mt-6",children:t.jsx(Ch,{context:{selectedSpace:g,selectedGraph:y,spaces:o,graphs:f,spacesLoading:j,graphsLoading:w,error:E}})})]})},Sy=()=>{const r=St(),n=Sh(),{selectedSpace:i="",selectedGraph:l="",graphs:o=[],spacesLoading:d=!0}=n||{},[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(""),[j,N]=x.useState(1),[w,S]=x.useState(10),[E,k]=x.useState(!1),[A,O]=x.useState(null),[L,B]=x.useState(!1),[V,$]=x.useState(null),le=x.useCallback(async()=>{if(!(!i||l===""))try{k(!0),O("");const C=o.find(M=>M.id===l),U=C?C.graph_uri:l;console.log("Fetching objects for space:",i,"graph:",U);const R=(await Ue.get("/api/graphs/objects",{params:{space_id:i,graph_id:U,page_size:w,offset:(j-1)*w}})).data;console.log("Objects API response:",R);const v=[];R.objects&&R.objects["@graph"]&&Array.isArray(R.objects["@graph"])?R.objects["@graph"].forEach((M,I)=>{var je;const ee=M["@id"]||M.URI||`unknown-${I}`,xe=M["@type"]||M.vitaltype||"Unknown";v.push({id:I,space_id:i,graph_id:typeof l=="number"?l:0,object_uri:ee,object_type:(je=M["@type"])!=null&&je.includes("Edge")?"Edge":"Node",rdf_type:xe,subject:ee,predicate:M.predicate||"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:xe,context:String(U),created_time:M.created_time||M.createdTime||new Date().toISOString(),last_modified:M.last_modified||M.lastModified||M.updated_time||new Date().toISOString(),properties_count:Object.keys(M).length-2,properties:[]})}):console.log("No objects found in API response or unexpected data structure:",R),h(v),O(null),R.total_count!==void 0&&console.log(`Total objects: ${R.total_count}, showing ${v.length}`)}catch(C){console.error("Error fetching objects:",C),O("Failed to load objects. Please try again later."),h([])}finally{k(!1)}},[i,l,o,w,j]);x.useEffect(()=>{const C=f.filter(U=>U.object_uri.toLowerCase().includes(y.toLowerCase())||U.rdf_type.toLowerCase().includes(y.toLowerCase())||U.object_type.toLowerCase().includes(y.toLowerCase()));p(C),N(1)},[f,y,w]),x.useEffect(()=>{le()},[le]);const q=Math.ceil(g.length/w),K=(j-1)*w,ae=K+w,G=g.slice(K,ae),Z=C=>{if(!C)return"";const U=C.split(/[#/]/);return U[U.length-1]||C},z=C=>new Date(C).toLocaleString(),H=C=>{const U=C==="Node"?{color:"blue",text:"Node"}:{color:"green",text:"Edge"};return t.jsx(jt,{color:U.color,children:U.text})};return t.jsxs(t.Fragment,{children:[i&&l!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs(X,{onClick:()=>{const C=o.find(T=>T.id===l),U=C?C.graph_uri:l;r(`/space/${i}/graph/${encodeURIComponent(U)}/objects/new?mode=create`)},color:"blue",children:[t.jsx(Nl,{className:"mr-2 h-4 w-4"}),"Add Graph Object"]})}),i&&l!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"relative",children:[t.jsx(Qa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),t.jsx(Me,{type:"text",placeholder:"Search objects by URI, type, or object type...",value:y,onChange:C=>b(C.target.value),className:"pl-10"})]})}),t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx(se,{htmlFor:"page-size",children:"Items per page"}),t.jsxs(rt,{id:"page-size",value:w,onChange:C=>{S(parseInt(C.target.value)),N(1)},children:[t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"})]})]})]})}),!i&&!d&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view graph objects"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see available graphs."})]})}),i&&l===""&&o.length>0&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a graph to view graph objects"}),t.jsx("p",{className:"text-sm",children:"Choose a graph from the dropdown above to see its objects."})]})}),i&&l!==""&&E&&t.jsxs("div",{className:"mt-8 flex justify-center",children:[t.jsx(He,{size:"lg"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:"Loading graph objects..."})]}),A&&t.jsx(Xe,{color:"failure",children:A}),i&&l!==""&&!E&&g.length===0&&!A?t.jsx(Xe,{color:"info",children:y?`No graph objects found matching "${y}". Try a different search term.`:"No graph objects found in this graph. Add your first object to get started."}):i&&l!==""&&!E&&G.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Object URI"}),t.jsx(he,{children:"RDF Type"}),t.jsx(he,{children:"Object Type"}),t.jsx(he,{children:"Properties"}),t.jsx(he,{children:"Last Modified"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:G.map(C=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:t.jsxs("div",{className:"max-w-xs",children:[t.jsx("div",{className:"font-mono text-sm text-blue-600 truncate",children:Z(C.object_uri)}),t.jsx("div",{className:"text-xs text-gray-500 truncate",children:C.object_uri})]})}),t.jsx(fe,{className:"font-mono text-sm",children:Z(C.rdf_type)}),t.jsx(fe,{children:H(C.object_type)}),t.jsx(fe,{children:t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[C.properties_count," properties"]})}),t.jsx(fe,{className:"text-sm text-gray-600 dark:text-gray-400",children:z(C.last_modified)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex space-x-2",children:[t.jsx(X,{size:"xs",color:"blue",onClick:()=>{const U=o.find(R=>R.id===l),T=U?U.graph_uri:l;r(`/space/${i}/graph/${encodeURIComponent(T)}/objects/${encodeURIComponent(C.object_uri)}`)},children:t.jsx(ol,{className:"h-3 w-3"})}),t.jsx(X,{size:"xs",color:"red",onClick:()=>{$(C),B(!0)},children:t.jsx(cl,{className:"h-3 w-3"})})]})})]},C.id))})]})}),q>1&&t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(yl,{currentPage:j,totalPages:q,onPageChange:N,showIcons:!0})})]}),t.jsx(Lt,{show:L,onClose:()=>B(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Object"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this object? This action cannot be undone."}),V&&t.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded mb-6",children:t.jsx("p",{className:"text-sm font-mono text-gray-800 dark:text-gray-200",children:V.object_uri})}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx(X,{onClick:()=>{console.log("Deleting object:",V==null?void 0:V.id),B(!1),$(null)},color:"failure",children:"Delete"}),t.jsx(X,{color:"gray",onClick:()=>{B(!1),$(null)},children:"Cancel"})]})]})})]})},_y=()=>{const r=St(),n=Sh(),{selectedSpace:i="",selectedGraph:l="",graphs:o=[],spacesLoading:d=!0}=n||{},[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!1),[j,N]=x.useState(null),[w,S]=x.useState(""),[E,k]=x.useState(1),[A,O]=x.useState(10),[L,B]=x.useState(!1),[V,$]=x.useState(null),le=x.useCallback(async()=>{if(!(!i||l===""))try{b(!0),N("");const z=o.find(U=>U.id===l);if(!z){N("Selected graph not found"),h([]);return}console.log("Fetching entities for space:",i,"graph:",z.graph_uri);const C=(await Ue.get("/api/graphs/kgentities",{params:{space_id:i,graph_id:z.graph_uri,page_size:100,offset:0}})).data;if(console.log("KG Entities API response:",C),C.entities&&C.entities["@graph"]&&Array.isArray(C.entities["@graph"])){const U=C.entities["@graph"].map((T,R)=>({id:R,type_name:T["@id"]||T.URI||`entity-${R}`,type_uri:T["@id"]||T.URI||"",uri:T["@id"]||T.URI||"",description:T["http://vital.ai/ontology/haley-ai-kg#hasKGraphDescription"]||"No description",created_at:T.created_time||new Date().toISOString(),updated_at:T.last_modified||new Date().toISOString(),space_id:i,graph_id:typeof l=="number"?l:0,properties:Object.keys(T).filter(v=>v!=="@context"&&v!=="@id"&&v!=="@type"&&v!=="URI")}));h(U)}else Array.isArray(C.entities)?h(C.entities):Array.isArray(C)?h(C):h([])}catch(z){console.error("Error fetching KG entities:",z),N("Failed to load KG entities. Please try again later."),h([])}finally{b(!1)}},[i,l]);x.useEffect(()=>{const z=f.filter(H=>H.type_name.toLowerCase().includes(w.toLowerCase())||H.description.toLowerCase().includes(w.toLowerCase())||H.uri.toLowerCase().includes(w.toLowerCase())||H.type_uri.toLowerCase().includes(w.toLowerCase()));p(z),k(1)},[f,w,A]),x.useEffect(()=>{le()},[le]);const q=Math.ceil(g.length/A),K=(E-1)*A,ae=K+A,G=g.slice(K,ae),Z=z=>new Date(z).toLocaleString();return t.jsxs(t.Fragment,{children:[i&&l!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs(X,{onClick:()=>{const z=o.find(C=>C.id===l),H=z?z.graph_uri:l;r(`/space/${i}/graph/${encodeURIComponent(H)}/entity/new?mode=create`)},color:"blue",children:[t.jsx(Nl,{className:"mr-2 h-4 w-4"}),"Add KG Entity"]})}),i&&l!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"relative",children:[t.jsx(Qa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),t.jsx(Me,{type:"text",placeholder:"Search KG entities by name, description, or URI...",value:w,onChange:z=>S(z.target.value),className:"pl-10"})]})}),t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx(se,{htmlFor:"page-size",children:"Items per page"}),t.jsxs(rt,{id:"page-size",value:A,onChange:z=>{O(parseInt(z.target.value)),k(1)},children:[t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"})]})]})]})}),!i&&!d&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view KG entities"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see available graphs."})]})}),i&&l===""&&o.length>0&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a graph to view KG entities"}),t.jsx("p",{className:"text-sm",children:"Choose a graph from the dropdown above to see its entities."})]})}),i&&l!==""&&y&&t.jsxs("div",{className:"mt-8 flex justify-center",children:[t.jsx(He,{size:"lg"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:"Loading KG entities..."})]}),j&&t.jsx(Xe,{color:"failure",children:j}),i&&l!==""&&!y&&g.length===0&&!j?t.jsx(Xe,{color:"info",children:w?`No KG entities found matching "${w}". Try a different search term.`:"No KG entities found in this graph. Add your first entity to get started."}):i&&l!==""&&!y&&G.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Entity URI"}),t.jsx(he,{children:"RDF Type"}),t.jsx(he,{children:"Entity Type"}),t.jsx(he,{children:"Properties"}),t.jsx(he,{children:"Last Modified"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:G.map(z=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:t.jsxs("div",{className:"max-w-xs",children:[t.jsx("div",{className:"font-mono text-sm text-blue-600 truncate",children:z.type_name}),t.jsx("div",{className:"text-xs text-gray-500 truncate",children:z.uri})]})}),t.jsx(fe,{className:"font-mono text-sm",children:z.type_uri}),t.jsx(fe,{children:t.jsx(jt,{color:"blue",children:"KG Entity"})}),t.jsx(fe,{children:t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[z.properties.length," properties"]})}),t.jsx(fe,{className:"text-sm text-gray-600 dark:text-gray-400",children:Z(z.updated_at)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex space-x-2",children:[t.jsx(X,{size:"xs",color:"blue",onClick:()=>{var U;const H=o.find(T=>T.id===l),C=H?H.graph_uri:l;r(`/space/${i}/graph/${encodeURIComponent(C)}/entity/${encodeURIComponent(z.type_uri||((U=z.id)==null?void 0:U.toString())||"")}`)},children:t.jsx(ol,{className:"h-3 w-3"})}),t.jsx(X,{size:"xs",color:"red",onClick:()=>{$(z),B(!0)},children:t.jsx(cl,{className:"h-3 w-3"})})]})})]},z.id))})]})}),q>1&&t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(yl,{currentPage:E,totalPages:q,onPageChange:k,showIcons:!0})})]}),t.jsx(Lt,{show:L,onClose:()=>B(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Entity"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this KG entity? This action cannot be undone."}),V&&t.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded mb-6",children:[t.jsx("p",{className:"text-sm font-mono text-gray-800 dark:text-gray-200",children:V.type_name}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:V.uri})]}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx(X,{onClick:()=>{console.log("Deleting entity:",V==null?void 0:V.id),B(!1),$(null)},color:"failure",children:"Delete"}),t.jsx(X,{color:"gray",onClick:()=>{B(!1),$(null)},children:"Cancel"})]})]})})]})},Ty=()=>{const r=St(),n=Sh(),{selectedSpace:i="",selectedGraph:l="",graphs:o=[],spacesLoading:d=!0}=n||{},[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!1),[j,N]=x.useState(null),[w,S]=x.useState(""),[E,k]=x.useState(1),[A,O]=x.useState(10),[L,B]=x.useState(!1),[V,$]=x.useState(null),le=x.useCallback(async()=>{if(!(!i||l===""))try{b(!0),N("");const z=o.find(U=>U.id===l);if(!z){N("Selected graph not found"),h([]);return}console.log("Fetching frames for space:",i,"graph:",z.graph_uri);const C=(await Ue.get("/api/graphs/kgframes",{params:{space_id:i,graph_id:z.graph_uri,page_size:100,offset:0}})).data;if(console.log("KG Frames API response:",C),C.frames&&C.frames["@graph"]&&Array.isArray(C.frames["@graph"])){const U=C.frames["@graph"].map((T,R)=>({id:R,type_name:T["@id"]||T.URI||`frame-${R}`,type_uri:T["@id"]||T.URI||"",uri:T["@id"]||T.URI||"",description:T["http://vital.ai/ontology/haley-ai-kg#hasKGraphDescription"]||"No description",created_at:T.created_time||new Date().toISOString(),updated_at:T.last_modified||new Date().toISOString(),space_id:i,graph_id:typeof l=="number"?l:0,properties:Object.keys(T).filter(v=>v!=="@context"&&v!=="@id"&&v!=="@type"&&v!=="URI")}));h(U)}else Array.isArray(C.frames)?h(C.frames):Array.isArray(C)?h(C):h([])}catch(z){console.error("Error fetching KG frames:",z),N("Failed to load KG frames. Please try again later."),h([])}finally{b(!1)}},[i,l,o]);x.useEffect(()=>{const z=f.filter(H=>H.type_name.toLowerCase().includes(w.toLowerCase())||H.description.toLowerCase().includes(w.toLowerCase())||H.uri.toLowerCase().includes(w.toLowerCase())||H.type_uri.toLowerCase().includes(w.toLowerCase()));p(z),k(1)},[f,w,A]),x.useEffect(()=>{le()},[le]);const q=Math.ceil(g.length/A),K=(E-1)*A,ae=K+A,G=g.slice(K,ae),Z=z=>new Date(z).toLocaleString();return t.jsxs(t.Fragment,{children:[i&&l!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs(X,{onClick:()=>{const z=o.find(C=>C.id===l),H=z?z.graph_uri:l;r(`/space/${i}/graph/${encodeURIComponent(H)}/frame/new?mode=create`)},color:"blue",children:[t.jsx(Nl,{className:"mr-2 h-4 w-4"}),"Add KG Frame"]})}),i&&l!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"relative",children:[t.jsx(Qa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),t.jsx(Me,{type:"text",placeholder:"Search KG frames by name, description, or URI...",value:w,onChange:z=>S(z.target.value),className:"pl-10"})]})}),t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx(se,{htmlFor:"page-size",children:"Items per page"}),t.jsxs(rt,{id:"page-size",value:A,onChange:z=>{O(parseInt(z.target.value)),k(1)},children:[t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"})]})]})]})}),!i&&!d&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view KG frames"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see available graphs."})]})}),i&&l===""&&o.length>0&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a graph to view KG frames"}),t.jsx("p",{className:"text-sm",children:"Choose a graph from the dropdown above to see its frames."})]})}),i&&l!==""&&y&&t.jsxs("div",{className:"mt-8 flex justify-center",children:[t.jsx(He,{size:"lg"}),t.jsx("span",{className:"ml-2 text-gray-600 dark:text-gray-400",children:"Loading KG frames..."})]}),j&&t.jsx(Xe,{color:"failure",children:j}),i&&l!==""&&!y&&g.length===0&&!j?t.jsx(Xe,{color:"info",children:w?`No KG frames found matching "${w}". Try a different search term.`:"No KG frames found in this graph. Add your first frame to get started."}):i&&l!==""&&!y&&G.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Frame URI"}),t.jsx(he,{children:"RDF Type"}),t.jsx(he,{children:"Frame Type"}),t.jsx(he,{children:"Properties"}),t.jsx(he,{children:"Last Modified"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:G.map(z=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:t.jsxs("div",{className:"max-w-xs",children:[t.jsx("div",{className:"font-mono text-sm text-blue-600 truncate",children:z.type_name}),t.jsx("div",{className:"text-xs text-gray-500 truncate",children:z.uri})]})}),t.jsx(fe,{className:"font-mono text-sm",children:z.type_uri}),t.jsx(fe,{children:t.jsx(jt,{color:"purple",children:"KG Frame"})}),t.jsx(fe,{children:t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[z.properties.length," properties"]})}),t.jsx(fe,{className:"text-sm text-gray-600 dark:text-gray-400",children:Z(z.updated_at)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex space-x-2",children:[t.jsx(X,{size:"xs",color:"blue",onClick:()=>{var U;const H=o.find(T=>T.id===l),C=H?H.graph_uri:l;r(`/space/${i}/graph/${encodeURIComponent(C)}/frame/${encodeURIComponent(z.type_uri||((U=z.id)==null?void 0:U.toString())||"")}`)},children:t.jsx(ol,{className:"h-3 w-3"})}),t.jsx(X,{size:"xs",color:"red",onClick:()=>{$(z),B(!0)},children:t.jsx(cl,{className:"h-3 w-3"})})]})})]},z.id))})]})}),q>1&&t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(yl,{currentPage:E,totalPages:q,onPageChange:k,showIcons:!0})})]}),t.jsx(Lt,{show:L,onClose:()=>B(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Frame"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this KG frame? This action cannot be undone."}),V&&t.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded mb-6",children:[t.jsx("p",{className:"text-sm font-mono text-gray-800 dark:text-gray-200",children:V.type_name}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:V.uri})]}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx(X,{onClick:()=>{console.log("Deleting frame:",V==null?void 0:V.id),B(!1),$(null)},color:"failure",children:"Delete"}),t.jsx(X,{color:"gray",onClick:()=>{B(!1),$(null)},children:"Cancel"})]})]})})]})},Kf=()=>{const r={objectTypeName:"Graph Object",objectTypeColor:"blue",apiEndpoint:"/api/graphs/objects",listRoute:"/objects/graphobjects",defaultRdfType:"http://vital.ai/ontology/haley-ai-kg#GraphObject",paramName:"objectId",uriFieldName:"Object URI",icon:il},l=ud(r,()=>({id:0,space_id:"",graph_id:0,object_uri:"",object_type:"Node",rdf_type:r.defaultRdfType,subject:"",predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:"",context:"",created_time:new Date().toISOString(),last_modified:new Date().toISOString(),properties_count:3,properties:[{predicate:"@id",object:"",object_type:"uri"},{predicate:"@type",object:r.defaultRdfType,object_type:"uri"},{predicate:"http://vital.ai/ontology/haley-ai-kg#hasKGraphDescription",object:"",object_type:"literal"}]}),o=>{const d={"@context":{}};return o.properties&&o.properties.forEach(f=>{f.predicate&&f.object&&(d[f.predicate]=f.object)}),{objects:{"@context":{},"@graph":[d]}}});return t.jsx(dd,{...l,config:r})},N3=()=>{const r={objectTypeName:"KG Entity",objectTypeColor:"green",apiEndpoint:"/api/graphs/kgentities",listRoute:"/kg-entities",defaultRdfType:"http://vital.ai/ontology/haley-ai-kg#KGEntity",paramName:"entityId",uriFieldName:"Entity URI",icon:Gi},l=ud(r,()=>({id:0,space_id:"",graph_id:0,object_uri:"",object_type:"Node",rdf_type:r.defaultRdfType,subject:"",predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:"",context:"",created_time:new Date().toISOString(),last_modified:new Date().toISOString(),properties_count:3,properties:[{predicate:"@id",object:"",object_type:"uri"},{predicate:"@type",object:r.defaultRdfType,object_type:"uri"},{predicate:"http://vital.ai/ontology/haley-ai-kg#hasKGraphDescription",object:"",object_type:"literal"}]}),o=>{const d={"@context":{}};return o.properties&&o.properties.forEach(f=>{f.predicate&&f.object&&(d[f.predicate]=f.object)}),{objects:{"@context":{},"@graph":[d]}}});return t.jsx(dd,{...l,config:r})},k3=()=>{const r={objectTypeName:"KG Frame",objectTypeColor:"indigo",apiEndpoint:"/api/graphs/kgframes",listRoute:"/kg-frames",defaultRdfType:"http://vital.ai/ontology/haley-ai-kg#KGFrame",paramName:"frameId",uriFieldName:"Frame URI",icon:rp},l=ud(r,()=>({id:0,space_id:"",graph_id:0,object_uri:"",object_type:"Node",rdf_type:r.defaultRdfType,subject:"",predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:"",context:"",created_time:new Date().toISOString(),last_modified:new Date().toISOString(),properties_count:3,properties:[{predicate:"@id",object:"",object_type:"uri"},{predicate:"@type",object:r.defaultRdfType,object_type:"uri"},{predicate:"http://vital.ai/ontology/haley-ai-kg#hasKGraphDescription",object:"",object_type:"literal"}]}),o=>{const d={"@context":{}};return o.properties&&o.properties.forEach(f=>{f.predicate&&f.object&&(d[f.predicate]=f.object)}),{objects:{"@context":{},"@graph":[d]}}});return t.jsx(dd,{...l,config:r})},S3=r=>{if(!r)return"Unknown Graph";const n=r.split(/[/#]/),i=n[n.length-1];return!i||i.length===0?r.includes("global")?"Global":r.includes("default")?"Default":"Graph":i.replace(/[-_]/g," ").replace(/\b\w/g,l=>l.toUpperCase())},_3=r=>{if(!r)return"Graph";const n=r.toLowerCase();return n.includes("global")?"Global Graph":n.includes("ontology")?"Ontology":n.includes("knowledge")?"Knowledge Graph":n.includes("user")?"User Graph":n.includes("entity")?"Entity Graph":n.includes("process")||n.includes("workflow")?"Process Graph":n.includes("experiment")?"Experimental Graph":n.includes("data")||n.includes("dataset")?"Data Graph":n.includes("result")||n.includes("analysis")?"Results Graph":"Graph"},Cy=()=>{const r=St(),{spaceId:n,graphId:i}=da(),[l,o]=x.useState([]),[d,f]=x.useState(n||""),[h,g]=x.useState(!0),[p,y]=x.useState([]),[b,j]=x.useState(i?decodeURIComponent(i):"");x.useEffect(()=>{d&&b!==""&&!n&&!i&&r(`/space/${d}/graph/${encodeURIComponent(b)}/triples`)},[d,b,r,n,i]);const[N,w]=x.useState(""),[S,E]=x.useState(""),[k,A]=x.useState(!1),[O,L]=x.useState(!1),[B,V]=x.useState(!1),[$,le]=x.useState([]),[q,K]=x.useState(null),[ae,G]=x.useState(!1),[Z,z]=x.useState(!1),[H,C]=x.useState(!1),[U,T]=x.useState(null),[R,v]=x.useState(null),[M,I]=x.useState(1),[ee,xe]=x.useState(1),[je,ve]=x.useState(10),[ye,ge]=x.useState({subject:"",predicate:"",object:"",objectType:"uri"}),be=async()=>{if(!(!ye.subject||!ye.predicate||!ye.object))try{const ce=p.find(ie=>ie.graph_uri===b);if(!ce){K("Selected graph not found");return}const pe={"@context":{"@vocab":"http://www.w3.org/1999/02/22-rdf-syntax-ns#"},"@graph":[{"@id":ye.subject,[ye.predicate]:ye.objectType==="uri"?{"@id":ye.object}:ye.object}]};await Vt.addTriples(d,ce.graph_uri,pe),await gt(),ge({subject:"",predicate:"",object:"",objectType:"uri"}),G(!1)}catch(ce){console.error("Error adding triple:",ce),K("Failed to add triple. Please try again.")}},Se=async()=>{if(!(!U||!ye.subject||!ye.predicate||!ye.object))try{const ce=p.find(Re=>Re.graph_uri===b);if(!ce){K("Selected graph not found");return}const pe={"@context":{"@vocab":"http://www.w3.org/1999/02/22-rdf-syntax-ns#"},"@graph":[{"@id":U.subject,[U.predicate]:U.object_type==="uri"?{"@id":U.object}:U.object}]};await Vt.deleteTriples(d,ce.graph_uri,pe);const ie={"@context":{"@vocab":"http://www.w3.org/1999/02/22-rdf-syntax-ns#"},"@graph":[{"@id":ye.subject,[ye.predicate]:ye.objectType==="uri"?{"@id":ye.object}:ye.object}]};await Vt.addTriples(d,ce.graph_uri,ie),await gt(),ge({subject:"",predicate:"",object:"",objectType:"uri"}),z(!1),T(null)}catch(ce){console.error("Error editing triple:",ce),K("Failed to edit triple. Please try again.")}},Ee=ce=>{T(ce),ge({subject:ce.subject,predicate:ce.predicate,object:ce.object,objectType:ce.object_type}),z(!0)},Ge=ce=>{v(ce),C(!0)},it=async()=>{if(R)try{const ce=p.find(ie=>ie.graph_uri===b);if(!ce){K("Selected graph not found");return}const pe={"@context":{"@vocab":"http://www.w3.org/1999/02/22-rdf-syntax-ns#"},"@graph":[{"@id":R.subject,[R.predicate]:R.object_type==="uri"?{"@id":R.object}:R.object}]};await Vt.deleteTriples(d,ce.graph_uri,pe),await gt(),C(!1),v(null)}catch(ce){console.error("Error deleting triple:",ce),K("Failed to delete triple. Please try again.")}},dt=x.useCallback(async()=>{try{g(!0),K(null);const pe=(await Vt.getSpaces()).map(ie=>({id:ie.id||0,tenant:ie.tenant||"default",space:ie.space,space_name:ie.space_name,description:ie.space_description||"",created_time:ie.created_time,last_modified:ie.updated_time}));o(pe)}catch(ce){console.error("Error fetching spaces:",ce),K("Failed to load spaces. Please try again later."),o([])}finally{g(!1)}},[]);x.useEffect(()=>{dt()},[dt]),x.useEffect(()=>{N!==S&&A(!0);const ce=setTimeout(()=>{E(N),A(!1)},500);return()=>clearTimeout(ce)},[N,S]);const st=x.useCallback(async()=>{if(!d){y([]);return}try{V(!0),K(null);const pe=(await Vt.getGraphs(d)).map((ie,Re)=>({id:Re,space_id:d,graph_name:S3(ie.graph_uri),graph_uri:ie.graph_uri,graph_type:_3(ie.graph_uri),triple_count:ie.triple_count||0,created_time:ie.created_time||new Date().toISOString(),last_modified:ie.updated_time||new Date().toISOString(),description:`Graph containing ${ie.triple_count||0} triples`,status:"active"}));y(pe)}catch(ce){console.error("Error fetching graphs:",ce),K("Failed to load graphs. Please try again later."),y([])}finally{V(!1)}},[d]);x.useEffect(()=>{st(),i||j("")},[st,i]);const gt=x.useCallback(async()=>{if(!(!d||b===""))try{L(!0),K(null);const ce=p.find(ke=>ke.graph_uri===b);if(!ce){K("Selected graph not found"),L(!1);return}const pe=(M-1)*je,ie=await Vt.getTriples(d,ce.graph_uri,{page_size:je,offset:pe,object_filter:S||void 0}),Re=[];let we=pe+1;if(ie.data&&ie.data["@graph"])for(const ke of ie.data["@graph"]){const ft=ke["@id"];for(const[Mt,qt]of Object.entries(ke)){if(Mt==="@id"||Mt==="@type")continue;let Wt,ht;typeof qt=="object"&&qt!==null?"@id"in qt?(Wt=String(qt["@id"]),ht="uri"):"@value"in qt?(Wt=String(qt["@value"]),ht="literal"):(Wt=JSON.stringify(qt),ht="literal"):(Wt=String(qt),ht="literal"),Re.push({id:we++,space_id:d,graph_id:ce.id,subject:ft,predicate:Mt,object:Wt,object_type:ht,created_time:new Date().toISOString(),last_modified:new Date().toISOString()})}}if(le(Re),ie.pagination){const ke=ie.pagination.pages||1;xe(ke)}else xe(1)}catch(ce){console.error("Error fetching triples:",ce),K("Failed to load triples. Please try again later."),le([]),xe(1)}finally{L(!1)}},[d,b,S,M,je,p]);return x.useEffect(()=>{gt()},[gt]),t.jsxs("div",{className:"space-y-6",children:[t.jsx(kl,{spaceId:n,graphId:i,currentPageName:"Triples",currentPageIcon:Bc}),t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(Bc,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Triples"})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end mb-6",children:[t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"space-select",children:"Select Space"}),t.jsxs(rt,{id:"space-select",value:d,onChange:ce=>f(ce.target.value),disabled:h,children:[t.jsx("option",{value:"",children:"Choose a space..."}),l.map(ce=>t.jsx("option",{value:ce.space,children:ce.space_name},ce.space))]})]}),t.jsxs("div",{className:"flex-1 max-w-xs",children:[t.jsx(se,{htmlFor:"graph-select",children:"Select Graph"}),t.jsxs(rt,{id:"graph-select",value:b,onChange:ce=>j(ce.target.value),disabled:!d||B,children:[t.jsx("option",{value:"",children:"Choose a graph..."}),p.map(ce=>t.jsx("option",{value:ce.graph_uri,children:ce.graph_name},ce.id))]})]})]}),d&&b!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs(X,{onClick:()=>G(!0),color:"blue",children:[t.jsx(as,{className:"mr-2 h-4 w-4"}),"Add Triple"]})}),d&&b!==""&&t.jsx("div",{className:"mb-6",children:t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-end",children:[t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"relative",children:[t.jsx(Qa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),t.jsx(Me,{type:"text",placeholder:"Search triples by subject, predicate, or object...",value:N,onChange:ce=>w(ce.target.value),className:"pl-10"}),k&&t.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"})})]})}),t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx(se,{htmlFor:"page-size",children:"Items per page"}),t.jsxs(rt,{id:"page-size",value:je,onChange:ce=>{ve(parseInt(ce.target.value)),I(1)},children:[t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"})]})]})]})}),q&&t.jsx(Xe,{color:"failure",className:"mb-6",children:q}),!d&&!h&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a space to view triples"}),t.jsx("p",{className:"text-sm",children:"Choose a space from the dropdown above to see available graphs."})]})}),d&&b===""&&!B&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[t.jsx("p",{className:"text-lg mb-2",children:"Select a graph to view triples"}),t.jsx("p",{className:"text-sm",children:"Choose a graph from the dropdown above to see its RDF triples."})]})}),d&&b!==""&&O&&t.jsx("div",{className:"mt-8 flex justify-center",children:t.jsx("div",{className:"text-gray-600 dark:text-gray-400",children:"Loading triples..."})}),d&&b!==""&&!O&&$.length===0&&!q?t.jsx(Xe,{color:"info",children:S?`No triples found matching "${S}". Try a different search term.`:"No triples found in this graph. Add your first triple to get started."}):d&&b!==""&&!O&&$.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{striped:!0,children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Subject"}),t.jsx(he,{children:"Predicate"}),t.jsx(he,{children:"Object"}),t.jsx(he,{children:"Type"}),t.jsx(he,{children:"Created"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{className:"divide-y",children:$.map(ce=>t.jsxs(at,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:[t.jsx(fe,{className:"font-medium text-gray-900 dark:text-white max-w-xs truncate",children:ce.subject}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400 max-w-xs truncate",children:ce.predicate}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400 max-w-xs truncate",children:ce.object}),t.jsx(fe,{children:t.jsx(jt,{color:ce.object_type==="uri"?"blue":"green",children:ce.object_type})}),t.jsx(fe,{className:"text-gray-500 dark:text-gray-400",children:new Date(ce.created_time).toLocaleDateString()}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsx(X,{size:"sm",color:"blue",onClick:()=>Ee(ce),children:t.jsx(Yi,{className:"h-4 w-4"})}),t.jsx(X,{size:"sm",color:"red",onClick:()=>Ge(ce),children:t.jsx(Et,{className:"h-4 w-4"})})]})})]},ce.id))})]})}),ee>1&&t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(yl,{currentPage:M,totalPages:ee,onPageChange:I,showIcons:!0})})]}),t.jsx(Lt,{show:ae,onClose:()=>G(!1),size:"lg",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Add New Triple"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"subject",children:"Subject"}),t.jsx(Me,{id:"subject",placeholder:"Enter subject URI or blank node",value:ye.subject,onChange:ce=>ge({...ye,subject:ce.target.value})})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"predicate",children:"Predicate"}),t.jsx(Me,{id:"predicate",placeholder:"Enter predicate URI",value:ye.predicate,onChange:ce=>ge({...ye,predicate:ce.target.value})})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"objectType",children:"Object Type"}),t.jsxs(rt,{id:"objectType",value:ye.objectType,onChange:ce=>ge({...ye,objectType:ce.target.value}),children:[t.jsx("option",{value:"uri",children:"URI"}),t.jsx("option",{value:"literal",children:"Literal"})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"object",children:"Object"}),ye.objectType==="literal"?t.jsx(_a,{id:"object",placeholder:"Enter literal value",value:ye.object,onChange:ce=>ge({...ye,object:ce.target.value}),rows:3}):t.jsx(Me,{id:"object",placeholder:"Enter object URI",value:ye.object,onChange:ce=>ge({...ye,object:ce.target.value})})]})]}),t.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[t.jsx(X,{onClick:be,color:"blue",children:"Add Triple"}),t.jsx(X,{color:"gray",onClick:()=>G(!1),children:"Cancel"})]})]})}),t.jsx(Lt,{show:Z,onClose:()=>z(!1),size:"lg",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Edit Triple"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"edit-subject",children:"Subject"}),t.jsx(Me,{id:"edit-subject",placeholder:"Enter subject URI or blank node",value:ye.subject,onChange:ce=>ge({...ye,subject:ce.target.value})})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"edit-predicate",children:"Predicate"}),t.jsx(Me,{id:"edit-predicate",placeholder:"Enter predicate URI",value:ye.predicate,onChange:ce=>ge({...ye,predicate:ce.target.value})})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"edit-objectType",children:"Object Type"}),t.jsxs(rt,{id:"edit-objectType",value:ye.objectType,onChange:ce=>ge({...ye,objectType:ce.target.value}),children:[t.jsx("option",{value:"uri",children:"URI"}),t.jsx("option",{value:"literal",children:"Literal"})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"edit-object",children:"Object"}),ye.objectType==="literal"?t.jsx(_a,{id:"edit-object",placeholder:"Enter literal value",value:ye.object,onChange:ce=>ge({...ye,object:ce.target.value}),rows:3}):t.jsx(Me,{id:"edit-object",placeholder:"Enter object URI",value:ye.object,onChange:ce=>ge({...ye,object:ce.target.value})})]})]}),t.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[t.jsx(X,{onClick:Se,color:"blue",children:"Save Changes"}),t.jsx(X,{color:"gray",onClick:()=>z(!1),children:"Cancel"})]})]})}),t.jsx(Lt,{show:H,onClose:()=>C(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Triple"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this triple? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx(X,{onClick:it,color:"failure",children:"Delete"}),t.jsx(X,{color:"gray",onClick:()=>C(!1),children:"Cancel"})]})]})})]})},T3=()=>{var G,Z,z,H,C,U,T,R,v;const[r,n]=x.useState(""),[i,l]=x.useState(null),[o,d]=x.useState(!1),[f,h]=x.useState(null),[g,p]=x.useState([]),[y,b]=x.useState(""),[j,N]=x.useState(!0),[w,S]=x.useState(!1),[E,k]=x.useState(1),[A,O]=x.useState(20),[L,B]=x.useState(0);x.useEffect(()=>{(async()=>{try{N(!0);const I=await Ue.get("/api/spaces"),ee=Array.isArray(I.data)?I.data:I.data.spaces||[];p(ee),ee.length>0&&b(ee[0].space)}catch(I){console.error("Error fetching spaces:",I),h("Failed to load spaces. Please try again later.")}finally{N(!1)}})()},[]);const V=[{name:"List all triples",query:`SELECT ?subject ?predicate ?object
WHERE {
  ?subject ?predicate ?object .
}
LIMIT 10`},{name:"Count triples",query:`SELECT (COUNT(*) as ?count)
WHERE {
  ?subject ?predicate ?object .
}`},{name:"Find entities with names",query:`PREFIX vital: <http://vital.ai/ontology/vital-core#>
SELECT ?entity ?name
WHERE {
  ?entity vital:hasName ?name .
}
LIMIT 10`}],$=async()=>{var M,I,ee,xe,je,ve,ye;if(!r.trim()){h("Please enter a SPARQL query");return}if(!y){h("Please select a space");return}try{d(!0),h(null);const ge=q(r,E,A),be=await Ue.post(`/api/graphs/sparql/${y}/query`,{query:ge},{headers:{"Content-Type":"application/json"}});console.log("SPARQL Response:",be.data),console.log("Query sent to backend:",ge),console.log("Results count:",((I=(M=be.data.results)==null?void 0:M.bindings)==null?void 0:I.length)||((ee=be.data.triples)==null?void 0:ee.length)||"N/A"),console.log("Pagination state:",{currentPage:E,pageSize:A,pagingEnabled:w}),console.log("Expected offset:",w?(E-1)*A:"N/A"),l(be.data);const Se=((je=(xe=be.data.results)==null?void 0:xe.bindings)==null?void 0:je.length)||((ve=be.data.triples)==null?void 0:ve.length)||0;Se>0&&B(w?Se===A?E*A+1:(E-1)*A+Se:Se)}catch(ge){console.error("Error executing SPARQL query:",ge);let be="Failed to execute SPARQL query. Please check your query syntax.";(ye=ge.response)!=null&&ye.data&&(typeof ge.response.data=="string"?be=ge.response.data:ge.response.data.detail?be=Array.isArray(ge.response.data.detail)?ge.response.data.detail.map(Se=>typeof Se=="object"?Se.msg||JSON.stringify(Se):Se).join(", "):ge.response.data.detail:ge.response.data.message&&(be=ge.response.data.message)),h(be),l(null)}finally{d(!1)}},le=M=>{n(M),l(null),h(null),k(1)},q=(M,I,ee)=>{if(console.log("🔧 addPaginationToQuery called:",{pagingEnabled:w,page:I,size:ee}),!w)return console.log("🔧 Pagination disabled, returning original query"),M;const xe=(I-1)*ee,ye=`${M.trim().replace(/\s+(LIMIT|OFFSET)\s+\d+/gi,"")}
LIMIT ${ee} OFFSET ${xe}`;return console.log("🔧 Generated paginated query:",ye),ye},K=M=>{S(M),k(1),i&&M&&$()},ae=()=>{var M,I;if(!i)return null;if(typeof i.boolean=="boolean")return t.jsxs(qe,{children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Query Result"}),i.query_time&&t.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Executed in ",(i.query_time*1e3).toFixed(2),"ms"]})]}),t.jsx("div",{className:`text-xl font-bold ${i.boolean?"text-green-600":"text-red-600"}`,children:i.boolean?"TRUE":"FALSE"})]});if((M=i.results)!=null&&M.bindings){const ee=i.results.bindings,xe=((I=i.head)==null?void 0:I.vars)||[];return ee.length===0?t.jsx(Xe,{color:"info",children:"Query executed successfully but returned no results."}):t.jsxs(qe,{children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:["Query Results (",ee.length," result",ee.length!==1?"s":"",")"]}),i.query_time&&t.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Executed in ",(i.query_time*1e3).toFixed(2),"ms"]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsx(at,{children:xe.map(je=>t.jsx(he,{children:je},je))})}),t.jsx(Xt,{className:"divide-y",children:ee.map((je,ve)=>t.jsx(at,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:xe.map(ye=>{const ge=je[ye],be=(ge==null?void 0:ge.value)||"",Se=(ge==null?void 0:ge.type)||null,Ee=(ge==null?void 0:ge.datatype)||null;return t.jsxs(fe,{className:"whitespace-nowrap",children:[t.jsx("div",{className:"max-w-xs truncate",title:be,children:be}),Se&&t.jsxs("div",{className:"text-xs text-gray-400 mt-1",children:[Se,Ee&&` (${Ee.split("#").pop()})`]})]},ye)})},ve))})]})})]})}return t.jsxs(qe,{children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Raw Results"}),i.query_time&&t.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Executed in ",(i.query_time*1e3).toFixed(2),"ms"]})]}),t.jsx("pre",{className:"text-sm bg-gray-100 dark:bg-gray-700 p-4 rounded overflow-auto",children:JSON.stringify(i,null,2)})]})};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(Qa,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"SPARQL Query Interface"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Execute SPARQL queries against your RDF data"})]}),t.jsx("div",{className:"mb-6",children:t.jsxs(qe,{children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs(se,{htmlFor:"space-select",className:"mb-2 block text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(t3,{className:"inline mr-2"}),"Select Space"]}),t.jsxs(rt,{id:"space-select",value:y,onChange:M=>b(M.target.value),disabled:j||o,required:!0,children:[t.jsx("option",{value:"",children:"Choose a space..."}),g.map(M=>t.jsxs("option",{value:M.space,children:[M.space_name," (",M.space,")"]},M.id))]})]}),y&&t.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.jsx("div",{className:"font-medium",children:(G=g.find(M=>M.space===y))==null?void 0:G.space_name}),t.jsx("div",{className:"text-xs",children:((Z=g.find(M=>M.space===y))==null?void 0:Z.space_description)||"No description"})]})]}),j&&t.jsxs("div",{className:"flex items-center gap-2 mt-2 text-sm text-gray-500",children:[t.jsx(He,{size:"sm"}),"Loading spaces..."]})]})}),t.jsxs("div",{className:"mb-6",children:[t.jsx("h2",{className:"mb-3 text-lg font-semibold text-gray-900 dark:text-white",children:"Sample Queries"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:V.map((M,I)=>t.jsx(qe,{className:"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700",children:t.jsxs("div",{onClick:()=>le(M.query),children:[t.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white mb-2",children:[t.jsx(a3,{className:"inline mr-2"}),M.name]}),t.jsxs("pre",{className:"text-xs text-gray-500 dark:text-gray-400 overflow-hidden",children:[M.query.substring(0,100),"..."]})]})},I))})]}),t.jsxs("div",{className:"mb-6",children:[t.jsx("h2",{className:"mb-3 text-lg font-semibold text-gray-900 dark:text-white",children:"SPARQL Query"}),t.jsx(_a,{id:"sparql-query",placeholder:"Enter your SPARQL query here...",rows:10,value:r,onChange:M=>n(M.target.value),className:"font-mono text-sm"}),t.jsxs("div",{className:"mt-4 flex gap-4",children:[t.jsx(X,{onClick:()=>{k(1),$()},disabled:o||!r.trim()||!y,color:"blue",children:o?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Executing..."]}):t.jsxs(t.Fragment,{children:[t.jsx(hr,{className:"mr-2 h-4 w-4"}),"Execute Query"]})}),t.jsx(X,{onClick:()=>{n(""),l(null),h(null),k(1),B(0)},color:"gray",disabled:o,children:"Clear"})]}),t.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[t.jsx(Ov,{checked:w,label:"Enable Pagination",onChange:K}),w&&t.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[t.jsx("span",{children:"Page size:"}),t.jsxs(rt,{value:A.toString(),onChange:M=>{O(parseInt(M.target.value)),k(1)},sizing:"sm",className:"w-20",children:[t.jsx("option",{value:"10",children:"10"}),t.jsx("option",{value:"20",children:"20"}),t.jsx("option",{value:"50",children:"50"}),t.jsx("option",{value:"100",children:"100"})]})]})]})]}),w&&i&&(((z=i.results)==null?void 0:z.bindings)||i.triples)&&t.jsx("div",{className:"mb-4",children:t.jsx(qe,{children:t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Page ",E," • Showing ",((C=(H=i.results)==null?void 0:H.bindings)==null?void 0:C.length)||((U=i.triples)==null?void 0:U.length)||0," results",L>A&&` • Estimated ${L}+ total`]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(X,{size:"sm",color:"gray",disabled:E===1||o,onClick:()=>{k(E-1),$()},children:"Previous"}),t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Page ",E]}),t.jsx(X,{size:"sm",color:"gray",disabled:(((R=(T=i.results)==null?void 0:T.bindings)==null?void 0:R.length)||((v=i.triples)==null?void 0:v.length)||0)<A||o,onClick:()=>{k(E+1),$()},children:"Next"})]})]})})}),f&&t.jsxs(Xe,{color:"failure",className:"mb-6",children:[t.jsx("span",{className:"font-medium",children:"Error:"})," ",f]}),ae()]})},f1=[{id:1,name:"Product Catalog Import",description:"Import product catalog data from external system",space_id:"space1",graph_id:1,file_name:"products.ttl",file_size:2048576,file_type:"text/turtle",status:"completed",progress:100,created_time:"2024-01-15T10:30:00Z",started_time:"2024-01-15T10:32:00Z",completed_time:"2024-01-15T10:35:00Z"},{id:2,name:"Customer Data Import",description:"Import customer relationship data",space_id:"space1",graph_id:2,file_name:"customers.rdf",file_size:1536e3,file_type:"application/rdf+xml",status:"processing",progress:65,created_time:"2024-01-16T14:20:00Z",started_time:"2024-01-16T14:22:00Z"},{id:3,name:"Ontology Import",description:"Import domain ontology definitions",space_id:"space2",graph_id:3,file_name:"ontology.owl",file_size:512e3,file_type:"application/rdf+xml",status:"pending",progress:0,created_time:"2024-01-17T09:15:00Z"},{id:4,name:"Failed Import Test",description:"Test import that failed due to format issues",space_id:"space1",graph_id:1,file_name:"invalid.ttl",file_size:1024e3,file_type:"text/turtle",status:"failed",progress:25,created_time:"2024-01-14T16:45:00Z",started_time:"2024-01-14T16:47:00Z",completed_time:"2024-01-14T16:48:00Z",error_message:"Invalid Turtle syntax at line 42: Unexpected token"}],h1=[{id:1,name:"Full Graph Export",description:"Complete export of product graph for backup",space_id:"space1",graph_id:1,export_format:"turtle",status:"completed",progress:100,file_size:3072e3,download_url:"/api/exports/1/download",expires_at:"2024-02-15T10:30:00Z",created_time:"2024-01-15T11:00:00Z",started_time:"2024-01-15T11:02:00Z",completed_time:"2024-01-15T11:05:00Z"},{id:2,name:"Customer Data Export",description:"Export customer data for analysis",space_id:"space1",graph_id:2,export_format:"json-ld",status:"processing",progress:80,created_time:"2024-01-16T15:30:00Z",started_time:"2024-01-16T15:32:00Z"},{id:3,name:"Ontology Export",description:"Export ontology for sharing with partners",space_id:"space2",graph_id:3,export_format:"rdf/xml",status:"pending",progress:0,created_time:"2024-01-17T10:00:00Z"},{id:4,name:"Expired Export",description:"Old export that has expired",space_id:"space1",graph_id:1,export_format:"n-triples",status:"expired",progress:100,file_size:256e4,created_time:"2024-01-10T08:00:00Z",started_time:"2024-01-10T08:02:00Z",completed_time:"2024-01-10T08:04:00Z",expires_at:"2024-01-17T08:04:00Z"},{id:5,name:"Failed Export",description:"Export that failed due to system error",space_id:"space2",graph_id:4,export_format:"turtle",status:"failed",progress:15,created_time:"2024-01-16T12:00:00Z",started_time:"2024-01-16T12:02:00Z",completed_time:"2024-01-16T12:03:00Z",error_message:"Database connection timeout during export"}],p1=[{id:1,name:"Knowledge Base Migration",description:"Migrate knowledge base from research space to production",source_space_id:"space2",source_graph_id:3,target_space_id:"space1",target_graph_id:1,migration_type:"copy",status:"completed",progress:100,triples_migrated:25680,total_triples:25680,created_time:"2024-01-18T09:00:00Z",started_time:"2024-01-18T09:02:00Z",completed_time:"2024-01-18T09:15:00Z"},{id:2,name:"User Data Sync",description:"Synchronize user data between spaces",source_space_id:"space1",source_graph_id:3,target_space_id:"space3",target_graph_id:5,migration_type:"sync",status:"processing",progress:45,triples_migrated:1053,total_triples:2340,created_time:"2024-01-19T14:30:00Z",started_time:"2024-01-19T14:32:00Z"},{id:3,name:"Ontology Move",description:"Move ontology definitions to dedicated space",source_space_id:"space1",source_graph_id:2,target_space_id:"space2",target_graph_id:4,migration_type:"move",status:"pending",progress:0,total_triples:8750,created_time:"2024-01-20T10:15:00Z"},{id:4,name:"Failed Migration Test",description:"Test migration that failed due to permission issues",source_space_id:"space3",source_graph_id:6,target_space_id:"space1",target_graph_id:1,migration_type:"copy",status:"failed",progress:12,triples_migrated:2270,total_triples:18920,created_time:"2024-01-17T16:00:00Z",started_time:"2024-01-17T16:02:00Z",completed_time:"2024-01-17T16:05:00Z",error_message:"Insufficient permissions to write to target graph"},{id:5,name:"Experimental Data Copy",description:"Copy experimental data for analysis",source_space_id:"space2",source_graph_id:5,target_space_id:"space3",target_graph_id:5,migration_type:"copy",status:"canceled",progress:28,triples_migrated:1588,total_triples:5670,created_time:"2024-01-16T11:20:00Z",started_time:"2024-01-16T11:22:00Z",completed_time:"2024-01-16T11:30:00Z"}],m1=[{id:1,name:"Customer Data Sync",description:"Sync customer data to external CRM system",space_id:"space1",graph_id:1,external_system:"Salesforce CRM",parallel_slices:4,status:"processing",overall_progress:65,ranges:[{range_id:1,hash_prefix_start:"00000000",hash_prefix_end:"3FFFFFFF",current_cursor:"2A3B4C5D",records_processed:12500,total_records:25e3,status:"processing",started_time:"2024-01-15T10:30:00Z"},{range_id:2,hash_prefix_start:"40000000",hash_prefix_end:"7FFFFFFF",current_cursor:"6F8A9B2C",records_processed:18750,total_records:25e3,status:"processing",started_time:"2024-01-15T10:30:00Z"},{range_id:3,hash_prefix_start:"80000000",hash_prefix_end:"BFFFFFFF",current_cursor:"BFFFFFFF",records_processed:25e3,total_records:25e3,status:"completed",started_time:"2024-01-15T10:30:00Z",completed_time:"2024-01-15T11:45:00Z"},{range_id:4,hash_prefix_start:"C0000000",hash_prefix_end:"FFFFFFFF",current_cursor:"D1E2F3A4",records_processed:8750,total_records:25e3,status:"processing",started_time:"2024-01-15T10:30:00Z"}],total_records:1e5,records_processed:65e3,created_time:"2024-01-15T10:00:00Z",started_time:"2024-01-15T10:30:00Z",last_updated:"2024-01-15T12:15:00Z"},{id:2,name:"Product Catalog Backup",description:"Backup product catalog to external storage",space_id:"space2",graph_id:3,external_system:"AWS S3",parallel_slices:2,status:"completed",overall_progress:100,ranges:[{range_id:1,hash_prefix_start:"00000000",hash_prefix_end:"7FFFFFFF",current_cursor:"7FFFFFFF",records_processed:5e4,total_records:5e4,status:"completed",started_time:"2024-01-14T14:00:00Z",completed_time:"2024-01-14T15:30:00Z"},{range_id:2,hash_prefix_start:"80000000",hash_prefix_end:"FFFFFFFF",current_cursor:"FFFFFFFF",records_processed:5e4,total_records:5e4,status:"completed",started_time:"2024-01-14T14:00:00Z",completed_time:"2024-01-14T15:20:00Z"}],total_records:1e5,records_processed:1e5,created_time:"2024-01-14T13:45:00Z",started_time:"2024-01-14T14:00:00Z",completed_time:"2024-01-14T15:30:00Z",last_updated:"2024-01-14T15:30:00Z"},{id:3,name:"Analytics Data Export",description:"Export analytics data for machine learning pipeline",space_id:"space1",graph_id:2,external_system:"ML Pipeline",parallel_slices:8,status:"pending",overall_progress:0,ranges:[{range_id:1,hash_prefix_start:"00000000",hash_prefix_end:"1FFFFFFF",current_cursor:"00000000",records_processed:0,total_records:37500,status:"pending"},{range_id:2,hash_prefix_start:"20000000",hash_prefix_end:"3FFFFFFF",current_cursor:"20000000",records_processed:0,total_records:37500,status:"pending"},{range_id:3,hash_prefix_start:"40000000",hash_prefix_end:"5FFFFFFF",current_cursor:"40000000",records_processed:0,total_records:37500,status:"pending"},{range_id:4,hash_prefix_start:"60000000",hash_prefix_end:"7FFFFFFF",current_cursor:"60000000",records_processed:0,total_records:37500,status:"pending"},{range_id:5,hash_prefix_start:"80000000",hash_prefix_end:"9FFFFFFF",current_cursor:"80000000",records_processed:0,total_records:37500,status:"pending"},{range_id:6,hash_prefix_start:"A0000000",hash_prefix_end:"BFFFFFFF",current_cursor:"A0000000",records_processed:0,total_records:37500,status:"pending"},{range_id:7,hash_prefix_start:"C0000000",hash_prefix_end:"DFFFFFFF",current_cursor:"C0000000",records_processed:0,total_records:37500,status:"pending"},{range_id:8,hash_prefix_start:"E0000000",hash_prefix_end:"FFFFFFFF",current_cursor:"E0000000",records_processed:0,total_records:37500,status:"pending"}],total_records:3e5,records_processed:0,created_time:"2024-01-16T09:00:00Z",last_updated:"2024-01-16T09:00:00Z"},{id:4,name:"Order History Sync",description:"Sync order history to data warehouse",space_id:"space3",graph_id:5,external_system:"Data Warehouse",parallel_slices:6,status:"failed",overall_progress:23,ranges:[{range_id:1,hash_prefix_start:"00000000",hash_prefix_end:"2AAAAAAA",current_cursor:"15432ABC",records_processed:8500,total_records:33333,status:"failed",started_time:"2024-01-13T16:00:00Z"},{range_id:2,hash_prefix_start:"2AAAAAAB",hash_prefix_end:"55555555",current_cursor:"2AAAAAAB",records_processed:0,total_records:33333,status:"pending"},{range_id:3,hash_prefix_start:"55555556",hash_prefix_end:"80000000",current_cursor:"55555556",records_processed:0,total_records:33333,status:"pending"},{range_id:4,hash_prefix_start:"80000001",hash_prefix_end:"AAAAAAAA",current_cursor:"80000001",records_processed:0,total_records:33333,status:"pending"},{range_id:5,hash_prefix_start:"AAAAAAAB",hash_prefix_end:"D5555555",current_cursor:"AAAAAAAB",records_processed:0,total_records:33333,status:"pending"},{range_id:6,hash_prefix_start:"D5555556",hash_prefix_end:"FFFFFFFF",current_cursor:"D5555556",records_processed:0,total_records:33334,status:"pending"}],total_records:2e5,records_processed:46e3,created_time:"2024-01-13T15:30:00Z",started_time:"2024-01-13T16:00:00Z",last_updated:"2024-01-13T16:45:00Z",error_message:"Connection timeout to external system"}],g1=[{id:1,name:"Daily Backup Checkpoint",description:"Daily backup checkpoint for customer data",space_id:"space1",graph_id:1,checkpoint_timestamp:"2024-01-15T23:59:59Z",checkpoint_hash:"a1b2c3d4e5f6789012345678901234567890abcd",purpose:"Daily backup",external_system:"Backup Service",created_time:"2024-01-16T00:05:00Z",created_by:"system"},{id:2,name:"Pre-Migration Checkpoint",description:"Checkpoint before data migration to new system",space_id:"space2",graph_id:3,checkpoint_timestamp:"2024-01-14T15:30:00Z",checkpoint_hash:"9876543210fedcba0987654321098765432109876",purpose:"Pre-migration snapshot",external_system:"Migration Tool",created_time:"2024-01-14T15:30:15Z",created_by:"admin"},{id:3,name:"Sync Completion Marker",description:"External sync completion checkpoint",space_id:"space1",graph_id:2,checkpoint_timestamp:"2024-01-16T14:22:30Z",checkpoint_hash:"def456789abc123456789def123456789abcdef12",purpose:"Sync completion",external_system:"CRM System",created_time:"2024-01-16T14:22:45Z",created_by:"sync-service"},{id:4,name:"Weekly Archive Point",description:"Weekly archival checkpoint for analytics data",space_id:"space3",graph_id:5,checkpoint_timestamp:"2024-01-14T23:59:59Z",checkpoint_hash:"123abc456def789012345678901234567890abcd",purpose:"Weekly archive",created_time:"2024-01-15T00:01:00Z",created_by:"archive-service"},{id:5,name:"Manual Checkpoint",description:"Manual checkpoint before system maintenance",space_id:"space2",graph_id:4,checkpoint_timestamp:"2024-01-13T16:45:00Z",checkpoint_hash:"fedcba9876543210fedcba9876543210fedcba98",purpose:"Pre-maintenance",created_time:"2024-01-13T16:45:30Z",created_by:"admin"}],Ti=()=>{const r=St(),n=za(),[i,l]=x.useState("import"),[o,d]=x.useState([]),[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState([]),[j,N]=x.useState([]),[w,S]=x.useState([]),[E,k]=x.useState([]),[A,O]=x.useState(!0),[L,B]=x.useState(null),[V,$]=x.useState(!1),[le,q]=x.useState(!1),[K,ae]=x.useState(!1),[G,Z]=x.useState(!1),[z,H]=x.useState(!1),[C,U]=x.useState(null),[T,R]=x.useState(null),[v,M]=x.useState(null),[I,ee]=x.useState(null),[xe,je]=x.useState(null),ve=x.useCallback(async()=>{try{O(!0),await new Promise(Q=>setTimeout(Q,500)),d(f1),h(h1),p(p1),b(m1),N(g1),S(Nr),k(Kr),B(null)}catch(Q){console.error("Error fetching data:",Q),B("Failed to load data. Please try again later.")}finally{O(!1)}},[]);x.useEffect(()=>{ve(),n.pathname==="/data/export"?l("export"):n.pathname==="/data/migrate"?l("migrate"):n.pathname==="/data/tracking"?l("tracking"):n.pathname==="/data/checkpoint"?l("checkpoint"):l("import")},[ve,n.pathname]);const ye=Q=>{const Ne=w.find(De=>De.space===Q);return Ne?Ne.space_name:Q},ge=Q=>{const Ne=E.find(De=>De.id===Q);return Ne?Ne.graph_name:`Graph ${Q}`},be=Q=>{if(Q===0)return"0 Bytes";const Ne=1024,De=["Bytes","KB","MB","GB"],Ga=Math.floor(Math.log(Q)/Math.log(Ne));return parseFloat((Q/Math.pow(Ne,Ga)).toFixed(2))+" "+De[Ga]},Se=Q=>new Date(Q).toLocaleString(),Ee=Q=>{switch(Q){case"completed":return"success";case"processing":return"info";case"pending":return"warning";case"failed":return"failure";case"canceled":return"gray";case"expired":return"gray";default:return"gray"}},Ge=async Q=>{d(Ne=>Ne.map(De=>De.id===Q?{...De,status:"processing",started_time:new Date().toISOString(),progress:10}:De))},it=async Q=>{d(Ne=>Ne.map(De=>De.id===Q?{...De,status:"canceled",completed_time:new Date().toISOString()}:De))},dt=async Q=>{h(Ne=>Ne.map(De=>De.id===Q?{...De,status:"processing",started_time:new Date().toISOString(),progress:10}:De))},st=async Q=>{h(Ne=>Ne.map(De=>De.id===Q?{...De,status:"canceled",completed_time:new Date().toISOString()}:De))},gt=async Q=>{p(Ne=>Ne.map(De=>De.id===Q?{...De,status:"processing",started_time:new Date().toISOString(),progress:10}:De))},ce=async Q=>{p(Ne=>Ne.map(De=>De.id===Q?{...De,status:"canceled",completed_time:new Date().toISOString()}:De))},pe=Q=>{if(Q.download_url){const Ne=document.createElement("a");Ne.href=Q.download_url,Ne.download=`${Q.name.replace(/\s+/g,"_")}.${Q.export_format}`,document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne)}},ie=async Q=>{const Ne=o.find(De=>De.id===Q);Ne&&(U(Ne),$(!0))},Re=async()=>{C&&(d(Q=>Q.filter(Ne=>Ne.id!==C.id)),$(!1),U(null))},we=async Q=>{const Ne=f.find(De=>De.id===Q);Ne&&(R(Ne),q(!0))},ke=async()=>{T&&(h(Q=>Q.filter(Ne=>Ne.id!==T.id)),q(!1),R(null))},ft=async Q=>{const Ne=g.find(De=>De.id===Q);Ne&&(M(Ne),ae(!0))},Mt=async()=>{v&&(p(Q=>Q.filter(Ne=>Ne.id!==v.id)),ae(!1),M(null))},qt=async Q=>{b(Ne=>Ne.map(De=>De.id===Q?{...De,status:"processing",started_time:new Date().toISOString(),overall_progress:5}:De))},Wt=async Q=>{b(Ne=>Ne.map(De=>De.id===Q?{...De,status:"paused",last_updated:new Date().toISOString()}:De))},ht=async Q=>{b(Ne=>Ne.map(De=>De.id===Q?{...De,status:"processing",last_updated:new Date().toISOString()}:De))},Ut=async Q=>{const Ne=y.find(De=>De.id===Q);Ne&&(ee(Ne),Z(!0))},Tt=async()=>{I&&(b(Q=>Q.filter(Ne=>Ne.id!==I.id)),Z(!1),ee(null))},Yr=async Q=>{const Ne=j.find(De=>De.id===Q);Ne&&(je(Ne),H(!0))},us=async()=>{xe&&(N(Q=>Q.filter(Ne=>Ne.id!==xe.id)),H(!1),je(null))};return A?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(nr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Data Management"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage data imports and exports for your RDF graphs"})]}),L&&t.jsx(Xe,{color:"failure",className:"mb-4",children:L}),t.jsxs(qe,{children:[t.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700",children:t.jsxs("nav",{className:"-mb-px flex space-x-8",children:[t.jsx("button",{onClick:()=>r("/data/import"),className:`py-2 px-1 border-b-2 font-medium text-sm ${i==="import"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Data Import"}),t.jsx("button",{onClick:()=>r("/data/export"),className:`py-2 px-1 border-b-2 font-medium text-sm ${i==="export"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Data Export"}),t.jsx("button",{onClick:()=>r("/data/migrate"),className:`py-2 px-1 border-b-2 font-medium text-sm ${i==="migrate"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Data Migrate"}),t.jsx("button",{onClick:()=>r("/data/tracking"),className:`py-2 px-1 border-b-2 font-medium text-sm ${i==="tracking"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Data Tracking"}),t.jsx("button",{onClick:()=>r("/data/checkpoint"),className:`py-2 px-1 border-b-2 font-medium text-sm ${i==="checkpoint"?"border-blue-500 text-blue-600 dark:text-blue-500":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Data Checkpoint"})]})}),t.jsxs("div",{className:"p-6",children:[i==="import"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Data Imports"}),t.jsxs(X,{color:"blue",onClick:()=>r("/data/import/new"),children:[t.jsx(as,{className:"w-4 h-4 mr-2"}),"Add Data Import"]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Name"}),t.jsx(he,{children:"Space"}),t.jsx(he,{children:"Graph"}),t.jsx(he,{children:"File"}),t.jsx(he,{children:"Status"}),t.jsx(he,{children:"Progress"}),t.jsx(he,{children:"Created"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{children:o.map(Q=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:Q.name}),t.jsx(fe,{children:ye(Q.space_id)}),t.jsx(fe,{children:ge(Q.graph_id)}),t.jsx(fe,{children:t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Q.file_name}),t.jsx("div",{className:"text-sm text-gray-500",children:be(Q.file_size)})]})}),t.jsx(fe,{children:t.jsx(jt,{color:Ee(Q.status),children:Q.status})}),t.jsx(fe,{children:t.jsxs("div",{className:"w-24",children:[t.jsx(yr,{progress:Q.progress,color:Q.status==="failed"?"red":"blue",size:"sm"}),t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[Q.progress,"%"]})]})}),t.jsx(fe,{className:"text-sm",children:Se(Q.created_time)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{size:"xs",color:"blue",onClick:()=>r(`/data/import/${Q.id}`),children:[t.jsx(Ka,{className:"w-3 h-3 mr-1"}),"Details"]}),Q.status==="pending"&&t.jsxs(X,{size:"xs",color:"green",onClick:()=>Ge(Q.id),children:[t.jsx(hr,{className:"w-3 h-3 mr-1"}),"Start"]}),Q.status==="processing"&&t.jsxs(X,{size:"xs",color:"red",onClick:()=>it(Q.id),children:[t.jsx(_n,{className:"w-3 h-3 mr-1"}),"Cancel"]}),t.jsx(X,{size:"xs",color:"red",onClick:()=>ie(Q.id),disabled:Q.status==="processing",children:t.jsx(Et,{className:"w-3 h-3"})})]})})]},Q.id))})]})}),o.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No data imports found. Create your first import to get started."})]}),i==="export"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Data Exports"}),t.jsxs(X,{color:"blue",onClick:()=>r("/data/export/new"),children:[t.jsx(as,{className:"w-4 h-4 mr-2"}),"Add Data Export"]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Space"}),t.jsx(he,{children:"Graph"}),t.jsx(he,{children:"Format"}),t.jsx(he,{children:"Status"}),t.jsx(he,{children:"Progress"}),t.jsx(he,{children:"Size"}),t.jsx(he,{children:"Created"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{children:f.map(Q=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:ye(Q.space_id)}),t.jsx(fe,{children:ge(Q.graph_id)}),t.jsx(fe,{children:t.jsx(jt,{color:"gray",children:Q.export_format})}),t.jsx(fe,{children:t.jsx(jt,{color:Ee(Q.status),children:Q.status})}),t.jsx(fe,{children:t.jsxs("div",{className:"w-24",children:[t.jsx(yr,{progress:Q.progress,color:Q.status==="failed"?"red":"blue",size:"sm"}),t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[Q.progress,"%"]})]})}),t.jsx(fe,{className:"text-sm",children:Q.file_size?be(Q.file_size):"-"}),t.jsx(fe,{className:"text-sm",children:Se(Q.created_time)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{size:"xs",color:"blue",onClick:()=>r(`/data/export/${Q.id}`),children:[t.jsx(Ka,{className:"w-3 h-3 mr-1"}),"Details"]}),Q.status==="pending"&&t.jsxs(X,{size:"xs",color:"green",onClick:()=>dt(Q.id),children:[t.jsx(hr,{className:"w-3 h-3 mr-1"}),"Start"]}),Q.status==="processing"&&t.jsxs(X,{size:"xs",color:"red",onClick:()=>st(Q.id),children:[t.jsx(_n,{className:"w-3 h-3 mr-1"}),"Cancel"]}),Q.status==="completed"&&Q.download_url&&t.jsxs(X,{size:"xs",color:"green",onClick:()=>pe(Q),children:[t.jsx(pr,{className:"w-3 h-3 mr-1"}),"Download"]}),t.jsx(X,{size:"xs",color:"red",onClick:()=>we(Q.id),disabled:Q.status==="processing",children:t.jsx(Et,{className:"w-3 h-3"})})]})})]},Q.id))})]})}),f.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No data exports found. Create your first export to get started."})]}),i==="migrate"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Data Migrations"}),t.jsxs(X,{color:"blue",onClick:()=>r("/data/migrate/new"),children:[t.jsx(as,{className:"w-4 h-4 mr-2"}),"Add Data Migration"]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Source Space"}),t.jsx(he,{children:"Source Graph"}),t.jsx(he,{children:"Target Space"}),t.jsx(he,{children:"Target Graph"}),t.jsx(he,{children:"Type"}),t.jsx(he,{children:"Status"}),t.jsx(he,{children:"Progress"}),t.jsx(he,{children:"Triples"}),t.jsx(he,{children:"Created"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{children:g.map(Q=>t.jsxs(at,{children:[t.jsx(fe,{children:t.jsx("div",{className:"font-medium",children:ye(Q.source_space_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ge(Q.source_graph_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"font-medium",children:ye(Q.target_space_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ge(Q.target_graph_id)})}),t.jsx(fe,{children:t.jsx(jt,{color:"gray",children:Q.migration_type})}),t.jsx(fe,{children:t.jsx(jt,{color:Ee(Q.status),children:Q.status})}),t.jsx(fe,{children:t.jsxs("div",{className:"w-24",children:[t.jsx(yr,{progress:Q.progress,color:Q.status==="failed"?"red":"blue",size:"sm"}),t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[Q.progress,"%"]})]})}),t.jsxs(fe,{className:"text-sm",children:[Q.triples_migrated?`${Q.triples_migrated.toLocaleString()}`:"0"," / ",Q.total_triples?Q.total_triples.toLocaleString():"0"]}),t.jsx(fe,{className:"text-sm",children:Se(Q.created_time)}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{size:"xs",color:"blue",onClick:()=>r(`/data/migrate/${Q.id}`),children:[t.jsx(Ka,{className:"w-3 h-3 mr-1"}),"Details"]}),Q.status==="pending"&&t.jsxs(X,{size:"xs",color:"green",onClick:()=>gt(Q.id),children:[t.jsx(hr,{className:"w-3 h-3 mr-1"}),"Start"]}),Q.status==="processing"&&t.jsxs(X,{size:"xs",color:"red",onClick:()=>ce(Q.id),children:[t.jsx(_n,{className:"w-3 h-3 mr-1"}),"Cancel"]}),t.jsx(X,{size:"xs",color:"red",onClick:()=>ft(Q.id),disabled:Q.status==="processing",children:t.jsx(Et,{className:"w-3 h-3"})})]})})]},Q.id))})]})}),g.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No data migrations found. Create your first migration to get started."})]}),i==="tracking"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Data Tracking"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Monitor data processing operations"})]}),t.jsxs(X,{onClick:()=>r("/data/tracking/new"),children:[t.jsx(as,{className:"w-4 h-4 mr-2"}),"Add Data Tracking"]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Name"}),t.jsx(he,{children:"Space"}),t.jsx(he,{children:"Graph"}),t.jsx(he,{children:"External System"}),t.jsx(he,{children:"Status"}),t.jsx(he,{children:"Progress"}),t.jsx(he,{children:"Slices"}),t.jsx(he,{children:"Records"}),t.jsx(he,{children:"Last Updated"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{children:y.map(Q=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:Q.name}),t.jsx(fe,{children:t.jsx("div",{className:"font-medium",children:ye(Q.space_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ge(Q.graph_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm",children:Q.external_system||"N/A"})}),t.jsx(fe,{children:t.jsx(jt,{color:Ee(Q.status),children:Q.status})}),t.jsxs(fe,{children:[t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700",children:t.jsx("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${Q.overall_progress}%`}})}),t.jsxs("span",{className:"text-xs text-gray-500 mt-1",children:[Q.overall_progress,"%"]})]}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm",children:Q.parallel_slices})}),t.jsx(fe,{children:t.jsxs("div",{className:"text-sm",children:[Q.records_processed.toLocaleString()," / ",Q.total_records.toLocaleString()]})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-500",children:new Date(Q.last_updated).toLocaleDateString()})}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{size:"xs",color:"blue",onClick:()=>r(`/data/tracking/${Q.id}`),children:[t.jsx(Ka,{className:"w-3 h-3 mr-1"}),"Details"]}),Q.status==="pending"?t.jsxs(X,{size:"xs",color:"green",onClick:()=>qt(Q.id),children:[t.jsx(hr,{className:"w-3 h-3 mr-1"}),"Start"]}):Q.status==="paused"?t.jsxs(X,{size:"xs",color:"green",onClick:()=>ht(Q.id),children:[t.jsx(hr,{className:"w-3 h-3 mr-1"}),"Resume"]}):Q.status==="processing"?t.jsxs(X,{size:"xs",color:"red",onClick:()=>Wt(Q.id),children:[t.jsx(_n,{className:"w-3 h-3 mr-1"}),"Pause"]}):null,t.jsx(X,{size:"xs",color:"red",onClick:()=>Ut(Q.id),disabled:Q.status==="processing",children:t.jsx(Et,{className:"w-3 h-3"})})]})})]},Q.id))})]})}),y.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No data tracking found. Create your first tracking to get started."})]}),i==="checkpoint"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Data Checkpoint"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Manage data checkpoints and snapshots"})]}),t.jsxs(X,{onClick:()=>r("/data/checkpoint/new"),children:[t.jsx(as,{className:"w-4 h-4 mr-2"}),"Add Data Checkpoint"]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Name"}),t.jsx(he,{children:"Space"}),t.jsx(he,{children:"Graph"}),t.jsx(he,{children:"Timestamp"}),t.jsx(he,{children:"Hash"}),t.jsx(he,{children:"External System"}),t.jsx(he,{children:"Created"}),t.jsx(he,{children:"Actions"})]})}),t.jsx(Xt,{children:j.map(Q=>t.jsxs(at,{children:[t.jsx(fe,{className:"font-medium",children:Q.name}),t.jsx(fe,{children:t.jsx("div",{className:"font-medium",children:ye(Q.space_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ge(Q.graph_id)})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:new Date(Q.checkpoint_timestamp).toLocaleString()})}),t.jsx(fe,{children:t.jsxs("div",{className:"text-xs font-mono text-gray-600 dark:text-gray-400",children:[Q.checkpoint_hash.substring(0,12),"..."]})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm",children:Q.external_system||"N/A"})}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm text-gray-500",children:new Date(Q.created_time).toLocaleDateString()})}),t.jsx(fe,{children:t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(X,{size:"xs",color:"blue",onClick:()=>r(`/data/checkpoint/${Q.id}`),children:[t.jsx(Ka,{className:"w-3 h-3 mr-1"}),"Details"]}),t.jsx(X,{size:"xs",color:"red",onClick:()=>Yr(Q.id),children:t.jsx(Et,{className:"w-3 h-3"})})]})})]},Q.id))})]})}),j.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No data checkpoints found. Create your first checkpoint to get started."})]})]})]}),t.jsx(Lt,{show:V,onClose:()=>$(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Import"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this import? This action cannot be undone."}),C&&t.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-lg mb-6",children:t.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("strong",{children:"Import:"})," ",C.name]})}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(X,{onClick:Re,color:"failure",className:"flex-1",children:"Yes, Delete Import"}),t.jsx(X,{color:"gray",onClick:()=>{$(!1),U(null)},className:"flex-1",children:"Cancel"})]})]})}),t.jsx(Lt,{show:le,onClose:()=>q(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Export"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this export? This action cannot be undone."}),T&&t.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-lg mb-6",children:t.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("strong",{children:"Export:"})," ",T.name]})}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(X,{onClick:ke,color:"failure",className:"flex-1",children:"Yes, Delete Export"}),t.jsx(X,{color:"gray",onClick:()=>{q(!1),R(null)},className:"flex-1",children:"Cancel"})]})]})}),t.jsx(Lt,{show:K,onClose:()=>ae(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Migration"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this migration? This action cannot be undone."}),v&&t.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-lg mb-6",children:t.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("strong",{children:"Migration:"})," ",ye(v.source_space_id)," → ",ye(v.target_space_id)]})}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(X,{onClick:Mt,color:"failure",className:"flex-1",children:"Yes, Delete Migration"}),t.jsx(X,{color:"gray",onClick:()=>{ae(!1),M(null)},className:"flex-1",children:"Cancel"})]})]})}),t.jsx(Lt,{show:G,onClose:()=>Z(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Tracking"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this tracking operation? This action cannot be undone."}),I&&t.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-lg mb-6",children:t.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("strong",{children:"Tracking:"})," ",I.name]})}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(X,{onClick:Tt,color:"failure",className:"flex-1",children:"Yes, Delete Tracking"}),t.jsx(X,{color:"gray",onClick:()=>{Z(!1),ee(null)},className:"flex-1",children:"Cancel"})]})]})}),t.jsx(Lt,{show:z,onClose:()=>H(!1),size:"md",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Delete Checkpoint"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Are you sure you want to delete this checkpoint? This action cannot be undone."}),xe&&t.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-lg mb-6",children:t.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("strong",{children:"Checkpoint:"})," ",xe.name]})}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(X,{onClick:us,color:"failure",className:"flex-1",children:"Yes, Delete Checkpoint"}),t.jsx(X,{color:"gray",onClick:()=>{H(!1),je(null)},className:"flex-1",children:"Cancel"})]})]})})]})},Ey=()=>{const r=St(),{importId:n}=da(),[i]=hl(),l=n==="new",[o,d]=x.useState(null),[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!0),[j,N]=x.useState(!1),[w,S]=x.useState(null),[E,k]=x.useState(null),[A,O]=x.useState({name:"",description:"",space_id:"",graph_id:0}),L=i.get("spaceId"),B=i.get("graphId"),V=x.useCallback(async()=>{try{if(b(!0),await new Promise(T=>setTimeout(T,100)),h(Nr),p(Kr),!l&&n){const T=f1.find(R=>R.id===parseInt(n));T?(d(T),O({name:T.name,description:T.description,space_id:T.space_id,graph_id:T.graph_id})):S("Import not found")}else{const T=B?parseInt(B,10):0;console.log("URL parameters:",{urlSpaceId:L,urlGraphId:B,graphIdNum:T}),O({name:"",description:"",space_id:L||"",graph_id:T})}S(null)}catch(T){console.error("Error fetching data:",T),S("Failed to load data. Please try again later.")}finally{b(!1)}},[n,l,L,B]);x.useEffect(()=>{V()},[V]);const $=T=>{const R=f.find(v=>v.space===T);return R?R.space_name:T},le=T=>{const R=g.find(v=>v.id===T);return R?R.graph_name:`Graph ${T}`},q=T=>{if(T===0)return"0 Bytes";const R=1024,v=["Bytes","KB","MB","GB"],M=Math.floor(Math.log(T)/Math.log(R));return parseFloat((T/Math.pow(R,M)).toFixed(2))+" "+v[M]},K=T=>new Date(T).toLocaleString(),ae=T=>{switch(T){case"completed":return"success";case"processing":return"info";case"pending":return"warning";case"failed":return"failure";case"canceled":return"gray";default:return"gray"}},G=(T,R)=>{O(v=>({...v,[T]:R}))},Z=T=>{var v;const R=(v=T.target.files)==null?void 0:v[0];k(R||null)},z=async()=>{if(!A.name.trim()){S("Name is required");return}if(!A.space_id){S("Space is required");return}if(!A.graph_id){S("Graph is required");return}if(l&&!E){S("File is required for new imports");return}try{N(!0),await new Promise(T=>setTimeout(T,1e3)),l?console.log("Creating new import:",A,E):console.log("Updating import:",o==null?void 0:o.id,A),r("/data/import")}catch(T){console.error("Error saving import:",T),S("Failed to save import. Please try again.")}finally{N(!1)}},H=async()=>{if(o)try{await new Promise(T=>setTimeout(T,500)),d(T=>T?{...T,status:"processing",started_time:new Date().toISOString(),progress:10}:null)}catch(T){console.error("Error starting import:",T),S("Failed to start import. Please try again.")}},C=async()=>{if(o)try{await new Promise(T=>setTimeout(T,500)),d(T=>T?{...T,status:"canceled",completed_time:new Date().toISOString()}:null)}catch(T){console.error("Error canceling import:",T),S("Failed to cancel import. Please try again.")}},U=async()=>{if(!(!o||!window.confirm("Are you sure you want to delete this import?")))try{await new Promise(T=>setTimeout(T,500)),r("/data/import")}catch(T){console.error("Error deleting import:",T),S("Failed to delete import. Please try again.")}};return y?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{className:"mb-4",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/data",icon:nr,children:"Data"}),t.jsx(Le,{children:l?"New Import":(o==null?void 0:o.name)||"Import Details"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(nr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l?"Create Data Import":"Data Import Details"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:l?"Configure and upload a new data import":"Manage your data import"})]}),w&&t.jsx(Xe,{color:"failure",className:"mb-4",children:w}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsx("div",{className:"lg:col-span-2",children:t.jsx(qe,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space",children:"Space"}),t.jsxs(rt,{id:"space",value:A.space_id,onChange:T=>G("space_id",T.target.value),disabled:n!=="new"&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"",children:"Select a space"}),f.map(T=>t.jsx("option",{value:T.space,children:T.space_name},T.space))]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph",children:"Graph"}),t.jsxs(rt,{id:"graph",value:A.graph_id,onChange:T=>G("graph_id",parseInt(T.target.value)),disabled:!A.space_id||n!=="new"&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:0,children:"Select a graph"}),g.filter(T=>T.space_id===A.space_id).map(T=>t.jsx("option",{value:T.id,children:T.graph_name},T.id))]})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"name",children:"Import Name"}),t.jsx(Me,{id:"name",type:"text",value:A.name,onChange:T=>G("name",T.target.value),placeholder:"Enter import name",disabled:n!=="new"&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",value:A.description,onChange:T=>G("description",T.target.value),placeholder:"Enter import description",rows:3,disabled:n!=="new"&&(o==null?void 0:o.status)==="processing"})]}),!o&&t.jsxs("div",{children:[t.jsx(se,{htmlFor:"file",children:"Import File"}),t.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",onDrop:T=>{T.preventDefault();const R=T.dataTransfer.files;R.length>0&&k(R[0])},onDragOver:T=>T.preventDefault(),onDragEnter:T=>T.preventDefault(),onClick:()=>{var T;return(T=document.getElementById("file"))==null?void 0:T.click()},children:[t.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[t.jsx("svg",{className:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:t.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),E?t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:t.jsx("span",{className:"font-semibold",children:E.name})}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:q(E.size)}),t.jsx("p",{className:"mt-2 text-xs text-blue-500 dark:text-blue-400",children:"Click to change file or drag and drop to replace"})]}):t.jsxs("div",{className:"text-center",children:[t.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[t.jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Turtle (.ttl), RDF/XML (.rdf), OWL (.owl), N-Triples (.nt), N-Quads (.nq), JSON-LD (.jsonld)"})]})]}),t.jsx("input",{id:"file",type:"file",className:"hidden",onChange:Z,accept:".ttl,.rdf,.owl,.nt,.nq,.jsonld"})]})]}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsxs(X,{color:"gray",onClick:()=>r("/data/import"),children:[t.jsx(Ki,{className:"w-4 h-4 mr-2"}),"Back to Data Imports"]}),o?t.jsxs(t.Fragment,{children:[(o==null?void 0:o.status)==="pending"&&t.jsxs(X,{color:"green",onClick:H,children:[t.jsx(hr,{className:"w-4 h-4 mr-2"}),"Start Import"]}),(o==null?void 0:o.status)==="processing"&&t.jsxs(X,{color:"red",onClick:C,children:[t.jsx(_n,{className:"w-4 h-4 mr-2"}),"Cancel Import"]}),t.jsxs(X,{color:"red",onClick:U,disabled:(o==null?void 0:o.status)==="processing",children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Delete"]})]}):t.jsxs(X,{color:"blue",onClick:z,disabled:j,children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(Mi,{className:"w-4 h-4 mr-2"}),j?"Creating...":"Create Import"]})]})]})})}),o&&t.jsx("div",{className:"lg:col-span-1",children:t.jsxs(qe,{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Import Status"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{children:"Space"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:$(o.space_id)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Graph"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:le(o.graph_id)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Status"}),t.jsx(jt,{color:ae(o.status),className:"mt-1",children:o.status})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Progress"}),t.jsx(yr,{progress:o.progress,color:o.status==="failed"?"red":"blue",className:"mt-1"}),t.jsxs("div",{className:"text-sm text-gray-500 mt-1",children:[o.progress,"% complete"]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"File"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:o.file_name}),t.jsx("div",{className:"text-sm text-gray-500",children:q(o.file_size)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Created"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:K(o.created_time)})]}),o.started_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Started"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:K(o.started_time)})]}),o.completed_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Completed"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:K(o.completed_time)})]}),o.error_message&&t.jsxs("div",{children:[t.jsx(se,{children:"Error"}),t.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:o.error_message})]})]})]})})]})]})},Ry=()=>{const r=St(),{exportId:n}=da(),[i]=hl(),l=n==="new",[o,d]=x.useState(null),[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!0),[j,N]=x.useState(!1),[w,S]=x.useState(null),[E,k]=x.useState(!1),[A,O]=x.useState(!1),[L,B]=x.useState({name:"",description:"",space_id:"",graph_id:0,export_format:"turtle"}),V=i.get("spaceId"),$=i.get("graphId"),le=x.useCallback(async()=>{try{if(b(!0),await new Promise(v=>setTimeout(v,300)),h(Nr),p(Kr),!l&&n){const v=h1.find(M=>M.id===parseInt(n));v?(d(v),B({name:v.name,description:v.description,space_id:v.space_id,graph_id:v.graph_id,export_format:v.export_format})):S("Export not found")}else{const v=$?parseInt($,10):0;console.log("URL parameters:",{urlSpaceId:V,urlGraphId:$,graphIdNum:v}),B({name:"",description:"",space_id:V||"",graph_id:v,export_format:"turtle"})}S(null)}catch(v){console.error("Error fetching data:",v),S("Failed to load data. Please try again later.")}finally{b(!1)}},[n,l,V,$]);x.useEffect(()=>{le()},[le]);const q=v=>{const M=f.find(I=>I.space===v);return M?M.space_name:v},K=v=>{const M=g.find(I=>I.id===v);return M?M.graph_name:`Graph ${v}`},ae=v=>{if(v===0)return"0 Bytes";const M=1024,I=["Bytes","KB","MB","GB"],ee=Math.floor(Math.log(v)/Math.log(M));return parseFloat((v/Math.pow(M,ee)).toFixed(2))+" "+I[ee]},G=v=>new Date(v).toLocaleString(),Z=v=>{switch(v){case"completed":return"success";case"processing":return"info";case"pending":return"warning";case"failed":return"failure";case"canceled":return"gray";case"expired":return"gray";default:return"gray"}},z=(v,M)=>{B(I=>({...I,[v]:M}))},H=async()=>{if(!L.name.trim()){S("Name is required");return}if(!L.space_id){S("Space is required");return}if(!L.graph_id){S("Graph is required");return}try{N(!0),await new Promise(v=>setTimeout(v,1e3)),l?console.log("Creating new export:",L):console.log("Updating export:",o==null?void 0:o.id,L),r("/data/export")}catch(v){console.error("Error saving export:",v),S("Failed to save export. Please try again.")}finally{N(!1)}},C=async()=>{if(o)try{await new Promise(v=>setTimeout(v,500)),d(v=>v?{...v,status:"processing",started_time:new Date().toISOString(),progress:10}:null)}catch(v){console.error("Error starting export:",v),S("Failed to start export. Please try again.")}},U=async()=>{if(o)try{await new Promise(v=>setTimeout(v,500)),d(v=>v?{...v,status:"canceled",completed_time:new Date().toISOString()}:null)}catch(v){console.error("Error canceling export:",v),S("Failed to cancel export. Please try again.")}},T=()=>{if(o!=null&&o.download_url){const v=document.createElement("a");v.href=o.download_url,v.download=`${o.name.replace(/\s+/g,"_")}.${o.export_format}`,document.body.appendChild(v),v.click(),document.body.removeChild(v)}},R=async()=>{if(o)try{O(!0),await new Promise(v=>setTimeout(v,500)),r("/data/export")}catch(v){console.error("Error deleting export:",v),S("Failed to delete export. Please try again.")}finally{O(!1),k(!1)}};return y?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{className:"mb-4",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/data",icon:nr,children:"Data"}),t.jsx(Le,{children:l?"New Export":(o==null?void 0:o.name)||"Export Details"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(nr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l?"Create Data Export":"Data Export Details"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:l?"Configure a new data export":"Manage your data export"})]}),w&&t.jsx(Xe,{color:"failure",className:"mb-4",children:w}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsx("div",{className:"lg:col-span-2",children:t.jsx(qe,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"name",children:"Name"}),t.jsx("input",{type:"text",id:"name",className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter export name",value:L.name,onChange:v=>z("name",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx("textarea",{id:"description",rows:3,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter export description",value:L.description,onChange:v=>z("description",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space",children:"Space"}),t.jsxs(rt,{id:"space",value:L.space_id,onChange:v=>z("space_id",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"",children:"Select a space"}),f.map(v=>t.jsx("option",{value:v.space,children:v.space_name},v.space))]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph",children:"Graph"}),t.jsxs(rt,{id:"graph",value:L.graph_id,onChange:v=>z("graph_id",parseInt(v.target.value)),disabled:!L.space_id||!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:0,children:"Select a graph"}),g.filter(v=>v.space_id===L.space_id).map(v=>t.jsx("option",{value:v.id,children:v.graph_name},v.id))]})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"format",children:"Export Format"}),t.jsxs(rt,{id:"format",value:L.export_format,onChange:v=>z("export_format",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"turtle",children:"Turtle (.ttl)"}),t.jsx("option",{value:"rdf/xml",children:"RDF/XML (.rdf)"}),t.jsx("option",{value:"n-triples",children:"N-Triples (.nt)"}),t.jsx("option",{value:"json-ld",children:"JSON-LD (.jsonld)"}),t.jsx("option",{value:"n-quads",children:"N-Quads (.nq)"})]})]}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsxs(X,{color:"gray",onClick:()=>r("/data/export"),children:[t.jsx(Ki,{className:"w-4 h-4 mr-2"}),"Back to Data Exports"]}),l?t.jsxs(X,{color:"blue",onClick:H,disabled:j,children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(pr,{className:"w-4 h-4 mr-2"}),j?"Creating...":"Create Export"]}):t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"blue",onClick:H,disabled:j||(o==null?void 0:o.status)==="processing",children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(pr,{className:"w-4 h-4 mr-2"}),j?"Saving...":"Save Changes"]}),(o==null?void 0:o.status)==="pending"&&t.jsxs(X,{color:"green",onClick:C,children:[t.jsx(hr,{className:"w-4 h-4 mr-2"}),"Start Export"]}),(o==null?void 0:o.status)==="processing"&&t.jsxs(X,{color:"red",onClick:U,children:[t.jsx(_n,{className:"w-4 h-4 mr-2"}),"Cancel Export"]}),(o==null?void 0:o.status)==="completed"&&o.download_url&&t.jsxs(X,{color:"green",onClick:T,children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"Download"]}),(o==null?void 0:o.status)!=="processing"&&t.jsxs(X,{color:"red",onClick:()=>k(!0),children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})})}),!l&&o&&t.jsx("div",{className:"lg:col-span-1",children:t.jsxs(qe,{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Export Status"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{children:"Space"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:q(o.space_id)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Graph"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:K(o.graph_id)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Status"}),t.jsx(jt,{color:Z(o.status),className:"mt-1",children:o.status})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Progress"}),t.jsx(yr,{progress:o.progress,color:o.status==="failed"?"red":"blue",className:"mt-1"}),t.jsxs("div",{className:"text-sm text-gray-500 mt-1",children:[o.progress,"% complete"]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Format"}),t.jsx(jt,{color:"gray",className:"mt-1",children:o.export_format})]}),o.file_size&&t.jsxs("div",{children:[t.jsx(se,{children:"File Size"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ae(o.file_size)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Created"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:G(o.created_time)})]}),o.started_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Started"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:G(o.started_time)})]}),o.completed_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Completed"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:G(o.completed_time)})]}),o.expires_at&&t.jsxs("div",{children:[t.jsx(se,{children:"Expires"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:G(o.expires_at)})]}),o.error_message&&t.jsxs("div",{children:[t.jsx(se,{children:"Error"}),t.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:o.error_message})]})]})]})})]}),t.jsxs(Lt,{show:E,onClose:()=>k(!1),size:"md",children:[t.jsxs(jr,{children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-600"}),"Confirm Deletion"]}),t.jsxs(br,{children:[t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to delete this export? This action cannot be undone."}),o&&t.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:o.name}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Status: ",o.status]})]})]}),t.jsxs(vr,{children:[t.jsx(X,{color:"red",onClick:R,disabled:A,children:A?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete Export"]})}),t.jsx(X,{color:"gray",onClick:()=>k(!1),disabled:A,children:"Cancel"})]})]})]})},Ay=()=>{const r=St(),{migrationId:n}=da(),[i]=hl(),l=n==="new",[o,d]=x.useState(null),[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!0),[j,N]=x.useState(!1),[w,S]=x.useState(null),[E,k]=x.useState(!1),[A,O]=x.useState(!1),[L,B]=x.useState({name:"",description:"",source_space_id:"",source_graph_id:0,target_space_id:"",target_graph_id:0,migration_type:"copy"}),V=i.get("sourceSpaceId"),$=i.get("sourceGraphId"),le=i.get("targetSpaceId"),q=i.get("targetGraphId"),K=x.useCallback(async()=>{try{if(b(!0),await new Promise(v=>setTimeout(v,300)),h(Nr),p(Kr),!l&&n){const v=p1.find(M=>M.id===parseInt(n));v?(d(v),B({name:v.name,description:v.description,source_space_id:v.source_space_id,source_graph_id:v.source_graph_id,target_space_id:v.target_space_id,target_graph_id:v.target_graph_id,migration_type:v.migration_type})):S("Migration not found")}else{const v=$?parseInt($,10):0,M=q?parseInt(q,10):0;B({name:"",description:"",source_space_id:V||"",source_graph_id:v,target_space_id:le||"",target_graph_id:M,migration_type:"copy"})}S(null)}catch(v){console.error("Error fetching data:",v),S("Failed to load data. Please try again later.")}finally{b(!1)}},[n,l,V,$,le,q]);x.useEffect(()=>{K()},[K]);const ae=v=>{const M=f.find(I=>I.space===v);return M?M.space_name:v},G=v=>{const M=g.find(I=>I.id===v);return M?M.graph_name:`Graph ${v}`},Z=v=>new Date(v).toLocaleString(),z=v=>{switch(v){case"completed":return"success";case"processing":return"info";case"pending":return"warning";case"failed":return"failure";case"canceled":return"gray";default:return"gray"}},H=(v,M)=>{B(I=>({...I,[v]:M}))},C=async()=>{if(!L.name.trim()){S("Name is required");return}if(!L.source_space_id){S("Source space is required");return}if(!L.source_graph_id){S("Source graph is required");return}if(!L.target_space_id){S("Target space is required");return}if(!L.target_graph_id){S("Target graph is required");return}if(L.source_space_id===L.target_space_id&&L.source_graph_id===L.target_graph_id){S("Source and target cannot be the same");return}try{N(!0),await new Promise(v=>setTimeout(v,1e3)),l?console.log("Creating new migration:",L):console.log("Updating migration:",o==null?void 0:o.id,L),r("/data/migrate")}catch(v){console.error("Error saving migration:",v),S("Failed to save migration. Please try again.")}finally{N(!1)}},U=async()=>{if(o)try{await new Promise(v=>setTimeout(v,500)),d(v=>v?{...v,status:"processing",started_time:new Date().toISOString(),progress:10}:null)}catch(v){console.error("Error starting migration:",v),S("Failed to start migration. Please try again.")}},T=async()=>{if(o)try{await new Promise(v=>setTimeout(v,500)),d(v=>v?{...v,status:"canceled",completed_time:new Date().toISOString()}:null)}catch(v){console.error("Error canceling migration:",v),S("Failed to cancel migration. Please try again.")}},R=async()=>{if(o)try{O(!0),await new Promise(v=>setTimeout(v,500)),r("/data/migrate")}catch(v){console.error("Error deleting migration:",v),S("Failed to delete migration. Please try again.")}finally{O(!1),k(!1)}};return y?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{className:"mb-4",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/data",icon:nr,children:"Data"}),t.jsx(Le,{href:"/data/migrate",children:"Migrate"}),t.jsx(Le,{children:l?"New Migration":(o==null?void 0:o.name)||"Migration Details"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(kc,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l?"Create Data Migration":"Data Migration Details"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:l?"Configure a new data migration between spaces and graphs":"Manage your data migration"})]}),w&&t.jsx(Xe,{color:"failure",className:"mb-4",children:w}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsx("div",{className:"lg:col-span-2",children:t.jsx(qe,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"name",children:"Migration Name"}),t.jsx(Me,{id:"name",value:L.name,onChange:v=>H("name",v.target.value),placeholder:"Enter migration name",disabled:!l&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"migration_type",children:"Migration Type"}),t.jsxs(rt,{id:"migration_type",value:L.migration_type,onChange:v=>H("migration_type",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"copy",children:"Copy (duplicate data)"}),t.jsx("option",{value:"move",children:"Move (transfer data)"}),t.jsx("option",{value:"sync",children:"Sync (synchronize data)"})]})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",value:L.description,onChange:v=>H("description",v.target.value),placeholder:"Optional description of the migration",rows:3,disabled:!l&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{className:"border-t pt-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Source"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"source_space",children:"Source Space"}),t.jsxs(rt,{id:"source_space",value:L.source_space_id,onChange:v=>H("source_space_id",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"",children:"Select source space"}),f.map(v=>t.jsx("option",{value:v.space,children:v.space_name},v.space))]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"source_graph",children:"Source Graph"}),t.jsxs(rt,{id:"source_graph",value:L.source_graph_id,onChange:v=>H("source_graph_id",parseInt(v.target.value)),disabled:!L.source_space_id||!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:0,children:"Select source graph"}),g.filter(v=>v.space_id===L.source_space_id).map(v=>t.jsx("option",{value:v.id,children:v.graph_name},v.id))]})]})]})]}),t.jsxs("div",{className:"border-t pt-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:"Target"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"target_space",children:"Target Space"}),t.jsxs(rt,{id:"target_space",value:L.target_space_id,onChange:v=>H("target_space_id",v.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"",children:"Select target space"}),f.map(v=>t.jsx("option",{value:v.space,children:v.space_name},v.space))]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"target_graph",children:"Target Graph"}),t.jsxs(rt,{id:"target_graph",value:L.target_graph_id,onChange:v=>H("target_graph_id",parseInt(v.target.value)),disabled:!L.target_space_id||!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:0,children:"Select target graph"}),g.filter(v=>v.space_id===L.target_space_id).map(v=>t.jsx("option",{value:v.id,children:v.graph_name},v.id))]})]})]})]}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsxs(X,{color:"gray",onClick:()=>r("/data/migrate"),children:[t.jsx(Ki,{className:"w-4 h-4 mr-2"}),"Back to Migrations"]}),l?t.jsxs(X,{color:"blue",onClick:C,disabled:j,children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(kc,{className:"w-4 h-4 mr-2"}),j?"Creating...":"Create Migration"]}):t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"blue",onClick:C,disabled:j||(o==null?void 0:o.status)==="processing",children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(kc,{className:"w-4 h-4 mr-2"}),j?"Saving...":"Save Changes"]}),(o==null?void 0:o.status)==="pending"&&t.jsxs(X,{color:"green",onClick:U,children:[t.jsx(hr,{className:"w-4 h-4 mr-2"}),"Start Migration"]}),(o==null?void 0:o.status)==="processing"&&t.jsxs(X,{color:"red",onClick:T,children:[t.jsx(_n,{className:"w-4 h-4 mr-2"}),"Cancel Migration"]}),o&&["completed","failed","canceled"].includes(o.status)&&t.jsxs(X,{color:"red",onClick:()=>k(!0),children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})})}),!l&&o&&t.jsx("div",{className:"lg:col-span-1",children:t.jsxs(qe,{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Migration Status"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{children:"Source"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[t.jsx("div",{className:"font-medium",children:ae(o.source_space_id)}),t.jsx("div",{className:"text-gray-500",children:G(o.source_graph_id)})]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Target"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[t.jsx("div",{className:"font-medium",children:ae(o.target_space_id)}),t.jsx("div",{className:"text-gray-500",children:G(o.target_graph_id)})]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Type"}),t.jsx(jt,{color:"gray",className:"mt-1",children:o.migration_type})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Status"}),t.jsx(jt,{color:z(o.status),className:"mt-1",children:o.status})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Progress"}),t.jsx(yr,{progress:o.progress,color:o.status==="failed"?"red":"blue",className:"mt-1"}),t.jsxs("div",{className:"text-sm text-gray-500 mt-1",children:[o.progress,"% complete"]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Triples"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[o.triples_migrated?o.triples_migrated.toLocaleString():"0"," / ",o.total_triples?o.total_triples.toLocaleString():"0"]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Created"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:Z(o.created_time)})]}),o.started_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Started"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:Z(o.started_time)})]}),o.completed_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Completed"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:Z(o.completed_time)})]}),o.error_message&&t.jsxs("div",{children:[t.jsx(se,{children:"Error"}),t.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:o.error_message})]})]})]})})]}),t.jsxs(Lt,{show:E,onClose:()=>k(!1),size:"md",children:[t.jsxs(jr,{children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-600"}),"Confirm Deletion"]}),t.jsxs(br,{children:[t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to delete this migration? This action cannot be undone."}),o&&t.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:o.name}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Status: ",o.status]})]})]}),t.jsxs(vr,{children:[t.jsx(X,{color:"red",onClick:R,disabled:A,children:A?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete Migration"]})}),t.jsx(X,{color:"gray",onClick:()=>k(!1),disabled:A,children:"Cancel"})]})]})]})},Dy=()=>{const r=St(),{trackingId:n}=da(),[i]=hl(),l=n==="new",[o,d]=x.useState(null),[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!0),[j,N]=x.useState(!1),[w,S]=x.useState(null),[E,k]=x.useState(!1),[A,O]=x.useState(!1),[L,B]=x.useState({name:"",description:"",space_id:"",graph_id:0,external_system:"",parallel_slices:4}),V=i.get("spaceId"),$=i.get("graphId"),le=x.useCallback(async()=>{try{if(b(!0),await new Promise(R=>setTimeout(R,300)),h(Nr),p(Kr),!l&&n){const R=m1.find(v=>v.id===parseInt(n));R?(d(R),B({name:R.name,description:R.description,space_id:R.space_id,graph_id:R.graph_id,external_system:R.external_system||"",parallel_slices:R.parallel_slices})):S("Tracking not found")}else{const R=$?parseInt($,10):0;B({name:"",description:"",space_id:V||"",graph_id:R,external_system:"",parallel_slices:4})}S(null)}catch(R){console.error("Error fetching data:",R),S("Failed to load data. Please try again later.")}finally{b(!1)}},[n,l,V,$]);x.useEffect(()=>{le()},[le]);const q=R=>{const v=f.find(M=>M.space===R);return v?v.space_name:R},K=R=>{const v=g.find(M=>M.id===R);return v?v.graph_name:`Graph ${R}`},ae=R=>new Date(R).toLocaleString(),G=R=>{switch(R){case"completed":return"success";case"processing":return"info";case"pending":return"warning";case"failed":return"failure";case"paused":return"gray";default:return"gray"}},Z=R=>{switch(R){case"completed":return"success";case"processing":return"info";case"pending":return"warning";case"failed":return"failure";default:return"gray"}},z=(R,v)=>{B(M=>({...M,[R]:v}))},H=async()=>{if(!L.name.trim()){S("Name is required");return}if(!L.space_id){S("Space is required");return}if(!L.graph_id){S("Graph is required");return}if(L.parallel_slices<1||L.parallel_slices>1e3){S("Parallel slices must be between 1 and 1000");return}try{N(!0),await new Promise(R=>setTimeout(R,1e3)),l?console.log("Creating new tracking:",L):console.log("Updating tracking:",o==null?void 0:o.id,L),r("/data/tracking")}catch(R){console.error("Error saving tracking:",R),S("Failed to save tracking. Please try again.")}finally{N(!1)}},C=async()=>{if(o)try{await new Promise(R=>setTimeout(R,500)),d(R=>R?{...R,status:"processing",started_time:new Date().toISOString(),overall_progress:5,last_updated:new Date().toISOString()}:null)}catch(R){console.error("Error starting tracking:",R),S("Failed to start tracking. Please try again.")}},U=async()=>{if(o)try{await new Promise(R=>setTimeout(R,500)),d(R=>R?{...R,status:"paused",last_updated:new Date().toISOString()}:null)}catch(R){console.error("Error pausing tracking:",R),S("Failed to pause tracking. Please try again.")}},T=async()=>{if(o)try{O(!0),await new Promise(R=>setTimeout(R,500)),r("/data/track")}catch(R){console.error("Error deleting tracking:",R),S("Failed to delete tracking. Please try again.")}finally{O(!1),k(!1)}};return y?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{className:"mb-4",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/data",icon:nr,children:"Data"}),t.jsx(Le,{href:"/data/tracking",children:"Tracking"}),t.jsx(Le,{children:l?"New Tracking":(o==null?void 0:o.name)||"Tracking Details"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(Di,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l?"Create Data Tracking":"Data Tracking Details"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:l?"Configure a new data tracking operation with parallel processing ranges":"Manage your data tracking operation"})]}),w&&t.jsx(Xe,{color:"failure",className:"mb-4",children:w}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"lg:col-span-2",children:[t.jsx(qe,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t.jsxs("div",{children:[t.jsx(se,{htmlFor:"name",children:"Tracking Name"}),t.jsx(Me,{id:"name",value:L.name,onChange:R=>z("name",R.target.value),placeholder:"Enter tracking name",disabled:!l&&(o==null?void 0:o.status)==="processing"})]})}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",value:L.description,onChange:R=>z("description",R.target.value),placeholder:"Optional description of the tracking operation",rows:3,disabled:!l&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space",children:"Space"}),t.jsxs(rt,{id:"space",value:L.space_id,onChange:R=>z("space_id",R.target.value),disabled:!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:"",children:"Select a space"}),f.map(R=>t.jsx("option",{value:R.space,children:R.space_name},R.space))]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph",children:"Graph"}),t.jsxs(rt,{id:"graph",value:L.graph_id,onChange:R=>z("graph_id",parseInt(R.target.value)),disabled:!L.space_id||!l&&(o==null?void 0:o.status)==="processing",children:[t.jsx("option",{value:0,children:"Select a graph"}),g.filter(R=>R.space_id===L.space_id).map(R=>t.jsx("option",{value:R.id,children:R.graph_name},R.id))]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"external_system",children:"External System"}),t.jsx(Me,{id:"external_system",value:L.external_system,onChange:R=>z("external_system",R.target.value),placeholder:"e.g., Salesforce, AWS S3, ML Pipeline",disabled:!l&&(o==null?void 0:o.status)==="processing"})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"parallel_slices",children:"Parallel Slices"}),t.jsx(Me,{id:"parallel_slices",type:"number",min:"1",max:"1000",value:L.parallel_slices,onChange:R=>z("parallel_slices",parseInt(R.target.value)||1),placeholder:"Enter number of parallel slices",disabled:!l&&(o==null?void 0:o.status)==="processing"}),t.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"Number of parallel processing ranges (1-1000)"})]})]}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsxs(X,{color:"gray",onClick:()=>r("/data/tracking"),children:[t.jsx(Ki,{className:"w-4 h-4 mr-2"}),"Back to Tracking"]}),l?t.jsxs(X,{color:"blue",onClick:H,disabled:j,children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(Di,{className:"w-4 h-4 mr-2"}),j?"Creating...":"Create Tracking"]}):t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"blue",onClick:H,disabled:j||(o==null?void 0:o.status)==="processing",children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(Di,{className:"w-4 h-4 mr-2"}),j?"Saving...":"Save Changes"]}),(o==null?void 0:o.status)==="pending"&&t.jsxs(X,{color:"green",onClick:C,children:[t.jsx(hr,{className:"w-4 h-4 mr-2"}),"Start Tracking"]}),(o==null?void 0:o.status)==="processing"&&t.jsxs(X,{color:"yellow",onClick:U,children:[t.jsx(_n,{className:"w-4 h-4 mr-2"}),"Pause Tracking"]}),o&&o.status!=="processing"&&t.jsxs(X,{color:"red",onClick:()=>k(!0),children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})}),!l&&o&&o.ranges.length>0&&t.jsxs(qe,{className:"mt-6",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Processing Ranges"}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(Yt,{children:[t.jsx(Qt,{children:t.jsxs(at,{children:[t.jsx(he,{children:"Range"}),t.jsx(he,{children:"Hash Range"}),t.jsx(he,{children:"Status"}),t.jsx(he,{children:"Progress"}),t.jsx(he,{children:"Records"}),t.jsx(he,{children:"Current Cursor"}),t.jsx(he,{children:"Duration"})]})}),t.jsx(Xt,{children:o.ranges.map(R=>t.jsxs(at,{children:[t.jsxs(fe,{className:"font-medium",children:["Range ",R.range_id]}),t.jsx(fe,{children:t.jsxs("div",{className:"text-sm font-mono",children:[R.hash_prefix_start,"..",R.hash_prefix_end]})}),t.jsx(fe,{children:t.jsx(jt,{color:Z(R.status),children:R.status})}),t.jsx(fe,{children:t.jsxs("div",{className:"w-20",children:[t.jsx(yr,{progress:R.records_processed/R.total_records*100,color:R.status==="failed"?"red":"blue",size:"sm"}),t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[Math.round(R.records_processed/R.total_records*100),"%"]})]})}),t.jsxs(fe,{className:"text-sm",children:[R.records_processed.toLocaleString()," / ",R.total_records.toLocaleString()]}),t.jsx(fe,{children:t.jsx("div",{className:"text-sm font-mono",children:R.current_cursor})}),t.jsx(fe,{className:"text-sm",children:R.started_time&&t.jsxs("div",{children:[t.jsxs("div",{children:["Started: ",ae(R.started_time)]}),R.completed_time&&t.jsxs("div",{children:["Completed: ",ae(R.completed_time)]})]})})]},R.range_id))})]})})]})]}),!l&&o&&t.jsx("div",{className:"lg:col-span-1",children:t.jsxs(qe,{children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Tracking Status"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(se,{children:"Space/Graph"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[t.jsx("div",{className:"font-medium",children:q(o.space_id)}),t.jsx("div",{className:"text-gray-500",children:K(o.graph_id)})]})]}),o.external_system&&t.jsxs("div",{children:[t.jsx(se,{children:"External System"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:o.external_system})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Status"}),t.jsx(jt,{color:G(o.status),className:"mt-1",children:o.status})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Overall Progress"}),t.jsx(yr,{progress:o.overall_progress,color:o.status==="failed"?"red":"blue",className:"mt-1"}),t.jsxs("div",{className:"text-sm text-gray-500 mt-1",children:[o.overall_progress,"% complete"]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Parallel Slices"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[o.parallel_slices," slices"]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Records"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[o.records_processed.toLocaleString()," / ",o.total_records.toLocaleString()]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Created"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ae(o.created_time)})]}),o.started_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Started"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ae(o.started_time)})]}),o.completed_time&&t.jsxs("div",{children:[t.jsx(se,{children:"Completed"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ae(o.completed_time)})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Last Updated"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:ae(o.last_updated)})]}),o.error_message&&t.jsxs("div",{children:[t.jsx(se,{children:"Error"}),t.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:o.error_message})]})]})]})})]}),t.jsxs(Lt,{show:E,onClose:()=>k(!1),size:"md",children:[t.jsxs(jr,{children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-600"}),"Confirm Deletion"]}),t.jsxs(br,{children:[t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to delete this tracking? This action cannot be undone."}),o&&t.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:o.name}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Status: ",o.status]})]})]}),t.jsxs(vr,{children:[t.jsx(X,{color:"red",onClick:T,disabled:A,children:A?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete Tracking"]})}),t.jsx(X,{color:"gray",onClick:()=>k(!1),disabled:A,children:"Cancel"})]})]})]})},My=()=>{const r=St(),{checkpointId:n}=da(),[i]=hl(),l=n==="new",[o,d]=x.useState(null),[f,h]=x.useState([]),[g,p]=x.useState([]),[y,b]=x.useState(!0),[j,N]=x.useState(!1),[w,S]=x.useState(null),[E,k]=x.useState(!1),[A,O]=x.useState(!1),[L,B]=x.useState({name:"",description:"",space_id:"",graph_id:0,external_system:""}),V=i.get("spaceId"),$=i.get("graphId"),le=x.useCallback(async()=>{try{if(b(!0),await new Promise(C=>setTimeout(C,500)),h(Nr),p(Kr),!l&&n){const C=g1.find(U=>U.id===parseInt(n));C?(d(C),B({name:C.name,description:C.description,space_id:C.space_id,graph_id:C.graph_id,external_system:C.external_system||""})):S("Checkpoint not found")}else{const C=$?parseInt($,10):0;B({name:"",description:"",space_id:V||"",graph_id:C,external_system:""})}S(null)}catch(C){console.error("Error fetching data:",C),S("Failed to load data. Please try again later.")}finally{b(!1)}},[n,l,V,$]);x.useEffect(()=>{le()},[le]);const q=C=>{const U=f.find(T=>T.space===C);return U?U.space_name:C},K=C=>{const U=g.find(T=>T.id===C);return U?U.graph_name:`Graph ${C}`},ae=()=>L.space_id?g.filter(C=>C.space_id===L.space_id):[],G=(C,U)=>{B(T=>({...T,[C]:U}))},Z=C=>{B(U=>({...U,space_id:C,graph_id:0}))},z=async()=>{try{if(N(!0),!L.name.trim()){S("Checkpoint name is required");return}if(!L.space_id){S("Space selection is required");return}if(!L.graph_id){S("Graph selection is required");return}await new Promise(C=>setTimeout(C,1e3)),r("/data/checkpoint")}catch(C){console.error("Error saving checkpoint:",C),S("Failed to save checkpoint. Please try again.")}finally{N(!1)}},H=async()=>{if(o)try{O(!0),await new Promise(C=>setTimeout(C,500)),r("/data/checkpoint")}catch(C){console.error("Error deleting checkpoint:",C),S("Failed to delete checkpoint. Please try again.")}finally{O(!1),k(!1)}};return y?t.jsx("div",{className:"flex justify-center items-center h-40",children:t.jsx(He,{size:"xl"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs(La,{className:"mb-4",children:[t.jsx(Le,{href:"/",icon:Ua,children:"Home"}),t.jsx(Le,{href:"/data",icon:nr,children:"Data"}),t.jsx(Le,{children:l?"New Checkpoint":(o==null?void 0:o.name)||"Checkpoint Details"})]}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(nr,{className:"w-6 h-6 text-blue-600"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l?"Create Data Checkpoint":"Data Checkpoint Details"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:l?"Configure a new data checkpoint":"Manage your data checkpoint"})]}),w&&t.jsx(Xe,{color:"failure",className:"mb-4",children:w}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsx("div",{className:"lg:col-span-2",children:t.jsxs(qe,{children:[t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{children:t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Checkpoint Information"})}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"name",children:"Checkpoint Name"}),t.jsx(Me,{id:"name",value:L.name,onChange:C=>G("name",C.target.value),placeholder:"Enter checkpoint name",disabled:!l&&(o==null?void 0:o.checkpoint_timestamp)!==void 0})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"description",children:"Description"}),t.jsx(_a,{id:"description",value:L.description,onChange:C=>G("description",C.target.value),placeholder:"Optional description of the checkpoint",rows:3,disabled:!l&&(o==null?void 0:o.checkpoint_timestamp)!==void 0})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(se,{htmlFor:"space_id",children:"Space"}),t.jsxs(rt,{id:"space_id",value:L.space_id,onChange:C=>Z(C.target.value),disabled:!l&&(o==null?void 0:o.checkpoint_timestamp)!==void 0,children:[t.jsx("option",{value:"",children:"Select a space"}),f.map(C=>t.jsx("option",{value:C.space,children:C.space_name},C.space))]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"graph_id",children:"Graph"}),t.jsxs(rt,{id:"graph_id",value:L.graph_id,onChange:C=>G("graph_id",parseInt(C.target.value)),disabled:!L.space_id||!l&&(o==null?void 0:o.checkpoint_timestamp)!==void 0,children:[t.jsx("option",{value:0,children:"Select a graph"}),ae().map(C=>t.jsx("option",{value:C.id,children:C.graph_name},C.id))]})]})]}),t.jsxs("div",{children:[t.jsx(se,{htmlFor:"external_system",children:"External System (Optional)"}),t.jsx(Me,{id:"external_system",value:L.external_system,onChange:C=>G("external_system",C.target.value),placeholder:"e.g., Backup Service, CRM System",disabled:!l&&(o==null?void 0:o.checkpoint_timestamp)!==void 0})]})]}),t.jsxs("div",{className:"flex flex-wrap gap-2 pt-4",children:[t.jsxs(X,{color:"gray",onClick:()=>r("/data/checkpoint"),children:[t.jsx(Ki,{className:"w-4 h-4 mr-2"}),"Back to Data Checkpoints"]}),o?t.jsxs(t.Fragment,{children:[t.jsxs(X,{color:"blue",onClick:z,disabled:j||(o==null?void 0:o.checkpoint_timestamp)!==void 0,children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(Rn,{className:"w-4 h-4 mr-2"}),j?"Saving...":"Save Changes"]}),t.jsxs(X,{color:"red",onClick:()=>k(!0),children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Delete"]})]}):t.jsxs(X,{color:"blue",onClick:z,disabled:j,children:[j?t.jsx(He,{size:"sm",className:"mr-2"}):t.jsx(Rn,{className:"w-4 h-4 mr-2"}),j?"Creating...":"Create Checkpoint"]})]})]})}),t.jsx("div",{className:"lg:col-span-1",children:t.jsxs(qe,{children:[t.jsx("div",{children:t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Checkpoint Status"})}),t.jsx("div",{className:"space-y-4",children:!l&&o?t.jsxs(t.Fragment,{children:[t.jsxs("div",{children:[t.jsx(se,{children:"Space/Graph"}),t.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[t.jsx("div",{className:"font-medium",children:q(o.space_id)}),t.jsx("div",{className:"text-gray-500",children:K(o.graph_id)})]})]}),o.external_system&&t.jsxs("div",{children:[t.jsx(se,{children:"External System"}),t.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:o.external_system})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Status"}),t.jsx(jt,{color:o.checkpoint_timestamp?"green":"yellow",className:"mt-1",children:o.checkpoint_timestamp?"Completed":"Pending"})]}),o.checkpoint_timestamp&&t.jsxs("div",{children:[t.jsx(se,{children:"Checkpoint Timestamp"}),t.jsxs("div",{className:"flex items-center space-x-2 mt-1",children:[t.jsx(bh,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-sm text-gray-900 dark:text-white",children:new Date(o.checkpoint_timestamp).toLocaleString()})]})]}),o.checkpoint_hash&&t.jsxs("div",{children:[t.jsx(se,{children:"Checkpoint Hash"}),t.jsxs("div",{className:"flex items-center space-x-2 mt-1",children:[t.jsx(n3,{className:"w-4 h-4 text-gray-500"}),t.jsx("span",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 break-all",children:o.checkpoint_hash})]})]}),t.jsxs("div",{children:[t.jsx(se,{children:"Created"}),t.jsxs("div",{className:"text-sm text-gray-500",children:[new Date(o.created_time).toLocaleString(),o.created_by&&t.jsxs("div",{className:"text-xs",children:["by ",o.created_by]})]})]})]}):t.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:[t.jsx(bh,{className:"w-12 h-12 mx-auto mb-4 text-gray-300"}),t.jsx("p",{children:"Checkpoint will be created when you save"})]})})]})})]}),t.jsxs(Lt,{show:E,onClose:()=>k(!1),size:"md",children:[t.jsxs(jr,{children:[t.jsx(Mn,{className:"mr-2 h-6 w-6 text-red-600"}),"Confirm Deletion"]}),t.jsxs(br,{children:[t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Are you sure you want to delete this checkpoint? This action cannot be undone."}),o&&t.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:o.name}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Status: ",o.checkpoint_timestamp?"Completed":"Pending"]})]})]}),t.jsxs(vr,{children:[t.jsx(X,{color:"red",onClick:H,disabled:A,children:A?t.jsxs(t.Fragment,{children:[t.jsx(He,{size:"sm",className:"mr-2"}),"Deleting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),"Delete Checkpoint"]})}),t.jsx(X,{color:"gray",onClick:()=>k(!1),disabled:A,children:"Cancel"})]})]})]})};nT();function C3(){return t.jsx(oT,{children:t.jsxs(uT,{children:[t.jsx($C,{}),t.jsx(lN,{children:t.jsx(PC,{children:t.jsxs(z2,{children:[t.jsx(ze,{path:"/login",element:t.jsx(c3,{})}),t.jsx(ze,{element:t.jsx(ZC,{}),children:t.jsxs(ze,{element:t.jsx(o3,{}),children:[t.jsx(ze,{path:"/",element:t.jsx(d3,{})}),t.jsx(ze,{path:"/spaces",element:t.jsx(f3,{})}),t.jsx(ze,{path:"/users",element:t.jsx(p3,{})}),t.jsx(ze,{path:"/data",element:t.jsx(Js,{to:"/data/import",replace:!0})}),t.jsx(ze,{path:"/sparql",element:t.jsx(T3,{})}),t.jsx(ze,{path:"/graphs",element:t.jsx(vy,{})}),t.jsx(ze,{path:"/objects",element:t.jsx(Js,{to:"/objects/graphobjects",replace:!0})}),t.jsxs(ze,{path:"/objects/*",element:t.jsx(ky,{}),children:[t.jsx(ze,{path:"graphobjects",element:t.jsx(Sy,{})}),t.jsx(ze,{path:"kgentities",element:t.jsx(_y,{})}),t.jsx(ze,{path:"kgframes",element:t.jsx(Ty,{})})]}),t.jsx(ze,{path:"/files",element:t.jsx(xy,{})}),t.jsx(ze,{path:"/triples",element:t.jsx(Cy,{})}),t.jsx(ze,{path:"/kg-types",element:t.jsx(wy,{})}),t.jsx(ze,{path:"/space/:spaceId/graphs",element:t.jsx(vy,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/objects",element:t.jsx(Js,{to:"graphobjects",replace:!0})}),t.jsxs(ze,{path:"/space/:spaceId/graph/:graphId/objects/*",element:t.jsx(ky,{}),children:[t.jsx(ze,{path:"graphobjects",element:t.jsx(Sy,{})}),t.jsx(ze,{path:"kgentities",element:t.jsx(_y,{})}),t.jsx(ze,{path:"kgframes",element:t.jsx(Ty,{})})]}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/files",element:t.jsx(xy,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/triples",element:t.jsx(Cy,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/kg-types",element:t.jsx(wy,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/new",element:t.jsx(jy,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/file/new",element:t.jsx(b3,{})}),t.jsx(ze,{path:"/data/import",element:t.jsx(Ti,{})}),t.jsx(ze,{path:"/data/export",element:t.jsx(Ti,{})}),t.jsx(ze,{path:"/data/migrate",element:t.jsx(Ti,{})}),t.jsx(ze,{path:"/data/tracking",element:t.jsx(Ti,{})}),t.jsx(ze,{path:"/data/checkpoint",element:t.jsx(Ti,{})}),t.jsx(ze,{path:"/data/import/new",element:t.jsx(Ey,{})}),t.jsx(ze,{path:"/data/import/:importId",element:t.jsx(Ey,{})}),t.jsx(ze,{path:"/data/export/new",element:t.jsx(Ry,{})}),t.jsx(ze,{path:"/data/export/:exportId",element:t.jsx(Ry,{})}),t.jsx(ze,{path:"/data/migrate/new",element:t.jsx(Ay,{})}),t.jsx(ze,{path:"/data/migrate/:migrationId",element:t.jsx(Ay,{})}),t.jsx(ze,{path:"/data/tracking/new",element:t.jsx(Dy,{})}),t.jsx(ze,{path:"/data/tracking/:trackingId",element:t.jsx(Dy,{})}),t.jsx(ze,{path:"/data/checkpoint/new",element:t.jsx(My,{})}),t.jsx(ze,{path:"/data/checkpoint/:checkpointId",element:t.jsx(My,{})}),t.jsx(ze,{path:"/space/:id",element:t.jsx(h3,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId",element:t.jsx(jy,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/analysis",element:t.jsx(w3,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/object/:objectId",element:t.jsx(Kf,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/entity/:entityId",element:t.jsx(N3,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/frame/:frameId",element:t.jsx(k3,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/kg-types/new",element:t.jsx(Ny,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/kg-types/:kgTypeId",element:t.jsx(Ny,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/objects/new",element:t.jsx(Kf,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/objects/:objectId",element:t.jsx(Kf,{})}),t.jsx(ze,{path:"/space/:spaceId/graph/:graphId/file/:fileId",element:t.jsx(y3,{})}),t.jsx(ze,{path:"/user/:id",element:t.jsx(m3,{})})]})}),t.jsx(ze,{path:"*",element:t.jsx(Js,{to:"/"})})]})})})]})})}Ue.defaults.baseURL=window.location.origin;Ue.interceptors.request.use(r=>{const n=na.getAccessToken();return n&&(r.headers.Authorization=`Bearer ${n}`),r},r=>Promise.reject(r));Ue.interceptors.response.use(r=>r,async r=>{var i;const n=r.config;if(((i=r.response)==null?void 0:i.status)===401&&!n._retry){if(n._retry=!0,console.log("🔄 Received 401, attempting token refresh..."),await na.refreshAccessToken()){const o=na.getAccessToken();if(o)return n.headers.Authorization=`Bearer ${o}`,Ue(n)}console.log("🚪 Token refresh failed, redirecting to login"),window.location.href="/login"}return Promise.reject(r)});Pw.createRoot(document.getElementById("root")).render(t.jsx(x.StrictMode,{children:t.jsx(C3,{})}));
