@lamalibre/create-portlama 1.0.0
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/bin/create-portlama.js +15 -0
- package/package.json +50 -0
- package/scripts/bundle-vendor.js +60 -0
- package/src/index.js +484 -0
- package/src/lib/cert-help-page.js +160 -0
- package/src/lib/env.js +136 -0
- package/src/lib/secrets.js +19 -0
- package/src/lib/summary.js +101 -0
- package/src/tasks/harden.js +302 -0
- package/src/tasks/mtls.js +195 -0
- package/src/tasks/nginx.js +184 -0
- package/src/tasks/node.js +110 -0
- package/src/tasks/panel.js +434 -0
- package/vendor/panel-client/dist/assets/index-BDOylgUN.js +323 -0
- package/vendor/panel-client/dist/assets/index-BZTMcuQt.css +1 -0
- package/vendor/panel-client/dist/index.html +13 -0
- package/vendor/panel-server/package.json +31 -0
- package/vendor/panel-server/src/index.js +86 -0
- package/vendor/panel-server/src/lib/app-error.js +14 -0
- package/vendor/panel-server/src/lib/authelia.js +482 -0
- package/vendor/panel-server/src/lib/certbot.js +328 -0
- package/vendor/panel-server/src/lib/chisel.js +357 -0
- package/vendor/panel-server/src/lib/config.js +100 -0
- package/vendor/panel-server/src/lib/files.js +251 -0
- package/vendor/panel-server/src/lib/mtls.js +197 -0
- package/vendor/panel-server/src/lib/nginx.js +529 -0
- package/vendor/panel-server/src/lib/plist.js +65 -0
- package/vendor/panel-server/src/lib/services.js +128 -0
- package/vendor/panel-server/src/lib/state.js +95 -0
- package/vendor/panel-server/src/lib/system-stats.js +58 -0
- package/vendor/panel-server/src/middleware/errors.js +58 -0
- package/vendor/panel-server/src/middleware/mtls.js +30 -0
- package/vendor/panel-server/src/middleware/onboarding-guard.js +30 -0
- package/vendor/panel-server/src/routes/health.js +22 -0
- package/vendor/panel-server/src/routes/management/certs.js +225 -0
- package/vendor/panel-server/src/routes/management/logs.js +132 -0
- package/vendor/panel-server/src/routes/management/services.js +51 -0
- package/vendor/panel-server/src/routes/management/sites.js +448 -0
- package/vendor/panel-server/src/routes/management/system.js +12 -0
- package/vendor/panel-server/src/routes/management/tunnels.js +225 -0
- package/vendor/panel-server/src/routes/management/users.js +237 -0
- package/vendor/panel-server/src/routes/management.js +20 -0
- package/vendor/panel-server/src/routes/onboarding/dns.js +73 -0
- package/vendor/panel-server/src/routes/onboarding/domain.js +35 -0
- package/vendor/panel-server/src/routes/onboarding/index.js +18 -0
- package/vendor/panel-server/src/routes/onboarding/provision.js +291 -0
- package/vendor/panel-server/src/routes/onboarding/status.js +12 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
var Nu=e=>{throw TypeError(e)};var El=(e,t,n)=>t.has(e)||Nu("Cannot "+n);var v=(e,t,n)=>(El(e,t,"read from private field"),n?n.call(e):t.get(e)),L=(e,t,n)=>t.has(e)?Nu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),R=(e,t,n,r)=>(El(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),I=(e,t,n)=>(El(e,t,"access private method"),n);var Gs=(e,t,n,r)=>({set _(s){R(e,t,s,n)},get _(){return v(e,t,r)}});function Tp(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Op(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yd={exports:{}},sl={},gd={exports:{}},$={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var $s=Symbol.for("react.element"),Lp=Symbol.for("react.portal"),Fp=Symbol.for("react.fragment"),_p=Symbol.for("react.strict_mode"),Dp=Symbol.for("react.profiler"),Ip=Symbol.for("react.provider"),Ap=Symbol.for("react.context"),Up=Symbol.for("react.forward_ref"),$p=Symbol.for("react.suspense"),Qp=Symbol.for("react.memo"),Bp=Symbol.for("react.lazy"),Su=Symbol.iterator;function Vp(e){return e===null||typeof e!="object"?null:(e=Su&&e[Su]||e["@@iterator"],typeof e=="function"?e:null)}var vd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wd=Object.assign,jd={};function $r(e,t,n){this.props=e,this.context=t,this.refs=jd,this.updater=n||vd}$r.prototype.isReactComponent={};$r.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};$r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nd(){}Nd.prototype=$r.prototype;function wa(e,t,n){this.props=e,this.context=t,this.refs=jd,this.updater=n||vd}var ja=wa.prototype=new Nd;ja.constructor=wa;wd(ja,$r.prototype);ja.isPureReactComponent=!0;var Cu=Array.isArray,Sd=Object.prototype.hasOwnProperty,Na={current:null},Cd={key:!0,ref:!0,__self:!0,__source:!0};function kd(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Sd.call(t,r)&&!Cd.hasOwnProperty(r)&&(s[r]=t[r]);var u=arguments.length-2;if(u===1)s.children=n;else if(1<u){for(var a=Array(u),c=0;c<u;c++)a[c]=arguments[c+2];s.children=a}if(e&&e.defaultProps)for(r in u=e.defaultProps,u)s[r]===void 0&&(s[r]=u[r]);return{$$typeof:$s,type:e,key:i,ref:o,props:s,_owner:Na.current}}function Hp(e,t){return{$$typeof:$s,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sa(e){return typeof e=="object"&&e!==null&&e.$$typeof===$s}function qp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ku=/\/+/g;function Pl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qp(""+e.key):t.toString(36)}function xi(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case $s:case Lp:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Pl(o,0):r,Cu(s)?(n="",e!=null&&(n=e.replace(ku,"$&/")+"/"),xi(s,t,n,"",function(c){return c})):s!=null&&(Sa(s)&&(s=Hp(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(ku,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Cu(e))for(var u=0;u<e.length;u++){i=e[u];var a=r+Pl(i,u);o+=xi(i,t,n,a,s)}else if(a=Vp(e),typeof a=="function")for(e=a.call(e),u=0;!(i=e.next()).done;)i=i.value,a=r+Pl(i,u++),o+=xi(i,t,n,a,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ys(e,t,n){if(e==null)return e;var r=[],s=0;return xi(e,r,"","",function(i){return t.call(n,i,s++)}),r}function Wp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Me={current:null},yi={transition:null},Kp={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:yi,ReactCurrentOwner:Na};function bd(){throw Error("act(...) is not supported in production builds of React.")}$.Children={map:Ys,forEach:function(e,t,n){Ys(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ys(e,function(){t++}),t},toArray:function(e){return Ys(e,function(t){return t})||[]},only:function(e){if(!Sa(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};$.Component=$r;$.Fragment=Fp;$.Profiler=Dp;$.PureComponent=wa;$.StrictMode=_p;$.Suspense=$p;$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kp;$.act=bd;$.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=wd({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Na.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(a in t)Sd.call(t,a)&&!Cd.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&u!==void 0?u[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){u=Array(a);for(var c=0;c<a;c++)u[c]=arguments[c+2];r.children=u}return{$$typeof:$s,type:e.type,key:s,ref:i,props:r,_owner:o}};$.createContext=function(e){return e={$$typeof:Ap,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ip,_context:e},e.Consumer=e};$.createElement=kd;$.createFactory=function(e){var t=kd.bind(null,e);return t.type=e,t};$.createRef=function(){return{current:null}};$.forwardRef=function(e){return{$$typeof:Up,render:e}};$.isValidElement=Sa;$.lazy=function(e){return{$$typeof:Bp,_payload:{_status:-1,_result:e},_init:Wp}};$.memo=function(e,t){return{$$typeof:Qp,type:e,compare:t===void 0?null:t}};$.startTransition=function(e){var t=yi.transition;yi.transition={};try{e()}finally{yi.transition=t}};$.unstable_act=bd;$.useCallback=function(e,t){return Me.current.useCallback(e,t)};$.useContext=function(e){return Me.current.useContext(e)};$.useDebugValue=function(){};$.useDeferredValue=function(e){return Me.current.useDeferredValue(e)};$.useEffect=function(e,t){return Me.current.useEffect(e,t)};$.useId=function(){return Me.current.useId()};$.useImperativeHandle=function(e,t,n){return Me.current.useImperativeHandle(e,t,n)};$.useInsertionEffect=function(e,t){return Me.current.useInsertionEffect(e,t)};$.useLayoutEffect=function(e,t){return Me.current.useLayoutEffect(e,t)};$.useMemo=function(e,t){return Me.current.useMemo(e,t)};$.useReducer=function(e,t,n){return Me.current.useReducer(e,t,n)};$.useRef=function(e){return Me.current.useRef(e)};$.useState=function(e){return Me.current.useState(e)};$.useSyncExternalStore=function(e,t,n){return Me.current.useSyncExternalStore(e,t,n)};$.useTransition=function(){return Me.current.useTransition()};$.version="18.3.1";gd.exports=$;var N=gd.exports;const se=Op(N),Gp=Tp({__proto__:null,default:se},[N]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Yp=N,Xp=Symbol.for("react.element"),Zp=Symbol.for("react.fragment"),Jp=Object.prototype.hasOwnProperty,em=Yp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tm={key:!0,ref:!0,__self:!0,__source:!0};function zd(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Jp.call(t,r)&&!tm.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Xp,type:e,key:i,ref:o,props:s,_owner:em.current}}sl.Fragment=Zp;sl.jsx=zd;sl.jsxs=zd;yd.exports=sl;var l=yd.exports,no={},Ed={exports:{}},He={},Pd={exports:{}},Rd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(T,_){var D=T.length;T.push(_);e:for(;0<D;){var Y=D-1>>>1,le=T[Y];if(0<s(le,_))T[Y]=_,T[D]=le,D=Y;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var _=T[0],D=T.pop();if(D!==_){T[0]=D;e:for(var Y=0,le=T.length,Xn=le>>>1;Y<Xn;){var Nt=2*(Y+1)-1,zl=T[Nt],Nn=Nt+1,Ks=T[Nn];if(0>s(zl,D))Nn<le&&0>s(Ks,zl)?(T[Y]=Ks,T[Nn]=D,Y=Nn):(T[Y]=zl,T[Nt]=D,Y=Nt);else if(Nn<le&&0>s(Ks,D))T[Y]=Ks,T[Nn]=D,Y=Nn;else break e}}return _}function s(T,_){var D=T.sortIndex-_.sortIndex;return D!==0?D:T.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var a=[],c=[],d=1,f=null,h=3,g=!1,y=!1,j=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(T){for(var _=n(c);_!==null;){if(_.callback===null)r(c);else if(_.startTime<=T)r(c),_.sortIndex=_.expirationTime,t(a,_);else break;_=n(c)}}function w(T){if(j=!1,m(T),!y)if(n(a)!==null)y=!0,Yn(C);else{var _=n(c);_!==null&&jt(w,_.startTime-T)}}function C(T,_){y=!1,j&&(j=!1,x(b),b=-1),g=!0;var D=h;try{for(m(_),f=n(a);f!==null&&(!(f.expirationTime>_)||T&&!A());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var le=Y(f.expirationTime<=_);_=e.unstable_now(),typeof le=="function"?f.callback=le:f===n(a)&&r(a),m(_)}else r(a);f=n(a)}if(f!==null)var Xn=!0;else{var Nt=n(c);Nt!==null&&jt(w,Nt.startTime-_),Xn=!1}return Xn}finally{f=null,h=D,g=!1}}var k=!1,E=null,b=-1,P=5,M=-1;function A(){return!(e.unstable_now()-M<P)}function de(){if(E!==null){var T=e.unstable_now();M=T;var _=!0;try{_=E(!0,T)}finally{_?tt():(k=!1,E=null)}}else k=!1}var tt;if(typeof p=="function")tt=function(){p(de)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,ge=ke.port2;ke.port1.onmessage=de,tt=function(){ge.postMessage(null)}}else tt=function(){S(de,0)};function Yn(T){E=T,k||(k=!0,tt())}function jt(T,_){b=S(function(){T(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,Yn(C))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var _=3;break;default:_=h}var D=h;h=_;try{return T()}finally{h=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,_){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var D=h;h=T;try{return _()}finally{h=D}},e.unstable_scheduleCallback=function(T,_,D){var Y=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?Y+D:Y):D=Y,T){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=D+le,T={id:d++,callback:_,priorityLevel:T,startTime:D,expirationTime:le,sortIndex:-1},D>Y?(T.sortIndex=D,t(c,T),n(a)===null&&T===n(c)&&(j?(x(b),b=-1):j=!0,jt(w,D-Y))):(T.sortIndex=le,t(a,T),y||g||(y=!0,Yn(C))),T},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(T){var _=h;return function(){var D=h;h=_;try{return T.apply(this,arguments)}finally{h=D}}}})(Rd);Pd.exports=Rd;var nm=Pd.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var rm=N,Ve=nm;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Md=new Set,ms={};function Kn(e,t){Rr(e,t),Rr(e+"Capture",t)}function Rr(e,t){for(ms[e]=t,e=0;e<t.length;e++)Md.add(t[e])}var Lt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ro=Object.prototype.hasOwnProperty,sm=/^[: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]*$/,bu={},zu={};function im(e){return ro.call(zu,e)?!0:ro.call(bu,e)?!1:sm.test(e)?zu[e]=!0:(bu[e]=!0,!1)}function lm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function om(e,t,n,r){if(t===null||typeof t>"u"||lm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Te(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Te(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Te(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Te(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Te(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Te(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Te(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Te(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Te(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Te(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ca=/[\-:]([a-z])/g;function ka(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ca,ka);ye[t]=new Te(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ca,ka);ye[t]=new Te(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ca,ka);ye[t]=new Te(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Te(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Te("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Te(e,1,!1,e.toLowerCase(),null,!0,!0)});function ba(e,t,n,r){var s=ye.hasOwnProperty(t)?ye[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(om(t,n,s,r)&&(n=null),r||s===null?im(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var It=rm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xs=Symbol.for("react.element"),Jn=Symbol.for("react.portal"),er=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),so=Symbol.for("react.profiler"),Td=Symbol.for("react.provider"),Od=Symbol.for("react.context"),Ea=Symbol.for("react.forward_ref"),io=Symbol.for("react.suspense"),lo=Symbol.for("react.suspense_list"),Pa=Symbol.for("react.memo"),Qt=Symbol.for("react.lazy"),Ld=Symbol.for("react.offscreen"),Eu=Symbol.iterator;function Wr(e){return e===null||typeof e!="object"?null:(e=Eu&&e[Eu]||e["@@iterator"],typeof e=="function"?e:null)}var J=Object.assign,Rl;function ts(e){if(Rl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Rl=t&&t[1]||""}return`
|
|
34
|
+
`+Rl+e}var Ml=!1;function Tl(e,t){if(!e||Ml)return"";Ml=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),o=s.length-1,u=i.length-1;1<=o&&0<=u&&s[o]!==i[u];)u--;for(;1<=o&&0<=u;o--,u--)if(s[o]!==i[u]){if(o!==1||u!==1)do if(o--,u--,0>u||s[o]!==i[u]){var a=`
|
|
37
|
+
`+s[o].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=o&&0<=u);break}}}finally{Ml=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ts(e):""}function am(e){switch(e.tag){case 5:return ts(e.type);case 16:return ts("Lazy");case 13:return ts("Suspense");case 19:return ts("SuspenseList");case 0:case 2:case 15:return e=Tl(e.type,!1),e;case 11:return e=Tl(e.type.render,!1),e;case 1:return e=Tl(e.type,!0),e;default:return""}}function oo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case er:return"Fragment";case Jn:return"Portal";case so:return"Profiler";case za:return"StrictMode";case io:return"Suspense";case lo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Od:return(e.displayName||"Context")+".Consumer";case Td:return(e._context.displayName||"Context")+".Provider";case Ea:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pa:return t=e.displayName||null,t!==null?t:oo(e.type)||"Memo";case Qt:t=e._payload,e=e._init;try{return oo(e(t))}catch{}}return null}function um(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oo(t);case 8:return t===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cm(e){var t=Fd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zs(e){e._valueTracker||(e._valueTracker=cm(e))}function _d(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Fd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pi(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 ao(e,t){var n=t.checked;return J({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dd(e,t){t=t.checked,t!=null&&ba(e,"checked",t,!1)}function uo(e,t){Dd(e,t);var n=mn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?co(e,t.type,n):t.hasOwnProperty("defaultValue")&&co(e,t.type,mn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ru(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function co(e,t,n){(t!=="number"||Pi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ns=Array.isArray;function fr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+mn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function fo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(z(91));return J({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Mu(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(z(92));if(ns(n)){if(1<n.length)throw Error(z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:mn(n)}}function Id(e,t){var n=mn(t.value),r=mn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Tu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ad(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ho(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ad(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Js,Ud=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Js=Js||document.createElement("div"),Js.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Js.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ls={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},dm=["Webkit","ms","Moz","O"];Object.keys(ls).forEach(function(e){dm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ls[t]=ls[e]})});function $d(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ls.hasOwnProperty(e)&&ls[e]?(""+t).trim():t+"px"}function Qd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=$d(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var fm=J({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function po(e,t){if(t){if(fm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function mo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xo=null;function Ra(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yo=null,hr=null,pr=null;function Ou(e){if(e=Vs(e)){if(typeof yo!="function")throw Error(z(280));var t=e.stateNode;t&&(t=ul(t),yo(e.stateNode,e.type,t))}}function Bd(e){hr?pr?pr.push(e):pr=[e]:hr=e}function Vd(){if(hr){var e=hr,t=pr;if(pr=hr=null,Ou(e),t)for(e=0;e<t.length;e++)Ou(t[e])}}function Hd(e,t){return e(t)}function qd(){}var Ol=!1;function Wd(e,t,n){if(Ol)return e(t,n);Ol=!0;try{return Hd(e,t,n)}finally{Ol=!1,(hr!==null||pr!==null)&&(qd(),Vd())}}function ys(e,t){var n=e.stateNode;if(n===null)return null;var r=ul(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(z(231,t,typeof n));return n}var go=!1;if(Lt)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){go=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{go=!1}function hm(e,t,n,r,s,i,o,u,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var os=!1,Ri=null,Mi=!1,vo=null,pm={onError:function(e){os=!0,Ri=e}};function mm(e,t,n,r,s,i,o,u,a){os=!1,Ri=null,hm.apply(pm,arguments)}function xm(e,t,n,r,s,i,o,u,a){if(mm.apply(this,arguments),os){if(os){var c=Ri;os=!1,Ri=null}else throw Error(z(198));Mi||(Mi=!0,vo=c)}}function Gn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Kd(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 Lu(e){if(Gn(e)!==e)throw Error(z(188))}function ym(e){var t=e.alternate;if(!t){if(t=Gn(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Lu(s),e;if(i===r)return Lu(s),t;i=i.sibling}throw Error(z(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,u=s.child;u;){if(u===n){o=!0,n=s,r=i;break}if(u===r){o=!0,r=s,n=i;break}u=u.sibling}if(!o){for(u=i.child;u;){if(u===n){o=!0,n=i,r=s;break}if(u===r){o=!0,r=i,n=s;break}u=u.sibling}if(!o)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t}function Gd(e){return e=ym(e),e!==null?Yd(e):null}function Yd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yd(e);if(t!==null)return t;e=e.sibling}return null}var Xd=Ve.unstable_scheduleCallback,Fu=Ve.unstable_cancelCallback,gm=Ve.unstable_shouldYield,vm=Ve.unstable_requestPaint,ie=Ve.unstable_now,wm=Ve.unstable_getCurrentPriorityLevel,Ma=Ve.unstable_ImmediatePriority,Zd=Ve.unstable_UserBlockingPriority,Ti=Ve.unstable_NormalPriority,jm=Ve.unstable_LowPriority,Jd=Ve.unstable_IdlePriority,il=null,gt=null;function Nm(e){if(gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(il,e,void 0,(e.current.flags&128)===128)}catch{}}var at=Math.clz32?Math.clz32:km,Sm=Math.log,Cm=Math.LN2;function km(e){return e>>>=0,e===0?32:31-(Sm(e)/Cm|0)|0}var ei=64,ti=4194304;function rs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Oi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var u=o&~s;u!==0?r=rs(u):(i&=o,i!==0&&(r=rs(i)))}else o=n&~s,o!==0?r=rs(o):i!==0&&(r=rs(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-at(t),s=1<<n,r|=e[n],t&=~s;return r}function bm(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-at(i),u=1<<o,a=s[o];a===-1?(!(u&n)||u&r)&&(s[o]=bm(u,t)):a<=t&&(e.expiredLanes|=u),i&=~u}}function wo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ef(){var e=ei;return ei<<=1,!(ei&4194240)&&(ei=64),e}function Ll(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-at(t),e[t]=n}function Em(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-at(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Ta(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var H=0;function tf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var nf,Oa,rf,sf,lf,jo=!1,ni=[],sn=null,ln=null,on=null,gs=new Map,vs=new Map,Vt=[],Pm="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function _u(e,t){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":ln=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(t.pointerId)}}function Gr(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Vs(t),t!==null&&Oa(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Rm(e,t,n,r,s){switch(t){case"focusin":return sn=Gr(sn,e,t,n,r,s),!0;case"dragenter":return ln=Gr(ln,e,t,n,r,s),!0;case"mouseover":return on=Gr(on,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return gs.set(i,Gr(gs.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,vs.set(i,Gr(vs.get(i)||null,e,t,n,r,s)),!0}return!1}function of(e){var t=kn(e.target);if(t!==null){var n=Gn(t);if(n!==null){if(t=n.tag,t===13){if(t=Kd(n),t!==null){e.blockedOn=t,lf(e.priority,function(){rf(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=No(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xo=r,n.target.dispatchEvent(r),xo=null}else return t=Vs(n),t!==null&&Oa(t),e.blockedOn=n,!1;t.shift()}return!0}function Du(e,t,n){gi(e)&&n.delete(t)}function Mm(){jo=!1,sn!==null&&gi(sn)&&(sn=null),ln!==null&&gi(ln)&&(ln=null),on!==null&&gi(on)&&(on=null),gs.forEach(Du),vs.forEach(Du)}function Yr(e,t){e.blockedOn===t&&(e.blockedOn=null,jo||(jo=!0,Ve.unstable_scheduleCallback(Ve.unstable_NormalPriority,Mm)))}function ws(e){function t(s){return Yr(s,e)}if(0<ni.length){Yr(ni[0],e);for(var n=1;n<ni.length;n++){var r=ni[n];r.blockedOn===e&&(r.blockedOn=null)}}for(sn!==null&&Yr(sn,e),ln!==null&&Yr(ln,e),on!==null&&Yr(on,e),gs.forEach(t),vs.forEach(t),n=0;n<Vt.length;n++)r=Vt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Vt.length&&(n=Vt[0],n.blockedOn===null);)of(n),n.blockedOn===null&&Vt.shift()}var mr=It.ReactCurrentBatchConfig,Li=!0;function Tm(e,t,n,r){var s=H,i=mr.transition;mr.transition=null;try{H=1,La(e,t,n,r)}finally{H=s,mr.transition=i}}function Om(e,t,n,r){var s=H,i=mr.transition;mr.transition=null;try{H=4,La(e,t,n,r)}finally{H=s,mr.transition=i}}function La(e,t,n,r){if(Li){var s=No(e,t,n,r);if(s===null)Vl(e,t,r,Fi,n),_u(e,r);else if(Rm(s,e,t,n,r))r.stopPropagation();else if(_u(e,r),t&4&&-1<Pm.indexOf(e)){for(;s!==null;){var i=Vs(s);if(i!==null&&nf(i),i=No(e,t,n,r),i===null&&Vl(e,t,r,Fi,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Vl(e,t,r,null,n)}}var Fi=null;function No(e,t,n,r){if(Fi=null,e=Ra(r),e=kn(e),e!==null)if(t=Gn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Kd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Fi=e,null}function af(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(wm()){case Ma:return 1;case Zd:return 4;case Ti:case jm:return 16;case Jd:return 536870912;default:return 16}default:return 16}}var tn=null,Fa=null,vi=null;function uf(){if(vi)return vi;var e,t=Fa,n=t.length,r,s="value"in tn?tn.value:tn.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return vi=s.slice(e,1<r?1-r:void 0)}function wi(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 ri(){return!0}function Iu(){return!1}function qe(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(i):i[u]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ri:Iu,this.isPropagationStopped=Iu,this}return J(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ri)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ri)},persist:function(){},isPersistent:ri}),t}var Qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_a=qe(Qr),Bs=J({},Qr,{view:0,detail:0}),Lm=qe(Bs),Fl,_l,Xr,ll=J({},Bs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Da,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!==Xr&&(Xr&&e.type==="mousemove"?(Fl=e.screenX-Xr.screenX,_l=e.screenY-Xr.screenY):_l=Fl=0,Xr=e),Fl)},movementY:function(e){return"movementY"in e?e.movementY:_l}}),Au=qe(ll),Fm=J({},ll,{dataTransfer:0}),_m=qe(Fm),Dm=J({},Bs,{relatedTarget:0}),Dl=qe(Dm),Im=J({},Qr,{animationName:0,elapsedTime:0,pseudoElement:0}),Am=qe(Im),Um=J({},Qr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$m=qe(Um),Qm=J({},Qr,{data:0}),Uu=qe(Qm),Bm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vm={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"},Hm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hm[e])?!!t[e]:!1}function Da(){return qm}var Wm=J({},Bs,{key:function(e){if(e.key){var t=Bm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=wi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Da,charCode:function(e){return e.type==="keypress"?wi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?wi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Km=qe(Wm),Gm=J({},ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$u=qe(Gm),Ym=J({},Bs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Da}),Xm=qe(Ym),Zm=J({},Qr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jm=qe(Zm),e0=J({},ll,{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}),t0=qe(e0),n0=[9,13,27,32],Ia=Lt&&"CompositionEvent"in window,as=null;Lt&&"documentMode"in document&&(as=document.documentMode);var r0=Lt&&"TextEvent"in window&&!as,cf=Lt&&(!Ia||as&&8<as&&11>=as),Qu=" ",Bu=!1;function df(e,t){switch(e){case"keyup":return n0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tr=!1;function s0(e,t){switch(e){case"compositionend":return ff(t);case"keypress":return t.which!==32?null:(Bu=!0,Qu);case"textInput":return e=t.data,e===Qu&&Bu?null:e;default:return null}}function i0(e,t){if(tr)return e==="compositionend"||!Ia&&df(e,t)?(e=uf(),vi=Fa=tn=null,tr=!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 cf&&t.locale!=="ko"?null:t.data;default:return null}}var l0={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 Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!l0[e.type]:t==="textarea"}function hf(e,t,n,r){Bd(r),t=_i(t,"onChange"),0<t.length&&(n=new _a("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var us=null,js=null;function o0(e){Cf(e,0)}function ol(e){var t=sr(e);if(_d(t))return e}function a0(e,t){if(e==="change")return t}var pf=!1;if(Lt){var Il;if(Lt){var Al="oninput"in document;if(!Al){var Hu=document.createElement("div");Hu.setAttribute("oninput","return;"),Al=typeof Hu.oninput=="function"}Il=Al}else Il=!1;pf=Il&&(!document.documentMode||9<document.documentMode)}function qu(){us&&(us.detachEvent("onpropertychange",mf),js=us=null)}function mf(e){if(e.propertyName==="value"&&ol(js)){var t=[];hf(t,js,e,Ra(e)),Wd(o0,t)}}function u0(e,t,n){e==="focusin"?(qu(),us=t,js=n,us.attachEvent("onpropertychange",mf)):e==="focusout"&&qu()}function c0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ol(js)}function d0(e,t){if(e==="click")return ol(t)}function f0(e,t){if(e==="input"||e==="change")return ol(t)}function h0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ct=typeof Object.is=="function"?Object.is:h0;function Ns(e,t){if(ct(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!ro.call(t,s)||!ct(e[s],t[s]))return!1}return!0}function Wu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ku(e,t){var n=Wu(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wu(n)}}function xf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yf(){for(var e=window,t=Pi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pi(e.document)}return t}function Aa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function p0(e){var t=yf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xf(n.ownerDocument.documentElement,n)){if(r!==null&&Aa(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Ku(n,i);var o=Ku(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var m0=Lt&&"documentMode"in document&&11>=document.documentMode,nr=null,So=null,cs=null,Co=!1;function Gu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Co||nr==null||nr!==Pi(r)||(r=nr,"selectionStart"in r&&Aa(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),cs&&Ns(cs,r)||(cs=r,r=_i(So,"onSelect"),0<r.length&&(t=new _a("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nr)))}function si(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var rr={animationend:si("Animation","AnimationEnd"),animationiteration:si("Animation","AnimationIteration"),animationstart:si("Animation","AnimationStart"),transitionend:si("Transition","TransitionEnd")},Ul={},gf={};Lt&&(gf=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function al(e){if(Ul[e])return Ul[e];if(!rr[e])return e;var t=rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gf)return Ul[e]=t[n];return e}var vf=al("animationend"),wf=al("animationiteration"),jf=al("animationstart"),Nf=al("transitionend"),Sf=new Map,Yu="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yn(e,t){Sf.set(e,t),Kn(t,[e])}for(var $l=0;$l<Yu.length;$l++){var Ql=Yu[$l],x0=Ql.toLowerCase(),y0=Ql[0].toUpperCase()+Ql.slice(1);yn(x0,"on"+y0)}yn(vf,"onAnimationEnd");yn(wf,"onAnimationIteration");yn(jf,"onAnimationStart");yn("dblclick","onDoubleClick");yn("focusin","onFocus");yn("focusout","onBlur");yn(Nf,"onTransitionEnd");Rr("onMouseEnter",["mouseout","mouseover"]);Rr("onMouseLeave",["mouseout","mouseover"]);Rr("onPointerEnter",["pointerout","pointerover"]);Rr("onPointerLeave",["pointerout","pointerover"]);Kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Kn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ss="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(" "),g0=new Set("cancel close invalid load scroll toggle".split(" ").concat(ss));function Xu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xm(r,t,void 0,e),e.currentTarget=null}function Cf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var u=r[o],a=u.instance,c=u.currentTarget;if(u=u.listener,a!==i&&s.isPropagationStopped())break e;Xu(s,u,c),i=a}else for(o=0;o<r.length;o++){if(u=r[o],a=u.instance,c=u.currentTarget,u=u.listener,a!==i&&s.isPropagationStopped())break e;Xu(s,u,c),i=a}}}if(Mi)throw e=vo,Mi=!1,vo=null,e}function W(e,t){var n=t[Po];n===void 0&&(n=t[Po]=new Set);var r=e+"__bubble";n.has(r)||(kf(t,e,2,!1),n.add(r))}function Bl(e,t,n){var r=0;t&&(r|=4),kf(n,e,r,t)}var ii="_reactListening"+Math.random().toString(36).slice(2);function Ss(e){if(!e[ii]){e[ii]=!0,Md.forEach(function(n){n!=="selectionchange"&&(g0.has(n)||Bl(n,!1,e),Bl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ii]||(t[ii]=!0,Bl("selectionchange",!1,t))}}function kf(e,t,n,r){switch(af(t)){case 1:var s=Tm;break;case 4:s=Om;break;default:s=La}n=s.bind(null,t,n,e),s=void 0,!go||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Vl(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var u=r.stateNode.containerInfo;if(u===s||u.nodeType===8&&u.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;o=o.return}for(;u!==null;){if(o=kn(u),o===null)return;if(a=o.tag,a===5||a===6){r=i=o;continue e}u=u.parentNode}}r=r.return}Wd(function(){var c=i,d=Ra(n),f=[];e:{var h=Sf.get(e);if(h!==void 0){var g=_a,y=e;switch(e){case"keypress":if(wi(n)===0)break e;case"keydown":case"keyup":g=Km;break;case"focusin":y="focus",g=Dl;break;case"focusout":y="blur",g=Dl;break;case"beforeblur":case"afterblur":g=Dl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Au;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=_m;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Xm;break;case vf:case wf:case jf:g=Am;break;case Nf:g=Jm;break;case"scroll":g=Lm;break;case"wheel":g=t0;break;case"copy":case"cut":case"paste":g=$m;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=$u}var j=(t&4)!==0,S=!j&&e==="scroll",x=j?h!==null?h+"Capture":null:h;j=[];for(var p=c,m;p!==null;){m=p;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,x!==null&&(w=ys(p,x),w!=null&&j.push(Cs(p,w,m)))),S)break;p=p.return}0<j.length&&(h=new g(h,y,null,n,d),f.push({event:h,listeners:j}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",h&&n!==xo&&(y=n.relatedTarget||n.fromElement)&&(kn(y)||y[Ft]))break e;if((g||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=c,y=y?kn(y):null,y!==null&&(S=Gn(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=c),g!==y)){if(j=Au,w="onMouseLeave",x="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(j=$u,w="onPointerLeave",x="onPointerEnter",p="pointer"),S=g==null?h:sr(g),m=y==null?h:sr(y),h=new j(w,p+"leave",g,n,d),h.target=S,h.relatedTarget=m,w=null,kn(d)===c&&(j=new j(x,p+"enter",y,n,d),j.target=m,j.relatedTarget=S,w=j),S=w,g&&y)t:{for(j=g,x=y,p=0,m=j;m;m=Zn(m))p++;for(m=0,w=x;w;w=Zn(w))m++;for(;0<p-m;)j=Zn(j),p--;for(;0<m-p;)x=Zn(x),m--;for(;p--;){if(j===x||x!==null&&j===x.alternate)break t;j=Zn(j),x=Zn(x)}j=null}else j=null;g!==null&&Zu(f,h,g,j,!1),y!==null&&S!==null&&Zu(f,S,y,j,!0)}}e:{if(h=c?sr(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var C=a0;else if(Vu(h))if(pf)C=f0;else{C=c0;var k=u0}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=d0);if(C&&(C=C(e,c))){hf(f,C,n,d);break e}k&&k(e,h,c),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&co(h,"number",h.value)}switch(k=c?sr(c):window,e){case"focusin":(Vu(k)||k.contentEditable==="true")&&(nr=k,So=c,cs=null);break;case"focusout":cs=So=nr=null;break;case"mousedown":Co=!0;break;case"contextmenu":case"mouseup":case"dragend":Co=!1,Gu(f,n,d);break;case"selectionchange":if(m0)break;case"keydown":case"keyup":Gu(f,n,d)}var E;if(Ia)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else tr?df(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(cf&&n.locale!=="ko"&&(tr||b!=="onCompositionStart"?b==="onCompositionEnd"&&tr&&(E=uf()):(tn=d,Fa="value"in tn?tn.value:tn.textContent,tr=!0)),k=_i(c,b),0<k.length&&(b=new Uu(b,e,null,n,d),f.push({event:b,listeners:k}),E?b.data=E:(E=ff(n),E!==null&&(b.data=E)))),(E=r0?s0(e,n):i0(e,n))&&(c=_i(c,"onBeforeInput"),0<c.length&&(d=new Uu("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=E))}Cf(f,t)})}function Cs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _i(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ys(e,n),i!=null&&r.unshift(Cs(e,i,s)),i=ys(e,t),i!=null&&r.push(Cs(e,i,s))),e=e.return}return r}function Zn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zu(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var u=n,a=u.alternate,c=u.stateNode;if(a!==null&&a===r)break;u.tag===5&&c!==null&&(u=c,s?(a=ys(n,i),a!=null&&o.unshift(Cs(n,a,u))):s||(a=ys(n,i),a!=null&&o.push(Cs(n,a,u)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var v0=/\r\n?/g,w0=/\u0000|\uFFFD/g;function Ju(e){return(typeof e=="string"?e:""+e).replace(v0,`
|
|
38
|
+
`).replace(w0,"")}function li(e,t,n){if(t=Ju(t),Ju(e)!==t&&n)throw Error(z(425))}function Di(){}var ko=null,bo=null;function zo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Eo=typeof setTimeout=="function"?setTimeout:void 0,j0=typeof clearTimeout=="function"?clearTimeout:void 0,ec=typeof Promise=="function"?Promise:void 0,N0=typeof queueMicrotask=="function"?queueMicrotask:typeof ec<"u"?function(e){return ec.resolve(null).then(e).catch(S0)}:Eo;function S0(e){setTimeout(function(){throw e})}function Hl(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),ws(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ws(t)}function an(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Br=Math.random().toString(36).slice(2),yt="__reactFiber$"+Br,ks="__reactProps$"+Br,Ft="__reactContainer$"+Br,Po="__reactEvents$"+Br,C0="__reactListeners$"+Br,k0="__reactHandles$"+Br;function kn(e){var t=e[yt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ft]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tc(e);e!==null;){if(n=e[yt])return n;e=tc(e)}return t}e=n,n=e.parentNode}return null}function Vs(e){return e=e[yt]||e[Ft],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function sr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(z(33))}function ul(e){return e[ks]||null}var Ro=[],ir=-1;function gn(e){return{current:e}}function K(e){0>ir||(e.current=Ro[ir],Ro[ir]=null,ir--)}function q(e,t){ir++,Ro[ir]=e.current,e.current=t}var xn={},Se=gn(xn),Ie=gn(!1),Un=xn;function Mr(e,t){var n=e.type.contextTypes;if(!n)return xn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ae(e){return e=e.childContextTypes,e!=null}function Ii(){K(Ie),K(Se)}function nc(e,t,n){if(Se.current!==xn)throw Error(z(168));q(Se,t),q(Ie,n)}function bf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(z(108,um(e)||"Unknown",s));return J({},n,r)}function Ai(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xn,Un=Se.current,q(Se,e),q(Ie,Ie.current),!0}function rc(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=bf(e,t,Un),r.__reactInternalMemoizedMergedChildContext=e,K(Ie),K(Se),q(Se,e)):K(Ie),q(Ie,n)}var kt=null,cl=!1,ql=!1;function zf(e){kt===null?kt=[e]:kt.push(e)}function b0(e){cl=!0,zf(e)}function vn(){if(!ql&&kt!==null){ql=!0;var e=0,t=H;try{var n=kt;for(H=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}kt=null,cl=!1}catch(s){throw kt!==null&&(kt=kt.slice(e+1)),Xd(Ma,vn),s}finally{H=t,ql=!1}}return null}var lr=[],or=0,Ui=null,$i=0,Ge=[],Ye=0,$n=null,Rt=1,Mt="";function Sn(e,t){lr[or++]=$i,lr[or++]=Ui,Ui=e,$i=t}function Ef(e,t,n){Ge[Ye++]=Rt,Ge[Ye++]=Mt,Ge[Ye++]=$n,$n=e;var r=Rt;e=Mt;var s=32-at(r)-1;r&=~(1<<s),n+=1;var i=32-at(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Rt=1<<32-at(t)+s|n<<s|r,Mt=i+e}else Rt=1<<i|n<<s|r,Mt=e}function Ua(e){e.return!==null&&(Sn(e,1),Ef(e,1,0))}function $a(e){for(;e===Ui;)Ui=lr[--or],lr[or]=null,$i=lr[--or],lr[or]=null;for(;e===$n;)$n=Ge[--Ye],Ge[Ye]=null,Mt=Ge[--Ye],Ge[Ye]=null,Rt=Ge[--Ye],Ge[Ye]=null}var Be=null,Qe=null,G=!1,ot=null;function Pf(e,t){var n=Xe(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Be=e,Qe=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Be=e,Qe=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$n!==null?{id:Rt,overflow:Mt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Be=e,Qe=null,!0):!1;default:return!1}}function Mo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function To(e){if(G){var t=Qe;if(t){var n=t;if(!sc(e,t)){if(Mo(e))throw Error(z(418));t=an(n.nextSibling);var r=Be;t&&sc(e,t)?Pf(r,n):(e.flags=e.flags&-4097|2,G=!1,Be=e)}}else{if(Mo(e))throw Error(z(418));e.flags=e.flags&-4097|2,G=!1,Be=e}}}function ic(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Be=e}function oi(e){if(e!==Be)return!1;if(!G)return ic(e),G=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!zo(e.type,e.memoizedProps)),t&&(t=Qe)){if(Mo(e))throw Rf(),Error(z(418));for(;t;)Pf(e,t),t=an(t.nextSibling)}if(ic(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qe=an(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qe=null}}else Qe=Be?an(e.stateNode.nextSibling):null;return!0}function Rf(){for(var e=Qe;e;)e=an(e.nextSibling)}function Tr(){Qe=Be=null,G=!1}function Qa(e){ot===null?ot=[e]:ot.push(e)}var z0=It.ReactCurrentBatchConfig;function Zr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var u=s.refs;o===null?delete u[i]:u[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,e))}return e}function ai(e,t){throw e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lc(e){var t=e._init;return t(e._payload)}function Mf(e){function t(x,p){if(e){var m=x.deletions;m===null?(x.deletions=[p],x.flags|=16):m.push(p)}}function n(x,p){if(!e)return null;for(;p!==null;)t(x,p),p=p.sibling;return null}function r(x,p){for(x=new Map;p!==null;)p.key!==null?x.set(p.key,p):x.set(p.index,p),p=p.sibling;return x}function s(x,p){return x=fn(x,p),x.index=0,x.sibling=null,x}function i(x,p,m){return x.index=m,e?(m=x.alternate,m!==null?(m=m.index,m<p?(x.flags|=2,p):m):(x.flags|=2,p)):(x.flags|=1048576,p)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function u(x,p,m,w){return p===null||p.tag!==6?(p=Jl(m,x.mode,w),p.return=x,p):(p=s(p,m),p.return=x,p)}function a(x,p,m,w){var C=m.type;return C===er?d(x,p,m.props.children,w,m.key):p!==null&&(p.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Qt&&lc(C)===p.type)?(w=s(p,m.props),w.ref=Zr(x,p,m),w.return=x,w):(w=zi(m.type,m.key,m.props,null,x.mode,w),w.ref=Zr(x,p,m),w.return=x,w)}function c(x,p,m,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=eo(m,x.mode,w),p.return=x,p):(p=s(p,m.children||[]),p.return=x,p)}function d(x,p,m,w,C){return p===null||p.tag!==7?(p=An(m,x.mode,w,C),p.return=x,p):(p=s(p,m),p.return=x,p)}function f(x,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Jl(""+p,x.mode,m),p.return=x,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Xs:return m=zi(p.type,p.key,p.props,null,x.mode,m),m.ref=Zr(x,null,p),m.return=x,m;case Jn:return p=eo(p,x.mode,m),p.return=x,p;case Qt:var w=p._init;return f(x,w(p._payload),m)}if(ns(p)||Wr(p))return p=An(p,x.mode,m,null),p.return=x,p;ai(x,p)}return null}function h(x,p,m,w){var C=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return C!==null?null:u(x,p,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Xs:return m.key===C?a(x,p,m,w):null;case Jn:return m.key===C?c(x,p,m,w):null;case Qt:return C=m._init,h(x,p,C(m._payload),w)}if(ns(m)||Wr(m))return C!==null?null:d(x,p,m,w,null);ai(x,m)}return null}function g(x,p,m,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return x=x.get(m)||null,u(p,x,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Xs:return x=x.get(w.key===null?m:w.key)||null,a(p,x,w,C);case Jn:return x=x.get(w.key===null?m:w.key)||null,c(p,x,w,C);case Qt:var k=w._init;return g(x,p,m,k(w._payload),C)}if(ns(w)||Wr(w))return x=x.get(m)||null,d(p,x,w,C,null);ai(p,w)}return null}function y(x,p,m,w){for(var C=null,k=null,E=p,b=p=0,P=null;E!==null&&b<m.length;b++){E.index>b?(P=E,E=null):P=E.sibling;var M=h(x,E,m[b],w);if(M===null){E===null&&(E=P);break}e&&E&&M.alternate===null&&t(x,E),p=i(M,p,b),k===null?C=M:k.sibling=M,k=M,E=P}if(b===m.length)return n(x,E),G&&Sn(x,b),C;if(E===null){for(;b<m.length;b++)E=f(x,m[b],w),E!==null&&(p=i(E,p,b),k===null?C=E:k.sibling=E,k=E);return G&&Sn(x,b),C}for(E=r(x,E);b<m.length;b++)P=g(E,x,b,m[b],w),P!==null&&(e&&P.alternate!==null&&E.delete(P.key===null?b:P.key),p=i(P,p,b),k===null?C=P:k.sibling=P,k=P);return e&&E.forEach(function(A){return t(x,A)}),G&&Sn(x,b),C}function j(x,p,m,w){var C=Wr(m);if(typeof C!="function")throw Error(z(150));if(m=C.call(m),m==null)throw Error(z(151));for(var k=C=null,E=p,b=p=0,P=null,M=m.next();E!==null&&!M.done;b++,M=m.next()){E.index>b?(P=E,E=null):P=E.sibling;var A=h(x,E,M.value,w);if(A===null){E===null&&(E=P);break}e&&E&&A.alternate===null&&t(x,E),p=i(A,p,b),k===null?C=A:k.sibling=A,k=A,E=P}if(M.done)return n(x,E),G&&Sn(x,b),C;if(E===null){for(;!M.done;b++,M=m.next())M=f(x,M.value,w),M!==null&&(p=i(M,p,b),k===null?C=M:k.sibling=M,k=M);return G&&Sn(x,b),C}for(E=r(x,E);!M.done;b++,M=m.next())M=g(E,x,b,M.value,w),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?b:M.key),p=i(M,p,b),k===null?C=M:k.sibling=M,k=M);return e&&E.forEach(function(de){return t(x,de)}),G&&Sn(x,b),C}function S(x,p,m,w){if(typeof m=="object"&&m!==null&&m.type===er&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Xs:e:{for(var C=m.key,k=p;k!==null;){if(k.key===C){if(C=m.type,C===er){if(k.tag===7){n(x,k.sibling),p=s(k,m.props.children),p.return=x,x=p;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Qt&&lc(C)===k.type){n(x,k.sibling),p=s(k,m.props),p.ref=Zr(x,k,m),p.return=x,x=p;break e}n(x,k);break}else t(x,k);k=k.sibling}m.type===er?(p=An(m.props.children,x.mode,w,m.key),p.return=x,x=p):(w=zi(m.type,m.key,m.props,null,x.mode,w),w.ref=Zr(x,p,m),w.return=x,x=w)}return o(x);case Jn:e:{for(k=m.key;p!==null;){if(p.key===k)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(x,p.sibling),p=s(p,m.children||[]),p.return=x,x=p;break e}else{n(x,p);break}else t(x,p);p=p.sibling}p=eo(m,x.mode,w),p.return=x,x=p}return o(x);case Qt:return k=m._init,S(x,p,k(m._payload),w)}if(ns(m))return y(x,p,m,w);if(Wr(m))return j(x,p,m,w);ai(x,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(x,p.sibling),p=s(p,m),p.return=x,x=p):(n(x,p),p=Jl(m,x.mode,w),p.return=x,x=p),o(x)):n(x,p)}return S}var Or=Mf(!0),Tf=Mf(!1),Qi=gn(null),Bi=null,ar=null,Ba=null;function Va(){Ba=ar=Bi=null}function Ha(e){var t=Qi.current;K(Qi),e._currentValue=t}function Oo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xr(e,t){Bi=e,Ba=ar=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function Je(e){var t=e._currentValue;if(Ba!==e)if(e={context:e,memoizedValue:t,next:null},ar===null){if(Bi===null)throw Error(z(308));ar=e,Bi.dependencies={lanes:0,firstContext:e}}else ar=ar.next=e;return t}var bn=null;function qa(e){bn===null?bn=[e]:bn.push(e)}function Of(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,qa(t)):(n.next=s.next,s.next=n),t.interleaved=n,_t(e,r)}function _t(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Bt=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function un(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,B&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,_t(e,n)}return s=r.interleaved,s===null?(t.next=t,qa(r)):(t.next=s.next,s.next=t),r.interleaved=t,_t(e,n)}function ji(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ta(e,n)}}function oc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vi(e,t,n,r){var s=e.updateQueue;Bt=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,u=s.shared.pending;if(u!==null){s.shared.pending=null;var a=u,c=a.next;a.next=null,o===null?i=c:o.next=c,o=a;var d=e.alternate;d!==null&&(d=d.updateQueue,u=d.lastBaseUpdate,u!==o&&(u===null?d.firstBaseUpdate=c:u.next=c,d.lastBaseUpdate=a))}if(i!==null){var f=s.baseState;o=0,d=c=a=null,u=i;do{var h=u.lane,g=u.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var y=e,j=u;switch(h=t,g=n,j.tag){case 1:if(y=j.payload,typeof y=="function"){f=y.call(g,f,h);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=j.payload,h=typeof y=="function"?y.call(g,f,h):y,h==null)break e;f=J({},f,h);break e;case 2:Bt=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[u]:h.push(u))}else g={eventTime:g,lane:h,tag:u.tag,payload:u.payload,callback:u.callback,next:null},d===null?(c=d=g,a=f):d=d.next=g,o|=h;if(u=u.next,u===null){if(u=s.shared.pending,u===null)break;h=u,u=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(a=f),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Bn|=o,e.lanes=o,e.memoizedState=f}}function ac(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(z(191,s));s.call(r)}}}var Hs={},vt=gn(Hs),bs=gn(Hs),zs=gn(Hs);function zn(e){if(e===Hs)throw Error(z(174));return e}function Ka(e,t){switch(q(zs,t),q(bs,e),q(vt,Hs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ho(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ho(t,e)}K(vt),q(vt,t)}function Lr(){K(vt),K(bs),K(zs)}function Ff(e){zn(zs.current);var t=zn(vt.current),n=ho(t,e.type);t!==n&&(q(bs,e),q(vt,n))}function Ga(e){bs.current===e&&(K(vt),K(bs))}var X=gn(0);function Hi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wl=[];function Ya(){for(var e=0;e<Wl.length;e++)Wl[e]._workInProgressVersionPrimary=null;Wl.length=0}var Ni=It.ReactCurrentDispatcher,Kl=It.ReactCurrentBatchConfig,Qn=0,Z=null,ae=null,he=null,qi=!1,ds=!1,Es=0,E0=0;function ve(){throw Error(z(321))}function Xa(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ct(e[n],t[n]))return!1;return!0}function Za(e,t,n,r,s,i){if(Qn=i,Z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ni.current=e===null||e.memoizedState===null?T0:O0,e=n(r,s),ds){i=0;do{if(ds=!1,Es=0,25<=i)throw Error(z(301));i+=1,he=ae=null,t.updateQueue=null,Ni.current=L0,e=n(r,s)}while(ds)}if(Ni.current=Wi,t=ae!==null&&ae.next!==null,Qn=0,he=ae=Z=null,qi=!1,t)throw Error(z(300));return e}function Ja(){var e=Es!==0;return Es=0,e}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?Z.memoizedState=he=e:he=he.next=e,he}function et(){if(ae===null){var e=Z.alternate;e=e!==null?e.memoizedState:null}else e=ae.next;var t=he===null?Z.memoizedState:he.next;if(t!==null)he=t,ae=e;else{if(e===null)throw Error(z(310));ae=e,e={memoizedState:ae.memoizedState,baseState:ae.baseState,baseQueue:ae.baseQueue,queue:ae.queue,next:null},he===null?Z.memoizedState=he=e:he=he.next=e}return he}function Ps(e,t){return typeof t=="function"?t(e):t}function Gl(e){var t=et(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=ae,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var u=o=null,a=null,c=i;do{var d=c.lane;if((Qn&d)===d)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(u=a=f,o=r):a=a.next=f,Z.lanes|=d,Bn|=d}c=c.next}while(c!==null&&c!==i);a===null?o=r:a.next=u,ct(r,t.memoizedState)||(De=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Z.lanes|=i,Bn|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Yl(e){var t=et(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);ct(i,t.memoizedState)||(De=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _f(){}function Df(e,t){var n=Z,r=et(),s=t(),i=!ct(r.memoizedState,s);if(i&&(r.memoizedState=s,De=!0),r=r.queue,eu(Uf.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,Rs(9,Af.bind(null,n,r,s,t),void 0,null),pe===null)throw Error(z(349));Qn&30||If(n,t,s)}return s}function If(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Z.updateQueue,t===null?(t={lastEffect:null,stores:null},Z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Af(e,t,n,r){t.value=n,t.getSnapshot=r,$f(t)&&Qf(e)}function Uf(e,t,n){return n(function(){$f(t)&&Qf(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ct(e,n)}catch{return!0}}function Qf(e){var t=_t(e,1);t!==null&&ut(t,e,1,-1)}function uc(e){var t=ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:e},t.queue=e,e=e.dispatch=M0.bind(null,Z,e),[t.memoizedState,e]}function Rs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Z.updateQueue,t===null?(t={lastEffect:null,stores:null},Z.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Bf(){return et().memoizedState}function Si(e,t,n,r){var s=ht();Z.flags|=e,s.memoizedState=Rs(1|t,n,void 0,r===void 0?null:r)}function dl(e,t,n,r){var s=et();r=r===void 0?null:r;var i=void 0;if(ae!==null){var o=ae.memoizedState;if(i=o.destroy,r!==null&&Xa(r,o.deps)){s.memoizedState=Rs(t,n,i,r);return}}Z.flags|=e,s.memoizedState=Rs(1|t,n,i,r)}function cc(e,t){return Si(8390656,8,e,t)}function eu(e,t){return dl(2048,8,e,t)}function Vf(e,t){return dl(4,2,e,t)}function Hf(e,t){return dl(4,4,e,t)}function qf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Wf(e,t,n){return n=n!=null?n.concat([e]):null,dl(4,4,qf.bind(null,t,e),n)}function tu(){}function Kf(e,t){var n=et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gf(e,t){var n=et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Yf(e,t,n){return Qn&21?(ct(n,t)||(n=ef(),Z.lanes|=n,Bn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,De=!0),e.memoizedState=n)}function P0(e,t){var n=H;H=n!==0&&4>n?n:4,e(!0);var r=Kl.transition;Kl.transition={};try{e(!1),t()}finally{H=n,Kl.transition=r}}function Xf(){return et().memoizedState}function R0(e,t,n){var r=dn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zf(e))Jf(t,n);else if(n=Of(e,t,n,r),n!==null){var s=Pe();ut(n,e,r,s),eh(n,t,r)}}function M0(e,t,n){var r=dn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zf(e))Jf(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(s.hasEagerState=!0,s.eagerState=u,ct(u,o)){var a=t.interleaved;a===null?(s.next=s,qa(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=Of(e,t,s,r),n!==null&&(s=Pe(),ut(n,e,r,s),eh(n,t,r))}}function Zf(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function Jf(e,t){ds=qi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ta(e,n)}}var Wi={readContext:Je,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useInsertionEffect:ve,useLayoutEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useMutableSource:ve,useSyncExternalStore:ve,useId:ve,unstable_isNewReconciler:!1},T0={readContext:Je,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:Je,useEffect:cc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Si(4194308,4,qf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Si(4194308,4,e,t)},useInsertionEffect:function(e,t){return Si(4,2,e,t)},useMemo:function(e,t){var n=ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ht();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=R0.bind(null,Z,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:uc,useDebugValue:tu,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=uc(!1),t=e[0];return e=P0.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Z,s=ht();if(G){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),pe===null)throw Error(z(349));Qn&30||If(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,cc(Uf.bind(null,r,i,e),[e]),r.flags|=2048,Rs(9,Af.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ht(),t=pe.identifierPrefix;if(G){var n=Mt,r=Rt;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Es++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=E0++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},O0={readContext:Je,useCallback:Kf,useContext:Je,useEffect:eu,useImperativeHandle:Wf,useInsertionEffect:Vf,useLayoutEffect:Hf,useMemo:Gf,useReducer:Gl,useRef:Bf,useState:function(){return Gl(Ps)},useDebugValue:tu,useDeferredValue:function(e){var t=et();return Yf(t,ae.memoizedState,e)},useTransition:function(){var e=Gl(Ps)[0],t=et().memoizedState;return[e,t]},useMutableSource:_f,useSyncExternalStore:Df,useId:Xf,unstable_isNewReconciler:!1},L0={readContext:Je,useCallback:Kf,useContext:Je,useEffect:eu,useImperativeHandle:Wf,useInsertionEffect:Vf,useLayoutEffect:Hf,useMemo:Gf,useReducer:Yl,useRef:Bf,useState:function(){return Yl(Ps)},useDebugValue:tu,useDeferredValue:function(e){var t=et();return ae===null?t.memoizedState=e:Yf(t,ae.memoizedState,e)},useTransition:function(){var e=Yl(Ps)[0],t=et().memoizedState;return[e,t]},useMutableSource:_f,useSyncExternalStore:Df,useId:Xf,unstable_isNewReconciler:!1};function rt(e,t){if(e&&e.defaultProps){t=J({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Lo(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:J({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fl={isMounted:function(e){return(e=e._reactInternals)?Gn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pe(),s=dn(e),i=Tt(r,s);i.payload=t,n!=null&&(i.callback=n),t=un(e,i,s),t!==null&&(ut(t,e,s,r),ji(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pe(),s=dn(e),i=Tt(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=un(e,i,s),t!==null&&(ut(t,e,s,r),ji(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pe(),r=dn(e),s=Tt(n,r);s.tag=2,t!=null&&(s.callback=t),t=un(e,s,r),t!==null&&(ut(t,e,r,n),ji(t,e,r))}};function dc(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Ns(n,r)||!Ns(s,i):!0}function th(e,t,n){var r=!1,s=xn,i=t.contextType;return typeof i=="object"&&i!==null?i=Je(i):(s=Ae(t)?Un:Se.current,r=t.contextTypes,i=(r=r!=null)?Mr(e,s):xn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=fl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function fc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&fl.enqueueReplaceState(t,t.state,null)}function Fo(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Wa(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Je(i):(i=Ae(t)?Un:Se.current,s.context=Mr(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Lo(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&fl.enqueueReplaceState(s,s.state,null),Vi(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Fr(e,t){try{var n="",r=t;do n+=am(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Xl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _o(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var F0=typeof WeakMap=="function"?WeakMap:Map;function nh(e,t,n){n=Tt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gi||(Gi=!0,qo=r),_o(e,t)},n}function rh(e,t,n){n=Tt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){_o(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){_o(e,t),typeof r!="function"&&(cn===null?cn=new Set([this]):cn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function hc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new F0;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=G0.bind(null,e,t,n),t.then(e,e))}function pc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mc(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Tt(-1,1),t.tag=2,un(n,t,1))),n.lanes|=1),e)}var _0=It.ReactCurrentOwner,De=!1;function ze(e,t,n,r){t.child=e===null?Tf(t,null,n,r):Or(t,e.child,n,r)}function xc(e,t,n,r,s){n=n.render;var i=t.ref;return xr(t,s),r=Za(e,t,n,r,i,s),n=Ja(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Dt(e,t,s)):(G&&n&&Ua(t),t.flags|=1,ze(e,t,r,s),t.child)}function yc(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!uu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,sh(e,t,i,r,s)):(e=zi(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ns,n(o,r)&&e.ref===t.ref)return Dt(e,t,s)}return t.flags|=1,e=fn(i,r),e.ref=t.ref,e.return=t,t.child=e}function sh(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Ns(i,r)&&e.ref===t.ref)if(De=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(De=!0);else return t.lanes=e.lanes,Dt(e,t,s)}return Do(e,t,n,r,s)}function ih(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},q(cr,$e),$e|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,q(cr,$e),$e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,q(cr,$e),$e|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,q(cr,$e),$e|=r;return ze(e,t,s,n),t.child}function lh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Do(e,t,n,r,s){var i=Ae(n)?Un:Se.current;return i=Mr(t,i),xr(t,s),n=Za(e,t,n,r,i,s),r=Ja(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Dt(e,t,s)):(G&&r&&Ua(t),t.flags|=1,ze(e,t,n,s),t.child)}function gc(e,t,n,r,s){if(Ae(n)){var i=!0;Ai(t)}else i=!1;if(xr(t,s),t.stateNode===null)Ci(e,t),th(t,n,r),Fo(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,u=t.memoizedProps;o.props=u;var a=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Je(c):(c=Ae(n)?Un:Se.current,c=Mr(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(u!==r||a!==c)&&fc(t,o,r,c),Bt=!1;var h=t.memoizedState;o.state=h,Vi(t,r,o,s),a=t.memoizedState,u!==r||h!==a||Ie.current||Bt?(typeof d=="function"&&(Lo(t,n,d,r),a=t.memoizedState),(u=Bt||dc(t,n,u,r,h,a,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=c,r=u):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Lf(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:rt(t.type,u),o.props=c,f=t.pendingProps,h=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=Je(a):(a=Ae(n)?Un:Se.current,a=Mr(t,a));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(u!==f||h!==a)&&fc(t,o,r,a),Bt=!1,h=t.memoizedState,o.state=h,Vi(t,r,o,s);var y=t.memoizedState;u!==f||h!==y||Ie.current||Bt?(typeof g=="function"&&(Lo(t,n,g,r),y=t.memoizedState),(c=Bt||dc(t,n,c,r,h,y,a)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=a,r=c):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Io(e,t,n,r,i,s)}function Io(e,t,n,r,s,i){lh(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&rc(t,n,!1),Dt(e,t,i);r=t.stateNode,_0.current=t;var u=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Or(t,e.child,null,i),t.child=Or(t,null,u,i)):ze(e,t,u,i),t.memoizedState=r.state,s&&rc(t,n,!0),t.child}function oh(e){var t=e.stateNode;t.pendingContext?nc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nc(e,t.context,!1),Ka(e,t.containerInfo)}function vc(e,t,n,r,s){return Tr(),Qa(s),t.flags|=256,ze(e,t,n,r),t.child}var Ao={dehydrated:null,treeContext:null,retryLane:0};function Uo(e){return{baseLanes:e,cachePool:null,transitions:null}}function ah(e,t,n){var r=t.pendingProps,s=X.current,i=!1,o=(t.flags&128)!==0,u;if((u=o)||(u=e!==null&&e.memoizedState===null?!1:(s&2)!==0),u?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),q(X,s&1),e===null)return To(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=ml(o,r,0,null),e=An(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Uo(n),t.memoizedState=Ao,e):nu(t,o));if(s=e.memoizedState,s!==null&&(u=s.dehydrated,u!==null))return D0(e,t,o,r,u,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,u=s.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=fn(s,a),r.subtreeFlags=s.subtreeFlags&14680064),u!==null?i=fn(u,i):(i=An(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Uo(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Ao,r}return i=e.child,e=i.sibling,r=fn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function nu(e,t){return t=ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ui(e,t,n,r){return r!==null&&Qa(r),Or(t,e.child,null,n),e=nu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function D0(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Xl(Error(z(422))),ui(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=ml({mode:"visible",children:r.children},s,0,null),i=An(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Or(t,e.child,null,o),t.child.memoizedState=Uo(o),t.memoizedState=Ao,i);if(!(t.mode&1))return ui(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var u=r.dgst;return r=u,i=Error(z(419)),r=Xl(i,r,void 0),ui(e,t,o,r)}if(u=(o&e.childLanes)!==0,De||u){if(r=pe,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,_t(e,s),ut(r,e,s,-1))}return au(),r=Xl(Error(z(421))),ui(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Y0.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Qe=an(s.nextSibling),Be=t,G=!0,ot=null,e!==null&&(Ge[Ye++]=Rt,Ge[Ye++]=Mt,Ge[Ye++]=$n,Rt=e.id,Mt=e.overflow,$n=t),t=nu(t,r.children),t.flags|=4096,t)}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Oo(e.return,t,n)}function Zl(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function uh(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(ze(e,t,r.children,n),r=X.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(q(X,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Hi(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Zl(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Hi(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Zl(t,!0,n,null,i);break;case"together":Zl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ci(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Bn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=fn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function I0(e,t,n){switch(t.tag){case 3:oh(t),Tr();break;case 5:Ff(t);break;case 1:Ae(t.type)&&Ai(t);break;case 4:Ka(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;q(Qi,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(q(X,X.current&1),t.flags|=128,null):n&t.child.childLanes?ah(e,t,n):(q(X,X.current&1),e=Dt(e,t,n),e!==null?e.sibling:null);q(X,X.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uh(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),q(X,X.current),r)break;return null;case 22:case 23:return t.lanes=0,ih(e,t,n)}return Dt(e,t,n)}var ch,$o,dh,fh;ch=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};$o=function(){};dh=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,zn(vt.current);var i=null;switch(n){case"input":s=ao(e,s),r=ao(e,r),i=[];break;case"select":s=J({},s,{value:void 0}),r=J({},r,{value:void 0}),i=[];break;case"textarea":s=fo(e,s),r=fo(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Di)}po(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var u=s[c];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ms.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var a=r[c];if(u=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&a!==u&&(a!=null||u!=null))if(c==="style")if(u){for(o in u)!u.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&u[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(i||(i=[]),i.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,u=u?u.__html:void 0,a!=null&&u!==a&&(i=i||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ms.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&W("scroll",e),i||u===a||(i=[])):(i=i||[]).push(c,a))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};fh=function(e,t,n,r){n!==r&&(t.flags|=4)};function Jr(e,t){if(!G)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function we(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function A0(e,t,n){var r=t.pendingProps;switch($a(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(t),null;case 1:return Ae(t.type)&&Ii(),we(t),null;case 3:return r=t.stateNode,Lr(),K(Ie),K(Se),Ya(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(oi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ot!==null&&(Go(ot),ot=null))),$o(e,t),we(t),null;case 5:Ga(t);var s=zn(zs.current);if(n=t.type,e!==null&&t.stateNode!=null)dh(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return we(t),null}if(e=zn(vt.current),oi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[yt]=t,r[ks]=i,e=(t.mode&1)!==0,n){case"dialog":W("cancel",r),W("close",r);break;case"iframe":case"object":case"embed":W("load",r);break;case"video":case"audio":for(s=0;s<ss.length;s++)W(ss[s],r);break;case"source":W("error",r);break;case"img":case"image":case"link":W("error",r),W("load",r);break;case"details":W("toggle",r);break;case"input":Pu(r,i),W("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},W("invalid",r);break;case"textarea":Mu(r,i),W("invalid",r)}po(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var u=i[o];o==="children"?typeof u=="string"?r.textContent!==u&&(i.suppressHydrationWarning!==!0&&li(r.textContent,u,e),s=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(i.suppressHydrationWarning!==!0&&li(r.textContent,u,e),s=["children",""+u]):ms.hasOwnProperty(o)&&u!=null&&o==="onScroll"&&W("scroll",r)}switch(n){case"input":Zs(r),Ru(r,i,!0);break;case"textarea":Zs(r),Tu(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Di)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ad(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[yt]=t,e[ks]=r,ch(e,t,!1,!1),t.stateNode=e;e:{switch(o=mo(n,r),n){case"dialog":W("cancel",e),W("close",e),s=r;break;case"iframe":case"object":case"embed":W("load",e),s=r;break;case"video":case"audio":for(s=0;s<ss.length;s++)W(ss[s],e);s=r;break;case"source":W("error",e),s=r;break;case"img":case"image":case"link":W("error",e),W("load",e),s=r;break;case"details":W("toggle",e),s=r;break;case"input":Pu(e,r),s=ao(e,r),W("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=J({},r,{value:void 0}),W("invalid",e);break;case"textarea":Mu(e,r),s=fo(e,r),W("invalid",e);break;default:s=r}po(n,s),u=s;for(i in u)if(u.hasOwnProperty(i)){var a=u[i];i==="style"?Qd(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Ud(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&xs(e,a):typeof a=="number"&&xs(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ms.hasOwnProperty(i)?a!=null&&i==="onScroll"&&W("scroll",e):a!=null&&ba(e,i,a,o))}switch(n){case"input":Zs(e),Ru(e,r,!1);break;case"textarea":Zs(e),Tu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+mn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fr(e,!!r.multiple,i,!1):r.defaultValue!=null&&fr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Di)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return we(t),null;case 6:if(e&&t.stateNode!=null)fh(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=zn(zs.current),zn(vt.current),oi(t)){if(r=t.stateNode,n=t.memoizedProps,r[yt]=t,(i=r.nodeValue!==n)&&(e=Be,e!==null))switch(e.tag){case 3:li(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&li(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yt]=t,t.stateNode=r}return we(t),null;case 13:if(K(X),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(G&&Qe!==null&&t.mode&1&&!(t.flags&128))Rf(),Tr(),t.flags|=98560,i=!1;else if(i=oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(z(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(z(317));i[yt]=t}else Tr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;we(t),i=!1}else ot!==null&&(Go(ot),ot=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||X.current&1?ce===0&&(ce=3):au())),t.updateQueue!==null&&(t.flags|=4),we(t),null);case 4:return Lr(),$o(e,t),e===null&&Ss(t.stateNode.containerInfo),we(t),null;case 10:return Ha(t.type._context),we(t),null;case 17:return Ae(t.type)&&Ii(),we(t),null;case 19:if(K(X),i=t.memoizedState,i===null)return we(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Jr(i,!1);else{if(ce!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Hi(e),o!==null){for(t.flags|=128,Jr(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return q(X,X.current&1|2),t.child}e=e.sibling}i.tail!==null&&ie()>_r&&(t.flags|=128,r=!0,Jr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Hi(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!G)return we(t),null}else 2*ie()-i.renderingStartTime>_r&&n!==1073741824&&(t.flags|=128,r=!0,Jr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ie(),t.sibling=null,n=X.current,q(X,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return ou(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$e&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function U0(e,t){switch($a(t),t.tag){case 1:return Ae(t.type)&&Ii(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lr(),K(Ie),K(Se),Ya(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ga(t),null;case 13:if(K(X),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(X),null;case 4:return Lr(),null;case 10:return Ha(t.type._context),null;case 22:case 23:return ou(),null;case 24:return null;default:return null}}var ci=!1,Ne=!1,$0=typeof WeakSet=="function"?WeakSet:Set,O=null;function ur(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function Qo(e,t,n){try{n()}catch(r){ne(e,t,r)}}var jc=!1;function Q0(e,t){if(ko=Li,e=yf(),Aa(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,u=-1,a=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var g;f!==n||s!==0&&f.nodeType!==3||(u=o+s),f!==i||r!==0&&f.nodeType!==3||(a=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===e)break t;if(h===n&&++c===s&&(u=o),h===i&&++d===r&&(a=o),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=u===-1||a===-1?null:{start:u,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(bo={focusedElem:e,selectionRange:n},Li=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var j=y.memoizedProps,S=y.memoizedState,x=t.stateNode,p=x.getSnapshotBeforeUpdate(t.elementType===t.type?j:rt(t.type,j),S);x.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(w){ne(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return y=jc,jc=!1,y}function fs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Qo(t,n,i)}s=s.next}while(s!==r)}}function hl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Bo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function hh(e){var t=e.alternate;t!==null&&(e.alternate=null,hh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yt],delete t[ks],delete t[Po],delete t[C0],delete t[k0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ph(e){return e.tag===5||e.tag===3||e.tag===4}function Nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ph(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Di));else if(r!==4&&(e=e.child,e!==null))for(Vo(e,t,n),e=e.sibling;e!==null;)Vo(e,t,n),e=e.sibling}function Ho(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ho(e,t,n),e=e.sibling;e!==null;)Ho(e,t,n),e=e.sibling}var me=null,lt=!1;function At(e,t,n){for(n=n.child;n!==null;)mh(e,t,n),n=n.sibling}function mh(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(il,n)}catch{}switch(n.tag){case 5:Ne||ur(n,t);case 6:var r=me,s=lt;me=null,At(e,t,n),me=r,lt=s,me!==null&&(lt?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(lt?(e=me,n=n.stateNode,e.nodeType===8?Hl(e.parentNode,n):e.nodeType===1&&Hl(e,n),ws(e)):Hl(me,n.stateNode));break;case 4:r=me,s=lt,me=n.stateNode.containerInfo,lt=!0,At(e,t,n),me=r,lt=s;break;case 0:case 11:case 14:case 15:if(!Ne&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Qo(n,t,o),s=s.next}while(s!==r)}At(e,t,n);break;case 1:if(!Ne&&(ur(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){ne(n,t,u)}At(e,t,n);break;case 21:At(e,t,n);break;case 22:n.mode&1?(Ne=(r=Ne)||n.memoizedState!==null,At(e,t,n),Ne=r):At(e,t,n);break;default:At(e,t,n)}}function Sc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $0),t.forEach(function(r){var s=X0.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,u=o;e:for(;u!==null;){switch(u.tag){case 5:me=u.stateNode,lt=!1;break e;case 3:me=u.stateNode.containerInfo,lt=!0;break e;case 4:me=u.stateNode.containerInfo,lt=!0;break e}u=u.return}if(me===null)throw Error(z(160));mh(i,o,s),me=null,lt=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){ne(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)xh(t,e),t=t.sibling}function xh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nt(t,e),ft(e),r&4){try{fs(3,e,e.return),hl(3,e)}catch(j){ne(e,e.return,j)}try{fs(5,e,e.return)}catch(j){ne(e,e.return,j)}}break;case 1:nt(t,e),ft(e),r&512&&n!==null&&ur(n,n.return);break;case 5:if(nt(t,e),ft(e),r&512&&n!==null&&ur(n,n.return),e.flags&32){var s=e.stateNode;try{xs(s,"")}catch(j){ne(e,e.return,j)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,u=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{u==="input"&&i.type==="radio"&&i.name!=null&&Dd(s,i),mo(u,o);var c=mo(u,i);for(o=0;o<a.length;o+=2){var d=a[o],f=a[o+1];d==="style"?Qd(s,f):d==="dangerouslySetInnerHTML"?Ud(s,f):d==="children"?xs(s,f):ba(s,d,f,c)}switch(u){case"input":uo(s,i);break;case"textarea":Id(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?fr(s,!!i.multiple,g,!1):h!==!!i.multiple&&(i.defaultValue!=null?fr(s,!!i.multiple,i.defaultValue,!0):fr(s,!!i.multiple,i.multiple?[]:"",!1))}s[ks]=i}catch(j){ne(e,e.return,j)}}break;case 6:if(nt(t,e),ft(e),r&4){if(e.stateNode===null)throw Error(z(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(j){ne(e,e.return,j)}}break;case 3:if(nt(t,e),ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ws(t.containerInfo)}catch(j){ne(e,e.return,j)}break;case 4:nt(t,e),ft(e);break;case 13:nt(t,e),ft(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(iu=ie())),r&4&&Sc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ne=(c=Ne)||d,nt(t,e),Ne=c):nt(t,e),ft(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(O=e,d=e.child;d!==null;){for(f=O=d;O!==null;){switch(h=O,g=h.child,h.tag){case 0:case 11:case 14:case 15:fs(4,h,h.return);break;case 1:ur(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(j){ne(r,n,j)}}break;case 5:ur(h,h.return);break;case 22:if(h.memoizedState!==null){kc(f);continue}}g!==null?(g.return=h,O=g):kc(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(u=f.stateNode,a=f.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,u.style.display=$d("display",o))}catch(j){ne(e,e.return,j)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(j){ne(e,e.return,j)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:nt(t,e),ft(e),r&4&&Sc(e);break;case 21:break;default:nt(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ph(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(xs(s,""),r.flags&=-33);var i=Nc(e);Ho(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,u=Nc(e);Vo(e,u,o);break;default:throw Error(z(161))}}catch(a){ne(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function B0(e,t,n){O=e,yh(e)}function yh(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var s=O,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||ci;if(!o){var u=s.alternate,a=u!==null&&u.memoizedState!==null||Ne;u=ci;var c=Ne;if(ci=o,(Ne=a)&&!c)for(O=s;O!==null;)o=O,a=o.child,o.tag===22&&o.memoizedState!==null?bc(s):a!==null?(a.return=o,O=a):bc(s);for(;i!==null;)O=i,yh(i),i=i.sibling;O=s,ci=u,Ne=c}Cc(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,O=i):Cc(e)}}function Cc(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ne||hl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ne)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:rt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ac(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ac(t,o,n)}break;case 5:var u=t.stateNode;if(n===null&&t.flags&4){n=u;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&ws(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Ne||t.flags&512&&Bo(t)}catch(h){ne(t,t.return,h)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function kc(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function bc(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{hl(4,t)}catch(a){ne(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){ne(t,s,a)}}var i=t.return;try{Bo(t)}catch(a){ne(t,i,a)}break;case 5:var o=t.return;try{Bo(t)}catch(a){ne(t,o,a)}}}catch(a){ne(t,t.return,a)}if(t===e){O=null;break}var u=t.sibling;if(u!==null){u.return=t.return,O=u;break}O=t.return}}var V0=Math.ceil,Ki=It.ReactCurrentDispatcher,ru=It.ReactCurrentOwner,Ze=It.ReactCurrentBatchConfig,B=0,pe=null,oe=null,xe=0,$e=0,cr=gn(0),ce=0,Ms=null,Bn=0,pl=0,su=0,hs=null,_e=null,iu=0,_r=1/0,Ct=null,Gi=!1,qo=null,cn=null,di=!1,nn=null,Yi=0,ps=0,Wo=null,ki=-1,bi=0;function Pe(){return B&6?ie():ki!==-1?ki:ki=ie()}function dn(e){return e.mode&1?B&2&&xe!==0?xe&-xe:z0.transition!==null?(bi===0&&(bi=ef()),bi):(e=H,e!==0||(e=window.event,e=e===void 0?16:af(e.type)),e):1}function ut(e,t,n,r){if(50<ps)throw ps=0,Wo=null,Error(z(185));Qs(e,n,r),(!(B&2)||e!==pe)&&(e===pe&&(!(B&2)&&(pl|=n),ce===4&&Ht(e,xe)),Ue(e,r),n===1&&B===0&&!(t.mode&1)&&(_r=ie()+500,cl&&vn()))}function Ue(e,t){var n=e.callbackNode;zm(e,t);var r=Oi(e,e===pe?xe:0);if(r===0)n!==null&&Fu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Fu(n),t===1)e.tag===0?b0(zc.bind(null,e)):zf(zc.bind(null,e)),N0(function(){!(B&6)&&vn()}),n=null;else{switch(tf(r)){case 1:n=Ma;break;case 4:n=Zd;break;case 16:n=Ti;break;case 536870912:n=Jd;break;default:n=Ti}n=kh(n,gh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function gh(e,t){if(ki=-1,bi=0,B&6)throw Error(z(327));var n=e.callbackNode;if(yr()&&e.callbackNode!==n)return null;var r=Oi(e,e===pe?xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Xi(e,r);else{t=r;var s=B;B|=2;var i=wh();(pe!==e||xe!==t)&&(Ct=null,_r=ie()+500,In(e,t));do try{W0();break}catch(u){vh(e,u)}while(!0);Va(),Ki.current=i,B=s,oe!==null?t=0:(pe=null,xe=0,t=ce)}if(t!==0){if(t===2&&(s=wo(e),s!==0&&(r=s,t=Ko(e,s))),t===1)throw n=Ms,In(e,0),Ht(e,r),Ue(e,ie()),n;if(t===6)Ht(e,r);else{if(s=e.current.alternate,!(r&30)&&!H0(s)&&(t=Xi(e,r),t===2&&(i=wo(e),i!==0&&(r=i,t=Ko(e,i))),t===1))throw n=Ms,In(e,0),Ht(e,r),Ue(e,ie()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:Cn(e,_e,Ct);break;case 3:if(Ht(e,r),(r&130023424)===r&&(t=iu+500-ie(),10<t)){if(Oi(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Pe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Eo(Cn.bind(null,e,_e,Ct),t);break}Cn(e,_e,Ct);break;case 4:if(Ht(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-at(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*V0(r/1960))-r,10<r){e.timeoutHandle=Eo(Cn.bind(null,e,_e,Ct),r);break}Cn(e,_e,Ct);break;case 5:Cn(e,_e,Ct);break;default:throw Error(z(329))}}}return Ue(e,ie()),e.callbackNode===n?gh.bind(null,e):null}function Ko(e,t){var n=hs;return e.current.memoizedState.isDehydrated&&(In(e,t).flags|=256),e=Xi(e,t),e!==2&&(t=_e,_e=n,t!==null&&Go(t)),e}function Go(e){_e===null?_e=e:_e.push.apply(_e,e)}function H0(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!ct(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ht(e,t){for(t&=~su,t&=~pl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function zc(e){if(B&6)throw Error(z(327));yr();var t=Oi(e,0);if(!(t&1))return Ue(e,ie()),null;var n=Xi(e,t);if(e.tag!==0&&n===2){var r=wo(e);r!==0&&(t=r,n=Ko(e,r))}if(n===1)throw n=Ms,In(e,0),Ht(e,t),Ue(e,ie()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Cn(e,_e,Ct),Ue(e,ie()),null}function lu(e,t){var n=B;B|=1;try{return e(t)}finally{B=n,B===0&&(_r=ie()+500,cl&&vn())}}function Vn(e){nn!==null&&nn.tag===0&&!(B&6)&&yr();var t=B;B|=1;var n=Ze.transition,r=H;try{if(Ze.transition=null,H=1,e)return e()}finally{H=r,Ze.transition=n,B=t,!(B&6)&&vn()}}function ou(){$e=cr.current,K(cr)}function In(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,j0(n)),oe!==null)for(n=oe.return;n!==null;){var r=n;switch($a(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ii();break;case 3:Lr(),K(Ie),K(Se),Ya();break;case 5:Ga(r);break;case 4:Lr();break;case 13:K(X);break;case 19:K(X);break;case 10:Ha(r.type._context);break;case 22:case 23:ou()}n=n.return}if(pe=e,oe=e=fn(e.current,null),xe=$e=t,ce=0,Ms=null,su=pl=Bn=0,_e=hs=null,bn!==null){for(t=0;t<bn.length;t++)if(n=bn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}bn=null}return e}function vh(e,t){do{var n=oe;try{if(Va(),Ni.current=Wi,qi){for(var r=Z.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}qi=!1}if(Qn=0,he=ae=Z=null,ds=!1,Es=0,ru.current=null,n===null||n.return===null){ce=1,Ms=t,oe=null;break}e:{var i=e,o=n.return,u=n,a=t;if(t=xe,u.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,d=u,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=pc(o);if(g!==null){g.flags&=-257,mc(g,o,u,i,t),g.mode&1&&hc(i,c,t),t=g,a=c;var y=t.updateQueue;if(y===null){var j=new Set;j.add(a),t.updateQueue=j}else y.add(a);break e}else{if(!(t&1)){hc(i,c,t),au();break e}a=Error(z(426))}}else if(G&&u.mode&1){var S=pc(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),mc(S,o,u,i,t),Qa(Fr(a,u));break e}}i=a=Fr(a,u),ce!==4&&(ce=2),hs===null?hs=[i]:hs.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=nh(i,a,t);oc(i,x);break e;case 1:u=a;var p=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(cn===null||!cn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=rh(i,u,t);oc(i,w);break e}}i=i.return}while(i!==null)}Nh(n)}catch(C){t=C,oe===n&&n!==null&&(oe=n=n.return);continue}break}while(!0)}function wh(){var e=Ki.current;return Ki.current=Wi,e===null?Wi:e}function au(){(ce===0||ce===3||ce===2)&&(ce=4),pe===null||!(Bn&268435455)&&!(pl&268435455)||Ht(pe,xe)}function Xi(e,t){var n=B;B|=2;var r=wh();(pe!==e||xe!==t)&&(Ct=null,In(e,t));do try{q0();break}catch(s){vh(e,s)}while(!0);if(Va(),B=n,Ki.current=r,oe!==null)throw Error(z(261));return pe=null,xe=0,ce}function q0(){for(;oe!==null;)jh(oe)}function W0(){for(;oe!==null&&!gm();)jh(oe)}function jh(e){var t=Ch(e.alternate,e,$e);e.memoizedProps=e.pendingProps,t===null?Nh(e):oe=t,ru.current=null}function Nh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=U0(n,t),n!==null){n.flags&=32767,oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ce=6,oe=null;return}}else if(n=A0(n,t,$e),n!==null){oe=n;return}if(t=t.sibling,t!==null){oe=t;return}oe=t=e}while(t!==null);ce===0&&(ce=5)}function Cn(e,t,n){var r=H,s=Ze.transition;try{Ze.transition=null,H=1,K0(e,t,n,r)}finally{Ze.transition=s,H=r}return null}function K0(e,t,n,r){do yr();while(nn!==null);if(B&6)throw Error(z(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Em(e,i),e===pe&&(oe=pe=null,xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||di||(di=!0,kh(Ti,function(){return yr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Ze.transition,Ze.transition=null;var o=H;H=1;var u=B;B|=4,ru.current=null,Q0(e,n),xh(n,e),p0(bo),Li=!!ko,bo=ko=null,e.current=n,B0(n),vm(),B=u,H=o,Ze.transition=i}else e.current=n;if(di&&(di=!1,nn=e,Yi=s),i=e.pendingLanes,i===0&&(cn=null),Nm(n.stateNode),Ue(e,ie()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Gi)throw Gi=!1,e=qo,qo=null,e;return Yi&1&&e.tag!==0&&yr(),i=e.pendingLanes,i&1?e===Wo?ps++:(ps=0,Wo=e):ps=0,vn(),null}function yr(){if(nn!==null){var e=tf(Yi),t=Ze.transition,n=H;try{if(Ze.transition=null,H=16>e?16:e,nn===null)var r=!1;else{if(e=nn,nn=null,Yi=0,B&6)throw Error(z(331));var s=B;for(B|=4,O=e.current;O!==null;){var i=O,o=i.child;if(O.flags&16){var u=i.deletions;if(u!==null){for(var a=0;a<u.length;a++){var c=u[a];for(O=c;O!==null;){var d=O;switch(d.tag){case 0:case 11:case 15:fs(8,d,i)}var f=d.child;if(f!==null)f.return=d,O=f;else for(;O!==null;){d=O;var h=d.sibling,g=d.return;if(hh(d),d===c){O=null;break}if(h!==null){h.return=g,O=h;break}O=g}}}var y=i.alternate;if(y!==null){var j=y.child;if(j!==null){y.child=null;do{var S=j.sibling;j.sibling=null,j=S}while(j!==null)}}O=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,O=o;else e:for(;O!==null;){if(i=O,i.flags&2048)switch(i.tag){case 0:case 11:case 15:fs(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,O=x;break e}O=i.return}}var p=e.current;for(O=p;O!==null;){o=O;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,O=m;else e:for(o=p;O!==null;){if(u=O,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:hl(9,u)}}catch(C){ne(u,u.return,C)}if(u===o){O=null;break e}var w=u.sibling;if(w!==null){w.return=u.return,O=w;break e}O=u.return}}if(B=s,vn(),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(il,e)}catch{}r=!0}return r}finally{H=n,Ze.transition=t}}return!1}function Ec(e,t,n){t=Fr(n,t),t=nh(e,t,1),e=un(e,t,1),t=Pe(),e!==null&&(Qs(e,1,t),Ue(e,t))}function ne(e,t,n){if(e.tag===3)Ec(e,e,n);else for(;t!==null;){if(t.tag===3){Ec(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(cn===null||!cn.has(r))){e=Fr(n,e),e=rh(t,e,1),t=un(t,e,1),e=Pe(),t!==null&&(Qs(t,1,e),Ue(t,e));break}}t=t.return}}function G0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Pe(),e.pingedLanes|=e.suspendedLanes&n,pe===e&&(xe&n)===n&&(ce===4||ce===3&&(xe&130023424)===xe&&500>ie()-iu?In(e,0):su|=n),Ue(e,t)}function Sh(e,t){t===0&&(e.mode&1?(t=ti,ti<<=1,!(ti&130023424)&&(ti=4194304)):t=1);var n=Pe();e=_t(e,t),e!==null&&(Qs(e,t,n),Ue(e,n))}function Y0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sh(e,n)}function X0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Sh(e,n)}var Ch;Ch=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ie.current)De=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return De=!1,I0(e,t,n);De=!!(e.flags&131072)}else De=!1,G&&t.flags&1048576&&Ef(t,$i,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ci(e,t),e=t.pendingProps;var s=Mr(t,Se.current);xr(t,n),s=Za(null,t,r,e,s,n);var i=Ja();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(r)?(i=!0,Ai(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wa(t),s.updater=fl,t.stateNode=s,s._reactInternals=t,Fo(t,r,e,n),t=Io(null,t,r,!0,i,n)):(t.tag=0,G&&i&&Ua(t),ze(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ci(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=J0(r),e=rt(r,e),s){case 0:t=Do(null,t,r,e,n);break e;case 1:t=gc(null,t,r,e,n);break e;case 11:t=xc(null,t,r,e,n);break e;case 14:t=yc(null,t,r,rt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rt(r,s),Do(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rt(r,s),gc(e,t,r,s,n);case 3:e:{if(oh(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Lf(e,t),Vi(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Fr(Error(z(423)),t),t=vc(e,t,r,n,s);break e}else if(r!==s){s=Fr(Error(z(424)),t),t=vc(e,t,r,n,s);break e}else for(Qe=an(t.stateNode.containerInfo.firstChild),Be=t,G=!0,ot=null,n=Tf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),r===s){t=Dt(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return Ff(t),e===null&&To(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,zo(r,s)?o=null:i!==null&&zo(r,i)&&(t.flags|=32),lh(e,t),ze(e,t,o,n),t.child;case 6:return e===null&&To(t),null;case 13:return ah(e,t,n);case 4:return Ka(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Or(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rt(r,s),xc(e,t,r,s,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,q(Qi,r._currentValue),r._currentValue=o,i!==null)if(ct(i.value,o)){if(i.children===s.children&&!Ie.current){t=Dt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){o=i.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Tt(-1,n&-n),a.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?a.next=a:(a.next=d.next,d.next=a),c.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Oo(i.return,n,t),u.lanes|=n;break}a=a.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(z(341));o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Oo(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ze(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,xr(t,n),s=Je(s),r=r(s),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,s=rt(r,t.pendingProps),s=rt(r.type,s),yc(e,t,r,s,n);case 15:return sh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:rt(r,s),Ci(e,t),t.tag=1,Ae(r)?(e=!0,Ai(t)):e=!1,xr(t,n),th(t,r,s),Fo(t,r,s,n),Io(null,t,r,!0,e,n);case 19:return uh(e,t,n);case 22:return ih(e,t,n)}throw Error(z(156,t.tag))};function kh(e,t){return Xd(e,t)}function Z0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xe(e,t,n,r){return new Z0(e,t,n,r)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function J0(e){if(typeof e=="function")return uu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ea)return 11;if(e===Pa)return 14}return 2}function fn(e,t){var n=e.alternate;return n===null?(n=Xe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function zi(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")uu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case er:return An(n.children,s,i,t);case za:o=8,s|=8;break;case so:return e=Xe(12,n,t,s|2),e.elementType=so,e.lanes=i,e;case io:return e=Xe(13,n,t,s),e.elementType=io,e.lanes=i,e;case lo:return e=Xe(19,n,t,s),e.elementType=lo,e.lanes=i,e;case Ld:return ml(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Td:o=10;break e;case Od:o=9;break e;case Ea:o=11;break e;case Pa:o=14;break e;case Qt:o=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Xe(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function An(e,t,n,r){return e=Xe(7,e,r,t),e.lanes=n,e}function ml(e,t,n,r){return e=Xe(22,e,r,t),e.elementType=Ld,e.lanes=n,e.stateNode={isHidden:!1},e}function Jl(e,t,n){return e=Xe(6,e,null,t),e.lanes=n,e}function eo(e,t,n){return t=Xe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ex(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ll(0),this.expirationTimes=Ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function cu(e,t,n,r,s,i,o,u,a){return e=new ex(e,t,n,u,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xe(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wa(i),e}function tx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function bh(e){if(!e)return xn;e=e._reactInternals;e:{if(Gn(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ae(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(Ae(n))return bf(e,n,t)}return t}function zh(e,t,n,r,s,i,o,u,a){return e=cu(n,r,!0,e,s,i,o,u,a),e.context=bh(null),n=e.current,r=Pe(),s=dn(n),i=Tt(r,s),i.callback=t??null,un(n,i,s),e.current.lanes=s,Qs(e,s,r),Ue(e,r),e}function xl(e,t,n,r){var s=t.current,i=Pe(),o=dn(s);return n=bh(n),t.context===null?t.context=n:t.pendingContext=n,t=Tt(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=un(s,t,o),e!==null&&(ut(e,s,o,i),ji(e,s,o)),o}function Zi(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Pc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function du(e,t){Pc(e,t),(e=e.alternate)&&Pc(e,t)}function nx(){return null}var Eh=typeof reportError=="function"?reportError:function(e){console.error(e)};function fu(e){this._internalRoot=e}yl.prototype.render=fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));xl(e,t,null,null)};yl.prototype.unmount=fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Vn(function(){xl(null,e,null,null)}),t[Ft]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=sf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vt.length&&t!==0&&t<Vt[n].priority;n++);Vt.splice(n,0,e),n===0&&of(e)}};function hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rc(){}function rx(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Zi(o);i.call(c)}}var o=zh(t,r,e,0,null,!1,!1,"",Rc);return e._reactRootContainer=o,e[Ft]=o.current,Ss(e.nodeType===8?e.parentNode:e),Vn(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var u=r;r=function(){var c=Zi(a);u.call(c)}}var a=cu(e,0,!1,null,null,!1,!1,"",Rc);return e._reactRootContainer=a,e[Ft]=a.current,Ss(e.nodeType===8?e.parentNode:e),Vn(function(){xl(t,a,n,r)}),a}function vl(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var u=s;s=function(){var a=Zi(o);u.call(a)}}xl(t,o,e,s)}else o=rx(n,t,e,s,r);return Zi(o)}nf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=rs(t.pendingLanes);n!==0&&(Ta(t,n|1),Ue(t,ie()),!(B&6)&&(_r=ie()+500,vn()))}break;case 13:Vn(function(){var r=_t(e,1);if(r!==null){var s=Pe();ut(r,e,1,s)}}),du(e,1)}};Oa=function(e){if(e.tag===13){var t=_t(e,134217728);if(t!==null){var n=Pe();ut(t,e,134217728,n)}du(e,134217728)}};rf=function(e){if(e.tag===13){var t=dn(e),n=_t(e,t);if(n!==null){var r=Pe();ut(n,e,t,r)}du(e,t)}};sf=function(){return H};lf=function(e,t){var n=H;try{return H=e,t()}finally{H=n}};yo=function(e,t,n){switch(t){case"input":if(uo(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=ul(r);if(!s)throw Error(z(90));_d(r),uo(r,s)}}}break;case"textarea":Id(e,n);break;case"select":t=n.value,t!=null&&fr(e,!!n.multiple,t,!1)}};Hd=lu;qd=Vn;var sx={usingClientEntryPoint:!1,Events:[Vs,sr,ul,Bd,Vd,lu]},es={findFiberByHostInstance:kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ix={bundleType:es.bundleType,version:es.version,rendererPackageName:es.rendererPackageName,rendererConfig:es.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:It.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Gd(e),e===null?null:e.stateNode},findFiberByHostInstance:es.findFiberByHostInstance||nx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fi.isDisabled&&fi.supportsFiber)try{il=fi.inject(ix),gt=fi}catch{}}He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sx;He.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hu(t))throw Error(z(200));return tx(e,t,null,n)};He.createRoot=function(e,t){if(!hu(e))throw Error(z(299));var n=!1,r="",s=Eh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=cu(e,1,!1,null,null,n,!1,r,s),e[Ft]=t.current,Ss(e.nodeType===8?e.parentNode:e),new fu(t)};He.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=Gd(t),e=e===null?null:e.stateNode,e};He.flushSync=function(e){return Vn(e)};He.hydrate=function(e,t,n){if(!gl(t))throw Error(z(200));return vl(null,e,t,!0,n)};He.hydrateRoot=function(e,t,n){if(!hu(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Eh;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=zh(t,null,e,1,n??null,s,!1,i,o),e[Ft]=t.current,Ss(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new yl(t)};He.render=function(e,t,n){if(!gl(t))throw Error(z(200));return vl(null,e,t,!1,n)};He.unmountComponentAtNode=function(e){if(!gl(e))throw Error(z(40));return e._reactRootContainer?(Vn(function(){vl(null,null,e,!1,function(){e._reactRootContainer=null,e[Ft]=null})}),!0):!1};He.unstable_batchedUpdates=lu;He.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!gl(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return vl(e,t,n,!1,r)};He.version="18.3.1-next-f1338f8080-20240426";function Ph(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ph)}catch(e){console.error(e)}}Ph(),Ed.exports=He;var lx=Ed.exports,Mc=lx;no.createRoot=Mc.createRoot,no.hydrateRoot=Mc.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function Ts(){return Ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ts.apply(this,arguments)}var rn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(rn||(rn={}));const Tc="popstate";function ox(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:u}=r.location;return Yo("",{pathname:i,search:o,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ji(s)}return ux(t,n,null,e)}function re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pu(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ax(){return Math.random().toString(36).substr(2,8)}function Oc(e,t){return{usr:e.state,key:e.key,idx:t}}function Yo(e,t,n,r){return n===void 0&&(n=null),Ts({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vr(t):t,{state:n,key:t&&t.key||r||ax()})}function Ji(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Vr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ux(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,u=rn.Pop,a=null,c=d();c==null&&(c=0,o.replaceState(Ts({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){u=rn.Pop;let S=d(),x=S==null?null:S-c;c=S,a&&a({action:u,location:j.location,delta:x})}function h(S,x){u=rn.Push;let p=Yo(j.location,S,x);c=d()+1;let m=Oc(p,c),w=j.createHref(p);try{o.pushState(m,"",w)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(w)}i&&a&&a({action:u,location:j.location,delta:1})}function g(S,x){u=rn.Replace;let p=Yo(j.location,S,x);c=d();let m=Oc(p,c),w=j.createHref(p);o.replaceState(m,"",w),i&&a&&a({action:u,location:j.location,delta:0})}function y(S){let x=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof S=="string"?S:Ji(S);return p=p.replace(/ $/,"%20"),re(x,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,x)}let j={get action(){return u},get location(){return e(s,o)},listen(S){if(a)throw new Error("A history only accepts one active listener");return s.addEventListener(Tc,f),a=S,()=>{s.removeEventListener(Tc,f),a=null}},createHref(S){return t(s,S)},createURL:y,encodeLocation(S){let x=y(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:g,go(S){return o.go(S)}};return j}var Lc;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Lc||(Lc={}));function cx(e,t,n){return n===void 0&&(n="/"),dx(e,t,n)}function dx(e,t,n,r){let s=typeof t=="string"?Vr(t):t,i=Dr(s.pathname||"/",n);if(i==null)return null;let o=Rh(e);fx(o);let u=null;for(let a=0;u==null&&a<o.length;++a){let c=Sx(i);u=jx(o[a],c)}return u}function Rh(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,u)=>{let a={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};a.relativePath.startsWith("/")&&(re(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let c=hn([r,a.relativePath]),d=n.concat(a);i.children&&i.children.length>0&&(re(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Rh(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:vx(c,i.index),routesMeta:d})};return e.forEach((i,o)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))s(i,o);else for(let a of Mh(i.path))s(i,o,a)}),t}function Mh(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Mh(r.join("/")),u=[];return u.push(...o.map(a=>a===""?i:[i,a].join("/"))),s&&u.push(...o),u.map(a=>e.startsWith("/")&&a===""?"/":a)}function fx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:wx(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const hx=/^:[\w-]+$/,px=3,mx=2,xx=1,yx=10,gx=-2,Fc=e=>e==="*";function vx(e,t){let n=e.split("/"),r=n.length;return n.some(Fc)&&(r+=gx),t&&(r+=mx),n.filter(s=>!Fc(s)).reduce((s,i)=>s+(hx.test(i)?px:i===""?xx:yx),r)}function wx(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function jx(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let u=0;u<r.length;++u){let a=r[u],c=u===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=Xo({path:a.relativePath,caseSensitive:a.caseSensitive,end:c},d),h=a.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:hn([i,f.pathname]),pathnameBase:Ex(hn([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=hn([i,f.pathnameBase]))}return o}function Xo(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Nx(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((c,d,f)=>{let{paramName:h,isOptional:g}=d;if(h==="*"){let j=u[f]||"";o=i.slice(0,i.length-j.length).replace(/(.)\/+$/,"$1")}const y=u[f];return g&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function Nx(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),pu(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,u,a)=>(r.push({paramName:u,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function Sx(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pu(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Dr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Cx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kx=e=>Cx.test(e);function bx(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Vr(e):e,i;if(n)if(kx(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),pu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=_c(n.substring(1),"/"):i=_c(n,t)}else i=t;return{pathname:i,search:Px(r),hash:Rx(s)}}function _c(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function to(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function zx(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Th(e,t){let n=zx(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Oh(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Vr(e):(s=Ts({},e),re(!s.pathname||!s.pathname.includes("?"),to("?","pathname","search",s)),re(!s.pathname||!s.pathname.includes("#"),to("#","pathname","hash",s)),re(!s.search||!s.search.includes("#"),to("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,u;if(o==null)u=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}u=f>=0?t[f]:"/"}let a=bx(s,u),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(c||d)&&(a.pathname+="/"),a}const hn=e=>e.join("/").replace(/\/\/+/g,"/"),Ex=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Px=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Rx=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Mx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Lh=["post","put","patch","delete"];new Set(Lh);const Tx=["get",...Lh];new Set(Tx);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Os.apply(this,arguments)}const wl=N.createContext(null),Fh=N.createContext(null),wn=N.createContext(null),jl=N.createContext(null),jn=N.createContext({outlet:null,matches:[],isDataRoute:!1}),_h=N.createContext(null);function Ox(e,t){let{relative:n}=t===void 0?{}:t;qs()||re(!1);let{basename:r,navigator:s}=N.useContext(wn),{hash:i,pathname:o,search:u}=Nl(e,{relative:n}),a=o;return r!=="/"&&(a=o==="/"?r:hn([r,o])),s.createHref({pathname:a,search:u,hash:i})}function qs(){return N.useContext(jl)!=null}function Ws(){return qs()||re(!1),N.useContext(jl).location}function Dh(e){N.useContext(wn).static||N.useLayoutEffect(e)}function Lx(){let{isDataRoute:e}=N.useContext(jn);return e?Gx():Fx()}function Fx(){qs()||re(!1);let e=N.useContext(wl),{basename:t,future:n,navigator:r}=N.useContext(wn),{matches:s}=N.useContext(jn),{pathname:i}=Ws(),o=JSON.stringify(Th(s,n.v7_relativeSplatPath)),u=N.useRef(!1);return Dh(()=>{u.current=!0}),N.useCallback(function(c,d){if(d===void 0&&(d={}),!u.current)return;if(typeof c=="number"){r.go(c);return}let f=Oh(c,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:hn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}const _x=N.createContext(null);function Dx(e){let t=N.useContext(jn).outlet;return t&&N.createElement(_x.Provider,{value:e},t)}function Nl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=N.useContext(wn),{matches:s}=N.useContext(jn),{pathname:i}=Ws(),o=JSON.stringify(Th(s,r.v7_relativeSplatPath));return N.useMemo(()=>Oh(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Ix(e,t){return Ax(e,t)}function Ax(e,t,n,r){qs()||re(!1);let{navigator:s}=N.useContext(wn),{matches:i}=N.useContext(jn),o=i[i.length-1],u=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let c=Ws(),d;if(t){var f;let S=typeof t=="string"?Vr(t):t;a==="/"||(f=S.pathname)!=null&&f.startsWith(a)||re(!1),d=S}else d=c;let h=d.pathname||"/",g=h;if(a!=="/"){let S=a.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let y=cx(e,{pathname:g}),j=Vx(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},u,S.params),pathname:hn([a,s.encodeLocation?s.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:hn([a,s.encodeLocation?s.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&j?N.createElement(jl.Provider,{value:{location:Os({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:rn.Pop}},j):j}function Ux(){let e=Kx(),t=Mx(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},t),n?N.createElement("pre",{style:s},n):null,null)}const $x=N.createElement(Ux,null);class Qx extends N.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?N.createElement(jn.Provider,{value:this.props.routeContext},N.createElement(_h.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bx(e){let{routeContext:t,match:n,children:r}=e,s=N.useContext(wl);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),N.createElement(jn.Provider,{value:t},r)}function Vx(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,u=(s=n)==null?void 0:s.errors;if(u!=null){let d=o.findIndex(f=>f.route.id&&(u==null?void 0:u[f.route.id])!==void 0);d>=0||re(!1),o=o.slice(0,Math.min(o.length,d+1))}let a=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:h,errors:g}=n,y=f.route.loader&&h[f.route.id]===void 0&&(!g||g[f.route.id]===void 0);if(f.route.lazy||y){a=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let g,y=!1,j=null,S=null;n&&(g=u&&f.route.id?u[f.route.id]:void 0,j=f.route.errorElement||$x,a&&(c<0&&h===0?(Yx("route-fallback"),y=!0,S=null):c===h&&(y=!0,S=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),p=()=>{let m;return g?m=j:y?m=S:f.route.Component?m=N.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=d,N.createElement(Bx,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:m})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?N.createElement(Qx,{location:n.location,revalidation:n.revalidation,component:j,error:g,children:p(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):p()},null)}var Ih=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ih||{}),Ah=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ah||{});function Hx(e){let t=N.useContext(wl);return t||re(!1),t}function qx(e){let t=N.useContext(Fh);return t||re(!1),t}function Wx(e){let t=N.useContext(jn);return t||re(!1),t}function Uh(e){let t=Wx(),n=t.matches[t.matches.length-1];return n.route.id||re(!1),n.route.id}function Kx(){var e;let t=N.useContext(_h),n=qx(),r=Uh();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Gx(){let{router:e}=Hx(Ih.UseNavigateStable),t=Uh(Ah.UseNavigateStable),n=N.useRef(!1);return Dh(()=>{n.current=!0}),N.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Os({fromRouteId:t},i)))},[e,t])}const Dc={};function Yx(e,t,n){Dc[e]||(Dc[e]=!0)}function Xx(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Zx(e){return Dx(e.context)}function Ut(e){re(!1)}function Jx(e){let{basename:t="/",children:n=null,location:r,navigationType:s=rn.Pop,navigator:i,static:o=!1,future:u}=e;qs()&&re(!1);let a=t.replace(/^\/*/,"/"),c=N.useMemo(()=>({basename:a,navigator:i,static:o,future:Os({v7_relativeSplatPath:!1},u)}),[a,u,i,o]);typeof r=="string"&&(r=Vr(r));let{pathname:d="/",search:f="",hash:h="",state:g=null,key:y="default"}=r,j=N.useMemo(()=>{let S=Dr(d,a);return S==null?null:{location:{pathname:S,search:f,hash:h,state:g,key:y},navigationType:s}},[a,d,f,h,g,y,s]);return j==null?null:N.createElement(wn.Provider,{value:c},N.createElement(jl.Provider,{children:n,value:j}))}function ey(e){let{children:t,location:n}=e;return Ix(Zo(t),n)}new Promise(()=>{});function Zo(e,t){t===void 0&&(t=[]);let n=[];return N.Children.forEach(e,(r,s)=>{if(!N.isValidElement(r))return;let i=[...t,s];if(r.type===N.Fragment){n.push.apply(n,Zo(r.props.children,i));return}r.type!==Ut&&re(!1),!r.props.index||!r.props.children||re(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Zo(r.props.children,i)),n.push(o)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function el(){return el=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},el.apply(this,arguments)}function $h(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function ty(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ny(e,t){return e.button===0&&(!t||t==="_self")&&!ty(e)}const ry=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],sy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],iy="6";try{window.__reactRouterVersion=iy}catch{}const ly=N.createContext({isTransitioning:!1}),oy="startTransition",Ic=Gp[oy];function ay(e){let{basename:t,children:n,future:r,window:s}=e,i=N.useRef();i.current==null&&(i.current=ox({window:s,v5Compat:!0}));let o=i.current,[u,a]=N.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=N.useCallback(f=>{c&&Ic?Ic(()=>a(f)):a(f)},[a,c]);return N.useLayoutEffect(()=>o.listen(d),[o,d]),N.useEffect(()=>Xx(r),[r]),N.createElement(Jx,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:o,future:r})}const uy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dy=N.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:u,target:a,to:c,preventScrollReset:d,viewTransition:f}=t,h=$h(t,ry),{basename:g}=N.useContext(wn),y,j=!1;if(typeof c=="string"&&cy.test(c)&&(y=c,uy))try{let m=new URL(window.location.href),w=c.startsWith("//")?new URL(m.protocol+c):new URL(c),C=Dr(w.pathname,g);w.origin===m.origin&&C!=null?c=C+w.search+w.hash:j=!0}catch{}let S=Ox(c,{relative:s}),x=py(c,{replace:o,state:u,target:a,preventScrollReset:d,relative:s,viewTransition:f});function p(m){r&&r(m),m.defaultPrevented||x(m)}return N.createElement("a",el({},h,{href:y||S,onClick:j||i?r:p,ref:n,target:a}))}),fy=N.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:a,viewTransition:c,children:d}=t,f=$h(t,sy),h=Nl(a,{relative:f.relative}),g=Ws(),y=N.useContext(Fh),{navigator:j,basename:S}=N.useContext(wn),x=y!=null&&my(h)&&c===!0,p=j.encodeLocation?j.encodeLocation(h).pathname:h.pathname,m=g.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(m=m.toLowerCase(),w=w?w.toLowerCase():null,p=p.toLowerCase()),w&&S&&(w=Dr(w,S)||w);const C=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let k=m===p||!o&&m.startsWith(p)&&m.charAt(C)==="/",E=w!=null&&(w===p||!o&&w.startsWith(p)&&w.charAt(p.length)==="/"),b={isActive:k,isPending:E,isTransitioning:x},P=k?r:void 0,M;typeof i=="function"?M=i(b):M=[i,k?"active":null,E?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let A=typeof u=="function"?u(b):u;return N.createElement(dy,el({},f,{"aria-current":P,className:M,ref:n,style:A,to:a,viewTransition:c}),typeof d=="function"?d(b):d)});var Jo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Jo||(Jo={}));var Ac;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ac||(Ac={}));function hy(e){let t=N.useContext(wl);return t||re(!1),t}function py(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:u}=t===void 0?{}:t,a=Lx(),c=Ws(),d=Nl(e,{relative:o});return N.useCallback(f=>{if(ny(f,n)){f.preventDefault();let h=r!==void 0?r:Ji(c)===Ji(d);a(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:u})}},[c,a,d,r,s,n,e,i,o,u])}function my(e,t){t===void 0&&(t={});let n=N.useContext(ly);n==null&&re(!1);let{basename:r}=hy(Jo.useViewTransitionState),s=Nl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Dr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Dr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xo(s.pathname,o)!=null||Xo(s.pathname,i)!=null}var Hr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},qt,va,ld,yy=(ld=class{constructor(){L(this,qt,xy);L(this,va,!1)}setTimeoutProvider(e){R(this,qt,e)}setTimeout(e,t){return v(this,qt).setTimeout(e,t)}clearTimeout(e){v(this,qt).clearTimeout(e)}setInterval(e,t){return v(this,qt).setInterval(e,t)}clearInterval(e){v(this,qt).clearInterval(e)}},qt=new WeakMap,va=new WeakMap,ld),En=new yy;function gy(e){setTimeout(e,0)}var Hn=typeof window>"u"||"Deno"in globalThis;function Ee(){}function vy(e,t){return typeof e=="function"?e(t):e}function ea(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pn(e,t){return typeof e=="function"?e(t):e}function Ke(e,t){return typeof e=="function"?e(t):e}function Uc(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==mu(o,t.options))return!1}else if(!Ls(t.queryKey,o))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||s&&s!==t.state.fetchStatus||i&&!i(t))}function $c(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(qn(t.options.mutationKey)!==qn(i))return!1}else if(!Ls(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function mu(e,t){return((t==null?void 0:t.queryKeyHashFn)||qn)(e)}function qn(e){return JSON.stringify(e,(t,n)=>ta(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ls(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ls(e[n],t[n])):!1}var wy=Object.prototype.hasOwnProperty;function Bh(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Qc(e)&&Qc(t);if(!r&&!(ta(e)&&ta(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),u=o.length,a=r?new Array(u):{};let c=0;for(let d=0;d<u;d++){const f=r?d:o[d],h=e[f],g=t[f];if(h===g){a[f]=h,(r?d<i:wy.call(e,f))&&c++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){a[f]=g;continue}const y=Bh(h,g,n+1);a[f]=y,y===h&&c++}return i===u&&c===i?e:a}function tl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Qc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ta(e){if(!Bc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Bc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bc(e){return Object.prototype.toString.call(e)==="[object Object]"}function jy(e){return new Promise(t=>{En.setTimeout(t,e)})}function na(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Bh(e,t):t}function Ny(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Sy(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xu=Symbol();function Vh(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xu?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function yu(e,t){return typeof e=="function"?e(...t):!!e}function Cy(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Pn,Wt,gr,od,ky=(od=class extends Hr{constructor(){super();L(this,Pn);L(this,Wt);L(this,gr);R(this,gr,t=>{if(!Hn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){v(this,Wt)||this.setEventListener(v(this,gr))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Wt))==null||t.call(this),R(this,Wt,void 0))}setEventListener(t){var n;R(this,gr,t),(n=v(this,Wt))==null||n.call(this),R(this,Wt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){v(this,Pn)!==t&&(R(this,Pn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof v(this,Pn)=="boolean"?v(this,Pn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pn=new WeakMap,Wt=new WeakMap,gr=new WeakMap,od),gu=new ky;function ra(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var by=gy;function zy(){let e=[],t=0,n=u=>{u()},r=u=>{u()},s=by;const i=u=>{t?e.push(u):s(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&s(()=>{r(()=>{u.forEach(a=>{n(a)})})})};return{batch:u=>{let a;t++;try{a=u()}finally{t--,t||o()}return a},batchCalls:u=>(...a)=>{i(()=>{u(...a)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var ue=zy(),vr,Kt,wr,ad,Ey=(ad=class extends Hr{constructor(){super();L(this,vr,!0);L(this,Kt);L(this,wr);R(this,wr,t=>{if(!Hn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){v(this,Kt)||this.setEventListener(v(this,wr))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Kt))==null||t.call(this),R(this,Kt,void 0))}setEventListener(t){var n;R(this,wr,t),(n=v(this,Kt))==null||n.call(this),R(this,Kt,t(this.setOnline.bind(this)))}setOnline(t){v(this,vr)!==t&&(R(this,vr,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return v(this,vr)}},vr=new WeakMap,Kt=new WeakMap,wr=new WeakMap,ad),nl=new Ey;function Py(e){return Math.min(1e3*2**e,3e4)}function Hh(e){return(e??"online")==="online"?nl.isOnline():!0}var sa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function qh(e){let t=!1,n=0,r;const s=ra(),i=()=>s.status!=="pending",o=j=>{var S;if(!i()){const x=new sa(j);h(x),(S=e.onCancel)==null||S.call(e,x)}},u=()=>{t=!0},a=()=>{t=!1},c=()=>gu.isFocused()&&(e.networkMode==="always"||nl.isOnline())&&e.canRun(),d=()=>Hh(e.networkMode)&&e.canRun(),f=j=>{i()||(r==null||r(),s.resolve(j))},h=j=>{i()||(r==null||r(),s.reject(j))},g=()=>new Promise(j=>{var S;r=x=>{(i()||c())&&j(x)},(S=e.onPause)==null||S.call(e)}).then(()=>{var j;r=void 0,i()||(j=e.onContinue)==null||j.call(e)}),y=()=>{if(i())return;let j;const S=n===0?e.initialPromise:void 0;try{j=S??e.fn()}catch(x){j=Promise.reject(x)}Promise.resolve(j).then(f).catch(x=>{var k;if(i())return;const p=e.retry??(Hn?0:3),m=e.retryDelay??Py,w=typeof m=="function"?m(n,x):m,C=p===!0||typeof p=="number"&&n<p||typeof p=="function"&&p(n,x);if(t||!C){h(x);return}n++,(k=e.onFail)==null||k.call(e,n,x),jy(w).then(()=>c()?void 0:g()).then(()=>{t?h(x):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:a,canStart:d,start:()=>(d()?y():g().then(y),s)}}var Rn,ud,Wh=(ud=class{constructor(){L(this,Rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ea(this.gcTime)&&R(this,Rn,En.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hn?1/0:5*60*1e3))}clearGcTimeout(){v(this,Rn)&&(En.clearTimeout(v(this,Rn)),R(this,Rn,void 0))}},Rn=new WeakMap,ud),Mn,jr,We,Tn,fe,_s,On,st,St,cd,Ry=(cd=class extends Wh{constructor(t){super();L(this,st);L(this,Mn);L(this,jr);L(this,We);L(this,Tn);L(this,fe);L(this,_s);L(this,On);R(this,On,!1),R(this,_s,t.defaultOptions),this.setOptions(t.options),this.observers=[],R(this,Tn,t.client),R(this,We,v(this,Tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,R(this,Mn,Hc(this.options)),this.state=t.state??v(this,Mn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=v(this,fe))==null?void 0:t.promise}setOptions(t){if(this.options={...v(this,_s),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Hc(this.options);n.data!==void 0&&(this.setState(Vc(n.data,n.dataUpdatedAt)),R(this,Mn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&v(this,We).remove(this)}setData(t,n){const r=na(this.state.data,t,this.options);return I(this,st,St).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){I(this,st,St).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=v(this,fe))==null?void 0:r.promise;return(s=v(this,fe))==null||s.cancel(t),n?n.then(Ee).catch(Ee):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(v(this,Mn))}isActive(){return this.observers.some(t=>Ke(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xu||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>pn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Qh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=v(this,fe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=v(this,fe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),v(this,We).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(v(this,fe)&&(v(this,On)?v(this,fe).cancel({revert:!0}):v(this,fe).cancelRetry()),this.scheduleGc()),v(this,We).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||I(this,st,St).call(this,{type:"invalidate"})}async fetch(t,n){var a,c,d,f,h,g,y,j,S,x,p,m;if(this.state.fetchStatus!=="idle"&&((a=v(this,fe))==null?void 0:a.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(v(this,fe))return v(this,fe).continueRetry(),v(this,fe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(C=>C.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(R(this,On,!0),r.signal)})},i=()=>{const w=Vh(this.options,n),k=(()=>{const E={client:v(this,Tn),queryKey:this.queryKey,meta:this.meta};return s(E),E})();return R(this,On,!1),this.options.persister?this.options.persister(w,k,this):w(k)},u=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:v(this,Tn),state:this.state,fetchFn:i};return s(w),w})();(c=this.options.behavior)==null||c.onFetch(u,this),R(this,jr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=u.fetchOptions)==null?void 0:d.meta))&&I(this,st,St).call(this,{type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta}),R(this,fe,qh({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:w=>{w instanceof sa&&w.revert&&this.setState({...v(this,jr),fetchStatus:"idle"}),r.abort()},onFail:(w,C)=>{I(this,st,St).call(this,{type:"failed",failureCount:w,error:C})},onPause:()=>{I(this,st,St).call(this,{type:"pause"})},onContinue:()=>{I(this,st,St).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const w=await v(this,fe).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(g=(h=v(this,We).config).onSuccess)==null||g.call(h,w,this),(j=(y=v(this,We).config).onSettled)==null||j.call(y,w,this.state.error,this),w}catch(w){if(w instanceof sa){if(w.silent)return v(this,fe).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw I(this,st,St).call(this,{type:"error",error:w}),(x=(S=v(this,We).config).onError)==null||x.call(S,w,this),(m=(p=v(this,We).config).onSettled)==null||m.call(p,this.state.data,w,this),w}finally{this.scheduleGc()}}},Mn=new WeakMap,jr=new WeakMap,We=new WeakMap,Tn=new WeakMap,fe=new WeakMap,_s=new WeakMap,On=new WeakMap,st=new WeakSet,St=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Kh(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Vc(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return R(this,jr,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),v(this,We).notify({query:this,type:"updated",action:t})})},cd);function Kh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Vc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Le,Q,Ds,be,Ln,Nr,bt,Gt,Is,Sr,Cr,Fn,_n,Yt,kr,V,is,ia,la,oa,aa,ua,ca,da,Gh,dd,My=(dd=class extends Hr{constructor(t,n){super();L(this,V);L(this,Le);L(this,Q);L(this,Ds);L(this,be);L(this,Ln);L(this,Nr);L(this,bt);L(this,Gt);L(this,Is);L(this,Sr);L(this,Cr);L(this,Fn);L(this,_n);L(this,Yt);L(this,kr,new Set);this.options=n,R(this,Le,t),R(this,Gt,null),R(this,bt,ra()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(v(this,Q).addObserver(this),qc(v(this,Q),this.options)?I(this,V,is).call(this):this.updateResult(),I(this,V,aa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fa(v(this,Q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fa(v(this,Q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,I(this,V,ua).call(this),I(this,V,ca).call(this),v(this,Q).removeObserver(this)}setOptions(t){const n=this.options,r=v(this,Q);if(this.options=v(this,Le).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ke(this.options.enabled,v(this,Q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");I(this,V,da).call(this),v(this,Q).setOptions(this.options),n._defaulted&&!tl(this.options,n)&&v(this,Le).getQueryCache().notify({type:"observerOptionsUpdated",query:v(this,Q),observer:this});const s=this.hasListeners();s&&Wc(v(this,Q),r,this.options,n)&&I(this,V,is).call(this),this.updateResult(),s&&(v(this,Q)!==r||Ke(this.options.enabled,v(this,Q))!==Ke(n.enabled,v(this,Q))||pn(this.options.staleTime,v(this,Q))!==pn(n.staleTime,v(this,Q)))&&I(this,V,ia).call(this);const i=I(this,V,la).call(this);s&&(v(this,Q)!==r||Ke(this.options.enabled,v(this,Q))!==Ke(n.enabled,v(this,Q))||i!==v(this,Yt))&&I(this,V,oa).call(this,i)}getOptimisticResult(t){const n=v(this,Le).getQueryCache().build(v(this,Le),t),r=this.createResult(n,t);return Oy(this,r)&&(R(this,be,r),R(this,Nr,this.options),R(this,Ln,v(this,Q).state)),r}getCurrentResult(){return v(this,be)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&v(this,bt).status==="pending"&&v(this,bt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){v(this,kr).add(t)}getCurrentQuery(){return v(this,Q)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=v(this,Le).defaultQueryOptions(t),r=v(this,Le).getQueryCache().build(v(this,Le),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return I(this,V,is).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),v(this,be)))}createResult(t,n){var P;const r=v(this,Q),s=this.options,i=v(this,be),o=v(this,Ln),u=v(this,Nr),c=t!==r?t.state:v(this,Ds),{state:d}=t;let f={...d},h=!1,g;if(n._optimisticResults){const M=this.hasListeners(),A=!M&&qc(t,n),de=M&&Wc(t,r,n,s);(A||de)&&(f={...f,...Kh(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:j,status:S}=f;g=f.data;let x=!1;if(n.placeholderData!==void 0&&g===void 0&&S==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(M=i.data,x=!0):M=typeof n.placeholderData=="function"?n.placeholderData((P=v(this,Cr))==null?void 0:P.state.data,v(this,Cr)):n.placeholderData,M!==void 0&&(S="success",g=na(i==null?void 0:i.data,M,n),h=!0)}if(n.select&&g!==void 0&&!x)if(i&&g===(o==null?void 0:o.data)&&n.select===v(this,Is))g=v(this,Sr);else try{R(this,Is,n.select),g=n.select(g),g=na(i==null?void 0:i.data,g,n),R(this,Sr,g),R(this,Gt,null)}catch(M){R(this,Gt,M)}v(this,Gt)&&(y=v(this,Gt),g=v(this,Sr),j=Date.now(),S="error");const p=f.fetchStatus==="fetching",m=S==="pending",w=S==="error",C=m&&p,k=g!==void 0,b={status:S,fetchStatus:f.fetchStatus,isPending:m,isSuccess:S==="success",isError:w,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:j,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:p,isRefetching:p&&!m,isLoadingError:w&&!k,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:w&&k,isStale:vu(t,n),refetch:this.refetch,promise:v(this,bt),isEnabled:Ke(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=b.data!==void 0,A=b.status==="error"&&!M,de=ge=>{A?ge.reject(b.error):M&&ge.resolve(b.data)},tt=()=>{const ge=R(this,bt,b.promise=ra());de(ge)},ke=v(this,bt);switch(ke.status){case"pending":t.queryHash===r.queryHash&&de(ke);break;case"fulfilled":(A||b.data!==ke.value)&&tt();break;case"rejected":(!A||b.error!==ke.reason)&&tt();break}}return b}updateResult(){const t=v(this,be),n=this.createResult(v(this,Q),this.options);if(R(this,Ln,v(this,Q).state),R(this,Nr,this.options),v(this,Ln).data!==void 0&&R(this,Cr,v(this,Q)),tl(n,t))return;R(this,be,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!v(this,kr).size)return!0;const o=new Set(i??v(this,kr));return this.options.throwOnError&&o.add("error"),Object.keys(v(this,be)).some(u=>{const a=u;return v(this,be)[a]!==t[a]&&o.has(a)})};I(this,V,Gh).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&I(this,V,aa).call(this)}},Le=new WeakMap,Q=new WeakMap,Ds=new WeakMap,be=new WeakMap,Ln=new WeakMap,Nr=new WeakMap,bt=new WeakMap,Gt=new WeakMap,Is=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,Fn=new WeakMap,_n=new WeakMap,Yt=new WeakMap,kr=new WeakMap,V=new WeakSet,is=function(t){I(this,V,da).call(this);let n=v(this,Q).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ee)),n},ia=function(){I(this,V,ua).call(this);const t=pn(this.options.staleTime,v(this,Q));if(Hn||v(this,be).isStale||!ea(t))return;const r=Qh(v(this,be).dataUpdatedAt,t)+1;R(this,Fn,En.setTimeout(()=>{v(this,be).isStale||this.updateResult()},r))},la=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(v(this,Q)):this.options.refetchInterval)??!1},oa=function(t){I(this,V,ca).call(this),R(this,Yt,t),!(Hn||Ke(this.options.enabled,v(this,Q))===!1||!ea(v(this,Yt))||v(this,Yt)===0)&&R(this,_n,En.setInterval(()=>{(this.options.refetchIntervalInBackground||gu.isFocused())&&I(this,V,is).call(this)},v(this,Yt)))},aa=function(){I(this,V,ia).call(this),I(this,V,oa).call(this,I(this,V,la).call(this))},ua=function(){v(this,Fn)&&(En.clearTimeout(v(this,Fn)),R(this,Fn,void 0))},ca=function(){v(this,_n)&&(En.clearInterval(v(this,_n)),R(this,_n,void 0))},da=function(){const t=v(this,Le).getQueryCache().build(v(this,Le),this.options);if(t===v(this,Q))return;const n=v(this,Q);R(this,Q,t),R(this,Ds,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Gh=function(t){ue.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(v(this,be))}),v(this,Le).getQueryCache().notify({query:v(this,Q),type:"observerResultsUpdated"})})},dd);function Ty(e,t){return Ke(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qc(e,t){return Ty(e,t)||e.state.data!==void 0&&fa(e,t,t.refetchOnMount)}function fa(e,t,n){if(Ke(t.enabled,e)!==!1&&pn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&vu(e,t)}return!1}function Wc(e,t,n,r){return(e!==t||Ke(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&vu(e,n)}function vu(e,t){return Ke(t.enabled,e)!==!1&&e.isStaleByTime(pn(t.staleTime,e))}function Oy(e,t){return!tl(e.getCurrentResult(),t)}function Kc(e){return{onFetch:(t,n)=>{var d,f,h,g,y;const r=t.options,s=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let u={pages:[],pageParams:[]},a=0;const c=async()=>{let j=!1;const S=m=>{Cy(m,()=>t.signal,()=>j=!0)},x=Vh(t.options,t.fetchOptions),p=async(m,w,C)=>{if(j)return Promise.reject();if(w==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};return S(A),A})(),b=await x(E),{maxPages:P}=t.options,M=C?Sy:Ny;return{pages:M(m.pages,b,P),pageParams:M(m.pageParams,w,P)}};if(s&&i.length){const m=s==="backward",w=m?Ly:Gc,C={pages:i,pageParams:o},k=w(r,C);u=await p(C,k,m)}else{const m=e??i.length;do{const w=a===0?o[0]??r.initialPageParam:Gc(r,u);if(a>0&&w==null)break;u=await p(u,w),a++}while(a<m)}return u};t.options.persister?t.fetchFn=()=>{var j,S;return(S=(j=t.options).persister)==null?void 0:S.call(j,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Gc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ly(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var As,pt,je,Dn,mt,$t,fd,Fy=(fd=class extends Wh{constructor(t){super();L(this,mt);L(this,As);L(this,pt);L(this,je);L(this,Dn);R(this,As,t.client),this.mutationId=t.mutationId,R(this,je,t.mutationCache),R(this,pt,[]),this.state=t.state||Yh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){v(this,pt).includes(t)||(v(this,pt).push(t),this.clearGcTimeout(),v(this,je).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){R(this,pt,v(this,pt).filter(n=>n!==t)),this.scheduleGc(),v(this,je).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){v(this,pt).length||(this.state.status==="pending"?this.scheduleGc():v(this,je).remove(this))}continue(){var t;return((t=v(this,Dn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,u,a,c,d,f,h,g,y,j,S,x,p,m,w,C,k,E;const n=()=>{I(this,mt,$t).call(this,{type:"continue"})},r={client:v(this,As),meta:this.options.meta,mutationKey:this.options.mutationKey};R(this,Dn,qh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(b,P)=>{I(this,mt,$t).call(this,{type:"failed",failureCount:b,error:P})},onPause:()=>{I(this,mt,$t).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>v(this,je).canRun(this)}));const s=this.state.status==="pending",i=!v(this,Dn).canStart();try{if(s)n();else{I(this,mt,$t).call(this,{type:"pending",variables:t,isPaused:i}),v(this,je).config.onMutate&&await v(this,je).config.onMutate(t,this,r);const P=await((u=(o=this.options).onMutate)==null?void 0:u.call(o,t,r));P!==this.state.context&&I(this,mt,$t).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const b=await v(this,Dn).start();return await((c=(a=v(this,je).config).onSuccess)==null?void 0:c.call(a,b,t,this.state.context,this,r)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,b,t,this.state.context,r)),await((g=(h=v(this,je).config).onSettled)==null?void 0:g.call(h,b,null,this.state.variables,this.state.context,this,r)),await((j=(y=this.options).onSettled)==null?void 0:j.call(y,b,null,t,this.state.context,r)),I(this,mt,$t).call(this,{type:"success",data:b}),b}catch(b){try{await((x=(S=v(this,je).config).onError)==null?void 0:x.call(S,b,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((m=(p=this.options).onError)==null?void 0:m.call(p,b,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((C=(w=v(this,je).config).onSettled)==null?void 0:C.call(w,void 0,b,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((E=(k=this.options).onSettled)==null?void 0:E.call(k,void 0,b,t,this.state.context,r))}catch(P){Promise.reject(P)}throw I(this,mt,$t).call(this,{type:"error",error:b}),b}finally{v(this,je).runNext(this)}}},As=new WeakMap,pt=new WeakMap,je=new WeakMap,Dn=new WeakMap,mt=new WeakSet,$t=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ue.batch(()=>{v(this,pt).forEach(r=>{r.onMutationUpdate(t)}),v(this,je).notify({mutation:this,type:"updated",action:t})})},fd);function Yh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zt,it,Us,hd,_y=(hd=class extends Hr{constructor(t={}){super();L(this,zt);L(this,it);L(this,Us);this.config=t,R(this,zt,new Set),R(this,it,new Map),R(this,Us,0)}build(t,n,r){const s=new Fy({client:t,mutationCache:this,mutationId:++Gs(this,Us)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){v(this,zt).add(t);const n=hi(t);if(typeof n=="string"){const r=v(this,it).get(n);r?r.push(t):v(this,it).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(v(this,zt).delete(t)){const n=hi(t);if(typeof n=="string"){const r=v(this,it).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&v(this,it).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=hi(t);if(typeof n=="string"){const r=v(this,it).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=hi(t);if(typeof n=="string"){const s=(r=v(this,it).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ue.batch(()=>{v(this,zt).forEach(t=>{this.notify({type:"removed",mutation:t})}),v(this,zt).clear(),v(this,it).clear()})}getAll(){return Array.from(v(this,zt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$c(n,r))}findAll(t={}){return this.getAll().filter(n=>$c(t,n))}notify(t){ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ee))))}},zt=new WeakMap,it=new WeakMap,Us=new WeakMap,hd);function hi(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Et,Xt,Fe,Pt,Ot,Ei,ha,pd,Dy=(pd=class extends Hr{constructor(n,r){super();L(this,Ot);L(this,Et);L(this,Xt);L(this,Fe);L(this,Pt);R(this,Et,n),this.setOptions(r),this.bindMethods(),I(this,Ot,Ei).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=v(this,Et).defaultMutationOptions(n),tl(this.options,r)||v(this,Et).getMutationCache().notify({type:"observerOptionsUpdated",mutation:v(this,Fe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&qn(r.mutationKey)!==qn(this.options.mutationKey)?this.reset():((s=v(this,Fe))==null?void 0:s.state.status)==="pending"&&v(this,Fe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=v(this,Fe))==null||n.removeObserver(this)}onMutationUpdate(n){I(this,Ot,Ei).call(this),I(this,Ot,ha).call(this,n)}getCurrentResult(){return v(this,Xt)}reset(){var n;(n=v(this,Fe))==null||n.removeObserver(this),R(this,Fe,void 0),I(this,Ot,Ei).call(this),I(this,Ot,ha).call(this)}mutate(n,r){var s;return R(this,Pt,r),(s=v(this,Fe))==null||s.removeObserver(this),R(this,Fe,v(this,Et).getMutationCache().build(v(this,Et),this.options)),v(this,Fe).addObserver(this),v(this,Fe).execute(n)}},Et=new WeakMap,Xt=new WeakMap,Fe=new WeakMap,Pt=new WeakMap,Ot=new WeakSet,Ei=function(){var r;const n=((r=v(this,Fe))==null?void 0:r.state)??Yh();R(this,Xt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ha=function(n){ue.batch(()=>{var r,s,i,o,u,a,c,d;if(v(this,Pt)&&this.hasListeners()){const f=v(this,Xt).variables,h=v(this,Xt).context,g={client:v(this,Et),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=v(this,Pt)).onSuccess)==null||s.call(r,n.data,f,h,g)}catch(y){Promise.reject(y)}try{(o=(i=v(this,Pt)).onSettled)==null||o.call(i,n.data,null,f,h,g)}catch(y){Promise.reject(y)}}else if((n==null?void 0:n.type)==="error"){try{(a=(u=v(this,Pt)).onError)==null||a.call(u,n.error,f,h,g)}catch(y){Promise.reject(y)}try{(d=(c=v(this,Pt)).onSettled)==null||d.call(c,void 0,n.error,f,h,g)}catch(y){Promise.reject(y)}}}this.listeners.forEach(f=>{f(v(this,Xt))})})},pd),xt,md,Iy=(md=class extends Hr{constructor(t={}){super();L(this,xt);this.config=t,R(this,xt,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??mu(s,n);let o=this.get(i);return o||(o=new Ry({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){v(this,xt).has(t.queryHash)||(v(this,xt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=v(this,xt).get(t.queryHash);n&&(t.destroy(),n===t&&v(this,xt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return v(this,xt).get(t)}getAll(){return[...v(this,xt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Uc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Uc(t,r)):n}notify(t){ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},xt=new WeakMap,md),te,Zt,Jt,br,zr,en,Er,Pr,xd,Ay=(xd=class{constructor(e={}){L(this,te);L(this,Zt);L(this,Jt);L(this,br);L(this,zr);L(this,en);L(this,Er);L(this,Pr);R(this,te,e.queryCache||new Iy),R(this,Zt,e.mutationCache||new _y),R(this,Jt,e.defaultOptions||{}),R(this,br,new Map),R(this,zr,new Map),R(this,en,0)}mount(){Gs(this,en)._++,v(this,en)===1&&(R(this,Er,gu.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,te).onFocus())})),R(this,Pr,nl.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,te).onOnline())})))}unmount(){var e,t;Gs(this,en)._--,v(this,en)===0&&((e=v(this,Er))==null||e.call(this),R(this,Er,void 0),(t=v(this,Pr))==null||t.call(this),R(this,Pr,void 0))}isFetching(e){return v(this,te).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return v(this,Zt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=v(this,te).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=v(this,te).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(pn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return v(this,te).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=v(this,te).get(r.queryHash),i=s==null?void 0:s.state.data,o=vy(t,i);if(o!==void 0)return v(this,te).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ue.batch(()=>v(this,te).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=v(this,te).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=v(this,te);ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=v(this,te);return ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ue.batch(()=>v(this,te).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ee).catch(Ee)}invalidateQueries(e,t={}){return ue.batch(()=>(v(this,te).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ue.batch(()=>v(this,te).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ee)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ee)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=v(this,te).build(this,t);return n.isStaleByTime(pn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ee).catch(Ee)}fetchInfiniteQuery(e){return e.behavior=Kc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ee).catch(Ee)}ensureInfiniteQueryData(e){return e.behavior=Kc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return nl.isOnline()?v(this,Zt).resumePausedMutations():Promise.resolve()}getQueryCache(){return v(this,te)}getMutationCache(){return v(this,Zt)}getDefaultOptions(){return v(this,Jt)}setDefaultOptions(e){R(this,Jt,e)}setQueryDefaults(e,t){v(this,br).set(qn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...v(this,br).values()],n={};return t.forEach(r=>{Ls(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){v(this,zr).set(qn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...v(this,zr).values()],n={};return t.forEach(r=>{Ls(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...v(this,Jt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=mu(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xu&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...v(this,Jt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){v(this,te).clear(),v(this,Zt).clear()}},te=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,br=new WeakMap,zr=new WeakMap,en=new WeakMap,Er=new WeakMap,Pr=new WeakMap,xd),Xh=N.createContext(void 0),Oe=e=>{const t=N.useContext(Xh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Uy=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Xh.Provider,{value:e,children:t})),Zh=N.createContext(!1),$y=()=>N.useContext(Zh);Zh.Provider;function Qy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var By=N.createContext(Qy()),Vy=()=>N.useContext(By),Hy=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?yu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},qy=e=>{N.useEffect(()=>{e.clearReset()},[e])},Wy=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||yu(n,[e.error,r])),Ky=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Gy=(e,t)=>e.isLoading&&e.isFetching&&!t,Yy=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xy(e,t,n){var h,g,y,j;const r=$y(),s=Vy(),i=Oe(),o=i.defaultQueryOptions(e);(g=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||g.call(h,o);const u=i.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",Ky(o),Hy(o,s,u),qy(s);const a=!i.getQueryCache().get(o.queryHash),[c]=N.useState(()=>new t(i,o)),d=c.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(S=>{const x=f?c.subscribe(ue.batchCalls(S)):Ee;return c.updateResult(),x},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(o)},[o,c]),Yy(o,d))throw Yc(o,c,s);if(Wy({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw d.error;if((j=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||j.call(y,o,d),o.experimental_prefetchInRender&&!Hn&&Gy(d,r)){const S=a?Yc(o,c,s):u==null?void 0:u.promise;S==null||S.catch(Ee).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function wt(e,t){return Xy(e,My)}function Ce(e,t){const n=Oe(),[r]=N.useState(()=>new Dy(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const s=N.useSyncExternalStore(N.useCallback(o=>r.subscribe(ue.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=N.useCallback((o,u)=>{r.mutate(o,u).catch(Ee)},[r]);if(s.error&&yu(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}async function Zy(){const e=await fetch("/api/onboarding/status");if(!e.ok)throw new Error(e.statusText);return e.json()}function Sl(){const{data:e,isLoading:t,isError:n,error:r,refetch:s}=wt({queryKey:["onboarding","status"],queryFn:Zy,staleTime:3e4,retry:2,refetchOnWindowFocus:!0});return{status:e==null?void 0:e.status,domain:(e==null?void 0:e.domain)??null,ip:(e==null?void 0:e.ip)??null,isLoading:t,isError:n,error:r,refetch:s}}/**
|
|
68
|
+
* @license lucide-react v0.383.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const Jy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jh=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
73
|
+
* @license lucide-react v0.383.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/var eg={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"};/**
|
|
78
|
+
* @license lucide-react v0.383.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const tg=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...u},a)=>N.createElement("svg",{ref:a,...eg,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Jh("lucide",s),...u},[...o.map(([c,d])=>N.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
|
|
83
|
+
* @license lucide-react v0.383.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const F=(e,t)=>{const n=N.forwardRef(({className:r,...s},i)=>N.createElement(tg,{ref:i,iconNode:t,className:Jh(`lucide-${Jy(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
88
|
+
* @license lucide-react v0.383.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const Xc=F("Activity",[["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"}]]);/**
|
|
93
|
+
* @license lucide-react v0.383.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const ng=F("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
98
|
+
* @license lucide-react v0.383.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const ep=F("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
103
|
+
* @license lucide-react v0.383.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const tp=F("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
108
|
+
* @license lucide-react v0.383.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const np=F("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
113
|
+
* @license lucide-react v0.383.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const rg=F("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
118
|
+
* @license lucide-react v0.383.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const sg=F("CircleAlert",[["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"}]]);/**
|
|
123
|
+
* @license lucide-react v0.383.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const ig=F("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
128
|
+
* @license lucide-react v0.383.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const pa=F("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
133
|
+
* @license lucide-react v0.383.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const rp=F("CircleX",[["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"}]]);/**
|
|
138
|
+
* @license lucide-react v0.383.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const lg=F("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
143
|
+
* @license lucide-react v0.383.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const sp=F("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
148
|
+
* @license lucide-react v0.383.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const Cl=F("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
153
|
+
* @license lucide-react v0.383.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const og=F("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
158
|
+
* @license lucide-react v0.383.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const ag=F("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
163
|
+
* @license lucide-react v0.383.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const ip=F("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
168
|
+
* @license lucide-react v0.383.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const Ir=F("ExternalLink",[["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"}]]);/**
|
|
173
|
+
* @license lucide-react v0.383.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const lp=F("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
178
|
+
* @license lucide-react v0.383.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const op=F("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
183
|
+
* @license lucide-react v0.383.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const ap=F("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
188
|
+
* @license lucide-react v0.383.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const ug=F("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
193
|
+
* @license lucide-react v0.383.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const up=F("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
198
|
+
* @license lucide-react v0.383.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const cg=F("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
203
|
+
* @license lucide-react v0.383.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const wu=F("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
208
|
+
* @license lucide-react v0.383.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const dg=F("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["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"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
213
|
+
* @license lucide-react v0.383.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const fg=F("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
|
|
218
|
+
* @license lucide-react v0.383.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const hg=F("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
223
|
+
* @license lucide-react v0.383.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const pg=F("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
228
|
+
* @license lucide-react v0.383.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const Re=F("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
233
|
+
* @license lucide-react v0.383.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const mg=F("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
238
|
+
* @license lucide-react v0.383.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const xg=F("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
243
|
+
* @license lucide-react v0.383.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const yg=F("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
248
|
+
* @license lucide-react v0.383.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const gg=F("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
253
|
+
* @license lucide-react v0.383.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const Ar=F("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
258
|
+
* @license lucide-react v0.383.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const cp=F("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
263
|
+
* @license lucide-react v0.383.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const vg=F("RotateCw",[["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"}]]);/**
|
|
268
|
+
* @license lucide-react v0.383.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const dp=F("Server",[["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"}]]);/**
|
|
273
|
+
* @license lucide-react v0.383.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const kl=F("ShieldCheck",[["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"}]]);/**
|
|
278
|
+
* @license lucide-react v0.383.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const wg=F("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
283
|
+
* @license lucide-react v0.383.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const qr=F("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
288
|
+
* @license lucide-react v0.383.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const Fs=F("TriangleAlert",[["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"}]]);/**
|
|
293
|
+
* @license lucide-react v0.383.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const jg=F("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
298
|
+
* @license lucide-react v0.383.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const Ng=F("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
303
|
+
* @license lucide-react v0.383.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const Sg=F("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
308
|
+
* @license lucide-react v0.383.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const bl=F("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fp=N.createContext(null);function dt(){const e=N.useContext(fp);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}let Cg=0;function kg({children:e}){const[t,n]=N.useState([]),r=N.useCallback((i,o="success")=>{const u=++Cg;n(a=>[...a,{id:u,message:i,variant:o}]),setTimeout(()=>{n(a=>a.filter(c=>c.id!==u))},3e3)},[]),s=N.useCallback(i=>{n(o=>o.filter(u=>u.id!==i))},[]);return l.jsxs(fp.Provider,{value:r,children:[e,l.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:t.map(i=>l.jsxs("div",{className:`flex items-center gap-3 rounded-lg border px-4 py-3 text-sm font-mono shadow-lg ${i.variant==="error"?"bg-red-500/10 border-red-500/20 text-red-400":"bg-green-500/10 border-green-500/20 text-green-400"}`,children:[l.jsx("span",{className:"flex-1",children:i.message}),l.jsx("button",{type:"button",onClick:()=>s(i.id),className:"text-zinc-500 hover:text-zinc-300",children:l.jsx(bl,{size:14})})]},i.id))})]})}function bg({to:e,icon:t,label:n,onClick:r}){return l.jsxs(fy,{to:e,end:e==="/",onClick:r,className:({isActive:s})=>["flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors",s?"text-cyan-400 bg-zinc-800/50":"text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800"].join(" "),children:[l.jsx(t,{className:"h-5 w-5"}),n]})}const zg=[{to:"/",icon:pg,label:"Dashboard"},{to:"/tunnels",icon:wu,label:"Tunnels"},{to:"/sites",icon:ap,label:"Static Sites"},{to:"/users",icon:Sg,label:"Users"},{to:"/certificates",icon:kl,label:"Certificates"},{to:"/services",icon:dp,label:"Services"}];function Zc({onLinkClick:e}){return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-b border-zinc-800 px-4 py-5",children:l.jsx("span",{className:"font-mono text-lg font-bold text-cyan-400",children:"Portlama"})}),l.jsx("nav",{className:"flex-1 space-y-1 px-2 py-4",children:zg.map(t=>l.jsx(bg,{...t,onClick:e},t.to))}),l.jsx("div",{className:"border-t border-zinc-800 px-4 py-3",children:l.jsx("span",{className:"font-mono text-xs text-zinc-600",children:"v0.1.0"})})]})}function Eg(){const[e,t]=N.useState(!1),n=()=>t(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>t(!0),className:"fixed left-4 top-4 z-40 rounded-md bg-zinc-900 p-2 text-zinc-400 hover:text-zinc-100 lg:hidden","aria-label":"Open sidebar",children:l.jsx(mg,{className:"h-5 w-5"})}),e&&l.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[l.jsx("div",{className:"fixed inset-0 bg-black/50",onClick:n}),l.jsxs("div",{className:"relative flex h-screen w-64 flex-col bg-zinc-900",children:[l.jsx("button",{type:"button",onClick:n,className:"absolute right-3 top-4 rounded-md p-1 text-zinc-400 hover:text-zinc-100","aria-label":"Close sidebar",children:l.jsx(bl,{className:"h-5 w-5"})}),l.jsx(Zc,{onLinkClick:n})]})]}),l.jsx("div",{className:"sticky top-0 hidden h-screen w-64 flex-col border-r border-zinc-800 bg-zinc-900 lg:flex",children:l.jsx(Zc,{})})]})}function Pg(){return l.jsxs("div",{className:"flex min-h-screen",children:[l.jsx(Eg,{}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-zinc-950 p-6 lg:p-8",children:l.jsx(Zx,{})})]})}function hp(){return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-zinc-950",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-zinc-700 border-t-cyan-400"}),l.jsx("p",{className:"mt-4 text-sm text-zinc-500",children:"Connecting to panel server..."})]})})}function pp({onRetry:e}){return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-zinc-950",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx(sg,{className:"mb-4 h-12 w-12 text-red-400"}),l.jsx("h1",{className:"mb-2 font-mono text-xl font-bold text-zinc-100",children:"Unable to connect"}),l.jsx("p",{className:"mb-6 max-w-md text-center text-zinc-400",children:"Could not reach the Portlama panel server. Make sure the server is running and try again."}),l.jsx("button",{type:"button",onClick:e,className:"rounded-md bg-cyan-400 px-4 py-2 font-medium text-zinc-900 transition-colors hover:bg-cyan-300",children:"Retry"})]})})}const Rg=/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mg=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Tg({domain:e,onComplete:t}){const[n,r]=N.useState(e??""),[s,i]=N.useState(""),[o,u]=N.useState({}),a=Oe(),c=Ce({mutationFn:async h=>{const g=await fetch("/api/onboarding/domain",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(!g.ok){const y=await g.json();throw new Error(y.error||"Request failed")}return g.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["onboarding","status"]}),t()}});function d(){const h={};return Rg.test(n)||(h.domain="Enter a valid domain name (e.g. example.com)"),Mg.test(s)||(h.email="Enter a valid email address"),u(h),Object.keys(h).length===0}function f(h){h.preventDefault(),d()&&c.mutate({domain:n.trim(),email:s.trim()})}return l.jsxs("div",{children:[l.jsx("h2",{className:"mb-2 text-xl font-semibold text-white",children:"Configure your domain"}),l.jsx("p",{className:"mb-6 text-sm text-zinc-400",children:"Enter the domain you want to use for Portlama. You will need to configure DNS records in the next step."}),c.isError&&l.jsx("div",{className:"mb-4 rounded-md bg-red-500/10 border border-red-500/20 px-4 py-3 text-sm text-red-400",children:c.error.message}),l.jsxs("form",{onSubmit:f,className:"space-y-5",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"domain",className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Domain"}),l.jsx("input",{id:"domain",type:"text",placeholder:"example.com",value:n,onChange:h=>{r(h.target.value),u(g=>({...g,domain:void 0}))},className:"w-full rounded-md border border-zinc-600 bg-zinc-900 px-3 py-2 font-mono text-sm text-white placeholder-zinc-500 focus:border-cyan-400 focus:outline-none focus:ring-1 focus:ring-cyan-400"}),o.domain&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:o.domain})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Email"}),l.jsx("input",{id:"email",type:"email",placeholder:"you@example.com",value:s,onChange:h=>{i(h.target.value),u(g=>({...g,email:void 0}))},className:"w-full rounded-md border border-zinc-600 bg-zinc-900 px-3 py-2 font-mono text-sm text-white placeholder-zinc-500 focus:border-cyan-400 focus:outline-none focus:ring-1 focus:ring-cyan-400"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Used for Let's Encrypt certificate registration"}),o.email&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:o.email})]}),l.jsx("div",{className:"flex justify-end pt-2",children:l.jsxs("button",{type:"submit",disabled:c.isPending,className:"flex items-center gap-2 rounded-md bg-cyan-500 px-6 py-2 font-medium text-white transition-colors hover:bg-cyan-600 disabled:opacity-50",children:[c.isPending&&l.jsx(Re,{size:16,className:"animate-spin"}),c.isPending?"Saving...":"Save & Continue"]})})]})]})}function Og({text:e}){const[t,n]=N.useState(!1);function r(){navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})}return l.jsxs("button",{type:"button",onClick:r,className:"ml-2 inline-flex items-center text-zinc-500 transition-colors hover:text-zinc-300",title:"Copy to clipboard",children:[l.jsx(Cl,{size:14}),t&&l.jsx("span",{className:"ml-1 text-xs text-green-400",children:"Copied"})]})}function Jc({type:e,name:t,value:n}){return l.jsxs("tr",{className:"border-b border-zinc-700 last:border-b-0",children:[l.jsx("td",{className:"px-3 py-2.5 font-mono text-sm text-cyan-400",children:e}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-sm text-zinc-300",children:t}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-sm text-zinc-300",children:l.jsxs("span",{className:"inline-flex items-center",children:[n,l.jsx(Og,{text:n})]})})]})}function Lg({result:e}){return e?l.jsxs("div",{className:"mt-5 space-y-3 rounded-md border border-zinc-700 bg-zinc-900 p-4",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[e.ok?l.jsx(pa,{size:18,className:"mt-0.5 shrink-0 text-green-400"}):l.jsx(rp,{size:18,className:"mt-0.5 shrink-0 text-red-400"}),l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:e.ok?"text-green-400":"text-red-400",children:e.domain}),e.ok?l.jsxs("span",{className:"text-zinc-400",children:[" resolves to ",e.expectedIp]}):e.resolvedIps.length>0?l.jsxs("span",{className:"text-zinc-400",children:[" resolves to ",e.resolvedIps.join(", ")," (expected ",e.expectedIp,")"]}):l.jsx("span",{className:"text-zinc-400",children:" does not resolve"})]})]}),l.jsxs("div",{className:"flex items-start gap-2",children:[e.wildcardOk?l.jsx(pa,{size:18,className:"mt-0.5 shrink-0 text-green-400"}):l.jsx(Fs,{size:18,className:"mt-0.5 shrink-0 text-yellow-400"}),l.jsxs("div",{className:"text-sm",children:[l.jsxs("span",{className:e.wildcardOk?"text-green-400":"text-yellow-400",children:["*.",e.domain]}),e.wildcardOk?l.jsxs("span",{className:"text-zinc-400",children:[" resolves to ",e.expectedIp]}):l.jsx("span",{className:"text-zinc-400",children:" not configured — you can add individual subdomain records later"})]})]}),l.jsx("p",{className:"text-sm text-zinc-400",children:e.message})]}):null}function Fg({domain:e,ip:t,onComplete:n,onBack:r}){const[s,i]=N.useState(null),o=Oe(),u=Ce({mutationFn:async()=>{const d=await fetch("/api/onboarding/verify-dns",{method:"POST",headers:{"Content-Type":"application/json"}});if(!d.ok){const f=await d.json();throw new Error(f.error||"Verification failed")}return d.json()},onSuccess:d=>{i(d),d.ok&&o.invalidateQueries({queryKey:["onboarding","status"]})}});function a(){u.mutate()}function c(){n()}return l.jsxs("div",{children:[l.jsx("h2",{className:"mb-2 text-xl font-semibold text-white",children:"Configure DNS records"}),l.jsx("p",{className:"mb-5 text-sm text-zinc-400",children:"Add these DNS records at your domain registrar or DNS provider."}),u.isError&&l.jsx("div",{className:"mb-4 rounded-md bg-red-500/10 border border-red-500/20 px-4 py-3 text-sm text-red-400",children:u.error.message}),l.jsx("div",{className:"overflow-hidden rounded-md border border-zinc-700",children:l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-700 bg-zinc-800/50",children:[l.jsx("th",{className:"px-3 py-2 text-xs font-medium uppercase tracking-wider text-zinc-500",children:"Type"}),l.jsx("th",{className:"px-3 py-2 text-xs font-medium uppercase tracking-wider text-zinc-500",children:"Name"}),l.jsx("th",{className:"px-3 py-2 text-xs font-medium uppercase tracking-wider text-zinc-500",children:"Value"})]})}),l.jsxs("tbody",{className:"bg-zinc-900",children:[l.jsx(Jc,{type:"A",name:e,value:t}),l.jsx(Jc,{type:"A",name:`*.${e}`,value:t})]})]})}),l.jsx("p",{className:"mt-3 text-xs italic text-zinc-500",children:"DNS propagation can take up to 48 hours, but usually completes within a few minutes."}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["The wildcard record (*.",e,") allows Portlama to create subdomains for your tunnels automatically."]}),l.jsx(Lg,{result:s}),l.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[l.jsx("button",{type:"button",onClick:r,className:"text-sm text-zinc-400 transition-colors hover:text-zinc-200",children:"Back"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("button",{type:"button",onClick:a,disabled:u.isPending,className:"flex items-center gap-2 rounded-md bg-cyan-500 px-6 py-2 font-medium text-white transition-colors hover:bg-cyan-600 disabled:opacity-50",children:[u.isPending&&l.jsx(Re,{size:16,className:"animate-spin"}),u.isPending?"Verifying...":"Verify DNS"]}),(s==null?void 0:s.ok)&&l.jsx("button",{type:"button",onClick:c,className:"rounded-md bg-green-600 px-6 py-2 font-medium text-white transition-colors hover:bg-green-700",children:"Continue"})]})]})]})}const _g=1e4;function Dg(){const[e,t]=N.useState([]),[n,r]=N.useState(!1),[s,i]=N.useState(!1),[o,u]=N.useState(null),[a,c]=N.useState(null),[d,f]=N.useState({current:0,total:0}),[h,g]=N.useState([]),y=N.useRef(null),j=N.useRef(0),S=N.useRef(null),x=N.useRef(!1),p=N.useRef(null);N.useEffect(()=>{x.current=!1;function w(){if(x.current)return;const k=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/onboarding/provision/stream`,E=new WebSocket(k);y.current=E,E.onopen=()=>{j.current=0},E.onmessage=b=>{let P;try{P=JSON.parse(b.data)}catch{return}if(P.type==="state"){P.tasks&&t(P.tasks),P.error&&(i(!0),u(P.error)),P.result&&(c(P.result),r(!0));return}if(P.task==="complete"&&P.status==="done"){r(!0),P.result&&c(P.result);return}P.status==="error"&&(i(!0),u({task:P.task,message:P.error||P.message})),P.progress&&f(P.progress),P.log&&g(M=>[...M.slice(-500),P.log]),P.message&&g(M=>[...M.slice(-500),P.message]),t(M=>{const A=M.findIndex(de=>de.id===P.task);if(A!==-1){const de=[...M];return de[A]={...de[A],status:P.status,message:P.message,log:P.log},de}return[...M,{id:P.task,title:P.title||P.task,status:P.status,message:P.message,log:P.log}]})},E.onclose=()=>{if(x.current)return;const b=j.current,P=Math.min(1e3*Math.pow(2,b),_g);j.current=b+1,S.current=setTimeout(()=>{x.current||w()},P)},E.onerror=()=>{}}return p.current=w,w(),()=>{x.current=!0,S.current&&clearTimeout(S.current),y.current&&y.current.close()}},[]);const m=N.useCallback(async()=>{i(!1),u(null),r(!1),c(null),t([]),g([]),f({current:0,total:0});const w=await fetch("/api/onboarding/provision",{method:"POST",headers:{"Content-Type":"application/json"}});if(!w.ok){const C=await w.json();throw new Error(C.error||"Failed to start provisioning")}},[]);return{tasks:e,isComplete:n,isError:s,error:o,result:a,progress:d,logs:h,retry:m}}function Ig({status:e}){switch(e){case"done":return l.jsx(pa,{size:18,className:"shrink-0 text-green-400"});case"error":return l.jsx(rp,{size:18,className:"shrink-0 text-red-400"});case"running":return l.jsx(Re,{size:18,className:"shrink-0 animate-spin text-cyan-400"});default:return l.jsx(lg,{size:18,className:"shrink-0 text-zinc-600"})}}function Ag({task:e,isLast:t}){const n=e.status==="pending"?"text-zinc-500":"text-white";return l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx(Ig,{status:e.status}),!t&&l.jsx("div",{className:"mt-1 w-px flex-1 bg-zinc-700"})]}),l.jsxs("div",{className:"pb-4",children:[l.jsx("p",{className:`text-sm font-medium ${n}`,children:e.title}),e.message&&e.status!=="pending"&&l.jsx("p",{className:"mt-0.5 text-xs text-zinc-400",children:e.message})]})]})}function Ug({onComplete:e}){const{tasks:t,isComplete:n,isError:r,error:s,result:i,progress:o,logs:u,retry:a}=Dg(),[c,d]=N.useState(!1),[f,h]=N.useState(!1),g=N.useRef(null);N.useEffect(()=>{c||(d(!0),fetch("/api/onboarding/provision",{method:"POST",headers:{"Content-Type":"application/json"}}).catch(()=>{}))},[c]),N.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[u]),N.useEffect(()=>{if(n&&e){const j=setTimeout(()=>{e(i)},1e3);return()=>clearTimeout(j)}},[n,e,i]);async function y(){h(!0);try{await a()}catch{}finally{h(!1)}}return l.jsxs("div",{children:[l.jsx("h2",{className:"mb-2 text-xl font-semibold text-white",children:"Setting up your Portlama"}),l.jsx("div",{className:"mb-5 rounded-md border border-amber-700 bg-amber-900/30 px-4 py-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Fs,{size:16,className:"shrink-0 text-amber-300"}),l.jsx("p",{className:"text-sm text-amber-300",children:"Do not close this page while provisioning is in progress"})]})}),l.jsx("div",{className:"mb-4",children:t.map((j,S)=>l.jsx(Ag,{task:j,isLast:S===t.length-1},j.id))}),l.jsx("div",{ref:g,className:"mb-3 max-h-48 overflow-y-auto rounded border border-zinc-800 bg-zinc-950 p-3 font-mono text-sm text-zinc-400",children:u.length===0?l.jsx("p",{className:"italic text-zinc-600",children:"Waiting for provisioning to start..."}):u.map((j,S)=>l.jsx("p",{className:"leading-relaxed",children:j},S))}),o.total>0&&l.jsxs("p",{className:"mb-4 text-sm text-zinc-500",children:["Step ",o.current," of ",o.total]}),r&&s&&l.jsxs("div",{className:"mb-4 rounded-md border border-red-700 bg-red-900/30 px-4 py-3",children:[l.jsx("p",{className:"text-sm font-medium text-red-300",children:"Provisioning failed"}),l.jsx("p",{className:"mt-1 text-xs text-red-400",children:s.message}),l.jsxs("button",{type:"button",onClick:y,disabled:f,className:"mt-3 flex items-center gap-2 rounded-md bg-cyan-500 px-6 py-2 font-medium text-white transition-colors hover:bg-cyan-600 disabled:opacity-50",children:[f&&l.jsx(Re,{size:16,className:"animate-spin"}),f?"Retrying...":"Retry"]})]}),n&&l.jsx("div",{className:"text-center",children:l.jsx("p",{className:"text-sm text-green-400",children:"Provisioning complete. Continuing..."})})]})}function ed({text:e}){const[t,n]=N.useState(!1);function r(){navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})}return l.jsxs("button",{type:"button",onClick:r,className:"ml-2 inline-flex items-center text-zinc-500 transition-colors hover:text-zinc-300",title:"Copy to clipboard",children:[l.jsx(Cl,{size:14}),t&&l.jsx("span",{className:"ml-1 text-xs text-green-400",children:"Copied"})]})}function $g({result:e,ip:t}){const[n,r]=N.useState(!1),s=(e==null?void 0:e.adminUsername)||"admin",i=(e==null?void 0:e.adminPassword)||"",o=(e==null?void 0:e.panelUrl)||"",u=(e==null?void 0:e.authUrl)||"",a=`https://${t}:9292`;return l.jsxs("div",{className:"animate-fade-in",children:[l.jsxs("div",{className:"mb-6 text-center",children:[l.jsx(kl,{size:48,className:"mx-auto mb-3 text-green-400"}),l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Portlama is ready!"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Your stack is fully configured and operational."})]}),l.jsxs("div",{className:"mb-5 rounded-lg border border-zinc-700 bg-zinc-800 p-6",children:[l.jsx("h3",{className:"mb-1 font-semibold text-white",children:"Admin Credentials"}),l.jsx("p",{className:"mb-4 text-sm text-amber-400",children:"Save these credentials — they won't be shown again."}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-zinc-400",children:"Username"}),l.jsxs("span",{className:"inline-flex items-center font-mono text-sm text-white",children:[s,l.jsx(ed,{text:s})]})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-zinc-400",children:"Password"}),l.jsxs("span",{className:"inline-flex items-center font-mono text-sm text-white",children:[n?i:"•".repeat(16),l.jsx("button",{type:"button",onClick:()=>r(c=>!c),className:"ml-2 text-zinc-500 transition-colors hover:text-zinc-300",title:n?"Hide password":"Show password",children:n?l.jsx(lp,{size:14}):l.jsx(op,{size:14})}),l.jsx(ed,{text:i})]})]})]})]}),l.jsxs("div",{className:"mb-5 space-y-2",children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-300",children:"Access URLs"}),l.jsxs("div",{className:"flex items-center justify-between rounded border border-zinc-700 bg-zinc-900 px-3 py-2",children:[l.jsx("span",{className:"text-sm text-zinc-400",children:"Panel"}),l.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-cyan-400 hover:underline",children:[o,l.jsx(Ir,{size:12})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded border border-zinc-700 bg-zinc-900 px-3 py-2",children:[l.jsx("span",{className:"text-sm text-zinc-400",children:"Auth Portal"}),l.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-cyan-400 hover:underline",children:[u,l.jsx(Ir,{size:12})]})]}),l.jsxs("div",{className:"flex items-center justify-between rounded border border-zinc-700 bg-zinc-900 px-3 py-2",children:[l.jsx("span",{className:"text-sm text-zinc-400",children:"IP Access"}),l.jsxs("span",{className:"text-sm text-zinc-400",children:[a," ",l.jsx("span",{className:"text-xs text-zinc-500",children:"(requires client certificate)"})]})]})]}),l.jsxs("p",{className:"mb-6 text-xs text-zinc-400",children:["On your first login to ",u?new URL(u).hostname:"the auth portal",", you will be prompted to set up two-factor authentication (TOTP). Use an authenticator app like Google Authenticator or Authy."]}),l.jsx("div",{className:"flex justify-center",children:l.jsx("a",{href:"/",className:"rounded-md bg-cyan-500 px-8 py-2.5 font-medium text-white transition-colors hover:bg-cyan-600",children:"Go to Dashboard"})})]})}const td=4;function Qg(e){switch(e){case"FRESH":return 1;case"DOMAIN_SET":return 2;case"DNS_READY":case"PROVISIONING":return 3;case"COMPLETED":return 4;default:return 1}}function Bg({current:e}){return l.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[l.jsxs("span",{className:"text-sm text-zinc-400",children:["Step ",e," of ",td]}),l.jsx("div",{className:"flex gap-1.5",children:Array.from({length:td},(t,n)=>{const r=n+1;let s="h-2 w-2 rounded-full";return r<e?s+=" bg-cyan-400":r===e?s+=" border-2 border-cyan-400 bg-transparent":s+=" bg-zinc-600",l.jsx("div",{className:s},r)})})]})}function Vg(){const{status:e,domain:t,ip:n,isLoading:r,isError:s,refetch:i}=Sl(),[o,u]=N.useState(null),[a,c]=N.useState(null),d=Qg(e),f=o!==null&&o<d?o:d;if(r)return l.jsx(hp,{});if(s)return l.jsx(pp,{onRetry:i});function h(){i(),u(null)}function g(){i(),u(null)}function y(){u(1)}function j(x){c(x),u(4),i()}let S;return f===1?S=l.jsx(Tg,{domain:t,onComplete:h}):f===2?S=l.jsx(Fg,{domain:t,ip:n,onComplete:g,onBack:y}):f===3?S=l.jsx(Ug,{onComplete:j}):f===4&&(S=l.jsx($g,{result:a,ip:n})),l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-zinc-950",children:l.jsxs("div",{className:"mx-4 w-full max-w-xl rounded-lg border border-zinc-800 bg-zinc-900 p-8",children:[l.jsx("h1",{className:"mb-2 font-mono text-2xl font-bold text-cyan-400",children:"Portlama"}),l.jsx(Bg,{current:f}),S]})})}function pi(e,t=1){if(e===0)return"0 B";const n=1024,r=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(n));return`${(e/Math.pow(n,s)).toFixed(t)} ${r[s]}`}function Hg(e){if(!e||e<=0)return"0s";const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),s=Math.floor(e%60),i=[];return t>0&&i.push(`${t}d`),n>0&&i.push(`${n}h`),r>0&&i.push(`${r}m`),i.length===0&&i.push(`${s}s`),i.join(" ")}async function qg(){const e=await fetch("/api/system/stats");if(!e.ok)throw new Error("Failed to fetch system stats");return e.json()}async function Wg(){const e=await fetch("/api/services");if(!e.ok)throw new Error("Failed to fetch services");return e.json()}function mi({icon:e,label:t,value:n,isLoading:r,isError:s}){return l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6",children:[l.jsx(e,{size:20,className:"text-cyan-400 mb-2"}),l.jsx("p",{className:"text-zinc-400 text-sm mb-1",children:t}),r?l.jsx("div",{className:"h-7 w-24 animate-pulse rounded bg-zinc-700"}):s?l.jsx("p",{className:"text-red-400 text-sm",children:"Error"}):l.jsx("p",{className:"text-xl font-semibold text-white",children:n})]})}function Kg({status:e}){const t=e==="active"?"bg-green-500":e==="failed"?"bg-red-500":"bg-zinc-500";return l.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${t}`})}function Gg(){var s;const e=wt({queryKey:["system-stats"],queryFn:qg,refetchInterval:5e3}),t=wt({queryKey:["services"],queryFn:Wg,refetchInterval:5e3}),n=e.data,r=(s=t.data)==null?void 0:s.services;return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6",children:[l.jsx("h1",{className:"text-xl font-bold text-white",children:"Dashboard"}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1",children:"System overview and service health"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:[l.jsx(mi,{icon:og,label:"CPU Usage",value:n?`${n.cpu.usage}%`:"—",isLoading:e.isLoading,isError:e.isError}),l.jsx(mi,{icon:ag,label:"Memory Usage",value:n?`${pi(n.memory.used)} / ${pi(n.memory.total)}`:"—",isLoading:e.isLoading,isError:e.isError}),l.jsx(mi,{icon:dg,label:"Disk Usage",value:n?`${pi(n.disk.used)} / ${pi(n.disk.total)}`:"—",isLoading:e.isLoading,isError:e.isError}),l.jsx(mi,{icon:sp,label:"Uptime",value:n?Hg(n.uptime):"—",isLoading:e.isLoading,isError:e.isError})]}),l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6 mb-8",children:[l.jsxs("h2",{className:"text-sm font-semibold text-zinc-300 mb-4 flex items-center gap-2",children:[l.jsx(Xc,{size:14,className:"text-cyan-400"}),"Service Health"]}),t.isLoading?l.jsx("div",{className:"flex gap-6 flex-wrap",children:Array.from({length:4}).map((i,o)=>l.jsx("div",{className:"h-5 w-28 animate-pulse rounded bg-zinc-700"},o))}):t.isError?l.jsx("p",{className:"text-red-400 text-sm",children:"Failed to load service status"}):l.jsx("div",{className:"flex gap-6 flex-wrap",children:r==null?void 0:r.map(i=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Kg,{status:i.status}),l.jsx("span",{className:"text-zinc-300 text-sm",children:i.name})]},i.name))})]}),l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6",children:[l.jsxs("h2",{className:"text-sm font-semibold text-zinc-300 mb-4 flex items-center gap-2",children:[l.jsx(Xc,{size:14,className:"text-cyan-400"}),"Quick Overview"]}),l.jsxs("div",{className:"flex gap-8 flex-wrap text-sm",children:[l.jsxs("div",{className:"text-zinc-400",children:["Active Tunnels: ",l.jsx("span",{className:"text-white",children:"0"})]}),l.jsxs("div",{className:"text-zinc-400",children:["Registered Users: ",l.jsx("span",{className:"text-white",children:"0"})]})]})]})]})}async function Yg(){const e=await fetch("/api/tunnels");if(!e.ok)throw new Error("Failed to fetch tunnels");return e.json()}async function Xg(e){const t=await fetch("/api/tunnels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error||"Failed to create tunnel");return n}async function Zg(e){const t=await fetch(`/api/tunnels/${e}`,{method:"DELETE"}),n=await t.json();if(!t.ok)throw new Error(n.error||"Failed to delete tunnel");return n}function mp(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n,s=Math.floor(r/1e3),i=Math.floor(s/60),o=Math.floor(i/60),u=Math.floor(o/24);return u>30?new Date(e).toLocaleDateString():u>0?`${u}d ago`:o>0?`${o}h ago`:i>0?`${i}m ago`:"just now"}const Jg=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;function ev(e){return e?e.length>63?"Max 63 characters":Jg.test(e)?null:"Lowercase letters, numbers, and hyphens only. Cannot start or end with a hyphen.":"Subdomain is required"}function tv(e){const t=Number(e);return!e&&e!==0?"Port is required":Number.isInteger(t)?t<1024?"Minimum 1024":t>65535?"Maximum 65535":null:"Must be an integer"}function nv({domain:e,onClose:t}){const n=Oe(),r=dt(),[s,i]=N.useState(""),[o,u]=N.useState(""),[a,c]=N.useState(""),[d,f]=N.useState({}),[h,g]=N.useState(null),y=Ce({mutationFn:Xg,onSuccess:S=>{n.invalidateQueries({queryKey:["tunnels"]}),r(`Tunnel ${S.tunnel.fqdn} created`),t()},onError:S=>{g(S.message)}}),j=N.useCallback(S=>{S.preventDefault(),g(null);const x=ev(s),p=tv(o),m={};if(x&&(m.subdomain=x),p&&(m.port=p),Object.keys(m).length>0){f(m);return}f({}),y.mutate({subdomain:s,port:Number(o),description:a||void 0})},[s,o,a,y]);return l.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-5 mb-6",children:[l.jsxs("h2",{className:"text-sm font-semibold text-zinc-300 mb-4 flex items-center gap-2",children:[l.jsx(Ar,{size:14,className:"text-cyan-400"}),"Add Tunnel"]}),l.jsxs("form",{onSubmit:j,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Subdomain"}),l.jsxs("div",{className:"flex items-center gap-0",children:[l.jsx("input",{type:"text",value:s,onChange:S=>{i(S.target.value.toLowerCase()),f(x=>({...x,subdomain:void 0}))},disabled:y.isPending,placeholder:"myapp",className:"flex-1 rounded-l bg-zinc-800 border border-zinc-700 px-3 py-2 text-sm text-zinc-200 font-mono placeholder:text-zinc-600 focus:outline-none focus:border-cyan-400 disabled:opacity-50"}),l.jsxs("span",{className:"rounded-r bg-zinc-800/60 border border-l-0 border-zinc-700 px-3 py-2 text-sm text-zinc-500 font-mono",children:[".",e]})]}),d.subdomain&&l.jsx("p",{className:"text-red-400 text-xs mt-1",children:d.subdomain})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Port"}),l.jsx("input",{type:"number",value:o,onChange:S=>{u(S.target.value),f(x=>({...x,port:void 0}))},disabled:y.isPending,placeholder:"8080",min:1024,max:65535,className:"w-40 rounded bg-zinc-800 border border-zinc-700 px-3 py-2 text-sm text-zinc-200 font-mono placeholder:text-zinc-600 focus:outline-none focus:border-cyan-400 disabled:opacity-50"}),d.port&&l.jsx("p",{className:"text-red-400 text-xs mt-1",children:d.port})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs text-zinc-400 mb-1",children:["Description ",l.jsx("span",{className:"text-zinc-600",children:"(optional)"})]}),l.jsx("input",{type:"text",value:a,onChange:S=>c(S.target.value),disabled:y.isPending,placeholder:"My web application",maxLength:200,className:"w-full rounded bg-zinc-800 border border-zinc-700 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:border-cyan-400 disabled:opacity-50"})]}),h&&l.jsx("div",{className:"rounded bg-red-500/10 border border-red-500/20 px-3 py-2 text-sm text-red-400",children:h}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{type:"submit",disabled:y.isPending,className:"flex items-center gap-2 rounded bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500 disabled:opacity-50 disabled:cursor-not-allowed",children:y.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Setting up tunnel..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ar,{size:14}),"Add Tunnel"]})}),l.jsx("button",{type:"button",onClick:t,disabled:y.isPending,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600 disabled:opacity-50",children:"Cancel"})]})]})]})}function rv({tunnel:e,onConfirm:t,onCancel:n,isPending:r}){return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:l.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 shadow-xl",children:[l.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Delete Tunnel"}),l.jsxs("p",{className:"text-zinc-400 text-sm mb-6",children:["Are you sure you want to delete"," ",l.jsx("span",{className:"text-cyan-400 font-mono",children:e.fqdn}),"? This will remove the nginx configuration and TLS certificate mapping."]}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:n,disabled:r,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600 disabled:opacity-50",children:"Cancel"}),l.jsx("button",{type:"button",onClick:t,disabled:r,className:"flex items-center gap-2 rounded bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-500 disabled:opacity-50",children:r?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Deleting..."]}):"Delete"})]})]})})}function sv({tunnels:e,onDelete:t}){return l.jsx("div",{className:"hidden md:block overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-700",children:[l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Subdomain"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"FQDN"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Port"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Description"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Created"}),l.jsx("th",{className:"text-right text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Actions"})]})}),l.jsx("tbody",{children:e.map(n=>l.jsxs("tr",{className:"border-b border-zinc-700 bg-zinc-800/50",children:[l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-200 font-mono",children:n.subdomain}),l.jsx("td",{className:"py-3 px-4 text-sm",children:l.jsxs("a",{href:`https://${n.fqdn}`,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 inline-flex items-center gap-1",children:[n.fqdn,l.jsx(Ir,{size:12})]})}),l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-200 font-mono",children:n.port}),l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-400",children:n.description||"—"}),l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-500",children:mp(n.createdAt)}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsxs("button",{type:"button",onClick:()=>t(n),className:"inline-flex items-center gap-1.5 rounded bg-zinc-700 px-2.5 py-1.5 text-xs text-red-400 hover:bg-red-600/20 hover:text-red-300",children:[l.jsx(qr,{size:12}),"Delete"]})})]},n.id))})]})})}function iv({tunnels:e,onDelete:t}){return l.jsx("div",{className:"md:hidden space-y-3",children:e.map(n=>l.jsxs("div",{className:"bg-zinc-800/50 border border-zinc-700 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-sm font-semibold text-zinc-200 font-mono",children:n.subdomain}),l.jsx("button",{type:"button",onClick:()=>t(n),className:"inline-flex items-center gap-1 text-xs text-red-400 hover:text-red-300",children:l.jsx(qr,{size:12})})]}),l.jsxs("a",{href:`https://${n.fqdn}`,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 text-sm inline-flex items-center gap-1 mb-1",children:[n.fqdn,l.jsx(Ir,{size:12})]}),l.jsxs("div",{className:"flex items-center gap-4 text-xs text-zinc-500 mt-2",children:[l.jsxs("span",{children:["Port: ",l.jsx("span",{className:"text-zinc-300 font-mono",children:n.port})]}),l.jsx("span",{children:mp(n.createdAt)})]}),n.description&&l.jsx("p",{className:"text-xs text-zinc-400 mt-2",children:n.description})]},n.id))})}function lv({hasTunnels:e}){const[t,n]=N.useState(!1),r=N.useCallback(async()=>{try{const i=await fetch("/api/tunnels/mac-plist");if(!i.ok)throw new Error("Download failed");const o=await i.blob(),u=URL.createObjectURL(o),a=document.createElement("a");a.href=u,a.download="com.portlama.chisel.plist",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(u)}catch{}},[]),s=[{step:"Install Chisel:",code:"brew install chisel",note:"or download from https://github.com/jpillora/chisel/releases"},{step:"Save the downloaded file to:",code:"~/Library/LaunchAgents/com.portlama.chisel.plist"},{step:"Load the agent:",code:"launchctl load ~/Library/LaunchAgents/com.portlama.chisel.plist"},{step:"Check status:",code:"launchctl list | grep chisel"},{step:"View logs:",code:"tail -f /usr/local/var/log/chisel.log"},{step:"To update after adding/removing tunnels:",note:"Download a new plist, unload the old one, load the new one."}];return l.jsxs("div",{className:"mt-8 border-t border-zinc-800 pt-6",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-300 mb-4",children:"Mac Client Configuration"}),l.jsxs("button",{type:"button",onClick:r,disabled:!e,title:e?"Download launchd plist":"Add at least one tunnel first",className:"flex items-center gap-2 rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(ip,{size:14}),"Download Mac Config"]}),!e&&l.jsx("p",{className:"text-xs text-zinc-500 mt-2",children:"Add at least one tunnel to download the config."}),l.jsxs("button",{type:"button",onClick:()=>n(i=>!i),className:"flex items-center gap-1 mt-4 text-sm text-zinc-400 hover:text-zinc-300",children:[t?l.jsx(tp,{size:14}):l.jsx(np,{size:14}),"Mac Setup Instructions"]}),t&&l.jsx("div",{className:"mt-3 bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:l.jsx("ol",{className:"space-y-3 text-sm text-zinc-400 list-decimal list-inside",children:s.map((i,o)=>l.jsxs("li",{children:[i.step,i.code&&l.jsx("code",{className:"ml-2 bg-zinc-800 px-2 py-0.5 rounded text-xs font-mono text-cyan-400",children:i.code}),i.note&&l.jsx("span",{className:"block ml-5 text-xs text-zinc-500 mt-0.5",children:i.note})]},o))})})]})}function ov(){var h;const e=Oe(),t=dt(),{domain:n}=Sl(),[r,s]=N.useState(!1),[i,o]=N.useState(null),u=wt({queryKey:["tunnels"],queryFn:Yg,refetchInterval:1e4}),a=Ce({mutationFn:Zg,onSuccess:()=>{e.invalidateQueries({queryKey:["tunnels"]}),t(`Tunnel ${i.fqdn} deleted`),o(null)},onError:g=>{t(g.message,"error"),o(null)}}),c=N.useCallback(g=>{o(g)},[]),d=N.useCallback(()=>{i&&a.mutate(i.id)},[i,a]),f=((h=u.data)==null?void 0:h.tunnels)||[];return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-bold text-white",children:"Tunnels"}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1",children:"Manage reverse tunnel configurations"})]}),!r&&l.jsxs("button",{type:"button",onClick:()=>s(!0),className:"flex items-center gap-2 rounded bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500",children:[l.jsx(Ar,{size:14}),"Add Tunnel"]})]}),r&&n&&l.jsx(nv,{domain:n,onClose:()=>s(!1)}),u.isLoading?l.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((g,y)=>l.jsx("div",{className:"h-16 animate-pulse rounded-lg bg-zinc-900 border border-zinc-800"},y))}):u.isError?l.jsx("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6",children:l.jsx("p",{className:"text-red-400 text-sm",children:"Failed to load tunnels"})}):f.length===0?l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-12 text-center",children:[l.jsx(xg,{size:32,className:"mx-auto text-zinc-600 mb-3"}),l.jsx("p",{className:"text-zinc-400 text-sm",children:"No tunnels yet. Add your first tunnel to get started."})]}):l.jsxs(l.Fragment,{children:[l.jsx(sv,{tunnels:f,onDelete:c}),l.jsx(iv,{tunnels:f,onDelete:c})]}),l.jsx(lv,{hasTunnels:f.length>0}),i&&l.jsx(rv,{tunnel:i,onConfirm:d,onCancel:()=>o(null),isPending:a.isPending})]})}async function av(e,t){const n=t&&t!=="."?`?path=${encodeURIComponent(t)}`:"",r=await fetch(`/api/sites/${e}/files${n}`);if(!r.ok)throw new Error("Failed to fetch files");return r.json()}async function uv(e,t,n){const r=new FormData;for(const u of n)r.append("files",u);const s=t&&t!=="."?`?path=${encodeURIComponent(t)}`:"",i=await fetch(`/api/sites/${e}/files${s}`,{method:"POST",body:r}),o=await i.json();if(!i.ok)throw new Error(o.error||"Upload failed");return o}async function cv(e,t){const n=await fetch(`/api/sites/${e}/files`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Delete failed");return r}function dv(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function fv(e){return new Date(e).toLocaleString()}function hv({currentPath:e,onNavigate:t}){const n=e==="."?[]:e.split("/");return l.jsxs("div",{className:"flex items-center gap-1 text-sm text-zinc-400 overflow-x-auto",children:[l.jsx("button",{type:"button",onClick:()=>t("."),className:"flex items-center gap-1 hover:text-cyan-400 shrink-0",children:l.jsx(fg,{size:14})}),n.map((r,s)=>{const i=n.slice(0,s+1).join("/"),o=s===n.length-1;return l.jsxs("span",{className:"flex items-center gap-1 shrink-0",children:[l.jsx(np,{size:12,className:"text-zinc-600"}),o?l.jsx("span",{className:"text-zinc-200",children:r}):l.jsx("button",{type:"button",onClick:()=>t(i),className:"hover:text-cyan-400",children:r})]},i)})]})}function pv({fileName:e,onConfirm:t,onCancel:n,isPending:r}){return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:l.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 shadow-xl",children:[l.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Delete File"}),l.jsxs("p",{className:"text-zinc-400 text-sm mb-6",children:["Are you sure you want to delete"," ",l.jsx("span",{className:"text-cyan-400 font-mono",children:e}),"?"]}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:n,disabled:r,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600 disabled:opacity-50",children:"Cancel"}),l.jsx("button",{type:"button",onClick:t,disabled:r,className:"flex items-center gap-2 rounded bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-500 disabled:opacity-50",children:r?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Deleting..."]}):"Delete"})]})]})})}function mv({site:e,onBack:t}){var x;const n=Oe(),r=dt(),s=N.useRef(null),[i,o]=N.useState("."),[u,a]=N.useState(null),c=wt({queryKey:["site-files",e.id,i],queryFn:()=>av(e.id,i),refetchInterval:5e3}),d=Ce({mutationFn:({files:p})=>uv(e.id,i,p),onSuccess:p=>{n.invalidateQueries({queryKey:["site-files",e.id]}),n.invalidateQueries({queryKey:["sites"]});const m=p.warning?`${p.files.length} file(s) uploaded. ${p.warning}`:`${p.files.length} file(s) uploaded`;r(m)},onError:p=>{r(p.message,"error")}}),f=Ce({mutationFn:p=>cv(e.id,p),onSuccess:()=>{n.invalidateQueries({queryKey:["site-files",e.id]}),n.invalidateQueries({queryKey:["sites"]}),r("File deleted"),a(null)},onError:p=>{r(p.message,"error"),a(null)}}),h=N.useCallback(p=>{o(p)},[]),g=N.useCallback(p=>{p.type==="directory"&&o(p.relativePath)},[]),y=N.useCallback(()=>{var p;(p=s.current)==null||p.click()},[]),j=N.useCallback(p=>{const m=Array.from(p.target.files||[]);m.length>0&&d.mutate({files:m}),p.target.value=""},[d]),S=((x=c.data)==null?void 0:x.files)||[];return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6",children:[l.jsxs("button",{type:"button",onClick:t,className:"flex items-center gap-2 text-sm text-zinc-400 hover:text-zinc-200 mb-3",children:[l.jsx(ng,{size:14}),"Back to Sites"]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("h1",{className:"text-xl font-bold text-white",children:[e.name,l.jsx("span",{className:"text-zinc-500 font-normal ml-2 text-base",children:"Files"})]}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1 font-mono",children:e.fqdn})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{ref:s,type:"file",multiple:!0,onChange:j,className:"hidden"}),l.jsx("button",{type:"button",onClick:y,disabled:d.isPending,className:"flex items-center gap-2 rounded bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500 disabled:opacity-50",children:d.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Uploading..."]}):l.jsxs(l.Fragment,{children:[l.jsx(jg,{size:14}),"Upload"]})})]})]})]}),l.jsx("div",{className:"bg-zinc-900 border border-zinc-800 rounded-t-lg px-4 py-3",children:l.jsx(hv,{currentPath:i,onNavigate:h})}),c.isLoading?l.jsx("div",{className:"bg-zinc-900 border border-t-0 border-zinc-800 rounded-b-lg p-8 text-center",children:l.jsx(Re,{size:24,className:"mx-auto text-zinc-500 animate-spin"})}):c.isError?l.jsx("div",{className:"bg-zinc-900 border border-t-0 border-zinc-800 rounded-b-lg p-6",children:l.jsx("p",{className:"text-red-400 text-sm",children:"Failed to load files"})}):S.length===0?l.jsx("div",{className:"bg-zinc-900 border border-t-0 border-zinc-800 rounded-b-lg p-8 text-center",children:l.jsx("p",{className:"text-zinc-500 text-sm",children:"This directory is empty."})}):l.jsx("div",{className:"bg-zinc-900 border border-t-0 border-zinc-800 rounded-b-lg overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left text-zinc-500 text-xs uppercase font-semibold py-2 px-4",children:"Name"}),l.jsx("th",{className:"text-left text-zinc-500 text-xs uppercase font-semibold py-2 px-4 hidden sm:table-cell",children:"Size"}),l.jsx("th",{className:"text-left text-zinc-500 text-xs uppercase font-semibold py-2 px-4 hidden md:table-cell",children:"Modified"}),l.jsx("th",{className:"text-right text-zinc-500 text-xs uppercase font-semibold py-2 px-4 w-16"})]})}),l.jsx("tbody",{children:S.map(p=>l.jsxs("tr",{className:`border-b border-zinc-800/50 ${p.type==="directory"?"cursor-pointer hover:bg-zinc-800/50":""}`,onClick:()=>g(p),children:[l.jsx("td",{className:"py-2.5 px-4 text-sm",children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[p.type==="directory"?l.jsx(cg,{size:14,className:"text-cyan-400 shrink-0"}):l.jsx(ug,{size:14,className:"text-zinc-500 shrink-0"}),l.jsx("span",{className:`font-mono ${p.type==="directory"?"text-cyan-400":"text-zinc-200"}`,children:p.name})]})}),l.jsx("td",{className:"py-2.5 px-4 text-sm text-zinc-500 font-mono hidden sm:table-cell",children:p.type==="file"?dv(p.size):"—"}),l.jsx("td",{className:"py-2.5 px-4 text-sm text-zinc-600 hidden md:table-cell",children:fv(p.modifiedAt)}),l.jsx("td",{className:"py-2.5 px-4 text-right",children:l.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),a(p)},className:"inline-flex items-center p-1 text-zinc-600 hover:text-red-400",title:"Delete",children:l.jsx(qr,{size:14})})})]},p.relativePath))})]})}),u&&l.jsx(pv,{fileName:u.name,onConfirm:()=>f.mutate(u.relativePath),onCancel:()=>a(null),isPending:f.isPending})]})}async function xv(){const e=await fetch("/api/sites");if(!e.ok)throw new Error("Failed to fetch sites");return e.json()}async function yv(e){const t=await fetch("/api/sites",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error||"Failed to create site");return n}async function gv(e){const t=await fetch(`/api/sites/${e}`,{method:"DELETE"}),n=await t.json();if(!t.ok)throw new Error(n.error||"Failed to delete site");return n}async function vv(e){const t=await fetch(`/api/sites/${e}/verify-dns`,{method:"POST"}),n=await t.json();if(!t.ok)throw new Error(n.error||"DNS verification failed");return n}function xp(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n,s=Math.floor(r/1e3),i=Math.floor(s/60),o=Math.floor(i/60),u=Math.floor(o/24);return u>30?new Date(e).toLocaleDateString():u>0?`${u}d ago`:o>0?`${o}h ago`:i>0?`${i}m ago`:"just now"}function yp(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function gp({site:e}){return e.certIssued&&e.dnsVerified?l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full border text-green-400 bg-green-500/10 border-green-500/20",children:[l.jsx(ig,{size:10}),"Live"]}):e.type==="custom"&&!e.dnsVerified?l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full border text-yellow-400 bg-yellow-500/10 border-yellow-500/20",children:[l.jsx(sp,{size:10}),"DNS Pending"]}):l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full border text-zinc-500 bg-zinc-800 border-zinc-700",children:[l.jsx(Fs,{size:10}),"Setup Required"]})}function vp({type:e}){return l.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full border ${e==="managed"?"text-cyan-400 bg-cyan-500/10 border-cyan-500/20":"text-purple-400 bg-purple-500/10 border-purple-500/20"}`,children:e})}const wv=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;function jv({domain:e,onClose:t}){const n=Oe(),r=dt(),[s,i]=N.useState(""),[o,u]=N.useState("managed"),[a,c]=N.useState(""),[d,f]=N.useState(!1),[h,g]=N.useState(!1),[y,j]=N.useState({}),[S,x]=N.useState(null),p=Ce({mutationFn:yv,onSuccess:w=>{n.invalidateQueries({queryKey:["sites"]}),r(`Site ${w.site.fqdn} created`),t()},onError:w=>{x(w.message)}}),m=N.useCallback(w=>{w.preventDefault(),x(null);const C={};if(s?wv.test(s)||(C.name="Lowercase letters, numbers, and hyphens only"):C.name="Name is required",o==="custom"&&!a&&(C.customDomain="Domain is required for custom sites"),Object.keys(C).length>0){j(C);return}j({});const k={name:s,type:o,spaMode:d,autheliaProtected:h};o==="custom"&&(k.customDomain=a.toLowerCase()),p.mutate(k)},[s,o,a,d,h,p]);return l.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-5 mb-6",children:[l.jsxs("h2",{className:"text-sm font-semibold text-zinc-300 mb-4 flex items-center gap-2",children:[l.jsx(Ar,{size:14,className:"text-cyan-400"}),"Add Static Site"]}),l.jsxs("form",{onSubmit:m,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-zinc-400 mb-2",children:"Domain Type"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{type:"button",onClick:()=>u("managed"),className:`px-3 py-1.5 text-sm rounded border ${o==="managed"?"border-cyan-400 text-cyan-400 bg-cyan-500/10":"border-zinc-700 text-zinc-400 bg-zinc-800 hover:border-zinc-600"}`,children:"Managed Subdomain"}),l.jsx("button",{type:"button",onClick:()=>u("custom"),className:`px-3 py-1.5 text-sm rounded border ${o==="custom"?"border-cyan-400 text-cyan-400 bg-cyan-500/10":"border-zinc-700 text-zinc-400 bg-zinc-800 hover:border-zinc-600"}`,children:"Custom Domain"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Name"}),l.jsxs("div",{className:"flex items-center gap-0",children:[l.jsx("input",{type:"text",value:s,onChange:w=>{i(w.target.value.toLowerCase()),j(C=>({...C,name:void 0}))},disabled:p.isPending,placeholder:"blog",className:`flex-1 ${o==="managed"?"rounded-l":"rounded"} bg-zinc-800 border border-zinc-700 px-3 py-2 text-sm text-zinc-200 font-mono placeholder:text-zinc-600 focus:outline-none focus:border-cyan-400 disabled:opacity-50`}),o==="managed"&&l.jsxs("span",{className:"rounded-r bg-zinc-800/60 border border-l-0 border-zinc-700 px-3 py-2 text-sm text-zinc-500 font-mono",children:[".",e]})]}),y.name&&l.jsx("p",{className:"text-red-400 text-xs mt-1",children:y.name})]}),o==="custom"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-zinc-400 mb-1",children:"Custom Domain"}),l.jsx("input",{type:"text",value:a,onChange:w=>{c(w.target.value.toLowerCase()),j(C=>({...C,customDomain:void 0}))},disabled:p.isPending,placeholder:"example.com",className:"w-full rounded bg-zinc-800 border border-zinc-700 px-3 py-2 text-sm text-zinc-200 font-mono placeholder:text-zinc-600 focus:outline-none focus:border-cyan-400 disabled:opacity-50"}),y.customDomain&&l.jsx("p",{className:"text-red-400 text-xs mt-1",children:y.customDomain})]}),l.jsxs("div",{className:"flex flex-wrap gap-4",children:[l.jsxs("label",{className:"flex items-center gap-2 text-sm text-zinc-400 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:d,onChange:w=>f(w.target.checked),disabled:p.isPending,className:"rounded border-zinc-700 bg-zinc-800 text-cyan-400 focus:ring-cyan-400"}),"SPA Mode",l.jsx("span",{className:"text-zinc-600 text-xs",children:"(fallback to index.html)"})]}),l.jsxs("label",{className:"flex items-center gap-2 text-sm text-zinc-400 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:h,onChange:w=>g(w.target.checked),disabled:p.isPending,className:"rounded border-zinc-700 bg-zinc-800 text-cyan-400 focus:ring-cyan-400"}),"Authelia Protected",l.jsx("span",{className:"text-zinc-600 text-xs",children:"(require login)"})]})]}),S&&l.jsx("div",{className:"rounded bg-red-500/10 border border-red-500/20 px-3 py-2 text-sm text-red-400",children:S}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{type:"submit",disabled:p.isPending,className:"flex items-center gap-2 rounded bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500 disabled:opacity-50 disabled:cursor-not-allowed",children:p.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Creating site..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ar,{size:14}),"Create Site"]})}),l.jsx("button",{type:"button",onClick:t,disabled:p.isPending,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600 disabled:opacity-50",children:"Cancel"})]})]})]})}function Nv({site:e,onClose:t}){const n=Oe(),r=dt(),[s,i]=N.useState(null),o=Ce({mutationFn:()=>vv(e.id),onSuccess:u=>{i(u),u.ok&&(n.invalidateQueries({queryKey:["sites"]}),r("DNS verified and site is now live!"))},onError:u=>{i({ok:!1,message:u.message})}});return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:l.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-6 max-w-lg w-full mx-4 shadow-xl",children:[l.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"DNS Verification"}),l.jsxs("p",{className:"text-zinc-400 text-sm mb-4",children:["Add an A record pointing"," ",l.jsx("span",{className:"text-cyan-400 font-mono",children:e.fqdn})," to your server IP."]}),l.jsx("div",{className:"bg-zinc-800 rounded-lg p-4 mb-4",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-500 py-1 pr-4",children:"Type"}),l.jsx("td",{className:"text-zinc-200 font-mono",children:"A"})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-500 py-1 pr-4",children:"Name"}),l.jsx("td",{className:"text-zinc-200 font-mono",children:e.fqdn})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-500 py-1 pr-4",children:"Value"}),l.jsx("td",{className:"text-zinc-200 font-mono",children:"(your server IP)"})]})]})})}),s&&l.jsx("div",{className:`rounded px-3 py-2 text-sm mb-4 ${s.ok?"bg-green-500/10 border border-green-500/20 text-green-400":"bg-yellow-500/10 border border-yellow-500/20 text-yellow-400"}`,children:s.message}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:t,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600",children:s!=null&&s.ok?"Done":"Cancel"}),!(s!=null&&s.ok)&&l.jsx("button",{type:"button",onClick:()=>o.mutate(),disabled:o.isPending,className:"flex items-center gap-2 rounded bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500 disabled:opacity-50",children:o.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Verifying..."]}):"Verify DNS"})]})]})})}function Sv({site:e,onConfirm:t,onCancel:n,isPending:r}){return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:l.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 shadow-xl",children:[l.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Delete Site"}),l.jsxs("p",{className:"text-zinc-400 text-sm mb-6",children:["Are you sure you want to delete"," ",l.jsx("span",{className:"text-cyan-400 font-mono",children:e.fqdn}),"? This will remove all files, the nginx configuration, and certificate mapping."]}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:n,disabled:r,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600 disabled:opacity-50",children:"Cancel"}),l.jsx("button",{type:"button",onClick:t,disabled:r,className:"flex items-center gap-2 rounded bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-500 disabled:opacity-50",children:r?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Deleting..."]}):"Delete"})]})]})})}function Cv({sites:e,onDelete:t,onFiles:n,onVerifyDns:r}){return l.jsx("div",{className:"hidden md:block overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-700",children:[l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Name"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Domain"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Type"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Status"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Size"}),l.jsx("th",{className:"text-left text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Created"}),l.jsx("th",{className:"text-right text-zinc-400 text-xs uppercase font-semibold py-3 px-4",children:"Actions"})]})}),l.jsx("tbody",{children:e.map(s=>l.jsxs("tr",{className:"border-b border-zinc-700 bg-zinc-800/50",children:[l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-200 font-mono",children:s.name}),l.jsx("td",{className:"py-3 px-4 text-sm",children:s.certIssued?l.jsxs("a",{href:`https://${s.fqdn}`,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 inline-flex items-center gap-1",children:[s.fqdn,l.jsx(Ir,{size:12})]}):l.jsx("span",{className:"text-zinc-400 font-mono",children:s.fqdn})}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(vp,{type:s.type})}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(gp,{site:s})}),l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-400 font-mono",children:yp(s.totalSize||0)}),l.jsx("td",{className:"py-3 px-4 text-sm text-zinc-500",children:xp(s.createdAt)}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.type==="custom"&&!s.dnsVerified&&l.jsxs("button",{type:"button",onClick:()=>r(s),className:"inline-flex items-center gap-1.5 rounded bg-zinc-700 px-2.5 py-1.5 text-xs text-yellow-400 hover:bg-yellow-600/20 hover:text-yellow-300",children:[l.jsx(wu,{size:12}),"Verify DNS"]}),l.jsxs("button",{type:"button",onClick:()=>n(s),className:"inline-flex items-center gap-1.5 rounded bg-zinc-700 px-2.5 py-1.5 text-xs text-cyan-400 hover:bg-cyan-600/20 hover:text-cyan-300",children:[l.jsx(up,{size:12}),"Files"]}),l.jsxs("button",{type:"button",onClick:()=>t(s),className:"inline-flex items-center gap-1.5 rounded bg-zinc-700 px-2.5 py-1.5 text-xs text-red-400 hover:bg-red-600/20 hover:text-red-300",children:[l.jsx(qr,{size:12}),"Delete"]})]})})]},s.id))})]})})}function kv({sites:e,onDelete:t,onFiles:n,onVerifyDns:r}){return l.jsx("div",{className:"md:hidden space-y-3",children:e.map(s=>l.jsxs("div",{className:"bg-zinc-800/50 border border-zinc-700 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-sm font-semibold text-zinc-200 font-mono",children:s.name}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(vp,{type:s.type}),l.jsx(gp,{site:s})]})]}),s.certIssued?l.jsxs("a",{href:`https://${s.fqdn}`,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 text-sm inline-flex items-center gap-1 mb-1",children:[s.fqdn,l.jsx(Ir,{size:12})]}):l.jsx("span",{className:"text-zinc-400 text-sm font-mono",children:s.fqdn}),l.jsxs("div",{className:"flex items-center gap-4 text-xs text-zinc-500 mt-2",children:[l.jsx("span",{children:yp(s.totalSize||0)}),l.jsx("span",{children:xp(s.createdAt)})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[s.type==="custom"&&!s.dnsVerified&&l.jsxs("button",{type:"button",onClick:()=>r(s),className:"inline-flex items-center gap-1 text-xs text-yellow-400 hover:text-yellow-300",children:[l.jsx(wu,{size:12}),"Verify DNS"]}),l.jsxs("button",{type:"button",onClick:()=>n(s),className:"inline-flex items-center gap-1 text-xs text-cyan-400 hover:text-cyan-300",children:[l.jsx(up,{size:12}),"Files"]}),l.jsxs("button",{type:"button",onClick:()=>t(s),className:"inline-flex items-center gap-1 text-xs text-red-400 hover:text-red-300",children:[l.jsx(qr,{size:12}),"Delete"]})]})]},s.id))})}function bv(){var p;const e=Oe(),t=dt(),{domain:n}=Sl(),[r,s]=N.useState(!1),[i,o]=N.useState(null),[u,a]=N.useState(null),[c,d]=N.useState(null),f=wt({queryKey:["sites"],queryFn:xv,refetchInterval:1e4}),h=Ce({mutationFn:gv,onSuccess:()=>{e.invalidateQueries({queryKey:["sites"]}),t(`Site ${i.fqdn} deleted`),o(null)},onError:m=>{t(m.message,"error"),o(null)}}),g=N.useCallback(m=>o(m),[]),y=N.useCallback(m=>a(m),[]),j=N.useCallback(m=>d(m),[]),S=N.useCallback(()=>{i&&h.mutate(i.id)},[i,h]),x=((p=f.data)==null?void 0:p.sites)||[];return u?l.jsx(mv,{site:u,onBack:()=>a(null)}):l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-bold text-white",children:"Static Sites"}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1",children:"Host static websites, landing pages, and SPAs"})]}),!r&&l.jsxs("button",{type:"button",onClick:()=>s(!0),className:"flex items-center gap-2 rounded bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500",children:[l.jsx(Ar,{size:14}),"Add Site"]})]}),r&&n&&l.jsx(jv,{domain:n,onClose:()=>s(!1)}),f.isLoading?l.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((m,w)=>l.jsx("div",{className:"h-16 animate-pulse rounded-lg bg-zinc-900 border border-zinc-800"},w))}):f.isError?l.jsx("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6",children:l.jsx("p",{className:"text-red-400 text-sm",children:"Failed to load sites"})}):x.length===0?l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-12 text-center",children:[l.jsx(ap,{size:32,className:"mx-auto text-zinc-600 mb-3"}),l.jsx("p",{className:"text-zinc-400 text-sm",children:"No static sites yet. Create your first site to get started."})]}):l.jsxs(l.Fragment,{children:[l.jsx(Cv,{sites:x,onDelete:g,onFiles:y,onVerifyDns:j}),l.jsx(kv,{sites:x,onDelete:g,onFiles:y,onVerifyDns:j})]}),c&&l.jsx(Nv,{site:c,onClose:()=>d(null)}),i&&l.jsx(Sv,{site:i,onConfirm:S,onCancel:()=>o(null),isPending:h.isPending})]})}var zv=Object.defineProperty,rl=Object.getOwnPropertySymbols,wp=Object.prototype.hasOwnProperty,jp=Object.prototype.propertyIsEnumerable,nd=(e,t,n)=>t in e?zv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ma=(e,t)=>{for(var n in t||(t={}))wp.call(t,n)&&nd(e,n,t[n]);if(rl)for(var n of rl(t))jp.call(t,n)&&nd(e,n,t[n]);return e},xa=(e,t)=>{var n={};for(var r in e)wp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rl)for(var r of rl(e))t.indexOf(r)<0&&jp.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
313
|
+
* @license QR Code generator library (TypeScript)
|
|
314
|
+
* Copyright (c) Project Nayuki.
|
|
315
|
+
* SPDX-License-Identifier: MIT
|
|
316
|
+
*/var Wn;(e=>{const t=class U{constructor(a,c,d,f){if(this.version=a,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],a<U.MIN_VERSION||a>U.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let h=[];for(let y=0;y<this.size;y++)h.push(!1);for(let y=0;y<this.size;y++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();const g=this.addEccAndInterleave(d);if(this.drawCodewords(g),f==-1){let y=1e9;for(let j=0;j<8;j++){this.applyMask(j),this.drawFormatBits(j);const S=this.getPenaltyScore();S<y&&(f=j,y=S),this.applyMask(j)}}s(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(a,c){const d=e.QrSegment.makeSegments(a);return U.encodeSegments(d,c)}static encodeBinary(a,c){const d=e.QrSegment.makeBytes(a);return U.encodeSegments([d],c)}static encodeSegments(a,c,d=1,f=40,h=-1,g=!0){if(!(U.MIN_VERSION<=d&&d<=f&&f<=U.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");let y,j;for(y=d;;y++){const m=U.getNumDataCodewords(y,c)*8,w=o.getTotalBits(a,y);if(w<=m){j=w;break}if(y>=f)throw new RangeError("Data too long")}for(const m of[U.Ecc.MEDIUM,U.Ecc.QUARTILE,U.Ecc.HIGH])g&&j<=U.getNumDataCodewords(y,m)*8&&(c=m);let S=[];for(const m of a){n(m.mode.modeBits,4,S),n(m.numChars,m.mode.numCharCountBits(y),S);for(const w of m.getData())S.push(w)}s(S.length==j);const x=U.getNumDataCodewords(y,c)*8;s(S.length<=x),n(0,Math.min(4,x-S.length),S),n(0,(8-S.length%8)%8,S),s(S.length%8==0);for(let m=236;S.length<x;m^=253)n(m,8,S);let p=[];for(;p.length*8<S.length;)p.push(0);return S.forEach((m,w)=>p[w>>>3]|=m<<7-(w&7)),new U(y,c,p,h)}getModule(a,c){return 0<=a&&a<this.size&&0<=c&&c<this.size&&this.modules[c][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let d=0;d<this.size;d++)this.setFunctionModule(6,d,d%2==0),this.setFunctionModule(d,6,d%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const a=this.getAlignmentPatternPositions(),c=a.length;for(let d=0;d<c;d++)for(let f=0;f<c;f++)d==0&&f==0||d==0&&f==c-1||d==c-1&&f==0||this.drawAlignmentPattern(a[d],a[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){const c=this.errorCorrectionLevel.formatBits<<3|a;let d=c;for(let h=0;h<10;h++)d=d<<1^(d>>>9)*1335;const f=(c<<10|d)^21522;s(f>>>15==0);for(let h=0;h<=5;h++)this.setFunctionModule(8,h,r(f,h));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,r(f,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,r(f,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,r(f,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let d=0;d<12;d++)a=a<<1^(a>>>11)*7973;const c=this.version<<12|a;s(c>>>18==0);for(let d=0;d<18;d++){const f=r(c,d),h=this.size-11+d%3,g=Math.floor(d/3);this.setFunctionModule(h,g,f),this.setFunctionModule(g,h,f)}}drawFinderPattern(a,c){for(let d=-4;d<=4;d++)for(let f=-4;f<=4;f++){const h=Math.max(Math.abs(f),Math.abs(d)),g=a+f,y=c+d;0<=g&&g<this.size&&0<=y&&y<this.size&&this.setFunctionModule(g,y,h!=2&&h!=4)}}drawAlignmentPattern(a,c){for(let d=-2;d<=2;d++)for(let f=-2;f<=2;f++)this.setFunctionModule(a+f,c+d,Math.max(Math.abs(f),Math.abs(d))!=1)}setFunctionModule(a,c,d){this.modules[c][a]=d,this.isFunction[c][a]=!0}addEccAndInterleave(a){const c=this.version,d=this.errorCorrectionLevel;if(a.length!=U.getNumDataCodewords(c,d))throw new RangeError("Invalid argument");const f=U.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c],h=U.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c],g=Math.floor(U.getNumRawDataModules(c)/8),y=f-g%f,j=Math.floor(g/f);let S=[];const x=U.reedSolomonComputeDivisor(h);for(let m=0,w=0;m<f;m++){let C=a.slice(w,w+j-h+(m<y?0:1));w+=C.length;const k=U.reedSolomonComputeRemainder(C,x);m<y&&C.push(0),S.push(C.concat(k))}let p=[];for(let m=0;m<S[0].length;m++)S.forEach((w,C)=>{(m!=j-h||C>=y)&&p.push(w[m])});return s(p.length==g),p}drawCodewords(a){if(a.length!=Math.floor(U.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(let f=0;f<this.size;f++)for(let h=0;h<2;h++){const g=d-h,j=(d+1&2)==0?this.size-1-f:f;!this.isFunction[j][g]&&c<a.length*8&&(this.modules[j][g]=r(a[c>>>3],7-(c&7)),c++)}}s(c==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let d=0;d<this.size;d++){let f;switch(a){case 0:f=(d+c)%2==0;break;case 1:f=c%2==0;break;case 2:f=d%3==0;break;case 3:f=(d+c)%3==0;break;case 4:f=(Math.floor(d/3)+Math.floor(c/2))%2==0;break;case 5:f=d*c%2+d*c%3==0;break;case 6:f=(d*c%2+d*c%3)%2==0;break;case 7:f=((d+c)%2+d*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][d]&&f&&(this.modules[c][d]=!this.modules[c][d])}}getPenaltyScore(){let a=0;for(let h=0;h<this.size;h++){let g=!1,y=0,j=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[h][S]==g?(y++,y==5?a+=U.PENALTY_N1:y>5&&a++):(this.finderPenaltyAddHistory(y,j),g||(a+=this.finderPenaltyCountPatterns(j)*U.PENALTY_N3),g=this.modules[h][S],y=1);a+=this.finderPenaltyTerminateAndCount(g,y,j)*U.PENALTY_N3}for(let h=0;h<this.size;h++){let g=!1,y=0,j=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][h]==g?(y++,y==5?a+=U.PENALTY_N1:y>5&&a++):(this.finderPenaltyAddHistory(y,j),g||(a+=this.finderPenaltyCountPatterns(j)*U.PENALTY_N3),g=this.modules[S][h],y=1);a+=this.finderPenaltyTerminateAndCount(g,y,j)*U.PENALTY_N3}for(let h=0;h<this.size-1;h++)for(let g=0;g<this.size-1;g++){const y=this.modules[h][g];y==this.modules[h][g+1]&&y==this.modules[h+1][g]&&y==this.modules[h+1][g+1]&&(a+=U.PENALTY_N2)}let c=0;for(const h of this.modules)c=h.reduce((g,y)=>g+(y?1:0),c);const d=this.size*this.size,f=Math.ceil(Math.abs(c*20-d*10)/d)-1;return s(0<=f&&f<=9),a+=f*U.PENALTY_N4,s(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2;let d=[6];for(let f=this.size-7;d.length<a;f-=c)d.splice(1,0,f);return d}}static getNumRawDataModules(a){if(a<U.MIN_VERSION||a>U.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*a+128)*a+64;if(a>=2){const d=Math.floor(a/7)+2;c-=(25*d-10)*d-55,a>=7&&(c-=36)}return s(208<=c&&c<=29648),c}static getNumDataCodewords(a,c){return Math.floor(U.getNumRawDataModules(a)/8)-U.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a]*U.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let c=[];for(let f=0;f<a-1;f++)c.push(0);c.push(1);let d=1;for(let f=0;f<a;f++){for(let h=0;h<c.length;h++)c[h]=U.reedSolomonMultiply(c[h],d),h+1<c.length&&(c[h]^=c[h+1]);d=U.reedSolomonMultiply(d,2)}return c}static reedSolomonComputeRemainder(a,c){let d=c.map(f=>0);for(const f of a){const h=f^d.shift();d.push(0),c.forEach((g,y)=>d[y]^=U.reedSolomonMultiply(g,h))}return d}static reedSolomonMultiply(a,c){if(a>>>8||c>>>8)throw new RangeError("Byte out of range");let d=0;for(let f=7;f>=0;f--)d=d<<1^(d>>>7)*285,d^=(c>>>f&1)*a;return s(d>>>8==0),d}finderPenaltyCountPatterns(a){const c=a[1];s(c<=this.size*3);const d=c>0&&a[2]==c&&a[3]==c*3&&a[4]==c&&a[5]==c;return(d&&a[0]>=c*4&&a[6]>=c?1:0)+(d&&a[6]>=c*4&&a[0]>=c?1:0)}finderPenaltyTerminateAndCount(a,c,d){return a&&(this.finderPenaltyAddHistory(c,d),c=0),c+=this.size,this.finderPenaltyAddHistory(c,d),this.finderPenaltyCountPatterns(d)}finderPenaltyAddHistory(a,c){c[0]==0&&(a+=this.size),c.pop(),c.unshift(a)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(u,a,c){if(a<0||a>31||u>>>a)throw new RangeError("Value out of range");for(let d=a-1;d>=0;d--)c.push(u>>>d&1)}function r(u,a){return(u>>>a&1)!=0}function s(u){if(!u)throw new Error("Assertion error")}const i=class ee{constructor(a,c,d){if(this.mode=a,this.numChars=c,this.bitData=d,c<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}static makeBytes(a){let c=[];for(const d of a)n(d,8,c);return new ee(ee.Mode.BYTE,a.length,c)}static makeNumeric(a){if(!ee.isNumeric(a))throw new RangeError("String contains non-numeric characters");let c=[];for(let d=0;d<a.length;){const f=Math.min(a.length-d,3);n(parseInt(a.substring(d,d+f),10),f*3+1,c),d+=f}return new ee(ee.Mode.NUMERIC,a.length,c)}static makeAlphanumeric(a){if(!ee.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],d;for(d=0;d+2<=a.length;d+=2){let f=ee.ALPHANUMERIC_CHARSET.indexOf(a.charAt(d))*45;f+=ee.ALPHANUMERIC_CHARSET.indexOf(a.charAt(d+1)),n(f,11,c)}return d<a.length&&n(ee.ALPHANUMERIC_CHARSET.indexOf(a.charAt(d)),6,c),new ee(ee.Mode.ALPHANUMERIC,a.length,c)}static makeSegments(a){return a==""?[]:ee.isNumeric(a)?[ee.makeNumeric(a)]:ee.isAlphanumeric(a)?[ee.makeAlphanumeric(a)]:[ee.makeBytes(ee.toUtf8ByteArray(a))]}static makeEci(a){let c=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)n(a,8,c);else if(a<16384)n(2,2,c),n(a,14,c);else if(a<1e6)n(6,3,c),n(a,21,c);else throw new RangeError("ECI assignment value out of range");return new ee(ee.Mode.ECI,0,c)}static isNumeric(a){return ee.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return ee.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,c){let d=0;for(const f of a){const h=f.mode.numCharCountBits(c);if(f.numChars>=1<<h)return 1/0;d+=4+h+f.bitData.length}return d}static toUtf8ByteArray(a){a=encodeURI(a);let c=[];for(let d=0;d<a.length;d++)a.charAt(d)!="%"?c.push(a.charCodeAt(d)):(c.push(parseInt(a.substring(d+1,d+3),16)),d+=2);return c}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let o=i;e.QrSegment=i})(Wn||(Wn={}));(e=>{(t=>{const n=class{constructor(s,i){this.ordinal=s,this.formatBits=i}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Wn||(Wn={}));(e=>{(t=>{const n=class{constructor(s,i){this.modeBits=s,this.numBitsCharCount=i}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Wn||(Wn={}));var dr=Wn;/**
|
|
317
|
+
* @license qrcode.react
|
|
318
|
+
* Copyright (c) Paul O'Shannessy
|
|
319
|
+
* SPDX-License-Identifier: ISC
|
|
320
|
+
*/var Ev={L:dr.QrCode.Ecc.LOW,M:dr.QrCode.Ecc.MEDIUM,Q:dr.QrCode.Ecc.QUARTILE,H:dr.QrCode.Ecc.HIGH},Np=128,Sp="L",Cp="#FFFFFF",kp="#000000",bp=!1,zp=1,Pv=4,Rv=0,Mv=.1;function Ep(e,t=0){const n=[];return e.forEach(function(r,s){let i=null;r.forEach(function(o,u){if(!o&&i!==null){n.push(`M${i+t} ${s+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===r.length-1){if(!o)return;i===null?n.push(`M${u+t},${s+t} h1v1H${u+t}z`):n.push(`M${i+t},${s+t} h${u+1-i}v1H${i+t}z`);return}o&&i===null&&(i=u)})}),n.join("")}function Pp(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((s,i)=>i<t.x||i>=t.x+t.w?s:!1))}function Tv(e,t,n,r){if(r==null)return null;const s=e.length+n*2,i=Math.floor(t*Mv),o=s/t,u=(r.width||i)*o,a=(r.height||i)*o,c=r.x==null?e.length/2-u/2:r.x*o,d=r.y==null?e.length/2-a/2:r.y*o,f=r.opacity==null?1:r.opacity;let h=null;if(r.excavate){let y=Math.floor(c),j=Math.floor(d),S=Math.ceil(u+c-y),x=Math.ceil(a+d-j);h={x:y,y:j,w:S,h:x}}const g=r.crossOrigin;return{x:c,y:d,h:a,w:u,excavation:h,opacity:f,crossOrigin:g}}function Ov(e,t){return t!=null?Math.max(Math.floor(t),0):e?Pv:Rv}function Rp({value:e,level:t,minVersion:n,includeMargin:r,marginSize:s,imageSettings:i,size:o,boostLevel:u}){let a=se.useMemo(()=>{const y=(Array.isArray(e)?e:[e]).reduce((j,S)=>(j.push(...dr.QrSegment.makeSegments(S)),j),[]);return dr.QrCode.encodeSegments(y,Ev[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:c,margin:d,numCells:f,calculatedImageSettings:h}=se.useMemo(()=>{let g=a.getModules();const y=Ov(r,s),j=g.length+y*2,S=Tv(g,o,y,i);return{cells:g,margin:y,numCells:j,calculatedImageSettings:S}},[a,o,i,r,s]);return{qrcode:a,margin:d,cells:c,numCells:f,calculatedImageSettings:h}}var Lv=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Fv=se.forwardRef(function(t,n){const r=t,{value:s,size:i=Np,level:o=Sp,bgColor:u=Cp,fgColor:a=kp,includeMargin:c=bp,minVersion:d=zp,boostLevel:f,marginSize:h,imageSettings:g}=r,j=xa(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=j,x=xa(j,["style"]),p=g==null?void 0:g.src,m=se.useRef(null),w=se.useRef(null),C=se.useCallback(ke=>{m.current=ke,typeof n=="function"?n(ke):n&&(n.current=ke)},[n]),[k,E]=se.useState(!1),{margin:b,cells:P,numCells:M,calculatedImageSettings:A}=Rp({value:s,level:o,minVersion:d,boostLevel:f,includeMargin:c,marginSize:h,imageSettings:g,size:i});se.useEffect(()=>{if(m.current!=null){const ke=m.current,ge=ke.getContext("2d");if(!ge)return;let Yn=P;const jt=w.current,T=A!=null&&jt!==null&&jt.complete&&jt.naturalHeight!==0&&jt.naturalWidth!==0;T&&A.excavation!=null&&(Yn=Pp(P,A.excavation));const _=window.devicePixelRatio||1;ke.height=ke.width=i*_;const D=i/M*_;ge.scale(D,D),ge.fillStyle=u,ge.fillRect(0,0,M,M),ge.fillStyle=a,Lv?ge.fill(new Path2D(Ep(Yn,b))):P.forEach(function(Y,le){Y.forEach(function(Xn,Nt){Xn&&ge.fillRect(Nt+b,le+b,1,1)})}),A&&(ge.globalAlpha=A.opacity),T&&ge.drawImage(jt,A.x+b,A.y+b,A.w,A.h)}}),se.useEffect(()=>{E(!1)},[p]);const de=ma({height:i,width:i},S);let tt=null;return p!=null&&(tt=se.createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{E(!0)},ref:w,crossOrigin:A==null?void 0:A.crossOrigin})),se.createElement(se.Fragment,null,se.createElement("canvas",ma({style:de,height:i,width:i,ref:C,role:"img"},x)),tt)});Fv.displayName="QRCodeCanvas";var Mp=se.forwardRef(function(t,n){const r=t,{value:s,size:i=Np,level:o=Sp,bgColor:u=Cp,fgColor:a=kp,includeMargin:c=bp,minVersion:d=zp,boostLevel:f,title:h,marginSize:g,imageSettings:y}=r,j=xa(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:x,numCells:p,calculatedImageSettings:m}=Rp({value:s,level:o,minVersion:d,boostLevel:f,includeMargin:c,marginSize:g,imageSettings:y,size:i});let w=x,C=null;y!=null&&m!=null&&(m.excavation!=null&&(w=Pp(x,m.excavation)),C=se.createElement("image",{href:y.src,height:m.h,width:m.w,x:m.x+S,y:m.y+S,preserveAspectRatio:"none",opacity:m.opacity,crossOrigin:m.crossOrigin}));const k=Ep(w,S);return se.createElement("svg",ma({height:i,width:i,viewBox:`0 0 ${p} ${p}`,ref:n,role:"img"},j),!!h&&se.createElement("title",null,h),se.createElement("path",{fill:u,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),se.createElement("path",{fill:a,d:k,shapeRendering:"crispEdges"}),C)});Mp.displayName="QRCodeSVG";async function _v(){const e=await fetch("/api/users");if(!e.ok)throw new Error((await e.json()).error||"Failed to fetch users");return e.json()}async function Dv(e){const t=await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error((await t.json()).error||"Failed to create user");return t.json()}async function Iv({username:e,...t}){const n=await fetch(`/api/users/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error((await n.json()).error||"Failed to update user");return n.json()}async function Av(e){const t=await fetch(`/api/users/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw new Error((await t.json()).error||"Failed to delete user");return t.json()}async function Uv(e){const t=await fetch(`/api/users/${encodeURIComponent(e)}/reset-totp`,{method:"POST"});if(!t.ok)throw new Error((await t.json()).error||"Failed to reset TOTP");return t.json()}function ju({children:e,onClose:t}){return l.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-black/50",children:l.jsxs("div",{className:"relative max-h-[90vh] w-full max-w-lg overflow-y-auto rounded-lg bg-zinc-800 p-6 shadow-xl",onClick:n=>n.stopPropagation(),children:[l.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-zinc-500 hover:text-zinc-300",children:l.jsx(bl,{size:18})}),e]})})}function $v({totpUri:e,onClose:t}){const[n,r]=N.useState(!1),s=e.match(/secret=([A-Z2-7]+)/),i=s?s[1]:"",o=i.replace(/(.{4})/g,"$1 ").trim();function u(){navigator.clipboard.writeText(i).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})}return l.jsxs(ju,{onClose:t,children:[l.jsx("h2",{className:"mb-4 text-lg font-bold text-white",children:"Two-Factor Authentication Setup"}),l.jsx("p",{className:"mb-4 text-sm text-zinc-400",children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"}),l.jsx("div",{className:"mb-4 flex justify-center",children:l.jsx("div",{className:"rounded-lg bg-zinc-900 p-4",children:l.jsx(Mp,{value:e,size:200,bgColor:"transparent",fgColor:"#ffffff"})})}),l.jsx("p",{className:"mb-2 text-sm text-zinc-400",children:"Or enter this code manually:"}),l.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-3",children:[l.jsx("code",{className:"flex-1 font-mono text-sm text-cyan-400 tracking-wider",children:o}),l.jsx("button",{type:"button",onClick:u,className:"text-zinc-500 hover:text-zinc-300",title:"Copy secret",children:n?l.jsx(ep,{size:16,className:"text-green-400"}):l.jsx(Cl,{size:16})})]}),l.jsx("p",{className:"mb-6 text-xs text-yellow-400",children:"This code will only be shown once. Make sure the user scans it before closing."}),l.jsx("button",{type:"button",onClick:t,className:"w-full rounded-lg bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500",children:"Done"})]})}function rd({user:e,onClose:t,onSuccess:n}){var p;const r=!!e,s=dt(),i=Oe(),[o,u]=N.useState({username:(e==null?void 0:e.username)||"",displayname:(e==null?void 0:e.displayname)||"",email:(e==null?void 0:e.email)||"",password:"",groups:((p=e==null?void 0:e.groups)==null?void 0:p.join(", "))||""}),[a,c]=N.useState(!1),[d,f]=N.useState(""),h=Ce({mutationFn:Dv,onSuccess:()=>i.invalidateQueries({queryKey:["users"]})}),g=Ce({mutationFn:Iv,onSuccess:()=>i.invalidateQueries({queryKey:["users"]})}),y=r?g:h;function j(m,w){u(C=>({...C,[m]:w})),f("")}async function S(m){if(m.preventDefault(),f(""),!r){if(!o.username||!o.displayname||!o.email||!o.password){f("All required fields must be filled");return}if(!/^[a-z0-9_-]+$/.test(o.username)){f("Username must contain only lowercase alphanumeric characters, underscores, and hyphens");return}if(o.username.length<2){f("Username must be at least 2 characters");return}if(o.password.length<8){f("Password must be at least 8 characters");return}}if(r&&o.password&&o.password.length<8){f("Password must be at least 8 characters");return}const w=o.groups.split(",").map(C=>C.trim()).filter(Boolean);try{if(r){const C={username:e.username};o.displayname!==e.displayname&&(C.displayname=o.displayname),o.email!==e.email&&(C.email=o.email),o.password&&(C.password=o.password);const k=(e.groups||[]).join(", ");if(o.groups!==k&&(C.groups=w),Object.keys(C).length<=1){f("No changes detected");return}await y.mutateAsync(C),s("User updated successfully"),t()}else{const C=await y.mutateAsync({username:o.username,displayname:o.displayname,email:o.email,password:o.password,groups:w});s("User created successfully"),n(C.user.username)}}catch(C){f(C.message)}}const x=y.isPending;return l.jsxs(ju,{onClose:t,children:[l.jsx("h2",{className:"mb-4 text-lg font-bold text-white",children:r?"Edit User":"Add User"}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-sm text-zinc-400",children:"Username"}),l.jsx("input",{type:"text",value:o.username,onChange:m=>j("username",m.target.value),disabled:r,placeholder:"johndoe",className:"w-full rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm text-white placeholder-zinc-600 focus:border-cyan-500 focus:outline-none disabled:text-zinc-500"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-sm text-zinc-400",children:"Display Name"}),l.jsx("input",{type:"text",value:o.displayname,onChange:m=>j("displayname",m.target.value),placeholder:"John Doe",className:"w-full rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm text-white placeholder-zinc-600 focus:border-cyan-500 focus:outline-none"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-sm text-zinc-400",children:"Email"}),l.jsx("input",{type:"email",value:o.email,onChange:m=>j("email",m.target.value),placeholder:"john@example.com",className:"w-full rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm text-white placeholder-zinc-600 focus:border-cyan-500 focus:outline-none"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"mb-1 block text-sm text-zinc-400",children:["Password",r?" (leave blank to keep current)":""]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:a?"text":"password",value:o.password,onChange:m=>j("password",m.target.value),placeholder:r?"Leave blank to keep current password":"Minimum 8 characters",className:"w-full rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 pr-10 text-sm text-white placeholder-zinc-600 focus:border-cyan-500 focus:outline-none"}),l.jsx("button",{type:"button",onClick:()=>c(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-500 hover:text-zinc-300",children:a?l.jsx(lp,{size:16}):l.jsx(op,{size:16})})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"mb-1 block text-sm text-zinc-400",children:"Groups (comma-separated)"}),l.jsx("input",{type:"text",value:o.groups,onChange:m=>j("groups",m.target.value),placeholder:"admins, users",className:"w-full rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm text-white placeholder-zinc-600 focus:border-cyan-500 focus:outline-none"})]}),d&&l.jsx("p",{className:"text-sm text-red-400",children:d}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx("button",{type:"button",onClick:t,className:"flex-1 rounded-lg border border-zinc-700 px-4 py-2 text-sm text-zinc-400 hover:text-white",children:"Cancel"}),l.jsx("button",{type:"submit",disabled:x,className:"flex-1 rounded-lg bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500 disabled:opacity-50",children:x?"Saving...":r?"Save Changes":"Create User"})]})]})]})}function sd({title:e,message:t,confirmLabel:n,destructive:r,onConfirm:s,onCancel:i,isPending:o}){return l.jsxs(ju,{onClose:i,children:[l.jsx("h2",{className:"mb-2 text-lg font-bold text-white",children:e}),l.jsx("p",{className:"mb-6 text-sm text-zinc-400",children:t}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{type:"button",onClick:i,className:"flex-1 rounded-lg border border-zinc-700 px-4 py-2 text-sm text-zinc-400 hover:text-white",children:"Cancel"}),l.jsx("button",{type:"button",onClick:s,disabled:o,className:`flex-1 rounded-lg px-4 py-2 text-sm font-semibold text-white disabled:opacity-50 ${r?"bg-red-600 hover:bg-red-500":"bg-cyan-600 hover:bg-cyan-500"}`,children:o?"Please wait...":n})]})]})}function Qv(){var C;const e=dt(),t=Oe(),[n,r]=N.useState(!1),[s,i]=N.useState(null),[o,u]=N.useState(null),[a,c]=N.useState(null),[d,f]=N.useState(null),h=wt({queryKey:["users"],queryFn:_v}),g=Ce({mutationFn:Av,onSuccess:()=>{t.invalidateQueries({queryKey:["users"]}),e("User deleted successfully"),u(null)},onError:k=>{e(k.message,"error"),u(null)}}),y=Ce({mutationFn:Uv,onSuccess:k=>{f(null),c(k.totpUri)},onError:k=>{e(k.message,"error"),f(null)}}),j=((C=h.data)==null?void 0:C.users)||[],S=j.length<=1;async function x(k){r(!1);try{const E=await y.mutateAsync(k);c(E.totpUri)}catch{}}function p(k){f(k)}function m(){d&&y.mutate(d)}function w(){c(null)}return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-bold text-white",children:"Users"}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1",children:"Manage Authelia users and two-factor authentication."})]}),l.jsxs("button",{type:"button",onClick:()=>r(!0),className:"flex items-center gap-2 rounded-lg bg-cyan-600 px-4 py-2 text-sm font-semibold text-white hover:bg-cyan-500",children:[l.jsx(Ng,{size:16}),"Add User"]})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800 bg-zinc-900",children:h.isLoading?l.jsx("div",{className:"p-8 text-center",children:l.jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-zinc-600 border-t-cyan-400"})}):h.isError?l.jsx("div",{className:"p-8 text-center text-red-400 text-sm",children:"Failed to load users"}):j.length===0?l.jsx("div",{className:"p-8 text-center text-zinc-500 text-sm",children:"No users configured. Add your first user to get started."}):l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-700",children:[l.jsx("th",{className:"px-4 py-3 text-xs font-semibold uppercase text-zinc-400",children:"Username"}),l.jsx("th",{className:"px-4 py-3 text-xs font-semibold uppercase text-zinc-400",children:"Display Name"}),l.jsx("th",{className:"px-4 py-3 text-xs font-semibold uppercase text-zinc-400 hidden sm:table-cell",children:"Email"}),l.jsx("th",{className:"px-4 py-3 text-xs font-semibold uppercase text-zinc-400 hidden md:table-cell",children:"Groups"}),l.jsx("th",{className:"px-4 py-3 text-xs font-semibold uppercase text-zinc-400 text-right",children:"Actions"})]})}),l.jsx("tbody",{children:j.map(k=>l.jsxs("tr",{className:"border-b border-zinc-700 last:border-b-0",children:[l.jsx("td",{className:"px-4 py-3 font-mono text-sm text-cyan-400",children:k.username}),l.jsx("td",{className:"px-4 py-3 text-sm text-zinc-300",children:k.displayname}),l.jsx("td",{className:"px-4 py-3 text-sm text-zinc-400 hidden sm:table-cell",children:k.email}),l.jsx("td",{className:"px-4 py-3 hidden md:table-cell",children:l.jsx("div",{className:"flex flex-wrap gap-1",children:(k.groups||[]).map(E=>l.jsx("span",{className:"rounded bg-zinc-700 px-2 py-0.5 text-xs text-zinc-300",children:E},E))})}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[l.jsx("button",{type:"button",onClick:()=>i(k),className:"rounded p-1.5 text-zinc-500 hover:bg-zinc-700 hover:text-zinc-300",title:"Edit user",children:l.jsx(yg,{size:14})}),l.jsx("button",{type:"button",onClick:()=>p(k.username),className:"rounded p-1.5 text-zinc-500 hover:bg-zinc-700 hover:text-zinc-300",title:"Reset TOTP",children:l.jsx(hg,{size:14})}),l.jsx("button",{type:"button",onClick:()=>!S&&u(k.username),disabled:S,className:"rounded p-1.5 text-zinc-500 hover:bg-zinc-700 hover:text-red-400 disabled:cursor-not-allowed disabled:opacity-30",title:S?"Cannot delete the last user":"Delete user",children:l.jsx(qr,{size:14})})]})})]},k.username))})]})}),n&&l.jsx(rd,{onClose:()=>r(!1),onSuccess:x}),s&&l.jsx(rd,{user:s,onClose:()=>i(null)}),o&&l.jsx(sd,{title:"Delete User",message:`Are you sure you want to delete user '${o}'? This action cannot be undone.`,confirmLabel:"Delete",destructive:!0,onConfirm:()=>g.mutate(o),onCancel:()=>u(null),isPending:g.isPending}),d&&!a&&l.jsx(sd,{title:"Reset TOTP",message:`This will invalidate the current TOTP secret for '${d}'. They will need to re-enroll their authenticator app.`,confirmLabel:"Reset TOTP",onConfirm:m,onCancel:()=>f(null),isPending:y.isPending}),a&&l.jsx($v,{totpUri:a,onClose:w})]})}async function Bv(){const e=await fetch("/api/certs");if(!e.ok)throw new Error("Failed to fetch certificates");return e.json()}async function Vv(){const e=await fetch("/api/certs/auto-renew-status");if(!e.ok)throw new Error("Failed to fetch auto-renew status");return e.json()}async function Hv(e){const t=await fetch(`/api/certs/${e}/renew`,{method:"POST"}),n=await t.json();if(!t.ok)throw new Error(n.details||n.error||"Renewal failed");return n}async function qv(){const e=await fetch("/api/certs/mtls/rotate",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error||"Rotation failed");return t}function ya({type:e}){const t={letsencrypt:"bg-blue-500/20 text-blue-400","mtls-ca":"bg-purple-500/20 text-purple-400","mtls-client":"bg-purple-500/20 text-purple-400"},n={letsencrypt:"Let's Encrypt","mtls-ca":"mTLS CA","mtls-client":"mTLS Client"};return l.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${t[e]||"bg-zinc-500/20 text-zinc-400"}`,children:n[e]||e})}function ga({days:e}){let t="text-green-400",n="bg-green-400";return e<=7?(t="text-red-400",n="bg-red-400"):e<=30&&(t="text-amber-400",n="bg-amber-400"),l.jsxs("span",{className:`flex items-center gap-1.5 ${t}`,children:[l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${n}`}),e,"d"]})}function Ur(e){if(!e)return"N/A";try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return e}}function Wv({data:e,isLoading:t}){return t?l.jsxs("div",{className:"mb-4 flex items-center gap-2 text-sm text-zinc-500",children:[l.jsx(Re,{size:14,className:"animate-spin"}),"Checking auto-renewal status..."]}):e?e.active?l.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-zinc-400",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-green-400"}),"Auto-renewal active"]}),e.nextRun&&l.jsxs("span",{children:["Next run: ",Ur(e.nextRun)]}),e.lastRun&&l.jsxs("span",{children:["Last renewed: ",Ur(e.lastRun)]})]}):l.jsxs("div",{className:"mb-4 flex items-center gap-1.5 text-sm text-amber-400",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"}),"Auto-renewal is not active. Certificates may expire."]}):null}function Kv({certs:e,onRenew:t,renewingDomain:n}){const r=e.filter(s=>s.type==="letsencrypt");return r.length===0?l.jsx("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6",children:l.jsx("p",{className:"text-zinc-500 text-sm text-center",children:"No Let's Encrypt certificates found."})}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-700 bg-zinc-900",children:[l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Type"}),l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Domain"}),l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Expiry Date"}),l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Days Remaining"}),l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase text-zinc-400",children:"Actions"})]})}),l.jsx("tbody",{children:r.map(s=>l.jsxs("tr",{className:"border-b border-zinc-700 bg-zinc-800",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx(ya,{type:s.type})}),l.jsx("td",{className:"px-4 py-3 text-zinc-300 font-mono text-xs",children:s.domain||"N/A"}),l.jsx("td",{className:"px-4 py-3 text-zinc-400",children:Ur(s.expiresAt)}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ga,{days:s.daysUntilExpiry})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("button",{type:"button",disabled:!!n,onClick:()=>t(s.domain),className:"flex items-center gap-1.5 rounded bg-zinc-700 px-3 py-1.5 text-xs text-zinc-300 hover:bg-zinc-600 disabled:opacity-50 disabled:cursor-not-allowed",children:n===s.domain?l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:12,className:"animate-spin"}),"Renewing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(cp,{size:12}),"Renew"]})})})]},s.domain||s.path))})]})})}function Gv({certs:e,onRotate:t}){const n=e.find(s=>s.type==="mtls-ca"),r=e.find(s=>s.type==="mtls-client");return!n&&!r?null:l.jsx("div",{className:"mt-8",children:l.jsxs("div",{className:"border-t border-zinc-700 pt-6",children:[l.jsxs("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[l.jsx(kl,{size:18,className:"text-purple-400"}),"mTLS Certificates"]}),l.jsxs("div",{className:"space-y-4",children:[n&&l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-5",children:[l.jsx("div",{className:"flex items-center justify-between",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(ya,{type:"mtls-ca"}),l.jsx("span",{className:"text-white font-semibold text-sm",children:"Certificate Authority"})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm text-zinc-400 mt-2",children:[l.jsxs("span",{children:["Expires: ",Ur(n.expiresAt)]}),l.jsx(ga,{days:n.daysUntilExpiry})]})]})}),l.jsx("p",{className:"text-xs text-zinc-500 mt-3",children:"The CA certificate cannot be rotated. It was created during initial setup."})]}),r&&l.jsx("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-5",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(ya,{type:"mtls-client"}),l.jsx("span",{className:"text-white font-semibold text-sm",children:"Client Certificate"})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm text-zinc-400 mt-2",children:[l.jsxs("span",{children:["Expires: ",Ur(r.expiresAt)]}),l.jsx(ga,{days:r.daysUntilExpiry})]})]}),l.jsxs("button",{type:"button",onClick:t,className:"flex items-center gap-1.5 rounded bg-amber-600 px-3 py-1.5 text-xs text-white hover:bg-amber-500",children:[l.jsx(cp,{size:12}),"Rotate"]})]})})]})]})})}function Yv({onClose:e}){const t=Oe(),n=dt(),[r,s]=N.useState("warning"),[i,o]=N.useState(null),[u,a]=N.useState(null),[c,d]=N.useState(!1),[f,h]=N.useState(!1),[g,y]=N.useState(!1),j=Ce({mutationFn:qv,onSuccess:w=>{o(w),s("success"),t.invalidateQueries({queryKey:["certs"]})},onError:w=>{a(w.message),s("error")}}),S=N.useCallback(()=>{s("rotating"),j.mutate()},[j]),x=N.useCallback(async()=>{if(i!=null&&i.p12Password)try{await navigator.clipboard.writeText(i.p12Password),d(!0),setTimeout(()=>d(!1),2e3)}catch{n("Failed to copy — please select and copy manually","error")}},[i,n]),p=N.useCallback(()=>{window.open("/api/certs/mtls/download","_blank")},[]),m=N.useCallback(()=>{if(!g){y(!0);return}e()},[g,e]);return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",children:l.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-zinc-900 border border-zinc-800 shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-zinc-800 px-6 py-4",children:[l.jsxs("h3",{className:"flex items-center gap-2 text-lg font-semibold text-white",children:[r==="warning"&&l.jsxs(l.Fragment,{children:[l.jsx(Fs,{size:20,className:"text-amber-400"}),"Rotate Client Certificate"]}),r==="rotating"&&l.jsxs(l.Fragment,{children:[l.jsx(Re,{size:20,className:"animate-spin text-cyan-400"}),"Generating New Certificate..."]}),r==="success"&&l.jsxs(l.Fragment,{children:[l.jsx(kl,{size:20,className:"text-green-400"}),"New Certificate Ready"]}),r==="error"&&l.jsxs(l.Fragment,{children:[l.jsx(Fs,{size:20,className:"text-red-400"}),"Rotation Failed"]})]}),(r==="warning"||r==="error")&&l.jsx("button",{type:"button",onClick:e,className:"text-zinc-500 hover:text-zinc-300",children:l.jsx(bl,{size:18})})]}),l.jsxs("div",{className:"px-6 py-5",children:[r==="warning"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg bg-amber-500/10 border border-amber-500/20 p-4 text-sm text-amber-400 space-y-2",children:[l.jsx("p",{className:"font-semibold",children:"This will immediately invalidate your current browser certificate."}),l.jsxs("p",{children:["You ",l.jsx("strong",{children:"MUST"})," download and import the new certificate before closing this page or your browser."]}),l.jsx("p",{children:"If you fail to do this, you will be locked out of the panel and will need SSH access to recover."})]}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:e,autoFocus:!0,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600",children:"Cancel"}),l.jsx("button",{type:"button",onClick:S,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-500",children:"I Understand, Rotate"})]})]}),r==="rotating"&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("p",{className:"text-zinc-400 text-sm",children:"Generating new certificate..."})}),r==="success"&&i&&l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-zinc-300 block mb-2",children:"Certificate Password (copy this first):"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 rounded border border-zinc-700 bg-zinc-950 p-3 font-mono text-cyan-400 text-sm break-all select-all",children:i.p12Password}),l.jsx("button",{type:"button",onClick:x,className:"rounded bg-zinc-700 p-2 text-zinc-300 hover:bg-zinc-600 shrink-0",title:"Copy password",children:c?l.jsx(ep,{size:16,className:"text-green-400"}):l.jsx(Cl,{size:16})})]})]}),l.jsxs("button",{type:"button",onClick:p,className:"flex w-full items-center justify-center gap-2 rounded bg-cyan-600 py-3 px-6 text-sm font-semibold text-white hover:bg-cyan-500",children:[l.jsx(ip,{size:16}),"Download Certificate"]}),l.jsxs("ol",{className:"list-decimal list-inside text-sm text-zinc-400 space-y-1.5 pl-1",children:[l.jsx("li",{children:"Copy the password above"}),l.jsx("li",{children:"Click Download Certificate"}),l.jsx("li",{children:"Double-click the downloaded file to import it into your browser's keychain"}),l.jsx("li",{children:"Enter the password when prompted"}),l.jsx("li",{children:"Restart your browser to use the new certificate"})]}),l.jsxs("div",{className:"border-t border-zinc-700 pt-4",children:[l.jsxs("button",{type:"button",onClick:()=>h(w=>!w),className:"flex items-center gap-1.5 text-xs text-zinc-500 hover:text-zinc-400",children:[f?l.jsx(rg,{size:14}):l.jsx(tp,{size:14}),"Recovery instructions (if locked out)"]}),f&&l.jsxs("div",{className:"mt-3 rounded border border-zinc-700 bg-zinc-950 p-3",children:[l.jsx("p",{className:"text-xs text-zinc-400 mb-2",children:"If you get locked out, connect via SSH and run these commands to restore the backup:"}),l.jsx("pre",{className:"text-xs text-zinc-300 font-mono whitespace-pre-wrap",children:`sudo cp /etc/portlama/pki/client.crt.bak /etc/portlama/pki/client.crt
|
|
321
|
+
sudo cp /etc/portlama/pki/client.key.bak /etc/portlama/pki/client.key
|
|
322
|
+
sudo cp /etc/portlama/pki/client.p12.bak /etc/portlama/pki/client.p12
|
|
323
|
+
sudo systemctl reload nginx`})]})]}),l.jsx("div",{className:"flex justify-end",children:g?l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-sm text-zinc-400",children:"Have you downloaded and imported the new certificate?"}),l.jsx("button",{type:"button",onClick:m,className:"rounded bg-green-600 px-4 py-2 text-sm text-white hover:bg-green-500",children:"Yes, Done"}),l.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600",children:"Not yet"})]}):l.jsx("button",{type:"button",onClick:m,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600",children:"Done"})})]}),r==="error"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg bg-red-500/10 border border-red-500/20 p-4 text-sm text-red-400",children:[l.jsx("p",{className:"font-semibold mb-1",children:"Rotation failed"}),l.jsx("p",{children:u}),l.jsx("p",{className:"mt-2 text-zinc-400",children:"Your existing certificate is still valid."})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx("button",{type:"button",onClick:e,className:"rounded bg-zinc-700 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-600",children:"Close"})})]})]})]})})}function Xv(){var f;const e=Oe(),t=dt(),[n,r]=N.useState(null),[s,i]=N.useState(!1),o=wt({queryKey:["certs"],queryFn:Bv,refetchInterval:3e4}),u=wt({queryKey:["auto-renew-status"],queryFn:Vv}),a=Ce({mutationFn:Hv,onSuccess:h=>{e.invalidateQueries({queryKey:["certs"]});const g=h.newExpiry?` New expiry: ${Ur(h.newExpiry)}`:"";t(`Certificate for ${h.domain} renewed.${g}`),h.warning&&t(h.warning,"error"),r(null)},onError:h=>{t(h.message,"error"),r(null)}}),c=N.useCallback(h=>{r(h),a.mutate(h)},[a]),d=((f=o.data)==null?void 0:f.certs)||[];return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6",children:[l.jsx("h1",{className:"text-xl font-bold text-white",children:"Certificates"}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1",children:"View and manage TLS and mTLS certificates"})]}),l.jsx(Wv,{data:u.data,isLoading:u.isLoading}),o.isLoading?l.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((h,g)=>l.jsx("div",{className:"h-14 animate-pulse rounded-lg bg-zinc-900 border border-zinc-800"},g))}):o.isError?l.jsx("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6",children:l.jsx("p",{className:"text-red-400 text-sm",children:"Failed to load certificates"})}):l.jsxs(l.Fragment,{children:[l.jsx(Kv,{certs:d,onRenew:c,renewingDomain:n}),l.jsx(Gv,{certs:d,onRotate:()=>i(!0)})]}),s&&l.jsx(Yv,{onClose:()=>i(!1)})]})}async function Zv(){const e=await fetch("/api/services");if(!e.ok)throw new Error("Failed to fetch services");return e.json()}async function Jv({name:e,action:t}){const n=await fetch(`/api/services/${e}/${t}`,{method:"POST"}),r=await n.json();if(!n.ok)throw new Error(r.error||`Failed to ${t} ${e}`);return r}function e1({status:e}){const t=e==="active"?"bg-green-500/20 text-green-400":e==="failed"?"bg-red-500/20 text-red-400":"bg-zinc-500/20 text-zinc-400",n=e==="active"?"Active":e==="failed"?"Failed":e==="inactive"?"Inactive":"Unknown";return l.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${t}`,children:n})}function t1({service:e,onAction:t,isActing:n}){const[r,s]=N.useState(!1),i=e.name==="portlama-panel",o=()=>{if(!i){if(!r){s(!0);return}s(!1),t(e.name,"stop")}},u=()=>s(!1);return l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(dp,{size:16,className:"text-cyan-400"}),l.jsx("span",{className:"text-white font-semibold",children:e.name})]}),l.jsx(e1,{status:e.status})]}),l.jsx("p",{className:"text-zinc-400 text-sm mb-4",children:e.status==="active"&&e.uptime?`Uptime: ${e.uptime}`:"—"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",disabled:n,onClick:()=>t(e.name,"start"),className:"flex items-center gap-1.5 rounded bg-zinc-700 px-3 py-1.5 text-xs text-zinc-300 hover:bg-zinc-600 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(gg,{size:12}),"Start"]}),r?l.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[l.jsx("span",{className:"text-zinc-400",children:"Stop?"}),l.jsx("button",{type:"button",onClick:o,className:"rounded bg-red-600 px-2 py-1 text-white hover:bg-red-500",children:"Yes"}),l.jsx("button",{type:"button",onClick:u,className:"rounded bg-zinc-700 px-2 py-1 text-zinc-300 hover:bg-zinc-600",children:"No"})]}):l.jsxs("button",{type:"button",disabled:n||i,onClick:o,title:i?"Cannot stop panel service":"Stop service",className:"flex items-center gap-1.5 rounded bg-zinc-700 px-3 py-1.5 text-xs text-zinc-300 hover:bg-zinc-600 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(wg,{size:12}),"Stop"]}),l.jsxs("button",{type:"button",disabled:n,onClick:()=>t(e.name,"restart"),className:"flex items-center gap-1.5 rounded bg-zinc-700 px-3 py-1.5 text-xs text-zinc-300 hover:bg-zinc-600 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(vg,{size:12}),"Restart"]})]})]})}const id=1e3;function n1({services:e}){const[t,n]=N.useState(""),[r,s]=N.useState([]),[i,o]=N.useState(null),u=N.useRef(null),a=N.useRef(null),c=N.useCallback(f=>{n(f.target.value),s([]),o(null)},[]);N.useEffect(()=>{const f=u.current;f&&(f.scrollTop=f.scrollHeight)},[r]),N.useEffect(()=>{if(a.current&&(a.current.close(),a.current=null),!t)return;const f=window.location.protocol==="https:"?"wss:":"ws:",h=new WebSocket(`${f}//${window.location.host}/api/services/${t}/logs`);return a.current=h,h.onmessage=g=>{try{const y=JSON.parse(g.data);s(j=>{const S=[...j,y];return S.length>id?S.slice(-id):S})}catch{}},h.onerror=()=>{o("Connection lost")},h.onclose=()=>{a.current=null},()=>{h.close()}},[t]);const d=(e==null?void 0:e.map(f=>f.name))||[];return l.jsxs("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-5",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-300 mb-4",children:"Service Logs"}),l.jsxs("select",{value:t,onChange:c,className:"mb-4 rounded bg-zinc-800 border border-zinc-700 px-3 py-1.5 text-sm text-zinc-300 focus:outline-none focus:border-cyan-400",children:[l.jsx("option",{value:"",children:"Select a service..."}),d.map(f=>l.jsx("option",{value:f,children:f},f))]}),l.jsx("div",{ref:u,className:"h-96 overflow-y-auto rounded-lg border border-zinc-800 bg-zinc-950 p-4 font-mono text-sm",children:t?i?l.jsx("p",{className:"text-red-400",children:i}):r.length===0?l.jsx("p",{className:"text-zinc-500 text-center mt-36",children:"Waiting for log data..."}):r.map((f,h)=>l.jsxs("div",{className:"leading-relaxed",children:[f.timestamp&&l.jsxs("span",{className:"text-zinc-500",children:[f.timestamp," "]}),l.jsx("span",{className:"text-zinc-300",children:f.message})]},h)):l.jsx("p",{className:"text-zinc-500 text-center mt-36",children:"Select a service to view its logs"})})]})}function r1(){var o;const e=Oe(),t=dt(),n=wt({queryKey:["services"],queryFn:Zv,refetchInterval:5e3}),r=Ce({mutationFn:Jv,onSuccess:u=>{e.invalidateQueries({queryKey:["services"]}),t(`${u.name} ${u.action}ed successfully`)},onError:u=>{t(u.message,"error")}}),s=N.useCallback((u,a)=>{r.mutate({name:u,action:a})},[r]),i=(o=n.data)==null?void 0:o.services;return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[l.jsxs("div",{className:"mb-6",children:[l.jsx("h1",{className:"text-xl font-bold text-white",children:"Services"}),l.jsx("p",{className:"text-zinc-500 text-sm mt-1",children:"Manage system services and view live logs"})]}),n.isLoading?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:Array.from({length:4}).map((u,a)=>l.jsx("div",{className:"h-40 animate-pulse rounded-lg bg-zinc-900 border border-zinc-800"},a))}):n.isError?l.jsx("div",{className:"rounded-lg bg-zinc-900 border border-zinc-800 p-6 mb-8",children:l.jsx("p",{className:"text-red-400 text-sm",children:"Failed to load services"})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:i==null?void 0:i.map(u=>l.jsx(t1,{service:u,onAction:s,isActing:r.isPending},u.name))}),l.jsx(n1,{services:i})]})}const s1=new Ay({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function i1(){const{status:e,isLoading:t,isError:n,refetch:r}=Sl();return t?l.jsx(hp,{}):n?l.jsx(pp,{onRetry:r}):e!=="COMPLETED"?l.jsx(Vg,{}):l.jsx(ey,{children:l.jsxs(Ut,{element:l.jsx(Pg,{}),children:[l.jsx(Ut,{path:"/",element:l.jsx(Gg,{})}),l.jsx(Ut,{path:"/tunnels",element:l.jsx(ov,{})}),l.jsx(Ut,{path:"/sites",element:l.jsx(bv,{})}),l.jsx(Ut,{path:"/users",element:l.jsx(Qv,{})}),l.jsx(Ut,{path:"/certificates",element:l.jsx(Xv,{})}),l.jsx(Ut,{path:"/services",element:l.jsx(r1,{})})]})})}function l1(){return l.jsx(Uy,{client:s1,children:l.jsx(kg,{children:l.jsx(ay,{children:l.jsx(i1,{})})})})}no.createRoot(document.getElementById("root")).render(l.jsx(se.StrictMode,{children:l.jsx(l1,{})}));
|