@brewnet/cli 0.0.7 → 0.0.8

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.
@@ -0,0 +1,215 @@
1
+ function Mc(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(r,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>r[l]})}}}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 l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uc={exports:{}},Wo={},Oc={exports:{}},te={};/**
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 kl=Symbol.for("react.element"),Op=Symbol.for("react.portal"),Bp=Symbol.for("react.fragment"),$p=Symbol.for("react.strict_mode"),Wp=Symbol.for("react.profiler"),Hp=Symbol.for("react.provider"),Vp=Symbol.for("react.context"),Kp=Symbol.for("react.forward_ref"),Gp=Symbol.for("react.suspense"),Qp=Symbol.for("react.memo"),Zp=Symbol.for("react.lazy"),tu=Symbol.iterator;function Yp(e){return e===null||typeof e!="object"?null:(e=tu&&e[tu]||e["@@iterator"],typeof e=="function"?e:null)}var Bc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$c=Object.assign,Wc={};function jr(e,t,n){this.props=e,this.context=t,this.refs=Wc,this.updater=n||Bc}jr.prototype.isReactComponent={};jr.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")};jr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hc(){}Hc.prototype=jr.prototype;function Ha(e,t,n){this.props=e,this.context=t,this.refs=Wc,this.updater=n||Bc}var Va=Ha.prototype=new Hc;Va.constructor=Ha;$c(Va,jr.prototype);Va.isPureReactComponent=!0;var nu=Array.isArray,Vc=Object.prototype.hasOwnProperty,Ka={current:null},Kc={key:!0,ref:!0,__self:!0,__source:!0};function Gc(e,t,n){var r,l={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Vc.call(t,r)&&!Kc.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)l[r]===void 0&&(l[r]=s[r]);return{$$typeof:kl,type:e,key:o,ref:a,props:l,_owner:Ka.current}}function Xp(e,t){return{$$typeof:kl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ga(e){return typeof e=="object"&&e!==null&&e.$$typeof===kl}function Jp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ru=/\/+/g;function hi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Jp(""+e.key):t.toString(36)}function eo(e,t,n,r,l){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case kl:case Op:a=!0}}if(a)return a=e,l=l(a),e=r===""?"."+hi(a,0):r,nu(l)?(n="",e!=null&&(n=e.replace(ru,"$&/")+"/"),eo(l,t,n,"",function(c){return c})):l!=null&&(Ga(l)&&(l=Xp(l,n+(!l.key||a&&a.key===l.key?"":(""+l.key).replace(ru,"$&/")+"/")+e)),t.push(l)),1;if(a=0,r=r===""?".":r+":",nu(e))for(var s=0;s<e.length;s++){o=e[s];var u=r+hi(o,s);a+=eo(o,t,n,u,l)}else if(u=Yp(e),typeof u=="function")for(e=u.call(e),s=0;!(o=e.next()).done;)o=o.value,u=r+hi(o,s++),a+=eo(o,t,n,u,l);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Fl(e,t,n){if(e==null)return e;var r=[],l=0;return eo(e,r,"","",function(o){return t.call(n,o,l++)}),r}function qp(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 Ge={current:null},to={transition:null},eh={ReactCurrentDispatcher:Ge,ReactCurrentBatchConfig:to,ReactCurrentOwner:Ka};function Qc(){throw Error("act(...) is not supported in production builds of React.")}te.Children={map:Fl,forEach:function(e,t,n){Fl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fl(e,function(){t++}),t},toArray:function(e){return Fl(e,function(t){return t})||[]},only:function(e){if(!Ga(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};te.Component=jr;te.Fragment=Bp;te.Profiler=Wp;te.PureComponent=Ha;te.StrictMode=$p;te.Suspense=Gp;te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eh;te.act=Qc;te.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=$c({},e.props),l=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=Ka.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)Vc.call(t,u)&&!Kc.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&s!==void 0?s[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){s=Array(u);for(var c=0;c<u;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:kl,type:e.type,key:l,ref:o,props:r,_owner:a}};te.createContext=function(e){return e={$$typeof:Vp,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Hp,_context:e},e.Consumer=e};te.createElement=Gc;te.createFactory=function(e){var t=Gc.bind(null,e);return t.type=e,t};te.createRef=function(){return{current:null}};te.forwardRef=function(e){return{$$typeof:Kp,render:e}};te.isValidElement=Ga;te.lazy=function(e){return{$$typeof:Zp,_payload:{_status:-1,_result:e},_init:qp}};te.memo=function(e,t){return{$$typeof:Qp,type:e,compare:t===void 0?null:t}};te.startTransition=function(e){var t=to.transition;to.transition={};try{e()}finally{to.transition=t}};te.unstable_act=Qc;te.useCallback=function(e,t){return Ge.current.useCallback(e,t)};te.useContext=function(e){return Ge.current.useContext(e)};te.useDebugValue=function(){};te.useDeferredValue=function(e){return Ge.current.useDeferredValue(e)};te.useEffect=function(e,t){return Ge.current.useEffect(e,t)};te.useId=function(){return Ge.current.useId()};te.useImperativeHandle=function(e,t,n){return Ge.current.useImperativeHandle(e,t,n)};te.useInsertionEffect=function(e,t){return Ge.current.useInsertionEffect(e,t)};te.useLayoutEffect=function(e,t){return Ge.current.useLayoutEffect(e,t)};te.useMemo=function(e,t){return Ge.current.useMemo(e,t)};te.useReducer=function(e,t,n){return Ge.current.useReducer(e,t,n)};te.useRef=function(e){return Ge.current.useRef(e)};te.useState=function(e){return Ge.current.useState(e)};te.useSyncExternalStore=function(e,t,n){return Ge.current.useSyncExternalStore(e,t,n)};te.useTransition=function(){return Ge.current.useTransition()};te.version="18.3.1";Oc.exports=te;var m=Oc.exports;const th=Ac(m),nh=Mc({__proto__:null,default:th},[m]);/**
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 rh=m,lh=Symbol.for("react.element"),oh=Symbol.for("react.fragment"),ih=Object.prototype.hasOwnProperty,ah=rh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sh={key:!0,ref:!0,__self:!0,__source:!0};function Zc(e,t,n){var r,l={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)ih.call(t,r)&&!sh.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:lh,type:e,key:o,ref:a,props:l,_owner:ah.current}}Wo.Fragment=oh;Wo.jsx=Zc;Wo.jsxs=Zc;Uc.exports=Wo;var i=Uc.exports,Yc={exports:{}},it={},Xc={exports:{}},Jc={};/**
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(z,F){var W=z.length;z.push(F);e:for(;0<W;){var q=W-1>>>1,Z=z[q];if(0<l(Z,F))z[q]=F,z[W]=Z,W=q;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var F=z[0],W=z.pop();if(W!==F){z[0]=W;e:for(var q=0,Z=z.length,We=Z>>>1;q<We;){var ee=2*(q+1)-1,O=z[ee],ne=ee+1,se=z[ne];if(0>l(O,W))ne<Z&&0>l(se,O)?(z[q]=se,z[ne]=W,q=ne):(z[q]=O,z[ee]=W,q=ee);else if(ne<Z&&0>l(se,W))z[q]=se,z[ne]=W,q=ne;else break e}}return F}function l(z,F){var W=z.sortIndex-F.sortIndex;return W!==0?W:z.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var u=[],c=[],p=1,f=null,v=3,S=!1,j=!1,w=!1,D=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(z){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=z)r(c),F.sortIndex=F.expirationTime,t(u,F);else break;F=n(c)}}function b(z){if(w=!1,y(z),!j)if(n(u)!==null)j=!0,H(E);else{var F=n(c);F!==null&&fe(b,F.startTime-z)}}function E(z,F){j=!1,w&&(w=!1,g(k),k=-1),S=!0;var W=v;try{for(y(F),f=n(u);f!==null&&(!(f.expirationTime>F)||z&&!K());){var q=f.callback;if(typeof q=="function"){f.callback=null,v=f.priorityLevel;var Z=q(f.expirationTime<=F);F=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===n(u)&&r(u),y(F)}else r(u);f=n(u)}if(f!==null)var We=!0;else{var ee=n(c);ee!==null&&fe(b,ee.startTime-F),We=!1}return We}finally{f=null,v=W,S=!1}}var T=!1,h=null,k=-1,I=5,R=-1;function K(){return!(e.unstable_now()-R<I)}function L(){if(h!==null){var z=e.unstable_now();R=z;var F=!0;try{F=h(!0,z)}finally{F?Q():(T=!1,h=null)}}else T=!1}var Q;if(typeof d=="function")Q=function(){d(L)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,_e=le.port2;le.port1.onmessage=L,Q=function(){_e.postMessage(null)}}else Q=function(){D(L,0)};function H(z){h=z,T||(T=!0,Q())}function fe(z,F){k=D(function(){z(e.unstable_now())},F)}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(z){z.callback=null},e.unstable_continueExecution=function(){j||S||(j=!0,H(E))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var F=3;break;default:F=v}var W=v;v=F;try{return z()}finally{v=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,F){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var W=v;v=z;try{return F()}finally{v=W}},e.unstable_scheduleCallback=function(z,F,W){var q=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?q+W:q):W=q,z){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=W+Z,z={id:p++,callback:F,priorityLevel:z,startTime:W,expirationTime:Z,sortIndex:-1},W>q?(z.sortIndex=W,t(c,z),n(u)===null&&z===n(c)&&(w?(g(k),k=-1):w=!0,fe(b,W-q))):(z.sortIndex=Z,t(u,z),j||S||(j=!0,H(E))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var F=v;return function(){var W=v;v=F;try{return z.apply(this,arguments)}finally{v=W}}}})(Jc);Xc.exports=Jc;var uh=Xc.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 ch=m,ot=uh;function _(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 qc=new Set,ll={};function On(e,t){hr(e,t),hr(e+"Capture",t)}function hr(e,t){for(ll[e]=t,e=0;e<t.length;e++)qc.add(t[e])}var Mt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gi=Object.prototype.hasOwnProperty,dh=/^[: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]*$/,lu={},ou={};function fh(e){return Gi.call(ou,e)?!0:Gi.call(lu,e)?!1:dh.test(e)?ou[e]=!0:(lu[e]=!0,!1)}function ph(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 hh(e,t,n,r){if(t===null||typeof t>"u"||ph(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 Qe(e,t,n,r,l,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Qe(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){Ae[e]=new Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qa=/[\-:]([a-z])/g;function Za(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(Qa,Za);Ae[t]=new Qe(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(Qa,Za);Ae[t]=new Qe(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(Qa,Za);Ae[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ya(e,t,n,r){var l=Ae.hasOwnProperty(t)?Ae[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(hh(t,n,l,r)&&(n=null),r||l===null?fh(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var $t=ch.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ml=Symbol.for("react.element"),Yn=Symbol.for("react.portal"),Xn=Symbol.for("react.fragment"),Xa=Symbol.for("react.strict_mode"),Qi=Symbol.for("react.profiler"),ed=Symbol.for("react.provider"),td=Symbol.for("react.context"),Ja=Symbol.for("react.forward_ref"),Zi=Symbol.for("react.suspense"),Yi=Symbol.for("react.suspense_list"),qa=Symbol.for("react.memo"),Yt=Symbol.for("react.lazy"),nd=Symbol.for("react.offscreen"),iu=Symbol.iterator;function Dr(e){return e===null||typeof e!="object"?null:(e=iu&&e[iu]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,mi;function Wr(e){if(mi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mi=t&&t[1]||""}return`
34
+ `+mi+e}var vi=!1;function yi(e,t){if(!e||vi)return"";vi=!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 l=c.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),a=l.length-1,s=o.length-1;1<=a&&0<=s&&l[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(l[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||l[a]!==o[s]){var u=`
37
+ `+l[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{vi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wr(e):""}function mh(e){switch(e.tag){case 5:return Wr(e.type);case 16:return Wr("Lazy");case 13:return Wr("Suspense");case 19:return Wr("SuspenseList");case 0:case 2:case 15:return e=yi(e.type,!1),e;case 11:return e=yi(e.type.render,!1),e;case 1:return e=yi(e.type,!0),e;default:return""}}function Xi(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 Xn:return"Fragment";case Yn:return"Portal";case Qi:return"Profiler";case Xa:return"StrictMode";case Zi:return"Suspense";case Yi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case td:return(e.displayName||"Context")+".Consumer";case ed:return(e._context.displayName||"Context")+".Provider";case Ja:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qa:return t=e.displayName||null,t!==null?t:Xi(e.type)||"Memo";case Yt:t=e._payload,e=e._init;try{return Xi(e(t))}catch{}}return null}function vh(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 Xi(t);case 8:return t===Xa?"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 fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yh(e){var t=rd(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 l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Al(e){e._valueTracker||(e._valueTracker=yh(e))}function ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=rd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ho(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 Ji(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function au(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fn(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 od(e,t){t=t.checked,t!=null&&Ya(e,"checked",t,!1)}function qi(e,t){od(e,t);var n=fn(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")?ea(e,t.type,n):t.hasOwnProperty("defaultValue")&&ea(e,t.type,fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function su(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 ea(e,t,n){(t!=="number"||ho(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Hr=Array.isArray;function sr(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fn(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function ta(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return we({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function uu(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(_(92));if(Hr(n)){if(1<n.length)throw Error(_(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fn(n)}}function id(e,t){var n=fn(t.value),r=fn(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 cu(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 na(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 Ul,sd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ul=Ul||document.createElement("div"),Ul.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ul.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ol(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qr={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},gh=["Webkit","ms","Moz","O"];Object.keys(Qr).forEach(function(e){gh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qr[t]=Qr[e]})});function ud(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qr.hasOwnProperty(e)&&Qr[e]?(""+t).trim():t+"px"}function cd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ud(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var xh=we({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 ra(e,t){if(t){if(xh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function la(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 oa=null;function es(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ia=null,ur=null,cr=null;function du(e){if(e=El(e)){if(typeof ia!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Qo(t),ia(e.stateNode,e.type,t))}}function dd(e){ur?cr?cr.push(e):cr=[e]:ur=e}function fd(){if(ur){var e=ur,t=cr;if(cr=ur=null,du(e),t)for(e=0;e<t.length;e++)du(t[e])}}function pd(e,t){return e(t)}function hd(){}var gi=!1;function md(e,t,n){if(gi)return e(t,n);gi=!0;try{return pd(e,t,n)}finally{gi=!1,(ur!==null||cr!==null)&&(hd(),fd())}}function il(e,t){var n=e.stateNode;if(n===null)return null;var r=Qo(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(_(231,t,typeof n));return n}var aa=!1;if(Mt)try{var Pr={};Object.defineProperty(Pr,"passive",{get:function(){aa=!0}}),window.addEventListener("test",Pr,Pr),window.removeEventListener("test",Pr,Pr)}catch{aa=!1}function Sh(e,t,n,r,l,o,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var Zr=!1,mo=null,vo=!1,sa=null,wh={onError:function(e){Zr=!0,mo=e}};function jh(e,t,n,r,l,o,a,s,u){Zr=!1,mo=null,Sh.apply(wh,arguments)}function kh(e,t,n,r,l,o,a,s,u){if(jh.apply(this,arguments),Zr){if(Zr){var c=mo;Zr=!1,mo=null}else throw Error(_(198));vo||(vo=!0,sa=c)}}function Bn(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 vd(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 fu(e){if(Bn(e)!==e)throw Error(_(188))}function Ch(e){var t=e.alternate;if(!t){if(t=Bn(e),t===null)throw Error(_(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var o=l.alternate;if(o===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===o.child){for(o=l.child;o;){if(o===n)return fu(l),e;if(o===r)return fu(l),t;o=o.sibling}throw Error(_(188))}if(n.return!==r.return)n=l,r=o;else{for(var a=!1,s=l.child;s;){if(s===n){a=!0,n=l,r=o;break}if(s===r){a=!0,r=l,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=l;break}if(s===r){a=!0,r=o,n=l;break}s=s.sibling}if(!a)throw Error(_(189))}}if(n.alternate!==r)throw Error(_(190))}if(n.tag!==3)throw Error(_(188));return n.stateNode.current===n?e:t}function yd(e){return e=Ch(e),e!==null?gd(e):null}function gd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gd(e);if(t!==null)return t;e=e.sibling}return null}var xd=ot.unstable_scheduleCallback,pu=ot.unstable_cancelCallback,bh=ot.unstable_shouldYield,Eh=ot.unstable_requestPaint,be=ot.unstable_now,Nh=ot.unstable_getCurrentPriorityLevel,ts=ot.unstable_ImmediatePriority,Sd=ot.unstable_UserBlockingPriority,yo=ot.unstable_NormalPriority,zh=ot.unstable_LowPriority,wd=ot.unstable_IdlePriority,Ho=null,Nt=null;function Th(e){if(Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(Ho,e,void 0,(e.current.flags&128)===128)}catch{}}var xt=Math.clz32?Math.clz32:Ph,Rh=Math.log,Dh=Math.LN2;function Ph(e){return e>>>=0,e===0?32:31-(Rh(e)/Dh|0)|0}var Ol=64,Bl=4194304;function Vr(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 go(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~l;s!==0?r=Vr(s):(o&=a,o!==0&&(r=Vr(o)))}else a=n&~l,a!==0?r=Vr(a):o!==0&&(r=Vr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-xt(t),l=1<<n,r|=e[n],t&=~l;return r}function Lh(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 _h(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-xt(o),s=1<<a,u=l[a];u===-1?(!(s&n)||s&r)&&(l[a]=Lh(s,t)):u<=t&&(e.expiredLanes|=s),o&=~s}}function ua(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function jd(){var e=Ol;return Ol<<=1,!(Ol&4194240)&&(Ol=64),e}function xi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xt(t),e[t]=n}function Ih(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 l=31-xt(n),o=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~o}}function ns(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xt(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var de=0;function kd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Cd,rs,bd,Ed,Nd,ca=!1,$l=[],rn=null,ln=null,on=null,al=new Map,sl=new Map,Jt=[],Fh="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 hu(e,t){switch(e){case"focusin":case"focusout":rn=null;break;case"dragenter":case"dragleave":ln=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":sl.delete(t.pointerId)}}function Lr(e,t,n,r,l,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[l]},t!==null&&(t=El(t),t!==null&&rs(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Mh(e,t,n,r,l){switch(t){case"focusin":return rn=Lr(rn,e,t,n,r,l),!0;case"dragenter":return ln=Lr(ln,e,t,n,r,l),!0;case"mouseover":return on=Lr(on,e,t,n,r,l),!0;case"pointerover":var o=l.pointerId;return al.set(o,Lr(al.get(o)||null,e,t,n,r,l)),!0;case"gotpointercapture":return o=l.pointerId,sl.set(o,Lr(sl.get(o)||null,e,t,n,r,l)),!0}return!1}function zd(e){var t=Nn(e.target);if(t!==null){var n=Bn(t);if(n!==null){if(t=n.tag,t===13){if(t=vd(n),t!==null){e.blockedOn=t,Nd(e.priority,function(){bd(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 no(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=da(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);oa=r,n.target.dispatchEvent(r),oa=null}else return t=El(n),t!==null&&rs(t),e.blockedOn=n,!1;t.shift()}return!0}function mu(e,t,n){no(e)&&n.delete(t)}function Ah(){ca=!1,rn!==null&&no(rn)&&(rn=null),ln!==null&&no(ln)&&(ln=null),on!==null&&no(on)&&(on=null),al.forEach(mu),sl.forEach(mu)}function _r(e,t){e.blockedOn===t&&(e.blockedOn=null,ca||(ca=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,Ah)))}function ul(e){function t(l){return _r(l,e)}if(0<$l.length){_r($l[0],e);for(var n=1;n<$l.length;n++){var r=$l[n];r.blockedOn===e&&(r.blockedOn=null)}}for(rn!==null&&_r(rn,e),ln!==null&&_r(ln,e),on!==null&&_r(on,e),al.forEach(t),sl.forEach(t),n=0;n<Jt.length;n++)r=Jt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Jt.length&&(n=Jt[0],n.blockedOn===null);)zd(n),n.blockedOn===null&&Jt.shift()}var dr=$t.ReactCurrentBatchConfig,xo=!0;function Uh(e,t,n,r){var l=de,o=dr.transition;dr.transition=null;try{de=1,ls(e,t,n,r)}finally{de=l,dr.transition=o}}function Oh(e,t,n,r){var l=de,o=dr.transition;dr.transition=null;try{de=4,ls(e,t,n,r)}finally{de=l,dr.transition=o}}function ls(e,t,n,r){if(xo){var l=da(e,t,n,r);if(l===null)Ti(e,t,r,So,n),hu(e,r);else if(Mh(l,e,t,n,r))r.stopPropagation();else if(hu(e,r),t&4&&-1<Fh.indexOf(e)){for(;l!==null;){var o=El(l);if(o!==null&&Cd(o),o=da(e,t,n,r),o===null&&Ti(e,t,r,So,n),o===l)break;l=o}l!==null&&r.stopPropagation()}else Ti(e,t,r,null,n)}}var So=null;function da(e,t,n,r){if(So=null,e=es(r),e=Nn(e),e!==null)if(t=Bn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vd(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 So=e,null}function Td(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(Nh()){case ts:return 1;case Sd:return 4;case yo:case zh:return 16;case wd:return 536870912;default:return 16}default:return 16}}var en=null,os=null,ro=null;function Rd(){if(ro)return ro;var e,t=os,n=t.length,r,l="value"in en?en.value:en.textContent,o=l.length;for(e=0;e<n&&t[e]===l[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===l[o-r];r++);return ro=l.slice(e,1<r?1-r:void 0)}function lo(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 Wl(){return!0}function vu(){return!1}function at(e){function t(n,r,l,o,a){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Wl:vu,this.isPropagationStopped=vu,this}return we(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=Wl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),t}var kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},is=at(kr),bl=we({},kr,{view:0,detail:0}),Bh=at(bl),Si,wi,Ir,Vo=we({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:as,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!==Ir&&(Ir&&e.type==="mousemove"?(Si=e.screenX-Ir.screenX,wi=e.screenY-Ir.screenY):wi=Si=0,Ir=e),Si)},movementY:function(e){return"movementY"in e?e.movementY:wi}}),yu=at(Vo),$h=we({},Vo,{dataTransfer:0}),Wh=at($h),Hh=we({},bl,{relatedTarget:0}),ji=at(Hh),Vh=we({},kr,{animationName:0,elapsedTime:0,pseudoElement:0}),Kh=at(Vh),Gh=we({},kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qh=at(Gh),Zh=we({},kr,{data:0}),gu=at(Zh),Yh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xh={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"},Jh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jh[e])?!!t[e]:!1}function as(){return qh}var em=we({},bl,{key:function(e){if(e.key){var t=Yh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:as,charCode:function(e){return e.type==="keypress"?lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tm=at(em),nm=we({},Vo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xu=at(nm),rm=we({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:as}),lm=at(rm),om=we({},kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),im=at(om),am=we({},Vo,{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}),sm=at(am),um=[9,13,27,32],ss=Mt&&"CompositionEvent"in window,Yr=null;Mt&&"documentMode"in document&&(Yr=document.documentMode);var cm=Mt&&"TextEvent"in window&&!Yr,Dd=Mt&&(!ss||Yr&&8<Yr&&11>=Yr),Su=" ",wu=!1;function Pd(e,t){switch(e){case"keyup":return um.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ld(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jn=!1;function dm(e,t){switch(e){case"compositionend":return Ld(t);case"keypress":return t.which!==32?null:(wu=!0,Su);case"textInput":return e=t.data,e===Su&&wu?null:e;default:return null}}function fm(e,t){if(Jn)return e==="compositionend"||!ss&&Pd(e,t)?(e=Rd(),ro=os=en=null,Jn=!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 Dd&&t.locale!=="ko"?null:t.data;default:return null}}var pm={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 ju(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pm[e.type]:t==="textarea"}function _d(e,t,n,r){dd(r),t=wo(t,"onChange"),0<t.length&&(n=new is("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xr=null,cl=null;function hm(e){Vd(e,0)}function Ko(e){var t=tr(e);if(ld(t))return e}function mm(e,t){if(e==="change")return t}var Id=!1;if(Mt){var ki;if(Mt){var Ci="oninput"in document;if(!Ci){var ku=document.createElement("div");ku.setAttribute("oninput","return;"),Ci=typeof ku.oninput=="function"}ki=Ci}else ki=!1;Id=ki&&(!document.documentMode||9<document.documentMode)}function Cu(){Xr&&(Xr.detachEvent("onpropertychange",Fd),cl=Xr=null)}function Fd(e){if(e.propertyName==="value"&&Ko(cl)){var t=[];_d(t,cl,e,es(e)),md(hm,t)}}function vm(e,t,n){e==="focusin"?(Cu(),Xr=t,cl=n,Xr.attachEvent("onpropertychange",Fd)):e==="focusout"&&Cu()}function ym(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ko(cl)}function gm(e,t){if(e==="click")return Ko(t)}function xm(e,t){if(e==="input"||e==="change")return Ko(t)}function Sm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:Sm;function dl(e,t){if(wt(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 l=n[r];if(!Gi.call(t,l)||!wt(e[l],t[l]))return!1}return!0}function bu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Eu(e,t){var n=bu(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=bu(n)}}function Md(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Md(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ad(){for(var e=window,t=ho();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ho(e.document)}return t}function us(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 wm(e){var t=Ad(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Md(n.ownerDocument.documentElement,n)){if(r!==null&&us(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 l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Eu(n,o);var a=Eu(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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 jm=Mt&&"documentMode"in document&&11>=document.documentMode,qn=null,fa=null,Jr=null,pa=!1;function Nu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pa||qn==null||qn!==ho(r)||(r=qn,"selectionStart"in r&&us(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}),Jr&&dl(Jr,r)||(Jr=r,r=wo(fa,"onSelect"),0<r.length&&(t=new is("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=qn)))}function Hl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var er={animationend:Hl("Animation","AnimationEnd"),animationiteration:Hl("Animation","AnimationIteration"),animationstart:Hl("Animation","AnimationStart"),transitionend:Hl("Transition","TransitionEnd")},bi={},Ud={};Mt&&(Ud=document.createElement("div").style,"AnimationEvent"in window||(delete er.animationend.animation,delete er.animationiteration.animation,delete er.animationstart.animation),"TransitionEvent"in window||delete er.transitionend.transition);function Go(e){if(bi[e])return bi[e];if(!er[e])return e;var t=er[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ud)return bi[e]=t[n];return e}var Od=Go("animationend"),Bd=Go("animationiteration"),$d=Go("animationstart"),Wd=Go("transitionend"),Hd=new Map,zu="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 hn(e,t){Hd.set(e,t),On(t,[e])}for(var Ei=0;Ei<zu.length;Ei++){var Ni=zu[Ei],km=Ni.toLowerCase(),Cm=Ni[0].toUpperCase()+Ni.slice(1);hn(km,"on"+Cm)}hn(Od,"onAnimationEnd");hn(Bd,"onAnimationIteration");hn($d,"onAnimationStart");hn("dblclick","onDoubleClick");hn("focusin","onFocus");hn("focusout","onBlur");hn(Wd,"onTransitionEnd");hr("onMouseEnter",["mouseout","mouseover"]);hr("onMouseLeave",["mouseout","mouseover"]);hr("onPointerEnter",["pointerout","pointerover"]);hr("onPointerLeave",["pointerout","pointerover"]);On("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));On("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));On("onBeforeInput",["compositionend","keypress","textInput","paste"]);On("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));On("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));On("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Kr="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(" "),bm=new Set("cancel close invalid load scroll toggle".split(" ").concat(Kr));function Tu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,kh(r,t,void 0,e),e.currentTarget=null}function Vd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],u=s.instance,c=s.currentTarget;if(s=s.listener,u!==o&&l.isPropagationStopped())break e;Tu(l,s,c),o=u}else for(a=0;a<r.length;a++){if(s=r[a],u=s.instance,c=s.currentTarget,s=s.listener,u!==o&&l.isPropagationStopped())break e;Tu(l,s,c),o=u}}}if(vo)throw e=sa,vo=!1,sa=null,e}function me(e,t){var n=t[ga];n===void 0&&(n=t[ga]=new Set);var r=e+"__bubble";n.has(r)||(Kd(t,e,2,!1),n.add(r))}function zi(e,t,n){var r=0;t&&(r|=4),Kd(n,e,r,t)}var Vl="_reactListening"+Math.random().toString(36).slice(2);function fl(e){if(!e[Vl]){e[Vl]=!0,qc.forEach(function(n){n!=="selectionchange"&&(bm.has(n)||zi(n,!1,e),zi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vl]||(t[Vl]=!0,zi("selectionchange",!1,t))}}function Kd(e,t,n,r){switch(Td(t)){case 1:var l=Uh;break;case 4:l=Oh;break;default:l=ls}n=l.bind(null,t,n,e),l=void 0,!aa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Ti(e,t,n,r,l){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===l||s.nodeType===8&&s.parentNode===l)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;a=a.return}for(;s!==null;){if(a=Nn(s),a===null)return;if(u=a.tag,u===5||u===6){r=o=a;continue e}s=s.parentNode}}r=r.return}md(function(){var c=o,p=es(n),f=[];e:{var v=Hd.get(e);if(v!==void 0){var S=is,j=e;switch(e){case"keypress":if(lo(n)===0)break e;case"keydown":case"keyup":S=tm;break;case"focusin":j="focus",S=ji;break;case"focusout":j="blur",S=ji;break;case"beforeblur":case"afterblur":S=ji;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":S=yu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=lm;break;case Od:case Bd:case $d:S=Kh;break;case Wd:S=im;break;case"scroll":S=Bh;break;case"wheel":S=sm;break;case"copy":case"cut":case"paste":S=Qh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=xu}var w=(t&4)!==0,D=!w&&e==="scroll",g=w?v!==null?v+"Capture":null:v;w=[];for(var d=c,y;d!==null;){y=d;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,g!==null&&(b=il(d,g),b!=null&&w.push(pl(d,b,y)))),D)break;d=d.return}0<w.length&&(v=new S(v,j,null,n,p),f.push({event:v,listeners:w}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",v&&n!==oa&&(j=n.relatedTarget||n.fromElement)&&(Nn(j)||j[At]))break e;if((S||v)&&(v=p.window===p?p:(v=p.ownerDocument)?v.defaultView||v.parentWindow:window,S?(j=n.relatedTarget||n.toElement,S=c,j=j?Nn(j):null,j!==null&&(D=Bn(j),j!==D||j.tag!==5&&j.tag!==6)&&(j=null)):(S=null,j=c),S!==j)){if(w=yu,b="onMouseLeave",g="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(w=xu,b="onPointerLeave",g="onPointerEnter",d="pointer"),D=S==null?v:tr(S),y=j==null?v:tr(j),v=new w(b,d+"leave",S,n,p),v.target=D,v.relatedTarget=y,b=null,Nn(p)===c&&(w=new w(g,d+"enter",j,n,p),w.target=y,w.relatedTarget=D,b=w),D=b,S&&j)t:{for(w=S,g=j,d=0,y=w;y;y=Kn(y))d++;for(y=0,b=g;b;b=Kn(b))y++;for(;0<d-y;)w=Kn(w),d--;for(;0<y-d;)g=Kn(g),y--;for(;d--;){if(w===g||g!==null&&w===g.alternate)break t;w=Kn(w),g=Kn(g)}w=null}else w=null;S!==null&&Ru(f,v,S,w,!1),j!==null&&D!==null&&Ru(f,D,j,w,!0)}}e:{if(v=c?tr(c):window,S=v.nodeName&&v.nodeName.toLowerCase(),S==="select"||S==="input"&&v.type==="file")var E=mm;else if(ju(v))if(Id)E=xm;else{E=ym;var T=vm}else(S=v.nodeName)&&S.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(E=gm);if(E&&(E=E(e,c))){_d(f,E,n,p);break e}T&&T(e,v,c),e==="focusout"&&(T=v._wrapperState)&&T.controlled&&v.type==="number"&&ea(v,"number",v.value)}switch(T=c?tr(c):window,e){case"focusin":(ju(T)||T.contentEditable==="true")&&(qn=T,fa=c,Jr=null);break;case"focusout":Jr=fa=qn=null;break;case"mousedown":pa=!0;break;case"contextmenu":case"mouseup":case"dragend":pa=!1,Nu(f,n,p);break;case"selectionchange":if(jm)break;case"keydown":case"keyup":Nu(f,n,p)}var h;if(ss)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Jn?Pd(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(Dd&&n.locale!=="ko"&&(Jn||k!=="onCompositionStart"?k==="onCompositionEnd"&&Jn&&(h=Rd()):(en=p,os="value"in en?en.value:en.textContent,Jn=!0)),T=wo(c,k),0<T.length&&(k=new gu(k,e,null,n,p),f.push({event:k,listeners:T}),h?k.data=h:(h=Ld(n),h!==null&&(k.data=h)))),(h=cm?dm(e,n):fm(e,n))&&(c=wo(c,"onBeforeInput"),0<c.length&&(p=new gu("onBeforeInput","beforeinput",null,n,p),f.push({event:p,listeners:c}),p.data=h))}Vd(f,t)})}function pl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wo(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,o=l.stateNode;l.tag===5&&o!==null&&(l=o,o=il(e,n),o!=null&&r.unshift(pl(e,o,l)),o=il(e,t),o!=null&&r.push(pl(e,o,l))),e=e.return}return r}function Kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ru(e,t,n,r,l){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,u=s.alternate,c=s.stateNode;if(u!==null&&u===r)break;s.tag===5&&c!==null&&(s=c,l?(u=il(n,o),u!=null&&a.unshift(pl(n,u,s))):l||(u=il(n,o),u!=null&&a.push(pl(n,u,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Em=/\r\n?/g,Nm=/\u0000|\uFFFD/g;function Du(e){return(typeof e=="string"?e:""+e).replace(Em,`
38
+ `).replace(Nm,"")}function Kl(e,t,n){if(t=Du(t),Du(e)!==t&&n)throw Error(_(425))}function jo(){}var ha=null,ma=null;function va(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 ya=typeof setTimeout=="function"?setTimeout:void 0,zm=typeof clearTimeout=="function"?clearTimeout:void 0,Pu=typeof Promise=="function"?Promise:void 0,Tm=typeof queueMicrotask=="function"?queueMicrotask:typeof Pu<"u"?function(e){return Pu.resolve(null).then(e).catch(Rm)}:ya;function Rm(e){setTimeout(function(){throw e})}function Ri(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),ul(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);ul(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 Lu(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 Cr=Math.random().toString(36).slice(2),Et="__reactFiber$"+Cr,hl="__reactProps$"+Cr,At="__reactContainer$"+Cr,ga="__reactEvents$"+Cr,Dm="__reactListeners$"+Cr,Pm="__reactHandles$"+Cr;function Nn(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[At]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Lu(e);e!==null;){if(n=e[Et])return n;e=Lu(e)}return t}e=n,n=e.parentNode}return null}function El(e){return e=e[Et]||e[At],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function tr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function Qo(e){return e[hl]||null}var xa=[],nr=-1;function mn(e){return{current:e}}function ve(e){0>nr||(e.current=xa[nr],xa[nr]=null,nr--)}function he(e,t){nr++,xa[nr]=e.current,e.current=t}var pn={},$e=mn(pn),Je=mn(!1),Ln=pn;function mr(e,t){var n=e.type.contextTypes;if(!n)return pn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function qe(e){return e=e.childContextTypes,e!=null}function ko(){ve(Je),ve($e)}function _u(e,t,n){if($e.current!==pn)throw Error(_(168));he($e,t),he(Je,n)}function Gd(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(_(108,vh(e)||"Unknown",l));return we({},n,r)}function Co(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pn,Ln=$e.current,he($e,e),he(Je,Je.current),!0}function Iu(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Gd(e,t,Ln),r.__reactInternalMemoizedMergedChildContext=e,ve(Je),ve($e),he($e,e)):ve(Je),he(Je,n)}var Pt=null,Zo=!1,Di=!1;function Qd(e){Pt===null?Pt=[e]:Pt.push(e)}function Lm(e){Zo=!0,Qd(e)}function vn(){if(!Di&&Pt!==null){Di=!0;var e=0,t=de;try{var n=Pt;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Pt=null,Zo=!1}catch(l){throw Pt!==null&&(Pt=Pt.slice(e+1)),xd(ts,vn),l}finally{de=t,Di=!1}}return null}var rr=[],lr=0,bo=null,Eo=0,st=[],ut=0,_n=null,Lt=1,_t="";function jn(e,t){rr[lr++]=Eo,rr[lr++]=bo,bo=e,Eo=t}function Zd(e,t,n){st[ut++]=Lt,st[ut++]=_t,st[ut++]=_n,_n=e;var r=Lt;e=_t;var l=32-xt(r)-1;r&=~(1<<l),n+=1;var o=32-xt(t)+l;if(30<o){var a=l-l%5;o=(r&(1<<a)-1).toString(32),r>>=a,l-=a,Lt=1<<32-xt(t)+l|n<<l|r,_t=o+e}else Lt=1<<o|n<<l|r,_t=e}function cs(e){e.return!==null&&(jn(e,1),Zd(e,1,0))}function ds(e){for(;e===bo;)bo=rr[--lr],rr[lr]=null,Eo=rr[--lr],rr[lr]=null;for(;e===_n;)_n=st[--ut],st[ut]=null,_t=st[--ut],st[ut]=null,Lt=st[--ut],st[ut]=null}var lt=null,rt=null,ge=!1,gt=null;function Yd(e,t){var n=ct(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 Fu(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,lt=e,rt=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,lt=e,rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=_n!==null?{id:Lt,overflow:_t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ct(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,lt=e,rt=null,!0):!1;default:return!1}}function Sa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wa(e){if(ge){var t=rt;if(t){var n=t;if(!Fu(e,t)){if(Sa(e))throw Error(_(418));t=an(n.nextSibling);var r=lt;t&&Fu(e,t)?Yd(r,n):(e.flags=e.flags&-4097|2,ge=!1,lt=e)}}else{if(Sa(e))throw Error(_(418));e.flags=e.flags&-4097|2,ge=!1,lt=e}}}function Mu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;lt=e}function Gl(e){if(e!==lt)return!1;if(!ge)return Mu(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!va(e.type,e.memoizedProps)),t&&(t=rt)){if(Sa(e))throw Xd(),Error(_(418));for(;t;)Yd(e,t),t=an(t.nextSibling)}if(Mu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rt=an(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rt=null}}else rt=lt?an(e.stateNode.nextSibling):null;return!0}function Xd(){for(var e=rt;e;)e=an(e.nextSibling)}function vr(){rt=lt=null,ge=!1}function fs(e){gt===null?gt=[e]:gt.push(e)}var _m=$t.ReactCurrentBatchConfig;function Fr(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(_(309));var r=n.stateNode}if(!r)throw Error(_(147,e));var l=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=l.refs;a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(_(284));if(!n._owner)throw Error(_(290,e))}return e}function Ql(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Au(e){var t=e._init;return t(e._payload)}function Jd(e){function t(g,d){if(e){var y=g.deletions;y===null?(g.deletions=[d],g.flags|=16):y.push(d)}}function n(g,d){if(!e)return null;for(;d!==null;)t(g,d),d=d.sibling;return null}function r(g,d){for(g=new Map;d!==null;)d.key!==null?g.set(d.key,d):g.set(d.index,d),d=d.sibling;return g}function l(g,d){return g=dn(g,d),g.index=0,g.sibling=null,g}function o(g,d,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<d?(g.flags|=2,d):y):(g.flags|=2,d)):(g.flags|=1048576,d)}function a(g){return e&&g.alternate===null&&(g.flags|=2),g}function s(g,d,y,b){return d===null||d.tag!==6?(d=Ai(y,g.mode,b),d.return=g,d):(d=l(d,y),d.return=g,d)}function u(g,d,y,b){var E=y.type;return E===Xn?p(g,d,y.props.children,b,y.key):d!==null&&(d.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Yt&&Au(E)===d.type)?(b=l(d,y.props),b.ref=Fr(g,d,y),b.return=g,b):(b=fo(y.type,y.key,y.props,null,g.mode,b),b.ref=Fr(g,d,y),b.return=g,b)}function c(g,d,y,b){return d===null||d.tag!==4||d.stateNode.containerInfo!==y.containerInfo||d.stateNode.implementation!==y.implementation?(d=Ui(y,g.mode,b),d.return=g,d):(d=l(d,y.children||[]),d.return=g,d)}function p(g,d,y,b,E){return d===null||d.tag!==7?(d=Pn(y,g.mode,b,E),d.return=g,d):(d=l(d,y),d.return=g,d)}function f(g,d,y){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Ai(""+d,g.mode,y),d.return=g,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Ml:return y=fo(d.type,d.key,d.props,null,g.mode,y),y.ref=Fr(g,null,d),y.return=g,y;case Yn:return d=Ui(d,g.mode,y),d.return=g,d;case Yt:var b=d._init;return f(g,b(d._payload),y)}if(Hr(d)||Dr(d))return d=Pn(d,g.mode,y,null),d.return=g,d;Ql(g,d)}return null}function v(g,d,y,b){var E=d!==null?d.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:s(g,d,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ml:return y.key===E?u(g,d,y,b):null;case Yn:return y.key===E?c(g,d,y,b):null;case Yt:return E=y._init,v(g,d,E(y._payload),b)}if(Hr(y)||Dr(y))return E!==null?null:p(g,d,y,b,null);Ql(g,y)}return null}function S(g,d,y,b,E){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(y)||null,s(d,g,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ml:return g=g.get(b.key===null?y:b.key)||null,u(d,g,b,E);case Yn:return g=g.get(b.key===null?y:b.key)||null,c(d,g,b,E);case Yt:var T=b._init;return S(g,d,y,T(b._payload),E)}if(Hr(b)||Dr(b))return g=g.get(y)||null,p(d,g,b,E,null);Ql(d,b)}return null}function j(g,d,y,b){for(var E=null,T=null,h=d,k=d=0,I=null;h!==null&&k<y.length;k++){h.index>k?(I=h,h=null):I=h.sibling;var R=v(g,h,y[k],b);if(R===null){h===null&&(h=I);break}e&&h&&R.alternate===null&&t(g,h),d=o(R,d,k),T===null?E=R:T.sibling=R,T=R,h=I}if(k===y.length)return n(g,h),ge&&jn(g,k),E;if(h===null){for(;k<y.length;k++)h=f(g,y[k],b),h!==null&&(d=o(h,d,k),T===null?E=h:T.sibling=h,T=h);return ge&&jn(g,k),E}for(h=r(g,h);k<y.length;k++)I=S(h,g,k,y[k],b),I!==null&&(e&&I.alternate!==null&&h.delete(I.key===null?k:I.key),d=o(I,d,k),T===null?E=I:T.sibling=I,T=I);return e&&h.forEach(function(K){return t(g,K)}),ge&&jn(g,k),E}function w(g,d,y,b){var E=Dr(y);if(typeof E!="function")throw Error(_(150));if(y=E.call(y),y==null)throw Error(_(151));for(var T=E=null,h=d,k=d=0,I=null,R=y.next();h!==null&&!R.done;k++,R=y.next()){h.index>k?(I=h,h=null):I=h.sibling;var K=v(g,h,R.value,b);if(K===null){h===null&&(h=I);break}e&&h&&K.alternate===null&&t(g,h),d=o(K,d,k),T===null?E=K:T.sibling=K,T=K,h=I}if(R.done)return n(g,h),ge&&jn(g,k),E;if(h===null){for(;!R.done;k++,R=y.next())R=f(g,R.value,b),R!==null&&(d=o(R,d,k),T===null?E=R:T.sibling=R,T=R);return ge&&jn(g,k),E}for(h=r(g,h);!R.done;k++,R=y.next())R=S(h,g,k,R.value,b),R!==null&&(e&&R.alternate!==null&&h.delete(R.key===null?k:R.key),d=o(R,d,k),T===null?E=R:T.sibling=R,T=R);return e&&h.forEach(function(L){return t(g,L)}),ge&&jn(g,k),E}function D(g,d,y,b){if(typeof y=="object"&&y!==null&&y.type===Xn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ml:e:{for(var E=y.key,T=d;T!==null;){if(T.key===E){if(E=y.type,E===Xn){if(T.tag===7){n(g,T.sibling),d=l(T,y.props.children),d.return=g,g=d;break e}}else if(T.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Yt&&Au(E)===T.type){n(g,T.sibling),d=l(T,y.props),d.ref=Fr(g,T,y),d.return=g,g=d;break e}n(g,T);break}else t(g,T);T=T.sibling}y.type===Xn?(d=Pn(y.props.children,g.mode,b,y.key),d.return=g,g=d):(b=fo(y.type,y.key,y.props,null,g.mode,b),b.ref=Fr(g,d,y),b.return=g,g=b)}return a(g);case Yn:e:{for(T=y.key;d!==null;){if(d.key===T)if(d.tag===4&&d.stateNode.containerInfo===y.containerInfo&&d.stateNode.implementation===y.implementation){n(g,d.sibling),d=l(d,y.children||[]),d.return=g,g=d;break e}else{n(g,d);break}else t(g,d);d=d.sibling}d=Ui(y,g.mode,b),d.return=g,g=d}return a(g);case Yt:return T=y._init,D(g,d,T(y._payload),b)}if(Hr(y))return j(g,d,y,b);if(Dr(y))return w(g,d,y,b);Ql(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,d!==null&&d.tag===6?(n(g,d.sibling),d=l(d,y),d.return=g,g=d):(n(g,d),d=Ai(y,g.mode,b),d.return=g,g=d),a(g)):n(g,d)}return D}var yr=Jd(!0),qd=Jd(!1),No=mn(null),zo=null,or=null,ps=null;function hs(){ps=or=zo=null}function ms(e){var t=No.current;ve(No),e._currentValue=t}function ja(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 fr(e,t){zo=e,ps=or=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xe=!0),e.firstContext=null)}function ft(e){var t=e._currentValue;if(ps!==e)if(e={context:e,memoizedValue:t,next:null},or===null){if(zo===null)throw Error(_(308));or=e,zo.dependencies={lanes:0,firstContext:e}}else or=or.next=e;return t}var zn=null;function vs(e){zn===null?zn=[e]:zn.push(e)}function ef(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,vs(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ut(e,r)}function Ut(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 Xt=!1;function ys(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tf(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 It(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ut(e,n)}return l=r.interleaved,l===null?(t.next=t,vs(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ut(e,n)}function oo(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,ns(e,n)}}function Uu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function To(e,t,n,r){var l=e.updateQueue;Xt=!1;var o=l.firstBaseUpdate,a=l.lastBaseUpdate,s=l.shared.pending;if(s!==null){l.shared.pending=null;var u=s,c=u.next;u.next=null,a===null?o=c:a.next=c,a=u;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==a&&(s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=u))}if(o!==null){var f=l.baseState;a=0,p=c=u=null,s=o;do{var v=s.lane,S=s.eventTime;if((r&v)===v){p!==null&&(p=p.next={eventTime:S,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var j=e,w=s;switch(v=t,S=n,w.tag){case 1:if(j=w.payload,typeof j=="function"){f=j.call(S,f,v);break e}f=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=w.payload,v=typeof j=="function"?j.call(S,f,v):j,v==null)break e;f=we({},f,v);break e;case 2:Xt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,v=l.effects,v===null?l.effects=[s]:v.push(s))}else S={eventTime:S,lane:v,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(c=p=S,u=f):p=p.next=S,a|=v;if(s=s.next,s===null){if(s=l.shared.pending,s===null)break;v=s,s=v.next,v.next=null,l.lastBaseUpdate=v,l.shared.pending=null}}while(!0);if(p===null&&(u=f),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Fn|=a,e.lanes=a,e.memoizedState=f}}function Ou(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(_(191,l));l.call(r)}}}var Nl={},zt=mn(Nl),ml=mn(Nl),vl=mn(Nl);function Tn(e){if(e===Nl)throw Error(_(174));return e}function gs(e,t){switch(he(vl,t),he(ml,e),he(zt,Nl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:na(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=na(t,e)}ve(zt),he(zt,t)}function gr(){ve(zt),ve(ml),ve(vl)}function nf(e){Tn(vl.current);var t=Tn(zt.current),n=na(t,e.type);t!==n&&(he(ml,e),he(zt,n))}function xs(e){ml.current===e&&(ve(zt),ve(ml))}var xe=mn(0);function Ro(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 Pi=[];function Ss(){for(var e=0;e<Pi.length;e++)Pi[e]._workInProgressVersionPrimary=null;Pi.length=0}var io=$t.ReactCurrentDispatcher,Li=$t.ReactCurrentBatchConfig,In=0,Se=null,Te=null,De=null,Do=!1,qr=!1,yl=0,Im=0;function Ue(){throw Error(_(321))}function ws(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function js(e,t,n,r,l,o){if(In=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,io.current=e===null||e.memoizedState===null?Um:Om,e=n(r,l),qr){o=0;do{if(qr=!1,yl=0,25<=o)throw Error(_(301));o+=1,De=Te=null,t.updateQueue=null,io.current=Bm,e=n(r,l)}while(qr)}if(io.current=Po,t=Te!==null&&Te.next!==null,In=0,De=Te=Se=null,Do=!1,t)throw Error(_(300));return e}function ks(){var e=yl!==0;return yl=0,e}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?Se.memoizedState=De=e:De=De.next=e,De}function pt(){if(Te===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=De===null?Se.memoizedState:De.next;if(t!==null)De=t,Te=e;else{if(e===null)throw Error(_(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},De===null?Se.memoizedState=De=e:De=De.next=e}return De}function gl(e,t){return typeof t=="function"?t(e):t}function _i(e){var t=pt(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=Te,l=r.baseQueue,o=n.pending;if(o!==null){if(l!==null){var a=l.next;l.next=o.next,o.next=a}r.baseQueue=l=o,n.pending=null}if(l!==null){o=l.next,r=r.baseState;var s=a=null,u=null,c=o;do{var p=c.lane;if((In&p)===p)u!==null&&(u=u.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:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(s=u=f,a=r):u=u.next=f,Se.lanes|=p,Fn|=p}c=c.next}while(c!==null&&c!==o);u===null?a=r:u.next=s,wt(r,t.memoizedState)||(Xe=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do o=l.lane,Se.lanes|=o,Fn|=o,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ii(e){var t=pt(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,o=t.memoizedState;if(l!==null){n.pending=null;var a=l=l.next;do o=e(o,a.action),a=a.next;while(a!==l);wt(o,t.memoizedState)||(Xe=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function rf(){}function lf(e,t){var n=Se,r=pt(),l=t(),o=!wt(r.memoizedState,l);if(o&&(r.memoizedState=l,Xe=!0),r=r.queue,Cs(sf.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||De!==null&&De.memoizedState.tag&1){if(n.flags|=2048,xl(9,af.bind(null,n,r,l,t),void 0,null),Pe===null)throw Error(_(349));In&30||of(n,t,l)}return l}function of(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.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,uf(t)&&cf(e)}function sf(e,t,n){return n(function(){uf(t)&&cf(e)})}function uf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function cf(e){var t=Ut(e,1);t!==null&&St(t,e,1,-1)}function Bu(e){var t=Ct();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gl,lastRenderedState:e},t.queue=e,e=e.dispatch=Am.bind(null,Se,e),[t.memoizedState,e]}function xl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.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 df(){return pt().memoizedState}function ao(e,t,n,r){var l=Ct();Se.flags|=e,l.memoizedState=xl(1|t,n,void 0,r===void 0?null:r)}function Yo(e,t,n,r){var l=pt();r=r===void 0?null:r;var o=void 0;if(Te!==null){var a=Te.memoizedState;if(o=a.destroy,r!==null&&ws(r,a.deps)){l.memoizedState=xl(t,n,o,r);return}}Se.flags|=e,l.memoizedState=xl(1|t,n,o,r)}function $u(e,t){return ao(8390656,8,e,t)}function Cs(e,t){return Yo(2048,8,e,t)}function ff(e,t){return Yo(4,2,e,t)}function pf(e,t){return Yo(4,4,e,t)}function hf(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 mf(e,t,n){return n=n!=null?n.concat([e]):null,Yo(4,4,hf.bind(null,t,e),n)}function bs(){}function vf(e,t){var n=pt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ws(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function yf(e,t){var n=pt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ws(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gf(e,t,n){return In&21?(wt(n,t)||(n=jd(),Se.lanes|=n,Fn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xe=!0),e.memoizedState=n)}function Fm(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=Li.transition;Li.transition={};try{e(!1),t()}finally{de=n,Li.transition=r}}function xf(){return pt().memoizedState}function Mm(e,t,n){var r=cn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sf(e))wf(t,n);else if(n=ef(e,t,n,r),n!==null){var l=Ke();St(n,e,r,l),jf(n,t,r)}}function Am(e,t,n){var r=cn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sf(e))wf(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(l.hasEagerState=!0,l.eagerState=s,wt(s,a)){var u=t.interleaved;u===null?(l.next=l,vs(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=ef(e,t,l,r),n!==null&&(l=Ke(),St(n,e,r,l),jf(n,t,r))}}function Sf(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function wf(e,t){qr=Do=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ns(e,n)}}var Po={readContext:ft,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},Um={readContext:ft,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:$u,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ao(4194308,4,hf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ao(4194308,4,e,t)},useInsertionEffect:function(e,t){return ao(4,2,e,t)},useMemo:function(e,t){var n=Ct();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ct();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=Mm.bind(null,Se,e),[r.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:Bu,useDebugValue:bs,useDeferredValue:function(e){return Ct().memoizedState=e},useTransition:function(){var e=Bu(!1),t=e[0];return e=Fm.bind(null,e[1]),Ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Se,l=Ct();if(ge){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),Pe===null)throw Error(_(349));In&30||of(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,$u(sf.bind(null,r,o,e),[e]),r.flags|=2048,xl(9,af.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ct(),t=Pe.identifierPrefix;if(ge){var n=_t,r=Lt;n=(r&~(1<<32-xt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=yl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Im++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Om={readContext:ft,useCallback:vf,useContext:ft,useEffect:Cs,useImperativeHandle:mf,useInsertionEffect:ff,useLayoutEffect:pf,useMemo:yf,useReducer:_i,useRef:df,useState:function(){return _i(gl)},useDebugValue:bs,useDeferredValue:function(e){var t=pt();return gf(t,Te.memoizedState,e)},useTransition:function(){var e=_i(gl)[0],t=pt().memoizedState;return[e,t]},useMutableSource:rf,useSyncExternalStore:lf,useId:xf,unstable_isNewReconciler:!1},Bm={readContext:ft,useCallback:vf,useContext:ft,useEffect:Cs,useImperativeHandle:mf,useInsertionEffect:ff,useLayoutEffect:pf,useMemo:yf,useReducer:Ii,useRef:df,useState:function(){return Ii(gl)},useDebugValue:bs,useDeferredValue:function(e){var t=pt();return Te===null?t.memoizedState=e:gf(t,Te.memoizedState,e)},useTransition:function(){var e=Ii(gl)[0],t=pt().memoizedState;return[e,t]},useMutableSource:rf,useSyncExternalStore:lf,useId:xf,unstable_isNewReconciler:!1};function mt(e,t){if(e&&e.defaultProps){t=we({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ka(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:we({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xo={isMounted:function(e){return(e=e._reactInternals)?Bn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ke(),l=cn(e),o=It(r,l);o.payload=t,n!=null&&(o.callback=n),t=sn(e,o,l),t!==null&&(St(t,e,l,r),oo(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ke(),l=cn(e),o=It(r,l);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=sn(e,o,l),t!==null&&(St(t,e,l,r),oo(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ke(),r=cn(e),l=It(n,r);l.tag=2,t!=null&&(l.callback=t),t=sn(e,l,r),t!==null&&(St(t,e,r,n),oo(t,e,r))}};function Wu(e,t,n,r,l,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!dl(n,r)||!dl(l,o):!0}function kf(e,t,n){var r=!1,l=pn,o=t.contextType;return typeof o=="object"&&o!==null?o=ft(o):(l=qe(t)?Ln:$e.current,r=t.contextTypes,o=(r=r!=null)?mr(e,l):pn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=o),t}function Hu(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&&Xo.enqueueReplaceState(t,t.state,null)}function Ca(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},ys(e);var o=t.contextType;typeof o=="object"&&o!==null?l.context=ft(o):(o=qe(t)?Ln:$e.current,l.context=mr(e,o)),l.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(ka(e,t,o,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Xo.enqueueReplaceState(l,l.state,null),To(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function xr(e,t){try{var n="",r=t;do n+=mh(r),r=r.return;while(r);var l=n}catch(o){l=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:l,digest:null}}function Fi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ba(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $m=typeof WeakMap=="function"?WeakMap:Map;function Cf(e,t,n){n=It(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_o||(_o=!0,Ia=r),ba(e,t)},n}function bf(e,t,n){n=It(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){ba(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ba(e,t),typeof r!="function"&&(un===null?un=new Set([this]):un.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Vu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $m;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=nv.bind(null,e,t,n),t.then(e,e))}function Ku(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 Gu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,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=It(-1,1),t.tag=2,sn(n,t,1))),n.lanes|=1),e)}var Wm=$t.ReactCurrentOwner,Xe=!1;function Ve(e,t,n,r){t.child=e===null?qd(t,null,n,r):yr(t,e.child,n,r)}function Qu(e,t,n,r,l){n=n.render;var o=t.ref;return fr(t,l),r=js(e,t,n,r,o,l),n=ks(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ot(e,t,l)):(ge&&n&&cs(t),t.flags|=1,Ve(e,t,r,l),t.child)}function Zu(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!Ls(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Ef(e,t,o,r,l)):(e=fo(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&l)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:dl,n(a,r)&&e.ref===t.ref)return Ot(e,t,l)}return t.flags|=1,e=dn(o,r),e.ref=t.ref,e.return=t,t.child=e}function Ef(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(dl(o,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=o,(e.lanes&l)!==0)e.flags&131072&&(Xe=!0);else return t.lanes=e.lanes,Ot(e,t,l)}return Ea(e,t,n,r,l)}function Nf(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(ar,tt),tt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(ar,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,he(ar,tt),tt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,he(ar,tt),tt|=r;return Ve(e,t,l,n),t.child}function zf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ea(e,t,n,r,l){var o=qe(n)?Ln:$e.current;return o=mr(t,o),fr(t,l),n=js(e,t,n,r,o,l),r=ks(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ot(e,t,l)):(ge&&r&&cs(t),t.flags|=1,Ve(e,t,n,l),t.child)}function Yu(e,t,n,r,l){if(qe(n)){var o=!0;Co(t)}else o=!1;if(fr(t,l),t.stateNode===null)so(e,t),kf(t,n,r),Ca(t,n,r,l),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=ft(c):(c=qe(n)?Ln:$e.current,c=mr(t,c));var p=n.getDerivedStateFromProps,f=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||u!==c)&&Hu(t,a,r,c),Xt=!1;var v=t.memoizedState;a.state=v,To(t,r,a,l),u=t.memoizedState,s!==r||v!==u||Je.current||Xt?(typeof p=="function"&&(ka(t,n,p,r),u=t.memoizedState),(s=Xt||Wu(t,n,s,r,v,u,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,tf(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:mt(t.type,s),a.props=c,f=t.pendingProps,v=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=ft(u):(u=qe(n)?Ln:$e.current,u=mr(t,u));var S=n.getDerivedStateFromProps;(p=typeof S=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||v!==u)&&Hu(t,a,r,u),Xt=!1,v=t.memoizedState,a.state=v,To(t,r,a,l);var j=t.memoizedState;s!==f||v!==j||Je.current||Xt?(typeof S=="function"&&(ka(t,n,S,r),j=t.memoizedState),(c=Xt||Wu(t,n,c,r,v,j,u)||!1)?(p||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,j,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,j,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=j),a.props=r,a.state=j,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),r=!1)}return Na(e,t,n,r,o,l)}function Na(e,t,n,r,l,o){zf(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return l&&Iu(t,n,!1),Ot(e,t,o);r=t.stateNode,Wm.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=yr(t,e.child,null,o),t.child=yr(t,null,s,o)):Ve(e,t,s,o),t.memoizedState=r.state,l&&Iu(t,n,!0),t.child}function Tf(e){var t=e.stateNode;t.pendingContext?_u(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_u(e,t.context,!1),gs(e,t.containerInfo)}function Xu(e,t,n,r,l){return vr(),fs(l),t.flags|=256,Ve(e,t,n,r),t.child}var za={dehydrated:null,treeContext:null,retryLane:0};function Ta(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rf(e,t,n){var r=t.pendingProps,l=xe.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(l&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),he(xe,l&1),e===null)return wa(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):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=ei(a,r,0,null),e=Pn(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Ta(n),t.memoizedState=za,e):Es(t,a));if(l=e.memoizedState,l!==null&&(s=l.dehydrated,s!==null))return Hm(e,t,a,r,s,l,n);if(o){o=r.fallback,a=t.mode,l=e.child,s=l.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=dn(l,u),r.subtreeFlags=l.subtreeFlags&14680064),s!==null?o=dn(s,o):(o=Pn(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?Ta(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=za,r}return o=e.child,e=o.sibling,r=dn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Es(e,t){return t=ei({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zl(e,t,n,r){return r!==null&&fs(r),yr(t,e.child,null,n),e=Es(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hm(e,t,n,r,l,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Fi(Error(_(422))),Zl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=ei({mode:"visible",children:r.children},l,0,null),o=Pn(o,l,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&yr(t,e.child,null,a),t.child.memoizedState=Ta(a),t.memoizedState=za,o);if(!(t.mode&1))return Zl(e,t,a,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(_(419)),r=Fi(o,r,void 0),Zl(e,t,a,r)}if(s=(a&e.childLanes)!==0,Xe||s){if(r=Pe,r!==null){switch(a&-a){case 4:l=2;break;case 16:l=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:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|a)?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,Ut(e,l),St(r,e,l,-1))}return Ps(),r=Fi(Error(_(421))),Zl(e,t,a,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=rv.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,rt=an(l.nextSibling),lt=t,ge=!0,gt=null,e!==null&&(st[ut++]=Lt,st[ut++]=_t,st[ut++]=_n,Lt=e.id,_t=e.overflow,_n=t),t=Es(t,r.children),t.flags|=4096,t)}function Ju(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ja(e.return,t,n)}function Mi(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function Df(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if(Ve(e,t,r.children,n),r=xe.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&&Ju(e,n,t);else if(e.tag===19)Ju(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(he(xe,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Ro(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Mi(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Ro(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Mi(t,!0,n,null,o);break;case"together":Mi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function so(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ot(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Fn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,n=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Vm(e,t,n){switch(t.tag){case 3:Tf(t),vr();break;case 5:nf(t);break;case 1:qe(t.type)&&Co(t);break;case 4:gs(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;he(No,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(xe,xe.current&1),t.flags|=128,null):n&t.child.childLanes?Rf(e,t,n):(he(xe,xe.current&1),e=Ot(e,t,n),e!==null?e.sibling:null);he(xe,xe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Df(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),he(xe,xe.current),r)break;return null;case 22:case 23:return t.lanes=0,Nf(e,t,n)}return Ot(e,t,n)}var Pf,Ra,Lf,_f;Pf=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}};Ra=function(){};Lf=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Tn(zt.current);var o=null;switch(n){case"input":l=Ji(e,l),r=Ji(e,r),o=[];break;case"select":l=we({},l,{value:void 0}),r=we({},r,{value:void 0}),o=[];break;case"textarea":l=ta(e,l),r=ta(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=jo)}ra(n,r);var a;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var s=l[c];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ll.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(s=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&u!==s&&(u!=null||s!=null))if(c==="style")if(s){for(a in s)!s.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&s[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ll.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&me("scroll",e),o||s===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};_f=function(e,t,n,r){n!==r&&(t.flags|=4)};function Mr(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Km(e,t,n){var r=t.pendingProps;switch(ds(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return qe(t.type)&&ko(),Oe(t),null;case 3:return r=t.stateNode,gr(),ve(Je),ve($e),Ss(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gt!==null&&(Aa(gt),gt=null))),Ra(e,t),Oe(t),null;case 5:xs(t);var l=Tn(vl.current);if(n=t.type,e!==null&&t.stateNode!=null)Lf(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return Oe(t),null}if(e=Tn(zt.current),Gl(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Et]=t,r[hl]=o,e=(t.mode&1)!==0,n){case"dialog":me("cancel",r),me("close",r);break;case"iframe":case"object":case"embed":me("load",r);break;case"video":case"audio":for(l=0;l<Kr.length;l++)me(Kr[l],r);break;case"source":me("error",r);break;case"img":case"image":case"link":me("error",r),me("load",r);break;case"details":me("toggle",r);break;case"input":au(r,o),me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},me("invalid",r);break;case"textarea":uu(r,o),me("invalid",r)}ra(n,o),l=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&Kl(r.textContent,s,e),l=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&Kl(r.textContent,s,e),l=["children",""+s]):ll.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&me("scroll",r)}switch(n){case"input":Al(r),su(r,o,!0);break;case"textarea":Al(r),cu(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=jo)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ad(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Et]=t,e[hl]=r,Pf(e,t,!1,!1),t.stateNode=e;e:{switch(a=la(n,r),n){case"dialog":me("cancel",e),me("close",e),l=r;break;case"iframe":case"object":case"embed":me("load",e),l=r;break;case"video":case"audio":for(l=0;l<Kr.length;l++)me(Kr[l],e);l=r;break;case"source":me("error",e),l=r;break;case"img":case"image":case"link":me("error",e),me("load",e),l=r;break;case"details":me("toggle",e),l=r;break;case"input":au(e,r),l=Ji(e,r),me("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=we({},r,{value:void 0}),me("invalid",e);break;case"textarea":uu(e,r),l=ta(e,r),me("invalid",e);break;default:l=r}ra(n,l),s=l;for(o in s)if(s.hasOwnProperty(o)){var u=s[o];o==="style"?cd(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&sd(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ol(e,u):typeof u=="number"&&ol(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ll.hasOwnProperty(o)?u!=null&&o==="onScroll"&&me("scroll",e):u!=null&&Ya(e,o,u,a))}switch(n){case"input":Al(e),su(e,r,!1);break;case"textarea":Al(e),cu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?sr(e,!!r.multiple,o,!1):r.defaultValue!=null&&sr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=jo)}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 Oe(t),null;case 6:if(e&&t.stateNode!=null)_f(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(n=Tn(vl.current),Tn(zt.current),Gl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Et]=t,(o=r.nodeValue!==n)&&(e=lt,e!==null))switch(e.tag){case 3:Kl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Kl(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Et]=t,t.stateNode=r}return Oe(t),null;case 13:if(ve(xe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&rt!==null&&t.mode&1&&!(t.flags&128))Xd(),vr(),t.flags|=98560,o=!1;else if(o=Gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(_(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(_(317));o[Et]=t}else vr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oe(t),o=!1}else gt!==null&&(Aa(gt),gt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||xe.current&1?Re===0&&(Re=3):Ps())),t.updateQueue!==null&&(t.flags|=4),Oe(t),null);case 4:return gr(),Ra(e,t),e===null&&fl(t.stateNode.containerInfo),Oe(t),null;case 10:return ms(t.type._context),Oe(t),null;case 17:return qe(t.type)&&ko(),Oe(t),null;case 19:if(ve(xe),o=t.memoizedState,o===null)return Oe(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)Mr(o,!1);else{if(Re!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ro(e),a!==null){for(t.flags|=128,Mr(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return he(xe,xe.current&1|2),t.child}e=e.sibling}o.tail!==null&&be()>Sr&&(t.flags|=128,r=!0,Mr(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ro(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Mr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!ge)return Oe(t),null}else 2*be()-o.renderingStartTime>Sr&&n!==1073741824&&(t.flags|=128,r=!0,Mr(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=be(),t.sibling=null,n=xe.current,he(xe,r?n&1|2:n&1),t):(Oe(t),null);case 22:case 23:return Ds(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function Gm(e,t){switch(ds(t),t.tag){case 1:return qe(t.type)&&ko(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gr(),ve(Je),ve($e),Ss(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xs(t),null;case 13:if(ve(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(xe),null;case 4:return gr(),null;case 10:return ms(t.type._context),null;case 22:case 23:return Ds(),null;case 24:return null;default:return null}}var Yl=!1,Be=!1,Qm=typeof WeakSet=="function"?WeakSet:Set,A=null;function ir(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function Da(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var qu=!1;function Zm(e,t){if(ha=xo,e=Ad(),us(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 l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,u=-1,c=0,p=0,f=e,v=null;t:for(;;){for(var S;f!==n||l!==0&&f.nodeType!==3||(s=a+l),f!==o||r!==0&&f.nodeType!==3||(u=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(S=f.firstChild)!==null;)v=f,f=S;for(;;){if(f===e)break t;if(v===n&&++c===l&&(s=a),v===o&&++p===r&&(u=a),(S=f.nextSibling)!==null)break;f=v,v=f.parentNode}f=S}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ma={focusedElem:e,selectionRange:n},xo=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var w=j.memoizedProps,D=j.memoizedState,g=t.stateNode,d=g.getSnapshotBeforeUpdate(t.elementType===t.type?w:mt(t.type,w),D);g.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(b){Ce(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return j=qu,qu=!1,j}function el(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Da(t,n,o)}l=l.next}while(l!==r)}}function Jo(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 Pa(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 If(e){var t=e.alternate;t!==null&&(e.alternate=null,If(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Et],delete t[hl],delete t[ga],delete t[Dm],delete t[Pm])),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 Ff(e){return e.tag===5||e.tag===3||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ff(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 La(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=jo));else if(r!==4&&(e=e.child,e!==null))for(La(e,t,n),e=e.sibling;e!==null;)La(e,t,n),e=e.sibling}function _a(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(_a(e,t,n),e=e.sibling;e!==null;)_a(e,t,n),e=e.sibling}var Fe=null,vt=!1;function Qt(e,t,n){for(n=n.child;n!==null;)Mf(e,t,n),n=n.sibling}function Mf(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Ho,n)}catch{}switch(n.tag){case 5:Be||ir(n,t);case 6:var r=Fe,l=vt;Fe=null,Qt(e,t,n),Fe=r,vt=l,Fe!==null&&(vt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(vt?(e=Fe,n=n.stateNode,e.nodeType===8?Ri(e.parentNode,n):e.nodeType===1&&Ri(e,n),ul(e)):Ri(Fe,n.stateNode));break;case 4:r=Fe,l=vt,Fe=n.stateNode.containerInfo,vt=!0,Qt(e,t,n),Fe=r,vt=l;break;case 0:case 11:case 14:case 15:if(!Be&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Da(n,t,a),l=l.next}while(l!==r)}Qt(e,t,n);break;case 1:if(!Be&&(ir(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ce(n,t,s)}Qt(e,t,n);break;case 21:Qt(e,t,n);break;case 22:n.mode&1?(Be=(r=Be)||n.memoizedState!==null,Qt(e,t,n),Be=r):Qt(e,t,n);break;default:Qt(e,t,n)}}function tc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Qm),t.forEach(function(r){var l=lv.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:Fe=s.stateNode,vt=!1;break e;case 3:Fe=s.stateNode.containerInfo,vt=!0;break e;case 4:Fe=s.stateNode.containerInfo,vt=!0;break e}s=s.return}if(Fe===null)throw Error(_(160));Mf(o,a,l),Fe=null,vt=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(c){Ce(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Af(t,e),t=t.sibling}function Af(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ht(t,e),kt(e),r&4){try{el(3,e,e.return),Jo(3,e)}catch(w){Ce(e,e.return,w)}try{el(5,e,e.return)}catch(w){Ce(e,e.return,w)}}break;case 1:ht(t,e),kt(e),r&512&&n!==null&&ir(n,n.return);break;case 5:if(ht(t,e),kt(e),r&512&&n!==null&&ir(n,n.return),e.flags&32){var l=e.stateNode;try{ol(l,"")}catch(w){Ce(e,e.return,w)}}if(r&4&&(l=e.stateNode,l!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&od(l,o),la(s,a);var c=la(s,o);for(a=0;a<u.length;a+=2){var p=u[a],f=u[a+1];p==="style"?cd(l,f):p==="dangerouslySetInnerHTML"?sd(l,f):p==="children"?ol(l,f):Ya(l,p,f,c)}switch(s){case"input":qi(l,o);break;case"textarea":id(l,o);break;case"select":var v=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!o.multiple;var S=o.value;S!=null?sr(l,!!o.multiple,S,!1):v!==!!o.multiple&&(o.defaultValue!=null?sr(l,!!o.multiple,o.defaultValue,!0):sr(l,!!o.multiple,o.multiple?[]:"",!1))}l[hl]=o}catch(w){Ce(e,e.return,w)}}break;case 6:if(ht(t,e),kt(e),r&4){if(e.stateNode===null)throw Error(_(162));l=e.stateNode,o=e.memoizedProps;try{l.nodeValue=o}catch(w){Ce(e,e.return,w)}}break;case 3:if(ht(t,e),kt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ul(t.containerInfo)}catch(w){Ce(e,e.return,w)}break;case 4:ht(t,e),kt(e);break;case 13:ht(t,e),kt(e),l=e.child,l.flags&8192&&(o=l.memoizedState!==null,l.stateNode.isHidden=o,!o||l.alternate!==null&&l.alternate.memoizedState!==null||(Ts=be())),r&4&&tc(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Be=(c=Be)||p,ht(t,e),Be=c):ht(t,e),kt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(A=e,p=e.child;p!==null;){for(f=A=p;A!==null;){switch(v=A,S=v.child,v.tag){case 0:case 11:case 14:case 15:el(4,v,v.return);break;case 1:ir(v,v.return);var j=v.stateNode;if(typeof j.componentWillUnmount=="function"){r=v,n=v.return;try{t=r,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(w){Ce(r,n,w)}}break;case 5:ir(v,v.return);break;case 22:if(v.memoizedState!==null){rc(f);continue}}S!==null?(S.return=v,A=S):rc(f)}p=p.sibling}e:for(p=null,f=e;;){if(f.tag===5){if(p===null){p=f;try{l=f.stateNode,c?(o=l.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=f.stateNode,u=f.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,s.style.display=ud("display",a))}catch(w){Ce(e,e.return,w)}}}else if(f.tag===6){if(p===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(w){Ce(e,e.return,w)}}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;p===f&&(p=null),f=f.return}p===f&&(p=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ht(t,e),kt(e),r&4&&tc(e);break;case 21:break;default:ht(t,e),kt(e)}}function kt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ff(n)){var r=n;break e}n=n.return}throw Error(_(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(ol(l,""),r.flags&=-33);var o=ec(e);_a(e,o,l);break;case 3:case 4:var a=r.stateNode.containerInfo,s=ec(e);La(e,s,a);break;default:throw Error(_(161))}}catch(u){Ce(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ym(e,t,n){A=e,Uf(e)}function Uf(e,t,n){for(var r=(e.mode&1)!==0;A!==null;){var l=A,o=l.child;if(l.tag===22&&r){var a=l.memoizedState!==null||Yl;if(!a){var s=l.alternate,u=s!==null&&s.memoizedState!==null||Be;s=Yl;var c=Be;if(Yl=a,(Be=u)&&!c)for(A=l;A!==null;)a=A,u=a.child,a.tag===22&&a.memoizedState!==null?lc(l):u!==null?(u.return=a,A=u):lc(l);for(;o!==null;)A=o,Uf(o),o=o.sibling;A=l,Yl=s,Be=c}nc(e)}else l.subtreeFlags&8772&&o!==null?(o.return=l,A=o):nc(e)}}function nc(e){for(;A!==null;){var t=A;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Be||Jo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Be)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:mt(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Ou(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ou(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.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 p=c.memoizedState;if(p!==null){var f=p.dehydrated;f!==null&&ul(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}Be||t.flags&512&&Pa(t)}catch(v){Ce(t,t.return,v)}}if(t===e){A=null;break}if(n=t.sibling,n!==null){n.return=t.return,A=n;break}A=t.return}}function rc(e){for(;A!==null;){var t=A;if(t===e){A=null;break}var n=t.sibling;if(n!==null){n.return=t.return,A=n;break}A=t.return}}function lc(e){for(;A!==null;){var t=A;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Jo(4,t)}catch(u){Ce(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){Ce(t,l,u)}}var o=t.return;try{Pa(t)}catch(u){Ce(t,o,u)}break;case 5:var a=t.return;try{Pa(t)}catch(u){Ce(t,a,u)}}}catch(u){Ce(t,t.return,u)}if(t===e){A=null;break}var s=t.sibling;if(s!==null){s.return=t.return,A=s;break}A=t.return}}var Xm=Math.ceil,Lo=$t.ReactCurrentDispatcher,Ns=$t.ReactCurrentOwner,dt=$t.ReactCurrentBatchConfig,oe=0,Pe=null,ze=null,Me=0,tt=0,ar=mn(0),Re=0,Sl=null,Fn=0,qo=0,zs=0,tl=null,Ye=null,Ts=0,Sr=1/0,Dt=null,_o=!1,Ia=null,un=null,Xl=!1,tn=null,Io=0,nl=0,Fa=null,uo=-1,co=0;function Ke(){return oe&6?be():uo!==-1?uo:uo=be()}function cn(e){return e.mode&1?oe&2&&Me!==0?Me&-Me:_m.transition!==null?(co===0&&(co=jd()),co):(e=de,e!==0||(e=window.event,e=e===void 0?16:Td(e.type)),e):1}function St(e,t,n,r){if(50<nl)throw nl=0,Fa=null,Error(_(185));Cl(e,n,r),(!(oe&2)||e!==Pe)&&(e===Pe&&(!(oe&2)&&(qo|=n),Re===4&&qt(e,Me)),et(e,r),n===1&&oe===0&&!(t.mode&1)&&(Sr=be()+500,Zo&&vn()))}function et(e,t){var n=e.callbackNode;_h(e,t);var r=go(e,e===Pe?Me:0);if(r===0)n!==null&&pu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&pu(n),t===1)e.tag===0?Lm(oc.bind(null,e)):Qd(oc.bind(null,e)),Tm(function(){!(oe&6)&&vn()}),n=null;else{switch(kd(r)){case 1:n=ts;break;case 4:n=Sd;break;case 16:n=yo;break;case 536870912:n=wd;break;default:n=yo}n=Gf(n,Of.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Of(e,t){if(uo=-1,co=0,oe&6)throw Error(_(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var r=go(e,e===Pe?Me:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Fo(e,r);else{t=r;var l=oe;oe|=2;var o=$f();(Pe!==e||Me!==t)&&(Dt=null,Sr=be()+500,Dn(e,t));do try{ev();break}catch(s){Bf(e,s)}while(!0);hs(),Lo.current=o,oe=l,ze!==null?t=0:(Pe=null,Me=0,t=Re)}if(t!==0){if(t===2&&(l=ua(e),l!==0&&(r=l,t=Ma(e,l))),t===1)throw n=Sl,Dn(e,0),qt(e,r),et(e,be()),n;if(t===6)qt(e,r);else{if(l=e.current.alternate,!(r&30)&&!Jm(l)&&(t=Fo(e,r),t===2&&(o=ua(e),o!==0&&(r=o,t=Ma(e,o))),t===1))throw n=Sl,Dn(e,0),qt(e,r),et(e,be()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:kn(e,Ye,Dt);break;case 3:if(qt(e,r),(r&130023424)===r&&(t=Ts+500-be(),10<t)){if(go(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){Ke(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=ya(kn.bind(null,e,Ye,Dt),t);break}kn(e,Ye,Dt);break;case 4:if(qt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var a=31-xt(r);o=1<<a,a=t[a],a>l&&(l=a),r&=~o}if(r=l,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Xm(r/1960))-r,10<r){e.timeoutHandle=ya(kn.bind(null,e,Ye,Dt),r);break}kn(e,Ye,Dt);break;case 5:kn(e,Ye,Dt);break;default:throw Error(_(329))}}}return et(e,be()),e.callbackNode===n?Of.bind(null,e):null}function Ma(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(Dn(e,t).flags|=256),e=Fo(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&Aa(t)),e}function Aa(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function Jm(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 l=n[r],o=l.getSnapshot;l=l.value;try{if(!wt(o(),l))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 qt(e,t){for(t&=~zs,t&=~qo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xt(t),r=1<<n;e[n]=-1,t&=~r}}function oc(e){if(oe&6)throw Error(_(327));pr();var t=go(e,0);if(!(t&1))return et(e,be()),null;var n=Fo(e,t);if(e.tag!==0&&n===2){var r=ua(e);r!==0&&(t=r,n=Ma(e,r))}if(n===1)throw n=Sl,Dn(e,0),qt(e,t),et(e,be()),n;if(n===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,kn(e,Ye,Dt),et(e,be()),null}function Rs(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Sr=be()+500,Zo&&vn())}}function Mn(e){tn!==null&&tn.tag===0&&!(oe&6)&&pr();var t=oe;oe|=1;var n=dt.transition,r=de;try{if(dt.transition=null,de=1,e)return e()}finally{de=r,dt.transition=n,oe=t,!(oe&6)&&vn()}}function Ds(){tt=ar.current,ve(ar)}function Dn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zm(n)),ze!==null)for(n=ze.return;n!==null;){var r=n;switch(ds(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ko();break;case 3:gr(),ve(Je),ve($e),Ss();break;case 5:xs(r);break;case 4:gr();break;case 13:ve(xe);break;case 19:ve(xe);break;case 10:ms(r.type._context);break;case 22:case 23:Ds()}n=n.return}if(Pe=e,ze=e=dn(e.current,null),Me=tt=t,Re=0,Sl=null,zs=qo=Fn=0,Ye=tl=null,zn!==null){for(t=0;t<zn.length;t++)if(n=zn[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=l,r.next=a}n.pending=r}zn=null}return e}function Bf(e,t){do{var n=ze;try{if(hs(),io.current=Po,Do){for(var r=Se.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Do=!1}if(In=0,De=Te=Se=null,qr=!1,yl=0,Ns.current=null,n===null||n.return===null){Re=1,Sl=t,ze=null;break}e:{var o=e,a=n.return,s=n,u=t;if(t=Me,s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,p=s,f=p.tag;if(!(p.mode&1)&&(f===0||f===11||f===15)){var v=p.alternate;v?(p.updateQueue=v.updateQueue,p.memoizedState=v.memoizedState,p.lanes=v.lanes):(p.updateQueue=null,p.memoizedState=null)}var S=Ku(a);if(S!==null){S.flags&=-257,Gu(S,a,s,o,t),S.mode&1&&Vu(o,c,t),t=S,u=c;var j=t.updateQueue;if(j===null){var w=new Set;w.add(u),t.updateQueue=w}else j.add(u);break e}else{if(!(t&1)){Vu(o,c,t),Ps();break e}u=Error(_(426))}}else if(ge&&s.mode&1){var D=Ku(a);if(D!==null){!(D.flags&65536)&&(D.flags|=256),Gu(D,a,s,o,t),fs(xr(u,s));break e}}o=u=xr(u,s),Re!==4&&(Re=2),tl===null?tl=[o]:tl.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=Cf(o,u,t);Uu(o,g);break e;case 1:s=u;var d=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof d.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(un===null||!un.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var b=bf(o,s,t);Uu(o,b);break e}}o=o.return}while(o!==null)}Hf(n)}catch(E){t=E,ze===n&&n!==null&&(ze=n=n.return);continue}break}while(!0)}function $f(){var e=Lo.current;return Lo.current=Po,e===null?Po:e}function Ps(){(Re===0||Re===3||Re===2)&&(Re=4),Pe===null||!(Fn&268435455)&&!(qo&268435455)||qt(Pe,Me)}function Fo(e,t){var n=oe;oe|=2;var r=$f();(Pe!==e||Me!==t)&&(Dt=null,Dn(e,t));do try{qm();break}catch(l){Bf(e,l)}while(!0);if(hs(),oe=n,Lo.current=r,ze!==null)throw Error(_(261));return Pe=null,Me=0,Re}function qm(){for(;ze!==null;)Wf(ze)}function ev(){for(;ze!==null&&!bh();)Wf(ze)}function Wf(e){var t=Kf(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?Hf(e):ze=t,Ns.current=null}function Hf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Gm(n,t),n!==null){n.flags&=32767,ze=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Re=6,ze=null;return}}else if(n=Km(n,t,tt),n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Re===0&&(Re=5)}function kn(e,t,n){var r=de,l=dt.transition;try{dt.transition=null,de=1,tv(e,t,n,r)}finally{dt.transition=l,de=r}return null}function tv(e,t,n,r){do pr();while(tn!==null);if(oe&6)throw Error(_(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Ih(e,o),e===Pe&&(ze=Pe=null,Me=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xl||(Xl=!0,Gf(yo,function(){return pr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=dt.transition,dt.transition=null;var a=de;de=1;var s=oe;oe|=4,Ns.current=null,Zm(e,n),Af(n,e),wm(ma),xo=!!ha,ma=ha=null,e.current=n,Ym(n),Eh(),oe=s,de=a,dt.transition=o}else e.current=n;if(Xl&&(Xl=!1,tn=e,Io=l),o=e.pendingLanes,o===0&&(un=null),Th(n.stateNode),et(e,be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(_o)throw _o=!1,e=Ia,Ia=null,e;return Io&1&&e.tag!==0&&pr(),o=e.pendingLanes,o&1?e===Fa?nl++:(nl=0,Fa=e):nl=0,vn(),null}function pr(){if(tn!==null){var e=kd(Io),t=dt.transition,n=de;try{if(dt.transition=null,de=16>e?16:e,tn===null)var r=!1;else{if(e=tn,tn=null,Io=0,oe&6)throw Error(_(331));var l=oe;for(oe|=4,A=e.current;A!==null;){var o=A,a=o.child;if(A.flags&16){var s=o.deletions;if(s!==null){for(var u=0;u<s.length;u++){var c=s[u];for(A=c;A!==null;){var p=A;switch(p.tag){case 0:case 11:case 15:el(8,p,o)}var f=p.child;if(f!==null)f.return=p,A=f;else for(;A!==null;){p=A;var v=p.sibling,S=p.return;if(If(p),p===c){A=null;break}if(v!==null){v.return=S,A=v;break}A=S}}}var j=o.alternate;if(j!==null){var w=j.child;if(w!==null){j.child=null;do{var D=w.sibling;w.sibling=null,w=D}while(w!==null)}}A=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,A=a;else e:for(;A!==null;){if(o=A,o.flags&2048)switch(o.tag){case 0:case 11:case 15:el(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,A=g;break e}A=o.return}}var d=e.current;for(A=d;A!==null;){a=A;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,A=y;else e:for(a=d;A!==null;){if(s=A,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Jo(9,s)}}catch(E){Ce(s,s.return,E)}if(s===a){A=null;break e}var b=s.sibling;if(b!==null){b.return=s.return,A=b;break e}A=s.return}}if(oe=l,vn(),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ho,e)}catch{}r=!0}return r}finally{de=n,dt.transition=t}}return!1}function ic(e,t,n){t=xr(n,t),t=Cf(e,t,1),e=sn(e,t,1),t=Ke(),e!==null&&(Cl(e,1,t),et(e,t))}function Ce(e,t,n){if(e.tag===3)ic(e,e,n);else for(;t!==null;){if(t.tag===3){ic(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(un===null||!un.has(r))){e=xr(n,e),e=bf(t,e,1),t=sn(t,e,1),e=Ke(),t!==null&&(Cl(t,1,e),et(t,e));break}}t=t.return}}function nv(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ke(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(Me&n)===n&&(Re===4||Re===3&&(Me&130023424)===Me&&500>be()-Ts?Dn(e,0):zs|=n),et(e,t)}function Vf(e,t){t===0&&(e.mode&1?(t=Bl,Bl<<=1,!(Bl&130023424)&&(Bl=4194304)):t=1);var n=Ke();e=Ut(e,t),e!==null&&(Cl(e,t,n),et(e,n))}function rv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vf(e,n)}function lv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Vf(e,n)}var Kf;Kf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xe=!1,Vm(e,t,n);Xe=!!(e.flags&131072)}else Xe=!1,ge&&t.flags&1048576&&Zd(t,Eo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;so(e,t),e=t.pendingProps;var l=mr(t,$e.current);fr(t,n),l=js(null,t,r,e,l,n);var o=ks();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qe(r)?(o=!0,Co(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ys(t),l.updater=Xo,t.stateNode=l,l._reactInternals=t,Ca(t,r,e,n),t=Na(null,t,r,!0,o,n)):(t.tag=0,ge&&o&&cs(t),Ve(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(so(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=iv(r),e=mt(r,e),l){case 0:t=Ea(null,t,r,e,n);break e;case 1:t=Yu(null,t,r,e,n);break e;case 11:t=Qu(null,t,r,e,n);break e;case 14:t=Zu(null,t,r,mt(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:mt(r,l),Ea(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:mt(r,l),Yu(e,t,r,l,n);case 3:e:{if(Tf(t),e===null)throw Error(_(387));r=t.pendingProps,o=t.memoizedState,l=o.element,tf(e,t),To(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=xr(Error(_(423)),t),t=Xu(e,t,r,n,l);break e}else if(r!==l){l=xr(Error(_(424)),t),t=Xu(e,t,r,n,l);break e}else for(rt=an(t.stateNode.containerInfo.firstChild),lt=t,ge=!0,gt=null,n=qd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vr(),r===l){t=Ot(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return nf(t),e===null&&wa(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,a=l.children,va(r,l)?a=null:o!==null&&va(r,o)&&(t.flags|=32),zf(e,t),Ve(e,t,a,n),t.child;case 6:return e===null&&wa(t),null;case 13:return Rf(e,t,n);case 4:return gs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yr(t,null,r,n):Ve(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:mt(r,l),Qu(e,t,r,l,n);case 7:return Ve(e,t,t.pendingProps,n),t.child;case 8:return Ve(e,t,t.pendingProps.children,n),t.child;case 12:return Ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,a=l.value,he(No,r._currentValue),r._currentValue=a,o!==null)if(wt(o.value,a)){if(o.children===l.children&&!Je.current){t=Ot(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=It(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),ja(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(_(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ja(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Ve(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,fr(t,n),l=ft(l),r=r(l),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,l=mt(r,t.pendingProps),l=mt(r.type,l),Zu(e,t,r,l,n);case 15:return Ef(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:mt(r,l),so(e,t),t.tag=1,qe(r)?(e=!0,Co(t)):e=!1,fr(t,n),kf(t,r,l),Ca(t,r,l,n),Na(null,t,r,!0,e,n);case 19:return Df(e,t,n);case 22:return Nf(e,t,n)}throw Error(_(156,t.tag))};function Gf(e,t){return xd(e,t)}function ov(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 ct(e,t,n,r){return new ov(e,t,n,r)}function Ls(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iv(e){if(typeof e=="function")return Ls(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ja)return 11;if(e===qa)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=ct(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 fo(e,t,n,r,l,o){var a=2;if(r=e,typeof e=="function")Ls(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Xn:return Pn(n.children,l,o,t);case Xa:a=8,l|=8;break;case Qi:return e=ct(12,n,t,l|2),e.elementType=Qi,e.lanes=o,e;case Zi:return e=ct(13,n,t,l),e.elementType=Zi,e.lanes=o,e;case Yi:return e=ct(19,n,t,l),e.elementType=Yi,e.lanes=o,e;case nd:return ei(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ed:a=10;break e;case td:a=9;break e;case Ja:a=11;break e;case qa:a=14;break e;case Yt:a=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=ct(a,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Pn(e,t,n,r){return e=ct(7,e,r,t),e.lanes=n,e}function ei(e,t,n,r){return e=ct(22,e,r,t),e.elementType=nd,e.lanes=n,e.stateNode={isHidden:!1},e}function Ai(e,t,n){return e=ct(6,e,null,t),e.lanes=n,e}function Ui(e,t,n){return t=ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function av(e,t,n,r,l){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=xi(0),this.expirationTimes=xi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xi(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function _s(e,t,n,r,l,o,a,s,u){return e=new av(e,t,n,s,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ct(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ys(o),e}function sv(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Qf(e){if(!e)return pn;e=e._reactInternals;e:{if(Bn(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(qe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var n=e.type;if(qe(n))return Gd(e,n,t)}return t}function Zf(e,t,n,r,l,o,a,s,u){return e=_s(n,r,!0,e,l,o,a,s,u),e.context=Qf(null),n=e.current,r=Ke(),l=cn(n),o=It(r,l),o.callback=t??null,sn(n,o,l),e.current.lanes=l,Cl(e,l,r),et(e,r),e}function ti(e,t,n,r){var l=t.current,o=Ke(),a=cn(l);return n=Qf(n),t.context===null?t.context=n:t.pendingContext=n,t=It(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=sn(l,t,a),e!==null&&(St(e,l,a,o),oo(e,l,a)),a}function Mo(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 ac(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Is(e,t){ac(e,t),(e=e.alternate)&&ac(e,t)}function uv(){return null}var Yf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fs(e){this._internalRoot=e}ni.prototype.render=Fs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));ti(e,t,null,null)};ni.prototype.unmount=Fs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Mn(function(){ti(null,e,null,null)}),t[At]=null}};function ni(e){this._internalRoot=e}ni.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ed();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jt.length&&t!==0&&t<Jt[n].priority;n++);Jt.splice(n,0,e),n===0&&zd(e)}};function Ms(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ri(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sc(){}function cv(e,t,n,r,l){if(l){if(typeof r=="function"){var o=r;r=function(){var c=Mo(a);o.call(c)}}var a=Zf(t,r,e,0,null,!1,!1,"",sc);return e._reactRootContainer=a,e[At]=a.current,fl(e.nodeType===8?e.parentNode:e),Mn(),a}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var s=r;r=function(){var c=Mo(u);s.call(c)}}var u=_s(e,0,!1,null,null,!1,!1,"",sc);return e._reactRootContainer=u,e[At]=u.current,fl(e.nodeType===8?e.parentNode:e),Mn(function(){ti(t,u,n,r)}),u}function li(e,t,n,r,l){var o=n._reactRootContainer;if(o){var a=o;if(typeof l=="function"){var s=l;l=function(){var u=Mo(a);s.call(u)}}ti(t,a,e,l)}else a=cv(n,t,e,l,r);return Mo(a)}Cd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Vr(t.pendingLanes);n!==0&&(ns(t,n|1),et(t,be()),!(oe&6)&&(Sr=be()+500,vn()))}break;case 13:Mn(function(){var r=Ut(e,1);if(r!==null){var l=Ke();St(r,e,1,l)}}),Is(e,1)}};rs=function(e){if(e.tag===13){var t=Ut(e,134217728);if(t!==null){var n=Ke();St(t,e,134217728,n)}Is(e,134217728)}};bd=function(e){if(e.tag===13){var t=cn(e),n=Ut(e,t);if(n!==null){var r=Ke();St(n,e,t,r)}Is(e,t)}};Ed=function(){return de};Nd=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};ia=function(e,t,n){switch(t){case"input":if(qi(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 l=Qo(r);if(!l)throw Error(_(90));ld(r),qi(r,l)}}}break;case"textarea":id(e,n);break;case"select":t=n.value,t!=null&&sr(e,!!n.multiple,t,!1)}};pd=Rs;hd=Mn;var dv={usingClientEntryPoint:!1,Events:[El,tr,Qo,dd,fd,Rs]},Ar={findFiberByHostInstance:Nn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fv={bundleType:Ar.bundleType,version:Ar.version,rendererPackageName:Ar.rendererPackageName,rendererConfig:Ar.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yd(e),e===null?null:e.stateNode},findFiberByHostInstance:Ar.findFiberByHostInstance||uv,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 Jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jl.isDisabled&&Jl.supportsFiber)try{Ho=Jl.inject(fv),Nt=Jl}catch{}}it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dv;it.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ms(t))throw Error(_(200));return sv(e,t,null,n)};it.createRoot=function(e,t){if(!Ms(e))throw Error(_(299));var n=!1,r="",l=Yf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=_s(e,1,!1,null,null,n,!1,r,l),e[At]=t.current,fl(e.nodeType===8?e.parentNode:e),new Fs(t)};it.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(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=yd(t),e=e===null?null:e.stateNode,e};it.flushSync=function(e){return Mn(e)};it.hydrate=function(e,t,n){if(!ri(t))throw Error(_(200));return li(null,e,t,!0,n)};it.hydrateRoot=function(e,t,n){if(!Ms(e))throw Error(_(405));var r=n!=null&&n.hydratedSources||null,l=!1,o="",a=Yf;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Zf(t,null,e,1,n??null,l,!1,o,a),e[At]=t.current,fl(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new ni(t)};it.render=function(e,t,n){if(!ri(t))throw Error(_(200));return li(null,e,t,!1,n)};it.unmountComponentAtNode=function(e){if(!ri(e))throw Error(_(40));return e._reactRootContainer?(Mn(function(){li(null,null,e,!1,function(){e._reactRootContainer=null,e[At]=null})}),!0):!1};it.unstable_batchedUpdates=Rs;it.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ri(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return li(e,t,n,!1,r)};it.version="18.3.1-next-f1338f8080-20240426";function Xf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xf)}catch(e){console.error(e)}}Xf(),Yc.exports=it;var oi=Yc.exports;const pv=Ac(oi),hv=Mc({__proto__:null,default:pv},[oi]);var Jf,uc=oi;Jf=uc.createRoot,uc.hydrateRoot;const qf=m.createContext(null);function mv({children:e}){const[t,n]=m.useState(()=>sessionStorage.getItem("adminPassword")),r=m.useCallback(a=>{sessionStorage.setItem("adminPassword",a),n(a)},[]),l=m.useCallback((a,s={})=>fetch(a,{...s,headers:{...s.headers,...t?{"X-Admin-Password":t}:{}}}),[t]),o=m.useMemo(()=>({password:t,setPassword:r,apiFetch:l,isAuthenticated:!!t}),[t,r,l]);return i.jsx(qf.Provider,{value:o,children:e})}function zl(){const e=m.useContext(qf);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}/**
41
+ * @license lucide-react v0.577.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const ep=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
+ * @license lucide-react v0.577.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */const vv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
51
+ * @license lucide-react v0.577.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const yv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
56
+ * @license lucide-react v0.577.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const cc=e=>{const t=yv(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
61
+ * @license lucide-react v0.577.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */var gv={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"};/**
66
+ * @license lucide-react v0.577.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const xv=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
71
+ * @license lucide-react v0.577.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const Sv=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:o,iconNode:a,...s},u)=>m.createElement("svg",{ref:u,...gv,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ep("lucide",l),...!o&&!xv(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,p])=>m.createElement(c,p)),...Array.isArray(o)?o:[o]]));/**
76
+ * @license lucide-react v0.577.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Le=(e,t)=>{const n=m.forwardRef(({className:r,...l},o)=>m.createElement(Sv,{ref:o,iconNode:t,className:ep(`lucide-${vv(cc(e))}`,`lucide-${e}`,r),...l}));return n.displayName=cc(e),n};/**
81
+ * @license lucide-react v0.577.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const wv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jv=Le("chevron-down",wv);/**
86
+ * @license lucide-react v0.577.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const kv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Cv=Le("circle-question-mark",kv);/**
91
+ * @license lucide-react v0.577.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const bv=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Ev=Le("git-branch",bv);/**
96
+ * @license lucide-react v0.577.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Nv=[["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"}]],Ao=Le("globe",Nv);/**
101
+ * @license lucide-react v0.577.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const zv=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Tv=Le("key-round",zv);/**
106
+ * @license lucide-react v0.577.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Rv=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Dv=Le("link",Rv);/**
111
+ * @license lucide-react v0.577.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Pv=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],bt=Le("loader",Pv);/**
116
+ * @license lucide-react v0.577.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Lv=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],_v=Le("log-in",Lv);/**
121
+ * @license lucide-react v0.577.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const Iv=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Fv=Le("package",Iv);/**
126
+ * @license lucide-react v0.577.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Mv=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Av=Le("play",Mv);/**
131
+ * @license lucide-react v0.577.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const Uv=[["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"}]],Ov=Le("refresh-cw",Uv);/**
136
+ * @license lucide-react v0.577.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Bv=[["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"}]],dc=Le("rotate-cw",Bv);/**
141
+ * @license lucide-react v0.577.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const $v=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Wv=Le("save",$v);/**
146
+ * @license lucide-react v0.577.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const Hv=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vv=Le("settings",Hv);/**
151
+ * @license lucide-react v0.577.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const Kv=[["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"}]],fc=Le("shield-check",Kv);/**
156
+ * @license lucide-react v0.577.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const Gv=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],pc=Le("undo-2",Gv);/**
161
+ * @license lucide-react v0.577.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const Qv=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],Zv=Le("unlink",Qv);/**
166
+ * @license lucide-react v0.577.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Yv=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Xv=Le("zap",Yv);function Jv({children:e}){const{isAuthenticated:t,setPassword:n}=zl(),[r,l]=m.useState(""),[o,a]=m.useState(""),[s,u]=m.useState(!1);if(t)return i.jsx(i.Fragment,{children:e});const c=async p=>{if(p.preventDefault(),!!r.trim()){u(!0),a("");try{(await fetch("/api/health",{headers:{"X-Admin-Password":r}})).ok?n(r):a("잘못된 비밀번호입니다.")}catch{a("서버에 연결할 수 없습니다.")}finally{u(!1)}}};return i.jsx("div",{className:"password-gate-overlay",children:i.jsxs("div",{className:"password-gate-card",children:[i.jsx("div",{className:"password-gate-logo",children:"☕"}),i.jsx("h2",{children:"Brewnet Admin"}),i.jsxs("form",{onSubmit:c,children:[i.jsx("input",{className:"password-gate-input",type:"password",placeholder:"Admin password",value:r,onChange:p=>l(p.target.value),autoFocus:!0,disabled:s}),o&&i.jsx("p",{className:"password-gate-error",children:o}),i.jsx("button",{className:"btn bp",type:"submit",disabled:s,style:{width:"100%",justifyContent:"center",opacity:s?.6:1},children:s?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," 확인 중…"]}):i.jsxs(i.Fragment,{children:[i.jsx(_v,{size:14})," 확인"]})})]})]})})}/**
171
+ * @remix-run/router v1.23.2
172
+ *
173
+ * Copyright (c) Remix Software Inc.
174
+ *
175
+ * This source code is licensed under the MIT license found in the
176
+ * LICENSE.md file in the root directory of this source tree.
177
+ *
178
+ * @license MIT
179
+ */function ye(){return ye=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},ye.apply(this,arguments)}var Ne;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ne||(Ne={}));const hc="popstate";function qv(e){e===void 0&&(e={});function t(r,l){let{pathname:o,search:a,hash:s}=r.location;return wl("",{pathname:o,search:a,hash:s},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Un(l)}return ty(t,n,null,e)}function J(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function An(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ey(){return Math.random().toString(36).substr(2,8)}function mc(e,t){return{usr:e.state,key:e.key,idx:t}}function wl(e,t,n,r){return n===void 0&&(n=null),ye({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?yn(t):t,{state:n,key:t&&t.key||r||ey()})}function Un(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 yn(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 ty(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,a=l.history,s=Ne.Pop,u=null,c=p();c==null&&(c=0,a.replaceState(ye({},a.state,{idx:c}),""));function p(){return(a.state||{idx:null}).idx}function f(){s=Ne.Pop;let D=p(),g=D==null?null:D-c;c=D,u&&u({action:s,location:w.location,delta:g})}function v(D,g){s=Ne.Push;let d=wl(w.location,D,g);c=p()+1;let y=mc(d,c),b=w.createHref(d);try{a.pushState(y,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;l.location.assign(b)}o&&u&&u({action:s,location:w.location,delta:1})}function S(D,g){s=Ne.Replace;let d=wl(w.location,D,g);c=p();let y=mc(d,c),b=w.createHref(d);a.replaceState(y,"",b),o&&u&&u({action:s,location:w.location,delta:0})}function j(D){let g=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof D=="string"?D:Un(D);return d=d.replace(/ $/,"%20"),J(g,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,g)}let w={get action(){return s},get location(){return e(l,a)},listen(D){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(hc,f),u=D,()=>{l.removeEventListener(hc,f),u=null}},createHref(D){return t(l,D)},createURL:j,encodeLocation(D){let g=j(D);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:v,replace:S,go(D){return a.go(D)}};return w}var ue;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ue||(ue={}));const ny=new Set(["lazy","caseSensitive","path","id","index","children"]);function ry(e){return e.index===!0}function Uo(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,o)=>{let a=[...n,String(o)],s=typeof l.id=="string"?l.id:a.join("-");if(J(l.index!==!0||!l.children,"Cannot specify children on an index route"),J(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),ry(l)){let u=ye({},l,t(l),{id:s});return r[s]=u,u}else{let u=ye({},l,t(l),{id:s,children:void 0});return r[s]=u,l.children&&(u.children=Uo(l.children,t,a,r)),u}})}function Cn(e,t,n){return n===void 0&&(n="/"),po(e,t,n,!1)}function po(e,t,n,r){let l=typeof t=="string"?yn(t):t,o=Bt(l.pathname||"/",n);if(o==null)return null;let a=tp(e);oy(a);let s=null;for(let u=0;s==null&&u<a.length;++u){let c=vy(o);s=hy(a[u],c,r)}return s}function ly(e,t){let{route:n,pathname:r,params:l}=e;return{id:n.id,pathname:r,params:l,data:t[n.id],handle:n.handle}}function tp(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(o,a,s)=>{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(J(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Ft([r,u.relativePath]),p=n.concat(u);o.children&&o.children.length>0&&(J(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),tp(o.children,t,p,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:fy(c,o.index),routesMeta:p})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))l(o,a);else for(let u of np(o.path))l(o,a,u)}),t}function np(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let a=np(r.join("/")),s=[];return s.push(...a.map(u=>u===""?o:[o,u].join("/"))),l&&s.push(...a),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function oy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:py(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iy=/^:[\w-]+$/,ay=3,sy=2,uy=1,cy=10,dy=-2,vc=e=>e==="*";function fy(e,t){let n=e.split("/"),r=n.length;return n.some(vc)&&(r+=dy),t&&(r+=sy),n.filter(l=>!vc(l)).reduce((l,o)=>l+(iy.test(o)?ay:o===""?uy:cy),r)}function py(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function hy(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,l={},o="/",a=[];for(let s=0;s<r.length;++s){let u=r[s],c=s===r.length-1,p=o==="/"?t:t.slice(o.length)||"/",f=Oo({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},p),v=u.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=Oo({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(l,f.params),a.push({params:l,pathname:Ft([o,f.pathname]),pathnameBase:Sy(Ft([o,f.pathnameBase])),route:v}),f.pathnameBase!=="/"&&(o=Ft([o,f.pathnameBase]))}return a}function Oo(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=my(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],a=o.replace(/(.)\/+$/,"$1"),s=l.slice(1);return{params:r.reduce((c,p,f)=>{let{paramName:v,isOptional:S}=p;if(v==="*"){let w=s[f]||"";a=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const j=s[f];return S&&!j?c[v]=void 0:c[v]=(j||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function my(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),An(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=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,u)=>(r.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function vy(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return An(!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 Bt(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 yy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gy=e=>yy.test(e);function xy(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?yn(e):e,o;if(n)if(gy(n))o=n;else{if(n.includes("//")){let a=n;n=n.replace(/\/\/+/g,"/"),An(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=yc(n.substring(1),"/"):o=yc(n,t)}else o=t;return{pathname:o,search:wy(r),hash:jy(l)}}function yc(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Oi(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 rp(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ii(e,t){let n=rp(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ai(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=yn(e):(l=ye({},e),J(!l.pathname||!l.pathname.includes("?"),Oi("?","pathname","search",l)),J(!l.pathname||!l.pathname.includes("#"),Oi("#","pathname","hash",l)),J(!l.search||!l.search.includes("#"),Oi("#","search","hash",l)));let o=e===""||l.pathname==="",a=o?"/":l.pathname,s;if(a==null)s=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let v=a.split("/");for(;v[0]==="..";)v.shift(),f-=1;l.pathname=v.join("/")}s=f>=0?t[f]:"/"}let u=xy(l,s),c=a&&a!=="/"&&a.endsWith("/"),p=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}const Ft=e=>e.join("/").replace(/\/\/+/g,"/"),Sy=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wy=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Bo{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function jl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lp=["post","put","patch","delete"],ky=new Set(lp),Cy=["get",...lp],by=new Set(Cy),Ey=new Set([301,302,303,307,308]),Ny=new Set([307,308]),Bi={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zy={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ur={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},As=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ty=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),op="remix-router-transitions";function Ry(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;J(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let x=e.detectErrorBoundary;l=C=>({hasErrorBoundary:x(C)})}else l=Ty;let o={},a=Uo(e.routes,l,void 0,o),s,u=e.basename||"/",c=e.dataStrategy||_y,p=e.patchRoutesOnNavigation,f=ye({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),v=null,S=new Set,j=null,w=null,D=null,g=e.hydrationData!=null,d=Cn(a,e.history.location,u),y=!1,b=null;if(d==null&&!p){let x=Ze(404,{pathname:e.history.location.pathname}),{matches:C,route:N}=zc(a);d=C,b={[N.id]:x}}d&&!e.hydrationData&&Pl(d,a,e.history.location.pathname).active&&(d=null);let E;if(d)if(d.some(x=>x.route.lazy))E=!1;else if(!d.some(x=>x.route.loader))E=!0;else if(f.v7_partialHydration){let x=e.hydrationData?e.hydrationData.loaderData:null,C=e.hydrationData?e.hydrationData.errors:null;if(C){let N=d.findIndex(P=>C[P.route.id]!==void 0);E=d.slice(0,N+1).every(P=>!Oa(P.route,x,C))}else E=d.every(N=>!Oa(N.route,x,C))}else E=e.hydrationData!=null;else if(E=!1,d=[],f.v7_partialHydration){let x=Pl(null,a,e.history.location.pathname);x.active&&x.matches&&(y=!0,d=x.matches)}let T,h={historyAction:e.history.action,location:e.history.location,matches:d,initialized:E,navigation:Bi,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},k=Ne.Pop,I=!1,R,K=!1,L=new Map,Q=null,le=!1,_e=!1,H=[],fe=new Set,z=new Map,F=0,W=-1,q=new Map,Z=new Set,We=new Map,ee=new Map,O=new Set,ne=new Map,se=new Map,Ht;function Vt(){if(v=e.history.listen(x=>{let{action:C,location:N,delta:P}=x;if(Ht){Ht(),Ht=void 0;return}An(se.size===0||P!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let M=Xs({currentLocation:h.location,nextLocation:N,historyAction:C});if(M&&P!=null){let G=new Promise(Y=>{Ht=Y});e.history.go(P*-1),Dl(M,{state:"blocked",location:N,proceed(){Dl(M,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),G.then(()=>e.history.go(P))},reset(){let Y=new Map(h.blockers);Y.set(M,Ur),He({blockers:Y})}});return}return xn(C,N)}),n){Qy(t,L);let x=()=>Zy(t,L);t.addEventListener("pagehide",x),Q=()=>t.removeEventListener("pagehide",x)}return h.initialized||xn(Ne.Pop,h.location,{initialHydration:!0}),T}function Cp(){v&&v(),Q&&Q(),S.clear(),R&&R.abort(),h.fetchers.forEach((x,C)=>Rl(C)),h.blockers.forEach((x,C)=>Ys(C))}function bp(x){return S.add(x),()=>S.delete(x)}function He(x,C){C===void 0&&(C={}),h=ye({},h,x);let N=[],P=[];f.v7_fetcherPersist&&h.fetchers.forEach((M,G)=>{M.state==="idle"&&(O.has(G)?P.push(G):N.push(G))}),O.forEach(M=>{!h.fetchers.has(M)&&!z.has(M)&&P.push(M)}),[...S].forEach(M=>M(h,{deletedFetchers:P,viewTransitionOpts:C.viewTransitionOpts,flushSync:C.flushSync===!0})),f.v7_fetcherPersist?(N.forEach(M=>h.fetchers.delete(M)),P.forEach(M=>Rl(M))):P.forEach(M=>O.delete(M))}function $n(x,C,N){var P,M;let{flushSync:G}=N===void 0?{}:N,Y=h.actionData!=null&&h.navigation.formMethod!=null&&yt(h.navigation.formMethod)&&h.navigation.state==="loading"&&((P=x.state)==null?void 0:P._isRedirect)!==!0,B;C.actionData?Object.keys(C.actionData).length>0?B=C.actionData:B=null:Y?B=h.actionData:B=null;let $=C.loaderData?Ec(h.loaderData,C.loaderData,C.matches||[],C.errors):h.loaderData,U=h.blockers;U.size>0&&(U=new Map(U),U.forEach((re,Ie)=>U.set(Ie,Ur)));let V=I===!0||h.navigation.formMethod!=null&&yt(h.navigation.formMethod)&&((M=x.state)==null?void 0:M._isRedirect)!==!0;s&&(a=s,s=void 0),le||k===Ne.Pop||(k===Ne.Push?e.history.push(x,x.state):k===Ne.Replace&&e.history.replace(x,x.state));let X;if(k===Ne.Pop){let re=L.get(h.location.pathname);re&&re.has(x.pathname)?X={currentLocation:h.location,nextLocation:x}:L.has(x.pathname)&&(X={currentLocation:x,nextLocation:h.location})}else if(K){let re=L.get(h.location.pathname);re?re.add(x.pathname):(re=new Set([x.pathname]),L.set(h.location.pathname,re)),X={currentLocation:h.location,nextLocation:x}}He(ye({},C,{actionData:B,loaderData:$,historyAction:k,location:x,initialized:!0,navigation:Bi,revalidation:"idle",restoreScrollPosition:qs(x,C.matches||h.matches),preventScrollReset:V,blockers:U}),{viewTransitionOpts:X,flushSync:G===!0}),k=Ne.Pop,I=!1,K=!1,le=!1,_e=!1,H=[]}async function Ws(x,C){if(typeof x=="number"){e.history.go(x);return}let N=Ua(h.location,h.matches,u,f.v7_prependBasename,x,f.v7_relativeSplatPath,C==null?void 0:C.fromRouteId,C==null?void 0:C.relative),{path:P,submission:M,error:G}=gc(f.v7_normalizeFormMethod,!1,N,C),Y=h.location,B=wl(h.location,P,C&&C.state);B=ye({},B,e.history.encodeLocation(B));let $=C&&C.replace!=null?C.replace:void 0,U=Ne.Push;$===!0?U=Ne.Replace:$===!1||M!=null&&yt(M.formMethod)&&M.formAction===h.location.pathname+h.location.search&&(U=Ne.Replace);let V=C&&"preventScrollReset"in C?C.preventScrollReset===!0:void 0,X=(C&&C.flushSync)===!0,re=Xs({currentLocation:Y,nextLocation:B,historyAction:U});if(re){Dl(re,{state:"blocked",location:B,proceed(){Dl(re,{state:"proceeding",proceed:void 0,reset:void 0,location:B}),Ws(x,C)},reset(){let Ie=new Map(h.blockers);Ie.set(re,Ur),He({blockers:Ie})}});return}return await xn(U,B,{submission:M,pendingError:G,preventScrollReset:V,replace:C&&C.replace,enableViewTransition:C&&C.viewTransition,flushSync:X})}function Ep(){if(ci(),He({revalidation:"loading"}),h.navigation.state!=="submitting"){if(h.navigation.state==="idle"){xn(h.historyAction,h.location,{startUninterruptedRevalidation:!0});return}xn(k||h.historyAction,h.navigation.location,{overrideNavigation:h.navigation,enableViewTransition:K===!0})}}async function xn(x,C,N){R&&R.abort(),R=null,k=x,le=(N&&N.startUninterruptedRevalidation)===!0,Fp(h.location,h.matches),I=(N&&N.preventScrollReset)===!0,K=(N&&N.enableViewTransition)===!0;let P=s||a,M=N&&N.overrideNavigation,G=N!=null&&N.initialHydration&&h.matches&&h.matches.length>0&&!y?h.matches:Cn(P,C,u),Y=(N&&N.flushSync)===!0;if(G&&h.initialized&&!_e&&Oy(h.location,C)&&!(N&&N.submission&&yt(N.submission.formMethod))){$n(C,{matches:G},{flushSync:Y});return}let B=Pl(G,P,C.pathname);if(B.active&&B.matches&&(G=B.matches),!G){let{error:pe,notFoundMatches:ae,route:je}=di(C.pathname);$n(C,{matches:ae,loaderData:{},errors:{[je.id]:pe}},{flushSync:Y});return}R=new AbortController;let $=Gn(e.history,C,R.signal,N&&N.submission),U;if(N&&N.pendingError)U=[bn(G).route.id,{type:ue.error,error:N.pendingError}];else if(N&&N.submission&&yt(N.submission.formMethod)){let pe=await Np($,C,N.submission,G,B.active,{replace:N.replace,flushSync:Y});if(pe.shortCircuited)return;if(pe.pendingActionResult){let[ae,je]=pe.pendingActionResult;if(nt(je)&&jl(je.error)&&je.error.status===404){R=null,$n(C,{matches:pe.matches,loaderData:{},errors:{[ae]:je.error}});return}}G=pe.matches||G,U=pe.pendingActionResult,M=$i(C,N.submission),Y=!1,B.active=!1,$=Gn(e.history,$.url,$.signal)}let{shortCircuited:V,matches:X,loaderData:re,errors:Ie}=await zp($,C,G,B.active,M,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,N&&N.initialHydration===!0,Y,U);V||(R=null,$n(C,ye({matches:X||G},Nc(U),{loaderData:re,errors:Ie})))}async function Np(x,C,N,P,M,G){G===void 0&&(G={}),ci();let Y=Ky(C,N);if(He({navigation:Y},{flushSync:G.flushSync===!0}),M){let U=await Ll(P,C.pathname,x.signal);if(U.type==="aborted")return{shortCircuited:!0};if(U.type==="error"){let V=bn(U.partialMatches).route.id;return{matches:U.partialMatches,pendingActionResult:[V,{type:ue.error,error:U.error}]}}else if(U.matches)P=U.matches;else{let{notFoundMatches:V,error:X,route:re}=di(C.pathname);return{matches:V,pendingActionResult:[re.id,{type:ue.error,error:X}]}}}let B,$=Gr(P,C);if(!$.route.action&&!$.route.lazy)B={type:ue.error,error:Ze(405,{method:x.method,pathname:C.pathname,routeId:$.route.id})};else if(B=(await Nr("action",h,x,[$],P,null))[$.route.id],x.signal.aborted)return{shortCircuited:!0};if(Rn(B)){let U;return G&&G.replace!=null?U=G.replace:U=kc(B.response.headers.get("Location"),new URL(x.url),u,e.history)===h.location.pathname+h.location.search,await Sn(x,B,!0,{submission:N,replace:U}),{shortCircuited:!0}}if(nn(B))throw Ze(400,{type:"defer-action"});if(nt(B)){let U=bn(P,$.route.id);return(G&&G.replace)!==!0&&(k=Ne.Push),{matches:P,pendingActionResult:[U.route.id,B]}}return{matches:P,pendingActionResult:[$.route.id,B]}}async function zp(x,C,N,P,M,G,Y,B,$,U,V){let X=M||$i(C,G),re=G||Y||Rc(X),Ie=!le&&(!f.v7_partialHydration||!$);if(P){if(Ie){let ke=Hs(V);He(ye({navigation:X},ke!==void 0?{actionData:ke}:{}),{flushSync:U})}let ie=await Ll(N,C.pathname,x.signal);if(ie.type==="aborted")return{shortCircuited:!0};if(ie.type==="error"){let ke=bn(ie.partialMatches).route.id;return{matches:ie.partialMatches,loaderData:{},errors:{[ke]:ie.error}}}else if(ie.matches)N=ie.matches;else{let{error:ke,notFoundMatches:Hn,route:Rr}=di(C.pathname);return{matches:Hn,loaderData:{},errors:{[Rr.id]:ke}}}}let pe=s||a,[ae,je]=Sc(e.history,h,N,re,C,f.v7_partialHydration&&$===!0,f.v7_skipActionErrorRevalidation,_e,H,fe,O,We,Z,pe,u,V);if(fi(ie=>!(N&&N.some(ke=>ke.route.id===ie))||ae&&ae.some(ke=>ke.route.id===ie)),W=++F,ae.length===0&&je.length===0){let ie=Qs();return $n(C,ye({matches:N,loaderData:{},errors:V&&nt(V[1])?{[V[0]]:V[1].error}:null},Nc(V),ie?{fetchers:new Map(h.fetchers)}:{}),{flushSync:U}),{shortCircuited:!0}}if(Ie){let ie={};if(!P){ie.navigation=X;let ke=Hs(V);ke!==void 0&&(ie.actionData=ke)}je.length>0&&(ie.fetchers=Tp(je)),He(ie,{flushSync:U})}je.forEach(ie=>{Gt(ie.key),ie.controller&&z.set(ie.key,ie.controller)});let Wn=()=>je.forEach(ie=>Gt(ie.key));R&&R.signal.addEventListener("abort",Wn);let{loaderResults:zr,fetcherResults:Rt}=await Vs(h,N,ae,je,x);if(x.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",Wn),je.forEach(ie=>z.delete(ie.key));let jt=ql(zr);if(jt)return await Sn(x,jt.result,!0,{replace:B}),{shortCircuited:!0};if(jt=ql(Rt),jt)return Z.add(jt.key),await Sn(x,jt.result,!0,{replace:B}),{shortCircuited:!0};let{loaderData:pi,errors:Tr}=bc(h,N,zr,V,je,Rt,ne);ne.forEach((ie,ke)=>{ie.subscribe(Hn=>{(Hn||ie.done)&&ne.delete(ke)})}),f.v7_partialHydration&&$&&h.errors&&(Tr=ye({},h.errors,Tr));let wn=Qs(),_l=Zs(W),Il=wn||_l||je.length>0;return ye({matches:N,loaderData:pi,errors:Tr},Il?{fetchers:new Map(h.fetchers)}:{})}function Hs(x){if(x&&!nt(x[1]))return{[x[0]]:x[1].data};if(h.actionData)return Object.keys(h.actionData).length===0?null:h.actionData}function Tp(x){return x.forEach(C=>{let N=h.fetchers.get(C.key),P=Or(void 0,N?N.data:void 0);h.fetchers.set(C.key,P)}),new Map(h.fetchers)}function Rp(x,C,N,P){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Gt(x);let M=(P&&P.flushSync)===!0,G=s||a,Y=Ua(h.location,h.matches,u,f.v7_prependBasename,N,f.v7_relativeSplatPath,C,P==null?void 0:P.relative),B=Cn(G,Y,u),$=Pl(B,G,Y);if($.active&&$.matches&&(B=$.matches),!B){Tt(x,C,Ze(404,{pathname:Y}),{flushSync:M});return}let{path:U,submission:V,error:X}=gc(f.v7_normalizeFormMethod,!0,Y,P);if(X){Tt(x,C,X,{flushSync:M});return}let re=Gr(B,U),Ie=(P&&P.preventScrollReset)===!0;if(V&&yt(V.formMethod)){Dp(x,C,U,re,B,$.active,M,Ie,V);return}We.set(x,{routeId:C,path:U}),Pp(x,C,U,re,B,$.active,M,Ie,V)}async function Dp(x,C,N,P,M,G,Y,B,$){ci(),We.delete(x);function U(Ee){if(!Ee.route.action&&!Ee.route.lazy){let Vn=Ze(405,{method:$.formMethod,pathname:N,routeId:C});return Tt(x,C,Vn,{flushSync:Y}),!0}return!1}if(!G&&U(P))return;let V=h.fetchers.get(x);Kt(x,Gy($,V),{flushSync:Y});let X=new AbortController,re=Gn(e.history,N,X.signal,$);if(G){let Ee=await Ll(M,new URL(re.url).pathname,re.signal,x);if(Ee.type==="aborted")return;if(Ee.type==="error"){Tt(x,C,Ee.error,{flushSync:Y});return}else if(Ee.matches){if(M=Ee.matches,P=Gr(M,N),U(P))return}else{Tt(x,C,Ze(404,{pathname:N}),{flushSync:Y});return}}z.set(x,X);let Ie=F,ae=(await Nr("action",h,re,[P],M,x))[P.route.id];if(re.signal.aborted){z.get(x)===X&&z.delete(x);return}if(f.v7_fetcherPersist&&O.has(x)){if(Rn(ae)||nt(ae)){Kt(x,Zt(void 0));return}}else{if(Rn(ae))if(z.delete(x),W>Ie){Kt(x,Zt(void 0));return}else return Z.add(x),Kt(x,Or($)),Sn(re,ae,!1,{fetcherSubmission:$,preventScrollReset:B});if(nt(ae)){Tt(x,C,ae.error);return}}if(nn(ae))throw Ze(400,{type:"defer-action"});let je=h.navigation.location||h.location,Wn=Gn(e.history,je,X.signal),zr=s||a,Rt=h.navigation.state!=="idle"?Cn(zr,h.navigation.location,u):h.matches;J(Rt,"Didn't find any matches after fetcher action");let jt=++F;q.set(x,jt);let pi=Or($,ae.data);h.fetchers.set(x,pi);let[Tr,wn]=Sc(e.history,h,Rt,$,je,!1,f.v7_skipActionErrorRevalidation,_e,H,fe,O,We,Z,zr,u,[P.route.id,ae]);wn.filter(Ee=>Ee.key!==x).forEach(Ee=>{let Vn=Ee.key,eu=h.fetchers.get(Vn),Up=Or(void 0,eu?eu.data:void 0);h.fetchers.set(Vn,Up),Gt(Vn),Ee.controller&&z.set(Vn,Ee.controller)}),He({fetchers:new Map(h.fetchers)});let _l=()=>wn.forEach(Ee=>Gt(Ee.key));X.signal.addEventListener("abort",_l);let{loaderResults:Il,fetcherResults:ie}=await Vs(h,Rt,Tr,wn,Wn);if(X.signal.aborted)return;X.signal.removeEventListener("abort",_l),q.delete(x),z.delete(x),wn.forEach(Ee=>z.delete(Ee.key));let ke=ql(Il);if(ke)return Sn(Wn,ke.result,!1,{preventScrollReset:B});if(ke=ql(ie),ke)return Z.add(ke.key),Sn(Wn,ke.result,!1,{preventScrollReset:B});let{loaderData:Hn,errors:Rr}=bc(h,Rt,Il,void 0,wn,ie,ne);if(h.fetchers.has(x)){let Ee=Zt(ae.data);h.fetchers.set(x,Ee)}Zs(jt),h.navigation.state==="loading"&&jt>W?(J(k,"Expected pending action"),R&&R.abort(),$n(h.navigation.location,{matches:Rt,loaderData:Hn,errors:Rr,fetchers:new Map(h.fetchers)})):(He({errors:Rr,loaderData:Ec(h.loaderData,Hn,Rt,Rr),fetchers:new Map(h.fetchers)}),_e=!1)}async function Pp(x,C,N,P,M,G,Y,B,$){let U=h.fetchers.get(x);Kt(x,Or($,U?U.data:void 0),{flushSync:Y});let V=new AbortController,X=Gn(e.history,N,V.signal);if(G){let ae=await Ll(M,new URL(X.url).pathname,X.signal,x);if(ae.type==="aborted")return;if(ae.type==="error"){Tt(x,C,ae.error,{flushSync:Y});return}else if(ae.matches)M=ae.matches,P=Gr(M,N);else{Tt(x,C,Ze(404,{pathname:N}),{flushSync:Y});return}}z.set(x,V);let re=F,pe=(await Nr("loader",h,X,[P],M,x))[P.route.id];if(nn(pe)&&(pe=await Us(pe,X.signal,!0)||pe),z.get(x)===V&&z.delete(x),!X.signal.aborted){if(O.has(x)){Kt(x,Zt(void 0));return}if(Rn(pe))if(W>re){Kt(x,Zt(void 0));return}else{Z.add(x),await Sn(X,pe,!1,{preventScrollReset:B});return}if(nt(pe)){Tt(x,C,pe.error);return}J(!nn(pe),"Unhandled fetcher deferred data"),Kt(x,Zt(pe.data))}}async function Sn(x,C,N,P){let{submission:M,fetcherSubmission:G,preventScrollReset:Y,replace:B}=P===void 0?{}:P;C.response.headers.has("X-Remix-Revalidate")&&(_e=!0);let $=C.response.headers.get("Location");J($,"Expected a Location header on the redirect Response"),$=kc($,new URL(x.url),u,e.history);let U=wl(h.location,$,{_isRedirect:!0});if(n){let ae=!1;if(C.response.headers.has("X-Remix-Reload-Document"))ae=!0;else if(As.test($)){const je=e.history.createURL($);ae=je.origin!==t.location.origin||Bt(je.pathname,u)==null}if(ae){B?t.location.replace($):t.location.assign($);return}}R=null;let V=B===!0||C.response.headers.has("X-Remix-Replace")?Ne.Replace:Ne.Push,{formMethod:X,formAction:re,formEncType:Ie}=h.navigation;!M&&!G&&X&&re&&Ie&&(M=Rc(h.navigation));let pe=M||G;if(Ny.has(C.response.status)&&pe&&yt(pe.formMethod))await xn(V,U,{submission:ye({},pe,{formAction:$}),preventScrollReset:Y||I,enableViewTransition:N?K:void 0});else{let ae=$i(U,M);await xn(V,U,{overrideNavigation:ae,fetcherSubmission:G,preventScrollReset:Y||I,enableViewTransition:N?K:void 0})}}async function Nr(x,C,N,P,M,G){let Y,B={};try{Y=await Iy(c,x,C,N,P,M,G,o,l)}catch($){return P.forEach(U=>{B[U.route.id]={type:ue.error,error:$}}),B}for(let[$,U]of Object.entries(Y))if(By(U)){let V=U.result;B[$]={type:ue.redirect,response:Ay(V,N,$,M,u,f.v7_relativeSplatPath)}}else B[$]=await My(U);return B}async function Vs(x,C,N,P,M){let G=x.matches,Y=Nr("loader",x,M,N,C,null),B=Promise.all(P.map(async V=>{if(V.matches&&V.match&&V.controller){let re=(await Nr("loader",x,Gn(e.history,V.path,V.controller.signal),[V.match],V.matches,V.key))[V.match.route.id];return{[V.key]:re}}else return Promise.resolve({[V.key]:{type:ue.error,error:Ze(404,{pathname:V.path})}})})),$=await Y,U=(await B).reduce((V,X)=>Object.assign(V,X),{});return await Promise.all([Hy(C,$,M.signal,G,x.loaderData),Vy(C,U,P)]),{loaderResults:$,fetcherResults:U}}function ci(){_e=!0,H.push(...fi()),We.forEach((x,C)=>{z.has(C)&&fe.add(C),Gt(C)})}function Kt(x,C,N){N===void 0&&(N={}),h.fetchers.set(x,C),He({fetchers:new Map(h.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function Tt(x,C,N,P){P===void 0&&(P={});let M=bn(h.matches,C);Rl(x),He({errors:{[M.route.id]:N},fetchers:new Map(h.fetchers)},{flushSync:(P&&P.flushSync)===!0})}function Ks(x){return ee.set(x,(ee.get(x)||0)+1),O.has(x)&&O.delete(x),h.fetchers.get(x)||zy}function Rl(x){let C=h.fetchers.get(x);z.has(x)&&!(C&&C.state==="loading"&&q.has(x))&&Gt(x),We.delete(x),q.delete(x),Z.delete(x),f.v7_fetcherPersist&&O.delete(x),fe.delete(x),h.fetchers.delete(x)}function Lp(x){let C=(ee.get(x)||0)-1;C<=0?(ee.delete(x),O.add(x),f.v7_fetcherPersist||Rl(x)):ee.set(x,C),He({fetchers:new Map(h.fetchers)})}function Gt(x){let C=z.get(x);C&&(C.abort(),z.delete(x))}function Gs(x){for(let C of x){let N=Ks(C),P=Zt(N.data);h.fetchers.set(C,P)}}function Qs(){let x=[],C=!1;for(let N of Z){let P=h.fetchers.get(N);J(P,"Expected fetcher: "+N),P.state==="loading"&&(Z.delete(N),x.push(N),C=!0)}return Gs(x),C}function Zs(x){let C=[];for(let[N,P]of q)if(P<x){let M=h.fetchers.get(N);J(M,"Expected fetcher: "+N),M.state==="loading"&&(Gt(N),q.delete(N),C.push(N))}return Gs(C),C.length>0}function _p(x,C){let N=h.blockers.get(x)||Ur;return se.get(x)!==C&&se.set(x,C),N}function Ys(x){h.blockers.delete(x),se.delete(x)}function Dl(x,C){let N=h.blockers.get(x)||Ur;J(N.state==="unblocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="proceeding"||N.state==="blocked"&&C.state==="unblocked"||N.state==="proceeding"&&C.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+C.state);let P=new Map(h.blockers);P.set(x,C),He({blockers:P})}function Xs(x){let{currentLocation:C,nextLocation:N,historyAction:P}=x;if(se.size===0)return;se.size>1&&An(!1,"A router only supports one blocker at a time");let M=Array.from(se.entries()),[G,Y]=M[M.length-1],B=h.blockers.get(G);if(!(B&&B.state==="proceeding")&&Y({currentLocation:C,nextLocation:N,historyAction:P}))return G}function di(x){let C=Ze(404,{pathname:x}),N=s||a,{matches:P,route:M}=zc(N);return fi(),{notFoundMatches:P,route:M,error:C}}function fi(x){let C=[];return ne.forEach((N,P)=>{(!x||x(P))&&(N.cancel(),C.push(P),ne.delete(P))}),C}function Ip(x,C,N){if(j=x,D=C,w=N||null,!g&&h.navigation===Bi){g=!0;let P=qs(h.location,h.matches);P!=null&&He({restoreScrollPosition:P})}return()=>{j=null,D=null,w=null}}function Js(x,C){return w&&w(x,C.map(P=>ly(P,h.loaderData)))||x.key}function Fp(x,C){if(j&&D){let N=Js(x,C);j[N]=D()}}function qs(x,C){if(j){let N=Js(x,C),P=j[N];if(typeof P=="number")return P}return null}function Pl(x,C,N){if(p)if(x){if(Object.keys(x[0].params).length>0)return{active:!0,matches:po(C,N,u,!0)}}else return{active:!0,matches:po(C,N,u,!0)||[]};return{active:!1,matches:null}}async function Ll(x,C,N,P){if(!p)return{type:"success",matches:x};let M=x;for(;;){let G=s==null,Y=s||a,B=o;try{await p({signal:N,path:C,matches:M,fetcherKey:P,patch:(V,X)=>{N.aborted||jc(V,X,Y,B,l)}})}catch(V){return{type:"error",error:V,partialMatches:M}}finally{G&&!N.aborted&&(a=[...a])}if(N.aborted)return{type:"aborted"};let $=Cn(Y,C,u);if($)return{type:"success",matches:$};let U=po(Y,C,u,!0);if(!U||M.length===U.length&&M.every((V,X)=>V.route.id===U[X].route.id))return{type:"success",matches:null};M=U}}function Mp(x){o={},s=Uo(x,l,void 0,o)}function Ap(x,C){let N=s==null;jc(x,C,s||a,o,l),N&&(a=[...a],He({}))}return T={get basename(){return u},get future(){return f},get state(){return h},get routes(){return a},get window(){return t},initialize:Vt,subscribe:bp,enableScrollRestoration:Ip,navigate:Ws,fetch:Rp,revalidate:Ep,createHref:x=>e.history.createHref(x),encodeLocation:x=>e.history.encodeLocation(x),getFetcher:Ks,deleteFetcher:Lp,dispose:Cp,getBlocker:_p,deleteBlocker:Ys,patchRoutes:Ap,_internalFetchControllers:z,_internalActiveDeferreds:ne,_internalSetRoutes:Mp},T}function Dy(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ua(e,t,n,r,l,o,a,s){let u,c;if(a){u=[];for(let f of t)if(u.push(f),f.route.id===a){c=f;break}}else u=t,c=t[t.length-1];let p=ai(l||".",ii(u,o),Bt(e.pathname,n)||e.pathname,s==="path");if(l==null&&(p.search=e.search,p.hash=e.hash),(l==null||l===""||l===".")&&c){let f=Os(p.search);if(c.route.index&&!f)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&f){let v=new URLSearchParams(p.search),S=v.getAll("index");v.delete("index"),S.filter(w=>w).forEach(w=>v.append("index",w));let j=v.toString();p.search=j?"?"+j:""}}return r&&n!=="/"&&(p.pathname=p.pathname==="/"?n:Ft([n,p.pathname])),Un(p)}function gc(e,t,n,r){if(!r||!Dy(r))return{path:n};if(r.formMethod&&!Wy(r.formMethod))return{path:n,error:Ze(405,{method:r.formMethod})};let l=()=>({path:n,error:Ze(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=sp(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!yt(a))return l();let v=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((S,j)=>{let[w,D]=j;return""+S+w+"="+D+`
180
+ `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:v}}}else if(r.formEncType==="application/json"){if(!yt(a))return l();try{let v=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}J(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=Ba(r.formData),c=r.formData;else if(r.body instanceof FormData)u=Ba(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=Cc(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=Cc(u)}catch{return l()}let p={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(yt(p.formMethod))return{path:n,submission:p};let f=yn(n);return t&&f.search&&Os(f.search)&&u.append("index",""),f.search="?"+u,{path:Un(f),submission:p}}function xc(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(l=>l.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Sc(e,t,n,r,l,o,a,s,u,c,p,f,v,S,j,w){let D=w?nt(w[1])?w[1].error:w[1].data:void 0,g=e.createURL(t.location),d=e.createURL(l),y=n;o&&t.errors?y=xc(n,Object.keys(t.errors)[0],!0):w&&nt(w[1])&&(y=xc(n,w[0]));let b=w?w[1].statusCode:void 0,E=a&&b&&b>=400,T=y.filter((k,I)=>{let{route:R}=k;if(R.lazy)return!0;if(R.loader==null)return!1;if(o)return Oa(R,t.loaderData,t.errors);if(Py(t.loaderData,t.matches[I],k)||u.some(Q=>Q===k.route.id))return!0;let K=t.matches[I],L=k;return wc(k,ye({currentUrl:g,currentParams:K.params,nextUrl:d,nextParams:L.params},r,{actionResult:D,actionStatus:b,defaultShouldRevalidate:E?!1:s||g.pathname+g.search===d.pathname+d.search||g.search!==d.search||ip(K,L)}))}),h=[];return f.forEach((k,I)=>{if(o||!n.some(le=>le.route.id===k.routeId)||p.has(I))return;let R=Cn(S,k.path,j);if(!R){h.push({key:I,routeId:k.routeId,path:k.path,matches:null,match:null,controller:null});return}let K=t.fetchers.get(I),L=Gr(R,k.path),Q=!1;v.has(I)?Q=!1:c.has(I)?(c.delete(I),Q=!0):K&&K.state!=="idle"&&K.data===void 0?Q=s:Q=wc(L,ye({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:d,nextParams:n[n.length-1].params},r,{actionResult:D,actionStatus:b,defaultShouldRevalidate:E?!1:s})),Q&&h.push({key:I,routeId:k.routeId,path:k.path,matches:R,match:L,controller:new AbortController})}),[T,h]}function Oa(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,l=n!=null&&n[e.id]!==void 0;return!r&&l?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!l}function Py(e,t,n){let r=!t||n.route.id!==t.route.id,l=e[n.route.id]===void 0;return r||l}function ip(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function wc(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function jc(e,t,n,r,l){var o;let a;if(e){let c=r[e];J(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let s=t.filter(c=>!a.some(p=>ap(c,p))),u=Uo(s,l,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...u)}function ap(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var l;return(l=t.children)==null?void 0:l.some(o=>ap(n,o))}):!1}async function Ly(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let l=n[e.id];J(l,"No route found in manifest");let o={};for(let a in r){let u=l[a]!==void 0&&a!=="hasErrorBoundary";An(!u,'Route "'+l.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!ny.has(a)&&(o[a]=r[a])}Object.assign(l,o),Object.assign(l,ye({},t(l),{lazy:void 0}))}async function _y(e){let{matches:t}=e,n=t.filter(l=>l.shouldLoad);return(await Promise.all(n.map(l=>l.resolve()))).reduce((l,o,a)=>Object.assign(l,{[n[a].route.id]:o}),{})}async function Iy(e,t,n,r,l,o,a,s,u,c){let p=o.map(S=>S.route.lazy?Ly(S.route,u,s):void 0),f=o.map((S,j)=>{let w=p[j],D=l.some(d=>d.route.id===S.route.id);return ye({},S,{shouldLoad:D,resolve:async d=>(d&&r.method==="GET"&&(S.route.lazy||S.route.loader)&&(D=!0),D?Fy(t,r,S,w,d,c):Promise.resolve({type:ue.data,result:void 0}))})}),v=await e({matches:f,request:r,params:o[0].params,fetcherKey:a,context:c});try{await Promise.all(p)}catch{}return v}async function Fy(e,t,n,r,l,o){let a,s,u=c=>{let p,f=new Promise((j,w)=>p=w);s=()=>p(),t.signal.addEventListener("abort",s);let v=j=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...j!==void 0?[j]:[]),S=(async()=>{try{return{type:"data",result:await(l?l(w=>v(w)):v())}}catch(j){return{type:"error",result:j}}})();return Promise.race([S,f])};try{let c=n.route[e];if(r)if(c){let p,[f]=await Promise.all([u(c).catch(v=>{p=v}),r]);if(p!==void 0)throw p;a=f}else if(await r,c=n.route[e],c)a=await u(c);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Ze(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:ue.data,result:void 0};else if(c)a=await u(c);else{let p=new URL(t.url),f=p.pathname+p.search;throw Ze(404,{pathname:f})}J(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:ue.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function My(e){let{result:t,type:n}=e;if(up(t)){let f;try{let v=t.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?t.body==null?f=null:f=await t.json():f=await t.text()}catch(v){return{type:ue.error,error:v}}return n===ue.error?{type:ue.error,error:new Bo(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:ue.data,data:f,statusCode:t.status,headers:t.headers}}if(n===ue.error){if(Tc(t)){var r,l;if(t.data instanceof Error){var o,a;return{type:ue.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:ue.error,error:new Bo(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:jl(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:ue.error,error:t,statusCode:jl(t)?t.status:void 0}}if($y(t)){var s,u;return{type:ue.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((u=t.init)==null?void 0:u.headers)&&new Headers(t.init.headers)}}if(Tc(t)){var c,p;return{type:ue.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(p=t.init)!=null&&p.headers?new Headers(t.init.headers):void 0}}return{type:ue.data,data:t}}function Ay(e,t,n,r,l,o){let a=e.headers.get("Location");if(J(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!As.test(a)){let s=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=Ua(new URL(t.url),s,l,!0,a,o),e.headers.set("Location",a)}return e}function kc(e,t,n,r){let l=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(As.test(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(l.includes(a.protocol))throw new Error("Invalid redirect location");let s=Bt(a.pathname,n)!=null;if(a.origin===t.origin&&s)return a.pathname+a.search+a.hash}try{let o=r.createURL(e);if(l.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Gn(e,t,n,r){let l=e.createURL(sp(t)).toString(),o={signal:n};if(r&&yt(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=Ba(r.formData):o.body=r.formData}return new Request(l,o)}function Ba(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Cc(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Uy(e,t,n,r,l){let o={},a=null,s,u=!1,c={},p=n&&nt(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let v=f.route.id,S=t[v];if(J(!Rn(S),"Cannot handle redirect results in processLoaderData"),nt(S)){let j=S.error;p!==void 0&&(j=p,p=void 0),a=a||{};{let w=bn(e,v);a[w.route.id]==null&&(a[w.route.id]=j)}o[v]=void 0,u||(u=!0,s=jl(S.error)?S.error.status:500),S.headers&&(c[v]=S.headers)}else nn(S)?(r.set(v,S.deferredData),o[v]=S.deferredData.data,S.statusCode!=null&&S.statusCode!==200&&!u&&(s=S.statusCode),S.headers&&(c[v]=S.headers)):(o[v]=S.data,S.statusCode&&S.statusCode!==200&&!u&&(s=S.statusCode),S.headers&&(c[v]=S.headers))}),p!==void 0&&n&&(a={[n[0]]:p},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:c}}function bc(e,t,n,r,l,o,a){let{loaderData:s,errors:u}=Uy(t,n,r,a);return l.forEach(c=>{let{key:p,match:f,controller:v}=c,S=o[p];if(J(S,"Did not find corresponding fetcher result"),!(v&&v.signal.aborted))if(nt(S)){let j=bn(e.matches,f==null?void 0:f.route.id);u&&u[j.route.id]||(u=ye({},u,{[j.route.id]:S.error})),e.fetchers.delete(p)}else if(Rn(S))J(!1,"Unhandled fetcher revalidation redirect");else if(nn(S))J(!1,"Unhandled fetcher deferred data");else{let j=Zt(S.data);e.fetchers.set(p,j)}}),{loaderData:s,errors:u}}function Ec(e,t,n,r){let l=ye({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(l[a]=t[a]):e[a]!==void 0&&o.route.loader&&(l[a]=e[a]),r&&r.hasOwnProperty(a))break}return l}function Nc(e){return e?nt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function bn(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function zc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ze(e,t){let{pathname:n,routeId:r,method:l,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(s="Bad Request",l&&n&&r?u="You made a "+l+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(s="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",u='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",l&&n&&r?u="You made a "+l.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":l&&(u='Invalid request method "'+l.toUpperCase()+'"')),new Bo(e||500,s,new Error(u),!0)}function ql(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,l]=t[n];if(Rn(l))return{key:r,result:l}}}function sp(e){let t=typeof e=="string"?yn(e):e;return Un(ye({},t,{hash:""}))}function Oy(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function By(e){return up(e.result)&&Ey.has(e.result.status)}function nn(e){return e.type===ue.deferred}function nt(e){return e.type===ue.error}function Rn(e){return(e&&e.type)===ue.redirect}function Tc(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $y(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function up(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Wy(e){return by.has(e.toLowerCase())}function yt(e){return ky.has(e.toLowerCase())}async function Hy(e,t,n,r,l){let o=Object.entries(t);for(let a=0;a<o.length;a++){let[s,u]=o[a],c=e.find(v=>(v==null?void 0:v.route.id)===s);if(!c)continue;let p=r.find(v=>v.route.id===c.route.id),f=p!=null&&!ip(p,c)&&(l&&l[c.route.id])!==void 0;nn(u)&&f&&await Us(u,n,!1).then(v=>{v&&(t[s]=v)})}}async function Vy(e,t,n){for(let r=0;r<n.length;r++){let{key:l,routeId:o,controller:a}=n[r],s=t[l];e.find(c=>(c==null?void 0:c.route.id)===o)&&nn(s)&&(J(a,"Expected an AbortController for revalidating fetcher deferred result"),await Us(s,a.signal,!0).then(c=>{c&&(t[l]=c)}))}}async function Us(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:ue.data,data:e.deferredData.unwrappedData}}catch(l){return{type:ue.error,error:l}}return{type:ue.data,data:e.deferredData.data}}}function Os(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Gr(e,t){let n=typeof t=="string"?yn(t).search:t.search;if(e[e.length-1].route.index&&Os(n||""))return e[e.length-1];let r=rp(e);return r[r.length-1]}function Rc(e){let{formMethod:t,formAction:n,formEncType:r,text:l,formData:o,json:a}=e;if(!(!t||!n||!r)){if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:l};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function $i(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ky(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Or(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Gy(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Zt(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Qy(e,t){try{let n=e.sessionStorage.getItem(op);if(n){let r=JSON.parse(n);for(let[l,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(l,new Set(o||[]))}}catch{}}function Zy(e,t){if(t.size>0){let n={};for(let[r,l]of t)n[r]=[...l];try{e.sessionStorage.setItem(op,JSON.stringify(n))}catch(r){An(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
181
+ * React Router v6.30.3
182
+ *
183
+ * Copyright (c) Remix Software Inc.
184
+ *
185
+ * This source code is licensed under the MIT license found in the
186
+ * LICENSE.md file in the root directory of this source tree.
187
+ *
188
+ * @license MIT
189
+ */function $o(){return $o=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},$o.apply(this,arguments)}const Tl=m.createContext(null),Bs=m.createContext(null),Wt=m.createContext(null),$s=m.createContext(null),gn=m.createContext({outlet:null,matches:[],isDataRoute:!1}),cp=m.createContext(null);function Yy(e,t){let{relative:n}=t===void 0?{}:t;br()||J(!1);let{basename:r,navigator:l}=m.useContext(Wt),{hash:o,pathname:a,search:s}=si(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:Ft([r,a])),l.createHref({pathname:u,search:s,hash:o})}function br(){return m.useContext($s)!=null}function Er(){return br()||J(!1),m.useContext($s).location}function dp(e){m.useContext(Wt).static||m.useLayoutEffect(e)}function fp(){let{isDataRoute:e}=m.useContext(gn);return e?sg():Xy()}function Xy(){br()||J(!1);let e=m.useContext(Tl),{basename:t,future:n,navigator:r}=m.useContext(Wt),{matches:l}=m.useContext(gn),{pathname:o}=Er(),a=JSON.stringify(ii(l,n.v7_relativeSplatPath)),s=m.useRef(!1);return dp(()=>{s.current=!0}),m.useCallback(function(c,p){if(p===void 0&&(p={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let f=ai(c,JSON.parse(a),o,p.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ft([t,f.pathname])),(p.replace?r.replace:r.push)(f,p.state,p)},[t,r,a,o,e])}function si(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Wt),{matches:l}=m.useContext(gn),{pathname:o}=Er(),a=JSON.stringify(ii(l,r.v7_relativeSplatPath));return m.useMemo(()=>ai(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function Jy(e,t,n,r){br()||J(!1);let{navigator:l}=m.useContext(Wt),{matches:o}=m.useContext(gn),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Er(),p;p=c;let f=p.pathname||"/",v=f;if(u!=="/"){let w=u.replace(/^\//,"").split("/");v="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let S=Cn(e,{pathname:v});return rg(S&&S.map(w=>Object.assign({},w,{params:Object.assign({},s,w.params),pathname:Ft([u,l.encodeLocation?l.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:Ft([u,l.encodeLocation?l.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r)}function qy(){let e=ag(),t=jl(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:l},n):null,null)}const eg=m.createElement(qy,null);class tg extends m.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?m.createElement(gn.Provider,{value:this.props.routeContext},m.createElement(cp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ng(e){let{routeContext:t,match:n,children:r}=e,l=m.useContext(Tl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(gn.Provider,{value:t},r)}function rg(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=(l=n)==null?void 0:l.errors;if(s!=null){let p=a.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);p>=0||J(!1),a=a.slice(0,Math.min(a.length,p+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<a.length;p++){let f=a[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:v,errors:S}=n,j=f.route.loader&&v[f.route.id]===void 0&&(!S||S[f.route.id]===void 0);if(f.route.lazy||j){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((p,f,v)=>{let S,j=!1,w=null,D=null;n&&(S=s&&f.route.id?s[f.route.id]:void 0,w=f.route.errorElement||eg,u&&(c<0&&v===0?(ug("route-fallback"),j=!0,D=null):c===v&&(j=!0,D=f.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,v+1)),d=()=>{let y;return S?y=w:j?y=D:f.route.Component?y=m.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=p,m.createElement(ng,{match:f,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||v===0)?m.createElement(tg,{location:n.location,revalidation:n.revalidation,component:w,error:S,children:d(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):d()},null)}var pp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pp||{}),hp=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}(hp||{});function lg(e){let t=m.useContext(Tl);return t||J(!1),t}function og(e){let t=m.useContext(Bs);return t||J(!1),t}function ig(e){let t=m.useContext(gn);return t||J(!1),t}function mp(e){let t=ig(),n=t.matches[t.matches.length-1];return n.route.id||J(!1),n.route.id}function ag(){var e;let t=m.useContext(cp),n=og(hp.UseRouteError),r=mp();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sg(){let{router:e}=lg(pp.UseNavigateStable),t=mp(),n=m.useRef(!1);return dp(()=>{n.current=!0}),m.useCallback(function(l,o){o===void 0&&(o={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,$o({fromRouteId:t},o)))},[e,t])}const Dc={};function ug(e,t,n){Dc[e]||(Dc[e]=!0)}function cg(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function dg(e){let{to:t,replace:n,state:r,relative:l}=e;br()||J(!1);let{future:o,static:a}=m.useContext(Wt),{matches:s}=m.useContext(gn),{pathname:u}=Er(),c=fp(),p=ai(t,ii(s,o.v7_relativeSplatPath),u,l==="path"),f=JSON.stringify(p);return m.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:l}),[c,f,l,n,r]),null}function fg(e){let{basename:t="/",children:n=null,location:r,navigationType:l=Ne.Pop,navigator:o,static:a=!1,future:s}=e;br()&&J(!1);let u=t.replace(/^\/*/,"/"),c=m.useMemo(()=>({basename:u,navigator:o,static:a,future:$o({v7_relativeSplatPath:!1},s)}),[u,s,o,a]);typeof r=="string"&&(r=yn(r));let{pathname:p="/",search:f="",hash:v="",state:S=null,key:j="default"}=r,w=m.useMemo(()=>{let D=Bt(p,u);return D==null?null:{location:{pathname:D,search:f,hash:v,state:S,key:j},navigationType:l}},[u,p,f,v,S,j,l]);return w==null?null:m.createElement(Wt.Provider,{value:c},m.createElement($s.Provider,{children:n,value:w}))}new Promise(()=>{});function pg(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
190
+ * React Router DOM v6.30.3
191
+ *
192
+ * Copyright (c) Remix Software Inc.
193
+ *
194
+ * This source code is licensed under the MIT license found in the
195
+ * LICENSE.md file in the root directory of this source tree.
196
+ *
197
+ * @license MIT
198
+ */function wr(){return wr=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},wr.apply(this,arguments)}function vp(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o<r.length;o++)l=r[o],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function hg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mg(e,t){return e.button===0&&(!t||t==="_self")&&!hg(e)}const vg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yg=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],gg="6";try{window.__reactRouterVersion=gg}catch{}function xg(e,t){return Ry({basename:void 0,future:wr({},void 0,{v7_prependBasename:!0}),history:qv({window:void 0}),hydrationData:Sg(),routes:e,mapRouteProperties:pg,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Sg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=wr({},t,{errors:wg(t.errors)})),t}function wg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,l]of t)if(l&&l.__type==="RouteErrorResponse")n[r]=new Bo(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let o=window[l.__subType];if(typeof o=="function")try{let a=new o(l.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(l.message);o.stack="",n[r]=o}}else n[r]=l;return n}const yp=m.createContext({isTransitioning:!1}),jg=m.createContext(new Map),kg="startTransition",Pc=nh[kg],Cg="flushSync",Lc=hv[Cg];function bg(e){Pc?Pc(e):e()}function Br(e){Lc?Lc(e):e()}class Eg{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Ng(e){let{fallbackElement:t,router:n,future:r}=e,[l,o]=m.useState(n.state),[a,s]=m.useState(),[u,c]=m.useState({isTransitioning:!1}),[p,f]=m.useState(),[v,S]=m.useState(),[j,w]=m.useState(),D=m.useRef(new Map),{v7_startTransition:g}=r||{},d=m.useCallback(k=>{g?bg(k):k()},[g]),y=m.useCallback((k,I)=>{let{deletedFetchers:R,flushSync:K,viewTransitionOpts:L}=I;k.fetchers.forEach((le,_e)=>{le.data!==void 0&&D.current.set(_e,le.data)}),R.forEach(le=>D.current.delete(le));let Q=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||Q){K?Br(()=>o(k)):d(()=>o(k));return}if(K){Br(()=>{v&&(p&&p.resolve(),v.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let le=n.window.document.startViewTransition(()=>{Br(()=>o(k))});le.finished.finally(()=>{Br(()=>{f(void 0),S(void 0),s(void 0),c({isTransitioning:!1})})}),Br(()=>S(le));return}v?(p&&p.resolve(),v.skipTransition(),w({state:k,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(k),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,v,p,D,d]);m.useLayoutEffect(()=>n.subscribe(y),[n,y]),m.useEffect(()=>{u.isTransitioning&&!u.flushSync&&f(new Eg)},[u]),m.useEffect(()=>{if(p&&a&&n.window){let k=a,I=p.promise,R=n.window.document.startViewTransition(async()=>{d(()=>o(k)),await I});R.finished.finally(()=>{f(void 0),S(void 0),s(void 0),c({isTransitioning:!1})}),S(R)}},[d,a,p,n.window]),m.useEffect(()=>{p&&a&&l.location.key===a.location.key&&p.resolve()},[p,v,l.location,a]),m.useEffect(()=>{!u.isTransitioning&&j&&(s(j.state),c({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}),w(void 0))},[u.isTransitioning,j]),m.useEffect(()=>{},[]);let b=m.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:k=>n.navigate(k),push:(k,I,R)=>n.navigate(k,{state:I,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(k,I,R)=>n.navigate(k,{replace:!0,state:I,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[n]),E=n.basename||"/",T=m.useMemo(()=>({router:n,navigator:b,static:!1,basename:E}),[n,b,E]),h=m.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return m.useEffect(()=>cg(r,n.future),[r,n.future]),m.createElement(m.Fragment,null,m.createElement(Tl.Provider,{value:T},m.createElement(Bs.Provider,{value:l},m.createElement(jg.Provider,{value:D.current},m.createElement(yp.Provider,{value:u},m.createElement(fg,{basename:E,location:l.location,navigationType:l.historyAction,navigator:b,future:h},l.initialized||n.future.v7_partialHydration?m.createElement(zg,{routes:n.routes,future:n.future,state:l}):t))))),null)}const zg=m.memo(Tg);function Tg(e){let{routes:t,future:n,state:r}=e;return Jy(t,void 0,r,n)}const Rg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pg=m.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:o,replace:a,state:s,target:u,to:c,preventScrollReset:p,viewTransition:f}=t,v=vp(t,vg),{basename:S}=m.useContext(Wt),j,w=!1;if(typeof c=="string"&&Dg.test(c)&&(j=c,Rg))try{let y=new URL(window.location.href),b=c.startsWith("//")?new URL(y.protocol+c):new URL(c),E=Bt(b.pathname,S);b.origin===y.origin&&E!=null?c=E+b.search+b.hash:w=!0}catch{}let D=Yy(c,{relative:l}),g=_g(c,{replace:a,state:s,target:u,preventScrollReset:p,relative:l,viewTransition:f});function d(y){r&&r(y),y.defaultPrevented||g(y)}return m.createElement("a",wr({},v,{href:j||D,onClick:w||o?r:d,ref:n,target:u}))}),Wi=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:o="",end:a=!1,style:s,to:u,viewTransition:c,children:p}=t,f=vp(t,yg),v=si(u,{relative:f.relative}),S=Er(),j=m.useContext(Bs),{navigator:w,basename:D}=m.useContext(Wt),g=j!=null&&Ig(v)&&c===!0,d=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,y=S.pathname,b=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;l||(y=y.toLowerCase(),b=b?b.toLowerCase():null,d=d.toLowerCase()),b&&D&&(b=Bt(b,D)||b);const E=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let T=y===d||!a&&y.startsWith(d)&&y.charAt(E)==="/",h=b!=null&&(b===d||!a&&b.startsWith(d)&&b.charAt(d.length)==="/"),k={isActive:T,isPending:h,isTransitioning:g},I=T?r:void 0,R;typeof o=="function"?R=o(k):R=[o,T?"active":null,h?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let K=typeof s=="function"?s(k):s;return m.createElement(Pg,wr({},f,{"aria-current":I,className:R,ref:n,style:K,to:u,viewTransition:c}),typeof p=="function"?p(k):p)});var $a;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})($a||($a={}));var _c;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_c||(_c={}));function Lg(e){let t=m.useContext(Tl);return t||J(!1),t}function _g(e,t){let{target:n,replace:r,state:l,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,u=fp(),c=Er(),p=si(e,{relative:a});return m.useCallback(f=>{if(mg(f,n)){f.preventDefault();let v=r!==void 0?r:Un(c)===Un(p);u(e,{replace:v,state:l,preventScrollReset:o,relative:a,viewTransition:s})}},[c,u,p,r,l,n,e,o,a,s])}function Ig(e,t){t===void 0&&(t={});let n=m.useContext(yp);n==null&&J(!1);let{basename:r}=Lg($a.useViewTransitionState),l=si(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Bt(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Bt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Oo(l.pathname,a)!=null||Oo(l.pathname,o)!=null}function rl(e,t,n,r,l=!0){m.useEffect(()=>{if(!l)return;let o=!1;const a=async()=>{try{const u=await n(e);if(!o&&u.ok){const c=await u.json();o||r(c)}}catch{}};a();const s=setInterval(a,t);return()=>{o=!0,clearInterval(s)}},[e,t,l])}function gp(){return i.jsxs("div",{id:"header",children:[i.jsxs(Wi,{to:"/",className:"logo",children:[i.jsx("span",{style:{fontSize:24},children:"☕"}),i.jsxs("span",{className:"logo-text",children:[i.jsx("span",{className:"logo-name",children:"Brewnet"}),i.jsx("span",{className:"logo-tag",children:"Home Server"})]})]}),i.jsxs("div",{className:"nav-links",children:[i.jsx(Wi,{to:"/",end:!0,className:({isActive:e})=>`nav-link${e?" active":""}`,children:"Dashboard"}),i.jsx(Wi,{to:"/apps",className:({isActive:e})=>`nav-link${e?" active":""}`,children:"Apps"})]})]})}function xp(){return i.jsxs("div",{style:{height:50,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",gap:10,background:"#0c1525",borderTop:"1px solid var(--bdr)",fontSize:12.5,color:"var(--txt3)"},children:[i.jsx("a",{href:"https://github.com/claude-code-expert/brewnet",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--txt2)",textDecoration:"none",fontFamily:"var(--mono)",fontWeight:600},children:"https://github.com/claude-code-expert/brewnet"}),i.jsx("span",{children:"—"}),i.jsx("span",{children:"Clicking the star helps the developer."})]})}const Fg={"go-gin":"Go / Gin","go-echo":"Go / Echo","go-fiber":"Go / Fiber","rust-actix-web":"Rust / Actix","rust-axum":"Rust / Axum","java-springboot":"Java / Spring Boot","java-spring":"Java / Spring","kotlin-ktor":"Kotlin / Ktor","kotlin-springboot":"Kotlin / Spring Boot","nodejs-express":"Node.js / Express","nodejs-nestjs":"Node.js / NestJS","nodejs-nextjs":"Node.js / Next.js","nodejs-nextjs-full":"Node.js / Next.js Full","python-fastapi":"Python / FastAPI","python-django":"Python / Django","python-flask":"Python / Flask"};function Mg(e){switch(e){case"running":return"bdg b-run";case"stopped":return"bdg b-stop";case"error":return"bdg b-stop";case"not_installed":return"bdg b-idle";default:return"bdg b-idle"}}function Ag(e){switch(e){case"running":return"Running";case"stopped":return"Stopped";case"error":return"Error";case"not_installed":return"Not Installed";default:return e}}function Sp({text:e,style:t}){const[n,r]=m.useState(!1),l=o=>{o.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(a=>{console.warn("[CopyButton] clipboard write failed:",a)})};return i.jsx("button",{onClick:l,style:{padding:"2px 8px",fontSize:10,fontFamily:"var(--mono)",background:n?"rgba(61,214,200,0.12)":"var(--bg3)",border:`1px solid ${n?"rgba(61,214,200,0.4)":"var(--bdr2)"}`,borderRadius:20,color:n?"var(--teal)":"var(--txt2)",cursor:"pointer",transition:"all 0.15s",lineHeight:1.6,flexShrink:0,...t},children:n?"copied":"copy"})}function Ug({service:e,detail:t,onOpenDetail:n}){var l,o;const r=e.status==="running";return i.jsxs("div",{style:{background:"var(--bg2)",border:"1px solid var(--bdr)",borderRadius:"var(--r2)",padding:"16px 18px",display:"flex",flexDirection:"column",gap:"10px",cursor:"pointer",transition:"border-color 0.14s"},onClick:n,onMouseEnter:a=>a.currentTarget.style.borderColor="var(--bdr3)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--bdr)",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--txt)",fontFamily:"var(--mono)"},children:e.name}),i.jsxs("span",{className:Mg(e.status),children:[r&&i.jsx("span",{className:"blink-dot"}),Ag(e.status)]})]}),e.stackId&&i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--teal)",background:"rgba(61,214,200,0.07)",border:"1px solid rgba(61,214,200,0.18)",borderRadius:20,padding:"2px 9px",alignSelf:"flex-start"},children:Fg[e.stackId]??e.stackId}),(t==null?void 0:t.description)&&i.jsx("p",{style:{fontSize:11.5,color:"var(--txt2)",lineHeight:1.5,margin:0},children:t.description}),e.port&&i.jsxs("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt2)",background:"var(--bg3)",border:"1px solid var(--bdr2)",borderRadius:4,padding:"2px 7px",alignSelf:"flex-start"},children:[":",e.port]}),!e.url&&!e.externalUrl&&((l=t==null?void 0:t.credentials)==null?void 0:l.command)&&i.jsx("div",{style:{background:"#0a1020",border:"1px solid var(--bdr)",borderRadius:4,padding:"5px 10px",fontFamily:"var(--mono)",fontSize:11,color:"var(--teal)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.credentials.command,children:t.credentials.command}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginTop:"auto"},children:[!e.url&&!e.externalUrl&&((o=t==null?void 0:t.credentials)==null?void 0:o.command)&&i.jsx(Sp,{text:t.credentials.command}),e.url&&i.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"domain-link",style:{fontSize:11},onClick:a=>a.stopPropagation(),children:"↗ Local"}),e.externalUrl&&i.jsx("a",{href:e.externalUrl,target:"_blank",rel:"noopener noreferrer",className:"domain-link",style:{fontSize:11,background:"rgba(232, 168, 73, 0.07)",borderColor:"rgba(232, 168, 73, 0.18)",color:"var(--amber)"},onClick:a=>a.stopPropagation(),children:"↗ External"})]})]})}function Og({service:e,detail:t,onClose:n}){var r;return i.jsx("div",{className:"overlay",children:i.jsxs("div",{className:"modal",style:{maxWidth:720},onClick:l=>l.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"14px 18px 12px",borderBottom:"1px solid var(--bdr)",flexShrink:0},children:[i.jsx("span",{style:{width:12,height:12,borderRadius:"50%",background:"#ff5f57",display:"inline-block"}}),i.jsx("span",{style:{width:12,height:12,borderRadius:"50%",background:"#febc2e",display:"inline-block"}}),i.jsx("span",{style:{width:12,height:12,borderRadius:"50%",background:"#28c840",display:"inline-block"}}),i.jsx("span",{style:{flex:1,textAlign:"center",fontSize:12,fontFamily:"var(--mono)",color:"var(--txt2)",marginLeft:-44},children:(t==null?void 0:t.name)??e.name}),i.jsx("button",{className:"xbtn",onClick:n,"aria-label":"Close",children:"✕"})]}),i.jsxs("div",{style:{padding:"20px 22px",overflowY:"auto",flex:1,display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[i.jsx("span",{style:{fontSize:18,fontWeight:700,color:"var(--txt)",fontFamily:"var(--mono)",flexShrink:0},children:e.name}),e.port&&i.jsxs("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt2)"},children:[":",e.port]}),e.uptime&&e.uptime!=="—"&&i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.uptime})]}),i.jsxs("span",{className:e.status==="running"?"bdg b-run":e.status==="stopped"||e.status==="error"?"bdg b-stop":"bdg b-idle",children:[e.status==="running"&&i.jsx("span",{className:"blink-dot"}),e.status]})]}),(t==null?void 0:t.description)&&i.jsx("p",{style:{fontSize:13,color:"var(--txt2)",lineHeight:1.6,margin:0},children:t.description}),(t==null?void 0:t.license)&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"LICENSE"}),i.jsx("span",{style:{fontSize:11.5,fontFamily:"var(--mono)",color:"var(--amber)",background:"rgba(232,168,73,0.08)",border:"1px solid rgba(232,168,73,0.18)",borderRadius:4,padding:"2px 8px"},children:t.license})]}),(t==null?void 0:t.features)&&t.features.length>0&&i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:8},children:"Features"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:t.features.map(l=>i.jsx("span",{style:{fontSize:11.5,fontFamily:"var(--mono)",color:"var(--teal)",background:"rgba(61,214,200,0.07)",border:"1px solid rgba(61,214,200,0.18)",borderRadius:4,padding:"3px 9px"},children:l},l))})]}),(t==null?void 0:t.credentials)&&i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:8},children:"Credentials"}),i.jsxs("div",{className:"cb",style:{marginTop:0},children:[t.credentials.summary,t.credentials.keys&&t.credentials.keys.length>0&&i.jsx("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:3},children:t.credentials.keys.map(l=>i.jsx("span",{style:{color:"var(--amber2)"},children:l},l))})]})]}),(t==null?void 0:t.connectionParams)&&t.connectionParams.length>0&&i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:8},children:"Connection"}),i.jsx("div",{style:{background:"#0a1020",border:"1px solid var(--bdr)",borderRadius:"var(--r)",padding:"10px 14px",display:"grid",gridTemplateColumns:"auto 1fr",columnGap:16,rowGap:5},children:t.connectionParams.map(({label:l,value:o})=>i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt3)"},children:l},`${l}-k`),i.jsx("span",{style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--teal)"},children:o},`${l}-v`)]}))})]}),((r=t==null?void 0:t.credentials)==null?void 0:r.command)&&i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[i.jsx("div",{className:"section-title",style:{margin:0},children:"How to Connect"}),i.jsx("span",{style:{fontSize:10,fontFamily:"var(--mono)",color:"var(--txt3)",background:"var(--bg3)",border:"1px solid var(--bdr)",borderRadius:20,padding:"1px 7px"},children:"Terminal only"})]}),i.jsx("div",{style:{background:"#0a1020",border:"1px solid var(--bdr)",borderRadius:"var(--r)",padding:"10px 14px",fontFamily:"var(--mono)",fontSize:12,color:"var(--teal)",overflowX:"auto",whiteSpace:"pre"},children:t.credentials.command})]}),(t==null?void 0:t.tips)&&t.tips.length>0&&i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:8},children:"Tips"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.tips.map(l=>i.jsxs("div",{style:{display:"flex",gap:8,fontSize:12,color:"var(--txt2)",lineHeight:1.5},children:[i.jsx("span",{style:{color:"var(--txt3)",flexShrink:0},children:"›"}),i.jsx("span",{children:l})]},l))})]}),(e.url||e.externalUrl)&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.url&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:10,fontFamily:"var(--mono)",color:"var(--txt3)",width:52,flexShrink:0},children:"LOCAL"}),i.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--teal)",background:"rgba(61,214,200,0.07)",border:"1px solid rgba(61,214,200,0.18)",borderRadius:4,padding:"3px 10px",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:"none"},title:e.url,children:["↗ ",e.url]})]}),e.externalUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:10,fontFamily:"var(--mono)",color:"var(--txt3)",width:52,flexShrink:0},children:"EXTERNAL"}),i.jsxs("a",{href:e.externalUrl,target:"_blank",rel:"noopener noreferrer",style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--amber)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.18)",borderRadius:4,padding:"3px 10px",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:"none"},title:e.externalUrl,children:["↗ ",e.externalUrl]})]})]}),(t==null?void 0:t.securityNote)&&i.jsxs("div",{style:{display:"flex",gap:10,padding:"10px 14px",background:"rgba(232,168,73,0.06)",border:"1px solid rgba(232,168,73,0.2)",borderRadius:"var(--r)",fontSize:12,color:"var(--txt2)",lineHeight:1.55},children:[i.jsx("span",{style:{color:"var(--amber)",flexShrink:0},children:"⚠"}),i.jsx("span",{children:t.securityNote})]}),(t==null?void 0:t.docs)&&i.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:i.jsx("a",{href:t.docs,target:"_blank",rel:"noopener noreferrer",className:"btn bv bsm",children:"📖 Docs"})})]})]})})}function Bg(e){switch(e){case"info":return{color:"var(--green)",background:"rgba(61,232,154,0.08)",border:"1px solid rgba(61,232,154,0.18)"};case"warn":return{color:"var(--amber)",background:"rgba(232,168,73,0.08)",border:"1px solid rgba(232,168,73,0.18)"};case"error":return{color:"var(--red)",background:"rgba(240,75,90,0.08)",border:"1px solid rgba(240,75,90,0.18)"};case"debug":return{color:"var(--txt3)",background:"rgba(58,80,112,0.12)",border:"1px solid var(--bdr)"};default:return{color:"var(--txt2)"}}}function $g(e){try{const t=new Date(e);return t.toLocaleTimeString("en-US",{hour12:!1})+"."+String(t.getMilliseconds()).padStart(3,"0")}catch{return e}}function Wg({apiFetch:e}){const[t,n]=m.useState(null),[r,l]=m.useState([]),[o,a]=m.useState(0),[s,u]=m.useState("all"),[c,p]=m.useState("ALL"),[f,v]=m.useState(""),[S,j]=m.useState(""),[w,D]=m.useState(!1),[g,d]=m.useState(!1),y=m.useRef(null),b=m.useCallback(async()=>{d(!0);try{const h=new URLSearchParams({limit:"100"});s!=="all"&&h.set("source",s),c!=="ALL"&&h.set("level",c.toLowerCase()),f&&h.set("search",f);const[k,I]=await Promise.all([e("/api/logs/stats"),e(`/api/logs?${h.toString()}`)]);if(k.ok){const R=await k.json();n(R)}if(I.ok){const R=await I.json();l(R.entries??[]),a(R.total??0)}}catch(h){console.warn("[LogsTab] fetch failed:",h)}finally{d(!1)}},[e,s,c,f]);m.useEffect(()=>{b()},[b]),m.useEffect(()=>(y.current&&clearInterval(y.current),w&&(y.current=setInterval(()=>{b()},5e3)),()=>{y.current&&clearInterval(y.current)}),[w,b]);const E=()=>{v(S)},T=["ALL","INFO","WARN","ERROR","DEBUG"];return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t&&i.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:[i.jsxs("div",{className:"sbox",style:{minWidth:100},children:[i.jsx("div",{className:"sk",children:"Total"}),i.jsx("div",{className:"sv",children:t.total})]}),t.byLevel&&Object.entries(t.byLevel).map(([h,k])=>i.jsxs("div",{className:"sbox",style:{minWidth:80},children:[i.jsx("div",{className:"sk",children:h.toUpperCase()}),i.jsx("div",{className:"sv",style:{color:h==="error"?"var(--red)":h==="warn"?"var(--amber)":h==="info"?"var(--green)":"var(--txt3)"},children:k})]},h))]}),i.jsxs("div",{style:{background:"var(--bg2)",border:"1px solid var(--bdr)",borderRadius:"var(--r2)",padding:"14px 16px",display:"flex",flexWrap:"wrap",gap:12,alignItems:"center"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"SOURCE"}),i.jsxs("select",{className:"fi",style:{width:"auto",padding:"5px 10px",fontSize:12},value:s,onChange:h=>u(h.target.value),children:[i.jsx("option",{value:"all",children:"All"}),i.jsx("option",{value:"cli",children:"CLI"}),i.jsx("option",{value:"tunnel",children:"Tunnel"}),i.jsx("option",{value:"access",children:"Access"}),i.jsx("option",{value:"service",children:"Service"})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"LEVEL"}),T.map(h=>i.jsx("button",{className:`btn bsm ${c===h?"bp":"bg"}`,style:c!==h?{fontSize:11,padding:"4px 10px"}:{fontSize:11,padding:"4px 10px"},onClick:()=>p(h),children:h},h))]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:200},children:[i.jsx("input",{className:"fi",style:{flex:1,padding:"6px 11px",fontSize:12},placeholder:"Search messages…",value:S,onChange:h=>j(h.target.value),onKeyDown:h=>{h.key==="Enter"&&E()}}),i.jsx("button",{className:"btn bg bsm",onClick:E,children:"Search"})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:"var(--txt2)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:w,onChange:h=>D(h.target.checked),style:{accentColor:"var(--amber)"}}),"Auto-refresh (5s)"]}),g&&i.jsx("span",{style:{fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"loading…"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--txt3)",fontFamily:"var(--mono)"},children:["Showing ",r.length," of ",o," entries"]}),i.jsx("div",{className:"rtbl-wrap",children:i.jsxs("table",{className:"rtbl",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{style:{width:90},children:"Time"}),i.jsx("th",{style:{width:70},children:"Level"}),i.jsx("th",{style:{width:90},children:"Source"}),i.jsx("th",{children:"Message"})]})}),i.jsx("tbody",{children:r.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:4,style:{textAlign:"center",color:"var(--txt3)",padding:"32px 0"},children:"No log entries found"})}):r.map((h,k)=>i.jsxs("tr",{children:[i.jsx("td",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--txt3)",whiteSpace:"nowrap"},children:$g(h.ts)}),i.jsx("td",{children:i.jsx("span",{className:"bdg",style:{...Bg(h.level),fontSize:10,padding:"2px 7px"},children:h.level.toUpperCase()})}),i.jsx("td",{style:{fontFamily:"var(--mono)",fontSize:11.5,color:"var(--txt2)"},children:h.source}),i.jsx("td",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--txt)",wordBreak:"break-word"},children:h.message})]},`${h.ts}-${k}`))})]})})]})}function Hg(){const{apiFetch:e}=zl(),[t,n]=m.useState("services"),[r,l]=m.useState(""),[o,a]=m.useState([]),[s,u]=m.useState({}),[c,p]=m.useState({}),[f,v]=m.useState(null),[S,j]=m.useState(!0);m.useEffect(()=>{let d=!1;return(async()=>{try{const[b,E,T]=await Promise.allSettled([e("/api/config"),e("/api/services"),e("/api/services/catalog")]);if(d)return;if(b.status==="fulfilled"&&b.value.ok){const h=await b.value.json();d||l(h.quickTunnelUrl??"")}if(E.status==="fulfilled"&&E.value.ok){const h=await E.value.json();d||a(h.services??[])}if(T.status==="fulfilled"&&T.value.ok){const h=await T.value.json();d||(u(h.catalog??{}),p(h.aliases??{}))}}catch(b){console.warn("[Dashboard] initial load error:",b)}finally{d||j(!1)}})(),()=>{d=!0}},[e]);const w=m.useCallback(d=>{const y=d;y!=null&&y.services&&a(y.services)},[]);rl("/api/services",5e3,e,w,!S);const D=o.filter(d=>d.status==="running").length,g=o.filter(d=>d.status==="stopped"||d.status==="error").length;return i.jsxs("div",{id:"main",children:[i.jsx(gp,{}),i.jsxs("div",{id:"content",children:[r&&i.jsxs("div",{className:"a-info",style:{borderRadius:"var(--r)",padding:"10px 14px",marginBottom:20,display:"flex",alignItems:"center",gap:10,fontSize:12},children:[i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--txt3)",fontSize:10},children:"QUICK TUNNEL"}),i.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",color:"var(--teal)",textDecoration:"underline"},children:r})]}),i.jsx("div",{style:{display:"flex",gap:8,marginBottom:22},children:["services","logs"].map(d=>i.jsx("button",{className:`btn bsm ${t===d?"bp":"bg"}`,onClick:()=>n(d),style:{textTransform:"capitalize"},children:d==="services"?"Services":"Logs"},d))}),S&&i.jsx("div",{style:{color:"var(--txt2)",padding:"40px 0",textAlign:"center",fontFamily:"var(--mono)",fontSize:13},children:"Loading dashboard…"}),!S&&t==="services"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[i.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[i.jsxs("div",{className:"sbox",style:{minWidth:110},children:[i.jsx("div",{className:"sk",children:"Total"}),i.jsx("div",{className:"sv",children:o.length})]}),i.jsxs("div",{className:"sbox",style:{minWidth:110},children:[i.jsx("div",{className:"sk",children:"Running"}),i.jsx("div",{className:"sv",style:{color:"var(--green)"},children:D})]}),i.jsxs("div",{className:"sbox",style:{minWidth:110},children:[i.jsx("div",{className:"sk",children:"Stopped"}),i.jsx("div",{className:"sv",style:{color:g>0?"var(--red)":"var(--txt3)"},children:g})]})]}),o.length>0?i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:10},children:"Services"}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:12},children:o.map(d=>{const y=s[d.id]??s[d.name]??s[c[d.name]]??s[d.type];return i.jsx(Ug,{service:d,detail:y,onOpenDetail:()=>v(d)},d.id)})})]}):i.jsx("div",{style:{background:"var(--bg2)",border:"1px dashed var(--bdr2)",borderRadius:"var(--r2)",padding:"40px 20px",textAlign:"center",color:"var(--txt3)",fontFamily:"var(--mono)",fontSize:13},children:"No services found"})]}),!S&&t==="logs"&&i.jsx(Wg,{apiFetch:e})]}),i.jsx(xp,{}),f&&i.jsx(Og,{service:f,detail:s[f.id]??s[f.name]??s[c[f.name]]??s[f.type],onClose:()=>v(null)})]})}let En=null,Hi=null;function ce(e,t=2600){En&&(Hi&&clearTimeout(Hi),En(e),Hi=setTimeout(()=>En==null?void 0:En(""),t))}function Vg(){const e=m.useRef(null);return m.useEffect(()=>(En=t=>{const n=e.current;n&&(n.textContent=t,n.style.display=t?"flex":"none")},()=>{En=null}),[]),i.jsx("div",{ref:e,id:"toast",style:{display:"none"}})}function Kg(e){switch(e){case"running":return"bdg b-run";case"stopped":return"bdg b-stop";case"creating":return"bdg b-build";case"failed":return"bdg b-stop";default:return"bdg b-idle"}}function Gg(e){return e==="running"||e==="creating"?i.jsx("span",{className:"blink-dot"}):i.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"currentColor",display:"inline-block"}})}function Qg(e){return e?new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"Never deployed"}function Zg({app:e,onOpenDetail:t,onStart:n,onStop:r,onDeploy:l,onDelete:o}){const a=()=>{if(!e.lastDeployedAt){ce("⚠️ Deploy first before starting");return}n()};return i.jsxs("div",{style:{background:"var(--bg2)",border:"1px solid var(--bdr)",borderRadius:"var(--r2)",padding:"18px 20px",display:"flex",flexDirection:"column",gap:12},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[i.jsx("button",{onClick:t,style:{fontSize:15,fontWeight:700,color:"var(--amber)",fontFamily:"var(--mono)",background:"none",border:"none",padding:0,cursor:"pointer",textDecoration:"underline",textDecorationStyle:"dotted",textUnderlineOffset:3},children:e.name}),i.jsxs("span",{className:Kg(e.status),children:[Gg(e.status),e.status]}),i.jsxs("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--txt3)",fontFamily:"var(--mono)"},children:[":",e.port]})]}),i.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.lang&&i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--teal)",background:"rgba(61,214,200,0.07)",border:"1px solid rgba(61,214,200,0.18)",borderRadius:20,padding:"2px 9px"},children:e.lang}),e.framework&&i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--violet)",background:"rgba(167,139,250,0.07)",border:"1px solid rgba(167,139,250,0.18)",borderRadius:20,padding:"2px 9px"},children:e.framework}),i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt2)",background:"rgba(255,255,255,0.03)",border:"1px solid var(--bdr3)",borderRadius:20,padding:"2px 9px"},children:e.mode})]}),i.jsx("div",{style:{fontSize:11.5,color:"var(--txt3)",fontFamily:"var(--mono)"},children:e.lastDeployedAt?i.jsxs(i.Fragment,{children:["Last deployed: ",i.jsx("span",{style:{color:"var(--txt2)"},children:Qg(e.lastDeployedAt)})]}):i.jsx("span",{style:{color:"var(--txt3)"},children:"Never deployed"})}),(e.localUrl||e.externalUrl||e.giteaRepoUrl)&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.localUrl&&i.jsx("a",{href:e.localUrl,target:"_blank",rel:"noopener noreferrer",className:"domain-link",style:{fontSize:11},children:"↗ Local"}),e.externalUrl&&i.jsx("a",{href:e.externalUrl,target:"_blank",rel:"noopener noreferrer",className:"domain-link",style:{fontSize:11,background:"rgba(232,168,73,0.07)",borderColor:"rgba(232,168,73,0.18)",color:"var(--amber)"},children:"↗ External"}),e.giteaRepoUrl&&i.jsx("a",{href:e.giteaRepoUrl,target:"_blank",rel:"noopener noreferrer",className:"domain-link",style:{fontSize:11,background:"rgba(61,214,200,0.07)",borderColor:"rgba(61,214,200,0.18)",color:"var(--teal)"},children:"⎇ Gitea"})]}),i.jsxs("div",{style:{display:"flex",gap:6},children:[i.jsx("button",{className:"btn bgrn bsm",onClick:a,disabled:e.status==="running",style:{opacity:e.status==="running"?.4:1,cursor:e.status==="running"?"not-allowed":"pointer"},children:"▶ Start"}),i.jsx("button",{className:"btn br bsm",onClick:r,disabled:e.status==="stopped",style:{opacity:e.status==="stopped"?.4:1,cursor:e.status==="stopped"?"not-allowed":"pointer"},children:"■ Stop"}),i.jsx("button",{className:`btn bt bsm${e.lastDeployedAt?"":" btn-pulse-deploy"}`,onClick:l,children:"↑ Deploy"}),i.jsx("button",{className:"btn br bsm",onClick:o,children:"✕ Delete"})]})]})}const Yg=[{id:"nodejs",label:"Node.js"},{id:"python",label:"Python"},{id:"go",label:"Go"},{id:"rust",label:"Rust"},{id:"java",label:"Java"},{id:"kotlin",label:"Kotlin"}],Xg={nodejs:[{id:"express",label:"Express 5",stackId:"nodejs-express"},{id:"nestjs",label:"NestJS 11",stackId:"nodejs-nestjs"},{id:"nextjs-app",label:"Next.js 15 (API Routes)",stackId:"nodejs-nextjs"},{id:"nextjs",label:"Next.js 15 (Full-Stack)",stackId:"nodejs-nextjs-full"}],python:[{id:"fastapi",label:"FastAPI",stackId:"python-fastapi"},{id:"django",label:"Django 6",stackId:"python-django"},{id:"flask",label:"Flask 3.1",stackId:"python-flask"}],go:[{id:"gin",label:"Gin",stackId:"go-gin"},{id:"echo",label:"Echo v4",stackId:"go-echo"},{id:"fiber",label:"Fiber v3",stackId:"go-fiber"}],rust:[{id:"actix-web",label:"Actix-web 4",stackId:"rust-actix-web"},{id:"axum",label:"Axum 0.8",stackId:"rust-axum"}],java:[{id:"springboot",label:"Spring Boot 3.3",stackId:"java-springboot"},{id:"spring",label:"Spring Framework 6.2",stackId:"java-spring"}],kotlin:[{id:"ktor",label:"Ktor 3.1",stackId:"kotlin-ktor"},{id:"springboot-kt",label:"Spring Boot 3.4",stackId:"kotlin-springboot"}]};function Jg(e){return{padding:"7px 16px",borderRadius:20,border:e?"1px solid var(--amber)":"1px solid var(--bdr2)",background:e?"rgba(232,168,73,0.12)":"var(--bg3)",color:e?"var(--amber)":"var(--txt2)",fontSize:12,fontFamily:"var(--mono)",cursor:"pointer",transition:"all 0.14s",userSelect:"none"}}function qg({apiFetch:e,onCreated:t,onClose:n}){const[r,l]=m.useState(1),[o,a]=m.useState(""),[s,u]=m.useState("boilerplate"),[c,p]=m.useState(""),[f,v]=m.useState(""),[S,j]=m.useState(""),[w,D]=m.useState(""),[g,d]=m.useState(3e3),[y,b]=m.useState(!1),[E,T]=m.useState(""),[h,k]=m.useState("idle"),[I,R]=m.useState(null),K=m.useRef(null);m.useEffect(()=>{if(r===3)return k("checking"),R(null),K.current&&clearTimeout(K.current),K.current=setTimeout(async()=>{try{const H=await e(`/api/apps/check-port?port=${g}`);if(!H.ok){k("idle");return}if((await H.json()).available)k("available");else{let z=g+1;for(;z<=65535;){const F=await e(`/api/apps/check-port?port=${z}`);if(F.ok&&(await F.json()).available)break;z++}R(z<=65535?z:null),k("conflict")}}catch{k("idle")}},400),()=>{K.current&&clearTimeout(K.current)}},[g,r]);const L=()=>{const H=o.trim();if(!H){T("App name is required");return}if(!/^[a-z0-9][a-z0-9-]{0,29}$/.test(H)){T("Lowercase letters, numbers and hyphens only, max 30 chars");return}T(""),l(2)},Q=()=>{if(s==="boilerplate"){if(!c){ce("Select a stack to continue");return}}else{const H=w.trim();if(!H){ce("Git URL is required");return}if(!/^https?:\/\/.+/.test(H)){ce("Enter a valid Git URL (https://)");return}}l(3)},le=async()=>{b(!0);try{const H={appName:o.trim(),mode:s,port:g,...s==="boilerplate"?{stackId:c}:{},...s==="git-clone"?{gitUrl:w.trim()}:{}},fe=await e("/api/apps/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)});if(!fe.ok){const F=await fe.json().catch(()=>({error:"Unknown error"}));ce(`Error: ${F.error??fe.statusText}`);return}const z=await fe.json();t(z.jobId,o.trim())}catch(H){ce(`Error: ${H instanceof Error?H.message:String(H)}`)}finally{b(!1)}},_e=H=>({display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderRadius:"var(--r)",border:H?"1px solid var(--amber)":"1px solid var(--bdr2)",background:H?"rgba(232,168,73,0.08)":"var(--bg3)",cursor:"pointer",transition:"all 0.14s",width:"100%",textAlign:"left"});return i.jsx("div",{className:"overlay",children:i.jsxs("div",{className:"modal",style:{maxWidth:560},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px 0"},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--txt)"},children:"Create New App"}),i.jsxs("div",{style:{fontSize:11.5,color:"var(--txt3)",fontFamily:"var(--mono)",marginTop:4},children:["Step ",r," of 3"]})]}),i.jsx("button",{className:"xbtn",onClick:n,children:"✕"})]}),i.jsx("div",{style:{padding:"12px 24px 0"},children:i.jsx("div",{style:{height:3,background:"var(--bdr)",borderRadius:4},children:i.jsx("div",{style:{height:"100%",width:`${r/3*100}%`,background:"var(--amber)",borderRadius:4,transition:"width 0.2s ease"}})})}),i.jsxs("div",{style:{padding:"20px 24px",flex:1,overflowY:"auto",maxHeight:"60vh"},children:[r===1&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[i.jsxs("div",{children:[i.jsx("label",{className:"fl",children:"Mode"}),i.jsx("div",{style:{display:"flex",gap:8},children:[{id:"boilerplate",label:"Boilerplate",Icon:Fv},{id:"git-clone",label:"Git Clone",Icon:Ev}].map(({id:H,label:fe,Icon:z})=>{const F=s===H;return i.jsxs("button",{onClick:()=>u(H),style:{display:"flex",alignItems:"center",gap:7,padding:"9px 18px",borderRadius:"var(--r)",border:F?"1px solid var(--amber)":"1px solid var(--bdr2)",background:F?"rgba(232,168,73,0.1)":"var(--bg3)",color:F?"var(--amber)":"var(--txt2)",fontSize:13,fontWeight:F?600:400,cursor:"pointer",transition:"all 0.14s"},children:[i.jsx(z,{size:15,strokeWidth:F?2.2:1.8}),fe]},H)})}),i.jsx("div",{className:"fhint",style:{marginTop:8},children:s==="boilerplate"?"Clone a Brewnet catalog template (language + framework).":"Clone any Git repository and deploy it on brewnet."})]}),i.jsxs("div",{className:"fg",children:[i.jsx("label",{className:"fl",children:"App Name"}),i.jsx("input",{className:"fi",value:o,onChange:H=>{a(H.target.value),T("")},placeholder:"my-app",autoFocus:!0,onKeyDown:H=>{H.key==="Enter"&&L()}}),E&&i.jsx("div",{className:"fhint",style:{color:"var(--red)"},children:E}),i.jsx("div",{className:"fhint",children:"Lowercase letters, numbers, hyphens. Max 30 chars."})]})]}),r===2&&s==="boilerplate"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:18},children:[i.jsxs("div",{children:[i.jsx("label",{className:"fl",children:"Language"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:Yg.map(H=>i.jsx("button",{style:Jg(f===H.id),onClick:()=>{v(H.id),j(""),p("")},children:H.label},H.id))})]}),f&&i.jsxs("div",{children:[i.jsx("label",{className:"fl",children:"Framework"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:(Xg[f]??[]).map(H=>i.jsxs("button",{style:_e(S===H.id),onClick:()=>{j(H.id),p(H.stackId)},children:[i.jsx("span",{style:{fontSize:13,fontWeight:600,color:S===H.id?"var(--amber)":"var(--txt)"},children:H.label}),i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt3)",marginLeft:"auto"},children:H.stackId})]},H.id))})]})]}),r===2&&s==="git-clone"&&i.jsxs("div",{className:"fg",children:[i.jsx("label",{className:"fl",children:"Git Repository URL"}),i.jsx("input",{className:"fi",value:w,onChange:H=>D(H.target.value),placeholder:"https://github.com/your-org/your-repo.git",autoFocus:!0,onKeyDown:H=>{H.key==="Enter"&&Q()}}),i.jsx("div",{className:"fhint",children:"Clone and deploy any public or private Git repository."})]}),r===3&&i.jsxs("div",{className:"fg",children:[i.jsx("label",{className:"fl",children:"Port"}),i.jsx("input",{className:"fi",type:"number",min:1024,max:65535,value:g,onChange:H=>d(Number(H.target.value)),autoFocus:!0,style:{borderColor:h==="conflict"?"var(--red)":void 0}}),h==="checking"&&i.jsx("div",{className:"fhint",children:"포트 확인 중…"}),h==="conflict"&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[i.jsxs("div",{className:"fhint",style:{color:"var(--red)",margin:0},children:["⚠ 포트 ",g," 사용 중."]}),I&&i.jsxs("button",{className:"btn bg bsm",style:{fontSize:11,padding:"3px 10px"},onClick:()=>d(I),children:[I," 사용"]})]}),h==="available"&&i.jsx("div",{className:"fhint",children:"Container port your app listens on. Default 3000."}),s==="boilerplate"&&f==="rust"&&i.jsx("div",{className:"fhint",style:{color:"var(--amber)",marginTop:6},children:"⚠ Rust stacks require longer build time (~10–20 min)."})]})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 24px 20px",gap:10},children:[i.jsx("button",{className:"btn bg",onClick:()=>r>1?l(r-1):n(),children:r===1?"Cancel":"← Back"}),i.jsxs("div",{style:{display:"flex",gap:8},children:[r<3&&i.jsx("button",{className:"btn bp",onClick:r===1?L:Q,disabled:r===2&&(s==="boilerplate"?!S:!w.trim()),children:"Next →"}),r===3&&i.jsx("button",{className:"btn bp",onClick:le,disabled:y,style:{opacity:y?.6:1},children:y?i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"})," Creating…"]}):"Create App"})]})]})]})})}function ex(e){const[t,n]=m.useState(0),r=m.useRef(null);return m.useEffect(()=>{if(!e){r.current=null,queueMicrotask(()=>n(0));return}r.current===null&&(r.current=Date.now());const l=setInterval(()=>n(Math.floor((Date.now()-r.current)/1e3)),1e3);return()=>clearInterval(l)},[e]),t}function tx({status:e}){return e==="done"?i.jsx("span",{style:{color:"var(--green)",fontWeight:700,width:16,display:"inline-block",textAlign:"center"},children:"✓"}):e==="running"?i.jsx("span",{style:{color:"var(--amber)",fontWeight:700,width:16,display:"inline-block",textAlign:"center",animation:"spin 1s linear infinite"},children:"◌"}):e==="failed"?i.jsx("span",{style:{color:"var(--red)",fontWeight:700,width:16,display:"inline-block",textAlign:"center"},children:"✗"}):i.jsx("span",{style:{color:"var(--txt2)",width:16,display:"inline-block",textAlign:"center"},children:"○"})}function wp({jobId:e,appName:t,jobType:n="create",apiFetch:r,onClose:l,onComplete:o}){const[a,s]=m.useState(null),[u,c]=m.useState(null),p=m.useRef(!1),f=m.useRef(null),v=m.useRef(0),S=m.useRef(Date.now()),[j,w]=m.useState(0),g=((a==null?void 0:a.steps.findIndex(E=>E.status==="running"))??-1)!==-1&&(a==null?void 0:a.status)==="running",d=ex(g),y=m.useCallback(async()=>{var E;try{const T=await r(`/api/apps/jobs/${e}`);if(!T.ok)return c(`Failed to fetch job status: ${T.status}`),!1;const h=await T.json();s(h);const k=((E=h.logs)==null?void 0:E.length)??0;return k!==v.current?(v.current=k,S.current=Date.now(),w(0)):h.status==="running"&&w(Math.floor((Date.now()-S.current)/1e3)),h.status==="done"&&!p.current?(p.current=!0,ce(n==="deploy"?"Deploy가 성공적으로 수행되었습니다.":"앱이 성공적으로 생성되었습니다."),o==null||o(),!1):h.status!=="failed"}catch(T){return c(T instanceof Error?T.message:String(T)),!1}},[e,r,o]);m.useEffect(()=>{let E=null,T=!1;return(async()=>{await y()&&!T&&(E=setInterval(async()=>{!await y()&&E&&(clearInterval(E),E=null)},1e3))})(),()=>{T=!0,E&&clearInterval(E)}},[e]),m.useEffect(()=>{var E;(E=f.current)==null||E.scrollIntoView({behavior:"smooth"})},[a==null?void 0:a.logs]);const b=(a==null?void 0:a.logs)??[];return i.jsx("div",{className:"overlay",children:i.jsxs("div",{className:"modal",style:{maxWidth:580},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px 16px",borderBottom:"1px solid var(--bdr)"},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--txt)"},children:(a==null?void 0:a.status)==="done"?n==="deploy"?"✓ Deploy Complete":"✓ App Created":(a==null?void 0:a.status)==="failed"?n==="deploy"?"✗ Deploy Failed":"✗ Creation Failed":n==="deploy"?"Deploying…":"Creating App…"}),i.jsxs("div",{style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--txt2)",marginTop:3},children:[t," — job ",e.slice(0,8)]})]}),i.jsx("button",{className:"xbtn",onClick:l,children:"✕"})]}),i.jsxs("div",{style:{padding:"16px 24px",flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:16},children:[a&&a.steps.length>0&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:a.steps.map((E,T)=>i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"8px 12px",borderRadius:"var(--r)",background:E.status==="running"?"rgba(232,168,73,0.06)":E.status==="done"?"rgba(61,232,154,0.04)":E.status==="failed"?"rgba(240,75,90,0.06)":"transparent",border:E.status==="running"?"1px solid rgba(232,168,73,0.15)":"1px solid transparent"},children:[i.jsx(tx,{status:E.status}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:13,color:E.status==="done"?"var(--txt2)":E.status==="running"?"var(--amber)":E.status==="failed"?"var(--red)":"var(--txt2)"},children:E.label}),E.status==="running"&&d>0&&i.jsx("span",{style:{fontSize:11,color:"var(--txt2)",fontFamily:"var(--mono)"},children:d>=60?`${Math.floor(d/60)}m ${d%60}s`:`${d}s`})]}),E.message&&i.jsx("div",{style:{fontSize:11.5,color:"var(--txt2)",fontFamily:"var(--mono)",marginTop:2},children:E.message}),E.status==="running"&&j>=10&&i.jsxs("div",{style:{fontSize:11.5,color:"var(--amber)",fontFamily:"var(--mono)",marginTop:4},children:["⌛ No new output for ",j,"s — container may be starting up…"]})]})]},T))}),((a==null?void 0:a.status)==="failed"||u)&&i.jsx("div",{style:{padding:"12px 14px",borderRadius:"var(--r)",background:"rgba(240,75,90,0.07)",border:"1px solid rgba(240,75,90,0.2)",color:"var(--red)",fontSize:12.5,fontFamily:"var(--mono)"},children:(a==null?void 0:a.error)??u??"Job failed. Check server logs."}),b.length>0&&i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:6},children:"Logs"}),i.jsxs("div",{style:{background:"var(--bg0)",border:"1px solid var(--bdr)",borderRadius:"var(--r)",padding:"10px 12px",fontFamily:"var(--mono)",fontSize:11.5,color:"var(--txt2)",maxHeight:320,overflowY:"auto",lineHeight:1.7},children:[b.map((E,T)=>i.jsx("div",{children:E},T)),i.jsx("div",{ref:f})]})]}),!a&&!u&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,color:"var(--txt2)",fontSize:13},children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"}),"Waiting for job…"]})]}),i.jsx("div",{style:{padding:"12px 24px 20px",borderTop:"1px solid var(--bdr)",display:"flex",justifyContent:"flex-end"},children:i.jsx("button",{className:(a==null?void 0:a.status)==="done"?"btn bp":"btn bg",onClick:l,children:(a==null?void 0:a.status)==="done"?"Close":(a==null?void 0:a.status)==="failed"?"Dismiss":"Close (keep running)"})})]})})}function nx(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").slice(0,63)}function Ic(e){return!e||e.length===0?{valid:!1,error:"Subdomain cannot be empty"}:e.length>63?{valid:!1,error:"Subdomain must be 63 characters or fewer"}:/[A-Z]/.test(e)?{valid:!1,error:"Subdomain must be lowercase"}:/\s/.test(e)?{valid:!1,error:"Subdomain cannot contain spaces"}:e.startsWith("-")?{valid:!1,error:"Subdomain cannot start with a hyphen"}:e.endsWith("-")?{valid:!1,error:"Subdomain cannot end with a hyphen"}:/^[a-z0-9-]+$/.test(e)?{valid:!0}:{valid:!1,error:"Subdomain must contain only lowercase letters, numbers, and hyphens"}}async function rx(e){return(await e("/api/settings/cloudflare")).json()}async function lx(e,t){return(await e("/api/settings/cloudflare",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiToken:t})})).json()}async function ox(e,t,n){return(await e("/api/settings/cloudflare",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiToken:t,zoneId:n})})).json()}async function ix(e){return(await e("/api/cloudflare/zones")).json()}async function ax(e,t){return(await e("/api/cloudflare/tunnel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelName:t})})).json()}async function sx(e,t,n,r){return(await e("/api/domain/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({appName:t,subdomain:n,domain:r})})).json()}async function ux(e,t){await e(`/api/domain/disconnect/${encodeURIComponent(t)}`,{method:"DELETE"})}async function cx(e){return(await e("/api/domain/list")).json()}const dx={INVALID_TOKEN:"API token invalid or expired. Check that it has Tunnel:Edit and DNS:Edit permissions.",NO_TOKEN:"Complete Step 1 (API Token) before loading zones.",TOKEN_INVALID:"Your saved API token is no longer valid. Re-enter it in Step 1.",TUNNEL_NAME_CONFLICT:"A tunnel with this name already exists. Try a different name.",CREDENTIALS_INCOMPLETE:"Complete Steps 1 and 2 before creating a tunnel.",CNAME_CONFLICT:"This subdomain is already in use. Choose a different one.",INVALID_SUBDOMAIN:"Subdomain must be lowercase letters, numbers, and hyphens only."};function $r(e,t){return e?dx[e]??t:t}function fx(e){return e.apiTokenSet?e.zoneName?e.tunnelName?"complete":"tunnel":"zone":"token"}function px(e){const[t,n]=m.useState(!0),[r,l]=m.useState(null),[o,a]=m.useState("token"),[s,u]=m.useState([]),[c,p]=m.useState(!1),[f,v]=m.useState(null),[S,j]=m.useState(null),[w,D]=m.useState(!1),[g,d]=m.useState(null),[y,b]=m.useState([]),[E,T]=m.useState(!1),[h,k]=m.useState(null),[I,R]=m.useState(!1),[K,L]=m.useState(null),[Q,le]=m.useState(void 0),[_e,H]=m.useState(void 0),fe=m.useCallback(async ee=>{T(!0),k(null);try{const O=ee?await fetch("/api/cloudflare/zones",{headers:{"X-Admin-Password":ee}}).then(ne=>ne.json()):await ix(e);O.success?(b(O.zones),O.zones.length===0&&O.warning&&k(O.warning)):k($r(O.error,O.message??"Failed to load zones"))}catch(O){k(O instanceof Error?O.message:"Failed to load zones")}finally{T(!1)}},[e]);m.useEffect(()=>{let ee=!1;return(async()=>{try{const O=await rx(e);if(ee)return;l(O);const ne=fx(O);a(ne);const se=[];O.apiTokenSet&&se.push("token"),O.zoneName&&se.push("zone"),O.tunnelName&&se.push("tunnel"),u(se),ne==="zone"&&fe()}catch{}finally{ee||n(!1)}})(),()=>{ee=!0}},[e,fe]);const z=m.useCallback(async ee=>{if(ee.trim()){p(!0),v(null),D(!1);try{const O=await lx(e,ee.trim());O.success?(j(O.email??null),u(ne=>[...new Set([...ne,"token"])]),a("zone"),fe()):O.error==="Unauthorized"?(d(ee.trim()),D(!0)):v($r(O.error,O.message??"Token verification failed"))}catch(O){v(O instanceof Error?O.message:"Token verification failed")}finally{p(!1)}}},[e,fe]),F=m.useCallback(async ee=>{if(!g)return;const O=g;D(!1),d(null),p(!0),v(null);try{const se=await(await fetch("/api/settings/cloudflare",{method:"PUT",headers:{"Content-Type":"application/json","X-Admin-Password":ee},body:JSON.stringify({apiToken:O})})).json();se.success?(j(se.email??null),u(Ht=>[...new Set([...Ht,"token"])]),a("zone"),fe(ee)):v($r(se.error,se.message??"Token verification failed"))}catch(ne){v(ne instanceof Error?ne.message:"Token verification failed")}finally{p(!1)}},[g,fe]),W=m.useCallback(async(ee,O)=>{var ne;try{const se=await ox(e,O,ee);if(se.success){const Ht=se.zoneName??((ne=y.find(Vt=>Vt.id===ee))==null?void 0:ne.name)??"";l(Vt=>Vt?{...Vt,zoneId:ee,zoneName:Ht}:null),u(Vt=>[...new Set([...Vt,"zone"])]),a("tunnel")}else ce($r(se.error,se.message??"Failed to save zone"))}catch(se){ce(se instanceof Error?se.message:"Failed to save zone")}},[e,y]),q=m.useCallback(async ee=>{if(ee.trim()){R(!0),L(null);try{const O=await ax(e,ee.trim());O.success?(l(ne=>ne?{...ne,tunnelName:O.tunnelName,tunnelId:O.tunnelId}:null),le(O.composeUpdated),H(O.containerRestarted),u(ne=>[...new Set([...ne,"tunnel"])]),a("complete")):L($r(O.error,"Tunnel creation failed"))}catch(O){L(O instanceof Error?O.message:"Tunnel creation failed")}finally{R(!1)}}},[e]),Z=m.useCallback(()=>{a("token"),u([]),v(null),j(null),b([]),k(null),L(null)},[]),We=(r==null?void 0:r.tunnelName)||(r!=null&&r.projectName?`brewnet-${r.projectName}`:"brewnet-homeserver");return{currentStep:o,completedSteps:s,loading:t,summary:r,tokenValidating:c,tokenError:f,tokenEmail:S,adminPasswordRequired:w,saveTokenAction:z,submitAdminPassword:F,zones:y,zonesLoading:E,zonesError:h,loadZones:fe,selectZoneAction:W,defaultTunnelName:We,tunnelCreating:I,tunnelError:K,tunnelComposeUpdated:Q,tunnelContainerRestarted:_e,createTunnelAction:q,resetSetup:Z}}function hx({steps:e,currentStep:t,completedSteps:n}){return i.jsx("div",{style:{display:"flex",alignItems:"center",gap:0,marginBottom:28},children:e.map((r,l)=>{const o=n.includes(r.id),a=r.id===t;return i.jsxs("div",{style:{display:"flex",alignItems:"center",flex:l<e.length-1?"1":"none"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",border:`2px solid ${o||a?"var(--teal)":"var(--bdr)"}`,background:o?"var(--teal)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o?i.jsx("span",{style:{color:"#fff",fontSize:13,fontWeight:700},children:"✓"}):i.jsx("span",{style:{fontSize:12,fontWeight:600,color:a?"var(--teal)":"var(--txt3)"},children:l+1})}),i.jsx("span",{style:{fontSize:11,fontWeight:a?600:400,color:o||a?"var(--teal)":"var(--txt3)",whiteSpace:"nowrap"},children:r.label})]}),l<e.length-1&&i.jsx("div",{style:{flex:1,height:2,background:o?"var(--teal)":"var(--bdr)",margin:"0 4px",marginBottom:18,alignSelf:"flex-start",marginTop:14}})]},r.id)})})}function ui({helpKey:e,onHelp:t}){return i.jsx("button",{type:"button",onClick:()=>t(e),title:"Show help",style:{cursor:"pointer",verticalAlign:"middle",fontSize:11,color:"var(--txt3)",fontWeight:700,lineHeight:1,display:"inline-flex",alignItems:"center",justifyContent:"center",width:15,height:15,border:"1.5px solid currentColor",borderRadius:"50%",background:"none",padding:0,transition:"color 0.14s, border-color 0.14s"},onMouseEnter:n=>{n.currentTarget.style.color="var(--teal)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--txt3)"},children:"?"})}function mx({tokenValidating:e,tokenError:t,tokenEmail:n,adminPasswordRequired:r,onSaveToken:l,onAdminPassword:o,onHelp:a}){const[s,u]=m.useState(""),[c,p]=m.useState(""),f=()=>{s.trim()&&l(s.trim())},v=()=>{c.trim()&&o&&(o(c.trim()),p(""))},S=!!n;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{children:[i.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"var(--txt)",marginBottom:4},children:["Cloudflare API Token",i.jsx("span",{style:{marginLeft:6},children:i.jsx(ui,{helpKey:"api-token",onHelp:a})})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--txt2)",marginBottom:10},children:["Required permissions: ",i.jsx("strong",{children:"Cloudflare Tunnel:Edit"}),", ",i.jsx("strong",{children:"DNS:Edit"}),", ",i.jsx("strong",{children:"Zone:Read"})]}),i.jsx("input",{className:"fi",type:"password",value:s,onChange:j=>u(j.target.value),onKeyDown:j=>{j.key==="Enter"&&f()},onBlur:f,placeholder:"Paste your API token here…",autoComplete:"new-password",disabled:e,style:{borderColor:t?"var(--red)":S?"var(--teal)":void 0}}),e&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8,fontSize:12,color:"var(--txt2)"},children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"}),"Verifying token…"]}),t&&!e&&!r&&i.jsx("div",{style:{marginTop:8,fontSize:12,color:"var(--red)",lineHeight:1.5},children:t}),r&&!e&&i.jsxs("div",{style:{marginTop:12,padding:"12px 14px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.25)",display:"flex",flexDirection:"column",gap:10},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,fontWeight:600,color:"var(--amber)"},children:[i.jsx(Tv,{size:13}),"Admin password required"]}),i.jsx("div",{style:{fontSize:12,color:"var(--txt2)",lineHeight:1.5},children:"브루넷 설치 시 설정한 관리자 비밀번호를 입력하세요."}),i.jsx("input",{className:"fi",type:"password",value:c,onChange:j=>p(j.target.value),onKeyDown:j=>{j.key==="Enter"&&v()},placeholder:"Admin password",autoFocus:!0,autoComplete:"current-password"}),i.jsxs("button",{className:"btn bp",onClick:v,disabled:!c.trim(),style:{alignSelf:"flex-start",opacity:c.trim()?1:.6},children:[i.jsx(fc,{size:14})," Confirm & Verify"]})]}),S&&!e&&!t&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,fontSize:12,color:"var(--teal)"},children:[i.jsx("span",{style:{fontWeight:700},children:"✓"}),"Verified — ",n]})]}),i.jsx("button",{className:"btn bp",onClick:f,disabled:e||!s.trim(),style:{alignSelf:"flex-start",opacity:e||!s.trim()?.6:1},children:e?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," Verifying…"]}):i.jsxs(i.Fragment,{children:[i.jsx(fc,{size:14})," Verify Token"]})})]})}function vx({zones:e,selectedId:t,onSelect:n}){const[r,l]=m.useState(!1),[o,a]=m.useState(null),s=m.useRef(null),u=m.useRef(null);m.useEffect(()=>{if(!r)return;const f=v=>{u.current&&!u.current.contains(v.target)&&s.current&&!s.current.contains(v.target)&&l(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r]);const c=()=>{!r&&s.current&&a(s.current.getBoundingClientRect()),l(f=>!f)},p=e.find(f=>f.id===t);return i.jsxs("div",{style:{position:"relative"},children:[i.jsxs("button",{ref:s,type:"button",onClick:c,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,background:"var(--bg3)",border:`1px solid ${r?"var(--amber)":"var(--bdr2)"}`,borderRadius:"var(--r)",padding:"9px 13px",fontFamily:"var(--mono)",fontSize:13,color:p?"var(--txt)":"var(--txt3)",cursor:"pointer",textAlign:"left",transition:"border-color 0.14s"},children:[i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[p&&i.jsx(Ao,{size:13,style:{color:"var(--teal)",flexShrink:0}}),i.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p?p.name:"— Select a domain —"})]}),p&&i.jsx("span",{style:{fontSize:10,fontFamily:"var(--sans)",padding:"2px 7px",borderRadius:4,background:p.status==="active"?"rgba(61,232,154,0.1)":"rgba(232,168,73,0.1)",color:p.status==="active"?"var(--green)":"var(--amber)",flexShrink:0},children:p.status}),i.jsx(jv,{size:14,style:{color:"var(--txt2)",flexShrink:0,transform:r?"rotate(180deg)":"none",transition:"transform 0.14s"}})]}),r&&o&&i.jsx("div",{ref:u,style:{position:"fixed",top:o.bottom+4,left:o.left,width:o.width,background:"var(--bg2)",border:"1px solid var(--bdr3)",borderRadius:"var(--r)",boxShadow:"0 8px 24px rgba(0,0,0,0.5)",zIndex:9999,maxHeight:220,overflowY:"auto"},children:e.map(f=>{const v=f.id===t;return i.jsxs("button",{type:"button",onClick:()=>{n(f.id),l(!1)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"10px 13px",background:v?"rgba(61,214,200,0.07)":"transparent",border:"none",borderBottom:"1px solid var(--bdr)",fontFamily:"var(--mono)",fontSize:13,color:v?"var(--teal)":"var(--txt)",cursor:"pointer",textAlign:"left",transition:"background 0.1s"},onMouseEnter:S=>{v||(S.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:S=>{v||(S.currentTarget.style.background="transparent")},children:[i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx(Ao,{size:13,style:{color:v?"var(--teal)":"var(--txt2)",flexShrink:0}}),f.name]}),i.jsx("span",{style:{fontSize:10,fontFamily:"var(--sans)",padding:"2px 7px",borderRadius:4,background:f.status==="active"?"rgba(61,232,154,0.1)":"rgba(232,168,73,0.1)",color:f.status==="active"?"var(--green)":"var(--amber)",flexShrink:0},children:f.status})]},f.id)})})]})}function yx({zones:e,zonesLoading:t,zonesError:n,onLoadZones:r,onSelectZone:l,currentToken:o="",onHelp:a}){const[s,u]=m.useState(""),c=p=>{u(p),p&&l(p,o)};return i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:16},children:i.jsxs("div",{children:[i.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"var(--txt)",marginBottom:4},children:["Select Domain (Zone)",i.jsx("span",{style:{marginLeft:6},children:i.jsx(ui,{helpKey:"zone",onHelp:a})})]}),i.jsx("div",{style:{fontSize:12,color:"var(--txt2)",marginBottom:10},children:"Choose which domain to use for your Brewnet apps."}),t?i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"var(--txt2)",padding:"12px 0"},children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"}),"Fetching your domains…"]}):n?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[i.jsx("div",{style:{padding:"10px 14px",borderRadius:"var(--r)",background:"rgba(240,180,50,0.07)",border:"1px solid rgba(240,180,50,0.25)",fontSize:12,color:"var(--amber)",lineHeight:1.6},children:n}),i.jsxs("button",{className:"btn bg",onClick:()=>void r(),style:{alignSelf:"flex-start"},children:[i.jsx(dc,{size:14})," Retry"]})]}):e.length===0?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[i.jsx("div",{style:{fontSize:13,color:"var(--txt2)",fontStyle:"italic"},children:"No domains found in your Cloudflare account."}),i.jsxs("button",{className:"btn bg",onClick:()=>void r(),style:{alignSelf:"flex-start"},children:[i.jsx(dc,{size:14})," Retry"]})]}):i.jsx(vx,{zones:e,selectedId:s,onSelect:c})]})})}function gx({defaultTunnelName:e,tunnelCreating:t,tunnelError:n,isComplete:r,composeUpdated:l,containerRestarted:o,onCreateTunnel:a,onStartOver:s,onHelp:u}){const[c,p]=m.useState(e);if(r){const f=l!==void 0||o!==void 0;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"var(--teal)"},children:[i.jsx("span",{style:{fontWeight:700},children:"✓"}),"Tunnel ",i.jsx("strong",{style:{fontFamily:"var(--mono)"},children:e})," created!"]}),f&&o&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.06)",border:"1px solid rgba(61,214,200,0.2)",fontSize:12,color:"var(--teal)"},children:[i.jsx("span",{style:{fontWeight:700},children:"✓"}),"docker-compose.yml 업데이트 및 cloudflared 컨테이너 재시작 완료"]}),f&&l&&!o&&i.jsxs("div",{style:{padding:"8px 12px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.25)",fontSize:12,color:"var(--amber)",lineHeight:1.6},children:["⚠ docker-compose.yml은 업데이트됐지만 cloudflared 재시작에 실패했습니다.",i.jsx("br",{}),i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11},children:"docker compose up -d --force-recreate cloudflared"}),"을 수동으로 실행하세요."]}),f&&!l&&i.jsxs("div",{style:{padding:"8px 12px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.25)",fontSize:12,color:"var(--amber)",lineHeight:1.6},children:["⚠ docker-compose.yml을 자동으로 업데이트하지 못했습니다.",i.jsx("br",{}),"cloudflared 서비스의 ",i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11},children:"command"}),"와"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11},children:"TUNNEL_TOKEN"})," 환경변수를 수동으로 업데이트하고 재시작하세요."]})]})}return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{children:[i.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"var(--txt)",marginBottom:4},children:["Tunnel Name",i.jsx("span",{style:{marginLeft:6},children:i.jsx(ui,{helpKey:"tunnel-name",onHelp:u})})]}),i.jsx("div",{style:{fontSize:12,color:"var(--txt2)",marginBottom:10},children:"Cloudflare에 생성할 터널의 이름입니다. 이 터널은 모든 앱이 공유하는 공통 연결 채널입니다."}),i.jsx("input",{className:"fi",value:c,onChange:f=>p(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!t&&c.trim()&&a(c.trim())},placeholder:"brewnet-homeserver",disabled:t,style:{borderColor:n?"var(--red)":void 0,fontFamily:"var(--mono)"}}),n&&n.includes("Steps 1 and 2")?i.jsxs("div",{style:{marginTop:12,padding:"12px 14px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.25)",display:"flex",flexDirection:"column",gap:10},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--amber)"},children:"⚠ Step 1·2 정보가 올바르지 않습니다"}),i.jsx("div",{style:{fontSize:12,color:"var(--txt2)",lineHeight:1.6},children:"API 토큰 또는 Zone 정보가 저장되지 않았습니다. Step 1부터 다시 진행해 주세요."}),i.jsx("button",{className:"btn bp",onClick:s,style:{alignSelf:"flex-end"},children:"← Step 1부터 다시 시작"})]}):n?i.jsx("div",{style:{marginTop:8,fontSize:12,color:"var(--red)",lineHeight:1.5},children:n}):null]}),i.jsx("button",{className:"btn bp",onClick:()=>void a(c.trim()),disabled:t||!c.trim(),style:{alignSelf:"flex-end",opacity:t||!c.trim()?.6:1},children:t?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," Creating tunnel…"]}):i.jsxs(i.Fragment,{children:[i.jsx(Xv,{size:14})," Create Tunnel"]})})]})}const xx={"api-token":{title:"Cloudflare API Token",what:"API Token은 Brewnet이 Cloudflare API를 통해 터널 생성 및 DNS 레코드를 자동으로 관리할 수 있는 인증 키입니다. 계정 전체 권한의 Global API Key와 달리, 특정 작업에만 범위가 제한된 안전한 토큰입니다.",howToGet:[{step:"우측 상단 프로필 아이콘 클릭 → 「My Profile」 → 좌측 메뉴 「API Tokens」 클릭"},{step:"「Create Token」 버튼 클릭 → 목록 맨 아래 「Custom token」 행에서 「Get started」 클릭"},{step:"Token Name 입력 (예: brewnet)"},{step:"Permissions — 권한 1 : 터널 생성·관리",detail:`① 첫 번째 드롭다운 → Account 선택
199
+ ② 두 번째 드롭다운 → Cloudflare Tunnel 선택
200
+ ③ 세 번째 드롭다운 → Edit 선택`},{step:"「+ Add more」 클릭 → 권한 2 : DNS 레코드 자동 생성",detail:`① 첫 번째 드롭다운 → Zone 선택
201
+ ② 두 번째 드롭다운 → DNS 선택
202
+ ③ 세 번째 드롭다운 → Edit 선택`},{step:"「+ Add more」 클릭 → 권한 3 : 도메인 목록 조회",detail:`① 첫 번째 드롭다운 → Zone 선택
203
+ ② 두 번째 드롭다운 → Zone 선택 ← 두 번째 드롭다운도 Zone
204
+ ③ 세 번째 드롭다운 → Read 선택`},{step:"Zone Resources — 토큰을 적용할 도메인 범위 지정",detail:`「Include」→「All zones from an account」→ 본인 계정 선택
205
+
206
+ 특정 도메인만 허용하려면:
207
+ 「Include」→「Specific zone」→ 사용할 도메인 선택`},{step:"「Continue to summary」 → 「Create Token」 클릭 → 표시된 토큰 즉시 복사"}],note:"토큰은 생성 직후 한 번만 표시됩니다. 창을 닫으면 다시 확인할 수 없으니 반드시 복사 후 안전한 곳에 보관하세요.",link:"https://dash.cloudflare.com/profile/api-tokens",linkLabel:"Cloudflare API Tokens 페이지 열기 →"},zone:{title:"Domain (Zone)",what:"Cloudflare Zone은 Cloudflare에서 관리 중인 도메인(예: example.com)을 의미합니다. API Token이 유효하면 계정에 등록된 모든 도메인이 자동으로 목록에 불러와집니다.",howToGet:[{step:"도메인이 없는 경우",detail:"Cloudflare Registrar에서 직접 구매하거나, 다른 업체(가비아, AWS 등)에서 구매 후 네임서버를 Cloudflare로 이전하세요."},{step:"이미 Cloudflare에 도메인이 있는 경우",detail:"「Load Domains」를 누르면 자동으로 선택 목록에 표시됩니다."},{step:"도메인 상태(Active/Pending)",detail:"Pending 상태는 네임서버 변경이 아직 적용 중임을 의미합니다. Active 상태가 되어야 DNS 레코드 생성이 가능합니다."}],link:"https://dash.cloudflare.com/",linkLabel:"Cloudflare 대시보드에서 도메인 확인 →"},subdomain:{title:"Subdomain",what:'서브도메인은 도메인 앞에 붙는 접두사입니다. 예를 들어 앱 이름이 "my-blog"이면 my-blog.example.com 으로 외부에서 접근할 수 있게 됩니다. 서브도메인마다 Cloudflare에 CNAME DNS 레코드가 자동으로 생성되며, Tunnel 인그레스 규칙도 함께 추가됩니다.',howToGet:[{step:"앱 이름 기반으로 자동 입력됩니다",detail:'예: 앱 이름이 "nodejs-express"이면 "nodejs-express"로 자동 제안됩니다.'},{step:"규칙: 영문 소문자, 숫자, 하이픈(-)만 허용",detail:"대문자, 언더스코어(_), 공백은 사용 불가. 하이픈으로 시작하거나 끝날 수 없습니다."},{step:"중복 확인",detail:"같은 도메인에 동일한 서브도메인이 이미 다른 앱에 연결되어 있으면 오류가 발생합니다."}],note:"연결 후 DNS 전파에 최대 수 분이 걸릴 수 있습니다. Cloudflare는 보통 즉시 반영됩니다.",link:"https://dash.cloudflare.com/",linkLabel:"Cloudflare DNS 레코드 확인 →"},"cloudflare-setup":{title:"Cloudflare Tunnel 설정 가이드",what:"Cloudflare Tunnel을 사용하면 공인 IP나 포트 포워딩 없이 홈 서버의 앱을 외부 도메인(예: myapp.example.com)으로 안전하게 공개할 수 있습니다. 설정은 최초 1회만 필요하며, 이후 앱마다 서브도메인만 연결하면 됩니다.",howToGet:[{step:"Step 1 — API Token 발급 및 검증",detail:`My Profile → API Tokens → Create Token → Custom token → Get started
208
+
209
+ 권한 3개 추가 (각 행: 카테고리 → 서비스 → 레벨):
210
+ Account → Cloudflare Tunnel → Edit
211
+ Zone → DNS → Edit
212
+ Zone → Zone → Read
213
+
214
+ Zone Resources:
215
+ Include → All zones from an account → 본인 계정 선택`},{step:"Step 2 — Zone(도메인) 선택",detail:"API Token이 검증되면 계정에 등록된 도메인이 자동으로 불러와집니다. 사용할 도메인을 선택하세요."},{step:"Step 3 — Tunnel 생성",detail:"이름을 입력하고 Create Tunnel을 클릭하면 Cloudflare에 터널이 자동으로 생성됩니다."},{step:"Step 4 — 앱별 서브도메인 연결",detail:"설정 완료 후 각 앱의 Domain 탭에서 서브도메인을 입력하고 Connect를 클릭하면 DNS 레코드가 자동 생성됩니다."}],note:"Cloudflare 계정과 도메인이 없다면 먼저 가입하고 도메인을 Cloudflare로 이전해야 합니다.",link:"https://dash.cloudflare.com/",linkLabel:"Cloudflare 대시보드 열기 →"},"tunnel-name":{title:"Tunnel Name",what:"Cloudflare Tunnel은 공인 IP나 포트 포워딩 없이 로컬 서버를 안전하게 외부에 노출하는 기술입니다. 터널 이름은 Cloudflare Zero Trust 대시보드에서 이 연결을 식별하는 레이블로 사용됩니다.",howToGet:[{step:"이름은 프로젝트명을 기반으로 자동 입력됩니다. 그대로 사용하거나 원하는 이름으로 변경하세요."},{step:"이름 규칙",detail:"영문 소문자, 숫자, 하이픈(-)만 사용 가능. Cloudflare 계정 내에서 고유해야 합니다."},{step:"생성 후 확인 위치",detail:"Cloudflare Zero Trust 대시보드 → Networks → Tunnels에서 생성된 터널과 상태를 확인할 수 있습니다."}],note:"동일한 이름의 터널이 이미 있으면 오류가 발생합니다. 기존 터널을 삭제하거나 다른 이름을 사용하세요.",link:"https://one.dash.cloudflare.com/",linkLabel:"Cloudflare Zero Trust에서 터널 확인 →"}};function Wa({helpKey:e,onClose:t}){const n=e?xx[e]??null:null,r=!!n;return oi.createPortal(i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:t,style:{position:"fixed",inset:0,zIndex:9e3,pointerEvents:r?"all":"none",background:"transparent"}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100vh",width:320,zIndex:9001,display:"flex",flexDirection:"column",background:"var(--bg1)",borderLeft:"1px solid var(--bdr)",boxShadow:r?"-12px 0 40px rgba(0,0,0,0.6)":"none",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.22s cubic-bezier(0.4,0,0.2,1)"},onClick:l=>l.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 18px",borderBottom:"1px solid var(--bdr)",flexShrink:0},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)",marginBottom:3},children:"HELP"}),i.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--txt)"},children:(n==null?void 0:n.title)??""})]}),i.jsx("button",{className:"xbtn",onClick:t,"aria-label":"Close help",style:{flexShrink:0},children:"✕"})]}),i.jsx("div",{style:{overflowY:"auto",padding:"20px 18px",display:"flex",flexDirection:"column",gap:20,flex:1},children:n&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,fontWeight:700,color:"#ffffff",fontFamily:"var(--mono)",letterSpacing:"0.06em",marginBottom:8},children:"이게 뭔가요?"}),i.jsx("p",{style:{fontSize:13,color:"#c8d4e8",lineHeight:1.7,margin:0},children:n.what})]}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,fontWeight:700,color:"#ffffff",fontFamily:"var(--mono)",letterSpacing:"0.06em",marginBottom:10},children:"어디서 가져오나요?"}),i.jsx("ol",{style:{margin:0,padding:"0 0 0 18px",display:"flex",flexDirection:"column",gap:10},children:n.howToGet.map((l,o)=>i.jsxs("li",{style:{fontSize:13,color:"#c8d4e8",lineHeight:1.6},children:[i.jsx("span",{style:{fontWeight:600,color:"#4db8a8"},children:l.step}),l.detail&&i.jsx("div",{style:{marginTop:5,padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--bdr)",borderRadius:"var(--r)",fontSize:12,color:"#a8bdd4",fontFamily:"var(--mono)",whiteSpace:"pre-wrap",lineHeight:1.6},children:l.detail})]},o))})]}),n.note&&i.jsxs("div",{style:{padding:"10px 12px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.2)",fontSize:12,color:"var(--amber)",lineHeight:1.6},children:["⚠ ",n.note]}),i.jsxs("a",{href:n.link,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:6,padding:"10px 14px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.07)",border:"1px solid rgba(61,214,200,0.2)",color:"var(--teal)",textDecoration:"none",fontSize:12,fontWeight:600},children:[i.jsx("span",{children:"↗"}),n.linkLabel]})]})})]})]}),document.body)}const Sx=[{id:"token",label:"API Token"},{id:"zone",label:"Domain"},{id:"tunnel",label:"Tunnel"}];function wx({apiFetch:e,onClose:t,onComplete:n}){const r=px(e),{setPassword:l}=zl(),[o,a]=m.useState(null),{currentStep:s,completedSteps:u,loading:c,summary:p,tokenValidating:f,tokenError:v,tokenEmail:S,adminPasswordRequired:j,saveTokenAction:w,submitAdminPassword:D,zones:g,zonesLoading:d,zonesError:y,loadZones:b,selectZoneAction:E,defaultTunnelName:T,tunnelCreating:h,tunnelError:k,tunnelComposeUpdated:I,tunnelContainerRestarted:R,createTunnelAction:K,resetSetup:L}=r,Q=async le=>{l(le),await D(le)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overlay",children:i.jsxs("div",{className:"modal",style:{maxWidth:540,width:"100%"},onClick:le=>le.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--bdr)",flexShrink:0},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--txt)"},children:"Cloudflare Domain Setup"}),i.jsx("div",{style:{fontSize:12,color:"var(--txt3)",marginTop:3},children:"Connect your apps to a public domain via Cloudflare Tunnel"})]}),i.jsx("button",{className:"xbtn",onClick:t,"aria-label":"Close",children:"✕"})]}),i.jsx("div",{style:{padding:"20px 24px",overflowY:"auto"},children:c?i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,color:"var(--txt2)",padding:"30px 0"},children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"}),"Loading settings…"]}):i.jsxs(i.Fragment,{children:[s!=="complete"&&i.jsxs("div",{style:{padding:"10px 14px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.06)",border:"1px solid rgba(61,214,200,0.15)",fontSize:12,color:"var(--txt2)",marginBottom:20,lineHeight:1.6},children:["One-time setup — complete these steps once to connect all your apps to a public domain.",i.jsxs("span",{style:{marginLeft:6,color:"var(--txt3)",fontSize:11},children:["각 항목의 ",i.jsx("strong",{style:{fontFamily:"var(--mono)",fontSize:10},children:"?"})," 버튼을 누르면 도움말이 표시됩니다."]})]}),i.jsx(hx,{steps:Sx,currentStep:s,completedSteps:u}),s==="token"&&i.jsx(mx,{tokenValidating:f,tokenError:v,tokenEmail:S,adminPasswordRequired:j,onSaveToken:w,onAdminPassword:Q,onHelp:a}),s==="zone"&&i.jsx(yx,{zones:g,zonesLoading:d,zonesError:y,onLoadZones:b,onSelectZone:E,onHelp:a}),s==="tunnel"&&i.jsx(gx,{defaultTunnelName:T,tunnelCreating:h,tunnelError:k,isComplete:!1,onCreateTunnel:K,onStartOver:L,onHelp:a}),s==="complete"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{style:{padding:"16px 20px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.06)",border:"1px solid rgba(61,214,200,0.2)",display:"flex",flexDirection:"column",gap:10},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:16,color:"var(--teal)",fontWeight:700},children:"✓"}),i.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--teal)"},children:"Cloudflare Tunnel Active"})]}),(p==null?void 0:p.tunnelName)&&i.jsxs("div",{style:{fontSize:13,color:"var(--txt2)"},children:["Tunnel: ",i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--txt)"},children:p.tunnelName})]}),(p==null?void 0:p.zoneName)&&i.jsxs("div",{style:{fontSize:13,color:"var(--txt2)"},children:["Domain: ",i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--txt)"},children:p.zoneName})]})]}),R===!0&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.06)",border:"1px solid rgba(61,214,200,0.2)",fontSize:12,color:"var(--teal)"},children:[i.jsx("span",{style:{fontWeight:700},children:"✓"}),"cloudflared 컨테이너가 자동으로 재시작됐습니다"]}),I===!0&&R===!1&&i.jsxs("div",{style:{padding:"8px 12px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.25)",fontSize:12,color:"var(--amber)",lineHeight:1.6},children:["⚠ docker-compose.yml은 업데이트됐지만 cloudflared 재시작에 실패했습니다.",i.jsx("br",{}),"수동으로"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11},children:"docker compose up -d --force-recreate cloudflared"}),"을 실행하세요."]}),I===!1&&i.jsxs("div",{style:{padding:"8px 12px",borderRadius:"var(--r)",background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.25)",fontSize:12,color:"var(--amber)",lineHeight:1.6},children:["⚠ docker-compose.yml을 자동으로 업데이트하지 못했습니다.",i.jsx("br",{}),"cloudflared 서비스의"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11},children:"command"}),"와"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11},children:"TUNNEL_TOKEN"}),"을 수동으로 업데이트하고 재시작하세요."]}),i.jsx("div",{style:{fontSize:12,color:"var(--txt3)"},children:"You can now connect your apps to subdomains from each app's Domain tab."}),i.jsx("button",{className:"btn bp",onClick:n??t,style:{alignSelf:"flex-end"},children:"Connect apps →"})]})]})})]})}),i.jsx(Wa,{helpKey:o,onClose:()=>a(null)})]})}const jx={CNAME_CONFLICT:"This subdomain is already in use. Choose a different one.",INVALID_SUBDOMAIN:"Subdomain must be lowercase letters, numbers, and hyphens only.",NOT_CONNECTED:"No domain connection found for this app."};function kx(e,t){return e?jx[e]??t:t}function Cx(e,t){const[n,r]=m.useState(!0),[l,o]=m.useState([]),[a,s]=m.useState(!1),[u,c]=m.useState(""),p=nx(e),[f,v]=m.useState(p),[S,j]=m.useState(null),[w,D]=m.useState(!1),[g,d]=m.useState(!1),y=m.useCallback(async()=>{var k;r(!0);try{const I=await cx(t);if(o(I.connections),s(I.credentialsConfigured),c(((k=I.tunnel)!=null&&k.tunnelName,"")),I.connections.length>0){const K=I.connections[0].hostname.split(".");K.length>=2&&c(K.slice(1).join("."))}try{const R=await t("/api/settings/cloudflare");if(R.ok){const K=await R.json();K.zoneName&&c(K.zoneName)}}catch{}}catch{}finally{r(!1)}},[t]);m.useEffect(()=>{y()},[y]);const b=l.find(k=>k.appName===e)??null,E=m.useCallback(async()=>{const k=Ic(f);if(!k.valid){j(k.error??"Invalid subdomain");return}if(j(null),!u){ce("Zone name not available. Complete Cloudflare setup first.");return}D(!0);try{const I=await sx(t,e,f,u);if(I.success)ce("Domain connected"),await y();else{const R=I.error,K=I.message??R??"Failed to connect domain";console.error(`[domain-connect] FAIL — error=${R} message=${K}`,I),ce(kx(R,K))}}catch(I){console.error("[domain-connect] exception:",I),ce(I instanceof Error?I.message:"Failed to connect domain")}finally{D(!1)}},[t,e,f,u,y]),T=m.useCallback(async()=>{d(!0);try{await ux(t,e),ce("Domain disconnected"),await y()}catch(k){ce(k instanceof Error?k.message:"Failed to disconnect domain")}finally{d(!1)}},[t,e,y]),h=m.useCallback(k=>{if(v(k),k){const I=Ic(k);j(I.valid?null:I.error??null)}else j(null)},[]);return{loading:n,connectedDomain:b,cfConfigured:a,zoneName:u,suggestedSubdomain:p,subdomain:f,setSubdomain:h,subdomainError:S,connecting:w,disconnecting:g,connect:E,disconnect:T,reload:y}}function jp({message:e,confirmLabel:t="Confirm",cancelLabel:n="Cancel",danger:r=!1,requiredInput:l,onConfirm:o,onCancel:a}){const[s,u]=m.useState(""),c=!l||s===l;return i.jsx("div",{className:"overlay",children:i.jsx("div",{className:"modal",style:{maxWidth:420},children:i.jsxs("div",{style:{padding:"24px 24px 20px",display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("span",{style:{fontSize:20},children:"⚠️"}),i.jsx("span",{style:{fontSize:14,fontWeight:700,color:r?"var(--red)":"var(--txt)"},children:r?"위험한 작업입니다":"확인"})]}),i.jsx("div",{style:{fontSize:13,color:"var(--txt2)",lineHeight:1.7},children:e}),l&&i.jsxs("div",{className:"fg",children:[i.jsxs("label",{className:"fl",style:{color:"var(--txt2)"},children:["확인을 위해 ",i.jsx("code",{style:{color:"var(--amber)",fontFamily:"var(--mono)",fontSize:12},children:l})," 를 입력하세요"]}),i.jsx("input",{className:"fi",value:s,onChange:p=>u(p.target.value),onKeyDown:p=>{p.key==="Enter"&&c&&o()},placeholder:l,autoFocus:!0,style:{borderColor:s&&!c?"var(--red)":void 0}})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:4},children:[i.jsx("button",{className:"btn bg",onClick:a,children:n}),i.jsx("button",{className:"btn bp",style:{...r?{background:"var(--red)",borderColor:"var(--red)"}:{},opacity:c?1:.4,cursor:c?"pointer":"not-allowed"},disabled:!c,onClick:o,children:t})]})]})})})}function bx({appName:e,apiFetch:t,appStatus:n,onOpenDomainSettings:r}){const[l,o]=m.useState(null),{loading:a,connectedDomain:s,cfConfigured:u,zoneName:c,subdomain:p,setSubdomain:f,subdomainError:v,connecting:S,disconnecting:j,connect:w,disconnect:D}=Cx(e,t),[g,d]=m.useState(!1);if(!a&&!u){const y=[{num:1,label:"API Token",desc:"Cloudflare API Token 발급 및 검증"},{num:2,label:"Zone",desc:"사용할 도메인(Zone) 선택"},{num:3,label:"Tunnel",desc:"Cloudflare Tunnel 생성"}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[i.jsx("div",{style:{width:36,height:36,borderRadius:"50%",flexShrink:0,background:"rgba(61,214,200,0.1)",border:"1px solid rgba(61,214,200,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(Ao,{size:16,style:{color:"var(--teal)"}})}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:13,fontWeight:700,color:"var(--txt)",marginBottom:4},children:"Public Domain Not Configured"}),i.jsx("div",{style:{fontSize:12.5,color:"var(--txt2)",lineHeight:1.6},children:"공인 IP나 포트포워딩 없이 앱을 외부 도메인으로 공개하려면 Cloudflare Tunnel 설정이 필요합니다. 설정은 최초 1회만 필요하며, 이후 앱마다 서브도메인만 연결하면 됩니다."})]})]}),i.jsxs("div",{style:{padding:"12px 16px",borderRadius:"var(--r)",background:"var(--bg0)",border:"1px solid var(--bdr)",display:"flex",flexDirection:"column",gap:10},children:[i.jsx("div",{style:{fontSize:11,fontWeight:700,color:"var(--txt2)",fontFamily:"var(--mono)",letterSpacing:"0.06em",marginBottom:2},children:"SETUP REQUIRED — 3 STEPS"}),y.map(b=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("div",{style:{width:22,height:22,borderRadius:"50%",flexShrink:0,background:"rgba(232,168,73,0.12)",border:"1px solid rgba(232,168,73,0.25)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700,color:"var(--amber)",fontFamily:"var(--mono)"},children:b.num}),i.jsxs("div",{children:[i.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--txt)"},children:b.label}),i.jsxs("span",{style:{fontSize:12,color:"var(--txt2)",marginLeft:8},children:["— ",b.desc]})]})]},b.num))]}),i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[r&&i.jsxs("button",{className:"btn bp",onClick:r,style:{flexShrink:0},children:[i.jsx(Vv,{size:14})," Open Domain Settings"]}),i.jsxs("button",{type:"button",onClick:()=>o("cloudflare-setup"),style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"1px solid var(--bdr)",borderRadius:"var(--r)",padding:"7px 12px",cursor:"pointer",color:"var(--txt2)",fontSize:12.5},children:[i.jsx(Cv,{size:13})," 설정 가이드 보기"]})]})]}),i.jsx(Wa,{helpKey:l,onClose:()=>o(null)})]})}if(a)return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--txt2)",fontSize:13,padding:"20px 0"},children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"}),"Loading domain info…"]});if(s){const y=s.externalUrl??`https://${s.hostname}`;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{style:{padding:"16px 20px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.05)",border:"1px solid rgba(61,214,200,0.2)",display:"flex",flexDirection:"column",gap:8},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[i.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--teal)",fontFamily:"var(--mono)",fontSize:13,fontWeight:600,textDecoration:"none"},children:[s.hostname,i.jsx("span",{style:{marginLeft:4,fontSize:11},children:"↗"})]}),i.jsx(Sp,{text:y})]}),s.connectedAt&&i.jsxs("span",{style:{fontSize:11.5,color:"var(--txt2)"},children:["Connected ",new Date(s.connectedAt).toLocaleString()]})]}),j?i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--txt2)",fontSize:13},children:[i.jsx("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"◌"}),"Removing DNS record…"]}):i.jsxs("button",{className:"btn bg",onClick:()=>d(!0),style:{alignSelf:"flex-end",color:"var(--red)"},children:[i.jsx(Zv,{size:14})," Disconnect"]}),g&&i.jsx(jp,{message:`This will remove the DNS record for "${s.hostname}" and the app will no longer be publicly accessible.`,confirmLabel:"Disconnect",danger:!0,onConfirm:()=>{d(!1),D()},onCancel:()=>d(!1)})]})}return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 14px",borderRadius:"var(--r)",background:"rgba(61,214,200,0.04)",border:"1px solid rgba(61,214,200,0.12)"},children:[i.jsx(Ao,{size:14,style:{color:"var(--teal)",flexShrink:0,marginTop:2}}),i.jsxs("div",{style:{fontSize:12,color:"var(--txt2)",lineHeight:1.6},children:["Connect this app to a subdomain on"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--txt)"},children:c?`.${c}`:"your domain"}),"."," ","Cloudflare DNS CNAME 레코드와 Tunnel ingress 규칙이 자동으로 생성됩니다."]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("label",{style:{fontSize:13,fontWeight:500,color:"var(--txt)",whiteSpace:"nowrap"},children:"Subdomain"}),i.jsx(ui,{helpKey:"subdomain",onHelp:o}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginLeft:"auto"},children:[i.jsx("input",{className:"fi",value:p,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!S&&w()},placeholder:`e.g. ${e.toLowerCase()}`,disabled:S,style:{borderColor:v?"var(--red)":void 0,fontFamily:"var(--mono)",width:150,height:30,padding:"0 10px",flexShrink:0}}),c&&i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",height:30,padding:"0 10px",background:"var(--bg2)",border:"1px solid var(--bdr)",borderRadius:"var(--r)",fontSize:13,color:"var(--txt2)",fontFamily:"var(--mono)",whiteSpace:"nowrap",width:250,flexShrink:0,boxSizing:"border-box"},children:[".",c]}),i.jsx("button",{className:"btn bp",onClick:()=>void w(),disabled:S||!p.trim()||!!v||!!n&&n!=="running",style:{opacity:S||!p.trim()||v||n&&n!=="running"?.5:1,flexShrink:0},children:S?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," Connecting…"]}):i.jsxs(i.Fragment,{children:[i.jsx(Dv,{size:14})," Connect"]})})]})]}),v&&i.jsx("div",{style:{fontSize:12,color:"var(--red)"},children:v}),!v&&n&&n!=="running"&&i.jsx("div",{style:{fontSize:12,color:"var(--red)"},children:"App must be running to connect a domain — start the app first."})]}),i.jsx(Wa,{helpKey:l,onClose:()=>o(null)})]})}const Ex="https://github.com/claude-code-expert/brewnet-boilerplate/tree/stack";function Qn({label:e,children:t}){return i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"5px 0",borderBottom:"1px solid var(--bdr)"},children:[i.jsx("span",{style:{width:110,flexShrink:0,fontSize:12,color:"var(--txt2)",paddingTop:1},children:e}),i.jsx("span",{style:{fontSize:13,color:"var(--txt)",wordBreak:"break-all",flex:1},children:t})]})}function Zn({label:e,children:t,wide:n}){return i.jsxs("div",{style:{gridColumn:n?"1 / -1":void 0},children:[i.jsx("div",{style:{fontSize:11,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:e}),i.jsx("div",{style:{fontSize:13,color:"var(--txt)",wordBreak:"break-all"},children:t})]})}function Vi(e){try{return new Date(e).toLocaleString()}catch{return e}}function Nx({app:e,git:t,boilerplate:n}){const r=e.backendExternalUrl??null;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:12},children:"App Info"}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"16px 12px"},children:[i.jsx(Zn,{label:"Name",children:i.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name})}),i.jsx(Zn,{label:"Port",children:i.jsx("span",{style:{fontFamily:"var(--mono)"},children:e.port})}),e.lang?i.jsxs(Zn,{label:"Language",children:[e.lang,e.framework?` / ${e.framework}`:""]}):i.jsx("div",{}),i.jsx(Zn,{label:"Created",children:Vi(e.createdAt)}),i.jsx(Zn,{label:"Last Deployed",children:e.lastDeployedAt?Vi(e.lastDeployedAt):i.jsx("span",{style:{color:"var(--txt2)",fontStyle:"italic"},children:"Never deployed"})}),i.jsx(Zn,{label:"App Directory",wide:!0,children:i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--txt2)",fontSize:12},children:e.appDir})})]})]}),(e.localUrl||e.externalUrl||e.backendLocalUrl||e.backendExternalUrl)&&i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:12},children:"Access"}),e.backendLocalUrl?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[i.jsxs("div",{style:{marginBottom:10},children:[i.jsx("div",{style:{fontSize:11,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:6},children:"Frontend"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.localUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("span",{style:{width:60,fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"local"}),i.jsxs("a",{href:e.localUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--teal)",fontSize:12.5,fontFamily:"var(--mono)",textDecoration:"none"},children:[e.localUrl," ",i.jsx("span",{style:{fontSize:10,color:"var(--txt3)"},children:"↗"})]})]}),e.externalUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("span",{style:{width:60,fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"external"}),i.jsxs("a",{href:e.externalUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--amber)",fontSize:12.5,fontFamily:"var(--mono)",textDecoration:"none"},children:[e.externalUrl," ",i.jsx("span",{style:{fontSize:10,color:"var(--txt3)"},children:"↗"})]})]})]})]}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:6},children:"Backend"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.backendLocalUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("span",{style:{width:60,fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"local"}),i.jsxs("a",{href:e.backendLocalUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--teal)",fontSize:12.5,fontFamily:"var(--mono)",textDecoration:"none"},children:[e.backendLocalUrl," ",i.jsx("span",{style:{fontSize:10,color:"var(--txt3)"},children:"↗"})]})]}),e.backendExternalUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("span",{style:{width:60,fontSize:11,color:"var(--txt3)",fontFamily:"var(--mono)"},children:"external"}),i.jsxs("a",{href:`${e.backendExternalUrl}/api/hello`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--amber)",fontSize:12.5,fontFamily:"var(--mono)",textDecoration:"none"},children:[e.backendExternalUrl,"/api/hello ",i.jsx("span",{style:{fontSize:10,color:"var(--txt3)"},children:"↗"})]})]})]})]})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.localUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[i.jsx("span",{style:{width:80,fontSize:12,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Local"}),i.jsxs("a",{href:e.localUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--teal)",fontSize:13,fontFamily:"var(--mono)",textDecoration:"none"},children:[e.localUrl," ",i.jsx("span",{style:{fontSize:11,color:"var(--txt3)"},children:"↗"})]})]}),e.externalUrl&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[i.jsx("span",{style:{width:80,fontSize:12,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"External"}),i.jsxs("a",{href:e.externalUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--amber)",fontSize:13,fontFamily:"var(--mono)",textDecoration:"none"},children:[e.externalUrl," ",i.jsx("span",{style:{fontSize:11,color:"var(--txt3)"},children:"↗"})]})]})]})]}),n&&i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[i.jsx("div",{className:"section-title",style:{marginBottom:0},children:"Stack Details"}),i.jsx("a",{href:`${Ex}/${n.stackId}`,target:"_blank",rel:"noopener noreferrer",className:"btn bg bsm",style:{fontSize:11},children:"GitHub ↗"})]}),(n.dbDriver||n.dbUser||n.dbName)&&i.jsxs("div",{style:{marginBottom:16},children:[i.jsx("div",{style:{fontSize:11,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8},children:"Database"}),i.jsxs("div",{style:{background:"var(--bg3)",border:"1px solid var(--bdr)",borderRadius:"var(--r)",padding:"10px 14px",display:"flex",flexDirection:"column",gap:6},children:[n.dbDriver&&i.jsxs("div",{style:{display:"flex",gap:12},children:[i.jsx("span",{style:{fontSize:11,color:"var(--txt2)",fontFamily:"var(--mono)",width:60},children:"Driver"}),i.jsx("span",{style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--txt)"},children:n.dbDriver})]}),n.dbUser&&i.jsxs("div",{style:{display:"flex",gap:12},children:[i.jsx("span",{style:{fontSize:11,color:"var(--txt2)",fontFamily:"var(--mono)",width:60},children:"User"}),i.jsx("span",{style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--txt)"},children:n.dbUser})]}),n.dbName&&i.jsxs("div",{style:{display:"flex",gap:12},children:[i.jsx("span",{style:{fontSize:11,color:"var(--txt2)",fontFamily:"var(--mono)",width:60},children:"Name"}),i.jsx("span",{style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--txt)"},children:n.dbName})]})]})]}),n.backendUrl&&!n.isUnified&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8},children:"API Endpoints"}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},children:[{label:"Health",path:"/health",method:"GET"},{label:"Hello",path:"/api/hello",method:"GET"},{label:"Echo",path:"/api/echo",method:"POST"}].map(({label:l,path:o,method:a})=>{const s=a==="GET",u=`${n.backendUrl}${o}`,c=r?`${r}${o}`:null,p={display:"flex",flexDirection:"column",gap:6,padding:"8px 10px",background:"var(--bg3)",border:"1px solid var(--bdr)",borderRadius:"var(--r)",textDecoration:"none",cursor:"default"};return i.jsxs("div",{style:p,children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[i.jsx("span",{style:{fontSize:10,fontFamily:"var(--mono)",color:"var(--txt2)",textTransform:"uppercase"},children:l}),!s&&i.jsx("span",{style:{fontSize:9,fontFamily:"var(--mono)",color:"var(--amber)",background:"rgba(232,168,73,0.12)",border:"1px solid rgba(232,168,73,0.3)",borderRadius:3,padding:"1px 4px",lineHeight:1.4},children:"POST"})]}),s?i.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--teal)",textDecoration:"none",wordBreak:"break-all"},children:[o," ",i.jsx("span",{style:{fontSize:9,color:"var(--txt3)"},children:"local ↗"})]}):i.jsx("span",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt3)",wordBreak:"break-all"},children:o}),s&&c&&i.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--amber)",textDecoration:"none",wordBreak:"break-all"},children:[o," ",i.jsx("span",{style:{fontSize:9,color:"var(--txt3)"},children:"domain ↗"})]})]},l)})})]})]}),i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:12},children:"Git Repository"}),!e.lastDeployedAt&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,background:"rgba(232,168,73,0.07)",border:"1px solid rgba(232,168,73,0.2)",borderRadius:"var(--r)",padding:"10px 14px",marginBottom:14,fontSize:12.5,color:"var(--amber)"},children:[i.jsx("span",{children:"⚠"}),i.jsx("span",{children:"Deploy를 먼저 실행하면 Gitea 저장소가 초기화되고 접속 주소가 활성화됩니다."})]}),t?i.jsxs("div",{children:[i.jsx(Qn,{label:"Branch",children:i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--teal)"},children:t.branch})}),t.giteaUrl&&i.jsx(Qn,{label:"Gitea URL",children:i.jsxs("a",{href:t.giteaUrl.startsWith("https://")?t.giteaUrl:`/api/gitea/autologin?redirect=${encodeURIComponent(new URL(t.giteaUrl).pathname)}`,target:"_blank",rel:"noopener noreferrer",style:{color:e.lastDeployedAt?"var(--teal)":"var(--txt2)",fontSize:13,fontFamily:"var(--mono)",textDecoration:"none",opacity:e.lastDeployedAt?1:.6},children:[t.giteaUrl,i.jsx("span",{style:{marginLeft:6,fontSize:11,color:"var(--txt3)"},children:"↗"})]})}),t.latestCommit?i.jsxs(i.Fragment,{children:[i.jsxs(Qn,{label:"Latest Commit",children:[i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--amber)",fontSize:12},children:t.latestCommit.shortHash}),i.jsx("span",{style:{marginLeft:10,color:"var(--txt2)",fontSize:13},children:t.latestCommit.message})]}),i.jsx(Qn,{label:"Commit Date",children:Vi(t.latestCommit.date)})]}):i.jsx(Qn,{label:"Latest Commit",children:i.jsx("span",{style:{color:"var(--txt2)",fontStyle:"italic"},children:"No commits yet"})}),i.jsx(Qn,{label:"Clone (HTTP)",children:i.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11.5,color:"var(--txt2)"},children:t.cloneUrlHttp})})]}):i.jsx("div",{style:{color:"var(--txt2)",fontSize:13,fontStyle:"italic"},children:"Git information unavailable"})]})]})}function zx(e){try{return new Date(e).toLocaleString()}catch{return e}}function Fc(e){return e.slice(0,7)}function Tx({status:e}){const t=e==="success"?"bdg b-run":"bdg b-stop";return i.jsx("span",{className:t,children:e})}function Rx({appName:e,git:t,settings:n,apiFetch:r,onDeployStarted:l}){const[o,a]=m.useState((n==null?void 0:n.deployBranch)??"main"),[s,u]=m.useState((n==null?void 0:n.autoDeploy)??!1),[c,p]=m.useState(!1),[f,v]=m.useState(!1),[S,j]=m.useState(null),[w,D]=m.useState([]),[g,d]=m.useState(!0),[y,b]=m.useState([]),[E,T]=m.useState(!1);m.useEffect(()=>{n&&(a(n.deployBranch),u(n.autoDeploy))},[n]);const h=m.useCallback(async()=>{T(!0);try{const L=await r(`/api/apps/${encodeURIComponent(e)}/branches`);if(L.ok){const Q=await L.json();b(Q.branches??[])}}catch{}finally{T(!1)}},[e,r]);m.useEffect(()=>{h()},[h]);const k=m.useCallback(async()=>{d(!0);try{const L=await r(`/api/deploy/history?app=${encodeURIComponent(e)}`);if(L.ok){const Q=await L.json();D((Q.history??[]).slice(-5))}}catch{}finally{d(!1)}},[e,r]);m.useEffect(()=>{k()},[k]);const I=async()=>{p(!0);try{const L=await r(`/api/apps/${encodeURIComponent(e)}/deploy/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoDeploy:s,deployBranch:o})});if(L.ok)ce("Deploy settings saved");else{const Q=await L.json().catch(()=>({error:L.statusText}));ce(`Error: ${Q.error??L.statusText}`)}}catch(L){ce(`Error: ${L instanceof Error?L.message:String(L)}`)}finally{p(!1)}},R=async L=>{j(L);try{const Q=await r(`/api/apps/${encodeURIComponent(e)}/rollback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:L})});if(Q.ok){const le=await Q.json();le.jobId&&(l(le.jobId),setTimeout(()=>{k()},2e3))}else{const le=await Q.json().catch(()=>({error:Q.statusText}));ce(`Rollback error: ${le.error??Q.statusText}`)}}catch(Q){ce(`Rollback error: ${Q instanceof Error?Q.message:String(Q)}`)}finally{j(null)}},K=async()=>{v(!0);try{const L=await r(`/api/apps/${encodeURIComponent(e)}/deploy`,{method:"POST"});if(L.ok){const Q=await L.json();Q.jobId?(l(Q.jobId),setTimeout(()=>{k()},2e3)):ce("Deploy started (no job ID returned)")}else{const Q=await L.json().catch(()=>({error:L.statusText}));ce(`Deploy error: ${Q.error??L.statusText}`)}}catch(L){ce(`Deploy error: ${L instanceof Error?L.message:String(L)}`)}finally{v(!1)}};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t&&i.jsxs("div",{className:"card",style:{padding:"10px 16px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:12},children:"Git Repository"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[i.jsxs("a",{href:(()=>{if(t.giteaUrl.startsWith("https://"))return t.giteaUrl;try{return`/api/gitea/autologin?redirect=${encodeURIComponent(new URL(t.giteaUrl).pathname)}`}catch{return t.giteaUrl}})(),target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,fontFamily:"var(--mono)",color:"var(--teal)",textDecoration:"none"},children:["⎇ ",t.giteaUrl]}),i.jsxs("div",{style:{display:"flex",gap:16,flexWrap:"wrap"},children:[i.jsxs("span",{style:{fontSize:11.5,color:"var(--txt2)",fontFamily:"var(--mono)"},children:["branch: ",i.jsx("span",{style:{color:"var(--amber)"},children:t.branch})]}),t.latestCommit&&i.jsxs("span",{style:{fontSize:11.5,color:"var(--txt2)",fontFamily:"var(--mono)"},children:["latest: ",i.jsx("span",{style:{color:"var(--txt2)"},children:t.latestCommit.shortHash})," ",i.jsx("span",{style:{color:"var(--txt2)"},children:t.latestCommit.message})]})]}),i.jsx("input",{className:"fi",readOnly:!0,value:t.cloneUrlHttp,style:{fontFamily:"var(--mono)",fontSize:11,cursor:"text"},onFocus:L=>L.target.select()}),i.jsx("div",{style:{fontSize:11.5,color:"var(--txt2)",background:"rgba(232,168,73,0.05)",border:"1px solid rgba(232,168,73,0.12)",borderRadius:"var(--r)",padding:"8px 12px"},children:"💡 Gitea 로그인은 brewnet 설치 시 설정한 관리자 계정을 사용하세요. 앱 생성 시 이 저장소가 자동으로 만들어지고 코드가 push됩니다."})]})]}),i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:16},children:"Deploy Settings"}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"12px 16px",alignItems:"end"},children:[i.jsxs("div",{style:{gridColumn:"1 / 3",display:"flex",flexDirection:"column",gap:6},children:[i.jsx("label",{style:{fontSize:12,color:"var(--txt2)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Deploy Branch"}),y.length>0?i.jsx("select",{className:"fi",value:o,onChange:L=>a(L.target.value),style:{fontFamily:"var(--mono)",cursor:"pointer"},children:y.map(L=>i.jsx("option",{value:L,children:L},L))}):i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("input",{type:"text",value:o,onChange:L=>a(L.target.value),placeholder:"main",style:{background:"var(--bg0)",border:"1px solid var(--bdr2)",borderRadius:"var(--r)",padding:"8px 12px",color:"var(--txt)",fontSize:13,fontFamily:"var(--mono)",outline:"none",flex:1}}),E&&i.jsx(bt,{size:13,className:"spin",style:{color:"var(--txt2)"}})]}),t&&t.branch&&o!==t.branch&&i.jsxs("div",{style:{fontSize:11.5,color:"var(--txt2)"},children:["Current repo branch: ",i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--teal)"},children:t.branch})]})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer",paddingBottom:9},children:[i.jsx("input",{type:"checkbox",checked:s,onChange:L=>u(L.target.checked),style:{width:16,height:16,accentColor:"var(--amber)",cursor:"pointer"}}),i.jsx("span",{style:{fontSize:13,color:"var(--txt2)"},children:"Auto Deploy"})]}),i.jsx("button",{className:"btn bp",onClick:I,disabled:c,style:{opacity:c?.6:1,justifySelf:"end"},children:c?i.jsx(bt,{size:14,className:"spin"}):i.jsxs(i.Fragment,{children:[i.jsx(Wv,{size:14})," Save"]})})]})]}),i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:12},children:"Manual Deploy"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[i.jsxs("div",{style:{fontSize:12.5,color:"var(--txt2)",flex:1,minWidth:180},children:["Deploy latest commit from"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--teal)"},children:o})]}),i.jsx("div",{style:{display:"flex",gap:8,flexShrink:0},children:w.length===0?i.jsx("button",{className:"btn bp",onClick:K,disabled:f||!!S,style:{opacity:f?.6:1},children:f?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," Deploying…"]}):i.jsxs(i.Fragment,{children:[i.jsx(Av,{size:14})," Deploy Now"]})}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn bp",onClick:K,disabled:f||!!S,style:{opacity:f||S?.6:1},title:"Redeploy latest commit on branch",children:f?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," Redeploying…"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ov,{size:14})," Redeploy"]})}),w.length>=2&&i.jsx("button",{className:"btn bg",onClick:()=>{const L=w[w.length-2];R((L==null?void 0:L.commitHash)??"")},disabled:f||!!S,style:{opacity:f||S?.6:1},title:"Roll back to previous deployment",children:S?i.jsxs(i.Fragment,{children:[i.jsx(bt,{size:14,className:"spin"})," Rolling back…"]}):i.jsxs(i.Fragment,{children:[i.jsx(pc,{size:14})," Rollback"]})})]})})]})]}),i.jsxs("div",{className:"card",style:{padding:"10px 20px"},children:[i.jsx("div",{className:"section-title",style:{marginBottom:14},children:"Deploy History"}),g?i.jsx("div",{style:{color:"var(--txt2)",fontSize:13},children:"Loading history…"}):w.length===0?i.jsx("div",{style:{color:"var(--txt2)",fontSize:13,fontStyle:"italic"},children:"No deployments yet"}):i.jsx("div",{className:"rtbl-wrap",children:i.jsxs("table",{className:"rtbl",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Commit"}),i.jsx("th",{children:"Message"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Date"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:w.map((L,Q)=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--amber)",fontSize:12},children:L.commitHash?Fc(L.commitHash):"—"})}),i.jsx("td",{style:{maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.commitMessage}),i.jsx("td",{children:i.jsx(Tx,{status:L.status})}),i.jsx("td",{style:{color:"var(--txt2)",fontSize:12,whiteSpace:"nowrap"},children:zx(L.deployedAt)}),i.jsx("td",{children:Q<w.length-1&&i.jsx("button",{className:"btn bg",onClick:()=>void R(L.commitHash??""),disabled:!!S||f,style:{opacity:S===L.commitHash?.6:1,fontSize:11.5,padding:"4px 10px"},title:L.commitHash?`Rollback to ${Fc(L.commitHash)}`:"Rollback to this deployment",children:S===L.commitHash?i.jsx(bt,{size:12,className:"spin"}):i.jsxs(i.Fragment,{children:[i.jsx(pc,{size:12})," Rollback"]})})})]},Q))})]})})]})]})}function Dx(e,t){const[n,r]=m.useState([]),[l,o]=m.useState(!1),[a,s]=m.useState(null);return m.useEffect(()=>{if(!e)return;const u=`/api/apps/${encodeURIComponent(e)}/logs`,c=new EventSource(u);return c.addEventListener("open",()=>{o(!0),s(null)}),c.addEventListener("message",p=>{const f={line:p.data,receivedAt:Date.now()};r(v=>[...v.slice(-500),f])}),c.addEventListener("error",()=>{o(!1),c.readyState===EventSource.CLOSED&&s("연결이 끊겼습니다. 재연결 중...")}),()=>{c.close()}},[e,t]),{logs:n,connected:l,error:a}}const Px=5*60*1e3;function Lx(e){return new Date(e).toLocaleTimeString()}function _x({appName:e}){const{logs:t,connected:n}=Dx(e,!0),r=m.useRef(null),[l,o]=m.useState(()=>Date.now());m.useEffect(()=>{const s=setInterval(()=>o(Date.now()),1e4);return()=>clearInterval(s)},[]),m.useEffect(()=>{var s;(s=r.current)==null||s.scrollIntoView({behavior:"smooth"})},[t]);const a=t.filter(s=>l-s.receivedAt<=Px);return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n?i.jsxs("span",{style:{fontSize:12,color:"var(--green)",display:"flex",alignItems:"center",gap:5},children:[i.jsx("span",{style:{fontSize:9},children:"●"})," Connected"]}):i.jsxs("span",{style:{fontSize:12,color:"var(--amber)",display:"flex",alignItems:"center",gap:5},children:[i.jsx("span",{style:{fontSize:9},children:"○"})," Reconnecting..."]}),i.jsxs("span",{style:{fontSize:11,color:"var(--txt2)"},children:["— ",e," live logs"]})]}),i.jsxs("div",{className:"cb",style:{height:400,overflowY:"auto",marginTop:0},children:[a.length===0?i.jsx("span",{style:{color:"var(--txt2)",fontStyle:"italic"},children:n?"Waiting for logs…":"Connecting…"}):a.map((s,u)=>i.jsxs("div",{style:{display:"flex",gap:10,alignItems:"flex-start"},children:[i.jsx("span",{style:{color:"var(--amber)",flexShrink:0,fontSize:11,opacity:.7},children:Lx(s.receivedAt)}),i.jsx("span",{style:{wordBreak:"break-all"},children:s.line})]},u)),i.jsx("div",{ref:r})]}),i.jsxs("div",{style:{fontSize:11.5,color:"var(--txt2)"},children:["Last 5 min — ",a.length," lines"]})]})}function Ix({appName:e,onClose:t,onOpenDomainSettings:n,initialTab:r}){const{apiFetch:l}=zl(),[o,a]=m.useState(null),[s,u]=m.useState(null),[c,p]=m.useState(null),[f,v]=m.useState(null),[S,j]=m.useState(!1),[w,D]=m.useState(r??"overview"),[g,d]=m.useState(null),y=m.useCallback(async(h,k)=>{const I=await l(h,k);return I.status===404?(j(!0),a(null),new Response(JSON.stringify({}),{status:200,headers:{"Content-Type":"application/json"}})):I},[l]),b=m.useCallback(h=>{const k=h;k!=null&&k.app&&(a(k.app),j(!1))},[]);rl(`/api/apps/${encodeURIComponent(e)}`,5e3,y,b,!0);const E=m.useCallback((h,k)=>l(h,k).then(I=>I.ok?I:new Response("{}",{status:200,headers:{"Content-Type":"application/json"}})),[l]);rl(`/api/apps/${encodeURIComponent(e)}/git`,3e4,E,m.useCallback(h=>{const k=h;k!=null&&k.git&&u(k.git)},[]),!0),rl(`/api/apps/${encodeURIComponent(e)}/deploy/settings`,3e4,E,m.useCallback(h=>{const k=h;k&&typeof k.autoDeploy<"u"&&p({autoDeploy:k.autoDeploy,deployBranch:k.deployBranch??"main",webhookSecret:k.webhookSecret})},[]),!0),m.useEffect(()=>{l("/api/apps/boilerplates").then(h=>h.ok?h.json():null).then(h=>{const k=(h==null?void 0:h.boilerplates)??[],I=k.find(R=>o&&R.appDir&&o.appDir&&R.appDir===o.appDir)??k.find(R=>R.stackId===(o==null?void 0:o.stackId))??null;v(I)}).catch(()=>null)},[e,o==null?void 0:o.appDir]);const T=h=>({padding:"7px 16px",borderRadius:"var(--r)",border:w===h?"1px solid rgba(232,168,73,0.3)":"1px solid transparent",background:w===h?"rgba(232,168,73,0.07)":"transparent",color:w===h?"var(--amber)":"var(--txt2)",cursor:"pointer",fontSize:12.5,fontWeight:w===h?600:400,transition:"all 0.14s"});return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overlay",children:i.jsxs("div",{className:"modal",style:{maxWidth:840,width:840,maxHeight:"88vh",display:"flex",flexDirection:"column"},onClick:h=>h.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 20px",borderBottom:"1px solid var(--bdr)",flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("span",{style:{fontSize:15,fontWeight:700,fontFamily:"var(--mono)",color:"var(--amber)"},children:e}),o&&i.jsxs("span",{className:`bdg ${o.status==="running"?"b-run":o.status==="stopped"?"b-stop":o.status==="creating"?"b-build":"b-stop"}`,children:[(o.status==="running"||o.status==="creating")&&i.jsx("span",{className:"blink-dot"}),o.status]})]}),i.jsx("button",{className:"xbtn",onClick:t,"aria-label":"Close",children:"✕"})]}),o&&i.jsxs("div",{style:{display:"flex",gap:4,padding:"10px 20px",borderBottom:"1px solid var(--bdr)",flexShrink:0},children:[i.jsx("button",{style:T("overview"),onClick:()=>D("overview"),children:"Overview"}),i.jsx("button",{style:T("deployment"),onClick:()=>D("deployment"),children:"Deployment"}),i.jsx("button",{style:T("logs"),onClick:()=>D("logs"),children:"Logs"}),i.jsx("button",{style:T("domain"),onClick:()=>D("domain"),children:"Domain"})]}),i.jsxs("div",{style:{overflowY:"auto",padding:"20px",flex:1},children:[!o&&!S&&i.jsx("div",{style:{color:"var(--txt3)",fontSize:13,padding:"20px 0"},children:"Loading app details…"}),S&&i.jsxs("div",{style:{padding:"40px 0",textAlign:"center",color:"var(--txt3)",fontSize:14},children:[i.jsx("div",{style:{fontSize:28,marginBottom:10},children:"🔍"}),i.jsx("div",{style:{color:"var(--txt2)",fontWeight:600,marginBottom:6},children:"App not found"}),i.jsxs("div",{children:["No app named"," ",i.jsx("span",{style:{fontFamily:"var(--mono)",color:"var(--amber)"},children:e})," was found."]})]}),o&&i.jsxs(i.Fragment,{children:[w==="overview"&&i.jsx(Nx,{app:o,git:s,boilerplate:f}),w==="deployment"&&i.jsx(Rx,{appName:e,git:s,settings:c,apiFetch:l,onDeployStarted:h=>d({jobId:h,appName:e})}),w==="logs"&&i.jsx(_x,{appName:e}),w==="domain"&&i.jsx(bx,{appName:e,apiFetch:l,appStatus:o.status,onOpenDomainSettings:n})]})]})]})}),g&&i.jsx(wp,{jobId:g.jobId,appName:g.appName,apiFetch:l,onClose:()=>d(null),onComplete:()=>d(null)})]})}const Ki=[{name:"GoDaddy",steps:["Log in to your GoDaddy account → DNS Management","Find the CNAME record for your subdomain",'Set the "Value" to: <tunnel-id>.cfargotunnel.com',"TTL: 1 hour (or Auto)","Save and wait for propagation (up to 30 min)"]},{name:"Namecheap",steps:["Log in → Domain List → Manage → Advanced DNS","Add / Edit CNAME record",'Host: your subdomain (e.g. "app")',"Value: <tunnel-id>.cfargotunnel.com","TTL: Automatic → Save All Changes"]},{name:"가비아 (Gabia)",steps:["가비아 로그인 → My 가비아 → DNS 관리","해당 도메인 DNS 설정 클릭","레코드 타입: CNAME 선택","호스트명: 서브도메인 (예: app)","값/주소: <tunnel-id>.cfargotunnel.com","TTL: 3600 → 확인/저장"]},{name:"Cafe24",steps:["카페24 호스팅센터 로그인 → 나의서비스관리 → 도메인 관리","도메인 목록에서 DNS 관리 클릭","CNAME 레코드 추가","이름(서브도메인): 원하는 호스트명","대상: <tunnel-id>.cfargotunnel.com","저장 후 전파 대기 (최대 1~2시간)"]}];function Fx({connections:e,tunnelId:t,zoneName:n}){const[r,l]=m.useState(!1),[o,a]=m.useState(0),s=t?`${t}.cfargotunnel.com`:"<tunnel-id>.cfargotunnel.com";return i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[i.jsx("div",{className:"section-title",style:{margin:0},children:"External Domain Connections"}),i.jsx("button",{className:"btn bg bsm",onClick:()=>l(!0),children:"CNAME Guide"})]}),n&&i.jsxs("div",{style:{fontSize:11,fontFamily:"var(--mono)",color:"var(--txt3)",marginBottom:10},children:["Zone: ",i.jsx("span",{style:{color:"var(--txt2)"},children:n})]}),e.length===0?i.jsx("div",{style:{background:"var(--bg2)",border:"1px dashed var(--bdr2)",borderRadius:"var(--r2)",padding:"28px 20px",textAlign:"center",color:"var(--txt3)",fontFamily:"var(--mono)",fontSize:12},children:"No external domain connections"}):i.jsx("div",{className:"rtbl-wrap",children:i.jsxs("table",{className:"rtbl",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"App Name"}),i.jsx("th",{children:"URL"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Connected At"}),i.jsx("th",{children:"Manage"})]})}),i.jsx("tbody",{children:e.map(u=>i.jsxs("tr",{children:[i.jsx("td",{style:{fontFamily:"var(--mono)",fontSize:13,fontWeight:600,color:"var(--txt)"},children:u.appName}),i.jsx("td",{children:i.jsxs("a",{href:`https://${u.hostname}`,target:"_blank",rel:"noopener noreferrer",className:"domain-link",children:["↗ ",u.hostname]})}),i.jsx("td",{children:i.jsxs("span",{className:"bdg b-run",children:[i.jsx("span",{className:"blink-dot"}),"Active"]})}),i.jsx("td",{style:{fontSize:12,fontFamily:"var(--mono)",color:"var(--txt3)"},children:u.connectedAt?new Date(u.connectedAt).toLocaleDateString():"—"}),i.jsx("td",{children:i.jsx("a",{href:"https://dash.cloudflare.com/?to=/:account/tunnels",target:"_blank",rel:"noopener noreferrer",className:"btn bg bxs",children:"CF Dashboard ↗"})})]},u.appName))})]})}),r&&i.jsx("div",{className:"overlay",onClick:()=>l(!1),children:i.jsxs("div",{className:"modal",style:{maxWidth:560},onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid var(--bdr)",flexShrink:0},children:[i.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--txt)",fontFamily:"var(--mono)"},children:"DNS CNAME Setup Guide"}),i.jsx("button",{className:"xbtn",onClick:()=>l(!1),"aria-label":"Close",children:"✕"})]}),i.jsxs("div",{style:{padding:"18px 20px",overflowY:"auto",display:"flex",flexDirection:"column",gap:14},children:[i.jsxs("div",{children:[i.jsx("div",{className:"section-title",style:{marginBottom:6},children:"CNAME Target"}),i.jsx("div",{className:"cb",style:{marginTop:0},children:s})]}),i.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:Ki.map((u,c)=>i.jsx("button",{className:`btn bsm ${o===c?"bp":"bg"}`,onClick:()=>a(c),children:u.name},u.name))}),i.jsxs("div",{style:{background:"var(--bg3)",border:"1px solid var(--bdr)",borderRadius:"var(--r)",padding:"14px 16px"},children:[i.jsx("div",{style:{fontSize:12,fontWeight:700,color:"var(--amber)",marginBottom:10},children:Ki[o].name}),i.jsx("ol",{style:{paddingLeft:18,display:"flex",flexDirection:"column",gap:8},children:Ki[o].steps.map((u,c)=>i.jsx("li",{style:{fontSize:12,color:"var(--txt2)",lineHeight:1.6,fontFamily:u.includes("<tunnel")?"var(--mono)":"var(--sans)"},children:u.replace("<tunnel-id>",t||"<tunnel-id>")},c))})]}),i.jsxs("p",{style:{fontSize:11.5,color:"var(--txt3)",lineHeight:1.6},children:["After adding the CNAME, DNS propagation may take 5–30 minutes. You can verify using"," ",i.jsx("code",{style:{fontFamily:"var(--mono)",color:"var(--teal)"},children:"dig CNAME your-subdomain.example.com"}),"."]})]})]})})]})}function Mx(){const{apiFetch:e}=zl(),[t,n]=m.useState([]),[r,l]=m.useState(!1),[o,a]=m.useState(!1),[s,u]=m.useState(null),[c,p]=m.useState(null),[f,v]=m.useState("overview"),[S,j]=m.useState(null),[w,D]=m.useState(null),[g,d]=m.useState(null),[y,b]=m.useState([]),[E,T]=m.useState(""),[h,k]=m.useState("");m.useEffect(()=>{let z=!1;return(async()=>{const[W,q]=await Promise.allSettled([e("/api/domain/list"),e("/api/config")]);if(!z){if(W.status==="fulfilled"&&W.value.ok){const Z=await W.value.json();z||b(Z.connections??Z.domainConnections??[])}if(q.status==="fulfilled"&&q.value.ok){const Z=await q.value.json();z||(T(Z.tunnelId??""),k(Z.zoneName??""))}}})(),()=>{z=!0}},[e]);const I=m.useCallback(z=>{const F=z;F!=null&&F.apps&&n(F.apps)},[]);rl("/api/apps",5e3,e,I);const R=async(z,F,W,q)=>{D(z);try{const Z=await e(`/api/apps/${z}${W}`,{method:F});if(!Z.ok){const O=await Z.json().catch(()=>({error:Z.statusText}));ce(`Error: ${O.error??Z.statusText}`);return}const We=await Z.json().catch(()=>({}));q==null||q(We);const ee=await e("/api/apps");if(ee.ok){const O=await ee.json();O!=null&&O.apps&&n(O.apps)}}catch(Z){ce(`Error: ${Z instanceof Error?Z.message:String(Z)}`)}finally{D(null)}},K=z=>R(z,"POST","/start",()=>ce(`✓ "${z}" started`)),L=z=>R(z,"POST","/stop",()=>ce(`✓ "${z}" stopped`)),Q=z=>{R(z,"POST","/deploy",F=>{const W=F;W!=null&&W.jobId&&j({jobId:W.jobId,appName:z,type:"deploy"})})},le=z=>{d(z)},_e=async z=>{d(null),await R(z,"DELETE","",()=>{ce(`✓ App "${z}" has been deleted.`)})},H=(z,F)=>{l(!1),j({jobId:z,appName:F,type:"create"})},fe=async()=>{try{const z=await e("/api/apps");if(z.ok){const F=await z.json();F!=null&&F.apps&&n(F.apps)}}catch{}};return i.jsxs("div",{id:"main",children:[i.jsx(gp,{}),i.jsxs("div",{id:"topbar",children:[i.jsx("div",{className:"bc",children:i.jsx("span",{className:"cur",children:"Apps"})}),i.jsxs("div",{className:"tbr",children:[i.jsx("button",{className:"btn bg bsm",onClick:()=>a(!0),children:"⚙ Domain Setting"}),i.jsx("button",{className:"btn bp bsm",onClick:()=>l(!0),children:"+ Create New App"})]})]}),i.jsx("div",{id:"content",children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:32,minHeight:"calc(100% - 50px)"},children:[t.length===0?i.jsxs("div",{style:{padding:"60px 0",textAlign:"center",color:"var(--txt3)",fontSize:14},children:[i.jsx("div",{style:{fontSize:32,marginBottom:12},children:"📦"}),i.jsx("div",{children:"No apps yet."}),i.jsxs("div",{style:{marginTop:6,fontSize:12.5},children:["Click ",i.jsx("strong",{style:{color:"var(--amber)"},children:"+ Create New App"})," to get started."]})]}):i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 350px)",gap:16},children:t.map(z=>i.jsx("div",{style:{opacity:w===z.name?.6:1,transition:"opacity 0.15s",pointerEvents:w===z.name?"none":"auto"},children:i.jsx(Zg,{app:z,onOpenDetail:()=>p(z.name),onStart:()=>K(z.name),onStop:()=>L(z.name),onDeploy:()=>Q(z.name),onDelete:()=>le(z.name)})},z.name))}),i.jsx(Fx,{connections:y,tunnelId:E,zoneName:h})]})}),i.jsx(xp,{}),r&&i.jsx(qg,{apiFetch:e,onCreated:H,onClose:()=>l(!1)}),o&&i.jsx(wx,{apiFetch:e,onClose:()=>{a(!1),u(null)},onComplete:()=>{a(!1),s&&(p(s),v("domain")),u(null),ce("Cloudflare Tunnel setup complete. Connect your apps from the Domain tab.")}}),c&&i.jsx(Ix,{appName:c,initialTab:f,onClose:()=>{p(null),v("overview")},onOpenDomainSettings:()=>{u(c),p(null),v("overview"),a(!0)}}),S&&i.jsx(wp,{jobId:S.jobId,appName:S.appName,jobType:S.type,apiFetch:e,onClose:()=>j(null),onComplete:fe}),g&&i.jsx(jp,{message:`"${g}" 앱과 관련된 모든 데이터가 영구 삭제됩니다. 이 작업은 되돌릴 수 없습니다.`,confirmLabel:"영구 삭제",danger:!0,requiredInput:g,onConfirm:()=>_e(g),onCancel:()=>d(null)})]})}const Ax=xg([{path:"/",element:i.jsx(Hg,{})},{path:"/apps",element:i.jsx(Mx,{})},{path:"/apps/:name",element:i.jsx(dg,{to:"/apps",replace:!0})}]);function Ux(){return i.jsx(Ng,{router:Ax})}const kp=document.getElementById("root");if(!kp)throw new Error("Root element not found");Jf(kp).render(i.jsx(m.StrictMode,{children:i.jsx(mv,{children:i.jsxs(Jv,{children:[i.jsx("div",{id:"shell",children:i.jsx(Ux,{})}),i.jsx(Vg,{})]})})}));