easy-devops 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/index-0LoFb6uX.js +532 -0
- package/dist/ui/assets/index-CldtlkZm.css +1 -0
- package/dist/ui/assets/{socket-Bv0wCEgi.js → socket-BZkwjlhM.js} +2 -2
- package/dist/ui/index.html +2 -2
- package/package.json +2 -2
- package/src/cli/elevation.js +134 -0
- package/src/cli/index.js +97 -39
- package/src/cli/menus/runtime.js +12 -1
- package/src/cli/menus/service.js +39 -1
- package/src/cli/menus/uninstall.js +11 -1
- package/src/cli/menus/update.js +10 -0
- package/src/core/cert-operations.js +74 -33
- package/src/core/cert-usage.js +181 -0
- package/src/core/deploy/engine.js +25 -1
- package/src/core/deploy/stages.js +80 -0
- package/src/core/domains-db.js +67 -1
- package/src/core/hub/agent.js +23 -3
- package/src/core/hub/deployProgress.js +9 -3
- package/src/core/platform.js +62 -0
- package/src/core/service/index.js +65 -3
- package/src/core/service/operator.js +401 -0
- package/src/core/service/runtimeUpdate.js +19 -1
- package/src/core/service/windowsService.js +91 -18
- package/src/core/updater.js +21 -0
- package/src/dashboard/controllers/domainsController.js +2 -31
- package/src/dashboard/controllers/sslController.js +14 -98
- package/src/dashboard/controllers/updateController.js +42 -1
- package/dist/ui/assets/index-Bu7af-Kj.css +0 -1
- package/dist/ui/assets/index-gndgYe3K.js +0 -532
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function MN(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Gf={exports:{}},xr={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ty;function _N(){if(Ty)return xr;Ty=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(c,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var h in d)h!=="key"&&(f[h]=d[h])}else f=d;return d=f.ref,{$$typeof:n,type:c,key:m,ref:d!==void 0?d:null,props:f}}return xr.Fragment=i,xr.jsx=r,xr.jsxs=r,xr}var Cy;function LN(){return Cy||(Cy=1,Gf.exports=_N()),Gf.exports}var a=LN(),Yf={exports:{}},Oe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ey;function UN(){if(Ey)return Oe;Ey=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.for("react.view_transition"),k=Symbol.iterator;function z(C){return C===null||typeof C!="object"?null:(C=k&&C[k]||C["@@iterator"],typeof C=="function"?C:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,R={};function S(C,q,Y){this.props=C,this.context=q,this.refs=R,this.updater=Y||T}S.prototype.isReactComponent={},S.prototype.setState=function(C,q){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,q,"setState")},S.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function O(){}O.prototype=S.prototype;function E(C,q,Y){this.props=C,this.context=q,this.refs=R,this.updater=Y||T}var M=E.prototype=new O;M.constructor=E,w(M,S.prototype),M.isPureReactComponent=!0;var X=Array.isArray;function A(){}var U={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function I(C,q,Y){var re=Y.ref;return{$$typeof:n,type:C,key:q,ref:re!==void 0?re:null,props:Y}}function te(C,q){return I(C.type,q,C.props)}function B(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function V(C){var q={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(Y){return q[Y]})}var de=/\/+/g;function le(C,q){return typeof C=="object"&&C!==null&&C.key!=null?V(""+C.key):q.toString(36)}function Q(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(A,A):(C.status="pending",C.then(function(q){C.status==="pending"&&(C.status="fulfilled",C.value=q)},function(q){C.status==="pending"&&(C.status="rejected",C.reason=q)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function F(C,q,Y,re,ye){var Re=typeof C;(Re==="undefined"||Re==="boolean")&&(C=null);var xe=!1;if(C===null)xe=!0;else switch(Re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(C.$$typeof){case n:case i:xe=!0;break;case b:return xe=C._init,F(xe(C._payload),q,Y,re,ye)}}if(xe)return ye=ye(C),xe=re===""?"."+le(C,0):re,X(ye)?(Y="",xe!=null&&(Y=xe.replace(de,"$&/")+"/"),F(ye,q,Y,"",function(Pe){return Pe})):ye!=null&&(B(ye)&&(ye=te(ye,Y+(ye.key==null||C&&C.key===ye.key?"":(""+ye.key).replace(de,"$&/")+"/")+xe)),q.push(ye)),1;xe=0;var me=re===""?".":re+":";if(X(C))for(var ie=0;ie<C.length;ie++)re=C[ie],Re=me+le(re,ie),xe+=F(re,q,Y,Re,ye);else if(ie=z(C),typeof ie=="function")for(C=ie.call(C),ie=0;!(re=C.next()).done;)re=re.value,Re=me+le(re,ie++),xe+=F(re,q,Y,Re,ye);else if(Re==="object"){if(typeof C.then=="function")return F(Q(C),q,Y,re,ye);throw q=String(C),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return xe}function L(C,q,Y){if(C==null)return C;var re=[],ye=0;return F(C,re,"","",function(Re){return q.call(Y,Re,ye++)}),re}function ee(C){if(C._status===-1){var q=C._result,Y=q();Y.then(function(re){(C._status===0||C._status===-1)&&(C._status=1,C._result=re,Y.status===void 0&&(Y.status="fulfilled",Y.value=re))},function(re){(C._status===0||C._status===-1)&&(C._status=2,C._result=re,Y.status===void 0&&(Y.status="rejected",Y.reason=re))}),C._status===-1&&(C._status=0,C._result=Y)}if(C._status===1)return C._result.default;throw C._result}var ue=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)};function ke(C){var q=U.T,Y={};Y.types=q!==null?q.types:null,U.T=Y;try{var re=C(),ye=U.S;ye!==null&&ye(Y,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(A,ue)}catch(Re){ue(Re)}finally{q!==null&&Y.types!==null&&(q.types=Y.types),U.T=q}}function Ne(C){var q=U.T;if(q!==null){var Y=q.types;Y===null?q.types=[C]:Y.indexOf(C)===-1&&Y.push(C)}else ke(Ne.bind(null,C))}var Ee={map:L,forEach:function(C,q,Y){L(C,function(){q.apply(this,arguments)},Y)},count:function(C){var q=0;return L(C,function(){q++}),q},toArray:function(C){return L(C,function(q){return q})||[]},only:function(C){if(!B(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Oe.Activity=x,Oe.Children=Ee,Oe.Component=S,Oe.Fragment=r,Oe.Profiler=d,Oe.PureComponent=E,Oe.StrictMode=c,Oe.Suspense=g,Oe.ViewTransition=j,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(C){return U.H.useMemoCache(C)}},Oe.addTransitionType=Ne,Oe.cache=function(C){return function(){return C.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(C,q,Y){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var re=w({},C.props),ye=C.key;if(q!=null)for(Re in q.key!==void 0&&(ye=""+q.key),q)!W.call(q,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&q.ref===void 0||(re[Re]=q[Re]);var Re=arguments.length-2;if(Re===1)re.children=Y;else if(1<Re){for(var xe=Array(Re),me=0;me<Re;me++)xe[me]=arguments[me+2];re.children=xe}return I(C.type,ye,re)},Oe.createContext=function(C){return C={$$typeof:m,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:f,_context:C},C},Oe.createElement=function(C,q,Y){var re,ye={},Re=null;if(q!=null)for(re in q.key!==void 0&&(Re=""+q.key),q)W.call(q,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ye[re]=q[re]);var xe=arguments.length-2;if(xe===1)ye.children=Y;else if(1<xe){for(var me=Array(xe),ie=0;ie<xe;ie++)me[ie]=arguments[ie+2];ye.children=me}if(C&&C.defaultProps)for(re in xe=C.defaultProps,xe)ye[re]===void 0&&(ye[re]=xe[re]);return I(C,Re,ye)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(C){return{$$typeof:h,render:C}},Oe.isValidElement=B,Oe.lazy=function(C){return{$$typeof:b,_payload:{_status:-1,_result:C},_init:ee}},Oe.memo=function(C,q){return{$$typeof:v,type:C,compare:q===void 0?null:q}},Oe.startTransition=ke,Oe.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Oe.use=function(C){return U.H.use(C)},Oe.useActionState=function(C,q,Y){return U.H.useActionState(C,q,Y)},Oe.useCallback=function(C,q){return U.H.useCallback(C,q)},Oe.useContext=function(C){return U.H.useContext(C)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(C,q){return U.H.useDeferredValue(C,q)},Oe.useEffect=function(C,q){return U.H.useEffect(C,q)},Oe.useEffectEvent=function(C){return U.H.useEffectEvent(C)},Oe.useId=function(){return U.H.useId()},Oe.useImperativeHandle=function(C,q,Y){return U.H.useImperativeHandle(C,q,Y)},Oe.useInsertionEffect=function(C,q){return U.H.useInsertionEffect(C,q)},Oe.useLayoutEffect=function(C,q){return U.H.useLayoutEffect(C,q)},Oe.useMemo=function(C,q){return U.H.useMemo(C,q)},Oe.useOptimistic=function(C,q){return U.H.useOptimistic(C,q)},Oe.useReducer=function(C,q,Y){return U.H.useReducer(C,q,Y)},Oe.useRef=function(C){return U.H.useRef(C)},Oe.useState=function(C){return U.H.useState(C)},Oe.useSyncExternalStore=function(C,q,Y){return U.H.useSyncExternalStore(C,q,Y)},Oe.useTransition=function(){return U.H.useTransition()},Oe.version="19.3.1",Oe}var Ry;function Oh(){return Ry||(Ry=1,Yf.exports=UN()),Yf.exports}var p=Oh();const yt=MN(p);var Vf={exports:{}},gr={},Xf={exports:{}},Kf={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var zy;function HN(){return zy||(zy=1,(function(n){function i(Q,F){var L=Q.length;Q.push(F);e:for(;0<L;){var ee=L-1>>>1,ue=Q[ee];if(0<d(ue,F))Q[ee]=F,Q[L]=ue,L=ee;else break e}}function r(Q){return Q.length===0?null:Q[0]}function c(Q){if(Q.length===0)return null;var F=Q[0],L=Q.pop();if(L!==F){Q[0]=L;e:for(var ee=0,ue=Q.length,ke=ue>>>1;ee<ke;){var Ne=2*(ee+1)-1,Ee=Q[Ne],C=Ne+1,q=Q[C];if(0>d(Ee,L))C<ue&&0>d(q,Ee)?(Q[ee]=q,Q[C]=L,ee=C):(Q[ee]=Ee,Q[Ne]=L,ee=Ne);else if(C<ue&&0>d(q,L))Q[ee]=q,Q[C]=L,ee=C;else break e}}return F}function d(Q,F){var L=Q.sortIndex-F.sortIndex;return L!==0?L:Q.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,h=m.now();n.unstable_now=function(){return m.now()-h}}var g=[],v=[],b=1,x=null,j=3,k=!1,z=!1,T=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function E(Q){for(var F=r(v);F!==null;){if(F.callback===null)c(v);else if(F.startTime<=Q)c(v),F.sortIndex=F.expirationTime,i(g,F);else break;F=r(v)}}function M(Q){if(T=!1,E(Q),!z)if(r(g)!==null)z=!0,X||(X=!0,B());else{var F=r(v);F!==null&&le(M,F.startTime-Q)}}var X=!1,A=-1,U=5,W=-1;function I(){return w?!0:!(n.unstable_now()-W<U)}function te(){if(w=!1,X){var Q=n.unstable_now();W=Q;var F=!0;try{e:{z=!1,T&&(T=!1,S(A),A=-1),k=!0;var L=j;try{t:{for(E(Q),x=r(g);x!==null&&!(x.expirationTime>Q&&I());){var ee=x.callback;if(typeof ee=="function"){x.callback=null,j=x.priorityLevel;var ue=ee(x.expirationTime<=Q);if(Q=n.unstable_now(),typeof ue=="function"){x.callback=ue,E(Q),F=!0;break t}x===r(g)&&c(g),E(Q)}else c(g);x=r(g)}if(x!==null)F=!0;else{var ke=r(v);ke!==null&&le(M,ke.startTime-Q),F=!1}}break e}finally{x=null,j=L,k=!1}F=void 0}}finally{F?B():X=!1}}}var B;if(typeof O=="function")B=function(){O(te)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,de=V.port2;V.port1.onmessage=te,B=function(){de.postMessage(null)}}else B=function(){R(te,0)};function le(Q,F){A=R(function(){Q(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(Q){Q.callback=null},n.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Q?Math.floor(1e3/Q):5},n.unstable_getCurrentPriorityLevel=function(){return j},n.unstable_next=function(Q){switch(j){case 1:case 2:case 3:var F=3;break;default:F=j}var L=j;j=F;try{return Q()}finally{j=L}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(Q,F){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var L=j;j=Q;try{return F()}finally{j=L}},n.unstable_scheduleCallback=function(Q,F,L){var ee=n.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?ee+L:ee):L=ee,Q){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=L+ue,Q={id:b++,callback:F,priorityLevel:Q,startTime:L,expirationTime:ue,sortIndex:-1},L>ee?(Q.sortIndex=L,i(v,Q),r(g)===null&&Q===r(v)&&(T?(S(A),A=-1):T=!0,le(M,L-ee))):(Q.sortIndex=ue,i(g,Q),z||k||(z=!0,X||(X=!0,B()))),Q},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(Q){var F=j;return function(){var L=j;j=F;try{return Q.apply(this,arguments)}finally{j=L}}}})(Kf)),Kf}var Dy;function BN(){return Dy||(Dy=1,Xf.exports=HN()),Xf.exports}var Zf={exports:{}},nn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Ay;function $N(){if(Ay)return nn;Ay=1;var n=Oh();function i(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)x+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function h(b,x,j){var k=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:k==null?null:k===m?m:""+k,children:b,containerInfo:x,implementation:j}}var g=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,nn.browser=function(b){return{$$typeof:f,_reason:b}},nn.createPortal=function(b,x){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return h(b,x,null,j)},nn.flushSync=function(b){var x=g.T,j=c.p;try{if(g.T=null,c.p=2,b)return b()}finally{g.T=x,c.p=j,c.d.f()}},nn.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(b,x))},nn.prefetchDNS=function(b){typeof b=="string"&&c.d.D(b)},nn.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var j=x.as,k=v(j,x.crossOrigin),z=typeof x.integrity=="string"?x.integrity:void 0,T=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;j==="style"?c.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:k,integrity:z,fetchPriority:T}):j==="script"&&c.d.X(b,{crossOrigin:k,integrity:z,fetchPriority:T,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},nn.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var j=v(x.as,x.crossOrigin);c.d.M(b,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}}else x==null&&c.d.M(b)},nn.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var j=x.as,k=v(j,x.crossOrigin);c.d.L(b,j,{crossOrigin:k,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},nn.preloadModule=function(b,x){if(typeof b=="string")if(x){var j=v(x.as,x.crossOrigin);c.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}else c.d.m(b)},nn.requestFormReset=function(b){c.d.r(b)},nn.unstable_batchedUpdates=function(b,x){return b(x)},nn.useFormState=function(b,x,j){return g.H.useFormState(b,x,j)},nn.useFormStatus=function(){return g.H.useHostTransitionStatus()},nn.version="19.3.1",nn}var Oy;function Iv(){if(Oy)return Zf.exports;Oy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Zf.exports=$N(),Zf.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var My;function qN(){if(My)return gr;My=1;var n=BN(),i=Oh(),r=Iv();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,s=t;s&&!s.alternate;)t=s,(t.flags&4098)!==0&&(e=t.return),s=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(c(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,l=t;;){var o=s.return;if(o===null)break;var u=o.alternate;if(u===null){if(l=o.return,l!==null){s=l;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===s)return g(o),e;if(u===l)return g(o),t;u=u.sibling}throw Error(c(188))}if(s.return!==l.return)s=o,l=u;else{for(var y=!1,N=o.child;N;){if(N===s){y=!0,s=o,l=u;break}if(N===l){y=!0,l=o,s=u;break}N=N.sibling}if(!y){for(N=u.child;N;){if(N===s){y=!0,s=u,l=o;break}if(N===l){y=!0,l=u,s=o;break}N=N.sibling}if(!y)throw Error(c(189))}}if(s.alternate!==l)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function x(e,t,s,l,o,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&s(e,l,o,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&x(e.child,t,s,l,o,u))return!0;e=e.sibling}return!1}function j(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function k(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function z(e){var t=[null,null],s=j(e);return s===null||T(t,e,s.child,{foundSelf:!1}),t}function T(e,t,s,l){for(;s!==null;){if(s===t)l.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(l.foundSelf)return e[1]=s,!0;e[0]=s}else if((s.tag!==22||s.memoizedState===null)&&T(e,t,s.child,l))return!0;s=s.sibling}return!1}function w(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(c(559))}}var R=null,S=null;function O(e,t,s){return e===s?!0:e===t?(R=e,!0):!1}function E(e,t,s){return e===s?(S=e,!1):e===t?(S!==null&&(R=e),!0):!1}function M(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function X(e,t,s){for(var l=0,o=e;o;o=s(o))l++;o=0;for(var u=t;u;u=s(u))o++;for(;0<l-o;)e=s(e),l--;for(;0<o-l;)t=s(t),o--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=s(e),t=s(t)}return null}var A=Object.assign,U=Symbol.for("react.element"),W=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),te=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),de=Symbol.for("react.consumer"),le=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),ke=Symbol.for("react.activity"),Ne=Symbol.for("react.legacy_hidden"),Ee=Symbol.for("react.memo_cache_sentinel"),C=Symbol.for("react.view_transition"),q=Symbol.for("react.recoverable"),Y=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case te:return"Fragment";case V:return"Profiler";case B:return"StrictMode";case F:return"Suspense";case L:return"SuspenseList";case ke:return"Activity";case C:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case I:return"Portal";case le:return e.displayName||"Context";case de:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case ue:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var xe=Array.isArray,me=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe={pending:!1,data:null,method:null,action:null},Ge=[],Fe=-1;function ce(e){return{current:e}}function De(e){0>Fe||(e.current=Ge[Fe],Ge[Fe]=null,Fe--)}function we(e,t){Fe++,Ge[Fe]=e.current,e.current=t}var nt=ce(null),rt=ce(null),xt=ce(null),bt=ce(null);function zn(e,t){switch(we(xt,t),we(rt,e),we(nt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_g(t),e=Lg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}De(nt),we(nt,e)}function jn(){De(nt),De(rt),De(xt)}function na(e){var t=e.memoizedState;t!==null&&(ri._currentValue=t.memoizedState,we(bt,e)),t=nt.current;var s=Lg(t,e.type);t!==s&&(we(rt,e),we(nt,s))}function J(e){rt.current===e&&(De(nt),De(rt)),bt.current===e&&(De(bt),ri._currentValue=Pe)}var be,Ue;function Dt(e){if(be===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",Ue=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+be+e+Ue}var aa=!1;function Xe(e,t){if(!e||aa)return"";aa=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(pe){var H=pe}Reflect.construct(e,[],se)}else{try{se.call()}catch(pe){H=pe}se=!1;try{var Z=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),se=!0,new e}finally{se&&(Z!==void 0?Object.defineProperty(e.prototype,"props",Z):delete e.prototype.props)}}}else{try{throw Error()}catch(pe){H=pe}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(pe){if(pe&&H&&typeof pe.stack=="string")return[pe.stack,H.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),y=u[0],N=u[1];if(y&&N){var D=y.split(`
|
|
44
|
-
`),G=N.split(`
|
|
45
|
-
`);for(o=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;o<G.length&&!G[o].includes("DetermineComponentFrameRoot");)o++;if(l===D.length||o===G.length)for(l=D.length-1,o=G.length-1;1<=l&&0<=o&&D[l]!==G[o];)o--;for(;1<=l&&0<=o;l--,o--)if(D[l]!==G[o]){if(l!==1||o!==1)do if(l--,o--,0>o||D[l]!==G[o]){var P=`
|
|
46
|
-
`+D[l].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=l&&0<=o);break}}}finally{aa=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Dt(s):""}function vl(e,t){switch(e.tag){case 26:case 27:case 5:return Dt(e.type);case 16:return Dt("Lazy");case 13:return e.child!==t&&t!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return Xe(e.type,!1);case 11:return Xe(e.type.render,!1);case 1:return Xe(e.type,!0);case 31:return Dt("Activity");case 30:return Dt("ViewTransition");default:return""}}function bl(e){try{var t="",s=null;do t+=vl(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
-
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var Hs=Object.prototype.hasOwnProperty,Ce=n.unstable_scheduleCallback,ut=n.unstable_cancelCallback,Rt=n.unstable_shouldYield,jt=n.unstable_requestPaint,Ke=n.unstable_now,Pt=n.unstable_getCurrentPriorityLevel,Kr=n.unstable_ImmediatePriority,Ut=n.unstable_UserBlockingPriority,Gt=n.unstable_NormalPriority,on=n.unstable_LowPriority,sa=n.unstable_IdlePriority,Nn=n.log,cn=n.unstable_setDisableYieldValue,an=null,At=null;function ft(e){if(typeof Nn=="function"&&cn(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(an,e)}catch{}}var Nt=Math.clz32?Math.clz32:Bs,Gn=Math.log,la=Math.LN2;function Bs(e){return e>>>=0,e===0?32:31-(Gn(e)/la|0)|0}var Na=256,Dn=262144,wa=4194304;function ia(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;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 Zr(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var o=0,u=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var N=l&134217727;return N!==0?(l=N&~u,l!==0?o=ia(l):(y&=N,y!==0?o=ia(y):s||(s=N&~e,s!==0&&(o=ia(s))))):(N=l&~u,N!==0?o=ia(N):y!==0?o=ia(y):s||(s=l&~e,s!==0&&(o=ia(s)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,s=t&-t,u>=s||u===32&&(s&4194048)!==0)?t:o}function Si(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rm(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var l=31-Nt(s),o=1<<l;t|=e[l],s&=~o}return t}function Q0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function om(){var e=wa;return wa<<=1,(wa&62914560)===0&&(wa=4194304),e}function mu(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function ki(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function P0(e,t,s,l,o,u){var y=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 N=e.entanglements,D=e.expirationTimes,G=e.hiddenUpdates;for(s=y&~s;0<s;){var P=31-Nt(s),se=1<<P;N[P]=0,D[P]=-1;var H=G[P];if(H!==null)for(G[P]=null,P=0;P<H.length;P++){var Z=H[P];Z!==null&&(Z.lane&=-536870913)}s&=~se}l!==0&&cm(e,l,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(y&~t))}function cm(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Nt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function um(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-Nt(s),o=1<<l;o&t|e[l]&t&&(e[l]|=t),s&=~o}}function dm(e,t){var s=t&-t;return s=(s&42)!==0?1:pu(s),(s&(e.suspendedLanes|t))!==0?0:s}function pu(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 xu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function fm(){var e=ie.p;return e!==0?e:(e=window.event,e===void 0?32:vy(e.type))}function hm(e,t){var s=ie.p;try{return ie.p=e,t()}finally{ie.p=s}}var Ua=Math.random().toString(36).slice(2),It="__reactFiber$"+Ua,wn="__reactProps$"+Ua,jl="__reactContainer$"+Ua,mm="__reactEvents$"+Ua,I0="__reactListeners$"+Ua,F0="__reactHandles$"+Ua,pm="__reactResources$"+Ua,Ti="__reactMarker$"+Ua,Qr="__reactLoad$"+Ua;function Pr(e){delete e[It],delete e[wn],delete e[I0],delete e[F0]}function $s(e){var t;if(t=e[It])return t;for(var s=e.parentNode;s;){if(t=s[jl]||s[It]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Wg(e);e!==null;){if(s=e[It])return s;e=Wg(e)}return t}e=s,s=e.parentNode}return null}function Nl(e){if(e=e[It]||e[jl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ci(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function wl(e){var t=e[pm];return t||(t=e[pm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Yt(e){e[Ti]=!0}function xm(e){e[Qr]=void 0}var gm=new Set,ym={};function qs(e,t){Sl(e,t),Sl(e+"Capture",t)}function Sl(e,t){for(ym[e]=t,e=0;e<t.length;e++)gm.add(t[e])}var J0=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]*$"),vm={},bm={};function W0(e){return Hs.call(bm,e)?!0:Hs.call(vm,e)?!1:J0.test(e)?bm[e]=!0:(vm[e]=!0,!1)}var Je=!1;function jm(){var e=Je;return Je=!1,e}function Ir(e,t,s){if(W0(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,s)}}function Fr(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function Ha(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,l)}}function An(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ej(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(y){s=""+y,u.call(this,y)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gu(e){if(!e._valueTracker){var t=Nm(e)?"checked":"value";e._valueTracker=ej(e,t,""+e[t])}}function wm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=Nm(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}var tj=/[\n"\\]/g;function Yn(e){return e.replace(tj,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function yu(e,t,s,l,o,u,y,N){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+An(t)):e.value!==""+An(t)&&(e.value=""+An(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?y==="number"&&e.value==t?vu(e,An(e.value)):vu(e,An(t)):s!=null?vu(e,An(s)):l!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+An(N):e.removeAttribute("name")}function Sm(e,t,s,l,o,u,y,N){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||s!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){gu(e);return}s=s!=null?""+An(s):"",t=t!=null?""+An(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=N?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),gu(e)}function vu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function kl(e,t,s,l){if(e=e.options,t){t={};for(var o=0;o<s.length;o++)t["$"+s[o]]=!0;for(s=0;s<e.length;s++)o=t.hasOwnProperty("$"+e[s].value),e[s].selected!==o&&(e[s].selected=o),o&&l&&(e[s].defaultSelected=!0)}else{for(s=""+An(s),t=null,o=0;o<e.length;o++){if(e[o].value===s){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function km(e,t,s){if(t!=null&&(t=""+An(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+An(s):""}function Tm(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(c(92));if(xe(l)){if(1<l.length)throw Error(c(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=An(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),gu(e)}function Tl(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var nj=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 Cm(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||nj.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Em(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Je=!0);for(var o in t)l=t[o],t.hasOwnProperty(o)&&s[o]!==l&&(Cm(e,o,l),Je=!0)}else for(var u in t)t.hasOwnProperty(u)&&Cm(e,u,t[u])}function bu(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 aj=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"],["maskType","mask-type"],["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"]]),sj=/^[\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 Jr(e){return sj.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Sa(){}var ju=null;function Nu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cl=null,El=null;function Rm(e){var t=Nl(e);if(t&&(e=t.stateNode)){var s=e[wn]||null;e:switch(e=t.stateNode,t.type){case"input":if(yu(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Yn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var o=l[wn]||null;if(!o)throw Error(c(90));yu(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&wm(l)}break e;case"textarea":km(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&kl(e,!!s.multiple,t,!1)}}}var wu=!1;function zm(e,t,s){if(wu)return e(t,s);wu=!0;try{var l=e(t);return l}finally{if(wu=!1,(Cl!==null||El!==null)&&(Wo(),Cl&&(t=Cl,e=El,El=Cl=null,Rm(t),e)))for(t=0;t<e.length;t++)Rm(e[t])}}function Ei(e,t){var s=e.stateNode;if(s===null)return null;var l=s[wn]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ba)try{var Ri={};Object.defineProperty(Ri,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{Su=!1}var ss=null,ku=null,Wr=null;function Dm(){if(Wr)return Wr;var e,t=ku,s=t.length,l,o="value"in ss?ss.value:ss.textContent,u=o.length;for(e=0;e<s&&t[e]===o[e];e++);var y=s-e;for(l=1;l<=y&&t[s-l]===o[u-l];l++);return Wr=o.slice(e,1<l?1-l:void 0)}function eo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function to(){return!0}function Am(){return!1}function un(e){function t(s,l,o,u,y){this._reactName=s,this._targetInst=o,this.type=l,this.nativeEvent=u,this.target=y,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(u):u[N]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?to:Am,this.isPropagationStopped=Am,this}return A(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},no=un(ls),zi=A({},ls,{view:0,detail:0}),lj=un(zi),Tu,Cu,Di,ao=A({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ru,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!==Di&&(Di&&e.type==="mousemove"?(Tu=e.screenX-Di.screenX,Cu=e.screenY-Di.screenY):Cu=Tu=0,Di=e),Tu)},movementY:function(e){return"movementY"in e?e.movementY:Cu}}),Om=un(ao),ij=A({},ao,{dataTransfer:0}),rj=un(ij),oj=A({},zi,{relatedTarget:0}),Eu=un(oj),cj=A({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),uj=un(cj),dj=A({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fj=un(dj),hj=A({},ls,{data:0}),Mm=un(hj),mj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pj={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"},xj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xj[e])?!!t[e]:!1}function Ru(){return gj}var yj=A({},zi,{key:function(e){if(e.key){var t=mj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ru,charCode:function(e){return e.type==="keypress"?eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vj=un(yj),bj=A({},ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_m=un(bj),jj=A({},ls,{submitter:0}),Nj=un(jj),wj=A({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ru}),Sj=un(wj),kj=A({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tj=un(kj),Cj=A({},ao,{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}),Ej=un(Cj),Rj=A({},ls,{newState:0,oldState:0,source:0}),zj=un(Rj),Dj=[9,13,27,32],zu=Ba&&"CompositionEvent"in window,Ai=null;Ba&&"documentMode"in document&&(Ai=document.documentMode);var Aj=Ba&&"TextEvent"in window&&!Ai,Lm=Ba&&(!zu||Ai&&8<Ai&&11>=Ai),Um=" ",Hm=!1;function Bm(e,t){switch(e){case"keyup":return Dj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $m(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rl=!1;function Oj(e,t){switch(e){case"compositionend":return $m(t);case"keypress":return t.which!==32?null:(Hm=!0,Um);case"textInput":return e=t.data,e===Um&&Hm?null:e;default:return null}}function Mj(e,t){if(Rl)return e==="compositionend"||!zu&&Bm(e,t)?(e=Dm(),Wr=ku=ss=null,Rl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Lm&&t.locale!=="ko"?null:t.data;default:return null}}var _j={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 qm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_j[e.type]:t==="textarea"}function Gm(e,t,s,l){Cl?El?El.push(l):El=[l]:Cl=l,t=lc(t,"onChange"),0<t.length&&(s=new no("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var Oi=null,Mi=null;function Lj(e){Rg(e,0)}function so(e){var t=Ci(e);if(wm(t))return e}function Ym(e,t){if(e==="change")return t}var Vm=!1;if(Ba){var Du;if(Ba){var Au="oninput"in document;if(!Au){var Xm=document.createElement("div");Xm.setAttribute("oninput","return;"),Au=typeof Xm.oninput=="function"}Du=Au}else Du=!1;Vm=Du&&(!document.documentMode||9<document.documentMode)}function Km(){Oi&&(Oi.detachEvent("onpropertychange",Zm),Mi=Oi=null)}function Zm(e){if(e.propertyName==="value"&&so(Mi)){var t=[];Gm(t,Mi,e,Nu(e)),zm(Lj,t)}}function Uj(e,t,s){e==="focusin"?(Km(),Oi=t,Mi=s,Oi.attachEvent("onpropertychange",Zm)):e==="focusout"&&Km()}function Hj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return so(Mi)}function Bj(e,t){if(e==="click")return so(t)}function $j(e,t){if(e==="input"||e==="change")return so(t)}function qj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var On=typeof Object.is=="function"?Object.is:qj;function _i(e,t){if(On(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var o=s[l];if(!Hs.call(t,o)||!On(e[o],t[o]))return!1}return!0}function Ou(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pm(e,t){var s=Qm(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Qm(s)}}function Im(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Im(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ou(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ou(e.document)}return t}function Mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Gj=Ba&&"documentMode"in document&&11>=document.documentMode,zl=null,_u=null,Li=null,Lu=!1;function Jm(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Lu||zl==null||zl!==Ou(l)||(l=zl,"selectionStart"in l&&Mu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Li&&_i(Li,l)||(Li=l,l=lc(_u,"onSelect"),0<l.length&&(t=new no("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=zl)))}function Gs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Dl={animationend:Gs("Animation","AnimationEnd"),animationiteration:Gs("Animation","AnimationIteration"),animationstart:Gs("Animation","AnimationStart"),transitionrun:Gs("Transition","TransitionRun"),transitionstart:Gs("Transition","TransitionStart"),transitioncancel:Gs("Transition","TransitionCancel"),transitionend:Gs("Transition","TransitionEnd")},Uu={},Wm={};Ba&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ys(e){if(Uu[e])return Uu[e];if(!Dl[e])return e;var t=Dl[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Wm)return Uu[e]=t[s];return e}var ep=Ys("animationend"),tp=Ys("animationiteration"),np=Ys("animationstart"),Yj=Ys("transitionrun"),Vj=Ys("transitionstart"),Xj=Ys("transitioncancel"),ap=Ys("transitionend"),sp=new Map,Hu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Hu.push("scrollEnd");function ra(e,t){sp.set(e,t),qs(t,[e])}var Kj=0;function $a(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=da.identifierPrefix;var s=Kj++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function lp(e){if(e==null||typeof e=="string")return e;var t=null,s=Fl;if(s!==null)for(var l=0;l<s.length;l++){var o=e[s[l]];if(o!=null){if(o==="none")return"none";t=t==null?o:t+(" "+o)}}return t??e.default}function qa(e,t){return e=lp(e),t=lp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var lo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Vn=[],Al=0,Bu=0;function io(){for(var e=Al,t=Bu=Al=0;t<e;){var s=Vn[t];Vn[t++]=null;var l=Vn[t];Vn[t++]=null;var o=Vn[t];Vn[t++]=null;var u=Vn[t];if(Vn[t++]=null,l!==null&&o!==null){var y=l.pending;y===null?o.next=o:(o.next=y.next,y.next=o),l.pending=o}u!==0&&ip(s,o,u)}}function ro(e,t,s,l){Vn[Al++]=e,Vn[Al++]=t,Vn[Al++]=s,Vn[Al++]=l,Bu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function $u(e,t,s,l){return ro(e,t,s,l),oo(e)}function Vs(e,t){return ro(e,null,null,t),oo(e)}function ip(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var o=!1,u=e.return;u!==null;)u.childLanes|=s,l=u.alternate,l!==null&&(l.childLanes|=s),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-Nt(s),e=u.hiddenUpdates,l=e[o],l===null?e[o]=[t]:l.push(t),t.lane=s|536870912),u):null}function oo(e){if(50<sr)throw sr=0,Jo=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ol={};function Zj(e,t,s,l){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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(e,t,s,l){return new Zj(e,t,s,l)}function qu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ga(e,t){var s=e.alternate;return s===null?(s=Sn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function rp(e,t){e.flags&=1206910978;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=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,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function co(e,t,s,l,o,u){var y=0;if(l=e,typeof l=="function")qu(l)&&(y=1);else if(typeof l=="string")y=jN(e,s,nt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ke:return e=Sn(31,s,t,o),e.elementType=ke,e.lanes=u,e;case te:return Xs(s.children,o,u,t);case B:y=8,o|=24;break;case V:return e=Sn(12,s,t,o|2),e.elementType=V,e.lanes=u,e;case F:return e=Sn(13,s,t,o),e.elementType=F,e.lanes=u,e;case L:return e=Sn(19,s,t,o),e.elementType=L,e.lanes=u,e;case Ne:case C:return e=o|32,e=Sn(30,s,t,e),e.elementType=C,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case le:y=10;break e;case de:y=9;break e;case Q:y=11;break e;case ee:y=14;break e;case ue:y=16,l=null;break e}y=29,s=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=Sn(y,s,t,o),t.elementType=e,t.type=l,t.lanes=u,t}function Xs(e,t,s,l){return e=Sn(7,e,l,t),e.lanes=s,e}function Gu(e,t,s){return e=Sn(6,e,null,t),e.lanes=s,e}function op(e){var t=Sn(18,null,null,0);return t.stateNode=e,t}function Yu(e,t,s){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var cp=new WeakMap;function Xn(e,t){if(typeof e=="object"&&e!==null){var s=cp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:bl(t)},cp.set(e,t),t)}return{value:e,source:t,stack:bl(t)}}var Ml=[],_l=0,uo=null,Ui=0,Kn=[],Zn=0,is=null,ka=1,Ta="";function Ya(e,t){Ml[_l++]=Ui,Ml[_l++]=uo,uo=e,Ui=t}function up(e,t,s){Kn[Zn++]=ka,Kn[Zn++]=Ta,Kn[Zn++]=is,is=e;var l=ka;e=Ta;var o=32-Nt(l)-1;l&=~(1<<o),s+=1;var u=32-Nt(t)+o;if(30<u){var y=o-o%5;u=(l&(1<<y)-1).toString(32),l>>=y,o-=y,ka=1<<32-Nt(t)+o|s<<o|l,Ta=u+e}else ka=1<<u|s<<o|l,Ta=e}function fo(e){e.return!==null&&(Ya(e,1),up(e,1,0))}function Vu(e){for(;e===uo;)uo=Ml[--_l],Ml[_l]=null,Ui=Ml[--_l],Ml[_l]=null;for(;e===is;)is=Kn[--Zn],Kn[Zn]=null,Ta=Kn[--Zn],Kn[Zn]=null,ka=Kn[--Zn],Kn[Zn]=null}function dp(e,t){Kn[Zn++]=ka,Kn[Zn++]=Ta,Kn[Zn++]=is,ka=t.id,Ta=t.overflow,is=e}var Vt=null,ht=null,Be=!1,rs=null,Qn=!1,Xu=Error(c(519));function os(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hi(Xn(t,e)),Xu}function fp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[It]=e,t[wn]=l,s){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(s=0;s<ir.length;s++)qe(ir[s],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Sm(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Tm(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||Og(t.textContent,s)?(l.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),l.onScroll!=null&&qe("scroll",t),l.onScrollEnd!=null&&qe("scrollend",t),l.onClick!=null&&(t.onclick=Sa),t=!0):t=!1,t||os(e,!0)}function ho(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Vt=Vt.return}}function Ll(e){if(e!==Vt)return!1;if(!Be)return ho(e),Be=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Nf(e.type,e.memoizedProps)),s=!s),s&&ht&&os(e),ho(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=Jg(e)}else t===27?(t=ht,Ss(e.type)?(e=Df,Df=null,ht=e):ht=t):ht=Vt?In(e.stateNode.nextSibling):null;return!0}function Ks(){ht=Vt=null,Be=!1}function Ku(){var e=rs;return e!==null&&(Cn===null?Cn=e:Cn.push.apply(Cn,e),rs=null),e}function Hi(e){rs===null?rs=[e]:rs.push(e)}var Zu=ce(null),Zs=null,Va=null;function cs(e,t,s){we(Zu,t._currentValue),t._currentValue=s}function Xa(e){e._currentValue=Zu.current,De(Zu)}function mo(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function Qu(e,t,s,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var y=o.child;u=u.firstContext;e:for(;u!==null;){var N=u;u=o;for(var D=0;D<t.length;D++)if(N.context===t[D]){u.lanes|=s,N=u.alternate,N!==null&&(N.lanes|=s),mo(u.return,s,e),l||(y=null);break e}u=N.next}}else if(o.tag===18){if(y=o.return,y===null)throw Error(c(341));y.lanes|=s,u=y.alternate,u!==null&&(u.lanes|=s),mo(y,s,e),y=null}else o.tag===13&&o.memoizedState!==null&&o.memoizedState.dehydrated===null?(o.lanes|=s,y=o.alternate,y!==null&&(y.lanes|=s),mo(o.return,s,e),y=o.child,y=y!==null?y.sibling:null):y=o.child;if(y!==null)y.return=o;else for(y=o;y!==null;){if(y===e){y=null;break}if(o=y.sibling,o!==null){o.return=y.return,y=o;break}y=y.return}o=y}}function Qs(e,t,s,l){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var y=o.alternate;if(y===null)throw Error(c(387));if(y=y.memoizedProps,y!==null){var N=o.type;On(o.pendingProps.value,y.value)||(e!==null?e.push(N):e=[N])}}else if(o===bt.current){if(y=o.alternate,y===null)throw Error(c(387));y.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ri):e=[ri])}o=o.return}return e!==null&&Qu(t,e,s,l),t.flags|=262144,e!==null}function po(e){for(e=e.firstContext;e!==null;){if(!On(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ps(e){Zs=e,Va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return hp(Zs,e)}function xo(e,t){return Zs===null&&Ps(e),hp(e,t)}function hp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Va===null){if(e===null)throw Error(c(308));Va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Va=Va.next=t;return s}var Qj=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Pj=n.unstable_scheduleCallback,Ij=n.unstable_NormalPriority,Ot={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new Qj,data:new Map,refCount:0}}function Bi(e){e.refCount--,e.refCount===0&&Pj(Ij,function(){e.controller.abort()})}function mp(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];s.indexOf(l)===-1&&s.push(l)}}}var $i=null;function Fj(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var qi=null,Iu=0,Is=0,Ul=null;function Jj(e,t){if(qi===null){var s=qi=[];Iu=0,Is=hf(),Ul={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Iu++,t.then(pp,pp),t}function pp(){if(--Iu===0&&($i=null,qi!==null)){Ul!==null&&(Ul.status="fulfilled");var e=qi;qi=null,Is=0,Ul=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wj(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(o){s.push(o)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var o=0;o<s.length;o++)(0,s[o])(t)},function(o){for(l.status="rejected",l.reason=o,o=0;o<s.length;o++)(0,s[o])(void 0)}),l}var xp=me.S;me.S=function(e,t){if(og=Ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jj(e,t),$i!==null)for(var s=ti;s!==null;)mp(s,$i),s=s.next;if(s=e.types,s!==null){for(var l=ti;l!==null;)mp(l,s),l=l.next;if(Is!==0){l=$i,l===null&&(l=$i=[]);for(var o=0;o<s.length;o++){var u=s[o];l.indexOf(u)===-1&&l.push(u)}}}xp!==null&&xp(e,t)};var Fs=ce(null);function Fu(){var e=Fs.current;return e!==null?e:dt.pooledCache}function go(e,t){t===null?we(Fs,Fs.current):we(Fs,t.pool)}function gp(){var e=Fu();return e===null?null:{parent:Ot._currentValue,pool:e}}var Hl=Error(c(460)),Ju=Error(c(474)),yo=Error(c(542)),vo={then:function(){}};function yp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Sa,Sa),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jp(e),e===void 0&&!("reason"in t)?Error(c(600)):e;default:if(typeof t.status=="string")t.then(Sa,Sa);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=l}},function(l){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jp(e),e}throw Ws=t,Hl}}function Js(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ws=s,Hl):s}}var Ws=null;function bp(){if(Ws===null)throw Error(c(459));var e=Ws;return Ws=null,e}function jp(e){if(e===Hl||e===yo)throw Error(c(483))}var Bl=null,Gi=0;function bo(e){var t=Gi;return Gi+=1,Bl===null&&(Bl=[]),vp(Bl,e,t)}function us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function jo(e,t){throw t.$$typeof===U?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Np(e){function t($,_){if(e){var K=$.deletions;K===null?($.deletions=[_],$.flags|=16):K.push(_)}}function s($,_){if(!e)return null;for(;_!==null;)t($,_),_=_.sibling;return null}function l($){for(var _=new Map;$!==null;)$.key===null?_.set($.index,$):_.set($.key,$),$=$.sibling;return _}function o($,_){return $=Ga($,_),$.index=0,$.sibling=null,$}function u($,_,K){return $.index=K,e?(K=$.alternate,K!==null?(K=K.index,K<_?($.flags|=2,_):K):($.flags|=134217730,_)):($.flags|=1048576,_)}function y($){return e&&$.alternate===null&&($.flags|=134217730),$}function N($,_,K,ne){return _===null||_.tag!==6?(_=Gu(K,$.mode,ne),_.return=$,_):(_=o(_,K),_.return=$,_)}function D($,_,K,ne){var Se=K.type;return Se===te?($=P($,_,K.props.children,ne,K.key),us($,K),$):_!==null&&(_.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===ue&&Js(Se)===_.type)?(_=o(_,K.props),us(_,K),_.return=$,_):(_=co(K.type,K.key,K.props,null,$.mode,ne),us(_,K),_.return=$,_)}function G($,_,K,ne){return _===null||_.tag!==4||_.stateNode.containerInfo!==K.containerInfo||_.stateNode.implementation!==K.implementation?(_=Yu(K,$.mode,ne),_.return=$,_):(_=o(_,K.children||[]),_.return=$,_)}function P($,_,K,ne,Se){return _===null||_.tag!==7?(_=Xs(K,$.mode,ne,Se),_.return=$,_):(_=o(_,K),_.return=$,_)}function se($,_,K){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Gu(""+_,$.mode,K),_.return=$,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case W:return K=co(_.type,_.key,_.props,null,$.mode,K),us(K,_),K.return=$,K;case I:return _=Yu(_,$.mode,K),_.return=$,_;case ue:return _=Js(_),se($,_,K)}if(xe(_)||re(_))return _=Xs(_,$.mode,K,null),_.return=$,_;if(typeof _.then=="function")return se($,bo(_),K);if(_.$$typeof===le)return se($,xo($,_),K);jo($,_)}return null}function H($,_,K,ne){var Se=_!==null?_.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Se!==null?null:N($,_,""+K,ne);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case W:return K.key===Se?D($,_,K,ne):null;case I:return K.key===Se?G($,_,K,ne):null;case ue:return K=Js(K),H($,_,K,ne)}if(xe(K)||re(K))return Se!==null?null:P($,_,K,ne,null);if(typeof K.then=="function")return H($,_,bo(K),ne);if(K.$$typeof===le)return H($,_,xo($,K),ne);jo($,K)}return null}function Z($,_,K,ne,Se){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return $=$.get(K)||null,N(_,$,""+ne,Se);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case W:return $=$.get(ne.key===null?K:ne.key)||null,D(_,$,ne,Se);case I:return $=$.get(ne.key===null?K:ne.key)||null,G(_,$,ne,Se);case ue:return ne=Js(ne),Z($,_,K,ne,Se)}if(xe(ne)||re(ne))return $=$.get(K)||null,P(_,$,ne,Se,null);if(typeof ne.then=="function")return Z($,_,K,bo(ne),Se);if(ne.$$typeof===le)return Z($,_,K,xo(_,ne),Se);jo(_,ne)}return null}function pe($,_,K,ne){for(var Se=null,Ve=null,ze=_,Ae=_=0,Lt=null;ze!==null&&Ae<K.length;Ae++){ze.index>Ae?(Lt=ze,ze=null):Lt=ze.sibling;var Ie=H($,ze,K[Ae],ne);if(Ie===null){ze===null&&(ze=Lt);break}e&&ze&&Ie.alternate===null&&t($,ze),_=u(Ie,_,Ae),Ve===null?Se=Ie:Ve.sibling=Ie,Ve=Ie,ze=Lt}if(Ae===K.length)return s($,ze),Be&&Ya($,Ae),Se;if(ze===null){for(;Ae<K.length;Ae++)ze=se($,K[Ae],ne),ze!==null&&(_=u(ze,_,Ae),Ve===null?Se=ze:Ve.sibling=ze,Ve=ze);return Be&&Ya($,Ae),Se}for(ze=l(ze);Ae<K.length;Ae++)Lt=Z(ze,$,Ae,K[Ae],ne),Lt!==null&&(e&&(Ie=Lt.alternate,Ie!==null&&ze.delete(Ie.key===null?Ae:Ie.key)),_=u(Lt,_,Ae),Ve===null?Se=Lt:Ve.sibling=Lt,Ve=Lt);return e&&ze.forEach(function(Rs){return t($,Rs)}),Be&&Ya($,Ae),Se}function Te($,_,K,ne){if(K==null)throw Error(c(151));for(var Se=null,Ve=null,ze=_,Ae=_=0,Lt=null,Ie=K.next();ze!==null&&!Ie.done;Ae++,Ie=K.next()){ze.index>Ae?(Lt=ze,ze=null):Lt=ze.sibling;var Rs=H($,ze,Ie.value,ne);if(Rs===null){ze===null&&(ze=Lt);break}e&&ze&&Rs.alternate===null&&t($,ze),_=u(Rs,_,Ae),Ve===null?Se=Rs:Ve.sibling=Rs,Ve=Rs,ze=Lt}if(Ie.done)return s($,ze),Be&&Ya($,Ae),Se;if(ze===null){for(;!Ie.done;Ae++,Ie=K.next())Ie=se($,Ie.value,ne),Ie!==null&&(_=u(Ie,_,Ae),Ve===null?Se=Ie:Ve.sibling=Ie,Ve=Ie);return Be&&Ya($,Ae),Se}for(ze=l(ze);!Ie.done;Ae++,Ie=K.next())Ie=Z(ze,$,Ae,Ie.value,ne),Ie!==null&&(e&&(Lt=Ie.alternate,Lt!==null&&ze.delete(Lt.key===null?Ae:Lt.key)),_=u(Ie,_,Ae),Ve===null?Se=Ie:Ve.sibling=Ie,Ve=Ie);return e&&ze.forEach(function(ON){return t($,ON)}),Be&&Ya($,Ae),Se}function Le($,_,K,ne){if(typeof K=="object"&&K!==null&&K.type===te&&K.key===null&&K.props.ref===void 0&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case W:e:{for(var Se=K.key;_!==null;){if(_.key===Se){if(Se=K.type,Se===te){if(_.tag===7){s($,_.sibling),ne=o(_,K.props.children),us(ne,K),ne.return=$,$=ne;break e}}else if(_.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===ue&&Js(Se)===_.type){s($,_.sibling),ne=o(_,K.props),us(ne,K),ne.return=$,$=ne;break e}s($,_);break}else t($,_);_=_.sibling}K.type===te?(ne=Xs(K.props.children,$.mode,ne,K.key),us(ne,K),ne.return=$,$=ne):(ne=co(K.type,K.key,K.props,null,$.mode,ne),us(ne,K),ne.return=$,$=ne)}return y($);case I:e:{for(Se=K.key;_!==null;){if(_.key===Se)if(_.tag===4&&_.stateNode.containerInfo===K.containerInfo&&_.stateNode.implementation===K.implementation){s($,_.sibling),ne=o(_,K.children||[]),ne.return=$,$=ne;break e}else{s($,_);break}else t($,_);_=_.sibling}ne=Yu(K,$.mode,ne),ne.return=$,$=ne}return y($);case ue:return K=Js(K),Le($,_,K,ne)}if(xe(K))return pe($,_,K,ne);if(re(K)){if(Se=re(K),typeof Se!="function")throw Error(c(150));return K=Se.call(K),Te($,_,K,ne)}if(typeof K.then=="function")return Le($,_,bo(K),ne);if(K.$$typeof===le)return Le($,_,xo($,K),ne);jo($,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,_!==null&&_.tag===6?(s($,_.sibling),ne=o(_,K),ne.return=$,$=ne):(s($,_),ne=Gu(K,$.mode,ne),ne.return=$,$=ne),y($)):s($,_)}return function($,_,K,ne){try{Gi=0;var Se=Le($,_,K,ne);return Bl=null,Se}catch(ze){if(ze===Hl||ze===yo)throw ze;var Ve=Sn(29,ze,null,$.mode);return Ve.lanes=ne,Ve.return=$,Ve}finally{}}}var el=Np(!0),wp=Np(!1),ds=!1;function Wu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ed(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hs(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(We&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,t=oo(e),ip(e,null,s),t}return ro(e,l,t,s),oo(e)}function Yi(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,um(e,s)}}function td(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var o=null,u=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};u===null?o=u=y:u=u.next=y,s=s.next}while(s!==null);u===null?o=u=t:u=u.next=t}else o=u=t;s={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var nd=!1;function Vi(){if(nd){var e=Ul;if(e!==null)throw e}}function Xi(e,t,s,l){nd=!1;var o=e.updateQueue;ds=!1;var u=o.firstBaseUpdate,y=o.lastBaseUpdate,N=o.shared.pending;if(N!==null){o.shared.pending=null;var D=N,G=D.next;D.next=null,y===null?u=G:y.next=G,y=D;var P=e.alternate;P!==null&&(P=P.updateQueue,N=P.lastBaseUpdate,N!==y&&(N===null?P.firstBaseUpdate=G:N.next=G,P.lastBaseUpdate=D))}if(u!==null){var se=o.baseState;y=0,P=G=D=null,N=u;do{var H=N.lane&-536870913,Z=H!==N.lane;if(Z?(Ye&H)===H:(l&H)===H){H!==0&&H===Is&&(nd=!0),P!==null&&(P=P.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var pe=e,Te=N;H=t;var Le=s;switch(Te.tag){case 1:if(pe=Te.payload,typeof pe=="function"){se=pe.call(Le,se,H);break e}se=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Te.payload,H=typeof pe=="function"?pe.call(Le,se,H):pe,H==null)break e;se=A({},se,H);break e;case 2:ds=!0}}H=N.callback,H!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=o.callbacks,Z===null?o.callbacks=[H]:Z.push(H))}else Z={lane:H,tag:N.tag,payload:N.payload,callback:N.callback,next:null},P===null?(G=P=Z,D=se):P=P.next=Z,y|=H;if(N=N.next,N===null){if(N=o.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,o.lastBaseUpdate=Z,o.shared.pending=null}}while(!0);P===null&&(D=se),o.baseState=D,o.firstBaseUpdate=G,o.lastBaseUpdate=P,u===null&&(o.shared.lanes=0),bs|=y,e.lanes=y,e.memoizedState=se}}function Sp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function kp(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Sp(s[e],t)}var ms=ce(null),No=ce(0);function Tp(e,t){e=Ia,we(No,e),we(ms,t),Ia=e|t.baseLanes}function ad(){we(No,Ia),we(ms,ms.current)}function sd(){Ia=No.current,De(ms),De(No)}var Jt=ce(null),sn=null;function ps(e){var t=e.alternate;we(Wt,Wt.current&1),we(Jt,e),sn===null&&(t===null||ms.current!==null||t.memoizedState!==null)&&(sn=e)}function ld(e){we(Wt,Wt.current),we(Jt,e),sn===null&&(sn=e)}function Cp(e){e.tag===22?(we(Wt,Wt.current),we(Jt,e),sn===null&&(sn=e)):xs()}function xs(){we(Wt,Wt.current),we(Jt,Jt.current)}function Mn(e){De(Jt),sn===e&&(sn=null),De(Wt)}var Wt=ce(0);function Ki(e,t){we(Jt,Jt.current),we(Wt,t)}function id(e){De(Wt),De(Jt),sn===e&&(sn=null)}function wo(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Rf(s)||zf(s)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ka=0,_e=null,ot=null,Mt=null,So=!1,$l=!1,tl=!1,ko=0,Zi=0,ql=null,e1=0;function wt(){throw Error(c(321))}function rd(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!On(e[s],t[s]))return!1;return!0}function od(e,t,s,l,o,u){return Ka=u,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?ux:dx,tl=!1,u=s(l,o),tl=!1,$l&&(u=Rp(t,s,l,o)),Ep(e),u}function Ep(e){me.H=Ao;var t=ot!==null&&ot.next!==null;if(Ka=0,Mt=ot=_e=null,So=!1,Zi=0,ql=null,t)throw Error(c(300));e===null||_t||(e=e.dependencies,e!==null&&po(e)&&(_t=!0))}function Rp(e,t,s,l){_e=e;var o=0;do{if($l&&(ql=null),Zi=0,$l=!1,25<=o)throw Error(c(301));if(o+=1,Mt=ot=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}me.H=o1,u=t(s,l)}while($l);return u}function t1(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Qi(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(_e.flags|=1024),t}function cd(){var e=ko!==0;return ko=0,e}function ud(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function dd(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}Ka=0,Mt=ot=_e=null,$l=!1,Zi=ko=0,ql=null}function dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function zt(){if(ot===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Mt===null?_e.memoizedState:Mt.next;if(t!==null)Mt=t,ot=e;else{if(e===null)throw _e.alternate===null?Error(c(467)):Error(c(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qi(e){var t=Zi;return Zi+=1,ql===null&&(ql=[]),e=vp(ql,e,t),t=_e,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?ux:dx),e}function Co(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qi(e);if(e.$$typeof===q)return;if(e.$$typeof===le)return Ft(e)}throw Error(c(438,String(e)))}function fd(e){var t=null,s=_e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=_e.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=To(),_e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=Ee;return t.index++,s}function Za(e,t){return typeof t=="function"?t(e):t}function Eo(e){var t=zt();return hd(t,ot,e)}function hd(e,t,s){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=s;var o=e.baseQueue,u=l.pending;if(u!==null){if(o!==null){var y=o.next;o.next=u.next,u.next=y}t.baseQueue=o=u,l.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var N=y=null,D=null,G=t,P=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(Ye&se)===se:(Ka&se)===se){var H=G.revertLane;if(H===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),se===Is&&(P=!0);else if((Ka&H)===H){G=G.next,H===Is&&(P=!0);continue}else se={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},D===null?(N=D=se,y=u):D=D.next=se,_e.lanes|=H,bs|=H;se=G.action,tl&&s(u,se),u=G.hasEagerState?G.eagerState:s(u,se)}else H={lane:se,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},D===null?(N=D=H,y=u):D=D.next=H,_e.lanes|=se,bs|=se;G=G.next}while(G!==null&&G!==t);if(D===null?y=u:D.next=N,!On(u,e.memoizedState)&&(_t=!0,P&&(s=Ul,s!==null)))throw s;e.memoizedState=u,e.baseState=y,e.baseQueue=D,l.lastRenderedState=u}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function md(e){var t=zt(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var l=s.dispatch,o=s.pending,u=t.memoizedState;if(o!==null){s.pending=null;var y=o=o.next;do u=e(u,y.action),y=y.next;while(y!==o);On(u,t.memoizedState)||(_t=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),s.lastRenderedState=u}return[u,l]}function zp(e,t,s){var l=_e,o=zt(),u=Be;if(u){if(s===void 0)throw Error(c(407));s=s()}else s=t();var y=!On((ot||o).memoizedState,s);if(y&&(o.memoizedState=s,_t=!0),o=o.queue,gd(Op.bind(null,l,o,e),[e]),e=o.getSnapshot!==t||y||Mt!==null&&(Mt.memoizedState.tag&1)!==0,Gl(e?9:8,{destroy:void 0},Ap.bind(null,l,o,s,t),null),e){if(l.flags|=2048,dt===null)throw Error(c(349));u||(Ka&127)!==0||Dp(l,t,s)}return s}function Dp(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_e.updateQueue,t===null?(t=To(),_e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Ap(e,t,s,l){t.value=s,t.getSnapshot=l,Mp(t)&&_p(e)}function Op(e,t,s){return s(function(){Mp(t)&&_p(e)})}function Mp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!On(e,s)}catch{return!0}}function _p(e){var t=Vs(e,2);t!==null&&En(t,e,2)}function pd(e){var t=dn();if(typeof e=="function"){var s=e;if(e=s(),tl){ft(!0);try{s()}finally{ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:e},t}function Lp(e,t,s,l){return e.baseState=s,hd(e,ot,typeof l=="function"?l:Za)}function n1(e,t,s,l,o){if(Do(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){u.listeners.push(y)}};me.T!==null?s(!0):u.isTransition=!1,l(u),s=t.pending,s===null?(u.next=t.pending=u,Up(t,u)):(u.next=s.next,t.pending=s.next=u)}}function Up(e,t){var s=t.action,l=t.payload,o=e.state;if(t.isTransition){var u=me.T,y={};y.types=u!==null?u.types:null,me.T=y;try{var N=s(o,l),D=me.S;D!==null&&D(y,N),Hp(e,t,N)}catch(G){xd(e,t,G)}finally{u!==null&&y.types!==null&&(u.types=y.types),me.T=u}}else try{u=s(o,l),Hp(e,t,u)}catch(G){xd(e,t,G)}}function Hp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Bp(e,t,l)},function(l){return xd(e,t,l)}):Bp(e,t,s)}function Bp(e,t,s){t.status="fulfilled",t.value=s,$p(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Up(e,s)))}function xd(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,$p(t),t=t.next;while(t!==l)}e.action=null}function $p(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qp(e,t){return t}function Gp(e,t){if(Be){var s=dt.formState;if(s!==null){e:{var l=_e;if(Be){if(ht){t:{for(var o=ht,u=Qn;o.nodeType!==8;){if(!u){o=null;break t}if(o=In(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){ht=In(o.nextSibling),l=o.data==="F!";break e}}os(l)}l=!1}l&&(t=s[0])}}return s=dn(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:t},s.queue=l,s=rx.bind(null,_e,l),l.dispatch=s,l=pd(!1),u=Nd.bind(null,_e,!1,l.queue),l=dn(),o={state:t,dispatch:null,action:e,pending:null},l.queue=o,s=n1.bind(null,_e,o,u,s),o.dispatch=s,l.memoizedState=e,[t,s,!1]}function Yp(e){var t=zt();return Vp(t,ot,e)}function Vp(e,t,s){if(t=hd(e,t,qp)[0],e=Eo(Za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Qi(t)}catch(y){throw y===Hl?yo:y}else l=t;t=zt();var o=t.queue,u=o.dispatch;return s!==t.memoizedState&&(_e.flags|=2048,Gl(9,{destroy:void 0},a1.bind(null,o,s),null)),[l,u,e]}function a1(e,t){e.action=t}function Xp(e){var t=zt(),s=ot;if(s!==null)return Vp(t,s,e);zt(),t=t.memoizedState,s=zt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function Gl(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=_e.updateQueue,t===null&&(t=To(),_e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Kp(){return zt().memoizedState}function Ro(e,t,s,l){var o=dn();_e.flags|=e,o.memoizedState=Gl(1|t,{destroy:void 0},s,l===void 0?null:l)}function zo(e,t,s,l){var o=zt();l=l===void 0?null:l;var u=o.memoizedState.inst;ot!==null&&l!==null&&rd(l,ot.memoizedState.deps)?o.memoizedState=Gl(t,u,s,l):(_e.flags|=e,o.memoizedState=Gl(1|t,u,s,l))}function Zp(e,t){Ro(8390656,8,e,t)}function gd(e,t){zo(2048,8,e,t)}function s1(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=To(),_e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Qp(e){var t=zt().memoizedState;return s1({ref:t,nextImpl:e}),function(){if((We&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Pp(e,t){return zo(4,2,e,t)}function Ip(e,t){return zo(4,4,e,t)}function Fp(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jp(e,t,s){s=s!=null?s.concat([e]):null,zo(4,4,Fp.bind(null,t,e),s)}function yd(){}function Wp(e,t){var s=zt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&rd(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function ex(e,t){var s=zt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&rd(t,l[1]))return l[0];if(l=e(),tl){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l}function vd(e,t,s){return s===void 0||(Ka&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=ug(),_e.lanes|=e,bs|=e,s)}function tx(e,t,s,l){return On(s,t)?s:ms.current!==null?(e=vd(e,s,l),On(e,t)||(_t=!0),e):(Ka&106)===0||(Ka&1073741824)!==0&&(Ye&261930)===0?(_t=!0,e.memoizedState=s):(e=ug(),_e.lanes|=e,bs|=e,t)}function nx(e,t,s,l,o){var u=ie.p;ie.p=u!==0&&8>u?u:8;var y=me.T,N={};N.types=y!==null?y.types:null,me.T=N,Nd(e,!1,t,s);try{var D=o(),G=me.S;if(G!==null&&G(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var P=Wj(D,l);Pi(e,t,P,Hn(e))}else Pi(e,t,l,Hn(e))}catch(se){Pi(e,t,{then:function(){},status:"rejected",reason:se},Hn())}finally{ie.p=u,y!==null&&N.types!==null&&(y.types=N.types),me.T=y}}function l1(){}function bd(e,t,s,l){if(e.tag!==5)throw Error(c(476));var o=ax(e).queue;nx(e,o,t,Pe,s===null?l1:function(){return sx(e),s(l)})}function ax(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Pe,baseState:Pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:Pe},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sx(e){var t=ax(e);t.next===null&&(t=e.alternate.memoizedState),Pi(e,t.next.queue,{},Hn())}function jd(){return Ft(ri)}function lx(){return zt().memoizedState}function ix(){return zt().memoizedState}function i1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Hn();e=fs(s);var l=hs(t,e,s);l!==null&&(En(l,t,s),Yi(l,t,s)),t={cache:Pu()},e.payload=t;return}t=t.return}}function r1(e,t,s){var l=Hn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Do(e)?ox(t,s):(s=$u(e,t,s,l),s!==null&&(En(s,e,l),cx(s,t,l)))}function rx(e,t,s){var l=Hn();Pi(e,t,s,l)}function Pi(e,t,s,l){var o={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Do(e))ox(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var y=t.lastRenderedState,N=u(y,s);if(o.hasEagerState=!0,o.eagerState=N,On(N,y))return ro(e,t,o,0),dt===null&&io(),!1}catch{}finally{}if(s=$u(e,t,o,l),s!==null)return En(s,e,l),cx(s,t,l),!0}return!1}function Nd(e,t,s,l){if(l={lane:2,revertLane:hf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Do(e)){if(t)throw Error(c(479))}else t=$u(e,s,l,2),t!==null&&En(t,e,2)}function Do(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function ox(e,t){$l=So=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function cx(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,um(e,s)}}var Ao={readContext:Ft,use:Co,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},ux={readContext:Ft,use:Co,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:Zp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ro(4194308,4,Fp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){Ro(4,2,e,t)},useMemo:function(e,t){var s=dn();t=t===void 0?null:t;var l=e();if(tl){ft(!0);try{e()}finally{ft(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=dn();if(s!==void 0){var o=s(t);if(tl){ft(!0);try{s(t)}finally{ft(!1)}}}else o=t;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=r1.bind(null,_e,e),[l.memoizedState,e]},useRef:function(e){var t=dn();return e={current:e},t.memoizedState=e},useState:function(e){e=pd(e);var t=e.queue,s=rx.bind(null,_e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:yd,useDeferredValue:function(e,t){var s=dn();return vd(s,e,t)},useTransition:function(){var e=pd(!1);return e=nx.bind(null,_e,e.queue,!0,!1),dn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=_e,o=dn();if(Be){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),dt===null)throw Error(c(349));(Ye&127)!==0||Dp(l,t,s)}o.memoizedState=s;var u={value:s,getSnapshot:t};return o.queue=u,Zp(Op.bind(null,l,u,e),[e]),l.flags|=2048,Gl(9,{destroy:void 0},Ap.bind(null,l,u,s,t),null),s},useId:function(){var e=dn(),t=dt.identifierPrefix;if(Be){var s=Ta,l=ka;s=(l&~(1<<32-Nt(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=ko++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=e1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jd,useFormState:Gp,useActionState:Gp,useOptimistic:function(e){var t=dn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Nd.bind(null,_e,!0,s),s.dispatch=t,[e,t]},useMemoCache:fd,useCacheRefresh:function(){return dn().memoizedState=i1.bind(null,_e)},useEffectEvent:function(e){var t=dn(),s={impl:e};return t.memoizedState=s,function(){if((We&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},dx={readContext:Ft,use:Co,useCallback:Wp,useContext:Ft,useEffect:gd,useImperativeHandle:Jp,useInsertionEffect:Pp,useLayoutEffect:Ip,useMemo:ex,useReducer:Eo,useRef:Kp,useState:function(){return Eo(Za)},useDebugValue:yd,useDeferredValue:function(e,t){var s=zt();return tx(s,ot.memoizedState,e,t)},useTransition:function(){var e=Eo(Za)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:zp,useId:lx,useHostTransitionStatus:jd,useFormState:Yp,useActionState:Yp,useOptimistic:function(e,t){var s=zt();return Lp(s,ot,e,t)},useMemoCache:fd,useCacheRefresh:ix,useEffectEvent:Qp},o1={readContext:Ft,use:Co,useCallback:Wp,useContext:Ft,useEffect:gd,useImperativeHandle:Jp,useInsertionEffect:Pp,useLayoutEffect:Ip,useMemo:ex,useReducer:md,useRef:Kp,useState:function(){return md(Za)},useDebugValue:yd,useDeferredValue:function(e,t){var s=zt();return ot===null?vd(s,e,t):tx(s,ot.memoizedState,e,t)},useTransition:function(){var e=md(Za)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:zp,useId:lx,useHostTransitionStatus:jd,useFormState:Xp,useActionState:Xp,useOptimistic:function(e,t){var s=zt();return ot!==null?Lp(s,ot,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:fd,useCacheRefresh:ix,useEffectEvent:Qp};function wd(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:A({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Sd={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=Hn(),o=fs(l);o.payload=t,s!=null&&(o.callback=s),t=hs(e,o,l),t!==null&&(En(t,e,l),Yi(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=Hn(),o=fs(l);o.tag=1,o.payload=t,s!=null&&(o.callback=s),t=hs(e,o,l),t!==null&&(En(t,e,l),Yi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Hn(),l=fs(s);l.tag=2,t!=null&&(l.callback=t),t=hs(e,l,s),t!==null&&(En(t,e,s),Yi(t,e,s))}};function fx(e,t,s,l,o,u,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,y):t.prototype&&t.prototype.isPureReactComponent?!_i(s,l)||!_i(o,u):!0}function hx(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Sd.enqueueReplaceState(t,t.state,null)}function nl(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=A({},s));for(var o in e)s[o]===void 0&&(s[o]=e[o])}return s}function mx(e){lo(e)}function px(e){console.error(e)}function xx(e){lo(e)}function Oo(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function gx(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function kd(e,t,s){return s=fs(s),s.tag=3,s.payload={element:null},s.callback=function(){Oo(e,t)},s}function yx(e){return e=fs(e),e.tag=3,e}function vx(e,t,s,l){var o=s.type.getDerivedStateFromError;if(typeof o=="function"){var u=l.value;e.payload=function(){return o(u)},e.callback=function(){gx(t,s,l)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){gx(t,s,l),typeof o!="function"&&(js===null?js=new Set([this]):js.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})})}function c1(e,t,s,l,o){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&Qs(t,s,o,!0),s=Jt.current,s!==null){switch(s.tag){case 31:case 13:case 19:return sn===null?ec():s.alternate===null&&St===0&&(St=3),s.flags&=-257,s.flags|=65536,s.lanes=o,l===vo?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),uf(e,l,o)),!1;case 22:return s.flags|=65536,l===vo?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),uf(e,l,o)),!1}throw Error(c(435,s.tag))}return uf(e,l,o),ec(),!1}if(Be)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,l!==Xu&&(e=Error(c(422),{cause:l}),Hi(Xn(e,s)))):(l!==Xu&&(t=Error(c(423),{cause:l}),Hi(Xn(t,s))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=Xn(l,s),o=kd(e.stateNode,l,o),td(e,o),St!==4&&(St=2)),!1;var u=Error(c(520),{cause:l});if(u=Xn(u,s),ar===null?ar=[u]:ar.push(u),St!==4&&(St=2),t===null)return!0;l=Xn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=o&-o,s.lanes|=e,e=kd(s.stateNode,l,e),td(s,e),!1;case 1:if(t=s.type,u=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(js===null||!js.has(u))))return s.flags|=65536,o&=-o,s.lanes|=o,o=yx(o),vx(o,e,s,l),td(s,o),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var Td=Error(c(461)),_t=!1;function Ht(e,t,s,l){t.child=e===null?wp(t,null,s,l):el(t,e.child,s,l)}function bx(e,t,s,l,o){s=s.render;var u=t.ref;if("ref"in l){var y={};for(var N in l)N!=="ref"&&(y[N]=l[N])}else y=l;return Ps(t),l=od(e,t,s,y,u,o),N=cd(),e!==null&&!_t?(ud(e,t,o),Qa(e,t,o)):(Be&&N&&fo(t),t.flags|=1,Ht(e,t,l,o),t.child)}function jx(e,t,s,l,o){if(e===null){var u=s.type;return typeof u=="function"&&!qu(u)&&u.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=u,Nx(e,t,u,l,o)):(e=co(s.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Md(e,o)){var y=u.memoizedProps;if(s=s.compare,s=s!==null?s:_i,s(y,l)&&e.ref===t.ref)return Qa(e,t,o)}return t.flags|=1,e=Ga(u,l),e.ref=t.ref,e.return=t,t.child=e}function Nx(e,t,s,l,o){if(e!==null){var u=e.memoizedProps;if(_i(u,l)&&e.ref===t.ref)if(_t=!1,t.pendingProps=l=u,Md(e,o))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Qa(e,t,o)}return Cd(e,t,s,l,o)}function wx(e,t,s,l){var o=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|s:s,e!==null){for(l=t.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~u}else l=0,t.child=null;return Sx(e,t,u,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&go(t,u!==null?u.cachePool:null),u!==null?Tp(t,u):ad(),Cp(t);else return l=t.lanes=536870912,Sx(e,t,u!==null?u.baseLanes|s:s,s,l)}else u!==null?(go(t,u.cachePool),Tp(t,u),xs(),t.memoizedState=null):(e!==null&&go(t,null),ad(),xs());return Ht(e,t,o,s),t.child}function Ii(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sx(e,t,s,l,o){var u=Fu();return u=u===null?null:{parent:Ot._currentValue,pool:u},t.memoizedState={baseLanes:s,cachePool:u},e!==null&&go(t,null),ad(),Cp(t),e!==null&&Qs(e,t,l,!0),t.childLanes=o,null}function Mo(e,t){return t=_o({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function kx(e,t,s){return el(t,e.child,null,s),e=Mo(t,t.pendingProps),e.flags|=2,Mn(t),t.memoizedState=null,e}function u1(e,t,s){var l=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(l.mode==="hidden")return e=Mo(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ii(null,e);if(ld(t),(e=ht)?(e=Fg(e,Qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:is!==null?{id:ka,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},s=op(e),s.return=t,t.child=s,Vt=t,ht=null)):e=null,e===null)throw os(t);return t.lanes=536870912,null}return Mo(t,l)}var u=e.memoizedState;if(u!==null){var y=u.dehydrated;if(ld(t),o)if(t.flags&256)t.flags&=-257,t=kx(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(_t||Qs(e,t,s,!1),o=(s&e.childLanes)!==0,_t||o){if(ms.current===null){if(l=dt,l!==null&&(y=dm(l,s),y!==0&&y!==u.retryLane))throw u.retryLane=y,Vs(e,y),En(l,e,y),Td;ec()}t=kx(e,t,s)}else e=u.treeContext,ht=In(y.nextSibling),Vt=t,Be=!0,rs=null,Qn=!1,e!==null&&dp(t,e),t=Mo(t,l),t.flags|=134221824;return t}return e=Ga(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yl(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Cd(e,t,s,l,o){return Ps(t),s=od(e,t,s,l,void 0,o),l=cd(),e!==null&&!_t?(ud(e,t,o),Qa(e,t,o)):(Be&&l&&fo(t),t.flags|=1,Ht(e,t,s,o),t.child)}function Tx(e,t,s,l,o,u){return Ps(t),t.updateQueue=null,s=Rp(t,l,s,o),Ep(e),l=cd(),e!==null&&!_t?(ud(e,t,u),Qa(e,t,u)):(Be&&l&&fo(t),t.flags|=1,Ht(e,t,s,u),t.child)}function Cx(e,t,s,l,o){if(Ps(t),t.stateNode===null){var u=Ol,y=s.contextType;typeof y=="object"&&y!==null&&(u=Ft(y)),u=new s(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Sd,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},Wu(t),y=s.contextType,u.context=typeof y=="object"&&y!==null?Ft(y):Ol,u.state=t.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(wd(t,s,y,l),u.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(y=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),y!==u.state&&Sd.enqueueReplaceState(u,u.state,null),Xi(t,l,u,o),Vi(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var N=t.memoizedProps,D=nl(s,N);u.props=D;var G=u.context,P=s.contextType;y=Ol,typeof P=="object"&&P!==null&&(y=Ft(P));var se=s.getDerivedStateFromProps;P=typeof se=="function"||typeof u.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,P||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(N||G!==y)&&hx(t,u,l,y),ds=!1;var H=t.memoizedState;u.state=H,Xi(t,l,u,o),Vi(),G=t.memoizedState,N||H!==G||ds?(typeof se=="function"&&(wd(t,s,se,l),G=t.memoizedState),(D=ds||fx(t,s,D,l,H,G,y))?(P||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=G),u.props=l,u.state=G,u.context=y,l=D):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,ed(e,t),y=t.memoizedProps,P=nl(s,y),u.props=P,se=t.pendingProps,H=u.context,G=s.contextType,D=Ol,typeof G=="object"&&G!==null&&(D=Ft(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(y!==se||H!==D)&&hx(t,u,l,D),ds=!1,H=t.memoizedState,u.state=H,Xi(t,l,u,o),Vi();var Z=t.memoizedState;y!==se||H!==Z||ds||e!==null&&e.dependencies!==null&&po(e.dependencies)?(typeof N=="function"&&(wd(t,s,N,l),Z=t.memoizedState),(P=ds||fx(t,s,P,l,H,Z,D)||e!==null&&e.dependencies!==null&&po(e.dependencies))?(G||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,Z,D),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,Z,D)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Z),u.props=l,u.state=Z,u.context=D,l=P):(typeof u.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Yl(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=el(t,e.child,null,o),t.child=el(t,null,s,o)):Ht(e,t,s,o),t.memoizedState=u.state,e=t.child):e=Qa(e,t,o),e}function Ex(e,t,s,l){return Ks(),t.flags|=256,Ht(e,t,s,l),t.child}var Ed={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rd(e){return{baseLanes:e,cachePool:gp()}}function zd(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Un),e}function Rx(e,t,s){var l=t.pendingProps,o=!1,u=(t.flags&128)!==0,y;if((y=u)||(y=e!==null&&e.memoizedState===null?!1:(Wt.current&2)!==0),y&&(o=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(o?ps(t):xs(),(e=ht)?(e=Fg(e,Qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:is!==null?{id:ka,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},s=op(e),s.return=t,t.child=s,Vt=t,ht=null)):e=null,e===null)throw os(t);return zf(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,o?(xs(),o=t.mode,u=_o({mode:"hidden",children:u},o),l=Xs(l,o,s,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=Rd(s),l.childLanes=zd(e,y,s),t.memoizedState=Ed,Ii(null,l)):(ps(t),Dd(t,u))}var N=e.memoizedState;if(N!==null){var D=N.dehydrated;if(D!==null)return d1(e,t,u,y,l,D,N,s)}return o?(xs(),o=l.fallback,u=t.mode,N=e.child,D=N.sibling,l=Ga(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&1206910976,D!==null?o=Ga(D,o):(o=Xs(o,u,s,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Ii(null,l),l=t.child,o=e.child.memoizedState,o===null?o=Rd(s):(u=o.cachePool,u!==null?(N=Ot._currentValue,u=u.parent!==N?{parent:N,pool:N}:u):u=gp(),o={baseLanes:o.baseLanes|s,cachePool:u}),l.memoizedState=o,l.childLanes=zd(e,y,s),t.memoizedState=Ed,Ii(e.child,l)):(ps(t),s=e.child,e=s.sibling,s=Ga(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=s,t.memoizedState=null,s)}function Dd(e,t){return t=_o({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _o(e,t){return e=Sn(22,e,null,t),e.lanes=0,e}function Lo(e,t,s){return el(t,e.child,null,s),e=Dd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function d1(e,t,s,l,o,u,y,N){if(s)return t.flags&256?(ps(t),t.flags&=-257,Lo(e,t,N)):t.memoizedState!==null?(xs(),t.child=e.child,t.flags|=128,null):(xs(),u=o.fallback,y=t.mode,o=_o({mode:"visible",children:o.children},y),u=Xs(u,y,N,null),u.flags|=2,o.return=t,u.return=t,o.sibling=u,t.child=o,el(t,e.child,null,N),o=t.child,o.memoizedState=Rd(N),o.childLanes=zd(e,l,N),t.memoizedState=Ed,Ii(null,o));if(ps(t),zf(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var D=l.dgst;return l=D,l!==""&&(o=Error(c(419)),o.stack="",o.digest=l,Hi({value:o,source:null,stack:null})),Lo(e,t,N)}if(_t||Qs(e,t,N,!1),l=(N&e.childLanes)!==0,_t||l){if(ms.current!==null)return Lo(e,t,N);if(l=dt,l!==null&&(o=dm(l,N),o!==0&&o!==y.retryLane))throw y.retryLane=o,Vs(e,o),En(l,e,o),Td;return Rf(u)||ec(),Lo(e,t,N)}return Rf(u)?(t.flags|=192,t.child=e.child,null):(e=y.treeContext,ht=In(u.nextSibling),Vt=t,Be=!0,rs=null,Qn=!1,e!==null&&dp(t,e),t=Dd(t,o.children),t.flags|=134221824,t)}function zx(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),mo(e.return,t,s)}function Dx(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&wo(s)===null&&(t=e),e=e.sibling}return t}function Uo(e,t,s,l,o,u){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:o,treeForkCount:u}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=l,y.tail=s,y.tailMode=o,y.treeForkCount=u)}function Ad(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function Od(e,t,s){var l=t.pendingProps,o=l.revealOrder,u=l.tail;l=l.children;var y=Wt.current;if(t.flags&128)return Ki(t,y),null;var N=(y&2)!==0;if(N?(y=y&1|2,t.flags|=128):y&=1,Ki(t,y),o==="backwards"&&e!==null?(Ad(e),Ht(e,t,l,s),Ad(e)):Ht(e,t,l,s),l=Be?Ui:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zx(e,s,t);else if(e.tag===19)zx(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"backwards":s=Dx(t.child),s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null,Ad(t)),Uo(t,!0,o,null,u,l);break;case"unstable_legacy-backwards":for(s=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&wo(e)===null){t.child=o;break}e=o.sibling,o.sibling=s,s=o,o=e}Uo(t,!0,s,null,u,l);break;case"together":Uo(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:s=Dx(t.child),s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null),Uo(t,!1,o,s,u,l)}return t.child}function Ax(e,t,s){var l=t.pendingProps;return cs(t,t.type,l.value),Ht(e,t,l.children,s),t.child}function Qa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),bs|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Qs(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,s=Ga(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Ga(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Md(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&po(e)))}function f1(e,t,s){switch(t.tag){case 3:zn(t,t.stateNode.containerInfo),cs(t,Ot,e.memoizedState.cache),Ks();break;case 27:case 5:na(t);break;case 4:zn(t,t.stateNode.containerInfo);break;case 10:cs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ld(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return ps(t),t.flags|=128,null;l=Qs(e,t,s,!1);var o=t.child.childLanes;return l||(s&o)!==0?Rx(e,t,s):(ps(t),e=Qa(e,t,s),e!==null?e.sibling:null)}ps(t);break;case 19:if(t.flags&128)return Od(e,t,s);if(o=(e.flags&128)!==0,l=(s&t.childLanes)!==0,l||(Qs(e,t,s,!1),l=(s&t.childLanes)!==0),o){if(l)return Od(e,t,s);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ki(t,Wt.current),l)break;return null;case 22:return t.lanes=0,wx(e,t,s,t.pendingProps);case 24:cs(t,Ot,e.memoizedState.cache)}return Qa(e,t,s)}function Ox(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Md(e,s)&&(t.flags&128)===0)return _t=!1,f1(e,t,s);_t=(e.flags&131072)!==0}else _t=!1,Be&&(t.flags&1048576)!==0&&up(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Js(t.elementType),t.type=e,typeof e=="function")qu(e)?(l=nl(e,l),t.tag=1,t=Cx(null,t,e,l,s)):(t.tag=0,t=Cd(null,t,e,l,s));else{if(e!=null){var o=e.$$typeof;if(o===Q){t.tag=11,t=bx(null,t,e,l,s);break e}else if(o===ee){t.tag=14,t=jx(null,t,e,l,s);break e}else if(o===le){t.tag=10,t.type=e,t=Ax(null,t,s);break e}}throw t=Re(e)||e,Error(c(306,t,""))}}return t;case 0:return Cd(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,o=nl(l,t.pendingProps),Cx(e,t,l,o,s);case 3:e:{if(zn(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var u=t.memoizedState;o=u.element,ed(e,t),Xi(t,l,null,s);var y=t.memoizedState;if(l=y.cache,cs(t,Ot,l),l!==u.cache&&Qu(t,[Ot],s,!0),Vi(),l=y.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Ex(e,t,l,s);break e}else if(l!==o){o=Xn(Error(c(424)),t),Hi(o),t=Ex(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ht=In(e.firstChild),Vt=t,Be=!0,rs=null,Qn=!0,s=wp(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(Ks(),l===o){t=Qa(e,t,s);break e}Ht(e,t,l,s)}t=t.child}return t;case 26:return Yl(e,t),e===null?(s=sy(t.type,null,t.pendingProps,null))?t.memoizedState=s:Be||(t.stateNode=Ug(t.type,t.pendingProps,xt.current,t)):t.memoizedState=sy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return na(t),e===null&&Be&&(l=t.stateNode=ey(t.type,t.pendingProps,xt.current),Vt=t,Qn=!0,o=ht,Ss(t.type)?(Df=o,ht=In(l.firstChild)):ht=o),Ht(e,t,t.pendingProps.children,s),Yl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((o=l=ht)&&(l=iN(l,t.type,t.pendingProps,Qn),l!==null?(t.stateNode=l,Vt=t,ht=In(l.firstChild),Qn=!1,o=!0):o=!1),o||os(t)),na(t),o=t.type,u=t.pendingProps,y=e!==null?e.memoizedProps:null,l=u.children,Nf(o,u)?l=null:y!==null&&Nf(o,y)&&(t.flags|=32),t.memoizedState!==null&&(o=od(e,t,t1,null,null,s),ri._currentValue=o),Yl(e,t),Ht(e,t,l,s),t.child;case 6:return e===null&&Be&&((e=s=ht)&&(s=rN(s,t.pendingProps,Qn),s!==null?(t.stateNode=s,Vt=t,ht=null,e=!0):e=!1),e||os(t)),null;case 13:return Rx(e,t,s);case 4:return zn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=el(t,null,l,s):Ht(e,t,l,s),t.child;case 11:return bx(e,t,t.type,t.pendingProps,s);case 7:return l=t.pendingProps,Yl(e,t),Ht(e,t,l,s),t.child;case 8:return Ht(e,t,t.pendingProps.children,s),t.child;case 12:return Ht(e,t,t.pendingProps.children,s),t.child;case 10:return Ax(e,t,s);case 9:return o=t.type._context,l=t.pendingProps.children,Ps(t),o=Ft(o),l=l(o),t.flags|=1,Ht(e,t,l,s),t.child;case 14:return jx(e,t,t.type,t.pendingProps,s);case 15:return Nx(e,t,t.type,t.pendingProps,s);case 19:return Od(e,t,s);case 31:return u1(e,t,s);case 22:return wx(e,t,s,t.pendingProps);case 24:return Ps(t),l=Ft(Ot),e===null?(o=Fu(),o===null&&(o=dt,u=Pu(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=s),o=u),t.memoizedState={parent:l,cache:o},Wu(t),cs(t,Ot,o)):((e.lanes&s)!==0&&(ed(e,t),Xi(t,null,null,s),Vi()),o=e.memoizedState,u=t.memoizedState,o.parent!==l?(o={parent:l,cache:l},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),cs(t,Ot,l)):(l=u.cache,cs(t,Ot,l),l!==o.cache&&Qu(t,[Ot],s,!0))),Ht(e,t,t.pendingProps.children,s),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:Be&&fo(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Yl(e,t),Ht(e,t,l.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Pa(e){e.flags|=4}function _d(e,t,s,l,o){var u;if((u=(e.mode&32)!==0)&&(u=s===null?oy(t,l):oy(t,l)&&(l.src!==s.src||l.srcSet!==s.srcSet)),u){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(mg())e.flags|=8192;else throw Ws=vo,Ju}else e.flags&=-16777217}function Mx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!cy(t))if(mg())e.flags|=8192;else throw Ws=vo,Ju}function Ho(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?om():536870912,e.lanes|=t,Ql|=t)}function Fi(e,t){if(!Be)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var o=e.child;o!==null;)s|=o.lanes|o.childLanes,l|=o.subtreeFlags&1206910976,l|=o.flags&1206910976,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)s|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function h1(e,t,s){var l=t.pendingProps;switch(Vu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Xa(Ot),jn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?Pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ku())),mt(t),null;case 26:var o=t.type,u=t.memoizedState;return e===null?(Pa(t),u!==null?(mt(t),Mx(t,u)):(mt(t),_d(t,o,null,l,s))):u?u!==e.memoizedState?(Pa(t),mt(t),Mx(t,u)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Pa(t),mt(t),_d(t,o,e,l,s)),null;case 27:if(J(t),s=xt.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Pa(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return mt(t),t.subtreeFlags&=-33554433,null}e=nt.current,Ll(t)?fp(t):(e=ey(o,l,s),t.stateNode=e,Pa(t))}return mt(t),t.subtreeFlags&=-33554433,null;case 5:if(J(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Pa(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return mt(t),t.subtreeFlags&=-33554433,null}if(u=nt.current,Ll(t))fp(t);else{var y=or(xt.current);switch(u){case 1:u=y.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:u=y.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":u=y.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":u=y.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":u=y.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?y.createElement(o,{is:l.is}):y.createElement(o)}}u[It]=t,u[wn]=l;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)u.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=u;e:switch(tn(u,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Pa(t)}}return mt(t),t.subtreeFlags&=-33554433,_d(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Pa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=xt.current,Ll(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,o=Vt,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[It]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Og(e.nodeValue,s)),e||os(t,!0)}else e=or(e).createTextNode(l),e[It]=t,t.stateNode=e}return mt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ll(t),s!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[It]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else s=Ku(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Mn(t),t):(Mn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ll(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[It]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),o=!1}else o=Ku(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Mn(t),t):(Mn(t),null)}return Mn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==o&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Ho(t,t.updateQueue),mt(t),null);case 4:return jn(),e===null&&gf(t.stateNode.containerInfo),t.flags|=67108864,mt(t),null;case 10:return Xa(t.type),mt(t),null;case 19:if(id(t),l=t.memoizedState,l===null)return mt(t),null;if(o=(t.flags&128)!==0,u=l.rendering,u===null)if(o)Fi(l,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=wo(e),u!==null){for(t.flags|=128,Fi(l,!1),e=u.updateQueue,t.updateQueue=e,Ho(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)rp(s,e),s=s.sibling;return Ki(t,Wt.current&1|2),Be&&Ya(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ke()>Io&&(t.flags|=128,o=!0,Fi(l,!1),t.lanes=4194304)}else{if(!o)if(e=wo(u),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Ho(t,e),Fi(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!Be)return mt(t),null}else 2*Ke()-l.renderingStartTime>Io&&s!==536870912&&(t.flags|=128,o=!0,Fi(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ke(),e.sibling=null,u=Wt.current,u=o?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!s||Be?Ki(t,u):(s=u,we(Jt,t),we(Wt,s),sn===null&&(sn=t)),Be&&Ya(t,l.treeForkCount),e}return mt(t),null;case 22:case 23:return Mn(t),sd(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),s=t.updateQueue,s!==null&&Ho(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&De(Fs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Xa(Ot),mt(t),null;case 25:return null;case 30:return t.flags|=33554432,mt(t),null}throw Error(c(156,t.tag))}function m1(e,t){switch(Vu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xa(Ot),jn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return J(t),null;case 31:if(t.memoizedState!==null){if(Mn(t),t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return id(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return jn(),null;case 10:return Xa(t.type),null;case 22:case 23:return Mn(t),sd(),e!==null&&De(Fs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xa(Ot),null;case 25:return null;default:return null}}function _x(e,t){switch(Vu(t),t.tag){case 3:Xa(Ot),jn();break;case 26:case 27:case 5:J(t);break;case 4:jn();break;case 31:t.memoizedState!==null&&Mn(t);break;case 13:Mn(t);break;case 19:id(t);break;case 10:Xa(t.type);break;case 22:case 23:Mn(t),sd(),e!==null&&De(Fs);break;case 24:Xa(Ot)}}function Ji(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var o=l.next;s=o;do{if((s.tag&e)===e){l=void 0;var u=s.create,y=s.inst;l=u(),y.destroy=l}s=s.next}while(s!==o)}}catch(N){lt(t,t.return,N)}}function gs(e,t,s){try{var l=t.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var u=o.next;l=u;do{if((l.tag&e)===e){var y=l.inst,N=y.destroy;if(N!==void 0){y.destroy=void 0,o=t;var D=s,G=N;try{G()}catch(P){lt(o,D,P)}}}l=l.next}while(l!==u)}}catch(P){lt(t,t.return,P)}}function Lx(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{kp(t,s)}catch(l){lt(e,e.return,l)}}}function Ux(e,t,s){s.props=nl(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){lt(e,t,l)}}function Ca(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var o=e.stateNode,u=$a(e.memoizedProps,o);(o.ref===null||o.ref.name!==u)&&(o.ref=Vg(u)),l=o.ref;break;case 7:if(e.stateNode===null){var y=new Bn(e);x(e.child,!1,sN,y,void 0,void 0),e.stateNode=y}l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(N){lt(e,t,N)}}function en(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(o){lt(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(o){lt(e,t,o)}else s.current=null}function Bo(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)Ig(e.stateNode,t[s])}function Hx(e){for(var t=e.return;t!==null&&(Ud(t)&&Ig(e.stateNode,t.stateNode),!Ld(t));)t=t.return}function Wi(e){for(var t=e.return;t!==null&&(Ud(t)&&lN(e.stateNode,t.stateNode),!Ld(t));)t=t.return}function Ld(e){return e.tag===5||e.tag===3||e.tag===27}function Ud(e){return e&&e.tag===7&&e.stateNode!==null}function Hd(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(o){lt(e,e.return,o)}}function Bd(e,t,s){try{var l=e.stateNode;$1(l,e.type,s,t),l[wn]=t}catch(o){lt(e,e.return,o)}}function Bx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ss(e.type)||e.tag===4}function $d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bx(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&&Ss(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 qd(e,t,s,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(o,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(o),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Sa)),Bo(e,l),Je=!0;else if(o!==4&&(o===27&&(Bo(e,l),l=null,Ss(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(qd(e,t,s,l),e=e.sibling;e!==null;)qd(e,t,s,l),e=e.sibling}function $o(e,t,s,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?s.insertBefore(o,t):s.appendChild(o),Bo(e,l),Je=!0;else if(o!==4&&(o===27&&(Bo(e,l),l=null,Ss(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for($o(e,t,s,l),e=e.sibling;e!==null;)$o(e,t,s,l),e=e.sibling}function $x(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);tn(t,l,s),t[It]=e,t[wn]=s}catch(u){lt(e,e.return,u)}}var qo=!1,_n=null;function qx(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(qo=!0)}var Ea=null;function Gx(){var e=Ea;return Ea=null,e}var kn=0;function Vl(e,t,s,l,o){return kn=0,Yx(e.child,t,s,l,o)}function Yx(e,t,s,l,o){for(var u=!1;e!==null;){if(e.tag===5){var y=e.stateNode;if(l!==null){var N=kf(y);l.push(N),N.view&&(u=!0)}else u||kf(y).view&&(u=!0);qo=!0,Gg(y,kn===0?t:t+"_"+kn,s),kn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&o||Yx(e.child,t,s,l,o)&&(u=!0));e=e.sibling}return u}function Ra(e,t){for(;e!==null;)e.tag===5?Yg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ra(e.child,t)),e=e.sibling}function Go(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Go(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(c(544));var s=t.name;t=qa(t.default,t.share),t!=="none"&&(Vl(e,s,t,null,!1)||Ra(e.child,!1))}e=e.sibling}}function Gd(e,t){if(e.tag===30){var s=e.stateNode,l=e.memoizedProps,o=$a(l,s),u=qa(l.default,s.paired?l.share:l.enter);u!=="none"?Vl(e,o,u,null,!1)?(Go(e),s.paired||t||Jl(e,l.onEnter)):Ra(e.child,!1):Go(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Gd(e,t),e=e.sibling;else Go(e)}function Yd(e){if(_n!==null&&_n.size!==0){var t=_n;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var s=e.memoizedProps,l=s.name;if(l!=null&&l!=="auto"){var o=t.get(l);if(o!==void 0){var u=qa(s.default,s.share);if(u!=="none"&&(Vl(e,l,u,null,!1)?(u=e.stateNode,o.paired=u,u.paired=o,Jl(e,s.onShare)):Ra(e.child,!1)),t.delete(l),t.size===0)break}}}Yd(e)}e=e.sibling}}}function Vd(e){if(e.tag===30){var t=e.memoizedProps,s=$a(t,e.stateNode),l=_n!==null?_n.get(s):void 0,o=qa(t.default,l!==void 0?t.share:t.exit);o!=="none"&&(Vl(e,s,o,null,!1)?l!==void 0?(o=e.stateNode,l.paired=o,o.paired=l,_n.delete(s),Jl(e,t.onShare)):Jl(e,t.onExit):Ra(e.child,!1)),_n!==null&&Yd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Vd(e),e=e.sibling;else _n!==null&&Yd(e)}function Vx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=$a(t,e.stateNode);t=qa(t.default,t.update),e.flags&=-5,t!=="none"&&Vl(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Vx(e);e=e.sibling}}function Xd(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ra(e.child,!1))}Xd(e)}e=e.sibling}}function Yo(e){if(e.tag===30)e.stateNode.paired=null,Ra(e.child,!1),Xd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Yo(e),e=e.sibling;else Xd(e)}function Xx(e){for(e=e.child;e!==null;)e.tag===30?Ra(e.child,!1):(e.subtreeFlags&33554432)!==0&&Xx(e),e=e.sibling}function Kd(e,t,s,l,o,u,y){for(var N=!1;t!==null;){if(t.tag===5){var D=t.stateNode;if(u!==null&&kn<u.length){var G=u[kn],P=kf(D);(G.view||P.view)&&(N=!0);var se;if(se=(e.flags&4)===0)if(P.clip)se=!0;else{se=G.rect;var H=P.rect;se=se.y!==H.y||se.x!==H.x||se.height!==H.height||se.width!==H.width}se&&(e.flags|=4),P.abs?P=!G.abs:(G=G.rect,P=P.rect,P=G.height!==P.height||G.width!==P.width),P&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Gg(D,kn===0?s:s+"_"+kn,o),N&&(e.flags&4)!==0||(Ea===null&&(Ea=[]),Ea.push(D,kn===0?l:l+"_"+kn,t.memoizedProps)),kn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&y?e.flags|=t.flags&32:Kd(e,t.child,s,l,o,u,y)&&(N=!0));t=t.sibling}return N}function Kx(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,l=e.stateNode,o=$a(s,l),u=qa(s.default,s.update),y;y=e.memoizedState,e.memoizedState=null,l=e;var N=e.child;kn=0,o=Kd(l,N,o,o,u,y,!1),(e.flags&4)!==0&&o&&Jl(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Kx(e);e=e.sibling}}var Xt=!1,at=!1,za=!1,Zd=!1,Zx=typeof WeakSet=="function"?WeakSet:Set,Kt=null,Da=!1,er=!1,Vo=!1,Qd=!1;function p1(e,t,s){if(e=e.containerInfo,bf=oi,e=Fm(e),Mu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var u=o.anchorOffset,y=o.focusNode;o=o.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var N=0,D=-1,G=-1,P=0,se=0,H=e,Z=null;t:for(;;){for(var pe;H!==l||u!==0&&H.nodeType!==3||(D=N+u),H!==y||o!==0&&H.nodeType!==3||(G=N+o),H.nodeType===3&&(N+=H.nodeValue.length),(pe=H.firstChild)!==null;)Z=H,H=pe;for(;;){if(H===e)break t;if(Z===l&&++P===u&&(D=N),Z===y&&++se===o&&(G=N),(pe=H.nextSibling)!==null)break;H=Z,Z=H.parentNode}H=pe}l=D===-1||G===-1?null:{start:D,end:G}}else l=null}l=l||{start:0,end:0}}else l=null;for(jf={focusedElem:e,selectionRange:l},oi=!1,s=(s&335544064)===s,Kt=t,t=s?9270:1024;Kt!==null;){if(e=Kt,s&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)s&&Vd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)s&&qx(e),Xo(s);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&s&&Vd(l),Xo(s);continue}else if(l!==null&&l.memoizedState!==null){s&&qx(e),Xo(s);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Kt=l):(s&&Vx(e),Xo(s))}}_n=null}function Xo(e){for(;Kt!==null;){var t=Kt,s=e,l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((o&1024)!==0&&l!==null){s=void 0,o=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var y=nl(t.type,o);s=u.getSnapshotBeforeUpdate(y,l),u.__reactInternalSnapshotBeforeUpdate=s}catch(N){lt(t,t.return,N)}}break;case 3:if((o&1024)!==0){if(l=t.stateNode.containerInfo,s=l.nodeType,s===9)Ef(l);else if(s===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Ef(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&l!==null&&(s=$a(l.memoizedProps,l.stateNode),o=t.memoizedProps,o=qa(o.default,o.update),o!=="none"&&Vl(l,s,o,l.memoizedState=[],!0));break;default:if((o&1024)!==0)throw Error(c(163))}if(l=t.sibling,l!==null){l.return=t.return,Kt=l;break}Kt=t.return}}function Qx(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Aa(e,s),l&4&&Ji(5,s);break;case 1:if(Aa(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(y){lt(s,s.return,y)}else{var o=nl(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){lt(s,s.return,y)}}l&64&&Lx(s),l&512&&Ca(s,s.return);break;case 3:if(Aa(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{kp(e,t)}catch(y){lt(s,s.return,y)}}break;case 27:t===null&&l&4&&$x(s);case 26:case 5:Aa(e,s),t===null&&l&4&&Hd(s),l&512&&Ca(s,s.return);break;case 12:Aa(e,s);break;case 31:Aa(e,s),l&4&&Jx(e,s);break;case 13:Aa(e,s),l&4&&Wx(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=C1.bind(null,s),oN(e,s))));break;case 22:if(l=s.memoizedState!==null||Xt,!l){var u=t!==null&&t.memoizedState!==null||at;t=Xt,o=at,Xt=l,(at=u)&&!o?(l=2,(s.subtreeFlags&8772)!==0&&(l|=1),ua(e,s,l)):Aa(e,s),Xt=t,at=o}break;case 30:Aa(e,s),l&512&&Ca(s,s.return);break;case 7:l&512&&Ca(s,s.return);default:Aa(e,s)}}function Pd(e,t){for(e=e.child;e!==null;)Px(e,t),e=e.sibling}function Px(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var l=s.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var o=e.stateNode,u=e.memoizedProps.style,y=u!=null&&u.hasOwnProperty("display")?u.display:null;o.style.display=y==null||typeof y=="boolean"?"":(""+y).trim()}}catch(D){lt(e,e.return,D)}Id(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Je=!0}catch(D){lt(e,e.return,D)}break;case 18:try{var N=e.stateNode;t?qg(N,!0):qg(e.stateNode,!1)}catch(D){lt(e,e.return,D)}break;case 22:case 23:e.memoizedState===null&&Pd(e,t);break;default:Pd(e,t)}}function Id(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,l=t;switch(s.tag){case 4:Px(s,l);break e;case 22:s.memoizedState===null&&Id(s,l);break e;default:Id(s,l)}}e=e.sibling}}function Ix(e){var t=e.alternate;t!==null&&(e.alternate=null,Ix(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pt=null,Tn=!1;function oa(e,t,s){for(s=s.child;s!==null;)Fx(e,t,s),s=s.sibling}function Fx(e,t,s){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(an,s)}catch{}switch(s.tag){case 26:at||en(s,t),oa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!at&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:at||en(s,t),Wi(s);var l=pt,o=Tn;Ss(s.type)&&(pt=s.stateNode,Tn=!1),oa(e,t,s),ty(s.stateNode,s.type,s.memoizedProps),pt=l,Tn=o;break;case 5:at||en(s,t),Wi(s);case 6:if(s.tag===6&&Wi(s),l=pt,o=Tn,pt=null,oa(e,t,s),pt=l,Tn=o,pt!==null)if(Tn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(s.stateNode),Je=!0}catch(u){lt(s,t,u)}else try{pt.removeChild(s.stateNode),Je=!0}catch(u){lt(s,t,u)}break;case 18:pt!==null&&(Tn?(e=pt,$g(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),ci(e)):$g(pt,s.stateNode));break;case 4:l=pt,o=Tn,pt=s.stateNode.containerInfo,Tn=!0,oa(e,t,s),pt=l,Tn=o;break;case 0:case 11:case 14:case 15:gs(2,s,t),at||gs(4,s,t),oa(e,t,s);break;case 1:at||(en(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Ux(s,t,l)),oa(e,t,s);break;case 21:oa(e,t,s);break;case 22:at=(l=at)||s.memoizedState!==null,oa(e,t,s),at=l;break;case 30:en(s,t),oa(e,t,s);break;case 7:at||en(s,t),oa(e,t,s);break;default:oa(e,t,s)}}function Jx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ci(e)}catch(s){lt(t,t.return,s)}}}function Wx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ci(e)}catch(s){lt(t,t.return,s)}}function x1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zx),t;default:throw Error(c(435,e.tag))}}function Ko(e,t){var s=x1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var o=E1.bind(null,e,l);l.then(o,o)}})}function fn(e,t,s){var l=t.deletions;if(l!==null)for(var o=0;o<l.length;o++){var u=l[o],y=e,N=t,D=N;e:for(;D!==null;){switch(D.tag){case 27:if(Ss(D.type)){pt=D.stateNode,Tn=!1;break e}break;case 5:pt=D.stateNode,Tn=!1;break e;case 3:case 4:pt=D.stateNode.containerInfo,Tn=!0;break e}D=D.return}if(pt===null)throw Error(c(160));Fx(y,N,u),pt=null,Tn=!1,y=u.alternate,y!==null&&(y.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)eg(t,e,s),t=t.sibling}var ca=null;function eg(e,t,s){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(o&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var u=0;u<l.length;u++){var y=l[u];y.ref.impl=y.nextImpl}fn(t,e,s),hn(e),o&4&&(gs(3,e,e.return),Ji(3,e),gs(5,e,e.return));break;case 1:fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),o&64&&Xt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(u=ca,fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),o&4)if(o=l!==null?l.memoizedState:null,s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null)if(Xt)e.stateNode=Ug(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,o=u.ownerDocument||u;t:switch(t){case"title":l=o.getElementsByTagName("title")[0],(!l||l[Ti]||l[It]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=o.createElement(t),o.head.insertBefore(l,o.querySelector("head > title"))),tn(l,t,s),l[It]=e,Yt(l),t=l;break e;case"link":if(u=ry("link","href",o).get(t+(s.href||""))){for(y=0;y<u.length;y++)if(l=u[y],l.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&l.getAttribute("rel")===(s.rel==null?null:s.rel)&&l.getAttribute("title")===(s.title==null?null:s.title)&&l.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){u.splice(y,1);break t}}l=o.createElement(t),tn(l,t,s),o.head.appendChild(l);break;case"meta":if(u=ry("meta","content",o).get(t+(s.content||""))){for(y=0;y<u.length;y++)if(l=u[y],l.getAttribute("content")===(s.content==null?null:""+s.content)&&l.getAttribute("name")===(s.name==null?null:s.name)&&l.getAttribute("property")===(s.property==null?null:s.property)&&l.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&l.getAttribute("charset")===(s.charSet==null?null:s.charSet)){u.splice(y,1);break t}}l=o.createElement(t),tn(l,t,s),o.head.appendChild(l);break;default:throw Error(c(468,t))}l[It]=e,Yt(l),t=l}e.stateNode=t}else Xt||_f(u,e.type,e.stateNode);else e.stateNode=iy(u,s,e.memoizedProps);else o!==s?(o===null?(t=l.stateNode,t===null||at||t.parentNode.removeChild(t)):o.count--,s===null?Xt||_f(u,e.type,e.stateNode):iy(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Bd(e,e.memoizedProps,l.memoizedProps);break;case 27:fn(t,e,s),hn(e),o&512&&(at||l===null||en(l,l.return)),l!==null&&o&4&&Bd(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=za,za=!1,fn(t,e,s),za=u,hn(e),o&512&&(at||l===null||en(l,l.return)),e.flags&32){t=e.stateNode;try{Tl(t,""),Je=!0}catch(P){lt(e,e.return,P)}}o&4&&e.stateNode!=null&&(t=e.memoizedProps,Bd(e,t,l!==null?l.memoizedProps:t)),o&1024&&(Zd=!0);break;case 6:if(fn(t,e,s),hn(e),o&4){if(e.stateNode===null)throw Error(c(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,Je=!0}catch(P){lt(e,e.return,P)}}break;case 3:if(Je=!1,rc=null,u=ca,ca=cr(t.containerInfo),fn(t,e,s),ca=u,hn(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ci(t.containerInfo)}catch(P){lt(e,e.return,P)}Zd&&(Zd=!1,tg(e)),Je=!1;break;case 4:o=za,za=Xt,l=jm(),u=ca,ca=cr(e.stateNode.containerInfo),fn(t,e,s),hn(e),ca=u,Je&&er&&(Vo=!0),Je=l,za=o;break;case 12:fn(t,e,s),hn(e);break;case 31:fn(t,e,s),hn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ko(e,t)));break;case 13:fn(t,e,s),hn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Po=Ke()),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ko(e,t)));break;case 22:u=e.memoizedState!==null,y=l!==null&&l.memoizedState!==null;var N=Xt,D=at,G=za;Xt=N||u,za=G||u,at=D||y,fn(t,e,s),at=D,za=G,Xt=N,hn(e),o&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||y||Xt||at||(t=y||at,s=Xt,l=at,Xt=u||Xt,at=t,ys(e,2),Xt=s,at=l),!u&&za||Pd(e,u)),o&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,Ko(e,s))));break;case 19:fn(t,e,s),hn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ko(e,t)));break;case 30:o&512&&(at||l===null||en(l,l.return)),o=jm(),u=er,y=(s&335544064)===s,N=e.memoizedProps,er=y&&qa(N.default,N.update)!=="none",fn(t,e,s),hn(e),y&&l!==null&&Je&&(e.flags|=4),er=u,Je=o;break;case 21:break;case 7:o&512&&(at||l===null||en(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:fn(t,e,s),hn(e)}}function hn(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Bx(l)){s=l;break}l=l.return}l=null;for(var o=e.return;o!==null;){if(Ud(o)){var u=o.stateNode;l===null?l=[u]:l.push(u)}if(Ld(o))break;o=o.return}var y=l;if(s==null)throw Error(c(160));switch(s.tag){case 27:var N=s.stateNode,D=$d(e);$o(e,D,N,y);break;case 5:var G=s.stateNode;s.flags&32&&(Tl(G,""),s.flags&=-33);var P=$d(e);$o(e,P,G,y);break;case 3:case 4:var se=s.stateNode.containerInfo,H=$d(e);qd(e,H,se,y);break;default:throw Error(c(161))}}catch(Z){lt(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;tg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,oi=!0,t.reset(),oi=!1),e=e.sibling}}function Xl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ng(t,e),t=t.sibling;else Kx(t)}function ng(e,t){var s=e.alternate;if(s===null)Gd(e,!1);else switch(e.tag){case 3:if(Qd=Da=!1,Gx(),Xl(t,e),!Da&&!Vo){if(e=Ea,e!==null)for(var l=0;l<e.length;l+=3){s=e[l];var o=e[l+1];Yg(s,e[l+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+o+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Qd=!0}Ea=null;break;case 5:Xl(t,e);break;case 4:l=Da,Da=!1,Xl(t,e),Da&&(Vo=!0),Da=l;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?Gd(e,!1):Xl(t,e));break;case 30:l=Da,o=Gx(),Da=!1,Xl(t,e),Da&&(e.flags|=4);var u=e.memoizedProps,y=e.stateNode;t=$a(u,y),y=$a(s.memoizedProps,y);var N=qa(u.default,u.update);N==="none"?t=!1:(u=s.memoizedState,s.memoizedState=null,s=e.child,kn=0,t=Kd(e,s,t,y,N,u,!0),kn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Jl(e,e.memoizedProps.onUpdate),Ea=o):o!==null&&(o.push.apply(o,Ea),Ea=o),Da=(e.flags&32)!==0?!0:l;break;default:Xl(t,e)}}function Aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Qx(e,t.alternate,t),t=t.sibling}function ys(e,t){for(e=e.child;e!==null;){var s=e,l=t;switch(s.tag){case 0:case 11:case 14:case 15:gs(4,s,s.return),ys(s,l);break;case 1:en(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Ux(s,s.return,o),ys(s,l);break;case 27:(l&2)!==0&&ty(s.stateNode,s.type,s.memoizedProps);case 5:en(s,s.return),s.tag!==5&&s.tag!==27||Wi(s),ys(s,l);break;case 6:Wi(s);break;case 26:en(s,s.return),o=s.stateNode,s.memoizedState!==null||o===null||at||o.parentNode.removeChild(o),ys(s,l);break;case 22:s.memoizedState===null&&ys(s,l);break;case 30:en(s,s.return),ys(s,l);break;case 7:en(s,s.return);default:ys(s,l)}e=e.sibling}}function ua(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var l=t.alternate,o=e,u=t,y=u.flags,N=(s&1)!==0;switch(u.tag){case 0:case 11:case 15:ua(o,u,s),Ji(4,u);break;case 1:if(ua(o,u,s),l=u,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(P){lt(l,l.return,P)}if(l=u,o=l.updateQueue,o!==null){var D=l.stateNode;try{var G=o.shared.hiddenCallbacks;if(G!==null)for(o.shared.hiddenCallbacks=null,o=0;o<G.length;o++)Sp(G[o],D)}catch(P){lt(l,l.return,P)}}N&&y&64&&Lx(u),Ca(u,u.return);break;case 27:(s&2)!==0&&$x(u);case 5:u.tag!==5&&u.tag!==27||Hx(u),ua(o,u,s),N&&l===null&&y&4&&Hd(u),Ca(u,u.return);break;case 6:Hx(u);break;case 26:D=u.stateNode,u.memoizedState!==null||D===null||Xt||_f(cr(D.ownerDocument),u.type,D),ua(o,u,s),N&&l===null&&y&4&&Hd(u),Ca(u,u.return);break;case 12:ua(o,u,s);break;case 31:ua(o,u,s),N&&y&4&&Jx(o,u);break;case 13:ua(o,u,s),N&&y&4&&Wx(o,u);break;case 22:u.memoizedState===null&&ua(o,u,s),Ca(u,u.return);break;case 30:ua(o,u,s),Ca(u,u.return);break;case 7:Ca(u,u.return);default:ua(o,u,s)}t=t.sibling}}function Fd(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Bi(s))}function Jd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bi(e))}function Pn(e,t,s,l){var o=(s&335544064)===s;if(t.subtreeFlags&(o?10262:10256))for(t=t.child;t!==null;)ag(e,t,s,l),t=t.sibling;else o&&Xx(t)}function ag(e,t,s,l){var o=(s&335544064)===s;o&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yo(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:Pn(e,t,s,l),u&2048&&Ji(9,t);break;case 1:Pn(e,t,s,l);break;case 3:Pn(e,t,s,l),o&&Qd&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&Bi(u)));break;case 12:if(u&2048){Pn(e,t,s,l),u=t.stateNode;try{var y=t.memoizedProps,N=y.id,D=y.onPostCommit;typeof D=="function"&&D(N,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(G){lt(t,t.return,G)}}else Pn(e,t,s,l);break;case 31:Pn(e,t,s,l);break;case 13:Pn(e,t,s,l);break;case 23:break;case 22:y=t.stateNode,N=t.alternate,t.memoizedState!==null?(o&&N!==null&&N.memoizedState===null&&Yo(N),y._visibility&2?Pn(e,t,s,l):tr(e,t)):(o&&N!==null&&N.memoizedState!==null&&Yo(t),y._visibility&2?Pn(e,t,s,l):(y._visibility|=2,Kl(e,t,s,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&Fd(N,t);break;case 24:Pn(e,t,s,l),u&2048&&Jd(t.alternate,t);break;case 30:o&&(u=t.alternate,u!==null&&(Ra(u.child,!0),Ra(t.child,!0))),Pn(e,t,s,l);break;default:Pn(e,t,s,l)}}function Kl(e,t,s,l,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,y=t,N=s,D=l,G=y.flags;switch(y.tag){case 0:case 11:case 15:Kl(u,y,N,D,o),Ji(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?Kl(u,y,N,D,o):tr(u,y):(P._visibility|=2,Kl(u,y,N,D,o)),o&&G&2048&&Fd(y.alternate,y);break;case 24:Kl(u,y,N,D,o),o&&G&2048&&Jd(y.alternate,y);break;default:Kl(u,y,N,D,o)}t=t.sibling}}function tr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,o=l.flags;switch(l.tag){case 22:tr(s,l),o&2048&&Fd(l.alternate,l);break;case 24:tr(s,l),o&2048&&Jd(l.alternate,l);break;default:tr(s,l)}t=t.sibling}}var al=8192;function sl(e,t,s){if(e.subtreeFlags&al)for(e=e.child;e!==null;)sg(e,t,s),e=e.sibling}function sg(e,t,s){switch(e.tag){case 26:sl(e,t,s),e.flags&al&&(e.memoizedState!==null?NN(s,ca,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&dy(s,e)));break;case 5:sl(e,t,s),e.flags&al&&(e=e.stateNode,(t&335544128)===t&&dy(s,e));break;case 3:case 4:var l=ca;ca=cr(e.stateNode.containerInfo),sl(e,t,s),ca=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=al,al=16777216,sl(e,t,s),al=l):sl(e,t,s));break;case 30:if((e.flags&al)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var o=e.stateNode;o.paired=null,_n===null&&(_n=new Map),_n.set(l,o)}sl(e,t,s);break;default:sl(e,t,s)}}function lg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function nr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Kt=l,rg(l,e)}lg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ig(e),e=e.sibling}function ig(e){switch(e.tag){case 0:case 11:case 15:nr(e),e.flags&2048&&gs(9,e,e.return);break;case 3:nr(e);break;case 12:nr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zo(e)):nr(e);break;default:nr(e)}}function Zo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Kt=l,rg(l,e)}lg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gs(8,t,t.return),Zo(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Zo(t));break;default:Zo(t)}e=e.sibling}}function rg(e,t){for(;Kt!==null;){var s=Kt;switch(s.tag){case 0:case 11:case 15:gs(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Bi(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Kt=l;else e:for(s=e;Kt!==null;){l=Kt;var o=l.sibling,u=l.return;if(Ix(l),l===s){Kt=null;break e}if(o!==null){o.return=u,Kt=o;break e}Kt=u}}}var g1={getCacheForType:function(e){var t=Ft(Ot),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ft(Ot).controller.signal}},y1=typeof WeakMap=="function"?WeakMap:Map,We=0,dt=null,$e=null,Ye=0,st=0,Ln=null,vs=!1,Zl=!1,Wd=!1,Ia=0,St=0,bs=0,ll=0,Qo=0,Un=0,Ql=0,ar=null,Cn=null,ef=!1,Po=0,og=0,Io=1/0,Fo=null,js=null,gt=0,da=null,il=null,Oa=0,tf=0,nf=null,cg=null,Pl=null,Il=null,Fl=null,sr=0,Jo=null;function Hn(){return(We&2)!==0&&Ye!==0?Ye&-Ye:me.T!==null?hf():fm()}function ug(){if(Un===0)if((Ye&536870912)===0||Be){var e=Dn;Dn<<=1,(Dn&3932160)===0&&(Dn=262144),Un=e}else Un=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Un}function Jl(e,t){if(t!=null){var s=e.stateNode,l=s.ref;l===null&&(l=s.ref=Vg($a(e.memoizedProps,s))),Il===null&&(Il=[]),Il.push(t.bind(null,l))}}function En(e,t,s){(e===dt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Ns(e,Ye,Un,!1)),ki(e,s),((We&2)===0||e!==dt)&&(e===dt&&((We&2)===0&&(ll|=s),St===4&&Ns(e,Ye,Un,!1)),Ma(e))}function dg(e,t,s){if((We&6)!==0)throw Error(c(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Si(e,t),o=l?j1(e,t):sf(e,t,!0),u=l;do{if(o===0){Zl&&!l&&Ns(e,t,0,!1);break}else{if(s=e.current.alternate,u&&!v1(s)){o=sf(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var N=e;o=ar;var D=N.current.memoizedState.isDehydrated;if(D&&(Wl(N,y).flags|=256),y=sf(N,y,!1),y!==2&&y!==6){if(Wd&&!D){N.errorRecoveryDisabledLanes|=u,ll|=u,o=4;break e}u=Cn,Cn=o,u!==null&&(Cn===null?Cn=u:Cn.push.apply(Cn,u))}o=y}if(u=!1,o!==2)continue}}if(o===1){Wl(e,0),Ns(e,t,0,!0);break}e:{switch(l=e,u=o,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ns(l,t,Un,!vs);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Po+300-Ke(),10<o)){if(Ns(l,t,Un,!vs),Zr(l,0,!0)!==0)break e;Oa=t,l.timeoutHandle=Sf(fg.bind(null,l,s,Cn,Fo,ef,t,Un,ll,Ql,vs,u,"Throttled",-0,0),o);break e}fg(l,s,Cn,Fo,ef,t,Un,ll,Ql,vs,u,null,-0,0)}}break}while(!0);Ma(e)}function fg(e,t,s,l,o,u,y,N,D,G,P,se,H,Z){e.timeoutHandle=-1;var pe=t.subtreeFlags,Te=(u&335544064)===u;if(se=null,(Te||pe&8192||(pe&16785408)===16785408)&&(se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sa},_n=null,sg(t,u,se),Te&&(pe=se,Te=e.containerInfo,Te=(Te.nodeType===9?Te:Te.ownerDocument).__reactViewTransition,Te!=null&&(pe.count++,pe.waitingForViewTransition=!0,pe=fr.bind(pe),Te.finished.then(pe,pe))),pe=(u&62914560)===u?Po-Ke():(u&4194048)===u?og-Ke():0,pe=wN(se,pe),pe!==null)){Oa=u,e.cancelPendingCommit=pe(bg.bind(null,e,t,u,s,l,o,y,N,D,G,P,se,null,H,Z)),Ns(e,u,y,!G);return}bg(e,t,u,s,l,o,y,N,D,G,P,se)}function v1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var o=s[l],u=o.getSnapshot;o=o.value;try{if(!On(u(),o))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ns(e,t,s,l){t=rm(e,t),t&=~Qo,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var o=t;0<o;){var u=31-Nt(o),y=1<<u;l[u]=-1,o&=~y}s!==0&&cm(e,s,t)}function Wo(){return(We&6)===0?(lr(0),!1):!0}function af(){if($e!==null){if(st===0)var e=$e.return;else e=$e,Va=Zs=null,dd(e),Bl=null,Gi=0,e=$e;for(;e!==null;)_x(e.alternate,e),e=e.return;$e=null}}function Wl(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,Y1(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Oa=0,af(),dt=e,$e=s=Ga(e.current,null),Ye=t,st=0,Ln=null,vs=!1,Zl=Si(e,t),Wd=!1,Ql=Un=Qo=ll=bs=St=0,Cn=ar=null,ef=!1,Ia=rm(e,t),io(),s}function hg(e,t){_e=null,me.H=Ao,t===Hl||t===yo?(t=bp(),st=3):t===Ju?(t=bp(),st=4):st=t===Td?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ln=t,$e===null&&(St=1,Oo(e,Xn(t,e.current)))}function mg(){var e=Jt.current;return e===null?!0:(Ye&4194048)===Ye?sn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===sn:!1}function pg(){var e=me.H;return me.H=Ao,e===null?Ao:e}function xg(){var e=me.A;return me.A=g1,e}function ec(){St=4,vs||(Ye&4194048)!==Ye&&Jt.current!==null||(Zl=!0),(bs&134217727)===0&&(ll&134217727)===0||dt===null||Ns(dt,Ye,Un,!1)}function sf(e,t,s){var l=We;We|=2;var o=pg(),u=xg();(dt!==e||Ye!==t)&&(Fo=null,Wl(e,t)),t=!1;var y=St;e:do try{if(st!==0&&$e!==null){var N=$e,D=Ln;switch(st){case 8:af(),y=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var G=st;if(st=0,Ln=null,ei(e,N,D,G),s&&Zl){y=0;break e}break;default:G=st,st=0,Ln=null,ei(e,N,D,G)}}b1(),y=St;break}catch(P){hg(e,P)}while(!0);return t&&e.shellSuspendCounter++,Va=Zs=null,We=l,me.H=o,me.A=u,$e===null&&(dt=null,Ye=0,io()),y}function b1(){for(;$e!==null;)gg($e)}function j1(e,t){var s=We;We|=2;var l=pg(),o=xg();dt!==e||Ye!==t?(Fo=null,Io=Ke()+500,Wl(e,t)):Zl=Si(e,t);e:do try{if(st!==0&&$e!==null){t=$e;var u=Ln;t:switch(st){case 1:st=0,Ln=null,ei(e,t,u,1);break;case 2:case 9:if(yp(u)){st=0,Ln=null,yg(t);break}t=function(){st!==2&&st!==9||dt!==e||(st=7),Ma(e)},u.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:yp(u)?(st=0,Ln=null,yg(t)):(st=0,Ln=null,ei(e,t,u,7));break;case 5:var y=null;switch($e.tag){case 26:y=$e.memoizedState;case 5:case 27:var N=$e;if(y?cy(y):N.stateNode.complete){st=0,Ln=null;var D=N.sibling;if(D!==null)$e=D;else{var G=N.return;G!==null?($e=G,tc(G)):$e=null}break t}}st=0,Ln=null,ei(e,t,u,5);break;case 6:st=0,Ln=null,ei(e,t,u,6);break;case 8:af(),St=6;break e;default:throw Error(c(462))}}N1();break}catch(P){hg(e,P)}while(!0);return Va=Zs=null,me.H=l,me.A=o,We=s,$e!==null?0:(dt=null,Ye=0,io(),St)}function N1(){for(;$e!==null&&!Rt();)gg($e)}function gg(e){var t=Ox(e.alternate,e,Ia);e.memoizedProps=e.pendingProps,t===null?tc(e):$e=t}function yg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Tx(s,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=Tx(s,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:dd(t);var l=t;l===Vt&&(Be?(ho(l),l.tag===5&&l.stateNode!=null&&(ht=l.stateNode)):(ho(l),Be=!0));default:_x(s,t),t=$e=rp(t,Ia),t=Ox(s,t,Ia)}e.memoizedProps=e.pendingProps,t===null?tc(e):$e=t}function ei(e,t,s,l){Va=Zs=null,dd(t),Bl=null,Gi=0;var o=t.return;try{if(c1(e,o,t,s,Ye)){St=1,Oo(e,Xn(s,e.current)),$e=null;return}}catch(u){if(o!==null)throw $e=o,u;St=1,Oo(e,Xn(s,e.current)),$e=null;return}t.flags&32768?(Be||l===1?e=!0:Zl||(Ye&536870912)!==0?e=!1:(vs=e=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),vg(t,e)):tc(t)}function tc(e){var t=e;do{if((t.flags&32768)!==0){vg(t,vs);return}e=t.return;var s=h1(t.alternate,t,Ia);if(s!==null){$e=s;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);St===0&&(St=5)}function vg(e,t){do{var s=m1(e.alternate,e);if(s!==null){s.flags&=32767,$e=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=s}while(e!==null);St=6,$e=null}function bg(e,t,s,l,o,u,y,N,D,G,P,se){e.cancelPendingCommit=null;do nc();while(gt!==0);if((We&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));e===dt&&($e=dt=null,Ye=0),il=t,da=e,Oa=s,nf=o,cg=l,w1(e,t,s,y,N,D,se)}}function w1(e,t,s,l,o,u,y){var N=t.lanes|t.childLanes;if(tf=N,N|=Bu,P0(e,s,N,l,o,u),Il=null,(s&335544064)===s?(Fl=Fj(e),l=10262):(Fl=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,R1(Gt,function(){return cf(),null})):(e.callbackNode=null,e.callbackPriority=0),qo=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null,o=ie.p,ie.p=2,u=We,We|=4;try{p1(e,t,s)}finally{We=u,ie.p=o,me.T=l}}gt=1,qo?Pl=P1(y,e.containerInfo,Fl,lf,rf,k1,of,cf,S1):(lf(),rf(),of())}function S1(e){if(gt!==0){var t=da.onRecoverableError;t(e,{componentStack:null})}}function k1(){gt===3&&(gt=0,ng(il,da),gt=4)}function lf(){if(gt===1){gt=0;var e=da,t=il,s=Oa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null;var o=ie.p;ie.p=2;var u=We;We|=4;try{er=Vo=!1,eg(t,e,s),s=jf;var y=Fm(e.containerInfo),N=s.focusedElem,D=s.selectionRange;if(y!==N&&N&&N.ownerDocument&&Im(N.ownerDocument.documentElement,N)){if(D!==null&&Mu(N)){var G=D.start,P=D.end;if(P===void 0&&(P=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(P,N.value.length);else{var se=N.ownerDocument||document,H=se&&se.defaultView||window;if(H.getSelection){var Z=H.getSelection(),pe=N.textContent.length,Te=Math.min(D.start,pe),Le=D.end===void 0?Te:Math.min(D.end,pe);!Z.extend&&Te>Le&&(y=Le,Le=Te,Te=y);var $=Pm(N,Te),_=Pm(N,Le);if($&&_&&(Z.rangeCount!==1||Z.anchorNode!==$.node||Z.anchorOffset!==$.offset||Z.focusNode!==_.node||Z.focusOffset!==_.offset)){var K=se.createRange();K.setStart($.node,$.offset),Z.removeAllRanges(),Te>Le?(Z.addRange(K),Z.extend(_.node,_.offset)):(K.setEnd(_.node,_.offset),Z.addRange(K))}}}}for(se=[],Z=N;Z=Z.parentNode;)Z.nodeType===1&&se.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var ne=se[N];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}oi=!!bf,jf=bf=null}finally{We=u,ie.p=o,me.T=l}}e.current=t,gt=2}}function rf(){if(gt===2){gt=0;var e=da,t=il,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=me.T,me.T=null;var l=ie.p;ie.p=2;var o=We;We|=4;try{Qx(e,t.alternate,t)}finally{We=o,ie.p=l,me.T=s}}gt=3}}function of(){if(gt===4||gt===3){gt=0;var e=Pl;Pl=null,jt();var t=da,s=il,l=Oa,o=cg,u=(l&335544064)===l?10262:10256;if((s.subtreeFlags&u)!==0||(s.flags&u)!==0?gt=5:(gt=0,il=da=null,jg(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(js=null),xu(l),s=s.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(an,s,void 0,(s.current.flags&128)===128)}catch{}if(o!==null){s=me.T,u=ie.p,ie.p=2,me.T=null;try{for(var y=t.onRecoverableError,N=0;N<o.length;N++){var D=o[N];y(D.value,{componentStack:D.stack})}}finally{me.T=s,ie.p=u}}if(o=Il,y=Fl,Fl=null,o!==null&&(Il=null,y===null&&(y=[]),e!==null))for(D=0;D<o.length;D++)s=(0,o[D])(y),s!==void 0&&e.finished.finally(s);(Oa&3)!==0&&nc(),Ma(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Jo?sr++:(sr=0,Jo=t):(sr=0,Jo=null),lr(0)}}function jg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Bi(t)))}function nc(){return Pl!==null&&(Pl.skipTransition(),Pl=null),lf(),rf(),of(),cf()}function cf(){if(gt!==5)return!1;var e=da,t=tf;tf=0;var s=xu(Oa),l=me.T,o=ie.p;try{ie.p=32>s?32:s,me.T=null,s=nf,nf=null;var u=da,y=Oa;if(gt=0,il=da=null,Oa=0,(We&6)!==0)throw Error(c(331));var N=We;if(We|=4,ig(u.current),ag(u,u.current,y,s),We=N,lr(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(an,u)}catch{}return!0}finally{ie.p=o,me.T=l,jg(e,t)}}function Ng(e,t,s){t=Xn(s,t),t=kd(e.stateNode,t,2),e=hs(e,t,2),e!==null&&(ki(e,2),Ma(e))}function lt(e,t,s){if(e.tag===3)Ng(e,e,s);else for(;t!==null;){if(t.tag===3){Ng(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(js===null||!js.has(l))){e=Xn(s,e),s=yx(2),l=hs(t,s,2),l!==null&&(vx(s,l,t,e),ki(l,2),Ma(l));break}}t=t.return}}function uf(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new y1;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(s)||(Wd=!0,o.add(s),e=T1.bind(null,e,t,s),t.then(e,e))}function T1(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,dt===e&&(Ye&s)===s&&((St===4||St===3&&(Ye&62914560)===Ye&&300>Ke()-Po)&&(We&2)===0?Wl(e,0):Qo|=s,Ql===Ye&&(Ql=0)),Ma(e)}function wg(e,t){t===0&&(t=om()),e=Vs(e,t),e!==null&&(ki(e,t),Ma(e))}function C1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),wg(e,s)}function E1(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(s=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),wg(e,s)}function R1(e,t){return Ce(e,t)}var ti=null,ni=null,df=!1,ac=!1,ff=!1,ws=0;function Ma(e){e!==ni&&e.next===null&&(ni===null?ti=ni=e:ni=ni.next=e),ac=!0,df||(df=!0,D1())}function lr(e,t){if(!ff&&ac){ff=!0;do for(var s=!1,l=ti;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var u=0;else{var y=l.suspendedLanes,N=l.pingedLanes;u=(1<<31-Nt(42|e)+1)-1,u&=o&~(y&~N),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(s=!0,Cg(l,u))}else u=Ye,u=Zr(l,l===dt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Si(l,u)||(s=!0,Cg(l,u));l=l.next}while(s);ff=!1}}function z1(){Sg()}function Sg(){ac=df=!1;var e=0;ws!==0&&G1()&&(e=ws);for(var t=Ke(),s=null,l=ti;l!==null;){var o=l.next,u=kg(l,t);u===0?(l.next=null,s===null?ti=o:s.next=o,o===null&&(ni=s)):(s=l,(e!==0||(u&3)!==0)&&(ac=!0)),l=o}gt!==0&>!==5||lr(e),ws!==0&&(ws=0)}function kg(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var y=31-Nt(u),N=1<<y,D=o[y];D===-1?((N&s)===0||(N&l)!==0)&&(o[y]=Q0(N,t)):D<=t&&(e.expiredLanes|=N),u&=~N}if(t=dt,s=Ye,s=Zr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ut(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Si(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&ut(l),xu(s)){case 2:case 8:s=Ut;break;case 32:s=Gt;break;case 268435456:s=sa;break;default:s=Gt}return l=Tg.bind(null,e),s=Ce(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&ut(l),e.callbackPriority=2,e.callbackNode=null,2}function Tg(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(nc()&&e.callbackNode!==s)return null;var l=Ye;return l=Zr(e,e===dt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(dg(e,l,t),kg(e,Ke()),e.callbackNode!=null&&e.callbackNode===s?Tg.bind(null,e):null)}function Cg(e,t){if(nc())return null;dg(e,t,!0)}function D1(){V1(function(){(We&6)!==0?Ce(Kr,z1):Sg()})}function hf(){if(ws===0){var e=Is;e===0&&(e=Na,Na<<=1,(Na&261888)===0&&(Na=256)),ws=e}return ws}function Eg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jr(e)}function A1(e,t,s,l,o){if(t==="submit"&&s&&s.stateNode===o){var u=Eg((o[wn]||null).action),y=l.submitter;y&&(t=(t=y[wn]||null)?Eg(t.formAction):y.getAttribute("formAction"),t!==null&&(u=t,y=null));var N=new no("action","action",null,l,o);e.push({event:N,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ws!==0){var D=new FormData(o,y);bd(s,{pending:!0,data:D,method:o.method,action:u},null,D)}}else typeof u=="function"&&(N.preventDefault(),D=new FormData(o,y),bd(s,{pending:!0,data:D,method:o.method,action:u},u,D))},currentTarget:o}]})}}for(var mf=0;mf<Hu.length;mf++){var pf=Hu[mf],O1=pf.toLowerCase(),M1=pf[0].toUpperCase()+pf.slice(1);ra(O1,"on"+M1)}ra(ep,"onAnimationEnd"),ra(tp,"onAnimationIteration"),ra(np,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(Yj,"onTransitionRun"),ra(Vj,"onTransitionStart"),ra(Xj,"onTransitionCancel"),ra(ap,"onTransitionEnd"),Sl("onMouseEnter",["mouseout","mouseover"]),Sl("onMouseLeave",["mouseout","mouseover"]),Sl("onPointerEnter",["pointerout","pointerover"]),Sl("onPointerLeave",["pointerout","pointerover"]),qs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qs("onBeforeInput",["compositionend","keypress","textInput","paste"]),qs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="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(" "),_1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function Rg(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],o=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var y=l.length-1;0<=y;y--){var N=l[y],D=N.instance,G=N.currentTarget;if(N=N.listener,D!==u&&o.isPropagationStopped())break e;u=N,o.currentTarget=G;try{u(o)}catch(P){lo(P)}o.currentTarget=null,u=D}else for(y=0;y<l.length;y++){if(N=l[y],D=N.instance,G=N.currentTarget,N=N.listener,D!==u&&o.isPropagationStopped())break e;u=N,o.currentTarget=G;try{u(o)}catch(P){lo(P)}o.currentTarget=null,u=D}}}}function qe(e,t){var s=t[mm];s===void 0&&(s=t[mm]=new Set);var l=e+"__bubble";s.has(l)||(zg(t,e,2,!1),s.add(l))}function xf(e,t,s){var l=0;t&&(l|=4),zg(s,e,l,t)}var sc="_reactListening"+Math.random().toString(36).slice(2);function gf(e){if(!e[sc]){e[sc]=!0,gm.forEach(function(s){s!=="selectionchange"&&(_1.has(s)||xf(s,!1,e),xf(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sc]||(t[sc]=!0,xf("selectionchange",!1,t))}}function zg(e,t,s,l){switch(vy(t)){case 2:var o=CN;break;case 8:o=EN;break;default:o=Uf}s=o.bind(null,t,s,e),o=void 0,!Su||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,s,{capture:!0,passive:o}):e.addEventListener(t,s,!0):o!==void 0?e.addEventListener(t,s,{passive:o}):e.addEventListener(t,s,!1)}function yf(e,t,s,l,o){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===o)break;if(y===4)for(y=l.return;y!==null;){var D=y.tag;if((D===3||D===4)&&y.stateNode.containerInfo===o)return;y=y.return}for(;N!==null;){if(y=$s(N),y===null)return;if(D=y.tag,D===5||D===6||D===26||D===27){l=u=y;continue e}N=N.parentNode}}l=l.return}zm(function(){var G=u,P=Nu(s),se=[];e:{var H=sp.get(e);if(H!==void 0){var Z=no,pe=e;switch(e){case"keypress":if(eo(s)===0)break e;case"keydown":case"keyup":Z=vj;break;case"focusin":pe="focus",Z=Eu;break;case"focusout":pe="blur",Z=Eu;break;case"beforeblur":case"afterblur":Z=Eu;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":Z=Om;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=rj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Sj;break;case ep:case tp:case np:Z=uj;break;case ap:Z=Tj;break;case"scroll":case"scrollend":Z=lj;break;case"wheel":Z=Ej;break;case"copy":case"cut":case"paste":Z=fj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=_m;break;case"submit":Z=Nj;break;case"toggle":case"beforetoggle":Z=zj}var Te=(t&4)!==0,Le=!Te&&(e==="scroll"||e==="scrollend"),$=Te?H!==null?H+"Capture":null:H;Te=[];for(var _=G,K;_!==null;){var ne=_;if(K=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||K===null||$===null||(ne=Ei(_,$),ne!=null&&Te.push(rr(_,ne,K))),Le)break;_=_.return}0<Te.length&&(H=new Z(H,pe,null,s,P),se.push({event:H,listeners:Te}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",Z&&s!==ju&&(pe=s.relatedTarget||s.fromElement)&&($s(pe)||pe[jl]))break e;(H||Z)&&(pe=P.window===P?P:(Z=P.ownerDocument)?Z.defaultView||Z.parentWindow:window,H?(Z=s.relatedTarget||s.toElement,H=G,Z=Z?$s(Z):null,Z!==null&&(Le=f(Z),Te=Z.tag,Z!==Le||Te!==5&&Te!==27&&Te!==6)&&(Z=null)):(H=null,Z=G),H!==Z&&(Te=Om,ne="onMouseLeave",$="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Te=_m,ne="onPointerLeave",$="onPointerEnter",_="pointer"),Le=H==null?pe:Ci(H),K=Z==null?pe:Ci(Z),pe=new Te(ne,_+"leave",H,s,P),pe.target=Le,pe.relatedTarget=K,ne=null,$s(P)===G&&(Te=new Te($,_+"enter",Z,s,P),Te.target=K,Te.relatedTarget=Le,ne=Te),Le=ne,Te=H&&Z?X(H,Z,L1):null,H!==null&&Dg(se,pe,H,Te,!1),Z!==null&&Le!==null&&Dg(se,Le,Z,Te,!0)))}e:{if(H=G?Ci(G):window,Z=H.nodeName&&H.nodeName.toLowerCase(),Z==="select"||Z==="input"&&H.type==="file")var Se=Ym;else if(qm(H))if(Vm)Se=$j;else{Se=Hj;var Ve=Uj}else Z=H.nodeName,!Z||Z.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?G&&bu(G.elementType)&&(Se=Ym):Se=Bj;if(Se&&(Se=Se(e,G))){Gm(se,Se,s,P);break e}Ve&&Ve(e,H,G)}switch(Ve=G?Ci(G):window,e){case"focusin":(qm(Ve)||Ve.contentEditable==="true")&&(zl=Ve,_u=G,Li=null);break;case"focusout":Li=_u=zl=null;break;case"mousedown":Lu=!0;break;case"contextmenu":case"mouseup":case"dragend":Lu=!1,Jm(se,s,P);break;case"selectionchange":if(Gj)break;case"keydown":case"keyup":Jm(se,s,P)}var ze;if(zu)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Rl?Bm(e,s)&&(Ae="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ae="onCompositionStart");Ae&&(Lm&&s.locale!=="ko"&&(Rl||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Rl&&(ze=Dm()):(ss=P,ku="value"in ss?ss.value:ss.textContent,Rl=!0)),Ve=lc(G,Ae),0<Ve.length&&(Ae=new Mm(Ae,e,null,s,P),se.push({event:Ae,listeners:Ve}),ze?Ae.data=ze:(ze=$m(s),ze!==null&&(Ae.data=ze)))),(ze=Aj?Oj(e,s):Mj(e,s))&&(Ae=lc(G,"onBeforeInput"),0<Ae.length&&(Ve=new Mm("onBeforeInput","beforeinput",null,s,P),se.push({event:Ve,listeners:Ae}),Ve.data=ze)),A1(se,e,G,s,P)}Rg(se,t)})}function rr(e,t,s){return{instance:e,listener:t,currentTarget:s}}function lc(e,t){for(var s=t+"Capture",l=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=Ei(e,s),o!=null&&l.unshift(rr(e,o,u)),o=Ei(e,t),o!=null&&l.push(rr(e,o,u))),e.tag===3)return l;e=e.return}return[]}function L1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dg(e,t,s,l,o){for(var u=t._reactName,y=[];s!==null&&s!==l;){var N=s,D=N.alternate,G=N.stateNode;if(N=N.tag,D!==null&&D===l)break;N!==5&&N!==26&&N!==27||G===null||(D=G,o?(G=Ei(s,u),G!=null&&y.unshift(rr(s,G,D))):o||(G=Ei(s,u),G!=null&&y.push(rr(s,G,D)))),s=s.return}y.length!==0&&e.push({event:t,listeners:y})}var U1=/\r\n?/g,H1=/\u0000|\uFFFD/g;function Ag(e){return(typeof e=="string"?e:""+e).replace(U1,`
|
|
49
|
-
`).replace(H1,"")}function Og(e,t){return t=Ag(t),Ag(e)===t}function it(e,t,s,l,o,u){switch(s){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Tl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Tl(e,""+l);else return;break;case"className":Fr(e,"class",l);break;case"tabIndex":Fr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Fr(e,s,l);break;case"style":Em(e,l,u);return;case"data":if(t!=="object"){Fr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Jr(l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="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 u=="function"&&(s==="formAction"?(t!=="input"&&it(e,t,"name",o.name,o,null),it(e,t,"formEncType",o.formEncType,o,null),it(e,t,"formMethod",o.formMethod,o,null),it(e,t,"formTarget",o.formTarget,o,null)):(it(e,t,"encType",o.encType,o,null),it(e,t,"method",o.method,o,null),it(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Jr(l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Sa);return;case"onScroll":l!=null&&qe("scroll",e);return;case"onScrollEnd":l!=null&&qe("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(s=l.__html,s!=null){if(o.children!=null)throw Error(c(60));u?.__html!==s&&(e.innerHTML=s)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Jr(l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Ir(e,"popover",l);break;case"xlinkActuate":Ha(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ha(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ha(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ha(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ha(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ha(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ir(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=aj.get(s)||s,Ir(e,s,l);else return}Je=!0}function vf(e,t,s,l,o,u){switch(s){case"style":Em(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(s=l.__html,s!=null){if(o.children!=null)throw Error(c(60));u?.__html!==s&&(e.innerHTML=s)}}break;case"children":if(typeof l=="string")Tl(e,l);else if(typeof l=="number"||typeof l=="bigint")Tl(e,""+l);else return;break;case"onScroll":l!=null&&qe("scroll",e);return;case"onScrollEnd":l!=null&&qe("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Sa);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!ym.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(o=s.endsWith("Capture"),u=s.slice(2,o?s.length-7:void 0),t=e[wn]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(u,t,o),typeof l=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(u,l,o);break e}Je=!0,s in e?e[s]=l:l===!0?e.setAttribute(s,""):Ir(e,s,l)}return}Je=!0}function tn(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var l=!1,o=!1,u;for(u in s)if(s.hasOwnProperty(u)){var y=s[u];if(y!=null)switch(u){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,u,y,s,null)}}o&&it(e,t,"srcSet",s.srcSet,s,null),l&&it(e,t,"src",s.src,s,null);return;case"input":qe("invalid",e);var N=u=y=o=null,D=null,G=null;for(l in s)if(s.hasOwnProperty(l)){var P=s[l];if(P!=null)switch(l){case"name":o=P;break;case"type":y=P;break;case"checked":D=P;break;case"defaultChecked":G=P;break;case"value":u=P;break;case"defaultValue":N=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(c(137,t));break;default:it(e,t,l,P,s,null)}}Sm(e,u,N,D,G,y,o,!1);return;case"select":qe("invalid",e),l=y=u=null;for(o in s)if(s.hasOwnProperty(o)&&(N=s[o],N!=null))switch(o){case"value":u=N;break;case"defaultValue":y=N;break;case"multiple":l=N;default:it(e,t,o,N,s,null)}t=u,s=y,e.multiple=!!l,t!=null?kl(e,!!l,t,!1):s!=null&&kl(e,!!l,s,!0);return;case"textarea":qe("invalid",e),u=o=l=null;for(y in s)if(s.hasOwnProperty(y)&&(N=s[y],N!=null))switch(y){case"value":l=N;break;case"defaultValue":o=N;break;case"children":u=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:it(e,t,y,N,s,null)}Tm(e,l,o,u);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(l=s[D],l!=null))switch(D){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:it(e,t,D,l,s,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(l=0;l<ir.length;l++)qe(ir[l],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(G in s)if(s.hasOwnProperty(G)&&(l=s[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,G,l,s,null)}return;default:if(bu(t)){for(P in s)s.hasOwnProperty(P)&&(l=s[P],l!==void 0&&vf(e,t,P,l,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(l=s[N],l!=null&&it(e,t,N,l,s,null))}var B1={};function $1(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,y=null,N=null,D=null,G=null,P=null;for(Z in s){var se=s[Z];if(s.hasOwnProperty(Z)&&se!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":D=se;default:l.hasOwnProperty(Z)||it(e,t,Z,null,l,se)}}for(var H in l){var Z=l[H];if(se=s[H],l.hasOwnProperty(H)&&(Z!=null||se!=null))switch(H){case"type":Z!==se&&(Je=!0),u=Z;break;case"name":Z!==se&&(Je=!0),o=Z;break;case"checked":Z!==se&&(Je=!0),G=Z;break;case"defaultChecked":Z!==se&&(Je=!0),P=Z;break;case"value":Z!==se&&(Je=!0),y=Z;break;case"defaultValue":Z!==se&&(Je=!0),N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:Z!==se&&it(e,t,H,Z,l,se)}}yu(e,y,N,D,G,P,u,o);return;case"select":Z=y=N=H=null;for(u in s)if(D=s[u],s.hasOwnProperty(u)&&D!=null)switch(u){case"value":break;case"multiple":Z=D;default:l.hasOwnProperty(u)||it(e,t,u,null,l,D)}for(o in l)if(u=l[o],D=s[o],l.hasOwnProperty(o)&&(u!=null||D!=null))switch(o){case"value":u!==D&&(Je=!0),H=u;break;case"defaultValue":u!==D&&(Je=!0),N=u;break;case"multiple":u!==D&&(Je=!0),y=u;default:u!==D&&it(e,t,o,u,l,D)}t=N,s=y,l=Z,H!=null?kl(e,!!s,H,!1):!!l!=!!s&&(t!=null?kl(e,!!s,t,!0):kl(e,!!s,s?[]:"",!1));return;case"textarea":Z=H=null;for(N in s)if(o=s[N],s.hasOwnProperty(N)&&o!=null&&!l.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:it(e,t,N,null,l,o)}for(y in l)if(o=l[y],u=s[y],l.hasOwnProperty(y)&&(o!=null||u!=null))switch(y){case"value":o!==u&&(Je=!0),H=o;break;case"defaultValue":o!==u&&(Je=!0),Z=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==u&&it(e,t,y,o,l,u)}km(e,H,Z);return;case"option":for(var pe in s)if(H=s[pe],s.hasOwnProperty(pe)&&H!=null&&!l.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:it(e,t,pe,null,l,H)}for(D in l)if(H=l[D],Z=s[D],l.hasOwnProperty(D)&&H!==Z&&(H!=null||Z!=null))switch(D){case"selected":H!==Z&&(Je=!0),e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:it(e,t,D,H,l,Z)}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 Te in s)H=s[Te],s.hasOwnProperty(Te)&&H!=null&&!l.hasOwnProperty(Te)&&it(e,t,Te,null,l,H);for(G in l)if(H=l[G],Z=s[G],l.hasOwnProperty(G)&&H!==Z&&(H!=null||Z!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(c(137,t));break;default:it(e,t,G,H,l,Z)}return;default:if(bu(t)){for(var Le in s)H=s[Le],s.hasOwnProperty(Le)&&H!==void 0&&!l.hasOwnProperty(Le)&&vf(e,t,Le,void 0,l,H);for(P in l)H=l[P],Z=s[P],!l.hasOwnProperty(P)||H===Z||H===void 0&&Z===void 0||vf(e,t,P,H,l,Z);return}}for(var $ in s)H=s[$],s.hasOwnProperty($)&&H!=null&&!l.hasOwnProperty($)&&it(e,t,$,null,l,H);for(se in l)H=l[se],Z=s[se],!l.hasOwnProperty(se)||H===Z||H==null&&Z==null||it(e,t,se,H,l,Z)}function Mg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var o=s[l],u=o.transferSize,y=o.initiatorType,N=o.duration;if(u&&N&&Mg(y)){for(y=0,N=o.responseEnd,l+=1;l<s.length;l++){var D=s[l],G=D.startTime;if(G>N)break;var P=D.transferSize,se=D.initiatorType;P&&Mg(se)&&(D=D.responseEnd,y+=P*(D<N?1:(N-G)/(D-G)))}if(--l,t+=8*(u+y)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var bf=null,jf=null;function or(e){return e.nodeType===9?e:e.ownerDocument}function _g(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 Lg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ug(e,t,s,l){return s=or(s).createElement(e),s[It]=l,s[wn]=t,tn(s,e,t),Yt(s),s}function Nf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wf=null;function G1(){var e=window.event;return e&&e.type==="popstate"?e===wf?!1:(wf=e,!0):(wf=null,!1)}var Sf=typeof setTimeout=="function"?setTimeout:void 0,Y1=typeof clearTimeout=="function"?clearTimeout:void 0,Hg=typeof Promise=="function"?Promise:void 0,Bg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Sf,V1=typeof queueMicrotask=="function"?queueMicrotask:typeof Hg<"u"?function(e){return Hg.resolve(null).then(e).catch(X1)}:Sf;function X1(e){setTimeout(function(){throw e})}function Ss(e){return e==="head"}function $g(e,t){var s=t,l=0;do{var o=s.nextSibling;if(e.removeChild(s),o&&o.nodeType===8)if(s=o.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(o),ci(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Af(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Af(s);for(var u=s.firstChild;u;){var y=u.nextSibling,N=u.nodeName;u[Ti]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&u.rel.toLowerCase()==="stylesheet"||s.removeChild(u),u=y}}else s==="body"&&Af(e.ownerDocument.body);s=o}while(s);ci(t)}function qg(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Gg(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var o=l=0;o<t.length;o++){var u=t[o];0<u.width&&0<u.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function Yg(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function K1(e,t,s){return s=s.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=s.innerHeight&&e.left<=s.innerWidth}}function kf(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return K1(t,s,e)}function Z1(e){return e.documentElement.clientHeight}function Q1(e){this.addEventListener("load",e),this.addEventListener("error",e)}function P1(e,t,s,l,o,u,y,N,D){var G=t.nodeType===9?t:t.ownerDocument;try{var P=G.startViewTransition({update:function(){var H=G.defaultView,Z=H.navigation&&H.navigation.transition,pe=G.fonts.status;l();var Te=[];if(pe==="loaded"&&(Z1(G),G.fonts.status==="loading"&&Te.push(G.fonts.ready)),pe=Te.length,e!==null)for(var Le=e.suspenseyImages,$=0,_=0;_<Le.length;_++){var K=Le[_];if(!K.complete){var ne=K.getBoundingClientRect();if(0<ne.bottom&&0<ne.right&&ne.top<H.innerHeight&&ne.left<H.innerWidth){if($+=uy(K),$>oc){Te.length=pe;break}K=new Promise(Q1.bind(K)),Te.push(K)}}}if(0<Te.length)return H=Promise.race([Promise.all(Te),new Promise(function(Se){return setTimeout(Se,500)})]).then(o,o),(Z?Promise.allSettled([Z.finished,H]):H).then(u,u);if(o(),Z)return Z.finished.then(u,u);u()},types:s});G.__reactViewTransition=P;var se=[];return P.ready.then(function(){for(var H=G.documentElement.getAnimations({subtree:!0}),Z=0;Z<H.length;Z++){var pe=H[Z],Te=pe.effect,Le=Te.pseudoElement;if(Le!=null&&Le.startsWith("::view-transition")){se.push(pe),pe=Te.getKeyframes();for(var $=Le=void 0,_=!0,K=0;K<pe.length;K++){var ne=pe[K],Se=ne.width;if(Le===void 0)Le=Se;else if(Le!==Se){_=!1;break}if(Se=ne.height,$===void 0)$=Se;else if($!==Se){_=!1;break}delete ne.width,delete ne.height,ne.transform==="none"&&delete ne.transform}_&&Le!==void 0&&$!==void 0&&(Te.setKeyframes(pe),_=getComputedStyle(Te.target,Te.pseudoElement),_.width!==Le||_.height!==$)&&(_=pe[0],_.width=Le,_.height=$,_=pe[pe.length-1],_.width=Le,_.height=$,Te.setKeyframes(pe))}}y()},function(H){G.__reactViewTransition===P&&(G.__reactViewTransition=null);try{if(typeof H=="object"&&H!==null)switch(H.name){case"InvalidStateError":(H.message==="View transition was skipped because document visibility state is hidden."||H.message==="Skipping view transition because document visibility state has become hidden."||H.message==="Skipping view transition because viewport size changed."||H.message==="Transition was aborted because of invalid state")&&(H=null)}H!==null&&D(H)}finally{l(),o(),y()}}),P.finished.finally(function(){for(var H=0;H<se.length;H++)se[H].cancel();G.__reactViewTransition===P&&(G.__reactViewTransition=null),N()}),P}catch{return l(),o(),y(),null}}function rl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}rl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:A({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},rl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),l=[],o=0;o<s.length;o++){var u=s[o].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(s[o])}return l},rl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vg(e){return{name:e,group:new rl("group",e),imagePair:new rl("image-pair",e),old:new rl("old",e),new:new rl("new",e)}}function Bn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bn.prototype.addEventListener=function(e,t,s){var l=null,o=null;if(!(s!=null&&typeof s!="boolean"&&(l=s.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(Kg(u,e,t,s)===-1){var y=this,N=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(N=function(D){y.removeEventListener(e,t,s),typeof t=="function"?t.call(this,D):t.handleEvent(D)}),l!==null&&(o=y.removeEventListener.bind(y,e,t,s),l.addEventListener("abort",o,{once:!0}),o=l.removeEventListener.bind(l,"abort",o)),l=ai(s),u.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:N,cleanup:o}),x(this._fragmentFiber.child,!1,I1,e,N,l)}this._eventListeners=u}};function I1(e,t,s,l){return w(e).addEventListener(t,s,l),!1}Bn.prototype.removeEventListener=function(e,t,s){var l=this._eventListeners;if(l!==null&&(t=Kg(l,e,t,s),t!==-1)){var o=l[t];s=o.attachedListener;var u=o.cleanup;o=ai(o.optionsOrUseCapture),x(this._fragmentFiber.child,!1,F1,e,s,o),l.splice(t,1),u!==null&&u()}};function F1(e,t,s,l){return w(e).removeEventListener(t,s,l),!1}function ai(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Xg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Kg(e,t,s,l){if(e.length===0)return-1;l=Xg(l);for(var o=0;o<e.length;o++){var u=e[o];if(u.type===t&&u.listener===s&&Xg(u.optionsOrUseCapture)===l)return o}return-1}Bn.prototype.dispatchEvent=function(e){var t=j(this._fragmentFiber);if(t===null)return!0;t=w(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var o=0;o<s.length;o++){var u=s[o];l.addEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),s)for(o=0;o<s.length;o++)u=s[o],l.removeEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Bn.prototype.focus=function(e){x(this._fragmentFiber.child,!0,Zg,e,void 0,void 0)};function Zg(e,t){return e.tag===6?!1:(e=w(e),cN(e,t))}Bn.prototype.focusLast=function(e){var t=[];x(this._fragmentFiber.child,!0,Tf,t,void 0,void 0);for(var s=t.length-1;0<=s&&!Zg(t[s],e);s--);};function Tf(e,t){return t.push(e),!1}Bn.prototype.blur=function(){var e=j(this._fragmentFiber);e!==null&&(e=w(e),e=or(e).activeElement,e!==null&&x(this._fragmentFiber.child,!1,J1,e,void 0,void 0))};function J1(e,t){return e.tag===6?!1:(e=w(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),x(this._fragmentFiber.child,!1,W1,e,void 0,void 0)};function W1(e,t){return e.tag===6||(e=w(e),t.observe(e)),!1}Bn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),x(this._fragmentFiber.child,!1,eN,e,void 0,void 0);for(var s=t=0;s<fa.length;s++){var l=fa[s];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):fa[t++]=l}fa.length=t}};function eN(e,t){return e.tag===6||(e=w(e),t.unobserve(e)),!1}var fa=[],Cf=!1;function tN(e,t,s){fa.push({fragmentInstance:e,observer:t,instance:s}),Cf||(Cf=!0,uN(function(){Cf=!1;var l=fa;fa=[];for(var o=0;o<l.length;o++){var u=l[o];u.observer.unobserve(u.instance)}}))}Bn.prototype.getClientRects=function(){var e=[];return x(this._fragmentFiber.child,!1,nN,e,void 0,void 0),e};function nN(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=w(e),t.push.apply(t,e.getClientRects());return!1}Bn.prototype.getRootNode=function(e){var t=j(this._fragmentFiber);return t===null?this:w(t).getRootNode(e)},Bn.prototype.compareDocumentPosition=function(e){var t=j(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];x(this._fragmentFiber.child,!1,Tf,s,void 0,void 0);var l=w(t);if(s.length===0){if(s=l,k(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(s=t)}t=this._fragmentFiber;var o=l=s.compareDocumentPosition(e);return s===e?o=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=z(t)[1],s===null?o=Node.DOCUMENT_POSITION_PRECEDING:(e=w(s).compareDocumentPosition(e),o=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),o|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=w(s[0]),o=w(s[s.length-1]);var u=k(this._fragmentFiber)?t.parentElement:l;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY;var y=t.compareDocumentPosition(e),N=o.compareDocumentPosition(e),D=y&Node.DOCUMENT_POSITION_CONTAINED_BY||N&Node.DOCUMENT_POSITION_CONTAINED_BY;return N=l&&u&&y&Node.DOCUMENT_POSITION_FOLLOWING&&N&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&o===e||D||N?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!u&&o===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:y,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||aN(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function aN(e,t,s,l,o){var u=$s(o);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){s=!0;break e}u=u.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=o.ownerDocument,o===u||o===u.documentElement||o===u.body;e:{for(u=t,t=j(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===s)&&(t=X(s,u,M),t===null?t=!1:(x(t,!0,O,u,s),u=R,R=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=X(l,u,M),t===null?t=!1:(x(t,!0,E,u,l),u=R,S=R=null,t=u!==null)),t):!1}function Qg(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Bn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(c(566));var t=[];x(this._fragmentFiber.child,!1,Tf,t,void 0,void 0);var s=e!==!1;if(t.length===0){var l=z(this._fragmentFiber);if(l=s?l[1]||l[0]||j(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=w(l),Qg(e,s);return}if(l=w(l),l.nodeType!==9){if(l.nodeType===11){s="host"in l?l.host:null,s!==null&&s.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=s?t.length-1:0;l!==(s?-1:t.length);){var o=t[l];o.tag===6?(o=w(o),Qg(o,s)):w(o).scrollIntoView(e),l+=s?-1:1}};function sN(e,t){return e=w(e),Pg(e,t),!1}function Pg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Ig(e,t){var s=t._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var o=s[l];e.addEventListener(o.type,o.attachedListener,ai(o.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(u){for(var y=0,N=0;N<fa.length;N++){var D=fa[N];(D.fragmentInstance!==t||D.observer!==u||D.instance!==e)&&(fa[y++]=D)}fa.length=y,u.observe(e)}),Pg(e,t))}function lN(e,t){var s=t._eventListeners;if(s!==null)for(var l=0;l<s.length;l++){var o=s[l];e.removeEventListener(o.type,o.attachedListener,ai(o.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(u){typeof u.rootMargin=="string"?tN(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ef(s),Pr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function iN(e,t,s,l){for(;e.nodeType===1;){var o=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ti])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=In(e.nextSibling),e===null)break}return null}function rN(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=In(e.nextSibling),e===null))return null;return e}function Fg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=In(e.nextSibling),e===null))return null;return e}function Rf(e){return e.data==="$?"||e.data==="$~"}function zf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function oN(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function In(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Df=null;function Jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return In(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Wg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function cN(e,t){function s(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return l}function uN(e){Bg(function(){Bg(function(t){return e(t)})})}function ey(e,t,s){switch(t=or(s),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function ty(e,t,s){for(var l in s){var o=s[l];s.hasOwnProperty(l)&&o!=null&&it(e,t,l,null,B1,o)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Sa&&(e.onclick=null),Pr(e)}function Af(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pr(e)}var Fn=new Map,ny=new Set;function cr(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Fa=ie.d;ie.d={f:dN,r:fN,D:hN,C:mN,L:pN,m:xN,X:yN,S:gN,M:vN};function dN(){var e=Fa.f(),t=Wo();return e||t}function fN(e){var t=Nl(e);t!==null&&t.tag===5&&t.type==="form"?sx(t):Fa.r(e)}var si=typeof document>"u"?null:document;function ay(e,t,s){var l=si;if(l&&typeof t=="string"&&t){var o=Yn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof s=="string"&&(o+='[crossorigin="'+s+'"]'),ny.has(o)||(ny.add(o),e={rel:e,crossOrigin:s,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),tn(t,"link",e),Yt(t),l.head.appendChild(t)))}}function hN(e){Fa.D(e),ay("dns-prefetch",e,null)}function mN(e,t){Fa.C(e,t),ay("preconnect",e,t)}function pN(e,t,s){Fa.L(e,t,s);var l=si;if(l&&e&&t){var o='link[rel="preload"][as="'+Yn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(o+='[imagesrcset="'+Yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(o+='[imagesizes="'+Yn(s.imageSizes)+'"]')):o+='[href="'+Yn(e)+'"]';var u=o;switch(t){case"style":u=li(e);break;case"script":u=ii(e)}if(!(Fn.has(u)||(e=A({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Fn.set(u,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(ur(u))||t==="script"&&l.querySelector(dr(u))))){var y=l.createElement("link");tn(y,"link",e),t==="style"&&(y[Qr]=!0,y.onload=y.onerror=function(){xm(y)}),Yt(y),l.head.appendChild(y)}}}function xN(e,t){Fa.m(e,t);var s=si;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Yn(l)+'"][href="'+Yn(e)+'"]',u=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ii(e)}if(!Fn.has(u)&&(e=A({rel:"modulepreload",href:e},t),Fn.set(u,e),s.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(dr(u)))return}l=s.createElement("link"),tn(l,"link",e),Yt(l),s.head.appendChild(l)}}}function gN(e,t,s){Fa.S(e,t,s);var l=si;if(l&&e){var o=wl(l).hoistableStyles,u=li(e);t=t||"default";var y=o.get(u);if(!y){var N={loading:0,preload:null};if(y=l.querySelector(ur(u)))N.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Fn.get(u))&&Of(e,s);var D=y=l.createElement("link");Yt(D),tn(D,"link",e),D._p=new Promise(function(G,P){D.onload=G,D.onerror=P}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ic(y,t,l)}y={type:"stylesheet",instance:y,count:1,state:N},o.set(u,y)}}}function yN(e,t){Fa.X(e,t);var s=si;if(s&&e){var l=wl(s).hoistableScripts,o=ii(e),u=l.get(o);u||(u=s.querySelector(dr(o)),u||(e=A({src:e,async:!0},t),(t=Fn.get(o))&&Mf(e,t),u=s.createElement("script"),Yt(u),tn(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function vN(e,t){Fa.M(e,t);var s=si;if(s&&e){var l=wl(s).hoistableScripts,o=ii(e),u=l.get(o);u||(u=s.querySelector(dr(o)),u||(e=A({src:e,async:!0,type:"module"},t),(t=Fn.get(o))&&Mf(e,t),u=s.createElement("script"),Yt(u),tn(u,"link",e),s.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function sy(e,t,s,l){var o=(o=xt.current)?cr(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=li(s.href),t=wl(o).hoistableStyles,l=t.get(s),l||(l={type:"style",instance:null,count:0,state:null},t.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=li(s.href);var u=wl(o).hoistableStyles,y=u.get(e);if(y||(o=o.ownerDocument||o,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,y),(u=o.querySelector(ur(e)))?u._p||(y.instance=u,y.state.loading=5):(u=Fn.get(e),u||(u={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Fn.set(e,u)),bN(o,e,u,y.state))),t&&l===null)throw Error(c(528,""));return y}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=ii(s),t=wl(o).hoistableScripts,l=t.get(s),l||(l={type:"script",instance:null,count:0,state:null},t.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function li(e){return'href="'+Yn(e)+'"'}function ur(e){return'link[rel="stylesheet"]['+e+"]"}function ly(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function bN(e,t,s,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Qr]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Qr]=!0,t.onload=t.onerror=xm.bind(null,t),tn(t,"link",s),Yt(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function ii(e){return'[src="'+Yn(e)+'"]'}function dr(e){return"script[async]"+e}function iy(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Yn(s.href)+'"]');if(l)return t.instance=l,Yt(l),l;var o=A({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Yt(l),tn(l,"style",o),ic(l,s.precedence,e),t.instance=l;case"stylesheet":o=li(s.href);var u=e.querySelector(ur(o));if(u)return t.state.loading|=4,t.instance=u,Yt(u),u;l=ly(s),(o=Fn.get(o))&&Of(l,o),u=(e.ownerDocument||e).createElement("link"),Yt(u);var y=u;return y._p=new Promise(function(N,D){y.onload=N,y.onerror=D}),tn(u,"link",l),t.state.loading|=4,ic(u,s.precedence,e),t.instance=u;case"script":return u=ii(s.src),(o=e.querySelector(dr(u)))?(t.instance=o,Yt(o),o):(l=s,(o=Fn.get(u))&&(l=A({},s),Mf(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),Yt(o),tn(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,ic(l,s.precedence,e));return t.instance}function ic(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,u=o,y=0;y<l.length;y++){var N=l[y];if(N.dataset.precedence===t)u=N;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Of(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Mf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rc=null;function ry(e,t,s){if(rc===null){var l=new Map,o=rc=new Map;o.set(s,l)}else o=rc,l=o.get(s),l||(l=new Map,o.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),o=0;o<s.length;o++){var u=s[o];if(!(u[Ti]||u[It]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var y=u.getAttribute(t)||"";y=e+y;var N=l.get(y);N?N.push(u):l.set(y,[u])}}return l}function _f(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function jN(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function oy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function cy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function dy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=uy(t),e.suspenseyImages.push(t)),e=SN.bind(e),t.decode().then(e,e))}function NN(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var o=li(l.href),u=t.querySelector(ur(o));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=u,Yt(u);return}u=t.ownerDocument||t,l=ly(l),(o=Fn.get(o))&&Of(l,o),u=u.createElement("link"),Yt(u);var y=u;y._p=new Promise(function(N,D){y.onload=N,y.onerror=D}),tn(u,"link",l),s.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=fr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var oc=0;function wN(e,t){return e.stylesheets&&e.count===0&&uc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&uc(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&oc===0&&(oc=62500*q1());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uc(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>oc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function fy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)uc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fr(){this.count--,fy(this)}function SN(){this.imgCount--,fy(this)}var cc=null;function uc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cc=new Map,t.forEach(kN,e),cc=null,fr.call(e))}function kN(e,t){if(!(t.state.loading&4)){var s=cc.get(e);if(s)var l=s.get(null);else{s=new Map,cc.set(e,s);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var y=o[u];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),l=y)}l&&s.set(null,l)}o=t.instance,y=o.getAttribute("data-precedence"),u=s.get(y)||l,u===l&&s.set(null,o),s.set(y,o),this.count++,l=fr.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ri={$$typeof:le,Provider:null,Consumer:null,_currentValue:Pe,_currentValue2:Pe,_threadCount:0};function TN(e,t,s,l,o,u,y,N,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=mu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mu(0),this.hiddenUpdates=mu(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.transitionTypes=null,this.incompleteTransitions=new Map}function hy(e,t,s,l,o,u,y,N,D,G,P,se){return e=new TN(e,t,s,y,D,G,P,se,N),t=1,u===!0&&(t|=24),u=Sn(3,null,null,t),e.current=u,u.stateNode=e,t=Pu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:s,cache:t},Wu(u),e}function my(e){return e?(e=Ol,e):Ol}function py(e,t,s,l,o,u){o=my(o),l.context===null?l.context=o:l.pendingContext=o,l=fs(t),l.payload={element:s},u=u===void 0?null:u,u!==null&&(l.callback=u),s=hs(e,l,t),s!==null&&(En(s,e,t),Yi(s,e,t))}function xy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Lf(e,t){xy(e,t),(e=e.alternate)&&xy(e,t)}function gy(e){if(e.tag===13||e.tag===31){var t=Vs(e,67108864);t!==null&&En(t,e,67108864),Lf(e,67108864)}}function yy(e){if(e.tag===13||e.tag===31){var t=Hn();t=pu(t);var s=Vs(e,t);s!==null&&En(s,e,t),Lf(e,t)}}var oi=!0;function CN(e,t,s,l){var o=me.T;me.T=null;var u=ie.p;try{ie.p=2,Uf(e,t,s,l)}finally{ie.p=u,me.T=o}}function EN(e,t,s,l){var o=me.T;me.T=null;var u=ie.p;try{ie.p=8,Uf(e,t,s,l)}finally{ie.p=u,me.T=o}}function Uf(e,t,s,l){if(oi){var o=Hf(l);if(o===null)yf(e,t,l,dc,s),by(e,l);else if(zN(o,e,t,s,l))l.stopPropagation();else if(by(e,l),t&4&&-1<RN.indexOf(e)){for(;o!==null;){var u=Nl(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var y=ia(u.pendingLanes);if(y!==0){var N=u;for(N.pendingLanes|=2,N.entangledLanes|=2;y;){var D=1<<31-Nt(y);N.entanglements[1]|=D,y&=~D}Ma(u),(We&6)===0&&(Io=Ke()+500,lr(0))}}break;case 31:case 13:N=Vs(u,2),N!==null&&En(N,u,2),Wo(),Lf(u,2)}if(u=Hf(l),u===null&&yf(e,t,l,dc,s),u===o)break;o=u}o!==null&&l.stopPropagation()}else yf(e,t,l,null,s)}}function Hf(e){return e=Nu(e),Bf(e)}var dc=null;function Bf(e){if(dc=null,e=$s(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=m(t),e!==null)return e;e=null}else if(s===31){if(e=h(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return dc=e,null}function vy(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Pt()){case Kr:return 2;case Ut:return 8;case Gt:case on:return 32;case sa:return 268435456;default:return 32}default:return 32}}var $f=!1,ks=null,Ts=null,Cs=null,hr=new Map,mr=new Map,Es=[],RN="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 by(e,t){switch(e){case"focusin":case"focusout":ks=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":Cs=null;break;case"pointerover":case"pointerout":hr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mr.delete(t.pointerId)}}function pr(e,t,s,l,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:u,targetContainers:[o]},t!==null&&(t=Nl(t),t!==null&&gy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function zN(e,t,s,l,o){switch(t){case"focusin":return ks=pr(ks,e,t,s,l,o),!0;case"dragenter":return Ts=pr(Ts,e,t,s,l,o),!0;case"mouseover":return Cs=pr(Cs,e,t,s,l,o),!0;case"pointerover":var u=o.pointerId;return hr.set(u,pr(hr.get(u)||null,e,t,s,l,o)),!0;case"gotpointercapture":return u=o.pointerId,mr.set(u,pr(mr.get(u)||null,e,t,s,l,o)),!0}return!1}function jy(e){var t=$s(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=m(s),t!==null){e.blockedOn=t,hm(e.priority,function(){yy(s)});return}}else if(t===31){if(t=h(s),t!==null){e.blockedOn=t,hm(e.priority,function(){yy(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Hf(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);ju=l,s.target.dispatchEvent(l),ju=null}else return t=Nl(s),t!==null&&gy(t),e.blockedOn=s,!1;t.shift()}return!0}function Ny(e,t,s){fc(e)&&s.delete(t)}function DN(){$f=!1,ks!==null&&fc(ks)&&(ks=null),Ts!==null&&fc(Ts)&&(Ts=null),Cs!==null&&fc(Cs)&&(Cs=null),hr.forEach(Ny),mr.forEach(Ny)}function hc(e,t){e.blockedOn===t&&(e.blockedOn=null,$f||($f=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,DN)))}var mc=null;function wy(e){mc!==e&&(mc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){mc===e&&(mc=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if(Bf(l||s)===null)continue;break}var u=Nl(s);u!==null&&(e.splice(t,3),t-=3,bd(u,{pending:!0,data:o,method:s.method,action:l},l,o))}}))}function ci(e){function t(D){return hc(D,e)}ks!==null&&hc(ks,e),Ts!==null&&hc(Ts,e),Cs!==null&&hc(Cs,e),hr.forEach(t),mr.forEach(t);for(var s=0;s<Es.length;s++){var l=Es[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Es.length&&(s=Es[0],s.blockedOn===null);)jy(s),s.blockedOn===null&&Es.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var o=s[l],u=s[l+1],y=o[wn]||null;if(typeof u=="function")y||wy(s);else if(y){var N=null;if(u&&u.hasAttribute("formAction")){if(o=u,y=u[wn]||null)N=y.formAction;else if(Bf(o)!==null)continue}else N=y.action;typeof N=="function"?s[l+1]=N:(s.splice(l,3),l-=3),wy(s)}}}function Sy(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(y){return o=y})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function qf(e){this._internalRoot=e}pc.prototype.render=qf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,l=Hn();py(s,l,e,t,null,null)},pc.prototype.unmount=qf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;py(e.current,2,null,e,null,null),Wo(),t[jl]=null}};function pc(e){this._internalRoot=e}pc.prototype.unstable_scheduleHydration=function(e){if(e){var t=fm();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Es.length&&t!==0&&t<Es[s].priority;s++);Es.splice(s,0,e),s===0&&jy(e)}};var ky=i.version;if(ky!=="19.3.1")throw Error(c(527,ky,"19.3.1"));ie.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var AN={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xc.isDisabled&&xc.supportsFiber)try{an=xc.inject(AN),At=xc}catch{}}return gr.createRoot=function(e,t){if(!d(e))throw Error(c(299));var s=!1,l="",o=mx,u=px,y=xx;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=hy(e,1,!1,null,null,s,l,null,o,u,y,Sy),e[jl]=t.current,gf(e),new qf(t)},gr.hydrateRoot=function(e,t,s){if(!d(e))throw Error(c(299));var l=!1,o="",u=mx,y=px,N=xx,D=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(u=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=hy(e,1,!0,t,s??null,l,o,D,u,y,N,Sy),t.context=my(null),s=t.current,l=Hn(),l=pu(l),o=fs(l),o.callback=null,hs(s,o,l),s=l,t.current.lanes=s,ki(t,s),Ma(t),e[jl]=t.current,gf(e),new pc(t)},gr.version="19.3.1",gr}var _y;function GN(){if(_y)return Vf.exports;_y=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Vf.exports=qN(),Vf.exports}var YN=GN();/**
|
|
50
|
-
* react-router v7.18.6
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var Zc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Fv=/^[\\/]{2}/;function VN(n,i){return i+n.replace(/\\/g,"/")}var Ly="popstate";function Uy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function XN(n={}){function i(d,f){let{pathname:m="/",search:h="",hash:g=""}=xl(d.location.hash.substring(1));return!m.startsWith("/")&&!m.startsWith(".")&&(m="/"+m),fh("",{pathname:m,search:h,hash:g},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function r(d,f){let m=d.document.querySelector("base"),h="";if(m&&m.getAttribute("href")){let g=d.location.href,v=g.indexOf("#");h=v===-1?g:g.slice(0,v)}return h+"#"+(typeof f=="string"?f:pi(f))}function c(d,f){ea(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(f)})`)}return ZN(i,r,c,n)}function vt(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function ea(n,i){if(!n){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function KN(){return Math.random().toString(36).substring(2,10)}function Hy(n,i){return{usr:n.state,key:n.key,idx:i,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function fh(n,i,r=null,c,d){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof i=="string"?xl(i):i,state:r,key:i&&i.key||c||KN(),mask:d}}function pi({pathname:n="/",search:i="",hash:r=""}){return i&&i!=="?"&&(n+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(n+=r.charAt(0)==="#"?r:"#"+r),n}function xl(n){let i={};if(n){let r=n.indexOf("#");r>=0&&(i.hash=n.substring(r),n=n.substring(0,r));let c=n.indexOf("?");c>=0&&(i.search=n.substring(c),n=n.substring(0,c)),n&&(i.pathname=n)}return i}function ZN(n,i,r,c={}){let{window:d=document.defaultView,v5Compat:f=!1}=c,m=d.history,h="POP",g=null,v=b();v==null&&(v=0,m.replaceState({...m.state,idx:v},""));function b(){return(m.state||{idx:null}).idx}function x(){h="POP";let w=b(),R=w==null?null:w-v;v=w,g&&g({action:h,location:T.location,delta:R})}function j(w,R){h="PUSH";let S=Uy(w)?w:fh(T.location,w,R);r&&r(S,w),v=b()+1;let O=Hy(S,v),E=T.createHref(S.mask||S);try{m.pushState(O,"",E)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;d.location.assign(E)}f&&g&&g({action:h,location:T.location,delta:1})}function k(w,R){h="REPLACE";let S=Uy(w)?w:fh(T.location,w,R);r&&r(S,w),v=b();let O=Hy(S,v),E=T.createHref(S.mask||S);m.replaceState(O,"",E),f&&g&&g({action:h,location:T.location,delta:0})}function z(w){return QN(d,w)}let T={get action(){return h},get location(){return n(d,m)},listen(w){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Ly,x),g=w,()=>{d.removeEventListener(Ly,x),g=null}},createHref(w){return i(d,w)},createURL:z,encodeLocation(w){let R=z(w);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:j,replace:k,go(w){return m.go(w)}};return T}function QN(n,i,r=!1){let c="http://localhost";n&&(c=n.location.origin!=="null"?n.location.origin:n.location.href),vt(c,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:pi(i);return d=d.replace(/ $/,"%20"),!r&&Fv.test(d)&&(d=c+d),new URL(d,c)}var hh=new URL("http://localhost");function Jv(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),hh)}catch{return hh}}function Qf(n,i){return n.origin===i.origin&&(n.origin!=="null"||n.protocol===i.protocol&&n.host===i.host)}function Wv(n,i){if(n.startsWith("//"))return!0;let r=i.protocol.toLowerCase();return n.toLowerCase().startsWith(r)?i.host===""||n.slice(r.length).startsWith("//"):!1}function eb(n){let i=n.replace(/[\t\n\r]/g,""),r=0;for(;i.charCodeAt(r)<=32;)r++;if(i=i.slice(r),!Zc.test(i))return;let c;try{c=new URL(n,hh)}catch{return}if(!Wv(n,c))throw new Error("External navigation is not allowed")}function tb(n,i,r,c){let d=null;try{d=n==null?null:new URL(n,r)}catch{}let f=new URL(i,r),m=d!=null&&!Qf(d,r),h=!Qf(f,r);if(c==="reject"){if(m||h)throw new Error("External navigation is not allowed")}else if(h&&(d==null||!Wv(n,d)||!Qf(d,f)))throw new Error("External navigation is not allowed")}function nb(n,i,r="/"){return PN(n,i,r,!1)}function PN(n,i,r,c,d){let f=typeof i=="string"?xl(i):i,m=es(f.pathname||"/",r);if(m==null)return null;let h=IN(n),g=null,v=r2(m);for(let b=0;g==null&&b<h.length;++b)g=i2(h[b],v,c);return g}function IN(n){let i=ab(n);return FN(i),i}function ab(n,i=[],r=[],c="",d=!1){let f=(m,h,g=d,v)=>{let b={relativePath:v===void 0?m.path||"":v,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(c)&&g)return;vt(b.relativePath.startsWith(c),`Absolute route path "${b.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(c.length)}let x=ha([c,b.relativePath]),j=r.concat(b);m.children&&m.children.length>0&&(vt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),ab(m.children,i,j,x,g)),!(m.path==null&&!m.index)&&i.push({path:x,score:s2(x,m.index),routesMeta:j.map((k,z)=>{let[T,w]=ib(k.relativePath,k.caseSensitive,z===j.length-1);return{...k,matcher:T,compiledParams:w}})})};return n.forEach((m,h)=>{if(m.path===""||!m.path?.includes("?"))f(m,h);else for(let g of sb(m.path))f(m,h,!0,g)}),i}function sb(n){let i=n.split("/");if(i.length===0)return[];let[r,...c]=i,d=r.endsWith("?"),f=r.replace(/\?$/,"");if(c.length===0)return d?[f,""]:[f];let m=sb(c.join("/")),h=[];return h.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&h.push(...m),h.map(g=>n.startsWith("/")&&g===""?"/":g)}function FN(n){n.sort((i,r)=>i.score!==r.score?r.score-i.score:l2(i.routesMeta.map(c=>c.childrenIndex),r.routesMeta.map(c=>c.childrenIndex)))}var JN=/^:[\w-]+$/,WN=3,e2=2,t2=1,n2=10,a2=-2,By=n=>n==="*";function s2(n,i){let r=n.split("/"),c=r.length;return r.some(By)&&(c+=a2),i&&(c+=e2),r.filter(d=>!By(d)).reduce((d,f)=>d+(JN.test(f)?WN:f===""?t2:n2),c)}function l2(n,i){return n.length===i.length&&n.slice(0,-1).every((c,d)=>c===i[d])?n[n.length-1]-i[i.length-1]:0}function i2(n,i,r=!1){let{routesMeta:c}=n,d={},f="/",m=[];for(let h=0;h<c.length;++h){let g=c[h],v=h===c.length-1,b=f==="/"?i:i.slice(f.length)||"/",x={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},j=g.matcher&&g.compiledParams?lb(x,b,g.matcher,g.compiledParams):Oc(x,b),k=g.route;if(!j&&v&&r&&!c[c.length-1].route.index&&(j=Oc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!j)return null;Object.assign(d,j.params),m.push({params:d,pathname:ha([f,j.pathname]),pathnameBase:u2(ha([f,j.pathnameBase])),route:k}),j.pathnameBase!=="/"&&(f=ha([f,j.pathnameBase]))}return m}function Oc(n,i){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[r,c]=ib(n.path,n.caseSensitive,n.end);return lb(n,i,r,c)}function lb(n,i,r,c){let d=i.match(r);if(!d)return null;let f=d[0],m=xi(f,1),h=d.slice(1);return{params:c.reduce((v,{paramName:b,isOptional:x},j)=>{if(b==="*"){let z=h[j]||"";m=xi(f.slice(0,f.length-z.length),1)}const k=h[j];return x&&!k?v[b]=void 0:v[b]=(k||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:m,pattern:n}}function ib(n,i=!1,r=!0){ea(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let c=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,h,g,v,b)=>{if(c.push({paramName:h,isOptional:g!=null}),g){let x=b.charAt(v+m.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(c.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),c]}function r2(n){try{return n.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return ea(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),n}}function es(n,i){if(i==="/")return n;if(!n.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,c=n.charAt(r);return c&&c!=="/"?null:n.slice(r)||"/"}function o2(n,i="/"){let{pathname:r,search:c="",hash:d=""}=typeof n=="string"?xl(n):n,f;return r?(r=ob(r),r.startsWith("/")||r.startsWith("\\")?f=$y(r.substring(1),"/"):f=$y(r,i)):f=i,{pathname:f,search:d2(c),hash:f2(d)}}function $y(n,i){let r=xi(i).split("/");return n.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Pf(n,i,r,c){return`Cannot include a '${n}' character in a manually specified \`to.${i}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function c2(n){return n.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function rb(n){let i=c2(n);return i.map((r,c)=>c===i.length-1?r.pathname:r.pathnameBase)}function Mh(n,i,r,c=!1){let d;typeof n=="string"?d=xl(n):(d={...n},vt(!d.pathname||!d.pathname.includes("?"),Pf("?","pathname","search",d)),vt(!d.pathname||!d.pathname.includes("#"),Pf("#","pathname","hash",d)),vt(!d.search||!d.search.includes("#"),Pf("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,h;if(m==null)h=r;else{let x=i.length-1;if(!c&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;d.pathname=j.join("/")}h=x>=0?i[x]:"/"}let g=o2(d,h),v=m&&m!=="/"&&m.endsWith("/"),b=(f||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(v||b)&&(g.pathname+="/"),g}var ob=n=>n.replace(/[\\/]{2,}/g,"/"),ha=n=>ob(n.join("/"));function xi(n,i=0){let r=n.length;for(;r>i&&n.charCodeAt(r-1)===47;)r--;return r===n.length?n:n.slice(0,r)}var u2=n=>xi(n).replace(/^\/*/,"/"),d2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,f2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,h2=class{constructor(n,i,r,c=!1){this.status=n,this.statusText=i||"",this.internal=c,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function m2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function p2(n){let i=n.map(r=>r.route.path).filter(Boolean);return ha(i)||"/"}var cb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ub(n,i){let r=n;if(typeof r!="string"||!Zc.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let c=r,d=!1;if(cb)try{let f=new URL(window.location.href),m=Fv.test(r)?new URL(VN(r,f.protocol)):new URL(r),h=es(m.pathname,i);m.origin===f.origin&&h!=null?r=h+m.search+m.hash:d=!0}catch{ea(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var db=["POST","PUT","PATCH","DELETE"];new Set(db);var x2=["GET",...db];new Set(x2);var g2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function y2(n){try{return g2.includes(new URL(n).protocol)}catch{return!1}}var yi=p.createContext(null);yi.displayName="DataRouter";var Qc=p.createContext(null);Qc.displayName="DataRouterState";var fb=p.createContext(!1);function v2(){return p.useContext(fb)}var hb=p.createContext({isTransitioning:!1});hb.displayName="ViewTransition";var b2=p.createContext(new Map);b2.displayName="Fetchers";var j2=p.createContext(null);j2.displayName="Await";var ta=p.createContext(null);ta.displayName="Navigation";var Mr=p.createContext(null);Mr.displayName="Location";var _a=p.createContext({outlet:null,matches:[],isDataRoute:!1});_a.displayName="Route";var _h=p.createContext(null);_h.displayName="RouteError";var mb="REACT_ROUTER_ERROR",N2="REDIRECT",w2="ROUTE_ERROR_RESPONSE";function S2(n){if(n.startsWith(`${mb}:${N2}:{`))try{let i=JSON.parse(n.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function k2(n){if(n.startsWith(`${mb}:${w2}:{`))try{let i=JSON.parse(n.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new h2(i.status,i.statusText,i.data)}catch{}}function T2(n,{relative:i}={}){vt(_r(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:c}=p.useContext(ta),{hash:d,pathname:f,search:m}=Lr(n,{relative:i}),h=f;return r!=="/"&&(h=f==="/"?r:ha([r,f])),c.createHref({pathname:h,search:m,hash:d})}function _r(){return p.useContext(Mr)!=null}function qn(){return vt(_r(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Mr).location}var pb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xb(n){p.useContext(ta).static||p.useLayoutEffect(n)}function Pc(){let{isDataRoute:n}=p.useContext(_a);return n?q2():C2()}function C2(){vt(_r(),"useNavigate() may be used only in the context of a <Router> component.");let n=p.useContext(yi),{basename:i,navigator:r}=p.useContext(ta),{matches:c}=p.useContext(_a),{pathname:d}=qn(),f=JSON.stringify(rb(c)),m=p.useRef(!1);return xb(()=>{m.current=!0}),p.useCallback((g,v={})=>{if(ea(m.current,pb),!m.current)return;if(typeof g=="number"){r.go(g);return}let b=Mh(g,JSON.parse(f),d,v.relative==="path");n==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:ha([i,b.pathname])),tb(typeof g=="string"?g:pi(g),r.createHref(b),Jv(r),"reject"),(v.replace?r.replace:r.push)(b,v.state,v)},[i,r,f,d,n])}var E2=p.createContext(null);function R2(n){let i=p.useContext(_a).outlet;return p.useMemo(()=>i&&p.createElement(E2.Provider,{value:n},i),[i,n])}function Lr(n,{relative:i}={}){let{matches:r}=p.useContext(_a),{pathname:c}=qn(),d=JSON.stringify(rb(r));return p.useMemo(()=>Mh(n,JSON.parse(d),c,i==="path"),[n,d,c,i])}function z2(n,i){return gb(n,i)}function gb(n,i,r){vt(_r(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=p.useContext(ta),{matches:d}=p.useContext(_a),f=d[d.length-1],m=f?f.params:{},h=f?f.pathname:"/",g=f?f.pathnameBase:"/",v=f&&f.route;{let w=v&&v.path||"";vb(h,!v||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${w}">) 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.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let b=qn(),x;if(i){let w=typeof i=="string"?xl(i):i;vt(g==="/"||w.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${w.pathname}" was given in the \`location\` prop.`),x=w}else x=b;let j=x.pathname||"/",k=j;if(g!=="/"){let w=g.replace(/^\//,"").split("/");k="/"+j.replace(/^\//,"").split("/").slice(w.length).join("/")}let z=r&&r.state.matches.length?r.state.matches.map(w=>Object.assign(w,{route:r.manifest[w.route.id]||w.route})):nb(n,{pathname:k});ea(v||z!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ea(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 T=_2(z&&z.map(w=>Object.assign({},w,{params:Object.assign({},m,w.params),pathname:ha([g,c.encodeLocation?c.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?g:ha([g,c.encodeLocation?c.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),d,r);return i&&T?p.createElement(Mr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...x},navigationType:"POP"}},T):T}function D2(){let n=$2(),i=m2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),r=n instanceof Error?n.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:f},"ErrorBoundary")," or"," ",p.createElement("code",{style:f},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},i),r?p.createElement("pre",{style:d},r):null,m)}var A2=p.createElement(D2,null),yb=class extends p.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,i){return i.location!==n.location||i.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:i.error,location:i.location,revalidation:n.revalidation||i.revalidation}}componentDidCatch(n,i){this.props.onError?this.props.onError(n,i):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const r=k2(n.digest);r&&(n=r)}let i=n!==void 0?p.createElement(_a.Provider,{value:this.props.routeContext},p.createElement(_h.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?p.createElement(O2,{error:n},i):i}};yb.contextType=fb;var If=new WeakMap;function O2({children:n,error:i}){let{basename:r,navigator:c}=p.useContext(ta);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let d=S2(i.digest);if(d){let f=If.get(i);if(f)throw f;let m=ub(d.location,r),h=m.absoluteURL||m.to;if(tb(d.location,h,Jv(c),"allow-explicit"),y2(h))throw new Error("Invalid redirect location");if(cb&&!If.get(i))if(m.isExternal||d.reloadDocument)window.location.href=h;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw If.set(i,g),g}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return n}function M2({routeContext:n,match:i,children:r}){let c=p.useContext(yi);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(_a.Provider,{value:n},r)}function _2(n,i=[],r){let c=r?.state;if(n==null){if(!c)return null;if(c.errors)n=c.matches;else if(i.length===0&&!c.initialized&&c.matches.length>0)n=c.matches;else return null}let d=n,f=c?.errors;if(f!=null){let b=d.findIndex(x=>x.route.id&&f?.[x.route.id]!==void 0);vt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let m=!1,h=-1;if(r&&c){m=c.renderFallback;for(let b=0;b<d.length;b++){let x=d[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=b),x.route.id){let{loaderData:j,errors:k}=c,z=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!k||k[x.route.id]===void 0);if(x.route.lazy||z){r.isStatic&&(m=!0),h>=0?d=d.slice(0,h+1):d=[d[0]];break}}}}let g=r?.onError,v=c&&g?(b,x)=>{g(b,{location:c.location,params:c.matches?.[0]?.params??{},pattern:p2(c.matches),errorInfo:x})}:void 0;return d.reduceRight((b,x,j)=>{let k,z=!1,T=null,w=null;c&&(k=f&&x.route.id?f[x.route.id]:void 0,T=x.route.errorElement||A2,m&&(h<0&&j===0?(vb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,w=null):h===j&&(z=!0,w=x.route.hydrateFallbackElement||null)));let R=i.concat(d.slice(0,j+1)),S=()=>{let O;return k?O=T:z?O=w:x.route.Component?O=p.createElement(x.route.Component,null):x.route.element?O=x.route.element:O=b,p.createElement(M2,{match:x,routeContext:{outlet:b,matches:R,isDataRoute:c!=null},children:O})};return c&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?p.createElement(yb,{location:c.location,revalidation:c.revalidation,component:T,error:k,children:S(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):S()},null)}function Lh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L2(n){let i=p.useContext(yi);return vt(i,Lh(n)),i}function U2(n){let i=p.useContext(Qc);return vt(i,Lh(n)),i}function H2(n){let i=p.useContext(_a);return vt(i,Lh(n)),i}function Uh(n){let i=H2(n),r=i.matches[i.matches.length-1];return vt(r.route.id,`${n} can only be used on routes that contain a unique "id"`),r.route.id}function B2(){return Uh("useRouteId")}function $2(){let n=p.useContext(_h),i=U2("useRouteError"),r=Uh("useRouteError");return n!==void 0?n:i.errors?.[r]}function q2(){let{router:n}=L2("useNavigate"),i=Uh("useNavigate"),r=p.useRef(!1);return xb(()=>{r.current=!0}),p.useCallback(async(d,f={})=>{ea(r.current,pb),r.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:i,...f}))},[n,i])}var qy={};function vb(n,i,r){!i&&!qy[n]&&(qy[n]=!0,ea(!1,r))}p.memo(G2);function G2({routes:n,manifest:i,future:r,state:c,isStatic:d,onError:f}){return gb(n,void 0,{manifest:i,state:c,isStatic:d,onError:f})}function Y2(n){return R2(n.context)}function Jn(n){vt(!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 V2({basename:n="/",children:i=null,location:r,navigationType:c="POP",navigator:d,static:f=!1,useTransitions:m}){vt(!_r(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:h,navigator:d,static:f,useTransitions:m,future:{}}),[h,d,f,m]);typeof r=="string"&&(r=xl(r));let{pathname:v="/",search:b="",hash:x="",state:j=null,key:k="default",mask:z}=r,T=p.useMemo(()=>{let w=es(v,h);return w==null?null:{location:{pathname:w,search:b,hash:x,state:j,key:k,mask:z},navigationType:c}},[h,v,b,x,j,k,c,z]);return ea(T!=null,`<Router basename="${h}"> is not able to match the URL "${v}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:p.createElement(ta.Provider,{value:g},p.createElement(Mr.Provider,{children:i,value:T}))}function X2({children:n,location:i}){return z2(mh(n),i)}function mh(n,i=[]){let r=[];return p.Children.forEach(n,(c,d)=>{if(!p.isValidElement(c))return;let f=[...i,d];if(c.type===p.Fragment){r.push.apply(r,mh(c.props.children,f));return}vt(c.type===Jn,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),vt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=mh(c.props.children,f)),r.push(m)}),r}var kc="get",Tc="application/x-www-form-urlencoded";function Ic(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function K2(n){return Ic(n)&&n.tagName.toLowerCase()==="button"}function Z2(n){return Ic(n)&&n.tagName.toLowerCase()==="form"}function Q2(n){return Ic(n)&&n.tagName.toLowerCase()==="input"}function P2(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function I2(n,i){return n.button===0&&(!i||i==="_self")&&!P2(n)}function ph(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((i,r)=>{let c=n[r];return i.concat(Array.isArray(c)?c.map(d=>[r,d]):[[r,c]])},[]))}function F2(n,i){let r=ph(n);return i&&i.forEach((c,d)=>{r.has(d)||i.getAll(d).forEach(f=>{r.append(d,f)})}),r}var gc=null;function J2(){if(gc===null)try{new FormData(document.createElement("form"),0),gc=!1}catch{gc=!0}return gc}var W2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ff(n){return n!=null&&!W2.has(n)?(ea(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tc}"`),null):n}function ew(n,i){let r,c,d,f,m;if(Z2(n)){let h=n.getAttribute("action");c=h?es(h,i):null,r=n.getAttribute("method")||kc,d=Ff(n.getAttribute("enctype"))||Tc,f=new FormData(n)}else if(K2(n)||Q2(n)&&(n.type==="submit"||n.type==="image")){let h=n.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||h.getAttribute("action");if(c=g?es(g,i):null,r=n.getAttribute("formmethod")||h.getAttribute("method")||kc,d=Ff(n.getAttribute("formenctype"))||Ff(h.getAttribute("enctype"))||Tc,f=new FormData(h,n),!J2()){let{name:v,type:b,value:x}=n;if(b==="image"){let j=v?`${v}.`:"";f.append(`${j}x`,"0"),f.append(`${j}y`,"0")}else v&&f.append(v,x)}}else{if(Ic(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=kc,c=null,d=Tc,m=n}return f&&d==="text/plain"&&(m=f,f=void 0),{action:c,method:r.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hh(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function bb(n,i,r,c){let d=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return r?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:i&&es(d.pathname,i)==="/"?d.pathname=`${xi(i)}/_root.${c}`:d.pathname=`${xi(d.pathname)}.${c}`,d}async function tw(n,i){if(n.id in i)return i[n.id];try{let r=await import(n.module);return i[n.id]=r,r}catch(r){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function aw(n,i,r){let c=await Promise.all(n.map(async d=>{let f=i.routes[d.route.id];if(f){let m=await tw(f,r);return m.links?m.links():[]}return[]}));return rw(c.flat(1).filter(nw).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Gy(n,i,r,c,d,f){let m=(g,v)=>r[v]?g.route.id!==r[v].route.id:!0,h=(g,v)=>r[v].pathname!==g.pathname||r[v].route.path?.endsWith("*")&&r[v].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,v)=>m(g,v)||h(g,v)):f==="data"?i.filter((g,v)=>{let b=c.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,v)||h(g,v))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function sw(n,i,{includeHydrateFallback:r}={}){return lw(n.map(c=>{let d=i.routes[c.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function lw(n){return[...new Set(n)]}function iw(n){let i={},r=Object.keys(n).sort();for(let c of r)i[c]=n[c];return i}function rw(n,i){let r=new Set;return new Set(i),n.reduce((c,d)=>{let f=JSON.stringify(iw(d));return r.has(f)||(r.add(f),c.push({key:f,link:d})),c},[])}function Bh(){let n=p.useContext(yi);return Hh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function ow(){let n=p.useContext(Qc);return Hh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var $h=p.createContext(void 0);$h.displayName="FrameworkContext";function Fc(){let n=p.useContext($h);return Hh(n,"You must render this element inside a <HydratedRouter> element"),n}function cw(n,i){let r=p.useContext($h),[c,d]=p.useState(!1),[f,m]=p.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:v,onMouseLeave:b,onTouchStart:x}=i,j=p.useRef(null);p.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=R=>{R.forEach(S=>{m(S.isIntersecting)})},w=new IntersectionObserver(T,{threshold:.5});return j.current&&w.observe(j.current),()=>{w.disconnect()}}},[n]),p.useEffect(()=>{if(c){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[c]);let k=()=>{d(!0)},z=()=>{d(!1),m(!1)};return r?n!=="intent"?[f,j,{}]:[f,j,{onFocus:yr(h,k),onBlur:yr(g,z),onMouseEnter:yr(v,k),onMouseLeave:yr(b,z),onTouchStart:yr(x,k)}]:[!1,j,{}]}function yr(n,i){return r=>{n&&n(r),r.defaultPrevented||i(r)}}function uw({page:n,...i}){let r=v2(),{nonce:c}=Fc(),{router:d}=Bh(),f=p.useMemo(()=>nb(d.routes,n,d.basename),[d.routes,n,d.basename]);return f?(i.nonce==null&&c&&(i={...i,nonce:c}),r?p.createElement(fw,{page:n,matches:f,...i}):p.createElement(hw,{page:n,matches:f,...i})):null}function dw(n){let{manifest:i,routeModules:r}=Fc(),[c,d]=p.useState([]);return p.useEffect(()=>{let f=!1;return aw(n,i,r).then(m=>{f||d(m)}),()=>{f=!0}},[n,i,r]),c}function fw({page:n,matches:i,...r}){let c=qn(),{future:d}=Fc(),{basename:f}=Bh(),m=p.useMemo(()=>{if(n===c.pathname+c.search+c.hash)return[];let h=bb(n,f,d.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?g=!0:v.push(b.route.id);return g&&v.length>0&&h.searchParams.set("_routes",v.join(",")),[h.pathname+h.search]},[f,d.v8_trailingSlashAwareDataRequests,n,c,i]);return p.createElement(p.Fragment,null,m.map(h=>p.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...r})))}function hw({page:n,matches:i,...r}){let c=qn(),{future:d,manifest:f,routeModules:m}=Fc(),{basename:h}=Bh(),{loaderData:g,matches:v}=ow(),b=p.useMemo(()=>Gy(n,i,v,f,c,"data"),[n,i,v,f,c]),x=p.useMemo(()=>Gy(n,i,v,f,c,"assets"),[n,i,v,f,c]),j=p.useMemo(()=>{if(n===c.pathname+c.search+c.hash)return[];let T=new Set,w=!1;if(i.forEach(S=>{let O=f.routes[S.route.id];!O||!O.hasLoader||(!b.some(E=>E.route.id===S.route.id)&&S.route.id in g&&m[S.route.id]?.shouldRevalidate||O.hasClientLoader?w=!0:T.add(S.route.id))}),T.size===0)return[];let R=bb(n,h,d.v8_trailingSlashAwareDataRequests,"data");return w&&T.size>0&&R.searchParams.set("_routes",i.filter(S=>T.has(S.route.id)).map(S=>S.route.id).join(",")),[R.pathname+R.search]},[h,d.v8_trailingSlashAwareDataRequests,g,c,f,b,i,n,m]),k=p.useMemo(()=>sw(x,f),[x,f]),z=dw(x);return p.createElement(p.Fragment,null,j.map(T=>p.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...r})),k.map(T=>p.createElement("link",{key:T,rel:"modulepreload",href:T,...r})),z.map(({key:T,link:w})=>p.createElement("link",{key:T,nonce:r.nonce,...w,crossOrigin:w.crossOrigin??r.crossOrigin})))}function mw(...n){return i=>{n.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var pw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pw&&(window.__reactRouterVersion="7.18.6")}catch{}function xw({basename:n,children:i,useTransitions:r,window:c}){let d=p.useRef();d.current==null&&(d.current=XN({window:c,v5Compat:!0}));let f=d.current,[m,h]=p.useState({action:f.action,location:f.location}),g=p.useCallback(v=>{r===!1?h(v):p.startTransition(()=>h(v))},[r]);return p.useLayoutEffect(()=>f.listen(g),[f,g]),p.createElement(V2,{basename:n,children:i,location:m.location,navigationType:m.action,navigator:f,useTransitions:r})}var kt=p.forwardRef(function({onClick:i,discover:r="render",prefetch:c="none",relative:d,reloadDocument:f,replace:m,mask:h,state:g,target:v,to:b,preventScrollReset:x,viewTransition:j,defaultShouldRevalidate:k,...z},T){let{basename:w,navigator:R,useTransitions:S}=p.useContext(ta),O=typeof b=="string"&&Zc.test(b),E=ub(b,w);b=E.to;let M=T2(b,{relative:d}),X=qn(),A=null;if(h){let Q=Mh(h,[],X.mask?X.mask.pathname:"/",!0);w!=="/"&&(Q.pathname=Q.pathname==="/"?w:ha([w,Q.pathname])),A=R.createHref(Q)}let[U,W,I]=cw(c,z),te=vw(b,{replace:m,mask:h,state:g,target:v,preventScrollReset:x,relative:d,viewTransition:j,defaultShouldRevalidate:k,useTransitions:S});function B(Q){i&&i(Q),Q.defaultPrevented||te(Q)}let V=!(E.isExternal||f),de=(V?A:void 0)||E.absoluteURL||M;eb(de);let le=p.createElement("a",{...z,...I,href:de,onClick:V?B:i,ref:mw(T,W),target:v,"data-discover":!O&&r==="render"?"true":void 0});return U&&!O?p.createElement(p.Fragment,null,le,p.createElement(uw,{page:M})):le});kt.displayName="Link";var jb=p.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:c="",end:d=!1,style:f,to:m,viewTransition:h,children:g,...v},b){let x=Lr(m,{relative:v.relative}),j=qn(),k=p.useContext(Qc),{navigator:z,basename:T}=p.useContext(ta),w=k!=null&&Sw(x)&&h===!0,R=z.encodeLocation?z.encodeLocation(x).pathname:x.pathname,S=j.pathname,O=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;r||(S=S.toLowerCase(),O=O?O.toLowerCase():null,R=R.toLowerCase()),O&&T&&(O=es(O,T)||O);const E=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let M=S===R||!d&&S.startsWith(R)&&S.charAt(E)==="/",X=O!=null&&(O===R||!d&&O.startsWith(R)&&O.charAt(R.length)==="/"),A={isActive:M,isPending:X,isTransitioning:w},U=M?i:void 0,W;typeof c=="function"?W=c(A):W=[c,M?"active":null,X?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let I=typeof f=="function"?f(A):f;return p.createElement(kt,{...v,"aria-current":U,className:W,ref:b,style:I,to:m,viewTransition:h},typeof g=="function"?g(A):g)});jb.displayName="NavLink";var gw=p.forwardRef(({discover:n="render",fetcherKey:i,navigate:r,reloadDocument:c,replace:d,state:f,method:m=kc,action:h,onSubmit:g,relative:v,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:j,...k},z)=>{let{useTransitions:T}=p.useContext(ta),w=Nw(),R=ww(h,{relative:v}),S=m.toLowerCase()==="get"?"get":"post",O=typeof h=="string"&&Zc.test(h),E=M=>{if(g&&g(M),M.defaultPrevented)return;M.preventDefault();let X=M.nativeEvent.submitter,A=X?.getAttribute("formmethod")||m,U=()=>w(X||M.currentTarget,{fetcherKey:i,method:A,navigate:r,replace:d,state:f,relative:v,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:j});T&&r!==!1?p.startTransition(()=>U()):U()};return p.createElement("form",{ref:z,method:S,action:R,onSubmit:c?g:E,...k,"data-discover":!O&&n==="render"?"true":void 0})});gw.displayName="Form";function yw(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nb(n){let i=p.useContext(yi);return vt(i,yw(n)),i}function vw(n,{target:i,replace:r,mask:c,state:d,preventScrollReset:f,relative:m,viewTransition:h,defaultShouldRevalidate:g,useTransitions:v}={}){let b=Pc(),x=qn(),j=Lr(n,{relative:m});return p.useCallback(k=>{if(I2(k,i)){k.preventDefault();let z=r!==void 0?r:pi(x)===pi(j),T=()=>b(n,{replace:z,mask:c,state:d,preventScrollReset:f,relative:m,viewTransition:h,defaultShouldRevalidate:g});v?p.startTransition(()=>T()):T()}},[x,b,j,r,c,d,i,n,f,m,h,g,v])}function Jc(n){ea(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 i=p.useRef(ph(n)),r=p.useRef(!1),c=qn(),d=p.useMemo(()=>F2(c.search,r.current?null:i.current),[c.search]),f=Pc(),m=p.useCallback((h,g)=>{const v=ph(typeof h=="function"?h(new URLSearchParams(d)):h);r.current=!0,f("?"+v,g)},[f,d]);return[d,m]}var bw=0,jw=()=>`__${String(++bw)}__`;function Nw(){let{router:n}=Nb("useSubmit"),{basename:i}=p.useContext(ta),r=B2(),c=n.fetch,d=n.navigate;return p.useCallback(async(f,m={})=>{let{action:h,method:g,encType:v,formData:b,body:x}=ew(f,i);if(m.navigate===!1){let j=m.fetcherKey||jw();await c(j,r,m.action||h,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||v,flushSync:m.flushSync})}else await d(m.action||h,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||v,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[c,d,i,r])}function ww(n,{relative:i}={}){let{basename:r}=p.useContext(ta),c=p.useContext(_a);vt(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),f={...Lr(n||".",{relative:i})},m=qn();if(n==null){f.search=m.search;let g=new URLSearchParams(f.search),v=g.getAll("index");if(v.some(x=>x==="")){g.delete("index"),v.filter(j=>j).forEach(j=>g.append("index",j));let x=g.toString();f.search=x?`?${x}`:""}}(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:ha([r,f.pathname]));let h=pi(f);return eb(h),h}function Sw(n,{relative:i}={}){let r=p.useContext(hb);vt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Nb("useViewTransitionState"),d=Lr(n,{relative:i});if(!r.isTransitioning)return!1;let f=es(r.currentLocation.pathname,c)||r.currentLocation.pathname,m=es(r.nextLocation.pathname,c)||r.nextLocation.pathname;return Oc(d.pathname,m)!=null||Oc(d.pathname,f)!=null}var ol=Iv();const wb="ez-theme",Sb=p.createContext(null);function kw(){try{const n=localStorage.getItem(wb);if(n==="light"||n==="dark")return n}catch{}return"dark"}function Tw({children:n}){const[i,r]=p.useState(kw);p.useEffect(()=>{document.documentElement.dataset.theme=i;try{localStorage.setItem(wb,i)}catch{}},[i]);const c=p.useCallback(()=>{r(f=>f==="dark"?"light":"dark")},[]),d=p.useMemo(()=>({theme:i,setTheme:r,toggleTheme:c}),[i,c]);return a.jsx(Sb.Provider,{value:d,children:n})}function kb(){const n=p.useContext(Sb);if(!n)throw new Error("useTheme must be used inside ThemeProvider");return n}/**
|
|
61
|
-
* @license lucide-react v0.511.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const Cw=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ew=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,c)=>c?c.toUpperCase():r.toLowerCase()),Yy=n=>{const i=Ew(n);return i.charAt(0).toUpperCase()+i.slice(1)},Tb=(...n)=>n.filter((i,r,c)=>!!i&&i.trim()!==""&&c.indexOf(i)===r).join(" ").trim(),Rw=n=>{for(const i in n)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/**
|
|
66
|
-
* @license lucide-react v0.511.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/var zw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
-
* @license lucide-react v0.511.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const Dw=p.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:d="",children:f,iconNode:m,...h},g)=>p.createElement("svg",{ref:g,...zw,width:i,height:i,stroke:n,strokeWidth:c?Number(r)*24/Number(i):r,className:Tb("lucide",d),...!f&&!Rw(h)&&{"aria-hidden":"true"},...h},[...m.map(([v,b])=>p.createElement(v,b)),...Array.isArray(f)?f:[f]]));/**
|
|
76
|
-
* @license lucide-react v0.511.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const he=(n,i)=>{const r=p.forwardRef(({className:c,...d},f)=>p.createElement(Dw,{ref:f,iconNode:i,className:Tb(`lucide-${Cw(Yy(n))}`,`lucide-${n}`,c),...d}));return r.displayName=Yy(n),r};/**
|
|
81
|
-
* @license lucide-react v0.511.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const Aw=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Mc=he("activity",Aw);/**
|
|
86
|
-
* @license lucide-react v0.511.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const Ow=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Cb=he("arrow-down",Ow);/**
|
|
91
|
-
* @license lucide-react v0.511.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const Mw=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_w=he("arrow-left",Mw);/**
|
|
96
|
-
* @license lucide-react v0.511.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const Lw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],vi=he("arrow-right",Lw);/**
|
|
101
|
-
* @license lucide-react v0.511.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const Uw=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Hw=he("arrow-up-right",Uw);/**
|
|
106
|
-
* @license lucide-react v0.511.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const Bw=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],$w=he("arrow-up",Bw);/**
|
|
111
|
-
* @license lucide-react v0.511.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const qw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],Gw=he("bell-off",qw);/**
|
|
116
|
-
* @license lucide-react v0.511.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Yw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],Cc=he("bell-ring",Yw);/**
|
|
121
|
-
* @license lucide-react v0.511.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const Vw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],qh=he("bell",Vw);/**
|
|
126
|
-
* @license lucide-react v0.511.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const Xw=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Eb=he("boxes",Xw);/**
|
|
131
|
-
* @license lucide-react v0.511.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const Kw=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Zw=he("braces",Kw);/**
|
|
136
|
-
* @license lucide-react v0.511.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const Qw=[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]],Pw=he("cable",Qw);/**
|
|
141
|
-
* @license lucide-react v0.511.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const Iw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dl=he("check",Iw);/**
|
|
146
|
-
* @license lucide-react v0.511.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const Fw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rb=he("chevron-down",Fw);/**
|
|
151
|
-
* @license lucide-react v0.511.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const Jw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ww=he("chevron-right",Jw);/**
|
|
156
|
-
* @license lucide-react v0.511.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const eS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],tS=he("circle-alert",eS);/**
|
|
161
|
-
* @license lucide-react v0.511.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const nS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ts=he("circle-check",nS);/**
|
|
166
|
-
* @license lucide-react v0.511.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const aS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],zb=he("circle-minus",aS);/**
|
|
171
|
-
* @license lucide-react v0.511.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const sS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],lS=he("circle-slash",sS);/**
|
|
176
|
-
* @license lucide-react v0.511.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const iS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Tr=he("circle-x",iS);/**
|
|
181
|
-
* @license lucide-react v0.511.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const rS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Db=he("circle",rS);/**
|
|
186
|
-
* @license lucide-react v0.511.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const oS=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],cS=he("code-xml",oS);/**
|
|
191
|
-
* @license lucide-react v0.511.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const uS=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],dS=he("compass",uS);/**
|
|
196
|
-
* @license lucide-react v0.511.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const fS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],hS=he("copy",fS);/**
|
|
201
|
-
* @license lucide-react v0.511.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const mS=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],xh=he("download",mS);/**
|
|
206
|
-
* @license lucide-react v0.511.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const pS=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Os=he("earth",pS);/**
|
|
211
|
-
* @license lucide-react v0.511.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const xS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],gS=he("external-link",xS);/**
|
|
216
|
-
* @license lucide-react v0.511.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const yS=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],vS=he("eye-off",yS);/**
|
|
221
|
-
* @license lucide-react v0.511.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const bS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jS=he("eye",bS);/**
|
|
226
|
-
* @license lucide-react v0.511.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const NS=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],wS=he("flask-conical",NS);/**
|
|
231
|
-
* @license lucide-react v0.511.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const SS=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],kS=he("folder-input",SS);/**
|
|
236
|
-
* @license lucide-react v0.511.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const TS=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],CS=he("gauge",TS);/**
|
|
241
|
-
* @license lucide-react v0.511.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const ES=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],RS=he("git-branch",ES);/**
|
|
246
|
-
* @license lucide-react v0.511.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const zS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],DS=he("globe",zS);/**
|
|
251
|
-
* @license lucide-react v0.511.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const AS=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ab=he("grip-vertical",AS);/**
|
|
256
|
-
* @license lucide-react v0.511.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const OS=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],MS=he("history",OS);/**
|
|
261
|
-
* @license lucide-react v0.511.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const _S=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],LS=he("inbox",_S);/**
|
|
266
|
-
* @license lucide-react v0.511.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const US=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ob=he("info",US);/**
|
|
271
|
-
* @license lucide-react v0.511.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const HS=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ur=he("key-round",HS);/**
|
|
276
|
-
* @license lucide-react v0.511.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const BS=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],$S=he("layout-dashboard",BS);/**
|
|
281
|
-
* @license lucide-react v0.511.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const qS=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],GS=he("link-2-off",qS);/**
|
|
286
|
-
* @license lucide-react v0.511.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const YS=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],VS=he("link-2",YS);/**
|
|
291
|
-
* @license lucide-react v0.511.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const XS=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],KS=he("list",XS);/**
|
|
296
|
-
* @license lucide-react v0.511.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const ZS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gn=he("loader-circle",ZS);/**
|
|
301
|
-
* @license lucide-react v0.511.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const QS=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Gh=he("lock",QS);/**
|
|
306
|
-
* @license lucide-react v0.511.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const PS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],IS=he("log-out",PS);/**
|
|
311
|
-
* @license lucide-react v0.511.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const FS=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],JS=he("menu",FS);/**
|
|
316
|
-
* @license lucide-react v0.511.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const WS=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Mb=he("moon",WS);/**
|
|
321
|
-
* @license lucide-react v0.511.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const ek=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],Vy=he("package-check",ek);/**
|
|
326
|
-
* @license lucide-react v0.511.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const tk=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],_b=he("pause",tk);/**
|
|
331
|
-
* @license lucide-react v0.511.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const nk=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Yh=he("pencil",nk);/**
|
|
336
|
-
* @license lucide-react v0.511.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const ak=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Hr=he("play",ak);/**
|
|
341
|
-
* @license lucide-react v0.511.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const sk=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],lk=he("plug-zap",sk);/**
|
|
346
|
-
* @license lucide-react v0.511.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const ik=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xa=he("plus",ik);/**
|
|
351
|
-
* @license lucide-react v0.511.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const rk=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ok=he("power-off",rk);/**
|
|
356
|
-
* @license lucide-react v0.511.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const ck=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],uk=he("power",ck);/**
|
|
361
|
-
* @license lucide-react v0.511.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const dk=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Tt=he("refresh-cw",dk);/**
|
|
366
|
-
* @license lucide-react v0.511.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const fk=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Cr=he("rocket",fk);/**
|
|
371
|
-
* @license lucide-react v0.511.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const hk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],mk=he("rotate-ccw",hk);/**
|
|
376
|
-
* @license lucide-react v0.511.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const pk=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Vh=he("rotate-cw",pk);/**
|
|
381
|
-
* @license lucide-react v0.511.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const xk=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],gh=he("save",xk);/**
|
|
386
|
-
* @license lucide-react v0.511.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const gk=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Er=he("scroll-text",gk);/**
|
|
391
|
-
* @license lucide-react v0.511.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const yk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Lb=he("search",yk);/**
|
|
396
|
-
* @license lucide-react v0.511.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const vk=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Ub=he("send",vk);/**
|
|
401
|
-
* @license lucide-react v0.511.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const bk=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],Hb=he("server-cog",bk);/**
|
|
406
|
-
* @license lucide-react v0.511.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const jk=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Bb=he("settings-2",jk);/**
|
|
411
|
-
* @license lucide-react v0.511.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const Nk=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],gl=he("server",Nk);/**
|
|
416
|
-
* @license lucide-react v0.511.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const wk=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sk=he("settings",wk);/**
|
|
421
|
-
* @license lucide-react v0.511.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const kk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],as=he("shield-alert",kk);/**
|
|
426
|
-
* @license lucide-react v0.511.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const Tk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Rn=he("shield-check",Tk);/**
|
|
431
|
-
* @license lucide-react v0.511.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const Ck=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],Ek=he("shield-off",Ck);/**
|
|
436
|
-
* @license lucide-react v0.511.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const Rk=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Xh=he("sparkles",Rk);/**
|
|
441
|
-
* @license lucide-react v0.511.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const zk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Kh=he("square",zk);/**
|
|
446
|
-
* @license lucide-react v0.511.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const Dk=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],$b=he("sun",Dk);/**
|
|
451
|
-
* @license lucide-react v0.511.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const Ak=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],Ok=he("table-2",Ak);/**
|
|
456
|
-
* @license lucide-react v0.511.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const Mk=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],_k=he("terminal",Mk);/**
|
|
461
|
-
* @license lucide-react v0.511.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const Lk=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]],Uk=he("timer-off",Lk);/**
|
|
466
|
-
* @license lucide-react v0.511.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const Hk=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Us=he("trash-2",Hk);/**
|
|
471
|
-
* @license lucide-react v0.511.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const Bk=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],fl=he("triangle-alert",Bk);/**
|
|
476
|
-
* @license lucide-react v0.511.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const $k=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],qk=he("undo-2",$k);/**
|
|
481
|
-
* @license lucide-react v0.511.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const Gk=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],Yk=he("unplug",Gk);/**
|
|
486
|
-
* @license lucide-react v0.511.0 - ISC
|
|
487
|
-
*
|
|
488
|
-
* This source code is licensed under the ISC license.
|
|
489
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
-
*/const Vk=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Xk=he("upload",Vk);/**
|
|
491
|
-
* @license lucide-react v0.511.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const Kk=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Zk=he("wand-sparkles",Kk);/**
|
|
496
|
-
* @license lucide-react v0.511.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* This source code is licensed under the ISC license.
|
|
499
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
-
*/const Qk=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Wc=he("webhook",Qk);/**
|
|
501
|
-
* @license lucide-react v0.511.0 - ISC
|
|
502
|
-
*
|
|
503
|
-
* This source code is licensed under the ISC license.
|
|
504
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
-
*/const Pk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ms=he("x",Pk);/**
|
|
506
|
-
* @license lucide-react v0.511.0 - ISC
|
|
507
|
-
*
|
|
508
|
-
* This source code is licensed under the ISC license.
|
|
509
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
-
*/const Ik=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],Fk=he("wrench",Ik);function oe(...n){return n.filter(Boolean).join(" ")}const qb=p.createContext(null),Jk={success:{icon:ts,iconClass:"text-ok"},error:{icon:tS,iconClass:"text-bad"},warning:{icon:fl,iconClass:"text-warn"},info:{icon:Ob,iconClass:"text-info"}},Wk=6e3;let Xy=0;function e5(){return Xy+=1,`toast-${Date.now().toString(36)}-${Xy}`}function t5({children:n}){const[i,r]=p.useState([]),c=p.useRef(new Map),d=h=>{const g=c.current.get(h);g&&clearTimeout(g),c.current.delete(h),r(v=>v.filter(b=>b.id!==h))},f=h=>{const g=e5(),v={id:g,title:h.title,description:h.description,tone:h.tone??"info"};r(x=>{const j=[...x,v];return j.length>5?j.slice(j.length-5):j});const b=setTimeout(()=>d(g),h.durationMs??Wk);return c.current.set(g,b),g},m=p.useMemo(()=>({push:f,dismiss:d,success:(h,g)=>f({title:h,description:g,tone:"success"}),error:(h,g)=>f({title:h,description:g,tone:"error"}),warning:(h,g)=>f({title:h,description:g,tone:"warning"}),info:(h,g)=>f({title:h,description:g,tone:"info"})}),[]);return p.useEffect(()=>{const h=c.current;return()=>{for(const g of h.values())clearTimeout(g);h.clear()}},[]),a.jsxs(qb.Provider,{value:m,children:[n,a.jsx("div",{className:"pointer-events-none fixed inset-x-3 bottom-3 z-[70] flex flex-col items-end gap-2 sm:inset-x-auto sm:right-4 sm:bottom-4 sm:w-[380px]","aria-live":"polite","aria-atomic":"false",children:i.map(h=>{const{icon:g,iconClass:v}=Jk[h.tone];return a.jsxs("div",{role:h.tone==="error"?"alert":"status",className:"toast-enter pointer-events-auto flex w-full items-start gap-3 rounded-md border border-line bg-raised px-3.5 py-3 shadow-pop",children:[a.jsx(g,{className:oe("mt-0.5 size-4 shrink-0",v),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:h.title}),h.description&&a.jsx("div",{className:"mt-0.5 break-words text-xs text-muted",children:h.description})]}),a.jsx("button",{type:"button",onClick:()=>d(h.id),"aria-label":"Dismiss notification",className:"-mr-1 -mt-1 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink",children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})})]},h.id)})})]})}function Et(){const n=p.useContext(qb);if(!n)throw new Error("useToast must be used inside ToastProvider");return n}const n5={primary:"bg-accent text-accent-ink border border-transparent hover:bg-accent-hover shadow-sm",secondary:"bg-raised text-ink border border-line hover:border-line-strong hover:bg-inset",ghost:"bg-transparent text-muted border border-transparent hover:text-ink hover:bg-inset",danger:"bg-bad text-white border border-transparent hover:opacity-90 shadow-sm",dangerGhost:"bg-bad-soft text-bad border border-transparent hover:border-bad/40 hover:bg-bad/15"},a5={sm:"h-8 px-3 text-xs gap-1.5 rounded-sm",md:"h-9 px-4 text-sm gap-2 rounded-md",lg:"h-10 px-5 text-sm gap-2 rounded-md"};function ma(n="secondary",i="md",r){return oe("inline-flex select-none items-center justify-center whitespace-nowrap font-medium transition-colors duration-[var(--ez-motion-fast)] disabled:pointer-events-none disabled:opacity-50",n5[n],a5[i],r)}const ae=p.forwardRef(function({variant:i="secondary",size:r="md",loading:c=!1,icon:d,className:f,children:m,disabled:h,...g},v){return a.jsxs("button",{ref:v,type:"button",className:ma(i,r,f),disabled:h||c,"aria-busy":c||void 0,...g,children:[c?a.jsx(gn,{className:"spin size-4","aria-hidden":"true"}):d,m]})}),ct=p.forwardRef(function({label:i,variant:r="ghost",size:c="md",className:d,children:f,...m},h){return a.jsx("button",{ref:h,type:"button","aria-label":i,title:i,className:ma(r,c==="sm"?"sm":"md",oe("!px-0",c==="sm"?"size-8":"size-9",d)),...m,children:f})}),hi=[],yh=new Set;function Ky(){for(const n of yh)n()}function vh(n){return hi.length>0&&hi[hi.length-1]===n}function s5(n){const i=p.useId(),[r,c]=p.useState(()=>vh(i));return p.useEffect(()=>{const d=()=>c(vh(i));return yh.add(d),d(),()=>{yh.delete(d)}},[i]),p.useEffect(()=>{if(n)return hi.push(i),Ky(),()=>{const d=hi.lastIndexOf(i);d!==-1&&hi.splice(d,1),Ky()}},[n,i]),{id:i,isTop:r}}const l5={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl"},i5='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function yn({open:n,onClose:i,title:r,description:c,children:d,footer:f,size:m="md",preventClose:h=!1,bodyClassName:g}){const v=p.useId(),b=p.useId(),{id:x,isTop:j}=s5(n),k=p.useRef(null),z=p.useRef(null),T=p.useRef(i);T.current=i;const w=p.useRef(h);return w.current=h,p.useEffect(()=>{if(!n)return;z.current=document.activeElement;const R=document.body.style.overflow;document.body.style.overflow="hidden";const S=window.setTimeout(()=>{const E=k.current;if(!E)return;(E.querySelector("[data-autofocus]")??E).focus()},0),O=E=>{if(!vh(x))return;if(E.key==="Escape"&&!w.current){if(E.defaultPrevented)return;E.stopPropagation(),T.current();return}if(E.key!=="Tab")return;const M=k.current;if(!M)return;const X=Array.from(M.querySelectorAll(i5)).filter(I=>I.offsetParent!==null);if(X.length===0){E.preventDefault(),M.focus();return}const A=X[0],U=X[X.length-1],W=document.activeElement;E.shiftKey&&(W===A||W===M)?(E.preventDefault(),U.focus()):!E.shiftKey&&W===U&&(E.preventDefault(),A.focus())};return document.addEventListener("keydown",O,!0),()=>{window.clearTimeout(S),document.removeEventListener("keydown",O,!0),document.body.style.overflow=R,z.current?.focus()}},[n,x]),n?ol.createPortal(a.jsx("div",{className:"fade-enter fixed inset-0 z-[60] flex items-end justify-center bg-[var(--ez-overlay)] p-0 backdrop-blur-[2px] sm:items-center sm:p-6",onMouseDown:R=>{R.target!==R.currentTarget||!j||h||i()},children:a.jsxs("div",{ref:k,role:"dialog","aria-modal":j||void 0,"aria-labelledby":v,"aria-describedby":c?b:void 0,tabIndex:-1,className:oe("panel-enter flex max-h-[92vh] w-full flex-col overflow-hidden rounded-t-xl border border-line bg-surface shadow-pop outline-none sm:rounded-xl",l5[m]),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-5 py-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{id:v,className:"text-base font-semibold text-ink",children:r}),c&&a.jsx("p",{id:b,className:"mt-1 text-sm text-muted",children:c})]}),a.jsx(ct,{label:"Close",size:"sm",onClick:i,disabled:h,className:"-mr-1 -mt-1",children:a.jsx(Ms,{className:"size-4","aria-hidden":"true"})})]}),d&&a.jsx("div",{className:oe("min-h-0 flex-1 overflow-y-auto px-5 py-4",g),children:d}),f&&a.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line bg-raised/40 px-5 py-3",children:f})]})}),document.body):null}class He extends Error{status;payload;constructor(i,r,c){super(c??r5(i,r)),this.name="ApiError",this.status=i,this.payload=r}get code(){const{error:i}=this.payload;if(typeof i=="string")return i;if(i&&typeof i=="object")return i.step}get blockedReason(){return this.status!==403?null:this.payload.reason??null}}function r5(n,i){const{error:r}=i;return typeof r=="string"&&r&&r!=="Forbidden"?r:r&&typeof r=="object"?r.cause||r.consequence||"The request failed.":n===403?"Request blocked by the dashboard.":n===401?"Your session ended. Please sign in again.":n===0?"Cannot reach the dashboard.":`Request failed (HTTP ${n}).`}function o5(n){if(n instanceof He)return n;const i=n instanceof Error?n.message:"Something went wrong.";return new He(0,{error:i})}function Ct(n,i=[],r={}){const c=r.enabled??!0,d=p.useRef(n);d.current=n;const[f,m]=p.useState(0),h=p.useRef(!1),[g,v]=p.useState({data:null,error:null,loading:c});p.useEffect(()=>{if(!c){h.current=!1,v({data:null,error:null,loading:!1});return}const k=new AbortController,z=h.current;return h.current=!1,z||v(T=>({...T,loading:!0,error:null})),d.current(k.signal).then(T=>{k.signal.aborted||v({data:T,error:null,loading:!1})}).catch(T=>{k.signal.aborted||T?.name!=="AbortError"&&v(w=>({...w,error:o5(T),loading:!1}))}),()=>k.abort()},[...i,c,f]);const b=p.useCallback(()=>m(k=>k+1),[]),x=p.useCallback(()=>{h.current=!0,m(k=>k+1)},[]),j=p.useCallback(k=>{v(z=>({...z,data:typeof k=="function"?k(z.data):k}))},[]);return{data:g.data,error:g.error,loading:g.loading,reload:b,reloadSilent:x,setData:j}}function hl(n,i,r=!0){const c=p.useRef(n);c.current=n,p.useEffect(()=>{if(!r)return;const d=setInterval(()=>c.current(),i);return()=>clearInterval(d)},[i,r])}function yl(n){const i=p.useRef(n);i.current=n,p.useEffect(()=>{const r=()=>{document.visibilityState==="visible"&&i.current()};return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[])}function ba(n){p.useEffect(()=>{document.title=n?`${n} · Easy DevOps`:"Easy DevOps"},[n])}let bh=null;function Zy(n){bh=n}function rn(){return p.useCallback(n=>bh?bh(n):Promise.resolve(!1),[])}function c5({children:n}){const[i,r]=p.useState(null),c=p.useRef(null),d=p.useCallback(h=>(c.current?.resolve(!1),new Promise(g=>{c.current={resolve:g},r(h)})),[]);p.useEffect(()=>(Zy(d),()=>Zy(null)),[d]);const f=p.useCallback(h=>{r(null);const g=c.current;c.current=null,g?.resolve(h)},[]),m=i?.tone==="danger";return a.jsxs(a.Fragment,{children:[n,a.jsx(yn,{open:i!==null,onClose:()=>f(!1),title:i?.title??"",size:"sm",bodyClassName:"px-5 py-4",footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:()=>f(!1),"data-autofocus":!0,children:i?.cancelLabel??"Cancel"}),a.jsx(ae,{variant:m?"danger":"primary",onClick:()=>f(!0),children:i?.confirmLabel??"Confirm"})]}),children:a.jsx("div",{className:"text-sm text-muted",children:i?.body})})]})}const u5="modulepreload",d5=function(n,i){return new URL(n,i).href},Qy={},f5=function(i,r,c){let d=Promise.resolve();if(r&&r.length>0){let m=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const h=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),v=g?.nonce||g?.getAttribute("nonce");d=m(r.map(b=>{if(b=d5(b,c),b in Qy)return;Qy[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!c)for(let T=h.length-1;T>=0;T--){const w=h[T];if(w.href===b&&(!x||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const z=document.createElement("link");if(z.rel=x?"stylesheet":u5,x||(z.as="script"),z.crossOrigin="",z.href=b,v&&z.setAttribute("nonce",v),document.head.appendChild(z),x)return new Promise((T,w)=>{z.addEventListener("load",T),z.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${b}`)))})}))}function f(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return d.then(m=>{for(const h of m||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},h5="/api",m5=new Set(["POST","PUT","PATCH","DELETE"]),p5=!1,x5="Your session ended. Please sign in again.",jh=new Set,Nh=new Set;function g5(n){return jh.add(n),()=>jh.delete(n)}function y5(n){return Nh.add(n),()=>Nh.delete(n)}function v5(n){if(!n)return"";const i=new URLSearchParams;for(const[c,d]of Object.entries(n))d!=null&&i.set(c,String(d));const r=i.toString();return r?`?${r}`:""}async function b5(n){const i=await n.text();if(!i)return{};try{const r=JSON.parse(i);return r&&typeof r=="object"?r:{error:String(r)}}catch{return{error:i.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,240)}}}async function ge(n,i={}){const r=i.method??"GET",c={Accept:"application/json"};let d;i.body!==void 0&&(c["Content-Type"]="application/json",d=JSON.stringify(i.body)),m5.has(r)&&(c["X-EZ-Request"]="1");let f;try{f=await fetch(`${h5}${n}${v5(i.query)}`,{method:r,headers:c,body:d,credentials:"same-origin",signal:i.signal})}catch(h){throw h?.name==="AbortError"?h:new He(0,{error:"Cannot reach the dashboard."})}if(f.status===204)return;if(!f.ok){const h=await b5(f),g=new He(f.status,h);if(!i.skipAuthEvents){if(f.status===401)for(const v of jh)v(x5);else if(f.status===403)for(const v of Nh)v(g)}throw g}const m=await f.text();if(m)return JSON.parse(m)}function Ze(n){return encodeURIComponent(n)}const fe={auth:{status:n=>ge("/auth",{signal:n}),login:n=>ge("/login",{method:"POST",body:{password:n},skipAuthEvents:!0}),setup:n=>ge("/setup",{method:"POST",body:n,skipAuthEvents:!0}),logout:()=>ge("/logout",{method:"POST"})},domains:{list:n=>ge("/domains",{signal:n}),create:n=>ge("/domains",{method:"POST",body:n}),update:(n,i)=>ge(`/domains/${Ze(n)}`,{method:"PUT",body:i}),remove:(n,i)=>ge(`/domains/${Ze(n)}`,{method:"DELETE",query:{deleteCert:i}}),toggle:n=>ge(`/domains/${Ze(n)}/toggle`,{method:"PUT"}),reload:n=>ge(`/domains/${Ze(n)}/reload`,{method:"POST"}),notifications:(n,i)=>ge(`/domains/${Ze(n)}/notifications`,{signal:i}),saveNotifications:(n,i)=>ge(`/domains/${Ze(n)}/notifications`,{method:"PUT",body:i}),sslSuggestion:(n,i)=>ge(`/domains/${Ze(n)}/ssl-suggestion`,{signal:i})},ssl:{list:n=>ge("/ssl",{signal:n}),create:n=>ge("/ssl/create",{method:"POST",body:n}),confirmDns:n=>ge("/ssl/create-confirm",{method:"POST",body:{domain:n}}),cancelDns:n=>ge("/ssl/create-cancel",{method:"POST",body:{domain:n}}),renew:(n,i)=>ge(`/ssl/renew/${Ze(n)}`,{method:"POST",body:i?{opId:i}:{}}),renewAll:n=>ge("/ssl/renew-all",{method:"POST",body:n?{opId:n}:{}}),remove:n=>ge(`/ssl/${Ze(n)}`,{method:"DELETE"})},nginx:{status:n=>ge("/nginx/status",{signal:n}),reload:()=>ge("/nginx/reload",{method:"POST"}),restart:()=>ge("/nginx/restart",{method:"POST"}),start:()=>ge("/nginx/start",{method:"POST"}),stop:()=>ge("/nginx/stop",{method:"POST"}),test:()=>ge("/nginx/test",{method:"POST"}),configs:n=>ge("/nginx/configs",{signal:n}),getConfig:(n,i)=>ge(`/nginx/config/${Ze(n)}`,{signal:i}),saveConfig:(n,i)=>ge(`/nginx/config/${Ze(n)}`,{method:"POST",body:{content:i}}),logs:n=>ge("/nginx/logs",{signal:n})},processes:{list:n=>ge("/processes",{signal:n}),action:(n,i)=>ge(`/processes/${Ze(n)}/${i}`,{method:"POST"}),logs:(n,i=200,r)=>ge(`/processes/${Ze(n)}/logs`,{signal:r,query:{lines:i}})},deployments:{list:n=>ge("/deployments",{signal:n}),get:(n,i)=>ge(`/deployments/${Ze(n)}`,{signal:i}),create:n=>ge("/deployments",{method:"POST",body:n}),update:(n,i)=>ge(`/deployments/${Ze(n)}`,{method:"PUT",body:i}),remove:(n,i={})=>ge(`/deployments/${Ze(n)}`,{method:"DELETE",query:{deleteDomain:i.deleteDomain?1:void 0,purgeData:i.purgeData?1:void 0}}),linkDomain:(n,i)=>ge(`/deployments/${Ze(n)}/domain`,{method:"PUT",body:i}),unlinkDomain:n=>ge(`/deployments/${Ze(n)}/domain`,{method:"DELETE"}),move:(n,i)=>ge(`/deployments/${Ze(n)}/move`,{method:"POST",body:{path:i}}),deploy:(n,i)=>ge(`/deployments/${Ze(n)}/deploy`,{method:"POST",body:i?{ref:i}:{}}),rollback:(n,i)=>ge(`/deployments/${Ze(n)}/rollback`,{method:"POST",body:i?{releaseId:i}:{}}),removeRelease:(n,i)=>ge(`/deployments/${Ze(n)}/releases/${Ze(i)}`,{method:"DELETE"}),run:(n,i,r)=>ge(`/deployments/${Ze(n)}/runs/${Ze(i)}`,{signal:r}),issueHookToken:n=>ge(`/deployments/${Ze(n)}/hook-token`,{method:"POST"}),revokeHookToken:n=>ge(`/deployments/${Ze(n)}/hook-token`,{method:"DELETE"}),generateDeployKey:n=>ge(`/deployments/${Ze(n)}/deploy-key`,{method:"POST"}),testDeployKey:n=>ge(`/deployments/${Ze(n)}/deploy-key/test`,{method:"POST"}),addDeployKeyToGithub:(n,i)=>ge(`/deployments/${Ze(n)}/deploy-key/github`,{method:"POST",body:i?{token:i}:{}}),github:(n,i)=>ge(`/deployments/${Ze(n)}/github`,{signal:i}),applyGithub:(n,i)=>ge(`/deployments/${Ze(n)}/github/apply`,{method:"POST",body:i}),hook:n=>ge("/deployments/hook",{signal:n}),updateHook:n=>ge("/deployments/hook",{method:"PUT",body:n})},service:{status:n=>ge("/service",{signal:n}),start:()=>ge("/service/start",{method:"POST"}),stop:()=>ge("/service/stop",{method:"POST"}),restart:()=>ge("/service/restart",{method:"POST"})},settings:{get:n=>ge("/settings",{signal:n}),update:n=>ge("/settings",{method:"POST",body:n}),permissions:n=>ge("/settings/permissions",{signal:n}),setupPermissions:()=>ge("/settings/permissions/setup",{method:"POST"}),backup:n=>ge("/settings/backup",{signal:n}),restore:n=>ge("/settings/restore",{method:"POST",body:n}),channels:{list:n=>ge("/settings/channels",{signal:n}),create:n=>ge("/settings/channels",{method:"POST",body:n}),update:(n,i)=>ge(`/settings/channels/${Ze(n)}`,{method:"PUT",body:i}),remove:n=>ge(`/settings/channels/${Ze(n)}`,{method:"DELETE"}),test:n=>ge(`/settings/channels/${Ze(n)}/test`,{method:"POST"})}},hub:{status:n=>ge("/hub/status",{signal:n}),connect:n=>ge("/hub/connect",{method:"POST",body:{connectionString:n}}),unlink:()=>ge("/hub/link",{method:"DELETE"}),updatePermissions:n=>ge("/hub/permissions",{method:"PUT",body:n})},update:{check:n=>ge("/update",{signal:n}),status:n=>ge("/update/status",{signal:n}),start:n=>ge("/update",{method:"POST",body:{version:n}})}},Gb=p.createContext(null);function j5(n){if(n instanceof He)return n;const i=n instanceof Error?n.message:"Cannot reach the dashboard.";return new He(0,{error:i})}function N5({children:n}){const[i,r]=p.useState("loading"),[c,d]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState(null),[v,b]=p.useState(null),x=p.useRef("loading");x.current=i;const j=p.useCallback(M=>{d(M),m(null),r(M.authenticated?"authenticated":"unauthenticated")},[]),k=p.useCallback(async()=>{r("loading");try{j(await fe.auth.status())}catch(M){m(j5(M)),r("error")}},[j]);p.useEffect(()=>{k()},[k]);const z=p.useCallback(M=>{g(M??"Your session ended. Please sign in again."),b(null),d(X=>X&&{...X,authenticated:!1}),r("unauthenticated")},[]);p.useEffect(()=>{const M=g5(A=>{x.current==="authenticated"&&z(A)}),X=y5(A=>b(A));return()=>{M(),X()}},[z]);const T=p.useCallback(async()=>{try{j(await fe.auth.status())}catch{d(M=>M&&{...M,authenticated:!0}),r("authenticated")}g(null),b(null)},[j]),w=p.useCallback(async M=>{await fe.auth.login(M),await T()},[T]),R=p.useCallback(async M=>{await fe.auth.setup(M),await T()},[T]),S=p.useCallback(async()=>{try{await fe.auth.logout()}catch{}d(M=>M&&{...M,authenticated:!1}),g(null),b(null),r("unauthenticated")},[]),O=p.useCallback(()=>b(null),[]),E=p.useMemo(()=>({phase:i,auth:c,bootError:f,sessionMessage:h,blocked:v,login:w,setup:R,logout:S,retryBoot:k,dismissBlocked:O,reportUnauthorized:z}),[i,c,f,h,v,w,R,S,k,O,z]);return a.jsx(Gb.Provider,{value:E,children:n})}function ja(){const n=p.useContext(Gb);if(!n)throw new Error("useAuth must be used inside AuthProvider");return n}const Py=50,Yb=p.createContext(null);function w5({children:n}){const{phase:i,reportUnauthorized:r}=ja(),c=i==="authenticated",[d,f]=p.useState(null),[m,h]=p.useState(!1),[g,v]=p.useState(null),[b,x]=p.useState(null),[j,k]=p.useState(null),[z,T]=p.useState([]),[w,R]=p.useState(0),[S,O]=p.useState(null),[E,M]=p.useState(0),X=p.useCallback(()=>R(0),[]),A=p.useCallback(()=>{T([]),R(0)},[]);p.useEffect(()=>{if(!c){f(null),h(!1),v(null),x(null),k(null),T([]),R(0),O(null);return}let W=!1,I=null;const te=()=>{h(!0),v(null)},B=()=>h(!1),V=L=>{h(!1);const ee=L.data;if(L.message==="UNAUTHORIZED"||ee?.reason==="unauthorized"){r();return}if(L.message==="FORBIDDEN"||ee?.reason){v(ee?.detail??"Live updates were blocked by the dashboard.");return}v("Live updates are unavailable. Data still refreshes on the page.")},de=L=>x(L),le=L=>k(L),Q=L=>{T(ee=>{const ue=ee.filter(Ne=>Ne.id!==L.id),ke=[L,...ue];return ke.length>Py?ke.slice(0,Py):ke}),R(ee=>Math.min(ee+1,99))},F=L=>{O(L),M(ee=>ee+1)};return(async()=>{try{if(!p5){const{createRealtimeClient:L}=await f5(async()=>{const{createRealtimeClient:ee}=await import("./socket-DwLPrgsr.js");return{createRealtimeClient:ee}},[],import.meta.url);I=L()}if(W){I.disconnect();return}I.on("connect",te),I.on("disconnect",B),I.on("connect_error",V),I.on("nginx:status",de),I.on("domain:health",le),I.on("notification:new",Q),I.on("local:changed",F),f(I),I.connect()}catch{W||v("Could not start the live connection.")}})(),()=>{W=!0,I&&(I.off("connect",te),I.off("disconnect",B),I.off("connect_error",V),I.off("nginx:status",de),I.off("domain:health",le),I.off("notification:new",Q),I.off("local:changed",F),I.disconnect()),h(!1)}},[c,r]);const U=p.useMemo(()=>({client:d,connected:m,connectionError:g,nginxStatus:b,domainHealth:j,notifications:z,unread:w,markAllRead:X,clearNotifications:A,lastChange:S,changeSeq:E}),[d,m,g,b,j,z,w,X,A,S,E]);return a.jsx(Yb.Provider,{value:U,children:n})}function vn(){const n=p.useContext(Yb);if(!n)throw new Error("useRealtime must be used inside RealtimeProvider");return n}const Vb=p.createContext(null);function S5({children:n}){const{phase:i}=ja(),r=i==="authenticated",{client:c,connected:d}=vn(),f=Ct(S=>fe.service.status(S),[r],{enabled:r}),{setData:m,reload:h,reloadSilent:g}=f;hl(h,6e4,r);const v=p.useRef(!1);p.useEffect(()=>{if(!r){v.current=!1;return}const S=f.data?.probes;if(!S)return;if(!S.pending){v.current=!1;return}if(v.current)return;const O=setTimeout(()=>{v.current=!0,g()},1500);return()=>clearTimeout(O)},[r,f.data,g]);const b=p.useCallback(S=>{m(O=>O&&{...O,backgroundService:{...O.backgroundService,...S}})},[m]),x=p.useRef(null),j=p.useRef(!1),k=p.useRef(!1);k.current=f.loading;const z=p.useCallback(()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{if(x.current=null,k.current){j.current=!0;return}h()},250)},[h]);p.useEffect(()=>{!f.loading&&j.current&&(j.current=!1,h())},[f.loading,h]),p.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),p.useEffect(()=>{if(!r||!c)return;const S=O=>{b(O),z()};return c.on("service:changed",S),()=>c.off("service:changed",S)},[r,c,b,z]);const T=p.useRef(!1),w=p.useRef(!1);p.useEffect(()=>{if(!r){T.current=!1,w.current=!1;return}d&&!T.current&&(w.current&&z(),w.current=!0),T.current=d},[r,d,z]);const R=p.useMemo(()=>({service:f.data,loading:f.loading,error:f.error,reload:f.reload,applyBackgroundService:b}),[f.data,f.loading,f.error,f.reload,b]);return a.jsx(Vb.Provider,{value:R,children:n})}function Br(){const n=p.useContext(Vb);if(!n)throw new Error("useService must be used inside ServiceProvider");return n}const Xb=[{label:"Manage",items:[{to:"/",label:"Overview",title:"Overview",description:"The state of nginx, your domains and their certificates at a glance.",icon:$S},{to:"/domains",label:"Domains",title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",icon:Os},{to:"/ssl",label:"SSL certificates",title:"SSL certificates",description:"Issue and renew Let’s Encrypt certificates for your domains.",icon:Rn},{to:"/nginx",label:"Nginx",title:"Nginx",description:"Service status, configuration files and live logs.",icon:gl},{to:"/deployments",label:"Deployments",title:"Deployments",description:"Put a project from a git repository on this server and keep it deployed.",icon:Cr}]},{label:"Monitor",items:[{to:"/notifications",label:"Notifications",title:"Notifications",description:"Delivery channels, test messages and recent events.",icon:qh},{to:"/processes",label:"Processes",title:"Processes",description:"The Easy DevOps background service and your own PM2 apps.",icon:Eb},{to:"/logs",label:"Logs",title:"Logs",description:"nginx access and error output as it is written.",icon:Er}]},{label:"System",items:[{to:"/settings",label:"Settings",title:"Settings",description:"Access, authentication, Hub pairing and backup.",icon:Sk}]}],k5=Xb.flatMap(n=>n.items);function Kb(n){return k5.find(i=>i.to==="/"?n==="/":n===i.to||n.startsWith(`${i.to}/`))}function Zb({className:n}){return a.jsxs("span",{className:oe("inline-flex shrink-0 items-center",n),"aria-hidden":"true",children:[a.jsx("img",{src:"/brand/mark-dark.png",alt:"",className:"brand-logo-dark h-full w-auto"}),a.jsx("img",{src:"/brand/mark-light.png",alt:"",className:"brand-logo-light h-full w-auto"})]})}const T5=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric"}),C5=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"});function Zh(n){if(n==null||n==="")return"—";const i=typeof n=="number"?new Date(n):new Date(n);return Number.isNaN(i.getTime())?"—":T5.format(i)}function Qh(n){if(n==null||n==="")return"—";const i=typeof n=="number"?new Date(n):new Date(n);return Number.isNaN(i.getTime())?"—":C5.format(i)}function $r(n){const i=Math.max(0,Math.round((Date.now()-n)/1e3));if(i<10)return"just now";if(i<60)return`${i}s ago`;const r=Math.floor(i/60);if(r<60)return`${r}m ago`;const c=Math.floor(r/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Qb(){return new Date().getFullYear()}function Pb(n){if(n==null)return"—";if(n<1024)return`${n} B`;const i=["KB","MB","GB","TB"];let r=n/1024,c=0;for(;r>=1024&&c<i.length-1;)r/=1024,c+=1;return`${r.toFixed(r<10?1:0)} ${i[c]}`}function eu(n){if(n==null||n<0)return"—";const i=Math.floor(n/6e4);if(i<1)return"<1m";if(i<60)return`${i}m`;const r=Math.floor(i/60);return r<24?`${r}h ${i%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function gi(n){return n===null?"Unknown":n<0?`Expired ${Math.abs(n)} day${Math.abs(n)===1?"":"s"} ago`:n===0?"Expires today":`${n} day${n===1?"":"s"} left`}function E5(n){return n==null?"—":`${n.toFixed(1)}%`}function $n(n,i,r=`${i}s`){return`${n} ${n===1?i:r}`}function R5(n,i=48){if(n.length<=i)return n;const r=Math.ceil((i-1)/2),c=Math.floor((i-1)/2);return`${n.slice(0,r)}…${n.slice(-c)}`}const z5={personal:"Personal","windows-service":"Windows service",systemd:"systemd",unknown:"Unknown"},D5={personal:"Startup supervisor · runs as you, starts at logon","windows-service":"WinSW service · NT SERVICE\\EasyDevOps",systemd:"systemd unit · starts at boot",unknown:"Not reported by this API"},A5={personal:"No administrator needed — run it in a normal PowerShell. Personal mode starts at logon and stops when you sign out.","windows-service":"Run it in an Administrator PowerShell. It creates a Windows service that runs as NT SERVICE\\EasyDevOps and never asks for an account password.",systemd:"Run it once with sudo; the unit then starts at boot.",unknown:"Run it in a terminal with the rights your platform requires."};function O5(n){switch(n.backgroundService.mechanism){case"startup-supervisor":return"personal";case"winsw":return"windows-service";case"systemd":return"systemd";default:return"unknown"}}function M5(n){return n==="logon"?"At logon":n==="boot"?"At boot":"Unknown"}function _5(n){return n.jobsRunningHere?"This dashboard":n.jobsOwnerRole==="daemon"?"Background service":n.jobsOwnerRole==="dashboard"?"Another dashboard process":n.running?"Background service":"Paused — no owner"}function qr(n){if(!n)return null;const i=n.backgroundService,r=O5(n),c=i.startsAt==="logon"||i.startsAt==="boot"?i.startsAt:"unknown",d=i.runtime??null,f=i.stoppedAt??null,m=Array.from(new Set([...i.warnings??[],...d?.warnings??[]]));return{running:i.running,connected:i.connected,jobsRunningHere:i.jobsRunningHere,jobsOwnerLabel:_5(i),pid:i.pid,version:i.version,startedAt:i.startedAt,uptimeMs:i.startedAt?Math.max(0,Date.now()-i.startedAt):null,heartbeatAgeMs:i.heartbeatAgeMs??null,mechanism:r,mechanismLabel:z5[r],mechanismDetail:D5[r],startsAt:c,startsAtLabel:M5(c),installed:i.installed===!0,stoppedByUser:i.stoppedByUser===!0,stoppedAt:f,stoppedAtLabel:f?Qh(f):null,state:i.state??null,detail:i.detail??null,enabledOnBoot:i.enabledOnBoot??null,restarts:i.restarts??0,crashLooping:i.crashLooping===!0,dataDir:i.dataDir,installCommand:n.install.command,installGuidance:A5[r],runtime:d,warnings:m}}function _c(n){return n?n.running?"Running":n.stoppedByUser?"Stopped by you":n.installed?"Not running":"Not installed":"Unknown"}function L5(n){if(!n)return null;const i=n.pinned,r=i?.version??null,c=n.systemNode.version??null,d=!!(i&&i.kind!=="none"&&i.exists!==!1),f=d&&!!(r&&c)&&r===c&&!i?.differsFromSystem;return{serviceVersion:r,servicePath:i?.path??null,systemVersion:c,systemPath:n.systemNode.path??null,sameAsSystem:f,broken:i?.broken===!0,pinned:d,kind:i?.kind??null,manager:n.manager?.managed?n.manager.manager??null:null}}const U5={neutral:"bg-inset text-muted",accent:"bg-accent-soft text-accent-text",ok:"bg-ok-soft text-ok",warn:"bg-warn-soft text-warn",bad:"bg-bad-soft text-bad",info:"bg-info-soft text-info"},Ib={neutral:"bg-faint",accent:"bg-accent",ok:"bg-ok",warn:"bg-warn",bad:"bg-bad",info:"bg-info"};function je({tone:n="neutral",children:i,className:r,dot:c=!1}){return a.jsxs("span",{className:oe("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",U5[n],r),children:[c&&a.jsx("span",{className:oe("size-1.5 rounded-full",Ib[n]),"aria-hidden":"true"}),i]})}function ln({tone:n="ok",pulse:i=!1,className:r}){return a.jsx("span",{className:oe("inline-block size-2 shrink-0 rounded-full",Ib[n],i&&"live-dot",r),"aria-hidden":"true"})}const H5='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Iy({onNavigate:n}){const{service:i}=Br(),r=qr(i),c=r?r.running?{tone:"ok",label:"Service running"}:r.stoppedByUser?{tone:"warn",label:"Service stopped by you"}:{tone:"warn",label:"Service stopped"}:{tone:"neutral",label:"Checking service…"};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:oe("flex h-[var(--ez-topbar-height)] shrink-0 items-center gap-2.5 border-b border-line px-4",n&&"pr-12"),children:[a.jsx(Zb,{className:"h-5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]}),a.jsx("nav",{"aria-label":"Main navigation",className:"flex-1 overflow-y-auto px-3 py-4",children:Xb.map((d,f)=>a.jsxs("div",{className:oe(f>0&&"mt-5"),children:[a.jsx("div",{className:"mb-1.5 px-2 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d.label}),a.jsx("div",{className:"space-y-0.5",children:d.items.map(m=>{const h=m.icon;return a.jsx(jb,{to:m.to,end:m.to==="/",onClick:n,className:({isActive:g})=>oe("group relative flex items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-colors duration-[var(--ez-motion-fast)]",g?"bg-accent-soft text-ink":"text-muted hover:bg-inset hover:text-ink"),children:({isActive:g})=>a.jsxs(a.Fragment,{children:[a.jsx("span",{className:oe("absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-pill bg-accent transition-opacity duration-[var(--ez-motion-fast)]",g?"opacity-100":"opacity-0"),"aria-hidden":"true"}),a.jsx(h,{className:oe("size-4 shrink-0 transition-colors",g?"text-accent-text":"text-faint group-hover:text-muted"),"aria-hidden":"true"}),m.label]})},m.to)})})]},d.label))}),a.jsx("div",{className:"border-t border-line p-3",children:a.jsxs(kt,{to:"/processes",onClick:n,className:"flex items-center gap-2.5 rounded-md border border-line bg-raised/60 px-2.5 py-2 transition-colors hover:border-line-strong hover:bg-inset","aria-label":`Background service: ${c.label}. Open Processes.`,children:[a.jsx(ln,{tone:c.tone,pulse:c.tone==="ok"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-2xs font-medium text-ink",children:"Background service"}),a.jsx("div",{className:"truncate text-2xs text-faint",children:c.label})]})]})})]})}function B5({open:n,onClose:i}){const r=p.useRef(null),c=p.useRef(null);return p.useEffect(()=>{if(!n)return;const d=document.activeElement,f=document.body.style.overflow;document.body.style.overflow="hidden";const m=window.setTimeout(()=>c.current?.focus(),0),h=g=>{if(g.key==="Escape"){g.preventDefault(),i();return}if(g.key!=="Tab")return;const v=r.current;if(!v)return;const b=Array.from(v.querySelectorAll(H5)).filter(z=>z.offsetParent!==null);if(b.length===0)return;const x=b[0],j=b[b.length-1],k=document.activeElement;g.shiftKey&&(k===x||k===v)?(g.preventDefault(),j.focus()):!g.shiftKey&&k===j&&(g.preventDefault(),x.focus())};return document.addEventListener("keydown",h,!0),()=>{window.clearTimeout(m),document.removeEventListener("keydown",h,!0),document.body.style.overflow=f,d?.focus()}},[n,i]),a.jsxs(a.Fragment,{children:[a.jsx("aside",{className:"hidden w-[var(--ez-sidebar-width)] shrink-0 flex-col border-r border-line bg-surface lg:flex",children:a.jsx(Iy,{})}),n&&a.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[a.jsx("div",{className:"fade-enter absolute inset-0 bg-[var(--ez-overlay)] backdrop-blur-[1px]",onClick:i,"aria-hidden":"true"}),a.jsxs("aside",{ref:r,role:"dialog","aria-modal":"true","aria-label":"Main navigation",tabIndex:-1,className:"drawer-enter absolute inset-y-0 left-0 flex w-[276px] flex-col border-r border-line bg-surface shadow-pop outline-none",children:[a.jsx(ct,{ref:c,label:"Close navigation",size:"sm",onClick:i,className:"absolute right-2 top-2 z-10",children:a.jsx(Ms,{className:"size-4","aria-hidden":"true"})}),a.jsx(Iy,{onNavigate:i})]})]})]})}function $5(n){return n.type==="nginx_down"?gl:n.type==="cert_expiry"?as:n.type==="domain_health"?Mc:n.type==="deploy"?Cr:Xh}function q5(n){return n==="danger"?"text-bad":n==="warning"?"text-warn":n==="success"?"text-ok":n==="info"?"text-info":"text-muted"}function G5(){const{notifications:n,unread:i,markAllRead:r,clearNotifications:c}=vn(),[d,f]=p.useState(!1),[,m]=p.useState(0),h=p.useRef(null),g=p.useRef(null);p.useEffect(()=>{if(!d)return;r();const b=j=>{h.current&&!h.current.contains(j.target)&&f(!1)},x=j=>{j.key==="Escape"&&(f(!1),g.current?.focus())};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",x)}},[d,r]),p.useEffect(()=>{d&&r()},[d,n.length,r]),p.useEffect(()=>{if(!d)return;const b=setInterval(()=>m(x=>x+1),3e4);return()=>clearInterval(b)},[d]);const v=i>0?`Notifications, ${i} unread`:"Notifications";return a.jsxs("div",{ref:h,className:"sm:relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ct,{ref:g,label:v,onClick:()=>f(b=>!b),"aria-expanded":d,"aria-haspopup":"dialog","aria-controls":"notifications-panel",className:oe(d&&"bg-inset text-ink"),children:a.jsx(qh,{className:"size-4.5","aria-hidden":"true"})}),i>0&&a.jsx("span",{className:"pointer-events-none absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-pill bg-accent px-1 text-[10px] font-semibold leading-none text-accent-ink","aria-hidden":"true",children:i>9?"9+":i})]}),d&&a.jsxs("div",{id:"notifications-panel",role:"dialog","aria-label":"Notifications",className:"panel-enter absolute right-3 top-[calc(100%+10px)] z-50 w-[min(92vw,360px)] overflow-hidden rounded-lg border border-line bg-surface shadow-pop sm:right-0",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2.5",children:[a.jsx("span",{className:"text-sm font-semibold text-ink",children:"Notifications"}),n.length>0&&a.jsx("button",{type:"button",onClick:c,className:"text-2xs text-muted transition-colors hover:text-ink",children:"Clear all"})]}),a.jsx("div",{className:"max-h-[min(60vh,320px)] overflow-y-auto",children:n.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[a.jsx(Gw,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsx("div",{className:"text-xs text-muted",children:"All clear — no notifications yet."})]}):n.map(b=>{const x=$5(b);return a.jsxs("div",{className:"flex items-start gap-2.5 border-b border-line/70 px-4 py-2.5 last:border-0",children:[a.jsx(x,{className:oe("mt-0.5 size-4 shrink-0",q5(b.severity)),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:b.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:$r(b.timestamp)})]})]},b.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/50 px-4 py-2",children:a.jsx(kt,{to:"/notifications",onClick:()=>f(!1),className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Open notification settings"})})]})]})}function Y5({onMenu:n}){const{pathname:i}=qn(),{theme:r,toggleTheme:c}=kb(),{nginxStatus:d,connected:f,connectionError:m}=vn(),{logout:h}=ja(),g=Et(),[v,b]=p.useState(!1),x=Kb(i)?.title??"Easy DevOps",j=d?.running===!0,k=d===null?"Unknown":j?"Running":"Stopped",z=async()=>{if(!v){b(!0);try{await h(),g.success("Signed out","Your dashboard session has ended.")}finally{b(!1)}}};return a.jsxs("header",{className:"sticky top-0 z-30 flex h-[var(--ez-topbar-height)] shrink-0 items-center justify-between gap-3 border-b border-line bg-canvas/85 px-3 backdrop-blur sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx(ct,{label:"Open navigation",size:"sm",onClick:n,className:"lg:hidden",children:a.jsx(JS,{className:"size-4.5","aria-hidden":"true"})}),a.jsx("div",{className:"truncate text-sm font-semibold text-ink",children:x})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1 sm:gap-1.5",children:[a.jsxs(kt,{to:"/nginx","aria-label":`Nginx is ${k.toLowerCase()}. Open Nginx.`,className:"hidden items-center gap-1.5 rounded-pill border border-line bg-raised px-2.5 py-1 text-2xs transition-colors hover:border-line-strong hover:bg-inset sm:inline-flex",children:[a.jsx(ln,{tone:d===null?"neutral":j?"ok":"bad",pulse:j&&f}),a.jsx("span",{className:"font-medium text-ink",children:"nginx"}),a.jsx("span",{className:"text-faint",children:k})]}),a.jsx(kt,{to:"/nginx","aria-label":`Nginx is ${k.toLowerCase()}. Open Nginx.`,className:"flex size-9 items-center justify-center rounded-md transition-colors hover:bg-inset sm:hidden",children:a.jsx(ln,{tone:d===null?"neutral":j?"ok":"bad",pulse:j&&f})}),a.jsxs("span",{className:"hidden items-center gap-1.5 pl-1 pr-2 text-2xs text-faint md:flex",title:m??(f?"Live updates are connected.":"Reconnecting to live updates…"),children:[a.jsx("span",{className:oe("size-1.5 rounded-full",m?"bg-bad":f?"bg-ok live-dot":"bg-faint"),"aria-hidden":"true"}),m?"Live blocked":f?"Live":"Connecting"]}),a.jsx(G5,{}),a.jsx(ct,{label:r==="dark"?"Switch to light theme":"Switch to dark theme",onClick:c,children:r==="dark"?a.jsx($b,{className:"size-4.5","aria-hidden":"true"}):a.jsx(Mb,{className:"size-4.5","aria-hidden":"true"})}),a.jsx(ct,{label:"Sign out",onClick:z,disabled:v,className:"hover:text-bad",children:a.jsx(IS,{className:"size-4.5","aria-hidden":"true"})})]})]})}function et({className:n,children:i,...r}){return a.jsx("div",{className:oe("rounded-lg border border-line bg-surface shadow-card",n),...r,children:i})}function pn({title:n,description:i,actions:r,className:c,icon:d}){return a.jsxs("div",{className:oe("flex flex-wrap items-start justify-between gap-3 border-b border-line px-4 py-3.5 sm:px-5",c),children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[d&&a.jsx("div",{className:"mt-0.5 text-muted",children:d}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:n}),i&&a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i})]})]}),r&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]})}function xn({className:n,children:i,...r}){return a.jsx("div",{className:oe("px-4 py-4 sm:px-5",n),...r,children:i})}function Ec({className:n,children:i}){return a.jsx("div",{className:oe("flex flex-wrap items-center justify-between gap-2 border-t border-line bg-raised/50 px-4 py-3 sm:px-5",n),children:i})}function _s({className:n}){return a.jsx(gn,{className:oe("spin size-4 text-muted",n),"aria-hidden":"true"})}function tt({className:n}){return a.jsx("div",{className:oe("skeleton",n),"aria-hidden":"true"})}function ns({children:n}){return a.jsx("div",{className:"page-enter space-y-5","aria-busy":"true","aria-label":"Loading",children:n})}function V5(){return a.jsx("div",{className:"flex min-h-full items-center justify-center bg-canvas",children:a.jsxs("div",{className:"flex items-center gap-3 text-muted",children:[a.jsx(gn,{className:"spin size-5 text-accent-text","aria-hidden":"true"}),a.jsx("span",{className:"text-sm",children:"Loading Easy DevOps…"})]})})}function ga({title:n,description:i,action:r,icon:c,className:d}){return a.jsxs("div",{className:oe("flex flex-col items-center justify-center px-6 py-12 text-center",d),children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-inset text-faint",children:c??a.jsx(LS,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-medium text-ink",children:n}),i&&a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:i}),r&&a.jsx("div",{className:"mt-4",children:r})]})}function ve({tone:n="info",title:i,children:r,action:c,className:d}){const f={info:"border-info/25 bg-info-soft text-info",warning:"border-warn/30 bg-warn-soft text-warn",danger:"border-bad/30 bg-bad-soft text-bad",success:"border-ok/30 bg-ok-soft text-ok"}[n],m={info:Ob,warning:fl,danger:fl,success:ts}[n];return a.jsx("div",{className:oe("rounded-md border px-3.5 py-3 text-xs",f,d),role:"status",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(m,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 text-muted",children:[i&&a.jsx("div",{className:"font-medium text-ink",children:i}),r&&a.jsx("div",{className:oe(i?"mt-0.5":void 0,"break-words"),children:r})]}),c&&a.jsx("div",{className:"shrink-0",children:c})]})})}function $t({error:n,onRetry:i,title:r,className:c}){const d=n instanceof He?n:null,f=d?.status===403,m=typeof d?.payload?.detail=="string"?d.payload.detail:void 0,h=d?.message??(n instanceof Error?n.message:"Something went wrong while loading this section.");return a.jsx(et,{className:oe("border-bad/25",c),children:a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 text-center",children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:f?a.jsx(as,{className:"size-5","aria-hidden":"true"}):a.jsx(fl,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-semibold text-ink",children:r??(f?"Request blocked":"Could not load this section")}),a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:h}),m&&a.jsx("p",{className:"mt-1 max-w-md break-all font-mono text-2xs text-faint",children:m}),d&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",d.status,d.code?` · ${d.code}`:""]}),i&&a.jsx(ae,{className:"mt-4",variant:"secondary",size:"sm",icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:i,children:"Try again"})]})})}const Fy="ez-service-banner-dismissed";function Jf({children:n}){return a.jsx("code",{className:"font-mono text-ink",children:n})}function X5(n){return n.startsAt==="logon"?"at your next logon":n.startsAt==="boot"?"at the next boot":"when the service starts"}function K5(n){return n.running?{code:"running",tone:"info",title:"Background service is running",body:"This dashboard is the interface only.",action:"Open Processes"}:n.stoppedByUser?{code:"stopped_by_user",tone:"warning",title:"The background service is stopped",body:a.jsxs(a.Fragment,{children:["You stopped it",n.stoppedAtLabel?` on ${n.stoppedAtLabel}`:"",", so monitoring and notifications are paused. It starts again ",X5(n),", or run"," ",a.jsx(Jf,{children:"ezz service start"})," to start it now."]}),action:"Open Processes"}:{code:"not_running",tone:"warning",title:"The background service is not running",body:n.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx(Jf,{children:"ezz service start"}),"."]}):a.jsxs(a.Fragment,{children:["Monitoring and notifications would run in this dashboard and stop when it closes. Set up the service with ",a.jsx(Jf,{children:n.installCommand}),"."]}),action:"Open Processes"}}function Z5(){const{service:n}=Br(),{pathname:i}=qn(),[r,c]=p.useState(()=>{try{return sessionStorage.getItem(Fy)}catch{return null}}),d=qr(n),f=d?K5(d):null,m=i!=="/processes",h=p.useMemo(()=>!d||!f?"":[f.code,d.pid,d.startedAt,d.stoppedByUser,d.stoppedAt,d.startsAt,d.installed].join("|"),[d,f]);if(!d||!f||r===h)return null;const g=()=>{c(h);try{sessionStorage.setItem(Fy,h)}catch{}};return a.jsx("div",{className:"fade-enter mb-5",children:a.jsx(ve,{tone:f.tone,title:f.title,action:a.jsxs("div",{className:"flex items-center gap-1",children:[m&&a.jsxs(kt,{to:"/processes",className:oe("inline-flex items-center gap-1 rounded-sm px-2 py-1 text-xs font-medium text-ink","border border-line bg-raised transition-colors hover:border-line-strong hover:bg-inset"),children:[f.action,a.jsx(vi,{className:"size-3","aria-hidden":"true"})]}),a.jsx(ct,{label:"Dismiss banner",size:"sm",onClick:g,children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})})]}),children:f.body})})}const Q5={host_missing:"The request arrived without a Host header.",host_port_mismatch:"The request was addressed to a different port.",host_not_local:"The request hostname does not mean this machine.",origin_malformed:"The request carried an unreadable Origin.",origin_port_mismatch:"The request came from a different port.",origin_not_local:"The request came from another site.",origin_cross_site:"The request came from another site.",missing_request_header:"The request was missing the dashboard’s safety header."};function P5(){const{blocked:n,dismissBlocked:i}=ja();if(!n)return null;const r=n.blockedReason,c=typeof n.payload.detail=="string"?n.payload.detail:void 0;return a.jsx("div",{className:"fade-enter mb-5 rounded-md border border-bad/30 bg-bad-soft px-3.5 py-3 text-xs",role:"alert",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(as,{className:"mt-0.5 size-4 shrink-0 text-bad","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"font-medium text-ink",children:"Request blocked"}),a.jsx("div",{className:"mt-0.5 text-muted",children:r?Q5[r]??"The dashboard refused this request.":n.message}),c&&a.jsx("div",{className:"mt-1 break-all font-mono text-2xs text-faint",children:c}),a.jsx("div",{className:"mt-1.5 text-2xs text-faint",children:"This happens when a request comes from another site or through a different port. Try reloading the dashboard from its own address."})]}),a.jsx(ae,{variant:"ghost",size:"sm",onClick:i,className:"-mr-1 -mt-1 shrink-0",children:"Dismiss"})]})})}class I5 extends p.Component{state={error:null};static getDerivedStateFromError(i){return{error:i}}componentDidCatch(i,r){console.error(`[ui] ${this.props.area??"page"} crashed`,i,r.componentStack)}render(){return this.state.error?a.jsx(et,{className:"border-bad/30",children:a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-12 text-center",children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:a.jsx(as,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"text-sm font-semibold text-ink",children:this.props.area?`${this.props.area} hit an error`:"This page hit an error"}),a.jsx("p",{className:"mt-1 max-w-lg text-xs text-muted",children:"The rest of the dashboard still works. Try again, or reload the page if it keeps happening."}),a.jsx("p",{className:"mt-2 max-w-lg break-all font-mono text-2xs text-faint",children:this.state.error.message}),a.jsx(ae,{className:"mt-4",size:"sm",icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>this.setState({error:null}),children:"Try again"})]})}):this.props.children}}function F5(){const[n,i]=p.useState(!1),{pathname:r}=qn(),c=p.useRef(null),d=p.useCallback(()=>i(!1),[]);p.useEffect(()=>{i(!1),c.current?.scrollTo({top:0}),c.current?.focus({preventScroll:!0})},[r]),p.useEffect(()=>{const m=window.matchMedia("(min-width: 1024px)"),h=()=>{m.matches&&i(!1)};return m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);const f=Kb(r);return a.jsxs("div",{className:"flex h-full min-h-0 bg-canvas",children:[a.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-3 focus:top-3 focus:z-[80] focus:rounded-md focus:border focus:border-line focus:bg-surface focus:px-3 focus:py-2 focus:text-sm focus:text-ink focus:shadow-pop",children:"Skip to content"}),a.jsx(B5,{open:n,onClose:d}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx(Y5,{onMenu:()=>i(!0)}),a.jsx("main",{ref:c,id:"main-content",tabIndex:-1,className:"min-h-0 flex-1 overflow-y-auto outline-none",children:a.jsxs("div",{className:"relative isolate mx-auto w-full max-w-[var(--ez-content-max)] px-3 py-4 sm:px-5 sm:py-5 lg:px-7 lg:py-6",children:[a.jsx("div",{className:"dashboard-ambient -z-10","aria-hidden":"true"}),a.jsx(Z5,{}),a.jsx(P5,{}),a.jsx("div",{className:"page-enter",children:a.jsx(I5,{area:f?.title,children:a.jsx(Y2,{})})},r)]})}),a.jsxs("footer",{className:"shrink-0 border-t border-line bg-canvas px-3 py-1.5 text-center text-[10px] text-faint sm:px-5",children:["© ",Qb()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})]})}function J5(){const{bootError:n,retryBoot:i}=ja(),[r,c]=p.useState(!1),d=async()=>{c(!0),await i(),c(!1)};return a.jsx("div",{className:"flex min-h-full items-center justify-center bg-canvas px-4 py-10",children:a.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-card",children:[a.jsx("div",{className:"mb-4 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:a.jsx(lk,{className:"size-5","aria-hidden":"true"})}),a.jsx("h1",{className:"text-lg font-semibold text-ink",children:"Cannot reach the dashboard"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:[n?.message??"The dashboard did not answer."," Check that Easy DevOps is running, then try again."]}),n&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",n.status===0?"connection failed":n.status]}),a.jsx(ae,{variant:"primary",loading:r,onClick:d,icon:a.jsx(Tt,{className:"size-4","aria-hidden":"true"}),className:"mt-5",children:"Try again"})]})})}const Ph="w-full rounded-md border border-line bg-canvas px-3 text-sm text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25 disabled:opacity-60",tu="border-bad/60 hover:border-bad focus:border-bad focus:ring-bad/25";function nu({htmlFor:n,children:i,optional:r,trailing:c}){return a.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[a.jsxs("label",{htmlFor:n,className:"flex items-baseline gap-2 text-xs font-medium text-muted",children:[a.jsx("span",{children:i}),r&&a.jsx("span",{className:"text-2xs font-normal text-faint",children:"Optional"})]}),c]})}function au({id:n,children:i}){return a.jsx("p",{id:n,className:"mt-1.5 text-xs text-bad",role:"alert",children:i})}function ml({id:n,children:i}){return a.jsx("p",{id:n,className:"mt-1.5 text-xs text-faint",children:i})}function Me({label:n,hint:i,error:r,optional:c,trailing:d,id:f,className:m,...h}){const g=p.useId(),v=f??g,b=`${v}-error`,x=`${v}-hint`;return a.jsxs("div",{className:m,children:[n&&a.jsx(nu,{htmlFor:v,optional:c,children:n}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{id:v,className:oe(Ph,"h-9",!!d&&"pr-10",r&&tu),"aria-invalid":r?!0:void 0,"aria-describedby":r?b:i?x:void 0,...h}),d&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-1.5",children:d})]}),r?a.jsx(au,{id:b,children:r}):i?a.jsx(ml,{id:x,children:i}):null]})}function Lc({label:n,hint:i,error:r,optional:c,id:d,className:f,...m}){const h=p.useId(),g=d??h,v=`${g}-error`,b=`${g}-hint`;return a.jsxs("div",{className:f,children:[n&&a.jsx(nu,{htmlFor:g,optional:c,children:n}),a.jsx("textarea",{id:g,className:oe(Ph,"min-h-24 py-2 leading-relaxed",r&&tu),"aria-invalid":r?!0:void 0,"aria-describedby":r?v:i?b:void 0,...m}),r?a.jsx(au,{id:v,children:r}):i?a.jsx(ml,{id:b,children:i}):null]})}function pa({label:n,hint:i,error:r,optional:c,id:d,className:f,children:m,...h}){const g=p.useId(),v=d??g,b=`${v}-error`,x=`${v}-hint`;return a.jsxs("div",{className:f,children:[n&&a.jsx(nu,{htmlFor:v,optional:c,children:n}),a.jsx("select",{id:v,className:oe(Ph,"h-9 cursor-pointer pr-8",r&&tu),"aria-invalid":r?!0:void 0,"aria-describedby":r?b:i?x:void 0,...h,children:m}),r?a.jsx(au,{id:b,children:r}):i?a.jsx(ml,{id:x,children:i}):null]})}function W5({label:n,hint:i,error:r,optional:c,value:d,onChange:f,normalize:m,max:h,placeholder:g,className:v,id:b}){const x=p.useId(),j=b??x,[k,z]=p.useState(""),[T,w]=p.useState(null),R=`${j}-error`,S=`${j}-hint`,O=T??r??null,E=()=>{const M=k.trim();if(!M)return;let X=d;for(const A of M.split(/[\n,]/)){if(!A.trim())continue;const U=m(A,X);if(U.error||!U.value){w(U.error??"This path cannot be added."),z(A.trim());return}X.includes(U.value)||(X=[...X,U.value])}f(X),z(""),w(null)};return a.jsxs("div",{className:v,children:[n&&a.jsx(nu,{htmlFor:j,optional:c,trailing:h?a.jsxs("span",{className:"text-2xs font-normal text-faint",children:[d.length,"/",h]}):void 0,children:n}),a.jsxs("div",{className:oe("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-canvas px-2 py-1.5 transition-colors duration-[var(--ez-motion-fast)]",O?tu:"border-line hover:border-line-strong focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/25"),children:[d.map(M=>a.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-sm border border-line bg-inset py-0.5 pl-2 pr-1 font-mono text-xs text-ink",children:[a.jsx("span",{className:"truncate",children:M}),a.jsx("button",{type:"button",onClick:()=>{f(d.filter(X=>X!==M)),w(null)},className:"shrink-0 rounded-sm p-0.5 text-faint transition-colors hover:bg-canvas hover:text-bad focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50","aria-label":`Remove ${M}`,children:a.jsx(Ms,{className:"size-3","aria-hidden":"true"})})]},M)),a.jsx("input",{id:j,value:k,onChange:M=>{z(M.target.value),T&&w(null)},onKeyDown:M=>{(M.key==="Enter"||M.key===",")&&(M.preventDefault(),E()),M.key==="Backspace"&&!k&&d.length>0&&f(d.slice(0,-1))},onBlur:E,placeholder:d.length===0?g:void 0,"aria-invalid":O?!0:void 0,"aria-describedby":O?R:i?S:void 0,className:"h-6 min-w-24 flex-1 bg-transparent font-mono text-sm text-ink placeholder:text-faint focus:outline-none",spellCheck:!1,autoComplete:"off"}),a.jsx("button",{type:"button",onClick:E,disabled:!k.trim(),className:"shrink-0 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:pointer-events-none disabled:opacity-40","aria-label":"Add path",children:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"})})]}),O?a.jsx(au,{id:R,children:O}):i?a.jsx(ml,{id:S,children:i}):null]})}function pl({label:n,hint:i,checked:r,onChange:c,disabled:d,className:f,id:m}){const h=p.useId(),g=m??h;return a.jsxs("div",{className:oe("flex items-start gap-2.5",f),children:[a.jsx("input",{id:g,type:"checkbox",checked:r,disabled:d,onChange:v=>c(v.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{htmlFor:g,className:oe("cursor-pointer text-sm text-ink",d&&"cursor-not-allowed opacity-60"),children:n}),i&&a.jsx("p",{className:"mt-0.5 text-xs text-faint",children:i})]})]})}function Zt({checked:n,onChange:i,label:r,ariaLabel:c,description:d,disabled:f,className:m}){const h=p.useId();return a.jsxs("div",{className:oe("flex items-start justify-between gap-4",m),children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{id:h,className:"text-sm text-ink",children:r}),d&&a.jsx("div",{className:"mt-0.5 text-xs text-faint",children:d})]}),a.jsx("button",{type:"button",role:"switch","aria-checked":n,"aria-labelledby":c?void 0:h,"aria-label":c,disabled:f,onClick:()=>i(!n),className:oe("relative mt-0.5 inline-flex h-5 w-9 shrink-0 items-center rounded-pill border transition-colors duration-[var(--ez-motion-fast)] disabled:opacity-50",n?"border-accent bg-accent":"border-line-strong bg-inset","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50"),children:a.jsx("span",{className:oe("inline-block size-3.5 rounded-full bg-white shadow-sm transition-transform duration-[var(--ez-motion-fast)]",n?"translate-x-[18px]":"translate-x-[3px]")})})]})}function Ja({children:n,className:i}){return a.jsx("div",{className:oe("grid gap-4 sm:grid-cols-2",i),children:n})}const eT=["Domains, certificates and nginx configs in one flow","Live nginx status, health checks and log tails","Processes, notifications and Hub pairing built in","Local-first: no Docker, no cloud account"],tT="This code has expired. Get a new one with: ezz dashboard setup-code";function Jy(n){return n?.setupCodeRequired!==!0?!1:n.setupCodeExpiresAt===null||n.setupCodeExpiresAt<=Date.now()}function Wy({compact:n=!1}){return a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(Zb,{className:"h-6"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),!n&&a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]})}function nT({children:n}){const{theme:i,toggleTheme:r}=kb();return a.jsxs("div",{className:"relative flex min-h-full flex-col overflow-hidden bg-canvas px-4 py-8 sm:py-12",children:[a.jsxs("div",{className:"pointer-events-none absolute inset-0","aria-hidden":"true",children:[a.jsx("div",{className:"absolute -top-48 left-1/2 h-[420px] w-[760px] -translate-x-1/2 rounded-full bg-accent-soft blur-3xl"}),a.jsx("div",{className:"absolute -bottom-56 right-[-120px] h-[380px] w-[520px] rounded-full bg-info-soft blur-3xl"})]}),a.jsxs("div",{className:"relative my-auto grid w-full max-w-4xl self-center overflow-hidden rounded-xl border border-line bg-surface shadow-card lg:grid-cols-[1.02fr_1fr]",children:[a.jsxs("aside",{className:"hidden flex-col justify-between gap-8 border-r border-line bg-raised/40 p-8 lg:flex",children:[a.jsx(Wy,{}),a.jsxs("div",{children:[a.jsx("h2",{className:"max-w-sm text-2xl font-semibold leading-snug tracking-tight text-ink",children:"nginx, certificates and processes — one calm console."}),a.jsx("ul",{className:"mt-6 space-y-3",children:eT.map(c=>a.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-muted",children:[a.jsx("span",{className:"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full bg-ok-soft text-ok",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})}),c]},c))})]}),a.jsxs("div",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(Gh,{className:"size-3.5","aria-hidden":"true"}),"Runs on this server. Nothing leaves it."]})]}),a.jsxs("section",{className:"relative p-6 sm:p-8",children:[a.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4 lg:justify-end",children:[a.jsx("div",{className:"lg:hidden",children:a.jsx(Wy,{compact:!0})}),a.jsx(ct,{label:i==="dark"?"Switch to light theme":"Switch to dark theme",onClick:r,children:i==="dark"?a.jsx($b,{className:"size-4.5","aria-hidden":"true"}):a.jsx(Mb,{className:"size-4.5","aria-hidden":"true"})})]}),n]})]}),a.jsxs("footer",{className:"relative py-4 text-center text-2xs text-faint",children:["© ",Qb()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})}function Fb({show:n,onToggle:i}){return a.jsx(ct,{label:n?"Hide password":"Show password",size:"sm",onClick:i,className:"text-faint hover:text-ink",children:n?a.jsx(vS,{className:"size-4","aria-hidden":"true"}):a.jsx(jS,{className:"size-4","aria-hidden":"true"})})}function Jb({error:n,cooldown:i=0}){if(!n)return null;const r=typeof n.payload.hint=="string"?n.payload.hint:void 0,c=Wb(n),d=i>0?i:c;return a.jsx(ve,{tone:"danger",title:c===null?n.message:"Too many attempts",className:"mb-4",children:r??(d===null?void 0:i>0?`Try again in ${aT(d)}.`:"You can try again now.")})}function Wb(n){if(n?.status!==429)return null;const i=n.payload.retryAfterSeconds;return typeof i!="number"||!Number.isFinite(i)||i<=0?null:Math.ceil(i)}function aT(n){return n>=120?`${Math.ceil(n/60)} minutes`:n>=60?"1 minute":`${n} second${n===1?"":"s"}`}function e0(){const[n,i]=p.useState(0);return p.useEffect(()=>{if(n<=0)return;const c=window.setTimeout(()=>i(d=>Math.max(0,d-1)),1e3);return()=>window.clearTimeout(c)},[n]),{remaining:n,start:c=>{const d=Wb(c);d!==null&&i(d)}}}function sT(){const{login:n,retryBoot:i,sessionMessage:r}=ja(),[c,d]=p.useState(""),[f,m]=p.useState(!1),[h,g]=p.useState(null),[v,b]=p.useState(null),[x,j]=p.useState(!1),k=e0(),z=k.remaining,T=async w=>{if(w.preventDefault(),!(z>0)){if(!c){g("Enter your password.");return}g(null),b(null),j(!0);try{await n(c)}catch(R){const S=R instanceof He?R:null;if(S?.payload.needsSetup){await i();return}if(S?.status===409){await i();return}S?.status===429&&k.start(S),b(S)}finally{j(!1)}}};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"Dashboard"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Welcome back"}),a.jsx("p",{className:"mt-1 text-sm text-muted",children:"Sign in to manage this server."})]}),r&&a.jsx(ve,{tone:"info",title:"You were signed out",className:"mb-4",children:r}),a.jsx(Jb,{error:v,cooldown:z}),a.jsxs("form",{onSubmit:T,noValidate:!0,children:[a.jsx(Me,{label:"Password",type:f?"text":"password",value:c,onChange:w=>{d(w.target.value),h&&g(null)},error:h,autoComplete:"current-password",autoFocus:!0,trailing:a.jsx(Fb,{show:f,onToggle:()=>m(w=>!w)})}),a.jsxs(ae,{type:"submit",variant:"primary",size:"lg",loading:x,disabled:z>0,className:"mt-5 w-full",children:[z>0?`Try again in ${z}s`:"Sign in",!x&&z===0&&a.jsx(vi,{className:"size-4","aria-hidden":"true"})]})]})]})}function lT(){const{auth:n,setup:i,retryBoot:r}=ja(),c=n?.minPasswordLength??8,d=n?.canUseNoPassword===!0,f=n?.setupCodeRequired===!0,m=Jy(n),[h,g]=p.useState("password"),[v,b]=p.useState(""),[x,j]=p.useState(""),[k,z]=p.useState(""),[T,w]=p.useState(!1),[R,S]=p.useState({}),[O,E]=p.useState(null),[M,X]=p.useState(!1),A=e0(),U=A.remaining,W=async I=>{if(I.preventDefault(),U>0)return;const te={};if(f&&!v.trim()&&(te.code="Enter the setup code shown by the server."),h==="password"&&(x.length<c&&(te.password=`Use at least ${c} characters.`),k!==x&&(te.confirm="The two passwords do not match.")),S(te),!(Object.keys(te).length>0)){E(null),X(!0);try{if(h==="none")await i({mode:"none"});else{const B=v.trim();await i({password:x,mode:"password",...B?{setupCode:B}:{}})}}catch(B){const V=B instanceof He?B:null;if(V?.status===409){await r();return}if(V?.status===400&&Jy(n)){E(null);return}V?.status===429&&A.start(V),E(V)}finally{X(!1)}}};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"First run"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Set up this dashboard"}),a.jsx("p",{className:"mt-1 text-sm text-muted",children:"Choose how Easy DevOps protects itself. You can change this later in Settings."})]}),a.jsx(Jb,{error:O,cooldown:U}),a.jsxs("form",{onSubmit:W,noValidate:!0,children:[a.jsxs("div",{className:oe("grid gap-2",d&&"grid-cols-2"),role:"group","aria-label":"Authentication method",children:[a.jsxs("button",{type:"button","aria-pressed":h==="password",onClick:()=>g("password"),className:oe("rounded-md border p-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h==="password"?"border-accent bg-accent-soft":"border-line bg-raised hover:border-line-strong hover:bg-inset"),children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(Ur,{className:"size-3.5 text-accent-text","aria-hidden":"true"}),"Password"]}),a.jsx("span",{className:"mt-1 block text-2xs text-muted",children:"Required to sign in from any browser."})]}),d&&a.jsxs("button",{type:"button","aria-pressed":h==="none",onClick:()=>g("none"),className:oe("rounded-md border p-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h==="none"?"border-accent bg-accent-soft":"border-line bg-raised hover:border-line-strong hover:bg-inset"),children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(Ek,{className:"size-3.5 text-warn","aria-hidden":"true"}),"No password"]}),a.jsx("span",{className:"mt-1 block text-2xs text-muted",children:"Only from this machine, while bound to loopback."})]})]}),f&&m&&a.jsx(ve,{tone:"warning",title:tT,className:"mt-4",children:"Run that on the server, then reload this page to enter the new code."}),f&&a.jsx(Me,{className:"mt-4",label:"Setup code",value:v,onChange:I=>{b(I.target.value),R.code&&S(te=>({...te,code:void 0}))},error:R.code,hint:"Printed in the terminal where the dashboard was started.",autoComplete:"one-time-code"}),h==="password"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{className:"mt-4",label:"Password",type:T?"text":"password",value:x,onChange:I=>{j(I.target.value),R.password&&S(te=>({...te,password:void 0}))},error:R.password,hint:`At least ${c} characters. Stored as a scrypt hash on this server.`,autoComplete:"new-password",autoFocus:!f,trailing:a.jsx(Fb,{show:T,onToggle:()=>w(I=>!I)})}),a.jsx(Me,{className:"mt-4",label:"Confirm password",type:T?"text":"password",value:k,onChange:I=>{z(I.target.value),R.confirm&&S(te=>({...te,confirm:void 0}))},error:R.confirm,autoComplete:"new-password"})]}):a.jsxs(ve,{tone:"warning",title:"The dashboard will have no password",className:"mt-4",children:["Anyone who can reach ",n?.bindAddress??"this machine"," can manage nginx, domains and certificates. Keep the dashboard bound to 127.0.0.1. Adding a password later in Settings is recommended if you ever expose it."]}),a.jsxs(ae,{type:"submit",variant:"primary",size:"lg",loading:M,disabled:U>0,className:"mt-5 w-full",children:[U>0?`Try again in ${U}s`:h==="password"?"Save password and sign in":"Start without a password",!M&&U===0&&a.jsx(vi,{className:"size-4","aria-hidden":"true"})]})]})]})}function iT(){const{auth:n,retryBoot:i}=ja(),[r,c]=p.useState(!1),d=async()=>{c(!0),await i(),c(!1)};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"No password"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Open the dashboard"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:["This dashboard is configured without a password. It only accepts requests from"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-2xs text-ink",children:n?.bindAddress??"this machine"}),"."]})]}),a.jsxs(ae,{variant:"primary",size:"lg",loading:r,onClick:d,className:"w-full",children:["Continue to dashboard",!r&&a.jsx(vi,{className:"size-4","aria-hidden":"true"})]})]})}function rT(){const{auth:n}=ja();return ba(n?.needsSetup?"Set up this dashboard":n?.authMode==="none"?"Open the dashboard":"Sign in"),a.jsxs(nT,{children:[n?.needsSetup?a.jsx(lT,{}):n?.authMode==="none"?a.jsx(iT,{}):a.jsx(sT,{}),a.jsxs("div",{className:"mx-auto mt-6 w-full max-w-sm border-t border-line pt-4 text-2xs text-faint",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[a.jsx(Gh,{className:"size-3 shrink-0","aria-hidden":"true"}),a.jsxs("span",{className:"truncate",children:["Listening on"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-2xs text-muted",children:n?.bindAddress??"…"})]})]}),a.jsx("span",{children:"Easy DevOps"})]}),!1]})]})}function bi(n,i){const{lastChange:r,changeSeq:c}=vn(),d=p.useRef(i);d.current=i,p.useEffect(()=>{if(!r)return;(Array.isArray(n)?n:[n]).includes(r.section)&&d.current()},[c])}function La({title:n,description:i,actions:r,meta:c,eyebrow:d}){return a.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[a.jsxs("div",{className:"min-w-0",children:[d&&a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:n}),c]}),i&&a.jsx("p",{className:"mt-1 max-w-2xl text-sm text-muted",children:i})]}),r&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]})}function oT(n){return Promise.all([fe.domains.list(n),fe.ssl.list(n),fe.nginx.status(n)]).then(([i,r,c])=>({domains:i,certs:r,nginx:c}))}const cT={neutral:"text-muted",accent:"text-accent-text",ok:"text-ok",warn:"text-warn",bad:"text-bad",info:"text-info"},uT={neutral:"border-line/70 bg-inset text-muted group-hover:text-ink",accent:"border-accent/25 bg-accent-soft text-accent-text",ok:"border-ok/25 bg-ok-soft text-ok",warn:"border-warn/25 bg-warn-soft text-warn",bad:"border-bad/25 bg-bad-soft text-bad",info:"border-info/25 bg-info-soft text-info"};function yc({label:n,value:i,hint:r,icon:c,tone:d="neutral",pulse:f=!1,to:m}){return a.jsx(kt,{to:m,className:"group block rounded-lg",children:a.jsxs(et,{className:"stat-card h-full px-4 py-3.5",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-2xs font-semibold uppercase tracking-[0.12em] text-faint",children:n}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[a.jsx("span",{className:oe("text-2xl font-semibold tracking-tight",cT[d]),children:i}),(d==="ok"||d==="bad"||d==="warn")&&a.jsx(ln,{tone:d,pulse:f})]})]}),a.jsx("div",{className:oe("flex size-9 shrink-0 items-center justify-center rounded-lg border transition-transform duration-[var(--ez-motion-base)] group-hover:scale-105",uT[d]),children:a.jsx(c,{className:"size-4","aria-hidden":"true"})})]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("div",{className:"truncate text-2xs text-muted",children:r}),a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-2xs font-medium text-faint opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",children:["Open",a.jsx(Hw,{className:"size-3","aria-hidden":"true"})]})]})]})})}function dT(n,i,r,c){const d=[];n&&!n.running&&d.push({id:"nginx-down",tone:"bad",title:"nginx is not running",detail:"No domain is being proxied until nginx is started.",to:"/nginx"});for(const f of r)f.status==="unreadable"||f.status==="error"?d.push({id:`cert-error-${f.domain}`,tone:"bad",title:`Certificate for ${f.domain} cannot be read`,detail:"The certificate files are missing or unreadable.",to:"/ssl"}):f.status==="expired"||f.daysLeft!==null&&f.daysLeft<0?d.push({id:`cert-expired-${f.domain}`,tone:"bad",title:`Certificate for ${f.domain} has expired`,detail:gi(f.daysLeft),to:"/ssl"}):f.status==="expiring"&&d.push({id:`cert-expiring-${f.domain}`,tone:"warn",title:`Certificate for ${f.domain} expires soon`,detail:gi(f.daysLeft),to:"/ssl"});for(const f of i)c.get(f.name)?.up===!1&&d.push({id:`domain-down-${f.name}`,tone:"bad",title:`${f.name} is not responding`,detail:`The backend ${f.backendHost}:${f.port} did not answer a health check.`,to:"/domains"});return d}function fT({entry:n}){return n?n.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):n.up?a.jsx(je,{tone:"ok",dot:!0,children:"Up"}):a.jsx(je,{tone:"bad",dot:!0,children:"Down"}):a.jsx("span",{className:"text-2xs text-faint",children:"Awaiting check"})}function hT({days:n}){const i=n<=0?"bg-bad":n<30?"bg-warn":"bg-ok",r=n<=0?100:Math.max(8,Math.min(n,90)/90*100);return a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:oe("text-2xs tabular-nums",n<30?"text-warn":"text-muted"),children:gi(n)}),a.jsx("span",{className:"h-1 w-10 shrink-0 overflow-hidden rounded-full bg-inset","aria-hidden":"true",children:a.jsx("span",{className:oe("block h-full rounded-full",i),style:{width:`${r}%`}})})]})}function mT(n){return n.type==="nginx_down"?{icon:gl,tone:"text-muted"}:n.type==="cert_expiry"?{icon:as,tone:"text-warn"}:n.type==="domain_health"?{icon:Mc,tone:"text-info"}:{icon:Mc,tone:"text-muted"}}function pT(){ba("Overview");const n=Et(),i=rn(),{nginxStatus:r,domainHealth:c,notifications:d}=vn(),{service:f}=Br(),m=qr(f),h=Ct(oT),[g,v]=p.useState(!1);yl(h.reload),bi(["domains","ssl","nginx"],h.reload);const b=h.data,x=r??b?.nginx??null,j=b?.domains??[],k=b?.certs??[],z=new Map((c??[]).map(A=>[A.name,A])),T=j.filter(A=>A.enabled).length,w=k.filter(A=>A.status==="expiring"),R=k.filter(A=>A.status==="expired"||A.status==="unreadable"||A.status==="error"),S=b?dT(x,j,k,z):[],O=S.filter(A=>A.tone==="bad").length,E=b!==null&&x?.running===!0&&S.length===0,M=R.length>0?`${$n(R.length,"certificate")} expired or unreadable`:w.length>0?`${w.length} expiring within 30 days`:k.length>0?"All certificates healthy":"No certificates yet",X=async()=>{if(await i({title:"Reload nginx?",body:"Reloading applies configuration changes. Existing connections are kept open.",confirmLabel:"Reload nginx"})){v(!0);try{const U=await fe.nginx.reload();U.success?(n.success("Nginx reloaded",U.output.trim()||"Configuration reloaded."),h.reload()):n.error("Nginx reload failed",U.output.trim()||"nginx refused the reload.")}catch(U){n.error("Nginx reload failed",U instanceof He?U.message:"The dashboard could not complete the reload.")}finally{v(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Overview",description:"The state of nginx, your domains and their certificates, live.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:h.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:h.reload,children:"Refresh"})}),h.error&&!b?a.jsx($t,{error:h.error,onRetry:h.reload}):b?a.jsxs("div",{className:"space-y-4",children:[h.error&&a.jsx(ve,{tone:"warning",title:"Showing the last known state",action:a.jsx(ae,{variant:"ghost",size:"sm",onClick:h.reload,children:"Try again"}),children:h.error.message}),a.jsxs(et,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"status-sheen pointer-events-none absolute inset-x-0 top-0 h-px overflow-hidden","aria-hidden":"true"}),a.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("div",{className:oe("relative isolate mt-0.5 flex size-11 shrink-0 items-center justify-center rounded-full border",O>0?"border-bad/30 bg-bad-soft text-bad":S.length>0?"border-warn/30 bg-warn-soft text-warn":"border-ok/30 bg-ok-soft text-ok"),children:[a.jsx("span",{className:oe("pointer-events-none absolute -inset-3 -z-10 rounded-full blur-lg",O>0?"bg-bad/25":S.length>0?"bg-warn/25":"bg-ok/25"),"aria-hidden":"true"}),O>0||S.length>0?a.jsx(fl,{className:"size-5","aria-hidden":"true"}):a.jsx(ts,{className:"size-5","aria-hidden":"true"}),a.jsx("span",{className:oe("absolute -inset-px rounded-full border",O>0?"border-bad/20":S.length>0?"border-warn/20":"border-ok/20"),"aria-hidden":"true"})]}),a.jsxs("div",{"aria-live":"polite",children:[a.jsx("div",{className:"text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"System status"}),a.jsx("div",{className:"mt-0.5 text-lg font-semibold tracking-tight text-ink",children:O>0?"Attention needed":S.length>0?"A few things to check":"All systems healthy"}),a.jsxs("div",{className:"mt-0.5 text-xs text-muted",children:[x?.running?"nginx running":"nginx stopped"," · ",$n(j.length,"domain")," · ",$n(k.length,"certificate"),S.length>0&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("span",{className:O>0?"text-bad":"text-warn",children:[$n(S.length,"item")," need attention"]})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:flex-col sm:items-end",children:[a.jsx(je,{tone:E?"ok":O>0?"bad":"warn",dot:!0,children:E?"Healthy":O>0?"Degraded":"Check"}),a.jsxs("span",{className:"text-2xs text-faint",children:["Checked ",b.nginx?"live":"—",x?.version?` · ${x.version}`:""]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[a.jsx(yc,{label:"Nginx",value:x?x.running?"Active":"Offline":"Unknown",hint:x?.running?`PID ${x.pid??"—"}${x.version?` · ${x.version}`:""}`:"Traffic is not being proxied.",icon:gl,tone:x?x.running?"ok":"bad":"neutral",pulse:x?.running===!0,to:"/nginx"}),a.jsx(yc,{label:"Domains",value:`${T}/${j.length}`,hint:j.length===0?"No domains configured yet.":T===j.length?"All domains enabled.":`${j.length-T} disabled.`,icon:Os,tone:j.length===0?"neutral":T>0?"accent":"warn",to:"/domains"}),a.jsx(yc,{label:"Certificates",value:String(k.length),hint:M,icon:Rn,tone:R.length>0?"bad":w.length>0?"warn":k.length>0?"ok":"neutral",to:"/ssl"}),a.jsx(yc,{label:"Background service",value:m?m.running?"Running":"Stopped":"Unknown",hint:m?m.running?m.startsAt==="unknown"?m.mechanismDetail:`${m.mechanismLabel} · starts ${m.startsAtLabel.toLowerCase()}`:m.stoppedByUser?m.installed?`You stopped it${m.stoppedAtLabel?` on ${m.stoppedAtLabel}`:""}; it starts again automatically.`:"You stopped it; start it to resume monitoring.":m.installed?"Monitoring runs in this window.":"Not installed; monitoring runs in this window.":"Checking…",icon:Eb,tone:m?m.running?"ok":"warn":"neutral",pulse:m?.running===!0,to:"/processes"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(kt,{to:"/domains?new=1",className:ma("primary","sm"),children:[a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),"Add domain"]}),a.jsxs(kt,{to:"/ssl?new=1",className:ma("secondary","sm"),children:[a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),"Issue certificate"]}),a.jsx(ae,{variant:"secondary",size:"sm",loading:g,disabled:!x?.running,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:X,children:"Reload nginx"})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsxs(et,{className:"xl:col-span-2",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3 sm:px-5",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Domain health"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Backends are checked on connect and every 60 seconds."})]}),a.jsx(kt,{to:"/domains",className:"text-2xs font-medium text-muted hover:text-ink",children:"Manage"})]}),j.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[a.jsx(Os,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No domains yet"}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Add a domain to put a backend behind nginx."})]}),a.jsx(kt,{to:"/domains?new=1",className:ma("primary","sm"),children:"Add your first domain"})]}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-left text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{className:"px-4 py-2 font-medium sm:px-5",children:"Domain"}),a.jsx("th",{className:"hidden px-3 py-2 font-medium sm:table-cell",children:"Target"}),a.jsx("th",{className:"px-3 py-2 font-medium",children:"Health"}),a.jsx("th",{className:"hidden px-3 py-2 font-medium md:table-cell",children:"Certificate"})]})}),a.jsx("tbody",{children:j.map(A=>{const U=z.get(A.name);return a.jsxs("tr",{className:"border-b border-line/60 last:border-0 hover:bg-raised/40",children:[a.jsx("td",{className:"px-4 py-2.5 sm:px-5",children:a.jsxs(kt,{to:`/domains?domain=${encodeURIComponent(A.name)}`,className:"flex items-center gap-2 font-medium text-ink hover:text-accent-text",children:[a.jsx("span",{className:"truncate",children:A.name}),!A.enabled&&a.jsx(je,{tone:"neutral",children:"Disabled"})]})}),a.jsxs("td",{className:"hidden px-3 py-2.5 font-mono text-2xs text-muted sm:table-cell",children:[A.backendHost,":",A.port]}),a.jsx("td",{className:"px-3 py-2.5",children:a.jsx(fT,{entry:U})}),a.jsx("td",{className:"hidden px-3 py-2.5 text-2xs md:table-cell",children:A.ssl.enabled?A.daysLeft!==null?a.jsx(hT,{days:A.daysLeft}):a.jsx("span",{className:"text-muted",children:"Unknown"}):a.jsx("span",{className:"text-faint",children:"Not enabled"})})]},A.name)})})]})}),c===null&&j.length>0&&a.jsx("div",{className:"border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:"Waiting for the first health check…"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs(et,{children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Needs attention"}),a.jsx("span",{className:"text-2xs text-faint",children:S.length})]}),S.length===0?a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-5 text-xs text-muted",children:[a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}),"Nothing needs attention right now."]}):a.jsx("div",{className:"max-h-[280px] overflow-y-auto",children:S.map(A=>a.jsxs(kt,{to:A.to,className:"group flex items-start gap-2.5 border-b border-line/60 px-4 py-2.5 last:border-0 hover:bg-raised/50",children:[a.jsx(ln,{tone:A.tone,className:"mt-1"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:A.title}),a.jsx("div",{className:"mt-0.5 text-2xs text-muted",children:A.detail})]}),a.jsx(Ww,{className:"mt-0.5 size-3.5 shrink-0 text-faint transition-transform group-hover:translate-x-0.5","aria-hidden":"true"})]},A.id))})]}),a.jsxs(et,{children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Recent events"}),a.jsx(kt,{to:"/notifications",className:"text-2xs font-medium text-muted hover:text-ink",children:"All events"})]}),d.length===0?a.jsx("div",{className:"px-4 py-5 text-xs text-muted",children:"No events since this tab opened. Alerts from nginx, certificates and domain health appear here live."}):a.jsx("div",{className:"event-timeline",children:d.slice(0,6).map(A=>{const{icon:U,tone:W}=mT(A);return a.jsxs("div",{className:"flex items-start gap-2.5 border-b border-line/60 px-4 py-2.5 last:border-0",children:[a.jsx("span",{className:"relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line bg-raised",children:a.jsx(U,{className:oe("size-3",W),"aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:A.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:$r(A.timestamp)})]})]},A.id)})})]})]})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-28 w-full rounded-lg"}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[0,1,2,3].map(A=>a.jsx(tt,{className:"h-[92px] rounded-lg"},A))}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsx(tt,{className:"h-64 rounded-lg xl:col-span-2"}),a.jsx(tt,{className:"h-64 rounded-lg"})]})]})]})}function Ih(n){if(!n||!n.trim())return"A domain name is required.";const r=(n.startsWith("*.")?n.slice(2):n).split(".");if(r.length<2)return"Use at least two labels, for example example.com.";const c=/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;return r.some(d=>!d||!c.test(d))?"Use letters, digits and hyphens only; each label must start and end with a letter or digit.":null}function su(n){const i=Number(n);return!Number.isInteger(i)||i<1||i>65535?"Port must be a whole number between 1 and 65535.":null}function t0(n){return n&&(!n.includes("@")||n.trim()!==n)?"Enter a valid email address.":null}function xT(n){return n?/^\d+[kmgKMG]?$/.test(n)?null:"Use a size like 10m, 1g or 512k.":null}function vr(n,i){const r=Number(n);return!Number.isInteger(r)||r<1?`${i} must be a positive whole number.`:null}function ev(n,i){return n?n.length<i?`Use at least ${i} characters.`:null:"Enter a password."}const gT=2048,tv=/^[A-Za-z0-9._~-]{1,200}$/;function yT(n){if(!n)return"The Hub URL is missing.";if(n!==n.trim())return"The Hub URL must not have spaces around it.";if(n.includes("://")&&!/^https?:\/\//i.test(n))return"The Hub URL must use http or https.";const i=/^https?:\/\//i.test(n)?n:`https://${n}`;let r;try{r=new URL(i)}catch{return"The Hub URL is not valid."}return r.protocol!=="http:"&&r.protocol!=="https:"?"The Hub URL must use http or https.":r.hostname?r.username||r.password?"The Hub URL must not contain credentials.":null:"The Hub URL is missing a host."}function vT(n){const i=n.trim();if(!i)return"Paste the connection string the Hub gave you.";if(i.length>gT)return"That connection string is too long.";if(!i.toLowerCase().startsWith("ezops://"))return"The connection string must start with ezops://.";const r=i.slice(8).split("|");if(r.length!==3)return"Expected the form ezops://hubUrl|serverId|secret.";const[c,d,f]=r.map(h=>h.trim()),m=yT(c);return m||(d?f?tv.test(d)?tv.test(f)?null:"The secret has characters the Hub does not use.":"The server ID has characters the Hub does not use.":"The secret is missing.":"The server ID is missing.")}function bT(n){const i=document.activeElement,r=document.getSelection(),c=[];if(r)for(let m=0;m<r.rangeCount;m+=1)c.push(r.getRangeAt(m));const d=document.createElement("textarea");d.value=n,d.setAttribute("readonly",""),d.style.position="fixed",d.style.top="0",d.style.left="0",d.style.opacity="0",d.style.pointerEvents="none",document.body.appendChild(d);let f;try{d.select(),d.setSelectionRange(0,n.length),f=document.execCommand("copy")}catch{f=!1}finally{if(d.remove(),r){r.removeAllRanges();for(const m of c)r.addRange(m)}i?.focus({preventScroll:!0})}return f}async function jT(n){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(n),!0}catch{}return bT(n)}function qt({value:n,label:i="Copy",withText:r=!1,className:c}){const[d,f]=p.useState("idle"),m=p.useRef(null),h=Et();p.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const g=async()=>{const x=await jT(n);f(x?"copied":"failed"),x||h.error("Could not copy","The browser blocked clipboard access. Select the text and copy it manually."),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>f("idle"),1600)},v=d==="copied"?a.jsx(dl,{className:"size-3.5 text-ok","aria-hidden":"true"}):d==="failed"?a.jsx(fl,{className:"size-3.5 text-bad","aria-hidden":"true"}):a.jsx(hS,{className:"size-3.5","aria-hidden":"true"}),b=d==="copied"?"Copied":d==="failed"?"Copy failed":i;return r?a.jsx(ae,{size:"sm",variant:"secondary",icon:v,onClick:g,className:c,children:a.jsx("span",{"aria-live":"polite",children:b})}):a.jsx(ct,{label:b,size:"sm",variant:"ghost",onClick:g,className:oe(d==="copied"&&"text-ok",d==="failed"&&"text-bad",c),children:v})}const NT={discord:{label:"Discord",badgeClassName:"bg-discord-soft text-discord",icon:Wc},telegram:{label:"Telegram",badgeClassName:"bg-telegram-soft text-telegram",icon:Ub}},nv={label:"Channel",badgeClassName:"bg-inset text-muted",icon:Cc};function n0(n){const i=n.trim(),r=NT[i.toLowerCase()];return r||{...nv,label:i?i.charAt(0).toUpperCase()+i.slice(1):nv.label}}function wT(n){return n0(n).label}function a0({type:n,className:i}){const r=n0(n),c=r.icon;return a.jsxs("span",{className:oe("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",r.badgeClassName,i),children:[a.jsx(c,{className:"size-3 shrink-0","aria-hidden":"true"}),r.label]})}const av="rounded-sm font-medium text-accent-text underline-offset-2 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:text-faint disabled:no-underline disabled:opacity-60";function ST({lastTest:n}){return n==="passed"?a.jsx(je,{tone:"ok",children:"Test passed"}):n==="failed"?a.jsx(je,{tone:"bad",children:"Test failed"}):n===null?a.jsx("span",{className:"text-2xs text-faint",children:"Not tested"}):null}function wh({channels:n,value:i,onChange:r,disabled:c,disabledIds:d,label:f,emptyHref:m,compact:h}){const g=p.useId(),v=p.useId(),[b,x]=p.useState("");if(n.length===0)return a.jsxs("div",{role:"group","aria-labelledby":g,className:"space-y-2",children:[a.jsx("span",{id:g,className:"block text-xs font-medium text-ink",children:f}),a.jsxs("div",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:["No notification channels yet."," ",a.jsx(kt,{to:m,className:"font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:"Add a channel"})]})]});const j=b.trim(),k=j.toLowerCase(),z=k?n.filter(E=>E.name.toLowerCase().includes(k)||E.type.toLowerCase().includes(k)||wT(E.type).toLowerCase().includes(k)):n,T=n.filter(E=>!d?.[E.id]),w=n.filter(E=>i.includes(E.id)).length,R=T.length>0&&T.every(E=>i.includes(E.id)),S=(E,M)=>{r(M?Array.from(new Set([...i,E])):i.filter(X=>X!==E))},O=()=>{r(Array.from(new Set([...i,...T.map(E=>E.id)])))};return a.jsxs("div",{role:"group","aria-labelledby":g,className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[a.jsx("span",{id:g,className:"text-xs font-medium text-ink",children:f}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-2xs",children:[a.jsxs("span",{className:"text-faint","aria-live":"polite",children:[w," of ",n.length," selected"]}),a.jsx("button",{type:"button",className:av,onClick:O,disabled:c||R,children:"Select all"}),a.jsx("button",{type:"button",className:av,onClick:()=>r([]),disabled:c||w===0,children:"Clear"})]})]}),n.length>6&&a.jsxs("div",{className:"relative",children:[a.jsx(Lb,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-faint","aria-hidden":"true"}),a.jsx("input",{id:v,type:"search",value:b,onChange:E=>x(E.target.value),onKeyDown:E=>{E.key==="Enter"&&E.preventDefault()},placeholder:"Search channels","aria-label":"Search channels",className:"h-8 w-full rounded-md border border-line bg-canvas pl-8 pr-3 text-xs text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25"})]}),z.length===0?a.jsx("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-3 text-xs text-muted",children:`No channels match "${j}"`}):a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:z.map(E=>{const M=i.includes(E.id),X=d?.[E.id],A=c||!!X;return a.jsxs("label",{title:X,className:oe("relative flex min-w-0 cursor-pointer items-start gap-2.5 rounded-md border px-3 text-left transition-colors duration-[var(--ez-motion-fast)]",h?"py-2":"py-2.5",M?"border-accent bg-accent-soft":"border-line bg-raised/40",!M&&!A&&"hover:border-line-strong hover:bg-raised",A&&"cursor-not-allowed opacity-60","focus-within:outline-none focus-within:ring-2 focus-within:ring-accent/50"),children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:M,disabled:A,onChange:U=>S(E.id,U.target.checked)}),a.jsxs("span",{className:"min-w-0 flex-1 pr-4 pt-0.5",children:[a.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{className:"truncate text-xs font-medium text-ink",children:E.name}),a.jsx(a0,{type:E.type}),a.jsx(ST,{lastTest:E.lastTest})]}),X&&a.jsx("span",{className:"mt-1 block text-2xs text-faint",children:X})]}),M&&a.jsx("span",{className:"absolute right-2 top-2 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})})]},E.id)})})]})}function kT({label:n,items:i,onChange:r,onToggleAll:c,disabled:d,children:f}){const m=p.useId(),h=p.useId(),g=p.useRef(null),v=i.length>0&&i.every(x=>x.enabled),b=i.every(x=>!x.enabled);return p.useEffect(()=>{g.current&&(g.current.indeterminate=!v&&!b)},[v,b]),a.jsxs("div",{role:"group","aria-labelledby":m,className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[a.jsx("h4",{id:m,className:"text-xs font-medium text-ink",children:n}),a.jsxs("label",{htmlFor:h,className:"inline-flex cursor-pointer items-center gap-2 text-2xs text-muted",children:[a.jsx("input",{id:h,ref:g,type:"checkbox",checked:v,disabled:d||i.length===0,onChange:()=>c(!v),className:"size-3.5 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)] disabled:cursor-not-allowed"}),a.jsx("span",{className:"select-none",children:v?"All on":b?"All off":"Mixed"})]})]}),a.jsx("div",{className:"space-y-3",children:i.map(x=>a.jsxs("div",{className:"rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:x.enabled,onChange:j=>r(x.id,j),label:x.label,description:x.description,disabled:d}),x.enabled&&f?.(x)]},x.id))})]})}const TT="text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript",Sh=[{id:"domain_health",label:"Port / health check",description:"The backend stops answering its health check."},{id:"cert_expiry",label:"SSL / certificate expiry",description:"A certificate is expired or close to expiry."},{id:"nginx_down",label:"nginx stopped",description:"nginx itself is not serving requests."}],s0=()=>({domain_health:{enabled:!0,channelIds:[]},cert_expiry:{enabled:!0,channelIds:[]},nginx_down:{enabled:!0,channelIds:[]}});function CT(){return{name:"",port:3e3,backendHost:"127.0.0.1",upstreamType:"http",www:!1,wildcard:!1,enabled:!0,ssl:{enabled:!1,certPath:"",keyPath:"",redirect:!0,hsts:!1,hstsMaxAge:31536e3},performance:{maxBodySize:"10m",readTimeout:60,connectTimeout:10,proxyBuffers:!1,gzip:!0,gzipTypes:TT},security:{rateLimit:!1,rateLimitRate:10,rateLimitBurst:20,securityHeaders:!1,custom404:!1,custom50x:!1},advanced:{accessLog:!0,customLocations:""},notifications:s0()}}function ET(n){const i=s0();for(const r of Sh){const c=n.notifications?.[r.id];c&&(i[r.id]={enabled:c.enabled,channelIds:[...c.channelIds??[]]})}return{name:n.name,port:n.port,backendHost:n.backendHost||"127.0.0.1",upstreamType:n.upstreamType||"http",www:n.www,wildcard:n.wildcard,enabled:n.enabled,ssl:{enabled:!!n.ssl?.enabled,certPath:n.ssl?.certPath??"",keyPath:n.ssl?.keyPath??"",redirect:n.ssl?.redirect??!0,hsts:n.ssl?.hsts??!1,hstsMaxAge:n.ssl?.hstsMaxAge||31536e3},performance:{...n.performance},security:{...n.security},advanced:{...n.advanced},notifications:i}}const sv={http:"HTTP",https:"HTTPS",ws:"WebSocket"};function kh(n){return n.trim().replace(/^\*\./,"")}function RT(n){return"status"in n&&n.status==="waiting_dns"}function zT(n,i){const r={};if(i){const h=Ih(kh(n.name));h&&(r["domain-name"]=h)}if(n.backendHost.trim()||(r["backend-host"]="A backend host or URL is required."),!/^https?:\/\//i.test(n.backendHost.trim())){const h=su(n.port);h&&(r["backend-port"]=h)}const d=xT(n.performance.maxBodySize);d&&(r["max-body"]=d);const f=vr(n.performance.readTimeout,"Read timeout");f&&(r["read-timeout"]=f);const m=vr(n.performance.connectTimeout,"Connect timeout");if(m&&(r["connect-timeout"]=m),n.ssl.enabled&&n.ssl.hsts){const h=vr(n.ssl.hstsMaxAge,"HSTS max-age");h&&(r["hsts-max-age"]=h)}if(n.security.rateLimit){const h=vr(n.security.rateLimitRate,"Rate");h&&(r["rate-limit-rate"]=h);const g=vr(n.security.rateLimitBurst,"Burst");g&&(r["rate-limit-burst"]=g)}return r}function lv(n){if(n instanceof He){const i=n.payload.error;if(i&&typeof i=="object")return{message:"Certificate creation failed",detail:[i.step?`Step: ${i.step}`:"",i.cause?`Cause: ${i.cause}`:"",i.consequence?`Note: ${i.consequence}`:""].filter(Boolean).join(`
|
|
511
|
-
`)||"The certificate authority did not issue a certificate.",hint:"nginx is left as it was."};const r=n.code==="email_required"?"Set the ACME email in Settings → General, then try again.":typeof n.payload.hint=="string"?n.payload.hint:void 0;return{message:"Certificate creation failed",detail:(typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.output=="string"?n.payload.output:void 0)??n.message,hint:r}}return{message:"Certificate creation failed",detail:n instanceof Error?n.message:"The request could not be completed."}}function ui({id:n,title:i,description:r,icon:c,open:d,onToggle:f,children:m}){return a.jsxs("section",{className:"border-b border-line last:border-b-0",children:[a.jsx("h3",{children:a.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":`section-${n}`,onClick:f,className:"group flex w-full items-center gap-3 px-5 py-3.5 text-left transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/50",children:[a.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-inset text-muted transition-colors group-hover:text-ink",children:a.jsx(c,{className:"size-3.5","aria-hidden":"true"})}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:i}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:r})]}),a.jsx(Rb,{className:oe("size-4 shrink-0 text-faint transition-transform duration-[var(--ez-motion-fast)]",d&&"rotate-180"),"aria-hidden":"true"})]})}),d&&a.jsx("div",{id:`section-${n}`,className:"px-5 pb-5 pt-1",children:m})]})}const di=n=>Number.isFinite(n)&&n!==0?n:"";function iv({wildcard:n,certMethod:i,onMethodChange:r,certFailure:c,dnsPending:d,certAction:f,onCreate:m,onConfirmDns:h,onCancelDns:g,disabledReason:v,extraActions:b}){const x=f!==null;return a.jsxs("div",{className:"space-y-3",children:[c&&a.jsxs(ve,{tone:"danger",title:c.message,children:[c.hint&&a.jsx("div",{children:c.hint}),c.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:c.detail})]}),d?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"Add this DNS TXT record, then continue"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:d.hint??"The certificate authority checks this record before issuing the certificate."})]}),a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-canvas p-3 font-mono text-2xs",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-sans text-2xs uppercase tracking-wider text-faint",children:"Name"}),a.jsx("div",{className:"mt-0.5 break-all text-ink",children:d.txtName})]}),a.jsx(qt,{value:d.txtName,label:"Copy record name"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-line pt-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-sans text-2xs uppercase tracking-wider text-faint",children:"Value"}),a.jsx("div",{className:"mt-0.5 break-all text-ink",children:d.txtValue})]}),a.jsx(qt,{value:d.txtValue,label:"Copy record value"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(ae,{variant:"primary",size:"sm",loading:f==="confirm",onClick:h,children:"I added the record, continue"}),a.jsx(ae,{variant:"secondary",size:"sm",onClick:g,disabled:x,children:"Cancel issuance"})]})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("fieldset",{children:[a.jsx("legend",{className:"mb-2 text-xs font-medium text-muted",children:"Validation method"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",i==="http"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",n&&"cursor-not-allowed opacity-50"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"http",checked:i==="http",disabled:n||x,onChange:()=>r("http"),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{children:[a.jsx("span",{className:"block font-medium text-ink",children:"HTTP challenge"}),a.jsx("span",{className:"block text-2xs text-faint",children:"DNS already points here"})]})]}),a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",i==="dns"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"dns",checked:i==="dns",disabled:x,onChange:()=>r("dns"),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{children:[a.jsx("span",{className:"block font-medium text-ink",children:"DNS challenge"}),a.jsx("span",{className:"block text-2xs text-faint",children:"Add a TXT record"})]})]})]}),n&&a.jsx("p",{className:"mt-2 text-2xs text-warn",children:"Wildcard certificates require the DNS challenge."})]}),v&&a.jsx("p",{className:"text-2xs text-warn",children:v}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(ae,{variant:"primary",size:"sm",loading:f==="issue",onClick:m,disabled:!!v,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Create certificate"}),b]})]})]})}function DT(n,i,r){return n==="exact"?`A certificate for ${i} already exists`:n==="wildcard"?`A wildcard certificate covers ${i}`:`The certificate in ${r} covers ${i}`}function AT({domainName:n,match:i,certificate:r,onAccept:c}){const d=r.daysLeft,f=d===null?"text-muted":d<=0?"text-bad":d<30?"text-warn":"text-ok",m=d===null?"expiry unknown":d<=0?"expired":`${d} days left`;return a.jsx("div",{className:"rounded-md border border-accent/40 bg-accent-soft/30 p-3.5",children:a.jsxs("div",{className:"flex flex-wrap items-start gap-x-3 gap-y-3",children:[a.jsx(Xh,{className:"mt-0.5 size-4 shrink-0 text-accent-text","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:DT(i,n,r.domain)}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i==="exact"?"Turning SSL on will use this certificate.":`Stored in ${r.domain}, which lists this domain as a name. Turning SSL on will use it.`}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs",children:[a.jsx("span",{className:oe("font-medium",f),children:m}),r.names.length>1&&a.jsxs("span",{className:"break-all text-muted",children:["covers ",r.names.join(", ")]})]}),a.jsxs("div",{className:"mt-2 space-y-0.5 font-mono text-2xs text-faint",children:[a.jsx("div",{className:"break-all",children:r.certPath}),a.jsx("div",{className:"break-all",children:r.keyPath})]})]}),a.jsx(ae,{size:"sm",onClick:c,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Use this certificate"})]})})}function OT({editor:n,onClose:i,onSaved:r}){const c=n.mode==="edit"?n.domain:null,d=Et(),f=rn(),m=p.useId(),[h,g]=p.useState(()=>c?ET(c):CT()),v=p.useRef(JSON.stringify(h)),b=JSON.stringify(h)!==v.current,[x,j]=p.useState(()=>c?{basic:!0,ssl:!0,performance:!0,security:!0,advanced:!0,notifications:!0}:{basic:!0,ssl:!0,performance:!1,security:!1,advanced:!1,notifications:!1}),[k,z]=p.useState({}),[T,w]=p.useState(null),[R,S]=p.useState(!1),[O,E]=p.useState(null),[M,X]=p.useState("http"),[A,U]=p.useState(null),[W,I]=p.useState(null),[te,B]=p.useState(null),V=Ct(J=>fe.settings.channels.list(J),[],{enabled:!!c}),de=Ct(J=>fe.ssl.list(J),[],{enabled:h.ssl.enabled}),le=Ct(J=>fe.domains.sslSuggestion(c?.name??"",J),[c?.name],{enabled:!!c});p.useEffect(()=>{if(!b)return;const J=be=>{be.preventDefault(),be.returnValue=""};return window.addEventListener("beforeunload",J),()=>window.removeEventListener("beforeunload",J)},[b]),p.useEffect(()=>{O&&h.wildcard&&X("dns")},[O,h.wildcard]);const Q=/^https?:\/\//i.test(h.backendHost.trim()),F=c?c.name:kh(h.name),L=Ih(F),ee=h.ssl.certPath.trim()===""&&h.ssl.keyPath.trim()==="",ue=de.data?.some(J=>J.domain===F)??!1,ke=le.data?.found?le.data:null,Ne=ee&&ke!==null,Ee=h.ssl.enabled&&ee&&!de.loading&&!ue&&!O&&!le.loading&&ke===null;function C(J,be){g(Ue=>({...Ue,[J]:be}))}function q(J,be){g(Ue=>({...Ue,ssl:{...Ue.ssl,[J]:be}}))}function Y(J){g(be=>({...be,ssl:{...be.ssl,enabled:!0,certPath:J.certPath,keyPath:J.keyPath}}))}function re(J,be){g(Ue=>({...Ue,performance:{...Ue.performance,[J]:be}}))}function ye(J,be){g(Ue=>({...Ue,security:{...Ue.security,[J]:be}}))}function Re(J,be){g(Ue=>({...Ue,advanced:{...Ue.advanced,[J]:be}}))}function xe(J,be){g(Ue=>({...Ue,notifications:{...Ue.notifications,[J]:{...Ue.notifications[J],...be}}}))}const me=J=>j(be=>({...be,[J]:!0})),ie=J=>({...h,...J,ssl:{...h.ssl,...J?.ssl??{}},name:c?c.name:kh(h.name)}),Pe=J=>{const be=zT(J,!c);if(Object.keys(be).length===0)return!0;z(be),w({message:"Check the highlighted fields before saving."}),(be["domain-name"]||be["backend-host"]||be["backend-port"])&&me("basic"),(be["max-body"]||be["read-timeout"]||be["connect-timeout"])&&me("performance"),(be["rate-limit-rate"]||be["rate-limit-burst"])&&me("security"),be["hsts-max-age"]&&me("ssl");const Ue=Object.keys(be)[0];return queueMicrotask(()=>document.getElementById(Ue)?.focus()),!1},Ge=async J=>{const be=ie(J);if(!Pe(be))return;const Ue=c?.name??be.name;z({}),w(null),S(!0);let Dt;try{Dt=c?await fe.domains.update(c.name,be):await fe.domains.create(be)}catch(aa){const Xe=aa instanceof He?aa:null;if(!Xe){E(null),I(null),U(null),d.warning("The dashboard’s reply could not be read","The domain list was reloaded. Check that the change is there before saving again."),r();return}Xe.status===422&&Xe.code==="cert_missing"?(E({certPath:typeof Xe.payload.certPath=="string"?Xe.payload.certPath:"",keyPath:typeof Xe.payload.keyPath=="string"?Xe.payload.keyPath:"",hint:typeof Xe.payload.hint=="string"?Xe.payload.hint:"The SSL certificate files do not exist at the configured paths."}),U(null),I(null),w(null),X(h.wildcard?"dns":"http"),me("ssl")):Xe.status===0?(w({message:"The dashboard did not answer.",detail:Xe.message,hint:"Saving may still have worked: check the domain list before trying again."}),d.error("The dashboard did not answer","The change may already have been saved.")):(w({message:Xe.message??"The domain could not be saved.",detail:typeof Xe.payload.detail=="string"?Xe.payload.detail:typeof Xe.payload.output=="string"?Xe.payload.output:void 0,hint:typeof Xe.payload.hint=="string"?Xe.payload.hint:void 0}),d.error("Could not save the domain",Xe.message??void 0));return}finally{S(!1)}E(null),I(null),U(null),d.success(c?"Domain saved":"Domain created",c?`${Dt?.name??Ue} was updated and its nginx config regenerated.`:`${Dt?.name??Ue} is configured; nginx will start serving it on the next reload.`),r()},Fe=async()=>{if(Pe(ie({ssl:{...h.ssl,enabled:!0}}))){B("issue"),U(null);try{const J=await fe.ssl.create({domain:F,www:h.www,validationMethod:h.wildcard?"dns":M});if(RT(J)){I(J);return}const be={...h.ssl,enabled:!0,certPath:J.certPath,keyPath:J.keyPath};g(Ue=>({...Ue,ssl:be})),E(null),I(null),await Ge({ssl:be})}catch(J){U(lv(J))}finally{B(null)}}},ce=async()=>{if(W){B("confirm"),U(null);try{const J=await fe.ssl.confirmDns(W.domain),be={...h.ssl,enabled:!0,certPath:J.certPath,keyPath:J.keyPath};g(Ue=>({...Ue,ssl:be})),I(null),E(null),await Ge({ssl:be})}catch(J){U(lv(J)),I(null)}finally{B(null)}}},De=async()=>{if(W){B("confirm");try{await fe.ssl.cancelDns(W.domain),d.info("DNS challenge cancelled","No certificate was requested.")}catch{d.warning("Could not cancel the DNS challenge")}finally{I(null),B(null)}}},we=()=>{const J={...h.ssl,enabled:!1};g(be=>({...be,ssl:J})),E(null),U(null),I(null),Ge({ssl:J})},nt=()=>{E(null),U(null),I(null)},rt=R||te!==null,xt=async()=>b?f({title:"Discard changes?",body:"The changes to this domain have not been saved.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}):!0,bt=()=>{W&&fe.ssl.cancelDns(W.domain).catch(()=>{})},zn=async()=>{rt||await xt()&&(bt(),i())},jn=p.useRef(zn);jn.current=zn;const na=p.useCallback(()=>{jn.current()},[]);return a.jsxs(yn,{open:!0,onClose:na,title:c?`Edit ${c.name}`:"New domain",description:"Changes are written to nginx, tested, and rolled back automatically if nginx rejects them.",size:"xl",preventClose:rt,bodyClassName:"px-0 py-0",footer:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mr-auto hidden text-2xs text-faint sm:block",children:c?"The domain name cannot change after creation.":"The domain is enabled as soon as it is created."}),a.jsx(ae,{variant:"ghost",onClick:na,disabled:rt,children:"Cancel"}),a.jsx(ae,{variant:"primary",type:"submit",form:m,loading:R,disabled:te!==null,children:c?"Save changes":"Create domain"})]}),children:[(T||O)&&a.jsxs("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[T&&!O&&a.jsxs(ve,{tone:"danger",title:T.message,children:[T.hint&&a.jsx("div",{children:T.hint}),T.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:T.detail})]}),O&&a.jsxs(a.Fragment,{children:[a.jsx(ve,{tone:"warning",title:"SSL certificate not found",action:a.jsx(ae,{variant:"ghost",size:"sm",onClick:nt,disabled:rt,children:"Keep editing"}),children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"break-all font-mono text-2xs",children:O.certPath||O.keyPath}),a.jsx("div",{children:O.hint}),a.jsx("div",{children:"Issue a certificate now, disable SSL for this domain, or point the paths at files that already exist."})]})}),a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(iv,{wildcard:h.wildcard,certMethod:M,onMethodChange:X,certFailure:A,dnsPending:W,certAction:te,onCreate:Fe,onConfirmDns:ce,onCancelDns:De,extraActions:a.jsx(ae,{variant:"dangerGhost",size:"sm",onClick:we,disabled:te!==null,children:"Disable SSL and save"})})})]})]}),a.jsxs("form",{id:m,onSubmit:J=>{J.preventDefault(),rt||Ge()},children:[a.jsx(ui,{id:"basic",title:"Basic configuration",description:"What nginx serves and where traffic goes.",icon:Os,open:x.basic??!1,onToggle:()=>j(J=>({...J,basic:!J.basic})),children:a.jsxs(Ja,{children:[a.jsx(Me,{id:"domain-name",className:"sm:col-span-2",label:"Domain name",placeholder:"api.example.com",value:h.name,disabled:!!c,onChange:J=>C("name",J.target.value),error:k["domain-name"],hint:h.wildcard?"Enter the bare domain — the *. prefix is added automatically.":c?"The domain name cannot be changed after creation.":void 0,autoComplete:"off",spellCheck:!1}),a.jsx(Me,{id:"backend-host",className:"sm:col-span-2",label:"Backend host or URL",placeholder:"127.0.0.1 or https://app.vercel.app",value:h.backendHost,onChange:J=>C("backendHost",J.target.value),error:k["backend-host"],hint:"A host and port, or a full http(s) URL to proxy to.",autoComplete:"off",spellCheck:!1}),a.jsx(Me,{id:"backend-port",label:"Backend port",type:"number",inputMode:"numeric",min:1,max:65535,value:di(h.port),disabled:Q,onChange:J=>C("port",Number(J.target.value)),error:k["backend-port"],hint:Q?"Taken from the URL.":void 0}),a.jsx(pa,{label:"Upstream type",value:h.upstreamType,onChange:J=>C("upstreamType",J.target.value),children:Object.keys(sv).map(J=>a.jsx("option",{value:J,children:sv[J]},J))}),a.jsxs("div",{className:"sm:col-span-2 space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.wildcard,onChange:J=>g(be=>({...be,wildcard:J,www:J?!1:be.www})),label:"Wildcard domain",description:"Serve *.example.com. Requires a DNS-01 certificate."}),!h.wildcard&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.www,onChange:J=>C("www",J),label:"Include www subdomain",description:"Adds www.example.com to server_name."})})]})]})}),a.jsx(ui,{id:"ssl",title:"SSL",description:"Serve this domain over HTTPS.",icon:Rn,open:x.ssl??!1,onToggle:()=>j(J=>({...J,ssl:!J.ssl})),children:a.jsxs("div",{className:"space-y-4",children:[Ne&&ke&&a.jsx(AT,{domainName:F,match:ke.match,certificate:ke.certificate,onAccept:()=>Y(ke.certificate)}),h.ssl.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(Me,{label:"Certificate path",value:h.ssl.certPath,onChange:J=>q("certPath",J.target.value),placeholder:"fullchain.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"}),a.jsx(Me,{label:"Private key path",value:h.ssl.keyPath,onChange:J=>q("keyPath",J.target.value),placeholder:"privkey.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"})]}),Ee&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No certificate paths set"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Create a certificate for ",F||"this domain"," now. On success, the certificate and key paths are filled in automatically."]})]}),a.jsx(iv,{wildcard:h.wildcard,certMethod:M,onMethodChange:X,certFailure:A,dnsPending:W,certAction:te,onCreate:Fe,onConfirmDns:ce,onCancelDns:De,disabledReason:F?L??null:"Enter the domain name above to create a certificate."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.ssl.redirect,onChange:J=>q("redirect",J),label:"Redirect HTTP to HTTPS",description:"Port 80 requests are sent to the HTTPS address."}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.ssl.hsts,onChange:J=>q("hsts",J),label:"Enable HSTS",description:"Tells browsers to use HTTPS for this domain only."})}),h.ssl.hsts&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Me,{id:"hsts-max-age",label:"HSTS max-age",type:"number",inputMode:"numeric",min:1,value:di(h.ssl.hstsMaxAge),onChange:J=>q("hstsMaxAge",Number(J.target.value)),error:k["hsts-max-age"],hint:"Seconds. 31536000 is one year.",className:"max-w-56"})})]})]}):a.jsx(Zt,{checked:h.ssl.enabled,onChange:J=>q("enabled",J),label:"Enable SSL / HTTPS",description:"Adds a 443 server block with the certificate below."}),h.ssl.enabled&&a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(as,{className:"mt-0.5 size-3.5 shrink-0 text-warn","aria-hidden":"true"}),a.jsx("span",{children:"The certificate files must exist before this domain can be saved. If they are missing, you will be offered to issue one."})]})]})}),a.jsx(ui,{id:"performance",title:"Performance",description:"Request limits, timeouts and compression.",icon:CS,open:x.performance??!1,onToggle:()=>j(J=>({...J,performance:!J.performance})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(Me,{id:"max-body",label:"Max body size",value:h.performance.maxBodySize,onChange:J=>re("maxBodySize",J.target.value),error:k["max-body"],placeholder:"10m",hint:"For uploads: 10m, 512k or 1g.",autoComplete:"off"}),a.jsx(Me,{id:"read-timeout",label:"Read timeout",type:"number",inputMode:"numeric",min:1,value:di(h.performance.readTimeout),onChange:J=>re("readTimeout",Number(J.target.value)),error:k["read-timeout"],hint:"Seconds."}),a.jsx(Me,{id:"connect-timeout",label:"Connect timeout",type:"number",inputMode:"numeric",min:1,value:di(h.performance.connectTimeout),onChange:J=>re("connectTimeout",Number(J.target.value)),error:k["connect-timeout"],hint:"Seconds."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.performance.proxyBuffers,onChange:J=>re("proxyBuffers",J),label:"Proxy buffering",description:"Buffer upstream responses on disk for slow clients."}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.performance.gzip,onChange:J=>re("gzip",J),label:"Gzip compression",description:"Compress text responses before sending them."})}),h.performance.gzip&&a.jsxs("div",{className:"border-t border-line pt-3",children:[a.jsx(Lc,{label:"Gzip MIME types",value:h.performance.gzipTypes,onChange:J=>re("gzipTypes",J.target.value),rows:3,spellCheck:!1,className:"font-mono"}),a.jsx(ml,{children:"Space-separated list of content types."})]})]})]})}),a.jsx(ui,{id:"security",title:"Security",description:"Rate limiting and response headers.",icon:Gh,open:x.security??!1,onToggle:()=>j(J=>({...J,security:!J.security})),children:a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(Zt,{checked:h.security.rateLimit,onChange:J=>ye("rateLimit",J),label:"Rate limiting",description:"Limit requests per IP address."}),h.security.rateLimit&&a.jsxs("div",{className:"grid gap-4 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(Me,{id:"rate-limit-rate",label:"Requests per second",type:"number",inputMode:"numeric",min:1,value:di(h.security.rateLimitRate),onChange:J=>ye("rateLimitRate",Number(J.target.value)),error:k["rate-limit-rate"]}),a.jsx(Me,{id:"rate-limit-burst",label:"Burst",type:"number",inputMode:"numeric",min:1,value:di(h.security.rateLimitBurst),onChange:J=>ye("rateLimitBurst",Number(J.target.value)),error:k["rate-limit-burst"],hint:"Requests allowed to exceed the rate briefly."})]}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Zt,{checked:h.security.securityHeaders,onChange:J=>ye("securityHeaders",J),label:"Security headers",description:"Adds X-Frame-Options and X-Content-Type-Options."})}),a.jsxs("div",{className:"grid gap-3 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(Zt,{checked:h.security.custom404,onChange:J=>ye("custom404",J),label:"Custom 404 form",description:"Return the dashboard's 404 page."}),a.jsx(Zt,{checked:h.security.custom50x,onChange:J=>ye("custom50x",J),label:"Custom 50x page",description:"Return the dashboard's error page when the backend fails."})]})]})}),a.jsx(ui,{id:"advanced",title:"Advanced",description:"Raw nginx additions for this domain.",icon:cS,open:x.advanced??!1,onToggle:()=>j(J=>({...J,advanced:!J.advanced})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Zt,{checked:h.advanced.accessLog,onChange:J=>Re("accessLog",J),label:"Domain-specific access log",description:"Writes this domain's requests to its own log file."}),a.jsx(Lc,{label:"Custom location blocks",value:h.advanced.customLocations,onChange:J=>Re("customLocations",J.target.value),rows:6,spellCheck:!1,placeholder:`location /api/v2 {
|
|
512
|
-
proxy_pass http://localhost:8080;
|
|
513
|
-
}`,className:"font-mono"}),a.jsx(ml,{children:"Appended verbatim inside the server block. nginx tests the result before it is kept."})]})}),c&&a.jsx(ui,{id:"notifications",title:"Notifications",description:"Which channels hear about this domain.",icon:qh,open:x.notifications??!1,onToggle:()=>j(J=>({...J,notifications:!J.notifications})),children:V.loading&&!V.data?a.jsxs("div",{className:"space-y-2",children:[a.jsx(tt,{className:"h-14 rounded-md"}),a.jsx(tt,{className:"h-14 rounded-md"}),a.jsx(tt,{className:"h-14 rounded-md"})]}):V.error&&!V.data?a.jsx(ve,{tone:"warning",title:"Could not load notification channels",action:a.jsx(ae,{variant:"ghost",size:"sm",onClick:V.reload,children:"Retry"}),children:V.error.message}):(V.data??[]).length===0?a.jsx(wh,{channels:[],value:[],onChange:()=>{},label:"Channels",emptyHref:"/notifications",disabled:rt}):a.jsx(kT,{label:"Events",disabled:rt,items:Sh.map(J=>({...J,enabled:h.notifications[J.id].enabled})),onChange:(J,be)=>xe(J,{enabled:be}),onToggleAll:J=>{for(const be of Sh)xe(be.id,{enabled:J})},children:J=>{const be=h.notifications[J.id];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-3 border-t border-line pt-3",children:a.jsx(wh,{channels:V.data??[],value:be.channelIds,onChange:Ue=>xe(J.id,{channelIds:Ue}),label:`${J.label} channels`,emptyHref:"/notifications",compact:!0,disabled:rt})}),be.channelIds.length===0&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No channels selected — the event is recorded but not delivered."})]})}})})]})]})}function MT(n){return/^https?:\/\//i.test(n.backendHost||"")?n.backendHost:`${n.upstreamType||"http"}://${n.backendHost||"127.0.0.1"}:${n.port}`}function _T({domain:n}){if(!n.ssl?.enabled)return a.jsx(je,{tone:"neutral",children:"HTTP only"});const i=n.daysLeft;return i==null?a.jsx(je,{tone:"neutral",children:"SSL"}):i<0?a.jsx(je,{tone:"bad",children:"SSL expired"}):i<30?a.jsx(je,{tone:"warn",children:gi(i)}):a.jsx(je,{tone:"ok",children:gi(i)})}function LT({entry:n}){return n?n.up===null?a.jsx(je,{tone:"neutral",dot:!0,children:"External"}):n.up?a.jsx(je,{tone:"ok",dot:!0,children:"Up"}):a.jsx(je,{tone:"bad",dot:!0,children:"Down"}):null}function UT(){ba("Domains");const n=Et(),i=rn(),{domainHealth:r}=vn(),c=Ct(L=>fe.domains.list(L)),[d,f]=Jc(),[m,h]=p.useState(""),[g,v]=p.useState("all"),[b,x]=p.useState(null),[j,k]=p.useState(null),[z,T]=p.useState(!1),[w,R]=p.useState(!1);yl(c.reload),bi("domains",c.reload);const S=c.data,O=p.useMemo(()=>new Map((r??[]).map(L=>[L.name,L])),[r]),E=d.get("new")==="1",M=d.get("domain"),X=M?(S??[]).find(L=>L.name===M):void 0,A=E?{mode:"create"}:X?{mode:"edit",domain:X}:null,U=p.useRef(null);p.useEffect(()=>{if(!S||!M){U.current=null;return}if(X){U.current=null;return}U.current!==M&&(U.current=M,n.error("Domain not found",M),f({},{replace:!0}))},[S,M,X,f,n]);const W=()=>f({new:"1"}),I=L=>f({domain:L}),te=()=>f({},{replace:!0}),B=p.useMemo(()=>{const L=S??[];return{all:L.length,enabled:L.filter(ee=>ee.enabled).length,disabled:L.filter(ee=>!ee.enabled).length}},[S]),V=p.useMemo(()=>{const L=m.trim().toLowerCase();return(S??[]).filter(ee=>g==="enabled"&&!ee.enabled||g==="disabled"&&ee.enabled?!1:L?[ee.name,ee.backendHost,String(ee.port)].join(" ").toLowerCase().includes(L):!0)},[S,g,m]),de=async L=>{const ee=!L.enabled;if(await i({title:`${ee?"Enable":"Disable"} "${L.name}"?`,body:ee?"nginx resumes serving this domain with its saved configuration.":"nginx stops serving this domain until you enable it again. The config file is kept.",confirmLabel:ee?"Enable":"Disable",tone:ee?"accent":"danger"})){x({name:L.name,action:"toggle"});try{const ke=await fe.domains.toggle(L.name);c.setData(Ne=>Ne&&Ne.map(Ee=>Ee.name===L.name?{...Ee,enabled:ke.enabled}:Ee)),n.success(ke.enabled?"Domain enabled":"Domain disabled",ke.enabled?`${L.name} is being served again.`:`${L.name} is no longer served by nginx.`)}catch(ke){n.error(`Could not ${ee?"enable":"disable"} the domain`,ke instanceof He?ke.message:void 0)}finally{x(null)}}},le=async L=>{x({name:L.name,action:"reload"});try{const ee=await fe.domains.reload(L.name);n.success("nginx reloaded",ee.message||`${L.name} is live with its current configuration.`)}catch(ee){n.error("Could not reload nginx",ee instanceof He?ee.message:void 0)}finally{x(null)}},Q=L=>{T(!1),k(L)},F=async()=>{if(j){R(!0);try{const L=await fe.domains.remove(j.name,j.ssl.enabled&&z);n.success("Domain deleted",L.certDeleted?`${j.name}, its nginx config and its certificate files were removed.`:`${j.name} and its nginx config were removed. The certificate files were kept.`),k(null),c.reload()}catch(L){n.error("Could not delete the domain",L instanceof He?L.message:void 0)}finally{R(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",meta:S?a.jsxs("span",{className:"text-2xs text-faint",children:[B.all," total · ",B.enabled," enabled"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:c.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:c.reload,children:"Refresh"}),a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,children:"Add domain"})]})}),c.error&&!S?a.jsx($t,{error:c.error,onRetry:c.reload}):S?S.length===0?a.jsx(et,{children:a.jsx(ga,{icon:a.jsx(Os,{className:"size-5","aria-hidden":"true"}),title:"No domains yet",description:"Add a domain and Easy DevOps writes its nginx config, tests it, and reloads nginx.",action:a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,children:"Add your first domain"})})}):a.jsxs("div",{className:"space-y-3",children:[c.error&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known list. ",c.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:c.reload,children:"Try again"})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-col gap-3 border-b border-line p-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"relative w-full sm:max-w-xs",children:[a.jsx(Lb,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-faint","aria-hidden":"true"}),a.jsx("input",{type:"search","aria-label":"Search domains",placeholder:"Search domain or backend…",value:m,onChange:L=>h(L.target.value),className:"h-9 w-full rounded-md border border-line bg-canvas pl-8 pr-3 text-sm text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25"})]}),a.jsx("div",{role:"group","aria-label":"Filter domains",className:"flex flex-wrap gap-1.5",children:[["all","All",B.all],["enabled","Enabled",B.enabled],["disabled","Disabled",B.disabled]].map(([L,ee,ue])=>a.jsxs("button",{type:"button","aria-pressed":g===L,onClick:()=>v(L),className:oe("inline-flex items-center gap-1.5 rounded-pill border px-2.5 py-1 text-xs transition-colors duration-[var(--ez-motion-fast)]",g===L?"border-accent/50 bg-accent-soft text-accent-text":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[ee,a.jsx("span",{className:oe("rounded-pill px-1 text-2xs",g===L?"bg-accent/15":"bg-inset text-faint"),children:ue})]},L))})]}),V.length===0?a.jsx(ga,{title:"No domains match",description:"Try a different search or show all domains.",action:a.jsx(ae,{variant:"secondary",size:"sm",onClick:()=>{h(""),v("all")},children:"Clear filters"})}):a.jsx("ul",{className:"divide-y divide-line",children:V.map(L=>{const ee=O.get(L.name),ue=ee?.up===!1,ke=b?.name===L.name,Ne=ke?b?.action:null;return a.jsxs("li",{className:oe("group flex flex-col gap-2.5 px-4 py-3 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 sm:flex-row sm:items-center sm:gap-4",!L.enabled&&"opacity-60"),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(ln,{tone:L.enabled?ue?"bad":"ok":"neutral",pulse:L.enabled&&!ue,className:"mt-1.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("button",{type:"button",onClick:()=>I(L.name),className:"max-w-full truncate text-left font-mono text-sm font-semibold text-ink transition-colors hover:text-accent-text",children:L.name}),L.wildcard&&a.jsx(je,{tone:"accent",children:"wildcard"}),L.www&&a.jsx(je,{tone:"neutral",children:"www"}),!L.enabled&&a.jsx(je,{tone:"neutral",children:"disabled"}),L.sslPathWarning&&a.jsx("span",{className:"inline-flex",title:"Certificate paths contain backslashes, which nginx on Windows can fail to load. Open and save this domain to regenerate them with forward slashes.",children:a.jsxs(je,{tone:"warn",children:[a.jsx(as,{className:"size-3","aria-hidden":"true"}),"Backslash cert paths"]})})]}),a.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:[a.jsx("span",{className:"max-w-full truncate font-mono",children:MT(L)}),L.ssl.enabled&&L.ssl.redirect&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{children:"HTTP redirects to HTTPS"})]})]})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-7 sm:w-52 sm:shrink-0 sm:pl-0",children:[a.jsx(_T,{domain:L}),a.jsx(LT,{entry:ee})]}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1 pl-7 sm:pl-0",children:[a.jsx(ct,{label:L.enabled?`Disable ${L.name}`:`Enable ${L.name}`,size:"sm",disabled:ke,onClick:()=>de(L),className:"text-muted hover:text-ink",children:Ne==="toggle"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):L.enabled?a.jsx(ok,{className:"size-3.5","aria-hidden":"true"}):a.jsx(uk,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Reload nginx for ${L.name}`,size:"sm",disabled:ke,onClick:()=>le(L),className:"text-muted hover:text-ink",children:Ne==="reload"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Edit ${L.name}`,size:"sm",onClick:()=>I(L.name),className:"text-muted hover:text-accent-text",children:a.jsx(Yh,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`Delete ${L.name}`,size:"sm",onClick:()=>Q(L),className:"text-muted hover:text-bad",children:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"})})]})]},L.name)})})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-14 rounded-lg"}),a.jsx(tt,{className:"h-[320px] rounded-lg"})]}),A&&a.jsx(OT,{editor:A,onClose:te,onSaved:()=>{te(),c.reload()}},A.mode==="edit"?`edit:${A.domain.name}`:"create"),a.jsx(yn,{open:j!==null,onClose:()=>{w||k(null)},title:j?`Delete "${j.name}"?`:"Delete domain",description:"This also removes the domain's nginx config. It cannot be undone.",size:"sm",preventClose:w,footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:()=>k(null),disabled:w,children:"Cancel"}),a.jsx(ae,{variant:"danger",loading:w,onClick:F,children:"Delete domain"})]}),children:j&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm text-muted",children:["nginx stops serving ",a.jsx("span",{className:"font-mono text-ink",children:j.name})," ","as soon as the config is removed."]}),j.ssl.enabled&&a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(pl,{checked:z,onChange:T,label:"Also delete the SSL certificate files",hint:`Otherwise ${j.name}'s certificate stays on disk and can be reused.`})})]})})]})}const Wa=Object.freeze([{id:"preflight",label:"Preflight checks"},{id:"account and order",label:"Account and order"},{id:"challenge ready",label:"Challenge ready"},{id:"waiting for validation",label:"Waiting for validation"},{id:"certificate received",label:"Certificate received"},{id:"files written",label:"Files written"},{id:"nginx config test",label:"nginx config test"},{id:"nginx reload",label:"nginx reload"},{id:"https verified",label:"HTTPS verified"}]),l0=Object.freeze([{id:"domain",label:"Domain linked"},...Wa.slice(0,6),{id:"https",label:"SSL settings"},...Wa.slice(6)]),i0=Object.freeze([{id:"domain",label:"Domain linked"},{id:"https",label:"SSL settings"},{id:"nginx config test",label:"nginx config test"},{id:"nginx reload",label:"nginx reload"},{id:"https verified",label:"HTTPS verified"}]),HT=i0;function rv(n){return l0.find(i=>i.id===n)?.label??Wa.find(i=>i.id===n)?.label??n}function ov(n){let i="";for(const r of n)i+=String.fromCharCode(r);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Fh(){const n=globalThis.crypto;if(n?.randomUUID){const r=n.randomUUID().replace(/-/g,""),c=new Uint8Array(16);for(let d=0;d<16;d+=1)c[d]=Number.parseInt(r.slice(d*2,d*2+2),16);return ov(c)}const i=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(i);else for(let r=0;r<i.length;r+=1)i[r]=Math.floor(Math.random()*256);return ov(i)}function BT(n,i,r=Date.now()){const c=n[i.stage];if(c?.status==="failed"&&i.status==="running")return n;const d={status:i.status,detail:i.detail??c?.detail,elapsedMs:i.elapsedMs,elapsedAt:r};return{...n,[i.stage]:d}}const $T=new Set([...Wa.map(n=>n.id),"domain","https"]);function jr(n){return typeof n=="string"&&($T.has(n)||n==="timeout")}function mn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Ds(...n){for(const i of n){const r=mn(i);if(r)return r}return null}function cv(n){if(!n||typeof n!="object")return null;const i=n,r=i.error;if(r&&typeof r=="object"){const c=r;return{stage:jr(mn(c.stage))?mn(c.stage):jr(mn(c.step))?mn(c.step):null,message:Ds(c.cause,c.consequence,i.detail,i.hint)??"No certificate was issued.",fix:Ds(c.fix,i.hint),consequence:mn(c.consequence)}}return typeof r=="string"?{stage:null,message:Ds(i.detail,r)??r,fix:Ds(i.hint),consequence:null}:typeof i.step=="string"||typeof i.cause=="string"||typeof i.stage=="string"?{stage:jr(mn(i.stage))?mn(i.stage):jr(mn(i.step))?mn(i.step):null,message:Ds(i.cause,i.consequence,i.detail)??"No certificate was issued.",fix:Ds(i.fix,i.hint),consequence:mn(i.consequence)}:null}function Uc(n){if(n==null)return null;if(n instanceof He){const i=n.payload,r=cv(i);return r||{stage:null,message:Ds(i.detail,i.hint,n.message)??n.message,fix:Ds(i.hint),consequence:null}}return typeof n=="string"?{stage:null,message:n,fix:null,consequence:null}:cv(n)}function cl(n){let i=null;if(n instanceof He?i=n.payload.preflight:Array.isArray(n)?i=n:n&&typeof n=="object"&&(i=n.preflight??n),!i)return null;const r=!Array.isArray(i)&&i&&typeof i=="object"?i:{},c=Array.isArray(i)?i:Array.isArray(r.results)?r.results:null;if(!c)return null;const d=[];for(const m of c){if(!m||typeof m!="object")continue;const h=m,g=mn(h.id),v=h.status;g&&(v!=="ok"&&v!=="warn"&&v!=="fail"&&v!=="skipped"||d.push({id:g,status:v,message:mn(h.message)??g,fix:mn(h.fix)??void 0}))}if(d.length===0)return null;const f=d.some(m=>m.status==="fail");return{ok:typeof r.ok=="boolean"?r.ok:!f,detail:mn(r.detail)??void 0,results:d,proxied:r.proxied===!0,reachesUs:r.reachesUs===!0}}function qT(n){const i=n.split(":")[0];return i==="dns"?"DNS record":i==="a"?"IPv4 (A record)":i==="aaaa"?"IPv6 (AAAA record)":i==="http"?"HTTP self-check":"Check"}function GT(n){const i=n.split(":");return i.length<2?null:i[1]||null}function YT(n){const i=Math.max(0,Math.floor(n/1e3)),r=Math.floor(i/60),c=i%60;return r>0?`${r}m ${String(c).padStart(2,"0")}s`:`${c}s`}function VT(n,i){const r={},c=d=>({status:"skipped",detail:d});for(const d of i)d.id==="domain"?r[d.id]={status:"ok",detail:"nginx serves this name"}:d.id==="https"?n.ssl?n.ssl.ok?r[d.id]={status:"ok",detail:n.ssl.detail}:r[d.id]={status:"failed",detail:n.ssl.detail}:r[d.id]=c("No certificate was requested"):d.id==="nginx config test"?r[d.id]=n.nginxReloaded?{status:"ok",detail:"nginx accepted the config"}:c("nginx was not reloaded"):d.id==="nginx reload"?r[d.id]=n.nginxReloaded?{status:"ok",detail:"nginx reloaded"}:{status:"failed",detail:"nginx was not reloaded"}:d.id==="https verified"?r[d.id]=c(n.ssl?.ok?"The certificate was checked by the server":"No new certificate to verify"):r[d.id]=c("Not reported for a link that runs in one request");return r}function Jh(n){const{client:i}=vn(),[r,c]=p.useState({}),[d,f]=p.useState(!1),[m,h]=p.useState(null);p.useEffect(()=>{if(!i||!n)return;const v=b=>{!b||b.opId!==n||typeof b.stage!="string"||!jr(b.stage)||b.stage==="timeout"||(f(!0),h(typeof b.elapsedMs=="number"?b.elapsedMs:null),c(x=>{const j=typeof b.domain=="string"?b.domain:"",k=x[j]??{};return{...x,[j]:BT(k,b)}}))};return i.on("ssl:progress",v),()=>i.off("ssl:progress",v)},[i,n]);const g=p.useCallback(v=>{c(b=>{if(v===void 0)return{};const x={...b};return delete x[v],x}),f(!1),h(null)},[]);return{byDomain:r,heard:d,lastElapsedMs:m,clear:g}}function XT(n,i){if(n instanceof He){const r=n.payload.error;if(r&&typeof r=="object")return{title:i,step:r.step,stage:r.stage,cause:r.cause,consequence:r.consequence,fix:r.fix??(typeof n.payload.hint=="string"?n.payload.hint:void 0),nginxRunning:r.nginxRunning};const c=n.code==="email_required"?"Set the ACME email in Settings → General, or provide an email with this request.":typeof n.payload.hint=="string"?n.payload.hint:void 0,d=typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.output=="string"?n.payload.output:n.message;return{title:i,summary:c,detail:d}}if(n&&typeof n=="object"){const r=n;return{title:r.step==="email configuration"?"ACME email is not configured":i,step:r.step,stage:r.stage,cause:r.cause,consequence:r.consequence,fix:r.fix,nginxRunning:r.nginxRunning}}return typeof n=="string"&&n?{title:i,detail:n}:{title:i,summary:"No certificate was issued."}}function r0(n){return n==null?"unknown":n<1e3?`${Math.round(n)} ms`:n<6e4?`${(n/1e3).toFixed(1)} s`:`${Math.round(n/6e4)} min`}function KT(n){return n?n==="proxy"?"The HTTP-01 challenge was answered through nginx, so nginx stayed running.":n==="standalone"?"The challenge ran in standalone mode.":n==="dns"?"Validated with a DNS TXT record.":`Validation mode: ${n}.`:null}function Rc({value:n,title:i="Certificate issuance failed"}){const r=XT(n,i),c=!!(r.step||r.cause||r.consequence);return a.jsxs(ve,{tone:"danger",title:r.title,children:[r.summary&&a.jsx("p",{children:r.summary}),c&&a.jsxs("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-2xs",children:[r.step&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Step"}),a.jsx("dd",{className:"text-muted",children:r.stage??r.step})]}),r.cause&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Cause"}),a.jsx("dd",{className:"text-muted",children:r.cause})]}),r.consequence&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Note"}),a.jsx("dd",{className:"text-muted",children:r.consequence})]})]}),r.nginxRunning===!1&&a.jsx("p",{className:"mt-2 text-2xs",children:"nginx is not running right now."}),r.fix&&a.jsxs("p",{className:"mt-2 break-words rounded border border-warn/25 bg-warn-soft px-2 py-1 text-2xs text-warn",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",r.fix]}),r.detail&&a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:r.detail})]})}function o0({result:n,title:i="Certificate issued"}){const r=KT(n.mode);return a.jsxs("div",{className:"rounded-md border border-ok/30 bg-ok-soft/40 px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-ink",children:[a.jsx(ts,{className:"size-4 shrink-0 text-ok","aria-hidden":"true"}),i]}),n.summary&&a.jsx("p",{className:"mt-1 text-xs text-muted",children:n.summary}),n.fellBack&&a.jsxs(ve,{tone:"warning",className:"mt-2.5",children:["The HTTP challenge could not be answered through nginx, so the standalone challenge was used. nginx was stopped for ",r0(n.nginxDownMs),"."]}),n.staging&&a.jsx(ve,{tone:"warning",className:"mt-2.5",children:"This is a staging certificate. Browsers will not trust it; issue again against production before relying on it."}),a.jsxs("dl",{className:"mt-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Certificate"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-2xs text-muted",children:n.certPath}),a.jsx(qt,{value:n.certPath,label:"Copy certificate path"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Private key"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-2xs text-muted",children:n.keyPath}),a.jsx(qt,{value:n.keyPath,label:"Copy private key path"})]})]}),r&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:r})]})}const ZT={ok:"OK",warn:"Warning",fail:"Failed",skipped:"Skipped"};function QT({status:n}){return n==="ok"?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):n==="warn"?a.jsx(fl,{className:"size-4 text-warn","aria-hidden":"true"}):n==="fail"?a.jsx(Tr,{className:"size-4 text-bad","aria-hidden":"true"}):n==="skipped"?a.jsx(lS,{className:"size-4 text-faint","aria-hidden":"true"}):a.jsx(zb,{className:"size-4 text-faint","aria-hidden":"true"})}function Rr({preflight:n,className:i}){if(!n||n.results.length===0)return null;const r=n.results.filter(m=>m.status==="fail").length,c=n.results.filter(m=>m.status==="warn").length,d=r>0?"bad":c>0?"warn":"ok",f=r>0?`${r} ${r===1?"check":"checks"} failed`:c>0?`${c} ${c===1?"warning":"warnings"}`:"All checks passed";return a.jsxs("section",{"aria-label":"Preflight checks",className:oe("rounded-md border border-line bg-raised/30 p-3",i),children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("h3",{className:"text-xs font-medium text-ink",children:"Preflight checks"}),a.jsx(je,{tone:d,children:f})]}),n.detail&&a.jsx("p",{className:"mt-1.5 break-words text-2xs text-muted",children:n.detail}),a.jsx("ul",{className:"mt-2 space-y-2",children:n.results.map((m,h)=>{const g=qT(m.id),v=GT(m.id),b=m.status==="fail"||m.status==="warn";return a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("div",{className:"mt-0.5 shrink-0",children:a.jsx(QT,{status:m.status})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"text-2xs font-medium text-ink",children:g}),v&&a.jsx("span",{className:"break-all font-mono text-2xs text-faint",children:v}),a.jsx("span",{className:oe("text-2xs uppercase tracking-wide",m.status==="fail"?"text-bad":m.status==="warn"?"text-warn":m.status==="ok"?"text-ok":"text-faint"),children:ZT[m.status]})]}),a.jsx("p",{className:"mt-0.5 break-words text-2xs text-muted",children:m.message}),b&&m.fix&&a.jsxs("p",{className:"mt-1 break-words rounded border border-warn/25 bg-warn-soft px-2 py-1 text-2xs text-warn",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",m.fix]})]})]},`${m.id}-${h}`)})})]})}const uv={running:"Running",ok:"Done",failed:"Failed",skipped:"Skipped",pending:"Waiting"};function PT({status:n}){return n==="running"?a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}):n==="ok"?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):n==="failed"?a.jsx(Tr,{className:"size-4 text-bad","aria-hidden":"true"}):n==="skipped"?a.jsx(zb,{className:"size-4 text-faint","aria-hidden":"true"}):a.jsx(Db,{className:"size-4 text-faint/60","aria-hidden":"true"})}function ul({stages:n,states:i,ariaLabel:r="Certificate operation stages",failure:c=null,timedOut:d=!1,className:f}){const m=n.some(z=>i[z.id]?.status==="running"),[h,g]=p.useState(()=>Date.now());p.useEffect(()=>{if(!m)return;const z=setInterval(()=>g(Date.now()),1e3);return()=>clearInterval(z)},[m]);const v=p.useMemo(()=>n.map(z=>{const T=i[z.id];return T?`${z.label}: ${uv[T.status]??T.status}`:null}).filter(Boolean).join(". "),[n,i]),b=c?.stage&&c.stage!=="timeout"?c.stage:n.find(z=>i[z.id]?.status==="failed")?.id??null,x=d||c?.stage==="timeout",j=c?.message??null,k=c?.fix??null;return a.jsxs("div",{className:oe("min-w-0",f),children:[a.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:v}),a.jsx("ol",{"aria-label":r,className:"space-y-1",children:n.map((z,T)=>{const w=i[z.id],R=w?.status??"pending",S=!w,O=R==="running",E=R==="failed"||b===z.id,M=w?.detail,X=O&&w?.elapsedMs!=null?w.elapsedMs+(w.elapsedAt!=null?Math.max(0,h-w.elapsedAt):0):null;return a.jsxs("li",{"aria-busy":O||void 0,className:oe("flex items-start gap-2.5 rounded-md px-2.5 py-2 transition-colors duration-[var(--ez-motion-fast)]",E?"bg-bad-soft/50 ring-1 ring-bad/30":O?"bg-accent-soft/40":"bg-transparent"),children:[a.jsx("div",{className:"mt-0.5 shrink-0",children:a.jsx(PT,{status:E&&R!=="failed"?"failed":R})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"text-2xs font-mono text-faint","aria-hidden":"true",children:String(T+1).padStart(2,"0")}),a.jsx("span",{className:oe("text-xs font-medium",E?"text-bad":S?"text-muted":"text-ink"),children:z.label}),O&&X!==null&&a.jsx("span",{className:"font-mono text-2xs font-medium text-accent-text","aria-hidden":"true",children:YT(X)}),a.jsx("span",{className:oe("text-2xs uppercase tracking-wide",E?"text-bad":R==="ok"?"text-ok":R==="running"?"text-accent-text":"text-faint"),children:E&&R!=="failed"?"Failed":uv[R]})]}),M&&a.jsx("p",{className:"mt-0.5 break-words text-2xs text-muted",children:M}),R==="skipped"&&!M&&a.jsx("p",{className:"mt-0.5 text-2xs text-faint",children:"Skipped."})]})]},z.id)})}),x?a.jsxs(ve,{tone:"warning",title:"The five-minute limit was reached",className:"mt-3",children:[a.jsx("p",{className:"break-words",children:j??"The certificate operation ran past its five-minute limit and stopped."}),a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["It stopped at ",b?rv(b):"an unknown stage",". Nothing later in the list ran, and the certificate already on disk was not replaced. Check the preflight checks, then try again."]})]}):j?a.jsxs(ve,{tone:"danger",title:b?`Stopped at ${rv(b)}`:"The certificate operation failed",className:"mt-3",children:[a.jsx("p",{className:"break-words",children:j}),c?.consequence&&a.jsx("p",{className:"mt-1.5 break-words text-2xs text-faint",children:c.consequence})]}):null,k&&!x&&a.jsxs("div",{role:"note",className:"mt-2 flex items-start gap-2 rounded-md border border-warn/30 bg-warn-soft px-3 py-2 text-xs text-warn",children:[a.jsx(Fk,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("p",{className:"break-words",children:[a.jsx("span",{className:"font-medium",children:"Fix:"})," ",k]})]}),x&&a.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Uk,{className:"size-3.5 shrink-0","aria-hidden":"true"}),"The limit exists so a stuck ACME server cannot hold the dashboard open."]})]})}const dv="ssl-known-domains";function IT(n){return"status"in n&&n.status==="waiting_dns"}function FT({error:n}){const i=Array.isArray(n.payload.found)?n.payload.found.filter(c=>typeof c=="string"):[],r=typeof n.payload.hint=="string"?n.payload.hint:n.message;return a.jsxs(ve,{tone:"warning",title:"The TXT record was not found yet",children:[a.jsx("p",{children:r}),i.length>0&&a.jsxs("p",{className:"mt-1.5 break-all",children:["Records currently visible:"," ",a.jsx("span",{className:"font-mono text-ink",children:i.join(" · ")})]})]})}function JT({domains:n,initialDomain:i="",onClose:r,onIssued:c}){const d=Et(),f=rn(),m=Pc(),{connected:h}=vn(),[g]=p.useState(()=>Fh()),v=Jh(g),[b,x]=p.useState(i),[j,k]=p.useState(""),[z,T]=p.useState(!1),[w,R]=p.useState("http"),[S,O]=p.useState("form"),[E,M]=p.useState({}),[X,A]=p.useState(null),[U,W]=p.useState(!1),[I,te]=p.useState(null),[B,V]=p.useState(!1),[de,le]=p.useState(null),[Q,F]=p.useState(null),[L,ee]=p.useState(""),ue=b.trim().startsWith("*."),ke=L?v.byDomain[L]??{}:{},Ne=Uc(X),Ee=cl(X),C=Q?cl(Q.result):null,q=h&&v.heard&&L!=="",Y=q?ke:{};p.useEffect(()=>{ue&&(R("dns"),T(!1))},[ue]);const re=b.trim()!==i||j.trim()!==""||z||w!=="http",ye=async()=>{const we={},nt=Ih(b.trim());nt&&(we.domain=nt);const rt=t0(j.trim());if(rt&&(we.email=rt),we.domain||we.email){M(we),queueMicrotask(()=>document.getElementById(we.domain?"ssl-domain":"ssl-email")?.focus());return}M({}),A(null),le(null),W(!0);const xt=b.trim();ee(xt),v.clear();try{const bt=await fe.ssl.create({domain:xt,www:ue?!1:z,validationMethod:ue?"dns":w,email:j.trim()||void 0,opId:g});if(IT(bt)){te(bt),O("dns");return}F({result:bt,domain:xt}),O("success"),c(bt,xt)}catch(bt){A(bt)}finally{W(!1)}},Re=async()=>{if(I){le(null),V(!0);try{const we=await fe.ssl.confirmDns(I.domain),nt=I.domain;te(null),F({result:we,domain:nt}),O("success"),c(we,nt)}catch(we){we instanceof He&&(we.code==="dns_not_propagated"||we.code==="dns_lookup_failed")?le(we):(te(null),O("form"),A(we))}finally{V(!1)}}},xe=async()=>{if(I){V(!0);try{await fe.ssl.cancelDns(I.domain),d.info("DNS challenge cancelled","No certificate was issued.")}catch{d.warning("Could not cancel the DNS challenge","It will expire on its own after ten minutes.")}finally{te(null),le(null),ee(""),v.clear(),O("form"),V(!1)}}},me=()=>{x(""),k(""),T(!1),R("http"),M({}),A(null),le(null),F(null),ee(""),v.clear(),O("form")},ie=U||B,Pe=async()=>{if(!ie){if(S==="dns"&&I){if(!await f({title:"Cancel the pending DNS challenge?",body:`No certificate will be issued for ${I.domain}. The TXT record can be removed afterwards.`,confirmLabel:"Cancel challenge",cancelLabel:"Keep waiting",tone:"danger"}))return;fe.ssl.cancelDns(I.domain).catch(()=>{}),r();return}S==="form"&&re&&!await f({title:"Discard this certificate request?",body:"The form has not been submitted, so nothing has been issued.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"})||r()}},Ge=p.useRef(Pe);Ge.current=Pe;const Fe=p.useCallback(()=>{Ge.current()},[]),ce=X instanceof He&&X.code==="email_required",De=S==="success"?"Certificate issued":S==="dns"?"DNS validation":"New certificate";return a.jsxs(yn,{open:!0,onClose:Fe,title:De,description:S==="form"?"Let’s Encrypt issues 90-day certificates. nginx keeps running unless the HTTP challenge has to fall back to standalone mode.":void 0,size:"lg",preventClose:ie,footer:S==="form"?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:Fe,disabled:ie,children:"Cancel"}),a.jsx(ae,{variant:"primary",loading:U,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),onClick:ye,children:"Issue certificate"})]}):S==="dns"?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:xe,disabled:ie,children:"Cancel challenge"}),a.jsx(ae,{variant:"primary",loading:B,onClick:Re,children:"I’ve added the record"})]}):a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"ghost",onClick:me,children:"Issue another"}),a.jsx(ae,{variant:"primary",onClick:Fe,children:"Done"})]}),children:[S==="form"&&a.jsxs("div",{className:"space-y-4",children:[L&&(U||X!=null)&&a.jsxs("div",{className:"space-y-2.5",children:[q?a.jsx(ul,{stages:Wa,states:Y,ariaLabel:`Certificate stages for ${L}`,failure:X!=null?Ne:null,timedOut:Ne?.stage==="timeout"}):U?a.jsxs("p",{role:"status",className:"flex items-start gap-2 rounded-md border border-line bg-raised/40 px-3 py-2.5 text-xs text-muted",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("span",{className:"break-words",children:["Issuing the certificate for"," ",a.jsx("span",{className:"font-mono text-ink",children:L}),". The live stage list needs the dashboard’s connection; the result appears here when it finishes."]})]}):null,Ee&&a.jsx(Rr,{preflight:Ee})]}),X!=null&&a.jsxs("div",{className:"space-y-2",children:[!(q&&Ne)&&a.jsx(Rc,{value:X}),ce&&a.jsx(ae,{variant:"secondary",size:"sm",onClick:()=>{r(),m("/settings")},children:"Open settings"})]}),a.jsx(Me,{id:"ssl-domain",label:"Domain name",placeholder:"example.com",value:b,onChange:we=>x(we.target.value),error:E.domain,hint:"An A or AAAA record for this name must point at this server for an HTTP challenge.",list:dv,autoComplete:"off",spellCheck:!1,disabled:ie}),a.jsx("datalist",{id:dv,children:n.map(we=>a.jsx("option",{value:we.name},we.name))}),a.jsx(Me,{id:"ssl-email",label:"ACME email",optional:!0,type:"email",placeholder:"admin@example.com",value:j,onChange:we=>k(we.target.value),error:E.email,hint:"Used by Let’s Encrypt for expiry notices. Falls back to the email saved in Settings.",autoComplete:"email",disabled:ie}),ue&&a.jsxs(ve,{tone:"info",title:"Wildcard certificate",children:["Wildcard names like ",a.jsx("span",{className:"font-mono",children:"*.example.com"})," can only be validated with a DNS TXT record, so the DNS challenge is selected."]}),a.jsxs("fieldset",{className:"rounded-md border border-line p-3.5",disabled:ie,children:[a.jsx("legend",{className:"px-1 text-xs font-medium text-muted",children:"Challenge method"}),a.jsxs("div",{className:"mt-1 space-y-2",children:[a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",w==="http"&&!ue?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",(ue||ie)&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"http",checked:w==="http"&&!ue,disabled:ue||ie,onChange:()=>R("http"),className:"mt-0.5 size-4 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm text-ink",children:"HTTP challenge"}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:"nginx answers the ACME challenge on port 80, so it can keep running."})]})]}),a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",w==="dns"?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",ie&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"dns",checked:w==="dns",disabled:ie,onChange:()=>R("dns"),className:"mt-0.5 size-4 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm text-ink",children:"DNS challenge"}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:"You add a TXT record at your DNS provider. Works for names that do not point at this server yet."})]})]})]})]}),a.jsx(pl,{checked:z&&!ue,onChange:T,disabled:ue||ie,label:b.trim()?`Also cover www.${b.trim().replace(/^\*\./,"")}`:"Also cover the www subdomain",hint:ue?"A wildcard certificate already covers every subdomain.":"Both names are added to the same certificate."})]}),S==="dns"&&I&&a.jsxs("div",{className:"space-y-4",children:[q&&a.jsx(ul,{stages:Wa,states:Y,ariaLabel:`Certificate stages for ${L||I.domain}`}),a.jsx(ve,{tone:"warning",title:"Add this DNS TXT record",children:"Create the record at your DNS provider, then confirm. The challenge waits up to ten minutes; nothing is written to nginx while it waits."}),a.jsxs("dl",{className:"space-y-2.5 rounded-md border border-line bg-raised/40 p-3.5",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Name"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-xs text-ink",children:I.txtName}),a.jsx(qt,{value:I.txtName,label:"Copy record name"})]}),a.jsxs("div",{className:"flex items-start gap-2 border-t border-line pt-2.5",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Value"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-xs text-ink",children:I.txtValue}),a.jsx(qt,{value:I.txtValue,label:"Copy record value"})]})]}),a.jsx("p",{className:"text-xs text-faint",children:"DNS changes can take a few minutes to propagate. Confirming checks that the value is publicly visible before Let’s Encrypt does."}),de&&a.jsx(FT,{error:de})]}),S==="success"&&Q&&a.jsxs("div",{className:"space-y-4",children:[q&&a.jsx(ul,{stages:Wa,states:Y,ariaLabel:`Certificate stages for ${Q.domain}`}),a.jsx(o0,{result:Q.result,title:`Certificate issued for ${Q.domain}`}),C&&a.jsx(Rr,{preflight:C}),a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(vi,{className:"mt-0.5 size-3.5 shrink-0 text-faint","aria-hidden":"true"}),a.jsx("p",{children:"The files are on disk. To serve them, edit a domain, enable SSL and use these paths."})]}),a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-raised/40 px-3.5 py-2.5 text-xs text-muted",children:[a.jsx(Ur,{className:"size-3.5 shrink-0 text-faint","aria-hidden":"true"}),"Rename or move these files only after updating the domain config; nginx reads them by path."]})]})]})}const WT={valid:{label:"Valid",tone:"ok"},expiring:{label:"Expiring",tone:"warn"},expired:{label:"Expired",tone:"bad"},not_issued:{label:"Not issued yet",tone:"neutral"},unreadable:{label:"Unreadable",tone:"bad"},error:{label:"Unreadable",tone:"bad"}};function fv(n){return n==="unreadable"||n==="error"}function eC(n){return n===null?"text-faint":n<0?"text-bad":n<30?"text-warn":"text-ink"}function Wf(n){const i=[];return n.summary&&i.push(n.summary),n.fellBack&&i.push(`nginx was stopped for ${r0(n.nginxDownMs)} while the challenge ran.`),n.staging&&i.push("This is a staging certificate that browsers will not trust."),i.join(" ")||"The certificate was renewed."}function tC(n){return n.error&&typeof n.error=="object"?n.error:typeof n.error=="string"?{step:n.error,cause:n.detail}:n.detail??"No certificate was issued."}function hv({children:n}){return a.jsxs("p",{role:"status",className:"flex items-start gap-2 rounded-md border border-line bg-raised/40 px-3 py-2.5 text-xs text-muted",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{className:"break-words",children:n})]})}function nC(){ba("SSL certificates");const n=Et(),i=rn(),r=Pc(),{connected:c}=vn(),d=Ct(C=>fe.ssl.list(C)),[f,m]=Jc(),[h]=p.useState(()=>Fh()),g=Jh(h),v=f.get("new")==="1"||!!f.get("domain"),b=f.get("domain")??"",x=Ct(C=>fe.domains.list(C),[],{enabled:v}),[j,k]=p.useState(null),[z,T]=p.useState(null),[w,R]=p.useState(null),[S,O]=p.useState(null),[E,M]=p.useState({}),[X,A]=p.useState(null);yl(d.reload),bi(["ssl","domains"],d.reload);const U=d.data,W=p.useMemo(()=>{const C=U??[];return{total:C.length,valid:C.filter(q=>q.status==="valid").length,expiring:C.filter(q=>q.status==="expiring"||q.daysLeft!==null&&q.daysLeft>=0&&q.daysLeft<30).length,expired:C.filter(q=>q.status==="expired"||q.daysLeft!==null&&q.daysLeft<0).length,unreadable:C.filter(q=>fv(q.status)).length,notIssued:C.filter(q=>q.status==="not_issued").length}},[U]),I=p.useMemo(()=>(U??[]).filter(C=>C.daysLeft!==null&&C.daysLeft<30),[U]),te=W.expiring>0||W.expired>0||W.unreadable>0,B=()=>m({},{replace:!0}),V=()=>m({new:"1"}),de=C=>m({domain:C}),le=C=>g.byDomain[C]??{},Q=C=>c&&Object.keys(g.byDomain[C]??{}).length>0,F=async C=>{if(!(j||z)){g.clear(C.domain),k(C.domain),R({domain:C.domain,done:!1});try{const q=await fe.ssl.renew(C.domain,h);R({domain:C.domain,done:!0,result:q}),n.success(`${C.domain} renewed`,Wf(q)),d.reload()}catch(q){R({domain:C.domain,done:!0,error:q})}finally{k(null)}}},L=async C=>{if(!(j||z||!await i({title:`Delete the certificate for ${C.domain}?`,body:"Its files are removed from disk and this cannot be undone. The deletion is refused if any nginx configuration still references the certificate.",confirmLabel:"Delete certificate",tone:"danger"}))){T(C.domain);try{const Y=await fe.ssl.remove(C.domain);n.success(`${C.domain} deleted`,`Removed ${Y.directory}.`),d.reload()}catch(Y){if(Y instanceof He&&Y.code==="cert_in_use")A({domain:C.domain,directory:typeof Y.payload.directory=="string"?Y.payload.directory:null,references:Array.isArray(Y.payload.references)?Y.payload.references:[]});else{const re=Y instanceof He&&typeof Y.payload.detail=="string"?Y.payload.detail:Y instanceof Error?Y.message:void 0;n.error(`Could not delete ${C.domain}`,re)}}finally{T(null)}}},ee=async()=>{if(j||z||I.length===0||!await i({title:`Renew ${$n(I.length,"certificate")}?`,body:"Every certificate expiring within 30 days is renewed one at a time. nginx keeps running unless a challenge has to fall back to standalone mode, which stops it briefly.",confirmLabel:"Renew now",tone:"accent"}))return;const q=I.map(Y=>Y.domain);g.clear(),M({}),k("all"),O({domains:q,done:!1,results:null});try{const Y=await fe.ssl.renewAll(h);O({domains:q,done:!0,results:Y});const re=Y.filter(ye=>!ye.success).length;Y.length===0?n.info("Nothing to renew","No certificate expires within 30 days."):re===0?n.success(`${$n(Y.length,"certificate")} renewed`,"The new certificates are already on disk."):n.warning("Some certificates were not renewed",`${Y.length-re} renewed, ${re} failed.`),d.reload()}catch(Y){O({domains:q,done:!0,results:null,error:Y})}finally{k(null)}},ue=w?.error?Uc(w.error):null,ke=w?.error?cl(w.error):w?.result?cl(w.result):null,Ne=w?.error instanceof He&&w.error.code==="email_required",Ee=S?Array.from(new Set([...S.domains,...(S.results??[]).map(C=>C.domain)])):[];return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"SSL certificates",description:"Let’s Encrypt certificates managed by this installation. Renewals keep nginx running where possible.",meta:U?a.jsxs("span",{className:"text-2xs text-faint",children:[$n(W.total,"certificate")," · ",W.valid," valid",W.notIssued>0?` · ${W.notIssued} not issued`:""]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:d.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:d.reload,children:"Refresh"}),a.jsxs(ae,{variant:"secondary",size:"sm",disabled:I.length===0||j!==null||z!==null,loading:j==="all",onClick:ee,children:["Renew expiring",I.length>0?` (${I.length})`:""]}),a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:V,children:"New certificate"})]})}),te&&a.jsxs(ve,{tone:W.expired>0||W.unreadable>0?"danger":"warning",title:"Certificates need attention",className:"mb-4",children:[[W.expired>0?`${W.expired} expired`:null,W.expiring>0?`${W.expiring} expiring within 30 days`:null,W.unreadable>0?`${W.unreadable} unreadable`:null].filter(Boolean).join(" · "),". Renewing uses the same domain; an unreadable certificate is replaced by a freshly issued one."]}),d.error&&!U?a.jsx($t,{error:d.error,onRetry:d.reload}):U?U.length===0?a.jsx(et,{children:a.jsx(ga,{icon:a.jsx(Rn,{className:"size-5","aria-hidden":"true"}),title:"No certificates yet",description:"Issue a Let’s Encrypt certificate for a domain, then point the domain’s SSL settings at its files.",action:a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:V,children:"Issue a certificate"})})}):a.jsxs("div",{className:"space-y-3",children:[d.error&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known list. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsx(et,{className:"overflow-hidden",children:a.jsx("ul",{className:"divide-y divide-line",children:U.map(C=>{const q=WT[C.status]??{label:C.status,tone:"neutral"},Y=j===C.domain,re=fv(C.status),ye=C.status==="not_issued";return a.jsxs("li",{className:"flex flex-col gap-2.5 px-4 py-3 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 sm:flex-row sm:items-center sm:gap-4",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(ln,{tone:q.tone,pulse:C.status==="valid",className:"mt-1.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-mono text-sm font-semibold text-ink",children:C.domain}),a.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:re?a.jsx("span",{children:"Certificate files are unreadable"}):ye?a.jsx("span",{children:"No certificate has been issued for this domain yet"}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:["Expires ",Zh(C.expiry)]}),a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{className:oe("font-mono font-medium",eC(C.daysLeft)),children:C.daysLeft!==null?C.daysLeft<0?`${Math.abs(C.daysLeft)}d overdue`:`${C.daysLeft}d`:gi(C.daysLeft)}),C.autoRenew&&C.autoRenew!=="off"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{title:C.autoRenew==="auto"?"The background service renews this certificate on its own.":C.autoRenew==="manual"?"DNS-validated (wildcard) certificates need a TXT record added by hand, so they are not renewed automatically.":"No enabled domain serves this certificate, so it is not renewed automatically.",className:C.autoRenew==="manual"?"text-warn":void 0,children:C.autoRenew==="auto"?`Auto-renews ${C.autoRenewDays??7}d before expiry`:C.autoRenew==="manual"?"Manual renewal (DNS)":"Not in use"})]})]})})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pl-7 sm:w-28 sm:shrink-0 sm:pl-0",children:a.jsx(je,{tone:q.tone,dot:!0,children:q.label})}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5 pl-7 sm:pl-0",children:[ye?a.jsx(ae,{variant:"secondary",size:"sm",disabled:j!==null||z!==null,onClick:()=>de(C.domain),children:"Issue"}):a.jsx(ae,{variant:"secondary",size:"sm",loading:Y,disabled:j!==null||z!==null,onClick:()=>F(C),children:"Renew"}),re&&a.jsx(ae,{variant:"dangerGhost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),loading:z===C.domain,disabled:j!==null||z!==null,onClick:()=>L(C),children:"Delete"})]})]},C.domain)})})})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-14 rounded-lg"}),a.jsx(tt,{className:"h-[280px] rounded-lg"})]}),v&&a.jsx(JT,{domains:x.data??[],initialDomain:b,onClose:B,onIssued:()=>d.reload()},b||"new"),a.jsx(yn,{open:w!==null,onClose:()=>R(null),title:w?w.done&&w.error?`${w.domain} was not renewed`:w.done?`${w.domain} renewed`:`Renewing ${w.domain}`:"Renewing",description:w?.done&&w.error?"The certificate already on disk was not replaced.":void 0,size:"md",preventClose:!!(w&&!w.done),footer:a.jsxs(a.Fragment,{children:[Ne&&a.jsx(ae,{variant:"secondary",onClick:()=>{R(null),r("/settings")},children:"Open settings"}),a.jsx(ae,{variant:"primary",disabled:!!(w&&!w.done),onClick:()=>R(null),children:"Close"})]}),children:w&&a.jsxs("div",{className:"space-y-3",children:[Q(w.domain)?a.jsx(ul,{stages:Wa,states:le(w.domain),ariaLabel:`Renewal stages for ${w.domain}`,failure:ue,timedOut:ue?.stage==="timeout"}):w.done?null:a.jsxs(hv,{children:["Renewing ",a.jsx("span",{className:"font-mono text-ink",children:w.domain}),". The live stage list needs the dashboard’s connection; the result appears here when it finishes."]}),ke&&a.jsx(Rr,{preflight:ke}),w.done&&(w.error?!Q(w.domain)&&a.jsx(Rc,{value:w.error,title:"The certificate could not be renewed"}):w.result&&a.jsx(o0,{result:w.result,title:"Certificate renewed"}))]})}),a.jsxs(yn,{open:S!==null,onClose:()=>O(null),title:S?.done?"Renewal results":"Renewing expiring certificates",description:S?S.results?`${S.results.filter(C=>C.success).length} of ${S.results.length} certificates renewed.`:`${$n(S.domains.length,"certificate")} queued, one at a time.`:void 0,size:"lg",preventClose:!!(S&&!S.done),footer:a.jsx(ae,{variant:"secondary",disabled:!!(S&&!S.done),onClick:()=>O(null),children:"Close"}),children:[S&&S.done&&S.results?.length===0?a.jsx(ga,{icon:a.jsx(Rn,{className:"size-5","aria-hidden":"true"}),title:"Nothing to renew",description:"No certificate expires within 30 days."}):a.jsx("ul",{className:"space-y-2.5",children:Ee.map(C=>{const q=S?.results?.find(Ge=>Ge.domain===C)??null,Y=le(C),re=Q(C),ye=c&&Object.values(Y).some(Ge=>Ge.status==="running"),Re=!!(S&&!S.done&&!q&&!ye),xe=q&&!q.success?Uc(q):null,me=q?cl(q):null,ie=!E[C],Pe=q?q.success?Wf(q):xe?.message??"Not renewed":ye?"Renewing…":Re?"Waiting for its turn":"Not started";return a.jsxs("li",{className:"rounded-md border border-line bg-raised/30 px-3.5 py-3",children:[a.jsxs("button",{type:"button","aria-expanded":ie,onClick:()=>M(Ge=>({...Ge,[C]:!Ge[C]})),className:"flex w-full items-start gap-2.5 text-left",children:[a.jsx("span",{className:"mt-0.5 shrink-0",children:q?q.success?a.jsx(ts,{className:"size-4 text-ok","aria-hidden":"true"}):a.jsx(Tr,{className:"size-4 text-bad","aria-hidden":"true"}):ye?a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}):a.jsx(ln,{tone:"neutral",className:"mt-1.5"})}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a.jsx("span",{className:"truncate font-mono text-sm font-medium text-ink",children:C}),q&&a.jsx(je,{tone:q.success?"ok":"bad",children:q.success?"Renewed":"Failed"})]}),a.jsx("span",{className:"mt-0.5 block break-words text-xs text-muted",children:Pe})]}),a.jsx(Rb,{className:oe("mt-0.5 size-4 shrink-0 text-faint transition-transform duration-[var(--ez-motion-fast)]",ie&&"rotate-180"),"aria-hidden":"true"})]}),ie&&a.jsxs("div",{className:"mt-2.5 border-t border-line pt-2.5",children:[re?a.jsx(ul,{stages:Wa,states:Y,ariaLabel:`Renewal stages for ${C}`,failure:xe,timedOut:xe?.stage==="timeout"}):q?q.success?a.jsx("p",{className:"text-xs text-muted",children:Wf(q)}):null:S&&!S.done?a.jsxs(hv,{children:["Renewing ",a.jsx("span",{className:"font-mono text-ink",children:C}),". The live stage list needs the dashboard’s connection."]}):null,me&&a.jsx(Rr,{preflight:me,className:"mt-2.5"}),q&&!q.success&&!re&&a.jsx("div",{className:"mt-2.5",children:a.jsx(Rc,{value:tC(q),title:`${q.domain} was not renewed`})}),q?.success&&q.configRegenerated&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"The nginx config was regenerated so it can answer the ACME challenge."})]})]},C)})}),S?.error!=null&&a.jsx("div",{className:"mt-3",children:a.jsx(Rc,{value:S.error,title:"The renewal run failed"})})]}),a.jsx(yn,{open:X!==null,onClose:()=>A(null),title:X?`${X.domain} is still referenced`:"Certificate is still referenced",description:"Nothing was deleted. At least one nginx configuration file still points at this certificate.",size:"md",footer:a.jsx(ae,{variant:"secondary",onClick:()=>A(null),children:"Close"}),children:X&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-muted",children:"Disable SSL on the domain that uses this certificate — or remove the matching lines — then try deleting it again."}),X.directory&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:X.directory}),X.references.length>0&&a.jsx("ul",{className:"space-y-2",children:X.references.map(C=>a.jsxs("li",{className:"rounded-md border border-line bg-raised/30 px-3 py-2",children:[a.jsxs("div",{className:"break-all font-mono text-2xs font-medium text-ink",children:[C.file,":",C.line]}),a.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:C.text})]},`${C.file}:${C.line}`))})]})})]})}function c0(n,i={}){const{client:r,connected:c}=vn(),d=i.enabled??!0,f=i.limit??500,[m,h]=p.useState([]),[g,v]=p.useState(!1),[b,x]=p.useState(0),j=p.useRef(g);j.current=g,p.useEffect(()=>{if(!r||!d)return;const w=R=>{if(R.logFile===n){if(j.current){x(S=>Math.min(S+1,999));return}h(S=>{const O=[...S,R.line];return O.length>f?O.slice(O.length-f):O})}};return r.on("logs:line",w),()=>r.off("logs:line",w)},[r,d,f,n]),p.useEffect(()=>{h([]),x(0)},[d,n]),p.useEffect(()=>{if(!(!r||!d||!c))return h([]),x(0),r.emit("logs:subscribe",{logFile:n}),()=>r.emit("logs:unsubscribe")},[r,c,d,n]);const k=p.useCallback(()=>{h([]),x(0)},[]),z=p.useCallback(()=>{h([]),x(0),!(!r||!d)&&(r.emit("logs:unsubscribe"),r.emit("logs:subscribe",{logFile:n}))},[r,d,n]),T=p.useCallback(w=>{v(w),w||x(0)},[]);return{lines:m,paused:g,missed:b,connected:c,clear:k,restart:z,setPaused:T}}const vc={start:"Start nginx",stop:"Stop nginx",restart:"Restart nginx",reload:"Reload nginx",test:"Test configuration"},aC={start:()=>fe.nginx.start(),stop:()=>fe.nginx.stop(),restart:()=>fe.nginx.restart(),reload:()=>fe.nginx.reload(),test:()=>fe.nginx.test()};function mv(n){return n instanceof He?typeof n.payload.output=="string"&&n.payload.output?n.payload.output:typeof n.payload.error=="string"&&n.payload.error?n.payload.error:n.message:n instanceof Error?n.message:"The action failed."}function sC(n){return/\[(error|crit|emerg|alert)\]/i.test(n)?"text-bad":/\[warn(ing)?\]/i.test(n)?"text-warn":"text-muted"}function lC(){ba("Nginx");const n=Et(),i=rn(),{nginxStatus:r,connectionError:c}=vn(),d=Ct(Y=>fe.nginx.status(Y)),f=Ct(Y=>fe.nginx.configs(Y)),[m,h]=p.useState(null),[g,v]=p.useState(null),[b,x]=p.useState(null),[j,k]=p.useState(null),[z,T]=p.useState(""),[w,R]=p.useState(""),[S,O]=p.useState(!1),[E,M]=p.useState(!1),[X,A]=p.useState(null),[U,W]=p.useState(null),I=p.useRef(null),te=p.useRef(null),B=c0("error",{limit:300}),V=p.useRef(null),[de,le]=p.useState(!0);p.useEffect(()=>{d.data&&h(d.data)},[d.data]),p.useEffect(()=>{r&&h(r)},[r]),p.useEffect(()=>{const Y=V.current;Y&&de&&(Y.scrollTop=Y.scrollHeight)},[B.lines,de]);const Q=j!==null&&z!==w;p.useEffect(()=>{if(!Q)return;const Y=re=>{re.preventDefault(),re.returnValue=""};return window.addEventListener("beforeunload",Y),()=>window.removeEventListener("beforeunload",Y)},[Q]);const F=()=>{d.reload(),f.reload()};yl(F),bi("nginx",F);async function L(Y){if(!(!Y||Y===j||S||E)&&!(Q&&!await i({title:"Discard unsaved changes?",body:`${j} has edits that were not saved.`,confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}))){k(Y),O(!0),A(null),W(null);try{const re=await fe.nginx.getConfig(Y);T(re.content),R(re.content)}catch(re){A(re),T(""),R("")}finally{O(!1)}}}p.useEffect(()=>{j||!f.data?.length||L(f.data[0])},[f.data,j]);const ee=async Y=>{if(!g&&!((Y==="stop"||Y==="restart")&&!await i({title:Y==="stop"?"Stop nginx?":"Restart nginx?",body:Y==="stop"?"Every site nginx serves goes offline until it is started again.":"Open connections are dropped for a moment while nginx restarts.",confirmLabel:Y==="stop"?"Stop nginx":"Restart nginx",tone:"danger"}))){v(Y),x(null);try{const re=await aC[Y]();x({action:Y,ok:re.success,output:re.output}),re.success?(n.success(`${vc[Y]} succeeded`,Y==="test"?"nginx -t accepted the configuration.":void 0),Y!=="test"&&d.reload()):n.error(`${vc[Y]} failed`,re.output||void 0)}catch(re){const ye=mv(re);x({action:Y,ok:!1,output:ye}),n.error(`${vc[Y]} failed`,ye)}finally{v(null)}}},ue=async()=>{if(!(!j||E||S||!Q)){M(!0),W(null);try{const Y=await fe.nginx.saveConfig(j,z);R(z),W({ok:!0,output:Y.output||"Saved and tested successfully."}),n.success("Configuration saved","nginx -t passed. Reload nginx to apply it.")}catch(Y){W({ok:!1,output:mv(Y)}),n.error("Configuration rejected","The previous file was restored.")}finally{M(!1)}}},ke=()=>{T(w),W(null)},Ne=p.useMemo(()=>{const Y=z.split(`
|
|
514
|
-
`).length;return Array.from({length:Math.max(Y,1)},(re,ye)=>ye+1)},[z]),Ee=!!m?.running,C=!m&&(d.loading||!!d.error),q=B.lines.join(`
|
|
515
|
-
`);return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Nginx",description:"Service controls, configuration files and the error log, without leaving the dashboard.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:d.loading||f.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>{F(),B.restart()},children:"Refresh"})}),d.error&&!m?a.jsx($t,{error:d.error,onRetry:d.reload}):C?a.jsxs(ns,{children:[a.jsx(tt,{className:"h-24 rounded-lg"}),a.jsx(tt,{className:"h-[380px] rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[d.error&&m&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known status. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",Ee?"bg-ok/60":"bg-bad/60"),"aria-hidden":"true"}),a.jsxs(xn,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3.5",children:[a.jsxs("div",{className:"relative flex size-11 shrink-0 items-center justify-center rounded-lg border border-line bg-raised",children:[a.jsx(gl,{className:"size-5 text-ink","aria-hidden":"true"}),a.jsx(ln,{tone:Ee?"ok":"bad",pulse:Ee,className:"absolute -right-0.5 -top-0.5 ring-2 ring-surface"})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-base font-semibold text-ink",children:Ee?"nginx is running":"nginx is stopped"}),m?.pid!==null&&m?.pid!==void 0&&Ee&&a.jsxs(je,{tone:"neutral",children:["pid ",m.pid]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted",children:m?.version??"Version unavailable"}),m?.error&&a.jsx("p",{className:"mt-1 text-xs text-bad",children:m.error})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ee?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="reload",disabled:g!==null&&g!=="reload",onClick:()=>ee("reload"),children:"Reload"}),a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="restart",disabled:g!==null&&g!=="restart",onClick:()=>ee("restart"),children:"Restart"}),a.jsx(ae,{variant:"danger",size:"sm",loading:g==="stop",disabled:g!==null&&g!=="stop",onClick:()=>ee("stop"),children:"Stop"})]}):a.jsx(ae,{variant:"primary",size:"sm",loading:g==="start",disabled:g!==null&&g!=="start",onClick:()=>ee("start"),children:"Start nginx"}),a.jsx("span",{className:"mx-0.5 hidden h-6 w-px bg-line sm:block","aria-hidden":"true"}),a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="test",disabled:g!==null&&g!=="test",onClick:()=>ee("test"),children:"Test config"})]})]}),b&&a.jsx("div",{className:"border-t border-line px-4 py-3 sm:px-5",children:a.jsx(ve,{tone:b.ok?"success":"danger",title:`${vc[b.action]} ${b.ok?"succeeded":"failed"}`,children:b.output&&a.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:b.output})})})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-col gap-3 border-b border-line px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Configuration"}),Q&&a.jsx(je,{tone:"warn",children:"Unsaved changes"})]}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Every save is written, tested with nginx -t, and rolled back if nginx rejects it."})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(pa,{"aria-label":"Configuration file",value:j??"",disabled:E||S||!f.data?.length,onChange:Y=>void L(Y.target.value),className:"w-full sm:w-60",children:[a.jsx("option",{value:"",disabled:!0,children:"Select a config file…"}),(f.data??[]).map(Y=>a.jsx("option",{value:Y,children:Y},Y))]}),a.jsx(ae,{variant:"ghost",size:"sm",disabled:!Q||E,icon:a.jsx(qk,{className:"size-3.5","aria-hidden":"true"}),onClick:ke,children:"Revert"}),a.jsx(ae,{variant:"primary",size:"sm",disabled:!j||!Q,loading:E,icon:a.jsx(gh,{className:"size-3.5","aria-hidden":"true"}),onClick:ue,children:"Save"})]})]}),f.error&&!f.data?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx($t,{error:f.error,onRetry:f.reload})}):f.data?f.data.length===0?a.jsx("div",{className:"px-4 py-14 text-center text-sm text-muted sm:px-5",children:"No configuration files were found."}):S?a.jsxs("div",{className:"flex h-[360px] items-center justify-center gap-2 text-sm text-muted",children:[a.jsx(Tt,{className:"spin size-4","aria-hidden":"true"}),"Loading configuration…"]}):X?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx($t,{error:X,title:"Could not load this configuration",onRetry:()=>j?void L(j):void 0})}):j?a.jsxs("div",{className:"relative flex h-[min(56vh,520px)] min-h-[280px] overflow-hidden bg-canvas",children:[a.jsx("div",{ref:te,"aria-hidden":"true",className:"config-editor pointer-events-none w-12 shrink-0 overflow-hidden border-r border-line bg-inset/40 py-3 pr-2 text-right text-faint",children:Ne.map(Y=>a.jsx("div",{children:Y},Y))}),a.jsx("textarea",{ref:I,value:z,onChange:Y=>T(Y.target.value),onScroll:()=>{te.current&&I.current&&(te.current.scrollTop=I.current.scrollTop)},onKeyDown:Y=>{(Y.metaKey||Y.ctrlKey)&&Y.key.toLowerCase()==="s"&&(Y.preventDefault(),ue())},wrap:"off",spellCheck:!1,"aria-label":j?`${j} contents`:"nginx configuration",className:"config-editor h-full w-full resize-none bg-transparent py-3 pl-4 pr-4 text-ink caret-accent outline-none"})]}):a.jsx("div",{className:"px-4 py-14 text-center text-sm text-muted sm:px-5",children:"Select a configuration file to start editing."}):a.jsxs("div",{className:"space-y-2 p-4 sm:p-5",children:[a.jsx(tt,{className:"h-5 w-48"}),a.jsx(tt,{className:"h-[300px]"})]}),U&&a.jsxs("div",{className:oe("border-t px-4 py-3 sm:px-5",U.ok?"border-ok/25 bg-ok-soft":"border-bad/25 bg-bad-soft"),children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("p",{className:oe("text-xs font-medium",U.ok?"text-ok":"text-bad"),children:U.ok?"Saved — nginx test passed":"Save rejected — the previous file was restored"}),U.ok&&a.jsx(ae,{variant:"secondary",size:"sm",loading:g==="reload",disabled:g!==null&&g!=="reload",onClick:()=>ee("reload"),children:"Reload nginx"})]}),U.output&&a.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:U.output})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-3 sm:px-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Error log"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(ln,{tone:B.paused?"warn":B.connected?"ok":"neutral",pulse:!B.paused&&B.connected}),B.paused?"Paused":B.connected?"Live":"Connecting…"]}),B.paused&&B.missed>0&&a.jsxs(je,{tone:"warn",children:[B.missed," new"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[q&&a.jsx(qt,{value:q,label:"Copy lines",withText:!0}),a.jsx(ct,{label:B.paused?"Resume the log stream":"Pause the log stream",size:"sm",onClick:()=>B.setPaused(!B.paused),children:B.paused?a.jsx(Hr,{className:"size-3.5","aria-hidden":"true"}):a.jsx(_b,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:"Clear the log view",size:"sm",onClick:B.clear,disabled:B.lines.length===0,children:a.jsx(Tt,{className:"size-3.5 rotate-45","aria-hidden":"true"})})]})]}),a.jsx("div",{ref:V,"aria-label":"Recent nginx error log",onScroll:Y=>{const re=Y.currentTarget;le(re.scrollHeight-re.scrollTop-re.clientHeight<40)},className:"h-64 overflow-y-auto bg-canvas px-4 py-3 font-mono text-2xs leading-relaxed sm:px-5",children:!B.connected&&B.lines.length===0?a.jsx("p",{className:"text-faint",children:"Waiting for the live stream…"}):B.lines.length===0?a.jsx("p",{className:"text-faint",children:"No errors logged."}):B.lines.map((Y,re)=>a.jsx("div",{className:oe("whitespace-pre-wrap break-all py-0.5",sC(Y)),children:Y},re))}),c&&a.jsxs("div",{className:"border-t border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["The live log stream is disconnected. New lines appear once the dashboard socket reconnects."," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:B.restart,children:"Try again"})]})]})]})]})}const iC=[{value:"discord",label:"Discord",description:"Post alerts to a channel through a webhook URL.",icon:Wc},{value:"telegram",label:"Telegram",description:"Send alerts through a bot to a chat or group.",icon:Ub}];function rC(n){return{name:n?.name??"",type:n?.type??"discord",webhookUrl:n?.webhookUrl??"",botToken:n?.botToken??"",chatId:n?.chatId??"",message:n?.message??""}}function oC(n){if(n instanceof He){const i=typeof n.payload.detail=="string"?n.payload.detail:null;return i||n.message}return n instanceof Error?n.message:"The channel could not be saved."}function cC({channel:n,onClose:i,onSaved:r}){const c=rn(),d=n!==null,f=p.useRef(rC(n)),[m,h]=p.useState(f.current),[g,v]=p.useState({}),[b,x]=p.useState(null),[j,k]=p.useState(!1),z=Object.keys(m).some(S=>m[S]!==f.current[S]),T=(S,O)=>{h(E=>({...E,[S]:O})),v(E=>({...E,[S]:void 0})),x(null)},w=()=>{if(!j){if(!z){i();return}c({title:d?"Discard channel changes?":"Discard this channel?",body:"Nothing has been sent to the server yet.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}).then(S=>{S&&i()})}},R=async()=>{if(j)return;const S={};if(m.name.trim()||(S.name="Give the channel a name."),m.type==="discord"){const E=m.webhookUrl.trim();E?/^https:\/\/\S+$/i.test(E)||(S.webhookUrl="Enter an https:// URL without spaces."):S.webhookUrl="A Discord webhook URL is required."}else m.botToken.trim()||(S.botToken="The bot token is required."),m.chatId.trim()||(S.chatId="The chat ID is required.");if(v(S),Object.keys(S).length>0)return;const O={name:m.name.trim(),type:m.type,...m.type==="discord"?{webhookUrl:m.webhookUrl.trim(),message:m.message.trim()}:{botToken:m.botToken.trim(),chatId:m.chatId.trim()}};k(!0),x(null);try{const E=n?await fe.settings.channels.update(n.id,O):await fe.settings.channels.create(O);r(E,!d)}catch(E){x(oC(E))}finally{k(!1)}};return a.jsx(yn,{open:!0,onClose:w,title:d?`Edit ${n.name}`:"New notification channel",description:d?"Change where this channel delivers, or how its messages look.":"Add a Discord webhook or a Telegram bot. Domains choose their channels per event.",preventClose:j,footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:w,disabled:j,children:"Cancel"}),a.jsx(ae,{variant:"primary",type:"submit",form:"channel-form",loading:j,children:d?"Save channel":"Create channel"})]}),children:a.jsxs("form",{id:"channel-form",onSubmit:S=>{S.preventDefault(),R()},className:"space-y-4",children:[b&&a.jsx(ve,{tone:"danger",title:"Could not save the channel",children:b}),a.jsx(Me,{label:"Name",value:m.name,onChange:S=>T("name",S.target.value),placeholder:"Production Discord",error:g.name,autoFocus:!0}),a.jsxs("fieldset",{disabled:d||j,children:[a.jsx("legend",{className:"mb-1.5 text-xs font-medium text-muted",children:"Type"}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:iC.map(S=>{const O=m.type===S.value;return a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2.5 rounded-md border p-3 transition-colors duration-[var(--ez-motion-fast)]",O?"border-accent bg-accent-soft":"border-line bg-canvas hover:border-line-strong",(d||j)&&"cursor-not-allowed opacity-70"),children:[a.jsx("input",{type:"radio",name:"channel-type",value:S.value,checked:O,onChange:()=>T("type",S.value),className:"mt-0.5 size-3.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(S.icon,{className:"size-3.5 text-muted","aria-hidden":"true"}),S.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:S.description})]})]},S.value)})}),d&&a.jsx(ml,{children:"The channel type cannot be changed after it is created."})]}),m.type==="discord"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{label:"Webhook URL",value:m.webhookUrl,onChange:S=>T("webhookUrl",S.target.value),placeholder:"https://discord.com/api/webhooks/…",error:g.webhookUrl,hint:"Create one in Discord under Channel settings → Integrations → Webhooks.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs("div",{children:[a.jsx(Me,{label:"Message prefix",optional:!0,value:m.message,onChange:S=>T("message",S.target.value),placeholder:"<@&1280907071813976196> or @team",hint:"Prepended to every alert in this channel.",spellCheck:!1}),a.jsxs("div",{className:"mt-2 rounded-md border border-info/25 bg-info-soft px-3 py-2 text-2xs text-muted",children:["Tip: to ping a Discord role, paste its mention as"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-[10px] text-ink",children:"<@&RoleId>"})," ","— for example"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-[10px] text-ink",children:"<@&1280907071813976196>"}),". The role is mentioned on every alert."]})]})]}):a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(Me,{label:"Bot token",value:m.botToken,onChange:S=>T("botToken",S.target.value),placeholder:"123456:ABC…",error:g.botToken,hint:"From @BotFather.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(Me,{label:"Chat ID",value:m.chatId,onChange:S=>T("chatId",S.target.value),placeholder:"-1001234567890",error:g.chatId,hint:"Groups start with a minus sign.",className:"font-mono",spellCheck:!1,autoComplete:"off"})]})]})})}const uC={nginx_down:"nginx",cert_expiry:"Certificate",domain_health:"Health check",test:"Test message"};function dC(n){return n.type==="nginx_down"?gl:n.type==="cert_expiry"?as:n.type==="domain_health"?Mc:Xh}function fC(n){return n==="danger"?"text-bad":n==="warning"?"text-warn":n==="success"?"text-ok":n==="info"?"text-info":"text-muted"}function pv(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function hC(n){if(!n)return"Webhook URL not set";try{const i=new URL(n),r=i.pathname.split("/").filter(Boolean).pop()??"";return`${i.host}/…${r.slice(-4)}`}catch{return"Webhook URL configured"}}function mC(n){return n.type==="discord"?hC(n.webhookUrl):`Chat ${n.chatId??"—"} · bot token saved`}function pC(){ba("Notifications");const n=Et(),i=rn(),{notifications:r,clearNotifications:c,connected:d,connectionError:f}=vn(),m=Ct(E=>fe.settings.channels.list(E)),h=Ct(E=>fe.domains.list(E)),[g,v]=p.useState(null),[b,x]=p.useState(null),[j,k]=p.useState(null),[,z]=p.useState(0);p.useEffect(()=>{const E=setInterval(()=>z(M=>M+1),3e4);return()=>clearInterval(E)},[]);const T=()=>{m.reload(),h.reload()};yl(T),bi(["settings","domains"],T);const w=p.useMemo(()=>{const E=new Map;for(const M of h.data??[]){if(!M.enabled)continue;const X=new Map;for(const A of Object.values(M.notifications))if(A.enabled)for(const U of A.channelIds)X.set(U,(X.get(U)??0)+1);for(const[A,U]of X){const W=E.get(A)??{domains:0,rules:0};W.domains+=1,W.rules+=U,E.set(A,W)}}return E},[h.data]),R=async E=>{if(!b){x(E.id);try{await fe.settings.channels.test(E.id),n.success(`Test sent to ${E.name}`,"Check the channel to confirm the message arrived.")}catch(M){n.error(`Test failed for ${E.name}`,pv(M,"The test message could not be delivered."))}finally{x(null)}}},S=async E=>{if(!(j||!await i({title:`Delete ${E.name}?`,body:"Domains routed to this channel stop delivering alerts there. The domains themselves are not changed.",confirmLabel:"Delete channel",tone:"danger"}))){k(E.id);try{await fe.settings.channels.remove(E.id),n.success("Channel deleted",`${E.name} will no longer receive alerts.`),m.reload()}catch(X){n.error("Could not delete the channel",pv(X,"The channel is still configured."))}finally{k(null)}}},O=m.data;return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Notifications",description:"Delivery channels for alerts, and the events received in this session.",actions:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:m.loading||h.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:T,children:"Refresh"}),a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>v({channel:null}),children:"New channel"})]})}),m.error&&!O?a.jsx($t,{error:m.error,onRetry:m.reload}):O?a.jsxs("div",{className:"grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_380px]",children:[a.jsx("div",{className:"space-y-5",children:a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:"Channels",description:"Named Discord and Telegram destinations. Domains choose which channels receive their events.",actions:O.length>0?a.jsx(je,{tone:"neutral",children:$n(O.length,"channel")}):void 0}),m.error&&a.jsxs("div",{className:"border-b border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["Showing the last known list. ",m.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:m.reload,children:"Try again"})]}),O.length===0?a.jsx(ga,{icon:a.jsx(Wc,{className:"size-5","aria-hidden":"true"}),title:"No channels yet",description:"Add a Discord webhook or a Telegram bot, then route domain events to it. Until then, alerts stay in the dashboard only.",action:a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>v({channel:null}),children:"New channel"})}):a.jsx("ul",{className:"divide-y divide-line/70",children:O.map(E=>{const M=w.get(E.id),X=j===E.id;return a.jsxs("li",{className:"flex flex-col gap-3 px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md border border-line bg-inset text-muted",children:a.jsx(Cc,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:E.name}),a.jsx(a0,{type:E.type}),h.data&&(M?a.jsxs(je,{tone:"ok",dot:!0,className:"cursor-default",children:[M.domains," ",M.domains===1?"domain":"domains"]}):a.jsx(je,{tone:"neutral",children:"Not routed yet"}))]}),a.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted",children:mC(E)}),E.type==="discord"&&E.message&&a.jsxs("p",{className:"mt-0.5 truncate text-2xs text-faint",children:["Prefix: ",E.message]})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 pl-12 sm:pl-0",children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:b===E.id,disabled:b!==null&&b!==E.id,icon:a.jsx(wS,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void R(E),children:"Test"}),a.jsx(ae,{variant:"ghost",size:"sm",disabled:X,icon:a.jsx(Yh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>v({channel:E}),children:"Edit"}),a.jsx(ct,{label:`Delete ${E.name}`,size:"sm",disabled:X,className:"hover:text-bad",onClick:()=>void S(E),children:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"})})]})]},E.id)})}),O.length>0&&a.jsx("div",{className:"border-t border-line bg-raised/40 px-4 py-2.5 text-2xs text-faint sm:px-5",children:h.error?"Domain routing could not be loaded, so usage counts are hidden.":"Counts include enabled domains that route at least one event to a channel."})]})}),a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Cc,{className:"size-4","aria-hidden":"true"}),title:"Recent events",description:"Received live while this page is open.",actions:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(ln,{tone:d?"ok":"warn",pulse:d}),d?"Live":"Reconnecting…"]})}),f&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ve,{tone:"warning",children:f})}),r.length===0?a.jsx(ga,{icon:a.jsx(Cc,{className:"size-5","aria-hidden":"true"}),title:"No events yet",description:"Alerts appear here as they happen. The bell in the header keeps the same list between pages.",className:"py-9"}):a.jsxs(a.Fragment,{children:[a.jsx("ul",{className:"max-h-[420px] divide-y divide-line/70 overflow-y-auto",children:r.map(E=>{const M=dC(E);return a.jsxs("li",{className:"flex items-start gap-2.5 px-4 py-2.5 sm:px-5",children:[a.jsx(M,{className:oe("mt-0.5 size-4 shrink-0",fC(E.severity)),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs leading-snug text-ink",children:E.message}),a.jsxs("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 text-2xs text-faint",children:[a.jsx("span",{children:uC[E.type]??"Notification"}),E.domain&&a.jsxs("span",{children:["· ",E.domain]}),a.jsxs("span",{children:["· ",$r(E.timestamp)]})]})]})]},E.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/40 px-4 py-2 sm:px-5",children:a.jsx("button",{type:"button",onClick:c,className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Clear all events"})})]})]}),a.jsxs(et,{children:[a.jsx(pn,{title:"How routing works",description:"Channels do nothing until a domain sends to them."}),a.jsxs(xn,{className:"space-y-3",children:[a.jsx("ol",{className:"space-y-2.5",children:["Create a channel here and send it a test message.","Open a domain and pick channels for nginx downtime, certificate expiry and health events.","Toggle each event separately — turning one off keeps the others delivering."].map((E,M)=>a.jsxs("li",{className:"flex gap-2.5 text-xs text-muted",children:[a.jsx("span",{className:"mt-0.5 flex size-4.5 shrink-0 items-center justify-center rounded-full bg-inset text-2xs font-semibold text-muted",children:M+1}),a.jsx("span",{children:E})]},E))}),a.jsxs(kt,{to:"/domains",className:ma("secondary","sm","w-full"),children:["Open domains",a.jsx(vi,{className:"size-3.5","aria-hidden":"true"})]})]})]})]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-40 rounded-lg"}),a.jsx(tt,{className:"h-64 rounded-lg"})]}),g&&a.jsx(cC,{channel:g.channel,onClose:()=>v(null),onSaved:(E,M)=>{v(null),m.reload(),n.success(M?"Channel created":"Channel updated",M?`${E.name} is ready to receive alerts.`:`${E.name} was saved.`)}},g.channel?.id??"new")]})}function xv(n,i){return n instanceof He?typeof n.payload.detail=="string"?n.payload.detail:typeof n.payload.message=="string"?n.payload.message:n.message:n instanceof Error?n.message:i}function Hc(n){return n==="online"?"ok":n==="errored"?"bad":n==="stopping"||n==="launching"?"warn":"neutral"}function u0(n){return n===null||n===0?"—":E5(n)}function d0(n){return n===null||n===0?"—":Pb(n)}function gv(n,i){const r=i?.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase()??null;return[n.execPath,n.cwd].some(c=>{if(!c)return!1;const d=c.replace(/\\/g,"/").toLowerCase();return r&&d.startsWith(`${r}/modules/`)?!0:/(^|\/)(\.pm2|pm2)\/modules\//.test(d)})}function bc({label:n,value:i}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:n}),a.jsx("div",{className:"mt-0.5 text-xs tabular-nums text-muted",children:i})]})}function zs({label:n,value:i,detail:r,tone:c}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:n}),a.jsx("div",{className:oe("mt-0.5 text-sm font-medium",c??"text-ink"),children:i}),r&&a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:r})]})}function xC({command:n,guidance:i}){return a.jsxs("div",{className:"rounded-md border border-line bg-canvas p-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("code",{className:"break-all font-mono text-xs text-ink",children:n}),a.jsx(qt,{value:n,label:"Copy command",withText:!0})]}),a.jsx("p",{className:"mt-2 text-2xs leading-relaxed text-muted",children:i})]})}function yv({label:n,version:i,path:r,broken:c=!1,emptyLabel:d="Unknown"}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs text-faint",children:n}),a.jsx("div",{className:oe("text-xs font-medium",c?"text-warn":"text-ink"),children:i??(c?"Missing":d)}),a.jsx("div",{className:"break-all font-mono text-2xs text-faint",children:r??"—"})]})}function gC({runtime:n}){const i=L5(n);return i?a.jsxs("div",{className:"rounded-md border border-line bg-canvas/40 px-3.5 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Node runtime"}),i.broken?a.jsx(je,{tone:"warn",children:"service runtime missing"}):i.pinned?i.sameAsSystem?a.jsx(je,{tone:"neutral",children:"same as system"}):a.jsx(je,{tone:"info",children:"pinned copy"}):a.jsx(je,{tone:"warn",children:"not pinned"})]}),a.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[a.jsx(yv,{label:"Service Node",version:i.serviceVersion,path:i.servicePath,broken:i.broken,emptyLabel:i.pinned?"Unknown":"Not pinned"}),a.jsx(yv,{label:"System Node",version:i.systemVersion,path:i.systemPath})]}),i.manager&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The system Node is managed by ",i.manager,". The service uses its own pinned binary so switching versions cannot break it."]}),!i.pinned&&!i.broken&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["No pinned Node was found. The service will start with whatever"," ",a.jsx("code",{className:"font-mono",children:"node"})," its launcher resolves;"," ",a.jsx("code",{className:"font-mono",children:"ezz service repair"})," pins one."]}),i.pinned&&!i.sameAsSystem&&!i.broken&&i.serviceVersion&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The service is pinned to a different Node than this dashboard. That is normal after an upgrade; ",a.jsx("code",{className:"font-mono",children:"ezz service repair"})," re-pins it."]})]}):null}function yC({app:n,onClose:i}){const r=Ct(d=>fe.processes.logs(n.name,200,d)),c=(r.data?.lines??[]).join(`
|
|
516
|
-
`);return a.jsx(yn,{open:!0,onClose:i,title:`Logs — ${n.name}`,description:"The last 200 lines PM2 has written for this process.",size:"lg",footer:a.jsxs(a.Fragment,{children:[c.trim()&&a.jsx(qt,{value:c,label:"Copy logs",withText:!0}),a.jsx(ae,{variant:"secondary",onClick:i,children:"Close"})]}),children:r.error&&!r.data?a.jsx($t,{error:r.error,title:"Could not read the logs",onRetry:r.reload,className:"border-0"}):r.data?a.jsx("pre",{className:"max-h-[55vh] overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted",children:c.trim()?c:"(no output)"}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[a.jsx(_s,{}),"Reading logs…"]})})}function vv({app:n,isModule:i,busy:r,currentUser:c,onAction:d,onLogs:f}){const m=r?.name===n.name,h=!!(n.user&&c&&n.user!==c);return a.jsxs("li",{className:"px-4 py-3.5 sm:px-5",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ln,{tone:Hc(n.status),pulse:n.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:n.name}),a.jsx(je,{tone:Hc(n.status),children:n.status}),i&&a.jsx(je,{tone:"info",children:"module"}),h&&a.jsx(je,{tone:"warn",children:n.user})]}),(n.execPath||n.cwd)&&a.jsx("p",{className:"mt-0.5 truncate font-mono text-2xs text-faint",children:n.execPath??n.cwd})]}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5",children:[n.status==="online"?a.jsx(ae,{variant:"secondary",size:"sm",loading:m&&r?.action==="stop",disabled:m||h,icon:a.jsx(Kh,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(n,"stop",i),children:"Stop"}):a.jsx(ae,{variant:"secondary",size:"sm",loading:m&&r?.action==="start",disabled:m||h,icon:a.jsx(Hr,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(n,"start",i),children:"Start"}),a.jsx(ae,{variant:"ghost",size:"sm",loading:m&&r?.action==="restart",disabled:m||h,icon:a.jsx(Vh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>d(n,"restart",i),children:"Restart"}),a.jsx(ae,{variant:"ghost",size:"sm",disabled:m,icon:a.jsx(Er,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>f(n),children:"Logs"})]})]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsx(bc,{label:"CPU",value:u0(n.cpu)}),a.jsx(bc,{label:"Memory",value:d0(n.memoryBytes)}),a.jsx(bc,{label:"Uptime",value:eu(n.uptimeMs)}),a.jsx(bc,{label:"Restarts",value:n.unstableRestarts>0?`${n.restarts} · ${n.unstableRestarts} unstable`:String(n.restarts)})]})]})}const f0="ez.processes.view";function vC(){try{return localStorage.getItem(f0)==="table"?"table":"list"}catch{return"list"}}function bC({view:n,onChange:i}){const r=[{id:"list",label:"List view",icon:KS},{id:"table",label:"Table view",icon:Ok}];return a.jsx("div",{role:"group","aria-label":"Process layout",className:"inline-flex items-center gap-0.5 rounded-md border border-line bg-raised p-0.5",children:r.map(({id:c,label:d,icon:f})=>a.jsxs("button",{type:"button","aria-pressed":n===c,title:d,onClick:()=>i(c),className:oe("inline-flex size-7 items-center justify-center rounded-sm transition-colors duration-[var(--ez-motion-fast)]",n===c?"bg-surface text-ink shadow-sm":"text-faint hover:text-ink"),children:[a.jsx(f,{className:"size-3.5","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:d})]},c))})}function jC({app:n}){return n.unstableRestarts>0?`${n.restarts} · ${n.unstableRestarts} unstable`:String(n.restarts)}function bv({apps:n,isModule:i,busy:r,currentUser:c,onAction:d,onLogs:f}){return a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full min-w-[42rem] text-left text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{scope:"col",className:"px-4 py-2 font-medium sm:px-5",children:"Process"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"CPU"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Memory"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Uptime"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Restarts"}),a.jsx("th",{scope:"col",className:"px-4 py-2 text-right font-medium sm:px-5",children:a.jsx("span",{className:"sr-only",children:"Actions"})})]})}),a.jsx("tbody",{children:n.map(m=>{const h=r?.name===m.name,g=!!(m.user&&c&&m.user!==c);return a.jsxs("tr",{className:"border-b border-line/70 last:border-0",children:[a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ln,{tone:Hc(m.status),pulse:m.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:m.name}),i&&a.jsx(je,{tone:"info",children:"module"}),g&&a.jsx(je,{tone:"warn",children:m.user})]})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2",children:a.jsx(je,{tone:Hc(m.status),children:m.status})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:u0(m.cpu)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:d0(m.memoryBytes)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 tabular-nums text-muted",children:eu(m.uptimeMs)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:a.jsx(jC,{app:m})}),a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[m.status==="online"?a.jsx(ct,{label:`Stop ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"stop",i),children:h&&r?.action==="stop"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Kh,{className:"size-3","aria-hidden":"true"})}):a.jsx(ct,{label:`Start ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"start",i),children:h&&r?.action==="start"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Hr,{className:"size-3","aria-hidden":"true"})}),a.jsx(ct,{label:`Restart ${m.name}`,size:"sm",disabled:h||g,onClick:()=>d(m,"restart",i),children:h&&r?.action==="restart"?a.jsx(gn,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Vh,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(ct,{label:`View logs for ${m.name}`,size:"sm",disabled:h,onClick:()=>f(m),children:a.jsx(Er,{className:"size-3.5","aria-hidden":"true"})})]})})]},`${m.name}-${m.pmId??"x"}`)})})]})})}function NC(){ba("Processes");const n=Et(),i=rn(),{service:r,loading:c,error:d,reload:f,applyBackgroundService:m}=Br(),h=qr(r),g=Ct(B=>fe.processes.list(B)),[v,b]=p.useState(null),[x,j]=p.useState(null),[k,z]=p.useState(null),[T,w]=p.useState(null),[R,S]=p.useState(vC),O=B=>{S(B);try{localStorage.setItem(f0,B)}catch{}},E=()=>{g.reload(),f()};hl(g.reload,15e3),hl(()=>{c||f()},15e3),yl(E);const M=async(B,V,de)=>{if(!v){if(V==="stop"||V==="restart"){const le=de?V==="stop"?B.name.toLowerCase().includes("logrotate")?`${B.name} rotates PM2's logs. Stopping it lets PM2 logs grow without limit until you start it again. It is a PM2 module, not one of your apps.`:`${B.name} is a PM2 module, not one of your apps. Stopping it changes how PM2 itself behaves.`:`${B.name} is a PM2 module. Restarting it briefly stops the behaviour it adds to PM2.`:`${B.name} is one of your own PM2 apps. ${V==="stop"?"Stopping":"Restarting"} it affects whatever else relies on it.`;if(!await i({title:`${V==="stop"?"Stop":"Restart"} ${B.name}?`,body:le,confirmLabel:de&&V==="stop"?"Stop module anyway":`${V==="stop"?"Stop":"Restart"} anyway`,tone:"danger"}))return}b({name:B.name,action:V});try{const le=await fe.processes.action(B.name,V);n.success(`${B.name}: ${V} done`,le.output||void 0),E()}catch(le){n.error(`Could not ${V} ${B.name}`,xv(le,"PM2 refused the action. Check the PM2 log for details."))}finally{b(null)}}},X=async B=>{if(!h||k)return;const V=h.startsAt==="logon"?"at your next logon":h.startsAt==="boot"?"at the next boot":"when the service starts";if(await i(B==="start"?{title:"Start the background service?",body:h.installed?`Monitoring and notifications keep running after this dashboard closes. From now on it also starts ${V}.`:"The service is not installed; if it cannot start, the exact install command is shown instead.",confirmLabel:"Start service"}:B==="stop"?{title:"Stop the background service?",body:h.installed?`Monitoring and notifications pause while it is down. It returns ${V} or as soon as you start it again.`:"Monitoring and notifications pause while it is down. It will not restart until you start it, because it is not installed.",confirmLabel:"Stop service",tone:"danger"}:{title:"Restart the background service?",body:"Monitoring pauses for a moment while the service restarts. Jobs resume when it is back up.",confirmLabel:"Restart service",tone:"danger"})){z(B),w(null);try{const le=await fe.service[B]();m(le.backgroundService),n.success(B==="start"?"Background service started":B==="stop"?"Background service stopped":"Background service restarted",le.output?.trim()||void 0),f()}catch(le){if(le instanceof He){if(le.payload.backgroundService&&m(le.payload.backgroundService),le.status===403&&le.code==="elevation_required"){w({kind:"elevation",action:B,command:typeof le.payload.command=="string"?le.payload.command:`ezz service ${B}`,shell:typeof le.payload.shell=="string"?le.payload.shell:null,message:typeof le.payload.message=="string"?le.payload.message:null});return}if(le.status===409&&le.code==="not_installed"){w({kind:"install",action:B,command:typeof le.payload.command=="string"?le.payload.command:r?.install.command??"ezz service install",shell:r?.install.shell??null,message:typeof le.payload.message=="string"?le.payload.message:null});return}if(le.status===409&&le.code==="already_running"){n.info("The background service is already running.",typeof le.payload.message=="string"?le.payload.message:void 0),f();return}n.error(`Could not ${B} the background service`,xv(le,"The service manager refused the action.")),f();return}n.error(`Could not ${B} the background service`,le instanceof Error?le.message:"The dashboard could not complete the action.")}finally{z(null)}}},A=(g.data?.apps??[]).filter(B=>!B.managed),U=g.data?.currentUser??null,W=g.data?.pm2Home??null,I=A.filter(B=>gv(B,W)),te=A.filter(B=>!gv(B,W));return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Processes",description:"The Easy DevOps background service, plus every PM2 app you run for yourself.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:g.loading||c,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:E,children:"Refresh"})}),g.error&&!g.data?a.jsx($t,{error:g.error,onRetry:g.reload}):g.data?a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",h?.running?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Hb,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",h&&a.jsx(je,{tone:h.running?"ok":"warn",dot:!0,children:_c(h)}),r?.dev&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications in the background, independent of this dashboard.",actions:h?h.running?a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",size:"sm",loading:k==="stop",disabled:k!==null,icon:a.jsx(Kh,{className:"size-3","aria-hidden":"true"}),onClick:()=>void X("stop"),children:"Stop"}),a.jsx(ae,{variant:"secondary",size:"sm",loading:k==="restart",disabled:k!==null,icon:a.jsx(Vh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void X("restart"),children:"Restart"})]}):a.jsx(ae,{variant:"primary",size:"sm",loading:k==="start",disabled:k!==null,icon:a.jsx(Hr,{className:"size-3","aria-hidden":"true"}),onClick:()=>void X("start"),children:"Start"}):void 0}),a.jsxs(xn,{className:"space-y-4",children:[T&&a.jsxs(ve,{tone:"warning",title:T.kind==="install"?"The background service is not installed":`${T.action==="start"?"Starting":T.action==="stop"?"Stopping":"Restarting"} needs ${T.shell??"a terminal with extra rights"}`,action:a.jsx(ct,{label:"Dismiss",size:"sm",onClick:()=>w(null),children:a.jsx(Ms,{className:"size-3.5","aria-hidden":"true"})}),children:[T.message&&a.jsx("p",{children:T.message}),a.jsxs("div",{className:"mt-2 rounded-md border border-line bg-canvas p-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("code",{className:"break-all font-mono text-xs text-ink",children:T.command}),a.jsx(qt,{value:T.command,label:"Copy command",withText:!0})]}),T.shell&&a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["Run it in ",T.shell,"."]})]}),a.jsx("p",{className:"mt-2 text-2xs text-faint",children:T.kind==="elevation"?"The dashboard cannot elevate itself or ask for a password. Run the command in a terminal you control.":"The command is run in a terminal, not from this dashboard."})]}),d&&!r?a.jsx($t,{error:d,title:"Could not read the service state",onRetry:f,className:"border-0"}):h?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-5 sm:grid-cols-4",children:[a.jsx(zs,{label:"Status",value:_c(h),tone:h.running?"text-ok":"text-warn",detail:h.stoppedByUser&&h.stoppedAtLabel?`Stopped ${h.stoppedAtLabel}`:h.detail??void 0}),a.jsx(zs,{label:"PID",value:h.pid===null?"—":String(h.pid)}),a.jsx(zs,{label:"Uptime",value:eu(h.uptimeMs)}),a.jsx(zs,{label:"Installed",value:h.installed?"Yes":"No"}),a.jsx(zs,{label:"Mode",value:h.mechanismLabel,detail:h.mechanismDetail}),a.jsx(zs,{label:"Starts",value:h.startsAtLabel}),a.jsx(zs,{label:"Monitoring runs in",value:h.jobsOwnerLabel}),a.jsx(zs,{label:"Live channel",value:h.connected?"Connected":"Not connected"})]}),a.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 text-2xs text-faint",children:[a.jsxs("span",{className:"min-w-0",children:["Data directory"," ",a.jsx("code",{className:"break-all font-mono text-muted",children:r?.dataDir??"—"})]}),h.version&&a.jsxs("span",{children:["Daemon ",a.jsx("code",{className:"font-mono text-muted",children:h.version})]})]}),h.runtime?a.jsx(gC,{runtime:h.runtime}):r?.probes?.pending?a.jsxs("p",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(_s,{}),"Measuring the Node runtime…"]}):a.jsx("p",{className:"text-2xs text-faint",children:"The service and system Node versions are not available for this install."}),h.warnings.map(B=>a.jsx(ve,{tone:"warning",children:a.jsx("span",{className:"whitespace-pre-line",children:B})},B)),!h.running&&a.jsx(ve,{tone:"warning",title:h.stoppedByUser?"The background service is stopped":h.installed?"The background service is not running":"The background service is not set up",children:h.stoppedByUser?a.jsxs(a.Fragment,{children:["You stopped it",h.stoppedAtLabel?` on ${h.stoppedAtLabel}`:"",". Monitoring and notifications are paused until it starts again"," ",h.startsAt==="logon"?"at your next logon":h.startsAt==="boot"?"at the next boot":"when the service starts",". Use Start above, or run"," ",a.jsx("code",{className:"font-mono",children:"ezz service start"}),"."]}):h.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx("code",{className:"font-mono",children:"ezz service start"}),", or use Start above."]}):a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Set up the service with"," ",a.jsx("code",{className:"font-mono",children:h.installCommand}),"."]})}),a.jsxs("details",{className:"rounded-md border border-line bg-canvas/40 px-3.5 py-3",children:[a.jsx("summary",{className:"cursor-pointer select-none text-xs font-medium text-ink",children:"Install or repair the service"}),a.jsxs("div",{className:"mt-3 space-y-2.5",children:[a.jsx(xC,{command:h.installCommand,guidance:h.installGuidance}),a.jsxs("p",{className:"text-2xs text-faint",children:["The command is run in a terminal, not from this dashboard."," ",h.startsAt==="logon"?"It starts the service at logon.":h.startsAt==="boot"?"It starts the service at boot.":"It sets the service up to start automatically."," ","It never asks for an account password."]})]})]})]}):a.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted",children:[a.jsx(_s,{}),"Checking the background service…"]})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Your PM2 apps",te.length>0&&a.jsx(je,{tone:"neutral",children:$n(te.length,"app")})]}),description:U?`Apps PM2 is supervising for ${U}. Easy DevOps itself is not one of them.`:"Apps PM2 is supervising for you. Easy DevOps itself is not one of them.",actions:te.length>0||I.length>0?a.jsx(bC,{view:R,onChange:O}):void 0}),g.data.pm2.installed&&g.data.hint&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ve,{tone:"warning",children:g.data.hint})}),g.error&&a.jsxs("div",{className:"border-b border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["Showing the last known list. ",g.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:g.reload,children:"Try again"})]}),g.data.pm2.installed?te.length===0?a.jsx(ga,{icon:a.jsx(Er,{className:"size-5","aria-hidden":"true"}),title:"No PM2 apps of your own",description:"Start an app with PM2 and it will appear here. Easy DevOps does not run itself under PM2."}):a.jsx("div",{className:"panel-enter",children:R==="table"?a.jsx(bv,{apps:te,isModule:!1,busy:v,currentUser:U,onAction:M,onLogs:j}):a.jsx("ul",{className:"divide-y divide-line/70",children:te.map(B=>a.jsx(vv,{app:B,isModule:!1,busy:v,currentUser:U,onAction:M,onLogs:j},`${B.name}-${B.pmId??"x"}`))})},R):a.jsx(ga,{icon:a.jsx(Er,{className:"size-5","aria-hidden":"true"}),title:"PM2 is not installed",description:"PM2 is optional. It is only for apps you run yourself; Easy DevOps uses its own background service."})]}),I.length>0&&a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["PM2 modules",a.jsx(je,{tone:"neutral",children:$n(I.length,"module")})]}),description:"Modules extend PM2 itself and are not your apps. Stopping pm2-logrotate lets PM2 logs grow without limit."}),a.jsx("div",{className:"panel-enter",children:R==="table"?a.jsx(bv,{apps:I,isModule:!0,busy:v,currentUser:U,onAction:M,onLogs:j}):a.jsx("ul",{className:"divide-y divide-line/70",children:I.map(B=>a.jsx(vv,{app:B,isModule:!0,busy:v,currentUser:U,onAction:M,onLogs:j},`${B.name}-${B.pmId??"x"}`))})},R)]})]}):a.jsxs(ns,{children:[a.jsx(tt,{className:"h-56 rounded-lg"}),a.jsx(tt,{className:"h-72 rounded-lg"})]}),x&&a.jsx(yC,{app:x,onClose:()=>j(null)})]})}function wC(n){return n?!/^[a-z0-9][a-z0-9-]{0,39}$/.test(n)||n.endsWith("-")?"Lower-case letters, digits and dashes, up to 40 characters.":null:"A name is required."}function SC(n){return/^ssh:\/\//.test(n)||/^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+:/.test(n)}function h0(n){if(!n)return null;const i=/^https?:\/\/github\.com\/([^/]+)\/([^/#?]+?)(?:\.git)?\/?$/i.exec(n.trim()),r=/^[A-Za-z0-9._-]+@github\.com:([^/]+)\/(.+?)(?:\.git)?$/i.exec(n.trim()),c=/^ssh:\/\/(?:[A-Za-z0-9._-]+@)?github\.com(?::\d+)?\/([^/]+)\/(.+?)(?:\.git)?$/i.exec(n.trim()),d=i??r??c;return d?`https://github.com/${d[1]}/${d[2]}/settings/keys/new`:null}function kC(n){const i={},r=n.split(/\r?\n/);for(let c=0;c<r.length;c++){const d=r[c];if(!d.trim()||d.trim().startsWith("#"))continue;const f=d.indexOf("=");if(f===-1)return{env:i,error:`Line ${c+1}: expected NAME=value.`};const m=d.slice(0,f).trim().replace(/^export\s+/,"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(m))return{env:i,error:`Line ${c+1}: "${m}" is not a valid variable name.`};let h=d.slice(f+1).trim();h.length>=2&&(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))&&(h=h.slice(1,-1)),i[m]=h}return{env:i,error:null}}function TC(n){return Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join(`
|
|
517
|
-
`)}let jv=0;function CC(){return jv+=1,`step-${jv}`}function m0(n){return n.map(i=>({key:CC(),run:i.run,kind:i.kind,enabled:i.enabled!==!1}))}function EC(n){return n.filter(i=>i.run.trim()).map(i=>({run:i.run.trim(),kind:i.kind,enabled:i.enabled!==!1}))}function RC(n){if(Array.isArray(n.steps))return n.steps.map(r=>({run:r.run,kind:r.kind,enabled:r.enabled!==!1}));const i=[];for(const r of["install","build","migrate"]){const c=n[r];if(typeof c=="string"&&c.trim()){i.push({run:c.trim(),kind:r,enabled:!0});continue}for(const d of Array.isArray(c)?c:[])d.trim()&&i.push({run:d,kind:r,enabled:!0})}return i}function zC(n){return n.steps!==void 0||n.install!==void 0||n.build!==void 0||n.migrate!==void 0}const jc=5,p0=[{value:"install",label:"Install"},{value:"build",label:"Build"},{value:"migrate",label:"Migrate"},{value:"custom",label:"Custom"}];function DC(n){const i={};n.forEach((d,f)=>{d.enabled!==!1&&i[d.kind]===void 0&&(i[d.kind]=f)});const r=[],c=(d,f,m)=>{const h=i[d],g=i[f];h!==void 0&&g!==void 0&&h<g&&r.push(m)};return c("migrate","install",'The "migrate" step is listed before "install", but dependencies are not installed yet. Put "install" before "migrate".'),c("build","install",'The "build" step is listed before "install", but dependencies are not installed yet. Put "install" before "build".'),c("migrate","build",'The "migrate" step is listed before "build". Build first, then migrate, so the migration runs against the release that is about to start.'),r}function Nv(n){return n.startsWith('The "')}const lu=[{id:"node",label:"Default Node app",description:"npm ci, then npm start",start:"npm start",steps:[{run:"npm ci",kind:"install",enabled:!0}]},{id:"next",label:"Next.js",description:"npm ci and npm run build, then npm start",start:"npm start",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]},{id:"nest",label:"NestJS",description:"npm ci and npm run build, then node dist/main.js",start:"node dist/main.js",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]},{id:"express",label:"Express / Fastify",description:"npm ci, then node server.js",start:"node server.js",steps:[{run:"npm ci",kind:"install",enabled:!0}]},{id:"nuxt",label:"Nuxt",description:"npm ci and npm run build, then the Node server",start:"node .output/server/index.mjs",steps:[{run:"npm ci",kind:"install",enabled:!0},{run:"npm run build",kind:"build",enabled:!0}]}];function AC(n){return[...n.steps,{run:"npm run lint",kind:"custom",enabled:!1},{run:"npx prisma migrate deploy",kind:"migrate",enabled:!1}]}function x0(n,i){return{steps:m0(RC(n)),start:n.start??"",runtime:n.runtime??"node",port:n.port?String(n.port):"",healthPath:n.healthPath??"",persist:Array.isArray(n.persist)?[...n.persist]:n.persist?[n.persist]:[],execMode:n.execMode??i?.execMode??"fork",instances:n.instances!==void 0?String(n.instances):i?.instances!==void 0?String(i.instances):"",stepsOverride:zC(n),startOverride:n.start!==void 0,runtimeOverride:n.runtime!==void 0,execModeOverride:n.execMode!==void 0,instancesOverride:n.instances!==void 0}}function OC(n){const i=n.trim(),r=i.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!r)return{path:null,error:"Enter a folder or file path."};if(r.length>200)return{path:null,error:`"${i}" is longer than 200 characters.`};if(r.startsWith("/")||/^[A-Za-z]:/.test(r))return{path:null,error:`"${i}" must be relative to the project folder.`};const c=r.split("/");return c.some(d=>d===""||d==="."||d==="..")?{path:null,error:`"${i}" must be a relative path without "." or "..".`}:c.includes(".git")?{path:null,error:`"${i}" cannot be ".git".`}:c.includes("node_modules")?{path:null,error:`"${i}" cannot include node_modules.`}:/[<>:"|?*]/.test(r)?{path:null,error:`"${i}" contains characters that are not allowed.`}:{path:r,error:null}}function MC(n,i){const r=OC(n);if(r.error||!r.path)return r;const c=r.path;if(i.includes(c))return{path:null,error:`"${c}" is already listed.`};if(i.length>=20)return{path:null,error:"Use at most 20 paths."};const d=c.toLowerCase();for(const f of i){const m=f.toLowerCase();if(m.startsWith(`${d}/`))return{path:null,error:`"${c}" contains "${f}" — keep only "${c}".`};if(d.startsWith(`${m}/`))return{path:null,error:`"${c}" is inside "${f}" — keep only "${f}".`}}return{path:c,error:null}}function _C(n){const i={};if(n.stepsOverride&&(i.steps=EC(n.steps)),n.startOverride&&n.start.trim()&&(i.start=n.start.trim()),n.runtimeOverride&&(i.runtime=n.runtime),n.port.trim()&&(i.port=Number(n.port)),n.healthPath.trim()&&(i.healthPath=n.healthPath.trim()),n.persist.length>0&&(i.persist=[...n.persist]),n.execModeOverride&&(i.execMode=n.execMode),n.instancesOverride){const r=n.instances.trim();r==="max"?i.instances="max":r&&Number.isInteger(Number(r))&&Number(r)>=1&&(i.instances=Number(r))}return i}const wv="Cluster mode runs several copies of the app; it must be stateless (no in-memory sessions, sockets, caches or schedulers that assume one process).";function LC(n){const i=n.trim();return i?/^node\s+(?!-)\S+$/.test(i):null}function Bc(n){if(!n.execMode)return null;const i=n.execMode==="cluster"?"Cluster":"Fork",r=n.instancesOnline??0;if(n.instances==="max")return`${i} · ${r} online (max)`;const c=n.instances??1;return`${i} · ${r}/${c} online`}const g0={running:{label:"Deploying",tone:"info"},success:{label:"Succeeded",tone:"ok"},failed:{label:"Failed",tone:"bad"},rolled_back:{label:"Rolled back",tone:"warn"}},UC={fetch:"Fetching the code",settings:"Reading project settings",pre:"Pre-deploy hook",install:"Installing",build:"Building",migrate:"Running migrations",start:"Starting",health:"Health check",post:"Post-deploy hook",finish:"Finishing",done:"Done"};function iu(n){return UC[n]??n}const eh=["fetch","settings","pre","install","build","migrate","start","health","post","finish"];function HC(n){const i=n.status==="success"||n.step==="done",r=n.status==="failed"||n.status==="rolled_back",c=eh.indexOf(n.step),d=i?eh.length:c===-1?0:c;return eh.map((f,m)=>i||m<d?{step:f,state:"done"}:m>d?{step:f,state:"pending"}:{step:f,state:r?"failed":"active"})}function BC(n){return n===!0?{tone:"ok",text:"The new release crashed at boot. The previous release was started again and is serving."}:n===!1?{tone:"bad",text:"The automatic rollback could not verify the previous release. The app may be down — check it on the server."}:{tone:"neutral",text:"No automatic rollback was attempted: this was the first release, or automatic rollback is switched off. The failed release was stopped."}}const $C={manual:"Dashboard",webhook:"GitHub Actions",hub:"Hub",rollback:"Rollback"};function zr(n){return n?n.slice(0,7):"—"}function qC(n){const i=n.finishedAt??Date.now(),r=Math.max(0,Math.round((i-n.startedAt)/1e3));return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}function GC(n){return n==="online"?"ok":n==="errored"?"bad":n==="stopped"||n==="stopping"?"warn":"neutral"}function YC(n){const i=(m,h)=>m===!1?!1:Array.isArray(m)?m.length===0?!1:m.length===1?m[0]:m:m&&m.trim()?m:h,r={};if(n.steps!==void 0)r.steps=n.steps.map(m=>({run:m.run,kind:m.kind,...m.enabled===!1?{enabled:!1}:{}}));else{r.install=i(n.install,"npm ci"),r.build=i(n.build,"npm run build");const m=i(n.migrate,"");m&&m!==""&&(r.migrate=m)}r.start=n.start?.trim()||"npm start",r.runtime=n.runtime??"node",r.port=n.port??3e3,r.health=n.healthPath?.trim()||"/";const c=Array.isArray(n.persist)?n.persist:n.persist?.trim()?[n.persist.trim()]:[];c.length>0&&(r.persist=c),n.execMode&&(r.execMode=n.execMode),n.instances!==void 0&&(r.instances=n.instances);const d=i(n.pre,""),f=i(n.post,"");return(d&&d!==""||f&&f!=="")&&(r.hooks={...d&&d!==""?{pre:d}:{},...f&&f!==""?{post:f}:{}}),`${JSON.stringify(r,null,2)}
|
|
518
|
-
`}const VC=`${JSON.stringify({install:"pip install -r requirements.txt",build:!1,start:"python app.py",port:8e3,health:"/health"},null,2)}
|
|
519
|
-
`,XC=[{name:"steps",meaning:"An ordered list of at most 5 steps, each { run, kind, enabled? }, where kind is install, build, migrate or custom. One field: it replaces the list below, and [] clears it. Disabled steps are skipped.",without:"the equivalent install/build/migrate list below"},{name:"runtime",meaning:'The runtime. "node" is the only one today; cluster mode is Node-only.',without:'"node"'},{name:"install",meaning:"Old format: a command, a list of commands, or false to skip. Read as an install step.",without:"npm ci (yarn and pnpm are detected from the lockfile)"},{name:"build",meaning:"Old format: run after install. Same forms. Read as a build step.",without:'the "build" script, if package.json has one'},{name:"migrate",meaning:"Old format: run after build, before the new release starts. Same forms. Forward-only: a rollback does not undo a migration.",without:"nothing is run"},{name:"start",meaning:"The long-running process. One command, any language.",without:'the "start" script, else node <main>'},{name:"execMode",meaning:'"fork" (one process) or "cluster" (one worker per instance). Cluster needs a start command of the form node <file>.',without:'"fork"'},{name:"instances",meaning:'How many copies to run: a whole number up to the CPU count, or "max".',without:"1"},{name:"port",meaning:"The port the app listens on. Passed to it as PORT and used for the health check.",without:"no HTTP check; the process only has to stay up"},{name:"health",meaning:'A path that must answer before the deployment counts: "/healthz", or { "path": "/healthz", "timeout": 60 }.',without:'"/" with a 60-second limit'},{name:"persist",meaning:"Folders or single files your app writes to and you need to keep: uploads, SQLite data, logs. A folder is usually the right unit — SQLite creates -wal and -shm files next to its database; list a file only when that file is all there is.",without:"nothing is kept; each deployment starts from the repository"},{name:"hooks.pre",meaning:"Run before install — check the environment, fetch something.",without:"nothing"},{name:"hooks.post",meaning:"Run once the new release is live — warm a cache, notify someone. A failure is a warning; the release stays.",without:"nothing"}];function KC({items:n,value:i,onChange:r,ariaLabel:c,className:d}){const f=p.useRef(new Map),m=g=>{const v=n[g];v&&(r(v.id),f.current.get(v.id)?.focus())},h=(g,v)=>{g.key==="ArrowRight"?(g.preventDefault(),m((v+1)%n.length)):g.key==="ArrowLeft"?(g.preventDefault(),m((v-1+n.length)%n.length)):g.key==="Home"?(g.preventDefault(),m(0)):g.key==="End"&&(g.preventDefault(),m(n.length-1))};return a.jsx("div",{role:"tablist","aria-label":c,className:oe("flex gap-1 overflow-x-auto border-b border-line",d),children:n.map((g,v)=>{const b=g.id===i;return a.jsxs("button",{ref:x=>{x?f.current.set(g.id,x):f.current.delete(g.id)},id:`tab-${g.id}`,role:"tab",type:"button","aria-selected":b,"aria-controls":`panel-${g.id}`,tabIndex:b?0:-1,onClick:()=>r(g.id),onKeyDown:x=>h(x,v),className:oe("relative -mb-px flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2.5 text-sm font-medium transition-colors duration-[var(--ez-motion-fast)]",b?"border-accent text-ink":"border-transparent text-muted hover:border-line-strong hover:text-ink"),children:[g.label,g.count!==void 0&&a.jsx("span",{className:oe("rounded-pill px-1.5 py-0.5 text-2xs",b?"bg-accent-soft text-accent-text":"bg-inset text-faint"),children:g.count})]},g.id)})})}function br({id:n,value:i,children:r}){return n!==i?null:a.jsx("div",{role:"tabpanel",id:`panel-${n}`,"aria-labelledby":`tab-${n}`,className:"page-enter",children:r})}const ZC=/^(\*\.)?[a-z0-9-]+(\.[a-z0-9-]+)+$/,QC="A new wildcard certificate needs DNS validation, which linking does not do. Issue it from the SSL page, then link with an existing certificate.",PC=[{mode:"issue",label:"Issue a new Let's Encrypt certificate",hint:"Over HTTP-01, so the domain must already point here."},{mode:"existing",label:"Use an existing certificate",hint:"A certificate already stored on this server."},{mode:"none",label:"No SSL",hint:"The domain is served over HTTP only."}];function IC({open:n,app:i,meta:r,onClose:c,onLinked:d}){const f=Et(),{connected:m}=vn(),[h]=p.useState(()=>Fh()),g=Jh(h),[v,b]=p.useState(""),[x,j]=p.useState(!1),[k,z]=p.useState("issue"),[T,w]=p.useState(!0),[R,S]=p.useState(!1),[O,E]=p.useState(null),[M,X]=p.useState(!1),[A,U]=p.useState(!1),[W,I]=p.useState(null),[te,B]=p.useState(null),V=v.trim().toLowerCase(),de=V.startsWith("*."),le=ZC.test(V),Q=O?.found===!0?O:null,F=k==="issue"?l0:k==="existing"?i0:HT,L=g.clear,ee=g.byDomain[V]??{},ke=m&&Object.keys(ee).length>0?ee:null,Ne=p.useMemo(()=>te?VT(te,F):null,[te,F]),Ee=W!=null?Uc(W):null,C=Ee?.message??(W instanceof Error?W.message:null)??(W!=null?"Nothing was changed.":null),q=p.useMemo(()=>cl(W)??cl(te),[W,te]);p.useEffect(()=>{n&&(b(""),j(!1),z("issue"),w(!0),S(!1),E(null),U(!1),I(null),B(null),L())},[n,i.id,L]),p.useEffect(()=>{if(!n||k!=="existing"||!le){E(null),X(!1);return}const ie=new AbortController,Pe=setTimeout(()=>{X(!0),fe.domains.sslSuggestion(V,ie.signal).then(Ge=>{ie.signal.aborted||E(Ge)}).catch(()=>{ie.signal.aborted||E(null)}).finally(()=>{ie.signal.aborted||X(!1)})},350);return()=>{clearTimeout(Pe),ie.abort()}},[n,k,V,le]);const Y=Q!==null&&(!de||[Q.certificate.domain,...Q.certificate.names].some(ie=>ie.trim().toLowerCase()===V)),re=de&&k==="issue",ye=!i.settings.port&&!i.currentRelease,Re=le&&!ye&&!A&&!re&&(k!=="existing"||Y),xe=async()=>{if(!(!Re||A)){L(),U(!0),I(null),B(null);try{const ie=await fe.deployments.linkDomain(i.id,{domain:V,www:de?!1:x,ssl:k==="issue"?{mode:"issue"}:k==="existing"&&Q?{mode:"existing",certName:Q.certificate.domain}:{mode:"none"},redirect:k==="none"?void 0:T,behindCloudflare:R,opId:h});B(ie),d(),ie.ssl&&!ie.ssl.ok||(ie.nginxReloaded?f.success("Domain linked",`${ie.domain} now proxies to port ${ie.port}.`):f.warning("Linked, but nginx was not reloaded","Reload nginx for it to take effect."))}catch(ie){I(ie)}finally{U(!1)}}},me=k==="issue"&&A?"Issuing the certificate, this can take a minute":A?"Linking the domain":null;return a.jsx(yn,{open:n,onClose:c,preventClose:A,size:"md",title:i.domain?"Link a different domain":"Link a domain",description:`Point a domain at ${i.id}. nginx proxies it to the app’s port.`,footer:te?a.jsx(ae,{variant:"secondary",onClick:c,children:"Close"}):a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:c,disabled:A,children:"Cancel"}),a.jsx(ae,{variant:"primary",onClick:()=>void xe(),loading:A,disabled:!Re,children:"Link domain"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Me,{label:"Domain name",value:v,onChange:ie=>{b(ie.target.value),B(null),I(null),L()},placeholder:"app.example.com",list:"link-domain-options",hint:V?r.domains.some(ie=>ie.name===V)?"This domain exists. It will be re-pointed at this app.":"This domain will be created.":"Type a new name, or pick one of your domains.",className:"font-mono",spellCheck:!1,autoComplete:"off",disabled:!!te}),a.jsx("datalist",{id:"link-domain-options",children:r.domains.map(ie=>a.jsx("option",{value:ie.name},ie.name))}),a.jsx(pl,{label:"Also serve www",hint:de?"A wildcard already covers the www name.":`Adds www.${V||"example.com"}.`,checked:x,onChange:j,disabled:de||!!te}),a.jsxs("fieldset",{disabled:!!te,children:[a.jsx("legend",{className:"mb-2 text-xs font-medium text-muted",children:"SSL"}),a.jsx("div",{className:"space-y-2",children:PC.map(ie=>{const Pe=!!te||ie.mode==="issue"&&de||ie.mode==="existing"&&!M&&!Y;return a.jsxs("label",{className:oe("flex cursor-pointer items-start gap-2.5 rounded-md border px-3 py-2.5 text-xs",k===ie.mode?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",Pe&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"link-domain-ssl",value:ie.mode,checked:k===ie.mode,disabled:Pe,onChange:()=>z(ie.mode),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-ink",children:[ie.mode!=="none"?a.jsx(Rn,{className:"size-3.5 shrink-0","aria-hidden":"true"}):null,ie.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:ie.mode==="existing"&&!V?"Type the domain name above first.":ie.mode==="existing"&&M?"Looking for a certificate…":ie.mode==="existing"&&le&&!Y?de?"No certificate on this server lists this wildcard name.":"No certificate on this server covers this name.":ie.hint})]})]},ie.mode)})}),de&&k==="issue"?a.jsx("p",{className:"mt-2 text-2xs text-warn",children:QC}):null,k==="issue"&&!de?a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"If issuance fails the domain still works over HTTP; you can issue the certificate later from the SSL page."}):null]}),k==="existing"&&Q&&Y?a.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-soft/30 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:de?`The certificate in ${Q.certificate.domain} lists ${V}`:Q.match==="exact"?`A certificate for ${V} already exists`:Q.match==="wildcard"?`A wildcard certificate covers ${V}`:`The certificate in ${Q.certificate.domain} covers ${V}`}),a.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-muted",children:[a.jsx("span",{className:"font-mono",children:Q.certificate.domain}),a.jsx("span",{children:Q.certificate.daysLeft===null?"expiry unknown":Q.certificate.daysLeft<=0?"expired":`${Q.certificate.daysLeft} days left`})]}),Q.certificate.names.length>1?a.jsxs("p",{className:"mt-1 break-all text-2xs text-faint",children:["covers ",Q.certificate.names.join(", ")]}):null]}):null,k!=="none"&&!te?a.jsx(Zt,{checked:T,onChange:w,label:"Redirect HTTP to HTTPS",description:"Port 80 requests are sent to the HTTPS address.",disabled:!!te}):null,a.jsx(pl,{label:"Behind Cloudflare",hint:"Only when Cloudflare proxies this domain (the orange cloud). The server then reads the visitor’s address from CF-Connecting-IP.",checked:R,onChange:S,disabled:!!te}),ye&&!te?a.jsxs(ve,{tone:"info",children:["The app needs a port first: set one in Edit, or put ",a.jsx("code",{className:"font-mono",children:"port"})," ","in ez.json and deploy once."]}):null,ke?a.jsx(ul,{stages:F,states:ke,ariaLabel:`Linking stages for ${V}`,failure:Ee,timedOut:Ee?.stage==="timeout"}):me?a.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted","aria-live":"polite",children:[a.jsx(gn,{className:"spin mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("span",{children:[me,"."," ",m?"The live stage list appears when the server reports its stages; the result is shown here when it finishes.":"This finishes in one request; the result appears here."]})]}):null,!ke&&Ne?a.jsx(ul,{stages:F,states:Ne,ariaLabel:`Link result stages for ${V}`}):null,q&&a.jsx(Rr,{preflight:q}),W&&!ke&&!Ne?a.jsx(ve,{tone:"danger",title:"The domain was not linked",children:C}):null,te?te.ssl&&!te.ssl.ok?a.jsxs(ve,{tone:"warning",title:"Linked, without a certificate",children:[te.domain," now proxies to port ",te.port,", but the certificate was not issued: ",te.ssl.detail," It works over HTTP until you issue the certificate from the SSL page."]}):a.jsxs(ve,{tone:"success",title:te.created?"Domain created and linked":"Domain linked",children:[te.domain," now proxies to port ",te.port,".",te.ssl?.ok?` ${te.ssl.detail}`:" It is served over HTTP.",te.nginxReloaded?"":" nginx was not reloaded yet; reload it for this to take effect."]}):null]})})}function Th(n,i){return n instanceof He||n instanceof Error?n.message:i}function FC({app:n,onClose:i,onDeleted:r}){const c=Et(),[d,f]=p.useState(!1),[m,h]=p.useState(!1),[g,v]=p.useState(!1);p.useEffect(()=>{n&&(f(!1),h(!1))},[n]);const b=!!(n&&(n.hasSharedData||(Array.isArray(n.settings.persist)?n.settings.persist.length>0:n.settings.persist))),x=async()=>{if(!(!n||g)){v(!0);try{const j=await fe.deployments.remove(n.id,{deleteDomain:d&&!!n.domain,purgeData:m}),k=j.sharedKept&&j.sharedPath?`Persistent data was kept in ${j.sharedPath}.`:"";j.warning?c.warning(`${n.id} deleted`,`${j.warning} ${k}`.trim()):c.success(`${n.id} deleted`,[j.domainDeleted?`${n.domain} was removed too.`:"",k].filter(Boolean).join(" ")||void 0),r()}catch(j){c.error(`Could not delete ${n.id}`,Th(j,"Nothing was changed."))}finally{v(!1)}}};return a.jsx(yn,{open:n!==null,onClose:i,preventClose:g,size:"sm",title:`Delete ${n?.id??""}?`,footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:i,disabled:g,children:"Cancel"}),a.jsx(ae,{variant:"danger",onClick:()=>void x(),loading:g,children:"Delete app"})]}),children:a.jsxs("div",{className:"space-y-4 text-sm text-muted",children:[a.jsx("p",{children:"Its process is stopped and removed from PM2, and every release, log and its deploy key are deleted from this server. The repository is not touched."}),n?.dir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:n.dir}),b&&n&&a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-inset/40 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Persistent data"}),a.jsx("p",{className:"text-xs",children:"Folders this app writes to are kept by default, so a later app with the same name can pick up its database and uploads."}),n.sharedDir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:n.sharedDir}),a.jsx(pl,{label:"Also delete the persistent data",hint:"The shared folders are deleted too and cannot be recovered.",checked:m,onChange:h})]}),n?.domain&&a.jsx(pl,{label:a.jsxs(a.Fragment,{children:["Also delete the domain ",a.jsx("span",{className:"font-mono text-ink",children:n.domain})]}),hint:"Its nginx config is removed and the site stops answering. Leave this off to keep the domain.",checked:d,onChange:f})]})})}function JC({app:n,meta:i,onChanged:r,onDelete:c}){const d=Et(),[f,m]=p.useState(!1),[h,g]=p.useState(""),[v,b]=p.useState(!1),x=n.settings.port??null,j=async()=>{try{await fe.deployments.unlinkDomain(n.id),d.success("Link removed",`${n.domain} is still configured; only the link is gone.`),r()}catch(z){d.error("Could not remove the link",Th(z,"Nothing was changed."))}},k=async()=>{if(!(!h.trim()||v)){b(!0);try{const z=await fe.deployments.move(n.id,h.trim());z.warning?d.warning("Moved",z.warning):d.success("App moved",`${z.to}${z.restarted?" — and started again.":""}`),g(""),r()}catch(z){d.error("Could not move the app",Th(z,"It is still where it was."))}finally{b(!1)}}};return a.jsxs("div",{className:"space-y-7",children:[a.jsxs("section",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(Os,{className:"mt-0.5 size-4 shrink-0 text-muted","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Domain"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Point a domain at this app. nginx proxies it to the app’s port, and a deployment that changes the port takes the domain with it."})]})]}),n.domain?a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-line bg-inset/40 px-3.5 py-2.5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-mono text-sm text-ink",children:n.domain}),a.jsxs("div",{className:"text-2xs text-faint",children:[x?`Proxies to port ${x}.`:"Proxies to the app’s port."," Edit it on the Domains page."]})]}),a.jsx(ae,{size:"sm",icon:a.jsx(GS,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void j(),children:"Remove link"})]}):null,a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ae,{variant:"primary",onClick:()=>m(!0),children:n.domain?"Link a different domain":"Link a domain"}),a.jsx("p",{className:"min-w-0 flex-1 text-xs text-faint",children:"Choose the name, whether www is served too, and the certificate to use."})]}),!x&&!n.currentRelease&&a.jsxs(ve,{tone:"info",children:["The app needs a port first: set one in Edit, or put ",a.jsx("code",{className:"font-mono",children:"port"})," ","in ez.json and deploy once."]})]})]}),a.jsx(IC,{open:f,app:n,meta:i,onClose:()=>m(!1),onLinked:r}),a.jsxs("section",{className:"space-y-3 border-t border-line pt-6",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(kS,{className:"mt-0.5 size-4 shrink-0 text-muted","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Folder"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Where this app’s releases, logs and deploy key live. It stays here even if the deployments folder in Settings changes."}),a.jsx("p",{className:"mt-1.5 break-all font-mono text-2xs text-ink",children:n.dir??"—"})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Me,{label:"Move to",value:h,onChange:z=>g(z.target.value),placeholder:i.deployDir??"/srv/ez_deploys","aria-describedby":"deploy-move-hint",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(ae,{onClick:()=>void k(),loading:v,disabled:!h.trim()||!!n.deploying,children:"Move app"})]}),a.jsx("p",{id:"deploy-move-hint",className:"mt-1.5 text-xs text-faint",children:h.trim()?`The app will be in ${h.trim().replace(/[\\/]+$/,"")}/${n.id}`:"A folder on this server. The app goes into a subfolder named after it."})]}),a.jsx("p",{className:"text-2xs text-faint",children:"The app is stopped, its folder is moved, and it is started again from the new place. To another disk this copies every release, and can take a while."})]}),a.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-line pt-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Delete this app"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Stops it and removes its folder. You are asked what to do with its domain."})]}),a.jsx(ae,{variant:"danger",icon:a.jsx(Us,{className:"size-4","aria-hidden":"true"}),onClick:c,disabled:!!n.deploying,children:"Delete app"})]})]})}function WC(n,i){const r=URL.createObjectURL(new Blob([i],{type:"application/json"})),c=document.createElement("a");c.href=r,c.download=n,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(r)}function e3({app:n,locations:i}){const r=YC(n.settings);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2 text-xs text-muted",children:[a.jsxs("p",{children:[a.jsx("code",{className:"font-mono text-ink",children:"ez.json"})," is an optional file in your repository that says how the project is installed, built and started. Keeping it with the code means the commands are reviewed and versioned like everything else, and a new server needs no setup."]}),a.jsxs("p",{children:[a.jsx("strong",{className:"font-medium text-ink",children:"You do not need one for a Node project"})," — without it, the scripts in ",a.jsx("code",{className:"font-mono",children:"package.json"})," are used. You do need one for any other language."]})]}),a.jsxs("ol",{className:"space-y-5",children:[a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"1. Create the file"}),a.jsxs("p",{className:"text-xs text-muted",children:["This is what ",a.jsx("span",{className:"font-mono",children:n.id})," deploys with today. Change the commands to match your project."]}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:r}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(qt,{value:r,label:"Copy ez.json",withText:!0}),a.jsx(ae,{size:"sm",icon:a.jsx(xh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>WC("ez.json",r),children:"Download ez.json"})]})]}),a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"2. Put it in the repository"}),a.jsxs("p",{className:"text-xs text-muted",children:["At the top of the repository, next to ",a.jsx("code",{className:"font-mono",children:"package.json"}),". It is looked for in this order:"," ",i.map((c,d)=>a.jsxs("span",{children:[a.jsx("code",{className:"font-mono text-ink",children:c}),d<i.length-1?", ":"."]},c))]})]}),a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"3. Commit, push, deploy"}),a.jsxs("p",{className:"text-xs text-muted",children:["The next deployment reads it. Its log shows where each value came from —"," ",a.jsx("code",{className:"font-mono",children:"[ez.json]"}),", ",a.jsx("code",{className:"font-mono",children:"[package.json]"})," ","or ",a.jsx("code",{className:"font-mono",children:"[override]"})," — so you can see that it was picked up."]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-sm font-medium text-ink",children:"What each field means"}),a.jsx("div",{className:"overflow-x-auto rounded-md border border-line",children:a.jsxs("table",{className:"w-full text-left text-2xs",children:[a.jsx("thead",{className:"border-b border-line bg-inset/50 text-faint",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"Field"}),a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"Meaning"}),a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"If you leave it out"})]})}),a.jsx("tbody",{className:"divide-y divide-line",children:XC.map(c=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap px-3 py-2 align-top font-mono text-ink",children:c.name}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:c.meaning}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:c.without})]},c.name))})]})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"Not a Node project?"}),a.jsx("p",{className:"text-xs text-muted",children:"The commands are run exactly as written, so any language works. A Python app:"}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:VC})]}),a.jsxs(ve,{tone:"info",title:"Which one wins",children:["A value set on the app (Edit) overrides ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", which overrides ",a.jsx("code",{className:"font-mono",children:"package.json"}),". To let the file decide, leave that field empty in Edit. A mistake in the file stops the deployment before anything that is running is touched."]})]})}function th(n,i){return n instanceof He||n instanceof Error?n.message:i}function Ch({appId:n,repoUrl:i,publicKey:r,fingerprint:c,createdAt:d,onDisk:f=!1,initialError:m=null,onChanged:h}){const g=Et(),v=rn(),[b,x]=p.useState(r??null),[j,k]=p.useState(c??null),[z,T]=p.useState(d??null),[w,R]=p.useState(null),[S,O]=p.useState(m),[E,M]=p.useState(!1),[X,A]=p.useState(!1),[U,W]=p.useState(!1),[I,te]=p.useState(""),[B,V]=p.useState(null),[de,le]=p.useState(!1),[Q,F]=p.useState(null),L=h0(i),ee=async()=>{if(!(E||!await v({title:"Replace the deploy key?",body:a.jsx(a.Fragment,{children:"The old key stops working here at once. GitHub keeps listing the old public key until you remove it — using “Add it to GitHub for me” afterwards removes the old key with the same title automatically."}),confirmLabel:"Replace the key",tone:"danger"}))){M(!0);try{const Ee=await fe.deployments.generateDeployKey(n);x(Ee.publicKey),k(Ee.fingerprint),T(Ee.createdAt),R(Ee.previousFingerprint??null),O(null),V(null),F(null),g.success("Deploy key replaced","Add the new public key to the repository."),h?.()}catch(Ee){g.error("Could not replace the key",th(Ee,"The old key is unchanged."))}finally{M(!1)}}},ue=async()=>{if(X)return;A(!0),V(null);const Ne=I.trim();try{const Ee=await fe.deployments.addDeployKeyToGithub(n,Ne||void 0);V(Ee),Ee.ok&&g.success("Key added to GitHub","It is read-only.")}catch(Ee){V({ok:!1,error:th(Ee,"GitHub did not accept the key."),steps:void 0})}finally{te(""),A(!1)}},ke=async()=>{if(!de){le(!0),F(null);try{F(await fe.deployments.testDeployKey(n))}catch(Ne){F({ok:!1,status:0,error:th(Ne,"The test could not run.")})}finally{le(!1)}}};return a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ur,{className:"size-4 text-muted","aria-hidden":"true"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:"Deploy key"})]}),a.jsx(ae,{size:"sm",icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void ee(),loading:E,children:b||S?"Regenerate key":"Generate key"})]}),S?a.jsxs(ve,{tone:"danger",title:"The key was not generated",children:[S," Press “Regenerate key” to try again; the app itself was created."]}):null,b?a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[a.jsx("span",{className:"text-2xs font-medium uppercase tracking-[0.12em] text-faint",children:"Public key"}),a.jsx(qt,{value:b,label:"Copy public key",withText:!0})]}),a.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs text-muted",children:b})]}),a.jsxs("p",{className:"break-all font-mono text-2xs text-faint",children:["Fingerprint ",j??"not reported",z?` · created ${new Date(z).toLocaleDateString()}`:""]}),w?a.jsxs("p",{className:"break-all text-2xs text-warn",children:["Replaced ",w,". The old key still needs removing on GitHub."]}):null,f?null:a.jsx("p",{className:"text-2xs text-warn",children:"The private half is not on the server's disk any more; regenerate the key before the next deployment."}),a.jsxs("ol",{className:"list-decimal space-y-1 pl-4 text-xs text-muted",children:[a.jsx("li",{children:"In the repository: Settings → Deploy keys → Add deploy key."}),a.jsx("li",{children:"Paste the key above. The title is up to you."}),a.jsx("li",{children:"Leave “Allow write access” off — deployments only read."})]}),L?a.jsxs("a",{href:L,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-accent-text underline-offset-2 hover:underline",children:[a.jsx(gS,{className:"size-3.5","aria-hidden":"true"}),"Open GitHub's Add deploy key page"]}):null,L?a.jsxs("div",{className:"space-y-2 border-t border-line pt-3",children:[U?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Me,{label:"GitHub token",type:"password",value:I,onChange:Ne=>te(Ne.target.value),hint:"Used once for this request and not stored. It needs Administration: read and write on this repository.",placeholder:"github_pat_…",autoComplete:"off",spellCheck:!1}),a.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[a.jsx(ae,{size:"sm",variant:"secondary",onClick:()=>{te(""),W(!1)},disabled:X,children:"Cancel"}),a.jsx(ae,{size:"sm",onClick:()=>void ue(),loading:X,children:"Add the key"})]})]}):a.jsx(ae,{size:"sm",variant:"secondary",icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>W(!0),disabled:X,children:"Add it to GitHub for me"}),B?a.jsxs("div",{className:"space-y-1.5",children:[(B.steps??[]).map(Ne=>a.jsxs("p",{className:`flex items-start gap-1.5 text-2xs ${Ne.ok?"text-ok":"text-bad"}`,children:[Ne.ok?a.jsx(dl,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}):a.jsx(Ms,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Ne.detail})]},Ne.id)),B.error&&(B.steps??[]).length===0?a.jsx(ve,{tone:"danger",children:B.error}):null]}):null]}):a.jsx("p",{className:"text-2xs text-faint",children:"Automatic setup works with github.com repositories only; for another host, add the key there by hand."}),a.jsxs("div",{className:"space-y-2 border-t border-line pt-3",children:[a.jsx(ae,{size:"sm",variant:"secondary",onClick:()=>void ke(),loading:de,icon:a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),children:"Test connection"}),Q?Q.ok?a.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-ok",children:[a.jsx(dl,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Q.detail??"The key can read the repository."})]}):a.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-bad",children:[a.jsx(Ms,{className:"mt-0.5 size-3 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:Q.error??"The key could not read the repository."})]}):null]})]}):S?null:a.jsx("p",{className:"text-xs text-muted",children:"No key yet. Generate one and add its public half to the repository as a read-only deploy key. The private half stays on this server and is never shown."})]})}function $c(n,i){return n instanceof He||n instanceof Error?n.message:i}const t3={fetch:"Fetch",settings:"Settings",pre:"Pre",install:"Install",build:"Build",migrate:"Migrate",start:"Start",health:"Health",post:"Post",finish:"Finish"},n3={done:"border-ok/30 bg-ok-soft text-ok",active:"border-accent/40 bg-accent-soft text-accent-text",failed:"border-bad/30 bg-bad-soft text-bad",pending:"border-line bg-inset/50 text-faint"};function a3({run:n}){return a.jsx("ol",{className:"flex flex-wrap items-center gap-1","aria-label":"Deployment steps",children:HC(n).map(({step:i,state:r},c)=>a.jsxs("li",{className:"flex items-center gap-1",children:[c>0&&a.jsx("span",{className:"text-2xs text-faint","aria-hidden":"true",children:"›"}),a.jsx("span",{"aria-current":r==="active"?"step":void 0,className:oe("rounded border px-1.5 py-0.5 text-2xs font-medium",n3[r]),children:t3[i]??iu(i)})]},i))})}function s3({run:n}){const i=BC(n.rollbackSucceeded),r=i.tone==="ok"?"text-ok":i.tone==="bad"?"text-bad":"text-muted";return a.jsxs("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-faint",children:"Rollback report"}),a.jsxs("div",{className:"mt-2 space-y-1.5 text-xs text-muted",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-medium text-ink",children:"Reason: "}),n.reason??n.error??"The server did not report a reason."]}),a.jsx("p",{className:r,children:i.text})]}),n.logTail&&n.logTail.length>0&&a.jsxs("div",{className:"mt-2.5",children:[a.jsx("div",{className:"mb-1 text-2xs text-faint",children:"Last lines from the new release (environment values are redacted)"}),a.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs leading-relaxed text-muted","aria-label":"Boot log of the failed release",children:n.logTail.join(`
|
|
520
|
-
`)})]})]})}function l3({appId:n,run:i}){const r=Ct(g=>fe.deployments.run(n,i.id,g),[n,i.id]),c=(r.data?.status??i.status)==="running";hl(r.reload,1500,c);const d=p.useRef(null),f=p.useRef(!0),m=r.data?.log??"";p.useEffect(()=>{const g=d.current;g&&f.current&&(g.scrollTop=g.scrollHeight)},[m]);const h=r.data??i;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsx(a3,{run:h}),h.error&&a.jsxs(ve,{tone:h.status==="rolled_back"?"warning":"danger",title:h.status==="rolled_back"?"The new release was not healthy — the previous one is running again":`Failed while: ${iu(h.step).toLowerCase()}`,children:[h.error,h.status!=="failed"&&h.reason?a.jsx("span",{className:"mt-1 block",children:h.reason}):null]}),h.warnings?.map(g=>a.jsx(ve,{tone:"warning",children:g},g)),h.status==="failed"&&a.jsx(s3,{run:h}),r.error&&!r.data?a.jsx($t,{error:r.error,onRetry:r.reload,title:"Could not load the log"}):a.jsxs("pre",{ref:d,onScroll:g=>{const v=g.currentTarget;f.current=v.scrollHeight-v.scrollTop-v.clientHeight<24},className:"h-[42vh] overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted","aria-label":"Deployment log","aria-busy":c,children:[r.data?.logTruncated&&`… earlier output is not shown …
|
|
521
|
-
`,m||(r.loading?"Loading…":"No output yet.")]})]})}function i3({app:n,initialRunId:i}){const[r,c]=p.useState(i);if(p.useEffect(()=>{n.activeRunId&&c(n.activeRunId)},[n.activeRunId]),n.runs.length===0)return a.jsx(ga,{icon:a.jsx(MS,{className:"size-5","aria-hidden":"true"}),title:"No deployments yet",description:"Press Deploy to build and start this app for the first time."});const d=n.runs.find(f=>f.id===r)??n.runs[0];return a.jsxs("div",{className:"grid gap-4 lg:grid-cols-[17rem_minmax(0,1fr)]",children:[a.jsx("ul",{className:"max-h-[52vh] space-y-1 overflow-y-auto pr-1","aria-label":"Deployments",children:n.runs.map(f=>{const m=g0[f.status],h=f.id===d.id;return a.jsx("li",{children:a.jsxs("button",{type:"button",onClick:()=>c(f.id),"aria-current":h?"true":void 0,className:oe("w-full rounded-md border px-3 py-2 text-left transition-colors duration-[var(--ez-motion-fast)]",h?"border-accent/40 bg-accent-soft":"border-transparent hover:bg-inset"),children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(je,{tone:m.tone,dot:!0,children:f.status==="running"?iu(f.step):m.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:zr(f.sha)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 text-2xs text-muted",children:[a.jsx("span",{children:$C[f.trigger]??f.trigger}),a.jsxs("span",{title:Qh(f.startedAt),children:[$r(f.startedAt)," · ",qC(f)]})]})]})},f.id)})}),a.jsx(l3,{appId:n.id,run:d},d.id)]})}function r3({app:n,onRollback:i,onDelete:r,deleting:c,busy:d}){return n.releases.length===0?a.jsx(ga,{title:"No releases on disk",description:"Each successful deployment leaves a release here to roll back to."}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"text-xs text-muted",children:["A rollback starts an earlier release exactly as it was built — nothing is fetched or rebuilt. The newest ",n.keepReleases," are kept."]}),a.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:n.releases.map(f=>a.jsxs("li",{className:"flex flex-wrap items-center gap-3 px-3.5 py-2.5",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs text-ink",children:f.id}),f.current&&a.jsx(je,{tone:"ok",children:"Live"}),f.previous&&a.jsx(je,{tone:"neutral",children:"Previous"})]}),a.jsxs("div",{className:"mt-0.5 font-mono text-2xs text-faint",children:[zr(f.sha),f.ref?` · ${f.ref}`:"",f.execMode?` · ${f.execMode==="cluster"?`Cluster ×${f.instances??"?"}`:"Fork"}`:""]})]}),!f.current&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ae,{size:"sm",icon:a.jsx(mk,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>i(f),disabled:d||!f.startable,title:f.startable?void 0:"This release never got as far as starting.",children:"Roll back to this"}),a.jsx(ae,{variant:"dangerGhost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>r(f),loading:c===f.id,disabled:d||f.previous,title:f.previous?"An automatic rollback would return to this release. Delete it after the next deployment.":`Delete the files of release ${f.id}`,children:"Delete"})]})]},f.id))})]})}function Nc({n,title:i,children:r}){return a.jsxs("li",{className:"flex gap-3",children:[a.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-pill bg-inset font-mono text-2xs font-semibold text-muted","aria-hidden":"true",children:n}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:i}),r]})]})}function Sv({name:n,value:i,note:r}){return a.jsxs("div",{className:"rounded-md border border-line bg-inset/50 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("code",{className:"font-mono text-xs font-semibold text-ink",children:n}),a.jsx(qt,{value:n,label:`Copy the name ${n}`})]}),i?a.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs text-muted",children:i}),a.jsx(qt,{value:i,label:`Copy the value of ${n}`,withText:!0})]}):r&&a.jsx("p",{className:"mt-1.5 text-2xs text-faint",children:r})]})}function o3({app:n,hook:i,onConfigureHook:r,onChanged:c}){const d=Et(),f=rn(),m=Ct(V=>fe.deployments.github(n.id,V),[n.id,i.enabled,i.domain,i.bind,i.port,n.branch]),[h,g]=p.useState(null),[v,b]=p.useState(!1),[x,j]=p.useState(null),[k,z]=p.useState(""),[T,w]=p.useState(!1),[R,S]=p.useState(null),O=async()=>{if(!v&&!(n.hook.hasToken&&!await f({title:"Replace the deploy token?",body:"The current token stops working immediately. The repository’s EZ_DEPLOY_TOKEN secret has to be updated before the next push can deploy.",confirmLabel:"Replace token",tone:"danger"}))){b(!0);try{const V=await fe.deployments.issueHookToken(n.id);g(V.token),c()}catch(V){d.error("Could not create the token",$c(V,"Try again."))}finally{b(!1)}}};if(m.error&&!m.data)return a.jsx($t,{error:m.error,onRetry:m.reload});if(!m.data)return a.jsx(tt,{className:"h-64 rounded-lg"});const E=m.data,M=n.hook.hasToken||h!==null,X=E.targets??[{id:"hook",label:"This server’s deploy hook",url:E.hookUrl,secure:E.hookSecure,note:E.hookNote}],A=V=>!!V.url&&(V.id!=="hub"||V.ready!==!1),U=X.find(V=>V.id===x)??X.find(A)??X[0],W=A(U),I=/github\.com[:/]/.test(n.repoUrl),te=n.authType==="deployKey"?1:0,B=async()=>{if(!T&&!(n.hook.hasToken&&!await f({title:"Set up GitHub automatically?",body:"A new deploy token is created and stored straight into the repository’s secrets; the current one stops working. The workflow file is committed to the branch, which starts a deployment.",confirmLabel:"Set up",tone:"accent"}))){w(!0),S(null);try{const V=await fe.deployments.applyGithub(n.id,{target:U.id,...k.trim()?{token:k.trim()}:{}});S(V),z(""),g(null),c(),V.ok?d.success("GitHub is set up",`${V.repo} deploys on every push to ${n.branch}.`):d.warning("Partly set up","Some steps need a token with more access. They are listed below.")}catch(V){const de=V instanceof He?V.payload:null;de&&Array.isArray(de.steps)&&S(de),d.error("Could not set up GitHub",$c(V,"Nothing was changed on GitHub."))}finally{w(!1)}}};return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"How it works"}),a.jsxs("ol",{className:"mt-2 list-decimal space-y-1 pl-4 text-xs text-muted",children:[a.jsxs("li",{children:["You push to ",a.jsx("code",{className:"font-mono text-ink",children:n.branch}),"."]}),a.jsx("li",{children:"GitHub runs the workflow file in your repository. It makes one request: “deploy this commit”, with the app’s deploy token."}),a.jsx("li",{children:"This server fetches that commit, builds it and starts it — the same steps as the Deploy button, with the log in the Deployments tab."}),a.jsx("li",{children:"The workflow waits for the result. A green check means the new version is live; a red one means it failed, and the previous version is still running."})]}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"GitHub never gets access to the server: it holds a URL and a token that can start a deployment of this one app, and nothing else."})]}),X.length>1&&a.jsx(pa,{label:"How GitHub reaches this server",value:U.id,onChange:V=>j(V.target.value),hint:U.note,children:X.map(V=>a.jsxs("option",{value:V.id,children:[V.label,A(V)?"":" — not available yet"]},V.id))}),W?!U.secure&&a.jsx(ve,{tone:"warning",title:"The deploy token would be sent unencrypted",action:U.id==="hook"?a.jsx(ae,{size:"sm",onClick:r,children:"Change"}):void 0,children:U.note}):a.jsx(ve,{tone:"warning",title:U.id==="hub"?"Not available through the Hub yet":"GitHub cannot reach this server yet",action:U.id==="hook"?a.jsx(ae,{size:"sm",onClick:r,children:"Set up the deploy hook"}):void 0,children:U.note}),I&&a.jsx("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(Zk,{className:"mt-0.5 size-4 shrink-0 text-accent-text","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"Do it for me"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Stores both secrets, commits the workflow file",n.authType==="deployKey"?" and adds the deploy key":"",". Needs a GitHub token that may write this repository’s ",a.jsx("em",{children:"secrets"}),", ",a.jsx("em",{children:"contents"})," and"," ",a.jsx("em",{children:"workflows"}),n.authType==="deployKey"?", and administer it (for the deploy key)":"",". A token typed here is used once and not stored."]})]}),a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Me,{label:"GitHub token",optional:n.authType==="token"&&n.hasToken,type:"password",value:k,onChange:V=>z(V.target.value),placeholder:n.authType==="token"&&n.hasToken?"leave empty to try the app’s token":"github_pat_…",autoComplete:"off",spellCheck:!1,className:"min-w-56 flex-1"}),a.jsx(ae,{variant:"primary",onClick:()=>void B(),loading:T,disabled:!W||!k.trim()&&!(n.authType==="token"&&n.hasToken),children:"Set up on GitHub"})]}),R&&a.jsxs("ul",{className:"space-y-1.5","aria-label":"Setup result",children:[R.error&&a.jsxs("li",{className:"flex items-start gap-2 text-xs text-bad",children:[a.jsx(Tr,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:R.error})]}),R.steps.map(V=>a.jsxs("li",{className:oe("flex items-start gap-2 text-xs",V.ok?"text-muted":"text-bad"),children:[V.ok?a.jsx(ts,{className:"mt-0.5 size-3.5 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Tr,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:V.detail})]},V.id))]})]})]})}),a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-faint",children:I?"Or by hand":"Steps"}),a.jsxs("ol",{className:"space-y-5",children:[n.authType==="deployKey"?a.jsx(Nc,{n:1,title:"Let this server read the repository",children:a.jsx(Ch,{appId:n.id,repoUrl:n.repoUrl,publicKey:n.deployKey,fingerprint:n.deployKeyFingerprint??null,createdAt:n.deployKeyCreatedAt??null,onDisk:n.deployKeyOnDisk??!!n.deployKey,onChanged:()=>{m.reload(),c()}})}):null,a.jsxs(Nc,{n:te+1,title:"Create the deploy token",children:[a.jsx("p",{className:"text-xs text-muted",children:"It can start a deployment of this app and nothing else. Only a hash of it is stored here, so it is shown once."}),h?a.jsx(ve,{tone:"success",title:"Copy it now — it will not be shown again",children:a.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs",children:h}),a.jsx(qt,{value:h,label:"Copy the deploy token",withText:!0})]})}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx(ae,{size:"sm",icon:a.jsx(Ur,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void O(),loading:v,children:n.hook.hasToken?"Replace the token":"Create token"}),n.hook.hasToken&&a.jsxs("span",{className:"text-2xs text-faint",children:["One exists, ending in"," ",a.jsx("code",{className:"font-mono",children:n.hook.tokenHint}),n.hook.createdAt?`, created ${Qh(n.hook.createdAt)}`:"","."]})]})]}),a.jsxs(Nc,{n:te+2,title:"Add two repository secrets",children:[a.jsx("p",{className:"text-xs text-muted",children:"In the repository: Settings → Secrets and variables → Actions → New repository secret."}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Sv,{name:"EZ_DEPLOY_URL",value:W?U.url:null,note:"Available once GitHub can reach this server (see above)."}),a.jsx(Sv,{name:"EZ_DEPLOY_TOKEN",value:h,note:M?"The token from the step above. If you no longer have it, replace it.":"Create the token in the step above first."})]})]}),a.jsxs(Nc,{n:te+3,title:"Add the workflow file",children:[a.jsxs("p",{className:"text-xs text-muted",children:["Commit this to the repository as"," ",a.jsx("code",{className:"break-all font-mono text-ink",children:E.workflowPath}),". It contains no secrets, and it is the same file whichever way GitHub reaches the server."]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(qt,{value:E.workflowPath,label:"Copy the file path",withText:!0}),a.jsx(qt,{value:E.workflow,label:"Copy the workflow",withText:!0})]}),a.jsx("pre",{className:"max-h-64 overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted",children:E.workflow})]})]}),a.jsxs(ve,{tone:"info",title:"Optional: ez.json",children:["To keep the install, build and start commands with the code, add an"," ",a.jsx("code",{className:"font-mono",children:"ez.json"})," to the repository. Without one, a Node project is deployed from its ",a.jsx("code",{className:"font-mono",children:"package.json"})," scripts."]})]})}function c3({appId:n,hook:i,meta:r,initialTab:c="activity",onClose:d,onConfigureHook:f,onChanged:m,onDelete:h}){const g=Et(),v=rn(),b=n!==null,[x,j]=p.useState(c),[k,z]=p.useState(!1),[T,w]=p.useState(null),R=Ct(M=>fe.deployments.get(n??"",M),[n],{enabled:b}),S=R.data&&R.data.id===n?R.data:null;p.useEffect(()=>{b&&j(c)},[b,n,c]),hl(R.reload,2e3,b&&!!S?.deploying),hl(R.reload,8e3,b&&!!S&&!S?.deploying);const O=async M=>{if(!(!S||k||!await v({title:`Roll back ${S.id}?`,body:`Release ${M.id} (${zr(M.sha)}) will be started in place of the live one. The app restarts.`,confirmLabel:"Roll back",tone:"danger"}))){z(!0);try{await fe.deployments.rollback(S.id,M.id),g.info("Rollback started"),j("activity"),R.reload(),m()}catch(A){g.error("Could not roll back",$c(A,"Nothing was changed."))}finally{z(!1)}}},E=async M=>{if(!(!S||k||T||!await v({title:`Delete release ${M.id}?`,body:`Its files (${zr(M.sha)}) are removed from this server. The deployment log stays. The live release and the one an automatic rollback would return to cannot be deleted.`,confirmLabel:"Delete release",tone:"danger"}))){w(M.id);try{await fe.deployments.removeRelease(S.id,M.id),g.success("Release deleted"),R.reload(),m()}catch(A){g.error("Could not delete the release",$c(A,"Nothing was changed."))}finally{w(null)}}};return a.jsx(yn,{open:b,onClose:d,size:"xl",title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("span",{className:"font-mono",children:n}),S&&Bc(S)&&a.jsx(je,{tone:"neutral",children:Bc(S)}),S?.deploying&&a.jsx(je,{tone:"info",dot:!0,children:"Deploying"})]}),description:S?`${S.repoUrl} · ${S.branch}`:void 0,children:R.error&&!S?a.jsx($t,{error:R.error,onRetry:R.reload}):S?a.jsxs("div",{className:"space-y-4",children:[S.warnings?.map(M=>a.jsx(ve,{tone:"warning",children:M},M)),a.jsx(KC,{ariaLabel:"App sections",value:x,onChange:j,items:[{id:"activity",label:"Deployments",count:S.runs.length},{id:"releases",label:"Releases",count:S.releases.length},{id:"setup",label:"Domain & folder"},{id:"github",label:"GitHub Actions"},{id:"ezjson",label:"ez.json"}]}),a.jsx(br,{id:"activity",value:x,children:a.jsx(i3,{app:S,initialRunId:S.activeRunId??null})}),a.jsx(br,{id:"releases",value:x,children:a.jsx(r3,{app:S,onRollback:M=>void O(M),onDelete:M=>void E(M),deleting:T,busy:k||!!S.deploying})}),a.jsx(br,{id:"setup",value:x,children:a.jsx(JC,{app:S,meta:r,onChanged:()=>{R.reload(),m()},onDelete:()=>h(S)})}),a.jsx(br,{id:"ezjson",value:x,children:a.jsx(e3,{app:S,locations:r.ezFileLocations})}),a.jsx(br,{id:"github",value:x,children:a.jsx(o3,{app:S,hook:i,onConfigureHook:f,onChanged:()=>{R.reload(),m()}})}),!i.enabled&&x!=="github"&&S.hook.hasToken&&a.jsx(ve,{tone:"warning",title:"The deploy hook is switched off",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(as,{className:"size-3.5","aria-hidden":"true"}),"This app has a deploy token, but nothing is listening for it."]})})]}):a.jsxs("div",{className:"flex items-center gap-2.5 py-10 text-sm text-muted",children:[a.jsx(_s,{})," Loading…"]})})}const ru="custom";function u3(n){return[...n.steps.filter(r=>r.enabled!==!1).map(r=>r.run),n.start].join(" → ")}function kv(n){return n?n===ru?"Custom":lu.find(i=>i.id===n)?.label??null:null}function zc(n){if(n===ru)return{start:"",steps:[]};const i=lu.find(r=>r.id===n);return i?{start:i.start,steps:AC(i)}:{start:"",steps:[]}}function Eh(n,i,r,c){return n.length!==r.length||i.trim()!==c.trim()?!1:n.every((d,f)=>d.run.trim()===r[f].run.trim()&&d.kind===r[f].kind&&d.enabled!==!1==(r[f].enabled!==!1))}function d3(n,i){for(const r of lu){const c=zc(r.id);if(Eh(n,i,c.steps,c.start))return r.id}return n.length===0?ru:null}function f3(n){return n.split(/[^A-Za-z0-9]+/).filter(Boolean).slice(0,2).map(i=>i[0].toUpperCase()).join("")}function h3({value:n,modifiedFrom:i,onSelect:r,onReset:c,disabled:d}){const f=p.useRef(new Map),m=[...lu.map(v=>({id:v.id,name:v.label,summary:u3(v)})),{id:ru,name:"Custom",summary:"Start from empty steps"}],h=n??m[0].id,g=v=>{if(d)return;const b=Math.max(0,m.findIndex(k=>k.id===n));let x=null;if(v.key==="ArrowDown"||v.key==="ArrowRight"?x=(b+1)%m.length:v.key==="ArrowUp"||v.key==="ArrowLeft"?x=(b-1+m.length)%m.length:v.key==="Home"?x=0:v.key==="End"&&(x=m.length-1),x===null)return;v.preventDefault();const j=m[x];r(j.id),f.current.get(j.id)?.focus()};return a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{role:"radiogroup","aria-label":"Preset",onKeyDown:g,className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:m.map(v=>{const b=v.id===n;return a.jsxs("button",{ref:x=>{x?f.current.set(v.id,x):f.current.delete(v.id)},type:"button",role:"radio","aria-checked":b,tabIndex:b||v.id===h?0:-1,disabled:d,onClick:()=>r(v.id),className:oe("relative flex items-start gap-2.5 rounded-lg border px-3 py-3 text-left transition-colors duration-[var(--ez-motion-fast)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",b?"border-accent bg-accent-soft":"border-line bg-raised/40",!b&&!d&&"hover:border-line-strong hover:bg-raised",d&&"cursor-not-allowed opacity-60"),children:[a.jsx("span",{className:oe("mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md border text-2xs font-semibold",b?"border-accent/40 bg-canvas text-accent-text":"border-line bg-canvas text-muted"),"aria-hidden":"true",children:f3(v.name)}),a.jsxs("span",{className:"min-w-0 flex-1 pr-4",children:[a.jsx("span",{className:"block truncate text-xs font-medium text-ink",children:v.name}),a.jsx("span",{className:"mt-0.5 block truncate text-2xs text-muted",title:v.summary,children:v.summary})]}),b&&a.jsx("span",{className:"absolute right-2 top-2 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink",children:a.jsx(dl,{className:"size-2.5","aria-hidden":"true"})})]},v.id)})}),i&&a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-faint",children:[a.jsxs("span",{children:["Modified from ",i]}),a.jsx("button",{type:"button",onClick:c,disabled:d,className:"rounded-sm font-medium text-accent-text underline-offset-2 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:text-faint disabled:opacity-60",children:"Reset to preset"})]}),a.jsx(ve,{tone:"info",children:"Check your project's real start and build commands before relying on a preset; not every project uses the defaults."})]})}const m3=[{id:"node",name:"Node.js",description:"JavaScript and TypeScript: Next.js, NestJS, Express, Fastify, Nuxt.",icon:Zw},{id:"python",name:"Python",description:"Django, FastAPI, Flask.",icon:_k},{id:"go",name:"Go",description:"A compiled Go binary.",icon:gl},{id:"static",name:"Static site",description:"Files served as they are, with no process.",icon:DS}];function p3({value:n,onChange:i}){return a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:m3.map(r=>{const c=r.id==="node",d=r.id===n,f=r.icon;return a.jsxs("button",{type:"button","aria-pressed":d,disabled:!c,onClick:()=>c&&i(r.id),className:oe("flex items-start gap-3 rounded-lg border px-3 py-3 text-left transition-colors duration-[var(--ez-motion-fast)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",d?"border-accent bg-accent-soft":"border-line bg-raised/40",c&&!d&&"hover:border-line-strong hover:bg-raised",!c&&"cursor-not-allowed opacity-60"),children:[a.jsx("span",{className:oe("mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md border",d?"border-accent/40 bg-canvas text-accent-text":"border-line bg-canvas text-muted"),children:a.jsx(f,{className:"size-4","aria-hidden":"true"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:r.name}),d&&a.jsx(je,{tone:"accent",children:"Selected"}),!c&&a.jsx(je,{tone:"neutral",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-muted",children:r.description})]})]},r.id)})})}function x3(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return p.useMemo(()=>c=>{i.forEach(d=>d(c))},i)}const ou=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ji(n){const i=Object.prototype.toString.call(n);return i==="[object Window]"||i==="[object global]"}function Wh(n){return"nodeType"in n}function bn(n){var i,r;return n?ji(n)?n:Wh(n)&&(i=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?i:window:window}function em(n){const{Document:i}=bn(n);return n instanceof i}function Gr(n){return ji(n)?!1:n instanceof bn(n).HTMLElement}function y0(n){return n instanceof bn(n).SVGElement}function Ni(n){return n?ji(n)?n.document:Wh(n)?em(n)?n:Gr(n)||y0(n)?n.ownerDocument:document:document:document}const ya=ou?p.useLayoutEffect:p.useEffect;function cu(n){const i=p.useRef(n);return ya(()=>{i.current=n}),p.useCallback(function(){for(var r=arguments.length,c=new Array(r),d=0;d<r;d++)c[d]=arguments[d];return i.current==null?void 0:i.current(...c)},[])}function g3(){const n=p.useRef(null),i=p.useCallback((c,d)=>{n.current=setInterval(c,d)},[]),r=p.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[i,r]}function Dr(n,i){i===void 0&&(i=[n]);const r=p.useRef(n);return ya(()=>{r.current!==n&&(r.current=n)},i),r}function Yr(n,i){const r=p.useRef();return p.useMemo(()=>{const c=n(r.current);return r.current=c,c},[...i])}function qc(n){const i=cu(n),r=p.useRef(null),c=p.useCallback(d=>{d!==r.current&&i?.(d,r.current),r.current=d},[]);return[r,c]}function Gc(n){const i=p.useRef();return p.useEffect(()=>{i.current=n},[n]),i.current}let nh={};function Vr(n,i){return p.useMemo(()=>{if(i)return i;const r=nh[n]==null?0:nh[n]+1;return nh[n]=r,n+"-"+r},[n,i])}function v0(n){return function(i){for(var r=arguments.length,c=new Array(r>1?r-1:0),d=1;d<r;d++)c[d-1]=arguments[d];return c.reduce((f,m)=>{const h=Object.entries(m);for(const[g,v]of h){const b=f[g];b!=null&&(f[g]=b+n*v)}return f},{...i})}}const mi=v0(1),Ar=v0(-1);function y3(n){return"clientX"in n&&"clientY"in n}function uu(n){if(!n)return!1;const{KeyboardEvent:i}=bn(n.target);return i&&n instanceof i}function v3(n){if(!n)return!1;const{TouchEvent:i}=bn(n.target);return i&&n instanceof i}function Yc(n){if(v3(n)){if(n.touches&&n.touches.length){const{clientX:i,clientY:r}=n.touches[0];return{x:i,y:r}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:i,clientY:r}=n.changedTouches[0];return{x:i,y:r}}}return y3(n)?{x:n.clientX,y:n.clientY}:null}const Ls=Object.freeze({Translate:{toString(n){if(!n)return;const{x:i,y:r}=n;return"translate3d("+(i?Math.round(i):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:i,scaleY:r}=n;return"scaleX("+i+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[Ls.Translate.toString(n),Ls.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:i,duration:r,easing:c}=n;return i+" "+r+"ms "+c}}}),Tv="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function b3(n){return n.matches(Tv)?n:n.querySelector(Tv)}const j3={display:"none"};function N3(n){let{id:i,value:r}=n;return yt.createElement("div",{id:i,style:j3},r)}function w3(n){let{id:i,announcement:r,ariaLiveType:c="assertive"}=n;const d={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return yt.createElement("div",{id:i,style:d,role:"status","aria-live":c,"aria-atomic":!0},r)}function S3(){const[n,i]=p.useState("");return{announce:p.useCallback(c=>{c!=null&&i(c)},[]),announcement:n}}const b0=p.createContext(null);function k3(n){const i=p.useContext(b0);p.useEffect(()=>{if(!i)throw new Error("useDndMonitor must be used within a children of <DndContext>");return i(n)},[n,i])}function T3(){const[n]=p.useState(()=>new Set),i=p.useCallback(c=>(n.add(c),()=>n.delete(c)),[n]);return[p.useCallback(c=>{let{type:d,event:f}=c;n.forEach(m=>{var h;return(h=m[d])==null?void 0:h.call(m,f)})},[n]),i]}const C3={draggable:`
|
|
522
|
-
To pick up a draggable item, press the space bar.
|
|
523
|
-
While dragging, use the arrow keys to move the item.
|
|
524
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
525
|
-
`},E3={onDragStart(n){let{active:i}=n;return"Picked up draggable item "+i.id+"."},onDragOver(n){let{active:i,over:r}=n;return r?"Draggable item "+i.id+" was moved over droppable area "+r.id+".":"Draggable item "+i.id+" is no longer over a droppable area."},onDragEnd(n){let{active:i,over:r}=n;return r?"Draggable item "+i.id+" was dropped over droppable area "+r.id:"Draggable item "+i.id+" was dropped."},onDragCancel(n){let{active:i}=n;return"Dragging was cancelled. Draggable item "+i.id+" was dropped."}};function R3(n){let{announcements:i=E3,container:r,hiddenTextDescribedById:c,screenReaderInstructions:d=C3}=n;const{announce:f,announcement:m}=S3(),h=Vr("DndLiveRegion"),[g,v]=p.useState(!1);if(p.useEffect(()=>{v(!0)},[]),k3(p.useMemo(()=>({onDragStart(x){let{active:j}=x;f(i.onDragStart({active:j}))},onDragMove(x){let{active:j,over:k}=x;i.onDragMove&&f(i.onDragMove({active:j,over:k}))},onDragOver(x){let{active:j,over:k}=x;f(i.onDragOver({active:j,over:k}))},onDragEnd(x){let{active:j,over:k}=x;f(i.onDragEnd({active:j,over:k}))},onDragCancel(x){let{active:j,over:k}=x;f(i.onDragCancel({active:j,over:k}))}}),[f,i])),!g)return null;const b=yt.createElement(yt.Fragment,null,yt.createElement(N3,{id:c,value:d.draggable}),yt.createElement(w3,{id:h,announcement:m}));return r?ol.createPortal(b,r):b}var Bt;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Bt||(Bt={}));function Vc(){}function ah(n,i){return p.useMemo(()=>({sensor:n,options:i??{}}),[n,i])}function z3(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return p.useMemo(()=>[...i].filter(c=>c!=null),[...i])}const va=Object.freeze({x:0,y:0});function j0(n,i){return Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))}function D3(n,i){const r=Yc(n);if(!r)return"0 0";const c={x:(r.x-i.left)/i.width*100,y:(r.y-i.top)/i.height*100};return c.x+"% "+c.y+"%"}function N0(n,i){let{data:{value:r}}=n,{data:{value:c}}=i;return r-c}function A3(n,i){let{data:{value:r}}=n,{data:{value:c}}=i;return c-r}function Cv(n){let{left:i,top:r,height:c,width:d}=n;return[{x:i,y:r},{x:i+d,y:r},{x:i,y:r+c},{x:i+d,y:r+c}]}function w0(n,i){if(!n||n.length===0)return null;const[r]=n;return r[i]}function Ev(n,i,r){return i===void 0&&(i=n.left),r===void 0&&(r=n.top),{x:i+n.width*.5,y:r+n.height*.5}}const O3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=Ev(i,i.left,i.top),f=[];for(const m of c){const{id:h}=m,g=r.get(h);if(g){const v=j0(Ev(g),d);f.push({id:h,data:{droppableContainer:m,value:v}})}}return f.sort(N0)},M3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=Cv(i),f=[];for(const m of c){const{id:h}=m,g=r.get(h);if(g){const v=Cv(g),b=d.reduce((j,k,z)=>j+j0(v[z],k),0),x=Number((b/4).toFixed(4));f.push({id:h,data:{droppableContainer:m,value:x}})}}return f.sort(N0)};function _3(n,i){const r=Math.max(i.top,n.top),c=Math.max(i.left,n.left),d=Math.min(i.left+i.width,n.left+n.width),f=Math.min(i.top+i.height,n.top+n.height),m=d-c,h=f-r;if(c<d&&r<f){const g=i.width*i.height,v=n.width*n.height,b=m*h,x=b/(g+v-b);return Number(x.toFixed(4))}return 0}const L3=n=>{let{collisionRect:i,droppableRects:r,droppableContainers:c}=n;const d=[];for(const f of c){const{id:m}=f,h=r.get(m);if(h){const g=_3(h,i);g>0&&d.push({id:m,data:{droppableContainer:f,value:g}})}}return d.sort(A3)};function U3(n,i,r){return{...n,scaleX:i&&r?i.width/r.width:1,scaleY:i&&r?i.height/r.height:1}}function S0(n,i){return n&&i?{x:n.left-i.left,y:n.top-i.top}:va}function H3(n){return function(r){for(var c=arguments.length,d=new Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return d.reduce((m,h)=>({...m,top:m.top+n*h.y,bottom:m.bottom+n*h.y,left:m.left+n*h.x,right:m.right+n*h.x}),{...r})}}const B3=H3(1);function k0(n){if(n.startsWith("matrix3d(")){const i=n.slice(9,-1).split(/, /);return{x:+i[12],y:+i[13],scaleX:+i[0],scaleY:+i[5]}}else if(n.startsWith("matrix(")){const i=n.slice(7,-1).split(/, /);return{x:+i[4],y:+i[5],scaleX:+i[0],scaleY:+i[3]}}return null}function $3(n,i,r){const c=k0(i);if(!c)return n;const{scaleX:d,scaleY:f,x:m,y:h}=c,g=n.left-m-(1-d)*parseFloat(r),v=n.top-h-(1-f)*parseFloat(r.slice(r.indexOf(" ")+1)),b=d?n.width/d:n.width,x=f?n.height/f:n.height;return{width:b,height:x,top:v,right:g+b,bottom:v+x,left:g}}const q3={ignoreTransform:!1};function wi(n,i){i===void 0&&(i=q3);let r=n.getBoundingClientRect();if(i.ignoreTransform){const{transform:v,transformOrigin:b}=bn(n).getComputedStyle(n);v&&(r=$3(r,v,b))}const{top:c,left:d,width:f,height:m,bottom:h,right:g}=r;return{top:c,left:d,width:f,height:m,bottom:h,right:g}}function Rv(n){return wi(n,{ignoreTransform:!0})}function G3(n){const i=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:i,bottom:r,width:i,height:r}}function Y3(n,i){return i===void 0&&(i=bn(n).getComputedStyle(n)),i.position==="fixed"}function V3(n,i){i===void 0&&(i=bn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(d=>{const f=i[d];return typeof f=="string"?r.test(f):!1})}function du(n,i){const r=[];function c(d){if(i!=null&&r.length>=i||!d)return r;if(em(d)&&d.scrollingElement!=null&&!r.includes(d.scrollingElement))return r.push(d.scrollingElement),r;if(!Gr(d)||y0(d)||r.includes(d))return r;const f=bn(n).getComputedStyle(d);return d!==n&&V3(d,f)&&r.push(d),Y3(d,f)?r:c(d.parentNode)}return n?c(n):r}function T0(n){const[i]=du(n,1);return i??null}function sh(n){return!ou||!n?null:ji(n)?n:Wh(n)?em(n)||n===Ni(n).scrollingElement?window:Gr(n)?n:null:null}function C0(n){return ji(n)?n.scrollX:n.scrollLeft}function E0(n){return ji(n)?n.scrollY:n.scrollTop}function Rh(n){return{x:C0(n),y:E0(n)}}var Qt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Qt||(Qt={}));function R0(n){return!ou||!n?!1:n===document.scrollingElement}function z0(n){const i={x:0,y:0},r=R0(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},c={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},d=n.scrollTop<=i.y,f=n.scrollLeft<=i.x,m=n.scrollTop>=c.y,h=n.scrollLeft>=c.x;return{isTop:d,isLeft:f,isBottom:m,isRight:h,maxScroll:c,minScroll:i}}const X3={x:.2,y:.2};function K3(n,i,r,c,d){let{top:f,left:m,right:h,bottom:g}=r;c===void 0&&(c=10),d===void 0&&(d=X3);const{isTop:v,isBottom:b,isLeft:x,isRight:j}=z0(n),k={x:0,y:0},z={x:0,y:0},T={height:i.height*d.y,width:i.width*d.x};return!v&&f<=i.top+T.height?(k.y=Qt.Backward,z.y=c*Math.abs((i.top+T.height-f)/T.height)):!b&&g>=i.bottom-T.height&&(k.y=Qt.Forward,z.y=c*Math.abs((i.bottom-T.height-g)/T.height)),!j&&h>=i.right-T.width?(k.x=Qt.Forward,z.x=c*Math.abs((i.right-T.width-h)/T.width)):!x&&m<=i.left+T.width&&(k.x=Qt.Backward,z.x=c*Math.abs((i.left+T.width-m)/T.width)),{direction:k,speed:z}}function Z3(n){if(n===document.scrollingElement){const{innerWidth:f,innerHeight:m}=window;return{top:0,left:0,right:f,bottom:m,width:f,height:m}}const{top:i,left:r,right:c,bottom:d}=n.getBoundingClientRect();return{top:i,left:r,right:c,bottom:d,width:n.clientWidth,height:n.clientHeight}}function D0(n){return n.reduce((i,r)=>mi(i,Rh(r)),va)}function Q3(n){return n.reduce((i,r)=>i+C0(r),0)}function P3(n){return n.reduce((i,r)=>i+E0(r),0)}function A0(n,i){if(i===void 0&&(i=wi),!n)return;const{top:r,left:c,bottom:d,right:f}=i(n);T0(n)&&(d<=0||f<=0||r>=window.innerHeight||c>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const I3=[["x",["left","right"],Q3],["y",["top","bottom"],P3]];class tm{constructor(i,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const c=du(r),d=D0(c);this.rect={...i},this.width=i.width,this.height=i.height;for(const[f,m,h]of I3)for(const g of m)Object.defineProperty(this,g,{get:()=>{const v=h(c),b=d[f]-v;return this.rect[g]+b},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class wr{constructor(i){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var c;return(c=this.target)==null?void 0:c.removeEventListener(...r)})},this.target=i}add(i,r,c){var d;(d=this.target)==null||d.addEventListener(i,r,c),this.listeners.push([i,r,c])}}function F3(n){const{EventTarget:i}=bn(n);return n instanceof i?n:Ni(n)}function lh(n,i){const r=Math.abs(n.x),c=Math.abs(n.y);return typeof i=="number"?Math.sqrt(r**2+c**2)>i:"x"in i&&"y"in i?r>i.x&&c>i.y:"x"in i?r>i.x:"y"in i?c>i.y:!1}var Wn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Wn||(Wn={}));function zv(n){n.preventDefault()}function J3(n){n.stopPropagation()}var Qe;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Qe||(Qe={}));const O0={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},W3=(n,i)=>{let{currentCoordinates:r}=i;switch(n.code){case Qe.Right:return{...r,x:r.x+25};case Qe.Left:return{...r,x:r.x-25};case Qe.Down:return{...r,y:r.y+25};case Qe.Up:return{...r,y:r.y-25}}};class nm{constructor(i){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=i;const{event:{target:r}}=i;this.props=i,this.listeners=new wr(Ni(r)),this.windowListeners=new wr(bn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Wn.Resize,this.handleCancel),this.windowListeners.add(Wn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Wn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:i,onStart:r}=this.props,c=i.node.current;c&&A0(c),r(va)}handleKeyDown(i){if(uu(i)){const{active:r,context:c,options:d}=this.props,{keyboardCodes:f=O0,coordinateGetter:m=W3,scrollBehavior:h="smooth"}=d,{code:g}=i;if(f.end.includes(g)){this.handleEnd(i);return}if(f.cancel.includes(g)){this.handleCancel(i);return}const{collisionRect:v}=c.current,b=v?{x:v.left,y:v.top}:va;this.referenceCoordinates||(this.referenceCoordinates=b);const x=m(i,{active:r,context:c.current,currentCoordinates:b});if(x){const j=Ar(x,b),k={x:0,y:0},{scrollableAncestors:z}=c.current;for(const T of z){const w=i.code,{isTop:R,isRight:S,isLeft:O,isBottom:E,maxScroll:M,minScroll:X}=z0(T),A=Z3(T),U={x:Math.min(w===Qe.Right?A.right-A.width/2:A.right,Math.max(w===Qe.Right?A.left:A.left+A.width/2,x.x)),y:Math.min(w===Qe.Down?A.bottom-A.height/2:A.bottom,Math.max(w===Qe.Down?A.top:A.top+A.height/2,x.y))},W=w===Qe.Right&&!S||w===Qe.Left&&!O,I=w===Qe.Down&&!E||w===Qe.Up&&!R;if(W&&U.x!==x.x){const te=T.scrollLeft+j.x,B=w===Qe.Right&&te<=M.x||w===Qe.Left&&te>=X.x;if(B&&!j.y){T.scrollTo({left:te,behavior:h});return}B?k.x=T.scrollLeft-te:k.x=w===Qe.Right?T.scrollLeft-M.x:T.scrollLeft-X.x,k.x&&T.scrollBy({left:-k.x,behavior:h});break}else if(I&&U.y!==x.y){const te=T.scrollTop+j.y,B=w===Qe.Down&&te<=M.y||w===Qe.Up&&te>=X.y;if(B&&!j.x){T.scrollTo({top:te,behavior:h});return}B?k.y=T.scrollTop-te:k.y=w===Qe.Down?T.scrollTop-M.y:T.scrollTop-X.y,k.y&&T.scrollBy({top:-k.y,behavior:h});break}}this.handleMove(i,mi(Ar(x,this.referenceCoordinates),k))}}}handleMove(i,r){const{onMove:c}=this.props;i.preventDefault(),c(r)}handleEnd(i){const{onEnd:r}=this.props;i.preventDefault(),this.detach(),r()}handleCancel(i){const{onCancel:r}=this.props;i.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}nm.activators=[{eventName:"onKeyDown",handler:(n,i,r)=>{let{keyboardCodes:c=O0,onActivation:d}=i,{active:f}=r;const{code:m}=n.nativeEvent;if(c.start.includes(m)){const h=f.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),d?.({event:n.nativeEvent}),!0)}return!1}}];function Dv(n){return!!(n&&"distance"in n)}function Av(n){return!!(n&&"delay"in n)}class am{constructor(i,r,c){var d;c===void 0&&(c=F3(i.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=i,this.events=r;const{event:f}=i,{target:m}=f;this.props=i,this.events=r,this.document=Ni(m),this.documentListeners=new wr(this.document),this.listeners=new wr(c),this.windowListeners=new wr(bn(m)),this.initialCoordinates=(d=Yc(f))!=null?d:va,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:i,props:{options:{activationConstraint:r,bypassActivationConstraint:c}}}=this;if(this.listeners.add(i.move.name,this.handleMove,{passive:!1}),this.listeners.add(i.end.name,this.handleEnd),i.cancel&&this.listeners.add(i.cancel.name,this.handleCancel),this.windowListeners.add(Wn.Resize,this.handleCancel),this.windowListeners.add(Wn.DragStart,zv),this.windowListeners.add(Wn.VisibilityChange,this.handleCancel),this.windowListeners.add(Wn.ContextMenu,zv),this.documentListeners.add(Wn.Keydown,this.handleKeydown),r){if(c!=null&&c({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Av(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Dv(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(i,r){const{active:c,onPending:d}=this.props;d(c,i,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:i}=this,{onStart:r}=this.props;i&&(this.activated=!0,this.documentListeners.add(Wn.Click,J3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Wn.SelectionChange,this.removeTextSelection),r(i))}handleMove(i){var r;const{activated:c,initialCoordinates:d,props:f}=this,{onMove:m,options:{activationConstraint:h}}=f;if(!d)return;const g=(r=Yc(i))!=null?r:va,v=Ar(d,g);if(!c&&h){if(Dv(h)){if(h.tolerance!=null&&lh(v,h.tolerance))return this.handleCancel();if(lh(v,h.distance))return this.handleStart()}if(Av(h)&&lh(v,h.tolerance))return this.handleCancel();this.handlePending(h,v);return}i.cancelable&&i.preventDefault(),m(g)}handleEnd(){const{onAbort:i,onEnd:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleCancel(){const{onAbort:i,onCancel:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleKeydown(i){i.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var i;(i=this.document.getSelection())==null||i.removeAllRanges()}}const eE={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sm extends am{constructor(i){const{event:r}=i,c=Ni(r.target);super(i,eE,c)}}sm.activators=[{eventName:"onPointerDown",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;return!r.isPrimary||r.button!==0?!1:(c?.({event:r}),!0)}}];const tE={move:{name:"mousemove"},end:{name:"mouseup"}};var zh;(function(n){n[n.RightClick=2]="RightClick"})(zh||(zh={}));class nE extends am{constructor(i){super(i,tE,Ni(i.event.target))}}nE.activators=[{eventName:"onMouseDown",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;return r.button===zh.RightClick?!1:(c?.({event:r}),!0)}}];const ih={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class M0 extends am{constructor(i){super(i,ih)}static setup(){return window.addEventListener(ih.move.name,i,{capture:!1,passive:!1}),function(){window.removeEventListener(ih.move.name,i)};function i(){}}}M0.activators=[{eventName:"onTouchStart",handler:(n,i)=>{let{nativeEvent:r}=n,{onActivation:c}=i;const{touches:d}=r;return d.length>1?!1:(c?.({event:r}),!0)}}];var Sr;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Sr||(Sr={}));var Xc;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xc||(Xc={}));function aE(n){let{acceleration:i,activator:r=Sr.Pointer,canScroll:c,draggingRect:d,enabled:f,interval:m=5,order:h=Xc.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:b,delta:x,threshold:j}=n;const k=lE({delta:x,disabled:!f}),[z,T]=g3(),w=p.useRef({x:0,y:0}),R=p.useRef({x:0,y:0}),S=p.useMemo(()=>{switch(r){case Sr.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case Sr.DraggableRect:return d}},[r,d,g]),O=p.useRef(null),E=p.useCallback(()=>{const X=O.current;if(!X)return;const A=w.current.x*R.current.x,U=w.current.y*R.current.y;X.scrollBy(A,U)},[]),M=p.useMemo(()=>h===Xc.TreeOrder?[...v].reverse():v,[h,v]);p.useEffect(()=>{if(!f||!v.length||!S){T();return}for(const X of M){if(c?.(X)===!1)continue;const A=v.indexOf(X),U=b[A];if(!U)continue;const{direction:W,speed:I}=K3(X,U,S,i,j);for(const te of["x","y"])k[te][W[te]]||(I[te]=0,W[te]=0);if(I.x>0||I.y>0){T(),O.current=X,z(E,m),w.current=I,R.current=W;return}}w.current={x:0,y:0},R.current={x:0,y:0},T()},[i,E,c,T,f,m,JSON.stringify(S),JSON.stringify(k),z,v,M,b,JSON.stringify(j)])}const sE={x:{[Qt.Backward]:!1,[Qt.Forward]:!1},y:{[Qt.Backward]:!1,[Qt.Forward]:!1}};function lE(n){let{delta:i,disabled:r}=n;const c=Gc(i);return Yr(d=>{if(r||!c||!d)return sE;const f={x:Math.sign(i.x-c.x),y:Math.sign(i.y-c.y)};return{x:{[Qt.Backward]:d.x[Qt.Backward]||f.x===-1,[Qt.Forward]:d.x[Qt.Forward]||f.x===1},y:{[Qt.Backward]:d.y[Qt.Backward]||f.y===-1,[Qt.Forward]:d.y[Qt.Forward]||f.y===1}}},[r,i,c])}function iE(n,i){const r=i!=null?n.get(i):void 0,c=r?r.node.current:null;return Yr(d=>{var f;return i==null?null:(f=c??d)!=null?f:null},[c,i])}function rE(n,i){return p.useMemo(()=>n.reduce((r,c)=>{const{sensor:d}=c,f=d.activators.map(m=>({eventName:m.eventName,handler:i(m.handler,c)}));return[...r,...f]},[]),[n,i])}var Or;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(Or||(Or={}));var Dh;(function(n){n.Optimized="optimized"})(Dh||(Dh={}));const Ov=new Map;function oE(n,i){let{dragging:r,dependencies:c,config:d}=i;const[f,m]=p.useState(null),{frequency:h,measure:g,strategy:v}=d,b=p.useRef(n),x=w(),j=Dr(x),k=p.useCallback(function(R){R===void 0&&(R=[]),!j.current&&m(S=>S===null?R:S.concat(R.filter(O=>!S.includes(O))))},[j]),z=p.useRef(null),T=Yr(R=>{if(x&&!r)return Ov;if(!R||R===Ov||b.current!==n||f!=null){const S=new Map;for(let O of n){if(!O)continue;if(f&&f.length>0&&!f.includes(O.id)&&O.rect.current){S.set(O.id,O.rect.current);continue}const E=O.node.current,M=E?new tm(g(E),E):null;O.rect.current=M,M&&S.set(O.id,M)}return S}return R},[n,f,r,x,g]);return p.useEffect(()=>{b.current=n},[n]),p.useEffect(()=>{x||k()},[r,x]),p.useEffect(()=>{f&&f.length>0&&m(null)},[JSON.stringify(f)]),p.useEffect(()=>{x||typeof h!="number"||z.current!==null||(z.current=setTimeout(()=>{k(),z.current=null},h))},[h,x,k,...c]),{droppableRects:T,measureDroppableContainers:k,measuringScheduled:f!=null};function w(){switch(v){case Or.Always:return!1;case Or.BeforeDragging:return r;default:return!r}}}function lm(n,i){return Yr(r=>n?r||(typeof i=="function"?i(n):n):null,[i,n])}function cE(n,i){return lm(n,i)}function uE(n){let{callback:i,disabled:r}=n;const c=cu(i),d=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:f}=window;return new f(c)},[c,r]);return p.useEffect(()=>()=>d?.disconnect(),[d]),d}function fu(n){let{callback:i,disabled:r}=n;const c=cu(i),d=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:f}=window;return new f(c)},[r]);return p.useEffect(()=>()=>d?.disconnect(),[d]),d}function dE(n){return new tm(wi(n),n)}function Mv(n,i,r){i===void 0&&(i=dE);const[c,d]=p.useState(null);function f(){d(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??r)!=null?v:null}const b=i(n);return JSON.stringify(g)===JSON.stringify(b)?g:b})}const m=uE({callback(g){if(n)for(const v of g){const{type:b,target:x}=v;if(b==="childList"&&x instanceof HTMLElement&&x.contains(n)){f();break}}}}),h=fu({callback:f});return ya(()=>{f(),n?(h?.observe(n),m?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),m?.disconnect())},[n]),c}function fE(n){const i=lm(n);return S0(n,i)}const _v=[];function hE(n){const i=p.useRef(n),r=Yr(c=>n?c&&c!==_v&&n&&i.current&&n.parentNode===i.current.parentNode?c:du(n):_v,[n]);return p.useEffect(()=>{i.current=n},[n]),r}function mE(n){const[i,r]=p.useState(null),c=p.useRef(n),d=p.useCallback(f=>{const m=sh(f.target);m&&r(h=>h?(h.set(m,Rh(m)),new Map(h)):null)},[]);return p.useEffect(()=>{const f=c.current;if(n!==f){m(f);const h=n.map(g=>{const v=sh(g);return v?(v.addEventListener("scroll",d,{passive:!0}),[v,Rh(v)]):null}).filter(g=>g!=null);r(h.length?new Map(h):null),c.current=n}return()=>{m(n),m(f)};function m(h){h.forEach(g=>{const v=sh(g);v?.removeEventListener("scroll",d)})}},[d,n]),p.useMemo(()=>n.length?i?Array.from(i.values()).reduce((f,m)=>mi(f,m),va):D0(n):va,[n,i])}function Lv(n,i){i===void 0&&(i=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},i),p.useEffect(()=>{const c=n!==va;c&&!r.current&&(r.current=n),!c&&r.current&&(r.current=null)},[n]),r.current?Ar(n,r.current):va}function pE(n){p.useEffect(()=>{if(!ou)return;const i=n.map(r=>{let{sensor:c}=r;return c.setup==null?void 0:c.setup()});return()=>{for(const r of i)r?.()}},n.map(i=>{let{sensor:r}=i;return r}))}function xE(n,i){return p.useMemo(()=>n.reduce((r,c)=>{let{eventName:d,handler:f}=c;return r[d]=m=>{f(m,i)},r},{}),[n,i])}function _0(n){return p.useMemo(()=>n?G3(n):null,[n])}const Uv=[];function gE(n,i){i===void 0&&(i=wi);const[r]=n,c=_0(r?bn(r):null),[d,f]=p.useState(Uv);function m(){f(()=>n.length?n.map(g=>R0(g)?c:new tm(i(g),g)):Uv)}const h=fu({callback:m});return ya(()=>{h?.disconnect(),m(),n.forEach(g=>h?.observe(g))},[n]),d}function L0(n){if(!n)return null;if(n.children.length>1)return n;const i=n.children[0];return Gr(i)?i:n}function yE(n){let{measure:i}=n;const[r,c]=p.useState(null),d=p.useCallback(v=>{for(const{target:b}of v)if(Gr(b)){c(x=>{const j=i(b);return x?{...x,width:j.width,height:j.height}:j});break}},[i]),f=fu({callback:d}),m=p.useCallback(v=>{const b=L0(v);f?.disconnect(),b&&f?.observe(b),c(b?i(b):null)},[i,f]),[h,g]=qc(m);return p.useMemo(()=>({nodeRef:h,rect:r,setRef:g}),[r,h,g])}const vE=[{sensor:sm,options:{}},{sensor:nm,options:{}}],bE={current:{}},Dc={draggable:{measure:Rv},droppable:{measure:Rv,strategy:Or.WhileDragging,frequency:Dh.Optimized},dragOverlay:{measure:wi}};class kr extends Map{get(i){var r;return i!=null&&(r=super.get(i))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(i=>{let{disabled:r}=i;return!r})}getNodeFor(i){var r,c;return(r=(c=this.get(i))==null?void 0:c.node.current)!=null?r:void 0}}const jE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Dc,measureDroppableContainers:Vc,windowRect:null,measuringScheduled:!1},U0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vc,draggableNodes:new Map,over:null,measureDroppableContainers:Vc},Xr=p.createContext(U0),H0=p.createContext(jE);function NE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function wE(n,i){switch(i.type){case Bt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:i.initialCoordinates,active:i.active}};case Bt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:i.coordinates.x-n.draggable.initialCoordinates.x,y:i.coordinates.y-n.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=i,{id:c}=r,d=new kr(n.droppable.containers);return d.set(c,r),{...n,droppable:{...n.droppable,containers:d}}}case Bt.SetDroppableDisabled:{const{id:r,key:c,disabled:d}=i,f=n.droppable.containers.get(r);if(!f||c!==f.key)return n;const m=new kr(n.droppable.containers);return m.set(r,{...f,disabled:d}),{...n,droppable:{...n.droppable,containers:m}}}case Bt.UnregisterDroppable:{const{id:r,key:c}=i,d=n.droppable.containers.get(r);if(!d||c!==d.key)return n;const f=new kr(n.droppable.containers);return f.delete(r),{...n,droppable:{...n.droppable,containers:f}}}default:return n}}function SE(n){let{disabled:i}=n;const{active:r,activatorEvent:c,draggableNodes:d}=p.useContext(Xr),f=Gc(c),m=Gc(r?.id);return p.useEffect(()=>{if(!i&&!c&&f&&m!=null){if(!uu(f)||document.activeElement===f.target)return;const h=d.get(m);if(!h)return;const{activatorNode:g,node:v}=h;if(!g.current&&!v.current)return;requestAnimationFrame(()=>{for(const b of[g.current,v.current]){if(!b)continue;const x=b3(b);if(x){x.focus();break}}})}},[c,i,d,m,f]),null}function B0(n,i){let{transform:r,...c}=i;return n!=null&&n.length?n.reduce((d,f)=>f({transform:d,...c}),r):r}function kE(n){return p.useMemo(()=>({draggable:{...Dc.draggable,...n?.draggable},droppable:{...Dc.droppable,...n?.droppable},dragOverlay:{...Dc.dragOverlay,...n?.dragOverlay}}),[n?.draggable,n?.droppable,n?.dragOverlay])}function TE(n){let{activeNode:i,measure:r,initialRect:c,config:d=!0}=n;const f=p.useRef(!1),{x:m,y:h}=typeof d=="boolean"?{x:d,y:d}:d;ya(()=>{if(!m&&!h||!i){f.current=!1;return}if(f.current||!c)return;const v=i?.node.current;if(!v||v.isConnected===!1)return;const b=r(v),x=S0(b,c);if(m||(x.x=0),h||(x.y=0),f.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const j=T0(v);j&&j.scrollBy({top:x.y,left:x.x})}},[i,m,h,c,r])}const hu=p.createContext({...va,scaleX:1,scaleY:1});var As;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(As||(As={}));const CE=p.memo(function(i){var r,c,d,f;let{id:m,accessibility:h,autoScroll:g=!0,children:v,sensors:b=vE,collisionDetection:x=L3,measuring:j,modifiers:k,...z}=i;const T=p.useReducer(wE,void 0,NE),[w,R]=T,[S,O]=T3(),[E,M]=p.useState(As.Uninitialized),X=E===As.Initialized,{draggable:{active:A,nodes:U,translate:W},droppable:{containers:I}}=w,te=A!=null?U.get(A):null,B=p.useRef({initial:null,translated:null}),V=p.useMemo(()=>{var Ut;return A!=null?{id:A,data:(Ut=te?.data)!=null?Ut:bE,rect:B}:null},[A,te]),de=p.useRef(null),[le,Q]=p.useState(null),[F,L]=p.useState(null),ee=Dr(z,Object.values(z)),ue=Vr("DndDescribedBy",m),ke=p.useMemo(()=>I.getEnabled(),[I]),Ne=kE(j),{droppableRects:Ee,measureDroppableContainers:C,measuringScheduled:q}=oE(ke,{dragging:X,dependencies:[W.x,W.y],config:Ne.droppable}),Y=iE(U,A),re=p.useMemo(()=>F?Yc(F):null,[F]),ye=Kr(),Re=cE(Y,Ne.draggable.measure);TE({activeNode:A!=null?U.get(A):null,config:ye.layoutShiftCompensation,initialRect:Re,measure:Ne.draggable.measure});const xe=Mv(Y,Ne.draggable.measure,Re),me=Mv(Y?Y.parentElement:null),ie=p.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:Ee,draggableNodes:U,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=I.getNodeFor((r=ie.current.over)==null?void 0:r.id),Ge=yE({measure:Ne.dragOverlay.measure}),Fe=(c=Ge.nodeRef.current)!=null?c:Y,ce=X?(d=Ge.rect)!=null?d:xe:null,De=!!(Ge.nodeRef.current&&Ge.rect),we=fE(De?null:xe),nt=_0(Fe?bn(Fe):null),rt=hE(X?Pe??Y:null),xt=gE(rt),bt=B0(k,{transform:{x:W.x-we.x,y:W.y-we.y,scaleX:1,scaleY:1},activatorEvent:F,active:V,activeNodeRect:xe,containerNodeRect:me,draggingNodeRect:ce,over:ie.current.over,overlayNodeRect:Ge.rect,scrollableAncestors:rt,scrollableAncestorRects:xt,windowRect:nt}),zn=re?mi(re,W):null,jn=mE(rt),na=Lv(jn),J=Lv(jn,[xe]),be=mi(bt,na),Ue=ce?B3(ce,bt):null,Dt=V&&Ue?x({active:V,collisionRect:Ue,droppableRects:Ee,droppableContainers:ke,pointerCoordinates:zn}):null,aa=w0(Dt,"id"),[Xe,vl]=p.useState(null),bl=De?bt:mi(bt,J),Hs=U3(bl,(f=Xe?.rect)!=null?f:null,xe),Ce=p.useRef(null),ut=p.useCallback((Ut,Gt)=>{let{sensor:on,options:sa}=Gt;if(de.current==null)return;const Nn=U.get(de.current);if(!Nn)return;const cn=Ut.nativeEvent,an=new on({active:de.current,activeNode:Nn,event:cn,options:sa,context:ie,onAbort(ft){if(!U.get(ft))return;const{onDragAbort:Gn}=ee.current,la={id:ft};Gn?.(la),S({type:"onDragAbort",event:la})},onPending(ft,Nt,Gn,la){if(!U.get(ft))return;const{onDragPending:Na}=ee.current,Dn={id:ft,constraint:Nt,initialCoordinates:Gn,offset:la};Na?.(Dn),S({type:"onDragPending",event:Dn})},onStart(ft){const Nt=de.current;if(Nt==null)return;const Gn=U.get(Nt);if(!Gn)return;const{onDragStart:la}=ee.current,Bs={activatorEvent:cn,active:{id:Nt,data:Gn.data,rect:B}};ol.unstable_batchedUpdates(()=>{la?.(Bs),M(As.Initializing),R({type:Bt.DragStart,initialCoordinates:ft,active:Nt}),S({type:"onDragStart",event:Bs}),Q(Ce.current),L(cn)})},onMove(ft){R({type:Bt.DragMove,coordinates:ft})},onEnd:At(Bt.DragEnd),onCancel:At(Bt.DragCancel)});Ce.current=an;function At(ft){return async function(){const{active:Gn,collisions:la,over:Bs,scrollAdjustedTranslate:Na}=ie.current;let Dn=null;if(Gn&&Na){const{cancelDrop:wa}=ee.current;Dn={activatorEvent:cn,active:Gn,collisions:la,delta:Na,over:Bs},ft===Bt.DragEnd&&typeof wa=="function"&&await Promise.resolve(wa(Dn))&&(ft=Bt.DragCancel)}de.current=null,ol.unstable_batchedUpdates(()=>{R({type:ft}),M(As.Uninitialized),vl(null),Q(null),L(null),Ce.current=null;const wa=ft===Bt.DragEnd?"onDragEnd":"onDragCancel";if(Dn){const ia=ee.current[wa];ia?.(Dn),S({type:wa,event:Dn})}})}}},[U]),Rt=p.useCallback((Ut,Gt)=>(on,sa)=>{const Nn=on.nativeEvent,cn=U.get(sa);if(de.current!==null||!cn||Nn.dndKit||Nn.defaultPrevented)return;const an={active:cn};Ut(on,Gt.options,an)===!0&&(Nn.dndKit={capturedBy:Gt.sensor},de.current=sa,ut(on,Gt))},[U,ut]),jt=rE(b,Rt);pE(b),ya(()=>{xe&&E===As.Initializing&&M(As.Initialized)},[xe,E]),p.useEffect(()=>{const{onDragMove:Ut}=ee.current,{active:Gt,activatorEvent:on,collisions:sa,over:Nn}=ie.current;if(!Gt||!on)return;const cn={active:Gt,activatorEvent:on,collisions:sa,delta:{x:be.x,y:be.y},over:Nn};ol.unstable_batchedUpdates(()=>{Ut?.(cn),S({type:"onDragMove",event:cn})})},[be.x,be.y]),p.useEffect(()=>{const{active:Ut,activatorEvent:Gt,collisions:on,droppableContainers:sa,scrollAdjustedTranslate:Nn}=ie.current;if(!Ut||de.current==null||!Gt||!Nn)return;const{onDragOver:cn}=ee.current,an=sa.get(aa),At=an&&an.rect.current?{id:an.id,rect:an.rect.current,data:an.data,disabled:an.disabled}:null,ft={active:Ut,activatorEvent:Gt,collisions:on,delta:{x:Nn.x,y:Nn.y},over:At};ol.unstable_batchedUpdates(()=>{vl(At),cn?.(ft),S({type:"onDragOver",event:ft})})},[aa]),ya(()=>{ie.current={activatorEvent:F,active:V,activeNode:Y,collisionRect:Ue,collisions:Dt,droppableRects:Ee,draggableNodes:U,draggingNode:Fe,draggingNodeRect:ce,droppableContainers:I,over:Xe,scrollableAncestors:rt,scrollAdjustedTranslate:be},B.current={initial:ce,translated:Ue}},[V,Y,Dt,Ue,U,Fe,ce,Ee,I,Xe,rt,be]),aE({...ye,delta:W,draggingRect:Ue,pointerCoordinates:zn,scrollableAncestors:rt,scrollableAncestorRects:xt});const Ke=p.useMemo(()=>({active:V,activeNode:Y,activeNodeRect:xe,activatorEvent:F,collisions:Dt,containerNodeRect:me,dragOverlay:Ge,draggableNodes:U,droppableContainers:I,droppableRects:Ee,over:Xe,measureDroppableContainers:C,scrollableAncestors:rt,scrollableAncestorRects:xt,measuringConfiguration:Ne,measuringScheduled:q,windowRect:nt}),[V,Y,xe,F,Dt,me,Ge,U,I,Ee,Xe,C,rt,xt,Ne,q,nt]),Pt=p.useMemo(()=>({activatorEvent:F,activators:jt,active:V,activeNodeRect:xe,ariaDescribedById:{draggable:ue},dispatch:R,draggableNodes:U,over:Xe,measureDroppableContainers:C}),[F,jt,V,xe,R,ue,U,Xe,C]);return yt.createElement(b0.Provider,{value:O},yt.createElement(Xr.Provider,{value:Pt},yt.createElement(H0.Provider,{value:Ke},yt.createElement(hu.Provider,{value:Hs},v)),yt.createElement(SE,{disabled:h?.restoreFocus===!1})),yt.createElement(R3,{...h,hiddenTextDescribedById:ue}));function Kr(){const Ut=le?.autoScrollEnabled===!1,Gt=typeof g=="object"?g.enabled===!1:g===!1,on=X&&!Ut&&!Gt;return typeof g=="object"?{...g,enabled:on}:{enabled:on}}}),EE=p.createContext(null),Hv="button",RE="Draggable";function zE(n){let{id:i,data:r,disabled:c=!1,attributes:d}=n;const f=Vr(RE),{activators:m,activatorEvent:h,active:g,activeNodeRect:v,ariaDescribedById:b,draggableNodes:x,over:j}=p.useContext(Xr),{role:k=Hv,roleDescription:z="draggable",tabIndex:T=0}=d??{},w=g?.id===i,R=p.useContext(w?hu:EE),[S,O]=qc(),[E,M]=qc(),X=xE(m,i),A=Dr(r);ya(()=>(x.set(i,{id:i,key:f,node:S,activatorNode:E,data:A}),()=>{const W=x.get(i);W&&W.key===f&&x.delete(i)}),[x,i]);const U=p.useMemo(()=>({role:k,tabIndex:T,"aria-disabled":c,"aria-pressed":w&&k===Hv?!0:void 0,"aria-roledescription":z,"aria-describedby":b.draggable}),[c,k,T,w,z,b.draggable]);return{active:g,activatorEvent:h,activeNodeRect:v,attributes:U,isDragging:w,listeners:c?void 0:X,node:S,over:j,setNodeRef:O,setActivatorNodeRef:M,transform:R}}function $0(){return p.useContext(H0)}const DE="Droppable",AE={timeout:25};function OE(n){let{data:i,disabled:r=!1,id:c,resizeObserverConfig:d}=n;const f=Vr(DE),{active:m,dispatch:h,over:g,measureDroppableContainers:v}=p.useContext(Xr),b=p.useRef({disabled:r}),x=p.useRef(!1),j=p.useRef(null),k=p.useRef(null),{disabled:z,updateMeasurementsFor:T,timeout:w}={...AE,...d},R=Dr(T??c),S=p.useCallback(()=>{if(!x.current){x.current=!0;return}k.current!=null&&clearTimeout(k.current),k.current=setTimeout(()=>{v(Array.isArray(R.current)?R.current:[R.current]),k.current=null},w)},[w]),O=fu({callback:S,disabled:z||!m}),E=p.useCallback((U,W)=>{O&&(W&&(O.unobserve(W),x.current=!1),U&&O.observe(U))},[O]),[M,X]=qc(E),A=Dr(i);return p.useEffect(()=>{!O||!M.current||(O.disconnect(),x.current=!1,O.observe(M.current))},[M,O]),p.useEffect(()=>(h({type:Bt.RegisterDroppable,element:{id:c,key:f,disabled:r,node:M,rect:j,data:A}}),()=>h({type:Bt.UnregisterDroppable,key:f,id:c})),[c]),p.useEffect(()=>{r!==b.current.disabled&&(h({type:Bt.SetDroppableDisabled,id:c,key:f,disabled:r}),b.current.disabled=r)},[c,f,r,h]),{active:m,rect:j,isOver:g?.id===c,node:M,over:g,setNodeRef:X}}function ME(n){let{animation:i,children:r}=n;const[c,d]=p.useState(null),[f,m]=p.useState(null),h=Gc(r);return!r&&!c&&h&&d(h),ya(()=>{if(!f)return;const g=c?.key,v=c?.props.id;if(g==null||v==null){d(null);return}Promise.resolve(i(v,f)).then(()=>{d(null)})},[i,c,f]),yt.createElement(yt.Fragment,null,r,c?p.cloneElement(c,{ref:m}):null)}const _E={x:0,y:0,scaleX:1,scaleY:1};function LE(n){let{children:i}=n;return yt.createElement(Xr.Provider,{value:U0},yt.createElement(hu.Provider,{value:_E},i))}const UE={position:"fixed",touchAction:"none"},HE=n=>uu(n)?"transform 250ms ease":void 0,BE=p.forwardRef((n,i)=>{let{as:r,activatorEvent:c,adjustScale:d,children:f,className:m,rect:h,style:g,transform:v,transition:b=HE}=n;if(!h)return null;const x=d?v:{...v,scaleX:1,scaleY:1},j={...UE,width:h.width,height:h.height,top:h.top,left:h.left,transform:Ls.Transform.toString(x),transformOrigin:d&&c?D3(c,h):void 0,transition:typeof b=="function"?b(c):b,...g};return yt.createElement(r,{className:m,style:j,ref:i},f)}),$E=n=>i=>{let{active:r,dragOverlay:c}=i;const d={},{styles:f,className:m}=n;if(f!=null&&f.active)for(const[h,g]of Object.entries(f.active))g!==void 0&&(d[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,g));if(f!=null&&f.dragOverlay)for(const[h,g]of Object.entries(f.dragOverlay))g!==void 0&&c.node.style.setProperty(h,g);return m!=null&&m.active&&r.node.classList.add(m.active),m!=null&&m.dragOverlay&&c.node.classList.add(m.dragOverlay),function(){for(const[g,v]of Object.entries(d))r.node.style.setProperty(g,v);m!=null&&m.active&&r.node.classList.remove(m.active)}},qE=n=>{let{transform:{initial:i,final:r}}=n;return[{transform:Ls.Transform.toString(i)},{transform:Ls.Transform.toString(r)}]},GE={duration:250,easing:"ease",keyframes:qE,sideEffects:$E({styles:{active:{opacity:"0"}}})};function YE(n){let{config:i,draggableNodes:r,droppableContainers:c,measuringConfiguration:d}=n;return cu((f,m)=>{if(i===null)return;const h=r.get(f);if(!h)return;const g=h.node.current;if(!g)return;const v=L0(m);if(!v)return;const{transform:b}=bn(m).getComputedStyle(m),x=k0(b);if(!x)return;const j=typeof i=="function"?i:VE(i);return A0(g,d.draggable.measure),j({active:{id:f,data:h.data,node:g,rect:d.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:m,rect:d.dragOverlay.measure(v)},droppableContainers:c,measuringConfiguration:d,transform:x})})}function VE(n){const{duration:i,easing:r,sideEffects:c,keyframes:d}={...GE,...n};return f=>{let{active:m,dragOverlay:h,transform:g,...v}=f;if(!i)return;const b={x:h.rect.left-m.rect.left,y:h.rect.top-m.rect.top},x={scaleX:g.scaleX!==1?m.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?m.rect.height*g.scaleY/h.rect.height:1},j={x:g.x-b.x,y:g.y-b.y,...x},k=d({...v,active:m,dragOverlay:h,transform:{initial:g,final:j}}),[z]=k,T=k[k.length-1];if(JSON.stringify(z)===JSON.stringify(T))return;const w=c?.({active:m,dragOverlay:h,...v}),R=h.node.animate(k,{duration:i,easing:r,fill:"forwards"});return new Promise(S=>{R.onfinish=()=>{w?.(),S()}})}}let Bv=0;function XE(n){return p.useMemo(()=>{if(n!=null)return Bv++,Bv},[n])}const KE=yt.memo(n=>{let{adjustScale:i=!1,children:r,dropAnimation:c,style:d,transition:f,modifiers:m,wrapperElement:h="div",className:g,zIndex:v=999}=n;const{activatorEvent:b,active:x,activeNodeRect:j,containerNodeRect:k,draggableNodes:z,droppableContainers:T,dragOverlay:w,over:R,measuringConfiguration:S,scrollableAncestors:O,scrollableAncestorRects:E,windowRect:M}=$0(),X=p.useContext(hu),A=XE(x?.id),U=B0(m,{activatorEvent:b,active:x,activeNodeRect:j,containerNodeRect:k,draggingNodeRect:w.rect,over:R,overlayNodeRect:w.rect,scrollableAncestors:O,scrollableAncestorRects:E,transform:X,windowRect:M}),W=lm(j),I=YE({config:c,draggableNodes:z,droppableContainers:T,measuringConfiguration:S}),te=W?w.setRef:void 0;return yt.createElement(LE,null,yt.createElement(ME,{animation:I},x&&A?yt.createElement(BE,{key:A,id:x.id,ref:te,as:h,activatorEvent:b,adjustScale:i,className:g,transition:f,rect:W,style:{zIndex:v,...d},transform:U},r):null))});function ZE(n,i,r){const c={...n};return i.top+n.y<=r.top?c.y=r.top-i.top:i.bottom+n.y>=r.top+r.height&&(c.y=r.top+r.height-i.bottom),i.left+n.x<=r.left?c.x=r.left-i.left:i.right+n.x>=r.left+r.width&&(c.x=r.left+r.width-i.right),c}const QE=n=>{let{containerNodeRect:i,draggingNodeRect:r,transform:c}=n;return!r||!i?c:ZE(c,r,i)},PE=n=>{let{transform:i}=n;return{...i,x:0}};function im(n,i,r){const c=n.slice();return c.splice(r<0?c.length+r:r,0,c.splice(i,1)[0]),c}function IE(n,i){return n.reduce((r,c,d)=>{const f=i.get(c);return f&&(r[d]=f),r},Array(n.length))}function wc(n){return n!==null&&n>=0}function FE(n,i){if(n===i)return!0;if(n.length!==i.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}function JE(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const q0=n=>{let{rects:i,activeIndex:r,overIndex:c,index:d}=n;const f=im(i,c,r),m=i[d],h=f[d];return!h||!m?null:{x:h.left-m.left,y:h.top-m.top,scaleX:h.width/m.width,scaleY:h.height/m.height}},Sc={scaleX:1,scaleY:1},WE=n=>{var i;let{activeIndex:r,activeNodeRect:c,index:d,rects:f,overIndex:m}=n;const h=(i=f[r])!=null?i:c;if(!h)return null;if(d===r){const v=f[m];return v?{x:0,y:r<m?v.top+v.height-(h.top+h.height):v.top-h.top,...Sc}:null}const g=e4(f,d,r);return d>r&&d<=m?{x:0,y:-h.height-g,...Sc}:d<r&&d>=m?{x:0,y:h.height+g,...Sc}:{x:0,y:0,...Sc}};function e4(n,i,r){const c=n[i],d=n[i-1],f=n[i+1];return c?r<i?d?c.top-(d.top+d.height):f?f.top-(c.top+c.height):0:f?f.top-(c.top+c.height):d?c.top-(d.top+d.height):0:0}const G0="Sortable",Y0=yt.createContext({activeIndex:-1,containerId:G0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:q0,disabled:{draggable:!1,droppable:!1}});function t4(n){let{children:i,id:r,items:c,strategy:d=q0,disabled:f=!1}=n;const{active:m,dragOverlay:h,droppableRects:g,over:v,measureDroppableContainers:b}=$0(),x=Vr(G0,r),j=h.rect!==null,k=p.useMemo(()=>c.map(X=>typeof X=="object"&&"id"in X?X.id:X),[c]),z=m!=null,T=m?k.indexOf(m.id):-1,w=v?k.indexOf(v.id):-1,R=p.useRef(k),S=!FE(k,R.current),O=w!==-1&&T===-1||S,E=JE(f);ya(()=>{S&&z&&b(k)},[S,k,z,b]),p.useEffect(()=>{R.current=k},[k]);const M=p.useMemo(()=>({activeIndex:T,containerId:x,disabled:E,disableTransforms:O,items:k,overIndex:w,useDragOverlay:j,sortedRects:IE(k,g),strategy:d}),[T,x,E.draggable,E.droppable,O,k,w,g,j,d]);return yt.createElement(Y0.Provider,{value:M},i)}const n4=n=>{let{id:i,items:r,activeIndex:c,overIndex:d}=n;return im(r,c,d).indexOf(i)},a4=n=>{let{containerId:i,isSorting:r,wasDragging:c,index:d,items:f,newIndex:m,previousItems:h,previousContainerId:g,transition:v}=n;return!v||!c||h!==f&&d===m?!1:r?!0:m!==d&&i===g},s4={duration:200,easing:"ease"},V0="transform",l4=Ls.Transition.toString({property:V0,duration:0,easing:"linear"}),i4={roleDescription:"sortable"};function r4(n){let{disabled:i,index:r,node:c,rect:d}=n;const[f,m]=p.useState(null),h=p.useRef(r);return ya(()=>{if(!i&&r!==h.current&&c.current){const g=d.current;if(g){const v=wi(c.current,{ignoreTransform:!0}),b={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(b.x||b.y)&&m(b)}}r!==h.current&&(h.current=r)},[i,r,c,d]),p.useEffect(()=>{f&&m(null)},[f]),f}function o4(n){let{animateLayoutChanges:i=a4,attributes:r,disabled:c,data:d,getNewIndex:f=n4,id:m,strategy:h,resizeObserverConfig:g,transition:v=s4}=n;const{items:b,containerId:x,activeIndex:j,disabled:k,disableTransforms:z,sortedRects:T,overIndex:w,useDragOverlay:R,strategy:S}=p.useContext(Y0),O=c4(c,k),E=b.indexOf(m),M=p.useMemo(()=>({sortable:{containerId:x,index:E,items:b},...d}),[x,d,E,b]),X=p.useMemo(()=>b.slice(b.indexOf(m)),[b,m]),{rect:A,node:U,isOver:W,setNodeRef:I}=OE({id:m,data:M,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:X,...g}}),{active:te,activatorEvent:B,activeNodeRect:V,attributes:de,setNodeRef:le,listeners:Q,isDragging:F,over:L,setActivatorNodeRef:ee,transform:ue}=zE({id:m,data:M,attributes:{...i4,...r},disabled:O.draggable}),ke=x3(I,le),Ne=!!te,Ee=Ne&&!z&&wc(j)&&wc(w),C=!R&&F,q=C&&Ee?ue:null,re=Ee?q??(h??S)({rects:T,activeNodeRect:V,activeIndex:j,overIndex:w,index:E}):null,ye=wc(j)&&wc(w)?f({id:m,items:b,activeIndex:j,overIndex:w}):E,Re=te?.id,xe=p.useRef({activeId:Re,items:b,newIndex:ye,containerId:x}),me=b!==xe.current.items,ie=i({active:te,containerId:x,isDragging:F,isSorting:Ne,id:m,index:E,items:b,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:v,wasDragging:xe.current.activeId!=null}),Pe=r4({disabled:!ie,index:E,node:U,rect:A});return p.useEffect(()=>{Ne&&xe.current.newIndex!==ye&&(xe.current.newIndex=ye),x!==xe.current.containerId&&(xe.current.containerId=x),b!==xe.current.items&&(xe.current.items=b)},[Ne,ye,x,b]),p.useEffect(()=>{if(Re===xe.current.activeId)return;if(Re!=null&&xe.current.activeId==null){xe.current.activeId=Re;return}const Fe=setTimeout(()=>{xe.current.activeId=Re},50);return()=>clearTimeout(Fe)},[Re]),{active:te,activeIndex:j,attributes:de,data:M,rect:A,index:E,newIndex:ye,items:b,isOver:W,isSorting:Ne,isDragging:F,listeners:Q,node:U,overIndex:w,over:L,setNodeRef:ke,setActivatorNodeRef:ee,setDroppableNodeRef:I,setDraggableNodeRef:le,transform:Pe??re,transition:Ge()};function Ge(){if(Pe||me&&xe.current.newIndex===E)return l4;if(!(C&&!uu(B)||!v)&&(Ne||ie))return Ls.Transition.toString({...v,property:V0})}}function c4(n,i){var r,c;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n?.draggable)!=null?r:i.draggable,droppable:(c=n?.droppable)!=null?c:i.droppable}}function Kc(n){if(!n)return!1;const i=n.data.current;return!!(i&&"sortable"in i&&typeof i.sortable=="object"&&"containerId"in i.sortable&&"items"in i.sortable&&"index"in i.sortable)}const u4=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],d4=(n,i)=>{let{context:{active:r,collisionRect:c,droppableRects:d,droppableContainers:f,over:m,scrollableAncestors:h}}=i;if(u4.includes(n.code)){if(n.preventDefault(),!r||!c)return;const g=[];f.getEnabled().forEach(x=>{if(!x||x!=null&&x.disabled)return;const j=d.get(x.id);if(j)switch(n.code){case Qe.Down:c.top<j.top&&g.push(x);break;case Qe.Up:c.top>j.top&&g.push(x);break;case Qe.Left:c.left>j.left&&g.push(x);break;case Qe.Right:c.left<j.left&&g.push(x);break}});const v=M3({collisionRect:c,droppableRects:d,droppableContainers:g});let b=w0(v,"id");if(b===m?.id&&v.length>1&&(b=v[1].id),b!=null){const x=f.get(r.id),j=f.get(b),k=j?d.get(j.id):null,z=j?.node.current;if(z&&k&&x&&j){const w=du(z).some((X,A)=>h[A]!==X),R=X0(x,j),S=f4(x,j),O=w||!R?{x:0,y:0}:{x:S?c.width-k.width:0,y:S?c.height-k.height:0},E={x:k.left,y:k.top};return O.x&&O.y?E:Ar(E,O)}}}};function X0(n,i){return!Kc(n)||!Kc(i)?!1:n.data.current.sortable.containerId===i.data.current.sortable.containerId}function f4(n,i){return!Kc(n)||!Kc(i)||!X0(n,i)?!1:n.data.current.sortable.index<i.data.current.sortable.index}const h4={draggable:"To pick up a step, press Space or Enter. Use the arrow keys to move it, Space or Enter to drop it, Escape to cancel."};function m4(){const[n,i]=p.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return p.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)"),c=()=>i(r.matches);return r.addEventListener("change",c),()=>r.removeEventListener("change",c)},[]),n}function K0(n){return n.run.trim()||"new step"}function p4(n){return p0.find(i=>i.value===n)?.label??n}function x4({step:n,index:i,total:r,error:c,disabled:d,reducedMotion:f,registerRow:m,registerHandle:h,onChange:g,onRemove:v,onMove:b}){const{attributes:x,listeners:j,setNodeRef:k,setActivatorNodeRef:z,transform:T,transition:w,isDragging:R}=o4({id:n.key,disabled:d}),S=n.enabled!==!1,O=K0(n);return a.jsx("li",{ref:E=>{k(E),m(n.key,E)},style:{transform:Ls.Transform.toString(T),transition:f?void 0:w},tabIndex:-1,className:oe("rounded-md border p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",R?"border-dashed border-line bg-raised/20":"border-line bg-raised/40"),children:a.jsxs("div",{className:oe("flex items-start gap-2",R&&"invisible"),children:[a.jsx("button",{ref:E=>{z(E),h(n.key,E)},type:"button","aria-label":`Reorder step ${i+1}: ${O}`,title:"Drag to reorder",disabled:d,className:"mt-2 inline-flex size-6 shrink-0 touch-none cursor-grab items-center justify-center rounded-sm text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 active:cursor-grabbing disabled:cursor-not-allowed",...x,...j,children:a.jsx(Ab,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsxs("div",{className:oe("flex flex-wrap items-center gap-2",!S&&"opacity-60"),children:[a.jsxs("span",{className:"text-2xs font-medium text-faint",children:["Step ",i+1]}),a.jsx("span",{className:"min-w-0 truncate font-mono text-2xs text-muted",children:n.run.trim()||"New step"}),!S&&a.jsx(je,{tone:"neutral",children:"Skipped"})]}),a.jsx("div",{className:oe(!S&&"opacity-60"),children:a.jsx(Me,{"aria-label":`Step ${i+1} command`,value:n.run,onChange:E=>g({run:E.target.value}),error:c,placeholder:"npm ci",className:"font-mono",spellCheck:!1,autoComplete:"off",disabled:d})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2",children:[a.jsx(pa,{"aria-label":`Step ${i+1} kind`,value:n.kind,onChange:E=>g({kind:E.target.value}),className:oe("w-28 shrink-0",!S&&"opacity-60"),disabled:d,children:p0.map(E=>a.jsx("option",{value:E.value,children:E.label},E.value))}),a.jsx(Zt,{label:S?"On":"Off",ariaLabel:`Step ${i+1} (${O}) ${S?"enabled":"disabled"}`,checked:S,onChange:E=>g({enabled:E}),disabled:d,className:"min-w-36 flex-1 items-center [&>div>div]:text-xs"}),a.jsxs("div",{className:oe("flex shrink-0 items-center gap-1",!S&&"opacity-60"),children:[a.jsx(ct,{label:`Move step ${i+1} up`,size:"sm",onClick:()=>b(i-1),disabled:d||i===0,children:a.jsx($w,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Move step ${i+1} down`,size:"sm",onClick:()=>b(i+1),disabled:d||i===r-1,children:a.jsx(Cb,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Remove step ${i+1}`,size:"sm",variant:"dangerGhost",onClick:v,disabled:d,children:a.jsx(Us,{className:"size-4","aria-hidden":"true"})})]})]}),n.kind==="migrate"&&a.jsx("p",{className:oe("text-2xs text-warn",!S&&"opacity-60"),children:"Forward-only: a rollback does not undo a migration that has already run."})]})]})})}function g4({step:n,index:i,reducedMotion:r}){const c=n.enabled!==!1;return a.jsx("div",{className:"cursor-grabbing rounded-md border border-line-strong bg-surface p-3 shadow-pop",style:{transform:r?void 0:"scale(1.02)"},children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"mt-2 inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-faint",children:a.jsx(Ab,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{className:"text-2xs font-medium text-faint",children:["Step ",i+1]}),a.jsx("span",{className:"min-w-0 truncate font-mono text-2xs text-muted",children:n.run.trim()||"New step"}),!c&&a.jsx(je,{tone:"neutral",children:"Skipped"})]}),a.jsx("div",{className:"truncate rounded-md border border-line bg-canvas px-3 py-1.5 font-mono text-sm text-ink",children:n.run.trim()||"npm ci"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-2xs text-muted",children:[a.jsx("span",{children:p4(n.kind)}),a.jsx("span",{children:c?"On":"Off"})]})]})]})})}function y4({steps:n,onChange:i,errors:r,apiWarnings:c=[],disabled:d}){const[f,m]=p.useState(null),[h,g]=p.useState(null),[v,b]=p.useState(""),[x,j]=p.useState(null),k=p.useRef(new Map),z=p.useRef(new Map),T=p.useRef(n);T.current=n;const w=m4(),R=z3(ah(sm,{activationConstraint:{distance:4}}),ah(M0,{activationConstraint:{delay:150,tolerance:5}}),ah(nm,{coordinateGetter:d4}));p.useEffect(()=>{f&&(k.current.get(f)?.focus(),m(null))},[f,n]),p.useEffect(()=>{h&&(z.current.get(h)?.focus(),g(null))},[h,n]),p.useEffect(()=>{if(!x)return;const F=L=>{L.key==="Escape"&&L.preventDefault()};return window.addEventListener("keydown",F,!0),()=>window.removeEventListener("keydown",F,!0)},[x]);const S=n.length>=jc,O=F=>{const L=T.current.find(ee=>ee.key===F);return L?K0(L):"this step"},E=F=>{const L=T.current.findIndex(ee=>ee.key===F);return L===-1?1:L+1},M={onDragStart:({active:F})=>`Picked up step ${O(F.id)}. It is in position ${E(F.id)} of ${T.current.length}.`,onDragOver:({active:F,over:L})=>`Step ${O(F.id)} moved to position ${E(L?.id??F.id)} of ${T.current.length}.`,onDragEnd:({active:F,over:L})=>`Step ${O(F.id)} dropped at position ${E(L?.id??F.id)} of ${T.current.length}.`,onDragCancel:({active:F})=>`Reordering cancelled. Step ${O(F.id)} returned to position ${E(F.id)} of ${T.current.length}.`},X=(F,L)=>{if(L<0||L>=n.length||F===L)return;const ee=[...n],[ue]=ee.splice(F,1);ee.splice(L,0,ue),m(ue.key),b(`Step ${F+1} moved to position ${L+1}.`),i(ee)},A=(F,L)=>{i(n.map((ee,ue)=>ue===F?{...ee,...L}:ee))},U=F=>{b(`Step ${F+1} removed.`),i(n.filter((L,ee)=>ee!==F))},W=()=>{S||i([...n,{key:`step-${Date.now()}-${n.length}`,run:"",kind:"custom",enabled:!0}])},I=F=>{j(String(F.active.id))},te=F=>{const{active:L,over:ee}=F;if(j(null),!ee||L.id===ee.id)return;const ue=n.findIndex(Ne=>Ne.key===L.id),ke=n.findIndex(Ne=>Ne.key===ee.id);ue===-1||ke===-1||ue===ke||(g(String(L.id)),b(`Step ${ue+1} moved to position ${ke+1}.`),i(im(n,ue,ke)))},B=()=>j(null),V=DC(n),de=[...V,...c.filter(F=>!V.includes(F))],le=n.findIndex(F=>F.key===x),Q=le===-1?null:n[le];return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Steps"}),a.jsxs("span",{className:"text-2xs text-faint",children:[n.length,"/",jc," steps",S?" — remove one to add another.":""]})]}),n.length===0?a.jsx("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:"No steps. Only the start command runs; nothing is installed, built or migrated."}):a.jsxs(CE,{sensors:R,collisionDetection:O3,modifiers:[PE,QE],accessibility:{announcements:M,screenReaderInstructions:h4},onDragStart:I,onDragEnd:te,onDragCancel:B,children:[a.jsx(t4,{items:n.map(F=>F.key),strategy:WE,children:a.jsx("ul",{className:"space-y-2",children:n.map((F,L)=>a.jsx(x4,{step:F,index:L,total:n.length,error:r?.[L]??null,disabled:d,reducedMotion:w,registerRow:(ee,ue)=>{ue?k.current.set(ee,ue):k.current.delete(ee)},registerHandle:(ee,ue)=>{ue?z.current.set(ee,ue):z.current.delete(ee)},onChange:ee=>A(L,ee),onRemove:()=>U(L),onMove:ee=>X(L,ee)},F.key))})}),ol.createPortal(a.jsx(KE,{dropAnimation:w?null:void 0,children:Q&&a.jsx(g4,{step:Q,index:le,reducedMotion:w})}),document.body)]}),de.map(F=>a.jsx(ve,{tone:"warning",children:F},F)),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(ae,{size:"sm",icon:a.jsx(xa,{className:"size-3.5","aria-hidden":"true"}),onClick:W,disabled:d||S,title:S?`At most ${jc} steps. Remove one to add another.`:void 0,children:"Add step"}),S&&a.jsxs("span",{className:"text-2xs text-faint",children:["At most ",jc," steps."]})]}),a.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:v})]})}function $v(n){return{id:"",repoUrl:"",branch:"main",authType:"none",token:"",generateKey:!0,settings:x0({}),envText:"",keepReleases:String(n),autoRollback:!0,notifyChannelIds:[]}}function v4(n){return{id:n.id,repoUrl:n.repoUrl,branch:n.branch,authType:n.authType,token:"",generateKey:!0,settings:x0(n.settings,{execMode:n.execMode,instances:n.instances}),envText:TC(n.env),keepReleases:String(n.keepReleases),autoRollback:n.autoRollback,notifyChannelIds:n.notifyChannelIds}}function b4(n){const i=n.deployKey;return i&&typeof i=="object"&&typeof i.publicKey=="string"?i:typeof i=="string"&&i?{publicKey:i,fingerprint:n.deployKeyFingerprint??"",createdAt:n.deployKeyCreatedAt??"",addUrl:h0(n.repoUrl)}:null}function qv(n,i){return n instanceof He||n instanceof Error?n.message:i}function fi({overridden:n,note:i,onClear:r,onOverride:c,overrideLabel:d="Override"}){return a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-2xs text-faint",children:[a.jsx("span",{children:n?a.jsxs(a.Fragment,{children:["Override — ",i]}):i}),n?a.jsx("button",{type:"button",onClick:r,className:"rounded-sm font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:"Use ez.json / default"}):c?a.jsx("button",{type:"button",onClick:c,className:"rounded-sm font-medium text-accent-text underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50",children:d}):null]})}function j4({open:n,app:i,meta:r,onClose:c,onSaved:d,onCreated:f,onDeployNow:m,onRefresh:h}){const g=Et(),v=rn(),b=i!==null,[x,j]=p.useState(()=>$v(r.limits.keepReleasesDefault)),[k,z]=p.useState(!1),[T,w]=p.useState(!1),[R,S]=p.useState(null),[O,E]=p.useState(null),[M,X]=p.useState(!1),[A,U]=p.useState(null);p.useEffect(()=>{if(!n)return;const ce=i?v4(i):$v(r.limits.keepReleasesDefault);j(ce),U(d3(ce.settings.steps,ce.settings.start)),E(null),z(!1),S(null)},[n,i?.id]);const W=ce=>{S(null),j(De=>({...De,...ce}))},I=ce=>{S(null),j(De=>({...De,settings:{...De.settings,...ce}}))},te=ce=>{const De=zc(ce);I({steps:m0(De.steps),stepsOverride:!0,start:De.start,startOverride:!0}),U(ce)},B=async ce=>{const De=A?zc(A):{start:"",steps:[]},we=!Eh(x.settings.steps,x.settings.start,De.steps,De.start);ce===A&&!we||we&&!await v({title:"Replace the current steps?",body:`Your edited steps will be replaced by the ${kv(ce)??"Custom"} preset.`,confirmLabel:"Replace",cancelLabel:"Keep my steps",tone:"accent"})||te(ce)},V=A?zc(A):null,de=V!==null&&!Eh(x.settings.steps,x.settings.start,V.steps,V.start),le=()=>I({steps:[],stepsOverride:!1}),Q=()=>I({start:"",startOverride:!1}),F=()=>I({runtime:"node",runtimeOverride:!1}),L=()=>I({execMode:i?.execMode??"fork",execModeOverride:!1}),ee=()=>I({instances:i?.instances!==void 0?String(i.instances):"",instancesOverride:!1}),ue=x.repoUrl.trim(),ke=SC(ue),Ne=kC(x.envText),Ee=Number(x.keepReleases),C={id:b?null:wC(x.id.trim()),repoUrl:ue?x.authType==="token"&&ke?"Token access needs an https:// URL.":x.authType==="deployKey"&&!ke?"A deploy key needs an SSH URL, like git@github.com:owner/repo.git.":null:"A repository URL is required.",token:x.authType==="token"&&!x.token.trim()&&!(b&&i?.hasToken)?"A token is required.":null,port:x.settings.port.trim()?su(x.settings.port):null,healthPath:x.settings.healthPath.trim()&&!x.settings.healthPath.trim().startsWith("/")?'Must start with "/".':null,start:x.settings.startOverride&&!x.settings.start.trim()?"A start command is required while this app overrides it.":null,env:Ne.error,keepReleases:!Number.isInteger(Ee)||Ee<r.limits.keepReleasesMin||Ee>r.limits.keepReleasesMax?`A whole number from ${r.limits.keepReleasesMin} to ${r.limits.keepReleasesMax}.`:null,instances:(()=>{const ce=x.settings.instances.trim();return!ce||ce==="max"||/^\d+$/.test(ce)&&Number(ce)>=1?null:'A whole number from 1 to this server’s CPU count, or "max".'})()},q=x.settings.stepsOverride?x.settings.steps.map(ce=>ce.run.trim()?null:"A command is required."):[],Y=Object.values(C).some(Boolean)||q.some(Boolean),re=LC(x.settings.start),ye=x.settings.execMode==="cluster"&&re===!1,Re=x.settings.execMode==="fork"&&Number(x.settings.instances)>1,xe=(i?.warnings??[]).filter(ce=>!Nv(ce)&&!(x.settings.execMode==="cluster"&&ce===wv)),me=(i?.warnings??[]).filter(Nv),ie=b&&i.settings.steps===void 0&&(i.settings.install!==void 0||i.settings.build!==void 0||i.settings.migrate!==void 0),Pe=async()=>{if(T||(z(!0),Y))return;const ce={repoUrl:ue,branch:x.branch.trim()||"main",authType:x.authType,settings:_C(x.settings),env:Ne.env,keepReleases:Ee,autoRollback:x.autoRollback,notifyChannelIds:x.notifyChannelIds};x.token.trim()&&(ce.token=x.token.trim()),!b&&x.authType==="deployKey"&&(ce.generateKey=x.generateKey),w(!0),S(null);try{if(b){const nt=await fe.deployments.update(i.id,ce);d(nt,!1);return}const De=await fe.deployments.create({...ce,id:x.id.trim()}),we=b4(De);if(x.authType==="deployKey"&&x.generateKey){const nt={...De,deployKey:we?.publicKey??null};E({app:nt,key:we,keyError:we?null:De.deployKeyError??"The key was not generated."}),f?.(nt);return}d(De,!0)}catch(De){S(qv(De,"Nothing was changed."))}finally{w(!1)}},Ge=async()=>{if(!(!O||M)){X(!0);try{await fe.deployments.deploy(O.app.id),g.success(`${O.app.id} is deploying`,"Its log is in the Deployments tab."),m?.(O.app.id)}catch(ce){g.error("Could not start the deployment",qv(ce,"Nothing was started."))}finally{X(!1)}}},Fe=ce=>k?C[ce]:null;return O?a.jsxs(yn,{open:n,onClose:c,preventClose:M,size:"lg",title:`${O.app.id} created`,description:"Add its public key to the repository so deployments can read the code.",footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:c,disabled:M,children:"Close"}),a.jsx(ae,{variant:"primary",onClick:()=>void Ge(),loading:M,children:"Deploy now"})]}),children:[a.jsx(Ch,{appId:O.app.id,repoUrl:O.app.repoUrl,publicKey:O.key?.publicKey??null,fingerprint:O.key?.fingerprint??null,createdAt:O.key?.createdAt??null,onDisk:!!O.key,initialError:O.keyError,onChanged:()=>f?.(O.app)}),a.jsx("p",{className:"mt-3 text-2xs text-faint",children:"Closing keeps the app and its key; you can add the key to GitHub later from the app’s GitHub tab."})]}):a.jsx(yn,{open:n,onClose:c,preventClose:T,size:"lg",title:b?`Edit ${i.id}`:"New app",description:b?"Changes apply to the next deployment. The running release is not touched.":"Where the code lives and how this server may read it. Everything else can be left to the project.",footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:c,disabled:T,children:"Cancel"}),a.jsx(ae,{variant:"primary",type:"submit",form:"deploy-app-form",loading:T,children:b?"Save app":"Create app"})]}),children:a.jsxs("form",{id:"deploy-app-form",className:"space-y-6",onSubmit:ce=>{ce.preventDefault(),Pe()},noValidate:!0,children:[R&&a.jsx(ve,{tone:"danger",title:b?"The app was not saved":"The app was not created",children:R}),a.jsxs("section",{className:"space-y-4",children:[a.jsxs(Ja,{children:[a.jsx(Me,{label:"Name",value:x.id,onChange:ce=>W({id:ce.target.value.toLowerCase()}),disabled:b,error:Fe("id"),hint:b?"The name cannot be changed.":"Used for its folder and its PM2 process (ez-<name>).",placeholder:"my-api",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(Me,{label:"Branch",value:x.branch,onChange:ce=>W({branch:ce.target.value}),hint:"Deployed when no specific commit is named.",placeholder:"main",className:"font-mono",spellCheck:!1})]}),a.jsx(Me,{label:"Repository URL",value:x.repoUrl,onChange:ce=>W({repoUrl:ce.target.value}),error:Fe("repoUrl"),hint:"https://github.com/owner/repo.git, or git@github.com:owner/repo.git for a deploy key.",placeholder:"https://github.com/owner/repo.git",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs(pa,{label:"Repository access",value:x.authType,onChange:ce=>W({authType:ce.target.value}),hint:x.authType==="none"?"For a public repository.":x.authType==="deployKey"?"An SSH key generated here; you add its public half to the repository. Nothing secret leaves this server.":"A personal access token stored on this server and sent only to the repository host.",children:[a.jsx("option",{value:"none",children:"Public — no credentials"}),a.jsx("option",{value:"deployKey",children:"Private — deploy key (SSH)"}),a.jsx("option",{value:"token",children:"Private — access token (HTTPS)"})]}),x.authType==="token"&&a.jsx(Me,{label:"Access token",type:"password",value:x.token,onChange:ce=>W({token:ce.target.value}),error:Fe("token"),hint:b&&i.hasToken?"A token is stored. Leave this empty to keep it.":"Read-only access to this one repository is enough.",placeholder:b&&i.hasToken?"••••••••":"github_pat_…",autoComplete:"off",spellCheck:!1}),x.authType==="deployKey"&&ke?b?a.jsx(Ch,{appId:i.id,repoUrl:i.repoUrl,publicKey:i.deployKey,fingerprint:i.deployKeyFingerprint??null,createdAt:i.deployKeyCreatedAt??null,onDisk:i.deployKeyOnDisk??!!i.deployKey,onChanged:h}):a.jsx(pl,{label:"Generate a deploy key for me",hint:"Made in the same step as the app, without deploying anything. You then add its public half to the repository.",checked:x.generateKey,onChange:ce=>W({generateKey:ce})}):null]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Port and health"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Optional. An empty field is read from the repository’s"," ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", and failing that from"," ",a.jsx("code",{className:"font-mono",children:"package.json"}),"."]})]}),xe.map(ce=>a.jsx(ve,{tone:"warning",children:ce},ce)),a.jsxs(Ja,{children:[a.jsx(Me,{label:"Port",optional:!0,type:"number",min:1,max:65535,inputMode:"numeric",value:x.settings.port,onChange:ce=>I({port:ce.target.value}),error:Fe("port"),hint:"The port the app listens on. Passed to it as PORT, and used for the health check.",placeholder:"3000"}),a.jsx(Me,{label:"Health check path",optional:!0,value:x.settings.healthPath,onChange:ce=>I({healthPath:ce.target.value}),error:Fe("healthPath"),hint:"Must answer before a deployment counts. Defaults to /.",placeholder:"/healthz",className:"font-mono",spellCheck:!1})]})]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Runtime"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"What runs the app. Node.js is the only runtime Easy DevOps can supervise today; the others are shown so the plan is clear."})]}),a.jsx(p3,{value:x.settings.runtime,onChange:ce=>I({runtime:ce,runtimeOverride:!0})}),x.settings.runtime==="node"&&a.jsx(h3,{value:A,modifiedFrom:de&&A?kv(A):null,onSelect:ce=>void B(ce),onReset:()=>{A&&te(A)}}),a.jsx(fi,{overridden:x.settings.runtimeOverride,note:x.settings.runtimeOverride?"the runtime is saved on this app instead of ez.json.":"No override — the runtime comes from ez.json, else Node.js.",onClear:F})]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Commands"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["The start command and the steps run in a new release, in this order. Steps are one field: saving them replaces the repository’s list, and clearing the override goes back to ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]})]}),ie&&a.jsx(ve,{tone:"info",title:"Saved in the old format",children:"These commands came from the separate install, build and migrate fields. Saving the app stores them as one ordered steps list."}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Me,{label:"Start command",value:x.settings.start,onChange:ce=>I({start:ce.target.value,startOverride:!0}),error:Fe("start"),hint:"The long-running process. Any language: node server.js, python app.py, ./server.",placeholder:"from ez.json, or npm start",className:"font-mono",spellCheck:!1}),a.jsx(fi,{overridden:x.settings.startOverride,note:x.settings.startOverride?"the start command is saved on this app instead of ez.json.":"No override — read from ez.json, else package.json’s start script.",onClear:Q})]}),x.settings.stepsOverride?a.jsxs("div",{className:"space-y-2",children:[a.jsx(y4,{steps:x.settings.steps,onChange:ce=>I({steps:ce}),errors:k?q:void 0,apiWarnings:me}),a.jsx(fi,{overridden:!0,note:"the steps are saved on this app instead of ez.json.",onClear:le})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"rounded-md border border-dashed border-line bg-raised/30 px-3 py-4 text-xs text-muted",children:["No steps are saved on this app. Its install, build and migrate commands come from"," ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", or from"," ",a.jsx("code",{className:"font-mono",children:"package.json"}),"."]}),a.jsx(fi,{overridden:!1,note:"No override — the steps come from ez.json.",onClear:le,onOverride:()=>I({stepsOverride:!0}),overrideLabel:"Override steps"})]})]}),x.settings.runtime==="node"&&a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Process mode"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Fork runs one process. Cluster runs one worker per instance, and needs a start command of the form ",a.jsx("code",{className:"font-mono",children:"node <file>"}),"."]})]}),a.jsxs(Ja,{children:[a.jsxs(pa,{label:"Process mode",value:x.settings.execMode,onChange:ce=>I({execMode:ce.target.value,execModeOverride:!0}),hint:"Cluster runs one worker per instance. It needs a start command of the form node <file>.",children:[a.jsx("option",{value:"fork",children:"Fork — one process"}),a.jsx("option",{value:"cluster",disabled:re===!1,children:"Cluster — several workers"})]}),a.jsx(Me,{label:"Instances",optional:!0,value:x.settings.instances,onChange:ce=>I({instances:ce.target.value,instancesOverride:!0}),error:Fe("instances"),hint:"A whole number up to this server’s CPU count, or “max”. Leave empty for 1.",placeholder:"1"})]}),a.jsx(fi,{overridden:x.settings.execModeOverride,note:x.settings.execModeOverride?"the process mode is saved on this app instead of ez.json.":b?"No override — the effective mode comes from ez.json, else the default.":"No override yet — fork is the default.",onClear:L}),a.jsx(fi,{overridden:x.settings.instancesOverride,note:x.settings.instancesOverride?"the instance count is saved on this app instead of ez.json.":b?"No override — the effective count comes from ez.json, else the default (1).":"No override yet — one instance is the default.",onClear:ee}),ye&&a.jsxs(ve,{tone:"warning",children:["Cluster mode needs a start command that runs a JS file directly, such as"," ",a.jsx("code",{className:"font-mono",children:"node dist/index.js"})," — not an npm script or another language. Change the start command, or choose Fork."]}),x.settings.execMode==="cluster"&&a.jsx(ve,{tone:"warning",title:"Cluster mode",children:wv}),Re&&a.jsxs(ve,{tone:"warning",children:["Fork mode starts one process. Several forked copies would all bind the same port — choose Cluster for ",x.settings.instances," instances."]})]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Persistent data"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Each deployment runs from a fresh copy of your code. Files written to at runtime are lost on the next deploy — and on rollback. Every path listed here, a folder or a single file, lives in a shared location that every deployment and every rollback reuses."})]}),a.jsx(W5,{label:"Folders and files to keep",optional:!0,value:x.settings.persist,onChange:ce=>I({persist:ce}),normalize:(ce,De)=>{const we=MC(ce,De);return{value:we.path,error:we.error}},max:20,hint:"Add folders your app writes to: uploads, SQLite data, logs — or one file, such as prisma/app.db. Press Enter after each path.",placeholder:"data, uploads, prisma/app.db"}),a.jsxs("div",{className:"space-y-1 text-2xs text-faint",children:[a.jsxs("p",{children:["The first deployment copies the current contents into the shared location; after that, the shared copy is what counts — changes to it in the repository are ignored. A folder is usually the safer unit: SQLite creates ",a.jsx("code",{className:"font-mono",children:"-wal"})," and"," ",a.jsx("code",{className:"font-mono",children:"-shm"})," files next to its database. Left empty, the list is read from ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]}),b&&i?.sharedDir&&a.jsxs("p",{className:"break-all",children:["Kept in ",a.jsx("span",{className:"font-mono",children:i.sharedDir})]})]})]}),a.jsx("section",{className:"space-y-4 border-t border-line pt-5",children:a.jsx(Lc,{label:"Environment variables",optional:!0,rows:5,value:x.envText,onChange:ce=>W({envText:ce.target.value}),error:Fe("env"),hint:"One NAME=value per line; a pasted .env file works. Stored on this server only, and available to the build and the running app.",placeholder:`DATABASE_URL=postgres://…
|
|
526
|
-
NODE_ENV=production`,className:"font-mono",spellCheck:!1})}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Zt,{checked:x.autoRollback,onChange:ce=>W({autoRollback:ce}),label:"Roll back automatically",description:"If a new release starts but fails its health check, the previous release is started again."}),a.jsx(Ja,{children:a.jsx(Me,{label:"Releases to keep",type:"number",min:r.limits.keepReleasesMin,max:r.limits.keepReleasesMax,inputMode:"numeric",value:x.keepReleases,onChange:ce=>W({keepReleases:ce.target.value}),error:Fe("keepReleases"),hint:"Older ones are deleted. The live release and the one before it are always kept."})}),a.jsx(wh,{channels:r.channels,value:x.notifyChannelIds,onChange:ce=>W({notifyChannelIds:ce}),label:"Notify on every deployment",emptyHref:"/notifications",disabled:T})]})]})})}function Gv(n){return n.domain?"domain":n.bind==="0.0.0.0"?"direct":"local"}function N4({open:n,hook:i,domains:r,onClose:c,onSaved:d}){const f=Et(),[m,h]=p.useState(i.enabled),[g,v]=p.useState(Gv(i)),[b,x]=p.useState(i.domain??""),[j,k]=p.useState(String(i.port)),[z,T]=p.useState(!1),[w,R]=p.useState(!1);p.useEffect(()=>{n&&(h(i.enabled),v(Gv(i)),x(i.domain??""),k(String(i.port)),R(!1))},[n]);const S=r.filter(A=>A.enabled),O=S.find(A=>A.name===b),E=su(j),M=m&&g==="domain"&&!O?"Choose a domain.":null,X=async()=>{if(!z&&(R(!0),!(E||M))){T(!0);try{const A=await fe.deployments.updateHook({enabled:m,port:Number(j),bind:g==="direct"?"0.0.0.0":"127.0.0.1",domain:g==="domain"?b:null});A.nginxReloaded===!1?f.warning("Saved, but nginx was not reloaded","The domain’s config was written. Reload nginx for the deploy hook to be reachable."):f.success("Deploy hook saved",m?`The background service picks it up within ${A.appliesWithinSeconds??10} seconds.`:"Nothing is listening for deployments now."),d(A)}catch(A){const U=A instanceof He&&typeof A.payload.detail=="string"?A.payload.detail:null;f.error("Could not save the deploy hook",U??(A instanceof Error?A.message:"Nothing was changed."))}finally{T(!1)}}};return a.jsx(yn,{open:n,onClose:c,preventClose:z,size:"md",title:"Deploy hook",description:"Lets a GitHub Action tell this server to deploy. Each app has its own token; the hook can do nothing else.",footer:a.jsxs(a.Fragment,{children:[a.jsx(ae,{variant:"secondary",onClick:c,disabled:z,children:"Cancel"}),a.jsx(ae,{variant:"primary",onClick:()=>void X(),loading:z,children:"Save"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(Zt,{checked:m,onChange:h,label:"Accept deployments from CI",description:"Off by default. While it is off nothing listens, and apps can only be deployed from this dashboard."}),m&&a.jsxs(a.Fragment,{children:[a.jsxs(pa,{label:"How CI reaches it",value:g,onChange:A=>v(A.target.value),children:[a.jsx("option",{value:"domain",children:"Through one of my domains (recommended)"}),a.jsx("option",{value:"direct",children:"Directly, on its own port"}),a.jsx("option",{value:"local",children:"This machine only"})]}),g==="domain"&&a.jsxs(a.Fragment,{children:[a.jsxs(pa,{label:"Domain",value:b,onChange:A=>x(A.target.value),error:w?M:null,hint:"One path, /.ez-deploy/, is added to this domain’s nginx config. Nothing else becomes reachable.",children:[a.jsx("option",{value:"",children:"Choose a domain…"}),S.map(A=>a.jsxs("option",{value:A.name,children:[A.name,A.ssl?"":" — no SSL"]},A.name))]}),S.length===0&&a.jsx(ve,{tone:"warning",children:"There is no enabled domain yet. Add one on the Domains page, or reach the hook directly."}),O&&!O.ssl&&a.jsx(ve,{tone:"warning",title:"This domain has no certificate",children:"The deploy token would travel over plain HTTP. Issue a certificate for it on the SSL page first."})]}),g==="direct"&&a.jsx(ve,{tone:"warning",title:"Plain HTTP, on every network interface",children:"The deploy token is sent unencrypted, and the port has to be opened in your firewall. Use a domain with SSL unless this server sits on a private network."}),g==="local"&&a.jsx(ve,{tone:"info",children:"Only programs on this server can call the hook — useful with your own tunnel or reverse proxy. GitHub cannot reach it."}),a.jsx(Ja,{children:a.jsx(Me,{label:"Listener port",type:"number",min:1,max:65535,inputMode:"numeric",value:j,onChange:A=>k(A.target.value),error:w?E:null,hint:g==="direct"?"The port CI connects to.":"Internal. nginx forwards to it; it is not opened to the network."})})]})]})})}function w4(n,i){return n instanceof He||n instanceof Error?n.message:i}function S4({data:n,onConfigure:i}){const{hook:r}=n,c=r.enabled&&(r.domain!==null||r.bind==="0.0.0.0"),f=!!(r.domain?n.domains.find(v=>v.name===r.domain):void 0)?.ssl;let m="neutral",h="Off",g="Apps are deployed from this dashboard only. Turn it on to deploy from GitHub Actions.";return r.enabled&&!r.listening?(m="warn",h="Not listening",g="It is switched on, but nothing answers on its port yet. The background service starts it within a few seconds; if it stays like this, check that the service is running."):r.enabled&&!c?(m="neutral",h="This machine only",g="Listening, but only programs on this server can call it. GitHub cannot reach it."):r.enabled&&r.domain?(m=f?"ok":"warn",h=f?"On":"On — no SSL",g=f?`Reached through https://${r.domain}${r.path}`:`Reached through http://${r.domain}${r.path} — the deploy token travels unencrypted. Issue a certificate for that domain.`):r.enabled&&(m="warn",h="On — plain HTTP",g=`Listening on every interface, port ${r.port}. The deploy token travels unencrypted; prefer a domain with SSL.`),a.jsx(et,{children:a.jsx(pn,{icon:a.jsx(Wc,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:["Deploy hook",a.jsx(je,{tone:m,dot:!0,children:h})]}),description:g,actions:a.jsx(ae,{size:"sm",icon:a.jsx(Bb,{className:"size-3.5","aria-hidden":"true"}),onClick:i,children:"Configure"})})})}function k4({app:n,canDeploy:i,busy:r,onDeploy:c,onOpen:d,onEdit:f,onDelete:m}){const h=n.lastRun??null,g=n.process??null,v=h?g0[h.status]:null;return a.jsxs("li",{className:"flex flex-col gap-3 px-4 py-3.5 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 lg:flex-row lg:items-center lg:gap-4",children:[a.jsxs("button",{type:"button",onClick:()=>d("activity"),className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[a.jsx(ln,{tone:g?GC(g.status):"neutral",pulse:g?.status==="online",className:"mt-1.5"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block truncate font-mono text-sm font-semibold text-ink",children:n.id}),a.jsxs("span",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-muted",children:[a.jsx("span",{className:"truncate font-mono",title:n.repoUrl,children:R5(n.repoUrl,44)}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(RS,{className:"size-3","aria-hidden":"true"}),n.branch]}),n.domain&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-accent-text",children:[a.jsx(Os,{className:"size-3","aria-hidden":"true"}),n.domain]})]}),a.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-faint",children:[g?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[g.status,g.status==="online"&&g.uptimeMs!==null?` · up ${eu(g.uptimeMs)}`:""]}),g.memoryBytes!==null&&a.jsxs("span",{children:["· ",Pb(g.memoryBytes)]}),g.restarts>0&&a.jsxs("span",{children:["· ",$n(g.restarts,"restart")]})]}):a.jsx("span",{children:n.currentRelease?"Not running":"Never deployed"}),Bc(n)&&a.jsxs("span",{children:["· ",Bc(n)]})]}),n.warnings?.length?a.jsx("span",{className:"mt-1 block text-2xs text-warn",children:n.warnings.join(" ")}):null]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2 pl-7 lg:w-56 lg:shrink-0 lg:pl-0",children:n.deploying?a.jsx(je,{tone:"info",dot:!0,children:h?.status==="running"?iu(h.step):"Deploying"}):v&&h?a.jsxs(a.Fragment,{children:[a.jsx(je,{tone:v.tone,dot:!0,children:v.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:zr(h.sha)}),a.jsx("span",{className:"text-2xs text-faint",children:$r(h.finishedAt??h.startedAt)})]}):a.jsx("span",{className:"text-2xs text-faint",children:"No deployments yet"})}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1.5 pl-7 lg:pl-0",children:[a.jsx(ae,{variant:"primary",size:"sm",icon:a.jsx(Cr,{className:"size-3.5","aria-hidden":"true"}),onClick:c,loading:r,disabled:!i||!!n.deploying,children:"Deploy"}),a.jsx(ae,{size:"sm",onClick:()=>d("setup"),children:"Domain"}),a.jsx(ae,{size:"sm",onClick:()=>d("github"),children:"GitHub"}),a.jsx(ct,{label:`Edit ${n.id}`,size:"sm",onClick:f,children:a.jsx(Yh,{className:"size-4","aria-hidden":"true"})}),a.jsx(ct,{label:`Delete ${n.id}`,size:"sm",variant:"dangerGhost",onClick:m,disabled:!!n.deploying,children:a.jsx(Us,{className:"size-4","aria-hidden":"true"})})]})]})}function T4(){ba("Deployments");const n=Et(),i=Ct(E=>fe.deployments.list(E),[]),r=i.data,c=!!r?.apps.some(E=>E.deploying);yl(i.reload),hl(i.reload,c?2e3:1e4);const[d,f]=p.useState(!1),[m,h]=p.useState(null),[g,v]=p.useState(!1),[b,x]=p.useState(null),[j,k]=p.useState(null),[z,T]=p.useState(null),w=()=>{h(null),f(!0)},R=async E=>{if(!j){k(E.id);try{await fe.deployments.deploy(E.id),x({id:E.id,tab:"activity"}),i.reload()}catch(M){n.error(`Could not deploy ${E.id}`,w4(M,"Nothing was started."))}finally{k(null)}}},S=a.jsx(La,{title:"Deployments",description:"Put a project from a git repository on this server: fetched, built and started here, with earlier releases kept to roll back to.",actions:a.jsxs(a.Fragment,{children:[a.jsx(ct,{label:"Refresh",onClick:i.reload,children:a.jsx(Tt,{className:"size-4","aria-hidden":"true"})}),a.jsx(ae,{variant:"primary",icon:a.jsx(xa,{className:"size-4","aria-hidden":"true"}),onClick:w,disabled:!r,children:"New app"})]})});if(i.error&&!r)return a.jsxs(a.Fragment,{children:[S,a.jsx($t,{error:i.error,onRetry:i.reload})]});if(!r)return a.jsxs(a.Fragment,{children:[S,a.jsxs(ns,{children:[a.jsx(tt,{className:"h-20 rounded-lg"}),a.jsx(tt,{className:"h-56 rounded-lg"})]})]});const O=r.requirements.git&&r.requirements.pm2;return a.jsxs(a.Fragment,{children:[S,a.jsxs("div",{className:"space-y-5",children:[!r.requirements.git&&a.jsx(ve,{tone:"danger",title:"git is not installed on this server",children:"Deployments fetch the code with git. Install it, and make sure it is on the PATH of the Easy DevOps service."}),!r.requirements.pm2&&a.jsxs(ve,{tone:"warning",title:"PM2 is not installed",action:a.jsx(kt,{to:"/processes",className:ma("secondary","sm"),children:"Open Processes"}),children:["Deployed apps are kept running by PM2. Install it from the Processes page, or with"," ",a.jsx("code",{className:"font-mono",children:"npm install -g pm2"}),"."]}),a.jsx(S4,{data:r,onConfigure:()=>v(!0)}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Cr,{className:"size-4","aria-hidden":"true"}),title:"Apps",description:r.apps.length===0?"Nothing is deployed from here yet.":`${$n(r.apps.length,"app")}. Each runs under PM2 as ez-<name>.`}),r.apps.length===0?a.jsx(xn,{children:a.jsx(ga,{icon:a.jsx(Cr,{className:"size-5","aria-hidden":"true"}),title:"Deploy your first app",description:a.jsxs(a.Fragment,{children:["Give it a repository. A Node project needs nothing else; for any other language, add an ",a.jsx("code",{className:"font-mono",children:"ez.json"})," with its install, build and start commands."]}),action:a.jsx(ae,{variant:"primary",icon:a.jsx(xa,{className:"size-4","aria-hidden":"true"}),onClick:w,children:"New app"})})}):a.jsx("ul",{className:"divide-y divide-line",children:r.apps.map(E=>a.jsx(k4,{app:E,canDeploy:O,busy:j===E.id,onDeploy:()=>void R(E),onOpen:M=>x({id:E.id,tab:M}),onEdit:()=>{h(E),f(!0)},onDelete:()=>T(E)},E.id))})]})]}),a.jsx(j4,{open:d,app:m,meta:r,onClose:()=>f(!1),onRefresh:i.reload,onCreated:()=>i.reload(),onDeployNow:E=>{f(!1),x({id:E,tab:"activity"}),i.reload()},onSaved:(E,M)=>{f(!1),i.reload(),M?n.success(`${E.id} created`,"Press Deploy to build and start it."):n.success(`${E.id} saved`,"It applies to the next deployment.")}}),a.jsx(N4,{open:g,hook:r.hook,domains:r.domains,onClose:()=>v(!1),onSaved:()=>{v(!1),i.reload()}}),a.jsx(c3,{appId:b?.id??null,initialTab:b?.tab,hook:r.hook,meta:r,onClose:()=>x(null),onConfigureHook:()=>v(!0),onChanged:i.reload,onDelete:E=>T(E)}),a.jsx(FC,{app:z,onClose:()=>T(null),onDeleted:()=>{T(null),x(null),i.reload()}})]})}const Yv=[{id:"error",label:"Error",fileName:"error.log"},{id:"access",label:"Access",fileName:"access.log"}];function C4(n){return/\[(error|crit|emerg|alert)\]/.test(n)?"text-bad":/\[(warn|warning)\]/.test(n)?"text-warn":/\s(2\d\d|3\d\d)\s/.test(n)?"text-ok":"text-muted"}function E4(){ba("Logs");const{connectionError:n}=vn(),[i,r]=Jc(),d=i.get("file")==="access"?"access":"error",f=Yv.find(k=>k.id===d),m=k=>{const z=new URLSearchParams(i);k==="error"?z.delete("file"):z.set("file",k),r(z,{replace:!0})},h=c0(d,{limit:500}),g=p.useRef(null),[v,b]=p.useState(!0);p.useEffect(()=>{const k=g.current;k&&v&&(k.scrollTop=k.scrollHeight)},[h.lines,v]);const x=h.paused,j=h.connected&&!x;return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Logs",description:"nginx output as it is written. The stream follows the file; switching tabs does not restart nginx.",meta:a.jsx(je,{tone:x?"warn":h.connected?"ok":"bad",dot:!0,children:x?"Paused":h.connected?"Live":"Reconnecting"}),actions:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex items-center gap-1 rounded-md border border-line bg-raised/60 p-1",role:"group","aria-label":"Log file",children:Yv.map(k=>a.jsx("button",{type:"button","aria-pressed":d===k.id,onClick:()=>m(k.id),className:oe("rounded-sm px-3 py-1 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",d===k.id?"bg-surface text-ink shadow-sm":"text-muted hover:text-ink"),children:k.label},k.id))}),a.jsx(ae,{variant:"secondary",size:"sm",icon:x?a.jsx(Hr,{className:"size-3.5","aria-hidden":"true"}):a.jsx(_b,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>h.setPaused(!x),children:x?"Resume":"Pause"}),a.jsx(ae,{variant:"ghost",size:"sm",icon:a.jsx(Us,{className:"size-3.5","aria-hidden":"true"}),onClick:h.clear,disabled:h.lines.length===0,children:"Clear"}),a.jsx(ae,{variant:"ghost",size:"sm",icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:h.restart,disabled:!h.connected,children:"Reload tail"}),a.jsx(qt,{value:h.lines.join(`
|
|
527
|
-
`),label:"Copy logs",withText:!0})]})}),n&&a.jsx(ve,{tone:"warning",title:"The live stream is disconnected",className:"mb-4",children:"New lines appear once the dashboard socket reconnects. nginx itself is unaffected."}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-line bg-raised/40 px-4 py-2 sm:px-5",children:[a.jsxs("span",{className:"inline-flex items-center gap-2 font-mono text-2xs text-muted",children:[a.jsx(ln,{tone:x?"warn":h.connected?"ok":"bad",pulse:j}),x?"Paused":h.connected?"Live":"Reconnecting"]}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:f.fileName}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:h.lines.length===1?"1 line":`${h.lines.length} lines`}),x&&h.missed>0&&a.jsxs(je,{tone:"warn",children:[h.missed===999?"999+":h.missed," new while paused"]}),a.jsx("span",{className:"ml-auto text-2xs text-faint",children:v?"Following the tail":"Scrolled back"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{ref:g,role:"log","aria-label":`nginx ${f.label.toLowerCase()} log`,"aria-live":"off",onScroll:()=>{const k=g.current;k&&b(k.scrollHeight-k.scrollTop-k.clientHeight<40)},className:"h-[calc(100dvh-20rem)] min-h-72 overflow-y-auto bg-canvas p-4 font-mono text-xs leading-relaxed",children:h.lines.length===0?a.jsx("p",{className:"italic text-faint",children:h.connected?d==="access"?"No access lines yet. They appear here as nginx writes them.":"No error lines yet.":"Waiting for the live stream…"}):h.lines.map((k,z)=>a.jsx("div",{className:oe("whitespace-pre-wrap break-all py-0.5",C4(k)),children:k},`${z}-${k}`))}),!v&&a.jsxs("button",{type:"button",onClick:()=>{const k=g.current;k&&(k.scrollTop=k.scrollHeight),b(!0)},className:"absolute bottom-3 right-3 inline-flex items-center gap-1.5 rounded-pill border border-line bg-surface px-3 py-1.5 text-2xs font-medium text-ink shadow-pop transition-colors hover:bg-inset",children:[a.jsx(Cb,{className:"size-3","aria-hidden":"true"}),"Jump to latest"]})]})]}),a.jsx("p",{className:"mt-3 text-2xs text-faint",children:"The dashboard keeps the last 500 lines in memory for this tab. Pausing only stops the display — lines keep being written to disk."})]})}const Vv={not_linked:"Not linked",connecting:"Connecting…",connected:"Connected",rejected:"Rejected by the Hub",unreachable:"Hub unreachable"},Xv={connected:"ok",connecting:"warn",unreachable:"warn",rejected:"bad",not_linked:"neutral"};function rh(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function R4({checked:n,indeterminate:i,disabled:r,label:c,onChange:d}){const f=p.useRef(null);return p.useEffect(()=>{f.current&&(f.current.indeterminate=i)},[i]),a.jsx("input",{ref:f,type:"checkbox","aria-label":`All ${c} permissions`,checked:n,disabled:r,onChange:m=>d(m.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"})}function oh(n,i){return!!n.comingSoon||i.includes(n.id)}function z4(){const n=Et(),i=rn(),r=Ct(B=>fe.hub.status(B)),c=r.setData,[d,f]=p.useState(""),[m,h]=p.useState(null),[g,v]=p.useState(!1),[b,x]=p.useState(!1),[j,k]=p.useState(!1),z=r.data?.status??"not_linked",{client:T}=vn();p.useEffect(()=>{if(!T)return;const B=V=>{c(de=>de&&{...de,linked:V.linked,connected:V.connected,status:V.status,lastError:V.lastError,attempts:V.attempts,...V.linked?{}:{hubUrl:null,serverId:null,permissions:{}}})};return T.on("hub:agentState",B),()=>T.off("hub:agentState",B)},[T,c]);const w=async()=>{if(g)return;const B=vT(d);if(B){h(B);return}h(null),v(!0);try{const V=await fe.hub.connect(d.trim());r.setData(V.status),f(""),n.success("Connection string saved",V.status.status==="connecting"?"Connecting to the Hub…":"This server is now linked to the Hub.")}catch(V){h(rh(V,"The Hub did not accept that connection string."))}finally{v(!1)}},R=async()=>{if(!(b||!await i({title:"Unlink this server from the Hub?",body:"The Hub stops receiving data from this server. Domains and certificates are not affected.",confirmLabel:"Unlink",tone:"danger"}))){x(!0);try{await fe.hub.unlink(),r.setData(V=>V&&{...V,linked:!1,hubUrl:null,serverId:null,connected:!1,status:"not_linked",permissions:{},lastError:null,attempts:0}),f(""),h(null),n.success("Unlinked from the Hub")}catch(V){n.error("Could not unlink",rh(V,"The link is still in place."))}finally{x(!1)}}},S=r.data?.permissions??{},O=r.data?.tree??[],E=r.data?.comingSoon??[],M=async(B,V)=>{if(!j){k(!0),r.setData(de=>{if(!de)return de;const le={...de.permissions};for(const Q of B)le[Q]=V;return{...de,permissions:le}});try{const de={};for(const Q of B)de[Q]=V;const le=await fe.hub.updatePermissions(de);r.setData(Q=>Q&&{...Q,permissions:le.permissions,tree:le.tree,comingSoon:le.comingSoon})}catch(de){n.error("Could not save permissions",rh(de,"The change was not kept.")),r.reload()}finally{k(!1)}}},X=B=>{const V=B.children.filter(le=>!oh(le,E));if(V.length===0)return"off";const de=V.filter(le=>S[le.id]===!0).length;return de===0?"off":de===V.length?"on":"partial"},A=(B,V)=>{const de=B.children.filter(le=>!oh(le,E)).map(le=>le.id);de.length!==0&&M(de,V)},U=Object.values(S).filter(Boolean).length,W=B=>a.jsxs("div",{className:"w-full max-w-md space-y-3",children:[a.jsx(Lc,{label:"Connection string",value:d,onChange:V=>{f(V.target.value),m&&h(null)},placeholder:"ezops://https://hub.example.com|server-id|secret",hint:"Shown only once by the Hub. Treat it like a password.",error:m,className:"font-mono",spellCheck:!1,autoComplete:"off",rows:3}),a.jsx(ae,{variant:"primary",loading:g,disabled:!d.trim(),icon:a.jsx(VS,{className:"size-4","aria-hidden":"true"}),onClick:()=>void w(),children:B})]}),I=Xv[z]??"neutral",te=(()=>{if(r.error&&!r.data)return a.jsx(xn,{children:a.jsx($t,{error:r.error,title:"Could not read the Hub status",onRetry:r.reload,className:"border-0"})});if(!r.data)return a.jsxs(xn,{className:"space-y-3",children:[a.jsx(tt,{className:"h-5 w-48"}),a.jsx(tt,{className:"h-24 rounded-md"}),a.jsx(tt,{className:"h-40 rounded-md"})]});const B=r.data,V=Vv[B.status]??"Unknown state",de=Xv[B.status]??"neutral";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line bg-raised/40 px-4 py-3 sm:px-5",children:[a.jsx(ln,{tone:de,pulse:B.status==="connecting"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:V}),B.hubUrl&&a.jsx("code",{className:"break-all font-mono text-xs text-muted",children:B.hubUrl}),B.serverId&&a.jsxs("span",{className:"text-2xs text-faint",children:["Server ID ",a.jsx("code",{className:"font-mono text-muted",children:B.serverId})]}),B.linked&&a.jsx("span",{className:"text-2xs text-faint",title:B.agentOwner==="daemon"?"The Hub connection is held by the background service, which keeps it alive with no browser open.":"The Hub connection is held by this dashboard and stops when it closes.",children:B.agentOwner==="daemon"&&!B.agentReported?"waiting for the background service…":B.agentOwner==="daemon"?"via the background service":"via this dashboard"}),B.status==="unreachable"&&B.attempts>0&&a.jsxs("span",{className:"text-2xs text-faint",children:[B.attempts," reconnect attempt",B.attempts===1?"":"s"]})]}),a.jsxs("div",{className:"flex flex-wrap items-start gap-x-2 gap-y-1 border-b border-line px-4 py-2.5 text-2xs sm:px-5",children:[a.jsx("span",{className:"font-medium uppercase tracking-wider text-faint",children:"Data directory"}),a.jsx("code",{className:"break-all font-mono text-muted",children:B.dataDir}),B.devDataDir&&a.jsx(je,{tone:"warn",children:"dev override"}),B.devDataDir&&a.jsx("span",{className:"w-full text-faint",children:"This is not the normal data directory. The CLI must run with the same override, or it reads and writes a different domain list."})]}),a.jsxs(xn,{className:"space-y-5",children:[B.lastError&&a.jsx(ve,{tone:B.status==="rejected"?"danger":"warning",title:B.status==="rejected"?"The Hub rejected this server":"The Hub cannot be reached right now",children:B.lastError}),B.linked?a.jsxs(a.Fragment,{children:[B.status==="rejected"&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"This link cannot recover by itself. Paste a fresh connection string from the Hub to replace it."}),W("Reconnect")]}),a.jsxs("section",{className:"space-y-3","aria-labelledby":"hub-permissions-heading",children:[a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h3",{id:"hub-permissions-heading",className:"text-sm font-semibold text-ink",children:"Allow the Hub to"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Monitoring — metrics, nginx status, domains and certificate expiry — is always on. These toggles are enforced on this server; the Hub cannot grant itself anything."})]}),a.jsxs(je,{tone:U>0?"accent":"neutral",children:[U," granted"]})]}),a.jsx("div",{className:"space-y-2.5",children:O.map(le=>{const Q=X(le);return a.jsxs("div",{className:"overflow-hidden rounded-md border border-line",children:[a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 bg-raised/60 px-3.5 py-2.5",children:[a.jsx(R4,{checked:Q==="on",indeterminate:Q==="partial",disabled:j,label:le.label,onChange:F=>A(le,F)}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:le.label}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:le.description})]})]}),a.jsx("ul",{className:"divide-y divide-line/60",children:le.children.map(F=>{const L=oh(F,E),ee=S[F.id]===!0;return a.jsx("li",{children:a.jsxs("label",{className:oe("flex items-start gap-3 px-3.5 py-2.5 pl-8",L?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-inset/60"),children:[a.jsx("input",{type:"checkbox",checked:ee,disabled:L||j,onChange:()=>void M([F.id],!ee),className:"mt-0.5 size-3.5 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2 text-sm text-ink",children:[F.label,L&&a.jsx(je,{tone:"warn",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-xs text-faint",children:F.description})]})]})},F.id)})})]},le.id)})})]}),a.jsx("div",{className:"border-t border-line pt-4",children:a.jsx(ae,{variant:"dangerGhost",loading:b,icon:a.jsx(Yk,{className:"size-4","aria-hidden":"true"}),onClick:()=>void R(),children:"Unlink from Hub"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm text-muted",children:"Add this server in the Hub first, then paste the connection string it gives you."}),a.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted",children:[a.jsxs("li",{children:["Open your Hub dashboard → ",a.jsx("span",{className:"text-ink",children:"Add Server"})]}),a.jsx("li",{children:"Enter a display name and submit"}),a.jsx("li",{children:"Copy the connection string the Hub shows you"}),a.jsx("li",{children:"Paste it below and click Connect"})]})]}),W("Connect")]})]})]})})();return a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",I==="ok"?"bg-ok/60":I==="bad"?"bg-bad/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Pw,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Easy DevOps Hub",r.data&&a.jsx(je,{tone:I,dot:!0,children:Vv[r.data.status]??"Unknown"}),r.data?.devDataDir&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Monitor and control this server from a central dashboard.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:r.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:r.reload,children:"Refresh"})}),te,r.loading&&r.data&&a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:[a.jsx(_s,{}),"Refreshing the Hub state…"]})]})}const D4=["starting","stopping","updating","restarting"],ch=[{id:"starting",label:"Hand over to the update worker"},{id:"stopping",label:"Stop the dashboard and the service"},{id:"updating",label:"Install the new version"},{id:"restarting",label:"Start the dashboard again"}],Kv={starting:"Starting…",stopping:"Stopping…",updating:"Updating…",restarting:"Restarting…",done:"Completed",failed:"Failed",interrupted:"Interrupted"},A4={starting:"warn",stopping:"warn",updating:"warn",restarting:"warn",done:"ok",failed:"bad",interrupted:"warn"};function O4(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function Zv(n){return n!==void 0&&D4.includes(n)}function Qv({run:n}){const i=[];return n.serviceInstalled?i.push({label:"Background service",value:n.versionConfirmed?`Running v${n.runningVersion} (reported by the daemon)`:`Restarted, reporting ${n.runningVersion?`v${n.runningVersion}`:"an unknown version"}`}):i.push({label:"Background service",value:"Not installed — the package was updated on its own"}),n.refreshedCopy&&i.push({label:"Runtime copy",value:"Refreshed, so the service runs the new code"}),n.dashboardRestarted===!1?i.push({label:"Dashboard",value:"Did not come back automatically — start it from the CLI"}):n.dashboardPort&&i.push({label:"Dashboard",value:`Running again on port ${n.dashboardPort}`}),a.jsx("dl",{className:"grid gap-x-6 gap-y-2 text-xs sm:grid-cols-[auto_1fr]",children:i.map(r=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"font-medium uppercase tracking-wider text-faint",children:r.label}),a.jsx("dd",{className:"text-muted",children:r.value})]},r.label))})}function M4({run:n}){const i=n.finishedAt?Zh(new Date(n.finishedAt).toISOString()):null;return n.phase==="done"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ve,{tone:"success",title:`Updated v${n.from} → v${n.to}`,children:[i?`Finished ${i}. `:"","The dashboard runs the new version from now on."]}),a.jsx(Qv,{run:n}),n.dashboardRestarted===!1&&a.jsxs(ve,{tone:"warning",title:"The dashboard did not come back by itself",children:["Start it again with ",a.jsx("code",{className:"font-mono",children:"ezz --dash"})," in a terminal."]})]}):n.phase==="interrupted"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ve,{tone:"warning",title:"The update was interrupted",children:["The worker that performs the update stopped reporting",n.step?` during “${n.step}”`:"",". Nothing here can say what state the files are in — run ",a.jsx("code",{className:"font-mono",children:"ezz update"})," in a terminal; it checks the source, reinstalls and verifies the service from the beginning."]}),a.jsx(ae,{variant:"secondary",size:"sm",icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsx(ve,{tone:"danger",title:`The update failed${n.step?` (${n.step})`:""}`,children:a.jsx("span",{className:"whitespace-pre-wrap break-words",children:n.reason??"No reason was reported."})}),n.rolledBack?a.jsx(ve,{tone:"success",title:`Rolled back to v${n.from}`,children:n.restored?"The background service is running again on the version you had.":"The service did not come back — start it from Processes."}):n.serviceInstalled?a.jsx(ve,{tone:"warning",title:"The service may not be running",children:"Start it again from Processes once you have checked the log below."}):null,a.jsx(Qv,{run:n})]})}function _4(){const n=Et(),i=rn(),r=Ct(w=>fe.update.check(w)),[c,d]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState(!1),[v,b]=p.useState(!1),x=p.useRef(null),j=r.reload;p.useEffect(()=>{const w=r.data;w&&(d(w.current),m(R=>R??w.run))},[r.data]);const k=Zv(f?.phase);p.useEffect(()=>{if(!k)return;let w=!1,R;const S=async()=>{try{const O=await fe.update.status();if(w)return;b(!1),d(O.current),m(O.run)}catch(O){if(w)return;O instanceof He&&O.status===0&&b(!0)}w||(R=window.setTimeout(S,v?3e3:1500))};return R=window.setTimeout(S,1200),()=>{w=!0,R&&window.clearTimeout(R)}},[k,v]),p.useEffect(()=>{!f||Zv(f.phase)||x.current!==f.id&&(x.current=f.id,j())},[f,j]);const z=async()=>{const w=r.data?.latest;if(!(!w||h||!await i({title:`Update to v${w}?`,body:"The dashboard stops, installs the new version and starts again on this port. This page loses its connection while that happens and comes back by itself — one or two minutes is normal. Do not close the tab.",confirmLabel:"Update now",tone:"accent"}))){g(!0);try{const S=await fe.update.start(w);b(!1),m(S.run),n.success("Update started","The dashboard will stop for a moment and come back on its own.")}catch(S){n.error("Could not start the update",O4(S,"Nothing was changed.")),r.reload()}finally{g(!1)}}},T=(()=>{if(r.error&&!r.data)return a.jsx(xn,{children:a.jsx($t,{error:r.error,title:"Could not check for updates",onRetry:r.reload,className:"border-0"})});if(!r.data)return a.jsxs(xn,{className:"space-y-3",children:[a.jsx(tt,{className:"h-5 w-56"}),a.jsx(tt,{className:"h-20 rounded-md"})]});const{source:w,latest:R,reachable:S,updateAvailable:O}=r.data,E=k&&f;return a.jsxs(xn,{className:"space-y-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Installed"}),a.jsxs("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:["v",c??r.data.current]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Latest"}),a.jsx("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:S&&R?`v${R}`:"—"})]}),a.jsx("div",{className:"pt-4",children:S?O?a.jsx(je,{tone:"accent",dot:!0,children:"Update available"}):a.jsx(je,{tone:"ok",dot:!0,children:"Up to date"}):a.jsx(je,{tone:"warn",dot:!0,children:"Registry unreachable"})})]}),!w.npmUpdatable&&a.jsxs(ve,{tone:"warning",title:"This copy is not managed by npm",children:["This installation is ",w.reason,". Running"," ",a.jsx("code",{className:"font-mono",children:"npm install -g"})," would install a second copy and leave this one running, so updates have to be done by hand:",a.jsx("pre",{className:"mt-2 overflow-x-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-ink",children:w.howToUpdate.join(`
|
|
528
|
-
`)})]}),E&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/40 px-4 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(gn,{className:"spin size-4 text-accent-text","aria-hidden":"true"}),a.jsxs("span",{className:"text-sm font-medium text-ink",children:["Updating v",E.from," → v",E.to]}),a.jsx(je,{tone:"warn",dot:!0,children:Kv[E.phase]})]}),a.jsx("ol",{className:"space-y-1.5",children:ch.map(M=>{const X=ch.findIndex(W=>W.id===E.phase),A=ch.findIndex(W=>W.id===M.id),U=A<X?"done":A===X?"current":"pending";return a.jsxs("li",{className:oe("flex items-center gap-2 text-xs",U==="pending"?"text-faint":"text-muted"),children:[U==="done"?a.jsx(dl,{className:"size-3.5 text-ok","aria-hidden":"true"}):U==="current"?a.jsx(gn,{className:"spin size-3.5 text-accent-text","aria-hidden":"true"}):a.jsx(Db,{className:"size-3.5","aria-hidden":"true"}),M.label]},M.id)})}),v&&a.jsx(ve,{tone:"info",title:"The dashboard is restarting",children:"This page cannot reach it at the moment. It keeps reconnecting and shows the result here as soon as the dashboard is back."}),E.logTail.length>0&&a.jsx("pre",{className:"max-h-36 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:E.logTail.join(`
|
|
529
|
-
`)})]}),f&&!k&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:f.phase==="done"?`Last update: v${f.from} → v${f.to}`:`Last update attempt (v${f.to})`}),a.jsx(je,{tone:A4[f.phase],dot:!0,children:Kv[f.phase]})]}),a.jsx(M4,{run:f}),f.logTail.length>0&&a.jsxs("details",{className:"text-xs text-muted",children:[a.jsx("summary",{className:"cursor-pointer select-none font-medium text-ink",children:"Update log"}),a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:f.logTail.join(`
|
|
530
|
-
`)})]})]}),!E&&w.npmUpdatable&&a.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-line pt-4",children:[O&&R?a.jsxs(ae,{variant:"primary",loading:h,icon:a.jsx(Vy,{className:"size-4","aria-hidden":"true"}),onClick:()=>void z(),children:["Update to v",R]}):f?.phase==="done"?a.jsx(ae,{variant:"secondary",icon:a.jsx(Tt,{className:"size-4","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"}):null,a.jsx("p",{className:"text-xs text-muted",children:"The dashboard stops while the update runs and starts again on this port by itself."})]})]})})();return a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Vy,{className:"size-4","aria-hidden":"true"}),title:"Easy DevOps version",description:"Update the package this dashboard and its service run on. Nothing is installed unless you ask for it.",actions:a.jsx(ae,{variant:"secondary",size:"sm",loading:r.loading,disabled:k,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:r.reload,children:"Check again"})}),T,r.loading&&r.data&&a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:[a.jsx(_s,{}),"Checking the npm registry…"]}),a.jsx(Ec,{children:a.jsxs("span",{className:"text-2xs text-faint",children:["Same flow as ",a.jsx("code",{className:"font-mono",children:"ezz update"})," — stop the service, replace the package, verify, and roll back if the new version does not come up."]})})]})}const Pv=[{id:"general",label:"General"},{id:"access",label:"Access"},{id:"hub",label:"Hub"},{id:"backup",label:"Backup"},{id:"update",label:"Update"}],Ah=[{value:"127.0.0.1",label:"This machine only (127.0.0.1)"},{value:"0.0.0.0",label:"All interfaces (0.0.0.0)"}];function L4(n){return n==="::1"?"This machine only (::1)":Ah.find(i=>i.value===n)?.label??n}const Ac={days:7,min:1,max:30};function uh(n){return{port:String(n.dashboardPort),nginxDir:n.nginxDir,sslDir:n.sslDir,acmeEmail:n.acmeEmail,autoRenew:n.sslAutoRenew??!0,autoRenewDays:String(n.sslAutoRenewDays??Ac.days),deployDir:n.deployDir??"",ui:n.dashboardUi??"classic"}}function dh(n){return{bind:n.dashboardBindAddress,auth:n.dashboardAuth,password:"",confirm:""}}function Nr(n,i){return n instanceof He?(typeof n.payload.detail=="string"?n.payload.detail:null)??n.message:n instanceof Error?n.message:i}function U4(n){if(n instanceof He){const i=n.payload.reason;if(i==="no_auth_requires_loopback")return"Running without a password requires the dashboard to listen on this machine only.";if(i==="bind_requires_password")return"Set a password before opening the dashboard to the network.";if(i==="no_auth_requires_local_request")return"Turning the password off is only allowed from this machine itself."}return Nr(n,"The previous access settings are still in force.")}function H4(){ba("Settings");const n=Et(),i=rn(),{auth:r}=ja(),c=r?.minPasswordLength??8,[d,f]=Jc(),m=d.get("tab"),h=Pv.some(Ce=>Ce.id===m)?m:"general",g=Ce=>{const ut=new URLSearchParams(d);Ce==="general"?ut.delete("tab"):ut.set("tab",Ce),f(ut,{replace:!0})},v=Ct(Ce=>fe.settings.get(Ce)),b=Ct(Ce=>fe.settings.permissions(Ce),[],{enabled:!!v.data&&v.data?.platform!=="win32"}),{service:x,error:j,reload:k}=Br(),z=qr(x);bi("settings",()=>{v.reload(),b.reload()});const[T,w]=p.useState(null),[R,S]=p.useState(null),[O,E]=p.useState(!1),[M,X]=p.useState(!1),[A,U]=p.useState(!1),[W,I]=p.useState(!1),[te,B]=p.useState(!1),[V,de]=p.useState(null),[le,Q]=p.useState(null);p.useEffect(()=>{v.data&&!T&&w(uh(v.data))},[v.data,T]),p.useEffect(()=>{v.data&&!R&&S(dh(v.data))},[v.data,R]);const F=T?su(T.port):null,L=T?t0(T.acmeEmail):null,ee=T&&!T.nginxDir.trim()?"This directory is required.":null,ue=T&&!T.sslDir.trim()?"This directory is required.":null,ke=v.data?.deployDir!==void 0,Ne=!!T&&ke&&T.deployDir.trim()!==(v.data?.deployDir??""),Ee=v.data?.sslAutoRenew!==void 0,C=v.data?.dashboardUi!==void 0,q=v.data?.sslAutoRenewDaysMin??Ac.min,Y=v.data?.sslAutoRenewDaysMax??Ac.max,re=T?Number(T.autoRenewDays):NaN,ye=T&&Ee&&T.autoRenew&&(!/^\d+$/.test(T.autoRenewDays.trim())||re<q||re>Y)?`Enter a whole number from ${q} to ${Y}.`:null,Re=!!(T&&v.data&&(Number(T.port)!==v.data.dashboardPort||T.nginxDir!==v.data.nginxDir||T.sslDir!==v.data.sslDir||T.acmeEmail!==v.data.acmeEmail||C&&T.ui!==(v.data.dashboardUi??"classic")||ke&&T.deployDir.trim()!==(v.data.deployDir??"")||Ee&&(T.autoRenew!==(v.data.sslAutoRenew??!0)||T.autoRenew&&re!==(v.data.sslAutoRenewDays??Ac.days)))),xe=!!(R&&v.data&&(R.bind!==v.data.dashboardBindAddress||R.auth!==v.data.dashboardAuth||R.password!=="")),me=async()=>{if(!T||A||!v.data||(E(!0),F||L||ee||ue||ye))return;const Ce=C&&T.ui!==(v.data.dashboardUi??"classic"),ut=Number(T.port)!==v.data.dashboardPort;U(!0);try{const Rt=await fe.settings.update({dashboardPort:Number(T.port),nginxDir:T.nginxDir.trim(),sslDir:T.sslDir.trim(),acmeEmail:T.acmeEmail.trim(),...C?{dashboardUi:T.ui}:{},...Ne?{deployDir:T.deployDir.trim()}:{},...Ee?{sslAutoRenew:T.autoRenew,...T.autoRenew?{sslAutoRenewDays:re}:{}}:{}});B(Rt.needsRestart),n.success("Settings saved",Rt.needsRestart?Ce&&ut?"Restart the dashboard for the new port and interface to take effect.":Ce?"The chosen interface applies the next time the dashboard starts.":"Restart the dashboard for the new port to take effect.":void 0),v.reload()}catch(Rt){n.error("Could not save settings",Nr(Rt,"The previous settings are still in force."))}finally{U(!1)}},ie=async()=>{if(!R||!v.data||W)return;if(X(!0),de(null),Q(null),R.auth==="none"&&R.bind==="0.0.0.0"){de("Running without a password requires the dashboard to listen here only.");return}if(R.password){const ut=ev(R.password,c)??(R.password!==R.confirm?"The two passwords do not match.":null);if(ut){Q(ut);return}}else if(R.auth==="password"&&!v.data.hasPassword){Q("Set a password before requiring a password to sign in.");return}const Ce=R.password?"password":R.auth;I(!0);try{const ut={dashboardBindAddress:R.bind,dashboardAuth:Ce};R.password&&(ut.dashboardPassword=R.password);const Rt=await fe.settings.update(ut);B(Rt.needsRestart),S(jt=>jt&&{...jt,auth:Rt.dashboardAuth,password:"",confirm:""}),n.success("Access settings saved",Rt.needsRestart?"Restart the dashboard for the new listening address to take effect.":void 0),v.reload()}catch(ut){de(U4(ut))}finally{I(!1)}},[Pe,Ge]=p.useState(null),[Fe,ce]=p.useState(!1),[De,we]=p.useState(null),nt=async()=>{if(!Fe){ce(!0),Ge(null);try{const Ce=await fe.settings.setupPermissions();we(Ce),Ce.configured&&(b.setData({configured:!0}),n.success("Permissions configured","nginx and systemctl no longer prompt for a password."))}catch(Ce){Ge(Nr(Ce,"The setup commands could not be prepared."))}finally{ce(!1)}}},rt=()=>{Ge(null),b.reload()},xt=p.useRef(null),[bt,zn]=p.useState(!1),[jn,na]=p.useState(!1),[J,be]=p.useState(null),Ue=async()=>{if(!bt){zn(!0);try{const Ce=await fe.settings.backup(),ut=new Blob([JSON.stringify(Ce,null,2)],{type:"application/json"}),Rt=URL.createObjectURL(ut),jt=document.createElement("a");jt.href=Rt,jt.download=`easy-devops-backup-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(jt),jt.click(),jt.remove(),window.setTimeout(()=>URL.revokeObjectURL(Rt),1e3),n.success("Backup downloaded")}catch(Ce){n.error("Could not create the backup",Nr(Ce,"Nothing was downloaded."))}finally{zn(!1)}}},Dt=async Ce=>{const ut=Ce.target.files?.[0];if(!ut)return;be(null);let Rt;try{Rt=JSON.parse(await ut.text())}catch{be({tone:"danger",title:"That file is not valid JSON",body:"Pick the .json file produced by Export backup."}),Ce.target.value="";return}const jt=Rt;if(!jt||typeof jt!="object"||typeof jt.config!="object"||jt.config===null){be({tone:"danger",title:"That file is not an Easy DevOps backup",body:"A backup always contains a config section and a domains list."}),Ce.target.value="";return}const Ke=await i({title:"Restore this backup?",body:"This replaces your current configuration and domain list. Passwords and the listen address stored in the file are ignored.",confirmLabel:"Restore",tone:"danger"});if(Ce.target.value="",!!Ke){na(!0);try{await fe.settings.restore(Rt);const Pt=await fe.settings.get();v.setData(Pt),w(uh(Pt)),S(dh(Pt)),E(!1),X(!1),B(!1),b.reload(),be({tone:"success",title:"Backup restored",body:`Configuration from ${Zh(jt.exportedAt??null)} is now in force. Reload any other open dashboard tabs to pick it up.`}),n.success("Backup restored")}catch(Pt){be({tone:"danger",title:"The restore failed",body:Nr(Pt,"Nothing was changed.")})}finally{na(!1)}}},aa=()=>{v.reload(),b.reload(),h==="general"&&k()},Xe=te&&a.jsx(ve,{tone:"info",title:"Restart needed",children:"The port or listening address changed. It takes effect after the dashboard restarts."}),vl=()=>v.error&&!v.data?a.jsx($t,{error:v.error,title:"Could not read the settings",onRetry:v.reload}):!v.data||!T?a.jsxs(ns,{children:[a.jsx(tt,{className:"h-64 rounded-lg"}),a.jsx(tt,{className:"h-40 rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Bb,{className:"size-4","aria-hidden":"true"}),title:"Application configuration",description:"Where nginx lives, which port the dashboard answers on, and the address Let’s Encrypt knows you by."}),a.jsxs(xn,{className:"space-y-5",children:[Xe,a.jsxs(Ja,{children:[a.jsx(Me,{label:"Dashboard port",type:"number",min:1,max:65535,inputMode:"numeric",value:T.port,onChange:Ce=>w({...T,port:Ce.target.value}),error:O?F:null,hint:"Takes effect after the dashboard restarts."}),a.jsx(Me,{label:"ACME email",type:"email",value:T.acmeEmail,onChange:Ce=>w({...T,acmeEmail:Ce.target.value}),error:O?L:null,hint:"Used when ordering certificates. Usually not shown to anyone.",placeholder:"admin@example.com"}),a.jsx(Me,{label:"Nginx directory",value:T.nginxDir,onChange:Ce=>w({...T,nginxDir:Ce.target.value}),error:O?ee:null,hint:"Where nginx.conf is located.",className:"font-mono",spellCheck:!1}),a.jsx(Me,{label:"SSL settings directory",value:T.sslDir,onChange:Ce=>w({...T,sslDir:Ce.target.value}),error:O?ue:null,hint:"Default directory for certificates the dashboard manages.",className:"font-mono",spellCheck:!1}),ke&&a.jsx(Me,{label:"Deployments folder",value:T.deployDir,onChange:Ce=>w({...T,deployDir:Ce.target.value}),hint:a.jsxs(a.Fragment,{children:["Where ",a.jsx("strong",{className:"font-medium",children:"new"})," deployed apps are created. Apps that already exist stay where they are — move one from its “Domain & folder” tab. Leave empty for the default",v.data.deployDirDefault?` (${v.data.deployDirDefault})`:"","."]}),placeholder:v.data.deployDirDefault,className:"font-mono",spellCheck:!1}),C&&a.jsxs(pa,{label:"Dashboard interface",value:T.ui,onChange:Ce=>w({...T,ui:Ce.target.value}),hint:"Applies the next time the dashboard starts.",children:[a.jsx("option",{value:"new",children:"New — this dashboard"}),a.jsx("option",{value:"classic",children:"Classic — the older page"})]})]}),Ee&&a.jsxs("div",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(Zt,{checked:T.autoRenew,onChange:Ce=>w({...T,autoRenew:Ce}),label:"Renew certificates automatically",description:a.jsx(a.Fragment,{children:"The background service renews HTTP-validated certificates before they expire, without stopping nginx. Wildcard and other DNS-validated certificates need a TXT record added by hand, so they only get a warning."})}),T.autoRenew&&a.jsx(Ja,{children:a.jsx(Me,{label:"Renew this many days before expiry",type:"number",min:q,max:Y,inputMode:"numeric",value:T.autoRenewDays,onChange:Ce=>w({...T,autoRenewDays:Ce.target.value}),error:O?ye:null,hint:T.acmeEmail.trim()?"A failed attempt is retried on the next check, and you are notified either way.":"Set an ACME email above — renewal cannot run without one."})})]})]}),a.jsxs(Ec,{children:[a.jsx("span",{className:"text-2xs text-faint",children:Re?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ae,{variant:"ghost",size:"sm",disabled:!Re,onClick:()=>{w(uh(v.data)),E(!1)},children:"Revert"}),a.jsx(ae,{variant:"primary",size:"sm",loading:A,disabled:!Re,icon:a.jsx(gh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void me(),children:"Save settings"})]})]})]}),a.jsxs(et,{className:"overflow-hidden",children:[a.jsx(pn,{icon:a.jsx(Hb,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",z&&a.jsx(je,{tone:z.running?"ok":"warn",dot:!0,children:_c(z)}),x?.dev&&a.jsx(je,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications without this dashboard open.",actions:a.jsx(kt,{to:"/processes",className:ma("secondary","sm"),children:"Open Processes"})}),a.jsx(xn,{children:j&&!x?a.jsxs(ve,{tone:"warning",title:"Could not read the service state",children:[j.message," ",a.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:k,children:"Try again"})]}):x?z?a.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Status"}),a.jsx("div",{className:oe("mt-0.5 text-sm font-medium",z.running?"text-ok":"text-warn"),children:_c(z)}),z.stoppedByUser&&z.stoppedAtLabel&&a.jsxs("div",{className:"mt-0.5 text-2xs text-faint",children:["Stopped ",z.stoppedAtLabel]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Mode"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",title:z.mechanismDetail,children:z.mechanismLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Starts"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",children:z.startsAtLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"PM2 (your apps)"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",children:x.pm2.installed===null?"Checking…":x.pm2.installed?x.pm2.version??"Installed":"Not installed"}),x.probes?.pending?a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:"Measuring…"}):x.probes?.refreshing?a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:"Refreshing…"}):null]})]}):null:a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(_s,{}),"Checking the background service…"]})})]})]}),bl=()=>{if(v.error&&!v.data)return a.jsx($t,{error:v.error,title:"Could not read the settings",onRetry:v.reload});if(!v.data||!R)return a.jsxs(ns,{children:[a.jsx(tt,{className:"h-72 rounded-lg"}),a.jsx(tt,{className:"h-40 rounded-lg"})]});const Ce=R.bind!=="0.0.0.0",ut=v.data.canUseNoPassword||Ce,Rt=R.password?ev(R.password,c)??(R.confirm&&R.password!==R.confirm?"The two passwords do not match.":null):null,jt=le??(M?Rt:null);return a.jsxs("div",{className:"space-y-5",children:[a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Ur,{className:"size-4","aria-hidden":"true"}),title:"Access and authentication",description:"Who can reach the dashboard, and how they prove who they are."}),a.jsxs(xn,{className:"space-y-5",children:[Xe,V&&a.jsx(ve,{tone:"danger",title:"Could not save access settings",children:V}),a.jsxs(Ja,{children:[a.jsxs(pa,{label:"Listen on",value:R.bind,onChange:Ke=>{const Pt=Ke.target.value;S({...R,bind:Pt,auth:Pt==="0.0.0.0"?"password":R.auth})},hint:R.auth==="none"?"Locked to this machine while there is no password.":"Changing this needs a dashboard restart.",children:[Ah.map(Ke=>a.jsx("option",{value:Ke.value,disabled:Ke.value==="0.0.0.0"&&R.auth==="none",children:Ke.label},Ke.value)),!Ah.some(Ke=>Ke.value===R.bind)&&a.jsx("option",{value:R.bind,children:L4(R.bind)})]}),a.jsxs(pa,{label:"Authentication",value:R.auth,onChange:Ke=>{const Pt=Ke.target.value;S({...R,auth:Pt,bind:Pt==="none"?"127.0.0.1":R.bind}),Q(null)},hint:R.auth==="none"?"No login — reachable from this machine only.":!v.data.hasPassword&&!R.password?"No password set yet — set one below.":"A password is required to sign in.",children:[a.jsx("option",{value:"password",children:"Password required"}),a.jsx("option",{value:"none",disabled:!ut,children:"No password (this machine only)"})]})]}),R.auth==="none"&&a.jsx(ve,{tone:"warning",title:"No login",children:"Anyone who can reach this machine can open the dashboard. Listening is fixed to 127.0.0.1 so that is only this machine, not the network."}),a.jsxs("div",{className:"max-w-md space-y-4 border-t border-line pt-4",children:[a.jsx(Me,{label:"New password",type:"password",autoComplete:"new-password",value:R.password,onChange:Ke=>{S({...R,password:Ke.target.value}),Q(null)},error:jt,hint:`Leave blank to keep the current password. At least ${c} characters.`}),a.jsx(Me,{label:"Confirm new password",type:"password",autoComplete:"new-password",value:R.confirm,onChange:Ke=>{S({...R,confirm:Ke.target.value}),Q(null)}})]})]}),a.jsxs(Ec,{children:[a.jsx("span",{className:"text-2xs text-faint",children:xe?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ae,{variant:"ghost",size:"sm",disabled:!xe,onClick:()=>{S(dh(v.data)),X(!1),de(null),Q(null)},children:"Revert"}),a.jsx(ae,{variant:"primary",size:"sm",loading:W,disabled:!xe,icon:a.jsx(gh,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void ie(),children:"Save access"})]})]})]}),v.data.platform!=="win32"&&a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:oe("h-0.5 w-full",b.data?.configured?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(Rn,{className:"size-4","aria-hidden":"true"}),title:"Linux permissions",description:"Passwordless sudo for nginx and systemctl.",actions:b.data?a.jsx(je,{tone:b.data.configured?"ok":"warn",dot:!0,children:b.data.configured?"Configured":"Required"}):void 0}),a.jsx(xn,{children:b.error&&!b.data?a.jsx($t,{error:b.error,title:"Could not read the permission state",onRetry:b.reload,className:"border-0"}):b.data?b.data.configured?a.jsx("p",{className:"text-sm text-muted",children:"Passwordless sudo is configured. The dashboard can reload nginx and call systemctl without stopping to ask for a password."}):a.jsxs("div",{className:"max-w-2xl space-y-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"The dashboard needs passwordless sudo to control nginx and systemctl. Generate the exact commands below, then run them once in a terminal on this server — sudo asks for your password there, never in this browser."}),Pe&&a.jsx(ve,{tone:"danger",title:"Setup commands were not prepared",children:Pe}),De&&De.commands.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("p",{className:"text-xs font-medium text-ink",children:"Run these in a terminal"}),a.jsx(qt,{value:De.commands.join(`
|
|
531
|
-
`),label:"Copy commands",withText:!0})]}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:De.commands.join(`
|
|
532
|
-
`)})]}),De&&De.refusedDirs.length>0&&a.jsx(ve,{tone:"warning",title:"These folders need root by hand",children:a.jsx("ul",{className:"mt-1.5 space-y-1",children:De.refusedDirs.map(({dir:Ke,reason:Pt})=>a.jsxs("li",{children:[a.jsx("code",{className:"font-mono text-2xs",children:Ke})," — ",Pt]},Ke))})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ae,{variant:"primary",loading:Fe,onClick:()=>void nt(),children:"Generate setup commands"}),a.jsx(ae,{variant:"secondary",icon:a.jsx(Tt,{className:"size-4","aria-hidden":"true"}),loading:b.loading,onClick:rt,children:"Check again"})]})]}):a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(_s,{}),"Checking sudoers…"]})})]})]})},Hs=()=>a.jsxs(et,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(pn,{icon:a.jsx(xh,{className:"size-4","aria-hidden":"true"}),title:"Backup and restore",description:"Export or restore settings and domains as JSON."}),a.jsxs(xn,{className:"space-y-5",children:[a.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-ink",children:"Export"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Download every setting and domain as one JSON file. Passwords are excluded from the export."})]}),a.jsx(ae,{variant:"secondary",loading:bt,icon:a.jsx(xh,{className:"size-4","aria-hidden":"true"}),onClick:()=>void Ue(),children:"Export backup"})]}),a.jsxs("div",{className:"space-y-3 border-t border-line pt-5 sm:border-l sm:border-t-0 sm:pl-5 sm:pt-0",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-ink",children:"Restore"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Replace the current configuration and domain list with a previously exported file. Passwords and the listen address stored in the file are ignored."})]}),a.jsx("input",{ref:xt,type:"file",accept:".json,application/json",className:"sr-only",onChange:Ce=>void Dt(Ce)}),a.jsx(ae,{variant:"secondary",loading:jn,disabled:bt,icon:a.jsx(Xk,{className:"size-4","aria-hidden":"true"}),onClick:()=>xt.current?.click(),children:"Choose backup file…"})]})]}),J&&a.jsx(ve,{tone:J.tone,title:J.title,children:J.body})]}),a.jsx(Ec,{children:a.jsx("span",{className:"text-2xs text-faint",children:"Exported backups never contain the dashboard password."})})]});return a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Settings",description:"Configuration, access, Hub pairing and backups for this dashboard.",actions:h!=="hub"&&h!=="update"?a.jsx(ae,{variant:"secondary",size:"sm",loading:v.loading||b.loading,icon:a.jsx(Tt,{className:"size-3.5","aria-hidden":"true"}),onClick:aa,children:"Refresh"}):void 0}),a.jsx("div",{role:"tablist","aria-label":"Settings sections",className:"mb-5 flex flex-wrap gap-1 rounded-lg border border-line bg-raised/60 p-1",children:Pv.map(Ce=>a.jsx("button",{type:"button",role:"tab",id:`settings-tab-${Ce.id}`,"aria-selected":h===Ce.id,"aria-controls":`settings-panel-${Ce.id}`,onClick:()=>g(Ce.id),className:oe("rounded-sm border px-3 py-1.5 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",h===Ce.id?"border-line bg-surface text-ink shadow-sm":"border-transparent text-muted hover:text-ink"),children:Ce.label},Ce.id))}),a.jsxs("div",{role:"tabpanel",id:`settings-panel-${h}`,"aria-labelledby":`settings-tab-${h}`,tabIndex:-1,className:"outline-none",children:[h==="general"&&vl(),h==="access"&&bl(),h==="hub"&&a.jsx(z4,{}),h==="backup"&&Hs(),h==="update"&&a.jsx(_4,{})]})]})}function B4(){return ba("Page not found"),a.jsxs(a.Fragment,{children:[a.jsx(La,{title:"Page not found",description:"That address does not match a dashboard section."}),a.jsxs(et,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-accent/60 to-transparent","aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute -top-28 left-1/2 size-72 -translate-x-1/2 rounded-full bg-accent-soft blur-3xl","aria-hidden":"true"}),a.jsxs("div",{className:"relative flex flex-col items-center px-6 py-14 text-center",children:[a.jsx("span",{className:"font-mono text-2xs font-semibold uppercase tracking-[0.22em] text-faint",children:"HTTP 404 · route not found"}),a.jsx("span",{className:"mt-3 bg-linear-to-b from-ink to-ink/25 bg-clip-text font-mono text-6xl font-bold tracking-tighter text-transparent",children:"404"}),a.jsx("span",{className:"mt-5 flex size-11 items-center justify-center rounded-full border border-line-strong bg-raised text-muted",children:a.jsx(dS,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"mt-4 text-lg font-semibold tracking-tight text-ink",children:"This section isn't in the dashboard"}),a.jsx("p",{className:"mt-1.5 max-w-md text-sm leading-6 text-muted",children:"The link may be old, or the page moved. Everything else is one click away — nginx, domains and certificates are untouched."}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-2",children:[a.jsxs(kt,{to:"/",className:ma("primary","sm"),children:[a.jsx(_w,{className:"size-3.5","aria-hidden":"true"}),"Back to Overview"]}),a.jsxs(kt,{to:"/domains",className:ma("secondary","sm"),children:[a.jsx(Os,{className:"size-3.5","aria-hidden":"true"}),"Domains"]}),a.jsxs(kt,{to:"/ssl",className:ma("secondary","sm"),children:[a.jsx(Rn,{className:"size-3.5","aria-hidden":"true"}),"Certificates"]})]})]})]})]})}function $4(){const{phase:n}=ja();return n==="loading"?a.jsx(V5,{}):n==="error"?a.jsx(J5,{}):n==="unauthenticated"?a.jsx(rT,{}):a.jsx(X2,{children:a.jsxs(Jn,{element:a.jsx(F5,{}),children:[a.jsx(Jn,{index:!0,element:a.jsx(pT,{})}),a.jsx(Jn,{path:"domains",element:a.jsx(UT,{})}),a.jsx(Jn,{path:"ssl",element:a.jsx(nC,{})}),a.jsx(Jn,{path:"nginx",element:a.jsx(lC,{})}),a.jsx(Jn,{path:"notifications",element:a.jsx(pC,{})}),a.jsx(Jn,{path:"deployments",element:a.jsx(T4,{})}),a.jsx(Jn,{path:"processes",element:a.jsx(NC,{})}),a.jsx(Jn,{path:"logs",element:a.jsx(E4,{})}),a.jsx(Jn,{path:"settings",element:a.jsx(H4,{})}),a.jsx(Jn,{path:"*",element:a.jsx(B4,{})})]})})}function q4(){return a.jsx(Tw,{children:a.jsx(t5,{children:a.jsx(c5,{children:a.jsx(N5,{children:a.jsx(w5,{children:a.jsx(S5,{children:a.jsx(xw,{children:a.jsx($4,{})})})})})})})})}const Z0=document.getElementById("root");if(!Z0)throw new Error("Missing #root element");YN.createRoot(Z0).render(a.jsx(p.StrictMode,{children:a.jsx(q4,{})}));
|