@superclawd-ai/fda 0.1.37 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{index-aS_PBUwX.js → index-Cq4AqUuq.js} +14 -14
- package/dist/index.html +1 -1
- package/dist-server/cli.mjs +134 -124
- package/dist-server/index.mjs +151 -141
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var tx=Object.defineProperty;var wp=n=>{throw TypeError(n)};var nx=(n,r,s)=>r in n?tx(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var qi=(n,r,s)=>nx(n,typeof r!="symbol"?r+"":r,s),Dc=(n,r,s)=>r.has(n)||wp("Cannot "+s);var
|
|
1
|
+
var tx=Object.defineProperty;var wp=n=>{throw TypeError(n)};var nx=(n,r,s)=>r in n?tx(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var qi=(n,r,s)=>nx(n,typeof r!="symbol"?r+"":r,s),Dc=(n,r,s)=>r.has(n)||wp("Cannot "+s);var N=(n,r,s)=>(Dc(n,r,"read from private field"),s?s.call(n):r.get(n)),ke=(n,r,s)=>r.has(n)?wp("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),ee=(n,r,s,o)=>(Dc(n,r,"write to private field"),o?o.call(n,s):r.set(n,s),s),De=(n,r,s)=>(Dc(n,r,"access private method"),s);var jo=(n,r,s,o)=>({set _(u){ee(n,r,u,s)},get _(){return N(n,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(u){if(u.ep)return;u.ep=!0;const d=s(u);fetch(u.href,d)}})();function qm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Oc={exports:{}},Bi={},Fc={exports:{}},qe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var tx=Object.defineProperty;var wp=n=>{throw TypeError(n)};var nx=(n,r,s)=>r in
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var kp;function rx(){if(kp)return
|
|
9
|
+
*/var kp;function rx(){if(kp)return qe;kp=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),w=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=w&&L[w]||L["@@iterator"],typeof L=="function"?L:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function S(L,q,be){this.props=L,this.context=q,this.refs=E,this.updater=be||j}S.prototype.isReactComponent={},S.prototype.setState=function(L,q){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,q,"setState")},S.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function P(){}P.prototype=S.prototype;function D(L,q,be){this.props=L,this.context=q,this.refs=E,this.updater=be||j}var U=D.prototype=new P;U.constructor=D,_(U,S.prototype),U.isPureReactComponent=!0;var Q=Array.isArray,X=Object.prototype.hasOwnProperty,se={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function B(L,q,be){var ve,xe={},Se=null,Fe=null;if(q!=null)for(ve in q.ref!==void 0&&(Fe=q.ref),q.key!==void 0&&(Se=""+q.key),q)X.call(q,ve)&&!A.hasOwnProperty(ve)&&(xe[ve]=q[ve]);var Ke=arguments.length-2;if(Ke===1)xe.children=be;else if(1<Ke){for(var _e=Array(Ke),It=0;It<Ke;It++)_e[It]=arguments[It+2];xe.children=_e}if(L&&L.defaultProps)for(ve in Ke=L.defaultProps,Ke)xe[ve]===void 0&&(xe[ve]=Ke[ve]);return{$$typeof:n,type:L,key:Se,ref:Fe,props:xe,_owner:se.current}}function pe(L,q){return{$$typeof:n,type:L.type,key:q,ref:L.ref,props:L.props,_owner:L._owner}}function Z(L){return typeof L=="object"&&L!==null&&L.$$typeof===n}function Ue(L){var q={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(be){return q[be]})}var Je=/\/+/g;function nt(L,q){return typeof L=="object"&&L!==null&&L.key!=null?Ue(""+L.key):q.toString(36)}function pt(L,q,be,ve,xe){var Se=typeof L;(Se==="undefined"||Se==="boolean")&&(L=null);var Fe=!1;if(L===null)Fe=!0;else switch(Se){case"string":case"number":Fe=!0;break;case"object":switch(L.$$typeof){case n:case r:Fe=!0}}if(Fe)return Fe=L,xe=xe(Fe),L=ve===""?"."+nt(Fe,0):ve,Q(xe)?(be="",L!=null&&(be=L.replace(Je,"$&/")+"/"),pt(xe,q,be,"",function(It){return It})):xe!=null&&(Z(xe)&&(xe=pe(xe,be+(!xe.key||Fe&&Fe.key===xe.key?"":(""+xe.key).replace(Je,"$&/")+"/")+L)),q.push(xe)),1;if(Fe=0,ve=ve===""?".":ve+":",Q(L))for(var Ke=0;Ke<L.length;Ke++){Se=L[Ke];var _e=ve+nt(Se,Ke);Fe+=pt(Se,q,be,_e,xe)}else if(_e=x(L),typeof _e=="function")for(L=_e.call(L),Ke=0;!(Se=L.next()).done;)Se=Se.value,_e=ve+nt(Se,Ke++),Fe+=pt(Se,q,be,_e,xe);else if(Se==="object")throw q=String(L),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Fe}function Pe(L,q,be){if(L==null)return L;var ve=[],xe=0;return pt(L,ve,"","",function(Se){return q.call(be,Se,xe++)}),ve}function Te(L){if(L._status===-1){var q=L._result;q=q(),q.then(function(be){(L._status===0||L._status===-1)&&(L._status=1,L._result=be)},function(be){(L._status===0||L._status===-1)&&(L._status=2,L._result=be)}),L._status===-1&&(L._status=0,L._result=q)}if(L._status===1)return L._result.default;throw L._result}var ye={current:null},G={transition:null},ne={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:G,ReactCurrentOwner:se};function $(){throw Error("act(...) is not supported in production builds of React.")}return qe.Children={map:Pe,forEach:function(L,q,be){Pe(L,function(){q.apply(this,arguments)},be)},count:function(L){var q=0;return Pe(L,function(){q++}),q},toArray:function(L){return Pe(L,function(q){return q})||[]},only:function(L){if(!Z(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},qe.Component=S,qe.Fragment=s,qe.Profiler=u,qe.PureComponent=D,qe.StrictMode=o,qe.Suspense=g,qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,qe.act=$,qe.cloneElement=function(L,q,be){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var ve=_({},L.props),xe=L.key,Se=L.ref,Fe=L._owner;if(q!=null){if(q.ref!==void 0&&(Se=q.ref,Fe=se.current),q.key!==void 0&&(xe=""+q.key),L.type&&L.type.defaultProps)var Ke=L.type.defaultProps;for(_e in q)X.call(q,_e)&&!A.hasOwnProperty(_e)&&(ve[_e]=q[_e]===void 0&&Ke!==void 0?Ke[_e]:q[_e])}var _e=arguments.length-2;if(_e===1)ve.children=be;else if(1<_e){Ke=Array(_e);for(var It=0;It<_e;It++)Ke[It]=arguments[It+2];ve.children=Ke}return{$$typeof:n,type:L.type,key:xe,ref:Se,props:ve,_owner:Fe}},qe.createContext=function(L){return L={$$typeof:h,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:d,_context:L},L.Consumer=L},qe.createElement=B,qe.createFactory=function(L){var q=B.bind(null,L);return q.type=L,q},qe.createRef=function(){return{current:null}},qe.forwardRef=function(L){return{$$typeof:p,render:L}},qe.isValidElement=Z,qe.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:Te}},qe.memo=function(L,q){return{$$typeof:m,type:L,compare:q===void 0?null:q}},qe.startTransition=function(L){var q=G.transition;G.transition={};try{L()}finally{G.transition=q}},qe.unstable_act=$,qe.useCallback=function(L,q){return ye.current.useCallback(L,q)},qe.useContext=function(L){return ye.current.useContext(L)},qe.useDebugValue=function(){},qe.useDeferredValue=function(L){return ye.current.useDeferredValue(L)},qe.useEffect=function(L,q){return ye.current.useEffect(L,q)},qe.useId=function(){return ye.current.useId()},qe.useImperativeHandle=function(L,q,be){return ye.current.useImperativeHandle(L,q,be)},qe.useInsertionEffect=function(L,q){return ye.current.useInsertionEffect(L,q)},qe.useLayoutEffect=function(L,q){return ye.current.useLayoutEffect(L,q)},qe.useMemo=function(L,q){return ye.current.useMemo(L,q)},qe.useReducer=function(L,q,be){return ye.current.useReducer(L,q,be)},qe.useRef=function(L){return ye.current.useRef(L)},qe.useState=function(L){return ye.current.useState(L)},qe.useSyncExternalStore=function(L,q,be){return ye.current.useSyncExternalStore(L,q,be)},qe.useTransition=function(){return ye.current.useTransition()},qe.version="18.3.1",qe}var jp;function Nd(){return jp||(jp=1,Fc.exports=rx()),Fc.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var tx=Object.defineProperty;var wp=n=>{throw TypeError(n)};var nx=(n,r,s)=>r in
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var bp;function sx(){if(bp)return Bi;bp=1;var n=Nd(),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function h(p,g,m){var y,w={},x=null,j=null;m!==void 0&&(x=""+m),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(j=g.ref);for(y in g)o.call(g,y)&&!d.hasOwnProperty(y)&&(w[y]=g[y]);if(p&&p.defaultProps)for(y in g=p.defaultProps,g)w[y]===void 0&&(w[y]=g[y]);return{$$typeof:r,type:p,key:x,ref:j,props:w,_owner:u.current}}return Bi.Fragment=s,Bi.jsx=h,Bi.jsxs=h,Bi}var Sp;function ax(){return Sp||(Sp=1,Oc.exports=sx()),Oc.exports}var i=ax(),k=Nd();const ix=qm(k);var
|
|
17
|
+
*/var bp;function sx(){if(bp)return Bi;bp=1;var n=Nd(),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function h(p,g,m){var y,w={},x=null,j=null;m!==void 0&&(x=""+m),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(j=g.ref);for(y in g)o.call(g,y)&&!d.hasOwnProperty(y)&&(w[y]=g[y]);if(p&&p.defaultProps)for(y in g=p.defaultProps,g)w[y]===void 0&&(w[y]=g[y]);return{$$typeof:r,type:p,key:x,ref:j,props:w,_owner:u.current}}return Bi.Fragment=s,Bi.jsx=h,Bi.jsxs=h,Bi}var Sp;function ax(){return Sp||(Sp=1,Oc.exports=sx()),Oc.exports}var i=ax(),k=Nd();const ix=qm(k);var bo={},Ic={exports:{}},fn={},zc={exports:{}},Uc={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var tx=Object.defineProperty;var wp=n=>{throw TypeError(n)};var nx=(n,r,s)=>r in
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Cp;function lx(){return Cp||(Cp=1,(function(n){function r(G,ne){var
|
|
25
|
+
*/var Cp;function lx(){return Cp||(Cp=1,(function(n){function r(G,ne){var $=G.length;G.push(ne);e:for(;0<$;){var L=$-1>>>1,q=G[L];if(0<u(q,ne))G[L]=ne,G[$]=q,$=L;else break e}}function s(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var ne=G[0],$=G.pop();if($!==ne){G[0]=$;e:for(var L=0,q=G.length,be=q>>>1;L<be;){var ve=2*(L+1)-1,xe=G[ve],Se=ve+1,Fe=G[Se];if(0>u(xe,$))Se<q&&0>u(Fe,xe)?(G[L]=Fe,G[Se]=$,L=Se):(G[L]=xe,G[ve]=$,L=ve);else if(Se<q&&0>u(Fe,$))G[L]=Fe,G[Se]=$,L=Se;else break e}}return ne}function u(G,ne){var $=G.sortIndex-ne.sortIndex;return $!==0?$:G.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();n.unstable_now=function(){return h.now()-p}}var g=[],m=[],y=1,w=null,x=3,j=!1,_=!1,E=!1,S=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(G){for(var ne=s(m);ne!==null;){if(ne.callback===null)o(m);else if(ne.startTime<=G)o(m),ne.sortIndex=ne.expirationTime,r(g,ne);else break;ne=s(m)}}function Q(G){if(E=!1,U(G),!_)if(s(g)!==null)_=!0,Te(X);else{var ne=s(m);ne!==null&&ye(Q,ne.startTime-G)}}function X(G,ne){_=!1,E&&(E=!1,P(B),B=-1),j=!0;var $=x;try{for(U(ne),w=s(g);w!==null&&(!(w.expirationTime>ne)||G&&!Ue());){var L=w.callback;if(typeof L=="function"){w.callback=null,x=w.priorityLevel;var q=L(w.expirationTime<=ne);ne=n.unstable_now(),typeof q=="function"?w.callback=q:w===s(g)&&o(g),U(ne)}else o(g);w=s(g)}if(w!==null)var be=!0;else{var ve=s(m);ve!==null&&ye(Q,ve.startTime-ne),be=!1}return be}finally{w=null,x=$,j=!1}}var se=!1,A=null,B=-1,pe=5,Z=-1;function Ue(){return!(n.unstable_now()-Z<pe)}function Je(){if(A!==null){var G=n.unstable_now();Z=G;var ne=!0;try{ne=A(!0,G)}finally{ne?nt():(se=!1,A=null)}}else se=!1}var nt;if(typeof D=="function")nt=function(){D(Je)};else if(typeof MessageChannel<"u"){var pt=new MessageChannel,Pe=pt.port2;pt.port1.onmessage=Je,nt=function(){Pe.postMessage(null)}}else nt=function(){S(Je,0)};function Te(G){A=G,se||(se=!0,nt())}function ye(G,ne){B=S(function(){G(n.unstable_now())},ne)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.unstable_continueExecution=function(){_||j||(_=!0,Te(X))},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pe=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return s(g)},n.unstable_next=function(G){switch(x){case 1:case 2:case 3:var ne=3;break;default:ne=x}var $=x;x=ne;try{return G()}finally{x=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(G,ne){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var $=x;x=G;try{return ne()}finally{x=$}},n.unstable_scheduleCallback=function(G,ne,$){var L=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?L+$:L):$=L,G){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=$+q,G={id:y++,callback:ne,priorityLevel:G,startTime:$,expirationTime:q,sortIndex:-1},$>L?(G.sortIndex=$,r(m,G),s(g)===null&&G===s(m)&&(E?(P(B),B=-1):E=!0,ye(Q,$-L))):(G.sortIndex=q,r(g,G),_||j||(_=!0,Te(X))),G},n.unstable_shouldYield=Ue,n.unstable_wrapCallback=function(G){var ne=x;return function(){var $=x;x=ne;try{return G.apply(this,arguments)}finally{x=$}}}})(Uc)),Uc}var Np;function ox(){return Np||(Np=1,zc.exports=lx()),zc.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var tx=Object.defineProperty;var wp=n=>{throw TypeError(n)};var nx=(n,r,s)=>r in
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Ep;function ux(){if(Ep)return fn;Ep=1;var n=Nd(),r=ox();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,u={};function d(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(u[e]=t,e=0;e<t.length;e++)o.add(t[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,y={},w={};function x(e){return g.call(w,e)?!0:g.call(y,e)?!1:m.test(e)?w[e]=!0:(y[e]=!0,!1)}function j(e,t,a,l){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function
|
|
34
|
-
`+
|
|
33
|
+
*/var Ep;function ux(){if(Ep)return fn;Ep=1;var n=Nd(),r=ox();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,u={};function d(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(u[e]=t,e=0;e<t.length;e++)o.add(t[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,y={},w={};function x(e){return g.call(w,e)?!0:g.call(y,e)?!1:m.test(e)?w[e]=!0:(y[e]=!0,!1)}function j(e,t,a,l){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _(e,t,a,l){if(t===null||typeof t>"u"||j(e,t,a,l))return!0;if(l)return!1;if(a!==null)switch(a.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function E(e,t,a,l,c,f,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=c,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=f,this.removeEmptyString=v}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){S[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];S[t]=new E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){S[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){S[e]=new E(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){S[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){S[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){S[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){S[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){S[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function D(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(P,D);S[t]=new E(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(P,D);S[t]=new E(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(P,D);S[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){S[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),S.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){S[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,a,l){var c=S.hasOwnProperty(t)?S[t]:null;(c!==null?c.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_(t,a,c,l)&&(a=null),l||c===null?x(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):c.mustUseProperty?e[c.propertyName]=a===null?c.type===3?!1:"":a:(t=c.attributeName,l=c.attributeNamespace,a===null?e.removeAttribute(t):(c=c.type,a=c===3||c===4&&a===!0?"":""+a,l?e.setAttributeNS(l,t,a):e.setAttribute(t,a))))}var Q=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,X=Symbol.for("react.element"),se=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),pe=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),Ue=Symbol.for("react.context"),Je=Symbol.for("react.forward_ref"),nt=Symbol.for("react.suspense"),pt=Symbol.for("react.suspense_list"),Pe=Symbol.for("react.memo"),Te=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),G=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var $=Object.assign,L;function q(e){if(L===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return`
|
|
34
|
+
`+L+e}var be=!1;function ve(e,t){if(!e||be)return"";be=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(I){var l=I}Reflect.construct(e,[],t)}else{try{t.call()}catch(I){l=I}e.call(t.prototype)}else{try{throw Error()}catch(I){l=I}e()}}catch(I){if(I&&l&&typeof I.stack=="string"){for(var c=I.stack.split(`
|
|
35
35
|
`),f=l.stack.split(`
|
|
36
36
|
`),v=c.length-1,b=f.length-1;1<=v&&0<=b&&c[v]!==f[b];)b--;for(;1<=v&&0<=b;v--,b--)if(c[v]!==f[b]){if(v!==1||b!==1)do if(v--,b--,0>b||c[v]!==f[b]){var R=`
|
|
37
|
-
`+c[v].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=v&&0<=b);break}}}finally{be=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?q(e):""}function xe(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return e=ve(e.type,!1),e;case 11:return e=ve(e.type.render,!1),e;case 1:return e=ve(e.type,!0),e;default:return""}}function Se(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case se:return"Portal";case pe:return"Profiler";case B:return"StrictMode";case nt:return"Suspense";case pt:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ze:return(e.displayName||"Context")+".Consumer";case Z:return(e._context.displayName||"Context")+".Provider";case Je:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Re:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case Pe:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}function Oe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(t);case 8:return t===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _e(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function It(e){var t=_e(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(v){l=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ct(e){e._valueTracker||(e._valueTracker=It(e))}function sn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=_e(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Fn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Gn(e,t){var a=t.checked;return U({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Yn(e,t){var a=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;a=Ke(t.value!=null?t.value:a),e._wrapperState={initialChecked:l,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function hl(e,t){t=t.checked,t!=null&&$(e,"checked",t,!1)}function Za(e,t){hl(e,t);var a=Ke(t.value),l=t.type;if(a!=null)l==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ti(e,t.type,a):t.hasOwnProperty("defaultValue")&&ti(e,t.type,Ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ei(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function ti(e,t,a){(t!=="number"||Fn(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var vs=Array.isArray;function Er(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Ke(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ni(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return U({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Jn(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(s(92));if(vs(a)){if(1<a.length)throw Error(s(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Ke(a)}}function Rr(e,t){var a=Ke(t.value),l=Ke(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),l!=null&&(e.defaultValue=""+l)}function ri(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ra(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ra(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var an,si=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,l,c){MSApp.execUnsafeLocalFunction(function(){return e(t,a,l,c)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(an=an||document.createElement("div"),an.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=an.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xs(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ur={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tu=["Webkit","ms","Moz","O"];Object.keys(ur).forEach(function(e){tu.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ur[t]=ur[e]})});function jn(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||ur.hasOwnProperty(e)&&ur[e]?(""+t).trim():t+"px"}function ai(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var l=a.indexOf("--")===0,c=jn(a,t[a],l);a==="float"&&(a="cssFloat"),l?e.setProperty(a,c):e[a]=c}}var pl=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sa(e,t){if(t){if(pl[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function ii(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var aa=null;function Pr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ia=null,Xn=null,Tr=null;function li(e){if(e=Ei(e)){if(typeof ia!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Dl(t),ia(e.stateNode,e.type,t))}}function ml(e){Xn?Tr?Tr.push(e):Tr=[e]:Xn=e}function oi(){if(Xn){var e=Xn,t=Tr;if(Tr=Xn=null,li(e),t)for(e=0;e<t.length;e++)li(t[e])}}function ws(e,t){return e(t)}function ks(){}var la=!1;function gl(e,t,a){if(la)return e(t,a);la=!0;try{return ws(e,t,a)}finally{la=!1,(Xn!==null||Tr!==null)&&(ks(),oi())}}function js(e,t){var a=e.stateNode;if(a===null)return null;var l=Dl(a);if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,t,typeof a));return a}var C=!1;if(p)try{var _={};Object.defineProperty(_,"passive",{get:function(){C=!0}}),window.addEventListener("test",_,_),window.removeEventListener("test",_,_)}catch{C=!1}function I(e,t,a,l,c,f,v,b,R){var F=Array.prototype.slice.call(arguments,3);try{t.apply(a,F)}catch(W){this.onError(W)}}var V=!1,J=null,ce=!1,fe=null,de={onError:function(e){V=!0,J=e}};function me(e,t,a,l,c,f,v,b,R){V=!1,J=null,I.apply(de,arguments)}function je(e,t,a,l,c,f,v,b,R){if(me.apply(this,arguments),V){if(V){var F=J;V=!1,J=null}else throw Error(s(198));ce||(ce=!0,fe=F)}}function we(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function ge(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 Ae(e){if(we(e)!==e)throw Error(s(188))}function st(e){var t=e.alternate;if(!t){if(t=we(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return Ae(c),e;if(f===l)return Ae(c),t;f=f.sibling}throw Error(s(188))}if(a.return!==l.return)a=c,l=f;else{for(var v=!1,b=c.child;b;){if(b===a){v=!0,a=c,l=f;break}if(b===l){v=!0,l=c,a=f;break}b=b.sibling}if(!v){for(b=f.child;b;){if(b===a){v=!0,a=f,l=c;break}if(b===l){v=!0,l=f,a=c;break}b=b.sibling}if(!v)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function jt(e){return e=st(e),e!==null?Nt(e):null}function Nt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nt(e);if(t!==null)return t;e=e.sibling}return null}var at=r.unstable_scheduleCallback,it=r.unstable_cancelCallback,cr=r.unstable_shouldYield,bs=r.unstable_requestPaint,Ze=r.unstable_now,bn=r.unstable_getCurrentPriorityLevel,Ss=r.unstable_ImmediatePriority,Lr=r.unstable_UserBlockingPriority,Sn=r.unstable_NormalPriority,oa=r.unstable_LowPriority,Cs=r.unstable_IdlePriority,Ue=null,lt=null;function Mr(e){if(lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(Ue,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:yl,mt=Math.log,ua=Math.LN2;function yl(e){return e>>>=0,e===0?32:31-(mt(e)/ua|0)|0}var ca=64,vl=4194304;function ui(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function xl(e,t){var a=e.pendingLanes;if(a===0)return 0;var l=0,c=e.suspendedLanes,f=e.pingedLanes,v=a&268435455;if(v!==0){var b=v&~c;b!==0?l=ui(b):(f&=v,f!==0&&(l=ui(f)))}else v=a&~c,v!==0?l=ui(v):f!==0&&(l=ui(f));if(l===0)return 0;if(t!==0&&t!==l&&(t&c)===0&&(c=l&-l,f=t&-t,c>=f||c===16&&(f&4194240)!==0))return t;if((l&4)!==0&&(l|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)a=31-Lt(t),c=1<<a,l|=e[a],t&=~c;return l}function wy(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ky(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes;0<f;){var v=31-Lt(f),b=1<<v,R=c[v];R===-1?((b&a)===0||(b&l)!==0)&&(c[v]=wy(b,t)):R<=t&&(e.expiredLanes|=b),f&=~b}}function nu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Yd(){var e=ca;return ca<<=1,(ca&4194240)===0&&(ca=64),e}function ru(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ci(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=a}function jy(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<a;){var c=31-Lt(a),f=1<<c;t[c]=0,l[c]=-1,e[c]=-1,a&=~f}}function su(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Lt(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}var rt=0;function Jd(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Xd,au,Zd,ef,tf,iu=!1,wl=[],_r=null,Ar=null,Dr=null,di=new Map,fi=new Map,Or=[],by="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nf(e,t){switch(e){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fi.delete(t.pointerId)}}function hi(e,t,a,l,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Ei(t),t!==null&&au(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Sy(e,t,a,l,c){switch(t){case"focusin":return _r=hi(_r,e,t,a,l,c),!0;case"dragenter":return Ar=hi(Ar,e,t,a,l,c),!0;case"mouseover":return Dr=hi(Dr,e,t,a,l,c),!0;case"pointerover":var f=c.pointerId;return di.set(f,hi(di.get(f)||null,e,t,a,l,c)),!0;case"gotpointercapture":return f=c.pointerId,fi.set(f,hi(fi.get(f)||null,e,t,a,l,c)),!0}return!1}function rf(e){var t=Ns(e.target);if(t!==null){var a=we(t);if(a!==null){if(t=a.tag,t===13){if(t=ge(a),t!==null){e.blockedOn=t,tf(e.priority,function(){Zd(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function kl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ou(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);aa=l,a.target.dispatchEvent(l),aa=null}else return t=Ei(a),t!==null&&au(t),e.blockedOn=a,!1;t.shift()}return!0}function sf(e,t,a){kl(e)&&a.delete(t)}function Cy(){iu=!1,_r!==null&&kl(_r)&&(_r=null),Ar!==null&&kl(Ar)&&(Ar=null),Dr!==null&&kl(Dr)&&(Dr=null),di.forEach(sf),fi.forEach(sf)}function pi(e,t){e.blockedOn===t&&(e.blockedOn=null,iu||(iu=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Cy)))}function mi(e){function t(c){return pi(c,e)}if(0<wl.length){pi(wl[0],e);for(var a=1;a<wl.length;a++){var l=wl[a];l.blockedOn===e&&(l.blockedOn=null)}}for(_r!==null&&pi(_r,e),Ar!==null&&pi(Ar,e),Dr!==null&&pi(Dr,e),di.forEach(t),fi.forEach(t),a=0;a<Or.length;a++)l=Or[a],l.blockedOn===e&&(l.blockedOn=null);for(;0<Or.length&&(a=Or[0],a.blockedOn===null);)rf(a),a.blockedOn===null&&Or.shift()}var da=Q.ReactCurrentBatchConfig,jl=!0;function Ny(e,t,a,l){var c=rt,f=da.transition;da.transition=null;try{rt=1,lu(e,t,a,l)}finally{rt=c,da.transition=f}}function Ey(e,t,a,l){var c=rt,f=da.transition;da.transition=null;try{rt=4,lu(e,t,a,l)}finally{rt=c,da.transition=f}}function lu(e,t,a,l){if(jl){var c=ou(e,t,a,l);if(c===null)Cu(e,t,l,bl,a),nf(e,l);else if(Sy(c,e,t,a,l))l.stopPropagation();else if(nf(e,l),t&4&&-1<by.indexOf(e)){for(;c!==null;){var f=Ei(c);if(f!==null&&Xd(f),f=ou(e,t,a,l),f===null&&Cu(e,t,l,bl,a),f===c)break;c=f}c!==null&&l.stopPropagation()}else Cu(e,t,l,null,a)}}var bl=null;function ou(e,t,a,l){if(bl=null,e=Pr(l),e=Ns(e),e!==null)if(t=we(e),t===null)e=null;else if(a=t.tag,a===13){if(e=ge(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bl=e,null}function af(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(bn()){case Ss:return 1;case Lr:return 4;case Sn:case oa:return 16;case Cs:return 536870912;default:return 16}default:return 16}}var Fr=null,uu=null,Sl=null;function lf(){if(Sl)return Sl;var e,t=uu,a=t.length,l,c="value"in Fr?Fr.value:Fr.textContent,f=c.length;for(e=0;e<a&&t[e]===c[e];e++);var v=a-e;for(l=1;l<=v&&t[a-l]===c[f-l];l++);return Sl=c.slice(e,1<l?1-l:void 0)}function Cl(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 Nl(){return!0}function of(){return!1}function yn(e){function t(a,l,c,f,v){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(f):f[b]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Nl:of,this.isPropagationStopped=of,this}return U(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),t}var fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cu=yn(fa),gi=U({},fa,{view:0,detail:0}),Ry=yn(gi),du,fu,yi,El=U({},gi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,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!==yi&&(yi&&e.type==="mousemove"?(du=e.screenX-yi.screenX,fu=e.screenY-yi.screenY):fu=du=0,yi=e),du)},movementY:function(e){return"movementY"in e?e.movementY:fu}}),uf=yn(El),Py=U({},El,{dataTransfer:0}),Ty=yn(Py),Ly=U({},gi,{relatedTarget:0}),hu=yn(Ly),My=U({},fa,{animationName:0,elapsedTime:0,pseudoElement:0}),_y=yn(My),Ay=U({},fa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dy=yn(Ay),Oy=U({},fa,{data:0}),cf=yn(Oy),Fy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Iy={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"},zy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zy[e])?!!t[e]:!1}function pu(){return Uy}var $y=U({},gi,{key:function(e){if(e.key){var t=Fy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Iy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?Cl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=yn($y),By=U({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),df=yn(By),Hy=U({},gi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),Qy=yn(Hy),Vy=U({},fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wy=yn(Vy),Ky=U({},El,{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}),Gy=yn(Ky),Yy=[9,13,27,32],mu=p&&"CompositionEvent"in window,vi=null;p&&"documentMode"in document&&(vi=document.documentMode);var Jy=p&&"TextEvent"in window&&!vi,ff=p&&(!mu||vi&&8<vi&&11>=vi),hf=" ",pf=!1;function mf(e,t){switch(e){case"keyup":return Yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ha=!1;function Xy(e,t){switch(e){case"compositionend":return gf(t);case"keypress":return t.which!==32?null:(pf=!0,hf);case"textInput":return e=t.data,e===hf&&pf?null:e;default:return null}}function Zy(e,t){if(ha)return e==="compositionend"||!mu&&mf(e,t)?(e=lf(),Sl=uu=Fr=null,ha=!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 ff&&t.locale!=="ko"?null:t.data;default:return null}}var ev={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 yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ev[e.type]:t==="textarea"}function vf(e,t,a,l){ml(l),t=Ml(t,"onChange"),0<t.length&&(a=new cu("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var xi=null,wi=null;function tv(e){Of(e,0)}function Rl(e){var t=va(e);if(sn(t))return e}function nv(e,t){if(e==="change")return t}var xf=!1;if(p){var gu;if(p){var yu="oninput"in document;if(!yu){var wf=document.createElement("div");wf.setAttribute("oninput","return;"),yu=typeof wf.oninput=="function"}gu=yu}else gu=!1;xf=gu&&(!document.documentMode||9<document.documentMode)}function kf(){xi&&(xi.detachEvent("onpropertychange",jf),wi=xi=null)}function jf(e){if(e.propertyName==="value"&&Rl(wi)){var t=[];vf(t,wi,e,Pr(e)),gl(tv,t)}}function rv(e,t,a){e==="focusin"?(kf(),xi=t,wi=a,xi.attachEvent("onpropertychange",jf)):e==="focusout"&&kf()}function sv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rl(wi)}function av(e,t){if(e==="click")return Rl(t)}function iv(e,t){if(e==="input"||e==="change")return Rl(t)}function lv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:lv;function ki(e,t){if(In(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!g.call(t,c)||!In(e[c],t[c]))return!1}return!0}function bf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sf(e,t){var a=bf(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=bf(a)}}function Cf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nf(){for(var e=window,t=Fn();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Fn(e.document)}return t}function vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ov(e){var t=Nf(),a=e.focusedElem,l=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Cf(a.ownerDocument.documentElement,a)){if(l!==null&&vu(a)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=a.textContent.length,f=Math.min(l.start,c);l=l.end===void 0?f:Math.min(l.end,c),!e.extend&&f>l&&(c=l,l=f,f=c),c=Sf(a,f);var v=Sf(a,l);c&&v&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),f>l?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uv=p&&"documentMode"in document&&11>=document.documentMode,pa=null,xu=null,ji=null,wu=!1;function Ef(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wu||pa==null||pa!==Fn(l)||(l=pa,"selectionStart"in l&&vu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ji&&ki(ji,l)||(ji=l,l=Ml(xu,"onSelect"),0<l.length&&(t=new cu("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=pa)))}function Pl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ma={animationend:Pl("Animation","AnimationEnd"),animationiteration:Pl("Animation","AnimationIteration"),animationstart:Pl("Animation","AnimationStart"),transitionend:Pl("Transition","TransitionEnd")},ku={},Rf={};p&&(Rf=document.createElement("div").style,"AnimationEvent"in window||(delete ma.animationend.animation,delete ma.animationiteration.animation,delete ma.animationstart.animation),"TransitionEvent"in window||delete ma.transitionend.transition);function Tl(e){if(ku[e])return ku[e];if(!ma[e])return e;var t=ma[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Rf)return ku[e]=t[a];return e}var Pf=Tl("animationend"),Tf=Tl("animationiteration"),Lf=Tl("animationstart"),Mf=Tl("transitionend"),_f=new Map,Af="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ir(e,t){_f.set(e,t),d(t,[e])}for(var ju=0;ju<Af.length;ju++){var bu=Af[ju],cv=bu.toLowerCase(),dv=bu[0].toUpperCase()+bu.slice(1);Ir(cv,"on"+dv)}Ir(Pf,"onAnimationEnd"),Ir(Tf,"onAnimationIteration"),Ir(Lf,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(Mf,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="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(" "),fv=new Set("cancel close invalid load scroll toggle".split(" ").concat(bi));function Df(e,t,a){var l=e.type||"unknown-event";e.currentTarget=a,je(l,t,void 0,e),e.currentTarget=null}function Of(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var f=void 0;if(t)for(var v=l.length-1;0<=v;v--){var b=l[v],R=b.instance,F=b.currentTarget;if(b=b.listener,R!==f&&c.isPropagationStopped())break e;Df(c,b,F),f=R}else for(v=0;v<l.length;v++){if(b=l[v],R=b.instance,F=b.currentTarget,b=b.listener,R!==f&&c.isPropagationStopped())break e;Df(c,b,F),f=R}}}if(ce)throw e=fe,ce=!1,fe=null,e}function ft(e,t){var a=t[Lu];a===void 0&&(a=t[Lu]=new Set);var l=e+"__bubble";a.has(l)||(Ff(t,e,2,!1),a.add(l))}function Su(e,t,a){var l=0;t&&(l|=4),Ff(a,e,l,t)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function Si(e){if(!e[Ll]){e[Ll]=!0,o.forEach(function(a){a!=="selectionchange"&&(fv.has(a)||Su(a,!1,e),Su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ll]||(t[Ll]=!0,Su("selectionchange",!1,t))}}function Ff(e,t,a,l){switch(af(t)){case 1:var c=Ny;break;case 4:c=Ey;break;default:c=lu}a=c.bind(null,t,a,e),c=void 0,!C||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Cu(e,t,a,l,c){var f=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var b=l.stateNode.containerInfo;if(b===c||b.nodeType===8&&b.parentNode===c)break;if(v===4)for(v=l.return;v!==null;){var R=v.tag;if((R===3||R===4)&&(R=v.stateNode.containerInfo,R===c||R.nodeType===8&&R.parentNode===c))return;v=v.return}for(;b!==null;){if(v=Ns(b),v===null)return;if(R=v.tag,R===5||R===6){l=f=v;continue e}b=b.parentNode}}l=l.return}gl(function(){var F=f,W=Pr(a),K=[];e:{var H=_f.get(e);if(H!==void 0){var te=cu,ae=e;switch(e){case"keypress":if(Cl(a)===0)break e;case"keydown":case"keyup":te=qy;break;case"focusin":ae="focus",te=hu;break;case"focusout":ae="blur",te=hu;break;case"beforeblur":case"afterblur":te=hu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Ty;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Qy;break;case Pf:case Tf:case Lf:te=_y;break;case Mf:te=Wy;break;case"scroll":te=Ry;break;case"wheel":te=Gy;break;case"copy":case"cut":case"paste":te=Dy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=df}var ue=(t&4)!==0,Et=!ue&&e==="scroll",D=ue?H!==null?H+"Capture":null:H;ue=[];for(var P=F,O;P!==null;){O=P;var Y=O.stateNode;if(O.tag===5&&Y!==null&&(O=Y,D!==null&&(Y=js(P,D),Y!=null&&ue.push(Ci(P,Y,O)))),Et)break;P=P.return}0<ue.length&&(H=new te(H,ae,null,a,W),K.push({event:H,listeners:ue}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",H&&a!==aa&&(ae=a.relatedTarget||a.fromElement)&&(Ns(ae)||ae[dr]))break e;if((te||H)&&(H=W.window===W?W:(H=W.ownerDocument)?H.defaultView||H.parentWindow:window,te?(ae=a.relatedTarget||a.toElement,te=F,ae=ae?Ns(ae):null,ae!==null&&(Et=we(ae),ae!==Et||ae.tag!==5&&ae.tag!==6)&&(ae=null)):(te=null,ae=F),te!==ae)){if(ue=uf,Y="onMouseLeave",D="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(ue=df,Y="onPointerLeave",D="onPointerEnter",P="pointer"),Et=te==null?H:va(te),O=ae==null?H:va(ae),H=new ue(Y,P+"leave",te,a,W),H.target=Et,H.relatedTarget=O,Y=null,Ns(W)===F&&(ue=new ue(D,P+"enter",ae,a,W),ue.target=O,ue.relatedTarget=Et,Y=ue),Et=Y,te&&ae)t:{for(ue=te,D=ae,P=0,O=ue;O;O=ga(O))P++;for(O=0,Y=D;Y;Y=ga(Y))O++;for(;0<P-O;)ue=ga(ue),P--;for(;0<O-P;)D=ga(D),O--;for(;P--;){if(ue===D||D!==null&&ue===D.alternate)break t;ue=ga(ue),D=ga(D)}ue=null}else ue=null;te!==null&&If(K,H,te,ue,!1),ae!==null&&Et!==null&&If(K,Et,ae,ue,!0)}}e:{if(H=F?va(F):window,te=H.nodeName&&H.nodeName.toLowerCase(),te==="select"||te==="input"&&H.type==="file")var he=nv;else if(yf(H))if(xf)he=iv;else{he=sv;var Ce=rv}else(te=H.nodeName)&&te.toLowerCase()==="input"&&(H.type==="checkbox"||H.type==="radio")&&(he=av);if(he&&(he=he(e,F))){vf(K,he,a,W);break e}Ce&&Ce(e,H,F),e==="focusout"&&(Ce=H._wrapperState)&&Ce.controlled&&H.type==="number"&&ti(H,"number",H.value)}switch(Ce=F?va(F):window,e){case"focusin":(yf(Ce)||Ce.contentEditable==="true")&&(pa=Ce,xu=F,ji=null);break;case"focusout":ji=xu=pa=null;break;case"mousedown":wu=!0;break;case"contextmenu":case"mouseup":case"dragend":wu=!1,Ef(K,a,W);break;case"selectionchange":if(uv)break;case"keydown":case"keyup":Ef(K,a,W)}var Ne;if(mu)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else ha?mf(e,a)&&(Te="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Te="onCompositionStart");Te&&(ff&&a.locale!=="ko"&&(ha||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&ha&&(Ne=lf()):(Fr=W,uu="value"in Fr?Fr.value:Fr.textContent,ha=!0)),Ce=Ml(F,Te),0<Ce.length&&(Te=new cf(Te,e,null,a,W),K.push({event:Te,listeners:Ce}),Ne?Te.data=Ne:(Ne=gf(a),Ne!==null&&(Te.data=Ne)))),(Ne=Jy?Xy(e,a):Zy(e,a))&&(F=Ml(F,"onBeforeInput"),0<F.length&&(W=new cf("onBeforeInput","beforeinput",null,a,W),K.push({event:W,listeners:F}),W.data=Ne))}Of(K,t)})}function Ci(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ml(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,f=c.stateNode;c.tag===5&&f!==null&&(c=f,f=js(e,a),f!=null&&l.unshift(Ci(e,f,c)),f=js(e,t),f!=null&&l.push(Ci(e,f,c))),e=e.return}return l}function ga(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function If(e,t,a,l,c){for(var f=t._reactName,v=[];a!==null&&a!==l;){var b=a,R=b.alternate,F=b.stateNode;if(R!==null&&R===l)break;b.tag===5&&F!==null&&(b=F,c?(R=js(a,f),R!=null&&v.unshift(Ci(a,R,b))):c||(R=js(a,f),R!=null&&v.push(Ci(a,R,b)))),a=a.return}v.length!==0&&e.push({event:t,listeners:v})}var hv=/\r\n?/g,pv=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(hv,`
|
|
38
|
-
`).replace(pv,"")}function _l(e,t,a){if(t=zf(t),zf(e)!==t&&a)throw Error(s(425))}function Al(){}var Nu=null,Eu=null;function Ru(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pu=typeof setTimeout=="function"?setTimeout:void 0,mv=typeof clearTimeout=="function"?clearTimeout:void 0,Uf=typeof Promise=="function"?Promise:void 0,gv=typeof queueMicrotask=="function"?queueMicrotask:typeof Uf<"u"?function(e){return Uf.resolve(null).then(e).catch(yv)}:Pu;function yv(e){setTimeout(function(){throw e})}function Tu(e,t){var a=t,l=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(l===0){e.removeChild(c),mi(t);return}l--}else a!=="$"&&a!=="$?"&&a!=="$!"||l++;a=c}while(a);mi(t)}function zr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var ya=Math.random().toString(36).slice(2),Zn="__reactFiber$"+ya,Ni="__reactProps$"+ya,dr="__reactContainer$"+ya,Lu="__reactEvents$"+ya,vv="__reactListeners$"+ya,xv="__reactHandles$"+ya;function Ns(e){var t=e[Zn];if(t)return t;for(var a=e.parentNode;a;){if(t=a[dr]||a[Zn]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=$f(e);e!==null;){if(a=e[Zn])return a;e=$f(e)}return t}e=a,a=e.parentNode}return null}function Ei(e){return e=e[Zn]||e[dr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function va(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Dl(e){return e[Ni]||null}var Mu=[],xa=-1;function Ur(e){return{current:e}}function ht(e){0>xa||(e.current=Mu[xa],Mu[xa]=null,xa--)}function dt(e,t){xa++,Mu[xa]=e.current,e.current=t}var $r={},Vt=Ur($r),ln=Ur(!1),Es=$r;function wa(e,t){var a=e.type.contextTypes;if(!a)return $r;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var c={},f;for(f in a)c[f]=t[f];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function on(e){return e=e.childContextTypes,e!=null}function Ol(){ht(ln),ht(Vt)}function qf(e,t,a){if(Vt.current!==$r)throw Error(s(168));dt(Vt,t),dt(ln,a)}function Bf(e,t,a){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return a;l=l.getChildContext();for(var c in l)if(!(c in t))throw Error(s(108,Oe(e)||"Unknown",c));return U({},a,l)}function Fl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$r,Es=Vt.current,dt(Vt,e),dt(ln,ln.current),!0}function Hf(e,t,a){var l=e.stateNode;if(!l)throw Error(s(169));a?(e=Bf(e,t,Es),l.__reactInternalMemoizedMergedChildContext=e,ht(ln),ht(Vt),dt(Vt,e)):ht(ln),dt(ln,a)}var fr=null,Il=!1,_u=!1;function Qf(e){fr===null?fr=[e]:fr.push(e)}function wv(e){Il=!0,Qf(e)}function qr(){if(!_u&&fr!==null){_u=!0;var e=0,t=rt;try{var a=fr;for(rt=1;e<a.length;e++){var l=a[e];do l=l(!0);while(l!==null)}fr=null,Il=!1}catch(c){throw fr!==null&&(fr=fr.slice(e+1)),at(Ss,qr),c}finally{rt=t,_u=!1}}return null}var ka=[],ja=0,zl=null,Ul=0,Cn=[],Nn=0,Rs=null,hr=1,pr="";function Ps(e,t){ka[ja++]=Ul,ka[ja++]=zl,zl=e,Ul=t}function Vf(e,t,a){Cn[Nn++]=hr,Cn[Nn++]=pr,Cn[Nn++]=Rs,Rs=e;var l=hr;e=pr;var c=32-Lt(l)-1;l&=~(1<<c),a+=1;var f=32-Lt(t)+c;if(30<f){var v=c-c%5;f=(l&(1<<v)-1).toString(32),l>>=v,c-=v,hr=1<<32-Lt(t)+c|a<<c|l,pr=f+e}else hr=1<<f|a<<c|l,pr=e}function Au(e){e.return!==null&&(Ps(e,1),Vf(e,1,0))}function Du(e){for(;e===zl;)zl=ka[--ja],ka[ja]=null,Ul=ka[--ja],ka[ja]=null;for(;e===Rs;)Rs=Cn[--Nn],Cn[Nn]=null,pr=Cn[--Nn],Cn[Nn]=null,hr=Cn[--Nn],Cn[Nn]=null}var vn=null,xn=null,gt=!1,zn=null;function Wf(e,t){var a=Tn(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Kf(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,vn=e,xn=zr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,vn=e,xn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Rs!==null?{id:hr,overflow:pr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=Tn(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,vn=e,xn=null,!0):!1;default:return!1}}function Ou(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fu(e){if(gt){var t=xn;if(t){var a=t;if(!Kf(e,t)){if(Ou(e))throw Error(s(418));t=zr(a.nextSibling);var l=vn;t&&Kf(e,t)?Wf(l,a):(e.flags=e.flags&-4097|2,gt=!1,vn=e)}}else{if(Ou(e))throw Error(s(418));e.flags=e.flags&-4097|2,gt=!1,vn=e}}}function Gf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;vn=e}function $l(e){if(e!==vn)return!1;if(!gt)return Gf(e),gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ru(e.type,e.memoizedProps)),t&&(t=xn)){if(Ou(e))throw Yf(),Error(s(418));for(;t;)Wf(e,t),t=zr(t.nextSibling)}if(Gf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){xn=zr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}xn=null}}else xn=vn?zr(e.stateNode.nextSibling):null;return!0}function Yf(){for(var e=xn;e;)e=zr(e.nextSibling)}function ba(){xn=vn=null,gt=!1}function Iu(e){zn===null?zn=[e]:zn.push(e)}var kv=Q.ReactCurrentBatchConfig;function Ri(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(s(309));var l=a.stateNode}if(!l)throw Error(s(147,e));var c=l,f=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===f?t.ref:(t=function(v){var b=c.refs;v===null?delete b[f]:b[f]=v},t._stringRef=f,t)}if(typeof e!="string")throw Error(s(284));if(!a._owner)throw Error(s(290,e))}return e}function ql(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Jf(e){var t=e._init;return t(e._payload)}function Xf(e){function t(D,P){if(e){var O=D.deletions;O===null?(D.deletions=[P],D.flags|=16):O.push(P)}}function a(D,P){if(!e)return null;for(;P!==null;)t(D,P),P=P.sibling;return null}function l(D,P){for(D=new Map;P!==null;)P.key!==null?D.set(P.key,P):D.set(P.index,P),P=P.sibling;return D}function c(D,P){return D=Yr(D,P),D.index=0,D.sibling=null,D}function f(D,P,O){return D.index=O,e?(O=D.alternate,O!==null?(O=O.index,O<P?(D.flags|=2,P):O):(D.flags|=2,P)):(D.flags|=1048576,P)}function v(D){return e&&D.alternate===null&&(D.flags|=2),D}function b(D,P,O,Y){return P===null||P.tag!==6?(P=Pc(O,D.mode,Y),P.return=D,P):(P=c(P,O),P.return=D,P)}function R(D,P,O,Y){var he=O.type;return he===A?W(D,P,O.props.children,Y,O.key):P!==null&&(P.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===Pe&&Jf(he)===P.type)?(Y=c(P,O.props),Y.ref=Ri(D,P,O),Y.return=D,Y):(Y=ho(O.type,O.key,O.props,null,D.mode,Y),Y.ref=Ri(D,P,O),Y.return=D,Y)}function F(D,P,O,Y){return P===null||P.tag!==4||P.stateNode.containerInfo!==O.containerInfo||P.stateNode.implementation!==O.implementation?(P=Tc(O,D.mode,Y),P.return=D,P):(P=c(P,O.children||[]),P.return=D,P)}function W(D,P,O,Y,he){return P===null||P.tag!==7?(P=Fs(O,D.mode,Y,he),P.return=D,P):(P=c(P,O),P.return=D,P)}function K(D,P,O){if(typeof P=="string"&&P!==""||typeof P=="number")return P=Pc(""+P,D.mode,O),P.return=D,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case X:return O=ho(P.type,P.key,P.props,null,D.mode,O),O.ref=Ri(D,null,P),O.return=D,O;case se:return P=Tc(P,D.mode,O),P.return=D,P;case Pe:var Y=P._init;return K(D,Y(P._payload),O)}if(vs(P)||ne(P))return P=Fs(P,D.mode,O,null),P.return=D,P;ql(D,P)}return null}function H(D,P,O,Y){var he=P!==null?P.key:null;if(typeof O=="string"&&O!==""||typeof O=="number")return he!==null?null:b(D,P,""+O,Y);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case X:return O.key===he?R(D,P,O,Y):null;case se:return O.key===he?F(D,P,O,Y):null;case Pe:return he=O._init,H(D,P,he(O._payload),Y)}if(vs(O)||ne(O))return he!==null?null:W(D,P,O,Y,null);ql(D,O)}return null}function te(D,P,O,Y,he){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return D=D.get(O)||null,b(P,D,""+Y,he);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case X:return D=D.get(Y.key===null?O:Y.key)||null,R(P,D,Y,he);case se:return D=D.get(Y.key===null?O:Y.key)||null,F(P,D,Y,he);case Pe:var Ce=Y._init;return te(D,P,O,Ce(Y._payload),he)}if(vs(Y)||ne(Y))return D=D.get(O)||null,W(P,D,Y,he,null);ql(P,Y)}return null}function ae(D,P,O,Y){for(var he=null,Ce=null,Ne=P,Te=P=0,$t=null;Ne!==null&&Te<O.length;Te++){Ne.index>Te?($t=Ne,Ne=null):$t=Ne.sibling;var Ye=H(D,Ne,O[Te],Y);if(Ye===null){Ne===null&&(Ne=$t);break}e&&Ne&&Ye.alternate===null&&t(D,Ne),P=f(Ye,P,Te),Ce===null?he=Ye:Ce.sibling=Ye,Ce=Ye,Ne=$t}if(Te===O.length)return a(D,Ne),gt&&Ps(D,Te),he;if(Ne===null){for(;Te<O.length;Te++)Ne=K(D,O[Te],Y),Ne!==null&&(P=f(Ne,P,Te),Ce===null?he=Ne:Ce.sibling=Ne,Ce=Ne);return gt&&Ps(D,Te),he}for(Ne=l(D,Ne);Te<O.length;Te++)$t=te(Ne,D,Te,O[Te],Y),$t!==null&&(e&&$t.alternate!==null&&Ne.delete($t.key===null?Te:$t.key),P=f($t,P,Te),Ce===null?he=$t:Ce.sibling=$t,Ce=$t);return e&&Ne.forEach(function(Jr){return t(D,Jr)}),gt&&Ps(D,Te),he}function ue(D,P,O,Y){var he=ne(O);if(typeof he!="function")throw Error(s(150));if(O=he.call(O),O==null)throw Error(s(151));for(var Ce=he=null,Ne=P,Te=P=0,$t=null,Ye=O.next();Ne!==null&&!Ye.done;Te++,Ye=O.next()){Ne.index>Te?($t=Ne,Ne=null):$t=Ne.sibling;var Jr=H(D,Ne,Ye.value,Y);if(Jr===null){Ne===null&&(Ne=$t);break}e&&Ne&&Jr.alternate===null&&t(D,Ne),P=f(Jr,P,Te),Ce===null?he=Jr:Ce.sibling=Jr,Ce=Jr,Ne=$t}if(Ye.done)return a(D,Ne),gt&&Ps(D,Te),he;if(Ne===null){for(;!Ye.done;Te++,Ye=O.next())Ye=K(D,Ye.value,Y),Ye!==null&&(P=f(Ye,P,Te),Ce===null?he=Ye:Ce.sibling=Ye,Ce=Ye);return gt&&Ps(D,Te),he}for(Ne=l(D,Ne);!Ye.done;Te++,Ye=O.next())Ye=te(Ne,D,Te,Ye.value,Y),Ye!==null&&(e&&Ye.alternate!==null&&Ne.delete(Ye.key===null?Te:Ye.key),P=f(Ye,P,Te),Ce===null?he=Ye:Ce.sibling=Ye,Ce=Ye);return e&&Ne.forEach(function(ex){return t(D,ex)}),gt&&Ps(D,Te),he}function Et(D,P,O,Y){if(typeof O=="object"&&O!==null&&O.type===A&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case X:e:{for(var he=O.key,Ce=P;Ce!==null;){if(Ce.key===he){if(he=O.type,he===A){if(Ce.tag===7){a(D,Ce.sibling),P=c(Ce,O.props.children),P.return=D,D=P;break e}}else if(Ce.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===Pe&&Jf(he)===Ce.type){a(D,Ce.sibling),P=c(Ce,O.props),P.ref=Ri(D,Ce,O),P.return=D,D=P;break e}a(D,Ce);break}else t(D,Ce);Ce=Ce.sibling}O.type===A?(P=Fs(O.props.children,D.mode,Y,O.key),P.return=D,D=P):(Y=ho(O.type,O.key,O.props,null,D.mode,Y),Y.ref=Ri(D,P,O),Y.return=D,D=Y)}return v(D);case se:e:{for(Ce=O.key;P!==null;){if(P.key===Ce)if(P.tag===4&&P.stateNode.containerInfo===O.containerInfo&&P.stateNode.implementation===O.implementation){a(D,P.sibling),P=c(P,O.children||[]),P.return=D,D=P;break e}else{a(D,P);break}else t(D,P);P=P.sibling}P=Tc(O,D.mode,Y),P.return=D,D=P}return v(D);case Pe:return Ce=O._init,Et(D,P,Ce(O._payload),Y)}if(vs(O))return ae(D,P,O,Y);if(ne(O))return ue(D,P,O,Y);ql(D,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,P!==null&&P.tag===6?(a(D,P.sibling),P=c(P,O),P.return=D,D=P):(a(D,P),P=Pc(O,D.mode,Y),P.return=D,D=P),v(D)):a(D,P)}return Et}var Sa=Xf(!0),Zf=Xf(!1),Bl=Ur(null),Hl=null,Ca=null,zu=null;function Uu(){zu=Ca=Hl=null}function $u(e){var t=Bl.current;ht(Bl),e._currentValue=t}function qu(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Na(e,t){Hl=e,zu=Ca=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(un=!0),e.firstContext=null)}function En(e){var t=e._currentValue;if(zu!==e)if(e={context:e,memoizedValue:t,next:null},Ca===null){if(Hl===null)throw Error(s(308));Ca=e,Hl.dependencies={lanes:0,firstContext:e}}else Ca=Ca.next=e;return t}var Ts=null;function Bu(e){Ts===null?Ts=[e]:Ts.push(e)}function eh(e,t,a,l){var c=t.interleaved;return c===null?(a.next=a,Bu(t)):(a.next=c.next,c.next=a),t.interleaved=a,mr(e,l)}function mr(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var Br=!1;function Hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function th(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hr(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ge&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,mr(e,a)}return c=l.interleaved,c===null?(t.next=t,Bu(l)):(t.next=c.next,c.next=t),l.interleaved=t,mr(e,a)}function Ql(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,su(e,a)}}function nh(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var v={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};f===null?c=f=v:f=f.next=v,a=a.next}while(a!==null);f===null?c=f=t:f=f.next=t}else c=f=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:l.shared,effects:l.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Vl(e,t,a,l){var c=e.updateQueue;Br=!1;var f=c.firstBaseUpdate,v=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var R=b,F=R.next;R.next=null,v===null?f=F:v.next=F,v=R;var W=e.alternate;W!==null&&(W=W.updateQueue,b=W.lastBaseUpdate,b!==v&&(b===null?W.firstBaseUpdate=F:b.next=F,W.lastBaseUpdate=R))}if(f!==null){var K=c.baseState;v=0,W=F=R=null,b=f;do{var H=b.lane,te=b.eventTime;if((l&H)===H){W!==null&&(W=W.next={eventTime:te,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ae=e,ue=b;switch(H=t,te=a,ue.tag){case 1:if(ae=ue.payload,typeof ae=="function"){K=ae.call(te,K,H);break e}K=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ue.payload,H=typeof ae=="function"?ae.call(te,K,H):ae,H==null)break e;K=U({},K,H);break e;case 2:Br=!0}}b.callback!==null&&b.lane!==0&&(e.flags|=64,H=c.effects,H===null?c.effects=[b]:H.push(b))}else te={eventTime:te,lane:H,tag:b.tag,payload:b.payload,callback:b.callback,next:null},W===null?(F=W=te,R=K):W=W.next=te,v|=H;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;H=b,b=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);if(W===null&&(R=K),c.baseState=R,c.firstBaseUpdate=F,c.lastBaseUpdate=W,t=c.shared.interleaved,t!==null){c=t;do v|=c.lane,c=c.next;while(c!==t)}else f===null&&(c.shared.lanes=0);_s|=v,e.lanes=v,e.memoizedState=K}}function rh(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],c=l.callback;if(c!==null){if(l.callback=null,l=a,typeof c!="function")throw Error(s(191,c));c.call(l)}}}var Pi={},er=Ur(Pi),Ti=Ur(Pi),Li=Ur(Pi);function Ls(e){if(e===Pi)throw Error(s(174));return e}function Qu(e,t){switch(dt(Li,t),dt(Ti,e),dt(er,Pi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gn(t,e)}ht(er),dt(er,t)}function Ea(){ht(er),ht(Ti),ht(Li)}function sh(e){Ls(Li.current);var t=Ls(er.current),a=gn(t,e.type);t!==a&&(dt(Ti,e),dt(er,a))}function Vu(e){Ti.current===e&&(ht(er),ht(Ti))}var vt=Ur(0);function Wl(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wu=[];function Ku(){for(var e=0;e<Wu.length;e++)Wu[e]._workInProgressVersionPrimary=null;Wu.length=0}var Kl=Q.ReactCurrentDispatcher,Gu=Q.ReactCurrentBatchConfig,Ms=0,xt=null,Mt=null,zt=null,Gl=!1,Mi=!1,_i=0,jv=0;function Wt(){throw Error(s(321))}function Yu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!In(e[a],t[a]))return!1;return!0}function Ju(e,t,a,l,c,f){if(Ms=f,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Kl.current=e===null||e.memoizedState===null?Nv:Ev,e=a(l,c),Mi){f=0;do{if(Mi=!1,_i=0,25<=f)throw Error(s(301));f+=1,zt=Mt=null,t.updateQueue=null,Kl.current=Rv,e=a(l,c)}while(Mi)}if(Kl.current=Xl,t=Mt!==null&&Mt.next!==null,Ms=0,zt=Mt=xt=null,Gl=!1,t)throw Error(s(300));return e}function Xu(){var e=_i!==0;return _i=0,e}function tr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?xt.memoizedState=zt=e:zt=zt.next=e,zt}function Rn(){if(Mt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=zt===null?xt.memoizedState:zt.next;if(t!==null)zt=t,Mt=e;else{if(e===null)throw Error(s(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},zt===null?xt.memoizedState=zt=e:zt=zt.next=e}return zt}function Ai(e,t){return typeof t=="function"?t(e):t}function Zu(e){var t=Rn(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var l=Mt,c=l.baseQueue,f=a.pending;if(f!==null){if(c!==null){var v=c.next;c.next=f.next,f.next=v}l.baseQueue=c=f,a.pending=null}if(c!==null){f=c.next,l=l.baseState;var b=v=null,R=null,F=f;do{var W=F.lane;if((Ms&W)===W)R!==null&&(R=R.next={lane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),l=F.hasEagerState?F.eagerState:e(l,F.action);else{var K={lane:W,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null};R===null?(b=R=K,v=l):R=R.next=K,xt.lanes|=W,_s|=W}F=F.next}while(F!==null&&F!==f);R===null?v=l:R.next=b,In(l,t.memoizedState)||(un=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=R,a.lastRenderedState=l}if(e=a.interleaved,e!==null){c=e;do f=c.lane,xt.lanes|=f,_s|=f,c=c.next;while(c!==e)}else c===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function ec(e){var t=Rn(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,f=t.memoizedState;if(c!==null){a.pending=null;var v=c=c.next;do f=e(f,v.action),v=v.next;while(v!==c);In(f,t.memoizedState)||(un=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,l]}function ah(){}function ih(e,t){var a=xt,l=Rn(),c=t(),f=!In(l.memoizedState,c);if(f&&(l.memoizedState=c,un=!0),l=l.queue,tc(uh.bind(null,a,l,e),[e]),l.getSnapshot!==t||f||zt!==null&&zt.memoizedState.tag&1){if(a.flags|=2048,Di(9,oh.bind(null,a,l,c,t),void 0,null),Ut===null)throw Error(s(349));(Ms&30)!==0||lh(a,t,c)}return c}function lh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function oh(e,t,a,l){t.value=a,t.getSnapshot=l,ch(t)&&dh(e)}function uh(e,t,a){return a(function(){ch(t)&&dh(e)})}function ch(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!In(e,a)}catch{return!0}}function dh(e){var t=mr(e,1);t!==null&&Bn(t,e,1,-1)}function fh(e){var t=tr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:e},t.queue=e,e=e.dispatch=Cv.bind(null,xt,e),[t.memoizedState,e]}function Di(e,t,a,l){return e={tag:e,create:t,destroy:a,deps:l,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e)),e}function hh(){return Rn().memoizedState}function Yl(e,t,a,l){var c=tr();xt.flags|=e,c.memoizedState=Di(1|t,a,void 0,l===void 0?null:l)}function Jl(e,t,a,l){var c=Rn();l=l===void 0?null:l;var f=void 0;if(Mt!==null){var v=Mt.memoizedState;if(f=v.destroy,l!==null&&Yu(l,v.deps)){c.memoizedState=Di(t,a,f,l);return}}xt.flags|=e,c.memoizedState=Di(1|t,a,f,l)}function ph(e,t){return Yl(8390656,8,e,t)}function tc(e,t){return Jl(2048,8,e,t)}function mh(e,t){return Jl(4,2,e,t)}function gh(e,t){return Jl(4,4,e,t)}function yh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vh(e,t,a){return a=a!=null?a.concat([e]):null,Jl(4,4,yh.bind(null,t,e),a)}function nc(){}function xh(e,t){var a=Rn();t=t===void 0?null:t;var l=a.memoizedState;return l!==null&&t!==null&&Yu(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function wh(e,t){var a=Rn();t=t===void 0?null:t;var l=a.memoizedState;return l!==null&&t!==null&&Yu(t,l[1])?l[0]:(e=e(),a.memoizedState=[e,t],e)}function kh(e,t,a){return(Ms&21)===0?(e.baseState&&(e.baseState=!1,un=!0),e.memoizedState=a):(In(a,t)||(a=Yd(),xt.lanes|=a,_s|=a,e.baseState=!0),t)}function bv(e,t){var a=rt;rt=a!==0&&4>a?a:4,e(!0);var l=Gu.transition;Gu.transition={};try{e(!1),t()}finally{rt=a,Gu.transition=l}}function jh(){return Rn().memoizedState}function Sv(e,t,a){var l=Kr(e);if(a={lane:l,action:a,hasEagerState:!1,eagerState:null,next:null},bh(e))Sh(t,a);else if(a=eh(e,t,a,l),a!==null){var c=Xt();Bn(a,e,l,c),Ch(a,t,l)}}function Cv(e,t,a){var l=Kr(e),c={lane:l,action:a,hasEagerState:!1,eagerState:null,next:null};if(bh(e))Sh(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,b=f(v,a);if(c.hasEagerState=!0,c.eagerState=b,In(b,v)){var R=t.interleaved;R===null?(c.next=c,Bu(t)):(c.next=R.next,R.next=c),t.interleaved=c;return}}catch{}finally{}a=eh(e,t,c,l),a!==null&&(c=Xt(),Bn(a,e,l,c),Ch(a,t,l))}}function bh(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function Sh(e,t){Mi=Gl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Ch(e,t,a){if((a&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,su(e,a)}}var Xl={readContext:En,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},Nv={readContext:En,useCallback:function(e,t){return tr().memoizedState=[e,t===void 0?null:t],e},useContext:En,useEffect:ph,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Yl(4194308,4,yh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Yl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yl(4,2,e,t)},useMemo:function(e,t){var a=tr();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var l=tr();return t=a!==void 0?a(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Sv.bind(null,xt,e),[l.memoizedState,e]},useRef:function(e){var t=tr();return e={current:e},t.memoizedState=e},useState:fh,useDebugValue:nc,useDeferredValue:function(e){return tr().memoizedState=e},useTransition:function(){var e=fh(!1),t=e[0];return e=bv.bind(null,e[1]),tr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var l=xt,c=tr();if(gt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),Ut===null)throw Error(s(349));(Ms&30)!==0||lh(l,t,a)}c.memoizedState=a;var f={value:a,getSnapshot:t};return c.queue=f,ph(uh.bind(null,l,f,e),[e]),l.flags|=2048,Di(9,oh.bind(null,l,f,a,t),void 0,null),a},useId:function(){var e=tr(),t=Ut.identifierPrefix;if(gt){var a=pr,l=hr;a=(l&~(1<<32-Lt(l)-1)).toString(32)+a,t=":"+t+"R"+a,a=_i++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=jv++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ev={readContext:En,useCallback:xh,useContext:En,useEffect:tc,useImperativeHandle:vh,useInsertionEffect:mh,useLayoutEffect:gh,useMemo:wh,useReducer:Zu,useRef:hh,useState:function(){return Zu(Ai)},useDebugValue:nc,useDeferredValue:function(e){var t=Rn();return kh(t,Mt.memoizedState,e)},useTransition:function(){var e=Zu(Ai)[0],t=Rn().memoizedState;return[e,t]},useMutableSource:ah,useSyncExternalStore:ih,useId:jh,unstable_isNewReconciler:!1},Rv={readContext:En,useCallback:xh,useContext:En,useEffect:tc,useImperativeHandle:vh,useInsertionEffect:mh,useLayoutEffect:gh,useMemo:wh,useReducer:ec,useRef:hh,useState:function(){return ec(Ai)},useDebugValue:nc,useDeferredValue:function(e){var t=Rn();return Mt===null?t.memoizedState=e:kh(t,Mt.memoizedState,e)},useTransition:function(){var e=ec(Ai)[0],t=Rn().memoizedState;return[e,t]},useMutableSource:ah,useSyncExternalStore:ih,useId:jh,unstable_isNewReconciler:!1};function Un(e,t){if(e&&e.defaultProps){t=U({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function rc(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:U({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Zl={isMounted:function(e){return(e=e._reactInternals)?we(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Xt(),c=Kr(e),f=gr(l,c);f.payload=t,a!=null&&(f.callback=a),t=Hr(e,f,c),t!==null&&(Bn(t,e,c,l),Ql(t,e,c))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Xt(),c=Kr(e),f=gr(l,c);f.tag=1,f.payload=t,a!=null&&(f.callback=a),t=Hr(e,f,c),t!==null&&(Bn(t,e,c,l),Ql(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Xt(),l=Kr(e),c=gr(a,l);c.tag=2,t!=null&&(c.callback=t),t=Hr(e,c,l),t!==null&&(Bn(t,e,l,a),Ql(t,e,l))}};function Nh(e,t,a,l,c,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,v):t.prototype&&t.prototype.isPureReactComponent?!ki(a,l)||!ki(c,f):!0}function Eh(e,t,a){var l=!1,c=$r,f=t.contextType;return typeof f=="object"&&f!==null?f=En(f):(c=on(t)?Es:Vt.current,l=t.contextTypes,f=(l=l!=null)?wa(e,c):$r),t=new t(a,f),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=f),t}function Rh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Zl.enqueueReplaceState(t,t.state,null)}function sc(e,t,a,l){var c=e.stateNode;c.props=a,c.state=e.memoizedState,c.refs={},Hu(e);var f=t.contextType;typeof f=="object"&&f!==null?c.context=En(f):(f=on(t)?Es:Vt.current,c.context=wa(e,f)),c.state=e.memoizedState,f=t.getDerivedStateFromProps,typeof f=="function"&&(rc(e,t,f,a),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&Zl.enqueueReplaceState(c,c.state,null),Vl(e,a,c,l),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function Ra(e,t){try{var a="",l=t;do a+=xe(l),l=l.return;while(l);var c=a}catch(f){c=`
|
|
37
|
+
`+c[v].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=v&&0<=b);break}}}finally{be=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?q(e):""}function xe(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return e=ve(e.type,!1),e;case 11:return e=ve(e.type.render,!1),e;case 1:return e=ve(e.type,!0),e;default:return""}}function Se(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case se:return"Portal";case pe:return"Profiler";case B:return"StrictMode";case nt:return"Suspense";case pt:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ue:return(e.displayName||"Context")+".Consumer";case Z:return(e._context.displayName||"Context")+".Provider";case Je:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pe:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case Te:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}function Fe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(t);case 8:return t===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _e(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function It(e){var t=_e(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(v){l=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ct(e){e._valueTracker||(e._valueTracker=It(e))}function sn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=_e(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Fn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Gn(e,t){var a=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Yn(e,t){var a=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;a=Ke(t.value!=null?t.value:a),e._wrapperState={initialChecked:l,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pl(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function Za(e,t){pl(e,t);var a=Ke(t.value),l=t.type;if(a!=null)l==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ti(e,t.type,a):t.hasOwnProperty("defaultValue")&&ti(e,t.type,Ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ei(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function ti(e,t,a){(t!=="number"||Fn(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var vs=Array.isArray;function Er(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Ke(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ni(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return $({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Jn(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(s(92));if(vs(a)){if(1<a.length)throw Error(s(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Ke(a)}}function Rr(e,t){var a=Ke(t.value),l=Ke(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),l!=null&&(e.defaultValue=""+l)}function ri(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ra(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ra(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var an,si=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,l,c){MSApp.execUnsafeLocalFunction(function(){return e(t,a,l,c)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(an=an||document.createElement("div"),an.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=an.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xs(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ur={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tu=["Webkit","ms","Moz","O"];Object.keys(ur).forEach(function(e){tu.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ur[t]=ur[e]})});function jn(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||ur.hasOwnProperty(e)&&ur[e]?(""+t).trim():t+"px"}function ai(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var l=a.indexOf("--")===0,c=jn(a,t[a],l);a==="float"&&(a="cssFloat"),l?e.setProperty(a,c):e[a]=c}}var ml=$({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sa(e,t){if(t){if(ml[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function ii(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var aa=null;function Pr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ia=null,Xn=null,Tr=null;function li(e){if(e=Ei(e)){if(typeof ia!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Ol(t),ia(e.stateNode,e.type,t))}}function gl(e){Xn?Tr?Tr.push(e):Tr=[e]:Xn=e}function oi(){if(Xn){var e=Xn,t=Tr;if(Tr=Xn=null,li(e),t)for(e=0;e<t.length;e++)li(t[e])}}function ws(e,t){return e(t)}function ks(){}var la=!1;function yl(e,t,a){if(la)return e(t,a);la=!0;try{return ws(e,t,a)}finally{la=!1,(Xn!==null||Tr!==null)&&(ks(),oi())}}function js(e,t){var a=e.stateNode;if(a===null)return null;var l=Ol(a);if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,t,typeof a));return a}var C=!1;if(p)try{var M={};Object.defineProperty(M,"passive",{get:function(){C=!0}}),window.addEventListener("test",M,M),window.removeEventListener("test",M,M)}catch{C=!1}function z(e,t,a,l,c,f,v,b,R){var I=Array.prototype.slice.call(arguments,3);try{t.apply(a,I)}catch(W){this.onError(W)}}var V=!1,J=null,ce=!1,fe=null,de={onError:function(e){V=!0,J=e}};function me(e,t,a,l,c,f,v,b,R){V=!1,J=null,z.apply(de,arguments)}function je(e,t,a,l,c,f,v,b,R){if(me.apply(this,arguments),V){if(V){var I=J;V=!1,J=null}else throw Error(s(198));ce||(ce=!0,fe=I)}}function we(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function ge(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 Ae(e){if(we(e)!==e)throw Error(s(188))}function st(e){var t=e.alternate;if(!t){if(t=we(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return Ae(c),e;if(f===l)return Ae(c),t;f=f.sibling}throw Error(s(188))}if(a.return!==l.return)a=c,l=f;else{for(var v=!1,b=c.child;b;){if(b===a){v=!0,a=c,l=f;break}if(b===l){v=!0,l=c,a=f;break}b=b.sibling}if(!v){for(b=f.child;b;){if(b===a){v=!0,a=f,l=c;break}if(b===l){v=!0,l=f,a=c;break}b=b.sibling}if(!v)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function jt(e){return e=st(e),e!==null?Nt(e):null}function Nt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nt(e);if(t!==null)return t;e=e.sibling}return null}var at=r.unstable_scheduleCallback,it=r.unstable_cancelCallback,cr=r.unstable_shouldYield,bs=r.unstable_requestPaint,Ze=r.unstable_now,bn=r.unstable_getCurrentPriorityLevel,Ss=r.unstable_ImmediatePriority,Lr=r.unstable_UserBlockingPriority,Sn=r.unstable_NormalPriority,oa=r.unstable_LowPriority,Cs=r.unstable_IdlePriority,$e=null,lt=null;function Mr(e){if(lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot($e,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:vl,mt=Math.log,ua=Math.LN2;function vl(e){return e>>>=0,e===0?32:31-(mt(e)/ua|0)|0}var ca=64,xl=4194304;function ui(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wl(e,t){var a=e.pendingLanes;if(a===0)return 0;var l=0,c=e.suspendedLanes,f=e.pingedLanes,v=a&268435455;if(v!==0){var b=v&~c;b!==0?l=ui(b):(f&=v,f!==0&&(l=ui(f)))}else v=a&~c,v!==0?l=ui(v):f!==0&&(l=ui(f));if(l===0)return 0;if(t!==0&&t!==l&&(t&c)===0&&(c=l&-l,f=t&-t,c>=f||c===16&&(f&4194240)!==0))return t;if((l&4)!==0&&(l|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)a=31-Lt(t),c=1<<a,l|=e[a],t&=~c;return l}function wy(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ky(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes;0<f;){var v=31-Lt(f),b=1<<v,R=c[v];R===-1?((b&a)===0||(b&l)!==0)&&(c[v]=wy(b,t)):R<=t&&(e.expiredLanes|=b),f&=~b}}function nu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Yd(){var e=ca;return ca<<=1,(ca&4194240)===0&&(ca=64),e}function ru(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ci(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=a}function jy(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<a;){var c=31-Lt(a),f=1<<c;t[c]=0,l[c]=-1,e[c]=-1,a&=~f}}function su(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Lt(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}var rt=0;function Jd(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Xd,au,Zd,ef,tf,iu=!1,kl=[],_r=null,Ar=null,Dr=null,di=new Map,fi=new Map,Or=[],by="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nf(e,t){switch(e){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fi.delete(t.pointerId)}}function hi(e,t,a,l,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Ei(t),t!==null&&au(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Sy(e,t,a,l,c){switch(t){case"focusin":return _r=hi(_r,e,t,a,l,c),!0;case"dragenter":return Ar=hi(Ar,e,t,a,l,c),!0;case"mouseover":return Dr=hi(Dr,e,t,a,l,c),!0;case"pointerover":var f=c.pointerId;return di.set(f,hi(di.get(f)||null,e,t,a,l,c)),!0;case"gotpointercapture":return f=c.pointerId,fi.set(f,hi(fi.get(f)||null,e,t,a,l,c)),!0}return!1}function rf(e){var t=Ns(e.target);if(t!==null){var a=we(t);if(a!==null){if(t=a.tag,t===13){if(t=ge(a),t!==null){e.blockedOn=t,tf(e.priority,function(){Zd(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ou(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);aa=l,a.target.dispatchEvent(l),aa=null}else return t=Ei(a),t!==null&&au(t),e.blockedOn=a,!1;t.shift()}return!0}function sf(e,t,a){jl(e)&&a.delete(t)}function Cy(){iu=!1,_r!==null&&jl(_r)&&(_r=null),Ar!==null&&jl(Ar)&&(Ar=null),Dr!==null&&jl(Dr)&&(Dr=null),di.forEach(sf),fi.forEach(sf)}function pi(e,t){e.blockedOn===t&&(e.blockedOn=null,iu||(iu=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Cy)))}function mi(e){function t(c){return pi(c,e)}if(0<kl.length){pi(kl[0],e);for(var a=1;a<kl.length;a++){var l=kl[a];l.blockedOn===e&&(l.blockedOn=null)}}for(_r!==null&&pi(_r,e),Ar!==null&&pi(Ar,e),Dr!==null&&pi(Dr,e),di.forEach(t),fi.forEach(t),a=0;a<Or.length;a++)l=Or[a],l.blockedOn===e&&(l.blockedOn=null);for(;0<Or.length&&(a=Or[0],a.blockedOn===null);)rf(a),a.blockedOn===null&&Or.shift()}var da=Q.ReactCurrentBatchConfig,bl=!0;function Ny(e,t,a,l){var c=rt,f=da.transition;da.transition=null;try{rt=1,lu(e,t,a,l)}finally{rt=c,da.transition=f}}function Ey(e,t,a,l){var c=rt,f=da.transition;da.transition=null;try{rt=4,lu(e,t,a,l)}finally{rt=c,da.transition=f}}function lu(e,t,a,l){if(bl){var c=ou(e,t,a,l);if(c===null)Cu(e,t,l,Sl,a),nf(e,l);else if(Sy(c,e,t,a,l))l.stopPropagation();else if(nf(e,l),t&4&&-1<by.indexOf(e)){for(;c!==null;){var f=Ei(c);if(f!==null&&Xd(f),f=ou(e,t,a,l),f===null&&Cu(e,t,l,Sl,a),f===c)break;c=f}c!==null&&l.stopPropagation()}else Cu(e,t,l,null,a)}}var Sl=null;function ou(e,t,a,l){if(Sl=null,e=Pr(l),e=Ns(e),e!==null)if(t=we(e),t===null)e=null;else if(a=t.tag,a===13){if(e=ge(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Sl=e,null}function af(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(bn()){case Ss:return 1;case Lr:return 4;case Sn:case oa:return 16;case Cs:return 536870912;default:return 16}default:return 16}}var Fr=null,uu=null,Cl=null;function lf(){if(Cl)return Cl;var e,t=uu,a=t.length,l,c="value"in Fr?Fr.value:Fr.textContent,f=c.length;for(e=0;e<a&&t[e]===c[e];e++);var v=a-e;for(l=1;l<=v&&t[a-l]===c[f-l];l++);return Cl=c.slice(e,1<l?1-l:void 0)}function Nl(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 El(){return!0}function of(){return!1}function yn(e){function t(a,l,c,f,v){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(f):f[b]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?El:of,this.isPropagationStopped=of,this}return $(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=El)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=El)},persist:function(){},isPersistent:El}),t}var fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cu=yn(fa),gi=$({},fa,{view:0,detail:0}),Ry=yn(gi),du,fu,yi,Rl=$({},gi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,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!==yi&&(yi&&e.type==="mousemove"?(du=e.screenX-yi.screenX,fu=e.screenY-yi.screenY):fu=du=0,yi=e),du)},movementY:function(e){return"movementY"in e?e.movementY:fu}}),uf=yn(Rl),Py=$({},Rl,{dataTransfer:0}),Ty=yn(Py),Ly=$({},gi,{relatedTarget:0}),hu=yn(Ly),My=$({},fa,{animationName:0,elapsedTime:0,pseudoElement:0}),_y=yn(My),Ay=$({},fa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dy=yn(Ay),Oy=$({},fa,{data:0}),cf=yn(Oy),Fy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Iy={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"},zy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zy[e])?!!t[e]:!1}function pu(){return Uy}var $y=$({},gi,{key:function(e){if(e.key){var t=Fy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Iy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=yn($y),By=$({},Rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),df=yn(By),Hy=$({},gi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),Qy=yn(Hy),Vy=$({},fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wy=yn(Vy),Ky=$({},Rl,{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}),Gy=yn(Ky),Yy=[9,13,27,32],mu=p&&"CompositionEvent"in window,vi=null;p&&"documentMode"in document&&(vi=document.documentMode);var Jy=p&&"TextEvent"in window&&!vi,ff=p&&(!mu||vi&&8<vi&&11>=vi),hf=" ",pf=!1;function mf(e,t){switch(e){case"keyup":return Yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ha=!1;function Xy(e,t){switch(e){case"compositionend":return gf(t);case"keypress":return t.which!==32?null:(pf=!0,hf);case"textInput":return e=t.data,e===hf&&pf?null:e;default:return null}}function Zy(e,t){if(ha)return e==="compositionend"||!mu&&mf(e,t)?(e=lf(),Cl=uu=Fr=null,ha=!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 ff&&t.locale!=="ko"?null:t.data;default:return null}}var ev={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 yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ev[e.type]:t==="textarea"}function vf(e,t,a,l){gl(l),t=_l(t,"onChange"),0<t.length&&(a=new cu("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var xi=null,wi=null;function tv(e){Of(e,0)}function Pl(e){var t=va(e);if(sn(t))return e}function nv(e,t){if(e==="change")return t}var xf=!1;if(p){var gu;if(p){var yu="oninput"in document;if(!yu){var wf=document.createElement("div");wf.setAttribute("oninput","return;"),yu=typeof wf.oninput=="function"}gu=yu}else gu=!1;xf=gu&&(!document.documentMode||9<document.documentMode)}function kf(){xi&&(xi.detachEvent("onpropertychange",jf),wi=xi=null)}function jf(e){if(e.propertyName==="value"&&Pl(wi)){var t=[];vf(t,wi,e,Pr(e)),yl(tv,t)}}function rv(e,t,a){e==="focusin"?(kf(),xi=t,wi=a,xi.attachEvent("onpropertychange",jf)):e==="focusout"&&kf()}function sv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pl(wi)}function av(e,t){if(e==="click")return Pl(t)}function iv(e,t){if(e==="input"||e==="change")return Pl(t)}function lv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:lv;function ki(e,t){if(In(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!g.call(t,c)||!In(e[c],t[c]))return!1}return!0}function bf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sf(e,t){var a=bf(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=bf(a)}}function Cf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nf(){for(var e=window,t=Fn();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Fn(e.document)}return t}function vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ov(e){var t=Nf(),a=e.focusedElem,l=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Cf(a.ownerDocument.documentElement,a)){if(l!==null&&vu(a)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=a.textContent.length,f=Math.min(l.start,c);l=l.end===void 0?f:Math.min(l.end,c),!e.extend&&f>l&&(c=l,l=f,f=c),c=Sf(a,f);var v=Sf(a,l);c&&v&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),f>l?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uv=p&&"documentMode"in document&&11>=document.documentMode,pa=null,xu=null,ji=null,wu=!1;function Ef(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wu||pa==null||pa!==Fn(l)||(l=pa,"selectionStart"in l&&vu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ji&&ki(ji,l)||(ji=l,l=_l(xu,"onSelect"),0<l.length&&(t=new cu("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=pa)))}function Tl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ma={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionend:Tl("Transition","TransitionEnd")},ku={},Rf={};p&&(Rf=document.createElement("div").style,"AnimationEvent"in window||(delete ma.animationend.animation,delete ma.animationiteration.animation,delete ma.animationstart.animation),"TransitionEvent"in window||delete ma.transitionend.transition);function Ll(e){if(ku[e])return ku[e];if(!ma[e])return e;var t=ma[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Rf)return ku[e]=t[a];return e}var Pf=Ll("animationend"),Tf=Ll("animationiteration"),Lf=Ll("animationstart"),Mf=Ll("transitionend"),_f=new Map,Af="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ir(e,t){_f.set(e,t),d(t,[e])}for(var ju=0;ju<Af.length;ju++){var bu=Af[ju],cv=bu.toLowerCase(),dv=bu[0].toUpperCase()+bu.slice(1);Ir(cv,"on"+dv)}Ir(Pf,"onAnimationEnd"),Ir(Tf,"onAnimationIteration"),Ir(Lf,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(Mf,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="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(" "),fv=new Set("cancel close invalid load scroll toggle".split(" ").concat(bi));function Df(e,t,a){var l=e.type||"unknown-event";e.currentTarget=a,je(l,t,void 0,e),e.currentTarget=null}function Of(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var f=void 0;if(t)for(var v=l.length-1;0<=v;v--){var b=l[v],R=b.instance,I=b.currentTarget;if(b=b.listener,R!==f&&c.isPropagationStopped())break e;Df(c,b,I),f=R}else for(v=0;v<l.length;v++){if(b=l[v],R=b.instance,I=b.currentTarget,b=b.listener,R!==f&&c.isPropagationStopped())break e;Df(c,b,I),f=R}}}if(ce)throw e=fe,ce=!1,fe=null,e}function ft(e,t){var a=t[Lu];a===void 0&&(a=t[Lu]=new Set);var l=e+"__bubble";a.has(l)||(Ff(t,e,2,!1),a.add(l))}function Su(e,t,a){var l=0;t&&(l|=4),Ff(a,e,l,t)}var Ml="_reactListening"+Math.random().toString(36).slice(2);function Si(e){if(!e[Ml]){e[Ml]=!0,o.forEach(function(a){a!=="selectionchange"&&(fv.has(a)||Su(a,!1,e),Su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ml]||(t[Ml]=!0,Su("selectionchange",!1,t))}}function Ff(e,t,a,l){switch(af(t)){case 1:var c=Ny;break;case 4:c=Ey;break;default:c=lu}a=c.bind(null,t,a,e),c=void 0,!C||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Cu(e,t,a,l,c){var f=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var b=l.stateNode.containerInfo;if(b===c||b.nodeType===8&&b.parentNode===c)break;if(v===4)for(v=l.return;v!==null;){var R=v.tag;if((R===3||R===4)&&(R=v.stateNode.containerInfo,R===c||R.nodeType===8&&R.parentNode===c))return;v=v.return}for(;b!==null;){if(v=Ns(b),v===null)return;if(R=v.tag,R===5||R===6){l=f=v;continue e}b=b.parentNode}}l=l.return}yl(function(){var I=f,W=Pr(a),K=[];e:{var H=_f.get(e);if(H!==void 0){var te=cu,ae=e;switch(e){case"keypress":if(Nl(a)===0)break e;case"keydown":case"keyup":te=qy;break;case"focusin":ae="focus",te=hu;break;case"focusout":ae="blur",te=hu;break;case"beforeblur":case"afterblur":te=hu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Ty;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Qy;break;case Pf:case Tf:case Lf:te=_y;break;case Mf:te=Wy;break;case"scroll":te=Ry;break;case"wheel":te=Gy;break;case"copy":case"cut":case"paste":te=Dy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=df}var ue=(t&4)!==0,Et=!ue&&e==="scroll",O=ue?H!==null?H+"Capture":null:H;ue=[];for(var T=I,F;T!==null;){F=T;var Y=F.stateNode;if(F.tag===5&&Y!==null&&(F=Y,O!==null&&(Y=js(T,O),Y!=null&&ue.push(Ci(T,Y,F)))),Et)break;T=T.return}0<ue.length&&(H=new te(H,ae,null,a,W),K.push({event:H,listeners:ue}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",H&&a!==aa&&(ae=a.relatedTarget||a.fromElement)&&(Ns(ae)||ae[dr]))break e;if((te||H)&&(H=W.window===W?W:(H=W.ownerDocument)?H.defaultView||H.parentWindow:window,te?(ae=a.relatedTarget||a.toElement,te=I,ae=ae?Ns(ae):null,ae!==null&&(Et=we(ae),ae!==Et||ae.tag!==5&&ae.tag!==6)&&(ae=null)):(te=null,ae=I),te!==ae)){if(ue=uf,Y="onMouseLeave",O="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(ue=df,Y="onPointerLeave",O="onPointerEnter",T="pointer"),Et=te==null?H:va(te),F=ae==null?H:va(ae),H=new ue(Y,T+"leave",te,a,W),H.target=Et,H.relatedTarget=F,Y=null,Ns(W)===I&&(ue=new ue(O,T+"enter",ae,a,W),ue.target=F,ue.relatedTarget=Et,Y=ue),Et=Y,te&&ae)t:{for(ue=te,O=ae,T=0,F=ue;F;F=ga(F))T++;for(F=0,Y=O;Y;Y=ga(Y))F++;for(;0<T-F;)ue=ga(ue),T--;for(;0<F-T;)O=ga(O),F--;for(;T--;){if(ue===O||O!==null&&ue===O.alternate)break t;ue=ga(ue),O=ga(O)}ue=null}else ue=null;te!==null&&If(K,H,te,ue,!1),ae!==null&&Et!==null&&If(K,Et,ae,ue,!0)}}e:{if(H=I?va(I):window,te=H.nodeName&&H.nodeName.toLowerCase(),te==="select"||te==="input"&&H.type==="file")var he=nv;else if(yf(H))if(xf)he=iv;else{he=sv;var Ce=rv}else(te=H.nodeName)&&te.toLowerCase()==="input"&&(H.type==="checkbox"||H.type==="radio")&&(he=av);if(he&&(he=he(e,I))){vf(K,he,a,W);break e}Ce&&Ce(e,H,I),e==="focusout"&&(Ce=H._wrapperState)&&Ce.controlled&&H.type==="number"&&ti(H,"number",H.value)}switch(Ce=I?va(I):window,e){case"focusin":(yf(Ce)||Ce.contentEditable==="true")&&(pa=Ce,xu=I,ji=null);break;case"focusout":ji=xu=pa=null;break;case"mousedown":wu=!0;break;case"contextmenu":case"mouseup":case"dragend":wu=!1,Ef(K,a,W);break;case"selectionchange":if(uv)break;case"keydown":case"keyup":Ef(K,a,W)}var Ne;if(mu)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else ha?mf(e,a)&&(Le="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Le="onCompositionStart");Le&&(ff&&a.locale!=="ko"&&(ha||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&ha&&(Ne=lf()):(Fr=W,uu="value"in Fr?Fr.value:Fr.textContent,ha=!0)),Ce=_l(I,Le),0<Ce.length&&(Le=new cf(Le,e,null,a,W),K.push({event:Le,listeners:Ce}),Ne?Le.data=Ne:(Ne=gf(a),Ne!==null&&(Le.data=Ne)))),(Ne=Jy?Xy(e,a):Zy(e,a))&&(I=_l(I,"onBeforeInput"),0<I.length&&(W=new cf("onBeforeInput","beforeinput",null,a,W),K.push({event:W,listeners:I}),W.data=Ne))}Of(K,t)})}function Ci(e,t,a){return{instance:e,listener:t,currentTarget:a}}function _l(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,f=c.stateNode;c.tag===5&&f!==null&&(c=f,f=js(e,a),f!=null&&l.unshift(Ci(e,f,c)),f=js(e,t),f!=null&&l.push(Ci(e,f,c))),e=e.return}return l}function ga(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function If(e,t,a,l,c){for(var f=t._reactName,v=[];a!==null&&a!==l;){var b=a,R=b.alternate,I=b.stateNode;if(R!==null&&R===l)break;b.tag===5&&I!==null&&(b=I,c?(R=js(a,f),R!=null&&v.unshift(Ci(a,R,b))):c||(R=js(a,f),R!=null&&v.push(Ci(a,R,b)))),a=a.return}v.length!==0&&e.push({event:t,listeners:v})}var hv=/\r\n?/g,pv=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(hv,`
|
|
38
|
+
`).replace(pv,"")}function Al(e,t,a){if(t=zf(t),zf(e)!==t&&a)throw Error(s(425))}function Dl(){}var Nu=null,Eu=null;function Ru(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pu=typeof setTimeout=="function"?setTimeout:void 0,mv=typeof clearTimeout=="function"?clearTimeout:void 0,Uf=typeof Promise=="function"?Promise:void 0,gv=typeof queueMicrotask=="function"?queueMicrotask:typeof Uf<"u"?function(e){return Uf.resolve(null).then(e).catch(yv)}:Pu;function yv(e){setTimeout(function(){throw e})}function Tu(e,t){var a=t,l=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(l===0){e.removeChild(c),mi(t);return}l--}else a!=="$"&&a!=="$?"&&a!=="$!"||l++;a=c}while(a);mi(t)}function zr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var ya=Math.random().toString(36).slice(2),Zn="__reactFiber$"+ya,Ni="__reactProps$"+ya,dr="__reactContainer$"+ya,Lu="__reactEvents$"+ya,vv="__reactListeners$"+ya,xv="__reactHandles$"+ya;function Ns(e){var t=e[Zn];if(t)return t;for(var a=e.parentNode;a;){if(t=a[dr]||a[Zn]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=$f(e);e!==null;){if(a=e[Zn])return a;e=$f(e)}return t}e=a,a=e.parentNode}return null}function Ei(e){return e=e[Zn]||e[dr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function va(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Ol(e){return e[Ni]||null}var Mu=[],xa=-1;function Ur(e){return{current:e}}function ht(e){0>xa||(e.current=Mu[xa],Mu[xa]=null,xa--)}function dt(e,t){xa++,Mu[xa]=e.current,e.current=t}var $r={},Vt=Ur($r),ln=Ur(!1),Es=$r;function wa(e,t){var a=e.type.contextTypes;if(!a)return $r;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var c={},f;for(f in a)c[f]=t[f];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function on(e){return e=e.childContextTypes,e!=null}function Fl(){ht(ln),ht(Vt)}function qf(e,t,a){if(Vt.current!==$r)throw Error(s(168));dt(Vt,t),dt(ln,a)}function Bf(e,t,a){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return a;l=l.getChildContext();for(var c in l)if(!(c in t))throw Error(s(108,Fe(e)||"Unknown",c));return $({},a,l)}function Il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$r,Es=Vt.current,dt(Vt,e),dt(ln,ln.current),!0}function Hf(e,t,a){var l=e.stateNode;if(!l)throw Error(s(169));a?(e=Bf(e,t,Es),l.__reactInternalMemoizedMergedChildContext=e,ht(ln),ht(Vt),dt(Vt,e)):ht(ln),dt(ln,a)}var fr=null,zl=!1,_u=!1;function Qf(e){fr===null?fr=[e]:fr.push(e)}function wv(e){zl=!0,Qf(e)}function qr(){if(!_u&&fr!==null){_u=!0;var e=0,t=rt;try{var a=fr;for(rt=1;e<a.length;e++){var l=a[e];do l=l(!0);while(l!==null)}fr=null,zl=!1}catch(c){throw fr!==null&&(fr=fr.slice(e+1)),at(Ss,qr),c}finally{rt=t,_u=!1}}return null}var ka=[],ja=0,Ul=null,$l=0,Cn=[],Nn=0,Rs=null,hr=1,pr="";function Ps(e,t){ka[ja++]=$l,ka[ja++]=Ul,Ul=e,$l=t}function Vf(e,t,a){Cn[Nn++]=hr,Cn[Nn++]=pr,Cn[Nn++]=Rs,Rs=e;var l=hr;e=pr;var c=32-Lt(l)-1;l&=~(1<<c),a+=1;var f=32-Lt(t)+c;if(30<f){var v=c-c%5;f=(l&(1<<v)-1).toString(32),l>>=v,c-=v,hr=1<<32-Lt(t)+c|a<<c|l,pr=f+e}else hr=1<<f|a<<c|l,pr=e}function Au(e){e.return!==null&&(Ps(e,1),Vf(e,1,0))}function Du(e){for(;e===Ul;)Ul=ka[--ja],ka[ja]=null,$l=ka[--ja],ka[ja]=null;for(;e===Rs;)Rs=Cn[--Nn],Cn[Nn]=null,pr=Cn[--Nn],Cn[Nn]=null,hr=Cn[--Nn],Cn[Nn]=null}var vn=null,xn=null,gt=!1,zn=null;function Wf(e,t){var a=Tn(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Kf(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,vn=e,xn=zr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,vn=e,xn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Rs!==null?{id:hr,overflow:pr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=Tn(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,vn=e,xn=null,!0):!1;default:return!1}}function Ou(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fu(e){if(gt){var t=xn;if(t){var a=t;if(!Kf(e,t)){if(Ou(e))throw Error(s(418));t=zr(a.nextSibling);var l=vn;t&&Kf(e,t)?Wf(l,a):(e.flags=e.flags&-4097|2,gt=!1,vn=e)}}else{if(Ou(e))throw Error(s(418));e.flags=e.flags&-4097|2,gt=!1,vn=e}}}function Gf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;vn=e}function ql(e){if(e!==vn)return!1;if(!gt)return Gf(e),gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ru(e.type,e.memoizedProps)),t&&(t=xn)){if(Ou(e))throw Yf(),Error(s(418));for(;t;)Wf(e,t),t=zr(t.nextSibling)}if(Gf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){xn=zr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}xn=null}}else xn=vn?zr(e.stateNode.nextSibling):null;return!0}function Yf(){for(var e=xn;e;)e=zr(e.nextSibling)}function ba(){xn=vn=null,gt=!1}function Iu(e){zn===null?zn=[e]:zn.push(e)}var kv=Q.ReactCurrentBatchConfig;function Ri(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(s(309));var l=a.stateNode}if(!l)throw Error(s(147,e));var c=l,f=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===f?t.ref:(t=function(v){var b=c.refs;v===null?delete b[f]:b[f]=v},t._stringRef=f,t)}if(typeof e!="string")throw Error(s(284));if(!a._owner)throw Error(s(290,e))}return e}function Bl(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Jf(e){var t=e._init;return t(e._payload)}function Xf(e){function t(O,T){if(e){var F=O.deletions;F===null?(O.deletions=[T],O.flags|=16):F.push(T)}}function a(O,T){if(!e)return null;for(;T!==null;)t(O,T),T=T.sibling;return null}function l(O,T){for(O=new Map;T!==null;)T.key!==null?O.set(T.key,T):O.set(T.index,T),T=T.sibling;return O}function c(O,T){return O=Yr(O,T),O.index=0,O.sibling=null,O}function f(O,T,F){return O.index=F,e?(F=O.alternate,F!==null?(F=F.index,F<T?(O.flags|=2,T):F):(O.flags|=2,T)):(O.flags|=1048576,T)}function v(O){return e&&O.alternate===null&&(O.flags|=2),O}function b(O,T,F,Y){return T===null||T.tag!==6?(T=Pc(F,O.mode,Y),T.return=O,T):(T=c(T,F),T.return=O,T)}function R(O,T,F,Y){var he=F.type;return he===A?W(O,T,F.props.children,Y,F.key):T!==null&&(T.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===Te&&Jf(he)===T.type)?(Y=c(T,F.props),Y.ref=Ri(O,T,F),Y.return=O,Y):(Y=po(F.type,F.key,F.props,null,O.mode,Y),Y.ref=Ri(O,T,F),Y.return=O,Y)}function I(O,T,F,Y){return T===null||T.tag!==4||T.stateNode.containerInfo!==F.containerInfo||T.stateNode.implementation!==F.implementation?(T=Tc(F,O.mode,Y),T.return=O,T):(T=c(T,F.children||[]),T.return=O,T)}function W(O,T,F,Y,he){return T===null||T.tag!==7?(T=Fs(F,O.mode,Y,he),T.return=O,T):(T=c(T,F),T.return=O,T)}function K(O,T,F){if(typeof T=="string"&&T!==""||typeof T=="number")return T=Pc(""+T,O.mode,F),T.return=O,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case X:return F=po(T.type,T.key,T.props,null,O.mode,F),F.ref=Ri(O,null,T),F.return=O,F;case se:return T=Tc(T,O.mode,F),T.return=O,T;case Te:var Y=T._init;return K(O,Y(T._payload),F)}if(vs(T)||ne(T))return T=Fs(T,O.mode,F,null),T.return=O,T;Bl(O,T)}return null}function H(O,T,F,Y){var he=T!==null?T.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return he!==null?null:b(O,T,""+F,Y);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case X:return F.key===he?R(O,T,F,Y):null;case se:return F.key===he?I(O,T,F,Y):null;case Te:return he=F._init,H(O,T,he(F._payload),Y)}if(vs(F)||ne(F))return he!==null?null:W(O,T,F,Y,null);Bl(O,F)}return null}function te(O,T,F,Y,he){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return O=O.get(F)||null,b(T,O,""+Y,he);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case X:return O=O.get(Y.key===null?F:Y.key)||null,R(T,O,Y,he);case se:return O=O.get(Y.key===null?F:Y.key)||null,I(T,O,Y,he);case Te:var Ce=Y._init;return te(O,T,F,Ce(Y._payload),he)}if(vs(Y)||ne(Y))return O=O.get(F)||null,W(T,O,Y,he,null);Bl(T,Y)}return null}function ae(O,T,F,Y){for(var he=null,Ce=null,Ne=T,Le=T=0,$t=null;Ne!==null&&Le<F.length;Le++){Ne.index>Le?($t=Ne,Ne=null):$t=Ne.sibling;var Ye=H(O,Ne,F[Le],Y);if(Ye===null){Ne===null&&(Ne=$t);break}e&&Ne&&Ye.alternate===null&&t(O,Ne),T=f(Ye,T,Le),Ce===null?he=Ye:Ce.sibling=Ye,Ce=Ye,Ne=$t}if(Le===F.length)return a(O,Ne),gt&&Ps(O,Le),he;if(Ne===null){for(;Le<F.length;Le++)Ne=K(O,F[Le],Y),Ne!==null&&(T=f(Ne,T,Le),Ce===null?he=Ne:Ce.sibling=Ne,Ce=Ne);return gt&&Ps(O,Le),he}for(Ne=l(O,Ne);Le<F.length;Le++)$t=te(Ne,O,Le,F[Le],Y),$t!==null&&(e&&$t.alternate!==null&&Ne.delete($t.key===null?Le:$t.key),T=f($t,T,Le),Ce===null?he=$t:Ce.sibling=$t,Ce=$t);return e&&Ne.forEach(function(Jr){return t(O,Jr)}),gt&&Ps(O,Le),he}function ue(O,T,F,Y){var he=ne(F);if(typeof he!="function")throw Error(s(150));if(F=he.call(F),F==null)throw Error(s(151));for(var Ce=he=null,Ne=T,Le=T=0,$t=null,Ye=F.next();Ne!==null&&!Ye.done;Le++,Ye=F.next()){Ne.index>Le?($t=Ne,Ne=null):$t=Ne.sibling;var Jr=H(O,Ne,Ye.value,Y);if(Jr===null){Ne===null&&(Ne=$t);break}e&&Ne&&Jr.alternate===null&&t(O,Ne),T=f(Jr,T,Le),Ce===null?he=Jr:Ce.sibling=Jr,Ce=Jr,Ne=$t}if(Ye.done)return a(O,Ne),gt&&Ps(O,Le),he;if(Ne===null){for(;!Ye.done;Le++,Ye=F.next())Ye=K(O,Ye.value,Y),Ye!==null&&(T=f(Ye,T,Le),Ce===null?he=Ye:Ce.sibling=Ye,Ce=Ye);return gt&&Ps(O,Le),he}for(Ne=l(O,Ne);!Ye.done;Le++,Ye=F.next())Ye=te(Ne,O,Le,Ye.value,Y),Ye!==null&&(e&&Ye.alternate!==null&&Ne.delete(Ye.key===null?Le:Ye.key),T=f(Ye,T,Le),Ce===null?he=Ye:Ce.sibling=Ye,Ce=Ye);return e&&Ne.forEach(function(ex){return t(O,ex)}),gt&&Ps(O,Le),he}function Et(O,T,F,Y){if(typeof F=="object"&&F!==null&&F.type===A&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case X:e:{for(var he=F.key,Ce=T;Ce!==null;){if(Ce.key===he){if(he=F.type,he===A){if(Ce.tag===7){a(O,Ce.sibling),T=c(Ce,F.props.children),T.return=O,O=T;break e}}else if(Ce.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===Te&&Jf(he)===Ce.type){a(O,Ce.sibling),T=c(Ce,F.props),T.ref=Ri(O,Ce,F),T.return=O,O=T;break e}a(O,Ce);break}else t(O,Ce);Ce=Ce.sibling}F.type===A?(T=Fs(F.props.children,O.mode,Y,F.key),T.return=O,O=T):(Y=po(F.type,F.key,F.props,null,O.mode,Y),Y.ref=Ri(O,T,F),Y.return=O,O=Y)}return v(O);case se:e:{for(Ce=F.key;T!==null;){if(T.key===Ce)if(T.tag===4&&T.stateNode.containerInfo===F.containerInfo&&T.stateNode.implementation===F.implementation){a(O,T.sibling),T=c(T,F.children||[]),T.return=O,O=T;break e}else{a(O,T);break}else t(O,T);T=T.sibling}T=Tc(F,O.mode,Y),T.return=O,O=T}return v(O);case Te:return Ce=F._init,Et(O,T,Ce(F._payload),Y)}if(vs(F))return ae(O,T,F,Y);if(ne(F))return ue(O,T,F,Y);Bl(O,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,T!==null&&T.tag===6?(a(O,T.sibling),T=c(T,F),T.return=O,O=T):(a(O,T),T=Pc(F,O.mode,Y),T.return=O,O=T),v(O)):a(O,T)}return Et}var Sa=Xf(!0),Zf=Xf(!1),Hl=Ur(null),Ql=null,Ca=null,zu=null;function Uu(){zu=Ca=Ql=null}function $u(e){var t=Hl.current;ht(Hl),e._currentValue=t}function qu(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Na(e,t){Ql=e,zu=Ca=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(un=!0),e.firstContext=null)}function En(e){var t=e._currentValue;if(zu!==e)if(e={context:e,memoizedValue:t,next:null},Ca===null){if(Ql===null)throw Error(s(308));Ca=e,Ql.dependencies={lanes:0,firstContext:e}}else Ca=Ca.next=e;return t}var Ts=null;function Bu(e){Ts===null?Ts=[e]:Ts.push(e)}function eh(e,t,a,l){var c=t.interleaved;return c===null?(a.next=a,Bu(t)):(a.next=c.next,c.next=a),t.interleaved=a,mr(e,l)}function mr(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var Br=!1;function Hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function th(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hr(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ge&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,mr(e,a)}return c=l.interleaved,c===null?(t.next=t,Bu(l)):(t.next=c.next,c.next=t),l.interleaved=t,mr(e,a)}function Vl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,su(e,a)}}function nh(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var v={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};f===null?c=f=v:f=f.next=v,a=a.next}while(a!==null);f===null?c=f=t:f=f.next=t}else c=f=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:l.shared,effects:l.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Wl(e,t,a,l){var c=e.updateQueue;Br=!1;var f=c.firstBaseUpdate,v=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var R=b,I=R.next;R.next=null,v===null?f=I:v.next=I,v=R;var W=e.alternate;W!==null&&(W=W.updateQueue,b=W.lastBaseUpdate,b!==v&&(b===null?W.firstBaseUpdate=I:b.next=I,W.lastBaseUpdate=R))}if(f!==null){var K=c.baseState;v=0,W=I=R=null,b=f;do{var H=b.lane,te=b.eventTime;if((l&H)===H){W!==null&&(W=W.next={eventTime:te,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ae=e,ue=b;switch(H=t,te=a,ue.tag){case 1:if(ae=ue.payload,typeof ae=="function"){K=ae.call(te,K,H);break e}K=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ue.payload,H=typeof ae=="function"?ae.call(te,K,H):ae,H==null)break e;K=$({},K,H);break e;case 2:Br=!0}}b.callback!==null&&b.lane!==0&&(e.flags|=64,H=c.effects,H===null?c.effects=[b]:H.push(b))}else te={eventTime:te,lane:H,tag:b.tag,payload:b.payload,callback:b.callback,next:null},W===null?(I=W=te,R=K):W=W.next=te,v|=H;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;H=b,b=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);if(W===null&&(R=K),c.baseState=R,c.firstBaseUpdate=I,c.lastBaseUpdate=W,t=c.shared.interleaved,t!==null){c=t;do v|=c.lane,c=c.next;while(c!==t)}else f===null&&(c.shared.lanes=0);_s|=v,e.lanes=v,e.memoizedState=K}}function rh(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],c=l.callback;if(c!==null){if(l.callback=null,l=a,typeof c!="function")throw Error(s(191,c));c.call(l)}}}var Pi={},er=Ur(Pi),Ti=Ur(Pi),Li=Ur(Pi);function Ls(e){if(e===Pi)throw Error(s(174));return e}function Qu(e,t){switch(dt(Li,t),dt(Ti,e),dt(er,Pi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gn(t,e)}ht(er),dt(er,t)}function Ea(){ht(er),ht(Ti),ht(Li)}function sh(e){Ls(Li.current);var t=Ls(er.current),a=gn(t,e.type);t!==a&&(dt(Ti,e),dt(er,a))}function Vu(e){Ti.current===e&&(ht(er),ht(Ti))}var vt=Ur(0);function Kl(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wu=[];function Ku(){for(var e=0;e<Wu.length;e++)Wu[e]._workInProgressVersionPrimary=null;Wu.length=0}var Gl=Q.ReactCurrentDispatcher,Gu=Q.ReactCurrentBatchConfig,Ms=0,xt=null,Mt=null,zt=null,Yl=!1,Mi=!1,_i=0,jv=0;function Wt(){throw Error(s(321))}function Yu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!In(e[a],t[a]))return!1;return!0}function Ju(e,t,a,l,c,f){if(Ms=f,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Gl.current=e===null||e.memoizedState===null?Nv:Ev,e=a(l,c),Mi){f=0;do{if(Mi=!1,_i=0,25<=f)throw Error(s(301));f+=1,zt=Mt=null,t.updateQueue=null,Gl.current=Rv,e=a(l,c)}while(Mi)}if(Gl.current=Zl,t=Mt!==null&&Mt.next!==null,Ms=0,zt=Mt=xt=null,Yl=!1,t)throw Error(s(300));return e}function Xu(){var e=_i!==0;return _i=0,e}function tr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?xt.memoizedState=zt=e:zt=zt.next=e,zt}function Rn(){if(Mt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=zt===null?xt.memoizedState:zt.next;if(t!==null)zt=t,Mt=e;else{if(e===null)throw Error(s(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},zt===null?xt.memoizedState=zt=e:zt=zt.next=e}return zt}function Ai(e,t){return typeof t=="function"?t(e):t}function Zu(e){var t=Rn(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var l=Mt,c=l.baseQueue,f=a.pending;if(f!==null){if(c!==null){var v=c.next;c.next=f.next,f.next=v}l.baseQueue=c=f,a.pending=null}if(c!==null){f=c.next,l=l.baseState;var b=v=null,R=null,I=f;do{var W=I.lane;if((Ms&W)===W)R!==null&&(R=R.next={lane:0,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),l=I.hasEagerState?I.eagerState:e(l,I.action);else{var K={lane:W,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null};R===null?(b=R=K,v=l):R=R.next=K,xt.lanes|=W,_s|=W}I=I.next}while(I!==null&&I!==f);R===null?v=l:R.next=b,In(l,t.memoizedState)||(un=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=R,a.lastRenderedState=l}if(e=a.interleaved,e!==null){c=e;do f=c.lane,xt.lanes|=f,_s|=f,c=c.next;while(c!==e)}else c===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function ec(e){var t=Rn(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,f=t.memoizedState;if(c!==null){a.pending=null;var v=c=c.next;do f=e(f,v.action),v=v.next;while(v!==c);In(f,t.memoizedState)||(un=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,l]}function ah(){}function ih(e,t){var a=xt,l=Rn(),c=t(),f=!In(l.memoizedState,c);if(f&&(l.memoizedState=c,un=!0),l=l.queue,tc(uh.bind(null,a,l,e),[e]),l.getSnapshot!==t||f||zt!==null&&zt.memoizedState.tag&1){if(a.flags|=2048,Di(9,oh.bind(null,a,l,c,t),void 0,null),Ut===null)throw Error(s(349));(Ms&30)!==0||lh(a,t,c)}return c}function lh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function oh(e,t,a,l){t.value=a,t.getSnapshot=l,ch(t)&&dh(e)}function uh(e,t,a){return a(function(){ch(t)&&dh(e)})}function ch(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!In(e,a)}catch{return!0}}function dh(e){var t=mr(e,1);t!==null&&Bn(t,e,1,-1)}function fh(e){var t=tr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:e},t.queue=e,e=e.dispatch=Cv.bind(null,xt,e),[t.memoizedState,e]}function Di(e,t,a,l){return e={tag:e,create:t,destroy:a,deps:l,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e)),e}function hh(){return Rn().memoizedState}function Jl(e,t,a,l){var c=tr();xt.flags|=e,c.memoizedState=Di(1|t,a,void 0,l===void 0?null:l)}function Xl(e,t,a,l){var c=Rn();l=l===void 0?null:l;var f=void 0;if(Mt!==null){var v=Mt.memoizedState;if(f=v.destroy,l!==null&&Yu(l,v.deps)){c.memoizedState=Di(t,a,f,l);return}}xt.flags|=e,c.memoizedState=Di(1|t,a,f,l)}function ph(e,t){return Jl(8390656,8,e,t)}function tc(e,t){return Xl(2048,8,e,t)}function mh(e,t){return Xl(4,2,e,t)}function gh(e,t){return Xl(4,4,e,t)}function yh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vh(e,t,a){return a=a!=null?a.concat([e]):null,Xl(4,4,yh.bind(null,t,e),a)}function nc(){}function xh(e,t){var a=Rn();t=t===void 0?null:t;var l=a.memoizedState;return l!==null&&t!==null&&Yu(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function wh(e,t){var a=Rn();t=t===void 0?null:t;var l=a.memoizedState;return l!==null&&t!==null&&Yu(t,l[1])?l[0]:(e=e(),a.memoizedState=[e,t],e)}function kh(e,t,a){return(Ms&21)===0?(e.baseState&&(e.baseState=!1,un=!0),e.memoizedState=a):(In(a,t)||(a=Yd(),xt.lanes|=a,_s|=a,e.baseState=!0),t)}function bv(e,t){var a=rt;rt=a!==0&&4>a?a:4,e(!0);var l=Gu.transition;Gu.transition={};try{e(!1),t()}finally{rt=a,Gu.transition=l}}function jh(){return Rn().memoizedState}function Sv(e,t,a){var l=Kr(e);if(a={lane:l,action:a,hasEagerState:!1,eagerState:null,next:null},bh(e))Sh(t,a);else if(a=eh(e,t,a,l),a!==null){var c=Xt();Bn(a,e,l,c),Ch(a,t,l)}}function Cv(e,t,a){var l=Kr(e),c={lane:l,action:a,hasEagerState:!1,eagerState:null,next:null};if(bh(e))Sh(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,b=f(v,a);if(c.hasEagerState=!0,c.eagerState=b,In(b,v)){var R=t.interleaved;R===null?(c.next=c,Bu(t)):(c.next=R.next,R.next=c),t.interleaved=c;return}}catch{}finally{}a=eh(e,t,c,l),a!==null&&(c=Xt(),Bn(a,e,l,c),Ch(a,t,l))}}function bh(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function Sh(e,t){Mi=Yl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Ch(e,t,a){if((a&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,su(e,a)}}var Zl={readContext:En,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},Nv={readContext:En,useCallback:function(e,t){return tr().memoizedState=[e,t===void 0?null:t],e},useContext:En,useEffect:ph,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Jl(4194308,4,yh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Jl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Jl(4,2,e,t)},useMemo:function(e,t){var a=tr();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var l=tr();return t=a!==void 0?a(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Sv.bind(null,xt,e),[l.memoizedState,e]},useRef:function(e){var t=tr();return e={current:e},t.memoizedState=e},useState:fh,useDebugValue:nc,useDeferredValue:function(e){return tr().memoizedState=e},useTransition:function(){var e=fh(!1),t=e[0];return e=bv.bind(null,e[1]),tr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var l=xt,c=tr();if(gt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),Ut===null)throw Error(s(349));(Ms&30)!==0||lh(l,t,a)}c.memoizedState=a;var f={value:a,getSnapshot:t};return c.queue=f,ph(uh.bind(null,l,f,e),[e]),l.flags|=2048,Di(9,oh.bind(null,l,f,a,t),void 0,null),a},useId:function(){var e=tr(),t=Ut.identifierPrefix;if(gt){var a=pr,l=hr;a=(l&~(1<<32-Lt(l)-1)).toString(32)+a,t=":"+t+"R"+a,a=_i++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=jv++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ev={readContext:En,useCallback:xh,useContext:En,useEffect:tc,useImperativeHandle:vh,useInsertionEffect:mh,useLayoutEffect:gh,useMemo:wh,useReducer:Zu,useRef:hh,useState:function(){return Zu(Ai)},useDebugValue:nc,useDeferredValue:function(e){var t=Rn();return kh(t,Mt.memoizedState,e)},useTransition:function(){var e=Zu(Ai)[0],t=Rn().memoizedState;return[e,t]},useMutableSource:ah,useSyncExternalStore:ih,useId:jh,unstable_isNewReconciler:!1},Rv={readContext:En,useCallback:xh,useContext:En,useEffect:tc,useImperativeHandle:vh,useInsertionEffect:mh,useLayoutEffect:gh,useMemo:wh,useReducer:ec,useRef:hh,useState:function(){return ec(Ai)},useDebugValue:nc,useDeferredValue:function(e){var t=Rn();return Mt===null?t.memoizedState=e:kh(t,Mt.memoizedState,e)},useTransition:function(){var e=ec(Ai)[0],t=Rn().memoizedState;return[e,t]},useMutableSource:ah,useSyncExternalStore:ih,useId:jh,unstable_isNewReconciler:!1};function Un(e,t){if(e&&e.defaultProps){t=$({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function rc(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:$({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var eo={isMounted:function(e){return(e=e._reactInternals)?we(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Xt(),c=Kr(e),f=gr(l,c);f.payload=t,a!=null&&(f.callback=a),t=Hr(e,f,c),t!==null&&(Bn(t,e,c,l),Vl(t,e,c))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Xt(),c=Kr(e),f=gr(l,c);f.tag=1,f.payload=t,a!=null&&(f.callback=a),t=Hr(e,f,c),t!==null&&(Bn(t,e,c,l),Vl(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Xt(),l=Kr(e),c=gr(a,l);c.tag=2,t!=null&&(c.callback=t),t=Hr(e,c,l),t!==null&&(Bn(t,e,l,a),Vl(t,e,l))}};function Nh(e,t,a,l,c,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,v):t.prototype&&t.prototype.isPureReactComponent?!ki(a,l)||!ki(c,f):!0}function Eh(e,t,a){var l=!1,c=$r,f=t.contextType;return typeof f=="object"&&f!==null?f=En(f):(c=on(t)?Es:Vt.current,l=t.contextTypes,f=(l=l!=null)?wa(e,c):$r),t=new t(a,f),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=eo,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=f),t}function Rh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&eo.enqueueReplaceState(t,t.state,null)}function sc(e,t,a,l){var c=e.stateNode;c.props=a,c.state=e.memoizedState,c.refs={},Hu(e);var f=t.contextType;typeof f=="object"&&f!==null?c.context=En(f):(f=on(t)?Es:Vt.current,c.context=wa(e,f)),c.state=e.memoizedState,f=t.getDerivedStateFromProps,typeof f=="function"&&(rc(e,t,f,a),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&eo.enqueueReplaceState(c,c.state,null),Wl(e,a,c,l),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function Ra(e,t){try{var a="",l=t;do a+=xe(l),l=l.return;while(l);var c=a}catch(f){c=`
|
|
39
39
|
Error generating stack: `+f.message+`
|
|
40
|
-
`+f.stack}return{value:e,source:t,stack:c,digest:null}}function ac(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var Pv=typeof WeakMap=="function"?WeakMap:Map;function Ph(e,t,a){a=gr(-1,a),a.tag=3,a.payload={element:null};var l=t.value;return a.callback=function(){io||(io=!0,kc=l),ic(e,t)},a}function Th(e,t,a){a=gr(-1,a),a.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var c=t.value;a.payload=function(){return l(c)},a.callback=function(){ic(e,t)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(a.callback=function(){ic(e,t),typeof l!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),a}function Lh(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Pv;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(c.add(a),e=Bv.bind(null,e,t,a),t.then(e,e))}function Mh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function _h(e,t,a,l,c){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=gr(-1,1),t.tag=2,Hr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var Tv=Q.ReactCurrentOwner,un=!1;function Jt(e,t,a,l){t.child=e===null?Zf(t,null,a,l):Sa(t,e.child,a,l)}function Ah(e,t,a,l,c){a=a.render;var f=t.ref;return Na(t,c),l=Ju(e,t,a,l,f,c),a=Xu(),e!==null&&!un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,yr(e,t,c)):(gt&&a&&Au(t),t.flags|=1,Jt(e,t,l,c),t.child)}function Dh(e,t,a,l,c){if(e===null){var f=a.type;return typeof f=="function"&&!Rc(f)&&f.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=f,Oh(e,t,f,l,c)):(e=ho(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,(e.lanes&c)===0){var v=f.memoizedProps;if(a=a.compare,a=a!==null?a:ki,a(v,l)&&e.ref===t.ref)return yr(e,t,c)}return t.flags|=1,e=Yr(f,l),e.ref=t.ref,e.return=t,t.child=e}function Oh(e,t,a,l,c){if(e!==null){var f=e.memoizedProps;if(ki(f,l)&&e.ref===t.ref)if(un=!1,t.pendingProps=l=f,(e.lanes&c)!==0)(e.flags&131072)!==0&&(un=!0);else return t.lanes=e.lanes,yr(e,t,c)}return lc(e,t,a,l,c)}function Fh(e,t,a){var l=t.pendingProps,c=l.children,f=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(Ta,wn),wn|=a;else{if((a&1073741824)===0)return e=f!==null?f.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,dt(Ta,wn),wn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=f!==null?f.baseLanes:a,dt(Ta,wn),wn|=l}else f!==null?(l=f.baseLanes|a,t.memoizedState=null):l=a,dt(Ta,wn),wn|=l;return Jt(e,t,c,a),t.child}function Ih(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function lc(e,t,a,l,c){var f=on(a)?Es:Vt.current;return f=wa(t,f),Na(t,c),a=Ju(e,t,a,l,f,c),l=Xu(),e!==null&&!un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,yr(e,t,c)):(gt&&l&&Au(t),t.flags|=1,Jt(e,t,a,c),t.child)}function zh(e,t,a,l,c){if(on(a)){var f=!0;Fl(t)}else f=!1;if(Na(t,c),t.stateNode===null)to(e,t),Eh(t,a,l),sc(t,a,l,c),l=!0;else if(e===null){var v=t.stateNode,b=t.memoizedProps;v.props=b;var R=v.context,F=a.contextType;typeof F=="object"&&F!==null?F=En(F):(F=on(a)?Es:Vt.current,F=wa(t,F));var W=a.getDerivedStateFromProps,K=typeof W=="function"||typeof v.getSnapshotBeforeUpdate=="function";K||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(b!==l||R!==F)&&Rh(t,v,l,F),Br=!1;var H=t.memoizedState;v.state=H,Vl(t,l,v,c),R=t.memoizedState,b!==l||H!==R||ln.current||Br?(typeof W=="function"&&(rc(t,a,W,l),R=t.memoizedState),(b=Br||Nh(t,a,b,l,H,R,F))?(K||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),v.props=l,v.state=R,v.context=F,l=b):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,th(e,t),b=t.memoizedProps,F=t.type===t.elementType?b:Un(t.type,b),v.props=F,K=t.pendingProps,H=v.context,R=a.contextType,typeof R=="object"&&R!==null?R=En(R):(R=on(a)?Es:Vt.current,R=wa(t,R));var te=a.getDerivedStateFromProps;(W=typeof te=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(b!==K||H!==R)&&Rh(t,v,l,R),Br=!1,H=t.memoizedState,v.state=H,Vl(t,l,v,c);var ae=t.memoizedState;b!==K||H!==ae||ln.current||Br?(typeof te=="function"&&(rc(t,a,te,l),ae=t.memoizedState),(F=Br||Nh(t,a,F,l,H,ae,R)||!1)?(W||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,ae,R),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,ae,R)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ae),v.props=l,v.state=ae,v.context=R,l=F):(typeof v.componentDidUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return oc(e,t,a,l,f,c)}function oc(e,t,a,l,c,f){Ih(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return c&&Hf(t,a,!1),yr(e,t,f);l=t.stateNode,Tv.current=t;var b=v&&typeof a.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Sa(t,e.child,null,f),t.child=Sa(t,null,b,f)):Jt(e,t,b,f),t.memoizedState=l.state,c&&Hf(t,a,!0),t.child}function Uh(e){var t=e.stateNode;t.pendingContext?qf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qf(e,t.context,!1),Qu(e,t.containerInfo)}function $h(e,t,a,l,c){return ba(),Iu(c),t.flags|=256,Jt(e,t,a,l),t.child}var uc={dehydrated:null,treeContext:null,retryLane:0};function cc(e){return{baseLanes:e,cachePool:null,transitions:null}}function qh(e,t,a){var l=t.pendingProps,c=vt.current,f=!1,v=(t.flags&128)!==0,b;if((b=v)||(b=e!==null&&e.memoizedState===null?!1:(c&2)!==0),b?(f=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),dt(vt,c&1),e===null)return Fu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(v=l.children,e=l.fallback,f?(l=t.mode,f=t.child,v={mode:"hidden",children:v},(l&1)===0&&f!==null?(f.childLanes=0,f.pendingProps=v):f=po(v,l,0,null),e=Fs(e,l,a,null),f.return=t,e.return=t,f.sibling=e,t.child=f,t.child.memoizedState=cc(a),t.memoizedState=uc,e):dc(t,v));if(c=e.memoizedState,c!==null&&(b=c.dehydrated,b!==null))return Lv(e,t,v,l,b,c,a);if(f){f=l.fallback,v=t.mode,c=e.child,b=c.sibling;var R={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==c?(l=t.child,l.childLanes=0,l.pendingProps=R,t.deletions=null):(l=Yr(c,R),l.subtreeFlags=c.subtreeFlags&14680064),b!==null?f=Yr(b,f):(f=Fs(f,v,a,null),f.flags|=2),f.return=t,l.return=t,l.sibling=f,t.child=l,l=f,f=t.child,v=e.child.memoizedState,v=v===null?cc(a):{baseLanes:v.baseLanes|a,cachePool:null,transitions:v.transitions},f.memoizedState=v,f.childLanes=e.childLanes&~a,t.memoizedState=uc,l}return f=e.child,e=f.sibling,l=Yr(f,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=a),l.return=t,l.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=l,t.memoizedState=null,l}function dc(e,t){return t=po({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function eo(e,t,a,l){return l!==null&&Iu(l),Sa(t,e.child,null,a),e=dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lv(e,t,a,l,c,f,v){if(a)return t.flags&256?(t.flags&=-257,l=ac(Error(s(422))),eo(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(f=l.fallback,c=t.mode,l=po({mode:"visible",children:l.children},c,0,null),f=Fs(f,c,v,null),f.flags|=2,l.return=t,f.return=t,l.sibling=f,t.child=l,(t.mode&1)!==0&&Sa(t,e.child,null,v),t.child.memoizedState=cc(v),t.memoizedState=uc,f);if((t.mode&1)===0)return eo(e,t,v,null);if(c.data==="$!"){if(l=c.nextSibling&&c.nextSibling.dataset,l)var b=l.dgst;return l=b,f=Error(s(419)),l=ac(f,l,void 0),eo(e,t,v,l)}if(b=(v&e.childLanes)!==0,un||b){if(l=Ut,l!==null){switch(v&-v){case 4:c=2;break;case 16:c=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(l.suspendedLanes|v))!==0?0:c,c!==0&&c!==f.retryLane&&(f.retryLane=c,mr(e,c),Bn(l,e,c,-1))}return Ec(),l=ac(Error(s(421))),eo(e,t,v,l)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=Hv.bind(null,e),c._reactRetry=t,null):(e=f.treeContext,xn=zr(c.nextSibling),vn=t,gt=!0,zn=null,e!==null&&(Cn[Nn++]=hr,Cn[Nn++]=pr,Cn[Nn++]=Rs,hr=e.id,pr=e.overflow,Rs=t),t=dc(t,l.children),t.flags|=4096,t)}function Bh(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),qu(e.return,t,a)}function fc(e,t,a,l,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=a,f.tailMode=c)}function Hh(e,t,a){var l=t.pendingProps,c=l.revealOrder,f=l.tail;if(Jt(e,t,l.children,a),l=vt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bh(e,a,t);else if(e.tag===19)Bh(e,a,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}l&=1}if(dt(vt,l),(t.mode&1)===0)t.memoizedState=null;else switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Wl(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),fc(t,!1,c,a,f);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Wl(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}fc(t,!0,a,null,f);break;case"together":fc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function to(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),_s|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=Yr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Yr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Mv(e,t,a){switch(t.tag){case 3:Uh(t),ba();break;case 5:sh(t);break;case 1:on(t.type)&&Fl(t);break;case 4:Qu(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,c=t.memoizedProps.value;dt(Bl,l._currentValue),l._currentValue=c;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(dt(vt,vt.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?qh(e,t,a):(dt(vt,vt.current&1),e=yr(e,t,a),e!==null?e.sibling:null);dt(vt,vt.current&1);break;case 19:if(l=(a&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Hh(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),dt(vt,vt.current),l)break;return null;case 22:case 23:return t.lanes=0,Fh(e,t,a)}return yr(e,t,a)}var Qh,hc,Vh,Wh;Qh=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},hc=function(){},Vh=function(e,t,a,l){var c=e.memoizedProps;if(c!==l){e=t.stateNode,Ls(er.current);var f=null;switch(a){case"input":c=Gn(e,c),l=Gn(e,l),f=[];break;case"select":c=U({},c,{value:void 0}),l=U({},l,{value:void 0}),f=[];break;case"textarea":c=ni(e,c),l=ni(e,l),f=[];break;default:typeof c.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Al)}sa(a,l);var v;a=null;for(F in c)if(!l.hasOwnProperty(F)&&c.hasOwnProperty(F)&&c[F]!=null)if(F==="style"){var b=c[F];for(v in b)b.hasOwnProperty(v)&&(a||(a={}),a[v]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(u.hasOwnProperty(F)?f||(f=[]):(f=f||[]).push(F,null));for(F in l){var R=l[F];if(b=c!=null?c[F]:void 0,l.hasOwnProperty(F)&&R!==b&&(R!=null||b!=null))if(F==="style")if(b){for(v in b)!b.hasOwnProperty(v)||R&&R.hasOwnProperty(v)||(a||(a={}),a[v]="");for(v in R)R.hasOwnProperty(v)&&b[v]!==R[v]&&(a||(a={}),a[v]=R[v])}else a||(f||(f=[]),f.push(F,a)),a=R;else F==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,b=b?b.__html:void 0,R!=null&&b!==R&&(f=f||[]).push(F,R)):F==="children"?typeof R!="string"&&typeof R!="number"||(f=f||[]).push(F,""+R):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(u.hasOwnProperty(F)?(R!=null&&F==="onScroll"&&ft("scroll",e),f||b===R||(f=[])):(f=f||[]).push(F,R))}a&&(f=f||[]).push("style",a);var F=f;(t.updateQueue=F)&&(t.flags|=4)}},Wh=function(e,t,a,l){a!==l&&(t.flags|=4)};function Oi(e,t){if(!gt)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Kt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&14680064,l|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function _v(e,t,a){var l=t.pendingProps;switch(Du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(t),null;case 1:return on(t.type)&&Ol(),Kt(t),null;case 3:return l=t.stateNode,Ea(),ht(ln),ht(Vt),Ku(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&($l(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,zn!==null&&(Sc(zn),zn=null))),hc(e,t),Kt(t),null;case 5:Vu(t);var c=Ls(Li.current);if(a=t.type,e!==null&&t.stateNode!=null)Vh(e,t,a,l,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Kt(t),null}if(e=Ls(er.current),$l(t)){l=t.stateNode,a=t.type;var f=t.memoizedProps;switch(l[Zn]=t,l[Ni]=f,e=(t.mode&1)!==0,a){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(c=0;c<bi.length;c++)ft(bi[c],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":Yn(l,f),ft("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!f.multiple},ft("invalid",l);break;case"textarea":Jn(l,f),ft("invalid",l)}sa(a,f),c=null;for(var v in f)if(f.hasOwnProperty(v)){var b=f[v];v==="children"?typeof b=="string"?l.textContent!==b&&(f.suppressHydrationWarning!==!0&&_l(l.textContent,b,e),c=["children",b]):typeof b=="number"&&l.textContent!==""+b&&(f.suppressHydrationWarning!==!0&&_l(l.textContent,b,e),c=["children",""+b]):u.hasOwnProperty(v)&&b!=null&&v==="onScroll"&&ft("scroll",l)}switch(a){case"input":ct(l),ei(l,f,!0);break;case"textarea":ct(l),ri(l);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(l.onclick=Al)}l=c,t.updateQueue=l,l!==null&&(t.flags|=4)}else{v=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ra(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(a,{is:l.is}):(e=v.createElement(a),a==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,a),e[Zn]=t,e[Ni]=l,Qh(e,t,!1,!1),t.stateNode=e;e:{switch(v=ii(a,l),a){case"dialog":ft("cancel",e),ft("close",e),c=l;break;case"iframe":case"object":case"embed":ft("load",e),c=l;break;case"video":case"audio":for(c=0;c<bi.length;c++)ft(bi[c],e);c=l;break;case"source":ft("error",e),c=l;break;case"img":case"image":case"link":ft("error",e),ft("load",e),c=l;break;case"details":ft("toggle",e),c=l;break;case"input":Yn(e,l),c=Gn(e,l),ft("invalid",e);break;case"option":c=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},c=U({},l,{value:void 0}),ft("invalid",e);break;case"textarea":Jn(e,l),c=ni(e,l),ft("invalid",e);break;default:c=l}sa(a,c),b=c;for(f in b)if(b.hasOwnProperty(f)){var R=b[f];f==="style"?ai(e,R):f==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&si(e,R)):f==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&xs(e,R):typeof R=="number"&&xs(e,""+R):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(u.hasOwnProperty(f)?R!=null&&f==="onScroll"&&ft("scroll",e):R!=null&&$(e,f,R,v))}switch(a){case"input":ct(e),ei(e,l,!1);break;case"textarea":ct(e),ri(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ke(l.value));break;case"select":e.multiple=!!l.multiple,f=l.value,f!=null?Er(e,!!l.multiple,f,!1):l.defaultValue!=null&&Er(e,!!l.multiple,l.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=Al)}switch(a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Kt(t),null;case 6:if(e&&t.stateNode!=null)Wh(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(a=Ls(Li.current),Ls(er.current),$l(t)){if(l=t.stateNode,a=t.memoizedProps,l[Zn]=t,(f=l.nodeValue!==a)&&(e=vn,e!==null))switch(e.tag){case 3:_l(l.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_l(l.nodeValue,a,(e.mode&1)!==0)}f&&(t.flags|=4)}else l=(a.nodeType===9?a:a.ownerDocument).createTextNode(l),l[Zn]=t,t.stateNode=l}return Kt(t),null;case 13:if(ht(vt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(gt&&xn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Yf(),ba(),t.flags|=98560,f=!1;else if(f=$l(t),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[Zn]=t}else ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Kt(t),f=!1}else zn!==null&&(Sc(zn),zn=null),f=!0;if(!f)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(vt.current&1)!==0?_t===0&&(_t=3):Ec())),t.updateQueue!==null&&(t.flags|=4),Kt(t),null);case 4:return Ea(),hc(e,t),e===null&&Si(t.stateNode.containerInfo),Kt(t),null;case 10:return $u(t.type._context),Kt(t),null;case 17:return on(t.type)&&Ol(),Kt(t),null;case 19:if(ht(vt),f=t.memoizedState,f===null)return Kt(t),null;if(l=(t.flags&128)!==0,v=f.rendering,v===null)if(l)Oi(f,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Wl(e),v!==null){for(t.flags|=128,Oi(f,!1),l=v.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=a,a=t.child;a!==null;)f=a,e=l,f.flags&=14680066,v=f.alternate,v===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=v.childLanes,f.lanes=v.lanes,f.child=v.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=v.memoizedProps,f.memoizedState=v.memoizedState,f.updateQueue=v.updateQueue,f.type=v.type,e=v.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return dt(vt,vt.current&1|2),t.child}e=e.sibling}f.tail!==null&&Ze()>La&&(t.flags|=128,l=!0,Oi(f,!1),t.lanes=4194304)}else{if(!l)if(e=Wl(v),e!==null){if(t.flags|=128,l=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Oi(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!gt)return Kt(t),null}else 2*Ze()-f.renderingStartTime>La&&a!==1073741824&&(t.flags|=128,l=!0,Oi(f,!1),t.lanes=4194304);f.isBackwards?(v.sibling=t.child,t.child=v):(a=f.last,a!==null?a.sibling=v:t.child=v,f.last=v)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Ze(),t.sibling=null,a=vt.current,dt(vt,l?a&1|2:a&1),t):(Kt(t),null);case 22:case 23:return Nc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(wn&1073741824)!==0&&(Kt(t),t.subtreeFlags&6&&(t.flags|=8192)):Kt(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Av(e,t){switch(Du(t),t.tag){case 1:return on(t.type)&&Ol(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ea(),ht(ln),ht(Vt),Ku(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Vu(t),null;case 13:if(ht(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(vt),null;case 4:return Ea(),null;case 10:return $u(t.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var no=!1,Gt=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,re=null;function Pa(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(l){bt(e,t,l)}else a.current=null}function pc(e,t,a){try{a()}catch(l){bt(e,t,l)}}var Kh=!1;function Ov(e,t){if(Nu=jl,e=Nf(),vu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var v=0,b=-1,R=-1,F=0,W=0,K=e,H=null;t:for(;;){for(var te;K!==a||c!==0&&K.nodeType!==3||(b=v+c),K!==f||l!==0&&K.nodeType!==3||(R=v+l),K.nodeType===3&&(v+=K.nodeValue.length),(te=K.firstChild)!==null;)H=K,K=te;for(;;){if(K===e)break t;if(H===a&&++F===c&&(b=v),H===f&&++W===l&&(R=v),(te=K.nextSibling)!==null)break;K=H,H=K.parentNode}K=te}a=b===-1||R===-1?null:{start:b,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Eu={focusedElem:e,selectionRange:a},jl=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var ae=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var ue=ae.memoizedProps,Et=ae.memoizedState,D=t.stateNode,P=D.getSnapshotBeforeUpdate(t.elementType===t.type?ue:Un(t.type,ue),Et);D.__reactInternalSnapshotBeforeUpdate=P}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Y){bt(t,t.return,Y)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return ae=Kh,Kh=!1,ae}function Fi(e,t,a){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var c=l=l.next;do{if((c.tag&e)===e){var f=c.destroy;c.destroy=void 0,f!==void 0&&pc(t,a,f)}c=c.next}while(c!==l)}}function ro(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var l=a.create;a.destroy=l()}a=a.next}while(a!==t)}}function mc(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=a;break;default:e=a}typeof t=="function"?t(e):t.current=e}}function Gh(e){var t=e.alternate;t!==null&&(e.alternate=null,Gh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zn],delete t[Ni],delete t[Lu],delete t[vv],delete t[xv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yh(e){return e.tag===5||e.tag===3||e.tag===4}function Jh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Al));else if(l!==4&&(e=e.child,e!==null))for(gc(e,t,a),e=e.sibling;e!==null;)gc(e,t,a),e=e.sibling}function yc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(yc(e,t,a),e=e.sibling;e!==null;)yc(e,t,a),e=e.sibling}var Ht=null,$n=!1;function Qr(e,t,a){for(a=a.child;a!==null;)Xh(e,t,a),a=a.sibling}function Xh(e,t,a){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(Ue,a)}catch{}switch(a.tag){case 5:Gt||Pa(a,t);case 6:var l=Ht,c=$n;Ht=null,Qr(e,t,a),Ht=l,$n=c,Ht!==null&&($n?(e=Ht,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):Ht.removeChild(a.stateNode));break;case 18:Ht!==null&&($n?(e=Ht,a=a.stateNode,e.nodeType===8?Tu(e.parentNode,a):e.nodeType===1&&Tu(e,a),mi(e)):Tu(Ht,a.stateNode));break;case 4:l=Ht,c=$n,Ht=a.stateNode.containerInfo,$n=!0,Qr(e,t,a),Ht=l,$n=c;break;case 0:case 11:case 14:case 15:if(!Gt&&(l=a.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){c=l=l.next;do{var f=c,v=f.destroy;f=f.tag,v!==void 0&&((f&2)!==0||(f&4)!==0)&&pc(a,t,v),c=c.next}while(c!==l)}Qr(e,t,a);break;case 1:if(!Gt&&(Pa(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=a.memoizedProps,l.state=a.memoizedState,l.componentWillUnmount()}catch(b){bt(a,t,b)}Qr(e,t,a);break;case 21:Qr(e,t,a);break;case 22:a.mode&1?(Gt=(l=Gt)||a.memoizedState!==null,Qr(e,t,a),Gt=l):Qr(e,t,a);break;default:Qr(e,t,a)}}function Zh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Dv),t.forEach(function(l){var c=Qv.bind(null,e,l);a.has(l)||(a.add(l),l.then(c,c))})}}function qn(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l];try{var f=e,v=t,b=v;e:for(;b!==null;){switch(b.tag){case 5:Ht=b.stateNode,$n=!1;break e;case 3:Ht=b.stateNode.containerInfo,$n=!0;break e;case 4:Ht=b.stateNode.containerInfo,$n=!0;break e}b=b.return}if(Ht===null)throw Error(s(160));Xh(f,v,c),Ht=null,$n=!1;var R=c.alternate;R!==null&&(R.return=null),c.return=null}catch(F){bt(c,t,F)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ep(t,e),t=t.sibling}function ep(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qn(t,e),nr(e),l&4){try{Fi(3,e,e.return),ro(3,e)}catch(ue){bt(e,e.return,ue)}try{Fi(5,e,e.return)}catch(ue){bt(e,e.return,ue)}}break;case 1:qn(t,e),nr(e),l&512&&a!==null&&Pa(a,a.return);break;case 5:if(qn(t,e),nr(e),l&512&&a!==null&&Pa(a,a.return),e.flags&32){var c=e.stateNode;try{xs(c,"")}catch(ue){bt(e,e.return,ue)}}if(l&4&&(c=e.stateNode,c!=null)){var f=e.memoizedProps,v=a!==null?a.memoizedProps:f,b=e.type,R=e.updateQueue;if(e.updateQueue=null,R!==null)try{b==="input"&&f.type==="radio"&&f.name!=null&&hl(c,f),ii(b,v);var F=ii(b,f);for(v=0;v<R.length;v+=2){var W=R[v],K=R[v+1];W==="style"?ai(c,K):W==="dangerouslySetInnerHTML"?si(c,K):W==="children"?xs(c,K):$(c,W,K,F)}switch(b){case"input":Za(c,f);break;case"textarea":Rr(c,f);break;case"select":var H=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!f.multiple;var te=f.value;te!=null?Er(c,!!f.multiple,te,!1):H!==!!f.multiple&&(f.defaultValue!=null?Er(c,!!f.multiple,f.defaultValue,!0):Er(c,!!f.multiple,f.multiple?[]:"",!1))}c[Ni]=f}catch(ue){bt(e,e.return,ue)}}break;case 6:if(qn(t,e),nr(e),l&4){if(e.stateNode===null)throw Error(s(162));c=e.stateNode,f=e.memoizedProps;try{c.nodeValue=f}catch(ue){bt(e,e.return,ue)}}break;case 3:if(qn(t,e),nr(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{mi(t.containerInfo)}catch(ue){bt(e,e.return,ue)}break;case 4:qn(t,e),nr(e);break;case 13:qn(t,e),nr(e),c=e.child,c.flags&8192&&(f=c.memoizedState!==null,c.stateNode.isHidden=f,!f||c.alternate!==null&&c.alternate.memoizedState!==null||(wc=Ze())),l&4&&Zh(e);break;case 22:if(W=a!==null&&a.memoizedState!==null,e.mode&1?(Gt=(F=Gt)||W,qn(t,e),Gt=F):qn(t,e),nr(e),l&8192){if(F=e.memoizedState!==null,(e.stateNode.isHidden=F)&&!W&&(e.mode&1)!==0)for(re=e,W=e.child;W!==null;){for(K=re=W;re!==null;){switch(H=re,te=H.child,H.tag){case 0:case 11:case 14:case 15:Fi(4,H,H.return);break;case 1:Pa(H,H.return);var ae=H.stateNode;if(typeof ae.componentWillUnmount=="function"){l=H,a=H.return;try{t=l,ae.props=t.memoizedProps,ae.state=t.memoizedState,ae.componentWillUnmount()}catch(ue){bt(l,a,ue)}}break;case 5:Pa(H,H.return);break;case 22:if(H.memoizedState!==null){rp(K);continue}}te!==null?(te.return=H,re=te):rp(K)}W=W.sibling}e:for(W=null,K=e;;){if(K.tag===5){if(W===null){W=K;try{c=K.stateNode,F?(f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(b=K.stateNode,R=K.memoizedProps.style,v=R!=null&&R.hasOwnProperty("display")?R.display:null,b.style.display=jn("display",v))}catch(ue){bt(e,e.return,ue)}}}else if(K.tag===6){if(W===null)try{K.stateNode.nodeValue=F?"":K.memoizedProps}catch(ue){bt(e,e.return,ue)}}else if((K.tag!==22&&K.tag!==23||K.memoizedState===null||K===e)&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===e)break e;for(;K.sibling===null;){if(K.return===null||K.return===e)break e;W===K&&(W=null),K=K.return}W===K&&(W=null),K.sibling.return=K.return,K=K.sibling}}break;case 19:qn(t,e),nr(e),l&4&&Zh(e);break;case 21:break;default:qn(t,e),nr(e)}}function nr(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(Yh(a)){var l=a;break e}a=a.return}throw Error(s(160))}switch(l.tag){case 5:var c=l.stateNode;l.flags&32&&(xs(c,""),l.flags&=-33);var f=Jh(e);yc(e,f,c);break;case 3:case 4:var v=l.stateNode.containerInfo,b=Jh(e);gc(e,b,v);break;default:throw Error(s(161))}}catch(R){bt(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fv(e,t,a){re=e,tp(e)}function tp(e,t,a){for(var l=(e.mode&1)!==0;re!==null;){var c=re,f=c.child;if(c.tag===22&&l){var v=c.memoizedState!==null||no;if(!v){var b=c.alternate,R=b!==null&&b.memoizedState!==null||Gt;b=no;var F=Gt;if(no=v,(Gt=R)&&!F)for(re=c;re!==null;)v=re,R=v.child,v.tag===22&&v.memoizedState!==null?sp(c):R!==null?(R.return=v,re=R):sp(c);for(;f!==null;)re=f,tp(f),f=f.sibling;re=c,no=b,Gt=F}np(e)}else(c.subtreeFlags&8772)!==0&&f!==null?(f.return=c,re=f):np(e)}}function np(e){for(;re!==null;){var t=re;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Gt||ro(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!Gt)if(a===null)l.componentDidMount();else{var c=t.elementType===t.type?a.memoizedProps:Un(t.type,a.memoizedProps);l.componentDidUpdate(c,a.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var f=t.updateQueue;f!==null&&rh(t,f,l);break;case 3:var v=t.updateQueue;if(v!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}rh(t,v,a)}break;case 5:var b=t.stateNode;if(a===null&&t.flags&4){a=b;var R=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&a.focus();break;case"img":R.src&&(a.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var F=t.alternate;if(F!==null){var W=F.memoizedState;if(W!==null){var K=W.dehydrated;K!==null&&mi(K)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Gt||t.flags&512&&mc(t)}catch(H){bt(t,t.return,H)}}if(t===e){re=null;break}if(a=t.sibling,a!==null){a.return=t.return,re=a;break}re=t.return}}function rp(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var a=t.sibling;if(a!==null){a.return=t.return,re=a;break}re=t.return}}function sp(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{ro(4,t)}catch(R){bt(t,a,R)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var c=t.return;try{l.componentDidMount()}catch(R){bt(t,c,R)}}var f=t.return;try{mc(t)}catch(R){bt(t,f,R)}break;case 5:var v=t.return;try{mc(t)}catch(R){bt(t,v,R)}}}catch(R){bt(t,t.return,R)}if(t===e){re=null;break}var b=t.sibling;if(b!==null){b.return=t.return,re=b;break}re=t.return}}var Iv=Math.ceil,so=Q.ReactCurrentDispatcher,vc=Q.ReactCurrentOwner,Pn=Q.ReactCurrentBatchConfig,Ge=0,Ut=null,Pt=null,Qt=0,wn=0,Ta=Ur(0),_t=0,Ii=null,_s=0,ao=0,xc=0,zi=null,cn=null,wc=0,La=1/0,vr=null,io=!1,kc=null,Vr=null,lo=!1,Wr=null,oo=0,Ui=0,jc=null,uo=-1,co=0;function Xt(){return(Ge&6)!==0?Ze():uo!==-1?uo:uo=Ze()}function Kr(e){return(e.mode&1)===0?1:(Ge&2)!==0&&Qt!==0?Qt&-Qt:kv.transition!==null?(co===0&&(co=Yd()),co):(e=rt,e!==0||(e=window.event,e=e===void 0?16:af(e.type)),e)}function Bn(e,t,a,l){if(50<Ui)throw Ui=0,jc=null,Error(s(185));ci(e,a,l),((Ge&2)===0||e!==Ut)&&(e===Ut&&((Ge&2)===0&&(ao|=a),_t===4&&Gr(e,Qt)),dn(e,l),a===1&&Ge===0&&(t.mode&1)===0&&(La=Ze()+500,Il&&qr()))}function dn(e,t){var a=e.callbackNode;ky(e,t);var l=xl(e,e===Ut?Qt:0);if(l===0)a!==null&&it(a),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(a!=null&&it(a),t===1)e.tag===0?wv(ip.bind(null,e)):Qf(ip.bind(null,e)),gv(function(){(Ge&6)===0&&qr()}),a=null;else{switch(Jd(l)){case 1:a=Ss;break;case 4:a=Lr;break;case 16:a=Sn;break;case 536870912:a=Cs;break;default:a=Sn}a=pp(a,ap.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function ap(e,t){if(uo=-1,co=0,(Ge&6)!==0)throw Error(s(327));var a=e.callbackNode;if(Ma()&&e.callbackNode!==a)return null;var l=xl(e,e===Ut?Qt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=fo(e,l);else{t=l;var c=Ge;Ge|=2;var f=op();(Ut!==e||Qt!==t)&&(vr=null,La=Ze()+500,Ds(e,t));do try{$v();break}catch(b){lp(e,b)}while(!0);Uu(),so.current=f,Ge=c,Pt!==null?t=0:(Ut=null,Qt=0,t=_t)}if(t!==0){if(t===2&&(c=nu(e),c!==0&&(l=c,t=bc(e,c))),t===1)throw a=Ii,Ds(e,0),Gr(e,l),dn(e,Ze()),a;if(t===6)Gr(e,l);else{if(c=e.current.alternate,(l&30)===0&&!zv(c)&&(t=fo(e,l),t===2&&(f=nu(e),f!==0&&(l=f,t=bc(e,f))),t===1))throw a=Ii,Ds(e,0),Gr(e,l),dn(e,Ze()),a;switch(e.finishedWork=c,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:Os(e,cn,vr);break;case 3:if(Gr(e,l),(l&130023424)===l&&(t=wc+500-Ze(),10<t)){if(xl(e,0)!==0)break;if(c=e.suspendedLanes,(c&l)!==l){Xt(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=Pu(Os.bind(null,e,cn,vr),t);break}Os(e,cn,vr);break;case 4:if(Gr(e,l),(l&4194240)===l)break;for(t=e.eventTimes,c=-1;0<l;){var v=31-Lt(l);f=1<<v,v=t[v],v>c&&(c=v),l&=~f}if(l=c,l=Ze()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Iv(l/1960))-l,10<l){e.timeoutHandle=Pu(Os.bind(null,e,cn,vr),l);break}Os(e,cn,vr);break;case 5:Os(e,cn,vr);break;default:throw Error(s(329))}}}return dn(e,Ze()),e.callbackNode===a?ap.bind(null,e):null}function bc(e,t){var a=zi;return e.current.memoizedState.isDehydrated&&(Ds(e,t).flags|=256),e=fo(e,t),e!==2&&(t=cn,cn=a,t!==null&&Sc(t)),e}function Sc(e){cn===null?cn=e:cn.push.apply(cn,e)}function zv(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var l=0;l<a.length;l++){var c=a[l],f=c.getSnapshot;c=c.value;try{if(!In(f(),c))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Gr(e,t){for(t&=~xc,t&=~ao,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Lt(t),l=1<<a;e[a]=-1,t&=~l}}function ip(e){if((Ge&6)!==0)throw Error(s(327));Ma();var t=xl(e,0);if((t&1)===0)return dn(e,Ze()),null;var a=fo(e,t);if(e.tag!==0&&a===2){var l=nu(e);l!==0&&(t=l,a=bc(e,l))}if(a===1)throw a=Ii,Ds(e,0),Gr(e,t),dn(e,Ze()),a;if(a===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Os(e,cn,vr),dn(e,Ze()),null}function Cc(e,t){var a=Ge;Ge|=1;try{return e(t)}finally{Ge=a,Ge===0&&(La=Ze()+500,Il&&qr())}}function As(e){Wr!==null&&Wr.tag===0&&(Ge&6)===0&&Ma();var t=Ge;Ge|=1;var a=Pn.transition,l=rt;try{if(Pn.transition=null,rt=1,e)return e()}finally{rt=l,Pn.transition=a,Ge=t,(Ge&6)===0&&qr()}}function Nc(){wn=Ta.current,ht(Ta)}function Ds(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,mv(a)),Pt!==null)for(a=Pt.return;a!==null;){var l=a;switch(Du(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Ol();break;case 3:Ea(),ht(ln),ht(Vt),Ku();break;case 5:Vu(l);break;case 4:Ea();break;case 13:ht(vt);break;case 19:ht(vt);break;case 10:$u(l.type._context);break;case 22:case 23:Nc()}a=a.return}if(Ut=e,Pt=e=Yr(e.current,null),Qt=wn=t,_t=0,Ii=null,xc=ao=_s=0,cn=zi=null,Ts!==null){for(t=0;t<Ts.length;t++)if(a=Ts[t],l=a.interleaved,l!==null){a.interleaved=null;var c=l.next,f=a.pending;if(f!==null){var v=f.next;f.next=c,l.next=v}a.pending=l}Ts=null}return e}function lp(e,t){do{var a=Pt;try{if(Uu(),Kl.current=Xl,Gl){for(var l=xt.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}Gl=!1}if(Ms=0,zt=Mt=xt=null,Mi=!1,_i=0,vc.current=null,a===null||a.return===null){_t=1,Ii=t,Pt=null;break}e:{var f=e,v=a.return,b=a,R=t;if(t=Qt,b.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var F=R,W=b,K=W.tag;if((W.mode&1)===0&&(K===0||K===11||K===15)){var H=W.alternate;H?(W.updateQueue=H.updateQueue,W.memoizedState=H.memoizedState,W.lanes=H.lanes):(W.updateQueue=null,W.memoizedState=null)}var te=Mh(v);if(te!==null){te.flags&=-257,_h(te,v,b,f,t),te.mode&1&&Lh(f,F,t),t=te,R=F;var ae=t.updateQueue;if(ae===null){var ue=new Set;ue.add(R),t.updateQueue=ue}else ae.add(R);break e}else{if((t&1)===0){Lh(f,F,t),Ec();break e}R=Error(s(426))}}else if(gt&&b.mode&1){var Et=Mh(v);if(Et!==null){(Et.flags&65536)===0&&(Et.flags|=256),_h(Et,v,b,f,t),Iu(Ra(R,b));break e}}f=R=Ra(R,b),_t!==4&&(_t=2),zi===null?zi=[f]:zi.push(f),f=v;do{switch(f.tag){case 3:f.flags|=65536,t&=-t,f.lanes|=t;var D=Ph(f,R,t);nh(f,D);break e;case 1:b=R;var P=f.type,O=f.stateNode;if((f.flags&128)===0&&(typeof P.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Vr===null||!Vr.has(O)))){f.flags|=65536,t&=-t,f.lanes|=t;var Y=Th(f,b,t);nh(f,Y);break e}}f=f.return}while(f!==null)}cp(a)}catch(he){t=he,Pt===a&&a!==null&&(Pt=a=a.return);continue}break}while(!0)}function op(){var e=so.current;return so.current=Xl,e===null?Xl:e}function Ec(){(_t===0||_t===3||_t===2)&&(_t=4),Ut===null||(_s&268435455)===0&&(ao&268435455)===0||Gr(Ut,Qt)}function fo(e,t){var a=Ge;Ge|=2;var l=op();(Ut!==e||Qt!==t)&&(vr=null,Ds(e,t));do try{Uv();break}catch(c){lp(e,c)}while(!0);if(Uu(),Ge=a,so.current=l,Pt!==null)throw Error(s(261));return Ut=null,Qt=0,_t}function Uv(){for(;Pt!==null;)up(Pt)}function $v(){for(;Pt!==null&&!cr();)up(Pt)}function up(e){var t=hp(e.alternate,e,wn);e.memoizedProps=e.pendingProps,t===null?cp(e):Pt=t,vc.current=null}function cp(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=_v(a,t,wn),a!==null){Pt=a;return}}else{if(a=Av(a,t),a!==null){a.flags&=32767,Pt=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{_t=6,Pt=null;return}}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);_t===0&&(_t=5)}function Os(e,t,a){var l=rt,c=Pn.transition;try{Pn.transition=null,rt=1,qv(e,t,a,l)}finally{Pn.transition=c,rt=l}return null}function qv(e,t,a,l){do Ma();while(Wr!==null);if((Ge&6)!==0)throw Error(s(327));a=e.finishedWork;var c=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var f=a.lanes|a.childLanes;if(jy(e,f),e===Ut&&(Pt=Ut=null,Qt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||lo||(lo=!0,pp(Sn,function(){return Ma(),null})),f=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||f){f=Pn.transition,Pn.transition=null;var v=rt;rt=1;var b=Ge;Ge|=4,vc.current=null,Ov(e,a),ep(a,e),ov(Eu),jl=!!Nu,Eu=Nu=null,e.current=a,Fv(a),bs(),Ge=b,rt=v,Pn.transition=f}else e.current=a;if(lo&&(lo=!1,Wr=e,oo=c),f=e.pendingLanes,f===0&&(Vr=null),Mr(a.stateNode),dn(e,Ze()),t!==null)for(l=e.onRecoverableError,a=0;a<t.length;a++)c=t[a],l(c.value,{componentStack:c.stack,digest:c.digest});if(io)throw io=!1,e=kc,kc=null,e;return(oo&1)!==0&&e.tag!==0&&Ma(),f=e.pendingLanes,(f&1)!==0?e===jc?Ui++:(Ui=0,jc=e):Ui=0,qr(),null}function Ma(){if(Wr!==null){var e=Jd(oo),t=Pn.transition,a=rt;try{if(Pn.transition=null,rt=16>e?16:e,Wr===null)var l=!1;else{if(e=Wr,Wr=null,oo=0,(Ge&6)!==0)throw Error(s(331));var c=Ge;for(Ge|=4,re=e.current;re!==null;){var f=re,v=f.child;if((re.flags&16)!==0){var b=f.deletions;if(b!==null){for(var R=0;R<b.length;R++){var F=b[R];for(re=F;re!==null;){var W=re;switch(W.tag){case 0:case 11:case 15:Fi(8,W,f)}var K=W.child;if(K!==null)K.return=W,re=K;else for(;re!==null;){W=re;var H=W.sibling,te=W.return;if(Gh(W),W===F){re=null;break}if(H!==null){H.return=te,re=H;break}re=te}}}var ae=f.alternate;if(ae!==null){var ue=ae.child;if(ue!==null){ae.child=null;do{var Et=ue.sibling;ue.sibling=null,ue=Et}while(ue!==null)}}re=f}}if((f.subtreeFlags&2064)!==0&&v!==null)v.return=f,re=v;else e:for(;re!==null;){if(f=re,(f.flags&2048)!==0)switch(f.tag){case 0:case 11:case 15:Fi(9,f,f.return)}var D=f.sibling;if(D!==null){D.return=f.return,re=D;break e}re=f.return}}var P=e.current;for(re=P;re!==null;){v=re;var O=v.child;if((v.subtreeFlags&2064)!==0&&O!==null)O.return=v,re=O;else e:for(v=P;re!==null;){if(b=re,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:ro(9,b)}}catch(he){bt(b,b.return,he)}if(b===v){re=null;break e}var Y=b.sibling;if(Y!==null){Y.return=b.return,re=Y;break e}re=b.return}}if(Ge=c,qr(),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Ue,e)}catch{}l=!0}return l}finally{rt=a,Pn.transition=t}}return!1}function dp(e,t,a){t=Ra(a,t),t=Ph(e,t,1),e=Hr(e,t,1),t=Xt(),e!==null&&(ci(e,1,t),dn(e,t))}function bt(e,t,a){if(e.tag===3)dp(e,e,a);else for(;t!==null;){if(t.tag===3){dp(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Vr===null||!Vr.has(l))){e=Ra(a,e),e=Th(t,e,1),t=Hr(t,e,1),e=Xt(),t!==null&&(ci(t,1,e),dn(t,e));break}}t=t.return}}function Bv(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),t=Xt(),e.pingedLanes|=e.suspendedLanes&a,Ut===e&&(Qt&a)===a&&(_t===4||_t===3&&(Qt&130023424)===Qt&&500>Ze()-wc?Ds(e,0):xc|=a),dn(e,t)}function fp(e,t){t===0&&((e.mode&1)===0?t=1:(t=vl,vl<<=1,(vl&130023424)===0&&(vl=4194304)));var a=Xt();e=mr(e,t),e!==null&&(ci(e,t,a),dn(e,a))}function Hv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),fp(e,a)}function Qv(e,t){var a=0;switch(e.tag){case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),fp(e,a)}var hp;hp=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||ln.current)un=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return un=!1,Mv(e,t,a);un=(e.flags&131072)!==0}else un=!1,gt&&(t.flags&1048576)!==0&&Vf(t,Ul,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;to(e,t),e=t.pendingProps;var c=wa(t,Vt.current);Na(t,a),c=Ju(null,t,l,e,c,a);var f=Xu();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(l)?(f=!0,Fl(t)):f=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Hu(t),c.updater=Zl,t.stateNode=c,c._reactInternals=t,sc(t,l,e,a),t=oc(null,t,l,!0,f,a)):(t.tag=0,gt&&f&&Au(t),Jt(null,t,c,a),t=t.child),t;case 16:l=t.elementType;e:{switch(to(e,t),e=t.pendingProps,c=l._init,l=c(l._payload),t.type=l,c=t.tag=Wv(l),e=Un(l,e),c){case 0:t=lc(null,t,l,e,a);break e;case 1:t=zh(null,t,l,e,a);break e;case 11:t=Ah(null,t,l,e,a);break e;case 14:t=Dh(null,t,l,Un(l.type,e),a);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),lc(e,t,l,c,a);case 1:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),zh(e,t,l,c,a);case 3:e:{if(Uh(t),e===null)throw Error(s(387));l=t.pendingProps,f=t.memoizedState,c=f.element,th(e,t),Vl(t,l,null,a);var v=t.memoizedState;if(l=v.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){c=Ra(Error(s(423)),t),t=$h(e,t,l,a,c);break e}else if(l!==c){c=Ra(Error(s(424)),t),t=$h(e,t,l,a,c);break e}else for(xn=zr(t.stateNode.containerInfo.firstChild),vn=t,gt=!0,zn=null,a=Zf(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ba(),l===c){t=yr(e,t,a);break e}Jt(e,t,l,a)}t=t.child}return t;case 5:return sh(t),e===null&&Fu(t),l=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,v=c.children,Ru(l,c)?v=null:f!==null&&Ru(l,f)&&(t.flags|=32),Ih(e,t),Jt(e,t,v,a),t.child;case 6:return e===null&&Fu(t),null;case 13:return qh(e,t,a);case 4:return Qu(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Sa(t,null,l,a):Jt(e,t,l,a),t.child;case 11:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),Ah(e,t,l,c,a);case 7:return Jt(e,t,t.pendingProps,a),t.child;case 8:return Jt(e,t,t.pendingProps.children,a),t.child;case 12:return Jt(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(l=t.type._context,c=t.pendingProps,f=t.memoizedProps,v=c.value,dt(Bl,l._currentValue),l._currentValue=v,f!==null)if(In(f.value,v)){if(f.children===c.children&&!ln.current){t=yr(e,t,a);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var b=f.dependencies;if(b!==null){v=f.child;for(var R=b.firstContext;R!==null;){if(R.context===l){if(f.tag===1){R=gr(-1,a&-a),R.tag=2;var F=f.updateQueue;if(F!==null){F=F.shared;var W=F.pending;W===null?R.next=R:(R.next=W.next,W.next=R),F.pending=R}}f.lanes|=a,R=f.alternate,R!==null&&(R.lanes|=a),qu(f.return,a,t),b.lanes|=a;break}R=R.next}}else if(f.tag===10)v=f.type===t.type?null:f.child;else if(f.tag===18){if(v=f.return,v===null)throw Error(s(341));v.lanes|=a,b=v.alternate,b!==null&&(b.lanes|=a),qu(v,a,t),v=f.sibling}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}Jt(e,t,c.children,a),t=t.child}return t;case 9:return c=t.type,l=t.pendingProps.children,Na(t,a),c=En(c),l=l(c),t.flags|=1,Jt(e,t,l,a),t.child;case 14:return l=t.type,c=Un(l,t.pendingProps),c=Un(l.type,c),Dh(e,t,l,c,a);case 15:return Oh(e,t,t.type,t.pendingProps,a);case 17:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),to(e,t),t.tag=1,on(l)?(e=!0,Fl(t)):e=!1,Na(t,a),Eh(t,l,c),sc(t,l,c,a),oc(null,t,l,!0,e,a);case 19:return Hh(e,t,a);case 22:return Fh(e,t,a)}throw Error(s(156,t.tag))};function pp(e,t){return at(e,t)}function Vv(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,a,l){return new Vv(e,t,a,l)}function Rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wv(e){if(typeof e=="function")return Rc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Je)return 11;if(e===Re)return 14}return 2}function Yr(e,t){var a=e.alternate;return a===null?(a=Tn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function ho(e,t,a,l,c,f){var v=2;if(l=e,typeof e=="function")Rc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case A:return Fs(a.children,c,f,t);case B:v=8,c|=8;break;case pe:return e=Tn(12,a,t,c|2),e.elementType=pe,e.lanes=f,e;case nt:return e=Tn(13,a,t,c),e.elementType=nt,e.lanes=f,e;case pt:return e=Tn(19,a,t,c),e.elementType=pt,e.lanes=f,e;case ye:return po(a,c,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Z:v=10;break e;case ze:v=9;break e;case Je:v=11;break e;case Re:v=14;break e;case Pe:v=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Tn(v,a,t,c),t.elementType=e,t.type=l,t.lanes=f,t}function Fs(e,t,a,l){return e=Tn(7,e,l,t),e.lanes=a,e}function po(e,t,a,l){return e=Tn(22,e,l,t),e.elementType=ye,e.lanes=a,e.stateNode={isHidden:!1},e}function Pc(e,t,a){return e=Tn(6,e,null,t),e.lanes=a,e}function Tc(e,t,a){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kv(e,t,a,l,c){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ru(0),this.expirationTimes=ru(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ru(0),this.identifierPrefix=l,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Lc(e,t,a,l,c,f,v,b,R){return e=new Kv(e,t,a,b,R),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Tn(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:l,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hu(f),e}function Gv(e,t,a){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:se,key:l==null?null:""+l,children:e,containerInfo:t,implementation:a}}function mp(e){if(!e)return $r;e=e._reactInternals;e:{if(we(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(on(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var a=e.type;if(on(a))return Bf(e,a,t)}return t}function gp(e,t,a,l,c,f,v,b,R){return e=Lc(a,l,!0,e,c,f,v,b,R),e.context=mp(null),a=e.current,l=Xt(),c=Kr(a),f=gr(l,c),f.callback=t??null,Hr(a,f,c),e.current.lanes=c,ci(e,c,l),dn(e,l),e}function mo(e,t,a,l){var c=t.current,f=Xt(),v=Kr(c);return a=mp(a),t.context===null?t.context=a:t.pendingContext=a,t=gr(f,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Hr(c,t,v),e!==null&&(Bn(e,c,v,f),Ql(e,c,v)),v}function go(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function yp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Mc(e,t){yp(e,t),(e=e.alternate)&&yp(e,t)}function Yv(){return null}var vp=typeof reportError=="function"?reportError:function(e){console.error(e)};function _c(e){this._internalRoot=e}yo.prototype.render=_c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));mo(e,t,null,null)},yo.prototype.unmount=_c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;As(function(){mo(null,e,null,null)}),t[dr]=null}};function yo(e){this._internalRoot=e}yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ef();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Or.length&&t!==0&&t<Or[a].priority;a++);Or.splice(a,0,e),a===0&&rf(e)}};function Ac(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function xp(){}function Jv(e,t,a,l,c){if(c){if(typeof l=="function"){var f=l;l=function(){var F=go(v);f.call(F)}}var v=gp(t,l,e,0,null,!1,!1,"",xp);return e._reactRootContainer=v,e[dr]=v.current,Si(e.nodeType===8?e.parentNode:e),As(),v}for(;c=e.lastChild;)e.removeChild(c);if(typeof l=="function"){var b=l;l=function(){var F=go(R);b.call(F)}}var R=Lc(e,0,!1,null,null,!1,!1,"",xp);return e._reactRootContainer=R,e[dr]=R.current,Si(e.nodeType===8?e.parentNode:e),As(function(){mo(t,R,a,l)}),R}function xo(e,t,a,l,c){var f=a._reactRootContainer;if(f){var v=f;if(typeof c=="function"){var b=c;c=function(){var R=go(v);b.call(R)}}mo(t,v,e,c)}else v=Jv(a,t,e,c,l);return go(v)}Xd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=ui(t.pendingLanes);a!==0&&(su(t,a|1),dn(t,Ze()),(Ge&6)===0&&(La=Ze()+500,qr()))}break;case 13:As(function(){var l=mr(e,1);if(l!==null){var c=Xt();Bn(l,e,1,c)}}),Mc(e,1)}},au=function(e){if(e.tag===13){var t=mr(e,134217728);if(t!==null){var a=Xt();Bn(t,e,134217728,a)}Mc(e,134217728)}},Zd=function(e){if(e.tag===13){var t=Kr(e),a=mr(e,t);if(a!==null){var l=Xt();Bn(a,e,t,l)}Mc(e,t)}},ef=function(){return rt},tf=function(e,t){var a=rt;try{return rt=e,t()}finally{rt=a}},ia=function(e,t,a){switch(t){case"input":if(Za(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=Dl(l);if(!c)throw Error(s(90));sn(l),Za(l,c)}}}break;case"textarea":Rr(e,a);break;case"select":t=a.value,t!=null&&Er(e,!!a.multiple,t,!1)}},ws=Cc,ks=As;var Xv={usingClientEntryPoint:!1,Events:[Ei,va,Dl,ml,oi,Cc]},$i={findFiberByHostInstance:Ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zv={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Q.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jt(e),e===null?null:e.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||Yv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wo.isDisabled&&wo.supportsFiber)try{Ue=wo.inject(Zv),lt=wo}catch{}}return fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xv,fn.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ac(t))throw Error(s(200));return Gv(e,t,null,a)},fn.createRoot=function(e,t){if(!Ac(e))throw Error(s(299));var a=!1,l="",c=vp;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Lc(e,1,!1,null,null,a,!1,l,c),e[dr]=t.current,Si(e.nodeType===8?e.parentNode:e),new _c(t)},fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=jt(t),e=e===null?null:e.stateNode,e},fn.flushSync=function(e){return As(e)},fn.hydrate=function(e,t,a){if(!vo(t))throw Error(s(200));return xo(null,e,t,!0,a)},fn.hydrateRoot=function(e,t,a){if(!Ac(e))throw Error(s(405));var l=a!=null&&a.hydratedSources||null,c=!1,f="",v=vp;if(a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),t=gp(t,null,e,1,a??null,c,!1,f,v),e[dr]=t.current,Si(e),l)for(e=0;e<l.length;e++)a=l[e],c=a._getVersion,c=c(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,c]:t.mutableSourceEagerHydrationData.push(a,c);return new yo(t)},fn.render=function(e,t,a){if(!vo(t))throw Error(s(200));return xo(null,e,t,!1,a)},fn.unmountComponentAtNode=function(e){if(!vo(e))throw Error(s(40));return e._reactRootContainer?(As(function(){xo(null,null,e,!1,function(){e._reactRootContainer=null,e[dr]=null})}),!0):!1},fn.unstable_batchedUpdates=Cc,fn.unstable_renderSubtreeIntoContainer=function(e,t,a,l){if(!vo(a))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return xo(e,t,a,!1,l)},fn.version="18.3.1-next-f1338f8080-20240426",fn}var Rp;function Bm(){if(Rp)return Ic.exports;Rp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Ic.exports=ux(),Ic.exports}var Pp;function cx(){if(Pp)return jo;Pp=1;var n=Bm();return jo.createRoot=n.createRoot,jo.hydrateRoot=n.hydrateRoot,jo}var dx=cx();const fx=qm(dx);var Ka=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hx={setTimeout:(n,r)=>setTimeout(n,r),clearTimeout:n=>clearTimeout(n),setInterval:(n,r)=>setInterval(n,r),clearInterval:n=>clearInterval(n)},rs,Cd,Lm,px=(Lm=class{constructor(){ke(this,rs,hx);ke(this,Cd,!1)}setTimeoutProvider(n){ee(this,rs,n)}setTimeout(n,r){return E(this,rs).setTimeout(n,r)}clearTimeout(n){E(this,rs).clearTimeout(n)}setInterval(n,r){return E(this,rs).setInterval(n,r)}clearInterval(n){E(this,rs).clearInterval(n)}},rs=new WeakMap,Cd=new WeakMap,Lm),zs=new px;function mx(n){setTimeout(n,0)}var Xs=typeof window>"u"||"Deno"in globalThis;function tn(){}function gx(n,r){return typeof n=="function"?n(r):n}function Gc(n){return typeof n=="number"&&n>=0&&n!==1/0}function Hm(n,r){return Math.max(n+(r||0)-Date.now(),0)}function hs(n,r){return typeof n=="function"?n(r):n}function _n(n,r){return typeof n=="function"?n(r):n}function Tp(n,r){const{type:s="all",exact:o,fetchStatus:u,predicate:d,queryKey:h,stale:p}=n;if(h){if(o){if(r.queryHash!==Ed(h,r.options))return!1}else if(!Xi(r.queryKey,h))return!1}if(s!=="all"){const g=r.isActive();if(s==="active"&&!g||s==="inactive"&&g)return!1}return!(typeof p=="boolean"&&r.isStale()!==p||u&&u!==r.state.fetchStatus||d&&!d(r))}function Lp(n,r){const{exact:s,status:o,predicate:u,mutationKey:d}=n;if(d){if(!r.options.mutationKey)return!1;if(s){if(Zs(r.options.mutationKey)!==Zs(d))return!1}else if(!Xi(r.options.mutationKey,d))return!1}return!(o&&r.state.status!==o||u&&!u(r))}function Ed(n,r){return((r==null?void 0:r.queryKeyHashFn)||Zs)(n)}function Zs(n){return JSON.stringify(n,(r,s)=>Yc(s)?Object.keys(s).sort().reduce((o,u)=>(o[u]=s[u],o),{}):s)}function Xi(n,r){return n===r?!0:typeof n!=typeof r?!1:n&&r&&typeof n=="object"&&typeof r=="object"?Object.keys(r).every(s=>Xi(n[s],r[s])):!1}var yx=Object.prototype.hasOwnProperty;function Qm(n,r){if(n===r)return n;const s=Mp(n)&&Mp(r);if(!s&&!(Yc(n)&&Yc(r)))return r;const u=(s?n:Object.keys(n)).length,d=s?r:Object.keys(r),h=d.length,p=s?new Array(h):{};let g=0;for(let m=0;m<h;m++){const y=s?m:d[m],w=n[y],x=r[y];if(w===x){p[y]=w,(s?m<u:yx.call(n,y))&&g++;continue}if(w===null||x===null||typeof w!="object"||typeof x!="object"){p[y]=x;continue}const j=Qm(w,x);p[y]=j,j===w&&g++}return u===h&&g===u?n:p}function Fo(n,r){if(!r||Object.keys(n).length!==Object.keys(r).length)return!1;for(const s in n)if(n[s]!==r[s])return!1;return!0}function Mp(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Yc(n){if(!_p(n))return!1;const r=n.constructor;if(r===void 0)return!0;const s=r.prototype;return!(!_p(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function _p(n){return Object.prototype.toString.call(n)==="[object Object]"}function vx(n){return new Promise(r=>{zs.setTimeout(r,n)})}function Jc(n,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,r):s.structuralSharing!==!1?Qm(n,r):r}function Ga(n){return n}function xx(n,r,s=0){const o=[...n,r];return s&&o.length>s?o.slice(1):o}function wx(n,r,s=0){const o=[r,...n];return s&&o.length>s?o.slice(0,-1):o}var Rd=Symbol();function Vm(n,r){return!n.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!n.queryFn||n.queryFn===Rd?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Wm(n,r){return typeof n=="function"?n(...r):!!n}var $s,ss,Oa,Mm,kx=(Mm=class extends Ka{constructor(){super();ke(this,$s);ke(this,ss);ke(this,Oa);ee(this,Oa,r=>{if(!Xs&&window.addEventListener){const s=()=>r();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){E(this,ss)||this.setEventListener(E(this,Oa))}onUnsubscribe(){var r;this.hasListeners()||((r=E(this,ss))==null||r.call(this),ee(this,ss,void 0))}setEventListener(r){var s;ee(this,Oa,r),(s=E(this,ss))==null||s.call(this),ee(this,ss,r(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(r){E(this,$s)!==r&&(ee(this,$s,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(s=>{s(r)})}isFocused(){var r;return typeof E(this,$s)=="boolean"?E(this,$s):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},$s=new WeakMap,ss=new WeakMap,Oa=new WeakMap,Mm),Pd=new kx;function Xc(){let n,r;const s=new Promise((u,d)=>{n=u,r=d});s.status="pending",s.catch(()=>{});function o(u){Object.assign(s,u),delete s.resolve,delete s.reject}return s.resolve=u=>{o({status:"fulfilled",value:u}),n(u)},s.reject=u=>{o({status:"rejected",reason:u}),r(u)},s}var jx=mx;function bx(){let n=[],r=0,s=p=>{p()},o=p=>{p()},u=jx;const d=p=>{r?n.push(p):u(()=>{s(p)})},h=()=>{const p=n;n=[],p.length&&u(()=>{o(()=>{p.forEach(g=>{s(g)})})})};return{batch:p=>{let g;r++;try{g=p()}finally{r--,r||h()}return g},batchCalls:p=>(...g)=>{d(()=>{p(...g)})},schedule:d,setNotifyFunction:p=>{s=p},setBatchNotifyFunction:p=>{o=p},setScheduler:p=>{u=p}}}var Dt=bx(),Fa,as,Ia,_m,Sx=(_m=class extends Ka{constructor(){super();ke(this,Fa,!0);ke(this,as);ke(this,Ia);ee(this,Ia,r=>{if(!Xs&&window.addEventListener){const s=()=>r(!0),o=()=>r(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}})}onSubscribe(){E(this,as)||this.setEventListener(E(this,Ia))}onUnsubscribe(){var r;this.hasListeners()||((r=E(this,as))==null||r.call(this),ee(this,as,void 0))}setEventListener(r){var s;ee(this,Ia,r),(s=E(this,as))==null||s.call(this),ee(this,as,r(this.setOnline.bind(this)))}setOnline(r){E(this,Fa)!==r&&(ee(this,Fa,r),this.listeners.forEach(o=>{o(r)}))}isOnline(){return E(this,Fa)}},Fa=new WeakMap,as=new WeakMap,Ia=new WeakMap,_m),Io=new Sx;function Cx(n){return Math.min(1e3*2**n,3e4)}function Km(n){return(n??"online")==="online"?Io.isOnline():!0}var Zc=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function Gm(n){let r=!1,s=0,o;const u=Xc(),d=()=>u.status!=="pending",h=N=>{var S;if(!d()){const L=new Zc(N);x(L),(S=n.onCancel)==null||S.call(n,L)}},p=()=>{r=!0},g=()=>{r=!1},m=()=>Pd.isFocused()&&(n.networkMode==="always"||Io.isOnline())&&n.canRun(),y=()=>Km(n.networkMode)&&n.canRun(),w=N=>{d()||(o==null||o(),u.resolve(N))},x=N=>{d()||(o==null||o(),u.reject(N))},j=()=>new Promise(N=>{var S;o=L=>{(d()||m())&&N(L)},(S=n.onPause)==null||S.call(n)}).then(()=>{var N;o=void 0,d()||(N=n.onContinue)==null||N.call(n)}),T=()=>{if(d())return;let N;const S=s===0?n.initialPromise:void 0;try{N=S??n.fn()}catch(L){N=Promise.reject(L)}Promise.resolve(N).then(w).catch(L=>{var se;if(d())return;const z=n.retry??(Xs?0:3),$=n.retryDelay??Cx,Q=typeof $=="function"?$(s,L):$,X=z===!0||typeof z=="number"&&s<z||typeof z=="function"&&z(s,L);if(r||!X){x(L);return}s++,(se=n.onFail)==null||se.call(n,s,L),vx(Q).then(()=>m()?void 0:j()).then(()=>{r?x(L):T()})})};return{promise:u,status:()=>u.status,cancel:h,continue:()=>(o==null||o(),u),cancelRetry:p,continueRetry:g,canStart:y,start:()=>(y()?T():j().then(T),u)}}var qs,Am,Ym=(Am=class{constructor(){ke(this,qs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gc(this.gcTime)&&ee(this,qs,zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Xs?1/0:300*1e3))}clearGcTimeout(){E(this,qs)&&(zs.clearTimeout(E(this,qs)),ee(this,qs,void 0))}},qs=new WeakMap,Am),Bs,za,Ln,Hs,qt,sl,Qs,Hn,wr,Dm,Nx=(Dm=class extends Ym{constructor(r){super();ke(this,Hn);ke(this,Bs);ke(this,za);ke(this,Ln);ke(this,Hs);ke(this,qt);ke(this,sl);ke(this,Qs);ee(this,Qs,!1),ee(this,sl,r.defaultOptions),this.setOptions(r.options),this.observers=[],ee(this,Hs,r.client),ee(this,Ln,E(this,Hs).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,ee(this,Bs,Dp(this.options)),this.state=r.state??E(this,Bs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=E(this,qt))==null?void 0:r.promise}setOptions(r){if(this.options={...E(this,sl),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Dp(this.options);s.data!==void 0&&(this.setState(Ap(s.data,s.dataUpdatedAt)),ee(this,Bs,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Ln).remove(this)}setData(r,s){const o=Jc(this.state.data,r,this.options);return De(this,Hn,wr).call(this,{data:o,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),o}setState(r,s){De(this,Hn,wr).call(this,{type:"setState",state:r,setStateOptions:s})}cancel(r){var o,u;const s=(o=E(this,qt))==null?void 0:o.promise;return(u=E(this,qt))==null||u.cancel(r),s?s.then(tn).catch(tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,Bs))}isActive(){return this.observers.some(r=>_n(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>hs(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!Hm(this.state.dataUpdatedAt,r)}onFocus(){var s;const r=this.observers.find(o=>o.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(s=E(this,qt))==null||s.continue()}onOnline(){var s;const r=this.observers.find(o=>o.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(s=E(this,qt))==null||s.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),E(this,Ln).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(s=>s!==r),this.observers.length||(E(this,qt)&&(E(this,Qs)?E(this,qt).cancel({revert:!0}):E(this,qt).cancelRetry()),this.scheduleGc()),E(this,Ln).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,Hn,wr).call(this,{type:"invalidate"})}async fetch(r,s){var g,m,y,w,x,j,T,N,S,L,z,$;if(this.state.fetchStatus!=="idle"&&((g=E(this,qt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(E(this,qt))return E(this,qt).continueRetry(),E(this,qt).promise}if(r&&this.setOptions(r),!this.options.queryFn){const Q=this.observers.find(X=>X.options.queryFn);Q&&this.setOptions(Q.options)}const o=new AbortController,u=Q=>{Object.defineProperty(Q,"signal",{enumerable:!0,get:()=>(ee(this,Qs,!0),o.signal)})},d=()=>{const Q=Vm(this.options,s),se=(()=>{const A={client:E(this,Hs),queryKey:this.queryKey,meta:this.meta};return u(A),A})();return ee(this,Qs,!1),this.options.persister?this.options.persister(Q,se,this):Q(se)},p=(()=>{const Q={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:E(this,Hs),state:this.state,fetchFn:d};return u(Q),Q})();(m=this.options.behavior)==null||m.onFetch(p,this),ee(this,za,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=p.fetchOptions)==null?void 0:y.meta))&&De(this,Hn,wr).call(this,{type:"fetch",meta:(w=p.fetchOptions)==null?void 0:w.meta}),ee(this,qt,Gm({initialPromise:s==null?void 0:s.initialPromise,fn:p.fetchFn,onCancel:Q=>{Q instanceof Zc&&Q.revert&&this.setState({...E(this,za),fetchStatus:"idle"}),o.abort()},onFail:(Q,X)=>{De(this,Hn,wr).call(this,{type:"failed",failureCount:Q,error:X})},onPause:()=>{De(this,Hn,wr).call(this,{type:"pause"})},onContinue:()=>{De(this,Hn,wr).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const Q=await E(this,qt).start();if(Q===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(Q),(j=(x=E(this,Ln).config).onSuccess)==null||j.call(x,Q,this),(N=(T=E(this,Ln).config).onSettled)==null||N.call(T,Q,this.state.error,this),Q}catch(Q){if(Q instanceof Zc){if(Q.silent)return E(this,qt).promise;if(Q.revert){if(this.state.data===void 0)throw Q;return this.state.data}}throw De(this,Hn,wr).call(this,{type:"error",error:Q}),(L=(S=E(this,Ln).config).onError)==null||L.call(S,Q,this),($=(z=E(this,Ln).config).onSettled)==null||$.call(z,this.state.data,Q,this),Q}finally{this.scheduleGc()}}},Bs=new WeakMap,za=new WeakMap,Ln=new WeakMap,Hs=new WeakMap,qt=new WeakMap,sl=new WeakMap,Qs=new WeakMap,Hn=new WeakSet,wr=function(r){const s=o=>{switch(r.type){case"failed":return{...o,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Jm(o.data,this.options),fetchMeta:r.meta??null};case"success":const u={...o,...Ap(r.data,r.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,za,r.manual?u:void 0),u;case"error":const d=r.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...r.state}}};this.state=s(this.state),Dt.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),E(this,Ln).notify({query:this,type:"updated",action:r})})},Dm);function Jm(n,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Km(r.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Ap(n,r){return{data:n,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dp(n){const r=typeof n.initialData=="function"?n.initialData():n.initialData,s=r!==void 0,o=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var hn,Ve,al,Zt,Vs,Ua,jr,is,il,$a,qa,Ws,Ks,ls,Ba,et,Gi,ed,td,nd,rd,sd,ad,id,Xm,Om,Ex=(Om=class extends Ka{constructor(r,s){super();ke(this,et);ke(this,hn);ke(this,Ve);ke(this,al);ke(this,Zt);ke(this,Vs);ke(this,Ua);ke(this,jr);ke(this,is);ke(this,il);ke(this,$a);ke(this,qa);ke(this,Ws);ke(this,Ks);ke(this,ls);ke(this,Ba,new Set);this.options=s,ee(this,hn,r),ee(this,is,null),ee(this,jr,Xc()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Ve).addObserver(this),Op(E(this,Ve),this.options)?De(this,et,Gi).call(this):this.updateResult(),De(this,et,rd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ld(E(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ld(E(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,et,sd).call(this),De(this,et,ad).call(this),E(this,Ve).removeObserver(this)}setOptions(r){const s=this.options,o=E(this,Ve);if(this.options=E(this,hn).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _n(this.options.enabled,E(this,Ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,et,id).call(this),E(this,Ve).setOptions(this.options),s._defaulted&&!Fo(this.options,s)&&E(this,hn).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Ve),observer:this});const u=this.hasListeners();u&&Fp(E(this,Ve),o,this.options,s)&&De(this,et,Gi).call(this),this.updateResult(),u&&(E(this,Ve)!==o||_n(this.options.enabled,E(this,Ve))!==_n(s.enabled,E(this,Ve))||hs(this.options.staleTime,E(this,Ve))!==hs(s.staleTime,E(this,Ve)))&&De(this,et,ed).call(this);const d=De(this,et,td).call(this);u&&(E(this,Ve)!==o||_n(this.options.enabled,E(this,Ve))!==_n(s.enabled,E(this,Ve))||d!==E(this,ls))&&De(this,et,nd).call(this,d)}getOptimisticResult(r){const s=E(this,hn).getQueryCache().build(E(this,hn),r),o=this.createResult(s,r);return Px(this,o)&&(ee(this,Zt,o),ee(this,Ua,this.options),ee(this,Vs,E(this,Ve).state)),o}getCurrentResult(){return E(this,Zt)}trackResult(r,s){return new Proxy(r,{get:(o,u)=>(this.trackProp(u),s==null||s(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&E(this,jr).status==="pending"&&E(this,jr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,u))})}trackProp(r){E(this,Ba).add(r)}getCurrentQuery(){return E(this,Ve)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const s=E(this,hn).defaultQueryOptions(r),o=E(this,hn).getQueryCache().build(E(this,hn),s);return o.fetch().then(()=>this.createResult(o,s))}fetch(r){return De(this,et,Gi).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Zt)))}createResult(r,s){var pe;const o=E(this,Ve),u=this.options,d=E(this,Zt),h=E(this,Vs),p=E(this,Ua),m=r!==o?r.state:E(this,al),{state:y}=r;let w={...y},x=!1,j;if(s._optimisticResults){const Z=this.hasListeners(),ze=!Z&&Op(r,s),Je=Z&&Fp(r,o,s,u);(ze||Je)&&(w={...w,...Jm(y.data,r.options)}),s._optimisticResults==="isRestoring"&&(w.fetchStatus="idle")}let{error:T,errorUpdatedAt:N,status:S}=w;j=w.data;let L=!1;if(s.placeholderData!==void 0&&j===void 0&&S==="pending"){let Z;d!=null&&d.isPlaceholderData&&s.placeholderData===(p==null?void 0:p.placeholderData)?(Z=d.data,L=!0):Z=typeof s.placeholderData=="function"?s.placeholderData((pe=E(this,qa))==null?void 0:pe.state.data,E(this,qa)):s.placeholderData,Z!==void 0&&(S="success",j=Jc(d==null?void 0:d.data,Z,s),x=!0)}if(s.select&&j!==void 0&&!L)if(d&&j===(h==null?void 0:h.data)&&s.select===E(this,il))j=E(this,$a);else try{ee(this,il,s.select),j=s.select(j),j=Jc(d==null?void 0:d.data,j,s),ee(this,$a,j),ee(this,is,null)}catch(Z){ee(this,is,Z)}E(this,is)&&(T=E(this,is),j=E(this,$a),N=Date.now(),S="error");const z=w.fetchStatus==="fetching",$=S==="pending",Q=S==="error",X=$&&z,se=j!==void 0,B={status:S,fetchStatus:w.fetchStatus,isPending:$,isSuccess:S==="success",isError:Q,isInitialLoading:X,isLoading:X,data:j,dataUpdatedAt:w.dataUpdatedAt,error:T,errorUpdatedAt:N,failureCount:w.fetchFailureCount,failureReason:w.fetchFailureReason,errorUpdateCount:w.errorUpdateCount,isFetched:w.dataUpdateCount>0||w.errorUpdateCount>0,isFetchedAfterMount:w.dataUpdateCount>m.dataUpdateCount||w.errorUpdateCount>m.errorUpdateCount,isFetching:z,isRefetching:z&&!$,isLoadingError:Q&&!se,isPaused:w.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:Q&&se,isStale:Td(r,s),refetch:this.refetch,promise:E(this,jr),isEnabled:_n(s.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const Z=nt=>{B.status==="error"?nt.reject(B.error):B.data!==void 0&&nt.resolve(B.data)},ze=()=>{const nt=ee(this,jr,B.promise=Xc());Z(nt)},Je=E(this,jr);switch(Je.status){case"pending":r.queryHash===o.queryHash&&Z(Je);break;case"fulfilled":(B.status==="error"||B.data!==Je.value)&&ze();break;case"rejected":(B.status!=="error"||B.error!==Je.reason)&&ze();break}}return B}updateResult(){const r=E(this,Zt),s=this.createResult(E(this,Ve),this.options);if(ee(this,Vs,E(this,Ve).state),ee(this,Ua,this.options),E(this,Vs).data!==void 0&&ee(this,qa,E(this,Ve)),Fo(s,r))return;ee(this,Zt,s);const o=()=>{if(!r)return!0;const{notifyOnChangeProps:u}=this.options,d=typeof u=="function"?u():u;if(d==="all"||!d&&!E(this,Ba).size)return!0;const h=new Set(d??E(this,Ba));return this.options.throwOnError&&h.add("error"),Object.keys(E(this,Zt)).some(p=>{const g=p;return E(this,Zt)[g]!==r[g]&&h.has(g)})};De(this,et,Xm).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,et,rd).call(this)}},hn=new WeakMap,Ve=new WeakMap,al=new WeakMap,Zt=new WeakMap,Vs=new WeakMap,Ua=new WeakMap,jr=new WeakMap,is=new WeakMap,il=new WeakMap,$a=new WeakMap,qa=new WeakMap,Ws=new WeakMap,Ks=new WeakMap,ls=new WeakMap,Ba=new WeakMap,et=new WeakSet,Gi=function(r){De(this,et,id).call(this);let s=E(this,Ve).fetch(this.options,r);return r!=null&&r.throwOnError||(s=s.catch(tn)),s},ed=function(){De(this,et,sd).call(this);const r=hs(this.options.staleTime,E(this,Ve));if(Xs||E(this,Zt).isStale||!Gc(r))return;const o=Hm(E(this,Zt).dataUpdatedAt,r)+1;ee(this,Ws,zs.setTimeout(()=>{E(this,Zt).isStale||this.updateResult()},o))},td=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Ve)):this.options.refetchInterval)??!1},nd=function(r){De(this,et,ad).call(this),ee(this,ls,r),!(Xs||_n(this.options.enabled,E(this,Ve))===!1||!Gc(E(this,ls))||E(this,ls)===0)&&ee(this,Ks,zs.setInterval(()=>{(this.options.refetchIntervalInBackground||Pd.isFocused())&&De(this,et,Gi).call(this)},E(this,ls)))},rd=function(){De(this,et,ed).call(this),De(this,et,nd).call(this,De(this,et,td).call(this))},sd=function(){E(this,Ws)&&(zs.clearTimeout(E(this,Ws)),ee(this,Ws,void 0))},ad=function(){E(this,Ks)&&(zs.clearInterval(E(this,Ks)),ee(this,Ks,void 0))},id=function(){const r=E(this,hn).getQueryCache().build(E(this,hn),this.options);if(r===E(this,Ve))return;const s=E(this,Ve);ee(this,Ve,r),ee(this,al,r.state),this.hasListeners()&&(s==null||s.removeObserver(this),r.addObserver(this))},Xm=function(r){Dt.batch(()=>{r.listeners&&this.listeners.forEach(s=>{s(E(this,Zt))}),E(this,hn).getQueryCache().notify({query:E(this,Ve),type:"observerResultsUpdated"})})},Om);function Rx(n,r){return _n(r.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&r.retryOnMount===!1)}function Op(n,r){return Rx(n,r)||n.state.data!==void 0&&ld(n,r,r.refetchOnMount)}function ld(n,r,s){if(_n(r.enabled,n)!==!1&&hs(r.staleTime,n)!=="static"){const o=typeof s=="function"?s(n):s;return o==="always"||o!==!1&&Td(n,r)}return!1}function Fp(n,r,s,o){return(n!==r||_n(o.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&Td(n,s)}function Td(n,r){return _n(r.enabled,n)!==!1&&n.isStaleByTime(hs(r.staleTime,n))}function Px(n,r){return!Fo(n.getCurrentResult(),r)}function Ip(n){return{onFetch:(r,s)=>{var y,w,x,j,T;const o=r.options,u=(x=(w=(y=r.fetchOptions)==null?void 0:y.meta)==null?void 0:w.fetchMore)==null?void 0:x.direction,d=((j=r.state.data)==null?void 0:j.pages)||[],h=((T=r.state.data)==null?void 0:T.pageParams)||[];let p={pages:[],pageParams:[]},g=0;const m=async()=>{let N=!1;const S=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(r.signal.aborted?N=!0:r.signal.addEventListener("abort",()=>{N=!0}),r.signal)})},L=Vm(r.options,r.fetchOptions),z=async($,Q,X)=>{if(N)return Promise.reject();if(Q==null&&$.pages.length)return Promise.resolve($);const A=(()=>{const ze={client:r.client,queryKey:r.queryKey,pageParam:Q,direction:X?"backward":"forward",meta:r.options.meta};return S(ze),ze})(),B=await L(A),{maxPages:pe}=r.options,Z=X?wx:xx;return{pages:Z($.pages,B,pe),pageParams:Z($.pageParams,Q,pe)}};if(u&&d.length){const $=u==="backward",Q=$?Tx:zp,X={pages:d,pageParams:h},se=Q(o,X);p=await z(X,se,$)}else{const $=n??d.length;do{const Q=g===0?h[0]??o.initialPageParam:zp(o,p);if(g>0&&Q==null)break;p=await z(p,Q),g++}while(g<$)}return p};r.options.persister?r.fetchFn=()=>{var N,S;return(S=(N=r.options).persister)==null?void 0:S.call(N,m,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s)}:r.fetchFn=m}}}function zp(n,{pages:r,pageParams:s}){const o=r.length-1;return r.length>0?n.getNextPageParam(r[o],r,s[o],s):void 0}function Tx(n,{pages:r,pageParams:s}){var o;return r.length>0?(o=n.getPreviousPageParam)==null?void 0:o.call(n,r[0],r,s[0],s):void 0}var ll,sr,en,Gs,ar,es,Fm,Lx=(Fm=class extends Ym{constructor(r){super();ke(this,ar);ke(this,ll);ke(this,sr);ke(this,en);ke(this,Gs);ee(this,ll,r.client),this.mutationId=r.mutationId,ee(this,en,r.mutationCache),ee(this,sr,[]),this.state=r.state||Zm(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){E(this,sr).includes(r)||(E(this,sr).push(r),this.clearGcTimeout(),E(this,en).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){ee(this,sr,E(this,sr).filter(s=>s!==r)),this.scheduleGc(),E(this,en).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){E(this,sr).length||(this.state.status==="pending"?this.scheduleGc():E(this,en).remove(this))}continue(){var r;return((r=E(this,Gs))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var h,p,g,m,y,w,x,j,T,N,S,L,z,$,Q,X,se,A,B,pe;const s=()=>{De(this,ar,es).call(this,{type:"continue"})},o={client:E(this,ll),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Gs,Gm({fn:()=>this.options.mutationFn?this.options.mutationFn(r,o):Promise.reject(new Error("No mutationFn found")),onFail:(Z,ze)=>{De(this,ar,es).call(this,{type:"failed",failureCount:Z,error:ze})},onPause:()=>{De(this,ar,es).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,en).canRun(this)}));const u=this.state.status==="pending",d=!E(this,Gs).canStart();try{if(u)s();else{De(this,ar,es).call(this,{type:"pending",variables:r,isPaused:d}),await((p=(h=E(this,en).config).onMutate)==null?void 0:p.call(h,r,this,o));const ze=await((m=(g=this.options).onMutate)==null?void 0:m.call(g,r,o));ze!==this.state.context&&De(this,ar,es).call(this,{type:"pending",context:ze,variables:r,isPaused:d})}const Z=await E(this,Gs).start();return await((w=(y=E(this,en).config).onSuccess)==null?void 0:w.call(y,Z,r,this.state.context,this,o)),await((j=(x=this.options).onSuccess)==null?void 0:j.call(x,Z,r,this.state.context,o)),await((N=(T=E(this,en).config).onSettled)==null?void 0:N.call(T,Z,null,this.state.variables,this.state.context,this,o)),await((L=(S=this.options).onSettled)==null?void 0:L.call(S,Z,null,r,this.state.context,o)),De(this,ar,es).call(this,{type:"success",data:Z}),Z}catch(Z){try{throw await(($=(z=E(this,en).config).onError)==null?void 0:$.call(z,Z,r,this.state.context,this,o)),await((X=(Q=this.options).onError)==null?void 0:X.call(Q,Z,r,this.state.context,o)),await((A=(se=E(this,en).config).onSettled)==null?void 0:A.call(se,void 0,Z,this.state.variables,this.state.context,this,o)),await((pe=(B=this.options).onSettled)==null?void 0:pe.call(B,void 0,Z,r,this.state.context,o)),Z}finally{De(this,ar,es).call(this,{type:"error",error:Z})}}finally{E(this,en).runNext(this)}}},ll=new WeakMap,sr=new WeakMap,en=new WeakMap,Gs=new WeakMap,ar=new WeakSet,es=function(r){const s=o=>{switch(r.type){case"failed":return{...o,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...o,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:r.error,failureCount:o.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Dt.batch(()=>{E(this,sr).forEach(o=>{o.onMutationUpdate(r)}),E(this,en).notify({mutation:this,type:"updated",action:r})})},Fm);function Zm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var br,Qn,ol,Im,eg=(Im=class extends Ka{constructor(r={}){super();ke(this,br);ke(this,Qn);ke(this,ol);this.config=r,ee(this,br,new Set),ee(this,Qn,new Map),ee(this,ol,0)}build(r,s,o){const u=new Lx({client:r,mutationCache:this,mutationId:++ko(this,ol)._,options:r.defaultMutationOptions(s),state:o});return this.add(u),u}add(r){E(this,br).add(r);const s=bo(r);if(typeof s=="string"){const o=E(this,Qn).get(s);o?o.push(r):E(this,Qn).set(s,[r])}this.notify({type:"added",mutation:r})}remove(r){if(E(this,br).delete(r)){const s=bo(r);if(typeof s=="string"){const o=E(this,Qn).get(s);if(o)if(o.length>1){const u=o.indexOf(r);u!==-1&&o.splice(u,1)}else o[0]===r&&E(this,Qn).delete(s)}}this.notify({type:"removed",mutation:r})}canRun(r){const s=bo(r);if(typeof s=="string"){const o=E(this,Qn).get(s),u=o==null?void 0:o.find(d=>d.state.status==="pending");return!u||u===r}else return!0}runNext(r){var o;const s=bo(r);if(typeof s=="string"){const u=(o=E(this,Qn).get(s))==null?void 0:o.find(d=>d!==r&&d.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Dt.batch(()=>{E(this,br).forEach(r=>{this.notify({type:"removed",mutation:r})}),E(this,br).clear(),E(this,Qn).clear()})}getAll(){return Array.from(E(this,br))}find(r){const s={exact:!0,...r};return this.getAll().find(o=>Lp(s,o))}findAll(r={}){return this.getAll().filter(s=>Lp(r,s))}notify(r){Dt.batch(()=>{this.listeners.forEach(s=>{s(r)})})}resumePausedMutations(){const r=this.getAll().filter(s=>s.state.isPaused);return Dt.batch(()=>Promise.all(r.map(s=>s.continue().catch(tn))))}},br=new WeakMap,Qn=new WeakMap,ol=new WeakMap,Im);function bo(n){var r;return(r=n.options.scope)==null?void 0:r.id}var Sr,os,pn,Cr,Nr,Lo,od,zm,Mx=(zm=class extends Ka{constructor(s,o){super();ke(this,Nr);ke(this,Sr);ke(this,os);ke(this,pn);ke(this,Cr);ee(this,Sr,s),this.setOptions(o),this.bindMethods(),De(this,Nr,Lo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var u;const o=this.options;this.options=E(this,Sr).defaultMutationOptions(s),Fo(this.options,o)||E(this,Sr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:E(this,pn),observer:this}),o!=null&&o.mutationKey&&this.options.mutationKey&&Zs(o.mutationKey)!==Zs(this.options.mutationKey)?this.reset():((u=E(this,pn))==null?void 0:u.state.status)==="pending"&&E(this,pn).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=E(this,pn))==null||s.removeObserver(this)}onMutationUpdate(s){De(this,Nr,Lo).call(this),De(this,Nr,od).call(this,s)}getCurrentResult(){return E(this,os)}reset(){var s;(s=E(this,pn))==null||s.removeObserver(this),ee(this,pn,void 0),De(this,Nr,Lo).call(this),De(this,Nr,od).call(this)}mutate(s,o){var u;return ee(this,Cr,o),(u=E(this,pn))==null||u.removeObserver(this),ee(this,pn,E(this,Sr).getMutationCache().build(E(this,Sr),this.options)),E(this,pn).addObserver(this),E(this,pn).execute(s)}},Sr=new WeakMap,os=new WeakMap,pn=new WeakMap,Cr=new WeakMap,Nr=new WeakSet,Lo=function(){var o;const s=((o=E(this,pn))==null?void 0:o.state)??Zm();ee(this,os,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},od=function(s){Dt.batch(()=>{var o,u,d,h,p,g,m,y;if(E(this,Cr)&&this.hasListeners()){const w=E(this,os).variables,x=E(this,os).context,j={client:E(this,Sr),meta:this.options.meta,mutationKey:this.options.mutationKey};(s==null?void 0:s.type)==="success"?((u=(o=E(this,Cr)).onSuccess)==null||u.call(o,s.data,w,x,j),(h=(d=E(this,Cr)).onSettled)==null||h.call(d,s.data,null,w,x,j)):(s==null?void 0:s.type)==="error"&&((g=(p=E(this,Cr)).onError)==null||g.call(p,s.error,w,x,j),(y=(m=E(this,Cr)).onSettled)==null||y.call(m,void 0,s.error,w,x,j))}this.listeners.forEach(w=>{w(E(this,os))})})},zm),ir,Um,_x=(Um=class extends Ka{constructor(r={}){super();ke(this,ir);this.config=r,ee(this,ir,new Map)}build(r,s,o){const u=s.queryKey,d=s.queryHash??Ed(u,s);let h=this.get(d);return h||(h=new Nx({client:r,queryKey:u,queryHash:d,options:r.defaultQueryOptions(s),state:o,defaultOptions:r.getQueryDefaults(u)}),this.add(h)),h}add(r){E(this,ir).has(r.queryHash)||(E(this,ir).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const s=E(this,ir).get(r.queryHash);s&&(r.destroy(),s===r&&E(this,ir).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){Dt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return E(this,ir).get(r)}getAll(){return[...E(this,ir).values()]}find(r){const s={exact:!0,...r};return this.getAll().find(o=>Tp(s,o))}findAll(r={}){const s=this.getAll();return Object.keys(r).length>0?s.filter(o=>Tp(r,o)):s}notify(r){Dt.batch(()=>{this.listeners.forEach(s=>{s(r)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},ir=new WeakMap,Um),St,us,cs,Ha,Qa,ds,Va,Wa,$m,Ax=($m=class{constructor(n={}){ke(this,St);ke(this,us);ke(this,cs);ke(this,Ha);ke(this,Qa);ke(this,ds);ke(this,Va);ke(this,Wa);ee(this,St,n.queryCache||new _x),ee(this,us,n.mutationCache||new eg),ee(this,cs,n.defaultOptions||{}),ee(this,Ha,new Map),ee(this,Qa,new Map),ee(this,ds,0)}mount(){ko(this,ds)._++,E(this,ds)===1&&(ee(this,Va,Pd.subscribe(async n=>{n&&(await this.resumePausedMutations(),E(this,St).onFocus())})),ee(this,Wa,Io.subscribe(async n=>{n&&(await this.resumePausedMutations(),E(this,St).onOnline())})))}unmount(){var n,r;ko(this,ds)._--,E(this,ds)===0&&((n=E(this,Va))==null||n.call(this),ee(this,Va,void 0),(r=E(this,Wa))==null||r.call(this),ee(this,Wa,void 0))}isFetching(n){return E(this,St).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return E(this,us).findAll({...n,status:"pending"}).length}getQueryData(n){var s;const r=this.defaultQueryOptions({queryKey:n});return(s=E(this,St).get(r.queryHash))==null?void 0:s.state.data}ensureQueryData(n){const r=this.defaultQueryOptions(n),s=E(this,St).build(this,r),o=s.state.data;return o===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(hs(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(n){return E(this,St).findAll(n).map(({queryKey:r,state:s})=>{const o=s.data;return[r,o]})}setQueryData(n,r,s){const o=this.defaultQueryOptions({queryKey:n}),u=E(this,St).get(o.queryHash),d=u==null?void 0:u.state.data,h=gx(r,d);if(h!==void 0)return E(this,St).build(this,o).setData(h,{...s,manual:!0})}setQueriesData(n,r,s){return Dt.batch(()=>E(this,St).findAll(n).map(({queryKey:o})=>[o,this.setQueryData(o,r,s)]))}getQueryState(n){var s;const r=this.defaultQueryOptions({queryKey:n});return(s=E(this,St).get(r.queryHash))==null?void 0:s.state}removeQueries(n){const r=E(this,St);Dt.batch(()=>{r.findAll(n).forEach(s=>{r.remove(s)})})}resetQueries(n,r){const s=E(this,St);return Dt.batch(()=>(s.findAll(n).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...n},r)))}cancelQueries(n,r={}){const s={revert:!0,...r},o=Dt.batch(()=>E(this,St).findAll(n).map(u=>u.cancel(s)));return Promise.all(o).then(tn).catch(tn)}invalidateQueries(n,r={}){return Dt.batch(()=>(E(this,St).findAll(n).forEach(s=>{s.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},r)))}refetchQueries(n,r={}){const s={...r,cancelRefetch:r.cancelRefetch??!0},o=Dt.batch(()=>E(this,St).findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let d=u.fetch(void 0,s);return s.throwOnError||(d=d.catch(tn)),u.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(o).then(tn)}fetchQuery(n){const r=this.defaultQueryOptions(n);r.retry===void 0&&(r.retry=!1);const s=E(this,St).build(this,r);return s.isStaleByTime(hs(r.staleTime,s))?s.fetch(r):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(tn).catch(tn)}fetchInfiniteQuery(n){return n.behavior=Ip(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(tn).catch(tn)}ensureInfiniteQueryData(n){return n.behavior=Ip(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Io.isOnline()?E(this,us).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,St)}getMutationCache(){return E(this,us)}getDefaultOptions(){return E(this,cs)}setDefaultOptions(n){ee(this,cs,n)}setQueryDefaults(n,r){E(this,Ha).set(Zs(n),{queryKey:n,defaultOptions:r})}getQueryDefaults(n){const r=[...E(this,Ha).values()],s={};return r.forEach(o=>{Xi(n,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(n,r){E(this,Qa).set(Zs(n),{mutationKey:n,defaultOptions:r})}getMutationDefaults(n){const r=[...E(this,Qa).values()],s={};return r.forEach(o=>{Xi(n,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const r={...E(this,cs).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return r.queryHash||(r.queryHash=Ed(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Rd&&(r.enabled=!1),r}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...E(this,cs).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){E(this,St).clear(),E(this,us).clear()}},St=new WeakMap,us=new WeakMap,cs=new WeakMap,Ha=new WeakMap,Qa=new WeakMap,ds=new WeakMap,Va=new WeakMap,Wa=new WeakMap,$m),tg=k.createContext(void 0),Ct=n=>{const r=k.useContext(tg);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},Dx=({client:n,children:r})=>(k.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),i.jsx(tg.Provider,{value:n,children:r})),ng=k.createContext(!1),Ox=()=>k.useContext(ng);ng.Provider;function Fx(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Ix=k.createContext(Fx()),zx=()=>k.useContext(Ix),Ux=(n,r)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(r.isReset()||(n.retryOnMount=!1))},$x=n=>{k.useEffect(()=>{n.clearReset()},[n])},qx=({result:n,errorResetBoundary:r,throwOnError:s,query:o,suspense:u})=>n.isError&&!r.isReset()&&!n.isFetching&&o&&(u&&n.data===void 0||Wm(s,[n.error,o])),Bx=n=>{if(n.suspense){const s=u=>u==="static"?u:Math.max(u??1e3,1e3),o=n.staleTime;n.staleTime=typeof o=="function"?(...u)=>s(o(...u)):s(o),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Hx=(n,r)=>n.isLoading&&n.isFetching&&!r,Qx=(n,r)=>(n==null?void 0:n.suspense)&&r.isPending,Up=(n,r,s)=>r.fetchOptimistic(n).catch(()=>{s.clearReset()});function Vx(n,r,s){var w,x,j,T,N;const o=Ox(),u=zx(),d=Ct(),h=d.defaultQueryOptions(n);(x=(w=d.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||x.call(w,h),h._optimisticResults=o?"isRestoring":"optimistic",Bx(h),Ux(h,u),$x(u);const p=!d.getQueryCache().get(h.queryHash),[g]=k.useState(()=>new r(d,h)),m=g.getOptimisticResult(h),y=!o&&n.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(S=>{const L=y?g.subscribe(Dt.batchCalls(S)):tn;return g.updateResult(),L},[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),k.useEffect(()=>{g.setOptions(h)},[h,g]),Qx(h,m))throw Up(h,g,u);if(qx({result:m,errorResetBoundary:u,throwOnError:h.throwOnError,query:d.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw m.error;if((T=(j=d.getDefaultOptions().queries)==null?void 0:j._experimental_afterQuery)==null||T.call(j,h,m),h.experimental_prefetchInRender&&!Xs&&Hx(m,o)){const S=p?Up(h,g,u):(N=d.getQueryCache().get(h.queryHash))==null?void 0:N.promise;S==null||S.catch(tn).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?m:g.trackResult(m)}function Rt(n,r){return Vx(n,Ex)}function Ft(n,r){const s=Ct(),[o]=k.useState(()=>new Mx(s,n));k.useEffect(()=>{o.setOptions(n)},[o,n]);const u=k.useSyncExternalStore(k.useCallback(h=>o.subscribe(Dt.batchCalls(h)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d=k.useCallback((h,p)=>{o.mutate(h,p).catch(tn)},[o]);if(u.error&&Wm(o.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:d,mutateAsync:u.mutate}}/**
|
|
40
|
+
`+f.stack}return{value:e,source:t,stack:c,digest:null}}function ac(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var Pv=typeof WeakMap=="function"?WeakMap:Map;function Ph(e,t,a){a=gr(-1,a),a.tag=3,a.payload={element:null};var l=t.value;return a.callback=function(){lo||(lo=!0,kc=l),ic(e,t)},a}function Th(e,t,a){a=gr(-1,a),a.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var c=t.value;a.payload=function(){return l(c)},a.callback=function(){ic(e,t)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(a.callback=function(){ic(e,t),typeof l!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),a}function Lh(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Pv;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(c.add(a),e=Bv.bind(null,e,t,a),t.then(e,e))}function Mh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function _h(e,t,a,l,c){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=gr(-1,1),t.tag=2,Hr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var Tv=Q.ReactCurrentOwner,un=!1;function Jt(e,t,a,l){t.child=e===null?Zf(t,null,a,l):Sa(t,e.child,a,l)}function Ah(e,t,a,l,c){a=a.render;var f=t.ref;return Na(t,c),l=Ju(e,t,a,l,f,c),a=Xu(),e!==null&&!un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,yr(e,t,c)):(gt&&a&&Au(t),t.flags|=1,Jt(e,t,l,c),t.child)}function Dh(e,t,a,l,c){if(e===null){var f=a.type;return typeof f=="function"&&!Rc(f)&&f.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=f,Oh(e,t,f,l,c)):(e=po(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,(e.lanes&c)===0){var v=f.memoizedProps;if(a=a.compare,a=a!==null?a:ki,a(v,l)&&e.ref===t.ref)return yr(e,t,c)}return t.flags|=1,e=Yr(f,l),e.ref=t.ref,e.return=t,t.child=e}function Oh(e,t,a,l,c){if(e!==null){var f=e.memoizedProps;if(ki(f,l)&&e.ref===t.ref)if(un=!1,t.pendingProps=l=f,(e.lanes&c)!==0)(e.flags&131072)!==0&&(un=!0);else return t.lanes=e.lanes,yr(e,t,c)}return lc(e,t,a,l,c)}function Fh(e,t,a){var l=t.pendingProps,c=l.children,f=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(Ta,wn),wn|=a;else{if((a&1073741824)===0)return e=f!==null?f.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,dt(Ta,wn),wn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=f!==null?f.baseLanes:a,dt(Ta,wn),wn|=l}else f!==null?(l=f.baseLanes|a,t.memoizedState=null):l=a,dt(Ta,wn),wn|=l;return Jt(e,t,c,a),t.child}function Ih(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function lc(e,t,a,l,c){var f=on(a)?Es:Vt.current;return f=wa(t,f),Na(t,c),a=Ju(e,t,a,l,f,c),l=Xu(),e!==null&&!un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,yr(e,t,c)):(gt&&l&&Au(t),t.flags|=1,Jt(e,t,a,c),t.child)}function zh(e,t,a,l,c){if(on(a)){var f=!0;Il(t)}else f=!1;if(Na(t,c),t.stateNode===null)no(e,t),Eh(t,a,l),sc(t,a,l,c),l=!0;else if(e===null){var v=t.stateNode,b=t.memoizedProps;v.props=b;var R=v.context,I=a.contextType;typeof I=="object"&&I!==null?I=En(I):(I=on(a)?Es:Vt.current,I=wa(t,I));var W=a.getDerivedStateFromProps,K=typeof W=="function"||typeof v.getSnapshotBeforeUpdate=="function";K||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(b!==l||R!==I)&&Rh(t,v,l,I),Br=!1;var H=t.memoizedState;v.state=H,Wl(t,l,v,c),R=t.memoizedState,b!==l||H!==R||ln.current||Br?(typeof W=="function"&&(rc(t,a,W,l),R=t.memoizedState),(b=Br||Nh(t,a,b,l,H,R,I))?(K||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),v.props=l,v.state=R,v.context=I,l=b):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,th(e,t),b=t.memoizedProps,I=t.type===t.elementType?b:Un(t.type,b),v.props=I,K=t.pendingProps,H=v.context,R=a.contextType,typeof R=="object"&&R!==null?R=En(R):(R=on(a)?Es:Vt.current,R=wa(t,R));var te=a.getDerivedStateFromProps;(W=typeof te=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(b!==K||H!==R)&&Rh(t,v,l,R),Br=!1,H=t.memoizedState,v.state=H,Wl(t,l,v,c);var ae=t.memoizedState;b!==K||H!==ae||ln.current||Br?(typeof te=="function"&&(rc(t,a,te,l),ae=t.memoizedState),(I=Br||Nh(t,a,I,l,H,ae,R)||!1)?(W||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,ae,R),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,ae,R)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ae),v.props=l,v.state=ae,v.context=R,l=I):(typeof v.componentDidUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return oc(e,t,a,l,f,c)}function oc(e,t,a,l,c,f){Ih(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return c&&Hf(t,a,!1),yr(e,t,f);l=t.stateNode,Tv.current=t;var b=v&&typeof a.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Sa(t,e.child,null,f),t.child=Sa(t,null,b,f)):Jt(e,t,b,f),t.memoizedState=l.state,c&&Hf(t,a,!0),t.child}function Uh(e){var t=e.stateNode;t.pendingContext?qf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qf(e,t.context,!1),Qu(e,t.containerInfo)}function $h(e,t,a,l,c){return ba(),Iu(c),t.flags|=256,Jt(e,t,a,l),t.child}var uc={dehydrated:null,treeContext:null,retryLane:0};function cc(e){return{baseLanes:e,cachePool:null,transitions:null}}function qh(e,t,a){var l=t.pendingProps,c=vt.current,f=!1,v=(t.flags&128)!==0,b;if((b=v)||(b=e!==null&&e.memoizedState===null?!1:(c&2)!==0),b?(f=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),dt(vt,c&1),e===null)return Fu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(v=l.children,e=l.fallback,f?(l=t.mode,f=t.child,v={mode:"hidden",children:v},(l&1)===0&&f!==null?(f.childLanes=0,f.pendingProps=v):f=mo(v,l,0,null),e=Fs(e,l,a,null),f.return=t,e.return=t,f.sibling=e,t.child=f,t.child.memoizedState=cc(a),t.memoizedState=uc,e):dc(t,v));if(c=e.memoizedState,c!==null&&(b=c.dehydrated,b!==null))return Lv(e,t,v,l,b,c,a);if(f){f=l.fallback,v=t.mode,c=e.child,b=c.sibling;var R={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==c?(l=t.child,l.childLanes=0,l.pendingProps=R,t.deletions=null):(l=Yr(c,R),l.subtreeFlags=c.subtreeFlags&14680064),b!==null?f=Yr(b,f):(f=Fs(f,v,a,null),f.flags|=2),f.return=t,l.return=t,l.sibling=f,t.child=l,l=f,f=t.child,v=e.child.memoizedState,v=v===null?cc(a):{baseLanes:v.baseLanes|a,cachePool:null,transitions:v.transitions},f.memoizedState=v,f.childLanes=e.childLanes&~a,t.memoizedState=uc,l}return f=e.child,e=f.sibling,l=Yr(f,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=a),l.return=t,l.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=l,t.memoizedState=null,l}function dc(e,t){return t=mo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function to(e,t,a,l){return l!==null&&Iu(l),Sa(t,e.child,null,a),e=dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lv(e,t,a,l,c,f,v){if(a)return t.flags&256?(t.flags&=-257,l=ac(Error(s(422))),to(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(f=l.fallback,c=t.mode,l=mo({mode:"visible",children:l.children},c,0,null),f=Fs(f,c,v,null),f.flags|=2,l.return=t,f.return=t,l.sibling=f,t.child=l,(t.mode&1)!==0&&Sa(t,e.child,null,v),t.child.memoizedState=cc(v),t.memoizedState=uc,f);if((t.mode&1)===0)return to(e,t,v,null);if(c.data==="$!"){if(l=c.nextSibling&&c.nextSibling.dataset,l)var b=l.dgst;return l=b,f=Error(s(419)),l=ac(f,l,void 0),to(e,t,v,l)}if(b=(v&e.childLanes)!==0,un||b){if(l=Ut,l!==null){switch(v&-v){case 4:c=2;break;case 16:c=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(l.suspendedLanes|v))!==0?0:c,c!==0&&c!==f.retryLane&&(f.retryLane=c,mr(e,c),Bn(l,e,c,-1))}return Ec(),l=ac(Error(s(421))),to(e,t,v,l)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=Hv.bind(null,e),c._reactRetry=t,null):(e=f.treeContext,xn=zr(c.nextSibling),vn=t,gt=!0,zn=null,e!==null&&(Cn[Nn++]=hr,Cn[Nn++]=pr,Cn[Nn++]=Rs,hr=e.id,pr=e.overflow,Rs=t),t=dc(t,l.children),t.flags|=4096,t)}function Bh(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),qu(e.return,t,a)}function fc(e,t,a,l,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=a,f.tailMode=c)}function Hh(e,t,a){var l=t.pendingProps,c=l.revealOrder,f=l.tail;if(Jt(e,t,l.children,a),l=vt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bh(e,a,t);else if(e.tag===19)Bh(e,a,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}l&=1}if(dt(vt,l),(t.mode&1)===0)t.memoizedState=null;else switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Kl(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),fc(t,!1,c,a,f);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Kl(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}fc(t,!0,a,null,f);break;case"together":fc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function no(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),_s|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=Yr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Yr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Mv(e,t,a){switch(t.tag){case 3:Uh(t),ba();break;case 5:sh(t);break;case 1:on(t.type)&&Il(t);break;case 4:Qu(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,c=t.memoizedProps.value;dt(Hl,l._currentValue),l._currentValue=c;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(dt(vt,vt.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?qh(e,t,a):(dt(vt,vt.current&1),e=yr(e,t,a),e!==null?e.sibling:null);dt(vt,vt.current&1);break;case 19:if(l=(a&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Hh(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),dt(vt,vt.current),l)break;return null;case 22:case 23:return t.lanes=0,Fh(e,t,a)}return yr(e,t,a)}var Qh,hc,Vh,Wh;Qh=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},hc=function(){},Vh=function(e,t,a,l){var c=e.memoizedProps;if(c!==l){e=t.stateNode,Ls(er.current);var f=null;switch(a){case"input":c=Gn(e,c),l=Gn(e,l),f=[];break;case"select":c=$({},c,{value:void 0}),l=$({},l,{value:void 0}),f=[];break;case"textarea":c=ni(e,c),l=ni(e,l),f=[];break;default:typeof c.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Dl)}sa(a,l);var v;a=null;for(I in c)if(!l.hasOwnProperty(I)&&c.hasOwnProperty(I)&&c[I]!=null)if(I==="style"){var b=c[I];for(v in b)b.hasOwnProperty(v)&&(a||(a={}),a[v]="")}else I!=="dangerouslySetInnerHTML"&&I!=="children"&&I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(u.hasOwnProperty(I)?f||(f=[]):(f=f||[]).push(I,null));for(I in l){var R=l[I];if(b=c!=null?c[I]:void 0,l.hasOwnProperty(I)&&R!==b&&(R!=null||b!=null))if(I==="style")if(b){for(v in b)!b.hasOwnProperty(v)||R&&R.hasOwnProperty(v)||(a||(a={}),a[v]="");for(v in R)R.hasOwnProperty(v)&&b[v]!==R[v]&&(a||(a={}),a[v]=R[v])}else a||(f||(f=[]),f.push(I,a)),a=R;else I==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,b=b?b.__html:void 0,R!=null&&b!==R&&(f=f||[]).push(I,R)):I==="children"?typeof R!="string"&&typeof R!="number"||(f=f||[]).push(I,""+R):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&(u.hasOwnProperty(I)?(R!=null&&I==="onScroll"&&ft("scroll",e),f||b===R||(f=[])):(f=f||[]).push(I,R))}a&&(f=f||[]).push("style",a);var I=f;(t.updateQueue=I)&&(t.flags|=4)}},Wh=function(e,t,a,l){a!==l&&(t.flags|=4)};function Oi(e,t){if(!gt)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Kt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&14680064,l|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function _v(e,t,a){var l=t.pendingProps;switch(Du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(t),null;case 1:return on(t.type)&&Fl(),Kt(t),null;case 3:return l=t.stateNode,Ea(),ht(ln),ht(Vt),Ku(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ql(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,zn!==null&&(Sc(zn),zn=null))),hc(e,t),Kt(t),null;case 5:Vu(t);var c=Ls(Li.current);if(a=t.type,e!==null&&t.stateNode!=null)Vh(e,t,a,l,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Kt(t),null}if(e=Ls(er.current),ql(t)){l=t.stateNode,a=t.type;var f=t.memoizedProps;switch(l[Zn]=t,l[Ni]=f,e=(t.mode&1)!==0,a){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(c=0;c<bi.length;c++)ft(bi[c],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":Yn(l,f),ft("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!f.multiple},ft("invalid",l);break;case"textarea":Jn(l,f),ft("invalid",l)}sa(a,f),c=null;for(var v in f)if(f.hasOwnProperty(v)){var b=f[v];v==="children"?typeof b=="string"?l.textContent!==b&&(f.suppressHydrationWarning!==!0&&Al(l.textContent,b,e),c=["children",b]):typeof b=="number"&&l.textContent!==""+b&&(f.suppressHydrationWarning!==!0&&Al(l.textContent,b,e),c=["children",""+b]):u.hasOwnProperty(v)&&b!=null&&v==="onScroll"&&ft("scroll",l)}switch(a){case"input":ct(l),ei(l,f,!0);break;case"textarea":ct(l),ri(l);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(l.onclick=Dl)}l=c,t.updateQueue=l,l!==null&&(t.flags|=4)}else{v=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ra(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(a,{is:l.is}):(e=v.createElement(a),a==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,a),e[Zn]=t,e[Ni]=l,Qh(e,t,!1,!1),t.stateNode=e;e:{switch(v=ii(a,l),a){case"dialog":ft("cancel",e),ft("close",e),c=l;break;case"iframe":case"object":case"embed":ft("load",e),c=l;break;case"video":case"audio":for(c=0;c<bi.length;c++)ft(bi[c],e);c=l;break;case"source":ft("error",e),c=l;break;case"img":case"image":case"link":ft("error",e),ft("load",e),c=l;break;case"details":ft("toggle",e),c=l;break;case"input":Yn(e,l),c=Gn(e,l),ft("invalid",e);break;case"option":c=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},c=$({},l,{value:void 0}),ft("invalid",e);break;case"textarea":Jn(e,l),c=ni(e,l),ft("invalid",e);break;default:c=l}sa(a,c),b=c;for(f in b)if(b.hasOwnProperty(f)){var R=b[f];f==="style"?ai(e,R):f==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&si(e,R)):f==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&xs(e,R):typeof R=="number"&&xs(e,""+R):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(u.hasOwnProperty(f)?R!=null&&f==="onScroll"&&ft("scroll",e):R!=null&&U(e,f,R,v))}switch(a){case"input":ct(e),ei(e,l,!1);break;case"textarea":ct(e),ri(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ke(l.value));break;case"select":e.multiple=!!l.multiple,f=l.value,f!=null?Er(e,!!l.multiple,f,!1):l.defaultValue!=null&&Er(e,!!l.multiple,l.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=Dl)}switch(a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Kt(t),null;case 6:if(e&&t.stateNode!=null)Wh(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(a=Ls(Li.current),Ls(er.current),ql(t)){if(l=t.stateNode,a=t.memoizedProps,l[Zn]=t,(f=l.nodeValue!==a)&&(e=vn,e!==null))switch(e.tag){case 3:Al(l.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Al(l.nodeValue,a,(e.mode&1)!==0)}f&&(t.flags|=4)}else l=(a.nodeType===9?a:a.ownerDocument).createTextNode(l),l[Zn]=t,t.stateNode=l}return Kt(t),null;case 13:if(ht(vt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(gt&&xn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Yf(),ba(),t.flags|=98560,f=!1;else if(f=ql(t),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[Zn]=t}else ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Kt(t),f=!1}else zn!==null&&(Sc(zn),zn=null),f=!0;if(!f)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(vt.current&1)!==0?_t===0&&(_t=3):Ec())),t.updateQueue!==null&&(t.flags|=4),Kt(t),null);case 4:return Ea(),hc(e,t),e===null&&Si(t.stateNode.containerInfo),Kt(t),null;case 10:return $u(t.type._context),Kt(t),null;case 17:return on(t.type)&&Fl(),Kt(t),null;case 19:if(ht(vt),f=t.memoizedState,f===null)return Kt(t),null;if(l=(t.flags&128)!==0,v=f.rendering,v===null)if(l)Oi(f,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Kl(e),v!==null){for(t.flags|=128,Oi(f,!1),l=v.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=a,a=t.child;a!==null;)f=a,e=l,f.flags&=14680066,v=f.alternate,v===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=v.childLanes,f.lanes=v.lanes,f.child=v.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=v.memoizedProps,f.memoizedState=v.memoizedState,f.updateQueue=v.updateQueue,f.type=v.type,e=v.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return dt(vt,vt.current&1|2),t.child}e=e.sibling}f.tail!==null&&Ze()>La&&(t.flags|=128,l=!0,Oi(f,!1),t.lanes=4194304)}else{if(!l)if(e=Kl(v),e!==null){if(t.flags|=128,l=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Oi(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!gt)return Kt(t),null}else 2*Ze()-f.renderingStartTime>La&&a!==1073741824&&(t.flags|=128,l=!0,Oi(f,!1),t.lanes=4194304);f.isBackwards?(v.sibling=t.child,t.child=v):(a=f.last,a!==null?a.sibling=v:t.child=v,f.last=v)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Ze(),t.sibling=null,a=vt.current,dt(vt,l?a&1|2:a&1),t):(Kt(t),null);case 22:case 23:return Nc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(wn&1073741824)!==0&&(Kt(t),t.subtreeFlags&6&&(t.flags|=8192)):Kt(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Av(e,t){switch(Du(t),t.tag){case 1:return on(t.type)&&Fl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ea(),ht(ln),ht(Vt),Ku(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Vu(t),null;case 13:if(ht(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(vt),null;case 4:return Ea(),null;case 10:return $u(t.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var ro=!1,Gt=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,re=null;function Pa(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(l){bt(e,t,l)}else a.current=null}function pc(e,t,a){try{a()}catch(l){bt(e,t,l)}}var Kh=!1;function Ov(e,t){if(Nu=bl,e=Nf(),vu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var v=0,b=-1,R=-1,I=0,W=0,K=e,H=null;t:for(;;){for(var te;K!==a||c!==0&&K.nodeType!==3||(b=v+c),K!==f||l!==0&&K.nodeType!==3||(R=v+l),K.nodeType===3&&(v+=K.nodeValue.length),(te=K.firstChild)!==null;)H=K,K=te;for(;;){if(K===e)break t;if(H===a&&++I===c&&(b=v),H===f&&++W===l&&(R=v),(te=K.nextSibling)!==null)break;K=H,H=K.parentNode}K=te}a=b===-1||R===-1?null:{start:b,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Eu={focusedElem:e,selectionRange:a},bl=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var ae=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var ue=ae.memoizedProps,Et=ae.memoizedState,O=t.stateNode,T=O.getSnapshotBeforeUpdate(t.elementType===t.type?ue:Un(t.type,ue),Et);O.__reactInternalSnapshotBeforeUpdate=T}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Y){bt(t,t.return,Y)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return ae=Kh,Kh=!1,ae}function Fi(e,t,a){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var c=l=l.next;do{if((c.tag&e)===e){var f=c.destroy;c.destroy=void 0,f!==void 0&&pc(t,a,f)}c=c.next}while(c!==l)}}function so(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var l=a.create;a.destroy=l()}a=a.next}while(a!==t)}}function mc(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=a;break;default:e=a}typeof t=="function"?t(e):t.current=e}}function Gh(e){var t=e.alternate;t!==null&&(e.alternate=null,Gh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zn],delete t[Ni],delete t[Lu],delete t[vv],delete t[xv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yh(e){return e.tag===5||e.tag===3||e.tag===4}function Jh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Dl));else if(l!==4&&(e=e.child,e!==null))for(gc(e,t,a),e=e.sibling;e!==null;)gc(e,t,a),e=e.sibling}function yc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(yc(e,t,a),e=e.sibling;e!==null;)yc(e,t,a),e=e.sibling}var Ht=null,$n=!1;function Qr(e,t,a){for(a=a.child;a!==null;)Xh(e,t,a),a=a.sibling}function Xh(e,t,a){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount($e,a)}catch{}switch(a.tag){case 5:Gt||Pa(a,t);case 6:var l=Ht,c=$n;Ht=null,Qr(e,t,a),Ht=l,$n=c,Ht!==null&&($n?(e=Ht,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):Ht.removeChild(a.stateNode));break;case 18:Ht!==null&&($n?(e=Ht,a=a.stateNode,e.nodeType===8?Tu(e.parentNode,a):e.nodeType===1&&Tu(e,a),mi(e)):Tu(Ht,a.stateNode));break;case 4:l=Ht,c=$n,Ht=a.stateNode.containerInfo,$n=!0,Qr(e,t,a),Ht=l,$n=c;break;case 0:case 11:case 14:case 15:if(!Gt&&(l=a.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){c=l=l.next;do{var f=c,v=f.destroy;f=f.tag,v!==void 0&&((f&2)!==0||(f&4)!==0)&&pc(a,t,v),c=c.next}while(c!==l)}Qr(e,t,a);break;case 1:if(!Gt&&(Pa(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=a.memoizedProps,l.state=a.memoizedState,l.componentWillUnmount()}catch(b){bt(a,t,b)}Qr(e,t,a);break;case 21:Qr(e,t,a);break;case 22:a.mode&1?(Gt=(l=Gt)||a.memoizedState!==null,Qr(e,t,a),Gt=l):Qr(e,t,a);break;default:Qr(e,t,a)}}function Zh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Dv),t.forEach(function(l){var c=Qv.bind(null,e,l);a.has(l)||(a.add(l),l.then(c,c))})}}function qn(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l];try{var f=e,v=t,b=v;e:for(;b!==null;){switch(b.tag){case 5:Ht=b.stateNode,$n=!1;break e;case 3:Ht=b.stateNode.containerInfo,$n=!0;break e;case 4:Ht=b.stateNode.containerInfo,$n=!0;break e}b=b.return}if(Ht===null)throw Error(s(160));Xh(f,v,c),Ht=null,$n=!1;var R=c.alternate;R!==null&&(R.return=null),c.return=null}catch(I){bt(c,t,I)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ep(t,e),t=t.sibling}function ep(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qn(t,e),nr(e),l&4){try{Fi(3,e,e.return),so(3,e)}catch(ue){bt(e,e.return,ue)}try{Fi(5,e,e.return)}catch(ue){bt(e,e.return,ue)}}break;case 1:qn(t,e),nr(e),l&512&&a!==null&&Pa(a,a.return);break;case 5:if(qn(t,e),nr(e),l&512&&a!==null&&Pa(a,a.return),e.flags&32){var c=e.stateNode;try{xs(c,"")}catch(ue){bt(e,e.return,ue)}}if(l&4&&(c=e.stateNode,c!=null)){var f=e.memoizedProps,v=a!==null?a.memoizedProps:f,b=e.type,R=e.updateQueue;if(e.updateQueue=null,R!==null)try{b==="input"&&f.type==="radio"&&f.name!=null&&pl(c,f),ii(b,v);var I=ii(b,f);for(v=0;v<R.length;v+=2){var W=R[v],K=R[v+1];W==="style"?ai(c,K):W==="dangerouslySetInnerHTML"?si(c,K):W==="children"?xs(c,K):U(c,W,K,I)}switch(b){case"input":Za(c,f);break;case"textarea":Rr(c,f);break;case"select":var H=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!f.multiple;var te=f.value;te!=null?Er(c,!!f.multiple,te,!1):H!==!!f.multiple&&(f.defaultValue!=null?Er(c,!!f.multiple,f.defaultValue,!0):Er(c,!!f.multiple,f.multiple?[]:"",!1))}c[Ni]=f}catch(ue){bt(e,e.return,ue)}}break;case 6:if(qn(t,e),nr(e),l&4){if(e.stateNode===null)throw Error(s(162));c=e.stateNode,f=e.memoizedProps;try{c.nodeValue=f}catch(ue){bt(e,e.return,ue)}}break;case 3:if(qn(t,e),nr(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{mi(t.containerInfo)}catch(ue){bt(e,e.return,ue)}break;case 4:qn(t,e),nr(e);break;case 13:qn(t,e),nr(e),c=e.child,c.flags&8192&&(f=c.memoizedState!==null,c.stateNode.isHidden=f,!f||c.alternate!==null&&c.alternate.memoizedState!==null||(wc=Ze())),l&4&&Zh(e);break;case 22:if(W=a!==null&&a.memoizedState!==null,e.mode&1?(Gt=(I=Gt)||W,qn(t,e),Gt=I):qn(t,e),nr(e),l&8192){if(I=e.memoizedState!==null,(e.stateNode.isHidden=I)&&!W&&(e.mode&1)!==0)for(re=e,W=e.child;W!==null;){for(K=re=W;re!==null;){switch(H=re,te=H.child,H.tag){case 0:case 11:case 14:case 15:Fi(4,H,H.return);break;case 1:Pa(H,H.return);var ae=H.stateNode;if(typeof ae.componentWillUnmount=="function"){l=H,a=H.return;try{t=l,ae.props=t.memoizedProps,ae.state=t.memoizedState,ae.componentWillUnmount()}catch(ue){bt(l,a,ue)}}break;case 5:Pa(H,H.return);break;case 22:if(H.memoizedState!==null){rp(K);continue}}te!==null?(te.return=H,re=te):rp(K)}W=W.sibling}e:for(W=null,K=e;;){if(K.tag===5){if(W===null){W=K;try{c=K.stateNode,I?(f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(b=K.stateNode,R=K.memoizedProps.style,v=R!=null&&R.hasOwnProperty("display")?R.display:null,b.style.display=jn("display",v))}catch(ue){bt(e,e.return,ue)}}}else if(K.tag===6){if(W===null)try{K.stateNode.nodeValue=I?"":K.memoizedProps}catch(ue){bt(e,e.return,ue)}}else if((K.tag!==22&&K.tag!==23||K.memoizedState===null||K===e)&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===e)break e;for(;K.sibling===null;){if(K.return===null||K.return===e)break e;W===K&&(W=null),K=K.return}W===K&&(W=null),K.sibling.return=K.return,K=K.sibling}}break;case 19:qn(t,e),nr(e),l&4&&Zh(e);break;case 21:break;default:qn(t,e),nr(e)}}function nr(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(Yh(a)){var l=a;break e}a=a.return}throw Error(s(160))}switch(l.tag){case 5:var c=l.stateNode;l.flags&32&&(xs(c,""),l.flags&=-33);var f=Jh(e);yc(e,f,c);break;case 3:case 4:var v=l.stateNode.containerInfo,b=Jh(e);gc(e,b,v);break;default:throw Error(s(161))}}catch(R){bt(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fv(e,t,a){re=e,tp(e)}function tp(e,t,a){for(var l=(e.mode&1)!==0;re!==null;){var c=re,f=c.child;if(c.tag===22&&l){var v=c.memoizedState!==null||ro;if(!v){var b=c.alternate,R=b!==null&&b.memoizedState!==null||Gt;b=ro;var I=Gt;if(ro=v,(Gt=R)&&!I)for(re=c;re!==null;)v=re,R=v.child,v.tag===22&&v.memoizedState!==null?sp(c):R!==null?(R.return=v,re=R):sp(c);for(;f!==null;)re=f,tp(f),f=f.sibling;re=c,ro=b,Gt=I}np(e)}else(c.subtreeFlags&8772)!==0&&f!==null?(f.return=c,re=f):np(e)}}function np(e){for(;re!==null;){var t=re;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Gt||so(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!Gt)if(a===null)l.componentDidMount();else{var c=t.elementType===t.type?a.memoizedProps:Un(t.type,a.memoizedProps);l.componentDidUpdate(c,a.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var f=t.updateQueue;f!==null&&rh(t,f,l);break;case 3:var v=t.updateQueue;if(v!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}rh(t,v,a)}break;case 5:var b=t.stateNode;if(a===null&&t.flags&4){a=b;var R=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&a.focus();break;case"img":R.src&&(a.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var I=t.alternate;if(I!==null){var W=I.memoizedState;if(W!==null){var K=W.dehydrated;K!==null&&mi(K)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Gt||t.flags&512&&mc(t)}catch(H){bt(t,t.return,H)}}if(t===e){re=null;break}if(a=t.sibling,a!==null){a.return=t.return,re=a;break}re=t.return}}function rp(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var a=t.sibling;if(a!==null){a.return=t.return,re=a;break}re=t.return}}function sp(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{so(4,t)}catch(R){bt(t,a,R)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var c=t.return;try{l.componentDidMount()}catch(R){bt(t,c,R)}}var f=t.return;try{mc(t)}catch(R){bt(t,f,R)}break;case 5:var v=t.return;try{mc(t)}catch(R){bt(t,v,R)}}}catch(R){bt(t,t.return,R)}if(t===e){re=null;break}var b=t.sibling;if(b!==null){b.return=t.return,re=b;break}re=t.return}}var Iv=Math.ceil,ao=Q.ReactCurrentDispatcher,vc=Q.ReactCurrentOwner,Pn=Q.ReactCurrentBatchConfig,Ge=0,Ut=null,Pt=null,Qt=0,wn=0,Ta=Ur(0),_t=0,Ii=null,_s=0,io=0,xc=0,zi=null,cn=null,wc=0,La=1/0,vr=null,lo=!1,kc=null,Vr=null,oo=!1,Wr=null,uo=0,Ui=0,jc=null,co=-1,fo=0;function Xt(){return(Ge&6)!==0?Ze():co!==-1?co:co=Ze()}function Kr(e){return(e.mode&1)===0?1:(Ge&2)!==0&&Qt!==0?Qt&-Qt:kv.transition!==null?(fo===0&&(fo=Yd()),fo):(e=rt,e!==0||(e=window.event,e=e===void 0?16:af(e.type)),e)}function Bn(e,t,a,l){if(50<Ui)throw Ui=0,jc=null,Error(s(185));ci(e,a,l),((Ge&2)===0||e!==Ut)&&(e===Ut&&((Ge&2)===0&&(io|=a),_t===4&&Gr(e,Qt)),dn(e,l),a===1&&Ge===0&&(t.mode&1)===0&&(La=Ze()+500,zl&&qr()))}function dn(e,t){var a=e.callbackNode;ky(e,t);var l=wl(e,e===Ut?Qt:0);if(l===0)a!==null&&it(a),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(a!=null&&it(a),t===1)e.tag===0?wv(ip.bind(null,e)):Qf(ip.bind(null,e)),gv(function(){(Ge&6)===0&&qr()}),a=null;else{switch(Jd(l)){case 1:a=Ss;break;case 4:a=Lr;break;case 16:a=Sn;break;case 536870912:a=Cs;break;default:a=Sn}a=pp(a,ap.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function ap(e,t){if(co=-1,fo=0,(Ge&6)!==0)throw Error(s(327));var a=e.callbackNode;if(Ma()&&e.callbackNode!==a)return null;var l=wl(e,e===Ut?Qt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=ho(e,l);else{t=l;var c=Ge;Ge|=2;var f=op();(Ut!==e||Qt!==t)&&(vr=null,La=Ze()+500,Ds(e,t));do try{$v();break}catch(b){lp(e,b)}while(!0);Uu(),ao.current=f,Ge=c,Pt!==null?t=0:(Ut=null,Qt=0,t=_t)}if(t!==0){if(t===2&&(c=nu(e),c!==0&&(l=c,t=bc(e,c))),t===1)throw a=Ii,Ds(e,0),Gr(e,l),dn(e,Ze()),a;if(t===6)Gr(e,l);else{if(c=e.current.alternate,(l&30)===0&&!zv(c)&&(t=ho(e,l),t===2&&(f=nu(e),f!==0&&(l=f,t=bc(e,f))),t===1))throw a=Ii,Ds(e,0),Gr(e,l),dn(e,Ze()),a;switch(e.finishedWork=c,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:Os(e,cn,vr);break;case 3:if(Gr(e,l),(l&130023424)===l&&(t=wc+500-Ze(),10<t)){if(wl(e,0)!==0)break;if(c=e.suspendedLanes,(c&l)!==l){Xt(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=Pu(Os.bind(null,e,cn,vr),t);break}Os(e,cn,vr);break;case 4:if(Gr(e,l),(l&4194240)===l)break;for(t=e.eventTimes,c=-1;0<l;){var v=31-Lt(l);f=1<<v,v=t[v],v>c&&(c=v),l&=~f}if(l=c,l=Ze()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Iv(l/1960))-l,10<l){e.timeoutHandle=Pu(Os.bind(null,e,cn,vr),l);break}Os(e,cn,vr);break;case 5:Os(e,cn,vr);break;default:throw Error(s(329))}}}return dn(e,Ze()),e.callbackNode===a?ap.bind(null,e):null}function bc(e,t){var a=zi;return e.current.memoizedState.isDehydrated&&(Ds(e,t).flags|=256),e=ho(e,t),e!==2&&(t=cn,cn=a,t!==null&&Sc(t)),e}function Sc(e){cn===null?cn=e:cn.push.apply(cn,e)}function zv(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var l=0;l<a.length;l++){var c=a[l],f=c.getSnapshot;c=c.value;try{if(!In(f(),c))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Gr(e,t){for(t&=~xc,t&=~io,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Lt(t),l=1<<a;e[a]=-1,t&=~l}}function ip(e){if((Ge&6)!==0)throw Error(s(327));Ma();var t=wl(e,0);if((t&1)===0)return dn(e,Ze()),null;var a=ho(e,t);if(e.tag!==0&&a===2){var l=nu(e);l!==0&&(t=l,a=bc(e,l))}if(a===1)throw a=Ii,Ds(e,0),Gr(e,t),dn(e,Ze()),a;if(a===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Os(e,cn,vr),dn(e,Ze()),null}function Cc(e,t){var a=Ge;Ge|=1;try{return e(t)}finally{Ge=a,Ge===0&&(La=Ze()+500,zl&&qr())}}function As(e){Wr!==null&&Wr.tag===0&&(Ge&6)===0&&Ma();var t=Ge;Ge|=1;var a=Pn.transition,l=rt;try{if(Pn.transition=null,rt=1,e)return e()}finally{rt=l,Pn.transition=a,Ge=t,(Ge&6)===0&&qr()}}function Nc(){wn=Ta.current,ht(Ta)}function Ds(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,mv(a)),Pt!==null)for(a=Pt.return;a!==null;){var l=a;switch(Du(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Fl();break;case 3:Ea(),ht(ln),ht(Vt),Ku();break;case 5:Vu(l);break;case 4:Ea();break;case 13:ht(vt);break;case 19:ht(vt);break;case 10:$u(l.type._context);break;case 22:case 23:Nc()}a=a.return}if(Ut=e,Pt=e=Yr(e.current,null),Qt=wn=t,_t=0,Ii=null,xc=io=_s=0,cn=zi=null,Ts!==null){for(t=0;t<Ts.length;t++)if(a=Ts[t],l=a.interleaved,l!==null){a.interleaved=null;var c=l.next,f=a.pending;if(f!==null){var v=f.next;f.next=c,l.next=v}a.pending=l}Ts=null}return e}function lp(e,t){do{var a=Pt;try{if(Uu(),Gl.current=Zl,Yl){for(var l=xt.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}Yl=!1}if(Ms=0,zt=Mt=xt=null,Mi=!1,_i=0,vc.current=null,a===null||a.return===null){_t=1,Ii=t,Pt=null;break}e:{var f=e,v=a.return,b=a,R=t;if(t=Qt,b.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var I=R,W=b,K=W.tag;if((W.mode&1)===0&&(K===0||K===11||K===15)){var H=W.alternate;H?(W.updateQueue=H.updateQueue,W.memoizedState=H.memoizedState,W.lanes=H.lanes):(W.updateQueue=null,W.memoizedState=null)}var te=Mh(v);if(te!==null){te.flags&=-257,_h(te,v,b,f,t),te.mode&1&&Lh(f,I,t),t=te,R=I;var ae=t.updateQueue;if(ae===null){var ue=new Set;ue.add(R),t.updateQueue=ue}else ae.add(R);break e}else{if((t&1)===0){Lh(f,I,t),Ec();break e}R=Error(s(426))}}else if(gt&&b.mode&1){var Et=Mh(v);if(Et!==null){(Et.flags&65536)===0&&(Et.flags|=256),_h(Et,v,b,f,t),Iu(Ra(R,b));break e}}f=R=Ra(R,b),_t!==4&&(_t=2),zi===null?zi=[f]:zi.push(f),f=v;do{switch(f.tag){case 3:f.flags|=65536,t&=-t,f.lanes|=t;var O=Ph(f,R,t);nh(f,O);break e;case 1:b=R;var T=f.type,F=f.stateNode;if((f.flags&128)===0&&(typeof T.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Vr===null||!Vr.has(F)))){f.flags|=65536,t&=-t,f.lanes|=t;var Y=Th(f,b,t);nh(f,Y);break e}}f=f.return}while(f!==null)}cp(a)}catch(he){t=he,Pt===a&&a!==null&&(Pt=a=a.return);continue}break}while(!0)}function op(){var e=ao.current;return ao.current=Zl,e===null?Zl:e}function Ec(){(_t===0||_t===3||_t===2)&&(_t=4),Ut===null||(_s&268435455)===0&&(io&268435455)===0||Gr(Ut,Qt)}function ho(e,t){var a=Ge;Ge|=2;var l=op();(Ut!==e||Qt!==t)&&(vr=null,Ds(e,t));do try{Uv();break}catch(c){lp(e,c)}while(!0);if(Uu(),Ge=a,ao.current=l,Pt!==null)throw Error(s(261));return Ut=null,Qt=0,_t}function Uv(){for(;Pt!==null;)up(Pt)}function $v(){for(;Pt!==null&&!cr();)up(Pt)}function up(e){var t=hp(e.alternate,e,wn);e.memoizedProps=e.pendingProps,t===null?cp(e):Pt=t,vc.current=null}function cp(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=_v(a,t,wn),a!==null){Pt=a;return}}else{if(a=Av(a,t),a!==null){a.flags&=32767,Pt=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{_t=6,Pt=null;return}}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);_t===0&&(_t=5)}function Os(e,t,a){var l=rt,c=Pn.transition;try{Pn.transition=null,rt=1,qv(e,t,a,l)}finally{Pn.transition=c,rt=l}return null}function qv(e,t,a,l){do Ma();while(Wr!==null);if((Ge&6)!==0)throw Error(s(327));a=e.finishedWork;var c=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var f=a.lanes|a.childLanes;if(jy(e,f),e===Ut&&(Pt=Ut=null,Qt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||oo||(oo=!0,pp(Sn,function(){return Ma(),null})),f=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||f){f=Pn.transition,Pn.transition=null;var v=rt;rt=1;var b=Ge;Ge|=4,vc.current=null,Ov(e,a),ep(a,e),ov(Eu),bl=!!Nu,Eu=Nu=null,e.current=a,Fv(a),bs(),Ge=b,rt=v,Pn.transition=f}else e.current=a;if(oo&&(oo=!1,Wr=e,uo=c),f=e.pendingLanes,f===0&&(Vr=null),Mr(a.stateNode),dn(e,Ze()),t!==null)for(l=e.onRecoverableError,a=0;a<t.length;a++)c=t[a],l(c.value,{componentStack:c.stack,digest:c.digest});if(lo)throw lo=!1,e=kc,kc=null,e;return(uo&1)!==0&&e.tag!==0&&Ma(),f=e.pendingLanes,(f&1)!==0?e===jc?Ui++:(Ui=0,jc=e):Ui=0,qr(),null}function Ma(){if(Wr!==null){var e=Jd(uo),t=Pn.transition,a=rt;try{if(Pn.transition=null,rt=16>e?16:e,Wr===null)var l=!1;else{if(e=Wr,Wr=null,uo=0,(Ge&6)!==0)throw Error(s(331));var c=Ge;for(Ge|=4,re=e.current;re!==null;){var f=re,v=f.child;if((re.flags&16)!==0){var b=f.deletions;if(b!==null){for(var R=0;R<b.length;R++){var I=b[R];for(re=I;re!==null;){var W=re;switch(W.tag){case 0:case 11:case 15:Fi(8,W,f)}var K=W.child;if(K!==null)K.return=W,re=K;else for(;re!==null;){W=re;var H=W.sibling,te=W.return;if(Gh(W),W===I){re=null;break}if(H!==null){H.return=te,re=H;break}re=te}}}var ae=f.alternate;if(ae!==null){var ue=ae.child;if(ue!==null){ae.child=null;do{var Et=ue.sibling;ue.sibling=null,ue=Et}while(ue!==null)}}re=f}}if((f.subtreeFlags&2064)!==0&&v!==null)v.return=f,re=v;else e:for(;re!==null;){if(f=re,(f.flags&2048)!==0)switch(f.tag){case 0:case 11:case 15:Fi(9,f,f.return)}var O=f.sibling;if(O!==null){O.return=f.return,re=O;break e}re=f.return}}var T=e.current;for(re=T;re!==null;){v=re;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,re=F;else e:for(v=T;re!==null;){if(b=re,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:so(9,b)}}catch(he){bt(b,b.return,he)}if(b===v){re=null;break e}var Y=b.sibling;if(Y!==null){Y.return=b.return,re=Y;break e}re=b.return}}if(Ge=c,qr(),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot($e,e)}catch{}l=!0}return l}finally{rt=a,Pn.transition=t}}return!1}function dp(e,t,a){t=Ra(a,t),t=Ph(e,t,1),e=Hr(e,t,1),t=Xt(),e!==null&&(ci(e,1,t),dn(e,t))}function bt(e,t,a){if(e.tag===3)dp(e,e,a);else for(;t!==null;){if(t.tag===3){dp(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Vr===null||!Vr.has(l))){e=Ra(a,e),e=Th(t,e,1),t=Hr(t,e,1),e=Xt(),t!==null&&(ci(t,1,e),dn(t,e));break}}t=t.return}}function Bv(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),t=Xt(),e.pingedLanes|=e.suspendedLanes&a,Ut===e&&(Qt&a)===a&&(_t===4||_t===3&&(Qt&130023424)===Qt&&500>Ze()-wc?Ds(e,0):xc|=a),dn(e,t)}function fp(e,t){t===0&&((e.mode&1)===0?t=1:(t=xl,xl<<=1,(xl&130023424)===0&&(xl=4194304)));var a=Xt();e=mr(e,t),e!==null&&(ci(e,t,a),dn(e,a))}function Hv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),fp(e,a)}function Qv(e,t){var a=0;switch(e.tag){case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),fp(e,a)}var hp;hp=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||ln.current)un=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return un=!1,Mv(e,t,a);un=(e.flags&131072)!==0}else un=!1,gt&&(t.flags&1048576)!==0&&Vf(t,$l,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;no(e,t),e=t.pendingProps;var c=wa(t,Vt.current);Na(t,a),c=Ju(null,t,l,e,c,a);var f=Xu();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(l)?(f=!0,Il(t)):f=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Hu(t),c.updater=eo,t.stateNode=c,c._reactInternals=t,sc(t,l,e,a),t=oc(null,t,l,!0,f,a)):(t.tag=0,gt&&f&&Au(t),Jt(null,t,c,a),t=t.child),t;case 16:l=t.elementType;e:{switch(no(e,t),e=t.pendingProps,c=l._init,l=c(l._payload),t.type=l,c=t.tag=Wv(l),e=Un(l,e),c){case 0:t=lc(null,t,l,e,a);break e;case 1:t=zh(null,t,l,e,a);break e;case 11:t=Ah(null,t,l,e,a);break e;case 14:t=Dh(null,t,l,Un(l.type,e),a);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),lc(e,t,l,c,a);case 1:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),zh(e,t,l,c,a);case 3:e:{if(Uh(t),e===null)throw Error(s(387));l=t.pendingProps,f=t.memoizedState,c=f.element,th(e,t),Wl(t,l,null,a);var v=t.memoizedState;if(l=v.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){c=Ra(Error(s(423)),t),t=$h(e,t,l,a,c);break e}else if(l!==c){c=Ra(Error(s(424)),t),t=$h(e,t,l,a,c);break e}else for(xn=zr(t.stateNode.containerInfo.firstChild),vn=t,gt=!0,zn=null,a=Zf(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ba(),l===c){t=yr(e,t,a);break e}Jt(e,t,l,a)}t=t.child}return t;case 5:return sh(t),e===null&&Fu(t),l=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,v=c.children,Ru(l,c)?v=null:f!==null&&Ru(l,f)&&(t.flags|=32),Ih(e,t),Jt(e,t,v,a),t.child;case 6:return e===null&&Fu(t),null;case 13:return qh(e,t,a);case 4:return Qu(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Sa(t,null,l,a):Jt(e,t,l,a),t.child;case 11:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),Ah(e,t,l,c,a);case 7:return Jt(e,t,t.pendingProps,a),t.child;case 8:return Jt(e,t,t.pendingProps.children,a),t.child;case 12:return Jt(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(l=t.type._context,c=t.pendingProps,f=t.memoizedProps,v=c.value,dt(Hl,l._currentValue),l._currentValue=v,f!==null)if(In(f.value,v)){if(f.children===c.children&&!ln.current){t=yr(e,t,a);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var b=f.dependencies;if(b!==null){v=f.child;for(var R=b.firstContext;R!==null;){if(R.context===l){if(f.tag===1){R=gr(-1,a&-a),R.tag=2;var I=f.updateQueue;if(I!==null){I=I.shared;var W=I.pending;W===null?R.next=R:(R.next=W.next,W.next=R),I.pending=R}}f.lanes|=a,R=f.alternate,R!==null&&(R.lanes|=a),qu(f.return,a,t),b.lanes|=a;break}R=R.next}}else if(f.tag===10)v=f.type===t.type?null:f.child;else if(f.tag===18){if(v=f.return,v===null)throw Error(s(341));v.lanes|=a,b=v.alternate,b!==null&&(b.lanes|=a),qu(v,a,t),v=f.sibling}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}Jt(e,t,c.children,a),t=t.child}return t;case 9:return c=t.type,l=t.pendingProps.children,Na(t,a),c=En(c),l=l(c),t.flags|=1,Jt(e,t,l,a),t.child;case 14:return l=t.type,c=Un(l,t.pendingProps),c=Un(l.type,c),Dh(e,t,l,c,a);case 15:return Oh(e,t,t.type,t.pendingProps,a);case 17:return l=t.type,c=t.pendingProps,c=t.elementType===l?c:Un(l,c),no(e,t),t.tag=1,on(l)?(e=!0,Il(t)):e=!1,Na(t,a),Eh(t,l,c),sc(t,l,c,a),oc(null,t,l,!0,e,a);case 19:return Hh(e,t,a);case 22:return Fh(e,t,a)}throw Error(s(156,t.tag))};function pp(e,t){return at(e,t)}function Vv(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,a,l){return new Vv(e,t,a,l)}function Rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wv(e){if(typeof e=="function")return Rc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Je)return 11;if(e===Pe)return 14}return 2}function Yr(e,t){var a=e.alternate;return a===null?(a=Tn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function po(e,t,a,l,c,f){var v=2;if(l=e,typeof e=="function")Rc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case A:return Fs(a.children,c,f,t);case B:v=8,c|=8;break;case pe:return e=Tn(12,a,t,c|2),e.elementType=pe,e.lanes=f,e;case nt:return e=Tn(13,a,t,c),e.elementType=nt,e.lanes=f,e;case pt:return e=Tn(19,a,t,c),e.elementType=pt,e.lanes=f,e;case ye:return mo(a,c,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Z:v=10;break e;case Ue:v=9;break e;case Je:v=11;break e;case Pe:v=14;break e;case Te:v=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Tn(v,a,t,c),t.elementType=e,t.type=l,t.lanes=f,t}function Fs(e,t,a,l){return e=Tn(7,e,l,t),e.lanes=a,e}function mo(e,t,a,l){return e=Tn(22,e,l,t),e.elementType=ye,e.lanes=a,e.stateNode={isHidden:!1},e}function Pc(e,t,a){return e=Tn(6,e,null,t),e.lanes=a,e}function Tc(e,t,a){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kv(e,t,a,l,c){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ru(0),this.expirationTimes=ru(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ru(0),this.identifierPrefix=l,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Lc(e,t,a,l,c,f,v,b,R){return e=new Kv(e,t,a,b,R),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Tn(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:l,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hu(f),e}function Gv(e,t,a){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:se,key:l==null?null:""+l,children:e,containerInfo:t,implementation:a}}function mp(e){if(!e)return $r;e=e._reactInternals;e:{if(we(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(on(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var a=e.type;if(on(a))return Bf(e,a,t)}return t}function gp(e,t,a,l,c,f,v,b,R){return e=Lc(a,l,!0,e,c,f,v,b,R),e.context=mp(null),a=e.current,l=Xt(),c=Kr(a),f=gr(l,c),f.callback=t??null,Hr(a,f,c),e.current.lanes=c,ci(e,c,l),dn(e,l),e}function go(e,t,a,l){var c=t.current,f=Xt(),v=Kr(c);return a=mp(a),t.context===null?t.context=a:t.pendingContext=a,t=gr(f,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Hr(c,t,v),e!==null&&(Bn(e,c,v,f),Vl(e,c,v)),v}function yo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function yp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Mc(e,t){yp(e,t),(e=e.alternate)&&yp(e,t)}function Yv(){return null}var vp=typeof reportError=="function"?reportError:function(e){console.error(e)};function _c(e){this._internalRoot=e}vo.prototype.render=_c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));go(e,t,null,null)},vo.prototype.unmount=_c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;As(function(){go(null,e,null,null)}),t[dr]=null}};function vo(e){this._internalRoot=e}vo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ef();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Or.length&&t!==0&&t<Or[a].priority;a++);Or.splice(a,0,e),a===0&&rf(e)}};function Ac(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function xp(){}function Jv(e,t,a,l,c){if(c){if(typeof l=="function"){var f=l;l=function(){var I=yo(v);f.call(I)}}var v=gp(t,l,e,0,null,!1,!1,"",xp);return e._reactRootContainer=v,e[dr]=v.current,Si(e.nodeType===8?e.parentNode:e),As(),v}for(;c=e.lastChild;)e.removeChild(c);if(typeof l=="function"){var b=l;l=function(){var I=yo(R);b.call(I)}}var R=Lc(e,0,!1,null,null,!1,!1,"",xp);return e._reactRootContainer=R,e[dr]=R.current,Si(e.nodeType===8?e.parentNode:e),As(function(){go(t,R,a,l)}),R}function wo(e,t,a,l,c){var f=a._reactRootContainer;if(f){var v=f;if(typeof c=="function"){var b=c;c=function(){var R=yo(v);b.call(R)}}go(t,v,e,c)}else v=Jv(a,t,e,c,l);return yo(v)}Xd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=ui(t.pendingLanes);a!==0&&(su(t,a|1),dn(t,Ze()),(Ge&6)===0&&(La=Ze()+500,qr()))}break;case 13:As(function(){var l=mr(e,1);if(l!==null){var c=Xt();Bn(l,e,1,c)}}),Mc(e,1)}},au=function(e){if(e.tag===13){var t=mr(e,134217728);if(t!==null){var a=Xt();Bn(t,e,134217728,a)}Mc(e,134217728)}},Zd=function(e){if(e.tag===13){var t=Kr(e),a=mr(e,t);if(a!==null){var l=Xt();Bn(a,e,t,l)}Mc(e,t)}},ef=function(){return rt},tf=function(e,t){var a=rt;try{return rt=e,t()}finally{rt=a}},ia=function(e,t,a){switch(t){case"input":if(Za(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=Ol(l);if(!c)throw Error(s(90));sn(l),Za(l,c)}}}break;case"textarea":Rr(e,a);break;case"select":t=a.value,t!=null&&Er(e,!!a.multiple,t,!1)}},ws=Cc,ks=As;var Xv={usingClientEntryPoint:!1,Events:[Ei,va,Ol,gl,oi,Cc]},$i={findFiberByHostInstance:Ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zv={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Q.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jt(e),e===null?null:e.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||Yv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ko.isDisabled&&ko.supportsFiber)try{$e=ko.inject(Zv),lt=ko}catch{}}return fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xv,fn.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ac(t))throw Error(s(200));return Gv(e,t,null,a)},fn.createRoot=function(e,t){if(!Ac(e))throw Error(s(299));var a=!1,l="",c=vp;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Lc(e,1,!1,null,null,a,!1,l,c),e[dr]=t.current,Si(e.nodeType===8?e.parentNode:e),new _c(t)},fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=jt(t),e=e===null?null:e.stateNode,e},fn.flushSync=function(e){return As(e)},fn.hydrate=function(e,t,a){if(!xo(t))throw Error(s(200));return wo(null,e,t,!0,a)},fn.hydrateRoot=function(e,t,a){if(!Ac(e))throw Error(s(405));var l=a!=null&&a.hydratedSources||null,c=!1,f="",v=vp;if(a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),t=gp(t,null,e,1,a??null,c,!1,f,v),e[dr]=t.current,Si(e),l)for(e=0;e<l.length;e++)a=l[e],c=a._getVersion,c=c(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,c]:t.mutableSourceEagerHydrationData.push(a,c);return new vo(t)},fn.render=function(e,t,a){if(!xo(t))throw Error(s(200));return wo(null,e,t,!1,a)},fn.unmountComponentAtNode=function(e){if(!xo(e))throw Error(s(40));return e._reactRootContainer?(As(function(){wo(null,null,e,!1,function(){e._reactRootContainer=null,e[dr]=null})}),!0):!1},fn.unstable_batchedUpdates=Cc,fn.unstable_renderSubtreeIntoContainer=function(e,t,a,l){if(!xo(a))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return wo(e,t,a,!1,l)},fn.version="18.3.1-next-f1338f8080-20240426",fn}var Rp;function Bm(){if(Rp)return Ic.exports;Rp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Ic.exports=ux(),Ic.exports}var Pp;function cx(){if(Pp)return bo;Pp=1;var n=Bm();return bo.createRoot=n.createRoot,bo.hydrateRoot=n.hydrateRoot,bo}var dx=cx();const fx=qm(dx);var Ka=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hx={setTimeout:(n,r)=>setTimeout(n,r),clearTimeout:n=>clearTimeout(n),setInterval:(n,r)=>setInterval(n,r),clearInterval:n=>clearInterval(n)},rs,Cd,Lm,px=(Lm=class{constructor(){ke(this,rs,hx);ke(this,Cd,!1)}setTimeoutProvider(n){ee(this,rs,n)}setTimeout(n,r){return N(this,rs).setTimeout(n,r)}clearTimeout(n){N(this,rs).clearTimeout(n)}setInterval(n,r){return N(this,rs).setInterval(n,r)}clearInterval(n){N(this,rs).clearInterval(n)}},rs=new WeakMap,Cd=new WeakMap,Lm),zs=new px;function mx(n){setTimeout(n,0)}var Xs=typeof window>"u"||"Deno"in globalThis;function tn(){}function gx(n,r){return typeof n=="function"?n(r):n}function Gc(n){return typeof n=="number"&&n>=0&&n!==1/0}function Hm(n,r){return Math.max(n+(r||0)-Date.now(),0)}function hs(n,r){return typeof n=="function"?n(r):n}function _n(n,r){return typeof n=="function"?n(r):n}function Tp(n,r){const{type:s="all",exact:o,fetchStatus:u,predicate:d,queryKey:h,stale:p}=n;if(h){if(o){if(r.queryHash!==Ed(h,r.options))return!1}else if(!Zi(r.queryKey,h))return!1}if(s!=="all"){const g=r.isActive();if(s==="active"&&!g||s==="inactive"&&g)return!1}return!(typeof p=="boolean"&&r.isStale()!==p||u&&u!==r.state.fetchStatus||d&&!d(r))}function Lp(n,r){const{exact:s,status:o,predicate:u,mutationKey:d}=n;if(d){if(!r.options.mutationKey)return!1;if(s){if(Zs(r.options.mutationKey)!==Zs(d))return!1}else if(!Zi(r.options.mutationKey,d))return!1}return!(o&&r.state.status!==o||u&&!u(r))}function Ed(n,r){return((r==null?void 0:r.queryKeyHashFn)||Zs)(n)}function Zs(n){return JSON.stringify(n,(r,s)=>Yc(s)?Object.keys(s).sort().reduce((o,u)=>(o[u]=s[u],o),{}):s)}function Zi(n,r){return n===r?!0:typeof n!=typeof r?!1:n&&r&&typeof n=="object"&&typeof r=="object"?Object.keys(r).every(s=>Zi(n[s],r[s])):!1}var yx=Object.prototype.hasOwnProperty;function Qm(n,r){if(n===r)return n;const s=Mp(n)&&Mp(r);if(!s&&!(Yc(n)&&Yc(r)))return r;const u=(s?n:Object.keys(n)).length,d=s?r:Object.keys(r),h=d.length,p=s?new Array(h):{};let g=0;for(let m=0;m<h;m++){const y=s?m:d[m],w=n[y],x=r[y];if(w===x){p[y]=w,(s?m<u:yx.call(n,y))&&g++;continue}if(w===null||x===null||typeof w!="object"||typeof x!="object"){p[y]=x;continue}const j=Qm(w,x);p[y]=j,j===w&&g++}return u===h&&g===u?n:p}function Fo(n,r){if(!r||Object.keys(n).length!==Object.keys(r).length)return!1;for(const s in n)if(n[s]!==r[s])return!1;return!0}function Mp(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Yc(n){if(!_p(n))return!1;const r=n.constructor;if(r===void 0)return!0;const s=r.prototype;return!(!_p(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function _p(n){return Object.prototype.toString.call(n)==="[object Object]"}function vx(n){return new Promise(r=>{zs.setTimeout(r,n)})}function Jc(n,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,r):s.structuralSharing!==!1?Qm(n,r):r}function Ga(n){return n}function xx(n,r,s=0){const o=[...n,r];return s&&o.length>s?o.slice(1):o}function wx(n,r,s=0){const o=[r,...n];return s&&o.length>s?o.slice(0,-1):o}var Rd=Symbol();function Vm(n,r){return!n.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!n.queryFn||n.queryFn===Rd?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Wm(n,r){return typeof n=="function"?n(...r):!!n}var $s,ss,Oa,Mm,kx=(Mm=class extends Ka{constructor(){super();ke(this,$s);ke(this,ss);ke(this,Oa);ee(this,Oa,r=>{if(!Xs&&window.addEventListener){const s=()=>r();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){N(this,ss)||this.setEventListener(N(this,Oa))}onUnsubscribe(){var r;this.hasListeners()||((r=N(this,ss))==null||r.call(this),ee(this,ss,void 0))}setEventListener(r){var s;ee(this,Oa,r),(s=N(this,ss))==null||s.call(this),ee(this,ss,r(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(r){N(this,$s)!==r&&(ee(this,$s,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(s=>{s(r)})}isFocused(){var r;return typeof N(this,$s)=="boolean"?N(this,$s):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},$s=new WeakMap,ss=new WeakMap,Oa=new WeakMap,Mm),Pd=new kx;function Xc(){let n,r;const s=new Promise((u,d)=>{n=u,r=d});s.status="pending",s.catch(()=>{});function o(u){Object.assign(s,u),delete s.resolve,delete s.reject}return s.resolve=u=>{o({status:"fulfilled",value:u}),n(u)},s.reject=u=>{o({status:"rejected",reason:u}),r(u)},s}var jx=mx;function bx(){let n=[],r=0,s=p=>{p()},o=p=>{p()},u=jx;const d=p=>{r?n.push(p):u(()=>{s(p)})},h=()=>{const p=n;n=[],p.length&&u(()=>{o(()=>{p.forEach(g=>{s(g)})})})};return{batch:p=>{let g;r++;try{g=p()}finally{r--,r||h()}return g},batchCalls:p=>(...g)=>{d(()=>{p(...g)})},schedule:d,setNotifyFunction:p=>{s=p},setBatchNotifyFunction:p=>{o=p},setScheduler:p=>{u=p}}}var Dt=bx(),Fa,as,Ia,_m,Sx=(_m=class extends Ka{constructor(){super();ke(this,Fa,!0);ke(this,as);ke(this,Ia);ee(this,Ia,r=>{if(!Xs&&window.addEventListener){const s=()=>r(!0),o=()=>r(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}})}onSubscribe(){N(this,as)||this.setEventListener(N(this,Ia))}onUnsubscribe(){var r;this.hasListeners()||((r=N(this,as))==null||r.call(this),ee(this,as,void 0))}setEventListener(r){var s;ee(this,Ia,r),(s=N(this,as))==null||s.call(this),ee(this,as,r(this.setOnline.bind(this)))}setOnline(r){N(this,Fa)!==r&&(ee(this,Fa,r),this.listeners.forEach(o=>{o(r)}))}isOnline(){return N(this,Fa)}},Fa=new WeakMap,as=new WeakMap,Ia=new WeakMap,_m),Io=new Sx;function Cx(n){return Math.min(1e3*2**n,3e4)}function Km(n){return(n??"online")==="online"?Io.isOnline():!0}var Zc=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function Gm(n){let r=!1,s=0,o;const u=Xc(),d=()=>u.status!=="pending",h=E=>{var S;if(!d()){const P=new Zc(E);x(P),(S=n.onCancel)==null||S.call(n,P)}},p=()=>{r=!0},g=()=>{r=!1},m=()=>Pd.isFocused()&&(n.networkMode==="always"||Io.isOnline())&&n.canRun(),y=()=>Km(n.networkMode)&&n.canRun(),w=E=>{d()||(o==null||o(),u.resolve(E))},x=E=>{d()||(o==null||o(),u.reject(E))},j=()=>new Promise(E=>{var S;o=P=>{(d()||m())&&E(P)},(S=n.onPause)==null||S.call(n)}).then(()=>{var E;o=void 0,d()||(E=n.onContinue)==null||E.call(n)}),_=()=>{if(d())return;let E;const S=s===0?n.initialPromise:void 0;try{E=S??n.fn()}catch(P){E=Promise.reject(P)}Promise.resolve(E).then(w).catch(P=>{var se;if(d())return;const D=n.retry??(Xs?0:3),U=n.retryDelay??Cx,Q=typeof U=="function"?U(s,P):U,X=D===!0||typeof D=="number"&&s<D||typeof D=="function"&&D(s,P);if(r||!X){x(P);return}s++,(se=n.onFail)==null||se.call(n,s,P),vx(Q).then(()=>m()?void 0:j()).then(()=>{r?x(P):_()})})};return{promise:u,status:()=>u.status,cancel:h,continue:()=>(o==null||o(),u),cancelRetry:p,continueRetry:g,canStart:y,start:()=>(y()?_():j().then(_),u)}}var qs,Am,Ym=(Am=class{constructor(){ke(this,qs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gc(this.gcTime)&&ee(this,qs,zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Xs?1/0:300*1e3))}clearGcTimeout(){N(this,qs)&&(zs.clearTimeout(N(this,qs)),ee(this,qs,void 0))}},qs=new WeakMap,Am),Bs,za,Ln,Hs,qt,al,Qs,Hn,wr,Dm,Nx=(Dm=class extends Ym{constructor(r){super();ke(this,Hn);ke(this,Bs);ke(this,za);ke(this,Ln);ke(this,Hs);ke(this,qt);ke(this,al);ke(this,Qs);ee(this,Qs,!1),ee(this,al,r.defaultOptions),this.setOptions(r.options),this.observers=[],ee(this,Hs,r.client),ee(this,Ln,N(this,Hs).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,ee(this,Bs,Dp(this.options)),this.state=r.state??N(this,Bs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=N(this,qt))==null?void 0:r.promise}setOptions(r){if(this.options={...N(this,al),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Dp(this.options);s.data!==void 0&&(this.setState(Ap(s.data,s.dataUpdatedAt)),ee(this,Bs,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Ln).remove(this)}setData(r,s){const o=Jc(this.state.data,r,this.options);return De(this,Hn,wr).call(this,{data:o,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),o}setState(r,s){De(this,Hn,wr).call(this,{type:"setState",state:r,setStateOptions:s})}cancel(r){var o,u;const s=(o=N(this,qt))==null?void 0:o.promise;return(u=N(this,qt))==null||u.cancel(r),s?s.then(tn).catch(tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,Bs))}isActive(){return this.observers.some(r=>_n(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>hs(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!Hm(this.state.dataUpdatedAt,r)}onFocus(){var s;const r=this.observers.find(o=>o.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(s=N(this,qt))==null||s.continue()}onOnline(){var s;const r=this.observers.find(o=>o.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(s=N(this,qt))==null||s.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),N(this,Ln).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(s=>s!==r),this.observers.length||(N(this,qt)&&(N(this,Qs)?N(this,qt).cancel({revert:!0}):N(this,qt).cancelRetry()),this.scheduleGc()),N(this,Ln).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,Hn,wr).call(this,{type:"invalidate"})}async fetch(r,s){var g,m,y,w,x,j,_,E,S,P,D,U;if(this.state.fetchStatus!=="idle"&&((g=N(this,qt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(N(this,qt))return N(this,qt).continueRetry(),N(this,qt).promise}if(r&&this.setOptions(r),!this.options.queryFn){const Q=this.observers.find(X=>X.options.queryFn);Q&&this.setOptions(Q.options)}const o=new AbortController,u=Q=>{Object.defineProperty(Q,"signal",{enumerable:!0,get:()=>(ee(this,Qs,!0),o.signal)})},d=()=>{const Q=Vm(this.options,s),se=(()=>{const A={client:N(this,Hs),queryKey:this.queryKey,meta:this.meta};return u(A),A})();return ee(this,Qs,!1),this.options.persister?this.options.persister(Q,se,this):Q(se)},p=(()=>{const Q={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:N(this,Hs),state:this.state,fetchFn:d};return u(Q),Q})();(m=this.options.behavior)==null||m.onFetch(p,this),ee(this,za,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=p.fetchOptions)==null?void 0:y.meta))&&De(this,Hn,wr).call(this,{type:"fetch",meta:(w=p.fetchOptions)==null?void 0:w.meta}),ee(this,qt,Gm({initialPromise:s==null?void 0:s.initialPromise,fn:p.fetchFn,onCancel:Q=>{Q instanceof Zc&&Q.revert&&this.setState({...N(this,za),fetchStatus:"idle"}),o.abort()},onFail:(Q,X)=>{De(this,Hn,wr).call(this,{type:"failed",failureCount:Q,error:X})},onPause:()=>{De(this,Hn,wr).call(this,{type:"pause"})},onContinue:()=>{De(this,Hn,wr).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const Q=await N(this,qt).start();if(Q===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(Q),(j=(x=N(this,Ln).config).onSuccess)==null||j.call(x,Q,this),(E=(_=N(this,Ln).config).onSettled)==null||E.call(_,Q,this.state.error,this),Q}catch(Q){if(Q instanceof Zc){if(Q.silent)return N(this,qt).promise;if(Q.revert){if(this.state.data===void 0)throw Q;return this.state.data}}throw De(this,Hn,wr).call(this,{type:"error",error:Q}),(P=(S=N(this,Ln).config).onError)==null||P.call(S,Q,this),(U=(D=N(this,Ln).config).onSettled)==null||U.call(D,this.state.data,Q,this),Q}finally{this.scheduleGc()}}},Bs=new WeakMap,za=new WeakMap,Ln=new WeakMap,Hs=new WeakMap,qt=new WeakMap,al=new WeakMap,Qs=new WeakMap,Hn=new WeakSet,wr=function(r){const s=o=>{switch(r.type){case"failed":return{...o,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Jm(o.data,this.options),fetchMeta:r.meta??null};case"success":const u={...o,...Ap(r.data,r.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,za,r.manual?u:void 0),u;case"error":const d=r.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...r.state}}};this.state=s(this.state),Dt.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),N(this,Ln).notify({query:this,type:"updated",action:r})})},Dm);function Jm(n,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Km(r.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Ap(n,r){return{data:n,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dp(n){const r=typeof n.initialData=="function"?n.initialData():n.initialData,s=r!==void 0,o=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var hn,Ve,il,Zt,Vs,Ua,jr,is,ll,$a,qa,Ws,Ks,ls,Ba,et,Gi,ed,td,nd,rd,sd,ad,id,Xm,Om,Ex=(Om=class extends Ka{constructor(r,s){super();ke(this,et);ke(this,hn);ke(this,Ve);ke(this,il);ke(this,Zt);ke(this,Vs);ke(this,Ua);ke(this,jr);ke(this,is);ke(this,ll);ke(this,$a);ke(this,qa);ke(this,Ws);ke(this,Ks);ke(this,ls);ke(this,Ba,new Set);this.options=s,ee(this,hn,r),ee(this,is,null),ee(this,jr,Xc()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ve).addObserver(this),Op(N(this,Ve),this.options)?De(this,et,Gi).call(this):this.updateResult(),De(this,et,rd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ld(N(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ld(N(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,et,sd).call(this),De(this,et,ad).call(this),N(this,Ve).removeObserver(this)}setOptions(r){const s=this.options,o=N(this,Ve);if(this.options=N(this,hn).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _n(this.options.enabled,N(this,Ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,et,id).call(this),N(this,Ve).setOptions(this.options),s._defaulted&&!Fo(this.options,s)&&N(this,hn).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ve),observer:this});const u=this.hasListeners();u&&Fp(N(this,Ve),o,this.options,s)&&De(this,et,Gi).call(this),this.updateResult(),u&&(N(this,Ve)!==o||_n(this.options.enabled,N(this,Ve))!==_n(s.enabled,N(this,Ve))||hs(this.options.staleTime,N(this,Ve))!==hs(s.staleTime,N(this,Ve)))&&De(this,et,ed).call(this);const d=De(this,et,td).call(this);u&&(N(this,Ve)!==o||_n(this.options.enabled,N(this,Ve))!==_n(s.enabled,N(this,Ve))||d!==N(this,ls))&&De(this,et,nd).call(this,d)}getOptimisticResult(r){const s=N(this,hn).getQueryCache().build(N(this,hn),r),o=this.createResult(s,r);return Px(this,o)&&(ee(this,Zt,o),ee(this,Ua,this.options),ee(this,Vs,N(this,Ve).state)),o}getCurrentResult(){return N(this,Zt)}trackResult(r,s){return new Proxy(r,{get:(o,u)=>(this.trackProp(u),s==null||s(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,jr).status==="pending"&&N(this,jr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,u))})}trackProp(r){N(this,Ba).add(r)}getCurrentQuery(){return N(this,Ve)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const s=N(this,hn).defaultQueryOptions(r),o=N(this,hn).getQueryCache().build(N(this,hn),s);return o.fetch().then(()=>this.createResult(o,s))}fetch(r){return De(this,et,Gi).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Zt)))}createResult(r,s){var pe;const o=N(this,Ve),u=this.options,d=N(this,Zt),h=N(this,Vs),p=N(this,Ua),m=r!==o?r.state:N(this,il),{state:y}=r;let w={...y},x=!1,j;if(s._optimisticResults){const Z=this.hasListeners(),Ue=!Z&&Op(r,s),Je=Z&&Fp(r,o,s,u);(Ue||Je)&&(w={...w,...Jm(y.data,r.options)}),s._optimisticResults==="isRestoring"&&(w.fetchStatus="idle")}let{error:_,errorUpdatedAt:E,status:S}=w;j=w.data;let P=!1;if(s.placeholderData!==void 0&&j===void 0&&S==="pending"){let Z;d!=null&&d.isPlaceholderData&&s.placeholderData===(p==null?void 0:p.placeholderData)?(Z=d.data,P=!0):Z=typeof s.placeholderData=="function"?s.placeholderData((pe=N(this,qa))==null?void 0:pe.state.data,N(this,qa)):s.placeholderData,Z!==void 0&&(S="success",j=Jc(d==null?void 0:d.data,Z,s),x=!0)}if(s.select&&j!==void 0&&!P)if(d&&j===(h==null?void 0:h.data)&&s.select===N(this,ll))j=N(this,$a);else try{ee(this,ll,s.select),j=s.select(j),j=Jc(d==null?void 0:d.data,j,s),ee(this,$a,j),ee(this,is,null)}catch(Z){ee(this,is,Z)}N(this,is)&&(_=N(this,is),j=N(this,$a),E=Date.now(),S="error");const D=w.fetchStatus==="fetching",U=S==="pending",Q=S==="error",X=U&&D,se=j!==void 0,B={status:S,fetchStatus:w.fetchStatus,isPending:U,isSuccess:S==="success",isError:Q,isInitialLoading:X,isLoading:X,data:j,dataUpdatedAt:w.dataUpdatedAt,error:_,errorUpdatedAt:E,failureCount:w.fetchFailureCount,failureReason:w.fetchFailureReason,errorUpdateCount:w.errorUpdateCount,isFetched:w.dataUpdateCount>0||w.errorUpdateCount>0,isFetchedAfterMount:w.dataUpdateCount>m.dataUpdateCount||w.errorUpdateCount>m.errorUpdateCount,isFetching:D,isRefetching:D&&!U,isLoadingError:Q&&!se,isPaused:w.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:Q&&se,isStale:Td(r,s),refetch:this.refetch,promise:N(this,jr),isEnabled:_n(s.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const Z=nt=>{B.status==="error"?nt.reject(B.error):B.data!==void 0&&nt.resolve(B.data)},Ue=()=>{const nt=ee(this,jr,B.promise=Xc());Z(nt)},Je=N(this,jr);switch(Je.status){case"pending":r.queryHash===o.queryHash&&Z(Je);break;case"fulfilled":(B.status==="error"||B.data!==Je.value)&&Ue();break;case"rejected":(B.status!=="error"||B.error!==Je.reason)&&Ue();break}}return B}updateResult(){const r=N(this,Zt),s=this.createResult(N(this,Ve),this.options);if(ee(this,Vs,N(this,Ve).state),ee(this,Ua,this.options),N(this,Vs).data!==void 0&&ee(this,qa,N(this,Ve)),Fo(s,r))return;ee(this,Zt,s);const o=()=>{if(!r)return!0;const{notifyOnChangeProps:u}=this.options,d=typeof u=="function"?u():u;if(d==="all"||!d&&!N(this,Ba).size)return!0;const h=new Set(d??N(this,Ba));return this.options.throwOnError&&h.add("error"),Object.keys(N(this,Zt)).some(p=>{const g=p;return N(this,Zt)[g]!==r[g]&&h.has(g)})};De(this,et,Xm).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,et,rd).call(this)}},hn=new WeakMap,Ve=new WeakMap,il=new WeakMap,Zt=new WeakMap,Vs=new WeakMap,Ua=new WeakMap,jr=new WeakMap,is=new WeakMap,ll=new WeakMap,$a=new WeakMap,qa=new WeakMap,Ws=new WeakMap,Ks=new WeakMap,ls=new WeakMap,Ba=new WeakMap,et=new WeakSet,Gi=function(r){De(this,et,id).call(this);let s=N(this,Ve).fetch(this.options,r);return r!=null&&r.throwOnError||(s=s.catch(tn)),s},ed=function(){De(this,et,sd).call(this);const r=hs(this.options.staleTime,N(this,Ve));if(Xs||N(this,Zt).isStale||!Gc(r))return;const o=Hm(N(this,Zt).dataUpdatedAt,r)+1;ee(this,Ws,zs.setTimeout(()=>{N(this,Zt).isStale||this.updateResult()},o))},td=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ve)):this.options.refetchInterval)??!1},nd=function(r){De(this,et,ad).call(this),ee(this,ls,r),!(Xs||_n(this.options.enabled,N(this,Ve))===!1||!Gc(N(this,ls))||N(this,ls)===0)&&ee(this,Ks,zs.setInterval(()=>{(this.options.refetchIntervalInBackground||Pd.isFocused())&&De(this,et,Gi).call(this)},N(this,ls)))},rd=function(){De(this,et,ed).call(this),De(this,et,nd).call(this,De(this,et,td).call(this))},sd=function(){N(this,Ws)&&(zs.clearTimeout(N(this,Ws)),ee(this,Ws,void 0))},ad=function(){N(this,Ks)&&(zs.clearInterval(N(this,Ks)),ee(this,Ks,void 0))},id=function(){const r=N(this,hn).getQueryCache().build(N(this,hn),this.options);if(r===N(this,Ve))return;const s=N(this,Ve);ee(this,Ve,r),ee(this,il,r.state),this.hasListeners()&&(s==null||s.removeObserver(this),r.addObserver(this))},Xm=function(r){Dt.batch(()=>{r.listeners&&this.listeners.forEach(s=>{s(N(this,Zt))}),N(this,hn).getQueryCache().notify({query:N(this,Ve),type:"observerResultsUpdated"})})},Om);function Rx(n,r){return _n(r.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&r.retryOnMount===!1)}function Op(n,r){return Rx(n,r)||n.state.data!==void 0&&ld(n,r,r.refetchOnMount)}function ld(n,r,s){if(_n(r.enabled,n)!==!1&&hs(r.staleTime,n)!=="static"){const o=typeof s=="function"?s(n):s;return o==="always"||o!==!1&&Td(n,r)}return!1}function Fp(n,r,s,o){return(n!==r||_n(o.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&Td(n,s)}function Td(n,r){return _n(r.enabled,n)!==!1&&n.isStaleByTime(hs(r.staleTime,n))}function Px(n,r){return!Fo(n.getCurrentResult(),r)}function Ip(n){return{onFetch:(r,s)=>{var y,w,x,j,_;const o=r.options,u=(x=(w=(y=r.fetchOptions)==null?void 0:y.meta)==null?void 0:w.fetchMore)==null?void 0:x.direction,d=((j=r.state.data)==null?void 0:j.pages)||[],h=((_=r.state.data)==null?void 0:_.pageParams)||[];let p={pages:[],pageParams:[]},g=0;const m=async()=>{let E=!1;const S=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(r.signal.aborted?E=!0:r.signal.addEventListener("abort",()=>{E=!0}),r.signal)})},P=Vm(r.options,r.fetchOptions),D=async(U,Q,X)=>{if(E)return Promise.reject();if(Q==null&&U.pages.length)return Promise.resolve(U);const A=(()=>{const Ue={client:r.client,queryKey:r.queryKey,pageParam:Q,direction:X?"backward":"forward",meta:r.options.meta};return S(Ue),Ue})(),B=await P(A),{maxPages:pe}=r.options,Z=X?wx:xx;return{pages:Z(U.pages,B,pe),pageParams:Z(U.pageParams,Q,pe)}};if(u&&d.length){const U=u==="backward",Q=U?Tx:zp,X={pages:d,pageParams:h},se=Q(o,X);p=await D(X,se,U)}else{const U=n??d.length;do{const Q=g===0?h[0]??o.initialPageParam:zp(o,p);if(g>0&&Q==null)break;p=await D(p,Q),g++}while(g<U)}return p};r.options.persister?r.fetchFn=()=>{var E,S;return(S=(E=r.options).persister)==null?void 0:S.call(E,m,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s)}:r.fetchFn=m}}}function zp(n,{pages:r,pageParams:s}){const o=r.length-1;return r.length>0?n.getNextPageParam(r[o],r,s[o],s):void 0}function Tx(n,{pages:r,pageParams:s}){var o;return r.length>0?(o=n.getPreviousPageParam)==null?void 0:o.call(n,r[0],r,s[0],s):void 0}var ol,sr,en,Gs,ar,es,Fm,Lx=(Fm=class extends Ym{constructor(r){super();ke(this,ar);ke(this,ol);ke(this,sr);ke(this,en);ke(this,Gs);ee(this,ol,r.client),this.mutationId=r.mutationId,ee(this,en,r.mutationCache),ee(this,sr,[]),this.state=r.state||Zm(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){N(this,sr).includes(r)||(N(this,sr).push(r),this.clearGcTimeout(),N(this,en).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){ee(this,sr,N(this,sr).filter(s=>s!==r)),this.scheduleGc(),N(this,en).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){N(this,sr).length||(this.state.status==="pending"?this.scheduleGc():N(this,en).remove(this))}continue(){var r;return((r=N(this,Gs))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var h,p,g,m,y,w,x,j,_,E,S,P,D,U,Q,X,se,A,B,pe;const s=()=>{De(this,ar,es).call(this,{type:"continue"})},o={client:N(this,ol),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Gs,Gm({fn:()=>this.options.mutationFn?this.options.mutationFn(r,o):Promise.reject(new Error("No mutationFn found")),onFail:(Z,Ue)=>{De(this,ar,es).call(this,{type:"failed",failureCount:Z,error:Ue})},onPause:()=>{De(this,ar,es).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,en).canRun(this)}));const u=this.state.status==="pending",d=!N(this,Gs).canStart();try{if(u)s();else{De(this,ar,es).call(this,{type:"pending",variables:r,isPaused:d}),await((p=(h=N(this,en).config).onMutate)==null?void 0:p.call(h,r,this,o));const Ue=await((m=(g=this.options).onMutate)==null?void 0:m.call(g,r,o));Ue!==this.state.context&&De(this,ar,es).call(this,{type:"pending",context:Ue,variables:r,isPaused:d})}const Z=await N(this,Gs).start();return await((w=(y=N(this,en).config).onSuccess)==null?void 0:w.call(y,Z,r,this.state.context,this,o)),await((j=(x=this.options).onSuccess)==null?void 0:j.call(x,Z,r,this.state.context,o)),await((E=(_=N(this,en).config).onSettled)==null?void 0:E.call(_,Z,null,this.state.variables,this.state.context,this,o)),await((P=(S=this.options).onSettled)==null?void 0:P.call(S,Z,null,r,this.state.context,o)),De(this,ar,es).call(this,{type:"success",data:Z}),Z}catch(Z){try{throw await((U=(D=N(this,en).config).onError)==null?void 0:U.call(D,Z,r,this.state.context,this,o)),await((X=(Q=this.options).onError)==null?void 0:X.call(Q,Z,r,this.state.context,o)),await((A=(se=N(this,en).config).onSettled)==null?void 0:A.call(se,void 0,Z,this.state.variables,this.state.context,this,o)),await((pe=(B=this.options).onSettled)==null?void 0:pe.call(B,void 0,Z,r,this.state.context,o)),Z}finally{De(this,ar,es).call(this,{type:"error",error:Z})}}finally{N(this,en).runNext(this)}}},ol=new WeakMap,sr=new WeakMap,en=new WeakMap,Gs=new WeakMap,ar=new WeakSet,es=function(r){const s=o=>{switch(r.type){case"failed":return{...o,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...o,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:r.error,failureCount:o.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Dt.batch(()=>{N(this,sr).forEach(o=>{o.onMutationUpdate(r)}),N(this,en).notify({mutation:this,type:"updated",action:r})})},Fm);function Zm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var br,Qn,ul,Im,eg=(Im=class extends Ka{constructor(r={}){super();ke(this,br);ke(this,Qn);ke(this,ul);this.config=r,ee(this,br,new Set),ee(this,Qn,new Map),ee(this,ul,0)}build(r,s,o){const u=new Lx({client:r,mutationCache:this,mutationId:++jo(this,ul)._,options:r.defaultMutationOptions(s),state:o});return this.add(u),u}add(r){N(this,br).add(r);const s=So(r);if(typeof s=="string"){const o=N(this,Qn).get(s);o?o.push(r):N(this,Qn).set(s,[r])}this.notify({type:"added",mutation:r})}remove(r){if(N(this,br).delete(r)){const s=So(r);if(typeof s=="string"){const o=N(this,Qn).get(s);if(o)if(o.length>1){const u=o.indexOf(r);u!==-1&&o.splice(u,1)}else o[0]===r&&N(this,Qn).delete(s)}}this.notify({type:"removed",mutation:r})}canRun(r){const s=So(r);if(typeof s=="string"){const o=N(this,Qn).get(s),u=o==null?void 0:o.find(d=>d.state.status==="pending");return!u||u===r}else return!0}runNext(r){var o;const s=So(r);if(typeof s=="string"){const u=(o=N(this,Qn).get(s))==null?void 0:o.find(d=>d!==r&&d.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Dt.batch(()=>{N(this,br).forEach(r=>{this.notify({type:"removed",mutation:r})}),N(this,br).clear(),N(this,Qn).clear()})}getAll(){return Array.from(N(this,br))}find(r){const s={exact:!0,...r};return this.getAll().find(o=>Lp(s,o))}findAll(r={}){return this.getAll().filter(s=>Lp(r,s))}notify(r){Dt.batch(()=>{this.listeners.forEach(s=>{s(r)})})}resumePausedMutations(){const r=this.getAll().filter(s=>s.state.isPaused);return Dt.batch(()=>Promise.all(r.map(s=>s.continue().catch(tn))))}},br=new WeakMap,Qn=new WeakMap,ul=new WeakMap,Im);function So(n){var r;return(r=n.options.scope)==null?void 0:r.id}var Sr,os,pn,Cr,Nr,Mo,od,zm,Mx=(zm=class extends Ka{constructor(s,o){super();ke(this,Nr);ke(this,Sr);ke(this,os);ke(this,pn);ke(this,Cr);ee(this,Sr,s),this.setOptions(o),this.bindMethods(),De(this,Nr,Mo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var u;const o=this.options;this.options=N(this,Sr).defaultMutationOptions(s),Fo(this.options,o)||N(this,Sr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,pn),observer:this}),o!=null&&o.mutationKey&&this.options.mutationKey&&Zs(o.mutationKey)!==Zs(this.options.mutationKey)?this.reset():((u=N(this,pn))==null?void 0:u.state.status)==="pending"&&N(this,pn).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=N(this,pn))==null||s.removeObserver(this)}onMutationUpdate(s){De(this,Nr,Mo).call(this),De(this,Nr,od).call(this,s)}getCurrentResult(){return N(this,os)}reset(){var s;(s=N(this,pn))==null||s.removeObserver(this),ee(this,pn,void 0),De(this,Nr,Mo).call(this),De(this,Nr,od).call(this)}mutate(s,o){var u;return ee(this,Cr,o),(u=N(this,pn))==null||u.removeObserver(this),ee(this,pn,N(this,Sr).getMutationCache().build(N(this,Sr),this.options)),N(this,pn).addObserver(this),N(this,pn).execute(s)}},Sr=new WeakMap,os=new WeakMap,pn=new WeakMap,Cr=new WeakMap,Nr=new WeakSet,Mo=function(){var o;const s=((o=N(this,pn))==null?void 0:o.state)??Zm();ee(this,os,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},od=function(s){Dt.batch(()=>{var o,u,d,h,p,g,m,y;if(N(this,Cr)&&this.hasListeners()){const w=N(this,os).variables,x=N(this,os).context,j={client:N(this,Sr),meta:this.options.meta,mutationKey:this.options.mutationKey};(s==null?void 0:s.type)==="success"?((u=(o=N(this,Cr)).onSuccess)==null||u.call(o,s.data,w,x,j),(h=(d=N(this,Cr)).onSettled)==null||h.call(d,s.data,null,w,x,j)):(s==null?void 0:s.type)==="error"&&((g=(p=N(this,Cr)).onError)==null||g.call(p,s.error,w,x,j),(y=(m=N(this,Cr)).onSettled)==null||y.call(m,void 0,s.error,w,x,j))}this.listeners.forEach(w=>{w(N(this,os))})})},zm),ir,Um,_x=(Um=class extends Ka{constructor(r={}){super();ke(this,ir);this.config=r,ee(this,ir,new Map)}build(r,s,o){const u=s.queryKey,d=s.queryHash??Ed(u,s);let h=this.get(d);return h||(h=new Nx({client:r,queryKey:u,queryHash:d,options:r.defaultQueryOptions(s),state:o,defaultOptions:r.getQueryDefaults(u)}),this.add(h)),h}add(r){N(this,ir).has(r.queryHash)||(N(this,ir).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const s=N(this,ir).get(r.queryHash);s&&(r.destroy(),s===r&&N(this,ir).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){Dt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return N(this,ir).get(r)}getAll(){return[...N(this,ir).values()]}find(r){const s={exact:!0,...r};return this.getAll().find(o=>Tp(s,o))}findAll(r={}){const s=this.getAll();return Object.keys(r).length>0?s.filter(o=>Tp(r,o)):s}notify(r){Dt.batch(()=>{this.listeners.forEach(s=>{s(r)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},ir=new WeakMap,Um),St,us,cs,Ha,Qa,ds,Va,Wa,$m,Ax=($m=class{constructor(n={}){ke(this,St);ke(this,us);ke(this,cs);ke(this,Ha);ke(this,Qa);ke(this,ds);ke(this,Va);ke(this,Wa);ee(this,St,n.queryCache||new _x),ee(this,us,n.mutationCache||new eg),ee(this,cs,n.defaultOptions||{}),ee(this,Ha,new Map),ee(this,Qa,new Map),ee(this,ds,0)}mount(){jo(this,ds)._++,N(this,ds)===1&&(ee(this,Va,Pd.subscribe(async n=>{n&&(await this.resumePausedMutations(),N(this,St).onFocus())})),ee(this,Wa,Io.subscribe(async n=>{n&&(await this.resumePausedMutations(),N(this,St).onOnline())})))}unmount(){var n,r;jo(this,ds)._--,N(this,ds)===0&&((n=N(this,Va))==null||n.call(this),ee(this,Va,void 0),(r=N(this,Wa))==null||r.call(this),ee(this,Wa,void 0))}isFetching(n){return N(this,St).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return N(this,us).findAll({...n,status:"pending"}).length}getQueryData(n){var s;const r=this.defaultQueryOptions({queryKey:n});return(s=N(this,St).get(r.queryHash))==null?void 0:s.state.data}ensureQueryData(n){const r=this.defaultQueryOptions(n),s=N(this,St).build(this,r),o=s.state.data;return o===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(hs(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(n){return N(this,St).findAll(n).map(({queryKey:r,state:s})=>{const o=s.data;return[r,o]})}setQueryData(n,r,s){const o=this.defaultQueryOptions({queryKey:n}),u=N(this,St).get(o.queryHash),d=u==null?void 0:u.state.data,h=gx(r,d);if(h!==void 0)return N(this,St).build(this,o).setData(h,{...s,manual:!0})}setQueriesData(n,r,s){return Dt.batch(()=>N(this,St).findAll(n).map(({queryKey:o})=>[o,this.setQueryData(o,r,s)]))}getQueryState(n){var s;const r=this.defaultQueryOptions({queryKey:n});return(s=N(this,St).get(r.queryHash))==null?void 0:s.state}removeQueries(n){const r=N(this,St);Dt.batch(()=>{r.findAll(n).forEach(s=>{r.remove(s)})})}resetQueries(n,r){const s=N(this,St);return Dt.batch(()=>(s.findAll(n).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...n},r)))}cancelQueries(n,r={}){const s={revert:!0,...r},o=Dt.batch(()=>N(this,St).findAll(n).map(u=>u.cancel(s)));return Promise.all(o).then(tn).catch(tn)}invalidateQueries(n,r={}){return Dt.batch(()=>(N(this,St).findAll(n).forEach(s=>{s.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},r)))}refetchQueries(n,r={}){const s={...r,cancelRefetch:r.cancelRefetch??!0},o=Dt.batch(()=>N(this,St).findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let d=u.fetch(void 0,s);return s.throwOnError||(d=d.catch(tn)),u.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(o).then(tn)}fetchQuery(n){const r=this.defaultQueryOptions(n);r.retry===void 0&&(r.retry=!1);const s=N(this,St).build(this,r);return s.isStaleByTime(hs(r.staleTime,s))?s.fetch(r):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(tn).catch(tn)}fetchInfiniteQuery(n){return n.behavior=Ip(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(tn).catch(tn)}ensureInfiniteQueryData(n){return n.behavior=Ip(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Io.isOnline()?N(this,us).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,St)}getMutationCache(){return N(this,us)}getDefaultOptions(){return N(this,cs)}setDefaultOptions(n){ee(this,cs,n)}setQueryDefaults(n,r){N(this,Ha).set(Zs(n),{queryKey:n,defaultOptions:r})}getQueryDefaults(n){const r=[...N(this,Ha).values()],s={};return r.forEach(o=>{Zi(n,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(n,r){N(this,Qa).set(Zs(n),{mutationKey:n,defaultOptions:r})}getMutationDefaults(n){const r=[...N(this,Qa).values()],s={};return r.forEach(o=>{Zi(n,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const r={...N(this,cs).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return r.queryHash||(r.queryHash=Ed(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Rd&&(r.enabled=!1),r}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...N(this,cs).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){N(this,St).clear(),N(this,us).clear()}},St=new WeakMap,us=new WeakMap,cs=new WeakMap,Ha=new WeakMap,Qa=new WeakMap,ds=new WeakMap,Va=new WeakMap,Wa=new WeakMap,$m),tg=k.createContext(void 0),Ct=n=>{const r=k.useContext(tg);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},Dx=({client:n,children:r})=>(k.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),i.jsx(tg.Provider,{value:n,children:r})),ng=k.createContext(!1),Ox=()=>k.useContext(ng);ng.Provider;function Fx(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Ix=k.createContext(Fx()),zx=()=>k.useContext(Ix),Ux=(n,r)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(r.isReset()||(n.retryOnMount=!1))},$x=n=>{k.useEffect(()=>{n.clearReset()},[n])},qx=({result:n,errorResetBoundary:r,throwOnError:s,query:o,suspense:u})=>n.isError&&!r.isReset()&&!n.isFetching&&o&&(u&&n.data===void 0||Wm(s,[n.error,o])),Bx=n=>{if(n.suspense){const s=u=>u==="static"?u:Math.max(u??1e3,1e3),o=n.staleTime;n.staleTime=typeof o=="function"?(...u)=>s(o(...u)):s(o),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Hx=(n,r)=>n.isLoading&&n.isFetching&&!r,Qx=(n,r)=>(n==null?void 0:n.suspense)&&r.isPending,Up=(n,r,s)=>r.fetchOptimistic(n).catch(()=>{s.clearReset()});function Vx(n,r,s){var w,x,j,_,E;const o=Ox(),u=zx(),d=Ct(),h=d.defaultQueryOptions(n);(x=(w=d.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||x.call(w,h),h._optimisticResults=o?"isRestoring":"optimistic",Bx(h),Ux(h,u),$x(u);const p=!d.getQueryCache().get(h.queryHash),[g]=k.useState(()=>new r(d,h)),m=g.getOptimisticResult(h),y=!o&&n.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(S=>{const P=y?g.subscribe(Dt.batchCalls(S)):tn;return g.updateResult(),P},[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),k.useEffect(()=>{g.setOptions(h)},[h,g]),Qx(h,m))throw Up(h,g,u);if(qx({result:m,errorResetBoundary:u,throwOnError:h.throwOnError,query:d.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw m.error;if((_=(j=d.getDefaultOptions().queries)==null?void 0:j._experimental_afterQuery)==null||_.call(j,h,m),h.experimental_prefetchInRender&&!Xs&&Hx(m,o)){const S=p?Up(h,g,u):(E=d.getQueryCache().get(h.queryHash))==null?void 0:E.promise;S==null||S.catch(tn).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?m:g.trackResult(m)}function Rt(n,r){return Vx(n,Ex)}function Ft(n,r){const s=Ct(),[o]=k.useState(()=>new Mx(s,n));k.useEffect(()=>{o.setOptions(n)},[o,n]);const u=k.useSyncExternalStore(k.useCallback(h=>o.subscribe(Dt.batchCalls(h)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d=k.useCallback((h,p)=>{o.mutate(h,p).catch(tn)},[o]);if(u.error&&Wm(o.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:d,mutateAsync:u.mutate}}/**
|
|
41
41
|
* react-router v7.9.6
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,10 +46,10 @@ Error generating stack: `+f.message+`
|
|
|
46
46
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
47
|
*
|
|
48
48
|
* @license MIT
|
|
49
|
-
*/var rg=n=>{throw TypeError(n)},Wx=(n,r,s)=>r.has(n)||rg("Cannot "+s),$c=(n,r,s)=>(Wx(n,r,"read from private field"),s?s.call(n):r.get(n)),Kx=(n,r,s)=>r.has(n)?rg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),$p="popstate";function Gx(n={}){function r(o,u){let{pathname:d,search:h,hash:p}=o.location;return Zi("",{pathname:d,search:h,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function s(o,u){return typeof u=="string"?u:or(u)}return Jx(r,s,null,n)}function Ie(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function wt(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Yx(){return Math.random().toString(36).substring(2,10)}function qp(n,r){return{usr:n.state,key:n.key,idx:r}}function Zi(n,r,s=null,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?ms(r):r,state:s,key:r&&r.key||o||Yx()}}function or({pathname:n="/",search:r="",hash:s=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function ms(n){let r={};if(n){let s=n.indexOf("#");s>=0&&(r.hash=n.substring(s),n=n.substring(0,s));let o=n.indexOf("?");o>=0&&(r.search=n.substring(o),n=n.substring(0,o)),n&&(r.pathname=n)}return r}function Jx(n,r,s,o={}){let{window:u=document.defaultView,v5Compat:d=!1}=o,h=u.history,p="POP",g=null,m=y();m==null&&(m=0,h.replaceState({...h.state,idx:m},""));function y(){return(h.state||{idx:null}).idx}function w(){p="POP";let S=y(),L=S==null?null:S-m;m=S,g&&g({action:p,location:N.location,delta:L})}function x(S,L){p="PUSH";let z=Zi(N.location,S,L);m=y()+1;let $=qp(z,m),Q=N.createHref(z);try{h.pushState($,"",Q)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;u.location.assign(Q)}d&&g&&g({action:p,location:N.location,delta:1})}function j(S,L){p="REPLACE";let z=Zi(N.location,S,L);m=y();let $=qp(z,m),Q=N.createHref(z);h.replaceState($,"",Q),d&&g&&g({action:p,location:N.location,delta:0})}function T(S){return sg(S)}let N={get action(){return p},get location(){return n(u,h)},listen(S){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener($p,w),g=S,()=>{u.removeEventListener($p,w),g=null}},createHref(S){return r(u,S)},createURL:T,encodeLocation(S){let L=T(S);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:x,replace:j,go(S){return h.go(S)}};return N}function sg(n,r=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),Ie(s,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:or(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=s+o),new URL(o,s)}var Yi,Bp=class{constructor(n){if(Kx(this,Yi,new Map),n)for(let[r,s]of n)this.set(r,s)}get(n){if($c(this,Yi).has(n))return $c(this,Yi).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,r){$c(this,Yi).set(n,r)}};Yi=new WeakMap;var Xx=new Set(["lazy","caseSensitive","path","id","index","children"]);function Zx(n){return Xx.has(n)}var e0=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function t0(n){return e0.has(n)}function n0(n){return n.index===!0}function el(n,r,s=[],o={},u=!1){return n.map((d,h)=>{let p=[...s,String(h)],g=typeof d.id=="string"?d.id:p.join("-");if(Ie(d.index!==!0||!d.children,"Cannot specify children on an index route"),Ie(u||!o[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),n0(d)){let m={...d,id:g};return o[g]=Hp(m,r(m)),m}else{let m={...d,id:g,children:void 0};return o[g]=Hp(m,r(m)),d.children&&(m.children=el(d.children,r,p,o,u)),m}})}function Hp(n,r){return Object.assign(n,{...r,...typeof r.lazy=="object"&&r.lazy!=null?{lazy:{...n.lazy,...r.lazy}}:{}})}function ts(n,r,s="/"){return Ji(n,r,s,!1)}function Ji(n,r,s,o){let u=typeof r=="string"?ms(r):r,d=An(u.pathname||"/",s);if(d==null)return null;let h=ag(n);s0(h);let p=null;for(let g=0;p==null&&g<h.length;++g){let m=m0(d);p=h0(h[g],m,o)}return p}function r0(n,r){let{route:s,pathname:o,params:u}=n;return{id:s.id,pathname:o,params:u,data:r[s.id],loaderData:r[s.id],handle:s.handle}}function ag(n,r=[],s=[],o="",u=!1){let d=(h,p,g=u,m)=>{let y={relativePath:m===void 0?h.path||"":m,caseSensitive:h.caseSensitive===!0,childrenIndex:p,route:h};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&g)return;Ie(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let w=lr([o,y.relativePath]),x=s.concat(y);h.children&&h.children.length>0&&(Ie(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),ag(h.children,r,x,w,g)),!(h.path==null&&!h.index)&&r.push({path:w,score:d0(w,h.index),routesMeta:x})};return n.forEach((h,p)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,p);else for(let m of ig(h.path))d(h,p,!0,m)}),r}function ig(n){let r=n.split("/");if(r.length===0)return[];let[s,...o]=r,u=s.endsWith("?"),d=s.replace(/\?$/,"");if(o.length===0)return u?[d,""]:[d];let h=ig(o.join("/")),p=[];return p.push(...h.map(g=>g===""?d:[d,g].join("/"))),u&&p.push(...h),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function s0(n){n.sort((r,s)=>r.score!==s.score?s.score-r.score:f0(r.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var a0=/^:[\w-]+$/,i0=3,l0=2,o0=1,u0=10,c0=-2,Qp=n=>n==="*";function d0(n,r){let s=n.split("/"),o=s.length;return s.some(Qp)&&(o+=c0),r&&(o+=l0),s.filter(u=>!Qp(u)).reduce((u,d)=>u+(a0.test(d)?i0:d===""?o0:u0),o)}function f0(n,r){return n.length===r.length&&n.slice(0,-1).every((o,u)=>o===r[u])?n[n.length-1]-r[r.length-1]:0}function h0(n,r,s=!1){let{routesMeta:o}=n,u={},d="/",h=[];for(let p=0;p<o.length;++p){let g=o[p],m=p===o.length-1,y=d==="/"?r:r.slice(d.length)||"/",w=zo({path:g.relativePath,caseSensitive:g.caseSensitive,end:m},y),x=g.route;if(!w&&m&&s&&!o[o.length-1].route.index&&(w=zo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!w)return null;Object.assign(u,w.params),h.push({params:u,pathname:lr([d,w.pathname]),pathnameBase:x0(lr([d,w.pathnameBase])),route:x}),w.pathnameBase!=="/"&&(d=lr([d,w.pathnameBase]))}return h}function zo(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,o]=p0(n.path,n.caseSensitive,n.end),u=r.match(s);if(!u)return null;let d=u[0],h=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:o.reduce((m,{paramName:y,isOptional:w},x)=>{if(y==="*"){let T=p[x]||"";h=d.slice(0,d.length-T.length).replace(/(.)\/+$/,"$1")}const j=p[x];return w&&!j?m[y]=void 0:m[y]=(j||"").replace(/%2F/g,"/"),m},{}),pathname:d,pathnameBase:h,pattern:n}}function p0(n,r=!1,s=!0){wt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,g)=>(o.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,r?void 0:"i"),o]}function m0(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return wt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),n}}function An(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let s=r.endsWith("/")?r.length-1:r.length,o=n.charAt(s);return o&&o!=="/"?null:n.slice(s)||"/"}function g0({basename:n,pathname:r}){return r==="/"?n:lr([n,r])}var y0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ho=n=>y0.test(n);function v0(n,r="/"){let{pathname:s,search:o="",hash:u=""}=typeof n=="string"?ms(n):n,d;if(s)if(Ho(s))d=s;else{if(s.includes("//")){let h=s;s=s.replace(/\/\/+/g,"/"),wt(!1,`Pathnames cannot have embedded double slashes - normalizing ${h} -> ${s}`)}s.startsWith("/")?d=Vp(s.substring(1),"/"):d=Vp(s,r)}else d=r;return{pathname:d,search:w0(o),hash:k0(u)}}function Vp(n,r){let s=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(u=>{u===".."?s.length>1&&s.pop():u!=="."&&s.push(u)}),s.length>1?s.join("/"):"/"}function qc(n,r,s,o){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lg(n){return n.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function Qo(n){let r=lg(n);return r.map((s,o)=>o===r.length-1?s.pathname:s.pathnameBase)}function Vo(n,r,s,o=!1){let u;typeof n=="string"?u=ms(n):(u={...n},Ie(!u.pathname||!u.pathname.includes("?"),qc("?","pathname","search",u)),Ie(!u.pathname||!u.pathname.includes("#"),qc("#","pathname","hash",u)),Ie(!u.search||!u.search.includes("#"),qc("#","search","hash",u)));let d=n===""||u.pathname==="",h=d?"/":u.pathname,p;if(h==null)p=s;else{let w=r.length-1;if(!o&&h.startsWith("..")){let x=h.split("/");for(;x[0]==="..";)x.shift(),w-=1;u.pathname=x.join("/")}p=w>=0?r[w]:"/"}let g=v0(u,p),m=h&&h!=="/"&&h.endsWith("/"),y=(d||h===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(m||y)&&(g.pathname+="/"),g}var lr=n=>n.join("/").replace(/\/\/+/g,"/"),x0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),w0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,k0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Uo=class{constructor(n,r,s,o=!1){this.status=n,this.statusText=r||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function tl(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Ld(n){return n.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var fs=Symbol("Uninstrumented");function j0(n,r){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(u=>u({id:r.id,index:r.index,path:r.path,instrument(d){let h=Object.keys(s);for(let p of h)d[p]&&s[p].push(d[p])}}));let o={};if(typeof r.lazy=="function"&&s.lazy.length>0){let u=Aa(s.lazy,r.lazy,()=>{});u&&(o.lazy=u)}if(typeof r.lazy=="object"){let u=r.lazy;["middleware","loader","action"].forEach(d=>{let h=u[d],p=s[`lazy.${d}`];if(typeof h=="function"&&p.length>0){let g=Aa(p,h,()=>{});g&&(o.lazy=Object.assign(o.lazy||{},{[d]:g}))}})}return["loader","action"].forEach(u=>{let d=r[u];if(typeof d=="function"&&s[u].length>0){let h=d[fs]??d,p=Aa(s[u],h,(...g)=>Wp(g[0]));p&&(p[fs]=h,o[u]=p)}}),r.middleware&&r.middleware.length>0&&s.middleware.length>0&&(o.middleware=r.middleware.map(u=>{let d=u[fs]??u,h=Aa(s.middleware,d,(...p)=>Wp(p[0]));return h?(h[fs]=d,h):u})),o}function b0(n,r){let s={navigate:[],fetch:[]};if(r.forEach(o=>o({instrument(u){let d=Object.keys(u);for(let h of d)u[h]&&s[h].push(u[h])}})),s.navigate.length>0){let o=n.navigate[fs]??n.navigate,u=Aa(s.navigate,o,(...d)=>{let[h,p]=d;return{to:typeof h=="number"||typeof h=="string"?h:h?or(h):".",...Kp(n,p??{})}});u&&(u[fs]=o,n.navigate=u)}if(s.fetch.length>0){let o=n.fetch[fs]??n.fetch,u=Aa(s.fetch,o,(...d)=>{let[h,,p,g]=d;return{href:p??".",fetcherKey:h,...Kp(n,g??{})}});u&&(u[fs]=o,n.fetch=u)}return n}function Aa(n,r,s){return n.length===0?null:async(...o)=>{let u=await og(n,s(...o),()=>r(...o),n.length-1);if(u.type==="error")throw u.value;return u.value}}async function og(n,r,s,o){let u=n[o],d;if(u){let h,p=async()=>(h?console.error("You cannot call instrumented handlers more than once"):h=og(n,r,s,o-1),d=await h,Ie(d,"Expected a result"),d.type==="error"&&d.value instanceof Error?{status:"error",error:d.value}:{status:"success",error:void 0});try{await u(p,r)}catch(g){console.error("An instrumentation function threw an error:",g)}h||await p(),await h}else try{d={type:"success",value:await s()}}catch(h){d={type:"error",value:h}}return d||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Wp(n){let{request:r,context:s,params:o,unstable_pattern:u}=n;return{request:S0(r),params:{...o},unstable_pattern:u,context:C0(s)}}function Kp(n,r){return{currentUrl:or(n.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function S0(n){return{method:n.method,url:n.url,headers:{get:(...r)=>n.headers.get(...r)}}}function C0(n){if(E0(n)){let r={...n};return Object.freeze(r),r}else return{get:r=>n.get(r)}}var N0=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function E0(n){if(n===null||typeof n!="object")return!1;const r=Object.getPrototypeOf(n);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===N0}var ug=["POST","PUT","PATCH","DELETE"],R0=new Set(ug),P0=["GET",...ug],T0=new Set(P0),L0=new Set([301,302,303,307,308]),M0=new Set([307,308]),Bc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_0={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Hi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},A0=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),cg="remix-router-transitions",dg=Symbol("ResetLoaderData");function D0(n){const r=n.window?n.window:typeof window<"u"?window:void 0,s=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";Ie(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let o=n.hydrationRouteProperties||[],u=n.mapRouteProperties||A0,d=u;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;d=_=>({...u(_),...j0(C.map(I=>I.route).filter(Boolean),_)})}let h={},p=el(n.routes,d,void 0,h),g,m=n.basename||"/";m.startsWith("/")||(m=`/${m}`);let y=n.dataStrategy||U0,w={...n.future},x=null,j=new Set,T=null,N=null,S=null,L=n.hydrationData!=null,z=ts(p,n.history.location,m),$=!1,Q=null,X;if(z==null&&!n.patchRoutesOnNavigation){let C=Mn(404,{pathname:n.history.location.pathname}),{matches:_,route:I}=So(p);X=!0,z=_,Q={[I.id]:C}}else if(z&&!n.hydrationData&&ws(z,p,n.history.location.pathname).active&&(z=null),z)if(z.some(C=>C.route.lazy))X=!1;else if(!z.some(C=>Md(C.route)))X=!0;else{let C=n.hydrationData?n.hydrationData.loaderData:null,_=n.hydrationData?n.hydrationData.errors:null;if(_){let I=z.findIndex(V=>_[V.route.id]!==void 0);X=z.slice(0,I+1).every(V=>!cd(V.route,C,_))}else X=z.every(I=>!cd(I.route,C,_))}else{X=!1,z=[];let C=ws(null,p,n.history.location.pathname);C.active&&C.matches&&($=!0,z=C.matches)}let se,A={historyAction:n.history.action,location:n.history.location,matches:z,initialized:X,navigation:Bc,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||Q,fetchers:new Map,blockers:new Map},B="POP",pe=!1,Z,ze=!1,Je=new Map,nt=null,pt=!1,Re=!1,Pe=new Set,ye=new Map,G=0,ne=-1,U=new Map,M=new Set,q=new Map,be=new Map,ve=new Set,xe=new Map,Se,Oe=null;function Ke(){if(x=n.history.listen(({action:C,location:_,delta:I})=>{if(Se){Se(),Se=void 0;return}wt(xe.size===0||I!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let V=ia({currentLocation:A.location,nextLocation:_,historyAction:C});if(V&&I!=null){let J=new Promise(ce=>{Se=ce});n.history.go(I*-1),Pr(V,{state:"blocked",location:_,proceed(){Pr(V,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),J.then(()=>n.history.go(I))},reset(){let ce=new Map(A.blockers);ce.set(V,Hi),ct({blockers:ce})}});return}return Yn(C,_)}),s){tw(r,Je);let C=()=>nw(r,Je);r.addEventListener("pagehide",C),nt=()=>r.removeEventListener("pagehide",C)}return A.initialized||Yn("POP",A.location,{initialHydration:!0}),se}function _e(){x&&x(),nt&&nt(),j.clear(),Z&&Z.abort(),A.fetchers.forEach((C,_)=>ur(_)),A.blockers.forEach((C,_)=>aa(_))}function It(C){return j.add(C),()=>j.delete(C)}function ct(C,_={}){C.matches&&(C.matches=C.matches.map(J=>{let ce=h[J.route.id],fe=J.route;return fe.element!==ce.element||fe.errorElement!==ce.errorElement||fe.hydrateFallbackElement!==ce.hydrateFallbackElement?{...J,route:ce}:J})),A={...A,...C};let I=[],V=[];A.fetchers.forEach((J,ce)=>{J.state==="idle"&&(ve.has(ce)?I.push(ce):V.push(ce))}),ve.forEach(J=>{!A.fetchers.has(J)&&!ye.has(J)&&I.push(J)}),[...j].forEach(J=>J(A,{deletedFetchers:I,viewTransitionOpts:_.viewTransitionOpts,flushSync:_.flushSync===!0})),I.forEach(J=>ur(J)),V.forEach(J=>A.fetchers.delete(J))}function sn(C,_,{flushSync:I}={}){var we,ge;let V=A.actionData!=null&&A.navigation.formMethod!=null&&nn(A.navigation.formMethod)&&A.navigation.state==="loading"&&((we=C.state)==null?void 0:we._isRedirect)!==!0,J;_.actionData?Object.keys(_.actionData).length>0?J=_.actionData:J=null:V?J=A.actionData:J=null;let ce=_.loaderData?sm(A.loaderData,_.loaderData,_.matches||[],_.errors):A.loaderData,fe=A.blockers;fe.size>0&&(fe=new Map(fe),fe.forEach((Ae,st)=>fe.set(st,Hi)));let de=pt?!1:oi(C,_.matches||A.matches),me=pe===!0||A.navigation.formMethod!=null&&nn(A.navigation.formMethod)&&((ge=C.state)==null?void 0:ge._isRedirect)!==!0;g&&(p=g,g=void 0),pt||B==="POP"||(B==="PUSH"?n.history.push(C,C.state):B==="REPLACE"&&n.history.replace(C,C.state));let je;if(B==="POP"){let Ae=Je.get(A.location.pathname);Ae&&Ae.has(C.pathname)?je={currentLocation:A.location,nextLocation:C}:Je.has(C.pathname)&&(je={currentLocation:C,nextLocation:A.location})}else if(ze){let Ae=Je.get(A.location.pathname);Ae?Ae.add(C.pathname):(Ae=new Set([C.pathname]),Je.set(A.location.pathname,Ae)),je={currentLocation:A.location,nextLocation:C}}ct({..._,actionData:J,loaderData:ce,historyAction:B,location:C,initialized:!0,navigation:Bc,revalidation:"idle",restoreScrollPosition:de,preventScrollReset:me,blockers:fe},{viewTransitionOpts:je,flushSync:I===!0}),B="POP",pe=!1,ze=!1,pt=!1,Re=!1,Oe==null||Oe.resolve(),Oe=null}async function Fn(C,_){if(typeof C=="number"){n.history.go(C);return}let I=ud(A.location,A.matches,m,C,_==null?void 0:_.fromRouteId,_==null?void 0:_.relative),{path:V,submission:J,error:ce}=Gp(!1,I,_),fe=A.location,de=Zi(A.location,V,_&&_.state);de={...de,...n.history.encodeLocation(de)};let me=_&&_.replace!=null?_.replace:void 0,je="PUSH";me===!0?je="REPLACE":me===!1||J!=null&&nn(J.formMethod)&&J.formAction===A.location.pathname+A.location.search&&(je="REPLACE");let we=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,ge=(_&&_.flushSync)===!0,Ae=ia({currentLocation:fe,nextLocation:de,historyAction:je});if(Ae){Pr(Ae,{state:"blocked",location:de,proceed(){Pr(Ae,{state:"proceeding",proceed:void 0,reset:void 0,location:de}),Fn(C,_)},reset(){let st=new Map(A.blockers);st.set(Ae,Hi),ct({blockers:st})}});return}await Yn(je,de,{submission:J,pendingError:ce,preventScrollReset:we,replace:_&&_.replace,enableViewTransition:_&&_.viewTransition,flushSync:ge})}function Gn(){Oe||(Oe=rw()),ra(),ct({revalidation:"loading"});let C=Oe.promise;return A.navigation.state==="submitting"?C:A.navigation.state==="idle"?(Yn(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),C):(Yn(B||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:ze===!0}),C)}async function Yn(C,_,I){Z&&Z.abort(),Z=null,B=C,pt=(I&&I.startUninterruptedRevalidation)===!0,ml(A.location,A.matches),pe=(I&&I.preventScrollReset)===!0,ze=(I&&I.enableViewTransition)===!0;let V=g||p,J=I&&I.overrideNavigation,ce=I!=null&&I.initialHydration&&A.matches&&A.matches.length>0&&!$?A.matches:ts(V,_,m),fe=(I&&I.flushSync)===!0;if(ce&&A.initialized&&!Re&&K0(A.location,_)&&!(I&&I.submission&&nn(I.submission.formMethod))){sn(_,{matches:ce},{flushSync:fe});return}let de=ws(ce,V,_.pathname);if(de.active&&de.matches&&(ce=de.matches),!ce){let{error:Nt,notFoundMatches:at,route:it}=Xn(_.pathname);sn(_,{matches:at,loaderData:{},errors:{[it.id]:Nt}},{flushSync:fe});return}Z=new AbortController;let me=_a(n.history,_,Z.signal,I&&I.submission),je=n.getContext?await n.getContext():new Bp,we;if(I&&I.pendingError)we=[ns(ce).route.id,{type:"error",error:I.pendingError}];else if(I&&I.submission&&nn(I.submission.formMethod)){let Nt=await hl(me,_,I.submission,ce,je,de.active,I&&I.initialHydration===!0,{replace:I.replace,flushSync:fe});if(Nt.shortCircuited)return;if(Nt.pendingActionResult){let[at,it]=Nt.pendingActionResult;if(kn(it)&&tl(it.error)&&it.error.status===404){Z=null,sn(_,{matches:Nt.matches,loaderData:{},errors:{[at]:it.error}});return}}ce=Nt.matches||ce,we=Nt.pendingActionResult,J=Hc(_,I.submission),fe=!1,de.active=!1,me=_a(n.history,me.url,me.signal)}let{shortCircuited:ge,matches:Ae,loaderData:st,errors:jt}=await Za(me,_,ce,je,de.active,J,I&&I.submission,I&&I.fetcherSubmission,I&&I.replace,I&&I.initialHydration===!0,fe,we);ge||(Z=null,sn(_,{matches:Ae||ce,...am(we),loaderData:st,errors:jt}))}async function hl(C,_,I,V,J,ce,fe,de={}){ra();let me=Z0(_,I);if(ct({navigation:me},{flushSync:de.flushSync===!0}),ce){let ge=await ks(V,_.pathname,C.signal);if(ge.type==="aborted")return{shortCircuited:!0};if(ge.type==="error"){if(ge.partialMatches.length===0){let{matches:st,route:jt}=So(p);return{matches:st,pendingActionResult:[jt.id,{type:"error",error:ge.error}]}}let Ae=ns(ge.partialMatches).route.id;return{matches:ge.partialMatches,pendingActionResult:[Ae,{type:"error",error:ge.error}]}}else if(ge.matches)V=ge.matches;else{let{notFoundMatches:Ae,error:st,route:jt}=Xn(_.pathname);return{matches:Ae,pendingActionResult:[jt.id,{type:"error",error:st}]}}}let je,we=Mo(V,_);if(!we.route.action&&!we.route.lazy)je={type:"error",error:Mn(405,{method:C.method,pathname:_.pathname,routeId:we.route.id})};else{let ge=Da(d,h,C,V,we,fe?[]:o,J),Ae=await Rr(C,ge,J,null);if(je=Ae[we.route.id],!je){for(let st of V)if(Ae[st.route.id]){je=Ae[st.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(Us(je)){let ge;return de&&de.replace!=null?ge=de.replace:ge=tm(je.response.headers.get("Location"),new URL(C.url),m)===A.location.pathname+A.location.search,await Jn(C,je,!0,{submission:I,replace:ge}),{shortCircuited:!0}}if(kn(je)){let ge=ns(V,we.route.id);return(de&&de.replace)!==!0&&(B="PUSH"),{matches:V,pendingActionResult:[ge.route.id,je,we.route.id]}}return{matches:V,pendingActionResult:[we.route.id,je]}}async function Za(C,_,I,V,J,ce,fe,de,me,je,we,ge){let Ae=ce||Hc(_,fe),st=fe||de||lm(Ae),jt=!pt&&!je;if(J){if(jt){let lt=ei(ge);ct({navigation:Ae,...lt!==void 0?{actionData:lt}:{}},{flushSync:we})}let Ue=await ks(I,_.pathname,C.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){if(Ue.partialMatches.length===0){let{matches:Mr,route:Lt}=So(p);return{matches:Mr,loaderData:{},errors:{[Lt.id]:Ue.error}}}let lt=ns(Ue.partialMatches).route.id;return{matches:Ue.partialMatches,loaderData:{},errors:{[lt]:Ue.error}}}else if(Ue.matches)I=Ue.matches;else{let{error:lt,notFoundMatches:Mr,route:Lt}=Xn(_.pathname);return{matches:Mr,loaderData:{},errors:{[Lt.id]:lt}}}}let Nt=g||p,{dsMatches:at,revalidatingFetchers:it}=Yp(C,V,d,h,n.history,A,I,st,_,je?[]:o,je===!0,Re,Pe,ve,q,M,Nt,m,n.patchRoutesOnNavigation!=null,ge);if(ne=++G,!n.dataStrategy&&!at.some(Ue=>Ue.shouldLoad)&&!at.some(Ue=>Ue.route.middleware&&Ue.route.middleware.length>0)&&it.length===0){let Ue=pl();return sn(_,{matches:I,loaderData:{},errors:ge&&kn(ge[1])?{[ge[0]]:ge[1].error}:null,...am(ge),...Ue?{fetchers:new Map(A.fetchers)}:{}},{flushSync:we}),{shortCircuited:!0}}if(jt){let Ue={};if(!J){Ue.navigation=Ae;let lt=ei(ge);lt!==void 0&&(Ue.actionData=lt)}it.length>0&&(Ue.fetchers=ti(it)),ct(Ue,{flushSync:we})}it.forEach(Ue=>{jn(Ue.key),Ue.controller&&ye.set(Ue.key,Ue.controller)});let cr=()=>it.forEach(Ue=>jn(Ue.key));Z&&Z.signal.addEventListener("abort",cr);let{loaderResults:bs,fetcherResults:Ze}=await ri(at,it,C,V);if(C.signal.aborted)return{shortCircuited:!0};Z&&Z.signal.removeEventListener("abort",cr),it.forEach(Ue=>ye.delete(Ue.key));let bn=Co(bs);if(bn)return await Jn(C,bn.result,!0,{replace:me}),{shortCircuited:!0};if(bn=Co(Ze),bn)return M.add(bn.key),await Jn(C,bn.result,!0,{replace:me}),{shortCircuited:!0};let{loaderData:Ss,errors:Lr}=rm(A,I,bs,ge,it,Ze);je&&A.errors&&(Lr={...A.errors,...Lr});let Sn=pl(),oa=sa(ne),Cs=Sn||oa||it.length>0;return{matches:I,loaderData:Ss,errors:Lr,...Cs?{fetchers:new Map(A.fetchers)}:{}}}function ei(C){if(C&&!kn(C[1]))return{[C[0]]:C[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function ti(C){return C.forEach(_=>{let I=A.fetchers.get(_.key),V=Qi(void 0,I?I.data:void 0);A.fetchers.set(_.key,V)}),new Map(A.fetchers)}async function vs(C,_,I,V){jn(C);let J=(V&&V.flushSync)===!0,ce=g||p,fe=ud(A.location,A.matches,m,I,_,V==null?void 0:V.relative),de=ts(ce,fe,m),me=ws(de,ce,fe);if(me.active&&me.matches&&(de=me.matches),!de){an(C,_,Mn(404,{pathname:fe}),{flushSync:J});return}let{path:je,submission:we,error:ge}=Gp(!0,fe,V);if(ge){an(C,_,ge,{flushSync:J});return}let Ae=n.getContext?await n.getContext():new Bp,st=(V&&V.preventScrollReset)===!0;if(we&&nn(we.formMethod)){await Er(C,_,je,de,Ae,me.active,J,st,we);return}q.set(C,{routeId:_,path:je}),await ni(C,_,je,de,Ae,me.active,J,st,we)}async function Er(C,_,I,V,J,ce,fe,de,me){ra(),q.delete(C);let je=A.fetchers.get(C);gn(C,ew(me,je),{flushSync:fe});let we=new AbortController,ge=_a(n.history,I,we.signal,me);if(ce){let mt=await ks(V,new URL(ge.url).pathname,ge.signal,C);if(mt.type==="aborted")return;if(mt.type==="error"){an(C,_,mt.error,{flushSync:fe});return}else if(mt.matches)V=mt.matches;else{an(C,_,Mn(404,{pathname:I}),{flushSync:fe});return}}let Ae=Mo(V,I);if(!Ae.route.action&&!Ae.route.lazy){let mt=Mn(405,{method:me.formMethod,pathname:I,routeId:_});an(C,_,mt,{flushSync:fe});return}ye.set(C,we);let st=G,jt=Da(d,h,ge,V,Ae,o,J),Nt=await Rr(ge,jt,J,C),at=Nt[Ae.route.id];if(!at){for(let mt of jt)if(Nt[mt.route.id]){at=Nt[mt.route.id];break}}if(ge.signal.aborted){ye.get(C)===we&&ye.delete(C);return}if(ve.has(C)){if(Us(at)||kn(at)){gn(C,kr(void 0));return}}else{if(Us(at))if(ye.delete(C),ne>st){gn(C,kr(void 0));return}else return M.add(C),gn(C,Qi(me)),Jn(ge,at,!1,{fetcherSubmission:me,preventScrollReset:de});if(kn(at)){an(C,_,at.error);return}}let it=A.navigation.location||A.location,cr=_a(n.history,it,we.signal),bs=g||p,Ze=A.navigation.state!=="idle"?ts(bs,A.navigation.location,m):A.matches;Ie(Ze,"Didn't find any matches after fetcher action");let bn=++G;U.set(C,bn);let Ss=Qi(me,at.data);A.fetchers.set(C,Ss);let{dsMatches:Lr,revalidatingFetchers:Sn}=Yp(cr,J,d,h,n.history,A,Ze,me,it,o,!1,Re,Pe,ve,q,M,bs,m,n.patchRoutesOnNavigation!=null,[Ae.route.id,at]);Sn.filter(mt=>mt.key!==C).forEach(mt=>{let ua=mt.key,yl=A.fetchers.get(ua),ca=Qi(void 0,yl?yl.data:void 0);A.fetchers.set(ua,ca),jn(ua),mt.controller&&ye.set(ua,mt.controller)}),ct({fetchers:new Map(A.fetchers)});let oa=()=>Sn.forEach(mt=>jn(mt.key));we.signal.addEventListener("abort",oa);let{loaderResults:Cs,fetcherResults:Ue}=await ri(Lr,Sn,cr,J);if(we.signal.aborted)return;if(we.signal.removeEventListener("abort",oa),U.delete(C),ye.delete(C),Sn.forEach(mt=>ye.delete(mt.key)),A.fetchers.has(C)){let mt=kr(at.data);A.fetchers.set(C,mt)}let lt=Co(Cs);if(lt)return Jn(cr,lt.result,!1,{preventScrollReset:de});if(lt=Co(Ue),lt)return M.add(lt.key),Jn(cr,lt.result,!1,{preventScrollReset:de});let{loaderData:Mr,errors:Lt}=rm(A,Ze,Cs,void 0,Sn,Ue);sa(bn),A.navigation.state==="loading"&&bn>ne?(Ie(B,"Expected pending action"),Z&&Z.abort(),sn(A.navigation.location,{matches:Ze,loaderData:Mr,errors:Lt,fetchers:new Map(A.fetchers)})):(ct({errors:Lt,loaderData:sm(A.loaderData,Mr,Ze,Lt),fetchers:new Map(A.fetchers)}),Re=!1)}async function ni(C,_,I,V,J,ce,fe,de,me){let je=A.fetchers.get(C);gn(C,Qi(me,je?je.data:void 0),{flushSync:fe});let we=new AbortController,ge=_a(n.history,I,we.signal);if(ce){let it=await ks(V,new URL(ge.url).pathname,ge.signal,C);if(it.type==="aborted")return;if(it.type==="error"){an(C,_,it.error,{flushSync:fe});return}else if(it.matches)V=it.matches;else{an(C,_,Mn(404,{pathname:I}),{flushSync:fe});return}}let Ae=Mo(V,I);ye.set(C,we);let st=G,jt=Da(d,h,ge,V,Ae,o,J),at=(await Rr(ge,jt,J,C))[Ae.route.id];if(ye.get(C)===we&&ye.delete(C),!ge.signal.aborted){if(ve.has(C)){gn(C,kr(void 0));return}if(Us(at))if(ne>st){gn(C,kr(void 0));return}else{M.add(C),await Jn(ge,at,!1,{preventScrollReset:de});return}if(kn(at)){an(C,_,at.error);return}gn(C,kr(at.data))}}async function Jn(C,_,I,{submission:V,fetcherSubmission:J,preventScrollReset:ce,replace:fe}={}){_.response.headers.has("X-Remix-Revalidate")&&(Re=!0);let de=_.response.headers.get("Location");Ie(de,"Expected a Location header on the redirect Response"),de=tm(de,new URL(C.url),m);let me=Zi(A.location,de,{_isRedirect:!0});if(s){let jt=!1;if(_.response.headers.has("X-Remix-Reload-Document"))jt=!0;else if(Ho(de)){const Nt=sg(de,!0);jt=Nt.origin!==r.location.origin||An(Nt.pathname,m)==null}if(jt){fe?r.location.replace(de):r.location.assign(de);return}}Z=null;let je=fe===!0||_.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:we,formAction:ge,formEncType:Ae}=A.navigation;!V&&!J&&we&&ge&&Ae&&(V=lm(A.navigation));let st=V||J;if(M0.has(_.response.status)&&st&&nn(st.formMethod))await Yn(je,me,{submission:{...st,formAction:de},preventScrollReset:ce||pe,enableViewTransition:I?ze:void 0});else{let jt=Hc(me,V);await Yn(je,me,{overrideNavigation:jt,fetcherSubmission:J,preventScrollReset:ce||pe,enableViewTransition:I?ze:void 0})}}async function Rr(C,_,I,V){let J,ce={};try{J=await q0(y,C,_,V,I,!1)}catch(fe){return _.filter(de=>de.shouldLoad).forEach(de=>{ce[de.route.id]={type:"error",error:fe}}),ce}if(C.signal.aborted)return ce;for(let[fe,de]of Object.entries(J))if(J0(de)){let me=de.result;ce[fe]={type:"redirect",response:V0(me,C,fe,_,m)}}else ce[fe]=await Q0(de);return ce}async function ri(C,_,I,V){let J=Rr(I,C,V,null),ce=Promise.all(_.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let we=(await Rr(me.request,me.matches,V,me.key))[me.match.route.id];return{[me.key]:we}}else return Promise.resolve({[me.key]:{type:"error",error:Mn(404,{pathname:me.path})}})})),fe=await J,de=(await ce).reduce((me,je)=>Object.assign(me,je),{});return{loaderResults:fe,fetcherResults:de}}function ra(){Re=!0,q.forEach((C,_)=>{ye.has(_)&&Pe.add(_),jn(_)})}function gn(C,_,I={}){A.fetchers.set(C,_),ct({fetchers:new Map(A.fetchers)},{flushSync:(I&&I.flushSync)===!0})}function an(C,_,I,V={}){let J=ns(A.matches,_);ur(C),ct({errors:{[J.route.id]:I},fetchers:new Map(A.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function si(C){return be.set(C,(be.get(C)||0)+1),ve.has(C)&&ve.delete(C),A.fetchers.get(C)||_0}function xs(C,_){jn(C,_==null?void 0:_.reason),gn(C,kr(null))}function ur(C){let _=A.fetchers.get(C);ye.has(C)&&!(_&&_.state==="loading"&&U.has(C))&&jn(C),q.delete(C),U.delete(C),M.delete(C),ve.delete(C),Pe.delete(C),A.fetchers.delete(C)}function tu(C){let _=(be.get(C)||0)-1;_<=0?(be.delete(C),ve.add(C)):be.set(C,_),ct({fetchers:new Map(A.fetchers)})}function jn(C,_){let I=ye.get(C);I&&(I.abort(_),ye.delete(C))}function ai(C){for(let _ of C){let I=si(_),V=kr(I.data);A.fetchers.set(_,V)}}function pl(){let C=[],_=!1;for(let I of M){let V=A.fetchers.get(I);Ie(V,`Expected fetcher: ${I}`),V.state==="loading"&&(M.delete(I),C.push(I),_=!0)}return ai(C),_}function sa(C){let _=[];for(let[I,V]of U)if(V<C){let J=A.fetchers.get(I);Ie(J,`Expected fetcher: ${I}`),J.state==="loading"&&(jn(I),U.delete(I),_.push(I))}return ai(_),_.length>0}function ii(C,_){let I=A.blockers.get(C)||Hi;return xe.get(C)!==_&&xe.set(C,_),I}function aa(C){A.blockers.delete(C),xe.delete(C)}function Pr(C,_){let I=A.blockers.get(C)||Hi;Ie(I.state==="unblocked"&&_.state==="blocked"||I.state==="blocked"&&_.state==="blocked"||I.state==="blocked"&&_.state==="proceeding"||I.state==="blocked"&&_.state==="unblocked"||I.state==="proceeding"&&_.state==="unblocked",`Invalid blocker state transition: ${I.state} -> ${_.state}`);let V=new Map(A.blockers);V.set(C,_),ct({blockers:V})}function ia({currentLocation:C,nextLocation:_,historyAction:I}){if(xe.size===0)return;xe.size>1&&wt(!1,"A router only supports one blocker at a time");let V=Array.from(xe.entries()),[J,ce]=V[V.length-1],fe=A.blockers.get(J);if(!(fe&&fe.state==="proceeding")&&ce({currentLocation:C,nextLocation:_,historyAction:I}))return J}function Xn(C){let _=Mn(404,{pathname:C}),I=g||p,{matches:V,route:J}=So(I);return{notFoundMatches:V,route:J,error:_}}function Tr(C,_,I){if(T=C,S=_,N=I||null,!L&&A.navigation===Bc){L=!0;let V=oi(A.location,A.matches);V!=null&&ct({restoreScrollPosition:V})}return()=>{T=null,S=null,N=null}}function li(C,_){return N&&N(C,_.map(V=>r0(V,A.loaderData)))||C.key}function ml(C,_){if(T&&S){let I=li(C,_);T[I]=S()}}function oi(C,_){if(T){let I=li(C,_),V=T[I];if(typeof V=="number")return V}return null}function ws(C,_,I){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:Ji(_,I,m,!0)}}else return{active:!0,matches:Ji(_,I,m,!0)||[]};return{active:!1,matches:null}}async function ks(C,_,I,V){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let J=C;for(;;){let ce=g==null,fe=g||p,de=h;try{await n.patchRoutesOnNavigation({signal:I,path:_,matches:J,fetcherKey:V,patch:(we,ge)=>{I.aborted||Jp(we,ge,fe,de,d,!1)}})}catch(we){return{type:"error",error:we,partialMatches:J}}finally{ce&&!I.aborted&&(p=[...p])}if(I.aborted)return{type:"aborted"};let me=ts(fe,_,m),je=null;if(me){if(Object.keys(me[0].params).length===0)return{type:"success",matches:me};if(je=Ji(fe,_,m,!0),!(je&&J.length<je.length&&la(J,je.slice(0,J.length))))return{type:"success",matches:me}}if(je||(je=Ji(fe,_,m,!0)),!je||la(J,je))return{type:"success",matches:null};J=je}}function la(C,_){return C.length===_.length&&C.every((I,V)=>I.route.id===_[V].route.id)}function gl(C){h={},g=el(C,d,void 0,h)}function js(C,_,I=!1){let V=g==null;Jp(C,_,g||p,h,d,I),V&&(p=[...p],ct({}))}return se={get basename(){return m},get future(){return w},get state(){return A},get routes(){return p},get window(){return r},initialize:Ke,subscribe:It,enableScrollRestoration:Tr,navigate:Fn,fetch:vs,revalidate:Gn,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:si,resetFetcher:xs,deleteFetcher:tu,dispose:_e,getBlocker:ii,deleteBlocker:aa,patchRoutes:js,_internalFetchControllers:ye,_internalSetRoutes:gl,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){ct(C)}},n.unstable_instrumentations&&(se=b0(se,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),se}function O0(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function ud(n,r,s,o,u,d){let h,p;if(u){h=[];for(let m of r)if(h.push(m),m.route.id===u){p=m;break}}else h=r,p=r[r.length-1];let g=Vo(o||".",Qo(h),An(n.pathname,s)||n.pathname,d==="path");if(o==null&&(g.search=n.search,g.hash=n.hash),(o==null||o===""||o===".")&&p){let m=_d(g.search);if(p.route.index&&!m)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&m){let y=new URLSearchParams(g.search),w=y.getAll("index");y.delete("index"),w.filter(j=>j).forEach(j=>y.append("index",j));let x=y.toString();g.search=x?`?${x}`:""}}return s!=="/"&&(g.pathname=g0({basename:s,pathname:g.pathname})),or(g)}function Gp(n,r,s){if(!s||!O0(s))return{path:r};if(s.formMethod&&!X0(s.formMethod))return{path:r,error:Mn(405,{method:s.formMethod})};let o=()=>({path:r,error:Mn(400,{type:"invalid-body"})}),d=(s.formMethod||"get").toUpperCase(),h=yg(r);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!nn(d))return o();let w=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((x,[j,T])=>`${x}${j}=${T}
|
|
50
|
-
`,""):String(s.body);return{path:r,submission:{formMethod:d,formAction:h,formEncType:s.formEncType,formData:void 0,json:void 0,text:w}}}else if(s.formEncType==="application/json"){if(!nn(d))return o();try{let w=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:r,submission:{formMethod:d,formAction:h,formEncType:s.formEncType,formData:void 0,json:w,text:void 0}}}catch{return o()}}}Ie(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=fd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=fd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=nm(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=nm(p)}catch{return o()}let m={formMethod:d,formAction:h,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(nn(m.formMethod))return{path:r,submission:m};let y=ms(r);return n&&y.search&&_d(y.search)&&p.append("index",""),y.search=`?${p}`,{path:or(y),submission:m}}function Yp(n,r,s,o,u,d,h,p,g,m,y,w,x,j,T,N,S,L,z,$){var pt;let Q=$?kn($[1])?$[1].error:$[1].data:void 0,X=u.createURL(d.location),se=u.createURL(g),A;if(y&&d.errors){let Re=Object.keys(d.errors)[0];A=h.findIndex(Pe=>Pe.route.id===Re)}else if($&&kn($[1])){let Re=$[0];A=h.findIndex(Pe=>Pe.route.id===Re)-1}let B=$?$[1].statusCode:void 0,pe=B&&B>=400,Z={currentUrl:X,currentParams:((pt=d.matches[0])==null?void 0:pt.params)||{},nextUrl:se,nextParams:h[0].params,...p,actionResult:Q,actionStatus:B},ze=Ld(h.map(Re=>Re.route.path)),Je=h.map((Re,Pe)=>{let{route:ye}=Re,G=null;if(A!=null&&Pe>A?G=!1:ye.lazy?G=!0:Md(ye)?y?G=cd(ye,d.loaderData,d.errors):F0(d.loaderData,d.matches[Pe],Re)&&(G=!0):G=!1,G!==null)return dd(s,o,n,ze,Re,m,r,G);let ne=pe?!1:w||X.pathname+X.search===se.pathname+se.search||X.search!==se.search||I0(d.matches[Pe],Re),U={...Z,defaultShouldRevalidate:ne},M=$o(Re,U);return dd(s,o,n,ze,Re,m,r,M,U)}),nt=[];return T.forEach((Re,Pe)=>{if(y||!h.some(ve=>ve.route.id===Re.routeId)||j.has(Pe))return;let ye=d.fetchers.get(Pe),G=ye&&ye.state!=="idle"&&ye.data===void 0,ne=ts(S,Re.path,L);if(!ne){if(z&&G)return;nt.push({key:Pe,routeId:Re.routeId,path:Re.path,matches:null,match:null,request:null,controller:null});return}if(N.has(Pe))return;let U=Mo(ne,Re.path),M=new AbortController,q=_a(u,Re.path,M.signal),be=null;if(x.has(Pe))x.delete(Pe),be=Da(s,o,q,ne,U,m,r);else if(G)w&&(be=Da(s,o,q,ne,U,m,r));else{let ve={...Z,defaultShouldRevalidate:pe?!1:w};$o(U,ve)&&(be=Da(s,o,q,ne,U,m,r,ve))}be&&nt.push({key:Pe,routeId:Re.routeId,path:Re.path,matches:be,match:U,request:q,controller:M})}),{dsMatches:Je,revalidatingFetchers:nt}}function Md(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function cd(n,r,s){if(n.lazy)return!0;if(!Md(n))return!1;let o=r!=null&&n.id in r,u=s!=null&&s[n.id]!==void 0;return!o&&u?!1:typeof n.loader=="function"&&n.loader.hydrate===!0?!0:!o&&!u}function F0(n,r,s){let o=!r||s.route.id!==r.route.id,u=!n.hasOwnProperty(s.route.id);return o||u}function I0(n,r){let s=n.route.path;return n.pathname!==r.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==r.params["*"]}function $o(n,r){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(r);if(typeof s=="boolean")return s}return r.defaultShouldRevalidate}function Jp(n,r,s,o,u,d){let h;if(n){let m=o[n];Ie(m,`No route found to patch children into: routeId = ${n}`),m.children||(m.children=[]),h=m.children}else h=s;let p=[],g=[];if(r.forEach(m=>{let y=h.find(w=>fg(m,w));y?g.push({existingRoute:y,newRoute:m}):p.push(m)}),p.length>0){let m=el(p,u,[n||"_","patch",String((h==null?void 0:h.length)||"0")],o);h.push(...m)}if(d&&g.length>0)for(let m=0;m<g.length;m++){let{existingRoute:y,newRoute:w}=g[m],x=y,[j]=el([w],u,[],{},!0);Object.assign(x,{element:j.element?j.element:x.element,errorElement:j.errorElement?j.errorElement:x.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:x.hydrateFallbackElement})}}function fg(n,r){return"id"in n&&"id"in r&&n.id===r.id?!0:n.index===r.index&&n.path===r.path&&n.caseSensitive===r.caseSensitive?(!n.children||n.children.length===0)&&(!r.children||r.children.length===0)?!0:n.children.every((s,o)=>{var u;return(u=r.children)==null?void 0:u.some(d=>fg(s,d))}):!1}var Xp=new WeakMap,hg=({key:n,route:r,manifest:s,mapRouteProperties:o})=>{let u=s[r.id];if(Ie(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let d=u.lazy[n];if(!d)return;let h=Xp.get(u);h||(h={},Xp.set(u,h));let p=h[n];if(p)return p;let g=(async()=>{let m=Zx(n),w=u[n]!==void 0&&n!=="hasErrorBoundary";if(m)wt(!m,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),h[n]=Promise.resolve();else if(w)wt(!1,`Route "${u.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let x=await d();x!=null&&(Object.assign(u,{[n]:x}),Object.assign(u,o(u)))}typeof u.lazy=="object"&&(u.lazy[n]=void 0,Object.values(u.lazy).every(x=>x===void 0)&&(u.lazy=void 0))})();return h[n]=g,g},Zp=new WeakMap;function z0(n,r,s,o,u){let d=s[n.id];if(Ie(d,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let y=Zp.get(d);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let w=(async()=>{Ie(typeof n.lazy=="function","No lazy route function found");let x=await n.lazy(),j={};for(let T in x){let N=x[T];if(N===void 0)continue;let S=t0(T),z=d[T]!==void 0&&T!=="hasErrorBoundary";S?wt(!S,"Route property "+T+" is not a supported property to be returned from a lazy route function. This property will be ignored."):z?wt(!z,`Route "${d.id}" has a static property "${T}" defined but its lazy function is also returning a value for this property. The lazy route property "${T}" will be ignored.`):j[T]=N}Object.assign(d,j),Object.assign(d,{...o(d),lazy:void 0})})();return Zp.set(d,w),w.catch(()=>{}),{lazyRoutePromise:w,lazyHandlerPromise:w}}let h=Object.keys(n.lazy),p=[],g;for(let y of h){if(u&&u.includes(y))continue;let w=hg({key:y,route:n,manifest:s,mapRouteProperties:o});w&&(p.push(w),y===r&&(g=w))}let m=p.length>0?Promise.all(p).then(()=>{}):void 0;return m==null||m.catch(()=>{}),g==null||g.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:g}}async function em(n){let r=n.matches.filter(u=>u.shouldLoad),s={};return(await Promise.all(r.map(u=>u.resolve()))).forEach((u,d)=>{s[r[d].route.id]=u}),s}async function U0(n){return n.matches.some(r=>r.route.middleware)?pg(n,()=>em(n)):em(n)}function pg(n,r){return $0(n,r,o=>o,G0,s);function s(o,u,d){if(d)return Promise.resolve(Object.assign(d.value,{[u]:{type:"error",result:o}}));{let{matches:h}=n,p=Math.min(Math.max(h.findIndex(m=>m.route.id===u),0),Math.max(h.findIndex(m=>m.unstable_shouldCallHandler()),0)),g=ns(h,h[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:o}})}}}async function $0(n,r,s,o,u){let{matches:d,request:h,params:p,context:g,unstable_pattern:m}=n,y=d.flatMap(x=>x.route.middleware?x.route.middleware.map(j=>[x.route.id,j]):[]);return await mg({request:h,params:p,context:g,unstable_pattern:m},y,r,s,o,u)}async function mg(n,r,s,o,u,d,h=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=r[h];if(!g)return await s();let[m,y]=g,w,x=async()=>{if(w)throw new Error("You may only call `next()` once per middleware");try{return w={value:await mg(n,r,s,o,u,d,h+1)},w.value}catch(j){return w={value:await d(j,m,w)},w.value}};try{let j=await y(n,x),T=j!=null?o(j):void 0;return u(T)?T:w?T??w.value:(w={value:await x()},w.value)}catch(j){return await d(j,m,w)}}function gg(n,r,s,o,u){let d=hg({key:"middleware",route:o.route,manifest:r,mapRouteProperties:n}),h=z0(o.route,nn(s.method)?"action":"loader",r,n,u);return{middleware:d,route:h.lazyRoutePromise,handler:h.lazyHandlerPromise}}function dd(n,r,s,o,u,d,h,p,g=null){let m=!1,y=gg(n,r,s,u,d);return{...u,_lazyPromises:y,shouldLoad:p,unstable_shouldRevalidateArgs:g,unstable_shouldCallHandler(w){return m=!0,g?typeof w=="boolean"?$o(u,{...g,defaultShouldRevalidate:w}):$o(u,g):p},resolve(w){let{lazy:x,loader:j,middleware:T}=u.route,N=m||p||w&&!nn(s.method)&&(x||j),S=T&&T.length>0&&!j&&!x;return N&&(nn(s.method)||!S)?B0({request:s,unstable_pattern:o,match:u,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:w,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function Da(n,r,s,o,u,d,h,p=null){return o.map(g=>g.route.id!==u.route.id?{...g,shouldLoad:!1,unstable_shouldRevalidateArgs:p,unstable_shouldCallHandler:()=>!1,_lazyPromises:gg(n,r,s,g,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:dd(n,r,s,Ld(o.map(m=>m.route.path)),g,d,h,!0,p))}async function q0(n,r,s,o,u,d){s.some(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(s.map(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware}));let h={request:r,unstable_pattern:Ld(s.map(m=>m.route.path)),params:s[0].params,context:u,matches:s},g=await n({...h,fetcherKey:o,runClientMiddleware:m=>{let y=h;return pg(y,()=>m({...y,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(m=>{var y,w;return[(y=m._lazyPromises)==null?void 0:y.handler,(w=m._lazyPromises)==null?void 0:w.route]}))}catch{}return g}async function B0({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:d,scopedContext:h}){let p,g,m=nn(n.method),y=m?"action":"loader",w=x=>{let j,T=new Promise((L,z)=>j=z);g=()=>j(),n.signal.addEventListener("abort",g);let N=L=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${s.route.id}]`)):x({request:n,unstable_pattern:r,params:s.params,context:h},...L!==void 0?[L]:[]),S=(async()=>{try{return{type:"data",result:await(d?d(z=>N(z)):N())}}catch(L){return{type:"error",result:L}}})();return Promise.race([S,T])};try{let x=m?s.route.action:s.route.loader;if(o||u)if(x){let j,[T]=await Promise.all([w(x).catch(N=>{j=N}),o,u]);if(j!==void 0)throw j;p=T}else{await o;let j=m?s.route.action:s.route.loader;if(j)[p]=await Promise.all([w(j),u]);else if(y==="action"){let T=new URL(n.url),N=T.pathname+T.search;throw Mn(405,{method:n.method,pathname:N,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(x)p=await w(x);else{let j=new URL(n.url),T=j.pathname+j.search;throw Mn(404,{pathname:T})}}catch(x){return{type:"error",result:x}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function H0(n){let r=n.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?n.body==null?null:n.json():n.text()}async function Q0(n){var o,u,d,h,p,g;let{result:r,type:s}=n;if(vg(r)){let m;try{m=await H0(r)}catch(y){return{type:"error",error:y}}return s==="error"?{type:"error",error:new Uo(r.status,r.statusText,m),statusCode:r.status,headers:r.headers}:{type:"data",data:m,statusCode:r.status,headers:r.headers}}return s==="error"?im(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:(o=r.init)==null?void 0:o.status,headers:(u=r.init)!=null&&u.headers?new Headers(r.init.headers):void 0}:{type:"error",error:new Uo(((d=r.init)==null?void 0:d.status)||500,void 0,r.data),statusCode:tl(r)?r.status:void 0,headers:(h=r.init)!=null&&h.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:tl(r)?r.status:void 0}:im(r)?{type:"data",data:r.data,statusCode:(p=r.init)==null?void 0:p.status,headers:(g=r.init)!=null&&g.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function V0(n,r,s,o,u){let d=n.headers.get("Location");if(Ie(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ho(d)){let h=o.slice(0,o.findIndex(p=>p.route.id===s)+1);d=ud(new URL(r.url),h,u,d),n.headers.set("Location",d)}return n}function tm(n,r,s){if(Ho(n)){let o=n,u=o.startsWith("//")?new URL(r.protocol+o):new URL(o),d=An(u.pathname,s)!=null;if(u.origin===r.origin&&d)return u.pathname+u.search+u.hash}return n}function _a(n,r,s,o){let u=n.createURL(yg(r)).toString(),d={signal:s};if(o&&nn(o.formMethod)){let{formMethod:h,formEncType:p}=o;d.method=h.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(o.json)):p==="text/plain"?d.body=o.text:p==="application/x-www-form-urlencoded"&&o.formData?d.body=fd(o.formData):d.body=o.formData}return new Request(u,d)}function fd(n){let r=new URLSearchParams;for(let[s,o]of n.entries())r.append(s,typeof o=="string"?o:o.name);return r}function nm(n){let r=new FormData;for(let[s,o]of n.entries())r.append(s,o);return r}function W0(n,r,s,o=!1,u=!1){let d={},h=null,p,g=!1,m={},y=s&&kn(s[1])?s[1].error:void 0;return n.forEach(w=>{if(!(w.route.id in r))return;let x=w.route.id,j=r[x];if(Ie(!Us(j),"Cannot handle redirect results in processLoaderData"),kn(j)){let T=j.error;if(y!==void 0&&(T=y,y=void 0),h=h||{},u)h[x]=T;else{let N=ns(n,x);h[N.route.id]==null&&(h[N.route.id]=T)}o||(d[x]=dg),g||(g=!0,p=tl(j.error)?j.error.status:500),j.headers&&(m[x]=j.headers)}else d[x]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(m[x]=j.headers)}),y!==void 0&&s&&(h={[s[0]]:y},s[2]&&(d[s[2]]=void 0)),{loaderData:d,errors:h,statusCode:p||200,loaderHeaders:m}}function rm(n,r,s,o,u,d){let{loaderData:h,errors:p}=W0(r,s,o);return u.filter(g=>!g.matches||g.matches.some(m=>m.shouldLoad)).forEach(g=>{let{key:m,match:y,controller:w}=g;if(w&&w.signal.aborted)return;let x=d[m];if(Ie(x,"Did not find corresponding fetcher result"),kn(x)){let j=ns(n.matches,y==null?void 0:y.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:x.error}),n.fetchers.delete(m)}else if(Us(x))Ie(!1,"Unhandled fetcher revalidation redirect");else{let j=kr(x.data);n.fetchers.set(m,j)}}),{loaderData:h,errors:p}}function sm(n,r,s,o){let u=Object.entries(r).filter(([,d])=>d!==dg).reduce((d,[h,p])=>(d[h]=p,d),{});for(let d of s){let h=d.route.id;if(!r.hasOwnProperty(h)&&n.hasOwnProperty(h)&&d.route.loader&&(u[h]=n[h]),o&&o.hasOwnProperty(h))break}return u}function am(n){return n?kn(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function ns(n,r){return(r?n.slice(0,n.findIndex(o=>o.route.id===r)+1):[...n]).reverse().find(o=>o.route.hasErrorBoundary===!0)||n[0]}function So(n){let r=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function Mn(n,{pathname:r,routeId:s,method:o,type:u,message:d}={}){let h="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(h="Bad Request",o&&r&&s?p=`You made a ${o} request to "${r}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:u==="invalid-body"&&(p="Unable to encode submission body")):n===403?(h="Forbidden",p=`Route "${s}" does not match URL "${r}"`):n===404?(h="Not Found",p=`No route matches URL "${r}"`):n===405&&(h="Method Not Allowed",o&&r&&s?p=`You made a ${o.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:o&&(p=`Invalid request method "${o.toUpperCase()}"`)),new Uo(n||500,h,new Error(p),!0)}function Co(n){let r=Object.entries(n);for(let s=r.length-1;s>=0;s--){let[o,u]=r[s];if(Us(u))return{key:o,result:u}}}function yg(n){let r=typeof n=="string"?ms(n):n;return or({...r,hash:""})}function K0(n,r){return n.pathname!==r.pathname||n.search!==r.search?!1:n.hash===""?r.hash!=="":n.hash===r.hash?!0:r.hash!==""}function G0(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([r,s])=>typeof r=="string"&&Y0(s))}function Y0(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function J0(n){return vg(n.result)&&L0.has(n.result.status)}function kn(n){return n.type==="error"}function Us(n){return(n&&n.type)==="redirect"}function im(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function vg(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function X0(n){return T0.has(n.toUpperCase())}function nn(n){return R0.has(n.toUpperCase())}function _d(n){return new URLSearchParams(n).getAll("index").some(r=>r==="")}function Mo(n,r){let s=typeof r=="string"?ms(r).search:r.search;if(n[n.length-1].route.index&&_d(s||""))return n[n.length-1];let o=lg(n);return o[o.length-1]}function lm(n){let{formMethod:r,formAction:s,formEncType:o,text:u,formData:d,json:h}=n;if(!(!r||!s||!o)){if(u!=null)return{formMethod:r,formAction:s,formEncType:o,formData:void 0,json:void 0,text:u};if(d!=null)return{formMethod:r,formAction:s,formEncType:o,formData:d,json:void 0,text:void 0};if(h!==void 0)return{formMethod:r,formAction:s,formEncType:o,formData:void 0,json:h,text:void 0}}}function Hc(n,r){return r?{state:"loading",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Z0(n,r){return{state:"submitting",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Qi(n,r){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function ew(n,r){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r?r.data:void 0}}function kr(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function tw(n,r){try{let s=n.sessionStorage.getItem(cg);if(s){let o=JSON.parse(s);for(let[u,d]of Object.entries(o||{}))d&&Array.isArray(d)&&r.set(u,new Set(d||[]))}}catch{}}function nw(n,r){if(r.size>0){let s={};for(let[o,u]of r)s[o]=[...u];try{n.sessionStorage.setItem(cg,JSON.stringify(s))}catch(o){wt(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function rw(){let n,r,s=new Promise((o,u)=>{n=async d=>{o(d);try{await s}catch{}},r=async d=>{u(d);try{await s}catch{}}});return{promise:s,resolve:n,reject:r}}var ea=k.createContext(null);ea.displayName="DataRouter";var ul=k.createContext(null);ul.displayName="DataRouterState";k.createContext(!1);var Ad=k.createContext({isTransitioning:!1});Ad.displayName="ViewTransition";var xg=k.createContext(new Map);xg.displayName="Fetchers";var sw=k.createContext(null);sw.displayName="Await";var Kn=k.createContext(null);Kn.displayName="Navigation";var Wo=k.createContext(null);Wo.displayName="Location";var Dn=k.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName="Route";var Dd=k.createContext(null);Dd.displayName="RouteError";function aw(n,{relative:r}={}){Ie(Ya(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=k.useContext(Kn),{hash:u,pathname:d,search:h}=cl(n,{relative:r}),p=d;return s!=="/"&&(p=d==="/"?s:lr([s,d])),o.createHref({pathname:p,search:h,hash:u})}function Ya(){return k.useContext(Wo)!=null}function On(){return Ie(Ya(),"useLocation() may be used only in the context of a <Router> component."),k.useContext(Wo).location}var wg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kg(n){k.useContext(Kn).static||k.useLayoutEffect(n)}function ta(){let{isDataRoute:n}=k.useContext(Dn);return n?kw():iw()}function iw(){Ie(Ya(),"useNavigate() may be used only in the context of a <Router> component.");let n=k.useContext(ea),{basename:r,navigator:s}=k.useContext(Kn),{matches:o}=k.useContext(Dn),{pathname:u}=On(),d=JSON.stringify(Qo(o)),h=k.useRef(!1);return kg(()=>{h.current=!0}),k.useCallback((g,m={})=>{if(wt(h.current,wg),!h.current)return;if(typeof g=="number"){s.go(g);return}let y=Vo(g,JSON.parse(d),u,m.relative==="path");n==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:lr([r,y.pathname])),(m.replace?s.replace:s.push)(y,m.state,m)},[r,s,d,u,n])}var lw=k.createContext(null);function ow(n){let r=k.useContext(Dn).outlet;return k.useMemo(()=>r&&k.createElement(lw.Provider,{value:n},r),[r,n])}function uw(){let{matches:n}=k.useContext(Dn),r=n[n.length-1];return r?r.params:{}}function cl(n,{relative:r}={}){let{matches:s}=k.useContext(Dn),{pathname:o}=On(),u=JSON.stringify(Qo(s));return k.useMemo(()=>Vo(n,JSON.parse(u),o,r==="path"),[n,u,o,r])}function cw(n,r,s,o,u){Ie(Ya(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=k.useContext(Kn),{matches:h}=k.useContext(Dn),p=h[h.length-1],g=p?p.params:{},m=p?p.pathname:"/",y=p?p.pathnameBase:"/",w=p&&p.route;{let z=w&&w.path||"";jg(m,!w||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${z}">) 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.
|
|
49
|
+
*/var rg=n=>{throw TypeError(n)},Wx=(n,r,s)=>r.has(n)||rg("Cannot "+s),$c=(n,r,s)=>(Wx(n,r,"read from private field"),s?s.call(n):r.get(n)),Kx=(n,r,s)=>r.has(n)?rg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),$p="popstate";function Gx(n={}){function r(o,u){let{pathname:d,search:h,hash:p}=o.location;return el("",{pathname:d,search:h,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function s(o,u){return typeof u=="string"?u:or(u)}return Jx(r,s,null,n)}function ze(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function wt(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Yx(){return Math.random().toString(36).substring(2,10)}function qp(n,r){return{usr:n.state,key:n.key,idx:r}}function el(n,r,s=null,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?ms(r):r,state:s,key:r&&r.key||o||Yx()}}function or({pathname:n="/",search:r="",hash:s=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function ms(n){let r={};if(n){let s=n.indexOf("#");s>=0&&(r.hash=n.substring(s),n=n.substring(0,s));let o=n.indexOf("?");o>=0&&(r.search=n.substring(o),n=n.substring(0,o)),n&&(r.pathname=n)}return r}function Jx(n,r,s,o={}){let{window:u=document.defaultView,v5Compat:d=!1}=o,h=u.history,p="POP",g=null,m=y();m==null&&(m=0,h.replaceState({...h.state,idx:m},""));function y(){return(h.state||{idx:null}).idx}function w(){p="POP";let S=y(),P=S==null?null:S-m;m=S,g&&g({action:p,location:E.location,delta:P})}function x(S,P){p="PUSH";let D=el(E.location,S,P);m=y()+1;let U=qp(D,m),Q=E.createHref(D);try{h.pushState(U,"",Q)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;u.location.assign(Q)}d&&g&&g({action:p,location:E.location,delta:1})}function j(S,P){p="REPLACE";let D=el(E.location,S,P);m=y();let U=qp(D,m),Q=E.createHref(D);h.replaceState(U,"",Q),d&&g&&g({action:p,location:E.location,delta:0})}function _(S){return sg(S)}let E={get action(){return p},get location(){return n(u,h)},listen(S){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener($p,w),g=S,()=>{u.removeEventListener($p,w),g=null}},createHref(S){return r(u,S)},createURL:_,encodeLocation(S){let P=_(S);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:x,replace:j,go(S){return h.go(S)}};return E}function sg(n,r=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),ze(s,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:or(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=s+o),new URL(o,s)}var Yi,Bp=class{constructor(n){if(Kx(this,Yi,new Map),n)for(let[r,s]of n)this.set(r,s)}get(n){if($c(this,Yi).has(n))return $c(this,Yi).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,r){$c(this,Yi).set(n,r)}};Yi=new WeakMap;var Xx=new Set(["lazy","caseSensitive","path","id","index","children"]);function Zx(n){return Xx.has(n)}var e0=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function t0(n){return e0.has(n)}function n0(n){return n.index===!0}function tl(n,r,s=[],o={},u=!1){return n.map((d,h)=>{let p=[...s,String(h)],g=typeof d.id=="string"?d.id:p.join("-");if(ze(d.index!==!0||!d.children,"Cannot specify children on an index route"),ze(u||!o[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),n0(d)){let m={...d,id:g};return o[g]=Hp(m,r(m)),m}else{let m={...d,id:g,children:void 0};return o[g]=Hp(m,r(m)),d.children&&(m.children=tl(d.children,r,p,o,u)),m}})}function Hp(n,r){return Object.assign(n,{...r,...typeof r.lazy=="object"&&r.lazy!=null?{lazy:{...n.lazy,...r.lazy}}:{}})}function ts(n,r,s="/"){return Ji(n,r,s,!1)}function Ji(n,r,s,o){let u=typeof r=="string"?ms(r):r,d=An(u.pathname||"/",s);if(d==null)return null;let h=ag(n);s0(h);let p=null;for(let g=0;p==null&&g<h.length;++g){let m=m0(d);p=h0(h[g],m,o)}return p}function r0(n,r){let{route:s,pathname:o,params:u}=n;return{id:s.id,pathname:o,params:u,data:r[s.id],loaderData:r[s.id],handle:s.handle}}function ag(n,r=[],s=[],o="",u=!1){let d=(h,p,g=u,m)=>{let y={relativePath:m===void 0?h.path||"":m,caseSensitive:h.caseSensitive===!0,childrenIndex:p,route:h};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&g)return;ze(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let w=lr([o,y.relativePath]),x=s.concat(y);h.children&&h.children.length>0&&(ze(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),ag(h.children,r,x,w,g)),!(h.path==null&&!h.index)&&r.push({path:w,score:d0(w,h.index),routesMeta:x})};return n.forEach((h,p)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,p);else for(let m of ig(h.path))d(h,p,!0,m)}),r}function ig(n){let r=n.split("/");if(r.length===0)return[];let[s,...o]=r,u=s.endsWith("?"),d=s.replace(/\?$/,"");if(o.length===0)return u?[d,""]:[d];let h=ig(o.join("/")),p=[];return p.push(...h.map(g=>g===""?d:[d,g].join("/"))),u&&p.push(...h),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function s0(n){n.sort((r,s)=>r.score!==s.score?s.score-r.score:f0(r.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var a0=/^:[\w-]+$/,i0=3,l0=2,o0=1,u0=10,c0=-2,Qp=n=>n==="*";function d0(n,r){let s=n.split("/"),o=s.length;return s.some(Qp)&&(o+=c0),r&&(o+=l0),s.filter(u=>!Qp(u)).reduce((u,d)=>u+(a0.test(d)?i0:d===""?o0:u0),o)}function f0(n,r){return n.length===r.length&&n.slice(0,-1).every((o,u)=>o===r[u])?n[n.length-1]-r[r.length-1]:0}function h0(n,r,s=!1){let{routesMeta:o}=n,u={},d="/",h=[];for(let p=0;p<o.length;++p){let g=o[p],m=p===o.length-1,y=d==="/"?r:r.slice(d.length)||"/",w=zo({path:g.relativePath,caseSensitive:g.caseSensitive,end:m},y),x=g.route;if(!w&&m&&s&&!o[o.length-1].route.index&&(w=zo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!w)return null;Object.assign(u,w.params),h.push({params:u,pathname:lr([d,w.pathname]),pathnameBase:x0(lr([d,w.pathnameBase])),route:x}),w.pathnameBase!=="/"&&(d=lr([d,w.pathnameBase]))}return h}function zo(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,o]=p0(n.path,n.caseSensitive,n.end),u=r.match(s);if(!u)return null;let d=u[0],h=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:o.reduce((m,{paramName:y,isOptional:w},x)=>{if(y==="*"){let _=p[x]||"";h=d.slice(0,d.length-_.length).replace(/(.)\/+$/,"$1")}const j=p[x];return w&&!j?m[y]=void 0:m[y]=(j||"").replace(/%2F/g,"/"),m},{}),pathname:d,pathnameBase:h,pattern:n}}function p0(n,r=!1,s=!0){wt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,g)=>(o.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,r?void 0:"i"),o]}function m0(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return wt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),n}}function An(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let s=r.endsWith("/")?r.length-1:r.length,o=n.charAt(s);return o&&o!=="/"?null:n.slice(s)||"/"}function g0({basename:n,pathname:r}){return r==="/"?n:lr([n,r])}var y0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ho=n=>y0.test(n);function v0(n,r="/"){let{pathname:s,search:o="",hash:u=""}=typeof n=="string"?ms(n):n,d;if(s)if(Ho(s))d=s;else{if(s.includes("//")){let h=s;s=s.replace(/\/\/+/g,"/"),wt(!1,`Pathnames cannot have embedded double slashes - normalizing ${h} -> ${s}`)}s.startsWith("/")?d=Vp(s.substring(1),"/"):d=Vp(s,r)}else d=r;return{pathname:d,search:w0(o),hash:k0(u)}}function Vp(n,r){let s=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(u=>{u===".."?s.length>1&&s.pop():u!=="."&&s.push(u)}),s.length>1?s.join("/"):"/"}function qc(n,r,s,o){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lg(n){return n.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function Qo(n){let r=lg(n);return r.map((s,o)=>o===r.length-1?s.pathname:s.pathnameBase)}function Vo(n,r,s,o=!1){let u;typeof n=="string"?u=ms(n):(u={...n},ze(!u.pathname||!u.pathname.includes("?"),qc("?","pathname","search",u)),ze(!u.pathname||!u.pathname.includes("#"),qc("#","pathname","hash",u)),ze(!u.search||!u.search.includes("#"),qc("#","search","hash",u)));let d=n===""||u.pathname==="",h=d?"/":u.pathname,p;if(h==null)p=s;else{let w=r.length-1;if(!o&&h.startsWith("..")){let x=h.split("/");for(;x[0]==="..";)x.shift(),w-=1;u.pathname=x.join("/")}p=w>=0?r[w]:"/"}let g=v0(u,p),m=h&&h!=="/"&&h.endsWith("/"),y=(d||h===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(m||y)&&(g.pathname+="/"),g}var lr=n=>n.join("/").replace(/\/\/+/g,"/"),x0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),w0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,k0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Uo=class{constructor(n,r,s,o=!1){this.status=n,this.statusText=r||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function nl(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Ld(n){return n.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var fs=Symbol("Uninstrumented");function j0(n,r){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(u=>u({id:r.id,index:r.index,path:r.path,instrument(d){let h=Object.keys(s);for(let p of h)d[p]&&s[p].push(d[p])}}));let o={};if(typeof r.lazy=="function"&&s.lazy.length>0){let u=Aa(s.lazy,r.lazy,()=>{});u&&(o.lazy=u)}if(typeof r.lazy=="object"){let u=r.lazy;["middleware","loader","action"].forEach(d=>{let h=u[d],p=s[`lazy.${d}`];if(typeof h=="function"&&p.length>0){let g=Aa(p,h,()=>{});g&&(o.lazy=Object.assign(o.lazy||{},{[d]:g}))}})}return["loader","action"].forEach(u=>{let d=r[u];if(typeof d=="function"&&s[u].length>0){let h=d[fs]??d,p=Aa(s[u],h,(...g)=>Wp(g[0]));p&&(p[fs]=h,o[u]=p)}}),r.middleware&&r.middleware.length>0&&s.middleware.length>0&&(o.middleware=r.middleware.map(u=>{let d=u[fs]??u,h=Aa(s.middleware,d,(...p)=>Wp(p[0]));return h?(h[fs]=d,h):u})),o}function b0(n,r){let s={navigate:[],fetch:[]};if(r.forEach(o=>o({instrument(u){let d=Object.keys(u);for(let h of d)u[h]&&s[h].push(u[h])}})),s.navigate.length>0){let o=n.navigate[fs]??n.navigate,u=Aa(s.navigate,o,(...d)=>{let[h,p]=d;return{to:typeof h=="number"||typeof h=="string"?h:h?or(h):".",...Kp(n,p??{})}});u&&(u[fs]=o,n.navigate=u)}if(s.fetch.length>0){let o=n.fetch[fs]??n.fetch,u=Aa(s.fetch,o,(...d)=>{let[h,,p,g]=d;return{href:p??".",fetcherKey:h,...Kp(n,g??{})}});u&&(u[fs]=o,n.fetch=u)}return n}function Aa(n,r,s){return n.length===0?null:async(...o)=>{let u=await og(n,s(...o),()=>r(...o),n.length-1);if(u.type==="error")throw u.value;return u.value}}async function og(n,r,s,o){let u=n[o],d;if(u){let h,p=async()=>(h?console.error("You cannot call instrumented handlers more than once"):h=og(n,r,s,o-1),d=await h,ze(d,"Expected a result"),d.type==="error"&&d.value instanceof Error?{status:"error",error:d.value}:{status:"success",error:void 0});try{await u(p,r)}catch(g){console.error("An instrumentation function threw an error:",g)}h||await p(),await h}else try{d={type:"success",value:await s()}}catch(h){d={type:"error",value:h}}return d||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Wp(n){let{request:r,context:s,params:o,unstable_pattern:u}=n;return{request:S0(r),params:{...o},unstable_pattern:u,context:C0(s)}}function Kp(n,r){return{currentUrl:or(n.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function S0(n){return{method:n.method,url:n.url,headers:{get:(...r)=>n.headers.get(...r)}}}function C0(n){if(E0(n)){let r={...n};return Object.freeze(r),r}else return{get:r=>n.get(r)}}var N0=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function E0(n){if(n===null||typeof n!="object")return!1;const r=Object.getPrototypeOf(n);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===N0}var ug=["POST","PUT","PATCH","DELETE"],R0=new Set(ug),P0=["GET",...ug],T0=new Set(P0),L0=new Set([301,302,303,307,308]),M0=new Set([307,308]),Bc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_0={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Hi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},A0=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),cg="remix-router-transitions",dg=Symbol("ResetLoaderData");function D0(n){const r=n.window?n.window:typeof window<"u"?window:void 0,s=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";ze(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let o=n.hydrationRouteProperties||[],u=n.mapRouteProperties||A0,d=u;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;d=M=>({...u(M),...j0(C.map(z=>z.route).filter(Boolean),M)})}let h={},p=tl(n.routes,d,void 0,h),g,m=n.basename||"/";m.startsWith("/")||(m=`/${m}`);let y=n.dataStrategy||U0,w={...n.future},x=null,j=new Set,_=null,E=null,S=null,P=n.hydrationData!=null,D=ts(p,n.history.location,m),U=!1,Q=null,X;if(D==null&&!n.patchRoutesOnNavigation){let C=Mn(404,{pathname:n.history.location.pathname}),{matches:M,route:z}=Co(p);X=!0,D=M,Q={[z.id]:C}}else if(D&&!n.hydrationData&&ws(D,p,n.history.location.pathname).active&&(D=null),D)if(D.some(C=>C.route.lazy))X=!1;else if(!D.some(C=>Md(C.route)))X=!0;else{let C=n.hydrationData?n.hydrationData.loaderData:null,M=n.hydrationData?n.hydrationData.errors:null;if(M){let z=D.findIndex(V=>M[V.route.id]!==void 0);X=D.slice(0,z+1).every(V=>!cd(V.route,C,M))}else X=D.every(z=>!cd(z.route,C,M))}else{X=!1,D=[];let C=ws(null,p,n.history.location.pathname);C.active&&C.matches&&(U=!0,D=C.matches)}let se,A={historyAction:n.history.action,location:n.history.location,matches:D,initialized:X,navigation:Bc,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||Q,fetchers:new Map,blockers:new Map},B="POP",pe=!1,Z,Ue=!1,Je=new Map,nt=null,pt=!1,Pe=!1,Te=new Set,ye=new Map,G=0,ne=-1,$=new Map,L=new Set,q=new Map,be=new Map,ve=new Set,xe=new Map,Se,Fe=null;function Ke(){if(x=n.history.listen(({action:C,location:M,delta:z})=>{if(Se){Se(),Se=void 0;return}wt(xe.size===0||z!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let V=ia({currentLocation:A.location,nextLocation:M,historyAction:C});if(V&&z!=null){let J=new Promise(ce=>{Se=ce});n.history.go(z*-1),Pr(V,{state:"blocked",location:M,proceed(){Pr(V,{state:"proceeding",proceed:void 0,reset:void 0,location:M}),J.then(()=>n.history.go(z))},reset(){let ce=new Map(A.blockers);ce.set(V,Hi),ct({blockers:ce})}});return}return Yn(C,M)}),s){tw(r,Je);let C=()=>nw(r,Je);r.addEventListener("pagehide",C),nt=()=>r.removeEventListener("pagehide",C)}return A.initialized||Yn("POP",A.location,{initialHydration:!0}),se}function _e(){x&&x(),nt&&nt(),j.clear(),Z&&Z.abort(),A.fetchers.forEach((C,M)=>ur(M)),A.blockers.forEach((C,M)=>aa(M))}function It(C){return j.add(C),()=>j.delete(C)}function ct(C,M={}){C.matches&&(C.matches=C.matches.map(J=>{let ce=h[J.route.id],fe=J.route;return fe.element!==ce.element||fe.errorElement!==ce.errorElement||fe.hydrateFallbackElement!==ce.hydrateFallbackElement?{...J,route:ce}:J})),A={...A,...C};let z=[],V=[];A.fetchers.forEach((J,ce)=>{J.state==="idle"&&(ve.has(ce)?z.push(ce):V.push(ce))}),ve.forEach(J=>{!A.fetchers.has(J)&&!ye.has(J)&&z.push(J)}),[...j].forEach(J=>J(A,{deletedFetchers:z,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),z.forEach(J=>ur(J)),V.forEach(J=>A.fetchers.delete(J))}function sn(C,M,{flushSync:z}={}){var we,ge;let V=A.actionData!=null&&A.navigation.formMethod!=null&&nn(A.navigation.formMethod)&&A.navigation.state==="loading"&&((we=C.state)==null?void 0:we._isRedirect)!==!0,J;M.actionData?Object.keys(M.actionData).length>0?J=M.actionData:J=null:V?J=A.actionData:J=null;let ce=M.loaderData?sm(A.loaderData,M.loaderData,M.matches||[],M.errors):A.loaderData,fe=A.blockers;fe.size>0&&(fe=new Map(fe),fe.forEach((Ae,st)=>fe.set(st,Hi)));let de=pt?!1:oi(C,M.matches||A.matches),me=pe===!0||A.navigation.formMethod!=null&&nn(A.navigation.formMethod)&&((ge=C.state)==null?void 0:ge._isRedirect)!==!0;g&&(p=g,g=void 0),pt||B==="POP"||(B==="PUSH"?n.history.push(C,C.state):B==="REPLACE"&&n.history.replace(C,C.state));let je;if(B==="POP"){let Ae=Je.get(A.location.pathname);Ae&&Ae.has(C.pathname)?je={currentLocation:A.location,nextLocation:C}:Je.has(C.pathname)&&(je={currentLocation:C,nextLocation:A.location})}else if(Ue){let Ae=Je.get(A.location.pathname);Ae?Ae.add(C.pathname):(Ae=new Set([C.pathname]),Je.set(A.location.pathname,Ae)),je={currentLocation:A.location,nextLocation:C}}ct({...M,actionData:J,loaderData:ce,historyAction:B,location:C,initialized:!0,navigation:Bc,revalidation:"idle",restoreScrollPosition:de,preventScrollReset:me,blockers:fe},{viewTransitionOpts:je,flushSync:z===!0}),B="POP",pe=!1,Ue=!1,pt=!1,Pe=!1,Fe==null||Fe.resolve(),Fe=null}async function Fn(C,M){if(typeof C=="number"){n.history.go(C);return}let z=ud(A.location,A.matches,m,C,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:V,submission:J,error:ce}=Gp(!1,z,M),fe=A.location,de=el(A.location,V,M&&M.state);de={...de,...n.history.encodeLocation(de)};let me=M&&M.replace!=null?M.replace:void 0,je="PUSH";me===!0?je="REPLACE":me===!1||J!=null&&nn(J.formMethod)&&J.formAction===A.location.pathname+A.location.search&&(je="REPLACE");let we=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,ge=(M&&M.flushSync)===!0,Ae=ia({currentLocation:fe,nextLocation:de,historyAction:je});if(Ae){Pr(Ae,{state:"blocked",location:de,proceed(){Pr(Ae,{state:"proceeding",proceed:void 0,reset:void 0,location:de}),Fn(C,M)},reset(){let st=new Map(A.blockers);st.set(Ae,Hi),ct({blockers:st})}});return}await Yn(je,de,{submission:J,pendingError:ce,preventScrollReset:we,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:ge})}function Gn(){Fe||(Fe=rw()),ra(),ct({revalidation:"loading"});let C=Fe.promise;return A.navigation.state==="submitting"?C:A.navigation.state==="idle"?(Yn(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),C):(Yn(B||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:Ue===!0}),C)}async function Yn(C,M,z){Z&&Z.abort(),Z=null,B=C,pt=(z&&z.startUninterruptedRevalidation)===!0,gl(A.location,A.matches),pe=(z&&z.preventScrollReset)===!0,Ue=(z&&z.enableViewTransition)===!0;let V=g||p,J=z&&z.overrideNavigation,ce=z!=null&&z.initialHydration&&A.matches&&A.matches.length>0&&!U?A.matches:ts(V,M,m),fe=(z&&z.flushSync)===!0;if(ce&&A.initialized&&!Pe&&K0(A.location,M)&&!(z&&z.submission&&nn(z.submission.formMethod))){sn(M,{matches:ce},{flushSync:fe});return}let de=ws(ce,V,M.pathname);if(de.active&&de.matches&&(ce=de.matches),!ce){let{error:Nt,notFoundMatches:at,route:it}=Xn(M.pathname);sn(M,{matches:at,loaderData:{},errors:{[it.id]:Nt}},{flushSync:fe});return}Z=new AbortController;let me=_a(n.history,M,Z.signal,z&&z.submission),je=n.getContext?await n.getContext():new Bp,we;if(z&&z.pendingError)we=[ns(ce).route.id,{type:"error",error:z.pendingError}];else if(z&&z.submission&&nn(z.submission.formMethod)){let Nt=await pl(me,M,z.submission,ce,je,de.active,z&&z.initialHydration===!0,{replace:z.replace,flushSync:fe});if(Nt.shortCircuited)return;if(Nt.pendingActionResult){let[at,it]=Nt.pendingActionResult;if(kn(it)&&nl(it.error)&&it.error.status===404){Z=null,sn(M,{matches:Nt.matches,loaderData:{},errors:{[at]:it.error}});return}}ce=Nt.matches||ce,we=Nt.pendingActionResult,J=Hc(M,z.submission),fe=!1,de.active=!1,me=_a(n.history,me.url,me.signal)}let{shortCircuited:ge,matches:Ae,loaderData:st,errors:jt}=await Za(me,M,ce,je,de.active,J,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,z&&z.initialHydration===!0,fe,we);ge||(Z=null,sn(M,{matches:Ae||ce,...am(we),loaderData:st,errors:jt}))}async function pl(C,M,z,V,J,ce,fe,de={}){ra();let me=Z0(M,z);if(ct({navigation:me},{flushSync:de.flushSync===!0}),ce){let ge=await ks(V,M.pathname,C.signal);if(ge.type==="aborted")return{shortCircuited:!0};if(ge.type==="error"){if(ge.partialMatches.length===0){let{matches:st,route:jt}=Co(p);return{matches:st,pendingActionResult:[jt.id,{type:"error",error:ge.error}]}}let Ae=ns(ge.partialMatches).route.id;return{matches:ge.partialMatches,pendingActionResult:[Ae,{type:"error",error:ge.error}]}}else if(ge.matches)V=ge.matches;else{let{notFoundMatches:Ae,error:st,route:jt}=Xn(M.pathname);return{matches:Ae,pendingActionResult:[jt.id,{type:"error",error:st}]}}}let je,we=_o(V,M);if(!we.route.action&&!we.route.lazy)je={type:"error",error:Mn(405,{method:C.method,pathname:M.pathname,routeId:we.route.id})};else{let ge=Da(d,h,C,V,we,fe?[]:o,J),Ae=await Rr(C,ge,J,null);if(je=Ae[we.route.id],!je){for(let st of V)if(Ae[st.route.id]){je=Ae[st.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(Us(je)){let ge;return de&&de.replace!=null?ge=de.replace:ge=tm(je.response.headers.get("Location"),new URL(C.url),m)===A.location.pathname+A.location.search,await Jn(C,je,!0,{submission:z,replace:ge}),{shortCircuited:!0}}if(kn(je)){let ge=ns(V,we.route.id);return(de&&de.replace)!==!0&&(B="PUSH"),{matches:V,pendingActionResult:[ge.route.id,je,we.route.id]}}return{matches:V,pendingActionResult:[we.route.id,je]}}async function Za(C,M,z,V,J,ce,fe,de,me,je,we,ge){let Ae=ce||Hc(M,fe),st=fe||de||lm(Ae),jt=!pt&&!je;if(J){if(jt){let lt=ei(ge);ct({navigation:Ae,...lt!==void 0?{actionData:lt}:{}},{flushSync:we})}let $e=await ks(z,M.pathname,C.signal);if($e.type==="aborted")return{shortCircuited:!0};if($e.type==="error"){if($e.partialMatches.length===0){let{matches:Mr,route:Lt}=Co(p);return{matches:Mr,loaderData:{},errors:{[Lt.id]:$e.error}}}let lt=ns($e.partialMatches).route.id;return{matches:$e.partialMatches,loaderData:{},errors:{[lt]:$e.error}}}else if($e.matches)z=$e.matches;else{let{error:lt,notFoundMatches:Mr,route:Lt}=Xn(M.pathname);return{matches:Mr,loaderData:{},errors:{[Lt.id]:lt}}}}let Nt=g||p,{dsMatches:at,revalidatingFetchers:it}=Yp(C,V,d,h,n.history,A,z,st,M,je?[]:o,je===!0,Pe,Te,ve,q,L,Nt,m,n.patchRoutesOnNavigation!=null,ge);if(ne=++G,!n.dataStrategy&&!at.some($e=>$e.shouldLoad)&&!at.some($e=>$e.route.middleware&&$e.route.middleware.length>0)&&it.length===0){let $e=ml();return sn(M,{matches:z,loaderData:{},errors:ge&&kn(ge[1])?{[ge[0]]:ge[1].error}:null,...am(ge),...$e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:we}),{shortCircuited:!0}}if(jt){let $e={};if(!J){$e.navigation=Ae;let lt=ei(ge);lt!==void 0&&($e.actionData=lt)}it.length>0&&($e.fetchers=ti(it)),ct($e,{flushSync:we})}it.forEach($e=>{jn($e.key),$e.controller&&ye.set($e.key,$e.controller)});let cr=()=>it.forEach($e=>jn($e.key));Z&&Z.signal.addEventListener("abort",cr);let{loaderResults:bs,fetcherResults:Ze}=await ri(at,it,C,V);if(C.signal.aborted)return{shortCircuited:!0};Z&&Z.signal.removeEventListener("abort",cr),it.forEach($e=>ye.delete($e.key));let bn=No(bs);if(bn)return await Jn(C,bn.result,!0,{replace:me}),{shortCircuited:!0};if(bn=No(Ze),bn)return L.add(bn.key),await Jn(C,bn.result,!0,{replace:me}),{shortCircuited:!0};let{loaderData:Ss,errors:Lr}=rm(A,z,bs,ge,it,Ze);je&&A.errors&&(Lr={...A.errors,...Lr});let Sn=ml(),oa=sa(ne),Cs=Sn||oa||it.length>0;return{matches:z,loaderData:Ss,errors:Lr,...Cs?{fetchers:new Map(A.fetchers)}:{}}}function ei(C){if(C&&!kn(C[1]))return{[C[0]]:C[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function ti(C){return C.forEach(M=>{let z=A.fetchers.get(M.key),V=Qi(void 0,z?z.data:void 0);A.fetchers.set(M.key,V)}),new Map(A.fetchers)}async function vs(C,M,z,V){jn(C);let J=(V&&V.flushSync)===!0,ce=g||p,fe=ud(A.location,A.matches,m,z,M,V==null?void 0:V.relative),de=ts(ce,fe,m),me=ws(de,ce,fe);if(me.active&&me.matches&&(de=me.matches),!de){an(C,M,Mn(404,{pathname:fe}),{flushSync:J});return}let{path:je,submission:we,error:ge}=Gp(!0,fe,V);if(ge){an(C,M,ge,{flushSync:J});return}let Ae=n.getContext?await n.getContext():new Bp,st=(V&&V.preventScrollReset)===!0;if(we&&nn(we.formMethod)){await Er(C,M,je,de,Ae,me.active,J,st,we);return}q.set(C,{routeId:M,path:je}),await ni(C,M,je,de,Ae,me.active,J,st,we)}async function Er(C,M,z,V,J,ce,fe,de,me){ra(),q.delete(C);let je=A.fetchers.get(C);gn(C,ew(me,je),{flushSync:fe});let we=new AbortController,ge=_a(n.history,z,we.signal,me);if(ce){let mt=await ks(V,new URL(ge.url).pathname,ge.signal,C);if(mt.type==="aborted")return;if(mt.type==="error"){an(C,M,mt.error,{flushSync:fe});return}else if(mt.matches)V=mt.matches;else{an(C,M,Mn(404,{pathname:z}),{flushSync:fe});return}}let Ae=_o(V,z);if(!Ae.route.action&&!Ae.route.lazy){let mt=Mn(405,{method:me.formMethod,pathname:z,routeId:M});an(C,M,mt,{flushSync:fe});return}ye.set(C,we);let st=G,jt=Da(d,h,ge,V,Ae,o,J),Nt=await Rr(ge,jt,J,C),at=Nt[Ae.route.id];if(!at){for(let mt of jt)if(Nt[mt.route.id]){at=Nt[mt.route.id];break}}if(ge.signal.aborted){ye.get(C)===we&&ye.delete(C);return}if(ve.has(C)){if(Us(at)||kn(at)){gn(C,kr(void 0));return}}else{if(Us(at))if(ye.delete(C),ne>st){gn(C,kr(void 0));return}else return L.add(C),gn(C,Qi(me)),Jn(ge,at,!1,{fetcherSubmission:me,preventScrollReset:de});if(kn(at)){an(C,M,at.error);return}}let it=A.navigation.location||A.location,cr=_a(n.history,it,we.signal),bs=g||p,Ze=A.navigation.state!=="idle"?ts(bs,A.navigation.location,m):A.matches;ze(Ze,"Didn't find any matches after fetcher action");let bn=++G;$.set(C,bn);let Ss=Qi(me,at.data);A.fetchers.set(C,Ss);let{dsMatches:Lr,revalidatingFetchers:Sn}=Yp(cr,J,d,h,n.history,A,Ze,me,it,o,!1,Pe,Te,ve,q,L,bs,m,n.patchRoutesOnNavigation!=null,[Ae.route.id,at]);Sn.filter(mt=>mt.key!==C).forEach(mt=>{let ua=mt.key,vl=A.fetchers.get(ua),ca=Qi(void 0,vl?vl.data:void 0);A.fetchers.set(ua,ca),jn(ua),mt.controller&&ye.set(ua,mt.controller)}),ct({fetchers:new Map(A.fetchers)});let oa=()=>Sn.forEach(mt=>jn(mt.key));we.signal.addEventListener("abort",oa);let{loaderResults:Cs,fetcherResults:$e}=await ri(Lr,Sn,cr,J);if(we.signal.aborted)return;if(we.signal.removeEventListener("abort",oa),$.delete(C),ye.delete(C),Sn.forEach(mt=>ye.delete(mt.key)),A.fetchers.has(C)){let mt=kr(at.data);A.fetchers.set(C,mt)}let lt=No(Cs);if(lt)return Jn(cr,lt.result,!1,{preventScrollReset:de});if(lt=No($e),lt)return L.add(lt.key),Jn(cr,lt.result,!1,{preventScrollReset:de});let{loaderData:Mr,errors:Lt}=rm(A,Ze,Cs,void 0,Sn,$e);sa(bn),A.navigation.state==="loading"&&bn>ne?(ze(B,"Expected pending action"),Z&&Z.abort(),sn(A.navigation.location,{matches:Ze,loaderData:Mr,errors:Lt,fetchers:new Map(A.fetchers)})):(ct({errors:Lt,loaderData:sm(A.loaderData,Mr,Ze,Lt),fetchers:new Map(A.fetchers)}),Pe=!1)}async function ni(C,M,z,V,J,ce,fe,de,me){let je=A.fetchers.get(C);gn(C,Qi(me,je?je.data:void 0),{flushSync:fe});let we=new AbortController,ge=_a(n.history,z,we.signal);if(ce){let it=await ks(V,new URL(ge.url).pathname,ge.signal,C);if(it.type==="aborted")return;if(it.type==="error"){an(C,M,it.error,{flushSync:fe});return}else if(it.matches)V=it.matches;else{an(C,M,Mn(404,{pathname:z}),{flushSync:fe});return}}let Ae=_o(V,z);ye.set(C,we);let st=G,jt=Da(d,h,ge,V,Ae,o,J),at=(await Rr(ge,jt,J,C))[Ae.route.id];if(ye.get(C)===we&&ye.delete(C),!ge.signal.aborted){if(ve.has(C)){gn(C,kr(void 0));return}if(Us(at))if(ne>st){gn(C,kr(void 0));return}else{L.add(C),await Jn(ge,at,!1,{preventScrollReset:de});return}if(kn(at)){an(C,M,at.error);return}gn(C,kr(at.data))}}async function Jn(C,M,z,{submission:V,fetcherSubmission:J,preventScrollReset:ce,replace:fe}={}){M.response.headers.has("X-Remix-Revalidate")&&(Pe=!0);let de=M.response.headers.get("Location");ze(de,"Expected a Location header on the redirect Response"),de=tm(de,new URL(C.url),m);let me=el(A.location,de,{_isRedirect:!0});if(s){let jt=!1;if(M.response.headers.has("X-Remix-Reload-Document"))jt=!0;else if(Ho(de)){const Nt=sg(de,!0);jt=Nt.origin!==r.location.origin||An(Nt.pathname,m)==null}if(jt){fe?r.location.replace(de):r.location.assign(de);return}}Z=null;let je=fe===!0||M.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:we,formAction:ge,formEncType:Ae}=A.navigation;!V&&!J&&we&&ge&&Ae&&(V=lm(A.navigation));let st=V||J;if(M0.has(M.response.status)&&st&&nn(st.formMethod))await Yn(je,me,{submission:{...st,formAction:de},preventScrollReset:ce||pe,enableViewTransition:z?Ue:void 0});else{let jt=Hc(me,V);await Yn(je,me,{overrideNavigation:jt,fetcherSubmission:J,preventScrollReset:ce||pe,enableViewTransition:z?Ue:void 0})}}async function Rr(C,M,z,V){let J,ce={};try{J=await q0(y,C,M,V,z,!1)}catch(fe){return M.filter(de=>de.shouldLoad).forEach(de=>{ce[de.route.id]={type:"error",error:fe}}),ce}if(C.signal.aborted)return ce;for(let[fe,de]of Object.entries(J))if(J0(de)){let me=de.result;ce[fe]={type:"redirect",response:V0(me,C,fe,M,m)}}else ce[fe]=await Q0(de);return ce}async function ri(C,M,z,V){let J=Rr(z,C,V,null),ce=Promise.all(M.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let we=(await Rr(me.request,me.matches,V,me.key))[me.match.route.id];return{[me.key]:we}}else return Promise.resolve({[me.key]:{type:"error",error:Mn(404,{pathname:me.path})}})})),fe=await J,de=(await ce).reduce((me,je)=>Object.assign(me,je),{});return{loaderResults:fe,fetcherResults:de}}function ra(){Pe=!0,q.forEach((C,M)=>{ye.has(M)&&Te.add(M),jn(M)})}function gn(C,M,z={}){A.fetchers.set(C,M),ct({fetchers:new Map(A.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function an(C,M,z,V={}){let J=ns(A.matches,M);ur(C),ct({errors:{[J.route.id]:z},fetchers:new Map(A.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function si(C){return be.set(C,(be.get(C)||0)+1),ve.has(C)&&ve.delete(C),A.fetchers.get(C)||_0}function xs(C,M){jn(C,M==null?void 0:M.reason),gn(C,kr(null))}function ur(C){let M=A.fetchers.get(C);ye.has(C)&&!(M&&M.state==="loading"&&$.has(C))&&jn(C),q.delete(C),$.delete(C),L.delete(C),ve.delete(C),Te.delete(C),A.fetchers.delete(C)}function tu(C){let M=(be.get(C)||0)-1;M<=0?(be.delete(C),ve.add(C)):be.set(C,M),ct({fetchers:new Map(A.fetchers)})}function jn(C,M){let z=ye.get(C);z&&(z.abort(M),ye.delete(C))}function ai(C){for(let M of C){let z=si(M),V=kr(z.data);A.fetchers.set(M,V)}}function ml(){let C=[],M=!1;for(let z of L){let V=A.fetchers.get(z);ze(V,`Expected fetcher: ${z}`),V.state==="loading"&&(L.delete(z),C.push(z),M=!0)}return ai(C),M}function sa(C){let M=[];for(let[z,V]of $)if(V<C){let J=A.fetchers.get(z);ze(J,`Expected fetcher: ${z}`),J.state==="loading"&&(jn(z),$.delete(z),M.push(z))}return ai(M),M.length>0}function ii(C,M){let z=A.blockers.get(C)||Hi;return xe.get(C)!==M&&xe.set(C,M),z}function aa(C){A.blockers.delete(C),xe.delete(C)}function Pr(C,M){let z=A.blockers.get(C)||Hi;ze(z.state==="unblocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="proceeding"||z.state==="blocked"&&M.state==="unblocked"||z.state==="proceeding"&&M.state==="unblocked",`Invalid blocker state transition: ${z.state} -> ${M.state}`);let V=new Map(A.blockers);V.set(C,M),ct({blockers:V})}function ia({currentLocation:C,nextLocation:M,historyAction:z}){if(xe.size===0)return;xe.size>1&&wt(!1,"A router only supports one blocker at a time");let V=Array.from(xe.entries()),[J,ce]=V[V.length-1],fe=A.blockers.get(J);if(!(fe&&fe.state==="proceeding")&&ce({currentLocation:C,nextLocation:M,historyAction:z}))return J}function Xn(C){let M=Mn(404,{pathname:C}),z=g||p,{matches:V,route:J}=Co(z);return{notFoundMatches:V,route:J,error:M}}function Tr(C,M,z){if(_=C,S=M,E=z||null,!P&&A.navigation===Bc){P=!0;let V=oi(A.location,A.matches);V!=null&&ct({restoreScrollPosition:V})}return()=>{_=null,S=null,E=null}}function li(C,M){return E&&E(C,M.map(V=>r0(V,A.loaderData)))||C.key}function gl(C,M){if(_&&S){let z=li(C,M);_[z]=S()}}function oi(C,M){if(_){let z=li(C,M),V=_[z];if(typeof V=="number")return V}return null}function ws(C,M,z){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:Ji(M,z,m,!0)}}else return{active:!0,matches:Ji(M,z,m,!0)||[]};return{active:!1,matches:null}}async function ks(C,M,z,V){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let J=C;for(;;){let ce=g==null,fe=g||p,de=h;try{await n.patchRoutesOnNavigation({signal:z,path:M,matches:J,fetcherKey:V,patch:(we,ge)=>{z.aborted||Jp(we,ge,fe,de,d,!1)}})}catch(we){return{type:"error",error:we,partialMatches:J}}finally{ce&&!z.aborted&&(p=[...p])}if(z.aborted)return{type:"aborted"};let me=ts(fe,M,m),je=null;if(me){if(Object.keys(me[0].params).length===0)return{type:"success",matches:me};if(je=Ji(fe,M,m,!0),!(je&&J.length<je.length&&la(J,je.slice(0,J.length))))return{type:"success",matches:me}}if(je||(je=Ji(fe,M,m,!0)),!je||la(J,je))return{type:"success",matches:null};J=je}}function la(C,M){return C.length===M.length&&C.every((z,V)=>z.route.id===M[V].route.id)}function yl(C){h={},g=tl(C,d,void 0,h)}function js(C,M,z=!1){let V=g==null;Jp(C,M,g||p,h,d,z),V&&(p=[...p],ct({}))}return se={get basename(){return m},get future(){return w},get state(){return A},get routes(){return p},get window(){return r},initialize:Ke,subscribe:It,enableScrollRestoration:Tr,navigate:Fn,fetch:vs,revalidate:Gn,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:si,resetFetcher:xs,deleteFetcher:tu,dispose:_e,getBlocker:ii,deleteBlocker:aa,patchRoutes:js,_internalFetchControllers:ye,_internalSetRoutes:yl,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){ct(C)}},n.unstable_instrumentations&&(se=b0(se,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),se}function O0(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function ud(n,r,s,o,u,d){let h,p;if(u){h=[];for(let m of r)if(h.push(m),m.route.id===u){p=m;break}}else h=r,p=r[r.length-1];let g=Vo(o||".",Qo(h),An(n.pathname,s)||n.pathname,d==="path");if(o==null&&(g.search=n.search,g.hash=n.hash),(o==null||o===""||o===".")&&p){let m=_d(g.search);if(p.route.index&&!m)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&m){let y=new URLSearchParams(g.search),w=y.getAll("index");y.delete("index"),w.filter(j=>j).forEach(j=>y.append("index",j));let x=y.toString();g.search=x?`?${x}`:""}}return s!=="/"&&(g.pathname=g0({basename:s,pathname:g.pathname})),or(g)}function Gp(n,r,s){if(!s||!O0(s))return{path:r};if(s.formMethod&&!X0(s.formMethod))return{path:r,error:Mn(405,{method:s.formMethod})};let o=()=>({path:r,error:Mn(400,{type:"invalid-body"})}),d=(s.formMethod||"get").toUpperCase(),h=yg(r);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!nn(d))return o();let w=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((x,[j,_])=>`${x}${j}=${_}
|
|
50
|
+
`,""):String(s.body);return{path:r,submission:{formMethod:d,formAction:h,formEncType:s.formEncType,formData:void 0,json:void 0,text:w}}}else if(s.formEncType==="application/json"){if(!nn(d))return o();try{let w=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:r,submission:{formMethod:d,formAction:h,formEncType:s.formEncType,formData:void 0,json:w,text:void 0}}}catch{return o()}}}ze(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=fd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=fd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=nm(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=nm(p)}catch{return o()}let m={formMethod:d,formAction:h,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(nn(m.formMethod))return{path:r,submission:m};let y=ms(r);return n&&y.search&&_d(y.search)&&p.append("index",""),y.search=`?${p}`,{path:or(y),submission:m}}function Yp(n,r,s,o,u,d,h,p,g,m,y,w,x,j,_,E,S,P,D,U){var pt;let Q=U?kn(U[1])?U[1].error:U[1].data:void 0,X=u.createURL(d.location),se=u.createURL(g),A;if(y&&d.errors){let Pe=Object.keys(d.errors)[0];A=h.findIndex(Te=>Te.route.id===Pe)}else if(U&&kn(U[1])){let Pe=U[0];A=h.findIndex(Te=>Te.route.id===Pe)-1}let B=U?U[1].statusCode:void 0,pe=B&&B>=400,Z={currentUrl:X,currentParams:((pt=d.matches[0])==null?void 0:pt.params)||{},nextUrl:se,nextParams:h[0].params,...p,actionResult:Q,actionStatus:B},Ue=Ld(h.map(Pe=>Pe.route.path)),Je=h.map((Pe,Te)=>{let{route:ye}=Pe,G=null;if(A!=null&&Te>A?G=!1:ye.lazy?G=!0:Md(ye)?y?G=cd(ye,d.loaderData,d.errors):F0(d.loaderData,d.matches[Te],Pe)&&(G=!0):G=!1,G!==null)return dd(s,o,n,Ue,Pe,m,r,G);let ne=pe?!1:w||X.pathname+X.search===se.pathname+se.search||X.search!==se.search||I0(d.matches[Te],Pe),$={...Z,defaultShouldRevalidate:ne},L=$o(Pe,$);return dd(s,o,n,Ue,Pe,m,r,L,$)}),nt=[];return _.forEach((Pe,Te)=>{if(y||!h.some(ve=>ve.route.id===Pe.routeId)||j.has(Te))return;let ye=d.fetchers.get(Te),G=ye&&ye.state!=="idle"&&ye.data===void 0,ne=ts(S,Pe.path,P);if(!ne){if(D&&G)return;nt.push({key:Te,routeId:Pe.routeId,path:Pe.path,matches:null,match:null,request:null,controller:null});return}if(E.has(Te))return;let $=_o(ne,Pe.path),L=new AbortController,q=_a(u,Pe.path,L.signal),be=null;if(x.has(Te))x.delete(Te),be=Da(s,o,q,ne,$,m,r);else if(G)w&&(be=Da(s,o,q,ne,$,m,r));else{let ve={...Z,defaultShouldRevalidate:pe?!1:w};$o($,ve)&&(be=Da(s,o,q,ne,$,m,r,ve))}be&&nt.push({key:Te,routeId:Pe.routeId,path:Pe.path,matches:be,match:$,request:q,controller:L})}),{dsMatches:Je,revalidatingFetchers:nt}}function Md(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function cd(n,r,s){if(n.lazy)return!0;if(!Md(n))return!1;let o=r!=null&&n.id in r,u=s!=null&&s[n.id]!==void 0;return!o&&u?!1:typeof n.loader=="function"&&n.loader.hydrate===!0?!0:!o&&!u}function F0(n,r,s){let o=!r||s.route.id!==r.route.id,u=!n.hasOwnProperty(s.route.id);return o||u}function I0(n,r){let s=n.route.path;return n.pathname!==r.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==r.params["*"]}function $o(n,r){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(r);if(typeof s=="boolean")return s}return r.defaultShouldRevalidate}function Jp(n,r,s,o,u,d){let h;if(n){let m=o[n];ze(m,`No route found to patch children into: routeId = ${n}`),m.children||(m.children=[]),h=m.children}else h=s;let p=[],g=[];if(r.forEach(m=>{let y=h.find(w=>fg(m,w));y?g.push({existingRoute:y,newRoute:m}):p.push(m)}),p.length>0){let m=tl(p,u,[n||"_","patch",String((h==null?void 0:h.length)||"0")],o);h.push(...m)}if(d&&g.length>0)for(let m=0;m<g.length;m++){let{existingRoute:y,newRoute:w}=g[m],x=y,[j]=tl([w],u,[],{},!0);Object.assign(x,{element:j.element?j.element:x.element,errorElement:j.errorElement?j.errorElement:x.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:x.hydrateFallbackElement})}}function fg(n,r){return"id"in n&&"id"in r&&n.id===r.id?!0:n.index===r.index&&n.path===r.path&&n.caseSensitive===r.caseSensitive?(!n.children||n.children.length===0)&&(!r.children||r.children.length===0)?!0:n.children.every((s,o)=>{var u;return(u=r.children)==null?void 0:u.some(d=>fg(s,d))}):!1}var Xp=new WeakMap,hg=({key:n,route:r,manifest:s,mapRouteProperties:o})=>{let u=s[r.id];if(ze(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let d=u.lazy[n];if(!d)return;let h=Xp.get(u);h||(h={},Xp.set(u,h));let p=h[n];if(p)return p;let g=(async()=>{let m=Zx(n),w=u[n]!==void 0&&n!=="hasErrorBoundary";if(m)wt(!m,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),h[n]=Promise.resolve();else if(w)wt(!1,`Route "${u.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let x=await d();x!=null&&(Object.assign(u,{[n]:x}),Object.assign(u,o(u)))}typeof u.lazy=="object"&&(u.lazy[n]=void 0,Object.values(u.lazy).every(x=>x===void 0)&&(u.lazy=void 0))})();return h[n]=g,g},Zp=new WeakMap;function z0(n,r,s,o,u){let d=s[n.id];if(ze(d,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let y=Zp.get(d);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let w=(async()=>{ze(typeof n.lazy=="function","No lazy route function found");let x=await n.lazy(),j={};for(let _ in x){let E=x[_];if(E===void 0)continue;let S=t0(_),D=d[_]!==void 0&&_!=="hasErrorBoundary";S?wt(!S,"Route property "+_+" is not a supported property to be returned from a lazy route function. This property will be ignored."):D?wt(!D,`Route "${d.id}" has a static property "${_}" defined but its lazy function is also returning a value for this property. The lazy route property "${_}" will be ignored.`):j[_]=E}Object.assign(d,j),Object.assign(d,{...o(d),lazy:void 0})})();return Zp.set(d,w),w.catch(()=>{}),{lazyRoutePromise:w,lazyHandlerPromise:w}}let h=Object.keys(n.lazy),p=[],g;for(let y of h){if(u&&u.includes(y))continue;let w=hg({key:y,route:n,manifest:s,mapRouteProperties:o});w&&(p.push(w),y===r&&(g=w))}let m=p.length>0?Promise.all(p).then(()=>{}):void 0;return m==null||m.catch(()=>{}),g==null||g.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:g}}async function em(n){let r=n.matches.filter(u=>u.shouldLoad),s={};return(await Promise.all(r.map(u=>u.resolve()))).forEach((u,d)=>{s[r[d].route.id]=u}),s}async function U0(n){return n.matches.some(r=>r.route.middleware)?pg(n,()=>em(n)):em(n)}function pg(n,r){return $0(n,r,o=>o,G0,s);function s(o,u,d){if(d)return Promise.resolve(Object.assign(d.value,{[u]:{type:"error",result:o}}));{let{matches:h}=n,p=Math.min(Math.max(h.findIndex(m=>m.route.id===u),0),Math.max(h.findIndex(m=>m.unstable_shouldCallHandler()),0)),g=ns(h,h[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:o}})}}}async function $0(n,r,s,o,u){let{matches:d,request:h,params:p,context:g,unstable_pattern:m}=n,y=d.flatMap(x=>x.route.middleware?x.route.middleware.map(j=>[x.route.id,j]):[]);return await mg({request:h,params:p,context:g,unstable_pattern:m},y,r,s,o,u)}async function mg(n,r,s,o,u,d,h=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=r[h];if(!g)return await s();let[m,y]=g,w,x=async()=>{if(w)throw new Error("You may only call `next()` once per middleware");try{return w={value:await mg(n,r,s,o,u,d,h+1)},w.value}catch(j){return w={value:await d(j,m,w)},w.value}};try{let j=await y(n,x),_=j!=null?o(j):void 0;return u(_)?_:w?_??w.value:(w={value:await x()},w.value)}catch(j){return await d(j,m,w)}}function gg(n,r,s,o,u){let d=hg({key:"middleware",route:o.route,manifest:r,mapRouteProperties:n}),h=z0(o.route,nn(s.method)?"action":"loader",r,n,u);return{middleware:d,route:h.lazyRoutePromise,handler:h.lazyHandlerPromise}}function dd(n,r,s,o,u,d,h,p,g=null){let m=!1,y=gg(n,r,s,u,d);return{...u,_lazyPromises:y,shouldLoad:p,unstable_shouldRevalidateArgs:g,unstable_shouldCallHandler(w){return m=!0,g?typeof w=="boolean"?$o(u,{...g,defaultShouldRevalidate:w}):$o(u,g):p},resolve(w){let{lazy:x,loader:j,middleware:_}=u.route,E=m||p||w&&!nn(s.method)&&(x||j),S=_&&_.length>0&&!j&&!x;return E&&(nn(s.method)||!S)?B0({request:s,unstable_pattern:o,match:u,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:w,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function Da(n,r,s,o,u,d,h,p=null){return o.map(g=>g.route.id!==u.route.id?{...g,shouldLoad:!1,unstable_shouldRevalidateArgs:p,unstable_shouldCallHandler:()=>!1,_lazyPromises:gg(n,r,s,g,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:dd(n,r,s,Ld(o.map(m=>m.route.path)),g,d,h,!0,p))}async function q0(n,r,s,o,u,d){s.some(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(s.map(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware}));let h={request:r,unstable_pattern:Ld(s.map(m=>m.route.path)),params:s[0].params,context:u,matches:s},g=await n({...h,fetcherKey:o,runClientMiddleware:m=>{let y=h;return pg(y,()=>m({...y,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(m=>{var y,w;return[(y=m._lazyPromises)==null?void 0:y.handler,(w=m._lazyPromises)==null?void 0:w.route]}))}catch{}return g}async function B0({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:d,scopedContext:h}){let p,g,m=nn(n.method),y=m?"action":"loader",w=x=>{let j,_=new Promise((P,D)=>j=D);g=()=>j(),n.signal.addEventListener("abort",g);let E=P=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${s.route.id}]`)):x({request:n,unstable_pattern:r,params:s.params,context:h},...P!==void 0?[P]:[]),S=(async()=>{try{return{type:"data",result:await(d?d(D=>E(D)):E())}}catch(P){return{type:"error",result:P}}})();return Promise.race([S,_])};try{let x=m?s.route.action:s.route.loader;if(o||u)if(x){let j,[_]=await Promise.all([w(x).catch(E=>{j=E}),o,u]);if(j!==void 0)throw j;p=_}else{await o;let j=m?s.route.action:s.route.loader;if(j)[p]=await Promise.all([w(j),u]);else if(y==="action"){let _=new URL(n.url),E=_.pathname+_.search;throw Mn(405,{method:n.method,pathname:E,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(x)p=await w(x);else{let j=new URL(n.url),_=j.pathname+j.search;throw Mn(404,{pathname:_})}}catch(x){return{type:"error",result:x}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function H0(n){let r=n.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?n.body==null?null:n.json():n.text()}async function Q0(n){var o,u,d,h,p,g;let{result:r,type:s}=n;if(vg(r)){let m;try{m=await H0(r)}catch(y){return{type:"error",error:y}}return s==="error"?{type:"error",error:new Uo(r.status,r.statusText,m),statusCode:r.status,headers:r.headers}:{type:"data",data:m,statusCode:r.status,headers:r.headers}}return s==="error"?im(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:(o=r.init)==null?void 0:o.status,headers:(u=r.init)!=null&&u.headers?new Headers(r.init.headers):void 0}:{type:"error",error:new Uo(((d=r.init)==null?void 0:d.status)||500,void 0,r.data),statusCode:nl(r)?r.status:void 0,headers:(h=r.init)!=null&&h.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:nl(r)?r.status:void 0}:im(r)?{type:"data",data:r.data,statusCode:(p=r.init)==null?void 0:p.status,headers:(g=r.init)!=null&&g.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function V0(n,r,s,o,u){let d=n.headers.get("Location");if(ze(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ho(d)){let h=o.slice(0,o.findIndex(p=>p.route.id===s)+1);d=ud(new URL(r.url),h,u,d),n.headers.set("Location",d)}return n}function tm(n,r,s){if(Ho(n)){let o=n,u=o.startsWith("//")?new URL(r.protocol+o):new URL(o),d=An(u.pathname,s)!=null;if(u.origin===r.origin&&d)return u.pathname+u.search+u.hash}return n}function _a(n,r,s,o){let u=n.createURL(yg(r)).toString(),d={signal:s};if(o&&nn(o.formMethod)){let{formMethod:h,formEncType:p}=o;d.method=h.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(o.json)):p==="text/plain"?d.body=o.text:p==="application/x-www-form-urlencoded"&&o.formData?d.body=fd(o.formData):d.body=o.formData}return new Request(u,d)}function fd(n){let r=new URLSearchParams;for(let[s,o]of n.entries())r.append(s,typeof o=="string"?o:o.name);return r}function nm(n){let r=new FormData;for(let[s,o]of n.entries())r.append(s,o);return r}function W0(n,r,s,o=!1,u=!1){let d={},h=null,p,g=!1,m={},y=s&&kn(s[1])?s[1].error:void 0;return n.forEach(w=>{if(!(w.route.id in r))return;let x=w.route.id,j=r[x];if(ze(!Us(j),"Cannot handle redirect results in processLoaderData"),kn(j)){let _=j.error;if(y!==void 0&&(_=y,y=void 0),h=h||{},u)h[x]=_;else{let E=ns(n,x);h[E.route.id]==null&&(h[E.route.id]=_)}o||(d[x]=dg),g||(g=!0,p=nl(j.error)?j.error.status:500),j.headers&&(m[x]=j.headers)}else d[x]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(m[x]=j.headers)}),y!==void 0&&s&&(h={[s[0]]:y},s[2]&&(d[s[2]]=void 0)),{loaderData:d,errors:h,statusCode:p||200,loaderHeaders:m}}function rm(n,r,s,o,u,d){let{loaderData:h,errors:p}=W0(r,s,o);return u.filter(g=>!g.matches||g.matches.some(m=>m.shouldLoad)).forEach(g=>{let{key:m,match:y,controller:w}=g;if(w&&w.signal.aborted)return;let x=d[m];if(ze(x,"Did not find corresponding fetcher result"),kn(x)){let j=ns(n.matches,y==null?void 0:y.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:x.error}),n.fetchers.delete(m)}else if(Us(x))ze(!1,"Unhandled fetcher revalidation redirect");else{let j=kr(x.data);n.fetchers.set(m,j)}}),{loaderData:h,errors:p}}function sm(n,r,s,o){let u=Object.entries(r).filter(([,d])=>d!==dg).reduce((d,[h,p])=>(d[h]=p,d),{});for(let d of s){let h=d.route.id;if(!r.hasOwnProperty(h)&&n.hasOwnProperty(h)&&d.route.loader&&(u[h]=n[h]),o&&o.hasOwnProperty(h))break}return u}function am(n){return n?kn(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function ns(n,r){return(r?n.slice(0,n.findIndex(o=>o.route.id===r)+1):[...n]).reverse().find(o=>o.route.hasErrorBoundary===!0)||n[0]}function Co(n){let r=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function Mn(n,{pathname:r,routeId:s,method:o,type:u,message:d}={}){let h="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(h="Bad Request",o&&r&&s?p=`You made a ${o} request to "${r}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:u==="invalid-body"&&(p="Unable to encode submission body")):n===403?(h="Forbidden",p=`Route "${s}" does not match URL "${r}"`):n===404?(h="Not Found",p=`No route matches URL "${r}"`):n===405&&(h="Method Not Allowed",o&&r&&s?p=`You made a ${o.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:o&&(p=`Invalid request method "${o.toUpperCase()}"`)),new Uo(n||500,h,new Error(p),!0)}function No(n){let r=Object.entries(n);for(let s=r.length-1;s>=0;s--){let[o,u]=r[s];if(Us(u))return{key:o,result:u}}}function yg(n){let r=typeof n=="string"?ms(n):n;return or({...r,hash:""})}function K0(n,r){return n.pathname!==r.pathname||n.search!==r.search?!1:n.hash===""?r.hash!=="":n.hash===r.hash?!0:r.hash!==""}function G0(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([r,s])=>typeof r=="string"&&Y0(s))}function Y0(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function J0(n){return vg(n.result)&&L0.has(n.result.status)}function kn(n){return n.type==="error"}function Us(n){return(n&&n.type)==="redirect"}function im(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function vg(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function X0(n){return T0.has(n.toUpperCase())}function nn(n){return R0.has(n.toUpperCase())}function _d(n){return new URLSearchParams(n).getAll("index").some(r=>r==="")}function _o(n,r){let s=typeof r=="string"?ms(r).search:r.search;if(n[n.length-1].route.index&&_d(s||""))return n[n.length-1];let o=lg(n);return o[o.length-1]}function lm(n){let{formMethod:r,formAction:s,formEncType:o,text:u,formData:d,json:h}=n;if(!(!r||!s||!o)){if(u!=null)return{formMethod:r,formAction:s,formEncType:o,formData:void 0,json:void 0,text:u};if(d!=null)return{formMethod:r,formAction:s,formEncType:o,formData:d,json:void 0,text:void 0};if(h!==void 0)return{formMethod:r,formAction:s,formEncType:o,formData:void 0,json:h,text:void 0}}}function Hc(n,r){return r?{state:"loading",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Z0(n,r){return{state:"submitting",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Qi(n,r){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function ew(n,r){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r?r.data:void 0}}function kr(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function tw(n,r){try{let s=n.sessionStorage.getItem(cg);if(s){let o=JSON.parse(s);for(let[u,d]of Object.entries(o||{}))d&&Array.isArray(d)&&r.set(u,new Set(d||[]))}}catch{}}function nw(n,r){if(r.size>0){let s={};for(let[o,u]of r)s[o]=[...u];try{n.sessionStorage.setItem(cg,JSON.stringify(s))}catch(o){wt(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function rw(){let n,r,s=new Promise((o,u)=>{n=async d=>{o(d);try{await s}catch{}},r=async d=>{u(d);try{await s}catch{}}});return{promise:s,resolve:n,reject:r}}var ea=k.createContext(null);ea.displayName="DataRouter";var cl=k.createContext(null);cl.displayName="DataRouterState";k.createContext(!1);var Ad=k.createContext({isTransitioning:!1});Ad.displayName="ViewTransition";var xg=k.createContext(new Map);xg.displayName="Fetchers";var sw=k.createContext(null);sw.displayName="Await";var Kn=k.createContext(null);Kn.displayName="Navigation";var Wo=k.createContext(null);Wo.displayName="Location";var Dn=k.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName="Route";var Dd=k.createContext(null);Dd.displayName="RouteError";function aw(n,{relative:r}={}){ze(Ya(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=k.useContext(Kn),{hash:u,pathname:d,search:h}=dl(n,{relative:r}),p=d;return s!=="/"&&(p=d==="/"?s:lr([s,d])),o.createHref({pathname:p,search:h,hash:u})}function Ya(){return k.useContext(Wo)!=null}function On(){return ze(Ya(),"useLocation() may be used only in the context of a <Router> component."),k.useContext(Wo).location}var wg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kg(n){k.useContext(Kn).static||k.useLayoutEffect(n)}function ta(){let{isDataRoute:n}=k.useContext(Dn);return n?kw():iw()}function iw(){ze(Ya(),"useNavigate() may be used only in the context of a <Router> component.");let n=k.useContext(ea),{basename:r,navigator:s}=k.useContext(Kn),{matches:o}=k.useContext(Dn),{pathname:u}=On(),d=JSON.stringify(Qo(o)),h=k.useRef(!1);return kg(()=>{h.current=!0}),k.useCallback((g,m={})=>{if(wt(h.current,wg),!h.current)return;if(typeof g=="number"){s.go(g);return}let y=Vo(g,JSON.parse(d),u,m.relative==="path");n==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:lr([r,y.pathname])),(m.replace?s.replace:s.push)(y,m.state,m)},[r,s,d,u,n])}var lw=k.createContext(null);function ow(n){let r=k.useContext(Dn).outlet;return k.useMemo(()=>r&&k.createElement(lw.Provider,{value:n},r),[r,n])}function uw(){let{matches:n}=k.useContext(Dn),r=n[n.length-1];return r?r.params:{}}function dl(n,{relative:r}={}){let{matches:s}=k.useContext(Dn),{pathname:o}=On(),u=JSON.stringify(Qo(s));return k.useMemo(()=>Vo(n,JSON.parse(u),o,r==="path"),[n,u,o,r])}function cw(n,r,s,o,u){ze(Ya(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=k.useContext(Kn),{matches:h}=k.useContext(Dn),p=h[h.length-1],g=p?p.params:{},m=p?p.pathname:"/",y=p?p.pathnameBase:"/",w=p&&p.route;{let D=w&&w.path||"";jg(m,!w||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${D}">) 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.
|
|
51
51
|
|
|
52
|
-
Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}/*`}">.`)}let x=On(),j;j=x;let T=j.pathname||"/",N=T;if(y!=="/"){let z=y.replace(/^\//,"").split("/");N="/"+T.replace(/^\//,"").split("/").slice(z.length).join("/")}let S=ts(n,{pathname:N});return wt(w||S!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),wt(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),mw(S&&S.map(z=>Object.assign({},z,{params:Object.assign({},g,z.params),pathname:lr([y,d.encodeLocation?d.encodeLocation(z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?y:lr([y,d.encodeLocation?d.encodeLocation(z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathnameBase])})),h,s,o,u)}function dw(){let n=ww(),r=tl(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:o},d={padding:"2px 4px",backgroundColor:o},h=null;return console.error("Error handled by React Router default ErrorBoundary:",n),h=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:d},"ErrorBoundary")," or"," ",k.createElement("code",{style:d},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},r),s?k.createElement("pre",{style:u},s):null,h)}var fw=k.createElement(dw,null),hw=class extends k.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){this.props.onError?this.props.onError(n,r):console.error("React Router caught the following error during render",n)}render(){return this.state.error!==void 0?k.createElement(Dn.Provider,{value:this.props.routeContext},k.createElement(Dd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function pw({routeContext:n,match:r,children:s}){let o=k.useContext(ea);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Dn.Provider,{value:n},s)}function mw(n,r=[],s=null,o=null,u=null){if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(r.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let d=n,h=s==null?void 0:s.errors;if(h!=null){let y=d.findIndex(w=>w.route.id&&(h==null?void 0:h[w.route.id])!==void 0);Ie(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),d=d.slice(0,Math.min(d.length,y+1))}let p=!1,g=-1;if(s)for(let y=0;y<d.length;y++){let w=d[y];if((w.route.HydrateFallback||w.route.hydrateFallbackElement)&&(g=y),w.route.id){let{loaderData:x,errors:j}=s,T=w.route.loader&&!x.hasOwnProperty(w.route.id)&&(!j||j[w.route.id]===void 0);if(w.route.lazy||T){p=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}let m=s&&o?(y,w)=>{var x,j;o(y,{location:s.location,params:((j=(x=s.matches)==null?void 0:x[0])==null?void 0:j.params)??{},errorInfo:w})}:void 0;return d.reduceRight((y,w,x)=>{let j,T=!1,N=null,S=null;s&&(j=h&&w.route.id?h[w.route.id]:void 0,N=w.route.errorElement||fw,p&&(g<0&&x===0?(jg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,S=null):g===x&&(T=!0,S=w.route.hydrateFallbackElement||null)));let L=r.concat(d.slice(0,x+1)),z=()=>{let $;return j?$=N:T?$=S:w.route.Component?$=k.createElement(w.route.Component,null):w.route.element?$=w.route.element:$=y,k.createElement(pw,{match:w,routeContext:{outlet:y,matches:L,isDataRoute:s!=null},children:$})};return s&&(w.route.ErrorBoundary||w.route.errorElement||x===0)?k.createElement(hw,{location:s.location,revalidation:s.revalidation,component:N,error:j,children:z(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:m}):z()},null)}function Od(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gw(n){let r=k.useContext(ea);return Ie(r,Od(n)),r}function yw(n){let r=k.useContext(ul);return Ie(r,Od(n)),r}function vw(n){let r=k.useContext(Dn);return Ie(r,Od(n)),r}function Fd(n){let r=vw(n),s=r.matches[r.matches.length-1];return Ie(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function xw(){return Fd("useRouteId")}function ww(){var o;let n=k.useContext(Dd),r=yw("useRouteError"),s=Fd("useRouteError");return n!==void 0?n:(o=r.errors)==null?void 0:o[s]}function kw(){let{router:n}=gw("useNavigate"),r=Fd("useNavigate"),s=k.useRef(!1);return kg(()=>{s.current=!0}),k.useCallback(async(u,d={})=>{wt(s.current,wg),s.current&&(typeof u=="number"?n.navigate(u):await n.navigate(u,{fromRouteId:r,...d}))},[n,r])}var om={};function jg(n,r,s){!r&&!om[n]&&(om[n]=!0,wt(!1,s))}var um={};function cm(n,r){!n&&!um[r]&&(um[r]=!0,console.warn(r))}function jw(n){let r={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&wt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:k.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&wt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:k.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&wt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:k.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),r}var bw=["HydrateFallback","hydrateFallbackElement"],Sw=class{constructor(){this.status="pending",this.promise=new Promise((n,r)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",r(s))}})}};function Cw({router:n,flushSync:r,unstable_onError:s}){let[o,u]=k.useState(n.state),[d,h]=k.useState(),[p,g]=k.useState({isTransitioning:!1}),[m,y]=k.useState(),[w,x]=k.useState(),[j,T]=k.useState(),N=k.useRef(new Map),S=k.useCallback(X=>{u(se=>(X.errors&&s&&Object.entries(X.errors).forEach(([A,B])=>{var pe,Z;((pe=se.errors)==null?void 0:pe[A])!==B&&s(B,{location:X.location,params:((Z=X.matches[0])==null?void 0:Z.params)??{}})}),X))},[s]),L=k.useCallback((X,{deletedFetchers:se,flushSync:A,viewTransitionOpts:B})=>{X.fetchers.forEach((Z,ze)=>{Z.data!==void 0&&N.current.set(ze,Z.data)}),se.forEach(Z=>N.current.delete(Z)),cm(A===!1||r!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let pe=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(cm(B==null||pe,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!pe){r&&A?r(()=>S(X)):k.startTransition(()=>S(X));return}if(r&&A){r(()=>{w&&(m&&m.resolve(),w.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let Z=n.window.document.startViewTransition(()=>{r(()=>S(X))});Z.finished.finally(()=>{r(()=>{y(void 0),x(void 0),h(void 0),g({isTransitioning:!1})})}),r(()=>x(Z));return}w?(m&&m.resolve(),w.skipTransition(),T({state:X,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(h(X),g({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[n.window,r,w,m,S]);k.useLayoutEffect(()=>n.subscribe(L),[n,L]),k.useEffect(()=>{p.isTransitioning&&!p.flushSync&&y(new Sw)},[p]),k.useEffect(()=>{if(m&&d&&n.window){let X=d,se=m.promise,A=n.window.document.startViewTransition(async()=>{k.startTransition(()=>S(X)),await se});A.finished.finally(()=>{y(void 0),x(void 0),h(void 0),g({isTransitioning:!1})}),x(A)}},[d,m,n.window,S]),k.useEffect(()=>{m&&d&&o.location.key===d.location.key&&m.resolve()},[m,w,o.location,d]),k.useEffect(()=>{!p.isTransitioning&&j&&(h(j.state),g({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}),T(void 0))},[p.isTransitioning,j]);let z=k.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:X=>n.navigate(X),push:(X,se,A)=>n.navigate(X,{state:se,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(X,se,A)=>n.navigate(X,{replace:!0,state:se,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[n]),$=n.basename||"/",Q=k.useMemo(()=>({router:n,navigator:z,static:!1,basename:$,unstable_onError:s}),[n,z,$,s]);return k.createElement(k.Fragment,null,k.createElement(ea.Provider,{value:Q},k.createElement(ul.Provider,{value:o},k.createElement(xg.Provider,{value:N.current},k.createElement(Ad.Provider,{value:p},k.createElement(Rw,{basename:$,location:o.location,navigationType:o.historyAction,navigator:z},k.createElement(Nw,{routes:n.routes,future:n.future,state:o,unstable_onError:s})))))),null)}var Nw=k.memo(Ew);function Ew({routes:n,future:r,state:s,unstable_onError:o}){return cw(n,void 0,s,o,r)}function hd({to:n,replace:r,state:s,relative:o}){Ie(Ya(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=k.useContext(Kn);wt(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=k.useContext(Dn),{pathname:h}=On(),p=ta(),g=Vo(n,Qo(d),h,o==="path"),m=JSON.stringify(g);return k.useEffect(()=>{p(JSON.parse(m),{replace:r,state:s,relative:o})},[p,m,o,r,s]),null}function Id(n){return ow(n.context)}function Rw({basename:n="/",children:r=null,location:s,navigationType:o="POP",navigator:u,static:d=!1}){Ie(!Ya(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),p=k.useMemo(()=>({basename:h,navigator:u,static:d,future:{}}),[h,u,d]);typeof s=="string"&&(s=ms(s));let{pathname:g="/",search:m="",hash:y="",state:w=null,key:x="default"}=s,j=k.useMemo(()=>{let T=An(g,h);return T==null?null:{location:{pathname:T,search:m,hash:y,state:w,key:x},navigationType:o}},[h,g,m,y,w,x,o]);return wt(j!=null,`<Router basename="${h}"> is not able to match the URL "${g}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:k.createElement(Kn.Provider,{value:p},k.createElement(Wo.Provider,{children:r,value:j}))}var _o="get",Ao="application/x-www-form-urlencoded";function Ko(n){return n!=null&&typeof n.tagName=="string"}function Pw(n){return Ko(n)&&n.tagName.toLowerCase()==="button"}function Tw(n){return Ko(n)&&n.tagName.toLowerCase()==="form"}function Lw(n){return Ko(n)&&n.tagName.toLowerCase()==="input"}function Mw(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function _w(n,r){return n.button===0&&(!r||r==="_self")&&!Mw(n)}function pd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((r,s)=>{let o=n[s];return r.concat(Array.isArray(o)?o.map(u=>[s,u]):[[s,o]])},[]))}function Aw(n,r){let s=pd(n);return r&&r.forEach((o,u)=>{s.has(u)||r.getAll(u).forEach(d=>{s.append(u,d)})}),s}var No=null;function Dw(){if(No===null)try{new FormData(document.createElement("form"),0),No=!1}catch{No=!0}return No}var Ow=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qc(n){return n!=null&&!Ow.has(n)?(wt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ao}"`),null):n}function Fw(n,r){let s,o,u,d,h;if(Tw(n)){let p=n.getAttribute("action");o=p?An(p,r):null,s=n.getAttribute("method")||_o,u=Qc(n.getAttribute("enctype"))||Ao,d=new FormData(n)}else if(Pw(n)||Lw(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(o=g?An(g,r):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||_o,u=Qc(n.getAttribute("formenctype"))||Qc(p.getAttribute("enctype"))||Ao,d=new FormData(p,n),!Dw()){let{name:m,type:y,value:w}=n;if(y==="image"){let x=m?`${m}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else m&&d.append(m,w)}}else{if(Ko(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=_o,o=null,u=Ao,h=n}return d&&u==="text/plain"&&(h=d,d=void 0),{action:o,method:s.toLowerCase(),encType:u,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zd(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function Iw(n,r,s){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return o.pathname==="/"?o.pathname=`_root.${s}`:r&&An(o.pathname,r)==="/"?o.pathname=`${r.replace(/\/$/,"")}/_root.${s}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${s}`,o}async function zw(n,r){if(n.id in r)return r[n.id];try{let s=await import(n.module);return r[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Uw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function $w(n,r,s){let o=await Promise.all(n.map(async u=>{let d=r.routes[u.route.id];if(d){let h=await zw(d,s);return h.links?h.links():[]}return[]}));return Qw(o.flat(1).filter(Uw).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function dm(n,r,s,o,u,d){let h=(g,m)=>s[m]?g.route.id!==s[m].route.id:!0,p=(g,m)=>{var y;return s[m].pathname!==g.pathname||((y=s[m].route.path)==null?void 0:y.endsWith("*"))&&s[m].params["*"]!==g.params["*"]};return d==="assets"?r.filter((g,m)=>h(g,m)||p(g,m)):d==="data"?r.filter((g,m)=>{var w;let y=o.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(h(g,m)||p(g,m))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((w=s[0])==null?void 0:w.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function qw(n,r,{includeHydrateFallback:s}={}){return Bw(n.map(o=>{let u=r.routes[o.route.id];if(!u)return[];let d=[u.module];return u.clientActionModule&&(d=d.concat(u.clientActionModule)),u.clientLoaderModule&&(d=d.concat(u.clientLoaderModule)),s&&u.hydrateFallbackModule&&(d=d.concat(u.hydrateFallbackModule)),u.imports&&(d=d.concat(u.imports)),d}).flat(1))}function Bw(n){return[...new Set(n)]}function Hw(n){let r={},s=Object.keys(n).sort();for(let o of s)r[o]=n[o];return r}function Qw(n,r){let s=new Set;return new Set(r),n.reduce((o,u)=>{let d=JSON.stringify(Hw(u));return s.has(d)||(s.add(d),o.push({key:d,link:u})),o},[])}function bg(){let n=k.useContext(ea);return zd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Vw(){let n=k.useContext(ul);return zd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Ud=k.createContext(void 0);Ud.displayName="FrameworkContext";function Sg(){let n=k.useContext(Ud);return zd(n,"You must render this element inside a <HydratedRouter> element"),n}function Ww(n,r){let s=k.useContext(Ud),[o,u]=k.useState(!1),[d,h]=k.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:m,onMouseLeave:y,onTouchStart:w}=r,x=k.useRef(null);k.useEffect(()=>{if(n==="render"&&h(!0),n==="viewport"){let N=L=>{L.forEach(z=>{h(z.isIntersecting)})},S=new IntersectionObserver(N,{threshold:.5});return x.current&&S.observe(x.current),()=>{S.disconnect()}}},[n]),k.useEffect(()=>{if(o){let N=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(N)}}},[o]);let j=()=>{u(!0)},T=()=>{u(!1),h(!1)};return s?n!=="intent"?[d,x,{}]:[d,x,{onFocus:Vi(p,j),onBlur:Vi(g,T),onMouseEnter:Vi(m,j),onMouseLeave:Vi(y,T),onTouchStart:Vi(w,j)}]:[!1,x,{}]}function Vi(n,r){return s=>{n&&n(s),s.defaultPrevented||r(s)}}function Kw({page:n,...r}){let{router:s}=bg(),o=k.useMemo(()=>ts(s.routes,n,s.basename),[s.routes,n,s.basename]);return o?k.createElement(Yw,{page:n,matches:o,...r}):null}function Gw(n){let{manifest:r,routeModules:s}=Sg(),[o,u]=k.useState([]);return k.useEffect(()=>{let d=!1;return $w(n,r,s).then(h=>{d||u(h)}),()=>{d=!0}},[n,r,s]),o}function Yw({page:n,matches:r,...s}){let o=On(),{manifest:u,routeModules:d}=Sg(),{basename:h}=bg(),{loaderData:p,matches:g}=Vw(),m=k.useMemo(()=>dm(n,r,g,u,o,"data"),[n,r,g,u,o]),y=k.useMemo(()=>dm(n,r,g,u,o,"assets"),[n,r,g,u,o]),w=k.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let T=new Set,N=!1;if(r.forEach(L=>{var $;let z=u.routes[L.route.id];!z||!z.hasLoader||(!m.some(Q=>Q.route.id===L.route.id)&&L.route.id in p&&(($=d[L.route.id])!=null&&$.shouldRevalidate)||z.hasClientLoader?N=!0:T.add(L.route.id))}),T.size===0)return[];let S=Iw(n,h,"data");return N&&T.size>0&&S.searchParams.set("_routes",r.filter(L=>T.has(L.route.id)).map(L=>L.route.id).join(",")),[S.pathname+S.search]},[h,p,o,u,m,r,n,d]),x=k.useMemo(()=>qw(y,u),[y,u]),j=Gw(y);return k.createElement(k.Fragment,null,w.map(T=>k.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...s})),x.map(T=>k.createElement("link",{key:T,rel:"modulepreload",href:T,...s})),j.map(({key:T,link:N})=>k.createElement("link",{key:T,nonce:s.nonce,...N})))}function Jw(...n){return r=>{n.forEach(s=>{typeof s=="function"?s(r):s!=null&&(s.current=r)})}}var Cg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Cg&&(window.__reactRouterVersion="7.9.6")}catch{}function Xw(n,r){return D0({basename:r==null?void 0:r.basename,getContext:r==null?void 0:r.getContext,future:r==null?void 0:r.future,history:Gx({window:r==null?void 0:r.window}),hydrationData:Zw(),routes:n,mapRouteProperties:jw,hydrationRouteProperties:bw,dataStrategy:r==null?void 0:r.dataStrategy,patchRoutesOnNavigation:r==null?void 0:r.patchRoutesOnNavigation,window:r==null?void 0:r.window,unstable_instrumentations:r==null?void 0:r.unstable_instrumentations}).initialize()}function Zw(){let n=window==null?void 0:window.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:ek(n.errors)}),n}function ek(n){if(!n)return null;let r=Object.entries(n),s={};for(let[o,u]of r)if(u&&u.__type==="RouteErrorResponse")s[o]=new Uo(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(u.__subType){let d=window[u.__subType];if(typeof d=="function")try{let h=new d(u.message);h.stack="",s[o]=h}catch{}}if(s[o]==null){let d=new Error(u.message);d.stack="",s[o]=d}}else s[o]=u;return s}var Ng=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bt=k.forwardRef(function({onClick:r,discover:s="render",prefetch:o="none",relative:u,reloadDocument:d,replace:h,state:p,target:g,to:m,preventScrollReset:y,viewTransition:w,...x},j){let{basename:T}=k.useContext(Kn),N=typeof m=="string"&&Ng.test(m),S,L=!1;if(typeof m=="string"&&N&&(S=m,Cg))try{let pe=new URL(window.location.href),Z=m.startsWith("//")?new URL(pe.protocol+m):new URL(m),ze=An(Z.pathname,T);Z.origin===pe.origin&&ze!=null?m=ze+Z.search+Z.hash:L=!0}catch{wt(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let z=aw(m,{relative:u}),[$,Q,X]=Ww(o,x),se=rk(m,{replace:h,state:p,target:g,preventScrollReset:y,relative:u,viewTransition:w});function A(pe){r&&r(pe),pe.defaultPrevented||se(pe)}let B=k.createElement("a",{...x,...X,href:S||z,onClick:L||d?r:A,ref:Jw(j,Q),target:g,"data-discover":!N&&s==="render"?"true":void 0});return $&&!N?k.createElement(k.Fragment,null,B,k.createElement(Kw,{page:z})):B});Bt.displayName="Link";var $d=k.forwardRef(function({"aria-current":r="page",caseSensitive:s=!1,className:o="",end:u=!1,style:d,to:h,viewTransition:p,children:g,...m},y){let w=cl(h,{relative:m.relative}),x=On(),j=k.useContext(ul),{navigator:T,basename:N}=k.useContext(Kn),S=j!=null&&ok(w)&&p===!0,L=T.encodeLocation?T.encodeLocation(w).pathname:w.pathname,z=x.pathname,$=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(z=z.toLowerCase(),$=$?$.toLowerCase():null,L=L.toLowerCase()),$&&N&&($=An($,N)||$);const Q=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let X=z===L||!u&&z.startsWith(L)&&z.charAt(Q)==="/",se=$!=null&&($===L||!u&&$.startsWith(L)&&$.charAt(L.length)==="/"),A={isActive:X,isPending:se,isTransitioning:S},B=X?r:void 0,pe;typeof o=="function"?pe=o(A):pe=[o,X?"active":null,se?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let Z=typeof d=="function"?d(A):d;return k.createElement(Bt,{...m,"aria-current":B,className:pe,ref:y,style:Z,to:h,viewTransition:p},typeof g=="function"?g(A):g)});$d.displayName="NavLink";var tk=k.forwardRef(({discover:n="render",fetcherKey:r,navigate:s,reloadDocument:o,replace:u,state:d,method:h=_o,action:p,onSubmit:g,relative:m,preventScrollReset:y,viewTransition:w,...x},j)=>{let T=ik(),N=lk(p,{relative:m}),S=h.toLowerCase()==="get"?"get":"post",L=typeof p=="string"&&Ng.test(p),z=$=>{if(g&&g($),$.defaultPrevented)return;$.preventDefault();let Q=$.nativeEvent.submitter,X=(Q==null?void 0:Q.getAttribute("formmethod"))||h;T(Q||$.currentTarget,{fetcherKey:r,method:X,navigate:s,replace:u,state:d,relative:m,preventScrollReset:y,viewTransition:w})};return k.createElement("form",{ref:j,method:S,action:N,onSubmit:o?g:z,...x,"data-discover":!L&&n==="render"?"true":void 0})});tk.displayName="Form";function nk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Eg(n){let r=k.useContext(ea);return Ie(r,nk(n)),r}function rk(n,{target:r,replace:s,state:o,preventScrollReset:u,relative:d,viewTransition:h}={}){let p=ta(),g=On(),m=cl(n,{relative:d});return k.useCallback(y=>{if(_w(y,r)){y.preventDefault();let w=s!==void 0?s:or(g)===or(m);p(n,{replace:w,state:o,preventScrollReset:u,relative:d,viewTransition:h})}},[g,p,m,s,o,r,n,u,d,h])}function qd(n){wt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let r=k.useRef(pd(n)),s=k.useRef(!1),o=On(),u=k.useMemo(()=>Aw(o.search,s.current?null:r.current),[o.search]),d=ta(),h=k.useCallback((p,g)=>{const m=pd(typeof p=="function"?p(new URLSearchParams(u)):p);s.current=!0,d("?"+m,g)},[d,u]);return[u,h]}var sk=0,ak=()=>`__${String(++sk)}__`;function ik(){let{router:n}=Eg("useSubmit"),{basename:r}=k.useContext(Kn),s=xw();return k.useCallback(async(o,u={})=>{let{action:d,method:h,encType:p,formData:g,body:m}=Fw(o,r);if(u.navigate===!1){let y=u.fetcherKey||ak();await n.fetch(y,s,u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:m,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await n.navigate(u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:m,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:s,flushSync:u.flushSync,viewTransition:u.viewTransition})},[n,r,s])}function lk(n,{relative:r}={}){let{basename:s}=k.useContext(Kn),o=k.useContext(Dn);Ie(o,"useFormAction must be used inside a RouteContext");let[u]=o.matches.slice(-1),d={...cl(n||".",{relative:r})},h=On();if(n==null){d.search=h.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(w=>w).forEach(w=>p.append("index",w));let y=p.toString();d.search=y?`?${y}`:""}}return(!n||n===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(d.pathname=d.pathname==="/"?s:lr([s,d.pathname])),or(d)}function ok(n,{relative:r}={}){let s=k.useContext(Ad);Ie(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Eg("useViewTransitionState"),u=cl(n,{relative:r});if(!s.isTransitioning)return!1;let d=An(s.currentLocation.pathname,o)||s.currentLocation.pathname,h=An(s.nextLocation.pathname,o)||s.nextLocation.pathname;return zo(u.pathname,h)!=null||zo(u.pathname,d)!=null}var uk=Bm();function ck(n){return k.createElement(Cw,{flushSync:uk.flushSync,...n})}/**
|
|
52
|
+
Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let x=On(),j;j=x;let _=j.pathname||"/",E=_;if(y!=="/"){let D=y.replace(/^\//,"").split("/");E="/"+_.replace(/^\//,"").split("/").slice(D.length).join("/")}let S=ts(n,{pathname:E});return wt(w||S!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),wt(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),mw(S&&S.map(D=>Object.assign({},D,{params:Object.assign({},g,D.params),pathname:lr([y,d.encodeLocation?d.encodeLocation(D.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?y:lr([y,d.encodeLocation?d.encodeLocation(D.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathnameBase])})),h,s,o,u)}function dw(){let n=ww(),r=nl(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:o},d={padding:"2px 4px",backgroundColor:o},h=null;return console.error("Error handled by React Router default ErrorBoundary:",n),h=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:d},"ErrorBoundary")," or"," ",k.createElement("code",{style:d},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},r),s?k.createElement("pre",{style:u},s):null,h)}var fw=k.createElement(dw,null),hw=class extends k.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){this.props.onError?this.props.onError(n,r):console.error("React Router caught the following error during render",n)}render(){return this.state.error!==void 0?k.createElement(Dn.Provider,{value:this.props.routeContext},k.createElement(Dd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function pw({routeContext:n,match:r,children:s}){let o=k.useContext(ea);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Dn.Provider,{value:n},s)}function mw(n,r=[],s=null,o=null,u=null){if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(r.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let d=n,h=s==null?void 0:s.errors;if(h!=null){let y=d.findIndex(w=>w.route.id&&(h==null?void 0:h[w.route.id])!==void 0);ze(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),d=d.slice(0,Math.min(d.length,y+1))}let p=!1,g=-1;if(s)for(let y=0;y<d.length;y++){let w=d[y];if((w.route.HydrateFallback||w.route.hydrateFallbackElement)&&(g=y),w.route.id){let{loaderData:x,errors:j}=s,_=w.route.loader&&!x.hasOwnProperty(w.route.id)&&(!j||j[w.route.id]===void 0);if(w.route.lazy||_){p=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}let m=s&&o?(y,w)=>{var x,j;o(y,{location:s.location,params:((j=(x=s.matches)==null?void 0:x[0])==null?void 0:j.params)??{},errorInfo:w})}:void 0;return d.reduceRight((y,w,x)=>{let j,_=!1,E=null,S=null;s&&(j=h&&w.route.id?h[w.route.id]:void 0,E=w.route.errorElement||fw,p&&(g<0&&x===0?(jg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,S=null):g===x&&(_=!0,S=w.route.hydrateFallbackElement||null)));let P=r.concat(d.slice(0,x+1)),D=()=>{let U;return j?U=E:_?U=S:w.route.Component?U=k.createElement(w.route.Component,null):w.route.element?U=w.route.element:U=y,k.createElement(pw,{match:w,routeContext:{outlet:y,matches:P,isDataRoute:s!=null},children:U})};return s&&(w.route.ErrorBoundary||w.route.errorElement||x===0)?k.createElement(hw,{location:s.location,revalidation:s.revalidation,component:E,error:j,children:D(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:m}):D()},null)}function Od(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gw(n){let r=k.useContext(ea);return ze(r,Od(n)),r}function yw(n){let r=k.useContext(cl);return ze(r,Od(n)),r}function vw(n){let r=k.useContext(Dn);return ze(r,Od(n)),r}function Fd(n){let r=vw(n),s=r.matches[r.matches.length-1];return ze(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function xw(){return Fd("useRouteId")}function ww(){var o;let n=k.useContext(Dd),r=yw("useRouteError"),s=Fd("useRouteError");return n!==void 0?n:(o=r.errors)==null?void 0:o[s]}function kw(){let{router:n}=gw("useNavigate"),r=Fd("useNavigate"),s=k.useRef(!1);return kg(()=>{s.current=!0}),k.useCallback(async(u,d={})=>{wt(s.current,wg),s.current&&(typeof u=="number"?n.navigate(u):await n.navigate(u,{fromRouteId:r,...d}))},[n,r])}var om={};function jg(n,r,s){!r&&!om[n]&&(om[n]=!0,wt(!1,s))}var um={};function cm(n,r){!n&&!um[r]&&(um[r]=!0,console.warn(r))}function jw(n){let r={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&wt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:k.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&wt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:k.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&wt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:k.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),r}var bw=["HydrateFallback","hydrateFallbackElement"],Sw=class{constructor(){this.status="pending",this.promise=new Promise((n,r)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",r(s))}})}};function Cw({router:n,flushSync:r,unstable_onError:s}){let[o,u]=k.useState(n.state),[d,h]=k.useState(),[p,g]=k.useState({isTransitioning:!1}),[m,y]=k.useState(),[w,x]=k.useState(),[j,_]=k.useState(),E=k.useRef(new Map),S=k.useCallback(X=>{u(se=>(X.errors&&s&&Object.entries(X.errors).forEach(([A,B])=>{var pe,Z;((pe=se.errors)==null?void 0:pe[A])!==B&&s(B,{location:X.location,params:((Z=X.matches[0])==null?void 0:Z.params)??{}})}),X))},[s]),P=k.useCallback((X,{deletedFetchers:se,flushSync:A,viewTransitionOpts:B})=>{X.fetchers.forEach((Z,Ue)=>{Z.data!==void 0&&E.current.set(Ue,Z.data)}),se.forEach(Z=>E.current.delete(Z)),cm(A===!1||r!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let pe=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(cm(B==null||pe,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!pe){r&&A?r(()=>S(X)):k.startTransition(()=>S(X));return}if(r&&A){r(()=>{w&&(m&&m.resolve(),w.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let Z=n.window.document.startViewTransition(()=>{r(()=>S(X))});Z.finished.finally(()=>{r(()=>{y(void 0),x(void 0),h(void 0),g({isTransitioning:!1})})}),r(()=>x(Z));return}w?(m&&m.resolve(),w.skipTransition(),_({state:X,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(h(X),g({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[n.window,r,w,m,S]);k.useLayoutEffect(()=>n.subscribe(P),[n,P]),k.useEffect(()=>{p.isTransitioning&&!p.flushSync&&y(new Sw)},[p]),k.useEffect(()=>{if(m&&d&&n.window){let X=d,se=m.promise,A=n.window.document.startViewTransition(async()=>{k.startTransition(()=>S(X)),await se});A.finished.finally(()=>{y(void 0),x(void 0),h(void 0),g({isTransitioning:!1})}),x(A)}},[d,m,n.window,S]),k.useEffect(()=>{m&&d&&o.location.key===d.location.key&&m.resolve()},[m,w,o.location,d]),k.useEffect(()=>{!p.isTransitioning&&j&&(h(j.state),g({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}),_(void 0))},[p.isTransitioning,j]);let D=k.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:X=>n.navigate(X),push:(X,se,A)=>n.navigate(X,{state:se,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(X,se,A)=>n.navigate(X,{replace:!0,state:se,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[n]),U=n.basename||"/",Q=k.useMemo(()=>({router:n,navigator:D,static:!1,basename:U,unstable_onError:s}),[n,D,U,s]);return k.createElement(k.Fragment,null,k.createElement(ea.Provider,{value:Q},k.createElement(cl.Provider,{value:o},k.createElement(xg.Provider,{value:E.current},k.createElement(Ad.Provider,{value:p},k.createElement(Rw,{basename:U,location:o.location,navigationType:o.historyAction,navigator:D},k.createElement(Nw,{routes:n.routes,future:n.future,state:o,unstable_onError:s})))))),null)}var Nw=k.memo(Ew);function Ew({routes:n,future:r,state:s,unstable_onError:o}){return cw(n,void 0,s,o,r)}function hd({to:n,replace:r,state:s,relative:o}){ze(Ya(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=k.useContext(Kn);wt(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=k.useContext(Dn),{pathname:h}=On(),p=ta(),g=Vo(n,Qo(d),h,o==="path"),m=JSON.stringify(g);return k.useEffect(()=>{p(JSON.parse(m),{replace:r,state:s,relative:o})},[p,m,o,r,s]),null}function Id(n){return ow(n.context)}function Rw({basename:n="/",children:r=null,location:s,navigationType:o="POP",navigator:u,static:d=!1}){ze(!Ya(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),p=k.useMemo(()=>({basename:h,navigator:u,static:d,future:{}}),[h,u,d]);typeof s=="string"&&(s=ms(s));let{pathname:g="/",search:m="",hash:y="",state:w=null,key:x="default"}=s,j=k.useMemo(()=>{let _=An(g,h);return _==null?null:{location:{pathname:_,search:m,hash:y,state:w,key:x},navigationType:o}},[h,g,m,y,w,x,o]);return wt(j!=null,`<Router basename="${h}"> is not able to match the URL "${g}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:k.createElement(Kn.Provider,{value:p},k.createElement(Wo.Provider,{children:r,value:j}))}var Ao="get",Do="application/x-www-form-urlencoded";function Ko(n){return n!=null&&typeof n.tagName=="string"}function Pw(n){return Ko(n)&&n.tagName.toLowerCase()==="button"}function Tw(n){return Ko(n)&&n.tagName.toLowerCase()==="form"}function Lw(n){return Ko(n)&&n.tagName.toLowerCase()==="input"}function Mw(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function _w(n,r){return n.button===0&&(!r||r==="_self")&&!Mw(n)}function pd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((r,s)=>{let o=n[s];return r.concat(Array.isArray(o)?o.map(u=>[s,u]):[[s,o]])},[]))}function Aw(n,r){let s=pd(n);return r&&r.forEach((o,u)=>{s.has(u)||r.getAll(u).forEach(d=>{s.append(u,d)})}),s}var Eo=null;function Dw(){if(Eo===null)try{new FormData(document.createElement("form"),0),Eo=!1}catch{Eo=!0}return Eo}var Ow=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qc(n){return n!=null&&!Ow.has(n)?(wt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Do}"`),null):n}function Fw(n,r){let s,o,u,d,h;if(Tw(n)){let p=n.getAttribute("action");o=p?An(p,r):null,s=n.getAttribute("method")||Ao,u=Qc(n.getAttribute("enctype"))||Do,d=new FormData(n)}else if(Pw(n)||Lw(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(o=g?An(g,r):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||Ao,u=Qc(n.getAttribute("formenctype"))||Qc(p.getAttribute("enctype"))||Do,d=new FormData(p,n),!Dw()){let{name:m,type:y,value:w}=n;if(y==="image"){let x=m?`${m}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else m&&d.append(m,w)}}else{if(Ko(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Ao,o=null,u=Do,h=n}return d&&u==="text/plain"&&(h=d,d=void 0),{action:o,method:s.toLowerCase(),encType:u,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zd(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function Iw(n,r,s){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return o.pathname==="/"?o.pathname=`_root.${s}`:r&&An(o.pathname,r)==="/"?o.pathname=`${r.replace(/\/$/,"")}/_root.${s}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${s}`,o}async function zw(n,r){if(n.id in r)return r[n.id];try{let s=await import(n.module);return r[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Uw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function $w(n,r,s){let o=await Promise.all(n.map(async u=>{let d=r.routes[u.route.id];if(d){let h=await zw(d,s);return h.links?h.links():[]}return[]}));return Qw(o.flat(1).filter(Uw).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function dm(n,r,s,o,u,d){let h=(g,m)=>s[m]?g.route.id!==s[m].route.id:!0,p=(g,m)=>{var y;return s[m].pathname!==g.pathname||((y=s[m].route.path)==null?void 0:y.endsWith("*"))&&s[m].params["*"]!==g.params["*"]};return d==="assets"?r.filter((g,m)=>h(g,m)||p(g,m)):d==="data"?r.filter((g,m)=>{var w;let y=o.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(h(g,m)||p(g,m))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((w=s[0])==null?void 0:w.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function qw(n,r,{includeHydrateFallback:s}={}){return Bw(n.map(o=>{let u=r.routes[o.route.id];if(!u)return[];let d=[u.module];return u.clientActionModule&&(d=d.concat(u.clientActionModule)),u.clientLoaderModule&&(d=d.concat(u.clientLoaderModule)),s&&u.hydrateFallbackModule&&(d=d.concat(u.hydrateFallbackModule)),u.imports&&(d=d.concat(u.imports)),d}).flat(1))}function Bw(n){return[...new Set(n)]}function Hw(n){let r={},s=Object.keys(n).sort();for(let o of s)r[o]=n[o];return r}function Qw(n,r){let s=new Set;return new Set(r),n.reduce((o,u)=>{let d=JSON.stringify(Hw(u));return s.has(d)||(s.add(d),o.push({key:d,link:u})),o},[])}function bg(){let n=k.useContext(ea);return zd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Vw(){let n=k.useContext(cl);return zd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Ud=k.createContext(void 0);Ud.displayName="FrameworkContext";function Sg(){let n=k.useContext(Ud);return zd(n,"You must render this element inside a <HydratedRouter> element"),n}function Ww(n,r){let s=k.useContext(Ud),[o,u]=k.useState(!1),[d,h]=k.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:m,onMouseLeave:y,onTouchStart:w}=r,x=k.useRef(null);k.useEffect(()=>{if(n==="render"&&h(!0),n==="viewport"){let E=P=>{P.forEach(D=>{h(D.isIntersecting)})},S=new IntersectionObserver(E,{threshold:.5});return x.current&&S.observe(x.current),()=>{S.disconnect()}}},[n]),k.useEffect(()=>{if(o){let E=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(E)}}},[o]);let j=()=>{u(!0)},_=()=>{u(!1),h(!1)};return s?n!=="intent"?[d,x,{}]:[d,x,{onFocus:Vi(p,j),onBlur:Vi(g,_),onMouseEnter:Vi(m,j),onMouseLeave:Vi(y,_),onTouchStart:Vi(w,j)}]:[!1,x,{}]}function Vi(n,r){return s=>{n&&n(s),s.defaultPrevented||r(s)}}function Kw({page:n,...r}){let{router:s}=bg(),o=k.useMemo(()=>ts(s.routes,n,s.basename),[s.routes,n,s.basename]);return o?k.createElement(Yw,{page:n,matches:o,...r}):null}function Gw(n){let{manifest:r,routeModules:s}=Sg(),[o,u]=k.useState([]);return k.useEffect(()=>{let d=!1;return $w(n,r,s).then(h=>{d||u(h)}),()=>{d=!0}},[n,r,s]),o}function Yw({page:n,matches:r,...s}){let o=On(),{manifest:u,routeModules:d}=Sg(),{basename:h}=bg(),{loaderData:p,matches:g}=Vw(),m=k.useMemo(()=>dm(n,r,g,u,o,"data"),[n,r,g,u,o]),y=k.useMemo(()=>dm(n,r,g,u,o,"assets"),[n,r,g,u,o]),w=k.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let _=new Set,E=!1;if(r.forEach(P=>{var U;let D=u.routes[P.route.id];!D||!D.hasLoader||(!m.some(Q=>Q.route.id===P.route.id)&&P.route.id in p&&((U=d[P.route.id])!=null&&U.shouldRevalidate)||D.hasClientLoader?E=!0:_.add(P.route.id))}),_.size===0)return[];let S=Iw(n,h,"data");return E&&_.size>0&&S.searchParams.set("_routes",r.filter(P=>_.has(P.route.id)).map(P=>P.route.id).join(",")),[S.pathname+S.search]},[h,p,o,u,m,r,n,d]),x=k.useMemo(()=>qw(y,u),[y,u]),j=Gw(y);return k.createElement(k.Fragment,null,w.map(_=>k.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...s})),x.map(_=>k.createElement("link",{key:_,rel:"modulepreload",href:_,...s})),j.map(({key:_,link:E})=>k.createElement("link",{key:_,nonce:s.nonce,...E})))}function Jw(...n){return r=>{n.forEach(s=>{typeof s=="function"?s(r):s!=null&&(s.current=r)})}}var Cg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Cg&&(window.__reactRouterVersion="7.9.6")}catch{}function Xw(n,r){return D0({basename:r==null?void 0:r.basename,getContext:r==null?void 0:r.getContext,future:r==null?void 0:r.future,history:Gx({window:r==null?void 0:r.window}),hydrationData:Zw(),routes:n,mapRouteProperties:jw,hydrationRouteProperties:bw,dataStrategy:r==null?void 0:r.dataStrategy,patchRoutesOnNavigation:r==null?void 0:r.patchRoutesOnNavigation,window:r==null?void 0:r.window,unstable_instrumentations:r==null?void 0:r.unstable_instrumentations}).initialize()}function Zw(){let n=window==null?void 0:window.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:ek(n.errors)}),n}function ek(n){if(!n)return null;let r=Object.entries(n),s={};for(let[o,u]of r)if(u&&u.__type==="RouteErrorResponse")s[o]=new Uo(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(u.__subType){let d=window[u.__subType];if(typeof d=="function")try{let h=new d(u.message);h.stack="",s[o]=h}catch{}}if(s[o]==null){let d=new Error(u.message);d.stack="",s[o]=d}}else s[o]=u;return s}var Ng=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bt=k.forwardRef(function({onClick:r,discover:s="render",prefetch:o="none",relative:u,reloadDocument:d,replace:h,state:p,target:g,to:m,preventScrollReset:y,viewTransition:w,...x},j){let{basename:_}=k.useContext(Kn),E=typeof m=="string"&&Ng.test(m),S,P=!1;if(typeof m=="string"&&E&&(S=m,Cg))try{let pe=new URL(window.location.href),Z=m.startsWith("//")?new URL(pe.protocol+m):new URL(m),Ue=An(Z.pathname,_);Z.origin===pe.origin&&Ue!=null?m=Ue+Z.search+Z.hash:P=!0}catch{wt(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=aw(m,{relative:u}),[U,Q,X]=Ww(o,x),se=rk(m,{replace:h,state:p,target:g,preventScrollReset:y,relative:u,viewTransition:w});function A(pe){r&&r(pe),pe.defaultPrevented||se(pe)}let B=k.createElement("a",{...x,...X,href:S||D,onClick:P||d?r:A,ref:Jw(j,Q),target:g,"data-discover":!E&&s==="render"?"true":void 0});return U&&!E?k.createElement(k.Fragment,null,B,k.createElement(Kw,{page:D})):B});Bt.displayName="Link";var $d=k.forwardRef(function({"aria-current":r="page",caseSensitive:s=!1,className:o="",end:u=!1,style:d,to:h,viewTransition:p,children:g,...m},y){let w=dl(h,{relative:m.relative}),x=On(),j=k.useContext(cl),{navigator:_,basename:E}=k.useContext(Kn),S=j!=null&&ok(w)&&p===!0,P=_.encodeLocation?_.encodeLocation(w).pathname:w.pathname,D=x.pathname,U=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(D=D.toLowerCase(),U=U?U.toLowerCase():null,P=P.toLowerCase()),U&&E&&(U=An(U,E)||U);const Q=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let X=D===P||!u&&D.startsWith(P)&&D.charAt(Q)==="/",se=U!=null&&(U===P||!u&&U.startsWith(P)&&U.charAt(P.length)==="/"),A={isActive:X,isPending:se,isTransitioning:S},B=X?r:void 0,pe;typeof o=="function"?pe=o(A):pe=[o,X?"active":null,se?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let Z=typeof d=="function"?d(A):d;return k.createElement(Bt,{...m,"aria-current":B,className:pe,ref:y,style:Z,to:h,viewTransition:p},typeof g=="function"?g(A):g)});$d.displayName="NavLink";var tk=k.forwardRef(({discover:n="render",fetcherKey:r,navigate:s,reloadDocument:o,replace:u,state:d,method:h=Ao,action:p,onSubmit:g,relative:m,preventScrollReset:y,viewTransition:w,...x},j)=>{let _=ik(),E=lk(p,{relative:m}),S=h.toLowerCase()==="get"?"get":"post",P=typeof p=="string"&&Ng.test(p),D=U=>{if(g&&g(U),U.defaultPrevented)return;U.preventDefault();let Q=U.nativeEvent.submitter,X=(Q==null?void 0:Q.getAttribute("formmethod"))||h;_(Q||U.currentTarget,{fetcherKey:r,method:X,navigate:s,replace:u,state:d,relative:m,preventScrollReset:y,viewTransition:w})};return k.createElement("form",{ref:j,method:S,action:E,onSubmit:o?g:D,...x,"data-discover":!P&&n==="render"?"true":void 0})});tk.displayName="Form";function nk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Eg(n){let r=k.useContext(ea);return ze(r,nk(n)),r}function rk(n,{target:r,replace:s,state:o,preventScrollReset:u,relative:d,viewTransition:h}={}){let p=ta(),g=On(),m=dl(n,{relative:d});return k.useCallback(y=>{if(_w(y,r)){y.preventDefault();let w=s!==void 0?s:or(g)===or(m);p(n,{replace:w,state:o,preventScrollReset:u,relative:d,viewTransition:h})}},[g,p,m,s,o,r,n,u,d,h])}function qd(n){wt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let r=k.useRef(pd(n)),s=k.useRef(!1),o=On(),u=k.useMemo(()=>Aw(o.search,s.current?null:r.current),[o.search]),d=ta(),h=k.useCallback((p,g)=>{const m=pd(typeof p=="function"?p(new URLSearchParams(u)):p);s.current=!0,d("?"+m,g)},[d,u]);return[u,h]}var sk=0,ak=()=>`__${String(++sk)}__`;function ik(){let{router:n}=Eg("useSubmit"),{basename:r}=k.useContext(Kn),s=xw();return k.useCallback(async(o,u={})=>{let{action:d,method:h,encType:p,formData:g,body:m}=Fw(o,r);if(u.navigate===!1){let y=u.fetcherKey||ak();await n.fetch(y,s,u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:m,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await n.navigate(u.action||d,{preventScrollReset:u.preventScrollReset,formData:g,body:m,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:s,flushSync:u.flushSync,viewTransition:u.viewTransition})},[n,r,s])}function lk(n,{relative:r}={}){let{basename:s}=k.useContext(Kn),o=k.useContext(Dn);ze(o,"useFormAction must be used inside a RouteContext");let[u]=o.matches.slice(-1),d={...dl(n||".",{relative:r})},h=On();if(n==null){d.search=h.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(w=>w).forEach(w=>p.append("index",w));let y=p.toString();d.search=y?`?${y}`:""}}return(!n||n===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(d.pathname=d.pathname==="/"?s:lr([s,d.pathname])),or(d)}function ok(n,{relative:r}={}){let s=k.useContext(Ad);ze(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Eg("useViewTransitionState"),u=dl(n,{relative:r});if(!s.isTransitioning)return!1;let d=An(s.currentLocation.pathname,o)||s.currentLocation.pathname,h=An(s.nextLocation.pathname,o)||s.nextLocation.pathname;return zo(u.pathname,h)!=null||zo(u.pathname,d)!=null}var uk=Bm();function ck(n){return k.createElement(Cw,{flushSync:uk.flushSync,...n})}/**
|
|
53
53
|
* @license lucide-react v0.555.0 - ISC
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
@@ -304,8 +304,8 @@ Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}
|
|
|
304
304
|
*
|
|
305
305
|
* This source code is licensed under the ISC license.
|
|
306
306
|
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const B1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bd=Me("x",B1);function Fg(n){var r,s,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(s=Fg(n[r]))&&(o&&(o+=" "),o+=s)}else for(s in n)n[s]&&(o&&(o+=" "),o+=s);return o}function Ig(){for(var n,r,s=0,o="",u=arguments.length;s<u;s++)(n=arguments[s])&&(r=Fg(n))&&(o&&(o+=" "),o+=r);return o}const hm=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,pm=Ig,zg=(n,r)=>s=>{var o;if((r==null?void 0:r.variants)==null)return pm(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:u,defaultVariants:d}=r,h=Object.keys(u).map(m=>{const y=s==null?void 0:s[m],w=d==null?void 0:d[m];if(y===null)return null;const x=hm(y)||hm(w);return u[m][x]}),p=s&&Object.entries(s).reduce((m,y)=>{let[w,x]=y;return x===void 0||(m[w]=x),m},{}),g=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((m,y)=>{let{class:w,className:x,...j}=y;return Object.entries(j).every(T=>{let[N,S]=T;return Array.isArray(S)?S.includes({...d,...p}[N]):{...d,...p}[N]===S})?[...m,w,x]:m},[]);return pm(n,h,g,s==null?void 0:s.class,s==null?void 0:s.className)},H1=(n,r)=>{const s=new Array(n.length+r.length);for(let o=0;o<n.length;o++)s[o]=n[o];for(let o=0;o<r.length;o++)s[n.length+o]=r[o];return s},Q1=(n,r)=>({classGroupId:n,validator:r}),Ug=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),Bo="-",mm=[],V1="arbitrary..",W1=n=>{const r=G1(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return K1(h);const p=h.split(Bo),g=p[0]===""&&p.length>1?1:0;return $g(p,g,r)},getConflictingClassGroupIds:(h,p)=>{if(p){const g=o[h],m=s[h];return g?m?H1(m,g):g:m||mm}return s[h]||mm}}},$g=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const u=n[r],d=s.nextPart.get(u);if(d){const m=$g(n,r+1,d);if(m)return m}const h=s.validators;if(h===null)return;const p=r===0?n.join(Bo):n.slice(r).join(Bo),g=h.length;for(let m=0;m<g;m++){const y=h[m];if(y.validator(p))return y.classGroupId}},K1=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?V1+o:void 0})(),G1=n=>{const{theme:r,classGroups:s}=n;return Y1(s,r)},Y1=(n,r)=>{const s=Ug();for(const o in n){const u=n[o];Hd(u,s,o,r)}return s},Hd=(n,r,s,o)=>{const u=n.length;for(let d=0;d<u;d++){const h=n[d];J1(h,r,s,o)}},J1=(n,r,s,o)=>{if(typeof n=="string"){X1(n,r,s);return}if(typeof n=="function"){Z1(n,r,s,o);return}ej(n,r,s,o)},X1=(n,r,s)=>{const o=n===""?r:qg(r,n);o.classGroupId=s},Z1=(n,r,s,o)=>{if(tj(n)){Hd(n(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(Q1(s,n))},ej=(n,r,s,o)=>{const u=Object.entries(n),d=u.length;for(let h=0;h<d;h++){const[p,g]=u[h];Hd(g,qg(r,p),s,o)}},qg=(n,r)=>{let s=n;const o=r.split(Bo),u=o.length;for(let d=0;d<u;d++){const h=o[d];let p=s.nextPart.get(h);p||(p=Ug(),s.nextPart.set(h,p)),s=p}return s},tj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,nj=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const u=(d,h)=>{s[d]=h,r++,r>n&&(r=0,o=s,s=Object.create(null))};return{get(d){let h=s[d];if(h!==void 0)return h;if((h=o[d])!==void 0)return u(d,h),h},set(d,h){d in s?s[d]=h:u(d,h)}}},yd="!",gm=":",rj=[],ym=(n,r,s,o,u)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:u}),sj=n=>{const{prefix:r,experimentalParseClassName:s}=n;let o=u=>{const d=[];let h=0,p=0,g=0,m;const y=u.length;for(let N=0;N<y;N++){const S=u[N];if(h===0&&p===0){if(S===gm){d.push(u.slice(g,N)),g=N+1;continue}if(S==="/"){m=N;continue}}S==="["?h++:S==="]"?h--:S==="("?p++:S===")"&&p--}const w=d.length===0?u:u.slice(g);let x=w,j=!1;w.endsWith(yd)?(x=w.slice(0,-1),j=!0):w.startsWith(yd)&&(x=w.slice(1),j=!0);const T=m&&m>g?m-g:void 0;return ym(d,j,x,T)};if(r){const u=r+gm,d=o;o=h=>h.startsWith(u)?d(h.slice(u.length)):ym(rj,!1,h,void 0,!0)}if(s){const u=o;o=d=>s({className:d,parseClassName:u})}return o},aj=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let u=[];for(let d=0;d<s.length;d++){const h=s[d],p=h[0]==="[",g=r.has(h);p||g?(u.length>0&&(u.sort(),o.push(...u),u=[]),o.push(h)):u.push(h)}return u.length>0&&(u.sort(),o.push(...u)),o}},ij=n=>({cache:nj(n.cacheSize),parseClassName:sj(n),sortModifiers:aj(n),...W1(n)}),lj=/\s+/,oj=(n,r)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:u,sortModifiers:d}=r,h=[],p=n.trim().split(lj);let g="";for(let m=p.length-1;m>=0;m-=1){const y=p[m],{isExternal:w,modifiers:x,hasImportantModifier:j,baseClassName:T,maybePostfixModifierPosition:N}=s(y);if(w){g=y+(g.length>0?" "+g:g);continue}let S=!!N,L=o(S?T.substring(0,N):T);if(!L){if(!S){g=y+(g.length>0?" "+g:g);continue}if(L=o(T),!L){g=y+(g.length>0?" "+g:g);continue}S=!1}const z=x.length===0?"":x.length===1?x[0]:d(x).join(":"),$=j?z+yd:z,Q=$+L;if(h.indexOf(Q)>-1)continue;h.push(Q);const X=u(L,S);for(let se=0;se<X.length;++se){const A=X[se];h.push($+A)}g=y+(g.length>0?" "+g:g)}return g},uj=(...n)=>{let r=0,s,o,u="";for(;r<n.length;)(s=n[r++])&&(o=Bg(s))&&(u&&(u+=" "),u+=o);return u},Bg=n=>{if(typeof n=="string")return n;let r,s="";for(let o=0;o<n.length;o++)n[o]&&(r=Bg(n[o]))&&(s&&(s+=" "),s+=r);return s},cj=(n,...r)=>{let s,o,u,d;const h=g=>{const m=r.reduce((y,w)=>w(y),n());return s=ij(m),o=s.cache.get,u=s.cache.set,d=p,p(g)},p=g=>{const m=o(g);if(m)return m;const y=oj(g,s);return u(g,y),y};return d=h,(...g)=>d(uj(...g))},dj=[],At=n=>{const r=s=>s[n]||dj;return r.isThemeGetter=!0,r},Hg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=n=>fj.test(n),Fe=n=>!!n&&!Number.isNaN(Number(n)),Zr=n=>!!n&&Number.isInteger(Number(n)),Vc=n=>n.endsWith("%")&&Fe(n.slice(0,-1)),xr=n=>hj.test(n),Vg=()=>!0,vj=n=>pj.test(n)&&!mj.test(n),Qd=()=>!1,xj=n=>gj.test(n),wj=n=>yj.test(n),kj=n=>!ie(n)&&!le(n),jj=n=>gs(n,Gg,Qd),ie=n=>Hg.test(n),Is=n=>gs(n,Yg,vj),vm=n=>gs(n,Tj,Fe),bj=n=>gs(n,Xg,Vg),Sj=n=>gs(n,Jg,Qd),xm=n=>gs(n,Wg,Qd),Cj=n=>gs(n,Kg,wj),Eo=n=>gs(n,Zg,xj),le=n=>Qg.test(n),Wi=n=>na(n,Yg),Nj=n=>na(n,Jg),wm=n=>na(n,Wg),Ej=n=>na(n,Gg),Rj=n=>na(n,Kg),Ro=n=>na(n,Zg,!0),Pj=n=>na(n,Xg,!0),gs=(n,r,s)=>{const o=Hg.exec(n);return o?o[1]?r(o[1]):s(o[2]):!1},na=(n,r,s=!1)=>{const o=Qg.exec(n);return o?o[1]?r(o[1]):s:!1},Wg=n=>n==="position"||n==="percentage",Kg=n=>n==="image"||n==="url",Gg=n=>n==="length"||n==="size"||n==="bg-size",Yg=n=>n==="length",Tj=n=>n==="number",Jg=n=>n==="family-name",Xg=n=>n==="number"||n==="weight",Zg=n=>n==="shadow",Lj=()=>{const n=At("color"),r=At("font"),s=At("text"),o=At("font-weight"),u=At("tracking"),d=At("leading"),h=At("breakpoint"),p=At("container"),g=At("spacing"),m=At("radius"),y=At("shadow"),w=At("inset-shadow"),x=At("text-shadow"),j=At("drop-shadow"),T=At("blur"),N=At("perspective"),S=At("aspect"),L=At("ease"),z=At("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Q(),le,ie],se=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],B=()=>[le,ie,g],pe=()=>[Xr,"full","auto",...B()],Z=()=>[Zr,"none","subgrid",le,ie],ze=()=>["auto",{span:["full",Zr,le,ie]},Zr,le,ie],Je=()=>[Zr,"auto",le,ie],nt=()=>["auto","min","max","fr",le,ie],pt=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Re=()=>["start","end","center","stretch","center-safe","end-safe"],Pe=()=>["auto",...B()],ye=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],G=()=>[Xr,"screen","full","dvw","lvw","svw","min","max","fit",...B()],ne=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],U=()=>[n,le,ie],M=()=>[...Q(),wm,xm,{position:[le,ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],be=()=>["auto","cover","contain",Ej,jj,{size:[le,ie]}],ve=()=>[Vc,Wi,Is],xe=()=>["","none","full",m,le,ie],Se=()=>["",Fe,Wi,Is],Oe=()=>["solid","dashed","dotted","double"],Ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>[Fe,Vc,wm,xm],It=()=>["","none",T,le,ie],ct=()=>["none",Fe,le,ie],sn=()=>["none",Fe,le,ie],Fn=()=>[Fe,le,ie],Gn=()=>[Xr,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xr],breakpoint:[xr],color:[Vg],container:[xr],"drop-shadow":[xr],ease:["in","out","in-out"],font:[kj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xr],shadow:[xr],spacing:["px",Fe],text:[xr],"text-shadow":[xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,ie,le,S]}],container:["container"],columns:[{columns:[Fe,ie,le,p]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Zr,"auto",le,ie]}],basis:[{basis:[Xr,"full","auto",p,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Xr,"auto","initial","none",ie]}],grow:[{grow:["",Fe,le,ie]}],shrink:[{shrink:["",Fe,le,ie]}],order:[{order:[Zr,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ze()}],"col-start":[{"col-start":Je()}],"col-end":[{"col-end":Je()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ze()}],"row-start":[{"row-start":Je()}],"row-end":[{"row-end":Je()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":nt()}],"auto-rows":[{"auto-rows":nt()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...pt(),"normal"]}],"justify-items":[{"justify-items":[...Re(),"normal"]}],"justify-self":[{"justify-self":["auto",...Re()]}],"align-content":[{content:["normal",...pt()]}],"align-items":[{items:[...Re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Re(),{baseline:["","last"]}]}],"place-content":[{"place-content":pt()}],"place-items":[{"place-items":[...Re(),"baseline"]}],"place-self":[{"place-self":["auto",...Re()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:Pe()}],mx:[{mx:Pe()}],my:[{my:Pe()}],ms:[{ms:Pe()}],me:[{me:Pe()}],mbs:[{mbs:Pe()}],mbe:[{mbe:Pe()}],mt:[{mt:Pe()}],mr:[{mr:Pe()}],mb:[{mb:Pe()}],ml:[{ml:Pe()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:ye()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[p,"screen",...ye()]}],"min-w":[{"min-w":[p,"screen","none",...ye()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[h]},...ye()]}],h:[{h:["screen","lh",...ye()]}],"min-h":[{"min-h":["screen","lh","none",...ye()]}],"max-h":[{"max-h":["screen","lh",...ye()]}],"font-size":[{text:["base",s,Wi,Is]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Pj,bj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vc,ie]}],"font-family":[{font:[Nj,Sj,r]}],"font-features":[{"font-features":[ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,le,ie]}],"line-clamp":[{"line-clamp":[Fe,"none",le,vm]}],leading:[{leading:[d,...B()]}],"list-image":[{"list-image":["none",le,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",le,Is]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Fe,"auto",le,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:be()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zr,le,ie],radial:["",le,ie],conic:[Zr,le,ie]},Rj,Cj]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:ve()}],"gradient-via-pos":[{via:ve()}],"gradient-to-pos":[{to:ve()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:xe()}],"rounded-s":[{"rounded-s":xe()}],"rounded-e":[{"rounded-e":xe()}],"rounded-t":[{"rounded-t":xe()}],"rounded-r":[{"rounded-r":xe()}],"rounded-b":[{"rounded-b":xe()}],"rounded-l":[{"rounded-l":xe()}],"rounded-ss":[{"rounded-ss":xe()}],"rounded-se":[{"rounded-se":xe()}],"rounded-ee":[{"rounded-ee":xe()}],"rounded-es":[{"rounded-es":xe()}],"rounded-tl":[{"rounded-tl":xe()}],"rounded-tr":[{"rounded-tr":xe()}],"rounded-br":[{"rounded-br":xe()}],"rounded-bl":[{"rounded-bl":xe()}],"border-w":[{border:Se()}],"border-w-x":[{"border-x":Se()}],"border-w-y":[{"border-y":Se()}],"border-w-s":[{"border-s":Se()}],"border-w-e":[{"border-e":Se()}],"border-w-bs":[{"border-bs":Se()}],"border-w-be":[{"border-be":Se()}],"border-w-t":[{"border-t":Se()}],"border-w-r":[{"border-r":Se()}],"border-w-b":[{"border-b":Se()}],"border-w-l":[{"border-l":Se()}],"divide-x":[{"divide-x":Se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Oe(),"hidden","none"]}],"divide-style":[{divide:[...Oe(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,le,ie]}],"outline-w":[{outline:["",Fe,Wi,Is]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",y,Ro,Eo]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",w,Ro,Eo]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Fe,Is]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",x,Ro,Eo]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Fe,le,ie]}],"mix-blend":[{"mix-blend":[...Ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[le,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Q()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:be()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:It()}],brightness:[{brightness:[Fe,le,ie]}],contrast:[{contrast:[Fe,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",j,Ro,Eo]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Fe,le,ie]}],"hue-rotate":[{"hue-rotate":[Fe,le,ie]}],invert:[{invert:["",Fe,le,ie]}],saturate:[{saturate:[Fe,le,ie]}],sepia:[{sepia:["",Fe,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":It()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",Fe,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,le,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",le,ie]}],ease:[{ease:["linear","initial",L,le,ie]}],delay:[{delay:[Fe,le,ie]}],animate:[{animate:["none",z,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,le,ie]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:ct()}],"rotate-x":[{"rotate-x":ct()}],"rotate-y":[{"rotate-y":ct()}],"rotate-z":[{"rotate-z":ct()}],scale:[{scale:sn()}],"scale-x":[{"scale-x":sn()}],"scale-y":[{"scale-y":sn()}],"scale-z":[{"scale-z":sn()}],"scale-3d":["scale-3d"],skew:[{skew:Fn()}],"skew-x":[{"skew-x":Fn()}],"skew-y":[{"skew-y":Fn()}],transform:[{transform:[le,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Gn()}],"translate-x":[{"translate-x":Gn()}],"translate-y":[{"translate-y":Gn()}],"translate-z":[{"translate-z":Gn()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le,ie]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Fe,Wi,Is,vm]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Mj=cj(Lj);function Xe(...n){return Mj(Ig(n))}function nl(n){if(!n)return null;try{const r=new URL(n);return r.protocol==="https:"||r.protocol==="http:"?r.toString():null}catch{return null}}const _j=zg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",xs:"h-7 rounded-md px-2 text-xs",lg:"h-11 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),oe=k.forwardRef(({className:n,variant:r,size:s,type:o="button",...u},d)=>i.jsx("button",{type:o,className:Xe(_j({variant:r,size:s,className:n})),ref:d,...u}));oe.displayName="Button";let rl=[],Aj=1;const vd=new Set;function ey(){for(const n of vd)n()}function We(n){const r={id:Aj++,variant:"default",...n};rl=[...rl.slice(-3),r],ey(),setTimeout(()=>ty(r.id),r.variant==="error"?8e3:4e3)}function ty(n){rl=rl.filter(r=>r.id!==n),ey()}function Dj(n){return vd.add(n),()=>{vd.delete(n)}}function Oj(){return rl}class Wn extends Error{constructor(s,o){var d,h,p;const u=((d=o.error)==null?void 0:d.code)??(s>=500?"server_error":"request_failed");super(((h=o.error)==null?void 0:h.message)??Ij(u,s));qi(this,"status");qi(this,"code");qi(this,"field");qi(this,"body");this.status=s,this.code=u,this.field=(p=o.error)==null?void 0:p.field,this.body=o}}const Fj={unauthorized:"Your session has ended. Sign in again.",invalid_credentials:"Wrong username or password.",rate_limited:"Too many attempts. Wait a moment and try again.",must_change_password:"Change your password to continue.",csrf:"The request was blocked by a security check. Reload the page and try again.",weak_password:"Use at least 12 characters for the new password.",invalid_username:"That username is not allowed.",not_found:"Not found.",not_cancellable:"This request can no longer be cancelled.",not_retryable:"This request cannot be retried.",invalid_key:"That API key was rejected.",invalid_setting:"One of the values is not valid.",network_error:"Could not reach the FDA daemon.",server_error:"The daemon hit an error."};function Ij(n,r){return Fj[n]??(r?`Request failed (${r}).`:"Request failed.")}function yt(n){return n instanceof Wn||n instanceof Error?n.message:"Something went wrong."}let xd={onUnauthorized:()=>window.location.assign("/login"),onMustChange:()=>window.location.assign("/change-password")};function zj(n){xd=n}async function Ee(n,r={}){const s={Accept:"application/json","X-FDA-Request":"1"};r.body!==void 0&&(s["Content-Type"]="application/json");let o;try{o=await fetch(n,{method:r.method??"GET",credentials:"same-origin",headers:s,body:r.body!==void 0?JSON.stringify(r.body):void 0,signal:r.signal})}catch(h){throw h instanceof DOMException&&h.name==="AbortError"?h:new Wn(0,{error:{code:"network_error"}})}const u=await o.text();let d=null;if(u)try{d=JSON.parse(u)}catch{d=null}if(!o.ok){const h=new Wn(o.status,d??{});throw o.status===401&&!r.noAuthRedirect&&h.code!=="invalid_credentials"?xd.onUnauthorized():o.status===403&&h.code==="must_change_password"?xd.onMustChange():o.status===403&&h.code==="csrf"&&We({title:"Blocked",description:h.message,variant:"error"}),h}return d}function Ja(n){const r=new URLSearchParams;for(const[o,u]of Object.entries(n))u!=null&&u!==""&&r.set(o,String(u));const s=r.toString();return s?`?${s}`:""}function kt({label:n="Loading"}){return i.jsxs("div",{className:"flex items-center gap-2 p-6 text-sm text-muted-foreground",role:"status",children:[i.jsx(i1,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),n]})}function Ot({error:n,onRetry:r}){return i.jsxs("div",{role:"alert",className:"flex items-start gap-3 rounded-md border border-destructive/50 bg-destructive-muted p-4 text-sm",children:[i.jsx(Rk,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive","aria-hidden":!0}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{children:yt(n)}),r&&i.jsx(oe,{variant:"outline",size:"xs",className:"mt-2",onClick:r,children:"Try again"})]})]})}function rn({children:n}){return i.jsx("div",{className:"rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground",children:n})}function Go({id:n,message:r}){return r?i.jsx("p",{id:n,role:"alert",className:"text-sm text-red-300",children:r}):null}function ys({title:n,description:r,actions:s}){return i.jsxs("div",{className:"mb-6 flex flex-wrap items-start justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-semibold",children:n}),r&&i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:r})]}),s&&i.jsx("div",{className:"flex items-center gap-2",children:s})]})}const Be={me:["me"],health:["health"],dashboard:["dashboard"],requests:["requests"],requestList:n=>["requests","list",n],request:n=>["requests","detail",n],settings:["settings"],agents:["agents"],manifest:n=>["slack-manifest",n],access:["access"],slackChannels:n=>["slack","channels",n],slackUsers:n=>["slack","users",n],slackUsergroups:["slack","usergroups"],fs:n=>["fs",n],audit:(n,r)=>["audit",n,r],schedules:["schedules"],setup:["setup"],schedule:n=>["schedules",n]};function Yo(){return Rt({queryKey:Be.me,queryFn:()=>Ee("/api/auth/me").then(n=>n.user),staleTime:6e4})}function Uj(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/auth/login",{method:"POST",body:r,noAuthRedirect:!0}),meta:{inlineError:!0},onSuccess:({user:r})=>{n.removeQueries(),n.setQueryData(Be.me,r)}})}function $j(){const n=Ct();return Ft({mutationFn:()=>Ee("/api/auth/logout",{method:"POST",noAuthRedirect:!0}),onSettled:()=>n.removeQueries()})}function qj(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/auth/password",{method:"POST",body:r,noAuthRedirect:!0}),meta:{inlineError:!0},onSuccess:({user:r})=>{n.setQueryData(Be.me,r),n.invalidateQueries({predicate:s=>s.queryKey[0]!=="me"})}})}function Bj(){return Rt({queryKey:Be.health,queryFn:()=>Ee("/api/health"),refetchInterval:1e4})}function Hj(){return Rt({queryKey:Be.dashboard,queryFn:()=>Ee("/api/dashboard"),refetchInterval:5e3})}function Qj(n){return Rt({queryKey:Be.requestList(n),queryFn:()=>Ee(`/api/requests${Ja({status:n.status.join(","),q:n.q,page:n.page,pageSize:n.pageSize,sort:n.sort})}`),placeholderData:Ga,refetchInterval:1e4})}function Vj(n){return Rt({queryKey:Be.request(n),queryFn:()=>Ee(`/api/requests/${encodeURIComponent(n)}`),refetchInterval:15e3})}function ny(n){const r=Ct();return Ft({mutationFn:s=>Ee(`/api/requests/${encodeURIComponent(s)}/${n}`,{method:"POST"}),onSettled:()=>{r.invalidateQueries({queryKey:Be.requests}),r.invalidateQueries({queryKey:Be.dashboard})}})}const Wj=()=>ny("cancel"),Kj=()=>ny("retry");function Jo(){return Rt({queryKey:Be.settings,queryFn:()=>Ee("/api/settings")})}function Xo(){const n=Ct();return()=>{n.invalidateQueries({queryKey:Be.health}),n.invalidateQueries({queryKey:Be.dashboard})}}function Zo(n,r){n.setQueryData(Be.settings,s=>s&&{...s,...r}),n.invalidateQueries({queryKey:Be.settings})}function Vd(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/general",{method:"PUT",body:s}),meta:{inlineError:!0},onSuccess:({settings:s})=>{Zo(n,{settings:s}),r()}})}function Gj(){return Rt({queryKey:Be.agents,queryFn:()=>Ee("/api/agents")})}function Yj(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/agent",{method:"PUT",body:{agentId:s}}),onSuccess:({settings:s})=>{Zo(n,{settings:s}),n.invalidateQueries({queryKey:Be.agents}),r()}})}function Jj(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/anthropic",{method:"PUT",body:{apiKey:s}}),meta:{inlineError:!0},onSuccess:({secrets:s})=>{Zo(n,{secrets:s}),r()}})}function Xj(){return Ft({mutationFn:()=>Ee("/api/settings/anthropic/test",{method:"POST"}),meta:{inlineError:!0}})}function Zj(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/slack",{method:"PUT",body:s}),meta:{inlineError:!0},onSuccess:({secrets:s})=>{Zo(n,{secrets:s}),r()}})}function eb(){const n=Ct();return Ft({mutationFn:()=>Ee("/api/settings/slack/test",{method:"POST"}),meta:{inlineError:!0},onSuccess:()=>{n.invalidateQueries({queryKey:Be.settings}),n.invalidateQueries({queryKey:Be.dashboard})}})}function tb(n){return Rt({queryKey:Be.manifest(n),queryFn:()=>Ee(`/api/settings/slack/manifest${Ja({name:n})}`),placeholderData:Ga})}function nb(){return Rt({queryKey:Be.access,queryFn:()=>Ee("/api/settings/access").then(n=>n.entries)})}function rb(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/settings/access",{method:"PUT",body:{entries:r}}),onSuccess:({entries:r})=>{n.setQueryData(Be.access,r),n.invalidateQueries({queryKey:Be.health})}})}function sb(n,r=!0){return Rt({queryKey:Be.slackChannels(n),queryFn:()=>Ee(`/api/slack/channels${Ja({q:n})}`).then(s=>s.items),enabled:r,staleTime:3e4,placeholderData:Ga})}function ab(n,r=!0){return Rt({queryKey:Be.slackUsers(n),queryFn:()=>Ee(`/api/slack/users${Ja({q:n})}`).then(s=>s.items),enabled:r,staleTime:3e4,placeholderData:Ga})}function ib(n=!0){return Rt({queryKey:Be.slackUsergroups,queryFn:()=>Ee("/api/slack/usergroups").then(r=>r.items),enabled:n,staleTime:6e4})}function lb(n,r=!0){return Rt({queryKey:Be.fs(n),queryFn:()=>Ee(`/api/fs/list${Ja({path:n})}`),enabled:r,placeholderData:Ga})}function ob(n,r){return Rt({queryKey:Be.audit(n,r),queryFn:()=>Ee(`/api/audit${Ja({page:n,pageSize:r})}`),placeholderData:Ga})}function ub(){return Rt({queryKey:Be.schedules,queryFn:()=>Ee("/api/schedules").then(n=>n.items),refetchInterval:3e4})}function cb(n){return Rt({queryKey:Be.schedule(n??""),queryFn:()=>Ee(`/api/schedules/${encodeURIComponent(n)}`),enabled:!!n})}function ry(){const n=Ct();return Ft({mutationFn:({id:r,patch:s})=>Ee(`/api/schedules/${encodeURIComponent(r)}`,{method:"PATCH",body:s}),onSettled:()=>void n.invalidateQueries({queryKey:Be.schedules})})}function db(){const n=Ct();return Ft({mutationFn:r=>Ee(`/api/schedules/${encodeURIComponent(r)}`,{method:"DELETE"}),onSettled:()=>void n.invalidateQueries({queryKey:Be.schedules})})}function fb(){const n=Ct();return Ft({mutationFn:r=>Ee(`/api/schedules/${encodeURIComponent(r)}/run`,{method:"POST"}),onSettled:()=>{n.invalidateQueries({queryKey:Be.schedules}),n.invalidateQueries({queryKey:Be.requests})}})}function hb(){return Rt({queryKey:Be.setup,queryFn:()=>Ee("/api/setup"),refetchInterval:3e4})}function pb(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/setup",{method:"PUT",body:r}),onSettled:()=>void n.invalidateQueries({queryKey:Be.setup})})}function mb(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/setup/proposal",{method:"POST",body:r}),onSettled:()=>void n.invalidateQueries({queryKey:Be.setup})})}function km({children:n}){var o;const r=Yo(),s=On();return r.isLoading?i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(kt,{})}):r.error?r.error instanceof Wn&&r.error.status===401?i.jsx(hd,{to:"/login",replace:!0,state:{from:s.pathname+s.search}}):i.jsx("div",{className:"mx-auto max-w-md p-8",children:i.jsx(Ot,{error:r.error,onRetry:()=>void r.refetch()})}):(o=r.data)!=null&&o.mustChange&&s.pathname!=="/change-password"?i.jsx(hd,{to:"/change-password",replace:!0}):i.jsx(i.Fragment,{children:n})}const gb=zg("inline-flex items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-xs font-medium",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",destructive:"border-destructive/40 bg-destructive-muted text-red-300",warning:"border-warning/40 bg-warning-muted text-amber-300",success:"border-success/40 bg-success-muted text-green-300",info:"border-info/40 bg-info-muted text-blue-300",muted:"border-transparent bg-muted text-muted-foreground"}},defaultVariants:{variant:"default"}});function tt({className:n,variant:r,...s}){return i.jsx("span",{className:Xe(gb({variant:r}),n),...s})}const Wc=new Intl.RelativeTimeFormat(void 0,{numeric:"auto",style:"short"});function Yt(n,r=Date.now()){if(!n)return"never";const s=(n-r)/1e3,o=Math.abs(s);return o<45?"just now":o<3600?Wc.format(Math.round(s/60),"minute"):o<86400?Wc.format(Math.round(s/3600),"hour"):o<86400*30?Wc.format(Math.round(s/86400),"day"):new Date(n).toLocaleDateString()}function mn(n){return n?new Date(n).toLocaleString():""}function dl(n){return n==null?"n/a":n>0&&n<.01?"<$0.01":`$${n.toFixed(2)}`}function yb(n){if(n==null)return"n/a";const r=Math.round(n/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60);return s<60?`${s}m ${r%60}s`:`${Math.floor(s/60)}h ${s%60}m`}function vb(n){const r=Math.floor(n/86400),s=Math.floor(n%86400/3600),o=Math.floor(n%3600/60);return r>0?`${r}d ${s}h`:s>0?`${s}h ${o}m`:`${o}m`}function jm(n){return n==null?"n/a":n.toLocaleString()}const sy={queued:"Queued",running:"Running",awaiting_input:"Awaiting input",awaiting_approval:"Awaiting approval",completed:"Completed",failed:"Failed",cancelled:"Cancelled"},bm={blocked:0,degraded:1,warn:2};function ay(n){return[...n].sort((r,s)=>bm[r.level]-bm[s.level]||r.since-s.since)}function iy({state:n}){return n==="blocked"?i.jsx(tt,{variant:"destructive",children:"Blocked"}):n==="degraded"?i.jsx(tt,{variant:"warning",children:"Degraded"}):i.jsx(tt,{variant:"success",children:"Healthy"})}function xb({conditions:n}){return n.length?i.jsx("ul",{className:"space-y-2",children:ay(n).map(r=>{const s=r.level==="blocked"?Og:r.level==="degraded"?O1:e1;return i.jsxs("li",{className:Xe("flex items-start gap-3 rounded-md border p-3 text-sm",r.level==="blocked"&&"border-destructive/50 bg-destructive-muted",r.level==="degraded"&&"border-warning/50 bg-warning-muted",r.level==="warn"&&"bg-muted/40"),children:[i.jsx(s,{className:Xe("mt-0.5 h-4 w-4 shrink-0",r.level==="blocked"&&"text-destructive",r.level==="degraded"&&"text-warning",r.level==="warn"&&"text-muted-foreground"),"aria-hidden":!0}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"break-words",children:r.message}),i.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[i.jsx("span",{className:"capitalize",children:r.level})," since"," ",Yt(r.since)]})]})]},r.id)})}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"No problems reported."})}function wb({conditions:n}){const r=ay(n).filter(s=>s.level==="blocked");return i.jsx("div",{role:"alert",className:"border-b border-destructive/50 bg-destructive-muted px-6 py-3 text-sm",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Og,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive","aria-hidden":!0}),i.jsxs("div",{className:"min-w-0 space-y-1",children:[i.jsx("p",{className:"font-medium",children:"FDA is blocked. New requests are refused until this is fixed."}),i.jsx("ul",{className:"list-disc space-y-0.5 pl-4 text-red-200",children:r.map(s=>i.jsx("li",{className:"break-words",children:s.message},s.id))})]})]})})}const kb=[{to:"/",label:"Dashboard",icon:n1,end:!0},{to:"/requests",label:"Requests",icon:s1,end:!1},{to:"/tickets",label:"Tickets",icon:_1,end:!1},{to:"/schedules",label:"Schedules",icon:jk,end:!1},{to:"/setup",label:"Setup",icon:q1,end:!1},{to:"/browser",label:"Browser",icon:Ag,end:!1},{to:"/settings",label:"Settings",icon:P1,end:!1},{to:"/audit",label:"Audit log",icon:C1,end:!1}];function jb(){var u,d,h;const n=Bj(),r=Yo(),s=$j(),o=ta();return i.jsxs("div",{className:"flex h-full",children:[i.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r bg-card/40",children:[i.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-4",children:[i.jsx(Pg,{className:"h-5 w-5","aria-hidden":!0}),i.jsx("span",{className:"font-semibold",children:"SuperClawd FDA"})]}),i.jsx("nav",{"aria-label":"Main",className:"flex-1 space-y-1 p-2",children:kb.map(({to:p,label:g,icon:m,end:y})=>i.jsxs($d,{to:p,end:y,className:({isActive:w})=>Xe("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",w?"bg-accent font-medium text-foreground":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[i.jsx(m,{className:"h-4 w-4","aria-hidden":!0}),g]},p))}),i.jsxs("div",{className:"space-y-3 border-t p-3 text-sm",children:[n.data&&i.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[i.jsx(iy,{state:n.data.state}),i.jsxs("span",{className:"text-xs",children:["v",n.data.version]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("span",{className:"truncate text-muted-foreground",title:(u=r.data)==null?void 0:u.username,children:(d=r.data)==null?void 0:d.username}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Sign out",title:"Sign out",onClick:()=>s.mutate(void 0,{onSettled:()=>o("/login",{replace:!0})}),children:i.jsx(Dg,{})})]})]})]}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[((h=n.data)==null?void 0:h.state)==="blocked"&&i.jsx(wb,{conditions:n.data.conditions}),i.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsx("div",{className:"mx-auto max-w-6xl p-6",children:i.jsx(Id,{})})})]})]})}function bb(){const n=ta(),r=On(),s=r.pathname,o=r.pathname+r.search;return k.useEffect(()=>{zj({onUnauthorized:()=>{s!=="/login"&&n("/login",{replace:!0,state:{from:o}})},onMustChange:()=>{s!=="/change-password"&&n("/change-password",{replace:!0})}})},[n,s,o]),i.jsx(Id,{})}const He=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("rounded-lg border bg-card text-card-foreground shadow-sm",n),...r}));He.displayName="Card";const ot=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("flex flex-col space-y-1.5 p-5",n),...r}));ot.displayName="CardHeader";const ut=k.forwardRef(({className:n,...r},s)=>i.jsx("h2",{ref:s,className:Xe("text-base font-semibold leading-none tracking-tight",n),...r}));ut.displayName="CardTitle";const Tt=k.forwardRef(({className:n,...r},s)=>i.jsx("p",{ref:s,className:Xe("text-sm text-muted-foreground",n),...r}));Tt.displayName="CardDescription";const Qe=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("p-5 pt-0",n),...r}));Qe.displayName="CardContent";const Sb=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("flex items-center p-5 pt-0",n),...r}));Sb.displayName="CardFooter";const Le=k.forwardRef(({className:n,type:r,...s},o)=>i.jsx("input",{type:r,className:Xe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive",n),ref:o,...s}));Le.displayName="Input";const ly=k.forwardRef(({className:n,...r},s)=>i.jsx("label",{ref:s,className:Xe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...r}));ly.displayName="Label";function qe({label:n,help:r,error:s,children:o}){const u=k.useId(),d=`${u}-help`,h=`${u}-err`,p=[r?d:null,s?h:null].filter(Boolean).join(" ")||void 0;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(ly,{htmlFor:u,children:n}),o({id:u,"aria-describedby":p,"aria-invalid":s?!0:void 0}),r&&i.jsx("p",{id:d,className:"text-xs text-muted-foreground",children:r}),s&&i.jsx("p",{id:h,role:"alert",className:"text-xs text-red-300",children:s})]})}function Cb(){var y;const[n,r]=k.useState(""),[s,o]=k.useState(""),u=Uj(),d=ta(),p=(y=On().state)==null?void 0:y.from,g=w=>{w.preventDefault(),u.mutate({username:n.trim(),password:s},{onSuccess:({user:x})=>{o(""),d(x.mustChange?"/change-password":p&&p!=="/login"?p:"/",{replace:!0})}})};let m=null;if(u.error){const w=u.error;m=w instanceof Wn&&w.code==="rate_limited"&&w.body.retryAfterSec?`Too many attempts. Try again in ${w.body.retryAfterSec} seconds.`:yt(w)}return i.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:i.jsxs(He,{className:"w-full max-w-sm",children:[i.jsxs(ot,{children:[i.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[i.jsx(Pg,{className:"h-5 w-5","aria-hidden":!0}),i.jsx("span",{className:"font-semibold",children:"SuperClawd FDA"})]}),i.jsx(ut,{children:"Sign in"}),i.jsx(Tt,{children:"Admin access for this machine."})]}),i.jsx(Qe,{children:i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[i.jsx(qe,{label:"Username",children:w=>i.jsx(Le,{...w,value:n,onChange:x=>r(x.target.value),autoComplete:"username",autoFocus:!0,required:!0})}),i.jsx(qe,{label:"Password",children:w=>i.jsx(Le,{...w,type:"password",value:s,onChange:x=>o(x.target.value),autoComplete:"current-password",required:!0})}),i.jsx(Go,{message:m}),i.jsx(oe,{type:"submit",className:"w-full",disabled:u.isPending||!n||!s,children:u.isPending?"Signing in":"Sign in"})]})})]})})}const Po=12;function oy({currentUsername:n,onDone:r,submitLabel:s="Save"}){const[o,u]=k.useState(""),[d,h]=k.useState(""),[p,g]=k.useState(""),[m,y]=k.useState(n),[w,x]=k.useState(null),j=qj(),T=j.error instanceof Wn?j.error:null,N=S=>{if(S.preventDefault(),x(null),d.length<Po)return x(`Use at least ${Po} characters for the new password.`);if(d!==p)return x("The new passwords do not match.");const L=m.trim();j.mutate({currentPassword:o,newPassword:d,...L&&L!==n?{newUsername:L}:{}},{onSuccess:({user:z})=>{u(""),h(""),g(""),r==null||r(z)}})};return i.jsxs("form",{onSubmit:N,className:"max-w-md space-y-4",noValidate:!0,children:[i.jsx(qe,{label:"Username",help:"Optional. Leave as is to keep it.",error:(T==null?void 0:T.code)==="invalid_username"?yt(T):null,children:S=>i.jsx(Le,{...S,value:m,onChange:L=>y(L.target.value),autoComplete:"username"})}),i.jsx(qe,{label:"Current password",error:(T==null?void 0:T.code)==="invalid_credentials"?"The current password is wrong.":null,children:S=>i.jsx(Le,{...S,type:"password",value:o,onChange:L=>u(L.target.value),autoComplete:"current-password",required:!0})}),i.jsx(qe,{label:"New password",help:`At least ${Po} characters.`,error:(T==null?void 0:T.code)==="weak_password"?yt(T):null,children:S=>i.jsx(Le,{...S,type:"password",value:d,onChange:L=>h(L.target.value),autoComplete:"new-password",required:!0,minLength:Po})}),i.jsx(qe,{label:"Confirm new password",children:S=>i.jsx(Le,{...S,type:"password",value:p,onChange:L=>g(L.target.value),autoComplete:"new-password",required:!0})}),i.jsx(Go,{message:w??(j.error&&!["invalid_username","invalid_credentials","weak_password"].includes((T==null?void 0:T.code)??"")?yt(j.error):null)}),i.jsx(oe,{type:"submit",disabled:j.isPending||!o||!d,children:j.isPending?"Saving":s})]})}function Nb(){var o;const n=Yo(),r=ta(),s=((o=n.data)==null?void 0:o.mustChange)??!1;return i.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:i.jsxs(He,{className:"w-full max-w-md",children:[i.jsxs(ot,{children:[i.jsx(ut,{children:s?"Set a new password":"Change password"}),i.jsx(Tt,{children:s?"Replace the temporary password before using the panel. You can also rename the admin account.":"Update your password or username. Other sessions will be signed out."})]}),i.jsx(Qe,{children:n.data&&i.jsx(oy,{currentUsername:n.data.username,submitLabel:"Save and continue",onDone:()=>{We({title:"Password updated",variant:"success"}),r("/",{replace:!0})}})})]})})}const Eb={queued:"secondary",running:"info",awaiting_input:"warning",awaiting_approval:"warning",completed:"success",failed:"destructive",cancelled:"muted"};function fl({status:n}){return i.jsxs(tt,{variant:Eb[n],children:[n==="running"&&i.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-current","aria-hidden":!0}),sy[n]]})}function Wd(n=3e4){const[r,s]=k.useState(()=>Date.now());return k.useEffect(()=>{const o=setInterval(()=>s(Date.now()),n);return()=>clearInterval(o)},[n]),r}function rr({label:n,value:r,hint:s}){return i.jsxs("div",{children:[i.jsx("dt",{className:"text-xs text-muted-foreground",children:n}),i.jsx("dd",{className:"mt-1 text-lg font-semibold",children:r}),s&&i.jsx("dd",{className:"text-xs text-muted-foreground",children:s})]})}function Ki({label:n,children:r}){return i.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:n}),i.jsx("dd",{className:"min-w-0 truncate text-right",children:r})]})}function Rb(){const n=Hj();if(Wd(5e3),n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const r=n.data,s=i.jsx("span",{className:"text-muted-foreground",children:"Not set"});return i.jsxs("div",{className:"space-y-6",children:[i.jsx(ys,{title:"Dashboard",description:`${r.hostname}, updated every 5 seconds.`}),i.jsxs(He,{children:[i.jsxs(ot,{className:"flex-row items-center justify-between space-y-0",children:[i.jsx(ut,{children:"Health"}),i.jsx(iy,{state:r.health.state})]}),i.jsx(Qe,{children:i.jsx(xb,{conditions:r.health.conditions})})]}),r.current&&i.jsx(Bt,{to:`/requests/${encodeURIComponent(r.current.id)}`,className:"block rounded-lg border bg-card p-5 transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Working on"}),i.jsx("p",{className:"mt-1 truncate font-medium",children:r.current.title}),i.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(fl,{status:r.current.status}),r.current.startedAt&&i.jsxs("span",{children:["started ",Yt(r.current.startedAt)]})]})]}),i.jsx(Lg,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),i.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Queue"})}),i.jsxs(Qe,{children:[i.jsxs("dl",{className:"grid grid-cols-3 gap-4",children:[i.jsx(rr,{label:"Running",value:r.queue.running}),i.jsx(rr,{label:"Queued",value:r.queue.queued}),i.jsx(rr,{label:"Awaiting",value:r.queue.awaiting,hint:"input or approval"})]}),i.jsx(Bt,{to:"/requests",className:"mt-4 inline-block text-sm text-info underline-offset-4 hover:underline",children:"View requests"})]})]}),i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Today"})}),i.jsx(Qe,{children:i.jsxs("dl",{className:"grid grid-cols-3 gap-4",children:[i.jsx(rr,{label:"Requests",value:r.today.requests}),i.jsx(rr,{label:"Turns",value:r.today.turns}),i.jsx(rr,{label:"Cost",value:dl(r.today.costUsd)})]})})]}),i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Agent and workspace"})}),i.jsx(Qe,{children:i.jsxs("dl",{className:"divide-y",children:[i.jsx(Ki,{label:"Primary agent",children:r.agent.name??i.jsx(Bt,{to:"/settings/agent",className:"text-info underline",children:"Choose an agent"})}),i.jsx(Ki,{label:"Workspace",children:r.workspace.slug??s}),i.jsx(Ki,{label:"Machine ID",children:r.machineId?i.jsx("code",{className:"text-xs",children:r.machineId}):s})]})})]}),i.jsxs(He,{children:[i.jsxs(ot,{className:"flex-row items-center justify-between space-y-0",children:[i.jsx(ut,{children:"Slack"}),r.slack.connected?i.jsx(tt,{variant:"success",children:"Connected"}):i.jsx(tt,{variant:"destructive",children:"Disconnected"})]}),i.jsxs(Qe,{children:[i.jsxs("dl",{className:"divide-y",children:[i.jsx(Ki,{label:"Bot name",children:r.slack.botName??s}),i.jsx(Ki,{label:"Team ID",children:r.slack.teamId?i.jsx("code",{className:"text-xs",children:r.slack.teamId}):s})]}),!r.slack.connected&&i.jsx(Bt,{to:"/settings/slack",className:"mt-3 inline-block text-sm text-info underline-offset-4 hover:underline",children:"Check Slack settings"})]})]}),i.jsxs(He,{className:"md:col-span-2",children:[i.jsx(ot,{children:i.jsx(ut,{children:"Machine"})}),i.jsx(Qe,{children:i.jsxs("dl",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[i.jsx(rr,{label:"Version",value:r.version}),i.jsx(rr,{label:"Uptime",value:vb(r.uptimeSec)}),i.jsx(rr,{label:"Free disk",value:r.disk.freeGb===null?"n/a":`${r.disk.freeGb.toFixed(1)} GB`}),i.jsx(rr,{label:"Host",value:i.jsx("span",{className:"break-all text-sm",children:r.hostname})})]})})]})]})]})}const eu=k.forwardRef(({className:n,...r},s)=>i.jsx("select",{className:Xe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:s,...r}));eu.displayName="Select";function uy({page:n,pageSize:r,total:s,onPage:o,pageSizes:u,onPageSize:d}){const h=Math.max(1,Math.ceil(s/r)),p=s===0?0:(n-1)*r+1,g=Math.min(s,n*r);return i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground",children:[i.jsxs("span",{children:[p," to ",g," of ",s]}),i.jsxs("div",{className:"flex items-center gap-2",children:[u&&d&&i.jsxs("label",{className:"flex items-center gap-2",children:[i.jsx("span",{children:"Rows"}),i.jsx(eu,{className:"h-8 w-20",value:r,onChange:m=>d(Number(m.target.value)),children:u.map(m=>i.jsx("option",{value:m,children:m},m))})]}),i.jsx(oe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:n<=1,onClick:()=>o(n-1),"aria-label":"Previous page",children:i.jsx(Nk,{})}),i.jsxs("span",{children:["Page ",n," of ",h]}),i.jsx(oe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:n>=h,onClick:()=>o(n+1),"aria-label":"Next page",children:i.jsx(_g,{})})]})]})}function Kd({open:n,onClose:r,title:s,description:o,children:u,footer:d,className:h}){const p=k.useRef(null),g=k.useId(),m=k.useId();return k.useEffect(()=>{const y=p.current;y&&(n&&!y.open&&y.showModal(),!n&&y.open&&y.close())},[n]),i.jsx("dialog",{ref:p,"aria-labelledby":g,"aria-describedby":o?m:void 0,onCancel:y=>{y.preventDefault(),r()},onClick:y=>{y.target===p.current&&r()},className:Xe("w-full max-w-lg rounded-lg border bg-card p-0 text-card-foreground shadow-xl backdrop:bg-black/60",h),children:n&&i.jsxs("div",{className:"flex max-h-[85vh] flex-col",children:[i.jsxs("div",{className:"flex items-start justify-between gap-4 border-b p-5",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h2",{id:g,className:"text-base font-semibold",children:s}),o&&i.jsx("p",{id:m,className:"text-sm text-muted-foreground",children:o})]}),i.jsx("button",{type:"button",onClick:r,"aria-label":"Close",className:"rounded-sm opacity-70 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Bd,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:u}),d&&i.jsx("div",{className:"flex justify-end gap-2 border-t p-4",children:d})]})})}function Gd({open:n,title:r,description:s,confirmLabel:o,destructive:u,pending:d,onConfirm:h,onClose:p}){return i.jsx(Kd,{open:n,onClose:p,title:r,footer:i.jsxs(i.Fragment,{children:[i.jsx(oe,{variant:"outline",onClick:p,children:"Keep it"}),i.jsx(oe,{variant:u?"destructive":"default",onClick:h,disabled:d,children:o})]}),children:i.jsx("p",{className:"text-sm text-muted-foreground",children:s})})}const cy=["queued","running","awaiting_input","awaiting_approval","completed","failed","cancelled"],Pb=["queued","running","awaiting_input","awaiting_approval"],Tb=["failed","cancelled"],Lb=["completed","failed","cancelled"];function dy({request:n,compact:r,showView:s}){const[o,u]=k.useState(!1),d=Wj(),h=Kj(),p=nl(n.permalink),g=r?"icon":"sm",m=r?"ghost":"outline",y=r?"h-8 w-8":void 0;return i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[p&&i.jsxs("a",{href:p,target:"_blank",rel:"noreferrer noopener",title:"Open in Slack","aria-label":r?`Open "${n.title}" in Slack`:void 0,className:`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${r?"h-8 w-8":"h-9 border border-input px-3"}`,children:[i.jsx(Dk,{className:"h-4 w-4","aria-hidden":!0}),!r&&"Open in Slack"]}),s&&i.jsx(Bt,{to:`/requests/${encodeURIComponent(n.id)}`,title:"View","aria-label":`View "${n.title}"`,className:"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Fk,{className:"h-4 w-4","aria-hidden":!0})}),Pb.includes(n.status)&&i.jsxs(oe,{variant:m,size:g,className:y,title:"Cancel","aria-label":r?`Cancel "${n.title}"`:void 0,onClick:()=>u(!0),children:[i.jsx(md,{}),!r&&"Cancel"]}),Tb.includes(n.status)&&i.jsxs(oe,{variant:m,size:g,className:y,title:"Retry","aria-label":r?`Retry "${n.title}"`:void 0,disabled:h.isPending,onClick:()=>h.mutate(n.id,{onSuccess:()=>We({title:"Request queued again",variant:"success"})}),children:[i.jsx(x1,{}),!r&&"Retry"]}),i.jsx(Gd,{open:o,title:"Cancel this request?",description:`"${n.title}" will stop. Any running turn is interrupted.`,confirmLabel:"Cancel request",destructive:!0,pending:d.isPending,onClose:()=>u(!1),onConfirm:()=>d.mutate(n.id,{onSuccess:()=>We({title:"Request cancelled",variant:"success"}),onSettled:()=>u(!1)})})]})}const fy=[25,50,100];function Mb(n){const r=(n.get("status")??"").split(",").filter(o=>cy.includes(o)),s=Number(n.get("pageSize"));return{status:r,q:n.get("q")??"",page:Math.max(1,Number(n.get("page"))||1),pageSize:fy.includes(s)?s:25,sort:n.get("sort")==="recent"?"recent":"active"}}function _b(){const[n,r]=qd(),s=Mb(n),o=Qj(s),u=Wd(),[d,h]=k.useState(s.q),p=(y,w=!0)=>{r(x=>{const j=new URLSearchParams(x);for(const[T,N]of Object.entries(y))N===null||N===""?j.delete(T):j.set(T,N);return w&&!("page"in y)&&j.delete("page"),j},{replace:!0})};k.useEffect(()=>{if(d===s.q)return;const y=setTimeout(()=>p({q:d.trim()||null}),300);return()=>clearTimeout(y)},[d]);const g=y=>{const w=new Set(s.status);w.has(y)?w.delete(y):w.add(y),p({status:[...w].join(",")||null})},m=y=>Xe("rounded-full border px-3 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground");return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Requests",description:"Everything FDA has been asked to do."}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsxs("div",{className:"relative w-full max-w-xs",children:[i.jsx(E1,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),i.jsx(Le,{type:"search","aria-label":"Search requests",placeholder:"Search title and messages",className:"pl-9",value:d,onChange:y=>h(y.target.value)})]}),i.jsx("div",{role:"group","aria-label":"Sort",className:"inline-flex rounded-md border p-0.5",children:["active","recent"].map(y=>i.jsx(oe,{size:"xs",variant:s.sort===y?"secondary":"ghost","aria-pressed":s.sort===y,onClick:()=>p({sort:y==="active"?null:y}),children:y==="active"?"Active first":"Most recent"},y))})]}),i.jsxs("div",{role:"group","aria-label":"Filter by status",className:"flex flex-wrap gap-2",children:[i.jsx("button",{type:"button",className:m(s.status.length===0),"aria-pressed":s.status.length===0,onClick:()=>p({status:null}),children:"All"}),cy.map(y=>i.jsx("button",{type:"button",className:m(s.status.includes(y)),"aria-pressed":s.status.includes(y),onClick:()=>g(y),children:sy[y]},y))]}),o.isLoading?i.jsx(kt,{}):o.isError?i.jsx(Ot,{error:o.error,onRetry:()=>void o.refetch()}):!o.data||o.data.items.length===0?i.jsx(rn,{children:s.status.length||s.q?"No requests match these filters.":"No requests yet. Mention the bot in an allowed Slack channel to start one."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Xe("overflow-x-auto rounded-lg border",o.isPlaceholderData&&"opacity-60"),children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Request"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Requester"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Channel"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Activity"}),i.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Cost"}),i.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:i.jsx("span",{className:"sr-only",children:"Actions"})})]})}),i.jsx("tbody",{className:"divide-y",children:o.data.items.map(y=>i.jsxs("tr",{className:"hover:bg-accent/30",children:[i.jsxs("td",{className:"max-w-xs px-3 py-2",children:[i.jsx(Bt,{to:`/requests/${encodeURIComponent(y.id)}`,className:"block truncate font-medium hover:underline",title:y.title,children:y.title}),y.prs.length>0&&i.jsx("span",{className:"text-xs text-muted-foreground",children:y.prs.length===1?"1 PR":`${y.prs.length} PRs`})]}),i.jsx("td",{className:"px-3 py-2",children:i.jsx(fl,{status:y.status})}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:y.requesterName??y.requesterId}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:y.channelName?`#${y.channelName}`:y.channelId}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-muted-foreground",title:mn(y.lastActivityAt),children:Yt(y.lastActivityAt,u)}),i.jsx("td",{className:"px-3 py-2 text-right tabular-nums text-muted-foreground",children:dl(y.costUsd)}),i.jsx("td",{className:"px-3 py-2",children:i.jsx(dy,{request:y,compact:!0,showView:!0})})]},y.id))})]})}),i.jsx(uy,{page:s.page,pageSize:s.pageSize,total:o.data.total,onPage:y=>p({page:y===1?null:String(y)},!1),pageSizes:fy,onPageSize:y=>p({pageSize:y===25?null:String(y)})})]})]})}function hy({items:n,value:r,onChange:s,label:o,idPrefix:u}){const d=k.useRef([]),h=(p,g)=>{var y;let m=-1;p.key==="ArrowRight"&&(m=(g+1)%n.length),p.key==="ArrowLeft"&&(m=(g-1+n.length)%n.length),p.key==="Home"&&(m=0),p.key==="End"&&(m=n.length-1),m>=0&&(p.preventDefault(),s(n[m].value),(y=d.current[m])==null||y.focus())};return i.jsx("div",{role:"tablist","aria-label":o,className:"flex flex-wrap gap-1 border-b",children:n.map((p,g)=>{const m=p.value===r;return i.jsx("button",{ref:y=>{d.current[g]=y},type:"button",role:"tab",id:`${u}-tab-${p.value}`,"aria-selected":m,"aria-controls":`${u}-panel-${p.value}`,tabIndex:m?0:-1,onClick:()=>s(p.value),onKeyDown:y=>h(y,g),className:Xe("-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m?"border-primary font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:p.label},p.value)})})}function py({idPrefix:n,value:r,children:s,className:o}){return i.jsx("div",{role:"tabpanel",id:`${n}-panel-${r}`,"aria-labelledby":`${n}-tab-${r}`,tabIndex:0,className:Xe("pt-4 focus-visible:outline-none",o),children:s})}const Kc=/^\s*([-*+]|\d+[.)])\s+(.*)$/;function Ab(n){const r=n.replace(/\r\n?/g,`
|
|
307
|
+
*/const B1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bd=Me("x",B1);function Fg(n){var r,s,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(s=Fg(n[r]))&&(o&&(o+=" "),o+=s)}else for(s in n)n[s]&&(o&&(o+=" "),o+=s);return o}function Ig(){for(var n,r,s=0,o="",u=arguments.length;s<u;s++)(n=arguments[s])&&(r=Fg(n))&&(o&&(o+=" "),o+=r);return o}const hm=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,pm=Ig,zg=(n,r)=>s=>{var o;if((r==null?void 0:r.variants)==null)return pm(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:u,defaultVariants:d}=r,h=Object.keys(u).map(m=>{const y=s==null?void 0:s[m],w=d==null?void 0:d[m];if(y===null)return null;const x=hm(y)||hm(w);return u[m][x]}),p=s&&Object.entries(s).reduce((m,y)=>{let[w,x]=y;return x===void 0||(m[w]=x),m},{}),g=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((m,y)=>{let{class:w,className:x,...j}=y;return Object.entries(j).every(_=>{let[E,S]=_;return Array.isArray(S)?S.includes({...d,...p}[E]):{...d,...p}[E]===S})?[...m,w,x]:m},[]);return pm(n,h,g,s==null?void 0:s.class,s==null?void 0:s.className)},H1=(n,r)=>{const s=new Array(n.length+r.length);for(let o=0;o<n.length;o++)s[o]=n[o];for(let o=0;o<r.length;o++)s[n.length+o]=r[o];return s},Q1=(n,r)=>({classGroupId:n,validator:r}),Ug=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),Bo="-",mm=[],V1="arbitrary..",W1=n=>{const r=G1(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return K1(h);const p=h.split(Bo),g=p[0]===""&&p.length>1?1:0;return $g(p,g,r)},getConflictingClassGroupIds:(h,p)=>{if(p){const g=o[h],m=s[h];return g?m?H1(m,g):g:m||mm}return s[h]||mm}}},$g=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const u=n[r],d=s.nextPart.get(u);if(d){const m=$g(n,r+1,d);if(m)return m}const h=s.validators;if(h===null)return;const p=r===0?n.join(Bo):n.slice(r).join(Bo),g=h.length;for(let m=0;m<g;m++){const y=h[m];if(y.validator(p))return y.classGroupId}},K1=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?V1+o:void 0})(),G1=n=>{const{theme:r,classGroups:s}=n;return Y1(s,r)},Y1=(n,r)=>{const s=Ug();for(const o in n){const u=n[o];Hd(u,s,o,r)}return s},Hd=(n,r,s,o)=>{const u=n.length;for(let d=0;d<u;d++){const h=n[d];J1(h,r,s,o)}},J1=(n,r,s,o)=>{if(typeof n=="string"){X1(n,r,s);return}if(typeof n=="function"){Z1(n,r,s,o);return}ej(n,r,s,o)},X1=(n,r,s)=>{const o=n===""?r:qg(r,n);o.classGroupId=s},Z1=(n,r,s,o)=>{if(tj(n)){Hd(n(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(Q1(s,n))},ej=(n,r,s,o)=>{const u=Object.entries(n),d=u.length;for(let h=0;h<d;h++){const[p,g]=u[h];Hd(g,qg(r,p),s,o)}},qg=(n,r)=>{let s=n;const o=r.split(Bo),u=o.length;for(let d=0;d<u;d++){const h=o[d];let p=s.nextPart.get(h);p||(p=Ug(),s.nextPart.set(h,p)),s=p}return s},tj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,nj=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const u=(d,h)=>{s[d]=h,r++,r>n&&(r=0,o=s,s=Object.create(null))};return{get(d){let h=s[d];if(h!==void 0)return h;if((h=o[d])!==void 0)return u(d,h),h},set(d,h){d in s?s[d]=h:u(d,h)}}},yd="!",gm=":",rj=[],ym=(n,r,s,o,u)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:u}),sj=n=>{const{prefix:r,experimentalParseClassName:s}=n;let o=u=>{const d=[];let h=0,p=0,g=0,m;const y=u.length;for(let E=0;E<y;E++){const S=u[E];if(h===0&&p===0){if(S===gm){d.push(u.slice(g,E)),g=E+1;continue}if(S==="/"){m=E;continue}}S==="["?h++:S==="]"?h--:S==="("?p++:S===")"&&p--}const w=d.length===0?u:u.slice(g);let x=w,j=!1;w.endsWith(yd)?(x=w.slice(0,-1),j=!0):w.startsWith(yd)&&(x=w.slice(1),j=!0);const _=m&&m>g?m-g:void 0;return ym(d,j,x,_)};if(r){const u=r+gm,d=o;o=h=>h.startsWith(u)?d(h.slice(u.length)):ym(rj,!1,h,void 0,!0)}if(s){const u=o;o=d=>s({className:d,parseClassName:u})}return o},aj=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let u=[];for(let d=0;d<s.length;d++){const h=s[d],p=h[0]==="[",g=r.has(h);p||g?(u.length>0&&(u.sort(),o.push(...u),u=[]),o.push(h)):u.push(h)}return u.length>0&&(u.sort(),o.push(...u)),o}},ij=n=>({cache:nj(n.cacheSize),parseClassName:sj(n),sortModifiers:aj(n),...W1(n)}),lj=/\s+/,oj=(n,r)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:u,sortModifiers:d}=r,h=[],p=n.trim().split(lj);let g="";for(let m=p.length-1;m>=0;m-=1){const y=p[m],{isExternal:w,modifiers:x,hasImportantModifier:j,baseClassName:_,maybePostfixModifierPosition:E}=s(y);if(w){g=y+(g.length>0?" "+g:g);continue}let S=!!E,P=o(S?_.substring(0,E):_);if(!P){if(!S){g=y+(g.length>0?" "+g:g);continue}if(P=o(_),!P){g=y+(g.length>0?" "+g:g);continue}S=!1}const D=x.length===0?"":x.length===1?x[0]:d(x).join(":"),U=j?D+yd:D,Q=U+P;if(h.indexOf(Q)>-1)continue;h.push(Q);const X=u(P,S);for(let se=0;se<X.length;++se){const A=X[se];h.push(U+A)}g=y+(g.length>0?" "+g:g)}return g},uj=(...n)=>{let r=0,s,o,u="";for(;r<n.length;)(s=n[r++])&&(o=Bg(s))&&(u&&(u+=" "),u+=o);return u},Bg=n=>{if(typeof n=="string")return n;let r,s="";for(let o=0;o<n.length;o++)n[o]&&(r=Bg(n[o]))&&(s&&(s+=" "),s+=r);return s},cj=(n,...r)=>{let s,o,u,d;const h=g=>{const m=r.reduce((y,w)=>w(y),n());return s=ij(m),o=s.cache.get,u=s.cache.set,d=p,p(g)},p=g=>{const m=o(g);if(m)return m;const y=oj(g,s);return u(g,y),y};return d=h,(...g)=>d(uj(...g))},dj=[],At=n=>{const r=s=>s[n]||dj;return r.isThemeGetter=!0,r},Hg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=n=>fj.test(n),Ie=n=>!!n&&!Number.isNaN(Number(n)),Zr=n=>!!n&&Number.isInteger(Number(n)),Vc=n=>n.endsWith("%")&&Ie(n.slice(0,-1)),xr=n=>hj.test(n),Vg=()=>!0,vj=n=>pj.test(n)&&!mj.test(n),Qd=()=>!1,xj=n=>gj.test(n),wj=n=>yj.test(n),kj=n=>!ie(n)&&!le(n),jj=n=>gs(n,Gg,Qd),ie=n=>Hg.test(n),Is=n=>gs(n,Yg,vj),vm=n=>gs(n,Tj,Ie),bj=n=>gs(n,Xg,Vg),Sj=n=>gs(n,Jg,Qd),xm=n=>gs(n,Wg,Qd),Cj=n=>gs(n,Kg,wj),Ro=n=>gs(n,Zg,xj),le=n=>Qg.test(n),Wi=n=>na(n,Yg),Nj=n=>na(n,Jg),wm=n=>na(n,Wg),Ej=n=>na(n,Gg),Rj=n=>na(n,Kg),Po=n=>na(n,Zg,!0),Pj=n=>na(n,Xg,!0),gs=(n,r,s)=>{const o=Hg.exec(n);return o?o[1]?r(o[1]):s(o[2]):!1},na=(n,r,s=!1)=>{const o=Qg.exec(n);return o?o[1]?r(o[1]):s:!1},Wg=n=>n==="position"||n==="percentage",Kg=n=>n==="image"||n==="url",Gg=n=>n==="length"||n==="size"||n==="bg-size",Yg=n=>n==="length",Tj=n=>n==="number",Jg=n=>n==="family-name",Xg=n=>n==="number"||n==="weight",Zg=n=>n==="shadow",Lj=()=>{const n=At("color"),r=At("font"),s=At("text"),o=At("font-weight"),u=At("tracking"),d=At("leading"),h=At("breakpoint"),p=At("container"),g=At("spacing"),m=At("radius"),y=At("shadow"),w=At("inset-shadow"),x=At("text-shadow"),j=At("drop-shadow"),_=At("blur"),E=At("perspective"),S=At("aspect"),P=At("ease"),D=At("animate"),U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Q(),le,ie],se=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],B=()=>[le,ie,g],pe=()=>[Xr,"full","auto",...B()],Z=()=>[Zr,"none","subgrid",le,ie],Ue=()=>["auto",{span:["full",Zr,le,ie]},Zr,le,ie],Je=()=>[Zr,"auto",le,ie],nt=()=>["auto","min","max","fr",le,ie],pt=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Pe=()=>["start","end","center","stretch","center-safe","end-safe"],Te=()=>["auto",...B()],ye=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],G=()=>[Xr,"screen","full","dvw","lvw","svw","min","max","fit",...B()],ne=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],$=()=>[n,le,ie],L=()=>[...Q(),wm,xm,{position:[le,ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],be=()=>["auto","cover","contain",Ej,jj,{size:[le,ie]}],ve=()=>[Vc,Wi,Is],xe=()=>["","none","full",m,le,ie],Se=()=>["",Ie,Wi,Is],Fe=()=>["solid","dashed","dotted","double"],Ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>[Ie,Vc,wm,xm],It=()=>["","none",_,le,ie],ct=()=>["none",Ie,le,ie],sn=()=>["none",Ie,le,ie],Fn=()=>[Ie,le,ie],Gn=()=>[Xr,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xr],breakpoint:[xr],color:[Vg],container:[xr],"drop-shadow":[xr],ease:["in","out","in-out"],font:[kj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xr],shadow:[xr],spacing:["px",Ie],text:[xr],"text-shadow":[xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,ie,le,S]}],container:["container"],columns:[{columns:[Ie,ie,le,p]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Zr,"auto",le,ie]}],basis:[{basis:[Xr,"full","auto",p,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Xr,"auto","initial","none",ie]}],grow:[{grow:["",Ie,le,ie]}],shrink:[{shrink:["",Ie,le,ie]}],order:[{order:[Zr,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:Ue()}],"col-start":[{"col-start":Je()}],"col-end":[{"col-end":Je()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:Ue()}],"row-start":[{"row-start":Je()}],"row-end":[{"row-end":Je()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":nt()}],"auto-rows":[{"auto-rows":nt()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...pt(),"normal"]}],"justify-items":[{"justify-items":[...Pe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Pe()]}],"align-content":[{content:["normal",...pt()]}],"align-items":[{items:[...Pe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Pe(),{baseline:["","last"]}]}],"place-content":[{"place-content":pt()}],"place-items":[{"place-items":[...Pe(),"baseline"]}],"place-self":[{"place-self":["auto",...Pe()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:Te()}],mx:[{mx:Te()}],my:[{my:Te()}],ms:[{ms:Te()}],me:[{me:Te()}],mbs:[{mbs:Te()}],mbe:[{mbe:Te()}],mt:[{mt:Te()}],mr:[{mr:Te()}],mb:[{mb:Te()}],ml:[{ml:Te()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:ye()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[p,"screen",...ye()]}],"min-w":[{"min-w":[p,"screen","none",...ye()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[h]},...ye()]}],h:[{h:["screen","lh",...ye()]}],"min-h":[{"min-h":["screen","lh","none",...ye()]}],"max-h":[{"max-h":["screen","lh",...ye()]}],"font-size":[{text:["base",s,Wi,Is]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Pj,bj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vc,ie]}],"font-family":[{font:[Nj,Sj,r]}],"font-features":[{"font-features":[ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,le,ie]}],"line-clamp":[{"line-clamp":[Ie,"none",le,vm]}],leading:[{leading:[d,...B()]}],"list-image":[{"list-image":["none",le,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",le,Is]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Ie,"auto",le,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:be()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zr,le,ie],radial:["",le,ie],conic:[Zr,le,ie]},Rj,Cj]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:ve()}],"gradient-via-pos":[{via:ve()}],"gradient-to-pos":[{to:ve()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:xe()}],"rounded-s":[{"rounded-s":xe()}],"rounded-e":[{"rounded-e":xe()}],"rounded-t":[{"rounded-t":xe()}],"rounded-r":[{"rounded-r":xe()}],"rounded-b":[{"rounded-b":xe()}],"rounded-l":[{"rounded-l":xe()}],"rounded-ss":[{"rounded-ss":xe()}],"rounded-se":[{"rounded-se":xe()}],"rounded-ee":[{"rounded-ee":xe()}],"rounded-es":[{"rounded-es":xe()}],"rounded-tl":[{"rounded-tl":xe()}],"rounded-tr":[{"rounded-tr":xe()}],"rounded-br":[{"rounded-br":xe()}],"rounded-bl":[{"rounded-bl":xe()}],"border-w":[{border:Se()}],"border-w-x":[{"border-x":Se()}],"border-w-y":[{"border-y":Se()}],"border-w-s":[{"border-s":Se()}],"border-w-e":[{"border-e":Se()}],"border-w-bs":[{"border-bs":Se()}],"border-w-be":[{"border-be":Se()}],"border-w-t":[{"border-t":Se()}],"border-w-r":[{"border-r":Se()}],"border-w-b":[{"border-b":Se()}],"border-w-l":[{"border-l":Se()}],"divide-x":[{"divide-x":Se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Fe(),"hidden","none"]}],"divide-style":[{divide:[...Fe(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,le,ie]}],"outline-w":[{outline:["",Ie,Wi,Is]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",y,Po,Ro]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",w,Po,Ro]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Ie,Is]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",x,Po,Ro]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Ie,le,ie]}],"mix-blend":[{"mix-blend":[...Ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[le,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Q()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:be()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:It()}],brightness:[{brightness:[Ie,le,ie]}],contrast:[{contrast:[Ie,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",j,Po,Ro]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Ie,le,ie]}],"hue-rotate":[{"hue-rotate":[Ie,le,ie]}],invert:[{invert:["",Ie,le,ie]}],saturate:[{saturate:[Ie,le,ie]}],sepia:[{sepia:["",Ie,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":It()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",Ie,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,le,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",le,ie]}],ease:[{ease:["linear","initial",P,le,ie]}],delay:[{delay:[Ie,le,ie]}],animate:[{animate:["none",D,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,le,ie]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:ct()}],"rotate-x":[{"rotate-x":ct()}],"rotate-y":[{"rotate-y":ct()}],"rotate-z":[{"rotate-z":ct()}],scale:[{scale:sn()}],"scale-x":[{"scale-x":sn()}],"scale-y":[{"scale-y":sn()}],"scale-z":[{"scale-z":sn()}],"scale-3d":["scale-3d"],skew:[{skew:Fn()}],"skew-x":[{"skew-x":Fn()}],"skew-y":[{"skew-y":Fn()}],transform:[{transform:[le,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Gn()}],"translate-x":[{"translate-x":Gn()}],"translate-y":[{"translate-y":Gn()}],"translate-z":[{"translate-z":Gn()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le,ie]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Ie,Wi,Is,vm]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Mj=cj(Lj);function Xe(...n){return Mj(Ig(n))}function rl(n){if(!n)return null;try{const r=new URL(n);return r.protocol==="https:"||r.protocol==="http:"?r.toString():null}catch{return null}}const _j=zg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",xs:"h-7 rounded-md px-2 text-xs",lg:"h-11 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),oe=k.forwardRef(({className:n,variant:r,size:s,type:o="button",...u},d)=>i.jsx("button",{type:o,className:Xe(_j({variant:r,size:s,className:n})),ref:d,...u}));oe.displayName="Button";let sl=[],Aj=1;const vd=new Set;function ey(){for(const n of vd)n()}function We(n){const r={id:Aj++,variant:"default",...n};sl=[...sl.slice(-3),r],ey(),setTimeout(()=>ty(r.id),r.variant==="error"?8e3:4e3)}function ty(n){sl=sl.filter(r=>r.id!==n),ey()}function Dj(n){return vd.add(n),()=>{vd.delete(n)}}function Oj(){return sl}class Wn extends Error{constructor(s,o){var d,h,p;const u=((d=o.error)==null?void 0:d.code)??(s>=500?"server_error":"request_failed");super(((h=o.error)==null?void 0:h.message)??Ij(u,s));qi(this,"status");qi(this,"code");qi(this,"field");qi(this,"body");this.status=s,this.code=u,this.field=(p=o.error)==null?void 0:p.field,this.body=o}}const Fj={unauthorized:"Your session has ended. Sign in again.",invalid_credentials:"Wrong username or password.",rate_limited:"Too many attempts. Wait a moment and try again.",must_change_password:"Change your password to continue.",csrf:"The request was blocked by a security check. Reload the page and try again.",weak_password:"Use at least 12 characters for the new password.",invalid_username:"That username is not allowed.",not_found:"Not found.",not_cancellable:"This request can no longer be cancelled.",not_retryable:"This request cannot be retried.",invalid_key:"That API key was rejected.",invalid_setting:"One of the values is not valid.",network_error:"Could not reach the FDA daemon.",server_error:"The daemon hit an error."};function Ij(n,r){return Fj[n]??(r?`Request failed (${r}).`:"Request failed.")}function yt(n){return n instanceof Wn||n instanceof Error?n.message:"Something went wrong."}let xd={onUnauthorized:()=>window.location.assign("/login"),onMustChange:()=>window.location.assign("/change-password")};function zj(n){xd=n}async function Ee(n,r={}){const s={Accept:"application/json","X-FDA-Request":"1"};r.body!==void 0&&(s["Content-Type"]="application/json");let o;try{o=await fetch(n,{method:r.method??"GET",credentials:"same-origin",headers:s,body:r.body!==void 0?JSON.stringify(r.body):void 0,signal:r.signal})}catch(h){throw h instanceof DOMException&&h.name==="AbortError"?h:new Wn(0,{error:{code:"network_error"}})}const u=await o.text();let d=null;if(u)try{d=JSON.parse(u)}catch{d=null}if(!o.ok){const h=new Wn(o.status,d??{});throw o.status===401&&!r.noAuthRedirect&&h.code!=="invalid_credentials"?xd.onUnauthorized():o.status===403&&h.code==="must_change_password"?xd.onMustChange():o.status===403&&h.code==="csrf"&&We({title:"Blocked",description:h.message,variant:"error"}),h}return d}function Ja(n){const r=new URLSearchParams;for(const[o,u]of Object.entries(n))u!=null&&u!==""&&r.set(o,String(u));const s=r.toString();return s?`?${s}`:""}function kt({label:n="Loading"}){return i.jsxs("div",{className:"flex items-center gap-2 p-6 text-sm text-muted-foreground",role:"status",children:[i.jsx(i1,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),n]})}function Ot({error:n,onRetry:r}){return i.jsxs("div",{role:"alert",className:"flex items-start gap-3 rounded-md border border-destructive/50 bg-destructive-muted p-4 text-sm",children:[i.jsx(Rk,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive","aria-hidden":!0}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{children:yt(n)}),r&&i.jsx(oe,{variant:"outline",size:"xs",className:"mt-2",onClick:r,children:"Try again"})]})]})}function rn({children:n}){return i.jsx("div",{className:"rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground",children:n})}function Go({id:n,message:r}){return r?i.jsx("p",{id:n,role:"alert",className:"text-sm text-red-300",children:r}):null}function ys({title:n,description:r,actions:s}){return i.jsxs("div",{className:"mb-6 flex flex-wrap items-start justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-semibold",children:n}),r&&i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:r})]}),s&&i.jsx("div",{className:"flex items-center gap-2",children:s})]})}const Be={me:["me"],health:["health"],dashboard:["dashboard"],requests:["requests"],requestList:n=>["requests","list",n],request:n=>["requests","detail",n],settings:["settings"],agents:["agents"],manifest:n=>["slack-manifest",n],access:["access"],slackChannels:n=>["slack","channels",n],slackUsers:n=>["slack","users",n],slackUsergroups:["slack","usergroups"],fs:n=>["fs",n],audit:(n,r)=>["audit",n,r],schedules:["schedules"],setup:["setup"],schedule:n=>["schedules",n]};function Yo(){return Rt({queryKey:Be.me,queryFn:()=>Ee("/api/auth/me").then(n=>n.user),staleTime:6e4})}function Uj(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/auth/login",{method:"POST",body:r,noAuthRedirect:!0}),meta:{inlineError:!0},onSuccess:({user:r})=>{n.removeQueries(),n.setQueryData(Be.me,r)}})}function $j(){const n=Ct();return Ft({mutationFn:()=>Ee("/api/auth/logout",{method:"POST",noAuthRedirect:!0}),onSettled:()=>n.removeQueries()})}function qj(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/auth/password",{method:"POST",body:r,noAuthRedirect:!0}),meta:{inlineError:!0},onSuccess:({user:r})=>{n.setQueryData(Be.me,r),n.invalidateQueries({predicate:s=>s.queryKey[0]!=="me"})}})}function Bj(){return Rt({queryKey:Be.health,queryFn:()=>Ee("/api/health"),refetchInterval:1e4})}function Hj(){return Rt({queryKey:Be.dashboard,queryFn:()=>Ee("/api/dashboard"),refetchInterval:5e3})}function Qj(n){return Rt({queryKey:Be.requestList(n),queryFn:()=>Ee(`/api/requests${Ja({status:n.status.join(","),q:n.q,page:n.page,pageSize:n.pageSize,sort:n.sort})}`),placeholderData:Ga,refetchInterval:1e4})}function Vj(n){return Rt({queryKey:Be.request(n),queryFn:()=>Ee(`/api/requests/${encodeURIComponent(n)}`),refetchInterval:15e3})}function ny(n){const r=Ct();return Ft({mutationFn:s=>Ee(`/api/requests/${encodeURIComponent(s)}/${n}`,{method:"POST"}),onSettled:()=>{r.invalidateQueries({queryKey:Be.requests}),r.invalidateQueries({queryKey:Be.dashboard})}})}const Wj=()=>ny("cancel"),Kj=()=>ny("retry");function Jo(){return Rt({queryKey:Be.settings,queryFn:()=>Ee("/api/settings")})}function Xo(){const n=Ct();return()=>{n.invalidateQueries({queryKey:Be.health}),n.invalidateQueries({queryKey:Be.dashboard})}}function Zo(n,r){n.setQueryData(Be.settings,s=>s&&{...s,...r}),n.invalidateQueries({queryKey:Be.settings})}function Vd(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/general",{method:"PUT",body:s}),meta:{inlineError:!0},onSuccess:({settings:s})=>{Zo(n,{settings:s}),r()}})}function Gj(){return Rt({queryKey:Be.agents,queryFn:()=>Ee("/api/agents")})}function Yj(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/agent",{method:"PUT",body:{agentId:s}}),onSuccess:({settings:s})=>{Zo(n,{settings:s}),n.invalidateQueries({queryKey:Be.agents}),r()}})}function Jj(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/anthropic",{method:"PUT",body:{apiKey:s}}),meta:{inlineError:!0},onSuccess:({secrets:s})=>{Zo(n,{secrets:s}),r()}})}function Xj(){return Ft({mutationFn:()=>Ee("/api/settings/anthropic/test",{method:"POST"}),meta:{inlineError:!0}})}function Zj(){const n=Ct(),r=Xo();return Ft({mutationFn:s=>Ee("/api/settings/slack",{method:"PUT",body:s}),meta:{inlineError:!0},onSuccess:({secrets:s})=>{Zo(n,{secrets:s}),r()}})}function eb(){const n=Ct();return Ft({mutationFn:()=>Ee("/api/settings/slack/test",{method:"POST"}),meta:{inlineError:!0},onSuccess:()=>{n.invalidateQueries({queryKey:Be.settings}),n.invalidateQueries({queryKey:Be.dashboard})}})}function tb(n){return Rt({queryKey:Be.manifest(n),queryFn:()=>Ee(`/api/settings/slack/manifest${Ja({name:n})}`),placeholderData:Ga})}function nb(){return Rt({queryKey:Be.access,queryFn:()=>Ee("/api/settings/access").then(n=>n.entries)})}function rb(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/settings/access",{method:"PUT",body:{entries:r}}),onSuccess:({entries:r})=>{n.setQueryData(Be.access,r),n.invalidateQueries({queryKey:Be.health})}})}function sb(n,r=!0){return Rt({queryKey:Be.slackChannels(n),queryFn:()=>Ee(`/api/slack/channels${Ja({q:n})}`).then(s=>s.items),enabled:r,staleTime:3e4,placeholderData:Ga})}function ab(n,r=!0){return Rt({queryKey:Be.slackUsers(n),queryFn:()=>Ee(`/api/slack/users${Ja({q:n})}`).then(s=>s.items),enabled:r,staleTime:3e4,placeholderData:Ga})}function ib(n=!0){return Rt({queryKey:Be.slackUsergroups,queryFn:()=>Ee("/api/slack/usergroups").then(r=>r.items),enabled:n,staleTime:6e4})}function lb(n,r=!0){return Rt({queryKey:Be.fs(n),queryFn:()=>Ee(`/api/fs/list${Ja({path:n})}`),enabled:r,placeholderData:Ga})}function ob(n,r){return Rt({queryKey:Be.audit(n,r),queryFn:()=>Ee(`/api/audit${Ja({page:n,pageSize:r})}`),placeholderData:Ga})}function ub(){return Rt({queryKey:Be.schedules,queryFn:()=>Ee("/api/schedules").then(n=>n.items),refetchInterval:3e4})}function cb(n){return Rt({queryKey:Be.schedule(n??""),queryFn:()=>Ee(`/api/schedules/${encodeURIComponent(n)}`),enabled:!!n})}function ry(){const n=Ct();return Ft({mutationFn:({id:r,patch:s})=>Ee(`/api/schedules/${encodeURIComponent(r)}`,{method:"PATCH",body:s}),onSettled:()=>void n.invalidateQueries({queryKey:Be.schedules})})}function db(){const n=Ct();return Ft({mutationFn:r=>Ee(`/api/schedules/${encodeURIComponent(r)}`,{method:"DELETE"}),onSettled:()=>void n.invalidateQueries({queryKey:Be.schedules})})}function fb(){const n=Ct();return Ft({mutationFn:r=>Ee(`/api/schedules/${encodeURIComponent(r)}/run`,{method:"POST"}),onSettled:()=>{n.invalidateQueries({queryKey:Be.schedules}),n.invalidateQueries({queryKey:Be.requests})}})}function hb(){return Rt({queryKey:Be.setup,queryFn:()=>Ee("/api/setup"),refetchInterval:3e4})}function pb(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/setup",{method:"PUT",body:r}),onSettled:()=>void n.invalidateQueries({queryKey:Be.setup})})}function mb(){const n=Ct();return Ft({mutationFn:r=>Ee("/api/setup/proposal",{method:"POST",body:r}),onSettled:()=>void n.invalidateQueries({queryKey:Be.setup})})}function km({children:n}){var o;const r=Yo(),s=On();return r.isLoading?i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(kt,{})}):r.error?r.error instanceof Wn&&r.error.status===401?i.jsx(hd,{to:"/login",replace:!0,state:{from:s.pathname+s.search}}):i.jsx("div",{className:"mx-auto max-w-md p-8",children:i.jsx(Ot,{error:r.error,onRetry:()=>void r.refetch()})}):(o=r.data)!=null&&o.mustChange&&s.pathname!=="/change-password"?i.jsx(hd,{to:"/change-password",replace:!0}):i.jsx(i.Fragment,{children:n})}const gb=zg("inline-flex items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-xs font-medium",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",destructive:"border-destructive/40 bg-destructive-muted text-red-300",warning:"border-warning/40 bg-warning-muted text-amber-300",success:"border-success/40 bg-success-muted text-green-300",info:"border-info/40 bg-info-muted text-blue-300",muted:"border-transparent bg-muted text-muted-foreground"}},defaultVariants:{variant:"default"}});function tt({className:n,variant:r,...s}){return i.jsx("span",{className:Xe(gb({variant:r}),n),...s})}const Wc=new Intl.RelativeTimeFormat(void 0,{numeric:"auto",style:"short"});function Yt(n,r=Date.now()){if(!n)return"never";const s=(n-r)/1e3,o=Math.abs(s);return o<45?"just now":o<3600?Wc.format(Math.round(s/60),"minute"):o<86400?Wc.format(Math.round(s/3600),"hour"):o<86400*30?Wc.format(Math.round(s/86400),"day"):new Date(n).toLocaleDateString()}function mn(n){return n?new Date(n).toLocaleString():""}function fl(n){return n==null?"n/a":n>0&&n<.01?"<$0.01":`$${n.toFixed(2)}`}function yb(n){if(n==null)return"n/a";const r=Math.round(n/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60);return s<60?`${s}m ${r%60}s`:`${Math.floor(s/60)}h ${s%60}m`}function vb(n){const r=Math.floor(n/86400),s=Math.floor(n%86400/3600),o=Math.floor(n%3600/60);return r>0?`${r}d ${s}h`:s>0?`${s}h ${o}m`:`${o}m`}function jm(n){return n==null?"n/a":n.toLocaleString()}const sy={queued:"Queued",running:"Running",awaiting_input:"Awaiting input",awaiting_approval:"Awaiting approval",completed:"Completed",failed:"Failed",cancelled:"Cancelled"},bm={blocked:0,degraded:1,warn:2};function ay(n){return[...n].sort((r,s)=>bm[r.level]-bm[s.level]||r.since-s.since)}function iy({state:n}){return n==="blocked"?i.jsx(tt,{variant:"destructive",children:"Blocked"}):n==="degraded"?i.jsx(tt,{variant:"warning",children:"Degraded"}):i.jsx(tt,{variant:"success",children:"Healthy"})}function xb({conditions:n}){return n.length?i.jsx("ul",{className:"space-y-2",children:ay(n).map(r=>{const s=r.level==="blocked"?Og:r.level==="degraded"?O1:e1;return i.jsxs("li",{className:Xe("flex items-start gap-3 rounded-md border p-3 text-sm",r.level==="blocked"&&"border-destructive/50 bg-destructive-muted",r.level==="degraded"&&"border-warning/50 bg-warning-muted",r.level==="warn"&&"bg-muted/40"),children:[i.jsx(s,{className:Xe("mt-0.5 h-4 w-4 shrink-0",r.level==="blocked"&&"text-destructive",r.level==="degraded"&&"text-warning",r.level==="warn"&&"text-muted-foreground"),"aria-hidden":!0}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"break-words",children:r.message}),i.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[i.jsx("span",{className:"capitalize",children:r.level})," since"," ",Yt(r.since)]})]})]},r.id)})}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"No problems reported."})}function wb({conditions:n}){const r=ay(n).filter(s=>s.level==="blocked");return i.jsx("div",{role:"alert",className:"border-b border-destructive/50 bg-destructive-muted px-6 py-3 text-sm",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Og,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive","aria-hidden":!0}),i.jsxs("div",{className:"min-w-0 space-y-1",children:[i.jsx("p",{className:"font-medium",children:"FDA is blocked. New requests are refused until this is fixed."}),i.jsx("ul",{className:"list-disc space-y-0.5 pl-4 text-red-200",children:r.map(s=>i.jsx("li",{className:"break-words",children:s.message},s.id))})]})]})})}const kb=[{to:"/",label:"Dashboard",icon:n1,end:!0},{to:"/requests",label:"Requests",icon:s1,end:!1},{to:"/tickets",label:"Tickets",icon:_1,end:!1},{to:"/schedules",label:"Schedules",icon:jk,end:!1},{to:"/setup",label:"Setup",icon:q1,end:!1},{to:"/browser",label:"Browser",icon:Ag,end:!1},{to:"/settings",label:"Settings",icon:P1,end:!1},{to:"/audit",label:"Audit log",icon:C1,end:!1}];function jb(){var u,d,h;const n=Bj(),r=Yo(),s=$j(),o=ta();return i.jsxs("div",{className:"flex h-full",children:[i.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r bg-card/40",children:[i.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-4",children:[i.jsx(Pg,{className:"h-5 w-5","aria-hidden":!0}),i.jsx("span",{className:"font-semibold",children:"SuperClawd FDA"})]}),i.jsx("nav",{"aria-label":"Main",className:"flex-1 space-y-1 p-2",children:kb.map(({to:p,label:g,icon:m,end:y})=>i.jsxs($d,{to:p,end:y,className:({isActive:w})=>Xe("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",w?"bg-accent font-medium text-foreground":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[i.jsx(m,{className:"h-4 w-4","aria-hidden":!0}),g]},p))}),i.jsxs("div",{className:"space-y-3 border-t p-3 text-sm",children:[n.data&&i.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[i.jsx(iy,{state:n.data.state}),i.jsxs("span",{className:"text-xs",children:["v",n.data.version]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("span",{className:"truncate text-muted-foreground",title:(u=r.data)==null?void 0:u.username,children:(d=r.data)==null?void 0:d.username}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Sign out",title:"Sign out",onClick:()=>s.mutate(void 0,{onSettled:()=>o("/login",{replace:!0})}),children:i.jsx(Dg,{})})]})]})]}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[((h=n.data)==null?void 0:h.state)==="blocked"&&i.jsx(wb,{conditions:n.data.conditions}),i.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:i.jsx("div",{className:"mx-auto max-w-6xl p-6",children:i.jsx(Id,{})})})]})]})}function bb(){const n=ta(),r=On(),s=r.pathname,o=r.pathname+r.search;return k.useEffect(()=>{zj({onUnauthorized:()=>{s!=="/login"&&n("/login",{replace:!0,state:{from:o}})},onMustChange:()=>{s!=="/change-password"&&n("/change-password",{replace:!0})}})},[n,s,o]),i.jsx(Id,{})}const He=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("rounded-lg border bg-card text-card-foreground shadow-sm",n),...r}));He.displayName="Card";const ot=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("flex flex-col space-y-1.5 p-5",n),...r}));ot.displayName="CardHeader";const ut=k.forwardRef(({className:n,...r},s)=>i.jsx("h2",{ref:s,className:Xe("text-base font-semibold leading-none tracking-tight",n),...r}));ut.displayName="CardTitle";const Tt=k.forwardRef(({className:n,...r},s)=>i.jsx("p",{ref:s,className:Xe("text-sm text-muted-foreground",n),...r}));Tt.displayName="CardDescription";const Qe=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("p-5 pt-0",n),...r}));Qe.displayName="CardContent";const Sb=k.forwardRef(({className:n,...r},s)=>i.jsx("div",{ref:s,className:Xe("flex items-center p-5 pt-0",n),...r}));Sb.displayName="CardFooter";const Re=k.forwardRef(({className:n,type:r,...s},o)=>i.jsx("input",{type:r,className:Xe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive",n),ref:o,...s}));Re.displayName="Input";const ly=k.forwardRef(({className:n,...r},s)=>i.jsx("label",{ref:s,className:Xe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...r}));ly.displayName="Label";function Oe({label:n,help:r,error:s,children:o}){const u=k.useId(),d=`${u}-help`,h=`${u}-err`,p=[r?d:null,s?h:null].filter(Boolean).join(" ")||void 0;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(ly,{htmlFor:u,children:n}),o({id:u,"aria-describedby":p,"aria-invalid":s?!0:void 0}),r&&i.jsx("p",{id:d,className:"text-xs text-muted-foreground",children:r}),s&&i.jsx("p",{id:h,role:"alert",className:"text-xs text-red-300",children:s})]})}function Cb(){var y;const[n,r]=k.useState(""),[s,o]=k.useState(""),u=Uj(),d=ta(),p=(y=On().state)==null?void 0:y.from,g=w=>{w.preventDefault(),u.mutate({username:n.trim(),password:s},{onSuccess:({user:x})=>{o(""),d(x.mustChange?"/change-password":p&&p!=="/login"?p:"/",{replace:!0})}})};let m=null;if(u.error){const w=u.error;m=w instanceof Wn&&w.code==="rate_limited"&&w.body.retryAfterSec?`Too many attempts. Try again in ${w.body.retryAfterSec} seconds.`:yt(w)}return i.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:i.jsxs(He,{className:"w-full max-w-sm",children:[i.jsxs(ot,{children:[i.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[i.jsx(Pg,{className:"h-5 w-5","aria-hidden":!0}),i.jsx("span",{className:"font-semibold",children:"SuperClawd FDA"})]}),i.jsx(ut,{children:"Sign in"}),i.jsx(Tt,{children:"Admin access for this machine."})]}),i.jsx(Qe,{children:i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[i.jsx(Oe,{label:"Username",children:w=>i.jsx(Re,{...w,value:n,onChange:x=>r(x.target.value),autoComplete:"username",autoFocus:!0,required:!0})}),i.jsx(Oe,{label:"Password",children:w=>i.jsx(Re,{...w,type:"password",value:s,onChange:x=>o(x.target.value),autoComplete:"current-password",required:!0})}),i.jsx(Go,{message:m}),i.jsx(oe,{type:"submit",className:"w-full",disabled:u.isPending||!n||!s,children:u.isPending?"Signing in":"Sign in"})]})})]})})}const To=12;function oy({currentUsername:n,onDone:r,submitLabel:s="Save"}){const[o,u]=k.useState(""),[d,h]=k.useState(""),[p,g]=k.useState(""),[m,y]=k.useState(n),[w,x]=k.useState(null),j=qj(),_=j.error instanceof Wn?j.error:null,E=S=>{if(S.preventDefault(),x(null),d.length<To)return x(`Use at least ${To} characters for the new password.`);if(d!==p)return x("The new passwords do not match.");const P=m.trim();j.mutate({currentPassword:o,newPassword:d,...P&&P!==n?{newUsername:P}:{}},{onSuccess:({user:D})=>{u(""),h(""),g(""),r==null||r(D)}})};return i.jsxs("form",{onSubmit:E,className:"max-w-md space-y-4",noValidate:!0,children:[i.jsx(Oe,{label:"Username",help:"Optional. Leave as is to keep it.",error:(_==null?void 0:_.code)==="invalid_username"?yt(_):null,children:S=>i.jsx(Re,{...S,value:m,onChange:P=>y(P.target.value),autoComplete:"username"})}),i.jsx(Oe,{label:"Current password",error:(_==null?void 0:_.code)==="invalid_credentials"?"The current password is wrong.":null,children:S=>i.jsx(Re,{...S,type:"password",value:o,onChange:P=>u(P.target.value),autoComplete:"current-password",required:!0})}),i.jsx(Oe,{label:"New password",help:`At least ${To} characters.`,error:(_==null?void 0:_.code)==="weak_password"?yt(_):null,children:S=>i.jsx(Re,{...S,type:"password",value:d,onChange:P=>h(P.target.value),autoComplete:"new-password",required:!0,minLength:To})}),i.jsx(Oe,{label:"Confirm new password",children:S=>i.jsx(Re,{...S,type:"password",value:p,onChange:P=>g(P.target.value),autoComplete:"new-password",required:!0})}),i.jsx(Go,{message:w??(j.error&&!["invalid_username","invalid_credentials","weak_password"].includes((_==null?void 0:_.code)??"")?yt(j.error):null)}),i.jsx(oe,{type:"submit",disabled:j.isPending||!o||!d,children:j.isPending?"Saving":s})]})}function Nb(){var o;const n=Yo(),r=ta(),s=((o=n.data)==null?void 0:o.mustChange)??!1;return i.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:i.jsxs(He,{className:"w-full max-w-md",children:[i.jsxs(ot,{children:[i.jsx(ut,{children:s?"Set a new password":"Change password"}),i.jsx(Tt,{children:s?"Replace the temporary password before using the panel. You can also rename the admin account.":"Update your password or username. Other sessions will be signed out."})]}),i.jsx(Qe,{children:n.data&&i.jsx(oy,{currentUsername:n.data.username,submitLabel:"Save and continue",onDone:()=>{We({title:"Password updated",variant:"success"}),r("/",{replace:!0})}})})]})})}const Eb={queued:"secondary",running:"info",awaiting_input:"warning",awaiting_approval:"warning",completed:"success",failed:"destructive",cancelled:"muted"};function hl({status:n}){return i.jsxs(tt,{variant:Eb[n],children:[n==="running"&&i.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-current","aria-hidden":!0}),sy[n]]})}function Wd(n=3e4){const[r,s]=k.useState(()=>Date.now());return k.useEffect(()=>{const o=setInterval(()=>s(Date.now()),n);return()=>clearInterval(o)},[n]),r}function rr({label:n,value:r,hint:s}){return i.jsxs("div",{children:[i.jsx("dt",{className:"text-xs text-muted-foreground",children:n}),i.jsx("dd",{className:"mt-1 text-lg font-semibold",children:r}),s&&i.jsx("dd",{className:"text-xs text-muted-foreground",children:s})]})}function Ki({label:n,children:r}){return i.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:n}),i.jsx("dd",{className:"min-w-0 truncate text-right",children:r})]})}function Rb(){const n=Hj();if(Wd(5e3),n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const r=n.data,s=i.jsx("span",{className:"text-muted-foreground",children:"Not set"});return i.jsxs("div",{className:"space-y-6",children:[i.jsx(ys,{title:"Dashboard",description:`${r.hostname}, updated every 5 seconds.`}),i.jsxs(He,{children:[i.jsxs(ot,{className:"flex-row items-center justify-between space-y-0",children:[i.jsx(ut,{children:"Health"}),i.jsx(iy,{state:r.health.state})]}),i.jsx(Qe,{children:i.jsx(xb,{conditions:r.health.conditions})})]}),r.current&&i.jsx(Bt,{to:`/requests/${encodeURIComponent(r.current.id)}`,className:"block rounded-lg border bg-card p-5 transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Working on"}),i.jsx("p",{className:"mt-1 truncate font-medium",children:r.current.title}),i.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(hl,{status:r.current.status}),r.current.startedAt&&i.jsxs("span",{children:["started ",Yt(r.current.startedAt)]})]})]}),i.jsx(Lg,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),i.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Queue"})}),i.jsxs(Qe,{children:[i.jsxs("dl",{className:"grid grid-cols-3 gap-4",children:[i.jsx(rr,{label:"Running",value:r.queue.running}),i.jsx(rr,{label:"Queued",value:r.queue.queued}),i.jsx(rr,{label:"Awaiting",value:r.queue.awaiting,hint:"input or approval"})]}),i.jsx(Bt,{to:"/requests",className:"mt-4 inline-block text-sm text-info underline-offset-4 hover:underline",children:"View requests"})]})]}),i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Today"})}),i.jsx(Qe,{children:i.jsxs("dl",{className:"grid grid-cols-3 gap-4",children:[i.jsx(rr,{label:"Requests",value:r.today.requests}),i.jsx(rr,{label:"Turns",value:r.today.turns}),i.jsx(rr,{label:"Cost",value:fl(r.today.costUsd)})]})})]}),i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Agent and workspace"})}),i.jsx(Qe,{children:i.jsxs("dl",{className:"divide-y",children:[i.jsx(Ki,{label:"Primary agent",children:r.agent.name??i.jsx(Bt,{to:"/settings/agent",className:"text-info underline",children:"Choose an agent"})}),i.jsx(Ki,{label:"Workspace",children:r.workspace.slug??s}),i.jsx(Ki,{label:"Machine ID",children:r.machineId?i.jsx("code",{className:"text-xs",children:r.machineId}):s})]})})]}),i.jsxs(He,{children:[i.jsxs(ot,{className:"flex-row items-center justify-between space-y-0",children:[i.jsx(ut,{children:"Slack"}),r.slack.connected?i.jsx(tt,{variant:"success",children:"Connected"}):i.jsx(tt,{variant:"destructive",children:"Disconnected"})]}),i.jsxs(Qe,{children:[i.jsxs("dl",{className:"divide-y",children:[i.jsx(Ki,{label:"Bot name",children:r.slack.botName??s}),i.jsx(Ki,{label:"Team ID",children:r.slack.teamId?i.jsx("code",{className:"text-xs",children:r.slack.teamId}):s})]}),!r.slack.connected&&i.jsx(Bt,{to:"/settings/slack",className:"mt-3 inline-block text-sm text-info underline-offset-4 hover:underline",children:"Check Slack settings"})]})]}),i.jsxs(He,{className:"md:col-span-2",children:[i.jsx(ot,{children:i.jsx(ut,{children:"Machine"})}),i.jsx(Qe,{children:i.jsxs("dl",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[i.jsx(rr,{label:"Version",value:r.version}),i.jsx(rr,{label:"Uptime",value:vb(r.uptimeSec)}),i.jsx(rr,{label:"Free disk",value:r.disk.freeGb===null?"n/a":`${r.disk.freeGb.toFixed(1)} GB`}),i.jsx(rr,{label:"Host",value:i.jsx("span",{className:"break-all text-sm",children:r.hostname})})]})})]})]})]})}const eu=k.forwardRef(({className:n,...r},s)=>i.jsx("select",{className:Xe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:s,...r}));eu.displayName="Select";function uy({page:n,pageSize:r,total:s,onPage:o,pageSizes:u,onPageSize:d}){const h=Math.max(1,Math.ceil(s/r)),p=s===0?0:(n-1)*r+1,g=Math.min(s,n*r);return i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground",children:[i.jsxs("span",{children:[p," to ",g," of ",s]}),i.jsxs("div",{className:"flex items-center gap-2",children:[u&&d&&i.jsxs("label",{className:"flex items-center gap-2",children:[i.jsx("span",{children:"Rows"}),i.jsx(eu,{className:"h-8 w-20",value:r,onChange:m=>d(Number(m.target.value)),children:u.map(m=>i.jsx("option",{value:m,children:m},m))})]}),i.jsx(oe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:n<=1,onClick:()=>o(n-1),"aria-label":"Previous page",children:i.jsx(Nk,{})}),i.jsxs("span",{children:["Page ",n," of ",h]}),i.jsx(oe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:n>=h,onClick:()=>o(n+1),"aria-label":"Next page",children:i.jsx(_g,{})})]})]})}function Kd({open:n,onClose:r,title:s,description:o,children:u,footer:d,className:h}){const p=k.useRef(null),g=k.useId(),m=k.useId();return k.useEffect(()=>{const y=p.current;y&&(n&&!y.open&&y.showModal(),!n&&y.open&&y.close())},[n]),i.jsx("dialog",{ref:p,"aria-labelledby":g,"aria-describedby":o?m:void 0,onCancel:y=>{y.preventDefault(),r()},onClick:y=>{y.target===p.current&&r()},className:Xe("w-full max-w-lg rounded-lg border bg-card p-0 text-card-foreground shadow-xl backdrop:bg-black/60",h),children:n&&i.jsxs("div",{className:"flex max-h-[85vh] flex-col",children:[i.jsxs("div",{className:"flex items-start justify-between gap-4 border-b p-5",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h2",{id:g,className:"text-base font-semibold",children:s}),o&&i.jsx("p",{id:m,className:"text-sm text-muted-foreground",children:o})]}),i.jsx("button",{type:"button",onClick:r,"aria-label":"Close",className:"rounded-sm opacity-70 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Bd,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:u}),d&&i.jsx("div",{className:"flex justify-end gap-2 border-t p-4",children:d})]})})}function Gd({open:n,title:r,description:s,confirmLabel:o,destructive:u,pending:d,onConfirm:h,onClose:p}){return i.jsx(Kd,{open:n,onClose:p,title:r,footer:i.jsxs(i.Fragment,{children:[i.jsx(oe,{variant:"outline",onClick:p,children:"Keep it"}),i.jsx(oe,{variant:u?"destructive":"default",onClick:h,disabled:d,children:o})]}),children:i.jsx("p",{className:"text-sm text-muted-foreground",children:s})})}const cy=["queued","running","awaiting_input","awaiting_approval","completed","failed","cancelled"],Pb=["queued","running","awaiting_input","awaiting_approval"],Tb=["failed","cancelled"],Lb=["completed","failed","cancelled"];function dy({request:n,compact:r,showView:s}){const[o,u]=k.useState(!1),d=Wj(),h=Kj(),p=rl(n.permalink),g=r?"icon":"sm",m=r?"ghost":"outline",y=r?"h-8 w-8":void 0;return i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[p&&i.jsxs("a",{href:p,target:"_blank",rel:"noreferrer noopener",title:"Open in Slack","aria-label":r?`Open "${n.title}" in Slack`:void 0,className:`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${r?"h-8 w-8":"h-9 border border-input px-3"}`,children:[i.jsx(Dk,{className:"h-4 w-4","aria-hidden":!0}),!r&&"Open in Slack"]}),s&&i.jsx(Bt,{to:`/requests/${encodeURIComponent(n.id)}`,title:"View","aria-label":`View "${n.title}"`,className:"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Fk,{className:"h-4 w-4","aria-hidden":!0})}),Pb.includes(n.status)&&i.jsxs(oe,{variant:m,size:g,className:y,title:"Cancel","aria-label":r?`Cancel "${n.title}"`:void 0,onClick:()=>u(!0),children:[i.jsx(md,{}),!r&&"Cancel"]}),Tb.includes(n.status)&&i.jsxs(oe,{variant:m,size:g,className:y,title:"Retry","aria-label":r?`Retry "${n.title}"`:void 0,disabled:h.isPending,onClick:()=>h.mutate(n.id,{onSuccess:()=>We({title:"Request queued again",variant:"success"})}),children:[i.jsx(x1,{}),!r&&"Retry"]}),i.jsx(Gd,{open:o,title:"Cancel this request?",description:`"${n.title}" will stop. Any running turn is interrupted.`,confirmLabel:"Cancel request",destructive:!0,pending:d.isPending,onClose:()=>u(!1),onConfirm:()=>d.mutate(n.id,{onSuccess:()=>We({title:"Request cancelled",variant:"success"}),onSettled:()=>u(!1)})})]})}const fy=[25,50,100];function Mb(n){const r=(n.get("status")??"").split(",").filter(o=>cy.includes(o)),s=Number(n.get("pageSize"));return{status:r,q:n.get("q")??"",page:Math.max(1,Number(n.get("page"))||1),pageSize:fy.includes(s)?s:25,sort:n.get("sort")==="recent"?"recent":"active"}}function _b(){const[n,r]=qd(),s=Mb(n),o=Qj(s),u=Wd(),[d,h]=k.useState(s.q),p=(y,w=!0)=>{r(x=>{const j=new URLSearchParams(x);for(const[_,E]of Object.entries(y))E===null||E===""?j.delete(_):j.set(_,E);return w&&!("page"in y)&&j.delete("page"),j},{replace:!0})};k.useEffect(()=>{if(d===s.q)return;const y=setTimeout(()=>p({q:d.trim()||null}),300);return()=>clearTimeout(y)},[d]);const g=y=>{const w=new Set(s.status);w.has(y)?w.delete(y):w.add(y),p({status:[...w].join(",")||null})},m=y=>Xe("rounded-full border px-3 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground");return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Requests",description:"Everything FDA has been asked to do."}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsxs("div",{className:"relative w-full max-w-xs",children:[i.jsx(E1,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),i.jsx(Re,{type:"search","aria-label":"Search requests",placeholder:"Search title and messages",className:"pl-9",value:d,onChange:y=>h(y.target.value)})]}),i.jsx("div",{role:"group","aria-label":"Sort",className:"inline-flex rounded-md border p-0.5",children:["active","recent"].map(y=>i.jsx(oe,{size:"xs",variant:s.sort===y?"secondary":"ghost","aria-pressed":s.sort===y,onClick:()=>p({sort:y==="active"?null:y}),children:y==="active"?"Active first":"Most recent"},y))})]}),i.jsxs("div",{role:"group","aria-label":"Filter by status",className:"flex flex-wrap gap-2",children:[i.jsx("button",{type:"button",className:m(s.status.length===0),"aria-pressed":s.status.length===0,onClick:()=>p({status:null}),children:"All"}),cy.map(y=>i.jsx("button",{type:"button",className:m(s.status.includes(y)),"aria-pressed":s.status.includes(y),onClick:()=>g(y),children:sy[y]},y))]}),o.isLoading?i.jsx(kt,{}):o.isError?i.jsx(Ot,{error:o.error,onRetry:()=>void o.refetch()}):!o.data||o.data.items.length===0?i.jsx(rn,{children:s.status.length||s.q?"No requests match these filters.":"No requests yet. Mention the bot in an allowed Slack channel to start one."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Xe("overflow-x-auto rounded-lg border",o.isPlaceholderData&&"opacity-60"),children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Request"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Requester"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Channel"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Activity"}),i.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Cost"}),i.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:i.jsx("span",{className:"sr-only",children:"Actions"})})]})}),i.jsx("tbody",{className:"divide-y",children:o.data.items.map(y=>i.jsxs("tr",{className:"hover:bg-accent/30",children:[i.jsxs("td",{className:"max-w-xs px-3 py-2",children:[i.jsx(Bt,{to:`/requests/${encodeURIComponent(y.id)}`,className:"block truncate font-medium hover:underline",title:y.title,children:y.title}),y.prs.length>0&&i.jsx("span",{className:"text-xs text-muted-foreground",children:y.prs.length===1?"1 PR":`${y.prs.length} PRs`})]}),i.jsx("td",{className:"px-3 py-2",children:i.jsx(hl,{status:y.status})}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:y.requesterName??y.requesterId}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:y.channelName?`#${y.channelName}`:y.channelId}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-muted-foreground",title:mn(y.lastActivityAt),children:Yt(y.lastActivityAt,u)}),i.jsx("td",{className:"px-3 py-2 text-right tabular-nums text-muted-foreground",children:fl(y.costUsd)}),i.jsx("td",{className:"px-3 py-2",children:i.jsx(dy,{request:y,compact:!0,showView:!0})})]},y.id))})]})}),i.jsx(uy,{page:s.page,pageSize:s.pageSize,total:o.data.total,onPage:y=>p({page:y===1?null:String(y)},!1),pageSizes:fy,onPageSize:y=>p({pageSize:y===25?null:String(y)})})]})]})}function hy({items:n,value:r,onChange:s,label:o,idPrefix:u}){const d=k.useRef([]),h=(p,g)=>{var y;let m=-1;p.key==="ArrowRight"&&(m=(g+1)%n.length),p.key==="ArrowLeft"&&(m=(g-1+n.length)%n.length),p.key==="Home"&&(m=0),p.key==="End"&&(m=n.length-1),m>=0&&(p.preventDefault(),s(n[m].value),(y=d.current[m])==null||y.focus())};return i.jsx("div",{role:"tablist","aria-label":o,className:"flex flex-wrap gap-1 border-b",children:n.map((p,g)=>{const m=p.value===r;return i.jsx("button",{ref:y=>{d.current[g]=y},type:"button",role:"tab",id:`${u}-tab-${p.value}`,"aria-selected":m,"aria-controls":`${u}-panel-${p.value}`,tabIndex:m?0:-1,onClick:()=>s(p.value),onKeyDown:y=>h(y,g),className:Xe("-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m?"border-primary font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:p.label},p.value)})})}function py({idPrefix:n,value:r,children:s,className:o}){return i.jsx("div",{role:"tabpanel",id:`${n}-panel-${r}`,"aria-labelledby":`${n}-tab-${r}`,tabIndex:0,className:Xe("pt-4 focus-visible:outline-none",o),children:s})}const Kc=/^\s*([-*+]|\d+[.)])\s+(.*)$/;function Ab(n){const r=n.replace(/\r\n?/g,`
|
|
308
308
|
`).split(`
|
|
309
309
|
`),s=[];let o=0;for(;o<r.length;){const u=r[o];if(!u.trim()){o++;continue}const d=u.match(/^\s*(```|~~~)\s*([\w+-]*)/);if(d){const m=[];for(o++;o<r.length&&!r[o].trim().startsWith(d[1]);)m.push(r[o++]);o++,s.push({type:"code",lang:d[2],text:m.join(`
|
|
310
310
|
`)});continue}const h=u.match(/^(#{1,6})\s+(.*)$/);if(h){s.push({type:"heading",level:h[1].length,text:h[2].replace(/\s#+\s*$/,"")}),o++;continue}if(/^\s*([-*_])(\s*\1){2,}\s*$/.test(u)){s.push({type:"hr"}),o++;continue}if(/^\s*>/.test(u)){const m=[];for(;o<r.length&&/^\s*>/.test(r[o]);)m.push(r[o++].replace(/^\s*>\s?/,""));s.push({type:"quote",text:m.join(`
|
|
311
|
-
`)});continue}const p=u.match(Kc);if(p){const m=/\d/.test(p[1]),y=[];for(;o<r.length;){const w=r[o].match(Kc);if(w&&/\d/.test(w[1])===m)y.push(w[2]),o++;else if(r[o].trim()&&/^\s{2,}/.test(r[o])&&y.length)y[y.length-1]+=" "+r[o].trim(),o++;else break}s.push({type:"list",ordered:m,items:y});continue}const g=[];for(;o<r.length&&r[o].trim()&&!/^(#{1,6})\s/.test(r[o])&&!/^\s*(```|~~~|>)/.test(r[o])&&!Kc.test(r[o]);)g.push(r[o++].trim());s.push({type:"para",text:g.join(" ")})}return s}const Db=/(`[^`]{1,500}`)|(\*\*[^*]{1,500}\*\*|__[^_]{1,500}__)|(\*[^*\s][^*]{0,500}\*|_[^_\s][^_]{0,500}_)|(\[[^\]]{1,300}\]\([^)\s]{1,2000}\))|(https?:\/\/[^\s<)]{1,2000})/,Sm=2e4;function Ys(n,r="i"){const s=[];let o=n.length>Sm?`${n.slice(0,Sm)}…`:n,u=0;for(;o;){const d=o.match(Db);if(!d||d.index===void 0){s.push(o);break}d.index>0&&s.push(o.slice(0,d.index));const h=d[0],p=`${r}-${u++}`;if(d[1])s.push(i.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:h.slice(1,-1)},p));else if(d[2])s.push(i.jsx("strong",{children:Ys(h.slice(2,-2),p)},p));else if(d[3])s.push(i.jsx("em",{children:Ys(h.slice(1,-1),p)},p));else if(d[4]){const g=h.match(/^\[([^\]]{1,300})\]\(([^)\s]{1,2000})\)$/),m=nl(g==null?void 0:g[2]);s.push(m?i.jsx("a",{href:m,target:"_blank",rel:"noreferrer noopener",className:"text-info underline",children:g==null?void 0:g[1]},p):i.jsx("span",{children:g==null?void 0:g[1]},p))}else if(d[5]){const g=nl(h);s.push(g?i.jsx("a",{href:g,target:"_blank",rel:"noreferrer noopener",className:"break-all text-info underline",children:h},p):h)}o=o.slice(d.index+h.length)}return s}function Ob(n,r){const s=n.match(/^\[([ xX])\]\s+(.*)$/);return s?i.jsxs("li",{className:"list-none",children:[i.jsx("span",{"aria-hidden":!0,className:"mr-1.5 font-mono text-muted-foreground",children:s[1]===" "?"[ ]":"[x]"}),Ys(s[2],r)]},r):i.jsx("li",{children:Ys(n,r)},r)}const Fb=["text-lg","text-base","text-sm","text-sm","text-sm","text-sm"];function Cm({source:n}){const r=Ab(n);return i.jsx("div",{className:"space-y-3 text-sm leading-relaxed",children:r.map((s,o)=>{const u=`b${o}`;switch(s.type){case"heading":{const d=`h${Math.min(s.level+2,6)}`;return i.jsx(d,{className:`${Fb[s.level-1]} mt-4 font-semibold first:mt-0`,children:Ys(s.text,u)},u)}case"para":return i.jsx("p",{children:Ys(s.text,u)},u);case"code":return i.jsx("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs",children:i.jsx("code",{children:s.text})},u);case"quote":return i.jsx("blockquote",{className:"border-l-2 pl-3 text-muted-foreground",children:Ys(s.text,u)},u);case"list":{const d=s.ordered?"ol":"ul";return i.jsx(d,{className:`${s.ordered?"list-decimal":"list-disc"} space-y-1 pl-5`,children:s.items.map((h,p)=>Ob(h,`${u}-${p}`))},u)}case"hr":return i.jsx("hr",{},u)}return null})})}const Nm=300;function Ib(n,r){const s=Ct(),[o,u]=k.useState([]),[d,h]=k.useState(null),[p,g]=k.useState("closed"),m=k.useRef(null);return k.useEffect(()=>{if(!r)return;g("connecting");const y=new EventSource(`/api/requests/${encodeURIComponent(n)}/stream`);return y.onopen=()=>g("open"),y.onerror=()=>g(y.readyState===EventSource.CLOSED?"closed":"connecting"),y.addEventListener("snapshot",w=>{let x;try{x=JSON.parse(w.data)}catch{return}const j=m.current;m.current=x,h(x),j&&(j.status!==x.status||j.planStatus!==x.planStatus||j.lastActivityAt!==x.lastActivityAt)&&(s.invalidateQueries({queryKey:Be.request(n)}),j.status!==x.status&&(s.invalidateQueries({queryKey:["requests","list"]}),s.invalidateQueries({queryKey:Be.dashboard})))}),y.addEventListener("activity",w=>{try{const x=JSON.parse(w.data);u(j=>j.length>=Nm?[...j.slice(-Nm+1),x]:[...j,x])}catch{}}),()=>{y.close(),g("closed")}},[n,r,s]),{activity:o,snapshot:d,state:p}}const zb=["live","conversation","turns","plans","artifacts","events"];function Ub(){var j;const{id:n=""}=uw(),r=Vj(n),[s,o]=qd();Wd();const u=(j=r.data)==null?void 0:j.request.status,d=u?!Lb.includes(u):!1,h=Ib(n,d),p=s.get("tab"),g=p&&zb.includes(p)&&(p!=="live"||d)?p:d?"live":"conversation",m=T=>o(N=>{const S=new URLSearchParams(N);return S.set("tab",T),S},{replace:!0});if(r.isLoading)return i.jsx(kt,{});if(r.isError||!r.data)return r.error instanceof Wn&&r.error.code==="not_found"?i.jsxs("div",{className:"space-y-4",children:[i.jsx(Em,{}),i.jsx(rn,{children:"This request does not exist."})]}):i.jsx(Ot,{error:r.error,onRetry:()=>void r.refetch()});const y=r.data,w=y.request,x=[...d?[{value:"live",label:i.jsx($b,{state:h.state})}]:[],{value:"conversation",label:`Conversation (${y.messages.length})`},{value:"turns",label:`Turns (${y.turns.length})`},{value:"plans",label:`Plans (${y.plans.length})`},{value:"artifacts",label:`Artifacts (${y.artifacts.length})`},{value:"events",label:"Events"}];return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Em,{}),i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0 space-y-2",children:[i.jsx("h1",{className:"break-words text-xl font-semibold",children:w.title}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(fl,{status:w.status}),w.planStatus!=="none"&&i.jsxs(tt,{variant:"outline",children:["Plan ",w.planStatus]}),i.jsxs("span",{children:["by ",w.requesterName??w.requesterId]}),i.jsxs("span",{children:["in ",w.channelName?`#${w.channelName}`:w.channelId]}),i.jsxs("span",{title:mn(w.createdAt),children:["opened ",Yt(w.createdAt)]}),i.jsxs("span",{children:["cost ",dl(w.costUsd)]})]})]}),i.jsx(dy,{request:w})]}),i.jsx(He,{children:i.jsxs(Qe,{className:"grid gap-x-8 gap-y-2 p-5 text-sm sm:grid-cols-2",children:[i.jsx(To,{label:"Branch",children:w.branch?i.jsx("code",{className:"text-xs",children:w.branch}):"None"}),i.jsx(To,{label:"Working directory",children:i.jsx("code",{className:"break-all text-xs",children:w.cwd||w.workdir})}),i.jsx(To,{label:"Last activity",children:i.jsx("span",{title:mn(w.lastActivityAt),children:Yt(w.lastActivityAt)})}),i.jsx(To,{label:"Pull requests",children:w.prs.length===0?"None":w.prs.map(T=>{const N=nl(T),S=y.prFollows.find(L=>L.url===T);return i.jsxs("span",{className:"mr-3 inline-block",children:[N?i.jsx("a",{href:N,target:"_blank",rel:"noreferrer noopener",className:"break-all text-info underline",children:my(T)}):T,S&&i.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",title:S.statusReason??S.lastError??void 0,children:["(",Zb(S),")"]})]},T)})}),w.pendingQuestion&&i.jsxs("div",{className:"rounded-md border border-warning/40 bg-warning-muted p-3 sm:col-span-2",children:[i.jsx("p",{className:"text-xs font-medium text-amber-300",children:"Waiting for an answer in Slack"}),i.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words",children:w.pendingQuestion})]})]})}),i.jsxs("div",{children:[i.jsx(hy,{idPrefix:"req",label:"Request details",items:x,value:g,onChange:m}),i.jsxs(py,{idPrefix:"req",value:g,children:[g==="live"&&i.jsx(qb,{activity:h.activity,state:h.state}),g==="conversation"&&i.jsx(Qb,{messages:y.messages}),g==="turns"&&i.jsx(Wb,{turns:y.turns}),g==="plans"&&i.jsx(Kb,{plans:y.plans}),g==="artifacts"&&i.jsx(Yb,{artifacts:y.artifacts,requestId:w.id}),g==="events"&&i.jsx(Xb,{events:y.events})]})]})]})}function Em(){return i.jsxs(Bt,{to:"/requests",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[i.jsx(Tg,{className:"h-4 w-4","aria-hidden":!0}),"Requests"]})}function To({label:n,children:r}){return i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"w-36 shrink-0 text-muted-foreground",children:n}),i.jsx("span",{className:"min-w-0",children:r})]})}function my(n){const r=n.match(/github\.com\/([^/]+\/[^/]+)\/pull\/(\d+)/);return r?`${r[1]}#${r[2]}`:n}function $b({state:n}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":!0,className:Xe("h-2 w-2 rounded-full",n==="open"?"animate-pulse bg-success":n==="connecting"?"bg-warning":"bg-muted-foreground")}),"Live"]})}function qb({activity:n,state:r}){const s=k.useRef(null),[o,u]=k.useState(!0);return k.useEffect(()=>{o&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[n,o]),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:r==="open"?"Connected. Showing live agent activity.":r==="connecting"?"Connecting":"Disconnected"}),i.jsxs("label",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",checked:o,onChange:d=>u(d.target.checked),className:"accent-current"}),"Follow"]})]}),i.jsx("div",{ref:s,className:"h-96 overflow-y-auto rounded-md border bg-black/40 p-3 font-mono text-xs","aria-live":"off",children:n.length===0?i.jsx("p",{className:"text-muted-foreground",children:"No activity yet. It appears here while a turn runs."}):n.map((d,h)=>i.jsxs("div",{className:"flex gap-3 py-0.5",children:[i.jsx("span",{className:"shrink-0 text-muted-foreground",children:new Date(d.ts).toLocaleTimeString()}),i.jsx("span",{className:Xe("shrink-0 w-10",d.kind==="tool"?"text-info":"text-success"),children:d.kind}),i.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words",children:d.text})]},h))})]})}const Bb={mention:"Mention",follow_up:"Follow-up",prior_context:"Prior context",unlisted:"Unlisted user",synthetic:"System",command:"Command"},Hb=["prior_context","unlisted"];function Qb({messages:n}){return n.length?i.jsx("ol",{className:"space-y-3",children:n.map(r=>{const s=Hb.includes(r.source);return i.jsxs("li",{className:Xe("rounded-md border p-3",s&&"border-dashed border-warning/50 bg-warning-muted/40"),children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"font-medium text-foreground",children:r.authorName??r.authorId??"System"}),i.jsxs(tt,{variant:s?"warning":"outline",children:[s&&i.jsx(L1,{className:"h-3 w-3","aria-hidden":!0}),Bb[r.source]]}),i.jsx(tt,{variant:r.state==="delivered"?"secondary":r.state==="pending"?"info":"muted",children:r.state}),i.jsx("span",{className:"ml-auto",title:mn(r.receivedAt),children:Yt(r.receivedAt)})]}),s&&i.jsx("p",{className:"mt-1 text-xs text-amber-300",children:"Untrusted: shown to the agent as context only, not as instructions."}),i.jsx("p",{className:"mt-2 whitespace-pre-wrap break-words text-sm",children:r.text})]},r.id)})}):i.jsx(rn,{children:"No messages."})}const Vb={answered:"success",asked:"warning",planned:"info",error:"destructive",cancelled:"muted",timeout:"destructive"};function wd({label:n,children:r,defaultOpen:s}){return i.jsxs("details",{className:"group mt-2",open:s,children:[i.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[i.jsx(_g,{className:"h-3 w-3 transition-transform group-open:rotate-90","aria-hidden":!0}),n]}),i.jsx("div",{className:"mt-2",children:r})]})}function Wb({turns:n}){return n.length?i.jsx("ol",{className:"space-y-3",children:n.map(r=>i.jsxs("li",{className:"rounded-md border p-3 text-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"font-medium",children:["Turn ",r.seq]}),r.mode==="plan"&&i.jsx(tt,{variant:"outline",children:"Plan mode"}),r.outcome?i.jsx(tt,{variant:Vb[r.outcome],children:r.outcome}):i.jsx(tt,{variant:"secondary",children:r.status}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["trigger: ",r.trigger]}),i.jsx("span",{className:"ml-auto text-xs text-muted-foreground",title:mn(r.startedAt),children:r.startedAt?Yt(r.startedAt):"not started"})]}),i.jsxs("dl",{className:"mt-2 flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted-foreground",children:[i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Duration "}),i.jsx("dd",{className:"inline text-foreground",children:yb(r.durationMs)})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Tokens "}),i.jsxs("dd",{className:"inline text-foreground",children:[jm(r.inputTokens)," in, ",jm(r.outputTokens)," out"]})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Cost "}),i.jsx("dd",{className:"inline text-foreground",children:dl(r.costUsd)})]}),r.stopReason&&i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Stop reason "}),i.jsx("dd",{className:"inline text-foreground",children:r.stopReason})]})]}),r.errorText&&i.jsx(wd,{label:"Error",defaultOpen:!0,children:i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words rounded bg-destructive-muted p-2 text-xs text-red-200",children:r.errorText})}),r.resultText&&i.jsx(wd,{label:"Result",children:i.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 text-xs",children:r.resultText})})]},r.id))}):i.jsx(rn,{children:"No turns yet."})}function Kb({plans:n}){if(!n.length)return i.jsx(rn,{children:"No plans for this request."});const r=[...n].sort((s,o)=>o.version-s.version);return i.jsx("div",{className:"space-y-4",children:r.map((s,o)=>i.jsx(He,{children:i.jsxs(Qe,{className:"p-5",children:[i.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Version ",s.version]}),i.jsx(tt,{variant:s.status==="approved"?"success":s.status==="rejected"?"destructive":"warning",children:s.status}),s.decidedBy&&i.jsxs("span",{children:["by ",s.decidedBy," ",s.decidedAt?Yt(s.decidedAt):""]}),i.jsx("span",{className:"ml-auto",children:mn(s.createdAt)})]}),s.feedback&&i.jsxs("div",{className:"mb-3 rounded-md border bg-muted/40 p-3 text-sm",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Feedback"}),i.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words",children:s.feedback})]}),o===0?i.jsx(Cm,{source:s.markdown}):i.jsx(wd,{label:"Show plan",children:i.jsx(Cm,{source:s.markdown})})]})},s.version))})}function Gb({requestId:n}){var u;const s=((u=Rt({queryKey:["screenshots",n],queryFn:()=>Ee(`/api/requests/${encodeURIComponent(n)}/screenshots`),refetchInterval:15e3}).data)==null?void 0:u.items)??[];if(!s.length)return null;const o=d=>`/api/requests/${encodeURIComponent(n)}/screenshots/${d.split("/").map(encodeURIComponent).join("/")}`;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h3",{className:"text-sm font-medium",children:["Screenshots (",s.length,")"]}),i.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3",children:s.map(d=>i.jsxs("a",{href:o(d.name),target:"_blank",rel:"noreferrer noopener",className:"group overflow-hidden rounded-md border",children:[i.jsx("img",{src:o(d.name),alt:d.name,loading:"lazy",className:"aspect-video w-full bg-muted object-cover object-top"}),i.jsxs("div",{className:"flex justify-between gap-2 px-2 py-1 text-xs text-muted-foreground",children:[i.jsx("span",{className:"truncate",children:d.name}),i.jsx("span",{className:"shrink-0",children:Yt(d.mtime)})]})]},d.name))})]})}function Yb({artifacts:n,requestId:r}){return i.jsxs("div",{className:"space-y-4",children:[i.jsx(Gb,{requestId:r}),i.jsx(Jb,{artifacts:n})]})}function Jb({artifacts:n}){return n.length?i.jsx("ul",{className:"divide-y rounded-md border",children:n.map(r=>{const s=r.kind==="pr"?Wk:r.kind==="screenshot"?Xk:zk,o=nl(r.urlOrPath);return i.jsxs("li",{className:"flex items-center gap-3 p-3 text-sm",children:[i.jsx(s,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsxs("div",{className:"min-w-0 flex-1",children:[r.title&&i.jsx("p",{className:"truncate font-medium",children:r.title}),o?i.jsx("a",{href:o,target:"_blank",rel:"noreferrer noopener",className:"break-all text-xs text-info underline",children:r.kind==="pr"?my(r.urlOrPath):r.urlOrPath}):i.jsx("code",{className:"break-all text-xs text-muted-foreground",children:r.urlOrPath})]}),i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Yt(r.createdAt)})]},r.id)})}):i.jsx(rn,{children:"No artifacts yet."})}function Xb({events:n}){return n.length?i.jsx("div",{className:"overflow-x-auto rounded-md border",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Time"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Type"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Summary"})]})}),i.jsx("tbody",{className:"divide-y",children:n.map(r=>i.jsxs("tr",{children:[i.jsx("td",{className:"whitespace-nowrap px-3 py-1.5 text-xs text-muted-foreground",children:mn(r.ts)}),i.jsx("td",{className:"whitespace-nowrap px-3 py-1.5",children:i.jsx("code",{className:"text-xs",children:r.type})}),i.jsx("td",{className:"px-3 py-1.5 break-words",children:r.summary})]},r.id))})]})}):i.jsx(rn,{children:"No events."})}function Zb(n){const r=n.status==="active"?"following":n.status==="gave_up"?"left for a human":n.status==="paused"?"not following":n.status,s=n.status==="active"&&n.ci&&n.ci!=="none"?`, CI ${n.ci}`:"",o=n.status==="active"&&n.mergeable==="CONFLICTING"?", conflicts":"";return r+s+o}const Rm=50;function eS(){const[n,r]=qd(),s=Math.max(1,Number(n.get("page"))||1),o=ob(s,Rm);return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Audit log",description:"Admin sign-ins and configuration changes on this machine."}),o.isLoading?i.jsx(kt,{}):o.isError||!o.data?i.jsx(Ot,{error:o.error,onRetry:()=>void o.refetch()}):o.data.items.length===0?i.jsx(rn,{children:"No audit entries yet."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Xe("overflow-x-auto rounded-lg border",o.isPlaceholderData&&"opacity-60"),children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Time"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Actor"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Action"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Detail"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"IP"})]})}),i.jsx("tbody",{className:"divide-y",children:o.data.items.map(u=>i.jsxs("tr",{children:[i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-muted-foreground",children:mn(u.ts)}),i.jsx("td",{className:"px-3 py-2",children:u.actor}),i.jsx("td",{className:"px-3 py-2",children:i.jsx("code",{className:"text-xs",children:u.action})}),i.jsx("td",{className:"max-w-md break-words px-3 py-2 text-muted-foreground",children:u.detail??""}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-xs text-muted-foreground",children:u.ip??""})]},u.id))})]})}),i.jsx(uy,{page:s,pageSize:Rm,total:o.data.total,onPage:u=>r(u===1?{}:{page:String(u)},{replace:!0})})]})]})}const ps=k.forwardRef(({checked:n,onCheckedChange:r,className:s,...o},u)=>i.jsx("button",{ref:u,type:"button",role:"switch","aria-checked":n,onClick:()=>r(!n),className:Xe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",n?"bg-primary":"bg-input",s),...o,children:i.jsx("span",{className:Xe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",n?"translate-x-5":"translate-x-0")})}));ps.displayName="Switch";const Pm={pending:{label:"Waiting for confirmation",variant:"warning"},active:{label:"Active",variant:"success"},paused:{label:"Paused",variant:"muted"}};function tS(){const n=ub(),r=ry(),s=fb(),o=db(),[u,d]=k.useState(null),[h,p]=k.useState(null),g=(m,y)=>r.mutate({id:m.id,patch:{status:y?"active":"paused"}},{onError:w=>We({title:"Couldn't change the schedule",description:yt(w),variant:"error"})});return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Schedules",description:"Recurring tasks and one-time reminders people set up in Slack (for example daily insights in a channel). Each run posts its result in the channel; replies in its thread continue the conversation. A one-time task leaves this list after it runs."}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):n.data.length===0?i.jsx(rn,{children:`No schedules yet. Ask the agent in Slack, e.g. "send a summary of yesterday's sales every weekday at 9:00 in this channel".`}):i.jsx("div",{className:"overflow-x-auto rounded-lg border",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Schedule"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"When"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Channel"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Next run"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last run"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"On"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:i.jsx("span",{className:"sr-only",children:"Actions"})})]})}),i.jsx("tbody",{className:"divide-y",children:n.data.map(m=>i.jsxs("tr",{className:"align-top",children:[i.jsxs("td",{className:"px-3 py-2",children:[i.jsx("button",{type:"button",className:"text-left font-medium hover:underline",onClick:()=>d(m),children:m.title}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(tt,{variant:Pm[m.status].variant,children:Pm[m.status].label}),i.jsxs("span",{children:["by ",m.createdByName??m.createdBy]})]}),m.statusReason&&i.jsx("div",{className:"mt-1 text-xs text-amber-300",children:m.statusReason})]}),i.jsxs("td",{className:"whitespace-nowrap px-3 py-2",children:[m.when,i.jsx("div",{className:"text-xs text-muted-foreground",children:m.timezone})]}),i.jsxs("td",{className:"whitespace-nowrap px-3 py-2",children:["#",m.channelName??m.channelId]}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-muted-foreground",children:m.nextRunAt?i.jsx("span",{title:mn(m.nextRunAt),children:Yt(m.nextRunAt)}):"—"}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2",children:m.lastRunAt?i.jsxs("div",{className:"flex items-center gap-2",children:[m.lastRunStatus==="missed"?i.jsx(tt,{variant:"muted",children:"Missed"}):m.lastRunStatus?i.jsx(fl,{status:m.lastRunStatus}):null,m.lastRequestId?i.jsx(Bt,{to:`/requests/${m.lastRequestId}`,className:"text-xs text-muted-foreground hover:underline",children:Yt(m.lastRunAt)}):i.jsx("span",{className:"text-xs text-muted-foreground",children:Yt(m.lastRunAt)})]}):i.jsx("span",{className:"text-muted-foreground",children:"Never"})}),i.jsx("td",{className:"px-3 py-2",children:i.jsx(ps,{checked:m.status==="active",disabled:m.status==="pending"||r.isPending,"aria-label":m.status==="active"?`Pause ${m.title}`:`Resume ${m.title}`,onCheckedChange:y=>g(m,y)})}),i.jsxs("td",{className:"whitespace-nowrap px-3 py-2 text-right",children:[i.jsxs(oe,{variant:"ghost",size:"sm",disabled:m.status==="pending"||s.isPending,onClick:()=>s.mutate(m.id,{onSuccess:()=>We({title:"Run started",description:`#${m.channelName??m.channelId}`,variant:"success"}),onError:y=>We({title:"Couldn't start the run",description:yt(y),variant:"error"})}),children:[i.jsx(p1,{className:"h-4 w-4","aria-hidden":!0})," Run now"]}),i.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>d(m),"aria-label":`Edit ${m.title}`,children:i.jsx(f1,{className:"h-4 w-4","aria-hidden":!0})}),i.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>p(m),"aria-label":`Delete ${m.title}`,children:i.jsx(qo,{className:"h-4 w-4","aria-hidden":!0})})]})]},m.id))})]})}),u&&i.jsx(nS,{schedule:u,onClose:()=>d(null)}),i.jsx(Gd,{open:!!h,title:"Delete this schedule?",description:h?`"${h.title}" stops running. Past runs stay in Requests.`:"",confirmLabel:"Delete",destructive:!0,pending:o.isPending,onClose:()=>p(null),onConfirm:()=>h&&o.mutate(h.id,{onSuccess:()=>p(null),onError:m=>We({title:"Couldn't delete",description:yt(m),variant:"error"})})})]})}function nS({schedule:n,onClose:r}){var N;const s=cb(n.id),o=ry(),[u,d]=k.useState(n.title),[h,p]=k.useState(n.prompt),[g,m]=k.useState(n.cron),[y,w]=k.useState(n.timezone),[x,j]=k.useState(null),T=()=>{j(null);const S={...u!==n.title&&{title:u},...h!==n.prompt&&{prompt:h},...g!==n.cron&&{cron:g},...y!==n.timezone&&{timezone:y}};if(!Object.keys(S).length)return r();o.mutate({id:n.id,patch:S},{onSuccess:()=>{We({title:"Schedule saved",variant:"success"}),r()},onError:L=>{var $,Q;const z=(Q=($=L.body)==null?void 0:$.error)==null?void 0:Q.field;j({field:z,message:yt(L)})}})};return i.jsx(Kd,{open:!0,onClose:r,title:"Edit schedule",description:`${n.when} (${n.timezone}) · #${n.channelName??n.channelId}`,className:"max-w-2xl",footer:i.jsxs(i.Fragment,{children:[i.jsx(oe,{variant:"outline",onClick:r,children:"Cancel"}),i.jsx(oe,{onClick:T,disabled:o.isPending,children:"Save"})]}),children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(qe,{label:"Title",error:(x==null?void 0:x.field)==="title"?x.message:null,children:S=>i.jsx(Le,{...S,value:u,maxLength:80,onChange:L=>d(L.target.value)})}),i.jsx(qe,{label:"What to do on each run",help:"Runs start without the original conversation, so keep this self-contained.",children:S=>i.jsx("textarea",{...S,value:h,maxLength:4e3,rows:6,onChange:L=>p(L.target.value),className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsx(qe,{label:"When (cron)",help:"minute hour day month weekday, e.g. 0 9 * * 1-5 for weekdays at 9:00",error:(x==null?void 0:x.field)==="cron"?x.message:null,children:S=>i.jsx(Le,{...S,value:g,onChange:L=>m(L.target.value),className:"font-mono"})}),i.jsx(qe,{label:"Timezone",help:"e.g. America/Sao_Paulo",error:(x==null?void 0:x.field)==="timezone"?x.message:null,children:S=>i.jsx(Le,{...S,value:y,onChange:L=>w(L.target.value)})})]}),x&&!["title","cron","timezone"].includes(x.field??"")&&i.jsx("p",{className:"text-sm text-red-300",children:x.message}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-medium",children:"Recent runs"}),s.isLoading?i.jsx(kt,{}):(N=s.data)!=null&&N.runs.length?i.jsx("ul",{className:"divide-y rounded-md border text-sm",children:s.data.runs.map(S=>i.jsxs("li",{className:"flex items-center justify-between gap-2 px-3 py-2",children:[i.jsx(Bt,{to:`/requests/${S.requestId}`,className:"hover:underline",onClick:r,children:mn(S.createdAt)}),i.jsx(fl,{status:S.status})]},S.requestId))}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"No runs yet."})]})]})})}const rS=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/,sS="flex w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";function aS(){const n=hb();return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Setup",description:"Commands a fresh worktree needs before the agent starts: install dependencies, copy an example env file, build. They run in the same sandbox as the agent, once per worktree, without FDA's tokens or the Anthropic key. The agent can propose a script; it only runs after you approve it here."}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):!n.data.workdir||!n.data.isRepo?i.jsxs(rn,{children:["Setup scripts run in per-request worktrees, so the working directory must be a git repository. The current one"," ",n.data.workdir?i.jsx("code",{children:n.data.workdir}):"isn't set",n.data.workdir?" isn't a repository":"","."]}):i.jsx(iS,{repoPath:n.data.workdir,row:n.data.scripts.find(r=>r.repoPath===n.data.workdir)??null})]})}function iS({repoPath:n,row:r}){const s=pb(),o=mb(),[u,d]=k.useState((r==null?void 0:r.script)??""),[h,p]=k.useState((r==null?void 0:r.onFailure)??"continue"),[g,m]=k.useState(String((r==null?void 0:r.timeoutSec)??600)),[y,w]=k.useState((r==null?void 0:r.enabled)??!0);k.useEffect(()=>{d((r==null?void 0:r.script)??""),p((r==null?void 0:r.onFailure)??"continue"),m(String((r==null?void 0:r.timeoutSec)??600)),w((r==null?void 0:r.enabled)??!0)},[r==null?void 0:r.updatedAt]);const x=N=>S=>We({title:N,description:yt(S),variant:"error"}),j=()=>s.mutate({repoPath:n,script:u.trim()||null,onFailure:h,timeoutSec:Number(g),enabled:y},{onSuccess:()=>We({title:"Setup script saved"}),onError:x("Couldn't save the setup script")}),T=N=>{var S;return o.mutate({repoPath:n,action:N,proposedAt:((S=r==null?void 0:r.proposal)==null?void 0:S.at)??null},{onSuccess:()=>We(N==="approve"?{title:"Proposal approved",description:"It's saved and runs in every new worktree (no need to press Save)."}:{title:"Proposal dismissed"}),onError:x("Couldn't update the proposal")})};return i.jsxs("div",{className:"space-y-4",children:[(r==null?void 0:r.proposal)&&i.jsx(He,{className:"border-warning/40",children:i.jsxs(Qe,{className:"space-y-3 p-5 text-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(tt,{variant:"warning",children:"Proposed by the agent"}),r.proposal.at&&i.jsx("span",{className:"text-muted-foreground",title:mn(r.proposal.at),children:Yt(r.proposal.at)}),r.proposal.requestId&&i.jsx(Bt,{to:`/requests/${r.proposal.requestId}`,className:"text-info underline",children:"from this request"})]}),r.proposal.reason&&i.jsx("p",{children:r.proposal.reason}),rS.test(r.proposal.script)&&i.jsx("p",{className:"text-xs font-medium text-destructive",children:"This script contains invisible or direction-changing characters. Don't approve it unless you know why."}),i.jsx("pre",{className:"max-h-72 overflow-auto rounded-md bg-muted/40 p-3 font-mono text-xs",children:r.proposal.script}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Read it before approving: it will run in every new worktree."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(oe,{size:"sm",onClick:()=>T("approve"),disabled:o.isPending,children:"Approve and use"}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>T("reject"),disabled:o.isPending,children:"Dismiss"})]})]})}),i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-4 p-5",children:[i.jsxs("p",{className:"text-sm",children:["Repository ",i.jsx("code",{className:"text-xs",children:n})]}),i.jsx(qe,{label:"Script",help:"Runs with bash in the new worktree. Example: npm ci && cp -n .env.example .env",children:N=>i.jsx("textarea",{...N,value:u,rows:8,maxLength:2e4,spellCheck:!1,placeholder:"npm ci",onChange:S=>d(S.target.value),className:sS})}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[i.jsx(qe,{label:"If it fails",help:"Continue tells the agent what failed; Stop fails the request.",children:N=>i.jsxs(eu,{...N,value:h,onChange:S=>p(S.target.value),children:[i.jsx("option",{value:"continue",children:"Continue"}),i.jsx("option",{value:"fail",children:"Stop"})]})}),i.jsx(qe,{label:"Timeout (seconds)",help:"10 to 3600.",children:N=>i.jsx(Le,{...N,type:"number",min:10,max:3600,value:g,onChange:S=>m(S.target.value)})}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"text-sm font-medium",children:"Enabled"}),i.jsx(ps,{checked:y,onCheckedChange:w,"aria-label":"Run the setup script"})]})]}),i.jsx(oe,{onClick:j,disabled:s.isPending,children:"Save"})]})}),i.jsxs("div",{children:[i.jsx("h2",{className:"mb-2 text-sm font-medium",children:"Recent runs"}),r!=null&&r.runs.length?i.jsx("ul",{className:"divide-y rounded-md border",children:r.runs.map(N=>i.jsxs("li",{className:"space-y-2 p-3 text-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(tt,{variant:N.status==="ok"?"success":N.status==="timeout"?"warning":"destructive",children:N.status==="ok"?"OK":N.status==="timeout"?"Timed out":`Failed (exit ${N.exitCode??"?"})`}),i.jsx("span",{className:"text-muted-foreground",title:mn(N.startedAt),children:Yt(N.startedAt)}),N.durationMs!==null&&i.jsxs("span",{className:"text-muted-foreground",children:[Math.round(N.durationMs/1e3),"s"]}),i.jsx(Bt,{to:`/requests/${N.requestId}`,className:"text-info underline",children:"request"})]}),N.log&&i.jsxs("details",{children:[i.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:"Output"}),i.jsx("pre",{className:"mt-2 max-h-72 overflow-auto rounded-md bg-muted/40 p-3 font-mono text-xs",children:N.log})]})]},N.id))}):i.jsx(rn,{children:"No runs yet."})]})]})}const kd=["browser"],lS=new Set(["Enter","Tab","Backspace","Delete","Escape","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function oS(){return Rt({queryKey:kd,queryFn:()=>Ee("/api/browser"),refetchInterval:2e4})}function gy(){const n=Ct();return Ft({mutationFn:r=>Ee(r.path,{method:r.method??"POST",body:r.body}),onSuccess:r=>{r&&"sites"in r&&n.setQueryData(kd,r)},onSettled:()=>void n.invalidateQueries({queryKey:kd})})}function uS(){const n=oS();return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Browser",description:"Sign the agent in to the sites it needs (a staging app, a dashboard). You drive a browser on this machine from here; Save and close keeps its cookies (encrypted), and every browser task starts signed in. Use test accounts: the agent can read what its browser holds."}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):n.data.installed?i.jsxs(i.Fragment,{children:[!n.data.enabled&&i.jsx("p",{className:"rounded-md border border-warning/50 bg-warning-muted p-3 text-sm",children:"The browser is off for tasks (Settings → General → Browser). You can still save sign-ins now; tasks use them once it's on."}),i.jsx(cS,{data:n.data}),i.jsx(dS,{data:n.data})]}):i.jsxs(rn,{children:["The browser isn't installed on this machine. Install it there with"," ",i.jsx("code",{children:"superclawd fda browser install"}),", then enable it in Settings → General."]})]})}function cS({data:n}){const r=gy(),[s,o]=k.useState(""),[u,d]=k.useState(null),h=k.useRef(null),p=k.useRef(null),g=n.session.open,{width:m,height:y}=n.session.viewport;k.useEffect(()=>{if(!g){d(null);return}const L=new EventSource("/api/browser/session/stream");return L.addEventListener("frame",z=>{const $=JSON.parse(z.data);d({src:`data:image/jpeg;base64,${$.data}`,url:$.url,title:$.title,tabs:$.tabs})}),L.addEventListener("closed",()=>L.close()),L.addEventListener("expired",()=>L.close()),()=>L.close()},[g]),k.useEffect(()=>{var L;u!=null&&u.url&&((L=document.activeElement)==null?void 0:L.id)!=="browser-address"&&o(u.url)},[u==null?void 0:u.url]);const w=L=>z=>We({title:L,description:yt(z),variant:"error"}),x=L=>Ee("/api/browser/session/input",{method:"POST",body:L}).catch(w("Couldn't send that to the browser")),j=L=>{const z=h.current.getBoundingClientRect();return{x:Math.round((L.clientX-z.left)/z.width*m),y:Math.round((L.clientY-z.top)/z.height*y)}},T=L=>r.mutateAsync({path:"/api/browser/session",body:{url:L}}).catch(w("Couldn't open the page")),N=L=>{if(!g)return;const z=[L.ctrlKey&&"Control",L.altKey&&"Alt",L.metaKey&&"Meta"].filter(Boolean);lS.has(L.key)?(L.preventDefault(),x({type:"key",key:[...z,...L.shiftKey?["Shift"]:[],L.key].join("+")})):L.key.length===1&&z.length?(L.preventDefault(),x({type:"key",key:[...z,L.key].join("+")})):L.key.length===1&&(L.preventDefault(),x({type:"text",text:L.key}))},S=L=>{const z=L.clipboardData.getData("text/plain");!z||!g||(L.preventDefault(),x({type:"text",text:z.slice(0,2e3)}))};return i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6",children:[i.jsxs("form",{className:"flex items-center gap-2",onSubmit:L=>{L.preventDefault(),s.trim()&&T(s.trim())},children:[i.jsx(oe,{type:"button",variant:"outline",size:"icon","aria-label":"Back",disabled:!g,onClick:()=>void Ee("/api/browser/session/go",{method:"POST",body:{action:"back"}}).catch(w("Couldn't go back")),children:i.jsx(Tg,{className:"h-4 w-4"})}),i.jsx(oe,{type:"button",variant:"outline",size:"icon","aria-label":"Forward",disabled:!g,onClick:()=>void Ee("/api/browser/session/go",{method:"POST",body:{action:"forward"}}).catch(w("Couldn't go forward")),children:i.jsx(Lg,{className:"h-4 w-4"})}),i.jsx(oe,{type:"button",variant:"outline",size:"icon","aria-label":"Reload",disabled:!g,onClick:()=>void Ee("/api/browser/session/go",{method:"POST",body:{action:"reload"}}).catch(w("Couldn't reload")),children:i.jsx(k1,{className:"h-4 w-4"})}),i.jsx(Le,{id:"browser-address",value:s,onChange:L=>o(L.target.value),placeholder:"https://staging.example.com/login","aria-label":"Address",className:"flex-1"}),i.jsxs(oe,{type:"submit",disabled:r.isPending||!s.trim(),children:[i.jsx(Ag,{className:"mr-1 h-4 w-4"}),g?"Go":"Open browser"]})]}),g?i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:p,tabIndex:0,role:"application","aria-label":"Remote browser: click to focus, then type",className:"relative overflow-hidden rounded-md border bg-muted outline-none focus:ring-2 focus:ring-ring",onKeyDown:N,onPaste:S,children:u?i.jsx("img",{ref:h,src:u.src,alt:u.title||"Remote browser",draggable:!1,className:"block w-full cursor-pointer select-none",style:{aspectRatio:`${m} / ${y}`},onClick:L=>{var z;(z=p.current)==null||z.focus(),x({type:"click",...j(L)})},onDoubleClick:L=>void x({type:"click",double:!0,...j(L)}),onContextMenu:L=>{L.preventDefault(),x({type:"click",button:"right",...j(L)})},onWheel:L=>void x({type:"wheel",...j(L),dx:Math.round(L.deltaX),dy:Math.round(L.deltaY)})}):i.jsx("div",{className:"flex items-center justify-center text-sm text-muted-foreground",style:{aspectRatio:`${m} / ${y}`},children:"Loading the page…"})}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{children:"Click the page, then type. Paste works too. Passwords you type go straight to the site; they aren't stored by FDA."}),u&&u.tabs>1&&i.jsxs(tt,{variant:"secondary",children:[u.tabs," tabs (showing the newest)"]}),!n.session.sandboxed&&i.jsx(tt,{variant:"secondary",children:"Chrome sandbox unavailable on this host"}),n.session.idleClosesAt&&i.jsxs("span",{children:["Closes when idle, latest ",mn(n.session.idleClosesAt),"."]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/browser/session/save",body:{close:!0}}).then(()=>We({title:"Sign-ins saved",description:"New browser tasks start signed in. Open the browser again to add another site."})).catch(w("Couldn't save the sign-ins")),children:[i.jsx(b1,{className:"mr-1 h-4 w-4"}),"Save and close"]}),i.jsxs(oe,{variant:"outline",disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/browser/session",method:"DELETE"}).catch(w("Couldn't close the browser")),children:[i.jsx(Bd,{className:"mr-1 h-4 w-4"}),"Close without saving"]})]})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the sign-in page of a site and open the browser. Sign in as you normally would (including two-factor), then Save and close."})]})})}function dS({data:n}){const r=gy(),[s,o]=k.useState(null),u=d=>h=>We({title:d,description:yt(h),variant:"error"});return i.jsxs(He,{children:[i.jsxs(Qe,{className:"space-y-3 pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"font-medium",children:"Signed-in sites"}),n.sites.length>1&&i.jsx(oe,{variant:"outline",size:"sm",onClick:()=>o("all"),children:"Sign out of all"})]}),n.sites.length?i.jsx("ul",{className:"divide-y rounded-md border",children:n.sites.map(d=>i.jsxs("li",{className:"flex items-center gap-3 px-3 py-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:d.site}),i.jsxs("span",{className:"text-muted-foreground",children:[d.cookies," cookie",d.cookies===1?"":"s",d.origins?`, local storage on ${d.origins}`:"",d.expiresAt?`, until ${mn(d.expiresAt)}`:", session only"]}),i.jsxs(oe,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>o(d.site),children:[i.jsx(Dg,{className:"mr-1 h-4 w-4"}),"Sign out"]})]},d.site))}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"None yet. Browser tasks start with a clean browser."}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Signing out here removes the saved cookies from this machine. It doesn't end the session on the site itself; to be sure, sign out there or change the password."})]}),i.jsx(Gd,{open:s!==null,onClose:()=>o(null),title:s==="all"?"Sign out of all sites?":`Sign out of ${s}?`,description:"New browser tasks will start without these sign-ins.",confirmLabel:"Sign out",destructive:!0,onConfirm:()=>{const d=s;o(null),r.mutateAsync({path:d==="all"?"/api/browser/sites":`/api/browser/sites/${encodeURIComponent(d)}`,method:"DELETE"}).catch(u("Couldn't sign out"))}})]})}function Js({text:n,label:r="Copy"}){const[s,o]=k.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(n),o(!0),setTimeout(()=>o(!1),1500)}catch{We({title:"Could not copy",description:"Select the text and copy it manually.",variant:"error"})}};return i.jsxs(oe,{variant:"outline",size:"sm",onClick:u,children:[s?i.jsx(Mg,{}):i.jsx(_k,{}),s?"Copied":r]})}const yy=["tickets"],fS={queued:{label:"Queued",variant:"muted"},working:{label:"Working",variant:"info"},waiting:{label:"Waiting for a reply",variant:"warning"},in_review:{label:"PR in review",variant:"info"},done:{label:"Done",variant:"success"},released:{label:"Taken off",variant:"muted"},refused:{label:"Refused",variant:"destructive"}};function hS(){return Rt({queryKey:yy,queryFn:()=>Ee("/api/tickets"),refetchInterval:15e3})}function Xa(){const n=Ct();return Ft({mutationFn:r=>Ee(r.path,{method:r.method??"POST",body:r.body}),onSuccess:r=>{r&&"items"in r&&n.setQueryData(yy,r)}})}const Vn=n=>r=>We({title:n,description:yt(r),variant:"error"});function pS(){const n=hS(),r=Xa();if(n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const s=n.data;return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Tickets",description:"People hand tickets to the agent in Linear (assign or @mention it) or GitHub (a label). It works them one at a time in its own worktree, opens a pull request, follows CI and reviews, and replies on the ticket. Only people on the access list can hand tickets over; the ticket's text is treated as data, not instructions.",actions:i.jsxs(oe,{variant:"outline",size:"sm",disabled:r.isPending||!s.settings.enabled,onClick:()=>void r.mutateAsync({path:"/api/tickets/poll"}).then(o=>We({title:"Checked",description:`${o.handled} new event(s).`})).catch(Vn("Couldn't check the trackers")),children:[i.jsx(y1,{className:"mr-1 h-4 w-4"}),"Check now"]})}),i.jsx(mS,{d:s}),i.jsx(gS,{d:s}),i.jsx(yS,{d:s}),s.jira.available&&i.jsx(vS,{d:s}),i.jsx(xS,{d:s}),i.jsx(wS,{d:s})]})}function Do({label:n,help:r,checked:s,onChange:o}){return i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:n}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),i.jsx(ps,{checked:s,onCheckedChange:o,"aria-label":n})]})}function mS({d:n}){const r=Xa(),s=n.settings,[o,u]=k.useState(String(s.atATime)),[d,h]=k.useState(s.budgetUsd===null?"":String(s.budgetUsd)),[p,g]=k.useState(s.dailyBudgetUsd===null?"":String(s.dailyBudgetUsd)),[m,y]=k.useState(s.statusOnPr??""),[w,x]=k.useState(s.slackChannel??""),j=(T,N)=>r.mutateAsync({path:"/api/tickets",method:"PUT",body:T}).then(()=>N&&We({title:N,variant:"success"})).catch(Vn("Couldn't save"));return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"How it works on tickets"}),i.jsx(Tt,{children:"Off by default. Turn it on once a tracker is connected."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsx(Do,{label:"Work on handed-over tickets",help:"Off: tickets are ignored (nothing is read or posted).",checked:s.enabled,onChange:T=>void j({enabled:T})}),i.jsx(Do,{label:"Auto-merge pull requests",help:"Turns on GitHub auto-merge for a ticket's PR: it merges only when required checks and approvals pass. Off: people merge.",checked:s.autoMerge,onChange:T=>void j({autoMerge:T})}),i.jsx(Do,{label:"Move tickets to In Progress",help:"When work starts (Linear: the team's first started state).",checked:s.statusOnStart,onChange:T=>void j({statusOnStart:T})}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[i.jsx(qe,{label:"Tickets at a time",help:"Pull requests in review don't count.",children:T=>i.jsx(Le,{...T,type:"number",min:1,max:8,value:o,onChange:N=>u(N.target.value)})}),i.jsx(qe,{label:"Budget per ticket (USD)",help:"All its turns together. Empty: unlimited.",children:T=>i.jsx(Le,{...T,type:"number",min:.5,step:.5,value:d,placeholder:"Unlimited",onChange:N=>h(N.target.value)})}),i.jsx(qe,{label:"Daily budget for tickets (USD)",help:"Tickets wait once it's spent. Empty: unlimited.",children:T=>i.jsx(Le,{...T,type:"number",min:1,value:p,placeholder:"Unlimited",onChange:N=>g(N.target.value)})}),i.jsx(qe,{label:"State when the PR opens",help:"By name, e.g. In Review (empty: don't move).",children:T=>i.jsx(Le,{...T,value:m,onChange:N=>y(N.target.value),placeholder:"In Review"})}),i.jsx(qe,{label:"Slack channel for ticket news",help:"Channel id (C…): pick-ups, PRs, merges. Empty: none.",children:T=>i.jsx(Le,{...T,value:w,onChange:N=>x(N.target.value),placeholder:"C0123456789"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void j({atATime:Number(o),budgetUsd:d.trim()?Number(d):null,dailyBudgetUsd:p.trim()?Number(p):null,statusOnPr:m.trim(),slackChannel:w.trim()},"Saved"),children:"Save"})]})]})}function gS({d:n}){const r=Xa(),s=n.linear,[o,u]=k.useState(s.clientId??""),[d,h]=k.useState(""),[p,g]=k.useState(s.teams.join(", "));return k.useEffect(()=>u(s.clientId??""),[s.clientId]),i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Linear"}),i.jsx(Tt,{children:"The agent is a Linear app (agents don't take a paid seat). People delegate an issue to it or @mention it; it reports in the issue's agent session. Create an OAuth app in Linear (Settings → API → OAuth applications), with this redirect URI, then connect it as an app."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:"Workspace:"}),s.connected?i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"success",children:"Connected"}),i.jsx("code",{children:s.workspace}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>void r.mutateAsync({path:"/api/tickets/linear/connection",method:"DELETE"}).catch(Vn("Couldn't disconnect")),children:"Disconnect"})]}):i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"muted",children:"Not connected"}),i.jsx(oe,{size:"sm",disabled:!s.configured,onClick:()=>void Ee("/api/tickets/linear/connect",{method:"POST"}).then(m=>window.location.assign(m.url)).catch(Vn("Couldn't start the Linear install")),children:"Connect Linear"}),!s.configured&&i.jsx("span",{className:"text-muted-foreground",children:"Save the client below first."})]})]}),i.jsxs("div",{className:"space-y-1.5 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Callback URL (add it to the Linear OAuth app)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:s.redirectUri}),i.jsx(Js,{text:s.redirectUri})]})]}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[i.jsx(qe,{label:"Client ID",children:m=>i.jsx(Le,{...m,value:o,onChange:y=>u(y.target.value)})}),i.jsx(qe,{label:"Client secret",help:s.hasSecret?"Saved. Enter a new one only to replace it.":void 0,children:m=>i.jsx(Le,{...m,type:"password",autoComplete:"off",value:d,onChange:y=>h(y.target.value),placeholder:s.hasSecret?"••••••••":""})}),i.jsx(qe,{label:"Teams",help:"Team keys, comma separated (empty: every team it can see).",children:m=>i.jsx(Le,{...m,value:p,onChange:y=>g(y.target.value),placeholder:"ENG, OPS"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{linearClientId:o.trim(),...d.trim()?{linearClientSecret:d.trim()}:{},linearTeams:p.split(",").map(m=>m.trim()).filter(Boolean)}}).then(()=>{h(""),We({title:"Linear saved",variant:"success"})}).catch(Vn("Couldn't save Linear")),children:"Save"})]})]})}function yS({d:n}){const r=Xa(),[s,o]=k.useState(n.github.repos.join(", ")),[u,d]=k.useState(n.github.label),[h,p]=k.useState(n.github.people.join(", "));return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"GitHub Issues"}),i.jsx(Tt,{children:"GitHub doesn't let apps be assignees, so an issue is handed over with a label. Whoever adds it must be listed under People and have write access. Uses this machine's GitHub login (the same as pull requests); replies are comments."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.jsx(qe,{label:"Repositories",help:"owner/name, comma separated.",children:g=>i.jsx(Le,{...g,value:s,onChange:m=>o(m.target.value),placeholder:"acme/web, acme/api"})}),i.jsx(qe,{label:"Label",children:g=>i.jsx(Le,{...g,value:u,onChange:m=>d(m.target.value)})}),i.jsx(qe,{label:"People",help:"GitHub logins allowed to hand issues over and talk to the agent (they also need write access). Comma separated.",children:g=>i.jsx(Le,{...g,value:h,onChange:m=>p(m.target.value),placeholder:"ana, bo"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{githubPeople:h.split(",").map(g=>g.trim()).filter(Boolean),githubRepos:s.split(",").map(g=>g.trim()).filter(Boolean),githubLabel:u.trim()}}).then(()=>We({title:"GitHub saved",variant:"success"})).catch(Vn("Couldn't save GitHub")),children:"Save"})]})]})}function vS({d:n}){const r=Xa(),s=n.jira.available?n.jira:null,[o,u]=k.useState((s==null?void 0:s.clientId)??""),[d,h]=k.useState(""),[p,g]=k.useState((s==null?void 0:s.siteInput)??""),[m,y]=k.useState(((s==null?void 0:s.projects)??[]).join(", ")),[w,x]=k.useState((s==null?void 0:s.label)??""),[j,T]=k.useState(((s==null?void 0:s.people)??[]).join(", "));return k.useEffect(()=>u((s==null?void 0:s.clientId)??""),[s==null?void 0:s.clientId]),s?i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Jira"}),i.jsx(Tt,{children:`The agent uses its own Jira user (e.g. "Jim"). People hand an issue over by assigning it to that user (or with the optional label); comments are the conversation. Create an OAuth 2.0 (3LO) app at developer.atlassian.com with the Jira scopes read:jira-work, write:jira-work and read:jira-user and this callback URL, then connect while signed in to Atlassian as the agent's user.`})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:"Site:"}),s.connected?i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"success",children:"Connected"}),i.jsx("code",{children:s.site}),s.account&&i.jsxs("span",{className:"text-muted-foreground",children:["as ",s.account]}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>void r.mutateAsync({path:"/api/tickets/jira/connection",method:"DELETE"}).catch(Vn("Couldn't disconnect")),children:"Disconnect"})]}):i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"muted",children:"Not connected"}),i.jsx(oe,{size:"sm",disabled:!s.configured,onClick:()=>void Ee("/api/tickets/jira/connect",{method:"POST"}).then(N=>window.location.assign(N.url)).catch(Vn("Couldn't start the Jira sign-in")),children:"Connect Jira"}),!s.configured&&i.jsx("span",{className:"text-muted-foreground",children:"Save the client below first."})]})]}),i.jsxs("div",{className:"space-y-1.5 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Callback URL (add it to the Atlassian app)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:s.redirectUri}),i.jsx(Js,{text:s.redirectUri})]})]}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[i.jsx(qe,{label:"Client ID",children:N=>i.jsx(Le,{...N,value:o,onChange:S=>u(S.target.value)})}),i.jsx(qe,{label:"Secret",help:s.hasSecret?"Saved. Enter a new one only to replace it.":void 0,children:N=>i.jsx(Le,{...N,type:"password",autoComplete:"off",value:d,onChange:S=>h(S.target.value),placeholder:s.hasSecret?"••••••••":""})}),i.jsx(qe,{label:"Site",help:"Only needed if the agent's account reaches several sites.",children:N=>i.jsx(Le,{...N,value:p,onChange:S=>g(S.target.value),placeholder:"https://acme.atlassian.net"})}),i.jsx(qe,{label:"Projects",help:"Project keys, comma separated (empty: every project it can see).",children:N=>i.jsx(Le,{...N,value:m,onChange:S=>y(S.target.value),placeholder:"ENG, OPS"})}),i.jsx(qe,{label:"Hand-over label (optional)",help:"Adding this label also hands an issue over.",children:N=>i.jsx(Le,{...N,value:w,onChange:S=>x(S.target.value),placeholder:"fda"})}),i.jsx(qe,{label:"People without a visible email",help:"People are matched to Slack by email. When Jira hides someone's email, add their Jira account id here (a refused ticket shows it).",children:N=>i.jsx(Le,{...N,value:j,onChange:S=>T(S.target.value),placeholder:"712020:…"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{jiraClientId:o.trim(),...d.trim()?{jiraClientSecret:d.trim()}:{},jiraSite:p.trim(),jiraProjects:m.split(",").map(N=>N.trim()).filter(Boolean),jiraLabel:w.trim(),jiraPeople:j.split(",").map(N=>N.trim()).filter(Boolean)}}).then(()=>{h(""),We({title:"Jira saved",variant:"success"})}).catch(Vn("Couldn't save Jira")),children:"Save"})]})]}):null}function xS({d:n}){const r=Xa(),[s,o]=k.useState(""),[u,d]=k.useState(null),h=n.bridge,p=(g,m=!1)=>Ee(`/api/tickets/bridge/${g}`,{method:"POST",body:{rotate:m}}).then(y=>{y.secret&&d(y.secret),r.mutateAsync({path:"/api/tickets",method:"PUT",body:{}}),We({title:"Webhook URL ready",variant:"success"})}).catch(Vn("Couldn't set up the webhook"));return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Instant updates (optional)"}),i.jsx(Tt,{children:"Without this, the agent checks Linear every 15 seconds and GitHub every minute. With it, the tracker's webhook goes to SuperClawd's bridge (this machine stays unreachable from the internet), which wakes the agent right away. No ticket data is stored there."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsx(Do,{label:"Use the webhook bridge",help:"Polling keeps running either way (a missed webhook only delays).",checked:h.enabled,onChange:g=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{bridge:g}}).catch(Vn("Couldn't change it"))}),i.jsxs("div",{className:"space-y-2 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Linear"}),i.jsx("p",{className:"text-muted-foreground",children:"In the Linear OAuth app: enable Webhooks, select Agent session events and Inbox notifications, paste the URL below, and copy Linear's signing secret here."}),i.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[i.jsx("div",{className:"min-w-64 flex-1",children:i.jsx(qe,{label:"Linear webhook signing secret",children:g=>i.jsx(Le,{...g,type:"password",autoComplete:"off",value:s,onChange:m=>o(m.target.value),placeholder:h.linear.hasSecret?"••••••••":"lin_wh_…"})})}),i.jsx(oe,{variant:"outline",disabled:!s.trim()&&!h.linear.hasSecret,onClick:()=>void(s.trim()?r.mutateAsync({path:"/api/tickets",method:"PUT",body:{linearWebhookSecret:s.trim()}}):Promise.resolve()).then(()=>(o(""),p("linear"))),children:"Get the webhook URL"})]}),h.linear.hasSecret&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Secret saved."}),h.linear.url&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:h.linear.url}),i.jsx(Js,{text:h.linear.url})]})]}),i.jsxs("div",{className:"space-y-2 text-sm",children:[i.jsx("p",{className:"font-medium",children:"GitHub"}),i.jsx("p",{className:"text-muted-foreground",children:"In each repository: Settings → Webhooks → Add webhook. Payload URL and secret below, content type application/json, events: Issues and Issue comments."}),i.jsx(oe,{variant:"outline",onClick:()=>void p("github",h.github.hasSecret),children:h.github.url?"New secret + URL":"Get the webhook URL and secret"}),h.github.url&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:h.github.url}),i.jsx(Js,{text:h.github.url})]}),u&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{children:"Secret (shown once):"}),i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:u}),i.jsx(Js,{text:u})]})]})]})]})}function wS({d:n}){return i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Recent tickets"})}),i.jsx(Qe,{children:n.items.length?i.jsx("ul",{className:"divide-y rounded-md border",children:n.items.map(r=>{const s=fS[r.state]??{label:r.state,variant:"muted"};return i.jsxs("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2 text-sm",children:[r.url?i.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer noopener",className:"font-medium text-info underline",children:r.key}):i.jsx("span",{className:"font-medium",children:r.key}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.title}),i.jsx(tt,{variant:s.variant,children:s.label}),r.statusNote&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r.statusNote}),r.prUrl&&i.jsx("a",{href:r.prUrl,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-info underline",children:"PR"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:dl(r.costUsd)}),r.requestId&&i.jsx(Bt,{to:`/requests/${r.requestId}`,className:"text-xs text-info underline",children:"Request"}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.delegator?`${r.delegator} · `:"",Yt(r.updatedAt)]})]},r.id)})}):i.jsx(rn,{children:"No tickets yet."})})]})}function kS(){const[n,r]=k.useState(null),s=k.useRef(!1);return k.useEffect(()=>{if(s.current)return;s.current=!0;const o=new URLSearchParams(window.location.search),u=o.get("code"),d=o.get("state");if(window.history.replaceState(null,"","/trackers/linear/callback"),o.get("error")||!u||!d){r({ok:!1,message:o.get("error")==="access_denied"?"The install was cancelled.":"Linear didn't complete the install."});return}Ee("/api/tickets/linear/exchange",{method:"POST",body:{code:u,state:d}}).then(h=>r({ok:!0,workspace:h.linear.workspace})).catch(h=>r({ok:!1,message:yt(h)}))},[]),i.jsx("div",{className:"mx-auto max-w-lg p-6",children:i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6 text-sm",children:[n?n.ok?i.jsxs("p",{children:["Linear is connected",n.workspace?i.jsxs(i.Fragment,{children:[" ","to ",i.jsx("code",{children:n.workspace})]}):null,"."]}):i.jsx("p",{className:"text-destructive",children:n.message}):i.jsx(kt,{label:"Connecting Linear"}),i.jsx(Bt,{to:"/tickets",className:"text-info underline",children:"Back to Tickets"})]})})})}function jS(){const[n,r]=k.useState(null),s=k.useRef(!1);return k.useEffect(()=>{if(s.current)return;s.current=!0;const o=new URLSearchParams(window.location.search),u=o.get("code"),d=o.get("state");if(window.history.replaceState(null,"","/trackers/jira/callback"),o.get("error")||!u||!d){r({ok:!1,message:o.get("error")==="access_denied"?"The sign-in was cancelled.":"Atlassian didn't complete the sign-in."});return}Ee("/api/tickets/jira/exchange",{method:"POST",body:{code:u,state:d}}).then(h=>r({ok:!0,site:h.jira.site??null,account:h.jira.account??null})).catch(h=>r({ok:!1,message:yt(h)}))},[]),i.jsx("div",{className:"mx-auto max-w-lg p-6",children:i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6 text-sm",children:[n?n.ok?i.jsxs("p",{children:["Jira is connected",n.site?i.jsxs(i.Fragment,{children:[" ","to ",i.jsx("code",{children:n.site})]}):null,n.account?i.jsxs(i.Fragment,{children:[" as ",n.account]}):null,"."]}):i.jsx("p",{className:"text-destructive",children:n.message}):i.jsx(kt,{label:"Connecting Jira"}),i.jsx(Bt,{to:"/tickets",className:"text-info underline",children:"Back to Tickets"})]})})})}const bS=[{to:"agent",label:"Agent"},{to:"anthropic",label:"Anthropic"},{to:"general",label:"General"},{to:"slack",label:"Slack"},{to:"access",label:"Access"},{to:"calendar",label:"Calendar"},{to:"account",label:"Account"}];function SS(){return i.jsxs("div",{children:[i.jsx(ys,{title:"Settings",description:"Configure this FDA machine."}),i.jsxs("div",{className:"flex flex-col gap-6 md:flex-row",children:[i.jsx("nav",{"aria-label":"Settings",className:"flex shrink-0 gap-1 overflow-x-auto md:w-44 md:flex-col",children:bS.map(n=>i.jsx($d,{to:n.to,className:({isActive:r})=>Xe("rounded-md px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",r?"bg-accent font-medium":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:n.label},n.to))}),i.jsx("div",{className:"min-w-0 flex-1",children:i.jsx(Id,{})})]})]})}function CS(){var h,p,g;const n=Gj(),r=Yj(),[s,o]=k.useState(null),u=((p=(h=n.data)==null?void 0:h.selected)==null?void 0:p.id)??null,d=s??u;return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Primary agent"}),i.jsx(Tt,{children:"The SuperClawd agent FDA runs as. It brings its skills, guardrails and memories from your workspace."})]}),i.jsxs(Qe,{className:"space-y-4",children:[((g=n.data)==null?void 0:g.selected)&&i.jsxs("p",{className:"text-sm",children:["Current:"," ",i.jsx("span",{className:"font-medium",children:n.data.selected.name})]}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):i.jsxs(i.Fragment,{children:[n.data.error&&i.jsx(Ot,{error:new Error(`Could not load agents from SuperClawd: ${n.data.error}`),onRetry:()=>void n.refetch()}),n.data.items.length===0&&!n.data.error?i.jsx(rn,{children:"No enabled Primary agents in this workspace. Create one in the SuperClawd app, then come back."}):i.jsx("div",{role:"radiogroup","aria-label":"Primary agent",className:"space-y-2",children:n.data.items.map(m=>{const y=d===m.id;return i.jsxs("button",{type:"button",role:"radio","aria-checked":y,onClick:()=>o(m.id),className:Xe("flex w-full items-start gap-3 rounded-md border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-accent":"hover:bg-accent/50"),children:[i.jsx("span",{className:Xe("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border",y&&"border-primary bg-primary text-primary-foreground"),children:y&&i.jsx(Mg,{className:"h-3 w-3","aria-hidden":!0})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:"font-medium",children:m.name}),i.jsx("code",{className:"text-xs text-muted-foreground",children:m.slug}),m.model&&i.jsx(tt,{variant:"outline",children:NS(m.model)}),m.id===u&&i.jsx(tt,{variant:"success",children:"Current"})]}),m.description&&i.jsx("span",{className:"mt-1 block text-sm text-muted-foreground",children:m.description})]})]},m.id)})}),i.jsx(oe,{disabled:!d||d===u||r.isPending,onClick:()=>d&&r.mutate(d,{onSuccess:()=>{o(null),We({title:"Agent saved",variant:"success"})}}),children:r.isPending?"Saving":"Save"})]})]})]})}function NS(n){if(n==="default")return"Session model";const r=/^claude-(opus|fable|sonnet|haiku)-latest$/.exec(n);return r?`Claude ${r[1][0].toUpperCase()}${r[1].slice(1)} (latest)`:n}function jd({label:n,value:r}){return i.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border px-3 py-2 text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:n}),r?i.jsx("code",{className:"text-xs",children:r}):i.jsx(tt,{variant:"warning",children:"Not set"})]})}function vy({result:n,error:r}){if(r)return i.jsxs("span",{role:"status",className:"flex items-center gap-1.5 text-sm text-red-300",children:[i.jsx(md,{className:"h-4 w-4","aria-hidden":!0}),yt(r)]});if(!n)return null;const s=[n.botName&&`bot ${n.botName}`,n.teamId&&`team ${n.teamId}`].filter(Boolean).join(", "),o=n.message??(n.ok?"Works.":"Failed.");return i.jsxs("span",{role:"status",className:`flex items-center gap-1.5 text-sm ${n.ok?"text-green-300":"text-red-300"}`,children:[n.ok?i.jsx(Tk,{className:"h-4 w-4","aria-hidden":!0}):i.jsx(md,{className:"h-4 w-4","aria-hidden":!0}),o,s&&i.jsxs("span",{className:"text-muted-foreground",children:["(",s,")"]})]})}function ES(){const n=Jo(),r=Jj(),s=Xj(),[o,u]=k.useState("");if(n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const d=h=>{h.preventDefault(),r.mutate(o.trim(),{onSuccess:()=>{u(""),s.reset(),We({title:"API key saved",variant:"success"})}})};return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Anthropic API key"}),i.jsx(Tt,{children:"FDA runs Claude Code with this key. It is stored encrypted on this machine and never shown again."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsx(jd,{label:"Current key",value:n.data.secrets.anthropicApiKey}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oe,{variant:"outline",disabled:s.isPending||!n.data.secrets.anthropicApiKey,onClick:()=>s.mutate(),children:s.isPending?"Testing":"Test key"}),i.jsx(vy,{result:s.data,error:s.error})]}),i.jsxs("form",{onSubmit:d,className:"max-w-md space-y-3",autoComplete:"off",children:[i.jsx(qe,{label:n.data.secrets.anthropicApiKey?"Replace key":"Set key",help:"Starts with sk-ant-.",error:r.error?yt(r.error):null,children:h=>i.jsx(Le,{...h,type:"password",autoComplete:"off",spellCheck:!1,value:o,onChange:p=>u(p.target.value),placeholder:"sk-ant-..."})}),i.jsx(oe,{type:"submit",disabled:!o.trim()||r.isPending,children:r.isPending?"Saving":"Save key"})]})]})]})}function RS({open:n,initialPath:r,onClose:s,onSelect:o}){return i.jsx(Kd,{open:n,onClose:s,title:"Choose a folder",description:"Folders under your home directory. Repositories are marked.",className:"max-w-xl",children:n&&i.jsx(PS,{initialPath:r??"",onSelect:o,onCancel:s})})}function PS({initialPath:n,onSelect:r,onCancel:s}){var p,g,m,y;const[o,u]=k.useState(n),d=lb(o),h=((p=d.data)==null?void 0:p.path)??o;return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(oe,{variant:"outline",size:"icon","aria-label":"Parent folder",disabled:!((g=d.data)!=null&&g.parent),onClick:()=>{var w;return((w=d.data)==null?void 0:w.parent)&&u(d.data.parent)},children:i.jsx(wk,{})}),i.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-muted px-2 py-1.5 text-xs",title:h,children:h||"Home"})]}),d.isLoading?i.jsx(kt,{}):d.isError?i.jsx(Ot,{error:d.error,onRetry:()=>u(n===o?"":n)}):i.jsxs("ul",{className:Xe("max-h-72 overflow-y-auto rounded-md border",d.isFetching&&"opacity-60"),"aria-label":"Folders",children:[((m=d.data)==null?void 0:m.dirs.length)===0&&i.jsx("li",{className:"p-3 text-sm text-muted-foreground",children:"No folders here."}),(y=d.data)==null?void 0:y.dirs.map(w=>i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>u(w.path),className:"flex w-full items-center gap-2 border-b px-3 py-2 text-left text-sm last:border-b-0 hover:bg-accent focus-visible:bg-accent focus-visible:outline-none",children:[w.isRepo?i.jsx(Qk,{className:"h-4 w-4 text-success","aria-hidden":!0}):i.jsx(Bk,{className:"h-4 w-4 text-muted-foreground","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:w.name}),w.isRepo&&i.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"repository"})]})},w.path))]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx(oe,{variant:"outline",onClick:s,children:"Cancel"}),i.jsx(oe,{disabled:!d.data,onClick:()=>d.data&&r(d.data.path),children:"Use this folder"})]})]})}const bd=[{title:"Workspace",description:"Where FDA works on this machine and who people should contact.",fields:[{key:"workdir",label:"Work directory",help:"Repositories FDA works on live here. Must be inside your home directory.",kind:"folder"},{key:"operatorContact",label:"Operator contact",help:"Shown to Slack users when FDA cannot help, for example a Slack handle or email.",kind:"text",nullable:!0,placeholder:"@alex"}]},{title:"Agent behavior",description:"How the coding agent runs each turn.",fields:[{key:"effort",label:"Reasoning effort",help:"Higher effort is slower and costs more.",kind:"select",nullable:!0,options:[{value:"",label:"Default"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"},{value:"max",label:"Max"}]},{key:"permissionMode",label:"Permission mode",help:"Bypass lets the agent run any tool without asking. Auto applies Claude Code's automatic permission checks.",kind:"select",options:[{value:"bypass",label:"Bypass"},{value:"auto",label:"Auto"}]},{key:"planPolicy",label:"Plan first",help:"Whether the agent proposes a plan for approval in Slack before making changes.",kind:"select",options:[{value:"auto",label:"When the task needs it"},{value:"always",label:"Always"},{value:"never",label:"Never"}]},{key:"browserEnabled",label:"Browser",help:"Let the agent use a headless browser for checks and screenshots.",kind:"bool"},{key:"superclawdMemory",label:"SuperClawd memory",help:"Team, repo, agent and private memories from SuperClawd. Off: none is loaded or captured, and the agent uses Claude Code's own memory instead (kept per repository on this machine).",kind:"bool"},{key:"captureMemories",label:"Capture memories",help:"Save learnings to your SuperClawd workspace memories after turns.",kind:"bool"},{key:"allowClaudeaiConnectors",label:"Claude.ai connectors",help:"Allow MCP connectors configured in the Claude.ai account.",kind:"bool"}]},{title:"Turn limits",description:"Guards against runaway turns.",fields:[{key:"debounceMs",label:"Message debounce (ms)",help:"Wait this long after the last Slack message before starting a turn, so quick follow-ups are batched.",kind:"number",min:0,step:100,integer:!0},{key:"turnTimeoutMin",label:"Turn timeout (minutes)",help:"Stop a turn that runs longer than this.",kind:"number",min:1,integer:!0},{key:"turnMaxBudgetUsd",label:"Max cost per turn (USD)",help:"Leave empty for no limit.",kind:"number",nullable:!0,min:0,step:.5},{key:"turnMaxTurns",label:"Max agent steps per turn",help:"Leave empty for no limit.",kind:"number",nullable:!0,min:1,integer:!0}]},{title:"Pull requests",description:"After FDA opens a pull request it keeps an eye on it (through the machine's gh login) and works on it again in the same thread.",fields:[{key:"prMonitorEnabled",label:"Follow pull requests",help:"Check the pull requests FDA opened. Say `stop following` in a thread to stop for that request.",kind:"bool"},{key:"prMonitorFixCi",label:"Fix failing CI",help:"Once per failing commit, up to the attempt limit below.",kind:"bool"},{key:"prMonitorReviews",label:"Address review feedback",help:"Only from people with write access to the repository; other comments are ignored.",kind:"bool"},{key:"prMonitorConflicts",label:"Resolve merge conflicts",help:"Merges the base branch into the pull request branch.",kind:"bool"},{key:"prMonitorIntervalSec",label:"Check every (seconds)",help:"Checks slow down when nothing is happening.",kind:"number",min:30,integer:!0},{key:"prMonitorQuietSec",label:"Wait after the last comment (seconds)",help:"Lets a reviewer finish before FDA starts.",kind:"number",min:0,integer:!0},{key:"prMonitorMaxCiAttempts",label:"CI fix attempts",help:"Then FDA leaves it for a human and says so in the thread.",kind:"number",min:1,integer:!0},{key:"prMonitorMaxPerDay",label:"Follow-ups per pull request per day",help:"A safety cap on automatic work.",kind:"number",min:1,integer:!0},{key:"prMonitorMaxAgeDays",label:"Stop after idle (days)",help:"Stop following a pull request with no activity for this long.",kind:"number",min:1,integer:!0}]},{title:"Slack context",description:"What FDA reads from the thread.",fields:[{key:"threadContextMessages",label:"Earlier thread messages",help:"How many earlier messages in the thread to include as context.",kind:"number",min:0,integer:!0},{key:"includeUnlistedContext",label:"Include messages from people not on the allowlist",help:"They are passed as untrusted context only, never as instructions.",kind:"bool"},{key:"stopButton",label:"Stop button",help:"Show a Stop button on the agent's live line while it works (same as typing `stop`; only the requester or allowed people can use it).",kind:"bool"},{key:"allowDirectMessages",label:"Direct messages",help:"People on the allowlist can DM the agent; each DM is a private request (the team doesn't see it). Turn off to accept requests only in channels.",kind:"bool"}]},{title:"Sessions and cleanup",description:"Housekeeping on this machine.",fields:[{key:"sessionMaxAgeH",label:"Session max age (hours)",help:"Start a fresh agent session for a thread after this long.",kind:"number",min:1,integer:!0},{key:"worktreeRetentionDays",label:"Keep worktrees (days)",help:"Delete finished request worktrees after this many days.",kind:"number",min:0,integer:!0},{key:"diskMinFreeGb",label:"Minimum free disk (GB)",help:"Pause new work when free disk drops below this.",kind:"number",min:0,step:.5},{key:"autoRequeueOnRestart",label:"Requeue after restart",help:"Requeue requests that were running when the daemon stopped.",kind:"bool"}]},{title:"Admin panel",description:"How this panel is reached.",fields:[{key:"adminPublicUrl",label:"Admin URL",help:"The address you use to open this panel. Used in Slack links.",kind:"text",nullable:!0,placeholder:"https://fda.example.ts.net"},{key:"publicHostname",label:"Public hostname",help:"Extra hostname this panel accepts, for example a Tailscale name.",kind:"text",nullable:!0,placeholder:"fda.example.ts.net"}]},{title:"Privacy",description:"What is shared with SuperClawd.",fields:[{key:"shareTitleWithCloud",label:"Share request titles",help:"Send request titles to SuperClawd for usage reporting. Off sends counts only.",kind:"bool"}]}];function Tm(n){const r={};for(const s of bd)for(const o of s.fields){const u=n[o.key];r[o.key]=typeof u=="boolean"?u:u===null?"":String(u)}return r}function TS(n,r){if(n.kind==="bool")return{value:r};const s=String(r).trim();if(n.kind==="number"){if(s==="")return n.nullable?{value:null}:{error:"Required."};const o=Number(s);return Number.isFinite(o)?n.integer&&!Number.isInteger(o)?{error:"Enter a whole number."}:n.min!==void 0&&o<n.min?{error:`Must be at least ${n.min}.`}:{value:o}:{error:"Enter a number."}}return s===""?"nullable"in n&&n.nullable?{value:null}:n.kind==="folder"?{value:null}:{error:"Required."}:{value:s}}function LS(){const n=Jo();return n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):i.jsx(MS,{settings:n.data.settings})}function MS({settings:n}){const[r]=k.useState(()=>Tm(n)),[s,o]=k.useState(r),[u,d]=k.useState(r),[h,p]=k.useState({}),[g,m]=k.useState(!1),y=Vd(),w=Object.keys(s).filter(N=>s[N]!==u[N]),x=(N,S)=>{o(L=>({...L,[N]:S})),p(L=>({...L,[N]:void 0}))},j=N=>{N.preventDefault();const S={},L={};for(const z of bd)for(const $ of z.fields){if(!w.includes($.key))continue;const Q=TS($,s[$.key]);Q.error?L[$.key]=Q.error:S[$.key]=Q.value}p(L),!Object.keys(L).length&&y.mutate(S,{onSuccess:({settings:z})=>{const $=Tm(z);o($),d($),We({title:"Settings saved",variant:"success"})},onError:z=>{z instanceof Wn&&z.field&&p({[z.field]:z.message})}})},T=y.error instanceof Wn&&y.error.field?null:y.error?yt(y.error):null;return i.jsxs("form",{onSubmit:j,className:"space-y-6",noValidate:!0,children:[bd.map(N=>i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:N.title}),i.jsx(Tt,{children:N.description})]}),i.jsx(Qe,{className:"grid gap-5 sm:grid-cols-2",children:N.fields.map(S=>i.jsx("div",{className:S.kind==="folder"||S.kind==="bool"?"sm:col-span-2":void 0,children:i.jsx(qe,{label:S.label,help:S.help,error:h[S.key],children:L=>{const z=s[S.key];switch(S.kind){case"bool":return i.jsx(ps,{...L,checked:z,onCheckedChange:$=>x(S.key,$)});case"select":return i.jsx(eu,{...L,value:z,onChange:$=>x(S.key,$.target.value),children:S.options.map($=>i.jsx("option",{value:$.value,children:$.label},$.value))});case"number":return i.jsx(Le,{...L,type:"number",inputMode:"decimal",min:S.min,step:S.step??1,value:z,onChange:$=>x(S.key,$.target.value)});case"folder":return i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Le,{...L,value:z,onChange:$=>x(S.key,$.target.value),placeholder:"/home/you/work",spellCheck:!1}),i.jsxs(oe,{variant:"outline",onClick:()=>m(!0),children:[i.jsx($k,{}),"Browse"]})]});default:return i.jsx(Le,{...L,value:z,onChange:$=>x(S.key,$.target.value),placeholder:S.placeholder,spellCheck:!1})}}})},S.key))})]},N.title)),i.jsxs("div",{className:"sticky bottom-0 flex items-center gap-3 border-t bg-background/95 py-4 backdrop-blur",children:[i.jsx(oe,{type:"submit",disabled:w.length===0||y.isPending,children:y.isPending?"Saving":"Save changes"}),i.jsx(oe,{variant:"ghost",disabled:w.length===0,onClick:()=>{o(u),p({})},children:"Discard"}),w.length>0&&i.jsx("span",{className:"text-sm text-muted-foreground",children:w.length===1?"1 unsaved change":`${w.length} unsaved changes`}),i.jsx(Go,{message:T})]}),i.jsx(RS,{open:g,initialPath:s.workdir||null,onClose:()=>m(!1),onSelect:N=>{x("workdir",N),m(!1)}})]})}function _S(){const n=Jo();if(n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const{secrets:r,settings:s}=n.data;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(AS,{botToken:r.slackBotToken,appToken:r.slackAppToken,botUserId:s.slackBotUserId,teamId:s.slackTeamId}),i.jsx(DS,{defaultName:s.slackBotName??"FDA"})]})}function AS({botToken:n,appToken:r,botUserId:s,teamId:o}){const u=Zj(),d=eb(),[h,p]=k.useState(""),[g,m]=k.useState(""),y=w=>{w.preventDefault();const x={};h.trim()&&(x.botToken=h.trim()),g.trim()&&(x.appToken=g.trim()),u.mutate(x,{onSuccess:()=>{p(""),m(""),d.reset(),We({title:"Slack tokens saved. Reconnecting.",variant:"success"})}})};return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Slack connection"}),i.jsx(Tt,{children:"FDA connects to Slack over Socket Mode with a bot token and an app-level token."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(jd,{label:"Bot token",value:n}),i.jsx(jd,{label:"App token",value:r}),(s||o)&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[s&&i.jsxs(i.Fragment,{children:["Bot user ",s,". "]}),o&&i.jsxs(i.Fragment,{children:["Team ",o,"."]})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oe,{variant:"outline",disabled:d.isPending||!n,onClick:()=>d.mutate(),children:d.isPending?"Testing":"Test connection"}),i.jsx(vy,{result:d.data,error:d.error})]}),i.jsxs("form",{onSubmit:y,className:"max-w-md space-y-4",autoComplete:"off",children:[i.jsx(qe,{label:"New bot token",help:"Starts with xoxb-. Leave empty to keep the current one.",children:w=>i.jsx(Le,{...w,type:"password",autoComplete:"off",spellCheck:!1,value:h,onChange:x=>p(x.target.value),placeholder:"xoxb-..."})}),i.jsx(qe,{label:"New app token",help:"Starts with xapp-. Needs the connections:write scope.",children:w=>i.jsx(Le,{...w,type:"password",autoComplete:"off",spellCheck:!1,value:g,onChange:x=>m(x.target.value),placeholder:"xapp-..."})}),i.jsx(Go,{message:u.error?yt(u.error):null}),i.jsx(oe,{type:"submit",disabled:!h.trim()&&!g.trim()||u.isPending,children:u.isPending?"Saving":"Save tokens"})]})]})]})}function DS({defaultName:n}){const[r,s]=k.useState(n),[o,u]=k.useState(n);k.useEffect(()=>{const p=setTimeout(()=>u(r.trim()||n),300);return()=>clearTimeout(p)},[r,n]);const d=tb(o),h=d.data?JSON.stringify(d.data.manifest,null,2):"";return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Slack app manifest"}),i.jsx(Tt,{children:"Create the Slack app from this manifest at api.slack.com/apps, then install it and paste the tokens above."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsx("div",{className:"max-w-xs",children:i.jsx(qe,{label:"Bot name",help:"The name people mention in Slack.",children:p=>i.jsx(Le,{...p,value:r,onChange:g=>s(g.target.value),maxLength:35})})}),d.isLoading?i.jsx(kt,{}):d.isError?i.jsx(Ot,{error:d.error,onRetry:()=>void d.refetch()}):i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx(Js,{text:h,label:"Copy manifest"})}),i.jsx("pre",{className:"max-h-96 overflow-auto rounded-md border bg-muted/40 p-3 font-mono text-xs","aria-label":"Manifest JSON",tabIndex:0,children:h})]})]})]})}const Sd={channel:"Channel",user:"User",usergroup:"User group"},OS={channel:Yk,user:I1,usergroup:U1},Oo=(n,r)=>n.kind===r.kind&&n.slackId===r.slackId;function FS(){var u,d,h,p,g;const n=nb(),r=Jo();if(n.isLoading||r.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const s=!!((u=r.data)!=null&&u.settings.allowAnyChannel),o=!!((d=r.data)!=null&&d.settings.allowAnyone);return i.jsxs("div",{className:"space-y-6",children:[i.jsx(zS,{anyChannel:s,anyone:o}),i.jsx(IS,{targets:((h=r.data)==null?void 0:h.settings.handoffTargets)??[],sources:((p=r.data)==null?void 0:p.settings.handoffSources)??[],budget:((g=r.data)==null?void 0:g.settings.handoffMaxBudgetUsd)??5}),i.jsx(US,{initial:n.data,anyChannel:s,anyone:o})]})}function IS({targets:n,sources:r,budget:s}){const o=Vd(),[u,d]=k.useState({botUserId:"",name:"",role:""}),[h,p]=k.useState(""),[g,m]=k.useState(String(s));k.useEffect(()=>m(String(s)),[s]);const y=(x,j)=>o.mutate(x,{onSuccess:()=>We({title:j,variant:"success"}),onError:T=>We({title:"Couldn't save",description:yt(T),variant:"error"})}),w=x=>/^[UW][A-Z0-9]{5,}$/.test(x.trim());return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Agent hand-offs"}),i.jsx(Tt,{children:"Optional. Let this agent hand part of a request to another agent (for example a product manager agent tasking a developer agent). The person who asked approves each hand-off with ✅ in the thread, and the receiving agent must list this one below too. A hand-off can't be passed on again."})]}),i.jsxs(Qe,{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"Agents this agent can hand work to"}),n.length===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"None (hand-offs off)."}):i.jsx("ul",{className:"divide-y rounded-md border",children:n.map(x=>i.jsxs("li",{className:"flex items-center gap-3 p-3 text-sm",children:[i.jsx("span",{className:"font-medium",children:x.name}),i.jsx("code",{className:"text-xs text-muted-foreground",children:x.botUserId}),i.jsx("span",{className:"flex-1 truncate text-muted-foreground",children:x.role}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":`Remove ${x.name}`,onClick:()=>y({handoffTargets:n.filter(j=>j.botUserId!==x.botUserId)},"Removed"),children:i.jsx(qo,{})})]},x.botUserId))}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_2fr_auto]",children:[i.jsx(Le,{placeholder:"Slack bot user id (U…)","aria-label":"Bot user id",value:u.botUserId,onChange:x=>d({...u,botUserId:x.target.value.trim()})}),i.jsx(Le,{placeholder:"Name (e.g. John)","aria-label":"Name",value:u.name,onChange:x=>d({...u,name:x.target.value})}),i.jsx(Le,{placeholder:"Role (e.g. backend developer)","aria-label":"Role",value:u.role,onChange:x=>d({...u,role:x.target.value})}),i.jsxs(oe,{disabled:!w(u.botUserId)||!u.name.trim()||o.isPending,onClick:()=>{y({handoffTargets:[...n.filter(x=>x.botUserId!==u.botUserId),{botUserId:u.botUserId,name:u.name.trim(),role:u.role.trim()}]},"Added"),d({botUserId:"",name:"",role:""})},children:[i.jsx(gd,{})," Add"]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"Agents allowed to hand work to this agent"}),r.length===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"None (no hand-offs accepted)."}):i.jsx("ul",{className:"divide-y rounded-md border",children:r.map(x=>i.jsxs("li",{className:"flex items-center gap-3 p-3 text-sm",children:[i.jsx("code",{className:"flex-1 text-xs",children:x}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":`Remove ${x}`,onClick:()=>y({handoffSources:r.filter(j=>j!==x)},"Removed"),children:i.jsx(qo,{})})]},x))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Le,{placeholder:"Slack bot user id (U…)","aria-label":"Allowed agent's bot user id",value:h,onChange:x=>p(x.target.value.trim())}),i.jsxs(oe,{disabled:!w(h)||o.isPending,onClick:()=>{y({handoffSources:[...new Set([...r,h])]},"Added"),p("")},children:[i.jsx(gd,{})," Add"]})]})]}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Cost cap per turn for handed-off work (USD)"}),i.jsx(Le,{type:"number",min:.5,step:.5,"aria-label":"Cost cap per turn for handed-off work",value:g,onChange:x=>m(x.target.value)})]}),i.jsx(oe,{variant:"outline",disabled:o.isPending||Number(g)===s,onClick:()=>y({handoffMaxBudgetUsd:Number(g)},"Saved"),children:"Save"})]})]})]})}function zS({anyChannel:n,anyone:r}){const s=Vd(),o=(d,h)=>s.mutate({[d]:h},{onError:p=>We({title:"Couldn't change access",description:yt(p),variant:"error"})}),u=(d,h,p,g)=>i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:p}),i.jsx("p",{className:"text-xs text-muted-foreground",children:g})]}),i.jsx(ps,{checked:h,disabled:s.isPending,"aria-label":p,onCheckedChange:m=>o(d,m)})]});return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Open access"}),i.jsx(Tt,{children:"Optional. Anyone who can reach the agent can make it run code and spend money on this machine, so these are off by default."})]}),i.jsxs(Qe,{className:"space-y-4",children:[u("allowAnyChannel",n,"Any channel the agent is in","Inviting the agent to a channel is enough; the channel list below isn't used. Shared (Slack Connect) channels are still refused."),u("allowAnyone",r,"Anyone in this workspace","Every member can use the agent; the people list below isn't used. External users, guest accounts and deactivated accounts are still refused (unless listed below).")]})]})}function US({initial:n,anyChannel:r,anyone:s}){const[o,u]=k.useState(n),[d,h]=k.useState(n),p=rb(),g=JSON.stringify(o)!==JSON.stringify(d),m=x=>u(j=>j.some(T=>Oo(T,x))?j:[...j,x]),y=x=>u(j=>j.filter(T=>!Oo(T,x))),w=(x,j)=>u(T=>T.map(N=>Oo(N,x)?{...N,label:j||null}:N));return i.jsxs("div",{className:"space-y-6",children:[i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Who can use FDA"}),i.jsxs(Tt,{children:["FDA only acts on mentions in allowed channels from allowed people. A user is allowed when they are listed directly or belong to a listed user group.",r&&" Any channel is on: channels listed here aren't needed.",s&&" Anyone in the workspace is on: people and groups listed here are only needed for guests."]})]}),i.jsxs(Qe,{className:"space-y-4",children:[o.length===0?i.jsx(rn,{children:r&&s?"Not needed while both open-access switches are on.":r?"Add at least one user or group (or turn on Anyone in this workspace).":s?"Add at least one channel (or turn on Any channel the agent is in).":"Nobody is allowed yet. Add at least one channel and one user or group."}):i.jsx("ul",{className:"divide-y rounded-md border",children:o.map(x=>{const j=OS[x.kind];return i.jsxs("li",{className:"flex items-center gap-3 p-3",children:[i.jsx(j,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsx(tt,{variant:"outline",className:"shrink-0",children:Sd[x.kind]}),i.jsx("code",{className:"shrink-0 text-xs text-muted-foreground",children:x.slackId}),i.jsx(Le,{"aria-label":`Label for ${Sd[x.kind].toLowerCase()} ${x.slackId}`,placeholder:"Label",className:"h-8",value:x.label??"",onChange:T=>w(x,T.target.value)}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":`Remove ${x.label??x.slackId}`,onClick:()=>y(x),children:i.jsx(qo,{})})]},`${x.kind}:${x.slackId}`)})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oe,{disabled:!g||p.isPending,onClick:()=>p.mutate(o,{onSuccess:({entries:x})=>{u(x),h(x),We({title:"Access list saved",variant:"success"})}}),children:p.isPending?"Saving":"Save access list"}),i.jsx(oe,{variant:"ghost",disabled:!g,onClick:()=>u(d),children:"Discard"}),g&&i.jsx("span",{className:"text-sm text-muted-foreground",children:"Unsaved changes"})]})]})]}),i.jsx(qS,{entries:o,onAdd:m})]})}function $S(n,r=300){const[s,o]=k.useState(n);return k.useEffect(()=>{const u=setTimeout(()=>o(n),r);return()=>clearTimeout(u)},[n,r]),s}function qS({entries:n,onAdd:r}){const[s,o]=k.useState("channel"),[u,d]=k.useState(""),h=$S(u.trim()),p=sb(h,s==="channel"),g=ab(h,s==="user"),m=ib(s==="usergroup"),y=s==="channel"?p:s==="user"?g:m;let w=[];if(s==="channel"&&p.data)w=p.data.map(x=>({id:x.id,primary:`#${x.name}`,secondary:x.isMember?void 0:"Bot is not a member yet",label:`#${x.name}`,icon:x.isPrivate?i.jsx(o1,{className:"h-3 w-3","aria-label":"Private"}):void 0}));else if(s==="user"&&g.data)w=g.data.map(x=>({id:x.id,primary:x.realName||x.name,secondary:`@${x.name}`,label:x.realName||x.name}));else if(s==="usergroup"&&m.data){const x=h.toLowerCase();w=m.data.filter(j=>!x||j.handle.toLowerCase().includes(x)||j.name.toLowerCase().includes(x)).map(j=>({id:j.id,primary:j.name,secondary:`@${j.handle}`,label:`@${j.handle}`}))}return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Add to the list"}),i.jsx(Tt,{children:"Search what the bot can see in your Slack workspace. Remember to save."})]}),i.jsxs(Qe,{children:[i.jsx(hy,{idPrefix:"access",label:"Entry type",value:s,onChange:x=>{o(x),d("")},items:[{value:"channel",label:"Channels"},{value:"user",label:"Users"},{value:"usergroup",label:"User groups"}]}),i.jsxs(py,{idPrefix:"access",value:s,className:"space-y-3",children:[i.jsx(Le,{type:"search","aria-label":`Search ${Sd[s].toLowerCase()}s`,placeholder:"Search",value:u,onChange:x=>d(x.target.value)}),y.isLoading?i.jsx(kt,{}):y.isError?i.jsx(Ot,{error:y.error,onRetry:()=>void y.refetch()}):w.length===0?i.jsx("p",{className:"p-2 text-sm text-muted-foreground",children:"No matches."}):i.jsx("ul",{className:Xe("max-h-72 overflow-y-auto rounded-md border",y.isFetching&&"opacity-60"),children:w.map(x=>{const j=n.some(T=>Oo(T,{kind:s,slackId:x.id}));return i.jsxs("li",{className:"flex items-center gap-3 border-b px-3 py-2 text-sm last:border-b-0",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("p",{className:"flex items-center gap-1.5 truncate",children:[x.primary,x.icon]}),x.secondary&&i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:x.secondary})]}),i.jsx(oe,{size:"xs",variant:"outline",disabled:j,"aria-label":j?`${x.primary} already added`:`Add ${x.primary}`,onClick:()=>r({kind:s,slackId:x.id,label:x.label}),children:j?"Added":i.jsxs(i.Fragment,{children:[i.jsx(gd,{}),"Add"]})})]},x.id)})})]})]})]})}function BS(){const n=Yo();return n.data?i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Account"}),i.jsx(Tt,{children:"Change your password or username. Your other sessions will be signed out."})]}),i.jsx(Qe,{children:i.jsx(oy,{currentUsername:n.data.username,onDone:()=>We({title:"Account updated",variant:"success"})})})]}):i.jsx(kt,{})}const xy=["calendar"];function HS(){return Rt({queryKey:xy,queryFn:()=>Ee("/api/calendar")})}function QS(){const n=Ct();return Ft({mutationFn:r=>Ee(r.path,{method:r.method??"POST",body:r.body}),onSuccess:r=>{r&&"redirectUri"in r&&n.setQueryData(xy,r)}})}function VS(){var y,w;const n=HS(),r=QS(),[s,o]=k.useState(""),[u,d]=k.useState("");if(k.useEffect(()=>{n.data&&o(n.data.clientId??"")},[(y=n.data)==null?void 0:y.clientId]),n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const h=n.data,p=x=>j=>We({title:x,description:yt(j),variant:"error"}),g=()=>r.mutateAsync({path:"/api/calendar",method:"PUT",body:{clientId:s.trim(),...u.trim()?{clientSecret:u.trim()}:{}}}).then(()=>{d(""),We({title:"Google client saved",variant:"success"})}).catch(p("Couldn't save the Google client")),m=()=>Ee("/api/calendar/connect",{method:"POST"}).then(x=>window.location.assign(x.url)).catch(p("Couldn't start the Google sign-in"));return i.jsxs("div",{className:"space-y-4",children:[i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Calendar"}),i.jsx(Tt,{children:"The agent books meetings on its own Google calendar, around the attendees' availability (Google Calendar). Connect the Google account the agent should use (ideally its own account, e.g. jane@yourcompany.com). The sign-in stays encrypted on this machine; tasks never see Google's tokens."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Calendar for tasks"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Off: tasks don't get the calendar tools."})]}),i.jsx(ps,{checked:h.enabled,onCheckedChange:x=>void r.mutateAsync({path:"/api/calendar",method:"PUT",body:{enabled:x}}).catch(p("Couldn't change it")),"aria-label":"Calendar for tasks"})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:"Google account:"}),h.connected?i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"success",children:"Connected"}),i.jsx("code",{children:h.account}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>void r.mutateAsync({path:"/api/calendar/connection",method:"DELETE"}).catch(p("Couldn't disconnect")),children:"Disconnect"})]}):i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"muted",children:"Not connected"}),i.jsx(oe,{size:"sm",disabled:!h.configured,onClick:()=>void m(),children:"Connect Google"}),!h.configured&&i.jsx("span",{className:"text-muted-foreground",children:"Save the Google client below first."})]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("p",{className:"font-medium",children:["Invite people outside"," ",((w=h.account)==null?void 0:w.split("@")[1])??"the account's domain"]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Off: the agent can only invite people from its own Google Workspace domain."})]}),i.jsx(ps,{checked:h.allowExternal,onCheckedChange:x=>void r.mutateAsync({path:"/api/calendar",method:"PUT",body:{allowExternal:x}}).catch(p("Couldn't change it")),"aria-label":"Allow external guests"})]})]})]}),i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Google client"}),i.jsx(Tt,{children:"From your Google Cloud project (Google Auth Platform → Clients): a Web application client, with the Google Calendar API enabled. See the setup guide for the steps."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-1.5 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Authorized redirect URI (add it to the client exactly)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:h.redirectUri}),i.jsx(Js,{text:h.redirectUri})]})]}),i.jsx(qe,{label:"Client ID",children:x=>i.jsx(Le,{...x,value:s,onChange:j=>o(j.target.value),placeholder:"1234…apps.googleusercontent.com"})}),i.jsx(qe,{label:"Client secret",help:h.hasSecret?"Saved. Enter a new one only to replace it.":void 0,children:x=>i.jsx(Le,{...x,type:"password",autoComplete:"off",value:u,onChange:j=>d(j.target.value),placeholder:h.hasSecret?"••••••••":"GOCSPX-…"})}),i.jsx(oe,{onClick:()=>void g(),disabled:r.isPending||!s.trim(),children:"Save"})]})]})]})}function WS(){const[n,r]=k.useState(null),s=k.useRef(!1);return k.useEffect(()=>{if(s.current)return;s.current=!0;const o=new URLSearchParams(window.location.search),u=o.get("code"),d=o.get("state");if(window.history.replaceState(null,"","/calendar/callback"),o.get("error")||!u||!d){r({ok:!1,message:o.get("error")==="access_denied"?"The sign-in was cancelled.":"Google didn't complete the sign-in."});return}Ee("/api/calendar/exchange",{method:"POST",body:{code:u,state:d}}).then(h=>r({ok:!0,account:h.account})).catch(h=>r({ok:!1,message:yt(h)}))},[]),i.jsx("div",{className:"mx-auto max-w-lg p-6",children:i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6 text-sm",children:[n?n.ok?i.jsxs("p",{children:["Google Calendar is connected",n.account?i.jsxs(i.Fragment,{children:[" ","as ",i.jsx("code",{children:n.account})]}):null,"."]}):i.jsx("p",{className:"text-destructive",children:n.message}):i.jsx(kt,{label:"Connecting Google"}),i.jsx(Bt,{to:"/settings/calendar",className:"text-info underline",children:"Back to Calendar settings"})]})})})}function KS(){return i.jsxs("div",{className:"py-16 text-center",children:[i.jsx("h1",{className:"text-xl font-semibold",children:"Page not found"}),i.jsx(Bt,{to:"/",className:"mt-3 inline-block text-sm text-info underline",children:"Back to the dashboard"})]})}const GS=Xw([{element:i.jsx(bb,{}),children:[{path:"/login",element:i.jsx(Cb,{})},{path:"/change-password",element:i.jsx(km,{children:i.jsx(Nb,{})})},{element:i.jsx(km,{children:i.jsx(jb,{})}),children:[{index:!0,element:i.jsx(Rb,{})},{path:"requests",element:i.jsx(_b,{})},{path:"requests/:id",element:i.jsx(Ub,{})},{path:"schedules",element:i.jsx(tS,{})},{path:"setup",element:i.jsx(aS,{})},{path:"browser",element:i.jsx(uS,{})},{path:"tickets",element:i.jsx(pS,{})},{path:"trackers/linear/callback",element:i.jsx(kS,{})},{path:"trackers/jira/callback",element:i.jsx(jS,{})},{path:"calendar/callback",element:i.jsx(WS,{})},{path:"settings",element:i.jsx(SS,{}),children:[{index:!0,element:i.jsx(hd,{to:"agent",replace:!0})},{path:"agent",element:i.jsx(CS,{})},{path:"anthropic",element:i.jsx(ES,{})},{path:"general",element:i.jsx(LS,{})},{path:"slack",element:i.jsx(_S,{})},{path:"access",element:i.jsx(FS,{})},{path:"calendar",element:i.jsx(VS,{})},{path:"account",element:i.jsx(BS,{})}]},{path:"audit",element:i.jsx(eS,{})},{path:"*",element:i.jsx(KS,{})}]}]}]);function YS(){const n=k.useSyncExternalStore(Dj,Oj);return i.jsx("div",{"aria-live":"polite",role:"status",className:"pointer-events-none fixed bottom-4 right-4 z-50 flex w-full max-w-sm flex-col gap-2",children:n.map(r=>i.jsxs("div",{className:Xe("pointer-events-auto flex items-start gap-3 rounded-md border bg-card p-4 text-sm shadow-lg animate-in fade-in slide-in-from-bottom-2",r.variant==="error"&&"border-destructive/50",r.variant==="success"&&"border-success/50"),children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"font-medium",children:r.title}),r.description&&i.jsx("p",{className:"mt-1 break-words text-muted-foreground",children:r.description})]}),i.jsx("button",{type:"button",onClick:()=>ty(r.id),"aria-label":"Dismiss",className:"rounded-sm opacity-70 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Bd,{className:"h-4 w-4"})})]},r.id))})}const JS=new Set(["unauthorized","must_change_password","csrf"]),XS=new Ax({defaultOptions:{queries:{retry:(n,r)=>!(r instanceof Wn&&r.status>=400&&r.status<500)&&n<2,refetchOnWindowFocus:!0}},mutationCache:new eg({onError:(n,r,s,o)=>{var u;(u=o.meta)!=null&&u.inlineError||n instanceof Wn&&JS.has(n.code)||We({title:"Action failed",description:yt(n),variant:"error"})}})});fx.createRoot(document.getElementById("root")).render(i.jsx(ix.StrictMode,{children:i.jsxs(Dx,{client:XS,children:[i.jsx(ck,{router:GS}),i.jsx(YS,{})]})}));
|
|
311
|
+
`)});continue}const p=u.match(Kc);if(p){const m=/\d/.test(p[1]),y=[];for(;o<r.length;){const w=r[o].match(Kc);if(w&&/\d/.test(w[1])===m)y.push(w[2]),o++;else if(r[o].trim()&&/^\s{2,}/.test(r[o])&&y.length)y[y.length-1]+=" "+r[o].trim(),o++;else break}s.push({type:"list",ordered:m,items:y});continue}const g=[];for(;o<r.length&&r[o].trim()&&!/^(#{1,6})\s/.test(r[o])&&!/^\s*(```|~~~|>)/.test(r[o])&&!Kc.test(r[o]);)g.push(r[o++].trim());s.push({type:"para",text:g.join(" ")})}return s}const Db=/(`[^`]{1,500}`)|(\*\*[^*]{1,500}\*\*|__[^_]{1,500}__)|(\*[^*\s][^*]{0,500}\*|_[^_\s][^_]{0,500}_)|(\[[^\]]{1,300}\]\([^)\s]{1,2000}\))|(https?:\/\/[^\s<)]{1,2000})/,Sm=2e4;function Ys(n,r="i"){const s=[];let o=n.length>Sm?`${n.slice(0,Sm)}…`:n,u=0;for(;o;){const d=o.match(Db);if(!d||d.index===void 0){s.push(o);break}d.index>0&&s.push(o.slice(0,d.index));const h=d[0],p=`${r}-${u++}`;if(d[1])s.push(i.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:h.slice(1,-1)},p));else if(d[2])s.push(i.jsx("strong",{children:Ys(h.slice(2,-2),p)},p));else if(d[3])s.push(i.jsx("em",{children:Ys(h.slice(1,-1),p)},p));else if(d[4]){const g=h.match(/^\[([^\]]{1,300})\]\(([^)\s]{1,2000})\)$/),m=rl(g==null?void 0:g[2]);s.push(m?i.jsx("a",{href:m,target:"_blank",rel:"noreferrer noopener",className:"text-info underline",children:g==null?void 0:g[1]},p):i.jsx("span",{children:g==null?void 0:g[1]},p))}else if(d[5]){const g=rl(h);s.push(g?i.jsx("a",{href:g,target:"_blank",rel:"noreferrer noopener",className:"break-all text-info underline",children:h},p):h)}o=o.slice(d.index+h.length)}return s}function Ob(n,r){const s=n.match(/^\[([ xX])\]\s+(.*)$/);return s?i.jsxs("li",{className:"list-none",children:[i.jsx("span",{"aria-hidden":!0,className:"mr-1.5 font-mono text-muted-foreground",children:s[1]===" "?"[ ]":"[x]"}),Ys(s[2],r)]},r):i.jsx("li",{children:Ys(n,r)},r)}const Fb=["text-lg","text-base","text-sm","text-sm","text-sm","text-sm"];function Cm({source:n}){const r=Ab(n);return i.jsx("div",{className:"space-y-3 text-sm leading-relaxed",children:r.map((s,o)=>{const u=`b${o}`;switch(s.type){case"heading":{const d=`h${Math.min(s.level+2,6)}`;return i.jsx(d,{className:`${Fb[s.level-1]} mt-4 font-semibold first:mt-0`,children:Ys(s.text,u)},u)}case"para":return i.jsx("p",{children:Ys(s.text,u)},u);case"code":return i.jsx("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs",children:i.jsx("code",{children:s.text})},u);case"quote":return i.jsx("blockquote",{className:"border-l-2 pl-3 text-muted-foreground",children:Ys(s.text,u)},u);case"list":{const d=s.ordered?"ol":"ul";return i.jsx(d,{className:`${s.ordered?"list-decimal":"list-disc"} space-y-1 pl-5`,children:s.items.map((h,p)=>Ob(h,`${u}-${p}`))},u)}case"hr":return i.jsx("hr",{},u)}return null})})}const Nm=300;function Ib(n,r){const s=Ct(),[o,u]=k.useState([]),[d,h]=k.useState(null),[p,g]=k.useState("closed"),m=k.useRef(null);return k.useEffect(()=>{if(!r)return;g("connecting");const y=new EventSource(`/api/requests/${encodeURIComponent(n)}/stream`);return y.onopen=()=>g("open"),y.onerror=()=>g(y.readyState===EventSource.CLOSED?"closed":"connecting"),y.addEventListener("snapshot",w=>{let x;try{x=JSON.parse(w.data)}catch{return}const j=m.current;m.current=x,h(x),j&&(j.status!==x.status||j.planStatus!==x.planStatus||j.lastActivityAt!==x.lastActivityAt)&&(s.invalidateQueries({queryKey:Be.request(n)}),j.status!==x.status&&(s.invalidateQueries({queryKey:["requests","list"]}),s.invalidateQueries({queryKey:Be.dashboard})))}),y.addEventListener("activity",w=>{try{const x=JSON.parse(w.data);u(j=>j.length>=Nm?[...j.slice(-Nm+1),x]:[...j,x])}catch{}}),()=>{y.close(),g("closed")}},[n,r,s]),{activity:o,snapshot:d,state:p}}const zb=["live","conversation","turns","plans","artifacts","events"];function Ub(){var j;const{id:n=""}=uw(),r=Vj(n),[s,o]=qd();Wd();const u=(j=r.data)==null?void 0:j.request.status,d=u?!Lb.includes(u):!1,h=Ib(n,d),p=s.get("tab"),g=p&&zb.includes(p)&&(p!=="live"||d)?p:d?"live":"conversation",m=_=>o(E=>{const S=new URLSearchParams(E);return S.set("tab",_),S},{replace:!0});if(r.isLoading)return i.jsx(kt,{});if(r.isError||!r.data)return r.error instanceof Wn&&r.error.code==="not_found"?i.jsxs("div",{className:"space-y-4",children:[i.jsx(Em,{}),i.jsx(rn,{children:"This request does not exist."})]}):i.jsx(Ot,{error:r.error,onRetry:()=>void r.refetch()});const y=r.data,w=y.request,x=[...d?[{value:"live",label:i.jsx($b,{state:h.state})}]:[],{value:"conversation",label:`Conversation (${y.messages.length})`},{value:"turns",label:`Turns (${y.turns.length})`},{value:"plans",label:`Plans (${y.plans.length})`},{value:"artifacts",label:`Artifacts (${y.artifacts.length})`},{value:"events",label:"Events"}];return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Em,{}),i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0 space-y-2",children:[i.jsx("h1",{className:"break-words text-xl font-semibold",children:w.title}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(hl,{status:w.status}),w.planStatus!=="none"&&i.jsxs(tt,{variant:"outline",children:["Plan ",w.planStatus]}),i.jsxs("span",{children:["by ",w.requesterName??w.requesterId]}),i.jsxs("span",{children:["in ",w.channelName?`#${w.channelName}`:w.channelId]}),i.jsxs("span",{title:mn(w.createdAt),children:["opened ",Yt(w.createdAt)]}),i.jsxs("span",{children:["cost ",fl(w.costUsd)]})]})]}),i.jsx(dy,{request:w})]}),i.jsx(He,{children:i.jsxs(Qe,{className:"grid gap-x-8 gap-y-2 p-5 text-sm sm:grid-cols-2",children:[i.jsx(Lo,{label:"Branch",children:w.branch?i.jsx("code",{className:"text-xs",children:w.branch}):"None"}),i.jsx(Lo,{label:"Working directory",children:i.jsx("code",{className:"break-all text-xs",children:w.cwd||w.workdir})}),i.jsx(Lo,{label:"Last activity",children:i.jsx("span",{title:mn(w.lastActivityAt),children:Yt(w.lastActivityAt)})}),i.jsx(Lo,{label:"Pull requests",children:w.prs.length===0?"None":w.prs.map(_=>{const E=rl(_),S=y.prFollows.find(P=>P.url===_);return i.jsxs("span",{className:"mr-3 inline-block",children:[E?i.jsx("a",{href:E,target:"_blank",rel:"noreferrer noopener",className:"break-all text-info underline",children:my(_)}):_,S&&i.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",title:S.statusReason??S.lastError??void 0,children:["(",Zb(S),")"]})]},_)})}),w.pendingQuestion&&i.jsxs("div",{className:"rounded-md border border-warning/40 bg-warning-muted p-3 sm:col-span-2",children:[i.jsx("p",{className:"text-xs font-medium text-amber-300",children:"Waiting for an answer in Slack"}),i.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words",children:w.pendingQuestion})]})]})}),i.jsxs("div",{children:[i.jsx(hy,{idPrefix:"req",label:"Request details",items:x,value:g,onChange:m}),i.jsxs(py,{idPrefix:"req",value:g,children:[g==="live"&&i.jsx(qb,{activity:h.activity,state:h.state}),g==="conversation"&&i.jsx(Qb,{messages:y.messages}),g==="turns"&&i.jsx(Wb,{turns:y.turns}),g==="plans"&&i.jsx(Kb,{plans:y.plans}),g==="artifacts"&&i.jsx(Yb,{artifacts:y.artifacts,requestId:w.id}),g==="events"&&i.jsx(Xb,{events:y.events})]})]})]})}function Em(){return i.jsxs(Bt,{to:"/requests",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[i.jsx(Tg,{className:"h-4 w-4","aria-hidden":!0}),"Requests"]})}function Lo({label:n,children:r}){return i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"w-36 shrink-0 text-muted-foreground",children:n}),i.jsx("span",{className:"min-w-0",children:r})]})}function my(n){const r=n.match(/github\.com\/([^/]+\/[^/]+)\/pull\/(\d+)/);return r?`${r[1]}#${r[2]}`:n}function $b({state:n}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":!0,className:Xe("h-2 w-2 rounded-full",n==="open"?"animate-pulse bg-success":n==="connecting"?"bg-warning":"bg-muted-foreground")}),"Live"]})}function qb({activity:n,state:r}){const s=k.useRef(null),[o,u]=k.useState(!0);return k.useEffect(()=>{o&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[n,o]),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:r==="open"?"Connected. Showing live agent activity.":r==="connecting"?"Connecting":"Disconnected"}),i.jsxs("label",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",checked:o,onChange:d=>u(d.target.checked),className:"accent-current"}),"Follow"]})]}),i.jsx("div",{ref:s,className:"h-96 overflow-y-auto rounded-md border bg-black/40 p-3 font-mono text-xs","aria-live":"off",children:n.length===0?i.jsx("p",{className:"text-muted-foreground",children:"No activity yet. It appears here while a turn runs."}):n.map((d,h)=>i.jsxs("div",{className:"flex gap-3 py-0.5",children:[i.jsx("span",{className:"shrink-0 text-muted-foreground",children:new Date(d.ts).toLocaleTimeString()}),i.jsx("span",{className:Xe("shrink-0 w-10",d.kind==="tool"?"text-info":"text-success"),children:d.kind}),i.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words",children:d.text})]},h))})]})}const Bb={mention:"Mention",follow_up:"Follow-up",prior_context:"Prior context",unlisted:"Unlisted user",synthetic:"System",command:"Command"},Hb=["prior_context","unlisted"];function Qb({messages:n}){return n.length?i.jsx("ol",{className:"space-y-3",children:n.map(r=>{const s=Hb.includes(r.source);return i.jsxs("li",{className:Xe("rounded-md border p-3",s&&"border-dashed border-warning/50 bg-warning-muted/40"),children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"font-medium text-foreground",children:r.authorName??r.authorId??"System"}),i.jsxs(tt,{variant:s?"warning":"outline",children:[s&&i.jsx(L1,{className:"h-3 w-3","aria-hidden":!0}),Bb[r.source]]}),i.jsx(tt,{variant:r.state==="delivered"?"secondary":r.state==="pending"?"info":"muted",children:r.state}),i.jsx("span",{className:"ml-auto",title:mn(r.receivedAt),children:Yt(r.receivedAt)})]}),s&&i.jsx("p",{className:"mt-1 text-xs text-amber-300",children:"Untrusted: shown to the agent as context only, not as instructions."}),i.jsx("p",{className:"mt-2 whitespace-pre-wrap break-words text-sm",children:r.text})]},r.id)})}):i.jsx(rn,{children:"No messages."})}const Vb={answered:"success",asked:"warning",planned:"info",error:"destructive",cancelled:"muted",timeout:"destructive"};function wd({label:n,children:r,defaultOpen:s}){return i.jsxs("details",{className:"group mt-2",open:s,children:[i.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[i.jsx(_g,{className:"h-3 w-3 transition-transform group-open:rotate-90","aria-hidden":!0}),n]}),i.jsx("div",{className:"mt-2",children:r})]})}function Wb({turns:n}){return n.length?i.jsx("ol",{className:"space-y-3",children:n.map(r=>i.jsxs("li",{className:"rounded-md border p-3 text-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"font-medium",children:["Turn ",r.seq]}),r.mode==="plan"&&i.jsx(tt,{variant:"outline",children:"Plan mode"}),r.outcome?i.jsx(tt,{variant:Vb[r.outcome],children:r.outcome}):i.jsx(tt,{variant:"secondary",children:r.status}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["trigger: ",r.trigger]}),i.jsx("span",{className:"ml-auto text-xs text-muted-foreground",title:mn(r.startedAt),children:r.startedAt?Yt(r.startedAt):"not started"})]}),i.jsxs("dl",{className:"mt-2 flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted-foreground",children:[i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Duration "}),i.jsx("dd",{className:"inline text-foreground",children:yb(r.durationMs)})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Tokens "}),i.jsxs("dd",{className:"inline text-foreground",children:[jm(r.inputTokens)," in, ",jm(r.outputTokens)," out"]})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Cost "}),i.jsx("dd",{className:"inline text-foreground",children:fl(r.costUsd)})]}),r.stopReason&&i.jsxs("div",{children:[i.jsx("dt",{className:"inline",children:"Stop reason "}),i.jsx("dd",{className:"inline text-foreground",children:r.stopReason})]})]}),r.errorText&&i.jsx(wd,{label:"Error",defaultOpen:!0,children:i.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words rounded bg-destructive-muted p-2 text-xs text-red-200",children:r.errorText})}),r.resultText&&i.jsx(wd,{label:"Result",children:i.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 text-xs",children:r.resultText})})]},r.id))}):i.jsx(rn,{children:"No turns yet."})}function Kb({plans:n}){if(!n.length)return i.jsx(rn,{children:"No plans for this request."});const r=[...n].sort((s,o)=>o.version-s.version);return i.jsx("div",{className:"space-y-4",children:r.map((s,o)=>i.jsx(He,{children:i.jsxs(Qe,{className:"p-5",children:[i.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Version ",s.version]}),i.jsx(tt,{variant:s.status==="approved"?"success":s.status==="rejected"?"destructive":"warning",children:s.status}),s.decidedBy&&i.jsxs("span",{children:["by ",s.decidedBy," ",s.decidedAt?Yt(s.decidedAt):""]}),i.jsx("span",{className:"ml-auto",children:mn(s.createdAt)})]}),s.feedback&&i.jsxs("div",{className:"mb-3 rounded-md border bg-muted/40 p-3 text-sm",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Feedback"}),i.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words",children:s.feedback})]}),o===0?i.jsx(Cm,{source:s.markdown}):i.jsx(wd,{label:"Show plan",children:i.jsx(Cm,{source:s.markdown})})]})},s.version))})}function Gb({requestId:n}){var u;const s=((u=Rt({queryKey:["screenshots",n],queryFn:()=>Ee(`/api/requests/${encodeURIComponent(n)}/screenshots`),refetchInterval:15e3}).data)==null?void 0:u.items)??[];if(!s.length)return null;const o=d=>`/api/requests/${encodeURIComponent(n)}/screenshots/${d.split("/").map(encodeURIComponent).join("/")}`;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h3",{className:"text-sm font-medium",children:["Screenshots (",s.length,")"]}),i.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3",children:s.map(d=>i.jsxs("a",{href:o(d.name),target:"_blank",rel:"noreferrer noopener",className:"group overflow-hidden rounded-md border",children:[i.jsx("img",{src:o(d.name),alt:d.name,loading:"lazy",className:"aspect-video w-full bg-muted object-cover object-top"}),i.jsxs("div",{className:"flex justify-between gap-2 px-2 py-1 text-xs text-muted-foreground",children:[i.jsx("span",{className:"truncate",children:d.name}),i.jsx("span",{className:"shrink-0",children:Yt(d.mtime)})]})]},d.name))})]})}function Yb({artifacts:n,requestId:r}){return i.jsxs("div",{className:"space-y-4",children:[i.jsx(Gb,{requestId:r}),i.jsx(Jb,{artifacts:n})]})}function Jb({artifacts:n}){return n.length?i.jsx("ul",{className:"divide-y rounded-md border",children:n.map(r=>{const s=r.kind==="pr"?Wk:r.kind==="screenshot"?Xk:zk,o=rl(r.urlOrPath);return i.jsxs("li",{className:"flex items-center gap-3 p-3 text-sm",children:[i.jsx(s,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsxs("div",{className:"min-w-0 flex-1",children:[r.title&&i.jsx("p",{className:"truncate font-medium",children:r.title}),o?i.jsx("a",{href:o,target:"_blank",rel:"noreferrer noopener",className:"break-all text-xs text-info underline",children:r.kind==="pr"?my(r.urlOrPath):r.urlOrPath}):i.jsx("code",{className:"break-all text-xs text-muted-foreground",children:r.urlOrPath})]}),i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Yt(r.createdAt)})]},r.id)})}):i.jsx(rn,{children:"No artifacts yet."})}function Xb({events:n}){return n.length?i.jsx("div",{className:"overflow-x-auto rounded-md border",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Time"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Type"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Summary"})]})}),i.jsx("tbody",{className:"divide-y",children:n.map(r=>i.jsxs("tr",{children:[i.jsx("td",{className:"whitespace-nowrap px-3 py-1.5 text-xs text-muted-foreground",children:mn(r.ts)}),i.jsx("td",{className:"whitespace-nowrap px-3 py-1.5",children:i.jsx("code",{className:"text-xs",children:r.type})}),i.jsx("td",{className:"px-3 py-1.5 break-words",children:r.summary})]},r.id))})]})}):i.jsx(rn,{children:"No events."})}function Zb(n){const r=n.status==="active"?"following":n.status==="gave_up"?"left for a human":n.status==="paused"?"not following":n.status,s=n.status==="active"&&n.ci&&n.ci!=="none"?`, CI ${n.ci}`:"",o=n.status==="active"&&n.mergeable==="CONFLICTING"?", conflicts":"";return r+s+o}const Rm=50;function eS(){const[n,r]=qd(),s=Math.max(1,Number(n.get("page"))||1),o=ob(s,Rm);return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Audit log",description:"Admin sign-ins and configuration changes on this machine."}),o.isLoading?i.jsx(kt,{}):o.isError||!o.data?i.jsx(Ot,{error:o.error,onRetry:()=>void o.refetch()}):o.data.items.length===0?i.jsx(rn,{children:"No audit entries yet."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Xe("overflow-x-auto rounded-lg border",o.isPlaceholderData&&"opacity-60"),children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Time"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Actor"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Action"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Detail"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"IP"})]})}),i.jsx("tbody",{className:"divide-y",children:o.data.items.map(u=>i.jsxs("tr",{children:[i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-muted-foreground",children:mn(u.ts)}),i.jsx("td",{className:"px-3 py-2",children:u.actor}),i.jsx("td",{className:"px-3 py-2",children:i.jsx("code",{className:"text-xs",children:u.action})}),i.jsx("td",{className:"max-w-md break-words px-3 py-2 text-muted-foreground",children:u.detail??""}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-xs text-muted-foreground",children:u.ip??""})]},u.id))})]})}),i.jsx(uy,{page:s,pageSize:Rm,total:o.data.total,onPage:u=>r(u===1?{}:{page:String(u)},{replace:!0})})]})]})}const ps=k.forwardRef(({checked:n,onCheckedChange:r,className:s,...o},u)=>i.jsx("button",{ref:u,type:"button",role:"switch","aria-checked":n,onClick:()=>r(!n),className:Xe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",n?"bg-primary":"bg-input",s),...o,children:i.jsx("span",{className:Xe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",n?"translate-x-5":"translate-x-0")})}));ps.displayName="Switch";const Pm={pending:{label:"Waiting for confirmation",variant:"warning"},active:{label:"Active",variant:"success"},paused:{label:"Paused",variant:"muted"}};function tS(){const n=ub(),r=ry(),s=fb(),o=db(),[u,d]=k.useState(null),[h,p]=k.useState(null),g=(m,y)=>r.mutate({id:m.id,patch:{status:y?"active":"paused"}},{onError:w=>We({title:"Couldn't change the schedule",description:yt(w),variant:"error"})});return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Schedules",description:"Recurring tasks and one-time reminders people set up in Slack (for example daily insights in a channel). Each run posts its result in the channel; replies in its thread continue the conversation. A one-time task leaves this list after it runs."}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):n.data.length===0?i.jsx(rn,{children:`No schedules yet. Ask the agent in Slack, e.g. "send a summary of yesterday's sales every weekday at 9:00 in this channel".`}):i.jsx("div",{className:"overflow-x-auto rounded-lg border",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-muted/40 text-left text-xs text-muted-foreground",children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Schedule"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"When"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Channel"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Next run"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last run"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"On"}),i.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:i.jsx("span",{className:"sr-only",children:"Actions"})})]})}),i.jsx("tbody",{className:"divide-y",children:n.data.map(m=>i.jsxs("tr",{className:"align-top",children:[i.jsxs("td",{className:"px-3 py-2",children:[i.jsx("button",{type:"button",className:"text-left font-medium hover:underline",onClick:()=>d(m),children:m.title}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(tt,{variant:Pm[m.status].variant,children:Pm[m.status].label}),i.jsxs("span",{children:["by ",m.createdByName??m.createdBy]})]}),m.statusReason&&i.jsx("div",{className:"mt-1 text-xs text-amber-300",children:m.statusReason})]}),i.jsxs("td",{className:"whitespace-nowrap px-3 py-2",children:[m.when,i.jsx("div",{className:"text-xs text-muted-foreground",children:m.timezone})]}),i.jsxs("td",{className:"whitespace-nowrap px-3 py-2",children:["#",m.channelName??m.channelId]}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-muted-foreground",children:m.nextRunAt?i.jsx("span",{title:mn(m.nextRunAt),children:Yt(m.nextRunAt)}):"—"}),i.jsx("td",{className:"whitespace-nowrap px-3 py-2",children:m.lastRunAt?i.jsxs("div",{className:"flex items-center gap-2",children:[m.lastRunStatus==="missed"?i.jsx(tt,{variant:"muted",children:"Missed"}):m.lastRunStatus?i.jsx(hl,{status:m.lastRunStatus}):null,m.lastRequestId?i.jsx(Bt,{to:`/requests/${m.lastRequestId}`,className:"text-xs text-muted-foreground hover:underline",children:Yt(m.lastRunAt)}):i.jsx("span",{className:"text-xs text-muted-foreground",children:Yt(m.lastRunAt)})]}):i.jsx("span",{className:"text-muted-foreground",children:"Never"})}),i.jsx("td",{className:"px-3 py-2",children:i.jsx(ps,{checked:m.status==="active",disabled:m.status==="pending"||r.isPending,"aria-label":m.status==="active"?`Pause ${m.title}`:`Resume ${m.title}`,onCheckedChange:y=>g(m,y)})}),i.jsxs("td",{className:"whitespace-nowrap px-3 py-2 text-right",children:[i.jsxs(oe,{variant:"ghost",size:"sm",disabled:m.status==="pending"||s.isPending,onClick:()=>s.mutate(m.id,{onSuccess:()=>We({title:"Run started",description:`#${m.channelName??m.channelId}`,variant:"success"}),onError:y=>We({title:"Couldn't start the run",description:yt(y),variant:"error"})}),children:[i.jsx(p1,{className:"h-4 w-4","aria-hidden":!0})," Run now"]}),i.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>d(m),"aria-label":`Edit ${m.title}`,children:i.jsx(f1,{className:"h-4 w-4","aria-hidden":!0})}),i.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>p(m),"aria-label":`Delete ${m.title}`,children:i.jsx(qo,{className:"h-4 w-4","aria-hidden":!0})})]})]},m.id))})]})}),u&&i.jsx(nS,{schedule:u,onClose:()=>d(null)}),i.jsx(Gd,{open:!!h,title:"Delete this schedule?",description:h?`"${h.title}" stops running. Past runs stay in Requests.`:"",confirmLabel:"Delete",destructive:!0,pending:o.isPending,onClose:()=>p(null),onConfirm:()=>h&&o.mutate(h.id,{onSuccess:()=>p(null),onError:m=>We({title:"Couldn't delete",description:yt(m),variant:"error"})})})]})}function nS({schedule:n,onClose:r}){var E;const s=cb(n.id),o=ry(),[u,d]=k.useState(n.title),[h,p]=k.useState(n.prompt),[g,m]=k.useState(n.cron),[y,w]=k.useState(n.timezone),[x,j]=k.useState(null),_=()=>{j(null);const S={...u!==n.title&&{title:u},...h!==n.prompt&&{prompt:h},...g!==n.cron&&{cron:g},...y!==n.timezone&&{timezone:y}};if(!Object.keys(S).length)return r();o.mutate({id:n.id,patch:S},{onSuccess:()=>{We({title:"Schedule saved",variant:"success"}),r()},onError:P=>{var U,Q;const D=(Q=(U=P.body)==null?void 0:U.error)==null?void 0:Q.field;j({field:D,message:yt(P)})}})};return i.jsx(Kd,{open:!0,onClose:r,title:"Edit schedule",description:`${n.when} (${n.timezone}) · #${n.channelName??n.channelId}`,className:"max-w-2xl",footer:i.jsxs(i.Fragment,{children:[i.jsx(oe,{variant:"outline",onClick:r,children:"Cancel"}),i.jsx(oe,{onClick:_,disabled:o.isPending,children:"Save"})]}),children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Oe,{label:"Title",error:(x==null?void 0:x.field)==="title"?x.message:null,children:S=>i.jsx(Re,{...S,value:u,maxLength:80,onChange:P=>d(P.target.value)})}),i.jsx(Oe,{label:"What to do on each run",help:"Runs start without the original conversation, so keep this self-contained.",children:S=>i.jsx("textarea",{...S,value:h,maxLength:4e3,rows:6,onChange:P=>p(P.target.value),className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsx(Oe,{label:"When (cron)",help:"minute hour day month weekday, e.g. 0 9 * * 1-5 for weekdays at 9:00",error:(x==null?void 0:x.field)==="cron"?x.message:null,children:S=>i.jsx(Re,{...S,value:g,onChange:P=>m(P.target.value),className:"font-mono"})}),i.jsx(Oe,{label:"Timezone",help:"e.g. America/Sao_Paulo",error:(x==null?void 0:x.field)==="timezone"?x.message:null,children:S=>i.jsx(Re,{...S,value:y,onChange:P=>w(P.target.value)})})]}),x&&!["title","cron","timezone"].includes(x.field??"")&&i.jsx("p",{className:"text-sm text-red-300",children:x.message}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-medium",children:"Recent runs"}),s.isLoading?i.jsx(kt,{}):(E=s.data)!=null&&E.runs.length?i.jsx("ul",{className:"divide-y rounded-md border text-sm",children:s.data.runs.map(S=>i.jsxs("li",{className:"flex items-center justify-between gap-2 px-3 py-2",children:[i.jsx(Bt,{to:`/requests/${S.requestId}`,className:"hover:underline",onClick:r,children:mn(S.createdAt)}),i.jsx(hl,{status:S.status})]},S.requestId))}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"No runs yet."})]})]})})}const rS=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/,sS="flex w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";function aS(){const n=hb();return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Setup",description:"Commands a fresh worktree needs before the agent starts: install dependencies, copy an example env file, build. They run in the same sandbox as the agent, once per worktree, without FDA's tokens or the Anthropic key. The agent can propose a script; it only runs after you approve it here."}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):!n.data.workdir||!n.data.isRepo?i.jsxs(rn,{children:["Setup scripts run in per-request worktrees, so the working directory must be a git repository. The current one"," ",n.data.workdir?i.jsx("code",{children:n.data.workdir}):"isn't set",n.data.workdir?" isn't a repository":"","."]}):i.jsx(iS,{repoPath:n.data.workdir,row:n.data.scripts.find(r=>r.repoPath===n.data.workdir)??null})]})}function iS({repoPath:n,row:r}){const s=pb(),o=mb(),[u,d]=k.useState((r==null?void 0:r.script)??""),[h,p]=k.useState((r==null?void 0:r.onFailure)??"continue"),[g,m]=k.useState(String((r==null?void 0:r.timeoutSec)??600)),[y,w]=k.useState((r==null?void 0:r.enabled)??!0);k.useEffect(()=>{d((r==null?void 0:r.script)??""),p((r==null?void 0:r.onFailure)??"continue"),m(String((r==null?void 0:r.timeoutSec)??600)),w((r==null?void 0:r.enabled)??!0)},[r==null?void 0:r.updatedAt]);const x=E=>S=>We({title:E,description:yt(S),variant:"error"}),j=()=>s.mutate({repoPath:n,script:u.trim()||null,onFailure:h,timeoutSec:Number(g),enabled:y},{onSuccess:()=>We({title:"Setup script saved"}),onError:x("Couldn't save the setup script")}),_=E=>{var S;return o.mutate({repoPath:n,action:E,proposedAt:((S=r==null?void 0:r.proposal)==null?void 0:S.at)??null},{onSuccess:()=>We(E==="approve"?{title:"Proposal approved",description:"It's saved and runs in every new worktree (no need to press Save)."}:{title:"Proposal dismissed"}),onError:x("Couldn't update the proposal")})};return i.jsxs("div",{className:"space-y-4",children:[(r==null?void 0:r.proposal)&&i.jsx(He,{className:"border-warning/40",children:i.jsxs(Qe,{className:"space-y-3 p-5 text-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(tt,{variant:"warning",children:"Proposed by the agent"}),r.proposal.at&&i.jsx("span",{className:"text-muted-foreground",title:mn(r.proposal.at),children:Yt(r.proposal.at)}),r.proposal.requestId&&i.jsx(Bt,{to:`/requests/${r.proposal.requestId}`,className:"text-info underline",children:"from this request"})]}),r.proposal.reason&&i.jsx("p",{children:r.proposal.reason}),rS.test(r.proposal.script)&&i.jsx("p",{className:"text-xs font-medium text-destructive",children:"This script contains invisible or direction-changing characters. Don't approve it unless you know why."}),i.jsx("pre",{className:"max-h-72 overflow-auto rounded-md bg-muted/40 p-3 font-mono text-xs",children:r.proposal.script}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Read it before approving: it will run in every new worktree."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(oe,{size:"sm",onClick:()=>_("approve"),disabled:o.isPending,children:"Approve and use"}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>_("reject"),disabled:o.isPending,children:"Dismiss"})]})]})}),i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-4 p-5",children:[i.jsxs("p",{className:"text-sm",children:["Repository ",i.jsx("code",{className:"text-xs",children:n})]}),i.jsx(Oe,{label:"Script",help:"Runs with bash in the new worktree. Example: npm ci && cp -n .env.example .env",children:E=>i.jsx("textarea",{...E,value:u,rows:8,maxLength:2e4,spellCheck:!1,placeholder:"npm ci",onChange:S=>d(S.target.value),className:sS})}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[i.jsx(Oe,{label:"If it fails",help:"Continue tells the agent what failed; Stop fails the request.",children:E=>i.jsxs(eu,{...E,value:h,onChange:S=>p(S.target.value),children:[i.jsx("option",{value:"continue",children:"Continue"}),i.jsx("option",{value:"fail",children:"Stop"})]})}),i.jsx(Oe,{label:"Timeout (seconds)",help:"10 to 3600.",children:E=>i.jsx(Re,{...E,type:"number",min:10,max:3600,value:g,onChange:S=>m(S.target.value)})}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"text-sm font-medium",children:"Enabled"}),i.jsx(ps,{checked:y,onCheckedChange:w,"aria-label":"Run the setup script"})]})]}),i.jsx(oe,{onClick:j,disabled:s.isPending,children:"Save"})]})}),i.jsxs("div",{children:[i.jsx("h2",{className:"mb-2 text-sm font-medium",children:"Recent runs"}),r!=null&&r.runs.length?i.jsx("ul",{className:"divide-y rounded-md border",children:r.runs.map(E=>i.jsxs("li",{className:"space-y-2 p-3 text-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(tt,{variant:E.status==="ok"?"success":E.status==="timeout"?"warning":"destructive",children:E.status==="ok"?"OK":E.status==="timeout"?"Timed out":`Failed (exit ${E.exitCode??"?"})`}),i.jsx("span",{className:"text-muted-foreground",title:mn(E.startedAt),children:Yt(E.startedAt)}),E.durationMs!==null&&i.jsxs("span",{className:"text-muted-foreground",children:[Math.round(E.durationMs/1e3),"s"]}),i.jsx(Bt,{to:`/requests/${E.requestId}`,className:"text-info underline",children:"request"})]}),E.log&&i.jsxs("details",{children:[i.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:"Output"}),i.jsx("pre",{className:"mt-2 max-h-72 overflow-auto rounded-md bg-muted/40 p-3 font-mono text-xs",children:E.log})]})]},E.id))}):i.jsx(rn,{children:"No runs yet."})]})]})}const kd=["browser"],lS=new Set(["Enter","Tab","Backspace","Delete","Escape","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function oS(){return Rt({queryKey:kd,queryFn:()=>Ee("/api/browser"),refetchInterval:2e4})}function gy(){const n=Ct();return Ft({mutationFn:r=>Ee(r.path,{method:r.method??"POST",body:r.body}),onSuccess:r=>{r&&"sites"in r&&n.setQueryData(kd,r)},onSettled:()=>void n.invalidateQueries({queryKey:kd})})}function uS(){const n=oS();return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Browser",description:"Sign the agent in to the sites it needs (a staging app, a dashboard). You drive a browser on this machine from here; Save and close keeps its cookies (encrypted), and every browser task starts signed in. Use test accounts: the agent can read what its browser holds."}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):n.data.installed?i.jsxs(i.Fragment,{children:[!n.data.enabled&&i.jsx("p",{className:"rounded-md border border-warning/50 bg-warning-muted p-3 text-sm",children:"The browser is off for tasks (Settings → General → Browser). You can still save sign-ins now; tasks use them once it's on."}),i.jsx(cS,{data:n.data}),i.jsx(dS,{data:n.data})]}):i.jsxs(rn,{children:["The browser isn't installed on this machine. Install it there with"," ",i.jsx("code",{children:"superclawd fda browser install"}),", then enable it in Settings → General."]})]})}function cS({data:n}){const r=gy(),[s,o]=k.useState(""),[u,d]=k.useState(null),h=k.useRef(null),p=k.useRef(null),g=n.session.open,{width:m,height:y}=n.session.viewport;k.useEffect(()=>{if(!g){d(null);return}const P=new EventSource("/api/browser/session/stream");return P.addEventListener("frame",D=>{const U=JSON.parse(D.data);d({src:`data:image/jpeg;base64,${U.data}`,url:U.url,title:U.title,tabs:U.tabs})}),P.addEventListener("closed",()=>P.close()),P.addEventListener("expired",()=>P.close()),()=>P.close()},[g]),k.useEffect(()=>{var P;u!=null&&u.url&&((P=document.activeElement)==null?void 0:P.id)!=="browser-address"&&o(u.url)},[u==null?void 0:u.url]);const w=P=>D=>We({title:P,description:yt(D),variant:"error"}),x=P=>Ee("/api/browser/session/input",{method:"POST",body:P}).catch(w("Couldn't send that to the browser")),j=P=>{const D=h.current.getBoundingClientRect();return{x:Math.round((P.clientX-D.left)/D.width*m),y:Math.round((P.clientY-D.top)/D.height*y)}},_=P=>r.mutateAsync({path:"/api/browser/session",body:{url:P}}).catch(w("Couldn't open the page")),E=P=>{if(!g)return;const D=[P.ctrlKey&&"Control",P.altKey&&"Alt",P.metaKey&&"Meta"].filter(Boolean);lS.has(P.key)?(P.preventDefault(),x({type:"key",key:[...D,...P.shiftKey?["Shift"]:[],P.key].join("+")})):P.key.length===1&&D.length?(P.preventDefault(),x({type:"key",key:[...D,P.key].join("+")})):P.key.length===1&&(P.preventDefault(),x({type:"text",text:P.key}))},S=P=>{const D=P.clipboardData.getData("text/plain");!D||!g||(P.preventDefault(),x({type:"text",text:D.slice(0,2e3)}))};return i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6",children:[i.jsxs("form",{className:"flex items-center gap-2",onSubmit:P=>{P.preventDefault(),s.trim()&&_(s.trim())},children:[i.jsx(oe,{type:"button",variant:"outline",size:"icon","aria-label":"Back",disabled:!g,onClick:()=>void Ee("/api/browser/session/go",{method:"POST",body:{action:"back"}}).catch(w("Couldn't go back")),children:i.jsx(Tg,{className:"h-4 w-4"})}),i.jsx(oe,{type:"button",variant:"outline",size:"icon","aria-label":"Forward",disabled:!g,onClick:()=>void Ee("/api/browser/session/go",{method:"POST",body:{action:"forward"}}).catch(w("Couldn't go forward")),children:i.jsx(Lg,{className:"h-4 w-4"})}),i.jsx(oe,{type:"button",variant:"outline",size:"icon","aria-label":"Reload",disabled:!g,onClick:()=>void Ee("/api/browser/session/go",{method:"POST",body:{action:"reload"}}).catch(w("Couldn't reload")),children:i.jsx(k1,{className:"h-4 w-4"})}),i.jsx(Re,{id:"browser-address",value:s,onChange:P=>o(P.target.value),placeholder:"https://staging.example.com/login","aria-label":"Address",className:"flex-1"}),i.jsxs(oe,{type:"submit",disabled:r.isPending||!s.trim(),children:[i.jsx(Ag,{className:"mr-1 h-4 w-4"}),g?"Go":"Open browser"]})]}),g?i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:p,tabIndex:0,role:"application","aria-label":"Remote browser: click to focus, then type",className:"relative overflow-hidden rounded-md border bg-muted outline-none focus:ring-2 focus:ring-ring",onKeyDown:E,onPaste:S,children:u?i.jsx("img",{ref:h,src:u.src,alt:u.title||"Remote browser",draggable:!1,className:"block w-full cursor-pointer select-none",style:{aspectRatio:`${m} / ${y}`},onClick:P=>{var D;(D=p.current)==null||D.focus(),x({type:"click",...j(P)})},onDoubleClick:P=>void x({type:"click",double:!0,...j(P)}),onContextMenu:P=>{P.preventDefault(),x({type:"click",button:"right",...j(P)})},onWheel:P=>void x({type:"wheel",...j(P),dx:Math.round(P.deltaX),dy:Math.round(P.deltaY)})}):i.jsx("div",{className:"flex items-center justify-center text-sm text-muted-foreground",style:{aspectRatio:`${m} / ${y}`},children:"Loading the page…"})}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{children:"Click the page, then type. Paste works too. Passwords you type go straight to the site; they aren't stored by FDA."}),u&&u.tabs>1&&i.jsxs(tt,{variant:"secondary",children:[u.tabs," tabs (showing the newest)"]}),!n.session.sandboxed&&i.jsx(tt,{variant:"secondary",children:"Chrome sandbox unavailable on this host"}),n.session.idleClosesAt&&i.jsxs("span",{children:["Closes when idle, latest ",mn(n.session.idleClosesAt),"."]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/browser/session/save",body:{close:!0}}).then(()=>We({title:"Sign-ins saved",description:"New browser tasks start signed in. Open the browser again to add another site."})).catch(w("Couldn't save the sign-ins")),children:[i.jsx(b1,{className:"mr-1 h-4 w-4"}),"Save and close"]}),i.jsxs(oe,{variant:"outline",disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/browser/session",method:"DELETE"}).catch(w("Couldn't close the browser")),children:[i.jsx(Bd,{className:"mr-1 h-4 w-4"}),"Close without saving"]})]})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the sign-in page of a site and open the browser. Sign in as you normally would (including two-factor), then Save and close."})]})})}function dS({data:n}){const r=gy(),[s,o]=k.useState(null),u=d=>h=>We({title:d,description:yt(h),variant:"error"});return i.jsxs(He,{children:[i.jsxs(Qe,{className:"space-y-3 pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"font-medium",children:"Signed-in sites"}),n.sites.length>1&&i.jsx(oe,{variant:"outline",size:"sm",onClick:()=>o("all"),children:"Sign out of all"})]}),n.sites.length?i.jsx("ul",{className:"divide-y rounded-md border",children:n.sites.map(d=>i.jsxs("li",{className:"flex items-center gap-3 px-3 py-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:d.site}),i.jsxs("span",{className:"text-muted-foreground",children:[d.cookies," cookie",d.cookies===1?"":"s",d.origins?`, local storage on ${d.origins}`:"",d.expiresAt?`, until ${mn(d.expiresAt)}`:", session only"]}),i.jsxs(oe,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>o(d.site),children:[i.jsx(Dg,{className:"mr-1 h-4 w-4"}),"Sign out"]})]},d.site))}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"None yet. Browser tasks start with a clean browser."}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Signing out here removes the saved cookies from this machine. It doesn't end the session on the site itself; to be sure, sign out there or change the password."})]}),i.jsx(Gd,{open:s!==null,onClose:()=>o(null),title:s==="all"?"Sign out of all sites?":`Sign out of ${s}?`,description:"New browser tasks will start without these sign-ins.",confirmLabel:"Sign out",destructive:!0,onConfirm:()=>{const d=s;o(null),r.mutateAsync({path:d==="all"?"/api/browser/sites":`/api/browser/sites/${encodeURIComponent(d)}`,method:"DELETE"}).catch(u("Couldn't sign out"))}})]})}function Js({text:n,label:r="Copy"}){const[s,o]=k.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(n),o(!0),setTimeout(()=>o(!1),1500)}catch{We({title:"Could not copy",description:"Select the text and copy it manually.",variant:"error"})}};return i.jsxs(oe,{variant:"outline",size:"sm",onClick:u,children:[s?i.jsx(Mg,{}):i.jsx(_k,{}),s?"Copied":r]})}const yy=["tickets"],fS={queued:{label:"Queued",variant:"muted"},working:{label:"Working",variant:"info"},waiting:{label:"Waiting for a reply",variant:"warning"},in_review:{label:"PR in review",variant:"info"},done:{label:"Done",variant:"success"},released:{label:"Taken off",variant:"muted"},refused:{label:"Refused",variant:"destructive"}};function hS(){return Rt({queryKey:yy,queryFn:()=>Ee("/api/tickets"),refetchInterval:15e3})}function Xa(){const n=Ct();return Ft({mutationFn:r=>Ee(r.path,{method:r.method??"POST",body:r.body}),onSuccess:r=>{r&&"items"in r&&n.setQueryData(yy,r)}})}const Vn=n=>r=>We({title:n,description:yt(r),variant:"error"});function pS(){const n=hS(),r=Xa();if(n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const s=n.data;return i.jsxs("div",{className:"space-y-4",children:[i.jsx(ys,{title:"Tickets",description:"People hand tickets to the agent in Linear (assign or @mention it) or GitHub (a label). It works them one at a time in its own worktree, opens a pull request, follows CI and reviews, and replies on the ticket. Only people on the access list can hand tickets over; the ticket's text is treated as data, not instructions.",actions:i.jsxs(oe,{variant:"outline",size:"sm",disabled:r.isPending||!s.settings.enabled,onClick:()=>void r.mutateAsync({path:"/api/tickets/poll"}).then(o=>We({title:"Checked",description:`${o.handled} new event(s).`})).catch(Vn("Couldn't check the trackers")),children:[i.jsx(y1,{className:"mr-1 h-4 w-4"}),"Check now"]})}),i.jsx(mS,{d:s}),i.jsx(gS,{d:s}),i.jsx(yS,{d:s}),s.jira.available&&i.jsx(vS,{d:s}),i.jsx(xS,{d:s}),i.jsx(wS,{d:s})]})}function Xi({label:n,help:r,checked:s,onChange:o}){return i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:n}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),i.jsx(ps,{checked:s,onCheckedChange:o,"aria-label":n})]})}function mS({d:n}){const r=Xa(),s=n.settings,[o,u]=k.useState(String(s.atATime)),[d,h]=k.useState(s.budgetUsd===null?"":String(s.budgetUsd)),[p,g]=k.useState(s.dailyBudgetUsd===null?"":String(s.dailyBudgetUsd)),[m,y]=k.useState(s.statusOnPr??""),[w,x]=k.useState(s.statusOnQuestion??""),[j,_]=k.useState(s.questionReminderHours===null?"":String(s.questionReminderHours)),[E,S]=k.useState(s.slackChannel??""),P=(D,U)=>r.mutateAsync({path:"/api/tickets",method:"PUT",body:D}).then(()=>U&&We({title:U,variant:"success"})).catch(Vn("Couldn't save"));return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"How it works on tickets"}),i.jsx(Tt,{children:"Off by default. Turn it on once a tracker is connected."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsx(Xi,{label:"Work on handed-over tickets",help:"Off: tickets are ignored (nothing is read or posted).",checked:s.enabled,onChange:D=>void P({enabled:D})}),i.jsx(Xi,{label:"Auto-merge pull requests",help:"Turns on GitHub auto-merge for a ticket's PR: it merges only when required checks and approvals pass. Off: people merge.",checked:s.autoMerge,onChange:D=>void P({autoMerge:D})}),i.jsx(Xi,{label:"Move tickets to In Progress",help:"When work starts (Linear: the team's first started state).",checked:s.statusOnStart,onChange:D=>void P({statusOnStart:D})}),i.jsx(Xi,{label:"DM the person when a ticket needs them",help:"A question or plan on a ticket mentions whoever handed it over there, and (when their email matches a Slack person) sends them a Slack DM. Needs the im:write scope.",checked:s.dmOnQuestion,onChange:D=>void P({dmOnQuestion:D})}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[i.jsx(Oe,{label:"Tickets at a time",help:"Pull requests in review don't count.",children:D=>i.jsx(Re,{...D,type:"number",min:1,max:8,value:o,onChange:U=>u(U.target.value)})}),i.jsx(Oe,{label:"Budget per ticket (USD)",help:"All its turns together. Empty: unlimited.",children:D=>i.jsx(Re,{...D,type:"number",min:.5,step:.5,value:d,placeholder:"Unlimited",onChange:U=>h(U.target.value)})}),i.jsx(Oe,{label:"Daily budget for tickets (USD)",help:"Tickets wait once it's spent. Empty: unlimited.",children:D=>i.jsx(Re,{...D,type:"number",min:1,value:p,placeholder:"Unlimited",onChange:U=>g(U.target.value)})}),i.jsx(Oe,{label:"State when the PR opens",help:"By name, e.g. In Review (empty: don't move).",children:D=>i.jsx(Re,{...D,value:m,onChange:U=>y(U.target.value),placeholder:"In Review"})}),i.jsx(Oe,{label:"State while waiting on a question",help:"By name, e.g. Blocked (GitHub: a label). Moved back when answered. Empty: don't move.",children:D=>i.jsx(Re,{...D,value:w,onChange:U=>x(U.target.value),placeholder:"Blocked"})}),i.jsx(Oe,{label:"Remind after (hours)",help:"One reminder on the ticket and by DM if nobody answers. Empty: never.",children:D=>i.jsx(Re,{...D,type:"number",min:1,max:720,value:j,placeholder:"Never",onChange:U=>_(U.target.value)})}),i.jsx(Oe,{label:"PR review channel",help:"Optional. The FDA posts each pull request it opens here and reacts when it's merged. Channel id (C…).",children:D=>i.jsx(Re,{...D,value:E,onChange:U=>S(U.target.value),placeholder:"C0123456789"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void P({atATime:Number(o),budgetUsd:d.trim()?Number(d):null,dailyBudgetUsd:p.trim()?Number(p):null,statusOnPr:m.trim(),statusOnQuestion:w.trim(),questionReminderHours:j.trim()?Number(j):null,slackChannel:E.trim()},"Saved"),children:"Save"})]})]})}function gS({d:n}){const r=Xa(),s=n.linear,[o,u]=k.useState(s.clientId??""),[d,h]=k.useState(""),[p,g]=k.useState(s.teams.join(", "));return k.useEffect(()=>u(s.clientId??""),[s.clientId]),i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Linear"}),i.jsx(Tt,{children:"The agent is a Linear app (agents don't take a paid seat). People delegate an issue to it or @mention it; it reports in the issue's agent session. Create an OAuth app in Linear (Settings → API → OAuth applications), with this redirect URI, then connect it as an app."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:"Workspace:"}),s.connected?i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"success",children:"Connected"}),i.jsx("code",{children:s.workspace}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>void r.mutateAsync({path:"/api/tickets/linear/connection",method:"DELETE"}).catch(Vn("Couldn't disconnect")),children:"Disconnect"})]}):i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"muted",children:"Not connected"}),i.jsx(oe,{size:"sm",disabled:!s.configured,onClick:()=>void Ee("/api/tickets/linear/connect",{method:"POST"}).then(m=>window.location.assign(m.url)).catch(Vn("Couldn't start the Linear install")),children:"Connect Linear"}),!s.configured&&i.jsx("span",{className:"text-muted-foreground",children:"Save the client below first."})]})]}),i.jsxs("div",{className:"space-y-1.5 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Callback URL (add it to the Linear OAuth app)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:s.redirectUri}),i.jsx(Js,{text:s.redirectUri})]})]}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[i.jsx(Oe,{label:"Client ID",children:m=>i.jsx(Re,{...m,value:o,onChange:y=>u(y.target.value)})}),i.jsx(Oe,{label:"Client secret",help:s.hasSecret?"Saved. Enter a new one only to replace it.":void 0,children:m=>i.jsx(Re,{...m,type:"password",autoComplete:"off",value:d,onChange:y=>h(y.target.value),placeholder:s.hasSecret?"••••••••":""})}),i.jsx(Oe,{label:"Teams",help:"Team keys, comma separated (empty: every team it can see).",children:m=>i.jsx(Re,{...m,value:p,onChange:y=>g(y.target.value),placeholder:"ENG, OPS"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{linearClientId:o.trim(),...d.trim()?{linearClientSecret:d.trim()}:{},linearTeams:p.split(",").map(m=>m.trim()).filter(Boolean)}}).then(()=>{h(""),We({title:"Linear saved",variant:"success"})}).catch(Vn("Couldn't save Linear")),children:"Save"})]})]})}function yS({d:n}){const r=Xa(),[s,o]=k.useState(n.github.repos.join(", ")),[u,d]=k.useState(n.github.label),[h,p]=k.useState(n.github.people.join(", "));return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"GitHub Issues"}),i.jsx(Tt,{children:"GitHub doesn't let apps be assignees, so an issue is handed over with a label. Whoever adds it must be listed under People and have write access. Uses this machine's GitHub login (the same as pull requests); replies are comments."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.jsx(Oe,{label:"Repositories",help:"owner/name, comma separated.",children:g=>i.jsx(Re,{...g,value:s,onChange:m=>o(m.target.value),placeholder:"acme/web, acme/api"})}),i.jsx(Oe,{label:"Label",children:g=>i.jsx(Re,{...g,value:u,onChange:m=>d(m.target.value)})}),i.jsx(Oe,{label:"People",help:"GitHub logins allowed to hand issues over and talk to the agent (they also need write access). Comma separated.",children:g=>i.jsx(Re,{...g,value:h,onChange:m=>p(m.target.value),placeholder:"ana, bo"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{githubPeople:h.split(",").map(g=>g.trim()).filter(Boolean),githubRepos:s.split(",").map(g=>g.trim()).filter(Boolean),githubLabel:u.trim()}}).then(()=>We({title:"GitHub saved",variant:"success"})).catch(Vn("Couldn't save GitHub")),children:"Save"})]})]})}function vS({d:n}){const r=Xa(),s=n.jira.available?n.jira:null,[o,u]=k.useState((s==null?void 0:s.clientId)??""),[d,h]=k.useState(""),[p,g]=k.useState((s==null?void 0:s.siteInput)??""),[m,y]=k.useState(((s==null?void 0:s.projects)??[]).join(", ")),[w,x]=k.useState((s==null?void 0:s.label)??""),[j,_]=k.useState(((s==null?void 0:s.people)??[]).join(", "));return k.useEffect(()=>u((s==null?void 0:s.clientId)??""),[s==null?void 0:s.clientId]),s?i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Jira"}),i.jsx(Tt,{children:`The agent uses its own Jira user (e.g. "Jim"). People hand an issue over by assigning it to that user (or with the optional label); comments are the conversation. Create an OAuth 2.0 (3LO) app at developer.atlassian.com with the Jira scopes read:jira-work, write:jira-work and read:jira-user and this callback URL, then connect while signed in to Atlassian as the agent's user.`})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:"Site:"}),s.connected?i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"success",children:"Connected"}),i.jsx("code",{children:s.site}),s.account&&i.jsxs("span",{className:"text-muted-foreground",children:["as ",s.account]}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>void r.mutateAsync({path:"/api/tickets/jira/connection",method:"DELETE"}).catch(Vn("Couldn't disconnect")),children:"Disconnect"})]}):i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"muted",children:"Not connected"}),i.jsx(oe,{size:"sm",disabled:!s.configured,onClick:()=>void Ee("/api/tickets/jira/connect",{method:"POST"}).then(E=>window.location.assign(E.url)).catch(Vn("Couldn't start the Jira sign-in")),children:"Connect Jira"}),!s.configured&&i.jsx("span",{className:"text-muted-foreground",children:"Save the client below first."})]})]}),i.jsxs("div",{className:"space-y-1.5 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Callback URL (add it to the Atlassian app)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:s.redirectUri}),i.jsx(Js,{text:s.redirectUri})]})]}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[i.jsx(Oe,{label:"Client ID",children:E=>i.jsx(Re,{...E,value:o,onChange:S=>u(S.target.value)})}),i.jsx(Oe,{label:"Secret",help:s.hasSecret?"Saved. Enter a new one only to replace it.":void 0,children:E=>i.jsx(Re,{...E,type:"password",autoComplete:"off",value:d,onChange:S=>h(S.target.value),placeholder:s.hasSecret?"••••••••":""})}),i.jsx(Oe,{label:"Site",help:"Only needed if the agent's account reaches several sites.",children:E=>i.jsx(Re,{...E,value:p,onChange:S=>g(S.target.value),placeholder:"https://acme.atlassian.net"})}),i.jsx(Oe,{label:"Projects",help:"Project keys, comma separated (empty: every project it can see).",children:E=>i.jsx(Re,{...E,value:m,onChange:S=>y(S.target.value),placeholder:"ENG, OPS"})}),i.jsx(Oe,{label:"Hand-over label (optional)",help:"Adding this label also hands an issue over.",children:E=>i.jsx(Re,{...E,value:w,onChange:S=>x(S.target.value),placeholder:"fda"})}),i.jsx(Oe,{label:"People without a visible email",help:"People are matched to Slack by email. When Jira hides someone's email, add their Jira account id here (a refused ticket shows it).",children:E=>i.jsx(Re,{...E,value:j,onChange:S=>_(S.target.value),placeholder:"712020:…"})})]}),i.jsx(oe,{disabled:r.isPending,onClick:()=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{jiraClientId:o.trim(),...d.trim()?{jiraClientSecret:d.trim()}:{},jiraSite:p.trim(),jiraProjects:m.split(",").map(E=>E.trim()).filter(Boolean),jiraLabel:w.trim(),jiraPeople:j.split(",").map(E=>E.trim()).filter(Boolean)}}).then(()=>{h(""),We({title:"Jira saved",variant:"success"})}).catch(Vn("Couldn't save Jira")),children:"Save"})]})]}):null}function xS({d:n}){const r=Xa(),[s,o]=k.useState(""),[u,d]=k.useState(null),h=n.bridge,p=(g,m=!1)=>Ee(`/api/tickets/bridge/${g}`,{method:"POST",body:{rotate:m}}).then(y=>{y.secret&&d(y.secret),r.mutateAsync({path:"/api/tickets",method:"PUT",body:{}}),We({title:"Webhook URL ready",variant:"success"})}).catch(Vn("Couldn't set up the webhook"));return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Instant updates (optional)"}),i.jsx(Tt,{children:"Without this, the agent checks Linear every 15 seconds and GitHub every minute. With it, the tracker's webhook goes to SuperClawd's bridge (this machine stays unreachable from the internet), which wakes the agent right away. No ticket data is stored there."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsx(Xi,{label:"Use the webhook bridge",help:"Polling keeps running either way (a missed webhook only delays).",checked:h.enabled,onChange:g=>void r.mutateAsync({path:"/api/tickets",method:"PUT",body:{bridge:g}}).catch(Vn("Couldn't change it"))}),i.jsxs("div",{className:"space-y-2 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Linear"}),i.jsx("p",{className:"text-muted-foreground",children:"In the Linear OAuth app: enable Webhooks, select Agent session events and Inbox notifications, paste the URL below, and copy Linear's signing secret here."}),i.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[i.jsx("div",{className:"min-w-64 flex-1",children:i.jsx(Oe,{label:"Linear webhook signing secret",children:g=>i.jsx(Re,{...g,type:"password",autoComplete:"off",value:s,onChange:m=>o(m.target.value),placeholder:h.linear.hasSecret?"••••••••":"lin_wh_…"})})}),i.jsx(oe,{variant:"outline",disabled:!s.trim()&&!h.linear.hasSecret,onClick:()=>void(s.trim()?r.mutateAsync({path:"/api/tickets",method:"PUT",body:{linearWebhookSecret:s.trim()}}):Promise.resolve()).then(()=>(o(""),p("linear"))),children:"Get the webhook URL"})]}),h.linear.hasSecret&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Secret saved."}),h.linear.url&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:h.linear.url}),i.jsx(Js,{text:h.linear.url})]})]}),i.jsxs("div",{className:"space-y-2 text-sm",children:[i.jsx("p",{className:"font-medium",children:"GitHub"}),i.jsx("p",{className:"text-muted-foreground",children:"In each repository: Settings → Webhooks → Add webhook. Payload URL and secret below, content type application/json, events: Issues and Issue comments."}),i.jsx(oe,{variant:"outline",onClick:()=>void p("github",h.github.hasSecret),children:h.github.url?"New secret + URL":"Get the webhook URL and secret"}),h.github.url&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:h.github.url}),i.jsx(Js,{text:h.github.url})]}),u&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{children:"Secret (shown once):"}),i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:u}),i.jsx(Js,{text:u})]})]})]})]})}function wS({d:n}){return i.jsxs(He,{children:[i.jsx(ot,{children:i.jsx(ut,{children:"Recent tickets"})}),i.jsx(Qe,{children:n.items.length?i.jsx("ul",{className:"divide-y rounded-md border",children:n.items.map(r=>{const s=fS[r.state]??{label:r.state,variant:"muted"};return i.jsxs("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2 text-sm",children:[r.url?i.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer noopener",className:"font-medium text-info underline",children:r.key}):i.jsx("span",{className:"font-medium",children:r.key}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.title}),i.jsx(tt,{variant:s.variant,children:s.label}),r.statusNote&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r.statusNote}),r.prUrl&&i.jsx("a",{href:r.prUrl,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-info underline",children:"PR"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:fl(r.costUsd)}),r.requestId&&i.jsx(Bt,{to:`/requests/${r.requestId}`,className:"text-xs text-info underline",children:"Request"}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.delegator?`${r.delegator} · `:"",Yt(r.updatedAt)]})]},r.id)})}):i.jsx(rn,{children:"No tickets yet."})})]})}function kS(){const[n,r]=k.useState(null),s=k.useRef(!1);return k.useEffect(()=>{if(s.current)return;s.current=!0;const o=new URLSearchParams(window.location.search),u=o.get("code"),d=o.get("state");if(window.history.replaceState(null,"","/trackers/linear/callback"),o.get("error")||!u||!d){r({ok:!1,message:o.get("error")==="access_denied"?"The install was cancelled.":"Linear didn't complete the install."});return}Ee("/api/tickets/linear/exchange",{method:"POST",body:{code:u,state:d}}).then(h=>r({ok:!0,workspace:h.linear.workspace})).catch(h=>r({ok:!1,message:yt(h)}))},[]),i.jsx("div",{className:"mx-auto max-w-lg p-6",children:i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6 text-sm",children:[n?n.ok?i.jsxs("p",{children:["Linear is connected",n.workspace?i.jsxs(i.Fragment,{children:[" ","to ",i.jsx("code",{children:n.workspace})]}):null,"."]}):i.jsx("p",{className:"text-destructive",children:n.message}):i.jsx(kt,{label:"Connecting Linear"}),i.jsx(Bt,{to:"/tickets",className:"text-info underline",children:"Back to Tickets"})]})})})}function jS(){const[n,r]=k.useState(null),s=k.useRef(!1);return k.useEffect(()=>{if(s.current)return;s.current=!0;const o=new URLSearchParams(window.location.search),u=o.get("code"),d=o.get("state");if(window.history.replaceState(null,"","/trackers/jira/callback"),o.get("error")||!u||!d){r({ok:!1,message:o.get("error")==="access_denied"?"The sign-in was cancelled.":"Atlassian didn't complete the sign-in."});return}Ee("/api/tickets/jira/exchange",{method:"POST",body:{code:u,state:d}}).then(h=>r({ok:!0,site:h.jira.site??null,account:h.jira.account??null})).catch(h=>r({ok:!1,message:yt(h)}))},[]),i.jsx("div",{className:"mx-auto max-w-lg p-6",children:i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6 text-sm",children:[n?n.ok?i.jsxs("p",{children:["Jira is connected",n.site?i.jsxs(i.Fragment,{children:[" ","to ",i.jsx("code",{children:n.site})]}):null,n.account?i.jsxs(i.Fragment,{children:[" as ",n.account]}):null,"."]}):i.jsx("p",{className:"text-destructive",children:n.message}):i.jsx(kt,{label:"Connecting Jira"}),i.jsx(Bt,{to:"/tickets",className:"text-info underline",children:"Back to Tickets"})]})})})}const bS=[{to:"agent",label:"Agent"},{to:"anthropic",label:"Anthropic"},{to:"general",label:"General"},{to:"slack",label:"Slack"},{to:"access",label:"Access"},{to:"calendar",label:"Calendar"},{to:"account",label:"Account"}];function SS(){return i.jsxs("div",{children:[i.jsx(ys,{title:"Settings",description:"Configure this FDA machine."}),i.jsxs("div",{className:"flex flex-col gap-6 md:flex-row",children:[i.jsx("nav",{"aria-label":"Settings",className:"flex shrink-0 gap-1 overflow-x-auto md:w-44 md:flex-col",children:bS.map(n=>i.jsx($d,{to:n.to,className:({isActive:r})=>Xe("rounded-md px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",r?"bg-accent font-medium":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:n.label},n.to))}),i.jsx("div",{className:"min-w-0 flex-1",children:i.jsx(Id,{})})]})]})}function CS(){var h,p,g;const n=Gj(),r=Yj(),[s,o]=k.useState(null),u=((p=(h=n.data)==null?void 0:h.selected)==null?void 0:p.id)??null,d=s??u;return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Primary agent"}),i.jsx(Tt,{children:"The SuperClawd agent FDA runs as. It brings its skills, guardrails and memories from your workspace."})]}),i.jsxs(Qe,{className:"space-y-4",children:[((g=n.data)==null?void 0:g.selected)&&i.jsxs("p",{className:"text-sm",children:["Current:"," ",i.jsx("span",{className:"font-medium",children:n.data.selected.name})]}),n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):i.jsxs(i.Fragment,{children:[n.data.error&&i.jsx(Ot,{error:new Error(`Could not load agents from SuperClawd: ${n.data.error}`),onRetry:()=>void n.refetch()}),n.data.items.length===0&&!n.data.error?i.jsx(rn,{children:"No enabled Primary agents in this workspace. Create one in the SuperClawd app, then come back."}):i.jsx("div",{role:"radiogroup","aria-label":"Primary agent",className:"space-y-2",children:n.data.items.map(m=>{const y=d===m.id;return i.jsxs("button",{type:"button",role:"radio","aria-checked":y,onClick:()=>o(m.id),className:Xe("flex w-full items-start gap-3 rounded-md border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-accent":"hover:bg-accent/50"),children:[i.jsx("span",{className:Xe("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border",y&&"border-primary bg-primary text-primary-foreground"),children:y&&i.jsx(Mg,{className:"h-3 w-3","aria-hidden":!0})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:"font-medium",children:m.name}),i.jsx("code",{className:"text-xs text-muted-foreground",children:m.slug}),m.model&&i.jsx(tt,{variant:"outline",children:NS(m.model)}),m.id===u&&i.jsx(tt,{variant:"success",children:"Current"})]}),m.description&&i.jsx("span",{className:"mt-1 block text-sm text-muted-foreground",children:m.description})]})]},m.id)})}),i.jsx(oe,{disabled:!d||d===u||r.isPending,onClick:()=>d&&r.mutate(d,{onSuccess:()=>{o(null),We({title:"Agent saved",variant:"success"})}}),children:r.isPending?"Saving":"Save"})]})]})]})}function NS(n){if(n==="default")return"Session model";const r=/^claude-(opus|fable|sonnet|haiku)-latest$/.exec(n);return r?`Claude ${r[1][0].toUpperCase()}${r[1].slice(1)} (latest)`:n}function jd({label:n,value:r}){return i.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border px-3 py-2 text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:n}),r?i.jsx("code",{className:"text-xs",children:r}):i.jsx(tt,{variant:"warning",children:"Not set"})]})}function vy({result:n,error:r}){if(r)return i.jsxs("span",{role:"status",className:"flex items-center gap-1.5 text-sm text-red-300",children:[i.jsx(md,{className:"h-4 w-4","aria-hidden":!0}),yt(r)]});if(!n)return null;const s=[n.botName&&`bot ${n.botName}`,n.teamId&&`team ${n.teamId}`].filter(Boolean).join(", "),o=n.message??(n.ok?"Works.":"Failed.");return i.jsxs("span",{role:"status",className:`flex items-center gap-1.5 text-sm ${n.ok?"text-green-300":"text-red-300"}`,children:[n.ok?i.jsx(Tk,{className:"h-4 w-4","aria-hidden":!0}):i.jsx(md,{className:"h-4 w-4","aria-hidden":!0}),o,s&&i.jsxs("span",{className:"text-muted-foreground",children:["(",s,")"]})]})}function ES(){const n=Jo(),r=Jj(),s=Xj(),[o,u]=k.useState("");if(n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const d=h=>{h.preventDefault(),r.mutate(o.trim(),{onSuccess:()=>{u(""),s.reset(),We({title:"API key saved",variant:"success"})}})};return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Anthropic API key"}),i.jsx(Tt,{children:"FDA runs Claude Code with this key. It is stored encrypted on this machine and never shown again."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsx(jd,{label:"Current key",value:n.data.secrets.anthropicApiKey}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oe,{variant:"outline",disabled:s.isPending||!n.data.secrets.anthropicApiKey,onClick:()=>s.mutate(),children:s.isPending?"Testing":"Test key"}),i.jsx(vy,{result:s.data,error:s.error})]}),i.jsxs("form",{onSubmit:d,className:"max-w-md space-y-3",autoComplete:"off",children:[i.jsx(Oe,{label:n.data.secrets.anthropicApiKey?"Replace key":"Set key",help:"Starts with sk-ant-.",error:r.error?yt(r.error):null,children:h=>i.jsx(Re,{...h,type:"password",autoComplete:"off",spellCheck:!1,value:o,onChange:p=>u(p.target.value),placeholder:"sk-ant-..."})}),i.jsx(oe,{type:"submit",disabled:!o.trim()||r.isPending,children:r.isPending?"Saving":"Save key"})]})]})]})}function RS({open:n,initialPath:r,onClose:s,onSelect:o}){return i.jsx(Kd,{open:n,onClose:s,title:"Choose a folder",description:"Folders under your home directory. Repositories are marked.",className:"max-w-xl",children:n&&i.jsx(PS,{initialPath:r??"",onSelect:o,onCancel:s})})}function PS({initialPath:n,onSelect:r,onCancel:s}){var p,g,m,y;const[o,u]=k.useState(n),d=lb(o),h=((p=d.data)==null?void 0:p.path)??o;return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(oe,{variant:"outline",size:"icon","aria-label":"Parent folder",disabled:!((g=d.data)!=null&&g.parent),onClick:()=>{var w;return((w=d.data)==null?void 0:w.parent)&&u(d.data.parent)},children:i.jsx(wk,{})}),i.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-muted px-2 py-1.5 text-xs",title:h,children:h||"Home"})]}),d.isLoading?i.jsx(kt,{}):d.isError?i.jsx(Ot,{error:d.error,onRetry:()=>u(n===o?"":n)}):i.jsxs("ul",{className:Xe("max-h-72 overflow-y-auto rounded-md border",d.isFetching&&"opacity-60"),"aria-label":"Folders",children:[((m=d.data)==null?void 0:m.dirs.length)===0&&i.jsx("li",{className:"p-3 text-sm text-muted-foreground",children:"No folders here."}),(y=d.data)==null?void 0:y.dirs.map(w=>i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>u(w.path),className:"flex w-full items-center gap-2 border-b px-3 py-2 text-left text-sm last:border-b-0 hover:bg-accent focus-visible:bg-accent focus-visible:outline-none",children:[w.isRepo?i.jsx(Qk,{className:"h-4 w-4 text-success","aria-hidden":!0}):i.jsx(Bk,{className:"h-4 w-4 text-muted-foreground","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:w.name}),w.isRepo&&i.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"repository"})]})},w.path))]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[i.jsx(oe,{variant:"outline",onClick:s,children:"Cancel"}),i.jsx(oe,{disabled:!d.data,onClick:()=>d.data&&r(d.data.path),children:"Use this folder"})]})]})}const bd=[{title:"Workspace",description:"Where FDA works on this machine and who people should contact.",fields:[{key:"workdir",label:"Work directory",help:"Repositories FDA works on live here. Must be inside your home directory.",kind:"folder"},{key:"operatorContact",label:"Operator contact",help:"Shown to Slack users when FDA cannot help, for example a Slack handle or email.",kind:"text",nullable:!0,placeholder:"@alex"}]},{title:"Agent behavior",description:"How the coding agent runs each turn.",fields:[{key:"effort",label:"Reasoning effort",help:"Higher effort is slower and costs more.",kind:"select",nullable:!0,options:[{value:"",label:"Default"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"},{value:"max",label:"Max"}]},{key:"permissionMode",label:"Permission mode",help:"Bypass lets the agent run any tool without asking. Auto applies Claude Code's automatic permission checks.",kind:"select",options:[{value:"bypass",label:"Bypass"},{value:"auto",label:"Auto"}]},{key:"planPolicy",label:"Plan first",help:"Whether the agent proposes a plan for approval in Slack before making changes.",kind:"select",options:[{value:"auto",label:"When the task needs it"},{value:"always",label:"Always"},{value:"never",label:"Never"}]},{key:"browserEnabled",label:"Browser",help:"Let the agent use a headless browser for checks and screenshots.",kind:"bool"},{key:"superclawdMemory",label:"SuperClawd memory",help:"Team, repo, agent and private memories from SuperClawd. Off: none is loaded or captured, and the agent uses Claude Code's own memory instead (kept per repository on this machine).",kind:"bool"},{key:"captureMemories",label:"Capture memories",help:"Save learnings to your SuperClawd workspace memories after turns.",kind:"bool"},{key:"allowClaudeaiConnectors",label:"Claude.ai connectors",help:"Allow MCP connectors configured in the Claude.ai account.",kind:"bool"}]},{title:"Turn limits",description:"Guards against runaway turns.",fields:[{key:"debounceMs",label:"Message debounce (ms)",help:"Wait this long after the last Slack message before starting a turn, so quick follow-ups are batched.",kind:"number",min:0,step:100,integer:!0},{key:"turnTimeoutMin",label:"Turn timeout (minutes)",help:"Stop a turn that runs longer than this.",kind:"number",min:1,integer:!0},{key:"turnMaxBudgetUsd",label:"Max cost per turn (USD)",help:"Leave empty for no limit.",kind:"number",nullable:!0,min:0,step:.5},{key:"turnMaxTurns",label:"Max agent steps per turn",help:"Leave empty for no limit.",kind:"number",nullable:!0,min:1,integer:!0}]},{title:"Pull requests",description:"After FDA opens a pull request it keeps an eye on it (through the machine's gh login) and works on it again in the same thread.",fields:[{key:"prMonitorEnabled",label:"Follow pull requests",help:"Check the pull requests FDA opened. Say `stop following` in a thread to stop for that request.",kind:"bool"},{key:"prMonitorFixCi",label:"Fix failing CI",help:"Once per failing commit, up to the attempt limit below.",kind:"bool"},{key:"prMonitorReviews",label:"Address review feedback",help:"Only from people with write access to the repository; other comments are ignored.",kind:"bool"},{key:"prMonitorConflicts",label:"Resolve merge conflicts",help:"Merges the base branch into the pull request branch.",kind:"bool"},{key:"prMonitorIntervalSec",label:"Check every (seconds)",help:"Checks slow down when nothing is happening.",kind:"number",min:30,integer:!0},{key:"prMonitorQuietSec",label:"Wait after the last comment (seconds)",help:"Lets a reviewer finish before FDA starts.",kind:"number",min:0,integer:!0},{key:"prMonitorMaxCiAttempts",label:"CI fix attempts",help:"Then FDA leaves it for a human and says so in the thread.",kind:"number",min:1,integer:!0},{key:"prMonitorMaxPerDay",label:"Follow-ups per pull request per day",help:"A safety cap on automatic work.",kind:"number",min:1,integer:!0},{key:"prMonitorMaxAgeDays",label:"Stop after idle (days)",help:"Stop following a pull request with no activity for this long.",kind:"number",min:1,integer:!0}]},{title:"Slack context",description:"What FDA reads from the thread.",fields:[{key:"threadContextMessages",label:"Earlier thread messages",help:"How many earlier messages in the thread to include as context.",kind:"number",min:0,integer:!0},{key:"includeUnlistedContext",label:"Include messages from people not on the allowlist",help:"They are passed as untrusted context only, never as instructions.",kind:"bool"},{key:"stopButton",label:"Stop button",help:"Show a Stop button on the agent's live line while it works (same as typing `stop`; only the requester or allowed people can use it).",kind:"bool"},{key:"allowDirectMessages",label:"Direct messages",help:"People on the allowlist can DM the agent; each DM is a private request (the team doesn't see it). Turn off to accept requests only in channels.",kind:"bool"}]},{title:"Sessions and cleanup",description:"Housekeeping on this machine.",fields:[{key:"sessionMaxAgeH",label:"Session max age (hours)",help:"Start a fresh agent session for a thread after this long.",kind:"number",min:1,integer:!0},{key:"worktreeRetentionDays",label:"Keep worktrees (days)",help:"Delete finished request worktrees after this many days.",kind:"number",min:0,integer:!0},{key:"diskMinFreeGb",label:"Minimum free disk (GB)",help:"Pause new work when free disk drops below this.",kind:"number",min:0,step:.5},{key:"autoRequeueOnRestart",label:"Requeue after restart",help:"Requeue requests that were running when the daemon stopped.",kind:"bool"}]},{title:"Admin panel",description:"How this panel is reached.",fields:[{key:"adminPublicUrl",label:"Admin URL",help:"The address you use to open this panel. Used in Slack links.",kind:"text",nullable:!0,placeholder:"https://fda.example.ts.net"},{key:"publicHostname",label:"Public hostname",help:"Extra hostname this panel accepts, for example a Tailscale name.",kind:"text",nullable:!0,placeholder:"fda.example.ts.net"}]},{title:"Privacy",description:"What is shared with SuperClawd.",fields:[{key:"shareTitleWithCloud",label:"Share request titles",help:"Send request titles to SuperClawd for usage reporting. Off sends counts only.",kind:"bool"}]}];function Tm(n){const r={};for(const s of bd)for(const o of s.fields){const u=n[o.key];r[o.key]=typeof u=="boolean"?u:u===null?"":String(u)}return r}function TS(n,r){if(n.kind==="bool")return{value:r};const s=String(r).trim();if(n.kind==="number"){if(s==="")return n.nullable?{value:null}:{error:"Required."};const o=Number(s);return Number.isFinite(o)?n.integer&&!Number.isInteger(o)?{error:"Enter a whole number."}:n.min!==void 0&&o<n.min?{error:`Must be at least ${n.min}.`}:{value:o}:{error:"Enter a number."}}return s===""?"nullable"in n&&n.nullable?{value:null}:n.kind==="folder"?{value:null}:{error:"Required."}:{value:s}}function LS(){const n=Jo();return n.isLoading?i.jsx(kt,{}):n.isError||!n.data?i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()}):i.jsx(MS,{settings:n.data.settings})}function MS({settings:n}){const[r]=k.useState(()=>Tm(n)),[s,o]=k.useState(r),[u,d]=k.useState(r),[h,p]=k.useState({}),[g,m]=k.useState(!1),y=Vd(),w=Object.keys(s).filter(E=>s[E]!==u[E]),x=(E,S)=>{o(P=>({...P,[E]:S})),p(P=>({...P,[E]:void 0}))},j=E=>{E.preventDefault();const S={},P={};for(const D of bd)for(const U of D.fields){if(!w.includes(U.key))continue;const Q=TS(U,s[U.key]);Q.error?P[U.key]=Q.error:S[U.key]=Q.value}p(P),!Object.keys(P).length&&y.mutate(S,{onSuccess:({settings:D})=>{const U=Tm(D);o(U),d(U),We({title:"Settings saved",variant:"success"})},onError:D=>{D instanceof Wn&&D.field&&p({[D.field]:D.message})}})},_=y.error instanceof Wn&&y.error.field?null:y.error?yt(y.error):null;return i.jsxs("form",{onSubmit:j,className:"space-y-6",noValidate:!0,children:[bd.map(E=>i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:E.title}),i.jsx(Tt,{children:E.description})]}),i.jsx(Qe,{className:"grid gap-5 sm:grid-cols-2",children:E.fields.map(S=>i.jsx("div",{className:S.kind==="folder"||S.kind==="bool"?"sm:col-span-2":void 0,children:i.jsx(Oe,{label:S.label,help:S.help,error:h[S.key],children:P=>{const D=s[S.key];switch(S.kind){case"bool":return i.jsx(ps,{...P,checked:D,onCheckedChange:U=>x(S.key,U)});case"select":return i.jsx(eu,{...P,value:D,onChange:U=>x(S.key,U.target.value),children:S.options.map(U=>i.jsx("option",{value:U.value,children:U.label},U.value))});case"number":return i.jsx(Re,{...P,type:"number",inputMode:"decimal",min:S.min,step:S.step??1,value:D,onChange:U=>x(S.key,U.target.value)});case"folder":return i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Re,{...P,value:D,onChange:U=>x(S.key,U.target.value),placeholder:"/home/you/work",spellCheck:!1}),i.jsxs(oe,{variant:"outline",onClick:()=>m(!0),children:[i.jsx($k,{}),"Browse"]})]});default:return i.jsx(Re,{...P,value:D,onChange:U=>x(S.key,U.target.value),placeholder:S.placeholder,spellCheck:!1})}}})},S.key))})]},E.title)),i.jsxs("div",{className:"sticky bottom-0 flex items-center gap-3 border-t bg-background/95 py-4 backdrop-blur",children:[i.jsx(oe,{type:"submit",disabled:w.length===0||y.isPending,children:y.isPending?"Saving":"Save changes"}),i.jsx(oe,{variant:"ghost",disabled:w.length===0,onClick:()=>{o(u),p({})},children:"Discard"}),w.length>0&&i.jsx("span",{className:"text-sm text-muted-foreground",children:w.length===1?"1 unsaved change":`${w.length} unsaved changes`}),i.jsx(Go,{message:_})]}),i.jsx(RS,{open:g,initialPath:s.workdir||null,onClose:()=>m(!1),onSelect:E=>{x("workdir",E),m(!1)}})]})}function _S(){const n=Jo();if(n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const{secrets:r,settings:s}=n.data;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(AS,{botToken:r.slackBotToken,appToken:r.slackAppToken,botUserId:s.slackBotUserId,teamId:s.slackTeamId}),i.jsx(DS,{defaultName:s.slackBotName??"FDA"})]})}function AS({botToken:n,appToken:r,botUserId:s,teamId:o}){const u=Zj(),d=eb(),[h,p]=k.useState(""),[g,m]=k.useState(""),y=w=>{w.preventDefault();const x={};h.trim()&&(x.botToken=h.trim()),g.trim()&&(x.appToken=g.trim()),u.mutate(x,{onSuccess:()=>{p(""),m(""),d.reset(),We({title:"Slack tokens saved. Reconnecting.",variant:"success"})}})};return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Slack connection"}),i.jsx(Tt,{children:"FDA connects to Slack over Socket Mode with a bot token and an app-level token."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(jd,{label:"Bot token",value:n}),i.jsx(jd,{label:"App token",value:r}),(s||o)&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[s&&i.jsxs(i.Fragment,{children:["Bot user ",s,". "]}),o&&i.jsxs(i.Fragment,{children:["Team ",o,"."]})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oe,{variant:"outline",disabled:d.isPending||!n,onClick:()=>d.mutate(),children:d.isPending?"Testing":"Test connection"}),i.jsx(vy,{result:d.data,error:d.error})]}),i.jsxs("form",{onSubmit:y,className:"max-w-md space-y-4",autoComplete:"off",children:[i.jsx(Oe,{label:"New bot token",help:"Starts with xoxb-. Leave empty to keep the current one.",children:w=>i.jsx(Re,{...w,type:"password",autoComplete:"off",spellCheck:!1,value:h,onChange:x=>p(x.target.value),placeholder:"xoxb-..."})}),i.jsx(Oe,{label:"New app token",help:"Starts with xapp-. Needs the connections:write scope.",children:w=>i.jsx(Re,{...w,type:"password",autoComplete:"off",spellCheck:!1,value:g,onChange:x=>m(x.target.value),placeholder:"xapp-..."})}),i.jsx(Go,{message:u.error?yt(u.error):null}),i.jsx(oe,{type:"submit",disabled:!h.trim()&&!g.trim()||u.isPending,children:u.isPending?"Saving":"Save tokens"})]})]})]})}function DS({defaultName:n}){const[r,s]=k.useState(n),[o,u]=k.useState(n);k.useEffect(()=>{const p=setTimeout(()=>u(r.trim()||n),300);return()=>clearTimeout(p)},[r,n]);const d=tb(o),h=d.data?JSON.stringify(d.data.manifest,null,2):"";return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Slack app manifest"}),i.jsx(Tt,{children:"Create the Slack app from this manifest at api.slack.com/apps, then install it and paste the tokens above."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsx("div",{className:"max-w-xs",children:i.jsx(Oe,{label:"Bot name",help:"The name people mention in Slack.",children:p=>i.jsx(Re,{...p,value:r,onChange:g=>s(g.target.value),maxLength:35})})}),d.isLoading?i.jsx(kt,{}):d.isError?i.jsx(Ot,{error:d.error,onRetry:()=>void d.refetch()}):i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx(Js,{text:h,label:"Copy manifest"})}),i.jsx("pre",{className:"max-h-96 overflow-auto rounded-md border bg-muted/40 p-3 font-mono text-xs","aria-label":"Manifest JSON",tabIndex:0,children:h})]})]})]})}const Sd={channel:"Channel",user:"User",usergroup:"User group"},OS={channel:Yk,user:I1,usergroup:U1},Oo=(n,r)=>n.kind===r.kind&&n.slackId===r.slackId;function FS(){var u,d,h,p,g;const n=nb(),r=Jo();if(n.isLoading||r.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const s=!!((u=r.data)!=null&&u.settings.allowAnyChannel),o=!!((d=r.data)!=null&&d.settings.allowAnyone);return i.jsxs("div",{className:"space-y-6",children:[i.jsx(zS,{anyChannel:s,anyone:o}),i.jsx(IS,{targets:((h=r.data)==null?void 0:h.settings.handoffTargets)??[],sources:((p=r.data)==null?void 0:p.settings.handoffSources)??[],budget:((g=r.data)==null?void 0:g.settings.handoffMaxBudgetUsd)??5}),i.jsx(US,{initial:n.data,anyChannel:s,anyone:o})]})}function IS({targets:n,sources:r,budget:s}){const o=Vd(),[u,d]=k.useState({botUserId:"",name:"",role:""}),[h,p]=k.useState(""),[g,m]=k.useState(String(s));k.useEffect(()=>m(String(s)),[s]);const y=(x,j)=>o.mutate(x,{onSuccess:()=>We({title:j,variant:"success"}),onError:_=>We({title:"Couldn't save",description:yt(_),variant:"error"})}),w=x=>/^[UW][A-Z0-9]{5,}$/.test(x.trim());return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Agent hand-offs"}),i.jsx(Tt,{children:"Optional. Let this agent hand part of a request to another agent (for example a product manager agent tasking a developer agent). The person who asked approves each hand-off with ✅ in the thread, and the receiving agent must list this one below too. A hand-off can't be passed on again."})]}),i.jsxs(Qe,{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"Agents this agent can hand work to"}),n.length===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"None (hand-offs off)."}):i.jsx("ul",{className:"divide-y rounded-md border",children:n.map(x=>i.jsxs("li",{className:"flex items-center gap-3 p-3 text-sm",children:[i.jsx("span",{className:"font-medium",children:x.name}),i.jsx("code",{className:"text-xs text-muted-foreground",children:x.botUserId}),i.jsx("span",{className:"flex-1 truncate text-muted-foreground",children:x.role}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":`Remove ${x.name}`,onClick:()=>y({handoffTargets:n.filter(j=>j.botUserId!==x.botUserId)},"Removed"),children:i.jsx(qo,{})})]},x.botUserId))}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_2fr_auto]",children:[i.jsx(Re,{placeholder:"Slack bot user id (U…)","aria-label":"Bot user id",value:u.botUserId,onChange:x=>d({...u,botUserId:x.target.value.trim()})}),i.jsx(Re,{placeholder:"Name (e.g. John)","aria-label":"Name",value:u.name,onChange:x=>d({...u,name:x.target.value})}),i.jsx(Re,{placeholder:"Role (e.g. backend developer)","aria-label":"Role",value:u.role,onChange:x=>d({...u,role:x.target.value})}),i.jsxs(oe,{disabled:!w(u.botUserId)||!u.name.trim()||o.isPending,onClick:()=>{y({handoffTargets:[...n.filter(x=>x.botUserId!==u.botUserId),{botUserId:u.botUserId,name:u.name.trim(),role:u.role.trim()}]},"Added"),d({botUserId:"",name:"",role:""})},children:[i.jsx(gd,{})," Add"]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"Agents allowed to hand work to this agent"}),r.length===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"None (no hand-offs accepted)."}):i.jsx("ul",{className:"divide-y rounded-md border",children:r.map(x=>i.jsxs("li",{className:"flex items-center gap-3 p-3 text-sm",children:[i.jsx("code",{className:"flex-1 text-xs",children:x}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":`Remove ${x}`,onClick:()=>y({handoffSources:r.filter(j=>j!==x)},"Removed"),children:i.jsx(qo,{})})]},x))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Re,{placeholder:"Slack bot user id (U…)","aria-label":"Allowed agent's bot user id",value:h,onChange:x=>p(x.target.value.trim())}),i.jsxs(oe,{disabled:!w(h)||o.isPending,onClick:()=>{y({handoffSources:[...new Set([...r,h])]},"Added"),p("")},children:[i.jsx(gd,{})," Add"]})]})]}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Cost cap per turn for handed-off work (USD)"}),i.jsx(Re,{type:"number",min:.5,step:.5,"aria-label":"Cost cap per turn for handed-off work",value:g,onChange:x=>m(x.target.value)})]}),i.jsx(oe,{variant:"outline",disabled:o.isPending||Number(g)===s,onClick:()=>y({handoffMaxBudgetUsd:Number(g)},"Saved"),children:"Save"})]})]})]})}function zS({anyChannel:n,anyone:r}){const s=Vd(),o=(d,h)=>s.mutate({[d]:h},{onError:p=>We({title:"Couldn't change access",description:yt(p),variant:"error"})}),u=(d,h,p,g)=>i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:p}),i.jsx("p",{className:"text-xs text-muted-foreground",children:g})]}),i.jsx(ps,{checked:h,disabled:s.isPending,"aria-label":p,onCheckedChange:m=>o(d,m)})]});return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Open access"}),i.jsx(Tt,{children:"Optional. Anyone who can reach the agent can make it run code and spend money on this machine, so these are off by default."})]}),i.jsxs(Qe,{className:"space-y-4",children:[u("allowAnyChannel",n,"Any channel the agent is in","Inviting the agent to a channel is enough; the channel list below isn't used. Shared (Slack Connect) channels are still refused."),u("allowAnyone",r,"Anyone in this workspace","Every member can use the agent; the people list below isn't used. External users, guest accounts and deactivated accounts are still refused (unless listed below).")]})]})}function US({initial:n,anyChannel:r,anyone:s}){const[o,u]=k.useState(n),[d,h]=k.useState(n),p=rb(),g=JSON.stringify(o)!==JSON.stringify(d),m=x=>u(j=>j.some(_=>Oo(_,x))?j:[...j,x]),y=x=>u(j=>j.filter(_=>!Oo(_,x))),w=(x,j)=>u(_=>_.map(E=>Oo(E,x)?{...E,label:j||null}:E));return i.jsxs("div",{className:"space-y-6",children:[i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Who can use FDA"}),i.jsxs(Tt,{children:["FDA only acts on mentions in allowed channels from allowed people. A user is allowed when they are listed directly or belong to a listed user group.",r&&" Any channel is on: channels listed here aren't needed.",s&&" Anyone in the workspace is on: people and groups listed here are only needed for guests."]})]}),i.jsxs(Qe,{className:"space-y-4",children:[o.length===0?i.jsx(rn,{children:r&&s?"Not needed while both open-access switches are on.":r?"Add at least one user or group (or turn on Anyone in this workspace).":s?"Add at least one channel (or turn on Any channel the agent is in).":"Nobody is allowed yet. Add at least one channel and one user or group."}):i.jsx("ul",{className:"divide-y rounded-md border",children:o.map(x=>{const j=OS[x.kind];return i.jsxs("li",{className:"flex items-center gap-3 p-3",children:[i.jsx(j,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsx(tt,{variant:"outline",className:"shrink-0",children:Sd[x.kind]}),i.jsx("code",{className:"shrink-0 text-xs text-muted-foreground",children:x.slackId}),i.jsx(Re,{"aria-label":`Label for ${Sd[x.kind].toLowerCase()} ${x.slackId}`,placeholder:"Label",className:"h-8",value:x.label??"",onChange:_=>w(x,_.target.value)}),i.jsx(oe,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":`Remove ${x.label??x.slackId}`,onClick:()=>y(x),children:i.jsx(qo,{})})]},`${x.kind}:${x.slackId}`)})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oe,{disabled:!g||p.isPending,onClick:()=>p.mutate(o,{onSuccess:({entries:x})=>{u(x),h(x),We({title:"Access list saved",variant:"success"})}}),children:p.isPending?"Saving":"Save access list"}),i.jsx(oe,{variant:"ghost",disabled:!g,onClick:()=>u(d),children:"Discard"}),g&&i.jsx("span",{className:"text-sm text-muted-foreground",children:"Unsaved changes"})]})]})]}),i.jsx(qS,{entries:o,onAdd:m})]})}function $S(n,r=300){const[s,o]=k.useState(n);return k.useEffect(()=>{const u=setTimeout(()=>o(n),r);return()=>clearTimeout(u)},[n,r]),s}function qS({entries:n,onAdd:r}){const[s,o]=k.useState("channel"),[u,d]=k.useState(""),h=$S(u.trim()),p=sb(h,s==="channel"),g=ab(h,s==="user"),m=ib(s==="usergroup"),y=s==="channel"?p:s==="user"?g:m;let w=[];if(s==="channel"&&p.data)w=p.data.map(x=>({id:x.id,primary:`#${x.name}`,secondary:x.isMember?void 0:"Bot is not a member yet",label:`#${x.name}`,icon:x.isPrivate?i.jsx(o1,{className:"h-3 w-3","aria-label":"Private"}):void 0}));else if(s==="user"&&g.data)w=g.data.map(x=>({id:x.id,primary:x.realName||x.name,secondary:`@${x.name}`,label:x.realName||x.name}));else if(s==="usergroup"&&m.data){const x=h.toLowerCase();w=m.data.filter(j=>!x||j.handle.toLowerCase().includes(x)||j.name.toLowerCase().includes(x)).map(j=>({id:j.id,primary:j.name,secondary:`@${j.handle}`,label:`@${j.handle}`}))}return i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Add to the list"}),i.jsx(Tt,{children:"Search what the bot can see in your Slack workspace. Remember to save."})]}),i.jsxs(Qe,{children:[i.jsx(hy,{idPrefix:"access",label:"Entry type",value:s,onChange:x=>{o(x),d("")},items:[{value:"channel",label:"Channels"},{value:"user",label:"Users"},{value:"usergroup",label:"User groups"}]}),i.jsxs(py,{idPrefix:"access",value:s,className:"space-y-3",children:[i.jsx(Re,{type:"search","aria-label":`Search ${Sd[s].toLowerCase()}s`,placeholder:"Search",value:u,onChange:x=>d(x.target.value)}),y.isLoading?i.jsx(kt,{}):y.isError?i.jsx(Ot,{error:y.error,onRetry:()=>void y.refetch()}):w.length===0?i.jsx("p",{className:"p-2 text-sm text-muted-foreground",children:"No matches."}):i.jsx("ul",{className:Xe("max-h-72 overflow-y-auto rounded-md border",y.isFetching&&"opacity-60"),children:w.map(x=>{const j=n.some(_=>Oo(_,{kind:s,slackId:x.id}));return i.jsxs("li",{className:"flex items-center gap-3 border-b px-3 py-2 text-sm last:border-b-0",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("p",{className:"flex items-center gap-1.5 truncate",children:[x.primary,x.icon]}),x.secondary&&i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:x.secondary})]}),i.jsx(oe,{size:"xs",variant:"outline",disabled:j,"aria-label":j?`${x.primary} already added`:`Add ${x.primary}`,onClick:()=>r({kind:s,slackId:x.id,label:x.label}),children:j?"Added":i.jsxs(i.Fragment,{children:[i.jsx(gd,{}),"Add"]})})]},x.id)})})]})]})]})}function BS(){const n=Yo();return n.data?i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Account"}),i.jsx(Tt,{children:"Change your password or username. Your other sessions will be signed out."})]}),i.jsx(Qe,{children:i.jsx(oy,{currentUsername:n.data.username,onDone:()=>We({title:"Account updated",variant:"success"})})})]}):i.jsx(kt,{})}const xy=["calendar"];function HS(){return Rt({queryKey:xy,queryFn:()=>Ee("/api/calendar")})}function QS(){const n=Ct();return Ft({mutationFn:r=>Ee(r.path,{method:r.method??"POST",body:r.body}),onSuccess:r=>{r&&"redirectUri"in r&&n.setQueryData(xy,r)}})}function VS(){var y,w;const n=HS(),r=QS(),[s,o]=k.useState(""),[u,d]=k.useState("");if(k.useEffect(()=>{n.data&&o(n.data.clientId??"")},[(y=n.data)==null?void 0:y.clientId]),n.isLoading)return i.jsx(kt,{});if(n.isError||!n.data)return i.jsx(Ot,{error:n.error,onRetry:()=>void n.refetch()});const h=n.data,p=x=>j=>We({title:x,description:yt(j),variant:"error"}),g=()=>r.mutateAsync({path:"/api/calendar",method:"PUT",body:{clientId:s.trim(),...u.trim()?{clientSecret:u.trim()}:{}}}).then(()=>{d(""),We({title:"Google client saved",variant:"success"})}).catch(p("Couldn't save the Google client")),m=()=>Ee("/api/calendar/connect",{method:"POST"}).then(x=>window.location.assign(x.url)).catch(p("Couldn't start the Google sign-in"));return i.jsxs("div",{className:"space-y-4",children:[i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Calendar"}),i.jsx(Tt,{children:"The agent books meetings on its own Google calendar, around the attendees' availability (Google Calendar). Connect the Google account the agent should use (ideally its own account, e.g. jane@yourcompany.com). The sign-in stays encrypted on this machine; tasks never see Google's tokens."})]}),i.jsxs(Qe,{className:"space-y-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Calendar for tasks"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Off: tasks don't get the calendar tools."})]}),i.jsx(ps,{checked:h.enabled,onCheckedChange:x=>void r.mutateAsync({path:"/api/calendar",method:"PUT",body:{enabled:x}}).catch(p("Couldn't change it")),"aria-label":"Calendar for tasks"})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-medium",children:"Google account:"}),h.connected?i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"success",children:"Connected"}),i.jsx("code",{children:h.account}),i.jsx(oe,{size:"sm",variant:"outline",onClick:()=>void r.mutateAsync({path:"/api/calendar/connection",method:"DELETE"}).catch(p("Couldn't disconnect")),children:"Disconnect"})]}):i.jsxs(i.Fragment,{children:[i.jsx(tt,{variant:"muted",children:"Not connected"}),i.jsx(oe,{size:"sm",disabled:!h.configured,onClick:()=>void m(),children:"Connect Google"}),!h.configured&&i.jsx("span",{className:"text-muted-foreground",children:"Save the Google client below first."})]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("p",{className:"font-medium",children:["Invite people outside"," ",((w=h.account)==null?void 0:w.split("@")[1])??"the account's domain"]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Off: the agent can only invite people from its own Google Workspace domain."})]}),i.jsx(ps,{checked:h.allowExternal,onCheckedChange:x=>void r.mutateAsync({path:"/api/calendar",method:"PUT",body:{allowExternal:x}}).catch(p("Couldn't change it")),"aria-label":"Allow external guests"})]})]})]}),i.jsxs(He,{children:[i.jsxs(ot,{children:[i.jsx(ut,{children:"Google client"}),i.jsx(Tt,{children:"From your Google Cloud project (Google Auth Platform → Clients): a Web application client, with the Google Calendar API enabled. See the setup guide for the steps."})]}),i.jsxs(Qe,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-1.5 text-sm",children:[i.jsx("p",{className:"font-medium",children:"Authorized redirect URI (add it to the client exactly)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"break-all rounded bg-muted px-2 py-1",children:h.redirectUri}),i.jsx(Js,{text:h.redirectUri})]})]}),i.jsx(Oe,{label:"Client ID",children:x=>i.jsx(Re,{...x,value:s,onChange:j=>o(j.target.value),placeholder:"1234…apps.googleusercontent.com"})}),i.jsx(Oe,{label:"Client secret",help:h.hasSecret?"Saved. Enter a new one only to replace it.":void 0,children:x=>i.jsx(Re,{...x,type:"password",autoComplete:"off",value:u,onChange:j=>d(j.target.value),placeholder:h.hasSecret?"••••••••":"GOCSPX-…"})}),i.jsx(oe,{onClick:()=>void g(),disabled:r.isPending||!s.trim(),children:"Save"})]})]})]})}function WS(){const[n,r]=k.useState(null),s=k.useRef(!1);return k.useEffect(()=>{if(s.current)return;s.current=!0;const o=new URLSearchParams(window.location.search),u=o.get("code"),d=o.get("state");if(window.history.replaceState(null,"","/calendar/callback"),o.get("error")||!u||!d){r({ok:!1,message:o.get("error")==="access_denied"?"The sign-in was cancelled.":"Google didn't complete the sign-in."});return}Ee("/api/calendar/exchange",{method:"POST",body:{code:u,state:d}}).then(h=>r({ok:!0,account:h.account})).catch(h=>r({ok:!1,message:yt(h)}))},[]),i.jsx("div",{className:"mx-auto max-w-lg p-6",children:i.jsx(He,{children:i.jsxs(Qe,{className:"space-y-3 pt-6 text-sm",children:[n?n.ok?i.jsxs("p",{children:["Google Calendar is connected",n.account?i.jsxs(i.Fragment,{children:[" ","as ",i.jsx("code",{children:n.account})]}):null,"."]}):i.jsx("p",{className:"text-destructive",children:n.message}):i.jsx(kt,{label:"Connecting Google"}),i.jsx(Bt,{to:"/settings/calendar",className:"text-info underline",children:"Back to Calendar settings"})]})})})}function KS(){return i.jsxs("div",{className:"py-16 text-center",children:[i.jsx("h1",{className:"text-xl font-semibold",children:"Page not found"}),i.jsx(Bt,{to:"/",className:"mt-3 inline-block text-sm text-info underline",children:"Back to the dashboard"})]})}const GS=Xw([{element:i.jsx(bb,{}),children:[{path:"/login",element:i.jsx(Cb,{})},{path:"/change-password",element:i.jsx(km,{children:i.jsx(Nb,{})})},{element:i.jsx(km,{children:i.jsx(jb,{})}),children:[{index:!0,element:i.jsx(Rb,{})},{path:"requests",element:i.jsx(_b,{})},{path:"requests/:id",element:i.jsx(Ub,{})},{path:"schedules",element:i.jsx(tS,{})},{path:"setup",element:i.jsx(aS,{})},{path:"browser",element:i.jsx(uS,{})},{path:"tickets",element:i.jsx(pS,{})},{path:"trackers/linear/callback",element:i.jsx(kS,{})},{path:"trackers/jira/callback",element:i.jsx(jS,{})},{path:"calendar/callback",element:i.jsx(WS,{})},{path:"settings",element:i.jsx(SS,{}),children:[{index:!0,element:i.jsx(hd,{to:"agent",replace:!0})},{path:"agent",element:i.jsx(CS,{})},{path:"anthropic",element:i.jsx(ES,{})},{path:"general",element:i.jsx(LS,{})},{path:"slack",element:i.jsx(_S,{})},{path:"access",element:i.jsx(FS,{})},{path:"calendar",element:i.jsx(VS,{})},{path:"account",element:i.jsx(BS,{})}]},{path:"audit",element:i.jsx(eS,{})},{path:"*",element:i.jsx(KS,{})}]}]}]);function YS(){const n=k.useSyncExternalStore(Dj,Oj);return i.jsx("div",{"aria-live":"polite",role:"status",className:"pointer-events-none fixed bottom-4 right-4 z-50 flex w-full max-w-sm flex-col gap-2",children:n.map(r=>i.jsxs("div",{className:Xe("pointer-events-auto flex items-start gap-3 rounded-md border bg-card p-4 text-sm shadow-lg animate-in fade-in slide-in-from-bottom-2",r.variant==="error"&&"border-destructive/50",r.variant==="success"&&"border-success/50"),children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"font-medium",children:r.title}),r.description&&i.jsx("p",{className:"mt-1 break-words text-muted-foreground",children:r.description})]}),i.jsx("button",{type:"button",onClick:()=>ty(r.id),"aria-label":"Dismiss",className:"rounded-sm opacity-70 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Bd,{className:"h-4 w-4"})})]},r.id))})}const JS=new Set(["unauthorized","must_change_password","csrf"]),XS=new Ax({defaultOptions:{queries:{retry:(n,r)=>!(r instanceof Wn&&r.status>=400&&r.status<500)&&n<2,refetchOnWindowFocus:!0}},mutationCache:new eg({onError:(n,r,s,o)=>{var u;(u=o.meta)!=null&&u.inlineError||n instanceof Wn&&JS.has(n.code)||We({title:"Action failed",description:yt(n),variant:"error"})}})});fx.createRoot(document.getElementById("root")).render(i.jsx(ix.StrictMode,{children:i.jsxs(Dx,{client:XS,children:[i.jsx(ck,{router:GS}),i.jsx(YS,{})]})}));
|