@ipul-labs/forge 1.13.0 → 1.13.2

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.
@@ -1,80 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function l(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=l(a);fetch(a.href,i)}})();var Td={exports:{}},Cs={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var ep=Symbol.for("react.transitional.element"),tp=Symbol.for("react.fragment");function Rd(e,t,l){var n=null;if(l!==void 0&&(n=""+l),t.key!==void 0&&(n=""+t.key),"key"in t){l={};for(var a in t)a!=="key"&&(l[a]=t[a])}else l=t;return t=l.ref,{$$typeof:ep,type:e,key:n,ref:t!==void 0?t:null,props:l}}Cs.Fragment=tp;Cs.jsx=Rd;Cs.jsxs=Rd;Td.exports=Cs;var c=Td.exports,Ad={exports:{}},$={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var er=Symbol.for("react.transitional.element"),lp=Symbol.for("react.portal"),np=Symbol.for("react.fragment"),ap=Symbol.for("react.strict_mode"),ip=Symbol.for("react.profiler"),sp=Symbol.for("react.consumer"),cp=Symbol.for("react.context"),up=Symbol.for("react.forward_ref"),rp=Symbol.for("react.suspense"),op=Symbol.for("react.memo"),wd=Symbol.for("react.lazy"),fp=Symbol.for("react.activity"),Bo=Symbol.iterator;function dp(e){return e===null||typeof e!="object"?null:(e=Bo&&e[Bo]||e["@@iterator"],typeof e=="function"?e:null)}var Cd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_d=Object.assign,Md={};function Fn(e,t,l){this.props=e,this.context=t,this.refs=Md,this.updater=l||Cd}Fn.prototype.isReactComponent={};Fn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Fn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Od(){}Od.prototype=Fn.prototype;function tr(e,t,l){this.props=e,this.context=t,this.refs=Md,this.updater=l||Cd}var lr=tr.prototype=new Od;lr.constructor=tr;_d(lr,Fn.prototype);lr.isPureReactComponent=!0;var Lo=Array.isArray;function lu(){}var ge={H:null,A:null,T:null,S:null},Dd=Object.prototype.hasOwnProperty;function nr(e,t,l){var n=l.ref;return{$$typeof:er,type:e,key:t,ref:n!==void 0?n:null,props:l}}function hp(e,t){return nr(e.type,t,e.props)}function ar(e){return typeof e=="object"&&e!==null&&e.$$typeof===er}function mp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(l){return t[l]})}var Ho=/\/+/g;function dc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mp(""+e.key):t.toString(36)}function xp(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(lu,lu):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function gn(e,t,l,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case er:case lp:s=!0;break;case wd:return s=e._init,gn(s(e._payload),t,l,n,a)}}if(s)return a=a(e),s=n===""?"."+dc(e,0):n,Lo(a)?(l="",s!=null&&(l=s.replace(Ho,"$&/")+"/"),gn(a,t,l,"",function(o){return o})):a!=null&&(ar(a)&&(a=hp(a,l+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(Ho,"$&/")+"/")+s)),t.push(a)),1;s=0;var u=n===""?".":n+":";if(Lo(e))for(var r=0;r<e.length;r++)n=e[r],i=u+dc(n,r),s+=gn(n,t,l,i,a);else if(r=dp(e),typeof r=="function")for(e=r.call(e),r=0;!(n=e.next()).done;)n=n.value,i=u+dc(n,r++),s+=gn(n,t,l,i,a);else if(i==="object"){if(typeof e.then=="function")return gn(xp(e),t,l,n,a);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 s}function gi(e,t,l){if(e==null)return e;var n=[],a=0;return gn(e,n,"","",function(i){return t.call(l,i,a++)}),n}function pp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(l){(e._status===0||e._status===-1)&&(e._status=1,e._result=l)},function(l){(e._status===0||e._status===-1)&&(e._status=2,e._result=l)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ko=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},gp={map:gi,forEach:function(e,t,l){gi(e,function(){t.apply(this,arguments)},l)},count:function(e){var t=0;return gi(e,function(){t++}),t},toArray:function(e){return gi(e,function(t){return t})||[]},only:function(e){if(!ar(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};$.Activity=fp;$.Children=gp;$.Component=Fn;$.Fragment=np;$.Profiler=ip;$.PureComponent=tr;$.StrictMode=ap;$.Suspense=rp;$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ge;$.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ge.H.useMemoCache(e)}};$.cache=function(e){return function(){return e.apply(null,arguments)}};$.cacheSignal=function(){return null};$.cloneElement=function(e,t,l){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=_d({},e.props),a=e.key;if(t!=null)for(i in t.key!==void 0&&(a=""+t.key),t)!Dd.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(n[i]=t[i]);var i=arguments.length-2;if(i===1)n.children=l;else if(1<i){for(var s=Array(i),u=0;u<i;u++)s[u]=arguments[u+2];n.children=s}return nr(e.type,a,n)};$.createContext=function(e){return e={$$typeof:cp,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:sp,_context:e},e};$.createElement=function(e,t,l){var n,a={},i=null;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)Dd.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(a[n]=t[n]);var s=arguments.length-2;if(s===1)a.children=l;else if(1<s){for(var u=Array(s),r=0;r<s;r++)u[r]=arguments[r+2];a.children=u}if(e&&e.defaultProps)for(n in s=e.defaultProps,s)a[n]===void 0&&(a[n]=s[n]);return nr(e,i,a)};$.createRef=function(){return{current:null}};$.forwardRef=function(e){return{$$typeof:up,render:e}};$.isValidElement=ar;$.lazy=function(e){return{$$typeof:wd,_payload:{_status:-1,_result:e},_init:pp}};$.memo=function(e,t){return{$$typeof:op,type:e,compare:t===void 0?null:t}};$.startTransition=function(e){var t=ge.T,l={};ge.T=l;try{var n=e(),a=ge.S;a!==null&&a(l,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(lu,ko)}catch(i){ko(i)}finally{t!==null&&l.types!==null&&(t.types=l.types),ge.T=t}};$.unstable_useCacheRefresh=function(){return ge.H.useCacheRefresh()};$.use=function(e){return ge.H.use(e)};$.useActionState=function(e,t,l){return ge.H.useActionState(e,t,l)};$.useCallback=function(e,t){return ge.H.useCallback(e,t)};$.useContext=function(e){return ge.H.useContext(e)};$.useDebugValue=function(){};$.useDeferredValue=function(e,t){return ge.H.useDeferredValue(e,t)};$.useEffect=function(e,t){return ge.H.useEffect(e,t)};$.useEffectEvent=function(e){return ge.H.useEffectEvent(e)};$.useId=function(){return ge.H.useId()};$.useImperativeHandle=function(e,t,l){return ge.H.useImperativeHandle(e,t,l)};$.useInsertionEffect=function(e,t){return ge.H.useInsertionEffect(e,t)};$.useLayoutEffect=function(e,t){return ge.H.useLayoutEffect(e,t)};$.useMemo=function(e,t){return ge.H.useMemo(e,t)};$.useOptimistic=function(e,t){return ge.H.useOptimistic(e,t)};$.useReducer=function(e,t,l){return ge.H.useReducer(e,t,l)};$.useRef=function(e){return ge.H.useRef(e)};$.useState=function(e){return ge.H.useState(e)};$.useSyncExternalStore=function(e,t,l){return ge.H.useSyncExternalStore(e,t,l)};$.useTransition=function(){return ge.H.useTransition()};$.version="19.2.5";Ad.exports=$;var p=Ad.exports,Ud={exports:{}},_s={},Bd={exports:{}},Ld={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(w,q){var G=w.length;w.push(q);e:for(;0<G;){var W=G-1>>>1,B=w[W];if(0<a(B,q))w[W]=q,w[G]=B,G=W;else break e}}function l(w){return w.length===0?null:w[0]}function n(w){if(w.length===0)return null;var q=w[0],G=w.pop();if(G!==q){w[0]=G;e:for(var W=0,B=w.length,I=B>>>1;W<I;){var st=2*(W+1)-1,je=w[st],ke=st+1,$e=w[ke];if(0>a(je,G))ke<B&&0>a($e,je)?(w[W]=$e,w[ke]=G,W=ke):(w[W]=je,w[st]=G,W=st);else if(ke<B&&0>a($e,G))w[W]=$e,w[ke]=G,W=ke;else break e}}return q}function a(w,q){var G=w.sortIndex-q.sortIndex;return G!==0?G:w.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var r=[],o=[],f=1,m=null,h=3,g=!1,v=!1,z=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function S(w){for(var q=l(o);q!==null;){if(q.callback===null)n(o);else if(q.startTime<=w)n(o),q.sortIndex=q.expirationTime,t(r,q);else break;q=l(o)}}function j(w){if(z=!1,S(w),!v)if(l(r)!==null)v=!0,M||(M=!0,he());else{var q=l(o);q!==null&&k(j,q.startTime-w)}}var M=!1,R=-1,C=5,U=-1;function O(){return b?!0:!(e.unstable_now()-U<C)}function ee(){if(b=!1,M){var w=e.unstable_now();U=w;var q=!0;try{e:{v=!1,z&&(z=!1,d(R),R=-1),g=!0;var G=h;try{t:{for(S(w),m=l(r);m!==null&&!(m.expirationTime>w&&O());){var W=m.callback;if(typeof W=="function"){m.callback=null,h=m.priorityLevel;var B=W(m.expirationTime<=w);if(w=e.unstable_now(),typeof B=="function"){m.callback=B,S(w),q=!0;break t}m===l(r)&&n(r),S(w)}else n(r);m=l(r)}if(m!==null)q=!0;else{var I=l(o);I!==null&&k(j,I.startTime-w),q=!1}}break e}finally{m=null,h=G,g=!1}q=void 0}}finally{q?he():M=!1}}}var he;if(typeof y=="function")he=function(){y(ee)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,F=_.port2;_.port1.onmessage=ee,he=function(){F.postMessage(null)}}else he=function(){x(ee,0)};function k(w,q){R=x(function(){w(e.unstable_now())},q)}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(w){w.callback=null},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(w){switch(h){case 1:case 2:case 3:var q=3;break;default:q=h}var G=h;h=q;try{return w()}finally{h=G}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(w,q){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var G=h;h=w;try{return q()}finally{h=G}},e.unstable_scheduleCallback=function(w,q,G){var W=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?W+G:W):G=W,w){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=G+B,w={id:f++,callback:q,priorityLevel:w,startTime:G,expirationTime:B,sortIndex:-1},G>W?(w.sortIndex=G,t(o,w),l(r)===null&&w===l(o)&&(z?(d(R),R=-1):z=!0,k(j,G-W))):(w.sortIndex=B,t(r,w),v||g||(v=!0,M||(M=!0,he()))),w},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(w){var q=h;return function(){var G=h;h=q;try{return w.apply(this,arguments)}finally{h=G}}}})(Ld);Bd.exports=Ld;var yp=Bd.exports,Hd={exports:{}},Fe={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var vp=p;function kd(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function fl(){}var Je={d:{f:fl,r:function(){throw Error(kd(522))},D:fl,C:fl,L:fl,m:fl,X:fl,S:fl,M:fl},p:0,findDOMNode:null},bp=Symbol.for("react.portal");function Sp(e,t,l){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:bp,key:n==null?null:""+n,children:e,containerInfo:t,implementation:l}}var Sa=vp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Ms(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Fe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Je;Fe.createPortal=function(e,t){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(kd(299));return Sp(e,t,null,l)};Fe.flushSync=function(e){var t=Sa.T,l=Je.p;try{if(Sa.T=null,Je.p=2,e)return e()}finally{Sa.T=t,Je.p=l,Je.d.f()}};Fe.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Je.d.C(e,t))};Fe.prefetchDNS=function(e){typeof e=="string"&&Je.d.D(e)};Fe.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var l=t.as,n=Ms(l,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;l==="style"?Je.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:a,fetchPriority:i}):l==="script"&&Je.d.X(e,{crossOrigin:n,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Fe.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var l=Ms(t.as,t.crossOrigin);Je.d.M(e,{crossOrigin:l,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Je.d.M(e)};Fe.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var l=t.as,n=Ms(l,t.crossOrigin);Je.d.L(e,l,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Fe.preloadModule=function(e,t){if(typeof e=="string")if(t){var l=Ms(t.as,t.crossOrigin);Je.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:l,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Je.d.m(e)};Fe.requestFormReset=function(e){Je.d.r(e)};Fe.unstable_batchedUpdates=function(e,t){return e(t)};Fe.useFormState=function(e,t,l){return Sa.H.useFormState(e,t,l)};Fe.useFormStatus=function(){return Sa.H.useHostTransitionStatus()};Fe.version="19.2.5";function qd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qd)}catch(e){console.error(e)}}qd(),Hd.exports=Fe;var zp=Hd.exports;/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var De=yp,Yd=p,Np=zp;function E(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Gd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wa(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function Xd(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 Vd(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function qo(e){if(Wa(e)!==e)throw Error(E(188))}function jp(e){var t=e.alternate;if(!t){if(t=Wa(e),t===null)throw Error(E(188));return t!==e?null:e}for(var l=e,n=t;;){var a=l.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){l=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===l)return qo(a),e;if(i===n)return qo(a),t;i=i.sibling}throw Error(E(188))}if(l.return!==n.return)l=a,n=i;else{for(var s=!1,u=a.child;u;){if(u===l){s=!0,l=a,n=i;break}if(u===n){s=!0,n=a,l=i;break}u=u.sibling}if(!s){for(u=i.child;u;){if(u===l){s=!0,l=i,n=a;break}if(u===n){s=!0,n=i,l=a;break}u=u.sibling}if(!s)throw Error(E(189))}}if(l.alternate!==n)throw Error(E(190))}if(l.tag!==3)throw Error(E(188));return l.stateNode.current===l?e:t}function Qd(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Qd(e),t!==null)return t;e=e.sibling}return null}var ye=Object.assign,Ep=Symbol.for("react.element"),yi=Symbol.for("react.transitional.element"),pa=Symbol.for("react.portal"),bn=Symbol.for("react.fragment"),$d=Symbol.for("react.strict_mode"),nu=Symbol.for("react.profiler"),Zd=Symbol.for("react.consumer"),Wt=Symbol.for("react.context"),ir=Symbol.for("react.forward_ref"),au=Symbol.for("react.suspense"),iu=Symbol.for("react.suspense_list"),sr=Symbol.for("react.memo"),dl=Symbol.for("react.lazy"),su=Symbol.for("react.activity"),Tp=Symbol.for("react.memo_cache_sentinel"),Yo=Symbol.iterator;function ua(e){return e===null||typeof e!="object"?null:(e=Yo&&e[Yo]||e["@@iterator"],typeof e=="function"?e:null)}var Rp=Symbol.for("react.client.reference");function cu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Rp?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bn:return"Fragment";case nu:return"Profiler";case $d:return"StrictMode";case au:return"Suspense";case iu:return"SuspenseList";case su:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case pa:return"Portal";case Wt:return e.displayName||"Context";case Zd:return(e._context.displayName||"Context")+".Consumer";case ir:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sr:return t=e.displayName||null,t!==null?t:cu(e.type)||"Memo";case dl:t=e._payload,e=e._init;try{return cu(e(t))}catch{}}return null}var ga=Array.isArray,X=Yd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Np.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Kl={pending:!1,data:null,method:null,action:null},uu=[],Sn=-1;function Gt(e){return{current:e}}function Le(e){0>Sn||(e.current=uu[Sn],uu[Sn]=null,Sn--)}function me(e,t){Sn++,uu[Sn]=e.current,e.current=t}var qt=Gt(null),Ua=Gt(null),Nl=Gt(null),Pi=Gt(null);function es(e,t){switch(me(Nl,t),me(Ua,e),me(qt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kf(t),e=hm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Le(qt),me(qt,e)}function kn(){Le(qt),Le(Ua),Le(Nl)}function ru(e){e.memoizedState!==null&&me(Pi,e);var t=qt.current,l=hm(t,e.type);t!==l&&(me(Ua,e),me(qt,l))}function ts(e){Ua.current===e&&(Le(qt),Le(Ua)),Pi.current===e&&(Le(Pi),$a._currentValue=Kl)}var hc,Go;function Xl(e){if(hc===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);hc=t&&t[1]||"",Go=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+hc+e+Go}var mc=!1;function xc(e,t){if(!e||mc)return"";mc=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(g){var h=g}Reflect.construct(e,[],m)}else{try{m.call()}catch(g){h=g}e.call(m.prototype)}}else{try{throw Error()}catch(g){h=g}(m=e())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(g){if(g&&h&&typeof g.stack=="string")return[g.stack,h.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),s=i[0],u=i[1];if(s&&u){var r=s.split(`
44
- `),o=u.split(`
45
- `);for(a=n=0;n<r.length&&!r[n].includes("DetermineComponentFrameRoot");)n++;for(;a<o.length&&!o[a].includes("DetermineComponentFrameRoot");)a++;if(n===r.length||a===o.length)for(n=r.length-1,a=o.length-1;1<=n&&0<=a&&r[n]!==o[a];)a--;for(;1<=n&&0<=a;n--,a--)if(r[n]!==o[a]){if(n!==1||a!==1)do if(n--,a--,0>a||r[n]!==o[a]){var f=`
46
- `+r[n].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=n&&0<=a);break}}}finally{mc=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Xl(l):""}function Ap(e,t){switch(e.tag){case 26:case 27:case 5:return Xl(e.type);case 16:return Xl("Lazy");case 13:return e.child!==t&&t!==null?Xl("Suspense Fallback"):Xl("Suspense");case 19:return Xl("SuspenseList");case 0:case 15:return xc(e.type,!1);case 11:return xc(e.type.render,!1);case 1:return xc(e.type,!0);case 31:return Xl("Activity");default:return""}}function Xo(e){try{var t="",l=null;do t+=Ap(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
47
- Error generating stack: `+n.message+`
48
- `+n.stack}}var ou=Object.prototype.hasOwnProperty,cr=De.unstable_scheduleCallback,pc=De.unstable_cancelCallback,wp=De.unstable_shouldYield,Cp=De.unstable_requestPaint,ft=De.unstable_now,_p=De.unstable_getCurrentPriorityLevel,Kd=De.unstable_ImmediatePriority,Jd=De.unstable_UserBlockingPriority,ls=De.unstable_NormalPriority,Mp=De.unstable_LowPriority,Fd=De.unstable_IdlePriority,Op=De.log,Dp=De.unstable_setDisableYieldValue,Ia=null,dt=null;function yl(e){if(typeof Op=="function"&&Dp(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Ia,e)}catch{}}var ht=Math.clz32?Math.clz32:Lp,Up=Math.log,Bp=Math.LN2;function Lp(e){return e>>>=0,e===0?32:31-(Up(e)/Bp|0)|0}var vi=256,bi=262144,Si=4194304;function Vl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Os(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var a=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var u=n&134217727;return u!==0?(n=u&~i,n!==0?a=Vl(n):(s&=u,s!==0?a=Vl(s):l||(l=u&~e,l!==0&&(a=Vl(l))))):(u=n&~i,u!==0?a=Vl(u):s!==0?a=Vl(s):l||(l=n&~e,l!==0&&(a=Vl(l)))),a===0?0:t!==0&&t!==a&&!(t&i)&&(i=a&-a,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:a}function Pa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Hp(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wd(){var e=Si;return Si<<=1,!(Si&62914560)&&(Si=4194304),e}function gc(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function kp(e,t,l,n,a,i){var s=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var u=e.entanglements,r=e.expirationTimes,o=e.hiddenUpdates;for(l=s&~l;0<l;){var f=31-ht(l),m=1<<f;u[f]=0,r[f]=-1;var h=o[f];if(h!==null)for(o[f]=null,f=0;f<h.length;f++){var g=h[f];g!==null&&(g.lane&=-536870913)}l&=~m}n!==0&&Id(e,n,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(s&~t))}function Id(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-ht(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function Pd(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-ht(l),a=1<<n;a&t|e[n]&t&&(e[n]|=t),l&=~a}}function eh(e,t){var l=t&-t;return l=l&42?1:ur(l),l&(e.suspendedLanes|t)?0:l}function ur(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rr(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function th(){var e=se.p;return e!==0?e:(e=window.event,e===void 0?32:jm(e.type))}function Vo(e,t){var l=se.p;try{return se.p=e,t()}finally{se.p=l}}var Bl=Math.random().toString(36).slice(2),Ye="__reactFiber$"+Bl,nt="__reactProps$"+Bl,Wn="__reactContainer$"+Bl,fu="__reactEvents$"+Bl,qp="__reactListeners$"+Bl,Yp="__reactHandles$"+Bl,Qo="__reactResources$"+Bl,ti="__reactMarker$"+Bl;function or(e){delete e[Ye],delete e[nt],delete e[fu],delete e[qp],delete e[Yp]}function zn(e){var t=e[Ye];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Wn]||l[Ye]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Pf(e);e!==null;){if(l=e[Ye])return l;e=Pf(e)}return t}e=l,l=e.parentNode}return null}function In(e){if(e=e[Ye]||e[Wn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ya(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(E(33))}function Mn(e){var t=e[Qo];return t||(t=e[Qo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Be(e){e[ti]=!0}var lh=new Set,nh={};function an(e,t){qn(e,t),qn(e+"Capture",t)}function qn(e,t){for(nh[e]=t,e=0;e<t.length;e++)lh.add(t[e])}var Gp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$o={},Zo={};function Xp(e){return ou.call(Zo,e)?!0:ou.call($o,e)?!1:Gp.test(e)?Zo[e]=!0:($o[e]=!0,!1)}function Bi(e,t,l){if(Xp(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function zi(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Vt(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function St(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vp(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){l=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(s){l=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function du(e){if(!e._valueTracker){var t=ah(e)?"checked":"value";e._valueTracker=Vp(e,t,""+e[t])}}function ih(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=ah(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function ns(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Qp=/[\n"\\]/g;function jt(e){return e.replace(Qp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hu(e,t,l,n,a,i,s,u){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+St(t)):e.value!==""+St(t)&&(e.value=""+St(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?mu(e,s,St(t)):l!=null?mu(e,s,St(l)):n!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+St(u):e.removeAttribute("name")}function sh(e,t,l,n,a,i,s,u){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){du(e);return}l=l!=null?""+St(l):"",t=t!=null?""+St(t):l,u||t===e.value||(e.value=t),e.defaultValue=t}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=u?e.checked:!!n,e.defaultChecked=!!n,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),du(e)}function mu(e,t,l){t==="number"&&ns(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function On(e,t,l,n){if(e=e.options,t){t={};for(var a=0;a<l.length;a++)t["$"+l[a]]=!0;for(l=0;l<e.length;l++)a=t.hasOwnProperty("$"+e[l].value),e[l].selected!==a&&(e[l].selected=a),a&&n&&(e[l].defaultSelected=!0)}else{for(l=""+St(l),t=null,a=0;a<e.length;a++){if(e[a].value===l){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function ch(e,t,l){if(t!=null&&(t=""+St(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+St(l):""}function uh(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(E(92));if(ga(n)){if(1<n.length)throw Error(E(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=St(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),du(e)}function Yn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var $p=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ko(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||$p.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function rh(e,t,l){if(t!=null&&typeof t!="object")throw Error(E(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var a in t)n=t[a],t.hasOwnProperty(a)&&l[a]!==n&&Ko(e,a,n)}else for(var i in t)t.hasOwnProperty(i)&&Ko(e,i,t[i])}function fr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Zp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Kp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Li(e){return Kp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function It(){}var xu=null;function dr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nn=null,Dn=null;function Jo(e){var t=In(e);if(t&&(e=t.stateNode)){var l=e[nt]||null;e:switch(e=t.stateNode,t.type){case"input":if(hu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+jt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var a=n[nt]||null;if(!a)throw Error(E(90));hu(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&ih(n)}break e;case"textarea":ch(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&On(e,!!l.multiple,t,!1)}}}var yc=!1;function oh(e,t,l){if(yc)return e(t,l);yc=!0;try{var n=e(t);return n}finally{if(yc=!1,(Nn!==null||Dn!==null)&&(Qs(),Nn&&(t=Nn,e=Dn,Dn=Nn=null,Jo(t),e)))for(t=0;t<e.length;t++)Jo(e[t])}}function Ba(e,t){var l=e.stateNode;if(l===null)return null;var n=l[nt]||null;if(n===null)return null;l=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(E(231,t,typeof l));return l}var nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pu=!1;if(nl)try{var ra={};Object.defineProperty(ra,"passive",{get:function(){pu=!0}}),window.addEventListener("test",ra,ra),window.removeEventListener("test",ra,ra)}catch{pu=!1}var vl=null,hr=null,Hi=null;function fh(){if(Hi)return Hi;var e,t=hr,l=t.length,n,a="value"in vl?vl.value:vl.textContent,i=a.length;for(e=0;e<l&&t[e]===a[e];e++);var s=l-e;for(n=1;n<=s&&t[l-n]===a[i-n];n++);return Hi=a.slice(e,1<n?1-n:void 0)}function ki(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 Ni(){return!0}function Fo(){return!1}function at(e){function t(l,n,a,i,s){this._reactName=l,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(l=e[u],this[u]=l?l(i):i[u]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ni:Fo,this.isPropagationStopped=Fo,this}return ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ni)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ni)},persist:function(){},isPersistent:Ni}),t}var sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ds=at(sn),li=ye({},sn,{view:0,detail:0}),Jp=at(li),vc,bc,oa,Us=ye({},li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mr,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!==oa&&(oa&&e.type==="mousemove"?(vc=e.screenX-oa.screenX,bc=e.screenY-oa.screenY):bc=vc=0,oa=e),vc)},movementY:function(e){return"movementY"in e?e.movementY:bc}}),Wo=at(Us),Fp=ye({},Us,{dataTransfer:0}),Wp=at(Fp),Ip=ye({},li,{relatedTarget:0}),Sc=at(Ip),Pp=ye({},sn,{animationName:0,elapsedTime:0,pseudoElement:0}),eg=at(Pp),tg=ye({},sn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lg=at(tg),ng=ye({},sn,{data:0}),Io=at(ng),ag={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ig={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"},sg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sg[e])?!!t[e]:!1}function mr(){return cg}var ug=ye({},li,{key:function(e){if(e.key){var t=ag[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ki(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ig[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mr,charCode:function(e){return e.type==="keypress"?ki(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ki(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rg=at(ug),og=ye({},Us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Po=at(og),fg=ye({},li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mr}),dg=at(fg),hg=ye({},sn,{propertyName:0,elapsedTime:0,pseudoElement:0}),mg=at(hg),xg=ye({},Us,{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}),pg=at(xg),gg=ye({},sn,{newState:0,oldState:0}),yg=at(gg),vg=[9,13,27,32],xr=nl&&"CompositionEvent"in window,za=null;nl&&"documentMode"in document&&(za=document.documentMode);var bg=nl&&"TextEvent"in window&&!za,dh=nl&&(!xr||za&&8<za&&11>=za),ef=" ",tf=!1;function hh(e,t){switch(e){case"keyup":return vg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jn=!1;function Sg(e,t){switch(e){case"compositionend":return mh(t);case"keypress":return t.which!==32?null:(tf=!0,ef);case"textInput":return e=t.data,e===ef&&tf?null:e;default:return null}}function zg(e,t){if(jn)return e==="compositionend"||!xr&&hh(e,t)?(e=fh(),Hi=hr=vl=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 dh&&t.locale!=="ko"?null:t.data;default:return null}}var Ng={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 lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ng[e.type]:t==="textarea"}function xh(e,t,l,n){Nn?Dn?Dn.push(n):Dn=[n]:Nn=n,t=Ss(t,"onChange"),0<t.length&&(l=new Ds("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var Na=null,La=null;function jg(e){om(e,0)}function Bs(e){var t=ya(e);if(ih(t))return e}function nf(e,t){if(e==="change")return t}var ph=!1;if(nl){var zc;if(nl){var Nc="oninput"in document;if(!Nc){var af=document.createElement("div");af.setAttribute("oninput","return;"),Nc=typeof af.oninput=="function"}zc=Nc}else zc=!1;ph=zc&&(!document.documentMode||9<document.documentMode)}function sf(){Na&&(Na.detachEvent("onpropertychange",gh),La=Na=null)}function gh(e){if(e.propertyName==="value"&&Bs(La)){var t=[];xh(t,La,e,dr(e)),oh(jg,t)}}function Eg(e,t,l){e==="focusin"?(sf(),Na=t,La=l,Na.attachEvent("onpropertychange",gh)):e==="focusout"&&sf()}function Tg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bs(La)}function Rg(e,t){if(e==="click")return Bs(t)}function Ag(e,t){if(e==="input"||e==="change")return Bs(t)}function wg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xt=typeof Object.is=="function"?Object.is:wg;function Ha(e,t){if(xt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var a=l[n];if(!ou.call(t,a)||!xt(e[a],t[a]))return!1}return!0}function cf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uf(e,t){var l=cf(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=cf(l)}}function yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ns(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=ns(e.document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Cg=nl&&"documentMode"in document&&11>=document.documentMode,En=null,gu=null,ja=null,yu=!1;function rf(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;yu||En==null||En!==ns(n)||(n=En,"selectionStart"in n&&pr(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ja&&Ha(ja,n)||(ja=n,n=Ss(gu,"onSelect"),0<n.length&&(t=new Ds("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=En)))}function ql(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Tn={animationend:ql("Animation","AnimationEnd"),animationiteration:ql("Animation","AnimationIteration"),animationstart:ql("Animation","AnimationStart"),transitionrun:ql("Transition","TransitionRun"),transitionstart:ql("Transition","TransitionStart"),transitioncancel:ql("Transition","TransitionCancel"),transitionend:ql("Transition","TransitionEnd")},jc={},bh={};nl&&(bh=document.createElement("div").style,"AnimationEvent"in window||(delete Tn.animationend.animation,delete Tn.animationiteration.animation,delete Tn.animationstart.animation),"TransitionEvent"in window||delete Tn.transitionend.transition);function cn(e){if(jc[e])return jc[e];if(!Tn[e])return e;var t=Tn[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in bh)return jc[e]=t[l];return e}var Sh=cn("animationend"),zh=cn("animationiteration"),Nh=cn("animationstart"),_g=cn("transitionrun"),Mg=cn("transitionstart"),Og=cn("transitioncancel"),jh=cn("transitionend"),Eh=new Map,vu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");vu.push("scrollEnd");function Ut(e,t){Eh.set(e,t),an(t,[e])}var as=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bt=[],Rn=0,gr=0;function Ls(){for(var e=Rn,t=gr=Rn=0;t<e;){var l=bt[t];bt[t++]=null;var n=bt[t];bt[t++]=null;var a=bt[t];bt[t++]=null;var i=bt[t];if(bt[t++]=null,n!==null&&a!==null){var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}i!==0&&Th(l,a,i)}}function Hs(e,t,l,n){bt[Rn++]=e,bt[Rn++]=t,bt[Rn++]=l,bt[Rn++]=n,gr|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function yr(e,t,l,n){return Hs(e,t,l,n),is(e)}function un(e,t){return Hs(e,null,null,t),is(e)}function Th(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var a=!1,i=e.return;i!==null;)i.childLanes|=l,n=i.alternate,n!==null&&(n.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-ht(l),e=i.hiddenUpdates,n=e[a],n===null?e[a]=[t]:n.push(t),t.lane=l|536870912),i):null}function is(e){if(50<Oa)throw Oa=0,qu=null,Error(E(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var An={};function Dg(e,t,l,n){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rt(e,t,l,n){return new Dg(e,t,l,n)}function vr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function el(e,t){var l=e.alternate;return l===null?(l=rt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Rh(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function qi(e,t,l,n,a,i){var s=0;if(n=e,typeof e=="function")vr(e)&&(s=1);else if(typeof e=="string")s=ky(e,l,qt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case su:return e=rt(31,l,t,a),e.elementType=su,e.lanes=i,e;case bn:return Jl(l.children,a,i,t);case $d:s=8,a|=24;break;case nu:return e=rt(12,l,t,a|2),e.elementType=nu,e.lanes=i,e;case au:return e=rt(13,l,t,a),e.elementType=au,e.lanes=i,e;case iu:return e=rt(19,l,t,a),e.elementType=iu,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wt:s=10;break e;case Zd:s=9;break e;case ir:s=11;break e;case sr:s=14;break e;case dl:s=16,n=null;break e}s=29,l=Error(E(130,e===null?"null":typeof e,"")),n=null}return t=rt(s,l,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Jl(e,t,l,n){return e=rt(7,e,n,t),e.lanes=l,e}function Ec(e,t,l){return e=rt(6,e,null,t),e.lanes=l,e}function Ah(e){var t=rt(18,null,null,0);return t.stateNode=e,t}function Tc(e,t,l){return t=rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var of=new WeakMap;function Et(e,t){if(typeof e=="object"&&e!==null){var l=of.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Xo(t)},of.set(e,t),t)}return{value:e,source:t,stack:Xo(t)}}var wn=[],Cn=0,ss=null,ka=0,zt=[],Nt=0,Ml=null,Lt=1,Ht="";function Jt(e,t){wn[Cn++]=ka,wn[Cn++]=ss,ss=e,ka=t}function wh(e,t,l){zt[Nt++]=Lt,zt[Nt++]=Ht,zt[Nt++]=Ml,Ml=e;var n=Lt;e=Ht;var a=32-ht(n)-1;n&=~(1<<a),l+=1;var i=32-ht(t)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,Lt=1<<32-ht(t)+a|l<<a|n,Ht=i+e}else Lt=1<<i|l<<a|n,Ht=e}function br(e){e.return!==null&&(Jt(e,1),wh(e,1,0))}function Sr(e){for(;e===ss;)ss=wn[--Cn],wn[Cn]=null,ka=wn[--Cn],wn[Cn]=null;for(;e===Ml;)Ml=zt[--Nt],zt[Nt]=null,Ht=zt[--Nt],zt[Nt]=null,Lt=zt[--Nt],zt[Nt]=null}function Ch(e,t){zt[Nt++]=Lt,zt[Nt++]=Ht,zt[Nt++]=Ml,Lt=t.id,Ht=t.overflow,Ml=e}var Ge=null,pe=null,te=!1,jl=null,Tt=!1,bu=Error(E(519));function Ol(e){var t=Error(E(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qa(Et(t,e)),bu}function ff(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[Ye]=e,t[nt]=n,l){case"dialog":K("cancel",t),K("close",t);break;case"iframe":case"object":case"embed":K("load",t);break;case"video":case"audio":for(l=0;l<Va.length;l++)K(Va[l],t);break;case"source":K("error",t);break;case"img":case"image":case"link":K("error",t),K("load",t);break;case"details":K("toggle",t);break;case"input":K("invalid",t),sh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":K("invalid",t);break;case"textarea":K("invalid",t),uh(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||dm(t.textContent,l)?(n.popover!=null&&(K("beforetoggle",t),K("toggle",t)),n.onScroll!=null&&K("scroll",t),n.onScrollEnd!=null&&K("scrollend",t),n.onClick!=null&&(t.onclick=It),t=!0):t=!1,t||Ol(e,!0)}function df(e){for(Ge=e.return;Ge;)switch(Ge.tag){case 5:case 31:case 13:Tt=!1;return;case 27:case 3:Tt=!0;return;default:Ge=Ge.return}}function mn(e){if(e!==Ge)return!1;if(!te)return df(e),te=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Qu(e.type,e.memoizedProps)),l=!l),l&&pe&&Ol(e),df(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(317));pe=If(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(317));pe=If(e)}else t===27?(t=pe,Ll(e.type)?(e=Ju,Ju=null,pe=e):pe=t):pe=Ge?At(e.stateNode.nextSibling):null;return!0}function Pl(){pe=Ge=null,te=!1}function Rc(){var e=jl;return e!==null&&(tt===null?tt=e:tt.push.apply(tt,e),jl=null),e}function qa(e){jl===null?jl=[e]:jl.push(e)}var Su=Gt(null),rn=null,Pt=null;function ml(e,t,l){me(Su,t._currentValue),t._currentValue=l}function tl(e){e._currentValue=Su.current,Le(Su)}function zu(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function Nu(e,t,l,n){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var s=a.child;i=i.firstContext;e:for(;i!==null;){var u=i;i=a;for(var r=0;r<t.length;r++)if(u.context===t[r]){i.lanes|=l,u=i.alternate,u!==null&&(u.lanes|=l),zu(i.return,l,e),n||(s=null);break e}i=u.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(E(341));s.lanes|=l,i=s.alternate,i!==null&&(i.lanes|=l),zu(s,l,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Pn(e,t,l,n){e=null;for(var a=t,i=!1;a!==null;){if(!i){if(a.flags&524288)i=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(E(387));if(s=s.memoizedProps,s!==null){var u=a.type;xt(a.pendingProps.value,s.value)||(e!==null?e.push(u):e=[u])}}else if(a===Pi.current){if(s=a.alternate,s===null)throw Error(E(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push($a):e=[$a])}a=a.return}e!==null&&Nu(t,e,l,n),t.flags|=262144}function cs(e){for(e=e.firstContext;e!==null;){if(!xt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function en(e){rn=e,Pt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xe(e){return _h(rn,e)}function ji(e,t){return rn===null&&en(e),_h(e,t)}function _h(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Pt===null){if(e===null)throw Error(E(308));Pt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pt=Pt.next=t;return l}var Ug=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Bg=De.unstable_scheduleCallback,Lg=De.unstable_NormalPriority,we={$$typeof:Wt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zr(){return{controller:new Ug,data:new Map,refCount:0}}function ni(e){e.refCount--,e.refCount===0&&Bg(Lg,function(){e.controller.abort()})}var Ea=null,ju=0,Gn=0,Un=null;function Hg(e,t){if(Ea===null){var l=Ea=[];ju=0,Gn=Zr(),Un={status:"pending",value:void 0,then:function(n){l.push(n)}}}return ju++,t.then(hf,hf),t}function hf(){if(--ju===0&&Ea!==null){Un!==null&&(Un.status="fulfilled");var e=Ea;Ea=null,Gn=0,Un=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kg(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(a){l.push(a)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var a=0;a<l.length;a++)(0,l[a])(t)},function(a){for(n.status="rejected",n.reason=a,a=0;a<l.length;a++)(0,l[a])(void 0)}),n}var mf=X.S;X.S=function(e,t){Q0=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Hg(e,t),mf!==null&&mf(e,t)};var Fl=Gt(null);function Nr(){var e=Fl.current;return e!==null?e:de.pooledCache}function Yi(e,t){t===null?me(Fl,Fl.current):me(Fl,t.pool)}function Mh(){var e=Nr();return e===null?null:{parent:we._currentValue,pool:e}}var ea=Error(E(460)),jr=Error(E(474)),ks=Error(E(542)),us={then:function(){}};function xf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Oh(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(It,It),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gf(e),e;default:if(typeof t.status=="string")t.then(It,It);else{if(e=de,e!==null&&100<e.shellSuspendCounter)throw Error(E(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=n}},function(n){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gf(e),e}throw Wl=t,ea}}function Ql(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Wl=l,ea):l}}var Wl=null;function pf(){if(Wl===null)throw Error(E(459));var e=Wl;return Wl=null,e}function gf(e){if(e===ea||e===ks)throw Error(E(483))}var Bn=null,Ya=0;function Ei(e){var t=Ya;return Ya+=1,Bn===null&&(Bn=[]),Oh(Bn,e,t)}function fa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ti(e,t){throw t.$$typeof===Ep?Error(E(525)):(e=Object.prototype.toString.call(t),Error(E(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Dh(e){function t(x,d){if(e){var y=x.deletions;y===null?(x.deletions=[d],x.flags|=16):y.push(d)}}function l(x,d){if(!e)return null;for(;d!==null;)t(x,d),d=d.sibling;return null}function n(x){for(var d=new Map;x!==null;)x.key!==null?d.set(x.key,x):d.set(x.index,x),x=x.sibling;return d}function a(x,d){return x=el(x,d),x.index=0,x.sibling=null,x}function i(x,d,y){return x.index=y,e?(y=x.alternate,y!==null?(y=y.index,y<d?(x.flags|=67108866,d):y):(x.flags|=67108866,d)):(x.flags|=1048576,d)}function s(x){return e&&x.alternate===null&&(x.flags|=67108866),x}function u(x,d,y,S){return d===null||d.tag!==6?(d=Ec(y,x.mode,S),d.return=x,d):(d=a(d,y),d.return=x,d)}function r(x,d,y,S){var j=y.type;return j===bn?f(x,d,y.props.children,S,y.key):d!==null&&(d.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===dl&&Ql(j)===d.type)?(d=a(d,y.props),fa(d,y),d.return=x,d):(d=qi(y.type,y.key,y.props,null,x.mode,S),fa(d,y),d.return=x,d)}function o(x,d,y,S){return d===null||d.tag!==4||d.stateNode.containerInfo!==y.containerInfo||d.stateNode.implementation!==y.implementation?(d=Tc(y,x.mode,S),d.return=x,d):(d=a(d,y.children||[]),d.return=x,d)}function f(x,d,y,S,j){return d===null||d.tag!==7?(d=Jl(y,x.mode,S,j),d.return=x,d):(d=a(d,y),d.return=x,d)}function m(x,d,y){if(typeof d=="string"&&d!==""||typeof d=="number"||typeof d=="bigint")return d=Ec(""+d,x.mode,y),d.return=x,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case yi:return y=qi(d.type,d.key,d.props,null,x.mode,y),fa(y,d),y.return=x,y;case pa:return d=Tc(d,x.mode,y),d.return=x,d;case dl:return d=Ql(d),m(x,d,y)}if(ga(d)||ua(d))return d=Jl(d,x.mode,y,null),d.return=x,d;if(typeof d.then=="function")return m(x,Ei(d),y);if(d.$$typeof===Wt)return m(x,ji(x,d),y);Ti(x,d)}return null}function h(x,d,y,S){var j=d!==null?d.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return j!==null?null:u(x,d,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yi:return y.key===j?r(x,d,y,S):null;case pa:return y.key===j?o(x,d,y,S):null;case dl:return y=Ql(y),h(x,d,y,S)}if(ga(y)||ua(y))return j!==null?null:f(x,d,y,S,null);if(typeof y.then=="function")return h(x,d,Ei(y),S);if(y.$$typeof===Wt)return h(x,d,ji(x,y),S);Ti(x,y)}return null}function g(x,d,y,S,j){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return x=x.get(y)||null,u(d,x,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yi:return x=x.get(S.key===null?y:S.key)||null,r(d,x,S,j);case pa:return x=x.get(S.key===null?y:S.key)||null,o(d,x,S,j);case dl:return S=Ql(S),g(x,d,y,S,j)}if(ga(S)||ua(S))return x=x.get(y)||null,f(d,x,S,j,null);if(typeof S.then=="function")return g(x,d,y,Ei(S),j);if(S.$$typeof===Wt)return g(x,d,y,ji(d,S),j);Ti(d,S)}return null}function v(x,d,y,S){for(var j=null,M=null,R=d,C=d=0,U=null;R!==null&&C<y.length;C++){R.index>C?(U=R,R=null):U=R.sibling;var O=h(x,R,y[C],S);if(O===null){R===null&&(R=U);break}e&&R&&O.alternate===null&&t(x,R),d=i(O,d,C),M===null?j=O:M.sibling=O,M=O,R=U}if(C===y.length)return l(x,R),te&&Jt(x,C),j;if(R===null){for(;C<y.length;C++)R=m(x,y[C],S),R!==null&&(d=i(R,d,C),M===null?j=R:M.sibling=R,M=R);return te&&Jt(x,C),j}for(R=n(R);C<y.length;C++)U=g(R,x,C,y[C],S),U!==null&&(e&&U.alternate!==null&&R.delete(U.key===null?C:U.key),d=i(U,d,C),M===null?j=U:M.sibling=U,M=U);return e&&R.forEach(function(ee){return t(x,ee)}),te&&Jt(x,C),j}function z(x,d,y,S){if(y==null)throw Error(E(151));for(var j=null,M=null,R=d,C=d=0,U=null,O=y.next();R!==null&&!O.done;C++,O=y.next()){R.index>C?(U=R,R=null):U=R.sibling;var ee=h(x,R,O.value,S);if(ee===null){R===null&&(R=U);break}e&&R&&ee.alternate===null&&t(x,R),d=i(ee,d,C),M===null?j=ee:M.sibling=ee,M=ee,R=U}if(O.done)return l(x,R),te&&Jt(x,C),j;if(R===null){for(;!O.done;C++,O=y.next())O=m(x,O.value,S),O!==null&&(d=i(O,d,C),M===null?j=O:M.sibling=O,M=O);return te&&Jt(x,C),j}for(R=n(R);!O.done;C++,O=y.next())O=g(R,x,C,O.value,S),O!==null&&(e&&O.alternate!==null&&R.delete(O.key===null?C:O.key),d=i(O,d,C),M===null?j=O:M.sibling=O,M=O);return e&&R.forEach(function(he){return t(x,he)}),te&&Jt(x,C),j}function b(x,d,y,S){if(typeof y=="object"&&y!==null&&y.type===bn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case yi:e:{for(var j=y.key;d!==null;){if(d.key===j){if(j=y.type,j===bn){if(d.tag===7){l(x,d.sibling),S=a(d,y.props.children),S.return=x,x=S;break e}}else if(d.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===dl&&Ql(j)===d.type){l(x,d.sibling),S=a(d,y.props),fa(S,y),S.return=x,x=S;break e}l(x,d);break}else t(x,d);d=d.sibling}y.type===bn?(S=Jl(y.props.children,x.mode,S,y.key),S.return=x,x=S):(S=qi(y.type,y.key,y.props,null,x.mode,S),fa(S,y),S.return=x,x=S)}return s(x);case pa:e:{for(j=y.key;d!==null;){if(d.key===j)if(d.tag===4&&d.stateNode.containerInfo===y.containerInfo&&d.stateNode.implementation===y.implementation){l(x,d.sibling),S=a(d,y.children||[]),S.return=x,x=S;break e}else{l(x,d);break}else t(x,d);d=d.sibling}S=Tc(y,x.mode,S),S.return=x,x=S}return s(x);case dl:return y=Ql(y),b(x,d,y,S)}if(ga(y))return v(x,d,y,S);if(ua(y)){if(j=ua(y),typeof j!="function")throw Error(E(150));return y=j.call(y),z(x,d,y,S)}if(typeof y.then=="function")return b(x,d,Ei(y),S);if(y.$$typeof===Wt)return b(x,d,ji(x,y),S);Ti(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,d!==null&&d.tag===6?(l(x,d.sibling),S=a(d,y),S.return=x,x=S):(l(x,d),S=Ec(y,x.mode,S),S.return=x,x=S),s(x)):l(x,d)}return function(x,d,y,S){try{Ya=0;var j=b(x,d,y,S);return Bn=null,j}catch(R){if(R===ea||R===ks)throw R;var M=rt(29,R,null,x.mode);return M.lanes=S,M.return=x,M}finally{}}}var tn=Dh(!0),Uh=Dh(!1),hl=!1;function Er(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function El(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tl(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ie&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,t=is(e),Th(e,null,l),t}return Hs(e,n,t,l),is(e)}function Ta(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Pd(e,l)}}function Ac(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?a=i=s:i=i.next=s,l=l.next}while(l!==null);i===null?a=i=t:i=i.next=t}else a=i=t;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Tu=!1;function Ra(){if(Tu){var e=Un;if(e!==null)throw e}}function Aa(e,t,l,n){Tu=!1;var a=e.updateQueue;hl=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,u=a.shared.pending;if(u!==null){a.shared.pending=null;var r=u,o=r.next;r.next=null,s===null?i=o:s.next=o,s=r;var f=e.alternate;f!==null&&(f=f.updateQueue,u=f.lastBaseUpdate,u!==s&&(u===null?f.firstBaseUpdate=o:u.next=o,f.lastBaseUpdate=r))}if(i!==null){var m=a.baseState;s=0,f=o=r=null,u=i;do{var h=u.lane&-536870913,g=h!==u.lane;if(g?(P&h)===h:(n&h)===h){h!==0&&h===Gn&&(Tu=!0),f!==null&&(f=f.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var v=e,z=u;h=t;var b=l;switch(z.tag){case 1:if(v=z.payload,typeof v=="function"){m=v.call(b,m,h);break e}m=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=z.payload,h=typeof v=="function"?v.call(b,m,h):v,h==null)break e;m=ye({},m,h);break e;case 2:hl=!0}}h=u.callback,h!==null&&(e.flags|=64,g&&(e.flags|=8192),g=a.callbacks,g===null?a.callbacks=[h]:g.push(h))}else g={lane:h,tag:u.tag,payload:u.payload,callback:u.callback,next:null},f===null?(o=f=g,r=m):f=f.next=g,s|=h;if(u=u.next,u===null){if(u=a.shared.pending,u===null)break;g=u,u=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);f===null&&(r=m),a.baseState=r,a.firstBaseUpdate=o,a.lastBaseUpdate=f,i===null&&(a.shared.lanes=0),Ul|=s,e.lanes=s,e.memoizedState=m}}function Bh(e,t){if(typeof e!="function")throw Error(E(191,e));e.call(t)}function Lh(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Bh(l[e],t)}var Xn=Gt(null),rs=Gt(0);function yf(e,t){e=cl,me(rs,e),me(Xn,t),cl=e|t.baseLanes}function Ru(){me(rs,cl),me(Xn,Xn.current)}function Tr(){cl=rs.current,Le(Xn),Le(rs)}var pt=Gt(null),Rt=null;function xl(e){var t=e.alternate;me(Ee,Ee.current&1),me(pt,e),Rt===null&&(t===null||Xn.current!==null||t.memoizedState!==null)&&(Rt=e)}function Au(e){me(Ee,Ee.current),me(pt,e),Rt===null&&(Rt=e)}function Hh(e){e.tag===22?(me(Ee,Ee.current),me(pt,e),Rt===null&&(Rt=e)):pl()}function pl(){me(Ee,Ee.current),me(pt,pt.current)}function ut(e){Le(pt),Rt===e&&(Rt=null),Le(Ee)}var Ee=Gt(0);function os(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Zu(l)||Ku(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 al=0,Z=null,fe=null,Re=null,fs=!1,Ln=!1,ln=!1,ds=0,Ga=0,Hn=null,qg=0;function Se(){throw Error(E(321))}function Rr(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!xt(e[l],t[l]))return!1;return!0}function Ar(e,t,l,n,a,i){return al=i,Z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,X.H=e===null||e.memoizedState===null?x0:kr,ln=!1,i=l(n,a),ln=!1,Ln&&(i=qh(t,l,n,a)),kh(e),i}function kh(e){X.H=Xa;var t=fe!==null&&fe.next!==null;if(al=0,Re=fe=Z=null,fs=!1,Ga=0,Hn=null,t)throw Error(E(300));e===null||Ce||(e=e.dependencies,e!==null&&cs(e)&&(Ce=!0))}function qh(e,t,l,n){Z=e;var a=0;do{if(Ln&&(Hn=null),Ga=0,Ln=!1,25<=a)throw Error(E(301));if(a+=1,Re=fe=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}X.H=p0,i=t(l,n)}while(Ln);return i}function Yg(){var e=X.H,t=e.useState()[0];return t=typeof t.then=="function"?ai(t):t,e=e.useState()[0],(fe!==null?fe.memoizedState:null)!==e&&(Z.flags|=1024),t}function wr(){var e=ds!==0;return ds=0,e}function Cr(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function _r(e){if(fs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fs=!1}al=0,Re=fe=Z=null,Ln=!1,Ga=ds=0,Hn=null}function Ke(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?Z.memoizedState=Re=e:Re=Re.next=e,Re}function Te(){if(fe===null){var e=Z.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=Re===null?Z.memoizedState:Re.next;if(t!==null)Re=t,fe=e;else{if(e===null)throw Z.alternate===null?Error(E(467)):Error(E(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},Re===null?Z.memoizedState=Re=e:Re=Re.next=e}return Re}function qs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ai(e){var t=Ga;return Ga+=1,Hn===null&&(Hn=[]),e=Oh(Hn,e,t),t=Z,(Re===null?t.memoizedState:Re.next)===null&&(t=t.alternate,X.H=t===null||t.memoizedState===null?x0:kr),e}function Ys(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ai(e);if(e.$$typeof===Wt)return Xe(e)}throw Error(E(438,String(e)))}function Mr(e){var t=null,l=Z.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=Z.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=qs(),Z.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=Tp;return t.index++,l}function il(e,t){return typeof t=="function"?t(e):t}function Gi(e){var t=Te();return Or(t,fe,e)}function Or(e,t,l){var n=e.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=l;var a=e.baseQueue,i=n.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}t.baseQueue=a=i,n.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var u=s=null,r=null,o=t,f=!1;do{var m=o.lane&-536870913;if(m!==o.lane?(P&m)===m:(al&m)===m){var h=o.revertLane;if(h===0)r!==null&&(r=r.next={lane:0,revertLane:0,gesture:null,action:o.action,hasEagerState:o.hasEagerState,eagerState:o.eagerState,next:null}),m===Gn&&(f=!0);else if((al&h)===h){o=o.next,h===Gn&&(f=!0);continue}else m={lane:0,revertLane:o.revertLane,gesture:null,action:o.action,hasEagerState:o.hasEagerState,eagerState:o.eagerState,next:null},r===null?(u=r=m,s=i):r=r.next=m,Z.lanes|=h,Ul|=h;m=o.action,ln&&l(i,m),i=o.hasEagerState?o.eagerState:l(i,m)}else h={lane:m,revertLane:o.revertLane,gesture:o.gesture,action:o.action,hasEagerState:o.hasEagerState,eagerState:o.eagerState,next:null},r===null?(u=r=h,s=i):r=r.next=h,Z.lanes|=m,Ul|=m;o=o.next}while(o!==null&&o!==t);if(r===null?s=i:r.next=u,!xt(i,e.memoizedState)&&(Ce=!0,f&&(l=Un,l!==null)))throw l;e.memoizedState=i,e.baseState=s,e.baseQueue=r,n.lastRenderedState=i}return a===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function wc(e){var t=Te(),l=t.queue;if(l===null)throw Error(E(311));l.lastRenderedReducer=e;var n=l.dispatch,a=l.pending,i=t.memoizedState;if(a!==null){l.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);xt(i,t.memoizedState)||(Ce=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,n]}function Yh(e,t,l){var n=Z,a=Te(),i=te;if(i){if(l===void 0)throw Error(E(407));l=l()}else l=t();var s=!xt((fe||a).memoizedState,l);if(s&&(a.memoizedState=l,Ce=!0),a=a.queue,Dr(Vh.bind(null,n,a,e),[e]),a.getSnapshot!==t||s||Re!==null&&Re.memoizedState.tag&1){if(n.flags|=2048,Vn(9,{destroy:void 0},Xh.bind(null,n,a,l,t),null),de===null)throw Error(E(349));i||al&127||Gh(n,t,l)}return l}function Gh(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Z.updateQueue,t===null?(t=qs(),Z.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Xh(e,t,l,n){t.value=l,t.getSnapshot=n,Qh(t)&&$h(e)}function Vh(e,t,l){return l(function(){Qh(t)&&$h(e)})}function Qh(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!xt(e,l)}catch{return!0}}function $h(e){var t=un(e,2);t!==null&&lt(t,e,2)}function wu(e){var t=Ke();if(typeof e=="function"){var l=e;if(e=l(),ln){yl(!0);try{l()}finally{yl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:e},t}function Zh(e,t,l,n){return e.baseState=l,Or(e,fe,typeof n=="function"?n:il)}function Gg(e,t,l,n,a){if(Xs(e))throw Error(E(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){i.listeners.push(s)}};X.T!==null?l(!0):i.isTransition=!1,n(i),l=t.pending,l===null?(i.next=t.pending=i,Kh(t,i)):(i.next=l.next,t.pending=l.next=i)}}function Kh(e,t){var l=t.action,n=t.payload,a=e.state;if(t.isTransition){var i=X.T,s={};X.T=s;try{var u=l(a,n),r=X.S;r!==null&&r(s,u),vf(e,t,u)}catch(o){Cu(e,t,o)}finally{i!==null&&s.types!==null&&(i.types=s.types),X.T=i}}else try{i=l(a,n),vf(e,t,i)}catch(o){Cu(e,t,o)}}function vf(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){bf(e,t,n)},function(n){return Cu(e,t,n)}):bf(e,t,l)}function bf(e,t,l){t.status="fulfilled",t.value=l,Jh(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Kh(e,l)))}function Cu(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Jh(t),t=t.next;while(t!==n)}e.action=null}function Jh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fh(e,t){return t}function Sf(e,t){if(te){var l=de.formState;if(l!==null){e:{var n=Z;if(te){if(pe){t:{for(var a=pe,i=Tt;a.nodeType!==8;){if(!i){a=null;break t}if(a=At(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){pe=At(a.nextSibling),n=a.data==="F!";break e}}Ol(n)}n=!1}n&&(t=l[0])}}return l=Ke(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fh,lastRenderedState:t},l.queue=n,l=d0.bind(null,Z,n),n.dispatch=l,n=wu(!1),i=Hr.bind(null,Z,!1,n.queue),n=Ke(),a={state:t,dispatch:null,action:e,pending:null},n.queue=a,l=Gg.bind(null,Z,a,i,l),a.dispatch=l,n.memoizedState=e,[t,l,!1]}function zf(e){var t=Te();return Wh(t,fe,e)}function Wh(e,t,l){if(t=Or(e,t,Fh)[0],e=Gi(il)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ai(t)}catch(s){throw s===ea?ks:s}else n=t;t=Te();var a=t.queue,i=a.dispatch;return l!==t.memoizedState&&(Z.flags|=2048,Vn(9,{destroy:void 0},Xg.bind(null,a,l),null)),[n,i,e]}function Xg(e,t){e.action=t}function Nf(e){var t=Te(),l=fe;if(l!==null)return Wh(t,l,e);Te(),t=t.memoizedState,l=Te();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function Vn(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=Z.updateQueue,t===null&&(t=qs(),Z.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Ih(){return Te().memoizedState}function Xi(e,t,l,n){var a=Ke();Z.flags|=e,a.memoizedState=Vn(1|t,{destroy:void 0},l,n===void 0?null:n)}function Gs(e,t,l,n){var a=Te();n=n===void 0?null:n;var i=a.memoizedState.inst;fe!==null&&n!==null&&Rr(n,fe.memoizedState.deps)?a.memoizedState=Vn(t,i,l,n):(Z.flags|=e,a.memoizedState=Vn(1|t,i,l,n))}function jf(e,t){Xi(8390656,8,e,t)}function Dr(e,t){Gs(2048,8,e,t)}function Vg(e){Z.flags|=4;var t=Z.updateQueue;if(t===null)t=qs(),Z.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Ph(e){var t=Te().memoizedState;return Vg({ref:t,nextImpl:e}),function(){if(ie&2)throw Error(E(440));return t.impl.apply(void 0,arguments)}}function e0(e,t){return Gs(4,2,e,t)}function t0(e,t){return Gs(4,4,e,t)}function l0(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function n0(e,t,l){l=l!=null?l.concat([e]):null,Gs(4,4,l0.bind(null,t,e),l)}function Ur(){}function a0(e,t){var l=Te();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&Rr(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function i0(e,t){var l=Te();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&Rr(t,n[1]))return n[0];if(n=e(),ln){yl(!0);try{e()}finally{yl(!1)}}return l.memoizedState=[n,t],n}function Br(e,t,l){return l===void 0||al&1073741824&&!(P&261930)?e.memoizedState=t:(e.memoizedState=l,e=Z0(),Z.lanes|=e,Ul|=e,l)}function s0(e,t,l,n){return xt(l,t)?l:Xn.current!==null?(e=Br(e,l,n),xt(e,t)||(Ce=!0),e):!(al&42)||al&1073741824&&!(P&261930)?(Ce=!0,e.memoizedState=l):(e=Z0(),Z.lanes|=e,Ul|=e,t)}function c0(e,t,l,n,a){var i=se.p;se.p=i!==0&&8>i?i:8;var s=X.T,u={};X.T=u,Hr(e,!1,t,l);try{var r=a(),o=X.S;if(o!==null&&o(u,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var f=kg(r,n);wa(e,t,f,mt(e))}else wa(e,t,n,mt(e))}catch(m){wa(e,t,{then:function(){},status:"rejected",reason:m},mt())}finally{se.p=i,s!==null&&u.types!==null&&(s.types=u.types),X.T=s}}function Qg(){}function _u(e,t,l,n){if(e.tag!==5)throw Error(E(476));var a=u0(e).queue;c0(e,a,t,Kl,l===null?Qg:function(){return r0(e),l(n)})}function u0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Kl,baseState:Kl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:Kl},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function r0(e){var t=u0(e);t.next===null&&(t=e.alternate.memoizedState),wa(e,t.next.queue,{},mt())}function Lr(){return Xe($a)}function o0(){return Te().memoizedState}function f0(){return Te().memoizedState}function $g(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=mt();e=El(l);var n=Tl(t,e,l);n!==null&&(lt(n,t,l),Ta(n,t,l)),t={cache:zr()},e.payload=t;return}t=t.return}}function Zg(e,t,l){var n=mt();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Xs(e)?h0(t,l):(l=yr(e,t,l,n),l!==null&&(lt(l,e,n),m0(l,t,n)))}function d0(e,t,l){var n=mt();wa(e,t,l,n)}function wa(e,t,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Xs(e))h0(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,u=i(s,l);if(a.hasEagerState=!0,a.eagerState=u,xt(u,s))return Hs(e,t,a,0),de===null&&Ls(),!1}catch{}finally{}if(l=yr(e,t,a,n),l!==null)return lt(l,e,n),m0(l,t,n),!0}return!1}function Hr(e,t,l,n){if(n={lane:2,revertLane:Zr(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Xs(e)){if(t)throw Error(E(479))}else t=yr(e,l,n,2),t!==null&&lt(t,e,2)}function Xs(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function h0(e,t){Ln=fs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function m0(e,t,l){if(l&4194048){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Pd(e,l)}}var Xa={readContext:Xe,use:Ys,useCallback:Se,useContext:Se,useEffect:Se,useImperativeHandle:Se,useLayoutEffect:Se,useInsertionEffect:Se,useMemo:Se,useReducer:Se,useRef:Se,useState:Se,useDebugValue:Se,useDeferredValue:Se,useTransition:Se,useSyncExternalStore:Se,useId:Se,useHostTransitionStatus:Se,useFormState:Se,useActionState:Se,useOptimistic:Se,useMemoCache:Se,useCacheRefresh:Se};Xa.useEffectEvent=Se;var x0={readContext:Xe,use:Ys,useCallback:function(e,t){return Ke().memoizedState=[e,t===void 0?null:t],e},useContext:Xe,useEffect:jf,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Xi(4194308,4,l0.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Xi(4194308,4,e,t)},useInsertionEffect:function(e,t){Xi(4,2,e,t)},useMemo:function(e,t){var l=Ke();t=t===void 0?null:t;var n=e();if(ln){yl(!0);try{e()}finally{yl(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Ke();if(l!==void 0){var a=l(t);if(ln){yl(!0);try{l(t)}finally{yl(!1)}}}else a=t;return n.memoizedState=n.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},n.queue=e,e=e.dispatch=Zg.bind(null,Z,e),[n.memoizedState,e]},useRef:function(e){var t=Ke();return e={current:e},t.memoizedState=e},useState:function(e){e=wu(e);var t=e.queue,l=d0.bind(null,Z,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ur,useDeferredValue:function(e,t){var l=Ke();return Br(l,e,t)},useTransition:function(){var e=wu(!1);return e=c0.bind(null,Z,e.queue,!0,!1),Ke().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=Z,a=Ke();if(te){if(l===void 0)throw Error(E(407));l=l()}else{if(l=t(),de===null)throw Error(E(349));P&127||Gh(n,t,l)}a.memoizedState=l;var i={value:l,getSnapshot:t};return a.queue=i,jf(Vh.bind(null,n,i,e),[e]),n.flags|=2048,Vn(9,{destroy:void 0},Xh.bind(null,n,i,l,t),null),l},useId:function(){var e=Ke(),t=de.identifierPrefix;if(te){var l=Ht,n=Lt;l=(n&~(1<<32-ht(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ds++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=qg++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Lr,useFormState:Sf,useActionState:Sf,useOptimistic:function(e){var t=Ke();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Hr.bind(null,Z,!0,l),l.dispatch=t,[e,t]},useMemoCache:Mr,useCacheRefresh:function(){return Ke().memoizedState=$g.bind(null,Z)},useEffectEvent:function(e){var t=Ke(),l={impl:e};return t.memoizedState=l,function(){if(ie&2)throw Error(E(440));return l.impl.apply(void 0,arguments)}}},kr={readContext:Xe,use:Ys,useCallback:a0,useContext:Xe,useEffect:Dr,useImperativeHandle:n0,useInsertionEffect:e0,useLayoutEffect:t0,useMemo:i0,useReducer:Gi,useRef:Ih,useState:function(){return Gi(il)},useDebugValue:Ur,useDeferredValue:function(e,t){var l=Te();return s0(l,fe.memoizedState,e,t)},useTransition:function(){var e=Gi(il)[0],t=Te().memoizedState;return[typeof e=="boolean"?e:ai(e),t]},useSyncExternalStore:Yh,useId:o0,useHostTransitionStatus:Lr,useFormState:zf,useActionState:zf,useOptimistic:function(e,t){var l=Te();return Zh(l,fe,e,t)},useMemoCache:Mr,useCacheRefresh:f0};kr.useEffectEvent=Ph;var p0={readContext:Xe,use:Ys,useCallback:a0,useContext:Xe,useEffect:Dr,useImperativeHandle:n0,useInsertionEffect:e0,useLayoutEffect:t0,useMemo:i0,useReducer:wc,useRef:Ih,useState:function(){return wc(il)},useDebugValue:Ur,useDeferredValue:function(e,t){var l=Te();return fe===null?Br(l,e,t):s0(l,fe.memoizedState,e,t)},useTransition:function(){var e=wc(il)[0],t=Te().memoizedState;return[typeof e=="boolean"?e:ai(e),t]},useSyncExternalStore:Yh,useId:o0,useHostTransitionStatus:Lr,useFormState:Nf,useActionState:Nf,useOptimistic:function(e,t){var l=Te();return fe!==null?Zh(l,fe,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Mr,useCacheRefresh:f0};p0.useEffectEvent=Ph;function Cc(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:ye({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Mu={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=mt(),a=El(n);a.payload=t,l!=null&&(a.callback=l),t=Tl(e,a,n),t!==null&&(lt(t,e,n),Ta(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=mt(),a=El(n);a.tag=1,a.payload=t,l!=null&&(a.callback=l),t=Tl(e,a,n),t!==null&&(lt(t,e,n),Ta(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=mt(),n=El(l);n.tag=2,t!=null&&(n.callback=t),t=Tl(e,n,l),t!==null&&(lt(t,e,l),Ta(t,e,l))}};function Ef(e,t,l,n,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,s):t.prototype&&t.prototype.isPureReactComponent?!Ha(l,n)||!Ha(a,i):!0}function Tf(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&Mu.enqueueReplaceState(t,t.state,null)}function nn(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=ye({},l));for(var a in e)l[a]===void 0&&(l[a]=e[a])}return l}function g0(e){as(e)}function y0(e){console.error(e)}function v0(e){as(e)}function hs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Rf(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Ou(e,t,l){return l=El(l),l.tag=3,l.payload={element:null},l.callback=function(){hs(e,t)},l}function b0(e){return e=El(e),e.tag=3,e}function S0(e,t,l,n){var a=l.type.getDerivedStateFromError;if(typeof a=="function"){var i=n.value;e.payload=function(){return a(i)},e.callback=function(){Rf(t,l,n)}}var s=l.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Rf(t,l,n),typeof a!="function"&&(Rl===null?Rl=new Set([this]):Rl.add(this));var u=n.stack;this.componentDidCatch(n.value,{componentStack:u!==null?u:""})})}function Kg(e,t,l,n,a){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Pn(t,l,a,!0),l=pt.current,l!==null){switch(l.tag){case 31:case 13:return Rt===null?ys():l.alternate===null&&ze===0&&(ze=3),l.flags&=-257,l.flags|=65536,l.lanes=a,n===us?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),Yc(e,n,a)),!1;case 22:return l.flags|=65536,n===us?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),Yc(e,n,a)),!1}throw Error(E(435,l.tag))}return Yc(e,n,a),ys(),!1}if(te)return t=pt.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,n!==bu&&(e=Error(E(422),{cause:n}),qa(Et(e,l)))):(n!==bu&&(t=Error(E(423),{cause:n}),qa(Et(t,l))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,n=Et(n,l),a=Ou(e.stateNode,n,a),Ac(e,a),ze!==4&&(ze=2)),!1;var i=Error(E(520),{cause:n});if(i=Et(i,l),Ma===null?Ma=[i]:Ma.push(i),ze!==4&&(ze=2),t===null)return!0;n=Et(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=a&-a,l.lanes|=e,e=Ou(l.stateNode,n,e),Ac(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Rl===null||!Rl.has(i))))return l.flags|=65536,a&=-a,l.lanes|=a,a=b0(a),S0(a,e,l,n),Ac(l,a),!1}l=l.return}while(l!==null);return!1}var qr=Error(E(461)),Ce=!1;function qe(e,t,l,n){t.child=e===null?Uh(t,null,l,n):tn(t,e.child,l,n)}function Af(e,t,l,n,a){l=l.render;var i=t.ref;if("ref"in n){var s={};for(var u in n)u!=="ref"&&(s[u]=n[u])}else s=n;return en(t),n=Ar(e,t,l,s,i,a),u=wr(),e!==null&&!Ce?(Cr(e,t,a),sl(e,t,a)):(te&&u&&br(t),t.flags|=1,qe(e,t,n,a),t.child)}function wf(e,t,l,n,a){if(e===null){var i=l.type;return typeof i=="function"&&!vr(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,z0(e,t,i,n,a)):(e=qi(l.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Yr(e,a)){var s=i.memoizedProps;if(l=l.compare,l=l!==null?l:Ha,l(s,n)&&e.ref===t.ref)return sl(e,t,a)}return t.flags|=1,e=el(i,n),e.ref=t.ref,e.return=t,t.child=e}function z0(e,t,l,n,a){if(e!==null){var i=e.memoizedProps;if(Ha(i,n)&&e.ref===t.ref)if(Ce=!1,t.pendingProps=n=i,Yr(e,a))e.flags&131072&&(Ce=!0);else return t.lanes=e.lanes,sl(e,t,a)}return Du(e,t,l,n,a)}function N0(e,t,l,n){var a=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|l:l,e!==null){for(n=t.child=e.child,a=0;n!==null;)a=a|n.lanes|n.childLanes,n=n.sibling;n=a&~i}else n=0,t.child=null;return Cf(e,t,i,l,n)}if(l&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yi(t,i!==null?i.cachePool:null),i!==null?yf(t,i):Ru(),Hh(t);else return n=t.lanes=536870912,Cf(e,t,i!==null?i.baseLanes|l:l,l,n)}else i!==null?(Yi(t,i.cachePool),yf(t,i),pl(),t.memoizedState=null):(e!==null&&Yi(t,null),Ru(),pl());return qe(e,t,a,l),t.child}function va(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cf(e,t,l,n,a){var i=Nr();return i=i===null?null:{parent:we._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&Yi(t,null),Ru(),Hh(t),e!==null&&Pn(e,t,n,!0),t.childLanes=a,null}function Vi(e,t){return t=ms({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _f(e,t,l){return tn(t,e.child,null,l),e=Vi(t,t.pendingProps),e.flags|=2,ut(t),t.memoizedState=null,e}function Jg(e,t,l){var n=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(te){if(n.mode==="hidden")return e=Vi(t,n),t.lanes=536870912,va(null,e);if(Au(t),(e=pe)?(e=xm(e,Tt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ml!==null?{id:Lt,overflow:Ht}:null,retryLane:536870912,hydrationErrors:null},l=Ah(e),l.return=t,t.child=l,Ge=t,pe=null)):e=null,e===null)throw Ol(t);return t.lanes=536870912,null}return Vi(t,n)}var i=e.memoizedState;if(i!==null){var s=i.dehydrated;if(Au(t),a)if(t.flags&256)t.flags&=-257,t=_f(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(E(558));else if(Ce||Pn(e,t,l,!1),a=(l&e.childLanes)!==0,Ce||a){if(n=de,n!==null&&(s=eh(n,l),s!==0&&s!==i.retryLane))throw i.retryLane=s,un(e,s),lt(n,e,s),qr;ys(),t=_f(e,t,l)}else e=i.treeContext,pe=At(s.nextSibling),Ge=t,te=!0,jl=null,Tt=!1,e!==null&&Ch(t,e),t=Vi(t,n),t.flags|=4096;return t}return e=el(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qi(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(E(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Du(e,t,l,n,a){return en(t),l=Ar(e,t,l,n,void 0,a),n=wr(),e!==null&&!Ce?(Cr(e,t,a),sl(e,t,a)):(te&&n&&br(t),t.flags|=1,qe(e,t,l,a),t.child)}function Mf(e,t,l,n,a,i){return en(t),t.updateQueue=null,l=qh(t,n,l,a),kh(e),n=wr(),e!==null&&!Ce?(Cr(e,t,i),sl(e,t,i)):(te&&n&&br(t),t.flags|=1,qe(e,t,l,i),t.child)}function Of(e,t,l,n,a){if(en(t),t.stateNode===null){var i=An,s=l.contextType;typeof s=="object"&&s!==null&&(i=Xe(s)),i=new l(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Mu,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Er(t),s=l.contextType,i.context=typeof s=="object"&&s!==null?Xe(s):An,i.state=t.memoizedState,s=l.getDerivedStateFromProps,typeof s=="function"&&(Cc(t,l,s,n),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(s=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),s!==i.state&&Mu.enqueueReplaceState(i,i.state,null),Aa(t,n,i,a),Ra(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var u=t.memoizedProps,r=nn(l,u);i.props=r;var o=i.context,f=l.contextType;s=An,typeof f=="object"&&f!==null&&(s=Xe(f));var m=l.getDerivedStateFromProps;f=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u||o!==s)&&Tf(t,i,n,s),hl=!1;var h=t.memoizedState;i.state=h,Aa(t,n,i,a),Ra(),o=t.memoizedState,u||h!==o||hl?(typeof m=="function"&&(Cc(t,l,m,n),o=t.memoizedState),(r=hl||Ef(t,l,r,n,h,o,s))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=o),i.props=n,i.state=o,i.context=s,n=r):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Eu(e,t),s=t.memoizedProps,f=nn(l,s),i.props=f,m=t.pendingProps,h=i.context,o=l.contextType,r=An,typeof o=="object"&&o!==null&&(r=Xe(o)),u=l.getDerivedStateFromProps,(o=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s!==m||h!==r)&&Tf(t,i,n,r),hl=!1,h=t.memoizedState,i.state=h,Aa(t,n,i,a),Ra();var g=t.memoizedState;s!==m||h!==g||hl||e!==null&&e.dependencies!==null&&cs(e.dependencies)?(typeof u=="function"&&(Cc(t,l,u,n),g=t.memoizedState),(f=hl||Ef(t,l,f,n,h,g,r)||e!==null&&e.dependencies!==null&&cs(e.dependencies))?(o||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,g,r),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,g,r)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),i.props=n,i.state=g,i.context=r,n=f):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Qi(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=tn(t,e.child,null,a),t.child=tn(t,null,l,a)):qe(e,t,l,a),t.memoizedState=i.state,e=t.child):e=sl(e,t,a),e}function Df(e,t,l,n){return Pl(),t.flags|=256,qe(e,t,l,n),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mc(e){return{baseLanes:e,cachePool:Mh()}}function Oc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=ot),e}function j0(e,t,l){var n=t.pendingProps,a=!1,i=(t.flags&128)!==0,s;if((s=i)||(s=e!==null&&e.memoizedState===null?!1:(Ee.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(te){if(a?xl(t):pl(),(e=pe)?(e=xm(e,Tt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ml!==null?{id:Lt,overflow:Ht}:null,retryLane:536870912,hydrationErrors:null},l=Ah(e),l.return=t,t.child=l,Ge=t,pe=null)):e=null,e===null)throw Ol(t);return Ku(e)?t.lanes=32:t.lanes=536870912,null}var u=n.children;return n=n.fallback,a?(pl(),a=t.mode,u=ms({mode:"hidden",children:u},a),n=Jl(n,a,l,null),u.return=t,n.return=t,u.sibling=n,t.child=u,n=t.child,n.memoizedState=Mc(l),n.childLanes=Oc(e,s,l),t.memoizedState=_c,va(null,n)):(xl(t),Uu(t,u))}var r=e.memoizedState;if(r!==null&&(u=r.dehydrated,u!==null)){if(i)t.flags&256?(xl(t),t.flags&=-257,t=Dc(e,t,l)):t.memoizedState!==null?(pl(),t.child=e.child,t.flags|=128,t=null):(pl(),u=n.fallback,a=t.mode,n=ms({mode:"visible",children:n.children},a),u=Jl(u,a,l,null),u.flags|=2,n.return=t,u.return=t,n.sibling=u,t.child=n,tn(t,e.child,null,l),n=t.child,n.memoizedState=Mc(l),n.childLanes=Oc(e,s,l),t.memoizedState=_c,t=va(null,n));else if(xl(t),Ku(u)){if(s=u.nextSibling&&u.nextSibling.dataset,s)var o=s.dgst;s=o,n=Error(E(419)),n.stack="",n.digest=s,qa({value:n,source:null,stack:null}),t=Dc(e,t,l)}else if(Ce||Pn(e,t,l,!1),s=(l&e.childLanes)!==0,Ce||s){if(s=de,s!==null&&(n=eh(s,l),n!==0&&n!==r.retryLane))throw r.retryLane=n,un(e,n),lt(s,e,n),qr;Zu(u)||ys(),t=Dc(e,t,l)}else Zu(u)?(t.flags|=192,t.child=e.child,t=null):(e=r.treeContext,pe=At(u.nextSibling),Ge=t,te=!0,jl=null,Tt=!1,e!==null&&Ch(t,e),t=Uu(t,n.children),t.flags|=4096);return t}return a?(pl(),u=n.fallback,a=t.mode,r=e.child,o=r.sibling,n=el(r,{mode:"hidden",children:n.children}),n.subtreeFlags=r.subtreeFlags&65011712,o!==null?u=el(o,u):(u=Jl(u,a,l,null),u.flags|=2),u.return=t,n.return=t,n.sibling=u,t.child=n,va(null,n),n=t.child,u=e.child.memoizedState,u===null?u=Mc(l):(a=u.cachePool,a!==null?(r=we._currentValue,a=a.parent!==r?{parent:r,pool:r}:a):a=Mh(),u={baseLanes:u.baseLanes|l,cachePool:a}),n.memoizedState=u,n.childLanes=Oc(e,s,l),t.memoizedState=_c,va(e.child,n)):(xl(t),l=e.child,e=l.sibling,l=el(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=l,t.memoizedState=null,l)}function Uu(e,t){return t=ms({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ms(e,t){return e=rt(22,e,null,t),e.lanes=0,e}function Dc(e,t,l){return tn(t,e.child,null,l),e=Uu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uf(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),zu(e.return,t,l)}function Uc(e,t,l,n,a,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:a,treeForkCount:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=l,s.tailMode=a,s.treeForkCount=i)}function E0(e,t,l){var n=t.pendingProps,a=n.revealOrder,i=n.tail;n=n.children;var s=Ee.current,u=(s&2)!==0;if(u?(s=s&1|2,t.flags|=128):s&=1,me(Ee,s),qe(e,t,n,l),n=te?ka:0,!u&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uf(e,l,t);else if(e.tag===19)Uf(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(l=t.child,a=null;l!==null;)e=l.alternate,e!==null&&os(e)===null&&(a=l),l=l.sibling;l=a,l===null?(a=t.child,t.child=null):(a=l.sibling,l.sibling=null),Uc(t,!1,a,l,i,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&os(e)===null){t.child=a;break}e=a.sibling,a.sibling=l,l=a,a=e}Uc(t,!0,l,null,i,n);break;case"together":Uc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function sl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,!(l&t.childLanes))if(e!==null){if(Pn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(E(153));if(t.child!==null){for(e=t.child,l=el(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=el(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Yr(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&cs(e)))}function Fg(e,t,l){switch(t.tag){case 3:es(t,t.stateNode.containerInfo),ml(t,we,e.memoizedState.cache),Pl();break;case 27:case 5:ru(t);break;case 4:es(t,t.stateNode.containerInfo);break;case 10:ml(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Au(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(xl(t),t.flags|=128,null):l&t.child.childLanes?j0(e,t,l):(xl(t),e=sl(e,t,l),e!==null?e.sibling:null);xl(t);break;case 19:var a=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Pn(e,t,l,!1),n=(l&t.childLanes)!==0),a){if(n)return E0(e,t,l);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),me(Ee,Ee.current),n)break;return null;case 22:return t.lanes=0,N0(e,t,l,t.pendingProps);case 24:ml(t,we,e.memoizedState.cache)}return sl(e,t,l)}function T0(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ce=!0;else{if(!Yr(e,l)&&!(t.flags&128))return Ce=!1,Fg(e,t,l);Ce=!!(e.flags&131072)}else Ce=!1,te&&t.flags&1048576&&wh(t,ka,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Ql(t.elementType),t.type=e,typeof e=="function")vr(e)?(n=nn(e,n),t.tag=1,t=Of(null,t,e,n,l)):(t.tag=0,t=Du(null,t,e,n,l));else{if(e!=null){var a=e.$$typeof;if(a===ir){t.tag=11,t=Af(null,t,e,n,l);break e}else if(a===sr){t.tag=14,t=wf(null,t,e,n,l);break e}}throw t=cu(e)||e,Error(E(306,t,""))}}return t;case 0:return Du(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,a=nn(n,t.pendingProps),Of(e,t,n,a,l);case 3:e:{if(es(t,t.stateNode.containerInfo),e===null)throw Error(E(387));n=t.pendingProps;var i=t.memoizedState;a=i.element,Eu(e,t),Aa(t,n,null,l);var s=t.memoizedState;if(n=s.cache,ml(t,we,n),n!==i.cache&&Nu(t,[we],l,!0),Ra(),n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Df(e,t,n,l);break e}else if(n!==a){a=Et(Error(E(424)),t),qa(a),t=Df(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(pe=At(e.firstChild),Ge=t,te=!0,jl=null,Tt=!0,l=Uh(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Pl(),n===a){t=sl(e,t,l);break e}qe(e,t,n,l)}t=t.child}return t;case 26:return Qi(e,t),e===null?(l=td(t.type,null,t.pendingProps,null))?t.memoizedState=l:te||(l=t.type,e=t.pendingProps,n=zs(Nl.current).createElement(l),n[Ye]=t,n[nt]=e,Ve(n,l,e),Be(n),t.stateNode=n):t.memoizedState=td(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ru(t),e===null&&te&&(n=t.stateNode=pm(t.type,t.pendingProps,Nl.current),Ge=t,Tt=!0,a=pe,Ll(t.type)?(Ju=a,pe=At(n.firstChild)):pe=a),qe(e,t,t.pendingProps.children,l),Qi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&te&&((a=n=pe)&&(n=Ty(n,t.type,t.pendingProps,Tt),n!==null?(t.stateNode=n,Ge=t,pe=At(n.firstChild),Tt=!1,a=!0):a=!1),a||Ol(t)),ru(t),a=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,n=i.children,Qu(a,i)?n=null:s!==null&&Qu(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ar(e,t,Yg,null,null,l),$a._currentValue=a),Qi(e,t),qe(e,t,n,l),t.child;case 6:return e===null&&te&&((e=l=pe)&&(l=Ry(l,t.pendingProps,Tt),l!==null?(t.stateNode=l,Ge=t,pe=null,e=!0):e=!1),e||Ol(t)),null;case 13:return j0(e,t,l);case 4:return es(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=tn(t,null,n,l):qe(e,t,n,l),t.child;case 11:return Af(e,t,t.type,t.pendingProps,l);case 7:return qe(e,t,t.pendingProps,l),t.child;case 8:return qe(e,t,t.pendingProps.children,l),t.child;case 12:return qe(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,ml(t,t.type,n.value),qe(e,t,n.children,l),t.child;case 9:return a=t.type._context,n=t.pendingProps.children,en(t),a=Xe(a),n=n(a),t.flags|=1,qe(e,t,n,l),t.child;case 14:return wf(e,t,t.type,t.pendingProps,l);case 15:return z0(e,t,t.type,t.pendingProps,l);case 19:return E0(e,t,l);case 31:return Jg(e,t,l);case 22:return N0(e,t,l,t.pendingProps);case 24:return en(t),n=Xe(we),e===null?(a=Nr(),a===null&&(a=de,i=zr(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=l),a=i),t.memoizedState={parent:n,cache:a},Er(t),ml(t,we,a)):(e.lanes&l&&(Eu(e,t),Aa(t,null,null,l),Ra()),a=e.memoizedState,i=t.memoizedState,a.parent!==n?(a={parent:n,cache:n},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ml(t,we,n)):(n=i.cache,ml(t,we,n),n!==a.cache&&Nu(t,[we],l,!0))),qe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(E(156,t.tag))}function Qt(e){e.flags|=4}function Bc(e,t,l,n,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(F0())e.flags|=8192;else throw Wl=us,jr}else e.flags&=-16777217}function Bf(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!vm(t))if(F0())e.flags|=8192;else throw Wl=us,jr}function Ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wd():536870912,e.lanes|=t,Qn|=t)}function da(e,t){if(!te)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags&65011712,n|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function Wg(e,t,l){var n=t.pendingProps;switch(Sr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xe(t),null;case 1:return xe(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),tl(we),kn(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(mn(t)?Qt(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rc())),xe(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Qt(t),i!==null?(xe(t),Bf(t,i)):(xe(t),Bc(t,a,null,n,l))):i?i!==e.memoizedState?(Qt(t),xe(t),Bf(t,i)):(xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Qt(t),xe(t),Bc(t,a,e,n,l)),null;case 27:if(ts(t),l=Nl.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Qt(t);else{if(!n){if(t.stateNode===null)throw Error(E(166));return xe(t),null}e=qt.current,mn(t)?ff(t):(e=pm(a,n,l),t.stateNode=e,Qt(t))}return xe(t),null;case 5:if(ts(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Qt(t);else{if(!n){if(t.stateNode===null)throw Error(E(166));return xe(t),null}if(i=qt.current,mn(t))ff(t);else{var s=zs(Nl.current);switch(i){case 1:i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=s.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?s.createElement("select",{is:n.is}):s.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?s.createElement(a,{is:n.is}):s.createElement(a)}}i[Ye]=t,i[nt]=n;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(Ve(i,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Qt(t)}}return xe(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Qt(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(E(166));if(e=Nl.current,mn(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,a=Ge,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}e[Ye]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||dm(e.nodeValue,l)),e||Ol(t,!0)}else e=zs(e).createTextNode(n),e[Ye]=t,t.stateNode=e}return xe(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=mn(t),l!==null){if(e===null){if(!n)throw Error(E(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(557));e[Ye]=t}else Pl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xe(t),e=!1}else l=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(ut(t),t):(ut(t),null);if(t.flags&128)throw Error(E(558))}return xe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=mn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(E(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(E(317));a[Ye]=t}else Pl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xe(t),a=!1}else a=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ut(t),t):(ut(t),null)}return ut(t),t.flags&128?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==a&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ri(t,t.updateQueue),xe(t),null);case 4:return kn(),e===null&&Kr(t.stateNode.containerInfo),xe(t),null;case 10:return tl(t.type),xe(t),null;case 19:if(Le(Ee),n=t.memoizedState,n===null)return xe(t),null;if(a=(t.flags&128)!==0,i=n.rendering,i===null)if(a)da(n,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=os(e),i!==null){for(t.flags|=128,da(n,!1),e=i.updateQueue,t.updateQueue=e,Ri(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Rh(l,e),l=l.sibling;return me(Ee,Ee.current&1|2),te&&Jt(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ft()>ps&&(t.flags|=128,a=!0,da(n,!1),t.lanes=4194304)}else{if(!a)if(e=os(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ri(t,e),da(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!te)return xe(t),null}else 2*ft()-n.renderingStartTime>ps&&l!==536870912&&(t.flags|=128,a=!0,da(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ft(),e.sibling=null,l=Ee.current,me(Ee,a?l&1|2:l&1),te&&Jt(t,n.treeForkCount),e):(xe(t),null);case 22:case 23:return ut(t),Tr(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?l&536870912&&!(t.flags&128)&&(xe(t),t.subtreeFlags&6&&(t.flags|=8192)):xe(t),l=t.updateQueue,l!==null&&Ri(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&Le(Fl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),tl(we),xe(t),null;case 25:return null;case 30:return null}throw Error(E(156,t.tag))}function Ig(e,t){switch(Sr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tl(we),kn(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ts(t),null;case 31:if(t.memoizedState!==null){if(ut(t),t.alternate===null)throw Error(E(340));Pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ut(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(Ee),null;case 4:return kn(),null;case 10:return tl(t.type),null;case 22:case 23:return ut(t),Tr(),e!==null&&Le(Fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return tl(we),null;case 25:return null;default:return null}}function R0(e,t){switch(Sr(t),t.tag){case 3:tl(we),kn();break;case 26:case 27:case 5:ts(t);break;case 4:kn();break;case 31:t.memoizedState!==null&&ut(t);break;case 13:ut(t);break;case 19:Le(Ee);break;case 10:tl(t.type);break;case 22:case 23:ut(t),Tr(),e!==null&&Le(Fl);break;case 24:tl(we)}}function ii(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&e)===e){n=void 0;var i=l.create,s=l.inst;n=i(),s.destroy=n}l=l.next}while(l!==a)}}catch(u){ue(t,t.return,u)}}function Dl(e,t,l){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){var s=n.inst,u=s.destroy;if(u!==void 0){s.destroy=void 0,a=t;var r=l,o=u;try{o()}catch(f){ue(a,r,f)}}}n=n.next}while(n!==i)}}catch(f){ue(t,t.return,f)}}function A0(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Lh(t,l)}catch(n){ue(e,e.return,n)}}}function w0(e,t,l){l.props=nn(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){ue(e,t,n)}}function Ca(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(a){ue(e,t,a)}}function kt(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){ue(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){ue(e,t,a)}else l.current=null}function C0(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){ue(e,e.return,a)}}function Lc(e,t,l){try{var n=e.stateNode;by(n,e.type,l,t),n[nt]=t}catch(a){ue(e,e.return,a)}}function _0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ll(e.type)||e.tag===4}function Hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ll(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Bu(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=It));else if(n!==4&&(n===27&&Ll(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Bu(e,t,l),e=e.sibling;e!==null;)Bu(e,t,l),e=e.sibling}function xs(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&Ll(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(xs(e,t,l),e=e.sibling;e!==null;)xs(e,t,l),e=e.sibling}function M0(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Ve(t,n,l),t[Ye]=e,t[nt]=l}catch(i){ue(e,e.return,i)}}var Ft=!1,Ae=!1,kc=!1,Lf=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function Pg(e,t){if(e=e.containerInfo,Xu=Ts,e=vh(e),pr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var s=0,u=-1,r=-1,o=0,f=0,m=e,h=null;t:for(;;){for(var g;m!==l||a!==0&&m.nodeType!==3||(u=s+a),m!==i||n!==0&&m.nodeType!==3||(r=s+n),m.nodeType===3&&(s+=m.nodeValue.length),(g=m.firstChild)!==null;)h=m,m=g;for(;;){if(m===e)break t;if(h===l&&++o===a&&(u=s),h===i&&++f===n&&(r=s),(g=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=g}l=u===-1||r===-1?null:{start:u,end:r}}else l=null}l=l||{start:0,end:0}}else l=null;for(Vu={focusedElem:e,selectionRange:l},Ts=!1,Ue=t;Ue!==null;)if(t=Ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ue=e;else for(;Ue!==null;){switch(t=Ue,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)a=e[l],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,l=t,a=i.memoizedProps,i=i.memoizedState,n=l.stateNode;try{var v=nn(l.type,a);e=n.getSnapshotBeforeUpdate(v,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(z){ue(l,l.return,z)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)$u(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":$u(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(E(163))}if(e=t.sibling,e!==null){e.return=t.return,Ue=e;break}Ue=t.return}}function O0(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Zt(e,l),n&4&&ii(5,l);break;case 1:if(Zt(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(s){ue(l,l.return,s)}else{var a=nn(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){ue(l,l.return,s)}}n&64&&A0(l),n&512&&Ca(l,l.return);break;case 3:if(Zt(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Lh(e,t)}catch(s){ue(l,l.return,s)}}break;case 27:t===null&&n&4&&M0(l);case 26:case 5:Zt(e,l),t===null&&n&4&&C0(l),n&512&&Ca(l,l.return);break;case 12:Zt(e,l);break;case 31:Zt(e,l),n&4&&B0(e,l);break;case 13:Zt(e,l),n&4&&L0(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=uy.bind(null,l),Ay(e,l))));break;case 22:if(n=l.memoizedState!==null||Ft,!n){t=t!==null&&t.memoizedState!==null||Ae,a=Ft;var i=Ae;Ft=n,(Ae=t)&&!i?Kt(e,l,(l.subtreeFlags&8772)!==0):Zt(e,l),Ft=a,Ae=i}break;case 30:break;default:Zt(e,l)}}function D0(e){var t=e.alternate;t!==null&&(e.alternate=null,D0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&or(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ve=null,et=!1;function $t(e,t,l){for(l=l.child;l!==null;)U0(e,t,l),l=l.sibling}function U0(e,t,l){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Ia,l)}catch{}switch(l.tag){case 26:Ae||kt(l,t),$t(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ae||kt(l,t);var n=ve,a=et;Ll(l.type)&&(ve=l.stateNode,et=!1),$t(e,t,l),Da(l.stateNode),ve=n,et=a;break;case 5:Ae||kt(l,t);case 6:if(n=ve,a=et,ve=null,$t(e,t,l),ve=n,et=a,ve!==null)if(et)try{(ve.nodeType===9?ve.body:ve.nodeName==="HTML"?ve.ownerDocument.body:ve).removeChild(l.stateNode)}catch(i){ue(l,t,i)}else try{ve.removeChild(l.stateNode)}catch(i){ue(l,t,i)}break;case 18:ve!==null&&(et?(e=ve,Ff(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Jn(e)):Ff(ve,l.stateNode));break;case 4:n=ve,a=et,ve=l.stateNode.containerInfo,et=!0,$t(e,t,l),ve=n,et=a;break;case 0:case 11:case 14:case 15:Dl(2,l,t),Ae||Dl(4,l,t),$t(e,t,l);break;case 1:Ae||(kt(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&w0(l,t,n)),$t(e,t,l);break;case 21:$t(e,t,l);break;case 22:Ae=(n=Ae)||l.memoizedState!==null,$t(e,t,l),Ae=n;break;default:$t(e,t,l)}}function B0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jn(e)}catch(l){ue(t,t.return,l)}}}function L0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jn(e)}catch(l){ue(t,t.return,l)}}function ey(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Lf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Lf),t;default:throw Error(E(435,e.tag))}}function Ai(e,t){var l=ey(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var a=ry.bind(null,e,n);n.then(a,a)}})}function Ie(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n],i=e,s=t,u=s;e:for(;u!==null;){switch(u.tag){case 27:if(Ll(u.type)){ve=u.stateNode,et=!1;break e}break;case 5:ve=u.stateNode,et=!1;break e;case 3:case 4:ve=u.stateNode.containerInfo,et=!0;break e}u=u.return}if(ve===null)throw Error(E(160));U0(i,s,a),ve=null,et=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)H0(t,e),t=t.sibling}var Ot=null;function H0(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ie(t,e),Pe(e),n&4&&(Dl(3,e,e.return),ii(3,e),Dl(5,e,e.return));break;case 1:Ie(t,e),Pe(e),n&512&&(Ae||l===null||kt(l,l.return)),n&64&&Ft&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var a=Ot;if(Ie(t,e),Pe(e),n&512&&(Ae||l===null||kt(l,l.return)),n&4){var i=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,a=a.ownerDocument||a;t:switch(n){case"title":i=a.getElementsByTagName("title")[0],(!i||i[ti]||i[Ye]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(n),a.head.insertBefore(i,a.querySelector("head > title"))),Ve(i,n,l),i[Ye]=e,Be(i),n=i;break e;case"link":var s=nd("link","href",a).get(n+(l.href||""));if(s){for(var u=0;u<s.length;u++)if(i=s[u],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){s.splice(u,1);break t}}i=a.createElement(n),Ve(i,n,l),a.head.appendChild(i);break;case"meta":if(s=nd("meta","content",a).get(n+(l.content||""))){for(u=0;u<s.length;u++)if(i=s[u],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){s.splice(u,1);break t}}i=a.createElement(n),Ve(i,n,l),a.head.appendChild(i);break;default:throw Error(E(468,n))}i[Ye]=e,Be(i),n=i}e.stateNode=n}else ad(a,e.type,e.stateNode);else e.stateNode=ld(a,n,e.memoizedProps);else i!==n?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,n===null?ad(a,e.type,e.stateNode):ld(a,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Lc(e,e.memoizedProps,l.memoizedProps)}break;case 27:Ie(t,e),Pe(e),n&512&&(Ae||l===null||kt(l,l.return)),l!==null&&n&4&&Lc(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Ie(t,e),Pe(e),n&512&&(Ae||l===null||kt(l,l.return)),e.flags&32){a=e.stateNode;try{Yn(a,"")}catch(v){ue(e,e.return,v)}}n&4&&e.stateNode!=null&&(a=e.memoizedProps,Lc(e,a,l!==null?l.memoizedProps:a)),n&1024&&(kc=!0);break;case 6:if(Ie(t,e),Pe(e),n&4){if(e.stateNode===null)throw Error(E(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(v){ue(e,e.return,v)}}break;case 3:if(Ki=null,a=Ot,Ot=Ns(t.containerInfo),Ie(t,e),Ot=a,Pe(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{Jn(t.containerInfo)}catch(v){ue(e,e.return,v)}kc&&(kc=!1,k0(e));break;case 4:n=Ot,Ot=Ns(e.stateNode.containerInfo),Ie(t,e),Pe(e),Ot=n;break;case 12:Ie(t,e),Pe(e);break;case 31:Ie(t,e),Pe(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ai(e,n)));break;case 13:Ie(t,e),Pe(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vs=ft()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ai(e,n)));break;case 22:a=e.memoizedState!==null;var r=l!==null&&l.memoizedState!==null,o=Ft,f=Ae;if(Ft=o||a,Ae=f||r,Ie(t,e),Ae=f,Ft=o,Pe(e),n&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(l===null||r||Ft||Ae||$l(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){r=l=t;try{if(i=r.stateNode,a)s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{u=r.stateNode;var m=r.memoizedProps.style,h=m!=null&&m.hasOwnProperty("display")?m.display:null;u.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(v){ue(r,r.return,v)}}}else if(t.tag===6){if(l===null){r=t;try{r.stateNode.nodeValue=a?"":r.memoizedProps}catch(v){ue(r,r.return,v)}}}else if(t.tag===18){if(l===null){r=t;try{var g=r.stateNode;a?Wf(g,!0):Wf(r.stateNode,!1)}catch(v){ue(r,r.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Ai(e,l))));break;case 19:Ie(t,e),Pe(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ai(e,n)));break;case 30:break;case 21:break;default:Ie(t,e),Pe(e)}}function Pe(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(_0(n)){l=n;break}n=n.return}if(l==null)throw Error(E(160));switch(l.tag){case 27:var a=l.stateNode,i=Hc(e);xs(e,i,a);break;case 5:var s=l.stateNode;l.flags&32&&(Yn(s,""),l.flags&=-33);var u=Hc(e);xs(e,u,s);break;case 3:case 4:var r=l.stateNode.containerInfo,o=Hc(e);Bu(e,o,r);break;default:throw Error(E(161))}}catch(f){ue(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function k0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;k0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Zt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)O0(e,t.alternate,t),t=t.sibling}function $l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Dl(4,t,t.return),$l(t);break;case 1:kt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&w0(t,t.return,l),$l(t);break;case 27:Da(t.stateNode);case 26:case 5:kt(t,t.return),$l(t);break;case 22:t.memoizedState===null&&$l(t);break;case 30:$l(t);break;default:$l(t)}e=e.sibling}}function Kt(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,a=e,i=t,s=i.flags;switch(i.tag){case 0:case 11:case 15:Kt(a,i,l),ii(4,i);break;case 1:if(Kt(a,i,l),n=i,a=n.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(o){ue(n,n.return,o)}if(n=i,a=n.updateQueue,a!==null){var u=n.stateNode;try{var r=a.shared.hiddenCallbacks;if(r!==null)for(a.shared.hiddenCallbacks=null,a=0;a<r.length;a++)Bh(r[a],u)}catch(o){ue(n,n.return,o)}}l&&s&64&&A0(i),Ca(i,i.return);break;case 27:M0(i);case 26:case 5:Kt(a,i,l),l&&n===null&&s&4&&C0(i),Ca(i,i.return);break;case 12:Kt(a,i,l);break;case 31:Kt(a,i,l),l&&s&4&&B0(a,i);break;case 13:Kt(a,i,l),l&&s&4&&L0(a,i);break;case 22:i.memoizedState===null&&Kt(a,i,l),Ca(i,i.return);break;case 30:break;default:Kt(a,i,l)}t=t.sibling}}function Gr(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&ni(l))}function Xr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ni(e))}function Mt(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)q0(e,t,l,n),t=t.sibling}function q0(e,t,l,n){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Mt(e,t,l,n),a&2048&&ii(9,t);break;case 1:Mt(e,t,l,n);break;case 3:Mt(e,t,l,n),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ni(e)));break;case 12:if(a&2048){Mt(e,t,l,n),e=t.stateNode;try{var i=t.memoizedProps,s=i.id,u=i.onPostCommit;typeof u=="function"&&u(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(r){ue(t,t.return,r)}}else Mt(e,t,l,n);break;case 31:Mt(e,t,l,n);break;case 13:Mt(e,t,l,n);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?i._visibility&2?Mt(e,t,l,n):_a(e,t):i._visibility&2?Mt(e,t,l,n):(i._visibility|=2,yn(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Gr(s,t);break;case 24:Mt(e,t,l,n),a&2048&&Xr(t.alternate,t);break;default:Mt(e,t,l,n)}}function yn(e,t,l,n,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,s=t,u=l,r=n,o=s.flags;switch(s.tag){case 0:case 11:case 15:yn(i,s,u,r,a),ii(8,s);break;case 23:break;case 22:var f=s.stateNode;s.memoizedState!==null?f._visibility&2?yn(i,s,u,r,a):_a(i,s):(f._visibility|=2,yn(i,s,u,r,a)),a&&o&2048&&Gr(s.alternate,s);break;case 24:yn(i,s,u,r,a),a&&o&2048&&Xr(s.alternate,s);break;default:yn(i,s,u,r,a)}t=t.sibling}}function _a(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,a=n.flags;switch(n.tag){case 22:_a(l,n),a&2048&&Gr(n.alternate,n);break;case 24:_a(l,n),a&2048&&Xr(n.alternate,n);break;default:_a(l,n)}t=t.sibling}}var ba=8192;function xn(e,t,l){if(e.subtreeFlags&ba)for(e=e.child;e!==null;)Y0(e,t,l),e=e.sibling}function Y0(e,t,l){switch(e.tag){case 26:xn(e,t,l),e.flags&ba&&e.memoizedState!==null&&qy(l,Ot,e.memoizedState,e.memoizedProps);break;case 5:xn(e,t,l);break;case 3:case 4:var n=Ot;Ot=Ns(e.stateNode.containerInfo),xn(e,t,l),Ot=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ba,ba=16777216,xn(e,t,l),ba=n):xn(e,t,l));break;default:xn(e,t,l)}}function G0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ha(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];Ue=n,V0(n,e)}G0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)X0(e),e=e.sibling}function X0(e){switch(e.tag){case 0:case 11:case 15:ha(e),e.flags&2048&&Dl(9,e,e.return);break;case 3:ha(e);break;case 12:ha(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$i(e)):ha(e);break;default:ha(e)}}function $i(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];Ue=n,V0(n,e)}G0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dl(8,t,t.return),$i(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,$i(t));break;default:$i(t)}e=e.sibling}}function V0(e,t){for(;Ue!==null;){var l=Ue;switch(l.tag){case 0:case 11:case 15:Dl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ni(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,Ue=n;else e:for(l=e;Ue!==null;){n=Ue;var a=n.sibling,i=n.return;if(D0(n),n===l){Ue=null;break e}if(a!==null){a.return=i,Ue=a;break e}Ue=i}}}var ty={getCacheForType:function(e){var t=Xe(we),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Xe(we).controller.signal}},ly=typeof WeakMap=="function"?WeakMap:Map,ie=0,de=null,J=null,P=0,ce=0,ct=null,bl=!1,ta=!1,Vr=!1,cl=0,ze=0,Ul=0,Il=0,Qr=0,ot=0,Qn=0,Ma=null,tt=null,Lu=!1,Vs=0,Q0=0,ps=1/0,gs=null,Rl=null,Me=0,Al=null,$n=null,ll=0,Hu=0,ku=null,$0=null,Oa=0,qu=null;function mt(){return ie&2&&P!==0?P&-P:X.T!==null?Zr():th()}function Z0(){if(ot===0)if(!(P&536870912)||te){var e=bi;bi<<=1,!(bi&3932160)&&(bi=262144),ot=e}else ot=536870912;return e=pt.current,e!==null&&(e.flags|=32),ot}function lt(e,t,l){(e===de&&(ce===2||ce===9)||e.cancelPendingCommit!==null)&&(Zn(e,0),Sl(e,P,ot,!1)),ei(e,l),(!(ie&2)||e!==de)&&(e===de&&(!(ie&2)&&(Il|=l),ze===4&&Sl(e,P,ot,!1)),Xt(e))}function K0(e,t,l){if(ie&6)throw Error(E(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Pa(e,t),a=n?iy(e,t):qc(e,t,!0),i=n;do{if(a===0){ta&&!n&&Sl(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!ny(l)){a=qc(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var u=e;a=Ma;var r=u.current.memoizedState.isDehydrated;if(r&&(Zn(u,s).flags|=256),s=qc(u,s,!1),s!==2){if(Vr&&!r){u.errorRecoveryDisabledLanes|=i,Il|=i,a=4;break e}i=tt,tt=a,i!==null&&(tt===null?tt=i:tt.push.apply(tt,i))}a=s}if(i=!1,a!==2)continue}}if(a===1){Zn(e,0),Sl(e,t,0,!0);break}e:{switch(n=e,i=a,i){case 0:case 1:throw Error(E(345));case 4:if((t&4194048)!==t)break;case 6:Sl(n,t,ot,!bl);break e;case 2:tt=null;break;case 3:case 5:break;default:throw Error(E(329))}if((t&62914560)===t&&(a=Vs+300-ft(),10<a)){if(Sl(n,t,ot,!bl),Os(n,0,!0)!==0)break e;ll=t,n.timeoutHandle=mm(Hf.bind(null,n,l,tt,gs,Lu,t,ot,Il,Qn,bl,i,"Throttled",-0,0),a);break e}Hf(n,l,tt,gs,Lu,t,ot,Il,Qn,bl,i,null,-0,0)}}break}while(!0);Xt(e)}function Hf(e,t,l,n,a,i,s,u,r,o,f,m,h,g){if(e.timeoutHandle=-1,m=t.subtreeFlags,m&8192||(m&16785408)===16785408){m={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:It},Y0(t,i,m);var v=(i&62914560)===i?Vs-ft():(i&4194048)===i?Q0-ft():0;if(v=Yy(m,v),v!==null){ll=i,e.cancelPendingCommit=v(qf.bind(null,e,t,i,l,n,a,s,u,r,f,m,null,h,g)),Sl(e,i,s,!o);return}}qf(e,t,i,l,n,a,s,u,r)}function ny(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var a=l[n],i=a.getSnapshot;a=a.value;try{if(!xt(i(),a))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Sl(e,t,l,n){t&=~Qr,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var a=t;0<a;){var i=31-ht(a),s=1<<i;n[i]=-1,a&=~s}l!==0&&Id(e,l,t)}function Qs(){return ie&6?!0:(si(0),!1)}function $r(){if(J!==null){if(ce===0)var e=J.return;else e=J,Pt=rn=null,_r(e),Bn=null,Ya=0,e=J;for(;e!==null;)R0(e.alternate,e),e=e.return;J=null}}function Zn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Ny(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ll=0,$r(),de=e,J=l=el(e.current,null),P=t,ce=0,ct=null,bl=!1,ta=Pa(e,t),Vr=!1,Qn=ot=Qr=Il=Ul=ze=0,tt=Ma=null,Lu=!1,t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-ht(n),i=1<<a;t|=e[a],n&=~i}return cl=t,Ls(),l}function J0(e,t){Z=null,X.H=Xa,t===ea||t===ks?(t=pf(),ce=3):t===jr?(t=pf(),ce=4):ce=t===qr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ct=t,J===null&&(ze=1,hs(e,Et(t,e.current)))}function F0(){var e=pt.current;return e===null?!0:(P&4194048)===P?Rt===null:(P&62914560)===P||P&536870912?e===Rt:!1}function W0(){var e=X.H;return X.H=Xa,e===null?Xa:e}function I0(){var e=X.A;return X.A=ty,e}function ys(){ze=4,bl||(P&4194048)!==P&&pt.current!==null||(ta=!0),!(Ul&134217727)&&!(Il&134217727)||de===null||Sl(de,P,ot,!1)}function qc(e,t,l){var n=ie;ie|=2;var a=W0(),i=I0();(de!==e||P!==t)&&(gs=null,Zn(e,t)),t=!1;var s=ze;e:do try{if(ce!==0&&J!==null){var u=J,r=ct;switch(ce){case 8:$r(),s=6;break e;case 3:case 2:case 9:case 6:pt.current===null&&(t=!0);var o=ce;if(ce=0,ct=null,_n(e,u,r,o),l&&ta){s=0;break e}break;default:o=ce,ce=0,ct=null,_n(e,u,r,o)}}ay(),s=ze;break}catch(f){J0(e,f)}while(!0);return t&&e.shellSuspendCounter++,Pt=rn=null,ie=n,X.H=a,X.A=i,J===null&&(de=null,P=0,Ls()),s}function ay(){for(;J!==null;)P0(J)}function iy(e,t){var l=ie;ie|=2;var n=W0(),a=I0();de!==e||P!==t?(gs=null,ps=ft()+500,Zn(e,t)):ta=Pa(e,t);e:do try{if(ce!==0&&J!==null){t=J;var i=ct;t:switch(ce){case 1:ce=0,ct=null,_n(e,t,i,1);break;case 2:case 9:if(xf(i)){ce=0,ct=null,kf(t);break}t=function(){ce!==2&&ce!==9||de!==e||(ce=7),Xt(e)},i.then(t,t);break e;case 3:ce=7;break e;case 4:ce=5;break e;case 7:xf(i)?(ce=0,ct=null,kf(t)):(ce=0,ct=null,_n(e,t,i,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var u=J;if(s?vm(s):u.stateNode.complete){ce=0,ct=null;var r=u.sibling;if(r!==null)J=r;else{var o=u.return;o!==null?(J=o,$s(o)):J=null}break t}}ce=0,ct=null,_n(e,t,i,5);break;case 6:ce=0,ct=null,_n(e,t,i,6);break;case 8:$r(),ze=6;break e;default:throw Error(E(462))}}sy();break}catch(f){J0(e,f)}while(!0);return Pt=rn=null,X.H=n,X.A=a,ie=l,J!==null?0:(de=null,P=0,Ls(),ze)}function sy(){for(;J!==null&&!wp();)P0(J)}function P0(e){var t=T0(e.alternate,e,cl);e.memoizedProps=e.pendingProps,t===null?$s(e):J=t}function kf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Mf(l,t,t.pendingProps,t.type,void 0,P);break;case 11:t=Mf(l,t,t.pendingProps,t.type.render,t.ref,P);break;case 5:_r(t);default:R0(l,t),t=J=Rh(t,cl),t=T0(l,t,cl)}e.memoizedProps=e.pendingProps,t===null?$s(e):J=t}function _n(e,t,l,n){Pt=rn=null,_r(t),Bn=null,Ya=0;var a=t.return;try{if(Kg(e,a,t,l,P)){ze=1,hs(e,Et(l,e.current)),J=null;return}}catch(i){if(a!==null)throw J=a,i;ze=1,hs(e,Et(l,e.current)),J=null;return}t.flags&32768?(te||n===1?e=!0:ta||P&536870912?e=!1:(bl=e=!0,(n===2||n===9||n===3||n===6)&&(n=pt.current,n!==null&&n.tag===13&&(n.flags|=16384))),em(t,e)):$s(t)}function $s(e){var t=e;do{if(t.flags&32768){em(t,bl);return}e=t.return;var l=Wg(t.alternate,t,cl);if(l!==null){J=l;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);ze===0&&(ze=5)}function em(e,t){do{var l=Ig(e.alternate,e);if(l!==null){l.flags&=32767,J=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=l}while(e!==null);ze=6,J=null}function qf(e,t,l,n,a,i,s,u,r){e.cancelPendingCommit=null;do Zs();while(Me!==0);if(ie&6)throw Error(E(327));if(t!==null){if(t===e.current)throw Error(E(177));if(i=t.lanes|t.childLanes,i|=gr,kp(e,l,i,s,u,r),e===de&&(J=de=null,P=0),$n=t,Al=e,ll=l,Hu=i,ku=a,$0=n,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,oy(ls,function(){return im(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,t.subtreeFlags&13878||n){n=X.T,X.T=null,a=se.p,se.p=2,s=ie,ie|=4;try{Pg(e,t,l)}finally{ie=s,se.p=a,X.T=n}}Me=1,tm(),lm(),nm()}}function tm(){if(Me===1){Me=0;var e=Al,t=$n,l=(t.flags&13878)!==0;if(t.subtreeFlags&13878||l){l=X.T,X.T=null;var n=se.p;se.p=2;var a=ie;ie|=4;try{H0(t,e);var i=Vu,s=vh(e.containerInfo),u=i.focusedElem,r=i.selectionRange;if(s!==u&&u&&u.ownerDocument&&yh(u.ownerDocument.documentElement,u)){if(r!==null&&pr(u)){var o=r.start,f=r.end;if(f===void 0&&(f=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(f,u.value.length);else{var m=u.ownerDocument||document,h=m&&m.defaultView||window;if(h.getSelection){var g=h.getSelection(),v=u.textContent.length,z=Math.min(r.start,v),b=r.end===void 0?z:Math.min(r.end,v);!g.extend&&z>b&&(s=b,b=z,z=s);var x=uf(u,z),d=uf(u,b);if(x&&d&&(g.rangeCount!==1||g.anchorNode!==x.node||g.anchorOffset!==x.offset||g.focusNode!==d.node||g.focusOffset!==d.offset)){var y=m.createRange();y.setStart(x.node,x.offset),g.removeAllRanges(),z>b?(g.addRange(y),g.extend(d.node,d.offset)):(y.setEnd(d.node,d.offset),g.addRange(y))}}}}for(m=[],g=u;g=g.parentNode;)g.nodeType===1&&m.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<m.length;u++){var S=m[u];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Ts=!!Xu,Vu=Xu=null}finally{ie=a,se.p=n,X.T=l}}e.current=t,Me=2}}function lm(){if(Me===2){Me=0;var e=Al,t=$n,l=(t.flags&8772)!==0;if(t.subtreeFlags&8772||l){l=X.T,X.T=null;var n=se.p;se.p=2;var a=ie;ie|=4;try{O0(e,t.alternate,t)}finally{ie=a,se.p=n,X.T=l}}Me=3}}function nm(){if(Me===4||Me===3){Me=0,Cp();var e=Al,t=$n,l=ll,n=$0;t.subtreeFlags&10256||t.flags&10256?Me=5:(Me=0,$n=Al=null,am(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Rl=null),rr(l),t=t.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Ia,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=X.T,a=se.p,se.p=2,X.T=null;try{for(var i=e.onRecoverableError,s=0;s<n.length;s++){var u=n[s];i(u.value,{componentStack:u.stack})}}finally{X.T=t,se.p=a}}ll&3&&Zs(),Xt(e),a=e.pendingLanes,l&261930&&a&42?e===qu?Oa++:(Oa=0,qu=e):Oa=0,si(0)}}function am(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ni(t)))}function Zs(){return tm(),lm(),nm(),im()}function im(){if(Me!==5)return!1;var e=Al,t=Hu;Hu=0;var l=rr(ll),n=X.T,a=se.p;try{se.p=32>l?32:l,X.T=null,l=ku,ku=null;var i=Al,s=ll;if(Me=0,$n=Al=null,ll=0,ie&6)throw Error(E(331));var u=ie;if(ie|=4,X0(i.current),q0(i,i.current,s,l),ie=u,si(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Ia,i)}catch{}return!0}finally{se.p=a,X.T=n,am(e,t)}}function Yf(e,t,l){t=Et(l,t),t=Ou(e.stateNode,t,2),e=Tl(e,t,2),e!==null&&(ei(e,2),Xt(e))}function ue(e,t,l){if(e.tag===3)Yf(e,e,l);else for(;t!==null;){if(t.tag===3){Yf(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Rl===null||!Rl.has(n))){e=Et(l,e),l=b0(2),n=Tl(t,l,2),n!==null&&(S0(l,n,t,e),ei(n,2),Xt(n));break}}t=t.return}}function Yc(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new ly;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(l)||(Vr=!0,a.add(l),e=cy.bind(null,e,t,l),t.then(e,e))}function cy(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,de===e&&(P&l)===l&&(ze===4||ze===3&&(P&62914560)===P&&300>ft()-Vs?!(ie&2)&&Zn(e,0):Qr|=l,Qn===P&&(Qn=0)),Xt(e)}function sm(e,t){t===0&&(t=Wd()),e=un(e,t),e!==null&&(ei(e,t),Xt(e))}function uy(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),sm(e,l)}function ry(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(E(314))}n!==null&&n.delete(t),sm(e,l)}function oy(e,t){return cr(e,t)}var vs=null,vn=null,Yu=!1,bs=!1,Gc=!1,zl=0;function Xt(e){e!==vn&&e.next===null&&(vn===null?vs=vn=e:vn=vn.next=e),bs=!0,Yu||(Yu=!0,dy())}function si(e,t){if(!Gc&&bs){Gc=!0;do for(var l=!1,n=vs;n!==null;){if(e!==0){var a=n.pendingLanes;if(a===0)var i=0;else{var s=n.suspendedLanes,u=n.pingedLanes;i=(1<<31-ht(42|e)+1)-1,i&=a&~(s&~u),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,Gf(n,i))}else i=P,i=Os(n,n===de?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(i&3)||Pa(n,i)||(l=!0,Gf(n,i));n=n.next}while(l);Gc=!1}}function fy(){cm()}function cm(){bs=Yu=!1;var e=0;zl!==0&&zy()&&(e=zl);for(var t=ft(),l=null,n=vs;n!==null;){var a=n.next,i=um(n,t);i===0?(n.next=null,l===null?vs=a:l.next=a,a===null&&(vn=l)):(l=n,(e!==0||i&3)&&(bs=!0)),n=a}Me!==0&&Me!==5||si(e),zl!==0&&(zl=0)}function um(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var s=31-ht(i),u=1<<s,r=a[s];r===-1?(!(u&l)||u&n)&&(a[s]=Hp(u,t)):r<=t&&(e.expiredLanes|=u),i&=~u}if(t=de,l=P,l=Os(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(ce===2||ce===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&pc(n),e.callbackNode=null,e.callbackPriority=0;if(!(l&3)||Pa(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&pc(n),rr(l)){case 2:case 8:l=Jd;break;case 32:l=ls;break;case 268435456:l=Fd;break;default:l=ls}return n=rm.bind(null,e),l=cr(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&pc(n),e.callbackPriority=2,e.callbackNode=null,2}function rm(e,t){if(Me!==0&&Me!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Zs()&&e.callbackNode!==l)return null;var n=P;return n=Os(e,e===de?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(K0(e,n,t),um(e,ft()),e.callbackNode!=null&&e.callbackNode===l?rm.bind(null,e):null)}function Gf(e,t){if(Zs())return null;K0(e,t,!0)}function dy(){jy(function(){ie&6?cr(Kd,fy):cm()})}function Zr(){if(zl===0){var e=Gn;e===0&&(e=vi,vi<<=1,!(vi&261888)&&(vi=256)),zl=e}return zl}function Xf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Li(""+e)}function Vf(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function hy(e,t,l,n,a){if(t==="submit"&&l&&l.stateNode===a){var i=Xf((a[nt]||null).action),s=n.submitter;s&&(t=(t=s[nt]||null)?Xf(t.formAction):s.getAttribute("formAction"),t!==null&&(i=t,s=null));var u=new Ds("action","action",null,n,a);e.push({event:u,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(zl!==0){var r=s?Vf(a,s):new FormData(a);_u(l,{pending:!0,data:r,method:a.method,action:i},null,r)}}else typeof i=="function"&&(u.preventDefault(),r=s?Vf(a,s):new FormData(a),_u(l,{pending:!0,data:r,method:a.method,action:i},i,r))},currentTarget:a}]})}}for(var Xc=0;Xc<vu.length;Xc++){var Vc=vu[Xc],my=Vc.toLowerCase(),xy=Vc[0].toUpperCase()+Vc.slice(1);Ut(my,"on"+xy)}Ut(Sh,"onAnimationEnd");Ut(zh,"onAnimationIteration");Ut(Nh,"onAnimationStart");Ut("dblclick","onDoubleClick");Ut("focusin","onFocus");Ut("focusout","onBlur");Ut(_g,"onTransitionRun");Ut(Mg,"onTransitionStart");Ut(Og,"onTransitionCancel");Ut(jh,"onTransitionEnd");qn("onMouseEnter",["mouseout","mouseover"]);qn("onMouseLeave",["mouseout","mouseover"]);qn("onPointerEnter",["pointerout","pointerover"]);qn("onPointerLeave",["pointerout","pointerover"]);an("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));an("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));an("onBeforeInput",["compositionend","keypress","textInput","paste"]);an("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));an("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));an("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Va="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(" "),py=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Va));function om(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var u=n[s],r=u.instance,o=u.currentTarget;if(u=u.listener,r!==i&&a.isPropagationStopped())break e;i=u,a.currentTarget=o;try{i(a)}catch(f){as(f)}a.currentTarget=null,i=r}else for(s=0;s<n.length;s++){if(u=n[s],r=u.instance,o=u.currentTarget,u=u.listener,r!==i&&a.isPropagationStopped())break e;i=u,a.currentTarget=o;try{i(a)}catch(f){as(f)}a.currentTarget=null,i=r}}}}function K(e,t){var l=t[fu];l===void 0&&(l=t[fu]=new Set);var n=e+"__bubble";l.has(n)||(fm(t,e,2,!1),l.add(n))}function Qc(e,t,l){var n=0;t&&(n|=4),fm(l,e,n,t)}var wi="_reactListening"+Math.random().toString(36).slice(2);function Kr(e){if(!e[wi]){e[wi]=!0,lh.forEach(function(l){l!=="selectionchange"&&(py.has(l)||Qc(l,!1,e),Qc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wi]||(t[wi]=!0,Qc("selectionchange",!1,t))}}function fm(e,t,l,n){switch(jm(t)){case 2:var a=Vy;break;case 8:a=Qy;break;default:a=Ir}l=a.bind(null,t,l,e),a=void 0,!pu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,l,{capture:!0,passive:a}):e.addEventListener(t,l,!0):a!==void 0?e.addEventListener(t,l,{passive:a}):e.addEventListener(t,l,!1)}function $c(e,t,l,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var u=n.stateNode.containerInfo;if(u===a)break;if(s===4)for(s=n.return;s!==null;){var r=s.tag;if((r===3||r===4)&&s.stateNode.containerInfo===a)return;s=s.return}for(;u!==null;){if(s=zn(u),s===null)return;if(r=s.tag,r===5||r===6||r===26||r===27){n=i=s;continue e}u=u.parentNode}}n=n.return}oh(function(){var o=i,f=dr(l),m=[];e:{var h=Eh.get(e);if(h!==void 0){var g=Ds,v=e;switch(e){case"keypress":if(ki(l)===0)break e;case"keydown":case"keyup":g=rg;break;case"focusin":v="focus",g=Sc;break;case"focusout":v="blur",g=Sc;break;case"beforeblur":case"afterblur":g=Sc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Wp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=dg;break;case Sh:case zh:case Nh:g=eg;break;case jh:g=mg;break;case"scroll":case"scrollend":g=Jp;break;case"wheel":g=pg;break;case"copy":case"cut":case"paste":g=lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Po;break;case"toggle":case"beforetoggle":g=yg}var z=(t&4)!==0,b=!z&&(e==="scroll"||e==="scrollend"),x=z?h!==null?h+"Capture":null:h;z=[];for(var d=o,y;d!==null;){var S=d;if(y=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||y===null||x===null||(S=Ba(d,x),S!=null&&z.push(Qa(d,S,y))),b)break;d=d.return}0<z.length&&(h=new g(h,v,null,l,f),m.push({event:h,listeners:z}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",h&&l!==xu&&(v=l.relatedTarget||l.fromElement)&&(zn(v)||v[Wn]))break e;if((g||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,g?(v=l.relatedTarget||l.toElement,g=o,v=v?zn(v):null,v!==null&&(b=Wa(v),z=v.tag,v!==b||z!==5&&z!==27&&z!==6)&&(v=null)):(g=null,v=o),g!==v)){if(z=Wo,S="onMouseLeave",x="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(z=Po,S="onPointerLeave",x="onPointerEnter",d="pointer"),b=g==null?h:ya(g),y=v==null?h:ya(v),h=new z(S,d+"leave",g,l,f),h.target=b,h.relatedTarget=y,S=null,zn(f)===o&&(z=new z(x,d+"enter",v,l,f),z.target=y,z.relatedTarget=b,S=z),b=S,g&&v)t:{for(z=gy,x=g,d=v,y=0,S=x;S;S=z(S))y++;S=0;for(var j=d;j;j=z(j))S++;for(;0<y-S;)x=z(x),y--;for(;0<S-y;)d=z(d),S--;for(;y--;){if(x===d||d!==null&&x===d.alternate){z=x;break t}x=z(x),d=z(d)}z=null}else z=null;g!==null&&Qf(m,h,g,z,!1),v!==null&&b!==null&&Qf(m,b,v,z,!0)}}e:{if(h=o?ya(o):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var M=nf;else if(lf(h))if(ph)M=Ag;else{M=Tg;var R=Eg}else g=h.nodeName,!g||g.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?o&&fr(o.elementType)&&(M=nf):M=Rg;if(M&&(M=M(e,o))){xh(m,M,l,f);break e}R&&R(e,h,o),e==="focusout"&&o&&h.type==="number"&&o.memoizedProps.value!=null&&mu(h,"number",h.value)}switch(R=o?ya(o):window,e){case"focusin":(lf(R)||R.contentEditable==="true")&&(En=R,gu=o,ja=null);break;case"focusout":ja=gu=En=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,rf(m,l,f);break;case"selectionchange":if(Cg)break;case"keydown":case"keyup":rf(m,l,f)}var C;if(xr)e:{switch(e){case"compositionstart":var U="onCompositionStart";break e;case"compositionend":U="onCompositionEnd";break e;case"compositionupdate":U="onCompositionUpdate";break e}U=void 0}else jn?hh(e,l)&&(U="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(U="onCompositionStart");U&&(dh&&l.locale!=="ko"&&(jn||U!=="onCompositionStart"?U==="onCompositionEnd"&&jn&&(C=fh()):(vl=f,hr="value"in vl?vl.value:vl.textContent,jn=!0)),R=Ss(o,U),0<R.length&&(U=new Io(U,e,null,l,f),m.push({event:U,listeners:R}),C?U.data=C:(C=mh(l),C!==null&&(U.data=C)))),(C=bg?Sg(e,l):zg(e,l))&&(U=Ss(o,"onBeforeInput"),0<U.length&&(R=new Io("onBeforeInput","beforeinput",null,l,f),m.push({event:R,listeners:U}),R.data=C)),hy(m,e,o,l,f)}om(m,t)})}function Qa(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Ss(e,t){for(var l=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=Ba(e,l),a!=null&&n.unshift(Qa(e,a,i)),a=Ba(e,t),a!=null&&n.push(Qa(e,a,i))),e.tag===3)return n;e=e.return}return[]}function gy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qf(e,t,l,n,a){for(var i=t._reactName,s=[];l!==null&&l!==n;){var u=l,r=u.alternate,o=u.stateNode;if(u=u.tag,r!==null&&r===n)break;u!==5&&u!==26&&u!==27||o===null||(r=o,a?(o=Ba(l,i),o!=null&&s.unshift(Qa(l,o,r))):a||(o=Ba(l,i),o!=null&&s.push(Qa(l,o,r)))),l=l.return}s.length!==0&&e.push({event:t,listeners:s})}var yy=/\r\n?/g,vy=/\u0000|\uFFFD/g;function $f(e){return(typeof e=="string"?e:""+e).replace(yy,`
49
- `).replace(vy,"")}function dm(e,t){return t=$f(t),$f(e)===t}function oe(e,t,l,n,a,i){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Yn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Yn(e,""+n);break;case"className":zi(e,"class",n);break;case"tabIndex":zi(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":zi(e,l,n);break;case"style":rh(e,n,i);break;case"data":if(t!=="object"){zi(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=Li(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(l==="formAction"?(t!=="input"&&oe(e,t,"name",a.name,a,null),oe(e,t,"formEncType",a.formEncType,a,null),oe(e,t,"formMethod",a.formMethod,a,null),oe(e,t,"formTarget",a.formTarget,a,null)):(oe(e,t,"encType",a.encType,a,null),oe(e,t,"method",a.method,a,null),oe(e,t,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=Li(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=It);break;case"onScroll":n!=null&&K("scroll",e);break;case"onScrollEnd":n!=null&&K("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(E(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(E(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=Li(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":K("beforetoggle",e),K("toggle",e),Bi(e,"popover",n);break;case"xlinkActuate":Vt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Vt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Vt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Vt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Vt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Vt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Bi(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Zp.get(l)||l,Bi(e,l,n))}}function Gu(e,t,l,n,a,i){switch(l){case"style":rh(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(E(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(E(60));e.innerHTML=l}}break;case"children":typeof n=="string"?Yn(e,n):(typeof n=="number"||typeof n=="bigint")&&Yn(e,""+n);break;case"onScroll":n!=null&&K("scroll",e);break;case"onScrollEnd":n!=null&&K("scrollend",e);break;case"onClick":n!=null&&(e.onclick=It);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nh.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(a=l.endsWith("Capture"),t=l.slice(2,a?l.length-7:void 0),i=e[nt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof n=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,a);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):Bi(e,l,n)}}}function Ve(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":K("error",e),K("load",e);var n=!1,a=!1,i;for(i in l)if(l.hasOwnProperty(i)){var s=l[i];if(s!=null)switch(i){case"src":n=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(E(137,t));default:oe(e,t,i,s,l,null)}}a&&oe(e,t,"srcSet",l.srcSet,l,null),n&&oe(e,t,"src",l.src,l,null);return;case"input":K("invalid",e);var u=i=s=a=null,r=null,o=null;for(n in l)if(l.hasOwnProperty(n)){var f=l[n];if(f!=null)switch(n){case"name":a=f;break;case"type":s=f;break;case"checked":r=f;break;case"defaultChecked":o=f;break;case"value":i=f;break;case"defaultValue":u=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(E(137,t));break;default:oe(e,t,n,f,l,null)}}sh(e,i,u,r,o,s,a,!1);return;case"select":K("invalid",e),n=s=i=null;for(a in l)if(l.hasOwnProperty(a)&&(u=l[a],u!=null))switch(a){case"value":i=u;break;case"defaultValue":s=u;break;case"multiple":n=u;default:oe(e,t,a,u,l,null)}t=i,l=s,e.multiple=!!n,t!=null?On(e,!!n,t,!1):l!=null&&On(e,!!n,l,!0);return;case"textarea":K("invalid",e),i=a=n=null;for(s in l)if(l.hasOwnProperty(s)&&(u=l[s],u!=null))switch(s){case"value":n=u;break;case"defaultValue":a=u;break;case"children":i=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(E(91));break;default:oe(e,t,s,u,l,null)}uh(e,n,a,i);return;case"option":for(r in l)if(l.hasOwnProperty(r)&&(n=l[r],n!=null))switch(r){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:oe(e,t,r,n,l,null)}return;case"dialog":K("beforetoggle",e),K("toggle",e),K("cancel",e),K("close",e);break;case"iframe":case"object":K("load",e);break;case"video":case"audio":for(n=0;n<Va.length;n++)K(Va[n],e);break;case"image":K("error",e),K("load",e);break;case"details":K("toggle",e);break;case"embed":case"source":case"link":K("error",e),K("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(o in l)if(l.hasOwnProperty(o)&&(n=l[o],n!=null))switch(o){case"children":case"dangerouslySetInnerHTML":throw Error(E(137,t));default:oe(e,t,o,n,l,null)}return;default:if(fr(t)){for(f in l)l.hasOwnProperty(f)&&(n=l[f],n!==void 0&&Gu(e,t,f,n,l,void 0));return}}for(u in l)l.hasOwnProperty(u)&&(n=l[u],n!=null&&oe(e,t,u,n,l,null))}function by(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,s=null,u=null,r=null,o=null,f=null;for(g in l){var m=l[g];if(l.hasOwnProperty(g)&&m!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":r=m;default:n.hasOwnProperty(g)||oe(e,t,g,null,n,m)}}for(var h in n){var g=n[h];if(m=l[h],n.hasOwnProperty(h)&&(g!=null||m!=null))switch(h){case"type":i=g;break;case"name":a=g;break;case"checked":o=g;break;case"defaultChecked":f=g;break;case"value":s=g;break;case"defaultValue":u=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(E(137,t));break;default:g!==m&&oe(e,t,h,g,n,m)}}hu(e,s,u,r,o,f,i,a);return;case"select":g=s=u=h=null;for(i in l)if(r=l[i],l.hasOwnProperty(i)&&r!=null)switch(i){case"value":break;case"multiple":g=r;default:n.hasOwnProperty(i)||oe(e,t,i,null,n,r)}for(a in n)if(i=n[a],r=l[a],n.hasOwnProperty(a)&&(i!=null||r!=null))switch(a){case"value":h=i;break;case"defaultValue":u=i;break;case"multiple":s=i;default:i!==r&&oe(e,t,a,i,n,r)}t=u,l=s,n=g,h!=null?On(e,!!l,h,!1):!!n!=!!l&&(t!=null?On(e,!!l,t,!0):On(e,!!l,l?[]:"",!1));return;case"textarea":g=h=null;for(u in l)if(a=l[u],l.hasOwnProperty(u)&&a!=null&&!n.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:oe(e,t,u,null,n,a)}for(s in n)if(a=n[s],i=l[s],n.hasOwnProperty(s)&&(a!=null||i!=null))switch(s){case"value":h=a;break;case"defaultValue":g=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(E(91));break;default:a!==i&&oe(e,t,s,a,n,i)}ch(e,h,g);return;case"option":for(var v in l)if(h=l[v],l.hasOwnProperty(v)&&h!=null&&!n.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:oe(e,t,v,null,n,h)}for(r in n)if(h=n[r],g=l[r],n.hasOwnProperty(r)&&h!==g&&(h!=null||g!=null))switch(r){case"selected":e.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:oe(e,t,r,h,n,g)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var z in l)h=l[z],l.hasOwnProperty(z)&&h!=null&&!n.hasOwnProperty(z)&&oe(e,t,z,null,n,h);for(o in n)if(h=n[o],g=l[o],n.hasOwnProperty(o)&&h!==g&&(h!=null||g!=null))switch(o){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(E(137,t));break;default:oe(e,t,o,h,n,g)}return;default:if(fr(t)){for(var b in l)h=l[b],l.hasOwnProperty(b)&&h!==void 0&&!n.hasOwnProperty(b)&&Gu(e,t,b,void 0,n,h);for(f in n)h=n[f],g=l[f],!n.hasOwnProperty(f)||h===g||h===void 0&&g===void 0||Gu(e,t,f,h,n,g);return}}for(var x in l)h=l[x],l.hasOwnProperty(x)&&h!=null&&!n.hasOwnProperty(x)&&oe(e,t,x,null,n,h);for(m in n)h=n[m],g=l[m],!n.hasOwnProperty(m)||h===g||h==null&&g==null||oe(e,t,m,h,n,g)}function Zf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var a=l[n],i=a.transferSize,s=a.initiatorType,u=a.duration;if(i&&u&&Zf(s)){for(s=0,u=a.responseEnd,n+=1;n<l.length;n++){var r=l[n],o=r.startTime;if(o>u)break;var f=r.transferSize,m=r.initiatorType;f&&Zf(m)&&(r=r.responseEnd,s+=f*(r<u?1:(u-o)/(r-o)))}if(--n,t+=8*(i+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Xu=null,Vu=null;function zs(e){return e.nodeType===9?e:e.ownerDocument}function Kf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Qu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zc=null;function zy(){var e=window.event;return e&&e.type==="popstate"?e===Zc?!1:(Zc=e,!0):(Zc=null,!1)}var mm=typeof setTimeout=="function"?setTimeout:void 0,Ny=typeof clearTimeout=="function"?clearTimeout:void 0,Jf=typeof Promise=="function"?Promise:void 0,jy=typeof queueMicrotask=="function"?queueMicrotask:typeof Jf<"u"?function(e){return Jf.resolve(null).then(e).catch(Ey)}:mm;function Ey(e){setTimeout(function(){throw e})}function Ll(e){return e==="head"}function Ff(e,t){var l=t,n=0;do{var a=l.nextSibling;if(e.removeChild(l),a&&a.nodeType===8)if(l=a.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(a),Jn(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Da(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Da(l);for(var i=l.firstChild;i;){var s=i.nextSibling,u=i.nodeName;i[ti]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=s}}else l==="body"&&Da(e.ownerDocument.body);l=a}while(l);Jn(t)}function Wf(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function $u(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":$u(l),or(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Ty(e,t,l,n){for(;e.nodeType===1;){var a=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ti])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=At(e.nextSibling),e===null)break}return null}function Ry(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=At(e.nextSibling),e===null))return null;return e}function xm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=At(e.nextSibling),e===null))return null;return e}function Zu(e){return e.data==="$?"||e.data==="$~"}function Ku(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ay(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function At(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ju=null;function If(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return At(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function pm(e,t,l){switch(t=zs(l),e){case"html":if(e=t.documentElement,!e)throw Error(E(452));return e;case"head":if(e=t.head,!e)throw Error(E(453));return e;case"body":if(e=t.body,!e)throw Error(E(454));return e;default:throw Error(E(451))}}function Da(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);or(e)}var wt=new Map,ed=new Set;function Ns(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rl=se.d;se.d={f:wy,r:Cy,D:_y,C:My,L:Oy,m:Dy,X:By,S:Uy,M:Ly};function wy(){var e=rl.f(),t=Qs();return e||t}function Cy(e){var t=In(e);t!==null&&t.tag===5&&t.type==="form"?r0(t):rl.r(e)}var la=typeof document>"u"?null:document;function gm(e,t,l){var n=la;if(n&&typeof t=="string"&&t){var a=jt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),ed.has(a)||(ed.add(a),e={rel:e,crossOrigin:l,href:t},n.querySelector(a)===null&&(t=n.createElement("link"),Ve(t,"link",e),Be(t),n.head.appendChild(t)))}}function _y(e){rl.D(e),gm("dns-prefetch",e,null)}function My(e,t){rl.C(e,t),gm("preconnect",e,t)}function Oy(e,t,l){rl.L(e,t,l);var n=la;if(n&&e&&t){var a='link[rel="preload"][as="'+jt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+jt(l.imageSizes)+'"]')):a+='[href="'+jt(e)+'"]';var i=a;switch(t){case"style":i=Kn(e);break;case"script":i=na(e)}wt.has(i)||(e=ye({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),wt.set(i,e),n.querySelector(a)!==null||t==="style"&&n.querySelector(ci(i))||t==="script"&&n.querySelector(ui(i))||(t=n.createElement("link"),Ve(t,"link",e),Be(t),n.head.appendChild(t)))}}function Dy(e,t){rl.m(e,t);var l=la;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+jt(n)+'"][href="'+jt(e)+'"]',i=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=na(e)}if(!wt.has(i)&&(e=ye({rel:"modulepreload",href:e},t),wt.set(i,e),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ui(i)))return}n=l.createElement("link"),Ve(n,"link",e),Be(n),l.head.appendChild(n)}}}function Uy(e,t,l){rl.S(e,t,l);var n=la;if(n&&e){var a=Mn(n).hoistableStyles,i=Kn(e);t=t||"default";var s=a.get(i);if(!s){var u={loading:0,preload:null};if(s=n.querySelector(ci(i)))u.loading=5;else{e=ye({rel:"stylesheet",href:e,"data-precedence":t},l),(l=wt.get(i))&&Jr(e,l);var r=s=n.createElement("link");Be(r),Ve(r,"link",e),r._p=new Promise(function(o,f){r.onload=o,r.onerror=f}),r.addEventListener("load",function(){u.loading|=1}),r.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Zi(s,t,n)}s={type:"stylesheet",instance:s,count:1,state:u},a.set(i,s)}}}function By(e,t){rl.X(e,t);var l=la;if(l&&e){var n=Mn(l).hoistableScripts,a=na(e),i=n.get(a);i||(i=l.querySelector(ui(a)),i||(e=ye({src:e,async:!0},t),(t=wt.get(a))&&Fr(e,t),i=l.createElement("script"),Be(i),Ve(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(a,i))}}function Ly(e,t){rl.M(e,t);var l=la;if(l&&e){var n=Mn(l).hoistableScripts,a=na(e),i=n.get(a);i||(i=l.querySelector(ui(a)),i||(e=ye({src:e,async:!0,type:"module"},t),(t=wt.get(a))&&Fr(e,t),i=l.createElement("script"),Be(i),Ve(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(a,i))}}function td(e,t,l,n){var a=(a=Nl.current)?Ns(a):null;if(!a)throw Error(E(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Kn(l.href),l=Mn(a).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Kn(l.href);var i=Mn(a).hoistableStyles,s=i.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=a.querySelector(ci(e)))&&!i._p&&(s.instance=i,s.state.loading=5),wt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},wt.set(e,l),i||Hy(a,e,l,s.state))),t&&n===null)throw Error(E(528,""));return s}if(t&&n!==null)throw Error(E(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=na(l),l=Mn(a).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(E(444,e))}}function Kn(e){return'href="'+jt(e)+'"'}function ci(e){return'link[rel="stylesheet"]['+e+"]"}function ym(e){return ye({},e,{"data-precedence":e.precedence,precedence:null})}function Hy(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Ve(t,"link",l),Be(t),e.head.appendChild(t))}function na(e){return'[src="'+jt(e)+'"]'}function ui(e){return"script[async]"+e}function ld(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+jt(l.href)+'"]');if(n)return t.instance=n,Be(n),n;var a=ye({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Be(n),Ve(n,"style",a),Zi(n,l.precedence,e),t.instance=n;case"stylesheet":a=Kn(l.href);var i=e.querySelector(ci(a));if(i)return t.state.loading|=4,t.instance=i,Be(i),i;n=ym(l),(a=wt.get(a))&&Jr(n,a),i=(e.ownerDocument||e).createElement("link"),Be(i);var s=i;return s._p=new Promise(function(u,r){s.onload=u,s.onerror=r}),Ve(i,"link",n),t.state.loading|=4,Zi(i,l.precedence,e),t.instance=i;case"script":return i=na(l.src),(a=e.querySelector(ui(i)))?(t.instance=a,Be(a),a):(n=l,(a=wt.get(i))&&(n=ye({},l),Fr(n,a)),e=e.ownerDocument||e,a=e.createElement("script"),Be(a),Ve(a,"link",n),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(E(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(n=t.instance,t.state.loading|=4,Zi(n,l.precedence,e));return t.instance}function Zi(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,i=a,s=0;s<n.length;s++){var u=n[s];if(u.dataset.precedence===t)i=u;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Jr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Fr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ki=null;function nd(e,t,l){if(Ki===null){var n=new Map,a=Ki=new Map;a.set(l,n)}else a=Ki,n=a.get(l),n||(n=new Map,a.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),a=0;a<l.length;a++){var i=l[a];if(!(i[ti]||i[Ye]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var s=i.getAttribute(t)||"";s=e+s;var u=n.get(s);u?u.push(i):n.set(s,[i])}}return n}function ad(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function ky(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vm(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function qy(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(l.state.loading&4)){if(l.instance===null){var a=Kn(n.href),i=t.querySelector(ci(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=js.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Be(i);return}i=t.ownerDocument||t,n=ym(n),(a=wt.get(a))&&Jr(n,a),i=i.createElement("link"),Be(i);var s=i;s._p=new Promise(function(u,r){s.onload=u,s.onerror=r}),Ve(i,"link",n),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&!(l.state.loading&3)&&(e.count++,l=js.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Kc=0;function Yy(e,t){return e.stylesheets&&e.count===0&&Ji(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&Ji(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Kc===0&&(Kc=62500*Sy());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ji(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Kc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function js(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ji(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Es=null;function Ji(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Es=new Map,t.forEach(Gy,e),Es=null,js.call(e))}function Gy(e,t){if(!(t.state.loading&4)){var l=Es.get(e);if(l)var n=l.get(null);else{l=new Map,Es.set(e,l);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var s=a[i];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(l.set(s.dataset.precedence,s),n=s)}n&&l.set(null,n)}a=t.instance,s=a.getAttribute("data-precedence"),i=l.get(s)||n,i===n&&l.set(null,a),l.set(s,a),this.count++,n=js.bind(this),a.addEventListener("load",n),a.addEventListener("error",n),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var $a={$$typeof:Wt,Provider:null,Consumer:null,_currentValue:Kl,_currentValue2:Kl,_threadCount:0};function Xy(e,t,l,n,a,i,s,u,r){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gc(0),this.hiddenUpdates=gc(null),this.identifierPrefix=n,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function bm(e,t,l,n,a,i,s,u,r,o,f,m){return e=new Xy(e,t,l,s,r,o,f,m,u),t=1,i===!0&&(t|=24),i=rt(3,null,null,t),e.current=i,i.stateNode=e,t=zr(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:l,cache:t},Er(i),e}function Sm(e){return e?(e=An,e):An}function zm(e,t,l,n,a,i){a=Sm(a),n.context===null?n.context=a:n.pendingContext=a,n=El(t),n.payload={element:l},i=i===void 0?null:i,i!==null&&(n.callback=i),l=Tl(e,n,t),l!==null&&(lt(l,e,t),Ta(l,e,t))}function id(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Wr(e,t){id(e,t),(e=e.alternate)&&id(e,t)}function Nm(e){if(e.tag===13||e.tag===31){var t=un(e,67108864);t!==null&&lt(t,e,67108864),Wr(e,67108864)}}function sd(e){if(e.tag===13||e.tag===31){var t=mt();t=ur(t);var l=un(e,t);l!==null&&lt(l,e,t),Wr(e,t)}}var Ts=!0;function Vy(e,t,l,n){var a=X.T;X.T=null;var i=se.p;try{se.p=2,Ir(e,t,l,n)}finally{se.p=i,X.T=a}}function Qy(e,t,l,n){var a=X.T;X.T=null;var i=se.p;try{se.p=8,Ir(e,t,l,n)}finally{se.p=i,X.T=a}}function Ir(e,t,l,n){if(Ts){var a=Fu(n);if(a===null)$c(e,t,n,Rs,l),cd(e,n);else if(Zy(a,e,t,l,n))n.stopPropagation();else if(cd(e,n),t&4&&-1<$y.indexOf(e)){for(;a!==null;){var i=In(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=Vl(i.pendingLanes);if(s!==0){var u=i;for(u.pendingLanes|=2,u.entangledLanes|=2;s;){var r=1<<31-ht(s);u.entanglements[1]|=r,s&=~r}Xt(i),!(ie&6)&&(ps=ft()+500,si(0))}}break;case 31:case 13:u=un(i,2),u!==null&&lt(u,i,2),Qs(),Wr(i,2)}if(i=Fu(n),i===null&&$c(e,t,n,Rs,l),i===a)break;a=i}a!==null&&n.stopPropagation()}else $c(e,t,n,null,l)}}function Fu(e){return e=dr(e),Pr(e)}var Rs=null;function Pr(e){if(Rs=null,e=zn(e),e!==null){var t=Wa(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=Xd(t),e!==null)return e;e=null}else if(l===31){if(e=Vd(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rs=e,null}function jm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(_p()){case Kd:return 2;case Jd:return 8;case ls:case Mp:return 32;case Fd:return 268435456;default:return 32}default:return 32}}var Wu=!1,wl=null,Cl=null,_l=null,Za=new Map,Ka=new Map,gl=[],$y="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function cd(e,t){switch(e){case"focusin":case"focusout":wl=null;break;case"dragenter":case"dragleave":Cl=null;break;case"mouseover":case"mouseout":_l=null;break;case"pointerover":case"pointerout":Za.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ka.delete(t.pointerId)}}function ma(e,t,l,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=In(t),t!==null&&Nm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Zy(e,t,l,n,a){switch(t){case"focusin":return wl=ma(wl,e,t,l,n,a),!0;case"dragenter":return Cl=ma(Cl,e,t,l,n,a),!0;case"mouseover":return _l=ma(_l,e,t,l,n,a),!0;case"pointerover":var i=a.pointerId;return Za.set(i,ma(Za.get(i)||null,e,t,l,n,a)),!0;case"gotpointercapture":return i=a.pointerId,Ka.set(i,ma(Ka.get(i)||null,e,t,l,n,a)),!0}return!1}function Em(e){var t=zn(e.target);if(t!==null){var l=Wa(t);if(l!==null){if(t=l.tag,t===13){if(t=Xd(l),t!==null){e.blockedOn=t,Vo(e.priority,function(){sd(l)});return}}else if(t===31){if(t=Vd(l),t!==null){e.blockedOn=t,Vo(e.priority,function(){sd(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Fu(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);xu=n,l.target.dispatchEvent(n),xu=null}else return t=In(l),t!==null&&Nm(t),e.blockedOn=l,!1;t.shift()}return!0}function ud(e,t,l){Fi(e)&&l.delete(t)}function Ky(){Wu=!1,wl!==null&&Fi(wl)&&(wl=null),Cl!==null&&Fi(Cl)&&(Cl=null),_l!==null&&Fi(_l)&&(_l=null),Za.forEach(ud),Ka.forEach(ud)}function Ci(e,t){e.blockedOn===t&&(e.blockedOn=null,Wu||(Wu=!0,De.unstable_scheduleCallback(De.unstable_NormalPriority,Ky)))}var _i=null;function rd(e){_i!==e&&(_i=e,De.unstable_scheduleCallback(De.unstable_NormalPriority,function(){_i===e&&(_i=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],a=e[t+2];if(typeof n!="function"){if(Pr(n||l)===null)continue;break}var i=In(l);i!==null&&(e.splice(t,3),t-=3,_u(i,{pending:!0,data:a,method:l.method,action:n},n,a))}}))}function Jn(e){function t(r){return Ci(r,e)}wl!==null&&Ci(wl,e),Cl!==null&&Ci(Cl,e),_l!==null&&Ci(_l,e),Za.forEach(t),Ka.forEach(t);for(var l=0;l<gl.length;l++){var n=gl[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<gl.length&&(l=gl[0],l.blockedOn===null);)Em(l),l.blockedOn===null&&gl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var a=l[n],i=l[n+1],s=a[nt]||null;if(typeof i=="function")s||rd(l);else if(s){var u=null;if(i&&i.hasAttribute("formAction")){if(a=i,s=i[nt]||null)u=s.formAction;else if(Pr(a)!==null)continue}else u=s.action;typeof u=="function"?l[n+1]=u:(l.splice(n,3),n-=3),rd(l)}}}function Tm(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function eo(e){this._internalRoot=e}Ks.prototype.render=eo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(E(409));var l=t.current,n=mt();zm(l,n,e,t,null,null)};Ks.prototype.unmount=eo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zm(e.current,2,null,e,null,null),Qs(),t[Wn]=null}};function Ks(e){this._internalRoot=e}Ks.prototype.unstable_scheduleHydration=function(e){if(e){var t=th();e={blockedOn:null,target:e,priority:t};for(var l=0;l<gl.length&&t!==0&&t<gl[l].priority;l++);gl.splice(l,0,e),l===0&&Em(e)}};var od=Yd.version;if(od!=="19.2.5")throw Error(E(527,od,"19.2.5"));se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(E(188)):(e=Object.keys(e).join(","),Error(E(268,e)));return e=jp(t),e=e!==null?Qd(e):null,e=e===null?null:e.stateNode,e};var Jy={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mi.isDisabled&&Mi.supportsFiber)try{Ia=Mi.inject(Jy),dt=Mi}catch{}}_s.createRoot=function(e,t){if(!Gd(e))throw Error(E(299));var l=!1,n="",a=g0,i=y0,s=v0;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=bm(e,1,!1,null,null,l,n,null,a,i,s,Tm),e[Wn]=t.current,Kr(e),new eo(t)};_s.hydrateRoot=function(e,t,l){if(!Gd(e))throw Error(E(299));var n=!1,a="",i=g0,s=y0,u=v0,r=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(a=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(s=l.onCaughtError),l.onRecoverableError!==void 0&&(u=l.onRecoverableError),l.formState!==void 0&&(r=l.formState)),t=bm(e,1,!0,t,l??null,n,a,r,i,s,u,Tm),t.context=Sm(null),l=t.current,n=mt(),n=ur(n),a=El(n),a.callback=null,Tl(l,a,n),l=n,t.current.lanes=l,ei(t,l),Xt(t),e[Wn]=t.current,Kr(e),new Ks(t)};_s.version="19.2.5";function Rm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rm)}catch(e){console.error(e)}}Rm(),Ud.exports=_s;var Fy=Ud.exports;/**
50
- * react-router v7.14.1
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var fd="popstate";function dd(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Wy(e={}){function t(n,a){var o;let i=(o=a.state)==null?void 0:o.masked,{pathname:s,search:u,hash:r}=i||n.location;return Iu("",{pathname:s,search:u,hash:r},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function l(n,a){return typeof a=="string"?a:Ja(a)}return Py(t,l,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Yt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Iy(){return Math.random().toString(36).substring(2,10)}function hd(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Iu(e,t,l=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ri(t):t,state:l,key:t&&t.key||n||Iy(),unstable_mask:a}}function Ja({pathname:e="/",search:t="",hash:l=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),l&&l!=="#"&&(e+=l.charAt(0)==="#"?l:"#"+l),e}function ri(e){let t={};if(e){let l=e.indexOf("#");l>=0&&(t.hash=e.substring(l),e=e.substring(0,l));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Py(e,t,l,n={}){let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,u="POP",r=null,o=f();o==null&&(o=0,s.replaceState({...s.state,idx:o},""));function f(){return(s.state||{idx:null}).idx}function m(){u="POP";let b=f(),x=b==null?null:b-o;o=b,r&&r({action:u,location:z.location,delta:x})}function h(b,x){u="PUSH";let d=dd(b)?b:Iu(z.location,b,x);o=f()+1;let y=hd(d,o),S=z.createHref(d.unstable_mask||d);try{s.pushState(y,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&r&&r({action:u,location:z.location,delta:1})}function g(b,x){u="REPLACE";let d=dd(b)?b:Iu(z.location,b,x);o=f();let y=hd(d,o),S=z.createHref(d.unstable_mask||d);s.replaceState(y,"",S),i&&r&&r({action:u,location:z.location,delta:0})}function v(b){return ev(b)}let z={get action(){return u},get location(){return e(a,s)},listen(b){if(r)throw new Error("A history only accepts one active listener");return a.addEventListener(fd,m),r=b,()=>{a.removeEventListener(fd,m),r=null}},createHref(b){return t(a,b)},createURL:v,encodeLocation(b){let x=v(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:g,go(b){return s.go(b)}};return z}function ev(e,t=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),Oe(l,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Ja(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=l+n),new URL(n,l)}function Am(e,t,l="/"){return tv(e,t,l,!1)}function tv(e,t,l,n){let a=typeof t=="string"?ri(t):t,i=ul(a.pathname||"/",l);if(i==null)return null;let s=wm(e);lv(s);let u=null;for(let r=0;u==null&&r<s.length;++r){let o=hv(i);u=fv(s[r],o,n)}return u}function wm(e,t=[],l=[],n="",a=!1){let i=(s,u,r=a,o)=>{let f={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:u,route:s};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(n)&&r)return;Oe(f.relativePath.startsWith(n),`Absolute route path "${f.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(n.length)}let m=Dt([n,f.relativePath]),h=l.concat(f);s.children&&s.children.length>0&&(Oe(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),wm(s.children,t,h,m,r)),!(s.path==null&&!s.index)&&t.push({path:m,score:rv(m,s.index),routesMeta:h})};return e.forEach((s,u)=>{var r;if(s.path===""||!((r=s.path)!=null&&r.includes("?")))i(s,u);else for(let o of Cm(s.path))i(s,u,!0,o)}),t}function Cm(e){let t=e.split("/");if(t.length===0)return[];let[l,...n]=t,a=l.endsWith("?"),i=l.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=Cm(n.join("/")),u=[];return u.push(...s.map(r=>r===""?i:[i,r].join("/"))),a&&u.push(...s),u.map(r=>e.startsWith("/")&&r===""?"/":r)}function lv(e){e.sort((t,l)=>t.score!==l.score?l.score-t.score:ov(t.routesMeta.map(n=>n.childrenIndex),l.routesMeta.map(n=>n.childrenIndex)))}var nv=/^:[\w-]+$/,av=3,iv=2,sv=1,cv=10,uv=-2,md=e=>e==="*";function rv(e,t){let l=e.split("/"),n=l.length;return l.some(md)&&(n+=uv),t&&(n+=iv),l.filter(a=>!md(a)).reduce((a,i)=>a+(nv.test(i)?av:i===""?sv:cv),n)}function ov(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function fv(e,t,l=!1){let{routesMeta:n}=e,a={},i="/",s=[];for(let u=0;u<n.length;++u){let r=n[u],o=u===n.length-1,f=i==="/"?t:t.slice(i.length)||"/",m=As({path:r.relativePath,caseSensitive:r.caseSensitive,end:o},f),h=r.route;if(!m&&o&&l&&!n[n.length-1].route.index&&(m=As({path:r.relativePath,caseSensitive:r.caseSensitive,end:!1},f)),!m)return null;Object.assign(a,m.params),s.push({params:a,pathname:Dt([i,m.pathname]),pathnameBase:gv(Dt([i,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(i=Dt([i,m.pathnameBase]))}return s}function As(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[l,n]=dv(e.path,e.caseSensitive,e.end),a=t.match(l);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:n.reduce((o,{paramName:f,isOptional:m},h)=>{if(f==="*"){let v=u[h]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=u[h];return m&&!g?o[f]=void 0:o[f]=(g||"").replace(/%2F/g,"/"),o},{}),pathname:i,pathnameBase:s,pattern:e}}function dv(e,t=!1,l=!0){Yt(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,u,r,o,f)=>{if(n.push({paramName:u,isOptional:r!=null}),r){let m=f.charAt(o+s.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function hv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Yt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ul(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let l=t.endsWith("/")?t.length-1:t.length,n=e.charAt(l);return n&&n!=="/"?null:e.slice(l)||"/"}var mv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function xv(e,t="/"){let{pathname:l,search:n="",hash:a=""}=typeof e=="string"?ri(e):e,i;return l?(l=Mm(l),l.startsWith("/")?i=xd(l.substring(1),"/"):i=xd(l,t)):i=t,{pathname:i,search:yv(n),hash:vv(a)}}function xd(e,t){let l=ws(t).split("/");return e.split("/").forEach(a=>{a===".."?l.length>1&&l.pop():a!=="."&&l.push(a)}),l.length>1?l.join("/"):"/"}function Jc(e,t,l,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pv(e){return e.filter((t,l)=>l===0||t.route.path&&t.route.path.length>0)}function _m(e){let t=pv(e);return t.map((l,n)=>n===t.length-1?l.pathname:l.pathnameBase)}function to(e,t,l,n=!1){let a;typeof e=="string"?a=ri(e):(a={...e},Oe(!a.pathname||!a.pathname.includes("?"),Jc("?","pathname","search",a)),Oe(!a.pathname||!a.pathname.includes("#"),Jc("#","pathname","hash",a)),Oe(!a.search||!a.search.includes("#"),Jc("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,u;if(s==null)u=l;else{let m=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),m-=1;a.pathname=h.join("/")}u=m>=0?t[m]:"/"}let r=xv(a,u),o=s&&s!=="/"&&s.endsWith("/"),f=(i||s===".")&&l.endsWith("/");return!r.pathname.endsWith("/")&&(o||f)&&(r.pathname+="/"),r}var Mm=e=>e.replace(/\/\/+/g,"/"),Dt=e=>Mm(e.join("/")),ws=e=>e.replace(/\/+$/,""),gv=e=>ws(e).replace(/^\/*/,"/"),yv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,bv=class{constructor(e,t,l,n=!1){this.status=e,this.statusText=t||"",this.internal=n,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Sv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zv(e){let t=e.map(l=>l.route.path).filter(Boolean);return Dt(t)||"/"}var Om=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Dm(e,t){let l=e;if(typeof l!="string"||!mv.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let n=l,a=!1;if(Om)try{let i=new URL(window.location.href),s=l.startsWith("//")?new URL(i.protocol+l):new URL(l),u=ul(s.pathname,t);s.origin===i.origin&&u!=null?l=u+s.search+s.hash:a=!0}catch{Yt(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Um=["POST","PUT","PATCH","DELETE"];new Set(Um);var Nv=["GET",...Um];new Set(Nv);var aa=p.createContext(null);aa.displayName="DataRouter";var Js=p.createContext(null);Js.displayName="DataRouterState";var Bm=p.createContext(!1);function jv(){return p.useContext(Bm)}var Lm=p.createContext({isTransitioning:!1});Lm.displayName="ViewTransition";var Ev=p.createContext(new Map);Ev.displayName="Fetchers";var Tv=p.createContext(null);Tv.displayName="Await";var Ct=p.createContext(null);Ct.displayName="Navigation";var Fs=p.createContext(null);Fs.displayName="Location";var ol=p.createContext({outlet:null,matches:[],isDataRoute:!1});ol.displayName="Route";var lo=p.createContext(null);lo.displayName="RouteError";var Hm="REACT_ROUTER_ERROR",Rv="REDIRECT",Av="ROUTE_ERROR_RESPONSE";function wv(e){if(e.startsWith(`${Hm}:${Rv}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Cv(e){if(e.startsWith(`${Hm}:${Av}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new bv(t.status,t.statusText,t.data)}catch{}}function _v(e,{relative:t}={}){Oe(oi(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:n}=p.useContext(Ct),{hash:a,pathname:i,search:s}=fi(e,{relative:t}),u=i;return l!=="/"&&(u=i==="/"?l:Dt([l,i])),n.createHref({pathname:u,search:s,hash:a})}function oi(){return p.useContext(Fs)!=null}function it(){return Oe(oi(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Fs).location}var km="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qm(e){p.useContext(Ct).static||p.useLayoutEffect(e)}function on(){let{isDataRoute:e}=p.useContext(ol);return e?Vv():Mv()}function Mv(){Oe(oi(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(aa),{basename:t,navigator:l}=p.useContext(Ct),{matches:n}=p.useContext(ol),{pathname:a}=it(),i=JSON.stringify(_m(n)),s=p.useRef(!1);return qm(()=>{s.current=!0}),p.useCallback((r,o={})=>{if(Yt(s.current,km),!s.current)return;if(typeof r=="number"){l.go(r);return}let f=to(r,JSON.parse(i),a,o.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Dt([t,f.pathname])),(o.replace?l.replace:l.push)(f,o.state,o)},[t,l,i,a,e])}p.createContext(null);function fi(e,{relative:t}={}){let{matches:l}=p.useContext(ol),{pathname:n}=it(),a=JSON.stringify(_m(l));return p.useMemo(()=>to(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Ov(e,t,l){Oe(oi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=p.useContext(Ct),{matches:a}=p.useContext(ol),i=a[a.length-1],s=i?i.params:{},u=i?i.pathname:"/",r=i?i.pathnameBase:"/",o=i&&i.route;{let b=o&&o.path||"";Gm(u,!o||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let f=it(),m;m=f;let h=m.pathname||"/",g=h;if(r!=="/"){let b=r.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let v=Am(e,{pathname:g});return Yt(o||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Yt(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Hv(v&&v.map(b=>Object.assign({},b,{params:Object.assign({},s,b.params),pathname:Dt([r,n.encodeLocation?n.encodeLocation(b.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?r:Dt([r,n.encodeLocation?n.encodeLocation(b.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),a,l)}function Dv(){let e=Xv(),t=Sv(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),l=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:i},"ErrorBoundary")," or"," ",p.createElement("code",{style:i},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),l?p.createElement("pre",{style:a},l):null,s)}var Uv=p.createElement(Dv,null),Ym=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const l=Cv(e.digest);l&&(e=l)}let t=e!==void 0?p.createElement(ol.Provider,{value:this.props.routeContext},p.createElement(lo.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?p.createElement(Bv,{error:e},t):t}};Ym.contextType=Bm;var Fc=new WeakMap;function Bv({children:e,error:t}){let{basename:l}=p.useContext(Ct);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=wv(t.digest);if(n){let a=Fc.get(t);if(a)throw a;let i=Dm(n.location,l);if(Om&&!Fc.get(t))if(i.isExternal||n.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Fc.set(t,s),s}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Lv({routeContext:e,match:t,children:l}){let n=p.useContext(aa);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(ol.Provider,{value:e},l)}function Hv(e,t=[],l){let n=l==null?void 0:l.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n==null?void 0:n.errors;if(i!=null){let f=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);Oe(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let s=!1,u=-1;if(l&&n){s=n.renderFallback;for(let f=0;f<a.length;f++){let m=a[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=f),m.route.id){let{loaderData:h,errors:g}=n,v=m.route.loader&&!h.hasOwnProperty(m.route.id)&&(!g||g[m.route.id]===void 0);if(m.route.lazy||v){l.isStatic&&(s=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let r=l==null?void 0:l.onError,o=n&&r?(f,m)=>{var h,g;r(f,{location:n.location,params:((g=(h=n.matches)==null?void 0:h[0])==null?void 0:g.params)??{},unstable_pattern:zv(n.matches),errorInfo:m})}:void 0;return a.reduceRight((f,m,h)=>{let g,v=!1,z=null,b=null;n&&(g=i&&m.route.id?i[m.route.id]:void 0,z=m.route.errorElement||Uv,s&&(u<0&&h===0?(Gm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,b=null):u===h&&(v=!0,b=m.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,h+1)),d=()=>{let y;return g?y=z:v?y=b:m.route.Component?y=p.createElement(m.route.Component,null):m.route.element?y=m.route.element:y=f,p.createElement(Lv,{match:m,routeContext:{outlet:f,matches:x,isDataRoute:n!=null},children:y})};return n&&(m.route.ErrorBoundary||m.route.errorElement||h===0)?p.createElement(Ym,{location:n.location,revalidation:n.revalidation,component:z,error:g,children:d(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:o}):d()},null)}function no(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kv(e){let t=p.useContext(aa);return Oe(t,no(e)),t}function qv(e){let t=p.useContext(Js);return Oe(t,no(e)),t}function Yv(e){let t=p.useContext(ol);return Oe(t,no(e)),t}function ao(e){let t=Yv(e),l=t.matches[t.matches.length-1];return Oe(l.route.id,`${e} can only be used on routes that contain a unique "id"`),l.route.id}function Gv(){return ao("useRouteId")}function Xv(){var n;let e=p.useContext(lo),t=qv("useRouteError"),l=ao("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[l]}function Vv(){let{router:e}=kv("useNavigate"),t=ao("useNavigate"),l=p.useRef(!1);return qm(()=>{l.current=!0}),p.useCallback(async(a,i={})=>{Yt(l.current,km),l.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var pd={};function Gm(e,t,l){!t&&!pd[e]&&(pd[e]=!0,Yt(!1,l))}p.memo(Qv);function Qv({routes:e,future:t,state:l,isStatic:n,onError:a}){return Ov(e,void 0,{state:l,isStatic:n,onError:a})}function $v({basename:e="/",children:t=null,location:l,navigationType:n="POP",navigator:a,static:i=!1,unstable_useTransitions:s}){Oe(!oi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),r=p.useMemo(()=>({basename:u,navigator:a,static:i,unstable_useTransitions:s,future:{}}),[u,a,i,s]);typeof l=="string"&&(l=ri(l));let{pathname:o="/",search:f="",hash:m="",state:h=null,key:g="default",unstable_mask:v}=l,z=p.useMemo(()=>{let b=ul(o,u);return b==null?null:{location:{pathname:b,search:f,hash:m,state:h,key:g,unstable_mask:v},navigationType:n}},[u,o,f,m,h,g,n,v]);return Yt(z!=null,`<Router basename="${u}"> is not able to match the URL "${o}${f}${m}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:p.createElement(Ct.Provider,{value:r},p.createElement(Fs.Provider,{children:t,value:z}))}var Wi="get",Ii="application/x-www-form-urlencoded";function Ws(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Zv(e){return Ws(e)&&e.tagName.toLowerCase()==="button"}function Kv(e){return Ws(e)&&e.tagName.toLowerCase()==="form"}function Jv(e){return Ws(e)&&e.tagName.toLowerCase()==="input"}function Fv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wv(e,t){return e.button===0&&(!t||t==="_self")&&!Fv(e)}var Oi=null;function Iv(){if(Oi===null)try{new FormData(document.createElement("form"),0),Oi=!1}catch{Oi=!0}return Oi}var Pv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wc(e){return e!=null&&!Pv.has(e)?(Yt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ii}"`),null):e}function eb(e,t){let l,n,a,i,s;if(Kv(e)){let u=e.getAttribute("action");n=u?ul(u,t):null,l=e.getAttribute("method")||Wi,a=Wc(e.getAttribute("enctype"))||Ii,i=new FormData(e)}else if(Zv(e)||Jv(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let r=e.getAttribute("formaction")||u.getAttribute("action");if(n=r?ul(r,t):null,l=e.getAttribute("formmethod")||u.getAttribute("method")||Wi,a=Wc(e.getAttribute("formenctype"))||Wc(u.getAttribute("enctype"))||Ii,i=new FormData(u,e),!Iv()){let{name:o,type:f,value:m}=e;if(f==="image"){let h=o?`${o}.`:"";i.append(`${h}x`,"0"),i.append(`${h}y`,"0")}else o&&i.append(o,m)}}else{if(Ws(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Wi,n=null,a=Ii,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:n,method:l.toLowerCase(),encType:a,formData:i,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function io(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xm(e,t,l,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return l?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&ul(a.pathname,t)==="/"?a.pathname=`${ws(t)}/_root.${n}`:a.pathname=`${ws(a.pathname)}.${n}`,a}async function tb(e,t){if(e.id in t)return t[e.id];try{let l=await import(e.module);return t[e.id]=l,l}catch(l){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lb(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function nb(e,t,l){let n=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await tb(i,l);return s.links?s.links():[]}return[]}));return cb(n.flat(1).filter(lb).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function gd(e,t,l,n,a,i){let s=(r,o)=>l[o]?r.route.id!==l[o].route.id:!0,u=(r,o)=>{var f;return l[o].pathname!==r.pathname||((f=l[o].route.path)==null?void 0:f.endsWith("*"))&&l[o].params["*"]!==r.params["*"]};return i==="assets"?t.filter((r,o)=>s(r,o)||u(r,o)):i==="data"?t.filter((r,o)=>{var m;let f=n.routes[r.route.id];if(!f||!f.hasLoader)return!1;if(s(r,o)||u(r,o))return!0;if(r.route.shouldRevalidate){let h=r.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=l[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:r.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function ab(e,t,{includeHydrateFallback:l}={}){return ib(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),l&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function ib(e){return[...new Set(e)]}function sb(e){let t={},l=Object.keys(e).sort();for(let n of l)t[n]=e[n];return t}function cb(e,t){let l=new Set;return new Set(t),e.reduce((n,a)=>{let i=JSON.stringify(sb(a));return l.has(i)||(l.add(i),n.push({key:i,link:a})),n},[])}function so(){let e=p.useContext(aa);return io(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ub(){let e=p.useContext(Js);return io(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var co=p.createContext(void 0);co.displayName="FrameworkContext";function uo(){let e=p.useContext(co);return io(e,"You must render this element inside a <HydratedRouter> element"),e}function rb(e,t){let l=p.useContext(co),[n,a]=p.useState(!1),[i,s]=p.useState(!1),{onFocus:u,onBlur:r,onMouseEnter:o,onMouseLeave:f,onTouchStart:m}=t,h=p.useRef(null);p.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let z=x=>{x.forEach(d=>{s(d.isIntersecting)})},b=new IntersectionObserver(z,{threshold:.5});return h.current&&b.observe(h.current),()=>{b.disconnect()}}},[e]),p.useEffect(()=>{if(n){let z=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(z)}}},[n]);let g=()=>{a(!0)},v=()=>{a(!1),s(!1)};return l?e!=="intent"?[i,h,{}]:[i,h,{onFocus:xa(u,g),onBlur:xa(r,v),onMouseEnter:xa(o,g),onMouseLeave:xa(f,v),onTouchStart:xa(m,g)}]:[!1,h,{}]}function xa(e,t){return l=>{e&&e(l),l.defaultPrevented||t(l)}}function ob({page:e,...t}){let l=jv(),{router:n}=so(),a=p.useMemo(()=>Am(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?l?p.createElement(db,{page:e,matches:a,...t}):p.createElement(hb,{page:e,matches:a,...t}):null}function fb(e){let{manifest:t,routeModules:l}=uo(),[n,a]=p.useState([]);return p.useEffect(()=>{let i=!1;return nb(e,t,l).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,l]),n}function db({page:e,matches:t,...l}){let n=it(),{future:a}=uo(),{basename:i}=so(),s=p.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=Xm(e,i,a.unstable_trailingSlashAwareDataRequests,"rsc"),r=!1,o=[];for(let f of t)typeof f.route.shouldRevalidate=="function"?r=!0:o.push(f.route.id);return r&&o.length>0&&u.searchParams.set("_routes",o.join(",")),[u.pathname+u.search]},[i,a.unstable_trailingSlashAwareDataRequests,e,n,t]);return p.createElement(p.Fragment,null,s.map(u=>p.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...l})))}function hb({page:e,matches:t,...l}){let n=it(),{future:a,manifest:i,routeModules:s}=uo(),{basename:u}=so(),{loaderData:r,matches:o}=ub(),f=p.useMemo(()=>gd(e,t,o,i,n,"data"),[e,t,o,i,n]),m=p.useMemo(()=>gd(e,t,o,i,n,"assets"),[e,t,o,i,n]),h=p.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let z=new Set,b=!1;if(t.forEach(d=>{var S;let y=i.routes[d.route.id];!y||!y.hasLoader||(!f.some(j=>j.route.id===d.route.id)&&d.route.id in r&&((S=s[d.route.id])!=null&&S.shouldRevalidate)||y.hasClientLoader?b=!0:z.add(d.route.id))}),z.size===0)return[];let x=Xm(e,u,a.unstable_trailingSlashAwareDataRequests,"data");return b&&z.size>0&&x.searchParams.set("_routes",t.filter(d=>z.has(d.route.id)).map(d=>d.route.id).join(",")),[x.pathname+x.search]},[u,a.unstable_trailingSlashAwareDataRequests,r,n,i,f,t,e,s]),g=p.useMemo(()=>ab(m,i),[m,i]),v=fb(m);return p.createElement(p.Fragment,null,h.map(z=>p.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...l})),g.map(z=>p.createElement("link",{key:z,rel:"modulepreload",href:z,...l})),v.map(({key:z,link:b})=>p.createElement("link",{key:z,nonce:l.nonce,...b,crossOrigin:b.crossOrigin??l.crossOrigin})))}function mb(...e){return t=>{e.forEach(l=>{typeof l=="function"?l(t):l!=null&&(l.current=t)})}}var xb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xb&&(window.__reactRouterVersion="7.14.1")}catch{}function pb({basename:e,children:t,unstable_useTransitions:l,window:n}){let a=p.useRef();a.current==null&&(a.current=Wy({window:n,v5Compat:!0}));let i=a.current,[s,u]=p.useState({action:i.action,location:i.location}),r=p.useCallback(o=>{l===!1?u(o):p.startTransition(()=>u(o))},[l]);return p.useLayoutEffect(()=>i.listen(r),[i,r]),p.createElement($v,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i,unstable_useTransitions:l})}var Vm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qm=p.forwardRef(function({onClick:t,discover:l="render",prefetch:n="none",relative:a,reloadDocument:i,replace:s,unstable_mask:u,state:r,target:o,to:f,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:g,...v},z){let{basename:b,navigator:x,unstable_useTransitions:d}=p.useContext(Ct),y=typeof f=="string"&&Vm.test(f),S=Dm(f,b);f=S.to;let j=_v(f,{relative:a}),M=it(),R=null;if(u){let k=to(u,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);b!=="/"&&(k.pathname=k.pathname==="/"?b:Dt([b,k.pathname])),R=x.createHref(k)}let[C,U,O]=rb(n,v),ee=bb(f,{replace:s,unstable_mask:u,state:r,target:o,preventScrollReset:m,relative:a,viewTransition:h,unstable_defaultShouldRevalidate:g,unstable_useTransitions:d});function he(k){t&&t(k),k.defaultPrevented||ee(k)}let _=!(S.isExternal||i),F=p.createElement("a",{...v,...O,href:(_?R:void 0)||S.absoluteURL||j,onClick:_?he:t,ref:mb(z,U),target:o,"data-discover":!y&&l==="render"?"true":void 0});return C&&!y?p.createElement(p.Fragment,null,F,p.createElement(ob,{page:j})):F});Qm.displayName="Link";var gb=p.forwardRef(function({"aria-current":t="page",caseSensitive:l=!1,className:n="",end:a=!1,style:i,to:s,viewTransition:u,children:r,...o},f){let m=fi(s,{relative:o.relative}),h=it(),g=p.useContext(Js),{navigator:v,basename:z}=p.useContext(Ct),b=g!=null&&Eb(m)&&u===!0,x=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,d=h.pathname,y=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;l||(d=d.toLowerCase(),y=y?y.toLowerCase():null,x=x.toLowerCase()),y&&z&&(y=ul(y,z)||y);const S=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let j=d===x||!a&&d.startsWith(x)&&d.charAt(S)==="/",M=y!=null&&(y===x||!a&&y.startsWith(x)&&y.charAt(x.length)==="/"),R={isActive:j,isPending:M,isTransitioning:b},C=j?t:void 0,U;typeof n=="function"?U=n(R):U=[n,j?"active":null,M?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let O=typeof i=="function"?i(R):i;return p.createElement(Qm,{...o,"aria-current":C,className:U,ref:f,style:O,to:s,viewTransition:u},typeof r=="function"?r(R):r)});gb.displayName="NavLink";var yb=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:l,reloadDocument:n,replace:a,state:i,method:s=Wi,action:u,onSubmit:r,relative:o,preventScrollReset:f,viewTransition:m,unstable_defaultShouldRevalidate:h,...g},v)=>{let{unstable_useTransitions:z}=p.useContext(Ct),b=Nb(),x=jb(u,{relative:o}),d=s.toLowerCase()==="get"?"get":"post",y=typeof u=="string"&&Vm.test(u),S=j=>{if(r&&r(j),j.defaultPrevented)return;j.preventDefault();let M=j.nativeEvent.submitter,R=(M==null?void 0:M.getAttribute("formmethod"))||s,C=()=>b(M||j.currentTarget,{fetcherKey:t,method:R,navigate:l,replace:a,state:i,relative:o,preventScrollReset:f,viewTransition:m,unstable_defaultShouldRevalidate:h});z&&l!==!1?p.startTransition(()=>C()):C()};return p.createElement("form",{ref:v,method:d,action:x,onSubmit:n?r:S,...g,"data-discover":!y&&e==="render"?"true":void 0})});yb.displayName="Form";function vb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $m(e){let t=p.useContext(aa);return Oe(t,vb(e)),t}function bb(e,{target:t,replace:l,unstable_mask:n,state:a,preventScrollReset:i,relative:s,viewTransition:u,unstable_defaultShouldRevalidate:r,unstable_useTransitions:o}={}){let f=on(),m=it(),h=fi(e,{relative:s});return p.useCallback(g=>{if(Wv(g,t)){g.preventDefault();let v=l!==void 0?l:Ja(m)===Ja(h),z=()=>f(e,{replace:v,unstable_mask:n,state:a,preventScrollReset:i,relative:s,viewTransition:u,unstable_defaultShouldRevalidate:r});o?p.startTransition(()=>z()):z()}},[m,f,h,l,n,a,t,e,i,s,u,r,o])}var Sb=0,zb=()=>`__${String(++Sb)}__`;function Nb(){let{router:e}=$m("useSubmit"),{basename:t}=p.useContext(Ct),l=Gv(),n=e.fetch,a=e.navigate;return p.useCallback(async(i,s={})=>{let{action:u,method:r,encType:o,formData:f,body:m}=eb(i,t);if(s.navigate===!1){let h=s.fetcherKey||zb();await n(h,l,s.action||u,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:m,formMethod:s.method||r,formEncType:s.encType||o,flushSync:s.flushSync})}else await a(s.action||u,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:m,formMethod:s.method||r,formEncType:s.encType||o,replace:s.replace,state:s.state,fromRouteId:l,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,a,t,l])}function jb(e,{relative:t}={}){let{basename:l}=p.useContext(Ct),n=p.useContext(ol);Oe(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),i={...fi(e||".",{relative:t})},s=it();if(e==null){i.search=s.search;let u=new URLSearchParams(i.search),r=u.getAll("index");if(r.some(f=>f==="")){u.delete("index"),r.filter(m=>m).forEach(m=>u.append("index",m));let f=u.toString();i.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(i.pathname=i.pathname==="/"?l:Dt([l,i.pathname])),Ja(i)}function Eb(e,{relative:t}={}){let l=p.useContext(Lm);Oe(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=$m("useViewTransitionState"),a=fi(e,{relative:t});if(!l.isTransitioning)return!1;let i=ul(l.currentLocation.pathname,n)||l.currentLocation.pathname,s=ul(l.nextLocation.pathname,n)||l.nextLocation.pathname;return As(a.pathname,s)!=null||As(a.pathname,i)!=null}function Tb({onConnect:e,error:t}){const[l,n]=p.useState(""),[a,i]=p.useState(!1),s=async u=>{u.preventDefault(),l.trim()&&(i(!0),await e(l.trim()),i(!1))};return c.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-4xl mb-3",children:"⚒"}),c.jsx("h1",{className:"text-2xl font-bold text-white",children:"Forge"}),c.jsx("p",{className:"text-sm text-zinc-400 mt-1",children:"AI-powered code change & deploy control panel"})]}),c.jsxs("form",{onSubmit:s,className:"w-full max-w-sm flex flex-col gap-3",children:[c.jsx("input",{type:"password",placeholder:"Enter Forge token",value:l,onChange:u=>n(u.target.value),className:"w-full bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-2.5 text-sm text-white placeholder:text-zinc-500 focus:outline-none focus:border-violet-500"}),t&&c.jsx("p",{className:"text-red-400 text-xs text-center",children:t}),c.jsx("button",{type:"submit",disabled:a||!l.trim(),className:"w-full bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-sm font-medium py-2.5 rounded-lg transition-colors",children:a?"Connecting...":"Connect"})]})]})}const Rb={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_FORGE_TOKEN:"51afb6f3e98afc446b8ab0f7532a066890e41f5da8b29f07b037053353107478"},Ab=e=>Rb[e];let ro="";function Bt(){return ro||Ab("VITE_FORGE_TOKEN")}function wb(e){ro=e}function Ic(){ro=""}async function re(e,t){const l=await fetch(`/api/forge${e}`,{...t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${Bt()}`,...t==null?void 0:t.headers}});if(!l.ok){let n={};try{n=await l.json()}catch{}throw new Error(n.error??`Request failed: ${l.status}`)}try{return await l.json()}catch{throw new Error(`Empty response from ${e}`)}}const Cb=5,Pu=(e,t)=>`forge:analyses:${e}:${t}`,yd=(e,t)=>`forge:analysis:${e}:${t}`;function _b(e){if(e.every(l=>typeof l.ordinal=="number"))return e;const t=e.length;return e.map((l,n)=>({...l,ordinal:typeof l.ordinal=="number"?l.ordinal:t-n}))}function Is(e,t){try{const l=localStorage.getItem(Pu(e,t));if(l){const a=JSON.parse(l);if(Array.isArray(a)){const i=_b(a);return i!==a&&Ps(e,t,i),i}}const n=localStorage.getItem(yd(e,t));if(n){const a=JSON.parse(n),i={id:a.analyzedAt||crypto.randomUUID(),ordinal:1,...a};return localStorage.setItem(Pu(e,t),JSON.stringify([i])),localStorage.removeItem(yd(e,t)),[i]}}catch{}return[]}function Ps(e,t,l){try{localStorage.setItem(Pu(e,t),JSON.stringify(l))}catch{}}function Mb(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Ob(e,t,l,n,a,i,s){const u=i==null?void 0:i.trim(),r=Is(e,t),o=r.reduce((h,g)=>Math.max(h,g.ordinal??0),0)+1,f={id:Mb(),ordinal:o,result:l,analyzedAt:new Date().toISOString(),repo:e,model:n,...a!==void 0&&{mrIid:a},...u&&{prompt:u},...s},m=[f,...r].slice(0,Cb);return Ps(e,t,m),f}function Yl(e,t,l,n){const a=Is(e,t),i=a.findIndex(r=>r.ordinal===l);if(i<0)return null;const s={...a[i],...n},u=[...a];return u[i]=s,Ps(e,t,u),s}function Zl(e,t){return Is(e,t)}function Db(e,t,l){const n=Is(e,t).filter(a=>a.id!==l);Ps(e,t,n)}function Ub(e){const t=new Date(e),n=new Date().getTime()-t.getTime(),a=Math.floor(n/6e4),i=Math.floor(a/60),s=Math.floor(i/24);return a<1?"just now":a<60?`${a}m ago`:i<24?`${i}h ago`:s<7?`${s}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})+" at "+t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Pc(e,t,l){const n=new EventSource(e);return n.onmessage=a=>t(JSON.parse(a.data)),n.onerror=l,n}function Di(e,t,l){return[...e.filter(n=>n.step!==t),{step:t,message:l}]}const Gl={result:null,steps:{},stale:!1};function Bb(e){return!!e.result||Object.keys(e.steps).length>0||e.stale}function vd(e){return!e||e.length===0?[]:e.map(t=>t.explanation===void 0&&t.kind!=="canceled"?{...t,kind:"canceled",explanation:"Refinement canceled — the page was reloaded before it finished."}:t)}const Zm="forge_secondary_repos";function Lb(){try{const e=localStorage.getItem(Zm);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(l=>typeof l=="string"):[]}catch{return[]}}function bd(e){try{localStorage.setItem(Zm,JSON.stringify(e))}catch{}}function Hb(){const[e,t]=p.useState(()=>Bt()?typeof window<"u"&&/^\/issues\/\d+/.test(window.location.pathname)?"selected":"idle":"connect"),[l,n]=p.useState(null),[a,i]=p.useState([]),[s,u]=p.useState(()=>!!Bt()),[r,o]=p.useState(null),[f,m]=p.useState(null),[h,g]=p.useState([]),[v,z]=p.useState([]),[b,x]=p.useState(null),[d,y]=p.useState([]),[S,j]=p.useState(null),[M,R]=p.useState([]),[C,U]=p.useState(null),[O,ee]=p.useState(!1),[he,_]=p.useState(null),[F,k]=p.useState(null),[w,q]=p.useState(null),[G,W]=p.useState(!1),[B,I]=p.useState([]),[st,je]=p.useState([]),[ke,$e]=p.useState(!1),[nx,ax]=p.useState([]),[ix,ho]=p.useState(!1),[sx,mo]=p.useState(null),[tc,lc]=p.useState(null),[cx,xo]=p.useState(!1),[ux,di]=p.useState(null),[po,gt]=p.useState(!1),[rx,go]=p.useState("analyze"),[yo,vo]=p.useState(""),[ox,bo]=p.useState({sessionCost:0,serviceTier:"",inputTokens:0,outputTokens:0,cacheCreationTokens:0,cacheReadTokens:0}),[fx,nc]=p.useState(null),[dx,So]=p.useState(!1),[hx,ac]=p.useState(null),[mx,xx]=p.useState(null),[ic,fn]=p.useState(!1),[px,_t]=p.useState(null),[ia,yt]=p.useState({result:null,steps:{},stale:!1}),vt=p.useRef(null),dn=p.useRef(!1),[hi,gx]=p.useState(()=>localStorage.getItem("forge_auto_push_on_green")==="1"),zo=p.useRef(hi);p.useEffect(()=>{zo.current=hi},[hi]);const yx=N=>{gx(N);try{localStorage.setItem("forge_auto_push_on_green",N?"1":"0")}catch{}},vx=async()=>{So(!0),ac(null);try{const{rateLimit:N,checkedAt:T}=await re("/quota");N&&nc(N),T&&xx(T),N||ac("No rate-limit headers returned.")}catch(N){ac(N.message)}finally{So(!1)}},[bx,Sx]=p.useState([]),[Q,No]=p.useState(""),[zx,Nx]=p.useState(null),[We,jo]=p.useState(Lb),Eo=N=>{jo(N),bd(N)},[jx,Ex]=p.useState([]),[sa,To]=p.useState(()=>localStorage.getItem("forge_model")??""),[Tx,Rx]=p.useState([]),[kl,Ro]=p.useState(()=>localStorage.getItem("forge_agent")??"claude"),Ax=N=>{To(N),localStorage.setItem("forge_model",N)},wx=N=>{Ro(N),localStorage.setItem("forge_agent",N)},mi=p.useRef(null),le=p.useRef(null);p.useEffect(()=>()=>{var N,T;(N=mi.current)==null||N.abort(),(T=le.current)==null||T.close(),le.current=null},[]);const ca=(N="?")=>Q?`${N}repo=${encodeURIComponent(Q)}`:"",sc=N=>{var T,D;Ex(N.models),To(A=>A||N.defaultModel),Nx(N.testDeployUrlTemplate??null),(T=N.repos)!=null&&T.length&&(Sx(N.repos),No(A=>A||N.defaultRepo||N.repos[0].id),jo(A=>{const L=new Set(N.repos.map(V=>V.id)),Y=A.filter(V=>L.has(V));return Y.length!==A.length&&bd(Y),Y})),(D=N.agents)!=null&&D.length&&(Rx(N.agents),Ro(A=>A||N.defaultAgent||"claude")),N.rateLimit&&nc(N.rateLimit),localStorage.getItem("forge_model")||localStorage.setItem("forge_model",N.defaultModel),localStorage.getItem("forge_agent")||localStorage.setItem("forge_agent",N.defaultAgent??"claude")};p.useEffect(()=>{if(Q&&We.includes(Q)){const N=We.filter(T=>T!==Q);Eo(N)}},[Q]),p.useEffect(()=>{e==="connect"&&Bt()&&re("/status").then(N=>{sc(N),t("idle")}).catch(()=>Ic())},[e]);const Ao=p.useRef(!1);p.useEffect(()=>{Ao.current||!Bt()||e==="connect"||(Ao.current=!0,re("/status").then(N=>{sc(N),xi(),cc()}).catch(()=>{}))},[e]);const wo=p.useRef(null);p.useEffect(()=>{const N=wo.current;wo.current=e,Bt()&&N!=null&&N!=="idle"&&e==="idle"&&(xi(),cc())},[e]);const Cx=async N=>{n(null),wb(N);try{const T=await re("/status");sc(T),u(!0),t("idle"),xi()}catch{Ic(),n("Invalid token or Forge is not configured.")}},xi=async()=>{var T;(T=mi.current)==null||T.abort();const N=new AbortController;mi.current=N,u(!0),o(null);try{const D=await re(`/issues${ca()}`,{signal:N.signal});i(D.issues)}catch(D){D.name!=="AbortError"&&o(D.message)}finally{u(!1)}},cc=async()=>{ho(!0),mo(null);try{const N=await re(`/mrs${ca()}`);ax(N.mrs)}catch(N){N.name!=="AbortError"&&mo(N.message)}finally{ho(!1)}},_x=N=>{var A;const T={repo:Q,branchName:N.source_branch,mr:{iid:N.iid,web_url:N.web_url,title:N.title},pipelineUrl:((A=N.pipeline)==null?void 0:A.web_url)??null};q({iid:N.iid,web_url:N.web_url,title:N.title,branchName:N.source_branch}),_({applications:[T]}),I([]),m(null),x(null),j(null),t("monitoring");const D=N.source_branch.match(/^forge\/issue-(\d+)-/);if(D){const L=Number(D[1]);Promise.all([re(`/issues/${L}${ca()}`).then(Y=>Y.issue,()=>null),re(`/issues/${L}/merged-mrs${ca()}`).then(Y=>Y.mrs,()=>[])]).then(([Y,V])=>{Y&&m(Y),V.length&&I(V)})}},Mx=async(N,T)=>{const D=await re("/issues",{method:"POST",body:JSON.stringify({title:N,description:T,repo:Q})});return i(A=>[D.issue,...A]),D.issue},Ox=async(N,T)=>{if(!f)return;const D=await re(`/issues/${f.iid}`,{method:"PUT",body:JSON.stringify({title:N,description:T,repo:Q})});m(D.issue),i(A=>A.map(L=>L.iid===D.issue.iid?D.issue:L))},Dx=N=>{m(N),q(null),W(!0),I([]),je([]),$e(!0),g([]),z([]),x(null),j(null),_(null),k(null),lc(null),di(null),R(Zl(Q||"default",N.iid)),yt(Gl),_t(null),t("selected");const T=[Q,...We].filter(Boolean);Promise.all(T.map(A=>re(`/issues/${N.iid}/environments?repo=${encodeURIComponent(A)}`).then(L=>L.environments).catch(()=>[]))).then(A=>{je(A.flat()),$e(!1)});const D=[Q,...We].filter(Boolean);Promise.all([Promise.all(D.map(A=>re(`/issues/${N.iid}/mr?repo=${encodeURIComponent(A)}`).then(L=>L.mr?{...L.mr,repo:A}:null).catch(()=>null))),re(`/issues/${N.iid}/merged-mrs${ca()}`).then(A=>A.mrs,()=>[]),Promise.all(D.map(A=>re(`/issues/${N.iid}/deploy-branches?repo=${encodeURIComponent(A)}`).then(L=>({repo:A,branches:L.branches})).catch(()=>({repo:A,branches:[]}))))]).then(([A,L,Y])=>{W(!1),L.length&&I(L);const V=A.filter(H=>H!==null).map(H=>({repo:H.repo,branchName:H.branchName,mr:{iid:H.iid,web_url:H.web_url,title:H.title},pipelineUrl:null})),_e=Y.flatMap(({repo:H,branches:ae})=>ae.map(Qe=>{var Ze;return{repo:H,branchName:Qe.branchName,mr:null,pipelineUrl:((Ze=Qe.pipeline)==null?void 0:Ze.web_url)??null}})),ne=A[0];ne&&q({iid:ne.iid,web_url:ne.web_url,title:ne.title,branchName:ne.branchName});const be=[...V,..._e];be.length&&_({applications:be})})},Ux=()=>{var L;if(!f)return;const N=w?"update":M.length>0?"new":B.length>0&&tc&&!tc.resolved?"retry":"fresh";g([]),z([]),x(null),j(null),y([]),go("analyze"),t("analyzing");const T=yo.trim();vo(""),(L=le.current)==null||L.close();const D=new URLSearchParams({token:Bt()});sa&&D.set("model",sa),Q&&D.set("repo",Q),We.length&&D.set("secondaryRepos",We.join(",")),kl&&D.set("agent",kl),T&&D.set("prompt",T),D.set("kind",N);let A=null;le.current=Pc(`/api/forge/issues/${f.iid}/analyze?${D.toString()}`,Y=>{var V,_e;if(Y.type==="progress")g(ne=>Di(ne,Y.step,Y.message));else if(Y.type==="log")z(ne=>[...ne,{ts:new Date().toISOString(),message:Y.message}]);else if(Y.type==="result"){const ne=Y.data;A=ne,x(ne)}else if(Y.type==="usage")pi(Y);else if(Y.type==="done"){if((V=le.current)==null||V.close(),le.current=null,A&&f){const ne=Ob(Q||"default",f.iid,A,sa,w==null?void 0:w.iid,T);R(be=>[ne,...be.filter(H=>H.id!==ne.id)].slice(0,5)),U(ne.ordinal),yt(Gl),_t(null)}t("reviewing")}else Y.type==="error"&&((_e=le.current)==null||_e.close(),le.current=null,j(Y.message),t("reviewing"))},()=>{var Y;(Y=le.current)==null||Y.close(),le.current=null,j("Connection lost during analysis."),t("reviewing")})},Co=()=>({repo:Q,secondaryRepos:We}),_o=(N,T)=>{yt(D=>{const A=D.steps[N]??{status:"idle",logs:[]};return{...D,steps:{...D.steps,[N]:{...A,...T}}}})},Bx=(N,T)=>{yt(D=>{const A=D.steps[N]??{status:"idle",logs:[]};return{...D,steps:{...D.steps,[N]:{...A,logs:[...A.logs,{ts:new Date().toISOString(),message:T}]}}}})},Mo=async()=>{var N;if(b){hn.current=b.changes,fn(!0),_t(null),yt({result:null,steps:{},stale:!1});try{const{jobId:T}=await re("/validate",{method:"POST",body:JSON.stringify({analysis:b,repo:Q})});(N=vt.current)==null||N.close();const D=new URLSearchParams({token:Bt()});Q&&D.set("repo",Q),vt.current=Pc(`/api/forge/jobs/${T}/stream?${D.toString()}`,A=>{var L,Y;if(A.type==="progress")_o(A.step,{status:"running"});else if(A.type==="log"){const V=A.step??"clone";Bx(V,A.message)}else if(A.type==="step_result"){const V=A.step,_e=!!A.passed,ne=!!A.skipped;_o(V,{status:ne?"skipped":_e?"passed":"failed",passed:_e,skipped:ne,exitCode:A.exitCode,durationMs:A.durationMs,tail:A.tail})}else if(A.type==="changes_formatted"){const V=A.files??[];if(V.length>0){const _e=new Map(V.map(ne=>[ne.file,ne.proposed]));x(ne=>{if(!ne)return ne;let be=!1;const H=ne.changes.map(Qe=>{const Ze=_e.get(Qe.file);return Ze!==void 0&&Ze!==Qe.proposed?(be=!0,{...Qe,proposed:Ze}):Qe});if(!be)return ne;const ae={...ne,changes:H};return hn.current=H,f&&C!=null&&Yl(Q||"default",f.iid,C,{result:ae}),ae})}}else if(A.type==="result"){const V=A.data;yt(_e=>({..._e,result:V})),V.allPassed&&zo.current&&setTimeout(()=>{kx()},0)}else A.type==="done"?((L=vt.current)==null||L.close(),vt.current=null,fn(!1)):A.type==="error"&&((Y=vt.current)==null||Y.close(),vt.current=null,_t(A.message),fn(!1))},()=>{var A;(A=vt.current)==null||A.close(),vt.current=null,_t("Connection lost during validation."),fn(!1)})}catch(T){_t(T.message),fn(!1)}}},hn=p.useRef(null);p.useEffect(()=>{const N=(b==null?void 0:b.changes)??null;N&&yt(T=>!hn.current||hn.current===N||!T.result&&Object.keys(T.steps).length===0?T:{...T,stale:!0})},[b==null?void 0:b.changes]),p.useEffect(()=>{if(ic||!f||C==null)return;const N=Bb(ia)?ia:void 0;Yl(Q||"default",f.iid,C,{validation:N}),R(Zl(Q||"default",f.iid))},[ic,ia,C,f,Q]),p.useEffect(()=>()=>{var N;(N=vt.current)==null||N.close(),vt.current=null},[]);const Oo=async()=>{if(b){ee(!0),k(null);try{const N=await re("/apply",{method:"POST",body:JSON.stringify({analysis:b,...Co()})});_(N),t("monitoring")}catch(N){k(N.message)}finally{ee(!1)}}},Lx=async()=>{if(b){ee(!0),k(null);try{const N=await re("/deploy-branch",{method:"POST",body:JSON.stringify({analysis:b,...Co()})});_(N),t("monitoring")}catch(N){k(N.message)}finally{ee(!1)}}},Hx=async N=>{if(f){ee(!0),k(null);try{const T=await re("/promote-branch",{method:"POST",body:JSON.stringify({branchName:N.branchName,repo:N.repo,issueIid:f.iid})});_(D=>D?{applications:D.applications.map(L=>L.repo===T.repo&&L.branchName===T.branchName?T:L)}:{applications:[T]})}catch(T){k(T.message)}finally{ee(!1)}}},Do=async()=>{if(!b)return;const N=(he==null?void 0:he.applications)??[];if(N.length){ee(!0),k(null);try{const T=new Set(b.changes.map(A=>A.repo||Q)),D=N.filter(A=>T.has(A.repo));if(!D.length)throw new Error("No existing branches match the refined changes.");await Promise.all(D.map(A=>re("/commit-to-branch",{method:"POST",body:JSON.stringify({branchName:A.branchName,analysis:{...b,changes:b.changes.filter(L=>(L.repo||Q)===A.repo)},repo:A.repo})}))),t("monitoring")}catch(T){k(T.message)}finally{ee(!1)}}},kx=()=>{if(O||!b)return;((he==null?void 0:he.applications)??[]).length>0?Do():Oo()},qx=()=>{x(null),U(null),yt(Gl),_t(null),t("selected")},Yx=N=>{const T=M.find(A=>A.id===N);if(!T)return;x(T.result),j(null),g([]),z([]);const D=vd(T.refineThread);y(D),f&&T.refineThread&&D.some((A,L)=>A!==T.refineThread[L])&&Yl(Q||"default",f.iid,T.ordinal,{refineThread:D}),U(T.ordinal),yt(T.validation??Gl),_t(null),hn.current=T.validation?T.result.changes:null,t("reviewing")},Gx=(N,T)=>{const D=T??(f==null?void 0:f.iid);if(!D)return!1;const A=Zl(Q||"default",D),L=A.find(V=>V.ordinal===N);if(!L)return!1;R(A),x(L.result),j(null),g([]),z([]);const Y=vd(L.refineThread);return y(Y),L.refineThread&&Y.some((V,_e)=>V!==L.refineThread[_e])&&Yl(Q||"default",D,L.ordinal,{refineThread:Y}),U(L.ordinal),yt(L.validation??Gl),_t(null),hn.current=L.validation?L.result.changes:null,t("reviewing"),!0},Xx=N=>{f&&(Db(Q||"default",f.iid,N),R(T=>T.filter(D=>D.id!==N)))},Vx=N=>{if(!f||po)return;const T=d[N];if(!T||T.kind!=="refine"||!T.prevResult)return;const D=d.slice(0,N),A=T.prevResult;y(D),x(A),C!=null&&(Yl(Q||"default",f.iid,C,{refineThread:D,result:A}),R(Zl(Q||"default",f.iid)))},uc=(N,T,D)=>{var L;(L=le.current)==null||L.close();const A=new URLSearchParams({token:Bt()});Q&&A.set("repo",Q),We.length&&A.set("secondaryRepos",We.join(",")),le.current=Pc(`/api/forge/jobs/${N}/stream?${A.toString()}`,T,D)},pi=N=>{bo(T=>({sessionCost:T.sessionCost+(N.cost||0),serviceTier:N.serviceTier??T.serviceTier,inputTokens:T.inputTokens+(N.inputTokens||0),outputTokens:T.outputTokens+(N.outputTokens||0),cacheCreationTokens:T.cacheCreationTokens+(N.cacheCreationTokens||0),cacheReadTokens:T.cacheReadTokens+(N.cacheReadTokens||0)})),N.rateLimit&&nc(N.rateLimit)},Qx=()=>{const{result:N,steps:T}=ia;if(!(N||Object.values(T).some(L=>L&&L.status!=="idle")))return null;const A={checkedAt:(N==null?void 0:N.checkedAt)??null,allPassed:(N==null?void 0:N.allPassed)??null,repo:(N==null?void 0:N.repo)??null,steps:{}};for(const[L,Y]of Object.entries(T))Y&&(A.steps[L]={status:Y.status,passed:Y.passed,skipped:Y.skipped,exitCode:Y.exitCode,durationMs:Y.durationMs,tail:Y.tail});return A},Uo=async N=>{if(!b||!f)return;const T=b;gt(!0),j(null),g([]);const D=[...d,{feedback:N}];y(D),C!=null&&(Yl(Q||"default",f.iid,C,{refineThread:D}),R(Zl(Q||"default",f.iid)));let A=null,L=!1;try{const{jobId:Y}=await re(`/issues/${f.iid}/refine`,{method:"POST",body:JSON.stringify({feedback:N,previousChanges:b.changes,validationState:Qx(),repo:Q,secondaryRepos:We,agent:kl})});uc(Y,V=>{var _e,ne;if(V.type==="progress")g(be=>Di(be,V.step,V.message));else if(V.type==="log")z(be=>[...be,{ts:new Date().toISOString(),message:V.message}]);else if(V.type==="answer"){L=!0;const be=V.text??"";y(H=>{if(H.length===0)return H;const ae=H[H.length-1];return[...H.slice(0,-1),{...ae,explanation:be,kind:"answer"}]})}else if(V.type==="result"){const be=V.data;A=be,x(be),y(H=>{if(H.length===0)return H;const ae=H[H.length-1];return[...H.slice(0,-1),{...ae,explanation:be.explanation,kind:"refine",prevResult:T}]})}else V.type==="usage"?pi(V):V.type==="done"?((_e=le.current)==null||_e.close(),le.current=null,gt(!1),y(be=>{if(f&&C!=null){const H={refineThread:be};A&&(H.result=A),Yl(Q||"default",f.iid,C,H),R(Zl(Q||"default",f.iid))}return be}),dn.current&&(dn.current=!1,!L&&A&&setTimeout(()=>{Mo()},0))):V.type==="error"&&((ne=le.current)==null||ne.close(),le.current=null,j(V.message),gt(!1),dn.current=!1)},()=>{var V;(V=le.current)==null||V.close(),le.current=null,j("Connection lost during refinement."),gt(!1),dn.current=!1})}catch(Y){j(Y.message),gt(!1),dn.current=!1}},$x=(N,T)=>{const D=N==="lint"?"lint":N==="typecheck"?"typecheck":N==="test"?"test suite":N,A=(T==null?void 0:T.trim())||`(no output captured for ${N})`,L=`The pre-flight ${D} check failed when validating the proposed changes against the real repo. Fix the errors below without altering unrelated behaviour, and keep the change surgical:
61
-
62
- ${A}`;dn.current=!0,Uo(L)},Zx=async(N,T,D)=>{if(!f)return;const A=D||Q,L=`?repo=${encodeURIComponent(A)}`,Y=await Promise.all(N.map(H=>re(`/jobs/${H}/trace${L}`).then(ae=>ae.trace,()=>`(trace unavailable for job ${H})`))),V=150,_e=Y.map((H,ae)=>{const Qe=H.split(`
63
- `),Ze=Qe.length>V?Qe.slice(-V).join(`
64
- `):H;return`--- Job ${N[ae]} (${A}) ---
65
- ${Ze}`}).join(`
66
-
67
- `),ne=T!=null&&T.trim()?`${_e}
68
-
69
- --- User instructions ---
70
- ${T.trim()}`:_e;if(go("ci-fix"),b){gt(!0),j(null),g([]);try{const{jobId:H}=await re(`/issues/${f.iid}/refine`,{method:"POST",body:JSON.stringify({ciContext:ne,previousChanges:b.changes,repo:Q,secondaryRepos:We,agent:kl})});uc(H,ae=>{var Qe,Ze;ae.type==="progress"?g(fc=>Di(fc,ae.step,ae.message)):ae.type==="log"?z(fc=>[...fc,{ts:new Date().toISOString(),message:ae.message}]):ae.type==="result"?x(ae.data):ae.type==="usage"?pi(ae):ae.type==="done"?((Qe=le.current)==null||Qe.close(),le.current=null,gt(!1),t("reviewing")):ae.type==="error"&&((Ze=le.current)==null||Ze.close(),le.current=null,j(ae.message),gt(!1),t("reviewing"))},()=>{var ae;(ae=le.current)==null||ae.close(),le.current=null,j("Connection lost during CI fix."),gt(!1),t("reviewing")})}catch(H){j(H.message),gt(!1)}return}const{jobId:be}=await re(`/issues/${f.iid}/ci-fix`,{method:"POST",body:JSON.stringify({ciContext:ne,model:sa,repo:Q,secondaryRepos:We,agent:kl})});g([]),z([]),x(null),j(null),t("analyzing"),uc(be,H=>{var ae,Qe;H.type==="progress"?g(Ze=>Di(Ze,H.step,H.message)):H.type==="log"?z(Ze=>[...Ze,{ts:new Date().toISOString(),message:H.message}]):H.type==="result"?x(H.data):H.type==="usage"?pi(H):H.type==="done"?((ae=le.current)==null||ae.close(),le.current=null,t("reviewing")):H.type==="error"&&((Qe=le.current)==null||Qe.close(),le.current=null,j(H.message),t("reviewing"))},()=>{var H;(H=le.current)==null||H.close(),le.current=null,j("Connection lost during CI fix analysis."),t("reviewing")})},Kx=async()=>{if(f){xo(!0),di(null);try{const N=await re(`/issues/${f.iid}/resolution-check`,{method:"POST",body:JSON.stringify({repo:Q,secondaryRepos:We,agent:kl})});lc(N),(N.cost!=null||N.inputTokens!=null)&&bo(T=>({sessionCost:T.sessionCost+(N.cost??0),serviceTier:N.serviceTier??T.serviceTier,inputTokens:T.inputTokens+(N.inputTokens??0),outputTokens:T.outputTokens+(N.outputTokens??0),cacheCreationTokens:T.cacheCreationTokens,cacheReadTokens:T.cacheReadTokens}))}catch(N){di(N.message)}finally{xo(!1)}}},Jx=()=>{w&&(_({applications:[{repo:Q,branchName:w.branchName,mr:{iid:w.iid,web_url:w.web_url,title:w.title},pipelineUrl:null}]}),t("monitoring"))},[Fx,rc]=p.useState(null),Wx=async()=>{if(f){rc(null);try{await re(`/issues/${f.iid}/close`,{method:"POST",body:JSON.stringify({repo:Q})}),i(N=>N.filter(T=>T.iid!==f.iid)),oc()}catch(N){rc(N.message)}}},Ix=()=>rc(null),Px=()=>{var N,T;(N=le.current)==null||N.close(),le.current=null,(T=vt.current)==null||T.close(),vt.current=null,fn(!1),gt(!1),U(null),yt(Gl),_t(null),t("selected")},oc=()=>{var N,T;(N=mi.current)==null||N.abort(),(T=le.current)==null||T.close(),le.current=null,m(null),q(null),W(!1),I([]),je([]),$e(!1),lc(null),di(null),x(null),R([]),U(null),_(null),g([]),z([]),j(null),k(null),gt(!1),yt(Gl),_t(null),t("idle")};return{phase:e,setPhase:t,connectError:l,issues:a,issuesLoading:s,issuesError:r,selectedIssue:f,progressSteps:h,analysisLogs:v,analysisResult:b,analysisError:S,applying:O,applyResult:he,applyError:F,refining:po,analysisMode:rx,analysisPrompt:yo,setAnalysisPrompt:vo,usage:ox,existingMr:w,existingMrLoading:G,mergedMrs:B,issueEnvironments:st,issueEnvironmentsLoading:ke,openMRs:nx,openMRsLoading:ix,openMRsError:sx,storedAnalyses:M,currentOrdinal:C,handleRestoreAnalysis:Yx,restoreAnalysisByOrdinal:Gx,handleDiscardStoredAnalysis:Xx,handleUndoRefine:Vx,formatAnalysisDate:Ub,handleConnect:Cx,loadIssues:xi,loadOpenMRs:cc,handleSelectMR:_x,handleCreateIssue:Mx,handleUpdateIssue:Ox,handleSelectIssue:Dx,handleBeginAnalysis:Ux,handleApprove:Oo,handleDeployBranch:Lx,handlePromoteBranch:Hx,handleCommitToBranch:Do,handleReject:qx,handleRefine:Uo,handleRefinePipelineFailure:Zx,handleCheckResolution:Kx,resolutionCheck:tc,resolutionChecking:cx,resolutionError:ux,handleViewExistingMr:Jx,handleCloseIssue:Wx,closeError:Fx,clearCloseError:Ix,handleBackToIssue:Px,handleReset:oc,handleDisconnect:()=>{Ic(),oc(),t("connect")},availableRepos:bx,selectedRepo:Q,setSelectedRepo:No,selectedSecondaryRepos:We,setSelectedSecondaryRepos:Eo,testDeployUrlTemplate:zx,availableModels:jx,selectedModel:sa,setSelectedModel:Ax,availableAgents:Tx,selectedAgent:kl,setSelectedAgent:wx,rateLimit:fx,quotaLoading:dx,quotaError:hx,quotaCheckedAt:mx,refreshQuota:vx,validating:ic,validationError:px,validation:ia,handleValidate:Mo,handleFixValidation:$x,autoPushOnValidatePass:hi,setAutoPushOnValidatePass:yx,refineThread:d,getToken:Bt}}const kb=["setPhase","setAnalysisPrompt","setAutoPushOnValidatePass","setSelectedModel","setSelectedAgent","setSelectedRepo","setSelectedSecondaryRepos","handleConnect","handleSelectMR","handleCreateIssue","handleUpdateIssue","handleSelectIssue","handleBeginAnalysis","handleApprove","handleDeployBranch","handlePromoteBranch","handleCommitToBranch","handleReject","handleRefine","handleUndoRefine","handleRefinePipelineFailure","handleCheckResolution","handleRestoreAnalysis","restoreAnalysisByOrdinal","handleDiscardStoredAnalysis","handleViewExistingMr","handleCloseIssue","clearCloseError","handleBackToIssue","handleReset","handleDisconnect","refreshQuota","handleValidate","handleFixValidation","loadIssues","loadOpenMRs","formatAnalysisDate","getToken"],Km=p.createContext(null),Jm=p.createContext(null),Fm=p.createContext(null),qb=new Set(kb);function Yb(e){const t={},l={};for(const[n,a]of Object.entries(e))qb.has(n)?l[n]=a:t[n]=a;return{state:t,actions:l}}function Gb({children:e}){const t=Hb(),{state:l,actions:n}=Yb(t),[a,i]=p.useState("issue"),[s,u]=p.useState(!1),[r,o]=p.useState(!1);return c.jsx(Km.Provider,{value:l,children:c.jsx(Jm.Provider,{value:n,children:c.jsx(Fm.Provider,{value:{activeDetailTab:a,setActiveDetailTab:i,mrMerged:s,setMrMerged:u,taskModalOpen:r,setTaskModalOpen:o},children:e})})})}function oo(e,t){const l=p.useContext(e);if(!l)throw new Error(`${t} must be used inside <ForgeProvider>`);return l}const Ne=()=>oo(Km,"useForgeState"),He=()=>oo(Jm,"useForgeActions"),Hl=()=>oo(Fm,"useForgeUI"),Xb=/\b(error|failed|failure|exception|panic|traceback|cannot|could not|refused|denied|timed? out|abort|unexpected)\b/i,Vb=/\b(warn|warning|skipped|skipping|deprecated|retry|retrying|fallback|truncated|missing)\b/i,Qb=/\b(ok|success|passed|completed|done|ready|merged|applied|resolved)\b/i,$b=/^(reasoning|scanning|analysis started|ci fix started|identified|loaded)\b/i;function Zb(e){return Xb.test(e)?"error":Vb.test(e)?"warn":Qb.test(e)?"success":$b.test(e)?"debug":"info"}function Kb(e){try{const t=new Date(e),l=String(t.getHours()).padStart(2,"0"),n=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),i=String(t.getMilliseconds()).padStart(3,"0");return`${l}:${n}:${a}.${i}`}catch{return"--:--:--.---"}}const Jb={info:{icon:"ℹ",text:"text-zinc-300",iconColor:"text-sky-400"},warn:{icon:"⚠",text:"text-amber-300",iconColor:"text-amber-400"},error:{icon:"✖",text:"text-red-300",iconColor:"text-red-400"},debug:{icon:"›",text:"text-zinc-500",iconColor:"text-zinc-600"},success:{icon:"✓",text:"text-emerald-300",iconColor:"text-emerald-400"}};function ec({entries:e,autoScroll:t=!0,variant:l="panel",heightClass:n="min-h-[12rem] max-h-[60vh]",label:a,badge:i,headerAccessory:s,empty:u="No output yet."}){const r=p.useRef(null);p.useEffect(()=>{t&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[e.length,t]);const o=e.map(m=>typeof m=="string"?{ts:new Date().toISOString(),message:m}:m),f=c.jsx("div",{ref:r,className:`font-mono text-[11px] leading-5 ${n} overflow-y-auto bg-black/60`,children:o.length===0?c.jsx("div",{className:"px-4 py-3 text-zinc-600 italic",children:u}):c.jsx("div",{children:o.map((m,h)=>{const g=m.level??Zb(m.message),v=Jb[g];return c.jsxs("div",{className:"flex items-start gap-2 px-3 py-[2px] hover:bg-white/[0.02] border-l-2 border-transparent",style:{borderLeftColor:g==="error"?"rgba(248, 113, 113, 0.5)":g==="warn"?"rgba(251, 191, 36, 0.4)":g==="success"?"rgba(52, 211, 153, 0.4)":"transparent"},children:[c.jsx("span",{className:"text-zinc-600 select-none shrink-0 tabular-nums",children:Kb(m.ts)}),c.jsx("span",{className:`${v.iconColor} shrink-0 select-none`,children:v.icon}),c.jsx("span",{className:`${v.text} whitespace-pre-wrap break-words`,children:m.message})]},h)})})});return l==="embedded"?f:c.jsxs("div",{className:"border border-zinc-800 rounded-lg overflow-hidden bg-zinc-950 shadow-inner",children:[c.jsxs("div",{className:"flex items-center justify-between bg-zinc-900/80 border-b border-zinc-800 px-3 py-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-zinc-500 font-mono uppercase tracking-wide",children:[c.jsxs("span",{className:"flex gap-1.5",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-red-500/60"}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/60"}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/60"})]}),a&&c.jsx("span",{className:"pl-1",children:a}),i&&c.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-zinc-800 text-[10px] text-zinc-400 tracking-normal normal-case",children:i})]}),s&&c.jsx("div",{className:"flex items-center",children:s})]}),f]})}function Fb(e,t=Date.now()){return e.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").split(`
71
- `).map((a,i)=>({ts:new Date(t+i).toISOString(),message:a.length?a:" "}))}const Wb=["fetch_issue","scan_repo","identify_files","fetch_files","generate_fix"],Ib={fetch_issue:"fetch_issue",scan_repo:"scan_repos",identify_files:"identify_files",fetch_files:"fetch_files",generate_fix:"generate_fix"};function Wm({steps:e,logs:t,issueTitle:l,mode:n="analyze"}){const a=new Set(e.map(u=>u.step)),i=e[e.length-1],s=n==="ci-fix"?"ci-fix":"analyze";return c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsxs("div",{className:"border border-zinc-800 rounded-lg overflow-hidden bg-zinc-950",children:[c.jsxs("div",{className:"flex items-center justify-between bg-zinc-900/80 border-b border-zinc-800 px-4 py-2",children:[c.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono text-zinc-400",children:[c.jsx("span",{className:"text-emerald-400",children:"●"}),c.jsxs("span",{className:"uppercase tracking-wide text-zinc-500",children:["forge / ",s]}),c.jsx("span",{className:"text-zinc-600",children:"›"}),c.jsx("span",{className:"text-zinc-200 truncate max-w-md",children:l})]}),n==="ci-fix"&&c.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wide px-2 py-0.5 rounded bg-amber-950/60 text-amber-300 border border-amber-900",children:"CI FAILURE"})]}),c.jsx("div",{className:"px-4 py-4",children:c.jsx("div",{className:"flex flex-col gap-1",children:Wb.map((u,r)=>{var z;const o=a.has(u),f=(i==null?void 0:i.step)===u,m=((z=e.find(b=>b.step===u))==null?void 0:z.message)??"",h=Ib[u]??u;let g,v="text-zinc-600";return o&&!f?(g=c.jsx("span",{className:"text-emerald-400 text-sm",children:"✓"}),v="text-zinc-400"):f?(g=c.jsx("span",{className:"w-3.5 h-3.5 rounded-full border-2 border-violet-400 border-t-transparent animate-spin inline-block"}),v="text-white"):g=c.jsx("span",{className:"text-zinc-700 text-sm",children:"○"}),c.jsxs("div",{className:"flex items-center gap-3 font-mono text-xs",children:[c.jsx("span",{className:"text-zinc-700 tabular-nums select-none w-6 text-right",children:String(r+1).padStart(2,"0")}),c.jsx("span",{className:"w-5 flex items-center justify-center shrink-0",children:g}),c.jsx("span",{className:`${v} w-36 shrink-0`,children:h}),c.jsx("span",{className:"text-zinc-500 truncate",children:m||"—"})]},u)})})})]}),t.length>0&&c.jsx(ec,{entries:t,label:`forge ${s}`,badge:`${t.length} entr${t.length===1?"y":"ies"}`,heightClass:"min-h-[40vh] max-h-[65vh]"})]})}function Pb(){const{selectedIssue:e,progressSteps:t,analysisLogs:l,analysisResult:n,analysisMode:a}=Ne();return e?c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsx(Wm,{steps:t,logs:l,issueTitle:e.title,mode:a}),n&&n.changes.length>0&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("p",{className:"text-xs text-zinc-500 uppercase tracking-wide",children:["Proposed changes (",n.changes.length," file",n.changes.length!==1?"s":"",")"]}),n.changes.map(i=>c.jsxs("div",{className:"flex items-start gap-3 bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-3",children:[c.jsx("span",{className:`text-xs font-medium mt-0.5 shrink-0 ${i.action==="create"?"text-green-400":i.action==="delete"?"text-red-400":"text-yellow-400"}`,children:i.action}),c.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[c.jsx("span",{className:"text-sm font-mono text-white truncate",children:i.file}),i.summary&&c.jsx("span",{className:"text-xs text-zinc-400",children:i.summary})]})]},i.file))]})]}):null}function e1({onCreate:e}){const[t,l]=p.useState(!1),[n,a]=p.useState(""),[i,s]=p.useState(""),[u,r]=p.useState(!1),[o,f]=p.useState(null),m=async h=>{if(h.preventDefault(),!!n.trim()){r(!0),f(null);try{await e(n.trim(),i.trim()),a(""),s(""),l(!1)}catch(g){f(g.message)}finally{r(!1)}}};return t?c.jsxs("form",{onSubmit:m,className:"border border-violet-600 rounded-lg px-4 py-4 flex flex-col gap-3 bg-zinc-800/50",children:[c.jsx("input",{type:"text",placeholder:"Issue title",value:n,onChange:h=>a(h.target.value),className:"w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:outline-none focus:border-violet-500"}),c.jsx("textarea",{placeholder:"Description (optional)",value:i,onChange:h=>s(h.target.value),rows:3,className:"w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:outline-none focus:border-violet-500 resize-none"}),o&&c.jsx("p",{className:"text-xs text-red-400",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:u||!n.trim(),className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-xs font-medium px-4 py-1.5 rounded transition-colors",children:u?"Creating...":"Create"}),c.jsx("button",{type:"button",onClick:()=>l(!1),className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors px-2",children:"Cancel"})]})]}):c.jsx("button",{onClick:()=>l(!0),className:"w-full text-left border border-dashed border-zinc-700 hover:border-violet-500 rounded-lg px-4 py-3 text-sm text-zinc-500 hover:text-violet-400 transition-colors",children:"+ New issue"})}function t1({issues:e,loading:t,onSelect:l,onCreate:n}){return t?c.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:5}).map((a,i)=>c.jsx("div",{className:"h-16 bg-zinc-800 rounded-lg animate-pulse"},i))}):c.jsxs("div",{className:"flex flex-col gap-2",children:[e.map(a=>c.jsx("button",{onClick:()=>l(a),className:"w-full text-left bg-zinc-800 hover:bg-zinc-700 border border-zinc-700 hover:border-violet-500 rounded-lg px-4 py-3 transition-colors group",children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:"text-xs text-zinc-500 font-mono",children:["#",a.iid]}),a.labels.map(i=>c.jsx("span",{className:"text-xs bg-zinc-700 text-zinc-300 px-1.5 py-0.5 rounded",children:i},i))]}),c.jsx("p",{className:"text-sm text-white font-medium truncate",children:a.title}),a.forgeBranch&&c.jsxs("p",{className:"text-[11px] font-mono text-violet-400/80 mt-0.5 truncate",title:a.forgeBranch,children:["⎇ ",a.forgeBranch]}),a.description&&c.jsx("p",{className:"text-xs text-zinc-500 mt-0.5 line-clamp-1",children:a.description})]}),c.jsx("span",{className:"text-violet-400 opacity-0 group-hover:opacity-100 transition-opacity text-sm shrink-0 mt-0.5",children:"Fix →"})]})},a.iid)),c.jsx(e1,{onCreate:n})]})}const l1={success:"bg-green-400",failed:"bg-red-400",running:"bg-yellow-400 animate-pulse",pending:"bg-yellow-600",canceled:"bg-zinc-500",skipped:"bg-zinc-600",created:"bg-zinc-500"},n1={success:"passed",failed:"failed",running:"running",pending:"pending",canceled:"canceled"};function a1({mrs:e,loading:t,error:l,onSelect:n,onRefresh:a}){return t?c.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((i,s)=>c.jsx("div",{className:"h-16 bg-zinc-800 rounded-lg animate-pulse"},s))}):l?c.jsxs("div",{className:"flex items-center justify-between bg-red-950/40 border border-red-800 rounded-lg px-4 py-3",children:[c.jsx("p",{className:"text-sm text-red-300",children:l}),c.jsx("button",{onClick:a,className:"text-xs text-red-400 hover:text-red-200 transition-colors ml-4 shrink-0",children:"Retry"})]}):e.length===0?c.jsx("div",{className:"text-center py-12 text-zinc-500 text-sm",children:"No open Forge merge requests."}):c.jsx("div",{className:"flex flex-col gap-2",children:e.map(i=>{const s=i.pipeline?l1[i.pipeline.status]??"bg-zinc-500":"bg-zinc-700",u=i.pipeline?n1[i.pipeline.status]??i.pipeline.status:"no pipeline",r=i.source_branch.match(/^forge\/issue-(\d+)-/),o=r?r[1]:null;return c.jsx("button",{onClick:()=>n(i),className:"w-full text-left bg-zinc-800 hover:bg-zinc-700 border border-zinc-700 hover:border-violet-500 rounded-lg px-4 py-3 transition-colors group",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"flex flex-col items-center gap-1 pt-0.5 shrink-0",children:c.jsx("span",{className:`w-2 h-2 rounded-full ${s}`,title:u})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[c.jsxs("span",{className:"text-xs text-zinc-500 font-mono",children:["!",i.iid]}),o&&c.jsxs("span",{className:"text-xs text-zinc-600 font-mono",children:["#",o]}),i.has_conflicts&&c.jsx("span",{className:"text-xs bg-amber-900/50 text-amber-400 border border-amber-700/50 px-1.5 py-0.5 rounded",children:"conflicts"}),i.pipeline&&c.jsx("span",{className:`text-xs ${i.pipeline.status==="failed"?"text-red-400":i.pipeline.status==="success"?"text-green-400":i.pipeline.status==="running"?"text-yellow-400":"text-zinc-500"}`,children:u})]}),c.jsx("p",{className:"text-sm text-white font-medium truncate",children:i.title}),c.jsx("p",{className:"text-xs font-mono text-zinc-500 mt-0.5 truncate",children:i.source_branch})]}),c.jsxs("div",{className:"shrink-0 flex flex-col items-end gap-1",children:[c.jsx("span",{className:"text-xs text-zinc-600",children:new Date(i.created_at).toLocaleDateString()}),c.jsx("span",{className:"text-violet-400 opacity-0 group-hover:opacity-100 transition-opacity text-xs",children:"View →"})]})]})},i.iid)})})}const i1={success:"text-green-400",failed:"text-red-400",running:"text-yellow-400",pending:"text-yellow-400",canceled:"text-zinc-500",skipped:"text-zinc-600",created:"text-zinc-400",manual:"text-blue-400"},s1={success:"✓",failed:"✗",running:"◎",pending:"○",canceled:"⊘",skipped:"→",created:"○",manual:"⊡"};function c1({mrs:e,loading:t,error:l,onRefresh:n}){if(t)return c.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((s,u)=>c.jsx("div",{className:"h-16 bg-zinc-800 rounded-lg animate-pulse"},u))});if(l)return c.jsxs("div",{className:"flex items-center justify-between bg-red-950/40 border border-red-800 rounded-lg px-4 py-3",children:[c.jsx("p",{className:"text-sm text-red-300",children:l}),c.jsx("button",{onClick:n,className:"text-xs text-red-400 hover:text-red-200 transition-colors ml-4 shrink-0",children:"Retry"})]});const a=e.filter(s=>s.pipeline),i=e.filter(s=>!s.pipeline);return e.length===0?c.jsx("div",{className:"text-center py-12 text-zinc-500 text-sm",children:"No open Forge merge requests."}):c.jsxs("div",{className:"flex flex-col gap-2",children:[a.map(s=>{const u=s.pipeline,r=i1[u.status]??"text-zinc-400",o=s1[u.status]??"?";return c.jsxs("div",{className:"bg-zinc-800/50 border border-zinc-700/50 rounded-lg px-4 py-3 flex items-center gap-4",children:[c.jsx("span",{className:`font-mono text-lg leading-none w-5 text-center ${r}`,children:o}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm text-zinc-200 truncate",children:s.title}),c.jsx("div",{className:"text-xs text-zinc-500 mt-0.5 font-mono",children:s.source_branch})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[c.jsx("span",{className:`text-xs font-medium ${r}`,children:u.status}),c.jsx("a",{href:u.web_url,target:"_blank",rel:"noreferrer",className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors",children:"Pipeline ↗"}),c.jsx("a",{href:s.web_url,target:"_blank",rel:"noreferrer",className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors",children:"MR ↗"})]})]},s.iid)}),i.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("div",{className:"text-xs text-zinc-600 mb-2",children:"No pipeline"}),i.map(s=>c.jsxs("div",{className:"bg-zinc-800/30 border border-zinc-800 rounded-lg px-4 py-3 flex items-center gap-4",children:[c.jsx("span",{className:"font-mono text-lg leading-none w-5 text-center text-zinc-700",children:"–"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm text-zinc-400 truncate",children:s.title}),c.jsx("div",{className:"text-xs text-zinc-600 mt-0.5 font-mono",children:s.source_branch})]}),c.jsx("a",{href:s.web_url,target:"_blank",rel:"noreferrer",className:"text-xs text-zinc-600 hover:text-zinc-400 transition-colors shrink-0",children:"MR ↗"})]},s.iid))]})]})}function u1(e){return e==="/mrs"||e.startsWith("/mrs/")?"mrs":e==="/pipelines"||e.startsWith("/pipelines/")?"pipelines":"issues"}function r1(){const e=it(),{issues:t,issuesLoading:l,issuesError:n,openMRs:a,openMRsLoading:i,openMRsError:s}=Ne(),{handleSelectIssue:u,handleCreateIssue:r,handleSelectMR:o,loadIssues:f,loadOpenMRs:m}=He(),h=u1(e.pathname),g=()=>{h==="issues"?f():m()};return c.jsxs("div",{className:"max-w-4xl mx-auto w-full flex flex-col gap-4",children:[c.jsx("div",{className:"flex items-center justify-end",children:c.jsx("button",{onClick:g,className:"text-xs text-zinc-600 hover:text-zinc-400 transition-colors",children:"↻ Refresh"})}),h==="issues"&&c.jsxs(c.Fragment,{children:[n&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-48 overflow-y-auto leading-snug",children:n}),c.jsx(t1,{issues:t,loading:l,onSelect:u,onCreate:r})]}),h==="mrs"&&c.jsx(a1,{mrs:a,loading:i,error:s,onSelect:o,onRefresh:m}),h==="pipelines"&&c.jsx(c1,{mrs:a,loading:i,error:s,onRefresh:m})]})}function Im(){const[e,t]=p.useState(!1),{closeError:l}=Ne(),{handleCloseIssue:n,clearCloseError:a}=He();return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center",children:e?c.jsxs("span",{className:"flex items-center gap-2 bg-red-950/40 border border-red-800/70 rounded-lg px-3 py-1.5",children:[c.jsx("span",{className:"text-sm text-red-200",children:"Close this issue?"}),c.jsx("button",{onClick:()=>{t(!1),n()},className:"text-sm font-medium text-white bg-red-700/70 hover:bg-red-600 rounded px-2.5 py-0.5 transition-colors",children:"Confirm"}),c.jsx("button",{onClick:()=>t(!1),className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",children:"Keep open"})]}):c.jsxs("button",{onClick:()=>{a(),t(!0)},className:"flex items-center gap-1.5 text-sm text-zinc-500 hover:text-red-300 border border-transparent hover:border-red-900/70 rounded-lg px-3 py-1.5 transition-colors",title:"Close this issue",children:[c.jsx("span",{className:"text-[11px]",children:"✕"}),"Close Issue"]})}),l&&c.jsxs("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300 flex items-start justify-between gap-3 mt-2",children:[c.jsx("span",{className:"flex-1",children:l}),c.jsx("button",{onClick:a,className:"text-red-400 hover:text-red-200 shrink-0",children:"✕"})]})]})}const o1={success:"bg-green-400",failed:"bg-red-400",running:"bg-yellow-400 animate-pulse",pending:"bg-yellow-600",canceled:"bg-zinc-500",skipped:"bg-zinc-600",created:"bg-zinc-500"},f1={success:"passed",failed:"failed",running:"running",pending:"pending",canceled:"canceled",skipped:"skipped",created:"created"},d1={success:"text-green-400",failed:"text-red-400",running:"text-yellow-400",pending:"text-yellow-500",canceled:"text-zinc-500",skipped:"text-zinc-600",created:"text-zinc-500"};function fo({mrs:e}){return e.length===0?null:c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-xs font-medium text-zinc-500 uppercase tracking-wide",children:"Merged MRs"}),c.jsx("div",{className:"flex flex-col gap-1",children:e.map(t=>{var s;const l=(s=t.pipeline)==null?void 0:s.status,n=l?o1[l]??"bg-zinc-500":"bg-zinc-700",a=l?f1[l]??l:"no pipeline",i=l?d1[l]??"text-zinc-500":"text-zinc-600";return c.jsxs("div",{className:"flex items-center justify-between bg-zinc-900 border border-zinc-800 rounded px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${n}`,title:`post-merge pipeline: ${a}`}),c.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[c.jsxs("a",{href:t.web_url,target:"_blank",rel:"noreferrer",className:"text-sm text-zinc-300 hover:text-white transition-colors truncate",children:["!",t.iid," ",t.title]}),c.jsx("span",{className:"text-xs font-mono text-zinc-600 truncate",children:t.branchName})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0 ml-3",children:[t.pipeline?c.jsx("a",{href:t.pipeline.web_url,target:"_blank",rel:"noreferrer",className:`text-xs hover:underline ${i}`,title:"View post-merge pipeline in GitLab",children:a}):c.jsx("span",{className:"text-xs text-zinc-600 italic",children:"no pipeline"}),c.jsx("span",{className:"text-xs text-zinc-600",children:new Date(t.merged_at).toLocaleDateString()})]})]},t.iid)})})]})}function h1(){const{selectedIssue:e,analysisPrompt:t,refining:l,mergedMrs:n}=Ne(),{setAnalysisPrompt:a,handleBeginAnalysis:i}=He();return e?c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[c.jsxs("span",{className:"font-mono",children:["#",e.iid]}),e.labels.map(s=>c.jsx("span",{className:"bg-zinc-700 text-zinc-300 px-1.5 py-0.5 rounded",children:s},s))]}),c.jsx("h2",{className:"text-lg font-semibold text-white",children:e.title}),c.jsxs("p",{className:"text-xs text-zinc-500",children:["by ",e.author.name," ·"," ",c.jsx("a",{href:e.web_url,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300 transition-colors",children:"view on GitLab ↗"})]})]}),e.description&&c.jsx("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-4 text-sm text-zinc-300 whitespace-pre-wrap leading-relaxed w-full max-h-[50vh] overflow-y-auto",children:e.description}),!l&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("textarea",{value:t,onChange:s=>a(s.target.value),placeholder:"Optional instructions for the analysis…",rows:2,className:"w-full bg-zinc-800/60 border border-zinc-700 rounded-lg px-3 py-2 text-sm text-zinc-200 placeholder-zinc-600 focus:outline-none focus:border-violet-500 resize-none"}),c.jsxs("div",{className:"flex items-center justify-between gap-6 border-t border-zinc-800/60 pt-3",children:[c.jsx("div",{className:"flex items-center gap-3",children:c.jsx("button",{onClick:i,className:"bg-zinc-700 hover:bg-zinc-600 text-zinc-200 text-sm font-medium px-4 py-2 rounded-lg transition-colors",children:"Analyze & Update MR"})}),c.jsx(Im,{})]})]}),c.jsx(fo,{mrs:n})]}):null}function m1(e){const t=[];let l=null;for(const n of e.split(`
72
- `))n.startsWith("@@")?(l={header:n,lines:[]},t.push(l)):l&&(n.startsWith("+")?l.lines.push({type:"add",content:n.slice(1)}):n.startsWith("-")?l.lines.push({type:"remove",content:n.slice(1)}):n.startsWith("\\")||l.lines.push({type:"context",content:n.slice(1)}));return t}function x1({d:e}){const[t,l]=p.useState(!0),n=m1(e.diff),a=e.new_file?"A":e.deleted_file?"D":e.renamed_file?"R":"M",i=a==="A"?"text-green-400":a==="D"?"text-red-400":a==="R"?"text-blue-400":"text-zinc-400";return c.jsxs("div",{className:"border border-zinc-700 rounded-lg overflow-hidden",children:[c.jsxs("button",{onClick:()=>l(s=>!s),className:"w-full flex items-center gap-2 bg-zinc-800 px-3 py-2 text-left hover:bg-zinc-750 transition-colors",children:[c.jsx("span",{className:`text-xs font-mono font-bold ${i}`,children:a}),c.jsx("span",{className:"text-xs font-mono text-zinc-300 flex-1 truncate",children:e.new_path!==e.old_path&&e.old_path!=="/dev/null"?`${e.old_path} → ${e.new_path}`:e.new_path}),c.jsx("span",{className:"text-zinc-600 text-xs",children:t?"▲":"▼"})]}),t&&c.jsx("div",{className:"overflow-x-auto",children:n.length===0?c.jsx("p",{className:"text-xs text-zinc-500 px-3 py-2",children:"Binary or empty diff"}):n.map((s,u)=>c.jsxs("div",{children:[c.jsx("div",{className:"bg-zinc-900 px-3 py-0.5 text-xs font-mono text-zinc-500",children:s.header}),s.lines.map((r,o)=>c.jsxs("div",{className:`flex font-mono text-xs leading-5 ${r.type==="add"?"bg-green-950/40 text-green-300":r.type==="remove"?"bg-red-950/40 text-red-300":"text-zinc-400"}`,children:[c.jsx("span",{className:`select-none w-4 shrink-0 text-center ${r.type==="add"?"text-green-500":r.type==="remove"?"text-red-500":"text-zinc-600"}`,children:r.type==="add"?"+":r.type==="remove"?"−":" "}),c.jsx("span",{className:"pl-2 whitespace-pre",children:r.content})]},o))]},u))})]})}function Pm({mrIid:e,token:t,repo:l,onMerged:n}){const[a,i]=p.useState(null),[s,u]=p.useState(!0),[r,o]=p.useState(null),[f,m]=p.useState(!1),[h,g]=p.useState(null),[v,z]=p.useState(!1),[b,x]=p.useState(null),[d,y]=p.useState(null),[S,j]=p.useState(!1),[M,R]=p.useState(null),[C,U]=p.useState(!1),O=p.useRef(null),ee=p.useRef(!1),he=p.useRef(!1),_=l?`?repo=${encodeURIComponent(l)}`:"",F=p.useCallback(async()=>{try{const B=await window.fetch(`/api/forge/mr/${e}/detail${_}`,{headers:{Authorization:`Bearer ${t}`}});if(!B.ok)throw B.status===404?(ee.current=!0,O.current&&(clearInterval(O.current),O.current=null),new Error("MR not found — it may have been deleted or belongs to a different project")):new Error(`MR API ${B.status}`);const I=await B.json();if(ee.current)return;if(i(I),o(null),u(!1),I.state==="merged"&&!he.current){he.current=!0,O.current&&clearInterval(O.current),O.current=null,n==null||n();return}!I.rebase_in_progress&&O.current&&(clearInterval(O.current),O.current=null)}catch(B){if(ee.current)return;o(B.message),u(!1)}},[e,t,_]);p.useEffect(()=>(ee.current=!1,F(),()=>{ee.current=!0,O.current&&clearInterval(O.current)}),[F]);const k=async()=>{m(!0),g(null);try{const B=await window.fetch(`/api/forge/mr/${e}/rebase${_}`,{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!B.ok){const I=await B.text().catch(()=>"");throw new Error(I||`Rebase API ${B.status}`)}i(I=>I&&{...I,rebase_in_progress:!0}),O.current&&clearInterval(O.current),O.current=setInterval(F,3e3)}catch(B){g(B.message)}finally{m(!1)}},w=async()=>{z(!0),x(null);const B=a==null?void 0:a.merge_when_pipeline_succeeds;try{const I=B?`/api/forge/mr/${e}/cancel-auto-merge${_}`:`/api/forge/mr/${e}/auto-merge${_}`,st=await window.fetch(I,{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!st.ok){const je=await st.text().catch(()=>"");throw new Error(je||`Auto-merge API ${st.status}`)}i(je=>je&&{...je,merge_when_pipeline_succeeds:!B})}catch(I){x(I.message)}finally{z(!1)}},q=async()=>{j(!0),R(null);try{const B=await window.fetch(`/api/forge/mr/${e}/diffs${_}`,{headers:{Authorization:`Bearer ${t}`}});if(!B.ok)throw new Error(`Diffs API ${B.status}`);const I=await B.json();y(I.diffs??[])}catch(B){R(B.message)}finally{j(!1)}},G=()=>{!C&&d===null&&q(),U(B=>!B)};if(s)return c.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500 py-1",children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-zinc-500 border-t-transparent animate-spin inline-block shrink-0"}),"Loading MR status…"]});if(r||!a)return c.jsxs("div",{className:"text-sm text-zinc-500 py-1",children:["Could not load MR status",r?` — ${r}`:"","."]});const W=a.has_conflicts||a.detailed_merge_status==="need_rebase"||a.merge_status==="cannot_be_merged";return c.jsxs("div",{className:"flex flex-col gap-3",children:[a.rebase_in_progress&&c.jsxs("div",{className:"flex items-center gap-2 bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-3",children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-yellow-400 border-t-transparent animate-spin inline-block shrink-0"}),c.jsx("span",{className:"text-sm text-yellow-300",children:"Rebase in progress…"})]}),!a.rebase_in_progress&&W&&c.jsxs("div",{className:"bg-amber-950/40 border border-amber-700 rounded-lg px-4 py-3 flex items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-amber-300",children:a.has_conflicts?"Merge conflicts detected":"Rebase required"}),c.jsx("p",{className:"text-xs text-amber-400/70 mt-0.5",children:a.has_conflicts?"This branch has conflicts with the target branch.":"The target branch has moved ahead of this MR branch."}),h&&c.jsx("p",{className:"text-xs text-red-400 mt-1",children:h})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx("button",{onClick:k,disabled:f,className:"bg-amber-600 hover:bg-amber-500 disabled:opacity-50 text-white text-xs font-medium px-3 py-1.5 rounded-lg transition-colors",children:f?"Rebasing…":"Rebase"}),a.has_conflicts&&c.jsx("a",{href:`${a.web_url}/conflicts`,target:"_blank",rel:"noreferrer",className:"text-xs text-amber-400 hover:text-amber-200 transition-colors",children:"Resolve in GitLab ↗"})]})]}),!W&&!a.rebase_in_progress&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[a.merge_when_pipeline_succeeds&&c.jsx("span",{className:"text-xs text-violet-400",children:"Auto-merge set — will merge when pipeline passes"}),b&&c.jsx("span",{className:"text-xs text-red-400",children:b})]}),c.jsx("button",{onClick:w,disabled:v,className:a.merge_when_pipeline_succeeds?"text-xs text-zinc-500 hover:text-zinc-300 disabled:opacity-50 transition-colors":"text-xs text-violet-400 hover:text-violet-200 disabled:opacity-50 transition-colors",children:v?"…":a.merge_when_pipeline_succeeds?"Cancel auto-merge":"Set auto-merge"})]}),c.jsxs("div",{children:[c.jsxs("button",{onClick:G,className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors flex items-center gap-1",children:[c.jsx("span",{className:`transition-transform ${C?"rotate-90":""} inline-block`,children:"›"}),C?"Hide diff":"Show current diff",d!==null&&` (${d.length} file${d.length!==1?"s":""})`]}),C&&c.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[S&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500",children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-zinc-500 border-t-transparent animate-spin inline-block shrink-0"}),"Loading diff…"]}),M&&c.jsx("p",{className:"text-xs text-red-400",children:M}),d&&d.length===0&&c.jsx("p",{className:"text-xs text-zinc-500",children:"No changes in this MR."}),d&&d.map((B,I)=>c.jsx(x1,{d:B},I))]})]})]})}const p1={success:"text-green-400",failed:"text-red-400",running:"text-yellow-400",pending:"text-yellow-400",canceled:"text-zinc-500",skipped:"text-zinc-600",created:"text-zinc-400",waiting_for_resource:"text-zinc-400",preparing:"text-zinc-400",scheduled:"text-zinc-400",manual:"text-blue-400"},g1={success:"✓",failed:"✗",running:"◎",pending:"○",canceled:"⊘",skipped:"→",created:"○",manual:"⊡"},Sd=new Set(["success","failed","canceled"]);function eu(e){return p1[e]??"text-zinc-400"}function zd(e){return g1[e]??"○"}function y1(e){const t=new Map;return e.forEach(l=>{t.has(l.stage)||t.set(l.stage,[]),t.get(l.stage).push(l)}),t}function Fa({endpoint:e,token:t,repo:l,onRefinePipelineFailure:n,onStatusChange:a}){const[i,s]=p.useState(null),[u,r]=p.useState([]),[o,f]=p.useState(!0),[m,h]=p.useState(null),[g,v]=p.useState(""),[z,b]=p.useState({}),[x,d]=p.useState({}),y=p.useRef(!1),S=p.useRef(null),j=p.useRef(!1),M=p.useRef(null),R=p.useRef(a);p.useEffect(()=>{R.current=a},[a]);const C=async()=>{var k,w;const _=new AbortController,F=setTimeout(()=>_.abort(),12e3);try{const q=e.includes("?")?"&":"?",G=l?`${q}repo=${encodeURIComponent(l)}`:"",W=await window.fetch(`/api/forge/${e}${G}`,{headers:{Authorization:`Bearer ${t}`},signal:_.signal});if(clearTimeout(F),!W.ok)throw new Error(`Pipeline API ${W.status}`);const B=await W.json();if(y.current)return;s(B.pipeline??null),r(B.jobs??[]),h(null),f(!1);const I=((k=B.pipeline)==null?void 0:k.status)??null;I!==M.current&&(M.current=I,(w=R.current)==null||w.call(R,I)),B.pipeline&&Sd.has(B.pipeline.status)&&(y.current=!0,S.current&&clearInterval(S.current),B.pipeline.status==="failed"&&!j.current&&(j.current=!0,(B.jobs??[]).filter(je=>je.status==="failed").forEach(je=>{window.fetch(`/api/forge/jobs/${je.id}/trace`,{headers:{Authorization:`Bearer ${t}`}}).then(ke=>ke.json()).then(ke=>b($e=>({...$e,[je.id]:ke.trace??"(empty)"}))).catch(()=>b(ke=>({...ke,[je.id]:"(failed to load trace)"})))})))}catch(q){if(clearTimeout(F),y.current)return;const G=q.name==="AbortError"?"Request timed out":q.message;h(G),f(!1)}};p.useEffect(()=>(y.current=!1,j.current=!1,M.current=null,f(!0),h(null),b({}),C(),S.current=setInterval(C,1e4),()=>{y.current=!0,S.current&&clearInterval(S.current)}),[e,t]);const U=async _=>{if(z[_]!==void 0){b(F=>{const k={...F};return delete k[_],k});return}d(F=>({...F,[_]:!0}));try{const k=await(await window.fetch(`/api/forge/jobs/${_}/trace`,{headers:{Authorization:`Bearer ${t}`}})).json();b(w=>({...w,[_]:k.trace??"(empty)"}))}catch{b(F=>({...F,[_]:"(failed to load trace)"}))}finally{d(F=>({...F,[_]:!1}))}},O=u.filter(_=>_.status==="failed");if(o)return c.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-zinc-500",children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-zinc-500 border-t-transparent animate-spin inline-block shrink-0"}),"Waiting for pipeline..."]});if(m)return c.jsxs("div",{className:"flex items-center justify-between py-3 px-4 bg-zinc-800 border border-zinc-700 rounded-lg",children:[c.jsxs("p",{className:"text-sm text-zinc-400",children:["Could not load pipeline — ",m]}),c.jsx("button",{onClick:()=>{f(!0),h(null),C()},className:"text-xs text-zinc-400 hover:text-white transition-colors ml-4 shrink-0",children:"Retry"})]});if(!i)return c.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-zinc-500",children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-zinc-600 border-t-transparent animate-spin inline-block shrink-0"}),"Waiting for pipeline to start..."]});const ee=y1(u),he=i.status==="failed";return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`font-mono text-sm ${eu(i.status)}`,children:i.status==="running"?c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-yellow-400 border-t-transparent animate-spin inline-block"}):zd(i.status)}),c.jsx("span",{className:`text-sm font-medium capitalize ${eu(i.status)}`,children:i.status}),c.jsxs("span",{className:"text-xs text-zinc-500",children:["#",i.id]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:()=>{f(!0),C()},className:"text-xs text-zinc-600 hover:text-zinc-400 transition-colors",children:"↻"}),c.jsx("a",{href:i.web_url,target:"_blank",rel:"noreferrer",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",children:"View in GitLab →"})]})]}),he&&n&&O.length>0&&c.jsxs("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 flex flex-col gap-3",children:[c.jsx("div",{className:"flex items-start justify-between gap-4",children:c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-red-300",children:"Pipeline failed"}),c.jsxs("p",{className:"text-xs text-red-400/70 mt-0.5",children:[O.length," job",O.length!==1?"s":""," ","failed: ",O.map(_=>_.name).join(", ")]})]})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"text",value:g,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),n(O.map(F=>F.id),g,l))},placeholder:"Add context or instructions for the AI fix (optional)",className:"flex-1 bg-zinc-900 border border-red-800/50 rounded-lg px-3 py-1.5 text-xs text-zinc-200 placeholder-zinc-600 focus:outline-none focus:border-red-600"}),c.jsx("button",{onClick:()=>n(O.map(_=>_.id),g,l),className:"shrink-0 bg-violet-600 hover:bg-violet-500 text-white text-xs font-medium px-4 py-2 rounded-lg transition-colors",children:"Fix with AI"})]})]}),Array.from(ee.entries()).map(([_,F])=>c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-zinc-500 uppercase tracking-wide mb-2",children:_}),c.jsx("div",{className:"flex flex-col gap-1",children:F.map(k=>c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("div",{className:"flex items-center gap-3 bg-zinc-800 rounded px-3 py-2",children:[c.jsx("span",{className:`font-mono text-sm w-4 ${eu(k.status)}`,children:k.status==="running"?c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-yellow-400 border-t-transparent animate-spin inline-block"}):zd(k.status)}),c.jsx("a",{href:k.web_url,target:"_blank",rel:"noreferrer",className:"text-sm text-zinc-200 hover:text-white transition-colors flex-1",children:k.name}),k.duration!=null&&c.jsxs("span",{className:"text-xs text-zinc-500",children:[Math.round(k.duration),"s"]}),Sd.has(k.status)&&c.jsx("button",{onClick:()=>U(k.id),className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors shrink-0",children:x[k.id]?c.jsx("span",{className:"w-3 h-3 rounded-full border border-zinc-500 border-t-transparent animate-spin inline-block"}):z[k.id]!==void 0?"Hide logs":"View logs"})]}),z[k.id]!==void 0&&c.jsx("div",{className:"border border-zinc-800 border-t-0 rounded-b overflow-hidden",children:c.jsx(ec,{variant:"embedded",autoScroll:!1,heightClass:"max-h-64",entries:Fb(z[k.id].split(`
73
- `).slice(-200).join(`
74
- `)),empty:"(empty trace)"})})]},k.id))})]},_))]})}function v1(e){return e.replicas.ready===0?"down":e.replicas.ready<e.replicas.desired?"degraded":e.replicas.updated<e.replicas.desired?"updating":"healthy"}const b1={healthy:{dot:"bg-green-400",label:"Healthy",text:"text-green-400"},updating:{dot:"bg-yellow-400 animate-pulse",label:"Updating",text:"text-yellow-400"},degraded:{dot:"bg-orange-400",label:"Degraded",text:"text-orange-400"},down:{dot:"bg-red-400",label:"Down",text:"text-red-400"}};function S1({token:e}){const[t,l]=p.useState([]),[n,a]=p.useState(!0),[i,s]=p.useState(null),[u,r]=p.useState(null);return p.useEffect(()=>{let o=!1;const f=async()=>{try{const h=await window.fetch("/api/forge/rollout",{headers:{Authorization:`Bearer ${e}`}});if(!h.ok)throw new Error(`${h.status}`);const g=await h.json();if(o)return;l(g.deployments??[]),r(new Date),s(null)}catch(h){o||s(h.message)}finally{o||a(!1)}};f();const m=setInterval(f,1e4);return()=>{o=!0,clearInterval(m)}},[e]),n?c.jsx("div",{className:"flex flex-col gap-2",children:Array.from({length:3}).map((o,f)=>c.jsx("div",{className:"h-14 bg-zinc-800 rounded-lg animate-pulse"},f))}):i?c.jsxs("p",{className:"text-sm text-zinc-500 text-center py-4",children:["K8s rollout unavailable — ",i]}):c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{className:"text-xs text-zinc-500 uppercase tracking-wide",children:"test namespace"}),u&&c.jsxs("p",{className:"text-xs text-zinc-600",children:["refreshed ",u.toLocaleTimeString()]})]}),t.length===0?c.jsx("p",{className:"text-sm text-zinc-500 text-center py-4",children:"No deployments found in test namespace."}):t.map(o=>{var g;const f=v1(o),m=b1[f],h=((g=o.image)==null?void 0:g.split(":")[1])??o.image;return c.jsxs("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-3 flex items-center gap-4",children:[c.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${m.dot}`}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm text-white font-medium",children:o.name}),c.jsx("p",{className:"text-xs text-zinc-500 font-mono truncate mt-0.5",children:h})]}),c.jsxs("div",{className:"text-right shrink-0",children:[c.jsx("p",{className:`text-sm font-medium ${m.text}`,children:m.label}),c.jsxs("p",{className:"text-xs text-zinc-500",children:[o.replicas.ready,"/",o.replicas.desired," ready"]})]})]},o.name)})]})}function ex({showTryAgain:e=!1}){const{resolutionCheck:t,resolutionChecking:l,resolutionError:n}=Ne(),{handleCheckResolution:a,handleBeginAnalysis:i}=He();return t?c.jsxs("div",{className:`border rounded-lg px-4 py-3 flex flex-col gap-2 ${t.resolved?"bg-green-950/40 border-green-800":"bg-amber-950/40 border-amber-800"}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`text-sm font-medium ${t.resolved?"text-green-300":"text-amber-300"}`,children:t.resolved?"✓ Issue appears resolved":"✗ Issue may not be resolved"}),c.jsx("button",{onClick:a,disabled:l,className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors ml-auto",children:"Re-check"})]}),c.jsx("p",{className:`text-xs leading-relaxed ${t.resolved?"text-green-400/80":"text-amber-400/80"}`,children:t.reasoning}),e&&!t.resolved&&c.jsx("button",{onClick:i,className:"self-start mt-1 bg-violet-600 hover:bg-violet-500 text-white text-xs font-medium px-4 py-1.5 rounded-lg transition-colors",children:"Try Again"})]}):c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:a,disabled:l,className:"flex items-center gap-2 text-sm text-zinc-400 hover:text-white border border-zinc-700 hover:border-zinc-500 rounded-lg px-4 py-2 transition-colors disabled:opacity-50",children:l?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-zinc-400 border-t-transparent animate-spin inline-block shrink-0"}),"Checking…"]}):"Check if resolved"}),n&&c.jsx("span",{className:"text-xs text-red-400",children:n})]})}function z1(){const{applyResult:e,selectedIssue:t,progressSteps:l,refining:n,applying:a,applyError:i,mergedMrs:s,availableRepos:u,selectedRepo:r}=Ne(),{handleRefinePipelineFailure:o,handlePromoteBranch:f,getToken:m}=He(),{mrMerged:h,setMrMerged:g}=Hl(),[v,z]=p.useState({});if(!e)return null;const b=new Set(e.applications.map(d=>d.repo)),x=b.size>1;return c.jsxs("div",{className:"flex flex-col gap-8",children:[x&&c.jsxs("div",{className:"bg-violet-950/30 border border-violet-900/50 rounded-lg px-4 py-3 flex items-center gap-3",children:[c.jsx("span",{className:"text-violet-300 text-sm",children:"⚡"}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("p",{className:"text-sm font-medium text-violet-200",children:["Full-stack change across ",b.size," repositories"]}),c.jsx("p",{className:"text-xs text-violet-400/80 mt-0.5",children:"Each repo has its own branch + CI pipeline. All need to go green before merging."})]})]}),e.applications.map((d,y)=>{var j;const S=((j=u.find(M=>M.id===d.repo))==null?void 0:j.label)??d.repo.split("/").pop()??d.repo;return c.jsxs("div",{className:"flex flex-col gap-4",children:[e.applications.length>1&&c.jsxs("div",{className:"flex items-center gap-3 border-b border-zinc-800 pb-2",children:[c.jsxs("span",{className:"text-xs font-mono font-semibold text-violet-300",children:["[",S,"]"]}),c.jsx("span",{className:"text-xs text-zinc-500 font-mono truncate",children:d.repo}),c.jsx("span",{className:"ml-auto text-[10px] text-zinc-600 uppercase tracking-wide",children:y===0?"primary":"companion"})]}),c.jsxs("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-white",children:d.mr?d.mr.title:"Test deploy — branch only, no MR"}),c.jsxs("p",{className:"text-xs text-zinc-400 mt-0.5",children:["Branch: ",c.jsx("span",{className:"font-mono",children:d.branchName})]})]}),d.mr?c.jsx("a",{href:d.mr.web_url,target:"_blank",rel:"noreferrer",className:"text-sm text-violet-400 hover:underline shrink-0 ml-4",children:"View MR →"}):v[`${d.repo}:${d.branchName}`]==="success"&&c.jsx("button",{onClick:()=>f(d),disabled:a,className:"shrink-0 ml-4 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors",title:"Pipeline is green — promote this branch to a merge request",children:a?"Creating MR…":"Approve & Create MR"})]}),!d.mr&&i&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-4 py-2 text-xs text-red-300",children:i}),d.mr&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"MR Status"}),c.jsx(Pm,{mrIid:d.mr.iid,token:m(),repo:d.repo,onMerged:()=>{y===0&&g(!0)}})]}),!n&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:d.mr?"CI Pipeline":"Branch Pipeline (test deploy)"}),c.jsx(Fa,{endpoint:d.mr?`mr/${d.mr.iid}/pipeline`:`branch-pipeline?branch=${encodeURIComponent(d.branchName)}`,token:m(),repo:d.repo,onRefinePipelineFailure:o,onStatusChange:d.mr?void 0:M=>z(R=>({...R,[`${d.repo}:${d.branchName}`]:M??""}))})]})]},`${d.repo}:${d.branchName}`)}),n&&t&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"CI Fix in Progress"}),c.jsx(Wm,{steps:l,logs:[],issueTitle:t.title,mode:"ci-fix"})]}),t&&h&&!n&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"Post-merge Pipeline"}),c.jsx("span",{className:"text-xs text-zinc-600",children:"main branch"})]}),c.jsx(Fa,{endpoint:`issues/${t.iid}/post-merge-pipeline`,token:m(),repo:r||void 0,onRefinePipelineFailure:o})]}),t&&h&&!n&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"Resolution"}),c.jsx(ex,{showTryAgain:!0})]}),!n&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"Test Rollout"}),c.jsx(S1,{token:m()})]}),c.jsx(fo,{mrs:s})]})}function tx({tabs:e,active:t,onSelect:l}){return c.jsx("div",{className:"flex items-center gap-1 bg-zinc-800/60 rounded-lg p-1 self-start",children:e.map(n=>{const a=t===n.id;return c.jsxs("button",{onClick:()=>l(n.id),className:`px-4 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center gap-1.5 ${a?"bg-zinc-700 text-white":"text-zinc-500 hover:text-zinc-300"}`,children:[n.label,(n.loading||n.badge!==void 0)&&c.jsx("span",{className:"inline-flex items-center h-4",children:n.loading?c.jsx("span",{className:"w-2.5 h-2.5 rounded-full border border-current border-t-transparent animate-spin"}):n.badge})]},n.id)})})}function N1(){const{applyResult:e,selectedIssue:t}=Ne(),{activeDetailTab:l,setActiveDetailTab:n}=Hl(),a=on();if(!e)return null;const i=f=>{if(!t)return;const m=f==="mr"?"mr":"issue";n(m),a(m==="mr"?`/issues/${t.iid}/mr`:`/issues/${t.iid}`,{replace:!0})},s=e.applications,u=s.length>0&&c.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${l==="mr"?"bg-zinc-600 text-zinc-300":"bg-violet-600/40 text-violet-300"}`,children:s.length>1?`${s.length} MRs`:s[0].mr?`!${s[0].mr.iid}`:"branch"}),r=[{id:"issue",label:"Issue"},{id:"mr",label:"Pipeline",badge:u||void 0}],o=l==="mr"||!t;return c.jsxs("div",{className:"max-w-4xl mx-auto w-full flex flex-col gap-6",children:[t&&c.jsx(tx,{tabs:r,active:l,onSelect:i}),l==="issue"&&t&&c.jsx(h1,{}),o&&c.jsx(z1,{})]})}function lx(e,t){const l=e.split(`
75
- `),n=t.split(`
76
- `),a=l.length,i=n.length,s=Array.from({length:a+1},()=>new Array(i+1).fill(0));for(let f=1;f<=a;f++)for(let m=1;m<=i;m++)s[f][m]=l[f-1]===n[m-1]?s[f-1][m-1]+1:Math.max(s[f-1][m],s[f][m-1]);const u=[];let r=a,o=i;for(;r>0||o>0;)r>0&&o>0&&l[r-1]===n[o-1]?(u.unshift({type:"context",text:l[r-1]}),r--,o--):o>0&&(r===0||s[r][o-1]>=s[r-1][o])?(u.unshift({type:"add",text:n[o-1]}),o--):(u.unshift({type:"remove",text:l[r-1]}),r--);return j1(u)}function j1(e){const l=new Set;e.forEach((s,u)=>{s.type!=="context"&&l.add(u)});const n=new Set;l.forEach(s=>{for(let u=Math.max(0,s-3);u<=Math.min(e.length-1,s+3);u++)n.add(u)});const a=[];let i=!0;return e.forEach((s,u)=>{n.has(u)?(i||a.push({type:"context",text:"..."}),a.push(s),i=!0):i=!1}),a}function E1({change:e}){const[t,l]=p.useState(!0),n=e.action==="modify"&&e.original?lx(e.original,e.proposed):e.action==="create"?e.proposed.split(`
77
- `).map(u=>({type:"add",text:u})):e.original?e.original.split(`
78
- `).map(u=>({type:"remove",text:u})):[],a=e.action==="create"?"text-green-400":e.action==="delete"?"text-red-400":"text-yellow-400",i=n.filter(u=>u.type==="add").length,s=n.filter(u=>u.type==="remove").length;return c.jsxs("div",{className:"border border-zinc-700 rounded-lg overflow-hidden",children:[c.jsxs("button",{onClick:()=>l(u=>!u),className:"w-full flex items-center gap-3 px-4 py-2.5 bg-zinc-800 hover:bg-zinc-750 text-left",children:[c.jsx("span",{className:`text-xs font-medium ${a}`,children:e.action}),c.jsx("span",{className:"text-sm text-white font-mono flex-1 truncate",children:e.file}),c.jsxs("span",{className:"text-xs text-green-400",children:["+",i]}),c.jsxs("span",{className:"text-xs text-red-400 ml-1",children:["-",s]}),c.jsx("span",{className:"text-zinc-500 text-xs ml-2",children:t?"▲":"▼"})]}),c.jsx("div",{className:"px-4 py-1.5 bg-zinc-900 border-t border-zinc-700 text-xs text-zinc-400",children:e.summary}),t&&c.jsx("div",{className:"overflow-x-auto",children:c.jsx("table",{className:"w-full text-xs font-mono border-collapse",children:c.jsx("tbody",{children:n.map((u,r)=>c.jsxs("tr",{className:u.type==="add"?"bg-green-950/40":u.type==="remove"?"bg-red-950/40":"",children:[c.jsx("td",{className:"w-6 px-2 py-px text-zinc-600 select-none border-r border-zinc-800 text-right",children:u.type==="add"?"+":u.type==="remove"?"-":" "}),c.jsx("td",{className:`px-3 py-px whitespace-pre ${u.type==="add"?"text-green-300":u.type==="remove"?"text-red-300":u.text==="..."?"text-zinc-600":"text-zinc-300"}`,children:u.text})]},r))})})})]})}function T1(e,t){const l=t==null?void 0:t.find(n=>n.id===e);return(l==null?void 0:l.label)??e.split("/").pop()??e}function R1(e,t,l){const n=new Map;for(const a of e){const i=a.repo||"(unknown)",s=n.get(i)??[];s.push(a),n.set(i,s)}return Array.from(n.entries()).map(([a,i])=>{let s=0,u=0;for(const o of i)if(o.action==="create"&&o.proposed)s+=o.proposed.split(`
79
- `).length;else if(o.action==="delete"&&o.original)u+=o.original.split(`
80
- `).length;else if(o.action==="modify"&&o.original){const f=lx(o.original,o.proposed);for(const m of f)m.type==="add"?s++:m.type==="remove"&&u++}const r=l==null?void 0:l.find(o=>o.repo===a);return{repo:a,label:T1(a,t),changes:i,adds:s,removes:u,existingBranch:r==null?void 0:r.branchName}})}function A1({explanation:e,changes:t,existingApplications:l,availableRepos:n,onApprove:a,onDeployBranch:i,onCommitToBranch:s,onReject:u,onRefine:r,onUndoRefine:o,refineThread:f=[],applying:m,refining:h,validationStatus:g="idle"}){var he;const[v,z]=p.useState(""),[b,x]=p.useState(!1),[d,y]=p.useState(new Set),S=p.useMemo(()=>R1(t,n,l),[t,n,l]),j=m||h,M=S.length>1,R=S.every(_=>_.existingBranch),C=S.some(_=>_.existingBranch),U=g!=="passed"&&!b,O=j||U,ee=()=>{v.trim()&&(r(v.trim()),z(""))};return c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-3 text-sm text-zinc-300 leading-relaxed",children:e}),M&&c.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500 font-mono",children:[c.jsx("span",{className:"text-violet-400",children:"⚡ full-stack"}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:[S.length," repos"]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:[t.length," file",t.length!==1?"s":""]})]}),c.jsx("div",{className:"flex flex-col gap-6",children:S.map(_=>c.jsxs("div",{className:"flex flex-col gap-2",children:[M&&c.jsxs("div",{className:"flex items-center gap-3 px-1",children:[c.jsxs("span",{className:"text-xs font-mono font-semibold text-violet-300",children:["[",_.label,"]"]}),c.jsx("span",{className:"text-xs text-zinc-500 font-mono truncate",children:_.repo}),c.jsxs("span",{className:"ml-auto text-xs text-zinc-500 flex items-center gap-2",children:[c.jsxs("span",{children:[_.changes.length," file",_.changes.length!==1?"s":""]}),c.jsxs("span",{className:"text-green-400",children:["+",_.adds]}),c.jsxs("span",{className:"text-red-400",children:["-",_.removes]}),_.existingBranch&&c.jsx("span",{className:"ml-2 text-[10px] uppercase tracking-wide bg-violet-900/40 text-violet-300 px-1.5 py-0.5 rounded font-mono",children:"branch open"})]})]}),c.jsx("div",{className:"flex flex-col gap-3",children:_.changes.map(F=>c.jsx(E1,{change:F},`${_.repo}:${F.file}`))})]},_.repo))}),c.jsxs("div",{className:"flex flex-col gap-3 border border-zinc-700 rounded-lg px-4 py-3 bg-zinc-900",children:[c.jsx("label",{htmlFor:"diff-refine",className:"text-xs text-zinc-500 uppercase tracking-wide",children:"Refine"}),f.length>0&&c.jsx("div",{className:"flex flex-col gap-3",children:f.map((_,F)=>{const k=_.kind==="answer",w=_.kind==="canceled",q=_.kind==="refine",G=w?"border-amber-800/60 bg-amber-950/30":k?"border-sky-800/60 bg-sky-950/30":"border-zinc-700 bg-zinc-800",W=d.has(F),B=240,I=_.feedback.length>B,st=()=>{y(ke=>{const $e=new Set(ke);return $e.has(F)?$e.delete(F):$e.add(F),$e})},je=q&&!!_.prevResult&&!!o&&!j;return c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsxs("div",{className:"text-xs text-zinc-500",children:[c.jsxs("div",{className:"flex items-start gap-1.5",children:[c.jsx("span",{className:"text-violet-400/80 font-medium shrink-0",children:"You:"}),c.jsx("span",{className:`italic flex-1 whitespace-pre-wrap break-words [overflow-wrap:anywhere] ${I&&!W?"max-h-12 overflow-hidden line-clamp-2":"max-h-40 overflow-y-auto"}`,children:I&&!W?_.feedback.slice(0,B)+"…":_.feedback})]}),I&&c.jsx("button",{onClick:st,className:"ml-10 mt-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 transition-colors",children:W?"Show less":"Show more"})]}),_.explanation!==void 0?c.jsxs("div",{className:`text-sm text-zinc-300 border rounded px-3 py-2 leading-relaxed whitespace-pre-wrap ${G}`,children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[c.jsx("span",{className:`text-[10px] uppercase tracking-wide font-mono ${w?"text-amber-300":k?"text-sky-300":"text-emerald-300"}`,children:w?"Canceled":k?"Answer — no code changed":"Refined — code updated"}),je&&c.jsx("button",{onClick:()=>o==null?void 0:o(F),className:"text-[10px] uppercase tracking-wide text-zinc-400 hover:text-zinc-200 border border-zinc-700 hover:border-zinc-500 rounded px-2 py-0.5 transition-colors",title:"Revert the code back to the state before this refinement",children:"Undo"})]}),_.explanation]}):c.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500 px-1",children:[c.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-zinc-500 border-t-transparent animate-spin inline-block"}),"Thinking…"]})]},F)})}),c.jsx("textarea",{id:"diff-refine",value:v,onChange:_=>z(_.target.value),disabled:j,placeholder:"Ask a question (e.g. “are the lint issues fixed?”) or give direction (e.g. “use the existing log utility”)",rows:2,className:"w-full bg-zinc-800 border border-zinc-700 rounded text-sm text-zinc-200 placeholder-zinc-600 px-3 py-2 resize-none focus:outline-none focus:border-zinc-500 disabled:opacity-40"}),c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{onClick:ee,disabled:j||!v.trim(),className:"text-xs px-4 py-1.5 bg-zinc-700 hover:bg-zinc-600 disabled:opacity-40 disabled:cursor-not-allowed text-zinc-200 rounded transition-colors",children:h?"Refining...":"Refine →"})})]}),g==="idle"&&c.jsxs("p",{className:"text-xs text-amber-300",children:["Pre-flight checks required. Run"," ",c.jsx("span",{className:"font-mono text-amber-200",children:"Validate"})," above — lint / typecheck / test must pass before pushing."," ",c.jsx("button",{onClick:()=>x(_=>!_),className:"underline decoration-dotted hover:text-amber-200 transition-colors",children:b?"Cancel override":"Skip checks"}),b&&" — override active, CI may still fail."]}),g==="running"&&c.jsx("p",{className:"text-xs text-violet-300",children:"Validation in progress — hold on before pushing."}),g==="failed"&&c.jsxs("p",{className:"text-xs text-red-300",children:["Validation failed."," ",c.jsx("button",{onClick:()=>x(_=>!_),className:"underline decoration-dotted hover:text-red-200 transition-colors",children:b?"Cancel override":"Push anyway"}),b&&" — override active, CI may still fail."]}),g==="passed"&&c.jsx("p",{className:"text-xs text-emerald-300",children:"All pre-flight checks passed."}),c.jsxs("div",{className:"flex gap-3 flex-wrap",children:[R&&s?c.jsx("button",{onClick:s,disabled:O,className:"flex-1 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-sm font-medium py-2.5 rounded-lg transition-colors",children:m?"Pushing...":g==="running"?"Waiting for checks…":U?"Validate first":M?`Push to ${S.length} existing branches`:`Push to ${((he=S[0])==null?void 0:he.existingBranch)??"branch"}`}):c.jsx("button",{onClick:a,disabled:O,className:"flex-1 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-sm font-medium py-2.5 rounded-lg transition-colors",children:m?"Pushing...":g==="running"?"Waiting for checks…":U?"Validate first":M?`Approve & Create ${S.length} MRs`:"Approve & Create MR"}),!C&&c.jsx("button",{onClick:i,disabled:O,title:"Push branch only — deploys to test namespace without opening an MR",className:"px-4 bg-zinc-800 hover:bg-zinc-700 disabled:opacity-40 disabled:cursor-not-allowed text-zinc-300 text-sm font-medium py-2.5 rounded-lg transition-colors border border-zinc-700",children:"Deploy to Test"}),c.jsx("button",{onClick:u,disabled:j,className:"px-4 bg-zinc-800 hover:bg-zinc-700 disabled:opacity-40 text-zinc-300 text-sm font-medium py-2.5 rounded-lg transition-colors border border-zinc-700",children:"← Back"})]})]})}const w1=["clone","install","overlay","format","lint","typecheck","test"],C1={clone:"clone",install:"install",overlay:"overlay",format:"format",lint:"lint",typecheck:"typecheck",test:"test"};function _1(e){switch(e){case"running":return c.jsx("span",{className:"w-3.5 h-3.5 rounded-full border-2 border-violet-400 border-t-transparent animate-spin inline-block"});case"passed":return c.jsx("span",{className:"text-emerald-400 text-sm",children:"✓"});case"failed":return c.jsx("span",{className:"text-red-400 text-sm",children:"✗"});case"skipped":return c.jsx("span",{className:"text-zinc-500 text-sm",children:"—"});case"idle":default:return c.jsx("span",{className:"text-zinc-700 text-sm",children:"○"})}}function M1(e){if(e.skipped)return"skipped (no script)";switch(e.status){case"running":return"running…";case"passed":return e.durationMs!=null?`passed in ${(e.durationMs/1e3).toFixed(1)}s`:"passed";case"failed":return e.exitCode!=null?`failed (exit ${e.exitCode})`:"failed";case"idle":return"pending";case"skipped":return"skipped";default:return""}}const O1=["lint","typecheck","test"];function D1({step:e,state:t,stale:l,onFix:n,fixing:a}){const[i,s]=p.useState(!1),u=t.logs.length>0||!!t.tail,r=n&&O1.includes(e)&&t.status==="failed",o=l?"border-amber-800/40":t.status==="failed"?"border-red-800/60":t.status==="passed"?"border-emerald-800/40":t.status==="running"?"border-violet-700/50":"border-zinc-800";return c.jsxs("div",{className:`border ${o} rounded-md overflow-hidden bg-zinc-900/40 ${l?"opacity-70":""}`,children:[c.jsxs("div",{className:"flex items-stretch",children:[c.jsxs("button",{disabled:!u,onClick:()=>s(f=>!f),className:`flex-1 flex items-center gap-3 px-3 py-2 text-left ${u?"hover:bg-zinc-800/60 cursor-pointer":"cursor-default"}`,children:[c.jsx("span",{className:"w-4 flex items-center justify-center shrink-0",children:_1(t.status)}),c.jsx("span",{className:"font-mono text-xs text-zinc-300 w-20 shrink-0",children:C1[e]}),c.jsx("span",{className:`text-xs ${t.status==="failed"?"text-red-300":t.status==="passed"?"text-zinc-400":t.status==="running"?"text-violet-300":"text-zinc-500"} flex-1 truncate`,children:M1(t)}),u&&c.jsx("span",{className:"text-zinc-600 text-xs shrink-0",children:i?"▲":"▼"})]}),r&&c.jsx("button",{onClick:f=>{f.stopPropagation(),n()},disabled:a,title:`Send this ${e} failure to Claude to refine the proposed changes.`,className:"shrink-0 px-3 text-[11px] font-medium text-violet-300 hover:text-violet-100 disabled:opacity-50 disabled:cursor-not-allowed border-l border-zinc-800 hover:bg-violet-900/20 transition-colors",children:a?"Fixing…":"Fix with AI"})]}),i&&u&&c.jsx(ec,{entries:t.logs,variant:"embedded",heightClass:"max-h-56",autoScroll:t.status==="running"})]})}function U1({state:e,validating:t,error:l,onValidate:n,onFixStep:a,fixingStep:i=null,autoPushOnPass:s=!1,onToggleAutoPush:u,children:r}){const{result:o,steps:f,stale:m}=e,h=Object.values(f).some(z=>z&&z.status!=="idle"),g=h?t?"text-violet-300":m?"text-amber-300":o!=null&&o.allPassed?"text-emerald-300":"text-red-300":"text-zinc-400",v=h?t?"Running pre-flight checks…":m?"Results outdated — proposal changed since last run":o!=null&&o.allPassed?`All checks passed${o.repo?` for ${o.repo}`:""}`:"Some checks failed":"Pre-flight checks not run yet";return c.jsxs("div",{className:"flex flex-col gap-3 border border-zinc-800 rounded-lg bg-zinc-950/60 p-4 [overflow-anchor:none]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[c.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 font-mono",children:"Pre-flight"}),c.jsx("span",{className:`text-sm font-medium truncate ${g}`,children:v})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[u&&c.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-zinc-400 cursor-pointer select-none",title:"When checked, any validation that passes automatically commits — pushes to the existing branch if one exists, or opens a new MR otherwise. Pairs with Fix with AI to close the loop.",children:[c.jsx("input",{type:"checkbox",checked:s,onChange:z=>u(z.target.checked),className:"accent-violet-500"}),"Auto-push on green"]}),c.jsx("button",{onClick:n,disabled:t,className:"bg-zinc-800 hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed text-zinc-200 text-sm font-medium px-4 py-1.5 rounded-md border border-zinc-700 hover:border-zinc-500 transition-colors",children:t?"Validating…":m||h?"Re-validate":"Validate"})]})]}),l&&c.jsx("div",{className:"text-xs text-red-400 bg-red-950/40 border border-red-900 rounded px-3 py-2 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-32 overflow-y-auto font-mono",children:l}),h&&c.jsx("div",{className:"flex flex-col gap-1.5",children:w1.map(z=>{const b=f[z]??{status:"idle",logs:[]};return c.jsx(D1,{step:z,state:b,stale:m,onFix:a?()=>a(z,b.tail):void 0,fixing:i===z},z)})}),r]})}function B1(){const{analysisLogs:e,analysisResult:t,analysisError:l,applyResult:n,applyError:a,applying:i,refining:s,validation:u,validating:r,validationError:o,autoPushOnValidatePass:f,availableRepos:m,refineThread:h}=Ne(),{handleApprove:g,handleDeployBranch:v,handleCommitToBranch:z,handleReject:b,handleRefine:x,handleUndoRefine:d,handleValidate:y,handleFixValidation:S,setAutoPushOnValidatePass:j}=He(),[M,R]=p.useState(null);p.useEffect(()=>{s||R(null)},[s]);const C=(O,ee)=>{R(O),S(O,ee)},U=r?"running":u.stale||!u.result?"idle":u.result.allPassed?"passed":"failed";return c.jsxs("div",{className:"max-w-4xl mx-auto w-full flex flex-col gap-5",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"Proposed Changes"}),l&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-48 overflow-y-auto font-mono leading-snug",children:l}),a&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-48 overflow-y-auto font-mono leading-snug",children:a}),e.length>0&&c.jsxs("details",{open:!0,className:"group",children:[c.jsxs("summary",{className:"cursor-pointer text-xs text-zinc-500 hover:text-zinc-300 transition-colors select-none list-none flex items-center gap-1",children:[c.jsx("span",{className:"group-open:rotate-90 transition-transform inline-block",children:"›"}),"Analysis logs (",e.length,")"]}),c.jsx("div",{className:"mt-2",children:c.jsx(ec,{entries:e,label:"forge analysis",badge:`${e.length} entr${e.length===1?"y":"ies"}`,heightClass:"max-h-56"})})]}),t?c.jsxs(c.Fragment,{children:[c.jsx(U1,{state:u,validating:r,error:o,onValidate:y,onFixStep:C,fixingStep:M,autoPushOnPass:f,onToggleAutoPush:j}),c.jsx(A1,{explanation:t.explanation,changes:t.changes,existingApplications:(n==null?void 0:n.applications)??[],availableRepos:m,onApprove:g,onDeployBranch:v,onCommitToBranch:z,onReject:b,onRefine:x,onUndoRefine:d,refineThread:h,applying:i,refining:s,validationStatus:U})]}):c.jsx("div",{className:"text-center py-12 text-zinc-500 text-sm",children:"No changes were proposed."})]})}function L1(){const{applyResult:e}=Ne(),{handleRefinePipelineFailure:t,getToken:l}=He(),n=(e==null?void 0:e.applications.filter(a=>!a.mr))??[];return n.length===0?null:c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"text-xs font-medium text-zinc-400 uppercase tracking-wide",children:"Forge Activity"}),c.jsx("span",{className:"text-[10px] text-zinc-600",children:"Deploy-to-Test · no MR yet"})]}),n.map(a=>c.jsxs("div",{className:"flex flex-col gap-3 bg-zinc-800/50 border border-zinc-700 rounded-lg p-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[c.jsx("span",{className:"text-xs text-zinc-500 uppercase tracking-wide",children:"Branch"}),c.jsxs("span",{className:"text-sm font-mono text-violet-300 truncate",title:a.branchName,children:["⎇ ",a.branchName]})]}),a.pipelineUrl&&c.jsx("a",{href:a.pipelineUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-violet-400 hover:underline shrink-0",children:"Open in GitLab ↗"})]}),c.jsx(Fa,{endpoint:`branch-pipeline?branch=${encodeURIComponent(a.branchName)}`,token:l(),repo:a.repo,onRefinePipelineFailure:t})]},`${a.repo}:${a.branchName}`))]})}function H1(){const{storedAnalyses:e}=Ne(),{handleRestoreAnalysis:t,handleDiscardStoredAnalysis:l,formatAnalysisDate:n}=He();return e.length===0?null:c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("span",{className:"text-xs text-zinc-400 font-medium",children:["Previous analyses (",e.length,")"]}),c.jsx("div",{className:"flex flex-col gap-1.5",children:e.map(a=>c.jsxs("div",{className:"bg-zinc-800/60 border border-zinc-700 rounded-lg px-4 py-2.5 flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500 min-w-0",children:[c.jsx("span",{children:n(a.analyzedAt)}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[a.result.changes.length," file",a.result.changes.length!==1?"s":""]}),a.model&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"·"}),c.jsx("span",{className:"truncate",children:a.model.split("-").slice(1,3).join(" ")})]}),c.jsx("span",{children:"·"}),a.mrIid?c.jsxs("span",{className:"text-violet-400",children:["MR !",a.mrIid]}):c.jsx("span",{className:"text-zinc-600",children:"no MR"})]}),a.prompt&&c.jsxs("div",{className:"text-xs text-zinc-400 italic truncate",title:a.prompt,children:["“",a.prompt,"”"]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx("button",{onClick:()=>t(a.id),className:"bg-violet-600 hover:bg-violet-500 text-white text-xs font-medium px-3 py-1 rounded transition-colors",children:"Restore"}),c.jsx("button",{onClick:()=>l(a.id),className:"text-xs text-zinc-600 hover:text-zinc-400 transition-colors",title:"Discard",children:"✕"})]})]},a.id))})]})}function k1({editing:e,editDescription:t,setEditDescription:l,saving:n,onSave:a,onCancelEdit:i,editTitle:s}){const{selectedIssue:u,analysisPrompt:r,existingMr:o,existingMrLoading:f,storedAnalyses:m,mergedMrs:h,resolutionCheck:g}=Ne(),{setAnalysisPrompt:v,handleBeginAnalysis:z,handleReset:b}=He();if(!u)return null;const x=h.length>0&&!o&&!f,d=f?"Checking MR…":o?"Analyze & Update MR":m.length>0?"New Analysis":h.length>0&&g&&!g.resolved?"Try Again":"Begin Analysis";return c.jsxs(c.Fragment,{children:[e?c.jsx("textarea",{value:t,onChange:y=>l(y.target.value),rows:8,className:"bg-zinc-800 border border-zinc-600 focus:border-violet-500 rounded-lg px-4 py-3 text-sm text-zinc-300 outline-none w-full resize-y leading-relaxed"}):u.description&&c.jsx("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-4 text-sm text-zinc-300 whitespace-pre-wrap leading-relaxed w-full max-h-[50vh] overflow-y-auto",children:u.description}),!e&&c.jsx(L1,{}),!e&&c.jsx(H1,{}),c.jsxs("div",{className:"flex flex-col gap-3",children:[!e&&c.jsx("textarea",{value:r,onChange:y=>v(y.target.value),placeholder:"Optional instructions for the analysis…",rows:2,className:"w-full bg-zinc-800/60 border border-zinc-700 rounded-lg px-3 py-2 text-sm text-zinc-200 placeholder-zinc-600 focus:outline-none focus:border-violet-500 resize-none"}),e?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:a,disabled:n||!s.trim(),className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-white text-sm font-medium px-5 py-2 rounded-lg transition-colors",children:n?"Saving…":"Save"}),c.jsx("button",{onClick:i,className:"text-sm text-zinc-500 hover:text-zinc-300 transition-colors",children:"Cancel"})]}):c.jsxs("div",{className:"flex items-center justify-between gap-6 border-t border-zinc-800/60 pt-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:z,disabled:f,className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-white text-sm font-medium px-5 py-2 rounded-lg transition-colors",children:d}),c.jsx("button",{onClick:b,className:"text-sm text-zinc-400 hover:text-zinc-200 transition-colors",children:"Cancel"})]}),c.jsx(Im,{})]})]}),x&&c.jsx("div",{className:"flex flex-col gap-3",children:c.jsx(ex,{})}),c.jsx(fo,{mrs:h})]})}function q1(e,t){if(!e)return null;const l=t.replace(/^forge\//,"").replace(/[/_]+/g,"-").toLowerCase();return e.replace("{branch}",t).replace("{slug}",l)}function Y1(){const{existingMr:e,existingMrLoading:t,applyResult:l,selectedRepo:n,applying:a,applyError:i,testDeployUrlTemplate:s}=Ne(),{handleRefinePipelineFailure:u,handlePromoteBranch:r,getToken:o}=He(),{setMrMerged:f}=Hl(),[m,h]=p.useState({});if(t)return c.jsxs("div",{className:"flex flex-col gap-3 animate-pulse",children:[c.jsx("div",{className:"h-20 bg-zinc-800 border border-zinc-700 rounded-lg"}),c.jsx("div",{className:"h-32 bg-zinc-800 border border-zinc-700 rounded-lg"})]});if(e)return c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsx("div",{className:"flex items-center justify-between bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-3",children:c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"text-xs text-zinc-500 uppercase tracking-wide",children:"Open MR"}),c.jsxs("a",{href:e.web_url,target:"_blank",rel:"noreferrer",className:"text-sm text-violet-400 hover:underline",children:["!",e.iid," ",e.title]}),c.jsx("span",{className:"text-xs font-mono text-zinc-500",children:e.branchName})]})}),c.jsx(Pm,{mrIid:e.iid,token:o(),repo:n||void 0,onMerged:()=>f(!0)}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"CI Pipeline"}),c.jsx(Fa,{endpoint:`mr/${e.iid}/pipeline`,token:o(),repo:n||void 0,onRefinePipelineFailure:u})]})]});const g=(l==null?void 0:l.applications.filter(v=>!v.mr))??[];return g.length>0?c.jsx("div",{className:"flex flex-col gap-6",children:g.map(v=>{const z=`${v.repo}:${v.branchName}`,b=m[z]==="success",x=b?q1(s,v.branchName):null;return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"bg-zinc-800 border border-zinc-700 rounded-lg px-4 py-4 flex items-center justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-white",children:"Test deploy — branch only, no MR"}),c.jsxs("p",{className:"text-xs text-zinc-400 mt-0.5 truncate",children:["Branch: ",c.jsx("span",{className:"font-mono",children:v.branchName})]}),x&&c.jsxs("a",{href:x,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 mt-1 text-xs text-emerald-400 hover:text-emerald-300 hover:underline",title:"Open the test deploy in a new tab",children:["View test deploy",c.jsx("span",{"aria-hidden":!0,children:"↗"}),c.jsx("span",{className:"font-mono text-emerald-500/80",children:x})]})]}),b&&c.jsx("button",{onClick:()=>r(v),disabled:a,className:"shrink-0 ml-4 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors",title:"Pipeline is green — promote this branch to a merge request",children:a?"Creating MR…":"Approve & Create MR"})]}),i&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-4 py-2 text-xs text-red-300",children:i}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("h2",{className:"text-sm font-medium text-zinc-400 uppercase tracking-wide",children:"Branch Pipeline (test deploy)"}),c.jsx(Fa,{endpoint:`branch-pipeline?branch=${encodeURIComponent(v.branchName)}`,token:o(),repo:v.repo,onRefinePipelineFailure:u,onStatusChange:d=>h(y=>({...y,[z]:d??""}))})]})]},z)})}):c.jsx("div",{className:"text-center py-12 text-zinc-500 text-sm",children:"No open MR found for this issue."})}function G1({editing:e,editTitle:t,setEditTitle:l,onStartEdit:n}){const{selectedIssue:a}=Ne();return a?c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[c.jsxs("span",{className:"font-mono",children:["#",a.iid]}),a.labels.map(i=>c.jsx("span",{className:"bg-zinc-700 text-zinc-300 px-1.5 py-0.5 rounded",children:i},i))]}),e?c.jsx("input",{value:t,onChange:i=>l(i.target.value),className:"bg-zinc-800 border border-zinc-600 focus:border-violet-500 rounded px-3 py-1.5 text-lg font-semibold text-white outline-none w-full"}):c.jsx("h2",{className:"text-lg font-semibold text-white",children:a.title}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"text-xs text-zinc-500",children:["by ",a.author.name," ·"," ",c.jsx("a",{href:a.web_url,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300 transition-colors",children:"view on GitLab ↗"})]}),n&&!e&&c.jsx("button",{onClick:n,className:"text-xs text-zinc-500 hover:text-zinc-300 transition-colors",children:"Edit"})]})]}):null}function X1(){const{selectedIssue:e,existingMr:t,existingMrLoading:l,applyResult:n}=Ne(),{handleUpdateIssue:a}=He(),{activeDetailTab:i,setActiveDetailTab:s}=Hl(),[u,r]=p.useState(!1),[o,f]=p.useState(""),[m,h]=p.useState(""),[g,v]=p.useState(!1),z=on();if(!e)return null;const b=()=>{f(e.title??""),h(e.description??""),r(!0)},x=()=>r(!1),d=async()=>{v(!0);try{await a(o,m),r(!1)}finally{v(!1)}},y=C=>{const U=C==="mr"?"mr":"issue";s(U),z(U==="mr"?`/issues/${e.iid}/mr`:`/issues/${e.iid}`,{replace:!0})},S=((n==null?void 0:n.applications)??[]).filter(C=>!C.mr).length,j=t?"MR":S>0?"Branch":"MR",M=t?c.jsxs("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${i==="mr"?"bg-zinc-600 text-zinc-300":"bg-violet-600/40 text-violet-300"}`,children:["!",t.iid]}):S>0?c.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${i==="mr"?"bg-zinc-600 text-zinc-300":"bg-amber-600/40 text-amber-300"}`,title:`${S} deploy-to-test branch${S>1?"es":""} without an MR`,children:S}):c.jsx("span",{className:"text-xs text-zinc-600",children:"—"}),R=[{id:"issue",label:"Issue"},{id:"mr",label:j,loading:l,badge:l?void 0:M}];return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx(G1,{editing:u,editTitle:o,setEditTitle:f,onStartEdit:b}),c.jsx(tx,{tabs:R,active:i,onSelect:y}),i==="issue"&&c.jsx(k1,{editing:u,editDescription:m,setEditDescription:h,saving:g,onSave:d,onCancelEdit:x,editTitle:o}),i==="mr"&&c.jsx(Y1,{})]})}function V1(){const[e,t]=p.useState(null),[l,n]=p.useState(!1),[a,i]=p.useState(null),s=p.useCallback(async()=>{n(!0),i(null);try{const r=await re("/config");t(r)}catch(r){i(r instanceof Error?r.message:String(r))}finally{n(!1)}},[]),u=p.useCallback(async r=>{const o=await re("/config",{method:"PUT",body:JSON.stringify(r)});return t(o),o},[]);return p.useEffect(()=>{s()},[s]),{config:e,loading:l,error:a,reload:s,patch:u}}const Q1={gitlab:"GitLab",github:"GitHub",azuredevops:"Azure DevOps"};function $1(e){return e==="config"?c.jsx("span",{className:"text-[10px] text-violet-400 uppercase tracking-wide",children:"config"}):e==="env"?c.jsx("span",{className:"text-[10px] text-zinc-500 uppercase tracking-wide",children:"env"}):c.jsx("span",{className:"text-[10px] text-red-400/80 uppercase tracking-wide",children:"missing"})}function tu({provider:e,connection:t,newToken:l,setNewToken:n,clearToken:a,setClearToken:i,baseUrl:s,setBaseUrl:u}){const[r,o]=p.useState(!1);return c.jsxs("div",{className:"flex flex-col gap-3 bg-zinc-900 border border-zinc-800 rounded-lg px-4 py-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium text-white",children:Q1[e]}),$1(t.tokenSource)]}),u&&c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs text-zinc-500",children:"API base URL"}),c.jsx("input",{value:s??"",onChange:f=>u(f.target.value),placeholder:"https://gitlab.com/api/v4",className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs font-mono text-zinc-300 focus:outline-none focus:border-violet-500"})]}),c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("span",{className:"text-xs text-zinc-500",children:["Token",t.hasToken&&c.jsx("span",{className:"ml-2 font-mono text-zinc-600",children:t.tokenHint})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:r?"text":"password",value:l,onChange:f=>n(f.target.value),placeholder:t.hasToken?"Leave blank to keep current":"Paste token",disabled:a,className:"flex-1 bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs font-mono text-zinc-300 focus:outline-none focus:border-violet-500 disabled:opacity-40"}),c.jsx("button",{onClick:()=>o(f=>!f),disabled:!l,className:"text-xs text-zinc-500 hover:text-zinc-300 disabled:opacity-30",children:r?"Hide":"Show"})]}),t.tokenSource==="config"&&c.jsxs("label",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[c.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),className:"rounded border-zinc-700 bg-zinc-800 text-violet-600 focus:ring-violet-500"}),"Clear stored token (revert to env var if set)"]})]})]})}const Nd={gitlab:"",github:"",azuredevops:""},jd={gitlab:!1,github:!1,azuredevops:!1};function Z1({connections:e,onSave:t}){const[l,n]=p.useState(e.gitlab.baseUrl),[a,i]=p.useState(Nd),[s,u]=p.useState(jd),[r,o]=p.useState(!1),[f,m]=p.useState(null);p.useEffect(()=>{n(e.gitlab.baseUrl)},[e.gitlab.baseUrl]);const h=l!==e.gitlab.baseUrl,g=!!(a.gitlab||a.github||a.azuredevops)||s.gitlab||s.github||s.azuredevops,v=h||g,z=()=>{const x={},d={};return h&&(d.baseUrl=l),s.gitlab?d.token="":a.gitlab&&(d.token=a.gitlab),Object.keys(d).length>0&&(x.gitlab=d),s.github?x.github={token:""}:a.github&&(x.github={token:a.github}),s.azuredevops?x.azuredevops={token:""}:a.azuredevops&&(x.azuredevops={token:a.azuredevops}),x},b=async()=>{o(!0),m(null);try{await t(z()),i(Nd),u(jd)}catch(x){m(x instanceof Error?x.message:String(x))}finally{o(!1)}};return c.jsxs("section",{className:"flex flex-col gap-4",children:[c.jsxs("header",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-white",children:"Connections"}),c.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"SCM hosts and tokens. Config values override env vars; empty config values fall back to env."})]}),v&&c.jsx("button",{onClick:b,disabled:r,className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-white text-sm font-medium px-4 py-1.5 rounded-lg transition-colors",children:r?"Saving…":"Save"})]}),f&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300",children:f}),c.jsx(tu,{provider:"gitlab",connection:e.gitlab,baseUrl:l,setBaseUrl:n,newToken:a.gitlab,setNewToken:x=>i(d=>({...d,gitlab:x})),clearToken:s.gitlab,setClearToken:x=>u(d=>({...d,gitlab:x}))}),c.jsx(tu,{provider:"github",connection:e.github,newToken:a.github,setNewToken:x=>i(d=>({...d,github:x})),clearToken:s.github,setClearToken:x=>u(d=>({...d,github:x}))}),c.jsx(tu,{provider:"azuredevops",connection:e.azuredevops,newToken:a.azuredevops,setNewToken:x=>i(d=>({...d,azuredevops:x})),clearToken:s.azuredevops,setClearToken:x=>u(d=>({...d,azuredevops:x}))})]})}function K1({defaults:e,onSave:t}){const{availableModels:l,availableAgents:n}=Ne(),[a,i]=p.useState(e),[s,u]=p.useState(!1),[r,o]=p.useState(null);p.useEffect(()=>{i(e)},[e]);const f=JSON.stringify(a)!==JSON.stringify(e),m=async()=>{u(!0),o(null);try{await t(a)}catch(h){o(h instanceof Error?h.message:String(h))}finally{u(!1)}};return c.jsxs("section",{className:"flex flex-col gap-4",children:[c.jsxs("header",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-white",children:"Defaults"}),c.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"Preselect the model and agent on load. Leaves selection free per-request."})]}),f&&c.jsx("button",{onClick:m,disabled:s,className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-white text-sm font-medium px-4 py-1.5 rounded-lg transition-colors",children:s?"Saving…":"Save"})]}),r&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300",children:r}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs text-zinc-500",children:"Default model"}),c.jsxs("select",{value:a.model??"",onChange:h=>i({...a,model:h.target.value===""?null:h.target.value}),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500",children:[c.jsx("option",{value:"",children:"— none —"}),l.map(h=>c.jsx("option",{value:h.id,children:h.label},h.id))]})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs text-zinc-500",children:"Default agent"}),c.jsxs("select",{value:a.agent??"",onChange:h=>i({...a,agent:h.target.value===""?null:h.target.value}),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500",children:[c.jsx("option",{value:"",children:"— none —"}),n.map(h=>c.jsxs("option",{value:h.id,disabled:!h.configured,children:[h.label,h.configured?"":" (not configured)"]},h.id))]})]}),c.jsxs("label",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"checkbox",checked:a.autoPushOnValidatePass,onChange:h=>i({...a,autoPushOnValidatePass:h.target.checked}),className:"rounded border-zinc-700 bg-zinc-800 text-violet-600 focus:ring-violet-500"}),c.jsx("span",{className:"text-xs text-zinc-300",children:"Auto-push on successful validation"})]}),c.jsxs("label",{className:"flex items-start gap-2",children:[c.jsx("input",{type:"checkbox",checked:a.refineRepoAccess,onChange:h=>i({...a,refineRepoAccess:h.target.checked}),className:"mt-0.5 rounded border-zinc-700 bg-zinc-800 text-violet-600 focus:ring-violet-500"}),c.jsxs("span",{className:"flex flex-col",children:[c.jsx("span",{className:"text-xs text-zinc-300",children:"Refine repo access"}),c.jsxs("span",{className:"text-[11px] text-zinc-500 leading-relaxed",children:["When on, Refine spawns Claude with ",c.jsx("code",{className:"text-zinc-400",children:"Read/Glob/Grep"}),' over a local clone of the primary repo (GitLab only). Off uses a lighter "file tree + attached files" prompt. ',c.jsx("code",{className:"text-zinc-400",children:"FORGE_REFINE_REPO_ACCESS"}),", if set, overrides this."]})]})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs text-zinc-500",children:"Test deploy URL"}),c.jsx("input",{type:"url",value:a.testDeployUrlTemplate??"",onChange:h=>i({...a,testDeployUrlTemplate:h.target.value}),placeholder:"https://test.example.com or https://{slug}.test.example.com",className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 placeholder-zinc-600 focus:outline-none focus:border-violet-500 font-mono"}),c.jsxs("span",{className:"text-[11px] text-zinc-500 leading-relaxed",children:['Shown next to "Approve & Create MR" once the branch pipeline is green. Supports ',c.jsx("code",{className:"text-zinc-400",children:"{branch}"})," (full branch) and"," ",c.jsx("code",{className:"text-zinc-400",children:"{slug}"})," (subdomain-safe) placeholders for ephemeral per-branch envs. Leave blank to hide the link."]})]})]})]})}const J1=["gitlab","github","azuredevops"];function F1(e){const t=e.replace(/^(gitlab|github|azuredevops):/,"");return t.split("/").pop()??t}function W1({repos:e,onSave:t}){const[l,n]=p.useState(e),[a,i]=p.useState("gitlab"),[s,u]=p.useState(""),[r,o]=p.useState(!1),[f,m]=p.useState(null);p.useEffect(()=>{n(e)},[e]);const h=JSON.stringify(l)!==JSON.stringify(e),g=()=>{const x=s.trim();if(!x)return;const d=x.includes(":")?x:`${a}:${x}`;if(l.some(y=>y.id===d)){m(`Already in list: ${d}`);return}m(null),n([...l,{id:d,label:F1(d)}]),u("")},v=x=>{n(l.filter(d=>d.id!==x))},z=(x,d)=>{n(l.map(y=>y.id===x?{...y,label:d}:y))},b=async()=>{o(!0),m(null);try{await t(l)}catch(x){m(x instanceof Error?x.message:String(x))}finally{o(!1)}};return c.jsxs("section",{className:"flex flex-col gap-4",children:[c.jsxs("header",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-white",children:"Repositories"}),c.jsxs("p",{className:"text-xs text-zinc-500 mt-0.5",children:["Override the ",c.jsx("code",{className:"text-zinc-400",children:"FORGE_REPOS"})," env var. Empty list falls back to env."]})]}),h&&c.jsx("button",{onClick:b,disabled:r,className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-white text-sm font-medium px-4 py-1.5 rounded-lg transition-colors",children:r?"Saving…":"Save"})]}),f&&c.jsx("div",{className:"bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300",children:f}),c.jsxs("div",{className:"flex flex-col gap-2",children:[l.length===0&&c.jsx("p",{className:"text-xs text-zinc-600 italic",children:"No repos configured — using env vars."}),l.map(x=>c.jsxs("div",{className:"flex items-center gap-3 bg-zinc-900 border border-zinc-800 rounded-lg px-3 py-2",children:[c.jsx("span",{className:"text-xs font-mono text-zinc-500 shrink-0",children:x.id}),c.jsx("input",{value:x.label,onChange:d=>z(x.id,d.target.value),className:"flex-1 bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500"}),c.jsx("button",{onClick:()=>v(x.id),className:"text-xs text-zinc-600 hover:text-red-400 transition-colors",title:"Remove",children:"✕"})]},x.id))]}),c.jsxs("div",{className:"flex items-center gap-2 border-t border-zinc-800 pt-4",children:[c.jsx("select",{value:a,onChange:x=>i(x.target.value),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500",children:J1.map(x=>c.jsx("option",{value:x,children:x},x))}),c.jsx("input",{value:s,onChange:x=>u(x.target.value),onKeyDown:x=>{x.key==="Enter"&&g()},placeholder:"group/repo or owner/repo",className:"flex-1 bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500"}),c.jsx("button",{onClick:g,className:"bg-zinc-800 hover:bg-zinc-700 border border-zinc-700 hover:border-zinc-600 text-zinc-300 text-xs px-3 py-1 rounded transition-colors",children:"+ Add"})]})]})}function I1(){var o;const{config:e,loading:t,error:l,patch:n}=V1(),{selectedRepo:a,availableRepos:i,selectedSecondaryRepos:s}=Ne(),u=((o=i.find(f=>f.id===a))==null?void 0:o.label)??a,r=s.map(f=>{var m;return((m=i.find(h=>h.id===f))==null?void 0:m.label)??f});return t&&!e?c.jsx("div",{className:"max-w-3xl mx-auto w-full text-sm text-zinc-500",children:"Loading settings…"}):l&&!e?c.jsx("div",{className:"max-w-3xl mx-auto w-full bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300",children:l}):e?c.jsxs("div",{className:"max-w-3xl mx-auto w-full flex flex-col gap-10",children:[c.jsxs("header",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[c.jsx("h1",{className:"text-lg font-semibold text-white",children:"Settings"}),u&&c.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[c.jsx("span",{className:"text-zinc-500",children:"Current repo"}),c.jsx("span",{className:"bg-violet-600/15 border border-violet-600/40 text-violet-200 px-2 py-0.5 rounded",children:u}),r.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-zinc-600",children:"+"}),r.map(f=>c.jsx("span",{className:"bg-zinc-800 border border-zinc-700 text-zinc-300 px-2 py-0.5 rounded",children:f},f))]})]})]}),c.jsxs("p",{className:"text-xs text-zinc-500",children:["Persisted to ",c.jsx("code",{className:"text-zinc-400",children:"~/.forge/config.json"}),". Env vars apply when config is empty."]})]}),c.jsx(Z1,{connections:e.connections,onSave:f=>n({connections:f}).then(()=>{})}),c.jsx(W1,{repos:e.repos,onSave:f=>n({repos:f}).then(()=>{})}),c.jsx(K1,{defaults:e.defaults,onSave:f=>n({defaults:f}).then(()=>{})})]}):null}function P1(){const{phase:e,selectedIssue:t,currentOrdinal:l,storedAnalyses:n,selectedRepo:a}=Ne(),{setPhase:i,handleReset:s,handleSelectIssue:u,restoreAnalysisByOrdinal:r,getToken:o}=He(),{setActiveDetailTab:f}=Hl(),m=on(),h=it();p.useEffect(()=>{f(h.pathname.endsWith("/mr")?"mr":"issue")},[h.pathname,f]),p.useEffect(()=>{if(!t||e==="idle"||e==="connect"||e==="applying")return;const v=`/issues/${t.iid}`;if(e==="reviewing"){const b=`${v}/analysis/${l??1}`;h.pathname!==b&&m(b)}else if(e==="monitoring"){const z=`${v}/mr`;h.pathname!==z&&m(z)}else h.pathname.startsWith(v)||m(v)},[e,t==null?void 0:t.iid,l]),p.useEffect(()=>{if(!t||e==="idle"||e==="connect")return;const v=`/issues/${t.iid}`;if(!h.pathname.startsWith(v)){s();return}const z=h.pathname.match(new RegExp(`^${v}/analysis/(\\d+)$`));if(h.pathname===`${v}/review`){const b=n[0];b?m(`${v}/analysis/${b.ordinal}`,{replace:!0}):m(v,{replace:!0});return}if(z){const b=Number(z[1]);if(e==="reviewing"&&l===b)return;r(b)||m(v,{replace:!0})}else e==="reviewing"&&i("selected")},[h.pathname]);const g=p.useRef(!1);return p.useEffect(()=>{if(g.current||!o()||!a||e!=="idle"&&e!=="selected")return;const v=h.pathname.match(/^\/issues\/(\d+)/);if(!v)return;g.current=!0;const z=h.pathname.match(/^\/issues\/\d+\/analysis\/(\d+)$/),b=h.pathname.endsWith("/review");re(`/issues/${v[1]}?repo=${encodeURIComponent(a)}`).then(({issue:x})=>{if(u(x),!(!z&&!b))if(z){const d=Number(z[1]);r(d,x.iid)||m(`/issues/${x.iid}`,{replace:!0})}else{const y=Zl(a,x.iid)[0];y&&r(y.ordinal,x.iid)?m(`/issues/${x.iid}/analysis/${y.ordinal}`,{replace:!0}):m(`/issues/${x.iid}`,{replace:!0})}}).catch(()=>m("/issues",{replace:!0}))},[e,a]),null}function eS(){const{taskModalOpen:e,setTaskModalOpen:t}=Hl(),{handleCreateIssue:l,handleSelectIssue:n}=He(),a=on(),[i,s]=p.useState(""),[u,r]=p.useState(""),[o,f]=p.useState(!1),[m,h]=p.useState(null);if(p.useEffect(()=>{e||(s(""),r(""),h(null),f(!1))},[e]),p.useEffect(()=>{if(!e)return;const v=z=>{z.key==="Escape"&&t(!1)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e,t]),!e)return null;const g=async v=>{if(v.preventDefault(),!!i.trim()){f(!0),h(null);try{const z=await l(i.trim(),u.trim());n(z),a(`/issues/${z.iid}`,{replace:!1}),t(!1)}catch(z){h(z.message),f(!1)}}};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm pt-24 px-4",onClick:()=>t(!1),children:c.jsxs("form",{onSubmit:g,onClick:v=>v.stopPropagation(),className:"w-full max-w-xl bg-zinc-900 border border-zinc-700 rounded-lg shadow-2xl p-5 flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-white",children:"New Task"}),c.jsx("button",{type:"button",onClick:()=>t(!1),className:"text-zinc-500 hover:text-zinc-300 text-lg leading-none","aria-label":"Close",children:"×"})]}),c.jsx("input",{type:"text",placeholder:"Task title",value:i,onChange:v=>s(v.target.value),autoFocus:!0,className:"w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:outline-none focus:border-violet-500"}),c.jsx("textarea",{placeholder:"Describe what you want done. The more detail, the better the analysis.",value:u,onChange:v=>r(v.target.value),rows:6,className:"w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white placeholder:text-zinc-500 focus:outline-none focus:border-violet-500 resize-y"}),m&&c.jsx("p",{className:"text-xs text-red-400",children:m}),c.jsx("p",{className:"text-[11px] text-zinc-500",children:"Creates an issue in the selected repo and opens it — click “Begin Analysis” next."}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx("button",{type:"button",onClick:()=>t(!1),className:"text-xs text-zinc-400 hover:text-zinc-200 px-3 py-1.5",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:o||!i.trim(),className:"bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-xs font-medium px-4 py-1.5 rounded transition-colors",children:o?"Creating...":"Create task"})]})]})})}function pn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function tS(e){if(!e)return"";const t=new Date(e),l=Math.max(0,t.getTime()-Date.now()),n=Math.floor(l/1e3),a=Math.floor(n/60),i=Math.floor(a/60);return i>=1?`${i}h ${a%60}m`:a>=1?`${a}m ${n%60}s`:n<=1?"< 1s":`${n}s`}function Ed(e){return e<=15?"text-red-400":e<=40?"text-amber-400":"text-emerald-400"}function lS(e){return e<=15?"bg-red-500":e<=40?"bg-amber-500":"bg-emerald-500"}function nS(e){if(!e)return"";const t=Date.now()-new Date(e).getTime();if(t<6e4)return"just now";const l=Math.floor(t/6e4);return l<60?`${l}m ago`:`${Math.floor(l/60)}h ago`}function aS({usage:e,rateLimit:t,selectedModel:l,agent:n,onRefreshQuota:a,quotaLoading:i=!1,quotaError:s=null,quotaCheckedAt:u=null}){const[r,o]=p.useState(!1),{sessionCost:f,serviceTier:m,inputTokens:h,outputTokens:g,cacheCreationTokens:v,cacheReadTokens:z}=e,b=m==="standard",x=m==="priority",d=x?"Priority":b?"Standard":m&&m!=="unknown"&&m!==""?m.charAt(0).toUpperCase()+m.slice(1):null,y=t&&(t.tokensRemaining!==null||t.requestsRemaining!==null),S=t!=null&&t.tokensLimit&&t.tokensRemaining!==null?Math.round(t.tokensRemaining/t.tokensLimit*100):null,j=n?c.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide ${n.id==="openclaw"?"bg-cyan-900/50 text-cyan-300":"bg-violet-900/50 text-violet-300"}`,children:n.label}):null;return r?c.jsxs("div",{className:"flex items-center gap-4 text-xs text-zinc-400 bg-zinc-800/40 border border-zinc-700 rounded-lg px-3 py-1.5",children:[n&&c.jsxs("span",{className:"flex items-center gap-1.5",children:[j,l&&c.jsx("span",{className:"text-zinc-500",children:l.rates?`${l.label} · $${l.rates.input}/$${l.rates.output}/MTok`:l.label})]}),!n&&l&&c.jsx("span",{className:"text-zinc-500",children:l.rates?`${l.label} · $${l.rates.input}/$${l.rates.output}/MTok`:l.label}),c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-zinc-500",children:"Session"}),c.jsxs("span",{className:"font-mono font-medium text-zinc-200",children:["$",f.toFixed(4)]}),c.jsx("span",{className:"text-zinc-600",children:"·"}),c.jsxs("span",{title:"Input tokens",className:"text-blue-400",children:[pn(h)," in"]}),c.jsx("span",{className:"text-zinc-600",children:"·"}),c.jsxs("span",{title:"Output tokens",className:"text-emerald-400",children:[pn(g)," out"]}),v>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-zinc-600",children:"·"}),c.jsxs("span",{title:"Cache write tokens",className:"text-amber-400",children:[pn(v)," cache↑"]})]}),z>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-zinc-600",children:"·"}),c.jsxs("span",{title:"Cache read tokens",className:"text-teal-400",children:[pn(z)," cache↓"]})]})]}),d&&c.jsxs("span",{className:b?"text-amber-400 font-medium":x?"text-violet-400":"text-zinc-400",children:[b&&"⚠ ",d]}),c.jsxs("div",{className:"flex items-center gap-2 border-l border-zinc-700 pl-4 min-w-[20rem]",children:[y&&S!==null?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-zinc-500 text-[10px] uppercase tracking-wide",children:"Quota"}),c.jsxs("span",{className:`font-mono font-bold text-sm ${Ed(S)}`,children:[S,"%"]}),c.jsx("span",{className:"text-zinc-600 text-[10px]",children:"left"}),c.jsx("span",{className:"relative h-1.5 w-24 bg-zinc-800 rounded overflow-hidden",children:c.jsx("span",{className:`absolute inset-y-0 left-0 ${lS(S)} transition-all`,style:{width:`${100-S}%`}})}),c.jsxs("span",{className:"font-mono text-zinc-400 text-[11px]",children:[pn(t.tokensRemaining),"/",pn(t.tokensLimit)]}),t.tokensReset&&c.jsxs("span",{className:"text-zinc-500 text-[11px]",children:["resets ",c.jsx("span",{className:"text-zinc-300 font-mono",children:tS(t.tokensReset)})]})]}):c.jsx("span",{className:"text-[11px] text-zinc-600 italic",title:"Click “Check quota” to fire one tiny Anthropic API call and read your plan quota from the response headers.",children:"quota not checked"}),a&&c.jsx("button",{onClick:a,disabled:i,title:u?`Last checked ${nS(u)}. Click to re-probe (1 tiny Anthropic API call).`:"Fire one tiny Anthropic API call to read your plan quota. CLI calls are unaffected.",className:"text-[11px] text-zinc-500 hover:text-zinc-200 disabled:opacity-50 transition-colors border border-zinc-700 hover:border-zinc-500 rounded px-2 py-0.5 ml-auto",children:i?"Checking…":y?"↻":"Check quota"}),s&&c.jsx("span",{className:"text-[11px] text-red-400 truncate max-w-xs",title:s,children:s})]}),c.jsx("a",{href:"https://claude.ai/settings/usage",target:"_blank",rel:"noreferrer",className:"text-zinc-600 hover:text-zinc-300 transition-colors",title:"View plan usage on claude.ai",children:"Plan ↗"}),c.jsx("button",{type:"button",onClick:()=>o(!1),className:"text-zinc-600 hover:text-zinc-300 text-[10px] ml-1",title:"Collapse",children:"▴"})]}):c.jsxs("button",{type:"button",onClick:()=>o(!0),title:"Click to expand usage details",className:"flex items-center gap-2 text-xs text-zinc-400 hover:text-zinc-200 bg-zinc-800/60 border border-zinc-700 hover:border-zinc-600 rounded-full px-3 py-1 transition-colors",children:[j,c.jsxs("span",{className:"text-zinc-500",children:["$",f.toFixed(4)]}),c.jsx("span",{className:"text-zinc-600",children:"·"}),c.jsx("span",{className:"inline-flex items-center justify-end w-10 font-mono",children:S!==null?c.jsxs("span",{className:Ed(S),children:[S,"%"]}):c.jsx("span",{className:"text-zinc-600",children:"—"})}),c.jsx("span",{className:"text-zinc-600 text-[10px]",children:"▾"})]})}function iS(){const{availableRepos:e,selectedRepo:t,selectedSecondaryRepos:l,availableAgents:n,selectedAgent:a,availableModels:i,selectedModel:s,usage:u,rateLimit:r,quotaLoading:o,quotaError:f,quotaCheckedAt:m}=Ne(),{setSelectedRepo:h,setSelectedSecondaryRepos:g,setSelectedAgent:v,setSelectedModel:z,refreshQuota:b}=He(),x=d=>{g(l.includes(d)?l.filter(y=>y!==d):[...l,d])};return c.jsxs("div",{className:"border-b border-zinc-800/60 px-6 flex items-center gap-3 bg-zinc-900/40 shrink-0 min-h-10 flex-wrap py-1.5",children:[e.length>1&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-xs text-zinc-600",children:"Repo"}),c.jsx("select",{value:t,onChange:d=>h(d.target.value),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500",children:e.map(d=>c.jsx("option",{value:d.id,children:d.label},d.id))}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-zinc-600",children:"+ Full-stack"}),c.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:e.filter(d=>d.id!==t).map(d=>{const y=l.includes(d.id);return c.jsxs("button",{onClick:()=>x(d.id),title:y?`Remove ${d.label} from analysis`:`Include ${d.label} in analysis`,className:`text-[11px] font-mono px-2 py-0.5 rounded border transition-colors ${y?"bg-violet-600/25 border-violet-500/70 text-violet-200 hover:bg-violet-600/40":"bg-zinc-800 border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-500"}`,children:[y?"✓ ":"+ ",d.label]},d.id)})})]})]}),n.length>1&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-xs text-zinc-600",children:"Agent"}),c.jsx("select",{value:a,onChange:d=>v(d.target.value),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500",children:n.map(d=>c.jsxs("option",{value:d.id,disabled:!d.configured,children:[d.label,d.configured?"":" (not configured)"]},d.id))})]}),a!=="openclaw"&&i.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-xs text-zinc-600",children:"Model"}),c.jsx("select",{value:s,onChange:d=>z(d.target.value),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 focus:outline-none focus:border-violet-500",children:i.map(d=>c.jsx("option",{value:d.id,children:d.label},d.id))})]}),c.jsx("div",{className:"flex-1"}),c.jsx(aS,{usage:u,rateLimit:r,selectedModel:i.find(d=>d.id===s),agent:n.find(d=>d.id===a),onRefreshQuota:b,quotaLoading:o,quotaError:f,quotaCheckedAt:m})]})}function sS(){const[e,t]=p.useState(!1),{handleDisconnect:l}=He(),n=p.useRef(null);return p.useEffect(()=>{if(!e)return;const a=i=>{n.current&&!n.current.contains(i.target)&&t(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e]),c.jsxs("div",{ref:n,className:"relative",children:[e&&c.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-1 bg-zinc-800 border border-zinc-700 rounded-md shadow-lg overflow-hidden",children:c.jsx("button",{onClick:()=>{t(!1),l()},className:"w-full text-left px-3 py-2 text-sm text-zinc-300 hover:bg-zinc-700 transition-colors",children:"Disconnect"})}),c.jsxs("button",{onClick:()=>t(a=>!a),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800/50 transition-colors","aria-expanded":e,"aria-haspopup":"menu",children:[c.jsx("span",{children:"☰"}),c.jsx("span",{children:"Menu"})]})]})}function Ui({label:e,icon:t,active:l,onClick:n,badgeCount:a}){const i=a!==void 0&&a>0;return c.jsxs("button",{onClick:n,className:`w-full flex items-center justify-between gap-2 px-3 py-2 rounded-md text-sm transition-colors ${l?"bg-zinc-800 text-white":"text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800/50"}`,children:[c.jsxs("span",{className:"flex items-center gap-2",children:[t&&c.jsx("span",{className:"text-zinc-600",children:t}),e]}),i&&c.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${l?"bg-zinc-700 text-zinc-300":"bg-zinc-800 text-zinc-500"}`,children:a})]})}function cS(){const{issues:e,openMRs:t,openMRsLoading:l}=Ne(),{loadOpenMRs:n}=He(),{setTaskModalOpen:a}=Hl(),i=on(),s=it(),u=o=>s.pathname===o||s.pathname.startsWith(`${o}/`),r=(o,f=!1)=>{i(o,{replace:!0}),f&&t.length===0&&!l&&n()};return c.jsxs("nav",{className:"flex flex-col gap-1",children:[c.jsx("button",{onClick:()=>a(!0),className:"flex items-center justify-center gap-1 bg-violet-600 hover:bg-violet-500 text-white text-sm font-medium px-3 py-2 rounded-md mb-2 transition-colors",children:"+ New Task"}),c.jsx(Ui,{label:"Issues",active:u("/issues"),onClick:()=>r("/issues"),badgeCount:e.length}),c.jsx(Ui,{label:"Merge Requests",active:u("/mrs"),onClick:()=>r("/mrs",!0),badgeCount:t.length}),c.jsx(Ui,{label:"Pipelines",active:u("/pipelines"),onClick:()=>r("/pipelines",!0),badgeCount:t.filter(o=>o.pipeline).length}),c.jsx("div",{className:"h-2"}),c.jsx(Ui,{label:"Settings",active:u("/settings"),onClick:()=>i("/settings",{replace:!0})})]})}function uS(){return c.jsxs("aside",{className:"w-56 shrink-0 border-r border-zinc-800 flex flex-col p-3 bg-zinc-950/40",children:[c.jsx(cS,{}),c.jsx("div",{className:"flex-1"}),c.jsx(sS,{})]})}const rS=["/issues","/mrs","/pipelines"];function oS(e){return rS.includes(e)}function fS({popoutUrl:e}){const{phase:t,selectedIssue:l,applyResult:n}=Ne(),{handleReset:a,handleBackToIssue:i}=He(),{setMrMerged:s}=Hl(),u=on(),r=it(),o=p.useRef("/issues");p.useEffect(()=>{t==="idle"&&oS(r.pathname)&&(o.current=r.pathname)},[r.pathname,t]);const f=t!=="idle",m=n==null?void 0:n.applications[0],h=m==null?void 0:m.mr,g=()=>{s(!1),a(),u(o.current,{replace:!0})};return c.jsxs("div",{className:"border-b border-zinc-800 px-6 py-3 flex items-center justify-between shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("span",{className:"text-base",children:"⚒"}),c.jsx("h1",{className:"text-sm font-semibold text-white shrink-0",children:"Forge"}),l&&f&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-zinc-700",children:"/"}),c.jsxs("span",{className:"text-sm text-zinc-400 truncate",children:["#",l.iid," ",l.title]})]}),!l&&h&&f&&n&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-zinc-700",children:"/"}),c.jsxs("span",{className:"text-sm text-zinc-400 truncate",children:["!",h.iid," ",h.title,n.applications.length>1&&c.jsxs("span",{className:"ml-2 text-xs text-violet-400",children:["+",n.applications.length-1," more"]})]})]})]}),c.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[(t==="analyzing"||t==="reviewing")&&l&&c.jsx("button",{onClick:i,className:"text-xs text-zinc-400 hover:text-white transition-colors",title:"Return to the issue detail view without discarding this analysis",children:"← Issue"}),f&&c.jsx("button",{onClick:g,className:"text-xs text-zinc-400 hover:text-white transition-colors",children:"← Back"}),e&&c.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-xs text-zinc-600 hover:text-zinc-400 transition-colors",title:"Open in new tab",children:"⤢"})]})]})}function dS({popoutUrl:e,children:t}){return c.jsxs("div",{className:"text-white flex flex-col h-screen",children:[c.jsx(fS,{popoutUrl:e}),c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsx(uS,{}),c.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0",children:[c.jsx(iS,{}),c.jsx("main",{className:"flex-1 min-h-0 w-full px-6 py-8 overflow-y-auto",children:t})]})]}),c.jsx(eS,{})]})}function hS({popoutUrl:e}={}){return c.jsxs(Gb,{children:[c.jsx(P1,{}),c.jsx(mS,{popoutUrl:e})]})}function mS({popoutUrl:e}){const{phase:t,connectError:l}=Ne(),{handleConnect:n}=He();return t==="connect"?c.jsx("div",{className:"px-4",children:c.jsx(Tb,{onConnect:n,error:l})}):c.jsx(dS,{popoutUrl:e,children:c.jsx(xS,{})})}function xS(){const{phase:e}=Ne(),t=it();if(e==="idle"&&t.pathname.startsWith("/settings"))return c.jsx(I1,{});switch(e){case"idle":return c.jsx(r1,{});case"selected":return c.jsx(X1,{});case"analyzing":return c.jsx(Pb,{});case"reviewing":case"applying":return c.jsx(B1,{});case"monitoring":return c.jsx(N1,{});default:return null}}Fy.createRoot(document.getElementById("root")).render(c.jsx(p.StrictMode,{children:c.jsx(pb,{children:c.jsx("div",{className:"min-h-screen bg-zinc-900",children:c.jsx(hS,{})})})}));