@jasonews/agent-squad-gateway 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +200 -0
  3. package/SECURITY.md +44 -0
  4. package/dist/bin/agent-squad-gateway.js +55 -0
  5. package/dist/bin/agent-squad-gateway.js.map +1 -0
  6. package/dist/config/config.js +124 -0
  7. package/dist/config/config.js.map +1 -0
  8. package/dist/config/paths.js +16 -0
  9. package/dist/config/paths.js.map +1 -0
  10. package/dist/control-plane/clients.js +77 -0
  11. package/dist/control-plane/clients.js.map +1 -0
  12. package/dist/control-plane/core-connection.js +54 -0
  13. package/dist/control-plane/core-connection.js.map +1 -0
  14. package/dist/control-plane/credentials.js +134 -0
  15. package/dist/control-plane/credentials.js.map +1 -0
  16. package/dist/control-plane/db.js +33 -0
  17. package/dist/control-plane/db.js.map +1 -0
  18. package/dist/control-plane/extensions.js +59 -0
  19. package/dist/control-plane/extensions.js.map +1 -0
  20. package/dist/control-plane/grants.js +107 -0
  21. package/dist/control-plane/grants.js.map +1 -0
  22. package/dist/control-plane/idempotency.js +132 -0
  23. package/dist/control-plane/idempotency.js.map +1 -0
  24. package/dist/control-plane/migrations.js +133 -0
  25. package/dist/control-plane/migrations.js.map +1 -0
  26. package/dist/control-plane/response-sessions.js +359 -0
  27. package/dist/control-plane/response-sessions.js.map +1 -0
  28. package/dist/control-plane/retention.js +138 -0
  29. package/dist/control-plane/retention.js.map +1 -0
  30. package/dist/control-plane/runs.js +156 -0
  31. package/dist/control-plane/runs.js.map +1 -0
  32. package/dist/control-plane/targets.js +449 -0
  33. package/dist/control-plane/targets.js.map +1 -0
  34. package/dist/control-plane/types.js +2 -0
  35. package/dist/control-plane/types.js.map +1 -0
  36. package/dist/core-client/client.js +275 -0
  37. package/dist/core-client/client.js.map +1 -0
  38. package/dist/core-client/event-proxy.js +105 -0
  39. package/dist/core-client/event-proxy.js.map +1 -0
  40. package/dist/core-client/types.js +2 -0
  41. package/dist/core-client/types.js.map +1 -0
  42. package/dist/extensions/contract.js +2 -0
  43. package/dist/extensions/contract.js.map +1 -0
  44. package/dist/extensions/openai/auth.js +16 -0
  45. package/dist/extensions/openai/auth.js.map +1 -0
  46. package/dist/extensions/openai/chat.js +403 -0
  47. package/dist/extensions/openai/chat.js.map +1 -0
  48. package/dist/extensions/openai/errors.js +79 -0
  49. package/dist/extensions/openai/errors.js.map +1 -0
  50. package/dist/extensions/openai/image-input.js +79 -0
  51. package/dist/extensions/openai/image-input.js.map +1 -0
  52. package/dist/extensions/openai/models.js +40 -0
  53. package/dist/extensions/openai/models.js.map +1 -0
  54. package/dist/extensions/openai/responses.js +731 -0
  55. package/dist/extensions/openai/responses.js.map +1 -0
  56. package/dist/extensions/openai/routes.js +81 -0
  57. package/dist/extensions/openai/routes.js.map +1 -0
  58. package/dist/extensions/openai/run-attempt.js +96 -0
  59. package/dist/extensions/openai/run-attempt.js.map +1 -0
  60. package/dist/extensions/openai/schemas.js +176 -0
  61. package/dist/extensions/openai/schemas.js.map +1 -0
  62. package/dist/extensions/openai/sse.js +421 -0
  63. package/dist/extensions/openai/sse.js.map +1 -0
  64. package/dist/extensions/openai/tools.js +727 -0
  65. package/dist/extensions/openai/tools.js.map +1 -0
  66. package/dist/extensions/registry.js +30 -0
  67. package/dist/extensions/registry.js.map +1 -0
  68. package/dist/lifecycle/daemon.js +437 -0
  69. package/dist/lifecycle/daemon.js.map +1 -0
  70. package/dist/lifecycle/pidfile.js +34 -0
  71. package/dist/lifecycle/pidfile.js.map +1 -0
  72. package/dist/provider-runtime/antigravity/adapter.js +398 -0
  73. package/dist/provider-runtime/antigravity/adapter.js.map +1 -0
  74. package/dist/provider-runtime/antigravity/conversation.js +31 -0
  75. package/dist/provider-runtime/antigravity/conversation.js.map +1 -0
  76. package/dist/provider-runtime/capability-service.js +191 -0
  77. package/dist/provider-runtime/capability-service.js.map +1 -0
  78. package/dist/provider-runtime/claude/adapter.js +397 -0
  79. package/dist/provider-runtime/claude/adapter.js.map +1 -0
  80. package/dist/provider-runtime/claude/protocol.js +143 -0
  81. package/dist/provider-runtime/claude/protocol.js.map +1 -0
  82. package/dist/provider-runtime/codex/adapter.js +440 -0
  83. package/dist/provider-runtime/codex/adapter.js.map +1 -0
  84. package/dist/provider-runtime/codex/json-rpc-client.js +182 -0
  85. package/dist/provider-runtime/codex/json-rpc-client.js.map +1 -0
  86. package/dist/provider-runtime/codex/protocol.js +128 -0
  87. package/dist/provider-runtime/codex/protocol.js.map +1 -0
  88. package/dist/provider-runtime/command-discovery.js +106 -0
  89. package/dist/provider-runtime/command-discovery.js.map +1 -0
  90. package/dist/provider-runtime/cursor/adapter.js +427 -0
  91. package/dist/provider-runtime/cursor/adapter.js.map +1 -0
  92. package/dist/provider-runtime/cursor/protocol.js +81 -0
  93. package/dist/provider-runtime/cursor/protocol.js.map +1 -0
  94. package/dist/provider-runtime/fake/adapter.js +138 -0
  95. package/dist/provider-runtime/fake/adapter.js.map +1 -0
  96. package/dist/provider-runtime/image-assets.js +409 -0
  97. package/dist/provider-runtime/image-assets.js.map +1 -0
  98. package/dist/provider-runtime/image-support.js +5 -0
  99. package/dist/provider-runtime/image-support.js.map +1 -0
  100. package/dist/provider-runtime/invocation-service.js +503 -0
  101. package/dist/provider-runtime/invocation-service.js.map +1 -0
  102. package/dist/provider-runtime/kimi/adapter.js +657 -0
  103. package/dist/provider-runtime/kimi/adapter.js.map +1 -0
  104. package/dist/provider-runtime/opencode/adapter.js +610 -0
  105. package/dist/provider-runtime/opencode/adapter.js.map +1 -0
  106. package/dist/provider-runtime/opencode/server.js +46 -0
  107. package/dist/provider-runtime/opencode/server.js.map +1 -0
  108. package/dist/provider-runtime/process/line-reader.js +49 -0
  109. package/dist/provider-runtime/process/line-reader.js.map +1 -0
  110. package/dist/provider-runtime/process/managed-process.js +151 -0
  111. package/dist/provider-runtime/process/managed-process.js.map +1 -0
  112. package/dist/provider-runtime/provider-input.js +77 -0
  113. package/dist/provider-runtime/provider-input.js.map +1 -0
  114. package/dist/provider-runtime/register-providers.js +26 -0
  115. package/dist/provider-runtime/register-providers.js.map +1 -0
  116. package/dist/provider-runtime/registry.js +35 -0
  117. package/dist/provider-runtime/registry.js.map +1 -0
  118. package/dist/provider-runtime/replay-buffer.js +168 -0
  119. package/dist/provider-runtime/replay-buffer.js.map +1 -0
  120. package/dist/provider-runtime/scheduler.js +155 -0
  121. package/dist/provider-runtime/scheduler.js.map +1 -0
  122. package/dist/provider-runtime/types.js +2 -0
  123. package/dist/provider-runtime/types.js.map +1 -0
  124. package/dist/provider-runtime/workspaces.js +814 -0
  125. package/dist/provider-runtime/workspaces.js.map +1 -0
  126. package/dist/security/admin-auth.js +109 -0
  127. package/dist/security/admin-auth.js.map +1 -0
  128. package/dist/security/crypto.js +52 -0
  129. package/dist/security/crypto.js.map +1 -0
  130. package/dist/security/secret-files.js +33 -0
  131. package/dist/security/secret-files.js.map +1 -0
  132. package/dist/server/admin-routes.js +610 -0
  133. package/dist/server/admin-routes.js.map +1 -0
  134. package/dist/server/app.js +178 -0
  135. package/dist/server/app.js.map +1 -0
  136. package/dist/server/auth-hooks.js +43 -0
  137. package/dist/server/auth-hooks.js.map +1 -0
  138. package/dist/server/core-routes.js +127 -0
  139. package/dist/server/core-routes.js.map +1 -0
  140. package/dist/server/errors.js +19 -0
  141. package/dist/server/errors.js.map +1 -0
  142. package/dist/server/ui-routes.js +77 -0
  143. package/dist/server/ui-routes.js.map +1 -0
  144. package/dist/web/assets/index-BhqNoPpE.js +206 -0
  145. package/dist/web/assets/index-BhqNoPpE.js.map +1 -0
  146. package/dist/web/assets/index-C5nnaBfZ.css +1 -0
  147. package/dist/web/index.html +14 -0
  148. package/package.json +74 -0
  149. package/translations/README.zh-CN.md +175 -0
@@ -0,0 +1,206 @@
1
+ var yy=Object.defineProperty;var Mf=s=>{throw TypeError(s)};var vy=(s,n,i)=>n in s?yy(s,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[n]=i;var Af=(s,n,i)=>vy(s,typeof n!="symbol"?n+"":n,i),Zo=(s,n,i)=>n.has(s)||Mf("Cannot "+i);var g=(s,n,i)=>(Zo(s,n,"read from private field"),i?i.call(s):n.get(s)),ae=(s,n,i)=>n.has(s)?Mf("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,i),K=(s,n,i,l)=>(Zo(s,n,"write to private field"),l?l.call(s,i):n.set(s,i),i),xe=(s,n,i)=>(Zo(s,n,"access private method"),i);var Fa=(s,n,i,l)=>({set _(c){K(s,n,c,i)},get _(){return g(s,n,l)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function i(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(c){if(c.ep)return;c.ep=!0;const f=i(c);fetch(c.href,f)}})();var Go={exports:{}},fi={},Yo={exports:{}},_e={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ff;function gy(){if(Ff)return _e;Ff=1;var s=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),E=Symbol.iterator;function I(v){return v===null||typeof v!="object"?null:(v=E&&v[E]||v["@@iterator"],typeof v=="function"?v:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,D={};function P(v,R,ie){this.props=v,this.context=R,this.refs=D,this.updater=ie||z}P.prototype.isReactComponent={},P.prototype.setState=function(v,R){if(typeof v!="object"&&typeof v!="function"&&v!=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,v,R,"setState")},P.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function T(){}T.prototype=P.prototype;function Y(v,R,ie){this.props=v,this.context=R,this.refs=D,this.updater=ie||z}var A=Y.prototype=new T;A.constructor=Y,V(A,P.prototype),A.isPureReactComponent=!0;var F=Array.isArray,Q=Object.prototype.hasOwnProperty,ue={current:null},he={key:!0,ref:!0,__self:!0,__source:!0};function oe(v,R,ie){var Ce,je={},Ee=null,De=null;if(R!=null)for(Ce in R.ref!==void 0&&(De=R.ref),R.key!==void 0&&(Ee=""+R.key),R)Q.call(R,Ce)&&!he.hasOwnProperty(Ce)&&(je[Ce]=R[Ce]);var Le=arguments.length-2;if(Le===1)je.children=ie;else if(1<Le){for(var Ve=Array(Le),Ot=0;Ot<Le;Ot++)Ve[Ot]=arguments[Ot+2];je.children=Ve}if(v&&v.defaultProps)for(Ce in Le=v.defaultProps,Le)je[Ce]===void 0&&(je[Ce]=Le[Ce]);return{$$typeof:s,type:v,key:Ee,ref:De,props:je,_owner:ue.current}}function U(v,R){return{$$typeof:s,type:v.type,key:R,ref:v.ref,props:v.props,_owner:v._owner}}function le(v){return typeof v=="object"&&v!==null&&v.$$typeof===s}function B(v){var R={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(ie){return R[ie]})}var Se=/\/+/g;function te(v,R){return typeof v=="object"&&v!==null&&v.key!=null?B(""+v.key):R.toString(36)}function ge(v,R,ie,Ce,je){var Ee=typeof v;(Ee==="undefined"||Ee==="boolean")&&(v=null);var De=!1;if(v===null)De=!0;else switch(Ee){case"string":case"number":De=!0;break;case"object":switch(v.$$typeof){case s:case n:De=!0}}if(De)return De=v,je=je(De),v=Ce===""?"."+te(De,0):Ce,F(je)?(ie="",v!=null&&(ie=v.replace(Se,"$&/")+"/"),ge(je,R,ie,"",function(Ot){return Ot})):je!=null&&(le(je)&&(je=U(je,ie+(!je.key||De&&De.key===je.key?"":(""+je.key).replace(Se,"$&/")+"/")+v)),R.push(je)),1;if(De=0,Ce=Ce===""?".":Ce+":",F(v))for(var Le=0;Le<v.length;Le++){Ee=v[Le];var Ve=Ce+te(Ee,Le);De+=ge(Ee,R,ie,Ve,je)}else if(Ve=I(v),typeof Ve=="function")for(v=Ve.call(v),Le=0;!(Ee=v.next()).done;)Ee=Ee.value,Ve=Ce+te(Ee,Le++),De+=ge(Ee,R,ie,Ve,je);else if(Ee==="object")throw R=String(v),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.");return De}function ze(v,R,ie){if(v==null)return v;var Ce=[],je=0;return ge(v,Ce,"","",function(Ee){return R.call(ie,Ee,je++)}),Ce}function Be(v){if(v._status===-1){var R=v._result;R=R(),R.then(function(ie){(v._status===0||v._status===-1)&&(v._status=1,v._result=ie)},function(ie){(v._status===0||v._status===-1)&&(v._status=2,v._result=ie)}),v._status===-1&&(v._status=0,v._result=R)}if(v._status===1)return v._result.default;throw v._result}var Ie={current:null},H={transition:null},fe={ReactCurrentDispatcher:Ie,ReactCurrentBatchConfig:H,ReactCurrentOwner:ue};function G(){throw Error("act(...) is not supported in production builds of React.")}return _e.Children={map:ze,forEach:function(v,R,ie){ze(v,function(){R.apply(this,arguments)},ie)},count:function(v){var R=0;return ze(v,function(){R++}),R},toArray:function(v){return ze(v,function(R){return R})||[]},only:function(v){if(!le(v))throw Error("React.Children.only expected to receive a single React element child.");return v}},_e.Component=P,_e.Fragment=i,_e.Profiler=c,_e.PureComponent=Y,_e.StrictMode=l,_e.Suspense=w,_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fe,_e.act=G,_e.cloneElement=function(v,R,ie){if(v==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+v+".");var Ce=V({},v.props),je=v.key,Ee=v.ref,De=v._owner;if(R!=null){if(R.ref!==void 0&&(Ee=R.ref,De=ue.current),R.key!==void 0&&(je=""+R.key),v.type&&v.type.defaultProps)var Le=v.type.defaultProps;for(Ve in R)Q.call(R,Ve)&&!he.hasOwnProperty(Ve)&&(Ce[Ve]=R[Ve]===void 0&&Le!==void 0?Le[Ve]:R[Ve])}var Ve=arguments.length-2;if(Ve===1)Ce.children=ie;else if(1<Ve){Le=Array(Ve);for(var Ot=0;Ot<Ve;Ot++)Le[Ot]=arguments[Ot+2];Ce.children=Le}return{$$typeof:s,type:v.type,key:je,ref:Ee,props:Ce,_owner:De}},_e.createContext=function(v){return v={$$typeof:p,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},v.Provider={$$typeof:f,_context:v},v.Consumer=v},_e.createElement=oe,_e.createFactory=function(v){var R=oe.bind(null,v);return R.type=v,R},_e.createRef=function(){return{current:null}},_e.forwardRef=function(v){return{$$typeof:m,render:v}},_e.isValidElement=le,_e.lazy=function(v){return{$$typeof:C,_payload:{_status:-1,_result:v},_init:Be}},_e.memo=function(v,R){return{$$typeof:S,type:v,compare:R===void 0?null:R}},_e.startTransition=function(v){var R=H.transition;H.transition={};try{v()}finally{H.transition=R}},_e.unstable_act=G,_e.useCallback=function(v,R){return Ie.current.useCallback(v,R)},_e.useContext=function(v){return Ie.current.useContext(v)},_e.useDebugValue=function(){},_e.useDeferredValue=function(v){return Ie.current.useDeferredValue(v)},_e.useEffect=function(v,R){return Ie.current.useEffect(v,R)},_e.useId=function(){return Ie.current.useId()},_e.useImperativeHandle=function(v,R,ie){return Ie.current.useImperativeHandle(v,R,ie)},_e.useInsertionEffect=function(v,R){return Ie.current.useInsertionEffect(v,R)},_e.useLayoutEffect=function(v,R){return Ie.current.useLayoutEffect(v,R)},_e.useMemo=function(v,R){return Ie.current.useMemo(v,R)},_e.useReducer=function(v,R,ie){return Ie.current.useReducer(v,R,ie)},_e.useRef=function(v){return Ie.current.useRef(v)},_e.useState=function(v){return Ie.current.useState(v)},_e.useSyncExternalStore=function(v,R,ie){return Ie.current.useSyncExternalStore(v,R,ie)},_e.useTransition=function(){return Ie.current.useTransition()},_e.version="18.3.1",_e}var zf;function Eu(){return zf||(zf=1,Yo.exports=gy()),Yo.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Df;function xy(){if(Df)return fi;Df=1;var s=Eu(),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function p(m,w,S){var C,E={},I=null,z=null;S!==void 0&&(I=""+S),w.key!==void 0&&(I=""+w.key),w.ref!==void 0&&(z=w.ref);for(C in w)l.call(w,C)&&!f.hasOwnProperty(C)&&(E[C]=w[C]);if(m&&m.defaultProps)for(C in w=m.defaultProps,w)E[C]===void 0&&(E[C]=w[C]);return{$$typeof:n,type:m,key:I,ref:z,props:E,_owner:c.current}}return fi.Fragment=i,fi.jsx=p,fi.jsxs=p,fi}var Uf;function wy(){return Uf||(Uf=1,Go.exports=xy()),Go.exports}var u=wy(),za={},Jo={exports:{}},bt={},Xo={exports:{}},eu={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var qf;function ky(){return qf||(qf=1,(function(s){function n(H,fe){var G=H.length;H.push(fe);e:for(;0<G;){var v=G-1>>>1,R=H[v];if(0<c(R,fe))H[v]=fe,H[G]=R,G=v;else break e}}function i(H){return H.length===0?null:H[0]}function l(H){if(H.length===0)return null;var fe=H[0],G=H.pop();if(G!==fe){H[0]=G;e:for(var v=0,R=H.length,ie=R>>>1;v<ie;){var Ce=2*(v+1)-1,je=H[Ce],Ee=Ce+1,De=H[Ee];if(0>c(je,G))Ee<R&&0>c(De,je)?(H[v]=De,H[Ee]=G,v=Ee):(H[v]=je,H[Ce]=G,v=Ce);else if(Ee<R&&0>c(De,G))H[v]=De,H[Ee]=G,v=Ee;else break e}}return fe}function c(H,fe){var G=H.sortIndex-fe.sortIndex;return G!==0?G:H.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var p=Date,m=p.now();s.unstable_now=function(){return p.now()-m}}var w=[],S=[],C=1,E=null,I=3,z=!1,V=!1,D=!1,P=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(H){for(var fe=i(S);fe!==null;){if(fe.callback===null)l(S);else if(fe.startTime<=H)l(S),fe.sortIndex=fe.expirationTime,n(w,fe);else break;fe=i(S)}}function F(H){if(D=!1,A(H),!V)if(i(w)!==null)V=!0,Be(Q);else{var fe=i(S);fe!==null&&Ie(F,fe.startTime-H)}}function Q(H,fe){V=!1,D&&(D=!1,T(oe),oe=-1),z=!0;var G=I;try{for(A(fe),E=i(w);E!==null&&(!(E.expirationTime>fe)||H&&!B());){var v=E.callback;if(typeof v=="function"){E.callback=null,I=E.priorityLevel;var R=v(E.expirationTime<=fe);fe=s.unstable_now(),typeof R=="function"?E.callback=R:E===i(w)&&l(w),A(fe)}else l(w);E=i(w)}if(E!==null)var ie=!0;else{var Ce=i(S);Ce!==null&&Ie(F,Ce.startTime-fe),ie=!1}return ie}finally{E=null,I=G,z=!1}}var ue=!1,he=null,oe=-1,U=5,le=-1;function B(){return!(s.unstable_now()-le<U)}function Se(){if(he!==null){var H=s.unstable_now();le=H;var fe=!0;try{fe=he(!0,H)}finally{fe?te():(ue=!1,he=null)}}else ue=!1}var te;if(typeof Y=="function")te=function(){Y(Se)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ze=ge.port2;ge.port1.onmessage=Se,te=function(){ze.postMessage(null)}}else te=function(){P(Se,0)};function Be(H){he=H,ue||(ue=!0,te())}function Ie(H,fe){oe=P(function(){H(s.unstable_now())},fe)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(H){H.callback=null},s.unstable_continueExecution=function(){V||z||(V=!0,Be(Q))},s.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<H?Math.floor(1e3/H):5},s.unstable_getCurrentPriorityLevel=function(){return I},s.unstable_getFirstCallbackNode=function(){return i(w)},s.unstable_next=function(H){switch(I){case 1:case 2:case 3:var fe=3;break;default:fe=I}var G=I;I=fe;try{return H()}finally{I=G}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(H,fe){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var G=I;I=H;try{return fe()}finally{I=G}},s.unstable_scheduleCallback=function(H,fe,G){var v=s.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?v+G:v):G=v,H){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=G+R,H={id:C++,callback:fe,priorityLevel:H,startTime:G,expirationTime:R,sortIndex:-1},G>v?(H.sortIndex=G,n(S,H),i(w)===null&&H===i(S)&&(D?(T(oe),oe=-1):D=!0,Ie(F,G-v))):(H.sortIndex=R,n(w,H),V||z||(V=!0,Be(Q))),H},s.unstable_shouldYield=B,s.unstable_wrapCallback=function(H){var fe=I;return function(){var G=I;I=fe;try{return H.apply(this,arguments)}finally{I=G}}}})(eu)),eu}var $f;function Cy(){return $f||($f=1,Xo.exports=ky()),Xo.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Vf;function _y(){if(Vf)return bt;Vf=1;var s=Eu(),n=Cy();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 l=new Set,c={};function f(e,t){p(e,t),p(e+"Capture",t)}function p(e,t){for(c[e]=t,e=0;e<t.length;e++)l.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),w=Object.prototype.hasOwnProperty,S=/^[: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]*$/,C={},E={};function I(e){return w.call(E,e)?!0:w.call(C,e)?!1:S.test(e)?E[e]=!0:(C[e]=!0,!1)}function z(e,t,r,a){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function V(e,t,r,a){if(t===null||typeof t>"u"||z(e,t,r,a))return!0;if(a)return!1;if(r!==null)switch(r.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 D(e,t,r,a,o,d,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=h}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[e]=new D(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];P[t]=new D(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new D(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[e]=new D(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){P[e]=new D(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new D(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new D(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new D(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new D(e,5,!1,e.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function Y(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(T,Y);P[t]=new D(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(T,Y);P[t]=new D(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(T,Y);P[t]=new D(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new D(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new D("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new D(e,1,!1,e.toLowerCase(),null,!0,!0)});function A(e,t,r,a){var o=P.hasOwnProperty(t)?P[t]:null;(o!==null?o.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(V(t,r,o,a)&&(r=null),a||o===null?I(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,a=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,a?e.setAttributeNS(a,t,r):e.setAttribute(t,r))))}var F=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Q=Symbol.for("react.element"),ue=Symbol.for("react.portal"),he=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),le=Symbol.for("react.provider"),B=Symbol.for("react.context"),Se=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),Be=Symbol.for("react.lazy"),Ie=Symbol.for("react.offscreen"),H=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,v;function R(e){if(v===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);v=t&&t[1]||""}return`
34
+ `+v+e}var ie=!1;function Ce(e,t){if(!e||ie)return"";ie=!0;var r=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(N){var a=N}Reflect.construct(e,[],t)}else{try{t.call()}catch(N){a=N}e.call(t.prototype)}else{try{throw Error()}catch(N){a=N}e()}}catch(N){if(N&&a&&typeof N.stack=="string"){for(var o=N.stack.split(`
35
+ `),d=a.stack.split(`
36
+ `),h=o.length-1,y=d.length-1;1<=h&&0<=y&&o[h]!==d[y];)y--;for(;1<=h&&0<=y;h--,y--)if(o[h]!==d[y]){if(h!==1||y!==1)do if(h--,y--,0>y||o[h]!==d[y]){var x=`
37
+ `+o[h].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),x}while(1<=h&&0<=y);break}}}finally{ie=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?R(e):""}function je(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=Ce(e.type,!1),e;case 11:return e=Ce(e.type.render,!1),e;case 1:return e=Ce(e.type,!0),e;default:return""}}function Ee(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 he:return"Fragment";case ue:return"Portal";case U:return"Profiler";case oe:return"StrictMode";case te:return"Suspense";case ge:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case B:return(e.displayName||"Context")+".Consumer";case le:return(e._context.displayName||"Context")+".Provider";case Se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ze:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case Be:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}function De(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 Ee(t);case 8:return t===oe?"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 Le(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ve(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ot(e){var t=Ve(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){a=""+h,d.call(this,h)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ni(e){e._valueTracker||(e._valueTracker=Ot(e))}function Uu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=Ve(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function bi(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 tl(e,t){var r=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function qu(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=Le(t.value!=null?t.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $u(e,t){t=t.checked,t!=null&&A(e,"checked",t,!1)}function nl(e,t){$u(e,t);var r=Le(t.value),a=t.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?rl(e,t.type,r):t.hasOwnProperty("defaultValue")&&rl(e,t.type,Le(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vu(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function rl(e,t,r){(t!=="number"||bi(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ns=Array.isArray;function Fr(e,t,r,a){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&a&&(e[r].defaultSelected=!0)}else{for(r=""+Le(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,a&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function sl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return G({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qu(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(i(92));if(Ns(r)){if(1<r.length)throw Error(i(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Le(r)}}function Bu(e,t){var r=Le(t.value),a=Le(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),a!=null&&(e.defaultValue=""+a)}function Hu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ku(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 il(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ku(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ri,Wu=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,a,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,a,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ri=Ri||document.createElement("div"),Ri.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ri.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Rs={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},wp=["Webkit","ms","Moz","O"];Object.keys(Rs).forEach(function(e){wp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rs[t]=Rs[e]})});function Zu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Rs.hasOwnProperty(e)&&Rs[e]?(""+t).trim():t+"px"}function Gu(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var a=r.indexOf("--")===0,o=Zu(r,t[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,o):e[r]=o}}var kp=G({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 al(e,t){if(t){if(kp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function ll(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 ol=null;function ul(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cl=null,zr=null,Dr=null;function Yu(e){if(e=Ys(e)){if(typeof cl!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Ji(t),cl(e.stateNode,e.type,t))}}function Ju(e){zr?Dr?Dr.push(e):Dr=[e]:zr=e}function Xu(){if(zr){var e=zr,t=Dr;if(Dr=zr=null,Yu(e),t)for(e=0;e<t.length;e++)Yu(t[e])}}function ec(e,t){return e(t)}function tc(){}var dl=!1;function nc(e,t,r){if(dl)return e(t,r);dl=!0;try{return ec(e,t,r)}finally{dl=!1,(zr!==null||Dr!==null)&&(tc(),Xu())}}function Ts(e,t){var r=e.stateNode;if(r===null)return null;var a=Ji(r);if(a===null)return null;r=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,t,typeof r));return r}var fl=!1;if(m)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){fl=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{fl=!1}function Cp(e,t,r,a,o,d,h,y,x){var N=Array.prototype.slice.call(arguments,3);try{t.apply(r,N)}catch(L){this.onError(L)}}var Os=!1,Ti=null,Pi=!1,hl=null,_p={onError:function(e){Os=!0,Ti=e}};function Sp(e,t,r,a,o,d,h,y,x){Os=!1,Ti=null,Cp.apply(_p,arguments)}function jp(e,t,r,a,o,d,h,y,x){if(Sp.apply(this,arguments),Os){if(Os){var N=Ti;Os=!1,Ti=null}else throw Error(i(198));Pi||(Pi=!0,hl=N)}}function cr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function rc(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 sc(e){if(cr(e)!==e)throw Error(i(188))}function Ep(e){var t=e.alternate;if(!t){if(t=cr(e),t===null)throw Error(i(188));return t!==e?null:e}for(var r=e,a=t;;){var o=r.return;if(o===null)break;var d=o.alternate;if(d===null){if(a=o.return,a!==null){r=a;continue}break}if(o.child===d.child){for(d=o.child;d;){if(d===r)return sc(o),e;if(d===a)return sc(o),t;d=d.sibling}throw Error(i(188))}if(r.return!==a.return)r=o,a=d;else{for(var h=!1,y=o.child;y;){if(y===r){h=!0,r=o,a=d;break}if(y===a){h=!0,a=o,r=d;break}y=y.sibling}if(!h){for(y=d.child;y;){if(y===r){h=!0,r=d,a=o;break}if(y===a){h=!0,a=d,r=o;break}y=y.sibling}if(!h)throw Error(i(189))}}if(r.alternate!==a)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:t}function ic(e){return e=Ep(e),e!==null?ac(e):null}function ac(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ac(e);if(t!==null)return t;e=e.sibling}return null}var lc=n.unstable_scheduleCallback,oc=n.unstable_cancelCallback,Np=n.unstable_shouldYield,bp=n.unstable_requestPaint,Ge=n.unstable_now,Rp=n.unstable_getCurrentPriorityLevel,pl=n.unstable_ImmediatePriority,uc=n.unstable_UserBlockingPriority,Oi=n.unstable_NormalPriority,Tp=n.unstable_LowPriority,cc=n.unstable_IdlePriority,Ii=null,nn=null;function Pp(e){if(nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(Ii,e,void 0,(e.current.flags&128)===128)}catch{}}var Kt=Math.clz32?Math.clz32:Lp,Op=Math.log,Ip=Math.LN2;function Lp(e){return e>>>=0,e===0?32:31-(Op(e)/Ip|0)|0}var Li=64,Mi=4194304;function Is(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 Ai(e,t){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,d=e.pingedLanes,h=r&268435455;if(h!==0){var y=h&~o;y!==0?a=Is(y):(d&=h,d!==0&&(a=Is(d)))}else h=r&~o,h!==0?a=Is(h):d!==0&&(a=Is(d));if(a===0)return 0;if(t!==0&&t!==a&&(t&o)===0&&(o=a&-a,d=t&-t,o>=d||o===16&&(d&4194240)!==0))return t;if((a&4)!==0&&(a|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)r=31-Kt(t),o=1<<r,a|=e[r],t&=~o;return a}function Mp(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 Ap(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,d=e.pendingLanes;0<d;){var h=31-Kt(d),y=1<<h,x=o[h];x===-1?((y&r)===0||(y&a)!==0)&&(o[h]=Mp(y,t)):x<=t&&(e.expiredLanes|=y),d&=~y}}function ml(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function dc(){var e=Li;return Li<<=1,(Li&4194240)===0&&(Li=64),e}function yl(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ls(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=r}function Fp(e,t){var r=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 a=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-Kt(r),d=1<<o;t[o]=0,a[o]=-1,e[o]=-1,r&=~d}}function vl(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Kt(r),o=1<<a;o&t|e[a]&t&&(e[a]|=t),r&=~o}}var Me=0;function fc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var hc,gl,pc,mc,yc,xl=!1,Fi=[],Tn=null,Pn=null,On=null,Ms=new Map,As=new Map,In=[],zp="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 vc(e,t){switch(e){case"focusin":case"focusout":Tn=null;break;case"dragenter":case"dragleave":Pn=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":Ms.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(t.pointerId)}}function Fs(e,t,r,a,o,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:d,targetContainers:[o]},t!==null&&(t=Ys(t),t!==null&&gl(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Dp(e,t,r,a,o){switch(t){case"focusin":return Tn=Fs(Tn,e,t,r,a,o),!0;case"dragenter":return Pn=Fs(Pn,e,t,r,a,o),!0;case"mouseover":return On=Fs(On,e,t,r,a,o),!0;case"pointerover":var d=o.pointerId;return Ms.set(d,Fs(Ms.get(d)||null,e,t,r,a,o)),!0;case"gotpointercapture":return d=o.pointerId,As.set(d,Fs(As.get(d)||null,e,t,r,a,o)),!0}return!1}function gc(e){var t=dr(e.target);if(t!==null){var r=cr(t);if(r!==null){if(t=r.tag,t===13){if(t=rc(r),t!==null){e.blockedOn=t,yc(e.priority,function(){pc(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=kl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);ol=a,r.target.dispatchEvent(a),ol=null}else return t=Ys(r),t!==null&&gl(t),e.blockedOn=r,!1;t.shift()}return!0}function xc(e,t,r){zi(e)&&r.delete(t)}function Up(){xl=!1,Tn!==null&&zi(Tn)&&(Tn=null),Pn!==null&&zi(Pn)&&(Pn=null),On!==null&&zi(On)&&(On=null),Ms.forEach(xc),As.forEach(xc)}function zs(e,t){e.blockedOn===t&&(e.blockedOn=null,xl||(xl=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Up)))}function Ds(e){function t(o){return zs(o,e)}if(0<Fi.length){zs(Fi[0],e);for(var r=1;r<Fi.length;r++){var a=Fi[r];a.blockedOn===e&&(a.blockedOn=null)}}for(Tn!==null&&zs(Tn,e),Pn!==null&&zs(Pn,e),On!==null&&zs(On,e),Ms.forEach(t),As.forEach(t),r=0;r<In.length;r++)a=In[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<In.length&&(r=In[0],r.blockedOn===null);)gc(r),r.blockedOn===null&&In.shift()}var Ur=F.ReactCurrentBatchConfig,Di=!0;function qp(e,t,r,a){var o=Me,d=Ur.transition;Ur.transition=null;try{Me=1,wl(e,t,r,a)}finally{Me=o,Ur.transition=d}}function $p(e,t,r,a){var o=Me,d=Ur.transition;Ur.transition=null;try{Me=4,wl(e,t,r,a)}finally{Me=o,Ur.transition=d}}function wl(e,t,r,a){if(Di){var o=kl(e,t,r,a);if(o===null)zl(e,t,a,Ui,r),vc(e,a);else if(Dp(o,e,t,r,a))a.stopPropagation();else if(vc(e,a),t&4&&-1<zp.indexOf(e)){for(;o!==null;){var d=Ys(o);if(d!==null&&hc(d),d=kl(e,t,r,a),d===null&&zl(e,t,a,Ui,r),d===o)break;o=d}o!==null&&a.stopPropagation()}else zl(e,t,a,null,r)}}var Ui=null;function kl(e,t,r,a){if(Ui=null,e=ul(a),e=dr(e),e!==null)if(t=cr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=rc(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ui=e,null}function wc(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(Rp()){case pl:return 1;case uc:return 4;case Oi:case Tp:return 16;case cc:return 536870912;default:return 16}default:return 16}}var Ln=null,Cl=null,qi=null;function kc(){if(qi)return qi;var e,t=Cl,r=t.length,a,o="value"in Ln?Ln.value:Ln.textContent,d=o.length;for(e=0;e<r&&t[e]===o[e];e++);var h=r-e;for(a=1;a<=h&&t[r-a]===o[d-a];a++);return qi=o.slice(e,1<a?1-a:void 0)}function $i(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 Vi(){return!0}function Cc(){return!1}function It(e){function t(r,a,o,d,h){this._reactName=r,this._targetInst=o,this.type=a,this.nativeEvent=d,this.target=h,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(r=e[y],this[y]=r?r(d):d[y]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Vi:Cc,this.isPropagationStopped=Cc,this}return G(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Vi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Vi)},persist:function(){},isPersistent:Vi}),t}var qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_l=It(qr),Us=G({},qr,{view:0,detail:0}),Vp=It(Us),Sl,jl,qs,Qi=G({},Us,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nl,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!==qs&&(qs&&e.type==="mousemove"?(Sl=e.screenX-qs.screenX,jl=e.screenY-qs.screenY):jl=Sl=0,qs=e),Sl)},movementY:function(e){return"movementY"in e?e.movementY:jl}}),_c=It(Qi),Qp=G({},Qi,{dataTransfer:0}),Bp=It(Qp),Hp=G({},Us,{relatedTarget:0}),El=It(Hp),Kp=G({},qr,{animationName:0,elapsedTime:0,pseudoElement:0}),Wp=It(Kp),Zp=G({},qr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gp=It(Zp),Yp=G({},qr,{data:0}),Sc=It(Yp),Jp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xp={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"},em={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=em[e])?!!t[e]:!1}function Nl(){return tm}var nm=G({},Us,{key:function(e){if(e.key){var t=Jp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$i(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nl,charCode:function(e){return e.type==="keypress"?$i(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$i(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rm=It(nm),sm=G({},Qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jc=It(sm),im=G({},Us,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nl}),am=It(im),lm=G({},qr,{propertyName:0,elapsedTime:0,pseudoElement:0}),om=It(lm),um=G({},Qi,{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}),cm=It(um),dm=[9,13,27,32],bl=m&&"CompositionEvent"in window,$s=null;m&&"documentMode"in document&&($s=document.documentMode);var fm=m&&"TextEvent"in window&&!$s,Ec=m&&(!bl||$s&&8<$s&&11>=$s),Nc=" ",bc=!1;function Rc(e,t){switch(e){case"keyup":return dm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $r=!1;function hm(e,t){switch(e){case"compositionend":return Tc(t);case"keypress":return t.which!==32?null:(bc=!0,Nc);case"textInput":return e=t.data,e===Nc&&bc?null:e;default:return null}}function pm(e,t){if($r)return e==="compositionend"||!bl&&Rc(e,t)?(e=kc(),qi=Cl=Ln=null,$r=!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 Ec&&t.locale!=="ko"?null:t.data;default:return null}}var mm={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 Pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mm[e.type]:t==="textarea"}function Oc(e,t,r,a){Ju(a),t=Zi(t,"onChange"),0<t.length&&(r=new _l("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var Vs=null,Qs=null;function ym(e){Gc(e,0)}function Bi(e){var t=Kr(e);if(Uu(t))return e}function vm(e,t){if(e==="change")return t}var Ic=!1;if(m){var Rl;if(m){var Tl="oninput"in document;if(!Tl){var Lc=document.createElement("div");Lc.setAttribute("oninput","return;"),Tl=typeof Lc.oninput=="function"}Rl=Tl}else Rl=!1;Ic=Rl&&(!document.documentMode||9<document.documentMode)}function Mc(){Vs&&(Vs.detachEvent("onpropertychange",Ac),Qs=Vs=null)}function Ac(e){if(e.propertyName==="value"&&Bi(Qs)){var t=[];Oc(t,Qs,e,ul(e)),nc(ym,t)}}function gm(e,t,r){e==="focusin"?(Mc(),Vs=t,Qs=r,Vs.attachEvent("onpropertychange",Ac)):e==="focusout"&&Mc()}function xm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(Qs)}function wm(e,t){if(e==="click")return Bi(t)}function km(e,t){if(e==="input"||e==="change")return Bi(t)}function Cm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:Cm;function Bs(e,t){if(Wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var o=r[a];if(!w.call(t,o)||!Wt(e[o],t[o]))return!1}return!0}function Fc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zc(e,t){var r=Fc(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Fc(r)}}function Dc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uc(){for(var e=window,t=bi();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=bi(e.document)}return t}function Pl(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 _m(e){var t=Uc(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Dc(r.ownerDocument.documentElement,r)){if(a!==null&&Pl(r)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,d=Math.min(a.start,o);a=a.end===void 0?d:Math.min(a.end,o),!e.extend&&d>a&&(o=a,a=d,d=o),o=zc(r,d);var h=zc(r,a);o&&h&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),d>a?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Sm=m&&"documentMode"in document&&11>=document.documentMode,Vr=null,Ol=null,Hs=null,Il=!1;function qc(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Il||Vr==null||Vr!==bi(a)||(a=Vr,"selectionStart"in a&&Pl(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Hs&&Bs(Hs,a)||(Hs=a,a=Zi(Ol,"onSelect"),0<a.length&&(t=new _l("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Vr)))}function Hi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Qr={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionend:Hi("Transition","TransitionEnd")},Ll={},$c={};m&&($c=document.createElement("div").style,"AnimationEvent"in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),"TransitionEvent"in window||delete Qr.transitionend.transition);function Ki(e){if(Ll[e])return Ll[e];if(!Qr[e])return e;var t=Qr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in $c)return Ll[e]=t[r];return e}var Vc=Ki("animationend"),Qc=Ki("animationiteration"),Bc=Ki("animationstart"),Hc=Ki("transitionend"),Kc=new Map,Wc="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 Mn(e,t){Kc.set(e,t),f(t,[e])}for(var Ml=0;Ml<Wc.length;Ml++){var Al=Wc[Ml],jm=Al.toLowerCase(),Em=Al[0].toUpperCase()+Al.slice(1);Mn(jm,"on"+Em)}Mn(Vc,"onAnimationEnd"),Mn(Qc,"onAnimationIteration"),Mn(Bc,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(Hc,"onTransitionEnd"),p("onMouseEnter",["mouseout","mouseover"]),p("onMouseLeave",["mouseout","mouseover"]),p("onPointerEnter",["pointerout","pointerover"]),p("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="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(" "),Nm=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ks));function Zc(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,jp(a,t,void 0,e),e.currentTarget=null}function Gc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],o=a.event;a=a.listeners;e:{var d=void 0;if(t)for(var h=a.length-1;0<=h;h--){var y=a[h],x=y.instance,N=y.currentTarget;if(y=y.listener,x!==d&&o.isPropagationStopped())break e;Zc(o,y,N),d=x}else for(h=0;h<a.length;h++){if(y=a[h],x=y.instance,N=y.currentTarget,y=y.listener,x!==d&&o.isPropagationStopped())break e;Zc(o,y,N),d=x}}}if(Pi)throw e=hl,Pi=!1,hl=null,e}function qe(e,t){var r=t[Ql];r===void 0&&(r=t[Ql]=new Set);var a=e+"__bubble";r.has(a)||(Yc(t,e,2,!1),r.add(a))}function Fl(e,t,r){var a=0;t&&(a|=4),Yc(r,e,a,t)}var Wi="_reactListening"+Math.random().toString(36).slice(2);function Ws(e){if(!e[Wi]){e[Wi]=!0,l.forEach(function(r){r!=="selectionchange"&&(Nm.has(r)||Fl(r,!1,e),Fl(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wi]||(t[Wi]=!0,Fl("selectionchange",!1,t))}}function Yc(e,t,r,a){switch(wc(t)){case 1:var o=qp;break;case 4:o=$p;break;default:o=wl}r=o.bind(null,t,r,e),o=void 0,!fl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),a?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function zl(e,t,r,a,o){var d=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var h=a.tag;if(h===3||h===4){var y=a.stateNode.containerInfo;if(y===o||y.nodeType===8&&y.parentNode===o)break;if(h===4)for(h=a.return;h!==null;){var x=h.tag;if((x===3||x===4)&&(x=h.stateNode.containerInfo,x===o||x.nodeType===8&&x.parentNode===o))return;h=h.return}for(;y!==null;){if(h=dr(y),h===null)return;if(x=h.tag,x===5||x===6){a=d=h;continue e}y=y.parentNode}}a=a.return}nc(function(){var N=d,L=ul(r),M=[];e:{var O=Kc.get(e);if(O!==void 0){var Z=_l,X=e;switch(e){case"keypress":if($i(r)===0)break e;case"keydown":case"keyup":Z=rm;break;case"focusin":X="focus",Z=El;break;case"focusout":X="blur",Z=El;break;case"beforeblur":case"afterblur":Z=El;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=_c;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Bp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=am;break;case Vc:case Qc:case Bc:Z=Wp;break;case Hc:Z=om;break;case"scroll":Z=Vp;break;case"wheel":Z=cm;break;case"copy":case"cut":case"paste":Z=Gp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=jc}var ne=(t&4)!==0,Ye=!ne&&e==="scroll",_=ne?O!==null?O+"Capture":null:O;ne=[];for(var k=N,j;k!==null;){j=k;var q=j.stateNode;if(j.tag===5&&q!==null&&(j=q,_!==null&&(q=Ts(k,_),q!=null&&ne.push(Zs(k,q,j)))),Ye)break;k=k.return}0<ne.length&&(O=new Z(O,X,null,r,L),M.push({event:O,listeners:ne}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",O&&r!==ol&&(X=r.relatedTarget||r.fromElement)&&(dr(X)||X[hn]))break e;if((Z||O)&&(O=L.window===L?L:(O=L.ownerDocument)?O.defaultView||O.parentWindow:window,Z?(X=r.relatedTarget||r.toElement,Z=N,X=X?dr(X):null,X!==null&&(Ye=cr(X),X!==Ye||X.tag!==5&&X.tag!==6)&&(X=null)):(Z=null,X=N),Z!==X)){if(ne=_c,q="onMouseLeave",_="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(ne=jc,q="onPointerLeave",_="onPointerEnter",k="pointer"),Ye=Z==null?O:Kr(Z),j=X==null?O:Kr(X),O=new ne(q,k+"leave",Z,r,L),O.target=Ye,O.relatedTarget=j,q=null,dr(L)===N&&(ne=new ne(_,k+"enter",X,r,L),ne.target=j,ne.relatedTarget=Ye,q=ne),Ye=q,Z&&X)t:{for(ne=Z,_=X,k=0,j=ne;j;j=Br(j))k++;for(j=0,q=_;q;q=Br(q))j++;for(;0<k-j;)ne=Br(ne),k--;for(;0<j-k;)_=Br(_),j--;for(;k--;){if(ne===_||_!==null&&ne===_.alternate)break t;ne=Br(ne),_=Br(_)}ne=null}else ne=null;Z!==null&&Jc(M,O,Z,ne,!1),X!==null&&Ye!==null&&Jc(M,Ye,X,ne,!0)}}e:{if(O=N?Kr(N):window,Z=O.nodeName&&O.nodeName.toLowerCase(),Z==="select"||Z==="input"&&O.type==="file")var re=vm;else if(Pc(O))if(Ic)re=km;else{re=xm;var ce=gm}else(Z=O.nodeName)&&Z.toLowerCase()==="input"&&(O.type==="checkbox"||O.type==="radio")&&(re=wm);if(re&&(re=re(e,N))){Oc(M,re,r,L);break e}ce&&ce(e,O,N),e==="focusout"&&(ce=O._wrapperState)&&ce.controlled&&O.type==="number"&&rl(O,"number",O.value)}switch(ce=N?Kr(N):window,e){case"focusin":(Pc(ce)||ce.contentEditable==="true")&&(Vr=ce,Ol=N,Hs=null);break;case"focusout":Hs=Ol=Vr=null;break;case"mousedown":Il=!0;break;case"contextmenu":case"mouseup":case"dragend":Il=!1,qc(M,r,L);break;case"selectionchange":if(Sm)break;case"keydown":case"keyup":qc(M,r,L)}var de;if(bl)e:{switch(e){case"compositionstart":var me="onCompositionStart";break e;case"compositionend":me="onCompositionEnd";break e;case"compositionupdate":me="onCompositionUpdate";break e}me=void 0}else $r?Rc(e,r)&&(me="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(me="onCompositionStart");me&&(Ec&&r.locale!=="ko"&&($r||me!=="onCompositionStart"?me==="onCompositionEnd"&&$r&&(de=kc()):(Ln=L,Cl="value"in Ln?Ln.value:Ln.textContent,$r=!0)),ce=Zi(N,me),0<ce.length&&(me=new Sc(me,e,null,r,L),M.push({event:me,listeners:ce}),de?me.data=de:(de=Tc(r),de!==null&&(me.data=de)))),(de=fm?hm(e,r):pm(e,r))&&(N=Zi(N,"onBeforeInput"),0<N.length&&(L=new Sc("onBeforeInput","beforeinput",null,r,L),M.push({event:L,listeners:N}),L.data=de))}Gc(M,t)})}function Zs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Zi(e,t){for(var r=t+"Capture",a=[];e!==null;){var o=e,d=o.stateNode;o.tag===5&&d!==null&&(o=d,d=Ts(e,r),d!=null&&a.unshift(Zs(e,d,o)),d=Ts(e,t),d!=null&&a.push(Zs(e,d,o))),e=e.return}return a}function Br(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Jc(e,t,r,a,o){for(var d=t._reactName,h=[];r!==null&&r!==a;){var y=r,x=y.alternate,N=y.stateNode;if(x!==null&&x===a)break;y.tag===5&&N!==null&&(y=N,o?(x=Ts(r,d),x!=null&&h.unshift(Zs(r,x,y))):o||(x=Ts(r,d),x!=null&&h.push(Zs(r,x,y)))),r=r.return}h.length!==0&&e.push({event:t,listeners:h})}var bm=/\r\n?/g,Rm=/\u0000|\uFFFD/g;function Xc(e){return(typeof e=="string"?e:""+e).replace(bm,`
38
+ `).replace(Rm,"")}function Gi(e,t,r){if(t=Xc(t),Xc(e)!==t&&r)throw Error(i(425))}function Yi(){}var Dl=null,Ul=null;function ql(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 $l=typeof setTimeout=="function"?setTimeout:void 0,Tm=typeof clearTimeout=="function"?clearTimeout:void 0,ed=typeof Promise=="function"?Promise:void 0,Pm=typeof queueMicrotask=="function"?queueMicrotask:typeof ed<"u"?function(e){return ed.resolve(null).then(e).catch(Om)}:$l;function Om(e){setTimeout(function(){throw e})}function Vl(e,t){var r=t,a=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(a===0){e.removeChild(o),Ds(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=o}while(r);Ds(t)}function An(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function td(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Hr=Math.random().toString(36).slice(2),rn="__reactFiber$"+Hr,Gs="__reactProps$"+Hr,hn="__reactContainer$"+Hr,Ql="__reactEvents$"+Hr,Im="__reactListeners$"+Hr,Lm="__reactHandles$"+Hr;function dr(e){var t=e[rn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[hn]||r[rn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=td(e);e!==null;){if(r=e[rn])return r;e=td(e)}return t}e=r,r=e.parentNode}return null}function Ys(e){return e=e[rn]||e[hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Kr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Ji(e){return e[Gs]||null}var Bl=[],Wr=-1;function Fn(e){return{current:e}}function $e(e){0>Wr||(e.current=Bl[Wr],Bl[Wr]=null,Wr--)}function Ue(e,t){Wr++,Bl[Wr]=e.current,e.current=t}var zn={},dt=Fn(zn),_t=Fn(!1),fr=zn;function Zr(e,t){var r=e.type.contextTypes;if(!r)return zn;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var o={},d;for(d in r)o[d]=t[d];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function St(e){return e=e.childContextTypes,e!=null}function Xi(){$e(_t),$e(dt)}function nd(e,t,r){if(dt.current!==zn)throw Error(i(168));Ue(dt,t),Ue(_t,r)}function rd(e,t,r){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var o in a)if(!(o in t))throw Error(i(108,De(e)||"Unknown",o));return G({},r,a)}function ea(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zn,fr=dt.current,Ue(dt,e),Ue(_t,_t.current),!0}function sd(e,t,r){var a=e.stateNode;if(!a)throw Error(i(169));r?(e=rd(e,t,fr),a.__reactInternalMemoizedMergedChildContext=e,$e(_t),$e(dt),Ue(dt,e)):$e(_t),Ue(_t,r)}var pn=null,ta=!1,Hl=!1;function id(e){pn===null?pn=[e]:pn.push(e)}function Mm(e){ta=!0,id(e)}function Dn(){if(!Hl&&pn!==null){Hl=!0;var e=0,t=Me;try{var r=pn;for(Me=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}pn=null,ta=!1}catch(o){throw pn!==null&&(pn=pn.slice(e+1)),lc(pl,Dn),o}finally{Me=t,Hl=!1}}return null}var Gr=[],Yr=0,na=null,ra=0,Dt=[],Ut=0,hr=null,mn=1,yn="";function pr(e,t){Gr[Yr++]=ra,Gr[Yr++]=na,na=e,ra=t}function ad(e,t,r){Dt[Ut++]=mn,Dt[Ut++]=yn,Dt[Ut++]=hr,hr=e;var a=mn;e=yn;var o=32-Kt(a)-1;a&=~(1<<o),r+=1;var d=32-Kt(t)+o;if(30<d){var h=o-o%5;d=(a&(1<<h)-1).toString(32),a>>=h,o-=h,mn=1<<32-Kt(t)+o|r<<o|a,yn=d+e}else mn=1<<d|r<<o|a,yn=e}function Kl(e){e.return!==null&&(pr(e,1),ad(e,1,0))}function Wl(e){for(;e===na;)na=Gr[--Yr],Gr[Yr]=null,ra=Gr[--Yr],Gr[Yr]=null;for(;e===hr;)hr=Dt[--Ut],Dt[Ut]=null,yn=Dt[--Ut],Dt[Ut]=null,mn=Dt[--Ut],Dt[Ut]=null}var Lt=null,Mt=null,Qe=!1,Zt=null;function ld(e,t){var r=Qt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function od(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Lt=e,Mt=An(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lt=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=hr!==null?{id:mn,overflow:yn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Qt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Lt=e,Mt=null,!0):!1;default:return!1}}function Zl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gl(e){if(Qe){var t=Mt;if(t){var r=t;if(!od(e,t)){if(Zl(e))throw Error(i(418));t=An(r.nextSibling);var a=Lt;t&&od(e,t)?ld(a,r):(e.flags=e.flags&-4097|2,Qe=!1,Lt=e)}}else{if(Zl(e))throw Error(i(418));e.flags=e.flags&-4097|2,Qe=!1,Lt=e}}}function ud(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lt=e}function sa(e){if(e!==Lt)return!1;if(!Qe)return ud(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ql(e.type,e.memoizedProps)),t&&(t=Mt)){if(Zl(e))throw cd(),Error(i(418));for(;t;)ld(e,t),t=An(t.nextSibling)}if(ud(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Mt=An(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=Lt?An(e.stateNode.nextSibling):null;return!0}function cd(){for(var e=Mt;e;)e=An(e.nextSibling)}function Jr(){Mt=Lt=null,Qe=!1}function Yl(e){Zt===null?Zt=[e]:Zt.push(e)}var Am=F.ReactCurrentBatchConfig;function Js(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(i(309));var a=r.stateNode}if(!a)throw Error(i(147,e));var o=a,d=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(h){var y=o.refs;h===null?delete y[d]:y[d]=h},t._stringRef=d,t)}if(typeof e!="string")throw Error(i(284));if(!r._owner)throw Error(i(290,e))}return e}function ia(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function dd(e){var t=e._init;return t(e._payload)}function fd(e){function t(_,k){if(e){var j=_.deletions;j===null?(_.deletions=[k],_.flags|=16):j.push(k)}}function r(_,k){if(!e)return null;for(;k!==null;)t(_,k),k=k.sibling;return null}function a(_,k){for(_=new Map;k!==null;)k.key!==null?_.set(k.key,k):_.set(k.index,k),k=k.sibling;return _}function o(_,k){return _=Kn(_,k),_.index=0,_.sibling=null,_}function d(_,k,j){return _.index=j,e?(j=_.alternate,j!==null?(j=j.index,j<k?(_.flags|=2,k):j):(_.flags|=2,k)):(_.flags|=1048576,k)}function h(_){return e&&_.alternate===null&&(_.flags|=2),_}function y(_,k,j,q){return k===null||k.tag!==6?(k=Vo(j,_.mode,q),k.return=_,k):(k=o(k,j),k.return=_,k)}function x(_,k,j,q){var re=j.type;return re===he?L(_,k,j.props.children,q,j.key):k!==null&&(k.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Be&&dd(re)===k.type)?(q=o(k,j.props),q.ref=Js(_,k,j),q.return=_,q):(q=Ra(j.type,j.key,j.props,null,_.mode,q),q.ref=Js(_,k,j),q.return=_,q)}function N(_,k,j,q){return k===null||k.tag!==4||k.stateNode.containerInfo!==j.containerInfo||k.stateNode.implementation!==j.implementation?(k=Qo(j,_.mode,q),k.return=_,k):(k=o(k,j.children||[]),k.return=_,k)}function L(_,k,j,q,re){return k===null||k.tag!==7?(k=Cr(j,_.mode,q,re),k.return=_,k):(k=o(k,j),k.return=_,k)}function M(_,k,j){if(typeof k=="string"&&k!==""||typeof k=="number")return k=Vo(""+k,_.mode,j),k.return=_,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Q:return j=Ra(k.type,k.key,k.props,null,_.mode,j),j.ref=Js(_,null,k),j.return=_,j;case ue:return k=Qo(k,_.mode,j),k.return=_,k;case Be:var q=k._init;return M(_,q(k._payload),j)}if(Ns(k)||fe(k))return k=Cr(k,_.mode,j,null),k.return=_,k;ia(_,k)}return null}function O(_,k,j,q){var re=k!==null?k.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return re!==null?null:y(_,k,""+j,q);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Q:return j.key===re?x(_,k,j,q):null;case ue:return j.key===re?N(_,k,j,q):null;case Be:return re=j._init,O(_,k,re(j._payload),q)}if(Ns(j)||fe(j))return re!==null?null:L(_,k,j,q,null);ia(_,j)}return null}function Z(_,k,j,q,re){if(typeof q=="string"&&q!==""||typeof q=="number")return _=_.get(j)||null,y(k,_,""+q,re);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case Q:return _=_.get(q.key===null?j:q.key)||null,x(k,_,q,re);case ue:return _=_.get(q.key===null?j:q.key)||null,N(k,_,q,re);case Be:var ce=q._init;return Z(_,k,j,ce(q._payload),re)}if(Ns(q)||fe(q))return _=_.get(j)||null,L(k,_,q,re,null);ia(k,q)}return null}function X(_,k,j,q){for(var re=null,ce=null,de=k,me=k=0,at=null;de!==null&&me<j.length;me++){de.index>me?(at=de,de=null):at=de.sibling;var Te=O(_,de,j[me],q);if(Te===null){de===null&&(de=at);break}e&&de&&Te.alternate===null&&t(_,de),k=d(Te,k,me),ce===null?re=Te:ce.sibling=Te,ce=Te,de=at}if(me===j.length)return r(_,de),Qe&&pr(_,me),re;if(de===null){for(;me<j.length;me++)de=M(_,j[me],q),de!==null&&(k=d(de,k,me),ce===null?re=de:ce.sibling=de,ce=de);return Qe&&pr(_,me),re}for(de=a(_,de);me<j.length;me++)at=Z(de,_,me,j[me],q),at!==null&&(e&&at.alternate!==null&&de.delete(at.key===null?me:at.key),k=d(at,k,me),ce===null?re=at:ce.sibling=at,ce=at);return e&&de.forEach(function(Wn){return t(_,Wn)}),Qe&&pr(_,me),re}function ne(_,k,j,q){var re=fe(j);if(typeof re!="function")throw Error(i(150));if(j=re.call(j),j==null)throw Error(i(151));for(var ce=re=null,de=k,me=k=0,at=null,Te=j.next();de!==null&&!Te.done;me++,Te=j.next()){de.index>me?(at=de,de=null):at=de.sibling;var Wn=O(_,de,Te.value,q);if(Wn===null){de===null&&(de=at);break}e&&de&&Wn.alternate===null&&t(_,de),k=d(Wn,k,me),ce===null?re=Wn:ce.sibling=Wn,ce=Wn,de=at}if(Te.done)return r(_,de),Qe&&pr(_,me),re;if(de===null){for(;!Te.done;me++,Te=j.next())Te=M(_,Te.value,q),Te!==null&&(k=d(Te,k,me),ce===null?re=Te:ce.sibling=Te,ce=Te);return Qe&&pr(_,me),re}for(de=a(_,de);!Te.done;me++,Te=j.next())Te=Z(de,_,me,Te.value,q),Te!==null&&(e&&Te.alternate!==null&&de.delete(Te.key===null?me:Te.key),k=d(Te,k,me),ce===null?re=Te:ce.sibling=Te,ce=Te);return e&&de.forEach(function(my){return t(_,my)}),Qe&&pr(_,me),re}function Ye(_,k,j,q){if(typeof j=="object"&&j!==null&&j.type===he&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Q:e:{for(var re=j.key,ce=k;ce!==null;){if(ce.key===re){if(re=j.type,re===he){if(ce.tag===7){r(_,ce.sibling),k=o(ce,j.props.children),k.return=_,_=k;break e}}else if(ce.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Be&&dd(re)===ce.type){r(_,ce.sibling),k=o(ce,j.props),k.ref=Js(_,ce,j),k.return=_,_=k;break e}r(_,ce);break}else t(_,ce);ce=ce.sibling}j.type===he?(k=Cr(j.props.children,_.mode,q,j.key),k.return=_,_=k):(q=Ra(j.type,j.key,j.props,null,_.mode,q),q.ref=Js(_,k,j),q.return=_,_=q)}return h(_);case ue:e:{for(ce=j.key;k!==null;){if(k.key===ce)if(k.tag===4&&k.stateNode.containerInfo===j.containerInfo&&k.stateNode.implementation===j.implementation){r(_,k.sibling),k=o(k,j.children||[]),k.return=_,_=k;break e}else{r(_,k);break}else t(_,k);k=k.sibling}k=Qo(j,_.mode,q),k.return=_,_=k}return h(_);case Be:return ce=j._init,Ye(_,k,ce(j._payload),q)}if(Ns(j))return X(_,k,j,q);if(fe(j))return ne(_,k,j,q);ia(_,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,k!==null&&k.tag===6?(r(_,k.sibling),k=o(k,j),k.return=_,_=k):(r(_,k),k=Vo(j,_.mode,q),k.return=_,_=k),h(_)):r(_,k)}return Ye}var Xr=fd(!0),hd=fd(!1),aa=Fn(null),la=null,es=null,Jl=null;function Xl(){Jl=es=la=null}function eo(e){var t=aa.current;$e(aa),e._currentValue=t}function to(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function ts(e,t){la=e,Jl=es=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(jt=!0),e.firstContext=null)}function qt(e){var t=e._currentValue;if(Jl!==e)if(e={context:e,memoizedValue:t,next:null},es===null){if(la===null)throw Error(i(308));es=e,la.dependencies={lanes:0,firstContext:e}}else es=es.next=e;return t}var mr=null;function no(e){mr===null?mr=[e]:mr.push(e)}function pd(e,t,r,a){var o=t.interleaved;return o===null?(r.next=r,no(t)):(r.next=o.next,o.next=r),t.interleaved=r,vn(e,a)}function vn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Un=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function md(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 gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qn(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Re&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,vn(e,r)}return o=a.interleaved,o===null?(t.next=t,no(a)):(t.next=o.next,o.next=t),a.interleaved=t,vn(e,r)}function oa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,vl(e,r)}}function yd(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var o=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var h={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};d===null?o=d=h:d=d.next=h,r=r.next}while(r!==null);d===null?o=d=t:d=d.next=t}else o=d=t;r={baseState:a.baseState,firstBaseUpdate:o,lastBaseUpdate:d,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ua(e,t,r,a){var o=e.updateQueue;Un=!1;var d=o.firstBaseUpdate,h=o.lastBaseUpdate,y=o.shared.pending;if(y!==null){o.shared.pending=null;var x=y,N=x.next;x.next=null,h===null?d=N:h.next=N,h=x;var L=e.alternate;L!==null&&(L=L.updateQueue,y=L.lastBaseUpdate,y!==h&&(y===null?L.firstBaseUpdate=N:y.next=N,L.lastBaseUpdate=x))}if(d!==null){var M=o.baseState;h=0,L=N=x=null,y=d;do{var O=y.lane,Z=y.eventTime;if((a&O)===O){L!==null&&(L=L.next={eventTime:Z,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null});e:{var X=e,ne=y;switch(O=t,Z=r,ne.tag){case 1:if(X=ne.payload,typeof X=="function"){M=X.call(Z,M,O);break e}M=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=ne.payload,O=typeof X=="function"?X.call(Z,M,O):X,O==null)break e;M=G({},M,O);break e;case 2:Un=!0}}y.callback!==null&&y.lane!==0&&(e.flags|=64,O=o.effects,O===null?o.effects=[y]:O.push(y))}else Z={eventTime:Z,lane:O,tag:y.tag,payload:y.payload,callback:y.callback,next:null},L===null?(N=L=Z,x=M):L=L.next=Z,h|=O;if(y=y.next,y===null){if(y=o.shared.pending,y===null)break;O=y,y=O.next,O.next=null,o.lastBaseUpdate=O,o.shared.pending=null}}while(!0);if(L===null&&(x=M),o.baseState=x,o.firstBaseUpdate=N,o.lastBaseUpdate=L,t=o.shared.interleaved,t!==null){o=t;do h|=o.lane,o=o.next;while(o!==t)}else d===null&&(o.shared.lanes=0);gr|=h,e.lanes=h,e.memoizedState=M}}function vd(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],o=a.callback;if(o!==null){if(a.callback=null,a=r,typeof o!="function")throw Error(i(191,o));o.call(a)}}}var Xs={},sn=Fn(Xs),ei=Fn(Xs),ti=Fn(Xs);function yr(e){if(e===Xs)throw Error(i(174));return e}function so(e,t){switch(Ue(ti,t),Ue(ei,e),Ue(sn,Xs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:il(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=il(t,e)}$e(sn),Ue(sn,t)}function ns(){$e(sn),$e(ei),$e(ti)}function gd(e){yr(ti.current);var t=yr(sn.current),r=il(t,e.type);t!==r&&(Ue(ei,e),Ue(sn,r))}function io(e){ei.current===e&&($e(sn),$e(ei))}var He=Fn(0);function ca(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 ao=[];function lo(){for(var e=0;e<ao.length;e++)ao[e]._workInProgressVersionPrimary=null;ao.length=0}var da=F.ReactCurrentDispatcher,oo=F.ReactCurrentBatchConfig,vr=0,Ke=null,et=null,st=null,fa=!1,ni=!1,ri=0,Fm=0;function ft(){throw Error(i(321))}function uo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Wt(e[r],t[r]))return!1;return!0}function co(e,t,r,a,o,d){if(vr=d,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,da.current=e===null||e.memoizedState===null?qm:$m,e=r(a,o),ni){d=0;do{if(ni=!1,ri=0,25<=d)throw Error(i(301));d+=1,st=et=null,t.updateQueue=null,da.current=Vm,e=r(a,o)}while(ni)}if(da.current=ma,t=et!==null&&et.next!==null,vr=0,st=et=Ke=null,fa=!1,t)throw Error(i(300));return e}function fo(){var e=ri!==0;return ri=0,e}function an(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Ke.memoizedState=st=e:st=st.next=e,st}function $t(){if(et===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=st===null?Ke.memoizedState:st.next;if(t!==null)st=t,et=e;else{if(e===null)throw Error(i(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},st===null?Ke.memoizedState=st=e:st=st.next=e}return st}function si(e,t){return typeof t=="function"?t(e):t}function ho(e){var t=$t(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var a=et,o=a.baseQueue,d=r.pending;if(d!==null){if(o!==null){var h=o.next;o.next=d.next,d.next=h}a.baseQueue=o=d,r.pending=null}if(o!==null){d=o.next,a=a.baseState;var y=h=null,x=null,N=d;do{var L=N.lane;if((vr&L)===L)x!==null&&(x=x.next={lane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),a=N.hasEagerState?N.eagerState:e(a,N.action);else{var M={lane:L,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null};x===null?(y=x=M,h=a):x=x.next=M,Ke.lanes|=L,gr|=L}N=N.next}while(N!==null&&N!==d);x===null?h=a:x.next=y,Wt(a,t.memoizedState)||(jt=!0),t.memoizedState=a,t.baseState=h,t.baseQueue=x,r.lastRenderedState=a}if(e=r.interleaved,e!==null){o=e;do d=o.lane,Ke.lanes|=d,gr|=d,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function po(e){var t=$t(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var a=r.dispatch,o=r.pending,d=t.memoizedState;if(o!==null){r.pending=null;var h=o=o.next;do d=e(d,h.action),h=h.next;while(h!==o);Wt(d,t.memoizedState)||(jt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),r.lastRenderedState=d}return[d,a]}function xd(){}function wd(e,t){var r=Ke,a=$t(),o=t(),d=!Wt(a.memoizedState,o);if(d&&(a.memoizedState=o,jt=!0),a=a.queue,mo(_d.bind(null,r,a,e),[e]),a.getSnapshot!==t||d||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,ii(9,Cd.bind(null,r,a,o,t),void 0,null),it===null)throw Error(i(349));(vr&30)!==0||kd(r,t,o)}return o}function kd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Cd(e,t,r,a){t.value=r,t.getSnapshot=a,Sd(t)&&jd(e)}function _d(e,t,r){return r(function(){Sd(t)&&jd(e)})}function Sd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Wt(e,r)}catch{return!0}}function jd(e){var t=vn(e,1);t!==null&&Xt(t,e,1,-1)}function Ed(e){var t=an();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:e},t.queue=e,e=e.dispatch=Um.bind(null,Ke,e),[t.memoizedState,e]}function ii(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e)),e}function Nd(){return $t().memoizedState}function ha(e,t,r,a){var o=an();Ke.flags|=e,o.memoizedState=ii(1|t,r,void 0,a===void 0?null:a)}function pa(e,t,r,a){var o=$t();a=a===void 0?null:a;var d=void 0;if(et!==null){var h=et.memoizedState;if(d=h.destroy,a!==null&&uo(a,h.deps)){o.memoizedState=ii(t,r,d,a);return}}Ke.flags|=e,o.memoizedState=ii(1|t,r,d,a)}function bd(e,t){return ha(8390656,8,e,t)}function mo(e,t){return pa(2048,8,e,t)}function Rd(e,t){return pa(4,2,e,t)}function Td(e,t){return pa(4,4,e,t)}function Pd(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 Od(e,t,r){return r=r!=null?r.concat([e]):null,pa(4,4,Pd.bind(null,t,e),r)}function yo(){}function Id(e,t){var r=$t();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&uo(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function Ld(e,t){var r=$t();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&uo(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function Md(e,t,r){return(vr&21)===0?(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=r):(Wt(r,t)||(r=dc(),Ke.lanes|=r,gr|=r,e.baseState=!0),t)}function zm(e,t){var r=Me;Me=r!==0&&4>r?r:4,e(!0);var a=oo.transition;oo.transition={};try{e(!1),t()}finally{Me=r,oo.transition=a}}function Ad(){return $t().memoizedState}function Dm(e,t,r){var a=Bn(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},Fd(e))zd(t,r);else if(r=pd(e,t,r,a),r!==null){var o=gt();Xt(r,e,a,o),Dd(r,t,a)}}function Um(e,t,r){var a=Bn(e),o={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(Fd(e))zd(t,o);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var h=t.lastRenderedState,y=d(h,r);if(o.hasEagerState=!0,o.eagerState=y,Wt(y,h)){var x=t.interleaved;x===null?(o.next=o,no(t)):(o.next=x.next,x.next=o),t.interleaved=o;return}}catch{}finally{}r=pd(e,t,o,a),r!==null&&(o=gt(),Xt(r,e,a,o),Dd(r,t,a))}}function Fd(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function zd(e,t){ni=fa=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Dd(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,vl(e,r)}}var ma={readContext:qt,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useInsertionEffect:ft,useLayoutEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useMutableSource:ft,useSyncExternalStore:ft,useId:ft,unstable_isNewReconciler:!1},qm={readContext:qt,useCallback:function(e,t){return an().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:bd,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ha(4194308,4,Pd.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ha(4194308,4,e,t)},useInsertionEffect:function(e,t){return ha(4,2,e,t)},useMemo:function(e,t){var r=an();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=an();return t=r!==void 0?r(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=Dm.bind(null,Ke,e),[a.memoizedState,e]},useRef:function(e){var t=an();return e={current:e},t.memoizedState=e},useState:Ed,useDebugValue:yo,useDeferredValue:function(e){return an().memoizedState=e},useTransition:function(){var e=Ed(!1),t=e[0];return e=zm.bind(null,e[1]),an().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Ke,o=an();if(Qe){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),it===null)throw Error(i(349));(vr&30)!==0||kd(a,t,r)}o.memoizedState=r;var d={value:r,getSnapshot:t};return o.queue=d,bd(_d.bind(null,a,d,e),[e]),a.flags|=2048,ii(9,Cd.bind(null,a,d,r,t),void 0,null),r},useId:function(){var e=an(),t=it.identifierPrefix;if(Qe){var r=yn,a=mn;r=(a&~(1<<32-Kt(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=ri++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Fm++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$m={readContext:qt,useCallback:Id,useContext:qt,useEffect:mo,useImperativeHandle:Od,useInsertionEffect:Rd,useLayoutEffect:Td,useMemo:Ld,useReducer:ho,useRef:Nd,useState:function(){return ho(si)},useDebugValue:yo,useDeferredValue:function(e){var t=$t();return Md(t,et.memoizedState,e)},useTransition:function(){var e=ho(si)[0],t=$t().memoizedState;return[e,t]},useMutableSource:xd,useSyncExternalStore:wd,useId:Ad,unstable_isNewReconciler:!1},Vm={readContext:qt,useCallback:Id,useContext:qt,useEffect:mo,useImperativeHandle:Od,useInsertionEffect:Rd,useLayoutEffect:Td,useMemo:Ld,useReducer:po,useRef:Nd,useState:function(){return po(si)},useDebugValue:yo,useDeferredValue:function(e){var t=$t();return et===null?t.memoizedState=e:Md(t,et.memoizedState,e)},useTransition:function(){var e=po(si)[0],t=$t().memoizedState;return[e,t]},useMutableSource:xd,useSyncExternalStore:wd,useId:Ad,unstable_isNewReconciler:!1};function Gt(e,t){if(e&&e.defaultProps){t=G({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function vo(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:G({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ya={isMounted:function(e){return(e=e._reactInternals)?cr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=gt(),o=Bn(e),d=gn(a,o);d.payload=t,r!=null&&(d.callback=r),t=qn(e,d,o),t!==null&&(Xt(t,e,o,a),oa(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=gt(),o=Bn(e),d=gn(a,o);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=qn(e,d,o),t!==null&&(Xt(t,e,o,a),oa(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=gt(),a=Bn(e),o=gn(r,a);o.tag=2,t!=null&&(o.callback=t),t=qn(e,o,a),t!==null&&(Xt(t,e,a,r),oa(t,e,a))}};function Ud(e,t,r,a,o,d,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,d,h):t.prototype&&t.prototype.isPureReactComponent?!Bs(r,a)||!Bs(o,d):!0}function qd(e,t,r){var a=!1,o=zn,d=t.contextType;return typeof d=="object"&&d!==null?d=qt(d):(o=St(t)?fr:dt.current,a=t.contextTypes,d=(a=a!=null)?Zr(e,o):zn),t=new t(r,d),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ya,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=d),t}function $d(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&ya.enqueueReplaceState(t,t.state,null)}function go(e,t,r,a){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},ro(e);var d=t.contextType;typeof d=="object"&&d!==null?o.context=qt(d):(d=St(t)?fr:dt.current,o.context=Zr(e,d)),o.state=e.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(vo(e,t,d,r),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ya.enqueueReplaceState(o,o.state,null),ua(e,r,o,a),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function rs(e,t){try{var r="",a=t;do r+=je(a),a=a.return;while(a);var o=r}catch(d){o=`
39
+ Error generating stack: `+d.message+`
40
+ `+d.stack}return{value:e,source:t,stack:o,digest:null}}function xo(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function wo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Qm=typeof WeakMap=="function"?WeakMap:Map;function Vd(e,t,r){r=gn(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){_a||(_a=!0,Mo=a),wo(e,t)},r}function Qd(e,t,r){r=gn(-1,r),r.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var o=t.value;r.payload=function(){return a(o)},r.callback=function(){wo(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(r.callback=function(){wo(e,t),typeof a!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),r}function Bd(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new Qm;var o=new Set;a.set(t,o)}else o=a.get(t),o===void 0&&(o=new Set,a.set(t,o));o.has(r)||(o.add(r),e=sy.bind(null,e,t,r),t.then(e,e))}function Hd(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 Kd(e,t,r,a,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=gn(-1,1),t.tag=2,qn(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Bm=F.ReactCurrentOwner,jt=!1;function vt(e,t,r,a){t.child=e===null?hd(t,null,r,a):Xr(t,e.child,r,a)}function Wd(e,t,r,a,o){r=r.render;var d=t.ref;return ts(t,o),a=co(e,t,r,a,d,o),r=fo(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,xn(e,t,o)):(Qe&&r&&Kl(t),t.flags|=1,vt(e,t,a,o),t.child)}function Zd(e,t,r,a,o){if(e===null){var d=r.type;return typeof d=="function"&&!$o(d)&&d.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=d,Gd(e,t,d,a,o)):(e=Ra(r.type,null,a,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,(e.lanes&o)===0){var h=d.memoizedProps;if(r=r.compare,r=r!==null?r:Bs,r(h,a)&&e.ref===t.ref)return xn(e,t,o)}return t.flags|=1,e=Kn(d,a),e.ref=t.ref,e.return=t,t.child=e}function Gd(e,t,r,a,o){if(e!==null){var d=e.memoizedProps;if(Bs(d,a)&&e.ref===t.ref)if(jt=!1,t.pendingProps=a=d,(e.lanes&o)!==0)(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,xn(e,t,o)}return ko(e,t,r,a,o)}function Yd(e,t,r){var a=t.pendingProps,o=a.children,d=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(is,At),At|=r;else{if((r&1073741824)===0)return e=d!==null?d.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ue(is,At),At|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=d!==null?d.baseLanes:r,Ue(is,At),At|=a}else d!==null?(a=d.baseLanes|r,t.memoizedState=null):a=r,Ue(is,At),At|=a;return vt(e,t,o,r),t.child}function Jd(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ko(e,t,r,a,o){var d=St(r)?fr:dt.current;return d=Zr(t,d),ts(t,o),r=co(e,t,r,a,d,o),a=fo(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,xn(e,t,o)):(Qe&&a&&Kl(t),t.flags|=1,vt(e,t,r,o),t.child)}function Xd(e,t,r,a,o){if(St(r)){var d=!0;ea(t)}else d=!1;if(ts(t,o),t.stateNode===null)ga(e,t),qd(t,r,a),go(t,r,a,o),a=!0;else if(e===null){var h=t.stateNode,y=t.memoizedProps;h.props=y;var x=h.context,N=r.contextType;typeof N=="object"&&N!==null?N=qt(N):(N=St(r)?fr:dt.current,N=Zr(t,N));var L=r.getDerivedStateFromProps,M=typeof L=="function"||typeof h.getSnapshotBeforeUpdate=="function";M||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==a||x!==N)&&$d(t,h,a,N),Un=!1;var O=t.memoizedState;h.state=O,ua(t,a,h,o),x=t.memoizedState,y!==a||O!==x||_t.current||Un?(typeof L=="function"&&(vo(t,r,L,a),x=t.memoizedState),(y=Un||Ud(t,r,y,a,O,x,N))?(M||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=x),h.props=a,h.state=x,h.context=N,a=y):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{h=t.stateNode,md(e,t),y=t.memoizedProps,N=t.type===t.elementType?y:Gt(t.type,y),h.props=N,M=t.pendingProps,O=h.context,x=r.contextType,typeof x=="object"&&x!==null?x=qt(x):(x=St(r)?fr:dt.current,x=Zr(t,x));var Z=r.getDerivedStateFromProps;(L=typeof Z=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==M||O!==x)&&$d(t,h,a,x),Un=!1,O=t.memoizedState,h.state=O,ua(t,a,h,o);var X=t.memoizedState;y!==M||O!==X||_t.current||Un?(typeof Z=="function"&&(vo(t,r,Z,a),X=t.memoizedState),(N=Un||Ud(t,r,N,a,O,X,x)||!1)?(L||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(a,X,x),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(a,X,x)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=X),h.props=a,h.state=X,h.context=x,a=N):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),a=!1)}return Co(e,t,r,a,d,o)}function Co(e,t,r,a,o,d){Jd(e,t);var h=(t.flags&128)!==0;if(!a&&!h)return o&&sd(t,r,!1),xn(e,t,d);a=t.stateNode,Bm.current=t;var y=h&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&h?(t.child=Xr(t,e.child,null,d),t.child=Xr(t,null,y,d)):vt(e,t,y,d),t.memoizedState=a.state,o&&sd(t,r,!0),t.child}function ef(e){var t=e.stateNode;t.pendingContext?nd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nd(e,t.context,!1),so(e,t.containerInfo)}function tf(e,t,r,a,o){return Jr(),Yl(o),t.flags|=256,vt(e,t,r,a),t.child}var _o={dehydrated:null,treeContext:null,retryLane:0};function So(e){return{baseLanes:e,cachePool:null,transitions:null}}function nf(e,t,r){var a=t.pendingProps,o=He.current,d=!1,h=(t.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(o&2)!==0),y?(d=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ue(He,o&1),e===null)return Gl(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):(h=a.children,e=a.fallback,d?(a=t.mode,d=t.child,h={mode:"hidden",children:h},(a&1)===0&&d!==null?(d.childLanes=0,d.pendingProps=h):d=Ta(h,a,0,null),e=Cr(e,a,r,null),d.return=t,e.return=t,d.sibling=e,t.child=d,t.child.memoizedState=So(r),t.memoizedState=_o,e):jo(t,h));if(o=e.memoizedState,o!==null&&(y=o.dehydrated,y!==null))return Hm(e,t,h,a,y,o,r);if(d){d=a.fallback,h=t.mode,o=e.child,y=o.sibling;var x={mode:"hidden",children:a.children};return(h&1)===0&&t.child!==o?(a=t.child,a.childLanes=0,a.pendingProps=x,t.deletions=null):(a=Kn(o,x),a.subtreeFlags=o.subtreeFlags&14680064),y!==null?d=Kn(y,d):(d=Cr(d,h,r,null),d.flags|=2),d.return=t,a.return=t,a.sibling=d,t.child=a,a=d,d=t.child,h=e.child.memoizedState,h=h===null?So(r):{baseLanes:h.baseLanes|r,cachePool:null,transitions:h.transitions},d.memoizedState=h,d.childLanes=e.childLanes&~r,t.memoizedState=_o,a}return d=e.child,e=d.sibling,a=Kn(d,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=r),a.return=t,a.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=a,t.memoizedState=null,a}function jo(e,t){return t=Ta({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function va(e,t,r,a){return a!==null&&Yl(a),Xr(t,e.child,null,r),e=jo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hm(e,t,r,a,o,d,h){if(r)return t.flags&256?(t.flags&=-257,a=xo(Error(i(422))),va(e,t,h,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(d=a.fallback,o=t.mode,a=Ta({mode:"visible",children:a.children},o,0,null),d=Cr(d,o,h,null),d.flags|=2,a.return=t,d.return=t,a.sibling=d,t.child=a,(t.mode&1)!==0&&Xr(t,e.child,null,h),t.child.memoizedState=So(h),t.memoizedState=_o,d);if((t.mode&1)===0)return va(e,t,h,null);if(o.data==="$!"){if(a=o.nextSibling&&o.nextSibling.dataset,a)var y=a.dgst;return a=y,d=Error(i(419)),a=xo(d,a,void 0),va(e,t,h,a)}if(y=(h&e.childLanes)!==0,jt||y){if(a=it,a!==null){switch(h&-h){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(a.suspendedLanes|h))!==0?0:o,o!==0&&o!==d.retryLane&&(d.retryLane=o,vn(e,o),Xt(a,e,o,-1))}return qo(),a=xo(Error(i(421))),va(e,t,h,a)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=iy.bind(null,e),o._reactRetry=t,null):(e=d.treeContext,Mt=An(o.nextSibling),Lt=t,Qe=!0,Zt=null,e!==null&&(Dt[Ut++]=mn,Dt[Ut++]=yn,Dt[Ut++]=hr,mn=e.id,yn=e.overflow,hr=t),t=jo(t,a.children),t.flags|=4096,t)}function rf(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),to(e.return,t,r)}function Eo(e,t,r,a,o){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:o}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=r,d.tailMode=o)}function sf(e,t,r){var a=t.pendingProps,o=a.revealOrder,d=a.tail;if(vt(e,t,a.children,r),a=He.current,(a&2)!==0)a=a&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&&rf(e,r,t);else if(e.tag===19)rf(e,r,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}a&=1}if(Ue(He,a),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&ca(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Eo(t,!1,o,r,d);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ca(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Eo(t,!0,r,null,d);break;case"together":Eo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ga(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function xn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),gr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,r=Kn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Kn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Km(e,t,r){switch(t.tag){case 3:ef(t),Jr();break;case 5:gd(t);break;case 1:St(t.type)&&ea(t);break;case 4:so(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,o=t.memoizedProps.value;Ue(aa,a._currentValue),a._currentValue=o;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(Ue(He,He.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?nf(e,t,r):(Ue(He,He.current&1),e=xn(e,t,r),e!==null?e.sibling:null);Ue(He,He.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return sf(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ue(He,He.current),a)break;return null;case 22:case 23:return t.lanes=0,Yd(e,t,r)}return xn(e,t,r)}var af,No,lf,of;af=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},No=function(){},lf=function(e,t,r,a){var o=e.memoizedProps;if(o!==a){e=t.stateNode,yr(sn.current);var d=null;switch(r){case"input":o=tl(e,o),a=tl(e,a),d=[];break;case"select":o=G({},o,{value:void 0}),a=G({},a,{value:void 0}),d=[];break;case"textarea":o=sl(e,o),a=sl(e,a),d=[];break;default:typeof o.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Yi)}al(r,a);var h;r=null;for(N in o)if(!a.hasOwnProperty(N)&&o.hasOwnProperty(N)&&o[N]!=null)if(N==="style"){var y=o[N];for(h in y)y.hasOwnProperty(h)&&(r||(r={}),r[h]="")}else N!=="dangerouslySetInnerHTML"&&N!=="children"&&N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&N!=="autoFocus"&&(c.hasOwnProperty(N)?d||(d=[]):(d=d||[]).push(N,null));for(N in a){var x=a[N];if(y=o!=null?o[N]:void 0,a.hasOwnProperty(N)&&x!==y&&(x!=null||y!=null))if(N==="style")if(y){for(h in y)!y.hasOwnProperty(h)||x&&x.hasOwnProperty(h)||(r||(r={}),r[h]="");for(h in x)x.hasOwnProperty(h)&&y[h]!==x[h]&&(r||(r={}),r[h]=x[h])}else r||(d||(d=[]),d.push(N,r)),r=x;else N==="dangerouslySetInnerHTML"?(x=x?x.__html:void 0,y=y?y.__html:void 0,x!=null&&y!==x&&(d=d||[]).push(N,x)):N==="children"?typeof x!="string"&&typeof x!="number"||(d=d||[]).push(N,""+x):N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&(c.hasOwnProperty(N)?(x!=null&&N==="onScroll"&&qe("scroll",e),d||y===x||(d=[])):(d=d||[]).push(N,x))}r&&(d=d||[]).push("style",r);var N=d;(t.updateQueue=N)&&(t.flags|=4)}},of=function(e,t,r,a){r!==a&&(t.flags|=4)};function ai(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags&14680064,a|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags,a|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function Wm(e,t,r){var a=t.pendingProps;switch(Wl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return St(t.type)&&Xi(),ht(t),null;case 3:return a=t.stateNode,ns(),$e(_t),$e(dt),lo(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(sa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zt!==null&&(zo(Zt),Zt=null))),No(e,t),ht(t),null;case 5:io(t);var o=yr(ti.current);if(r=t.type,e!==null&&t.stateNode!=null)lf(e,t,r,a,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(i(166));return ht(t),null}if(e=yr(sn.current),sa(t)){a=t.stateNode,r=t.type;var d=t.memoizedProps;switch(a[rn]=t,a[Gs]=d,e=(t.mode&1)!==0,r){case"dialog":qe("cancel",a),qe("close",a);break;case"iframe":case"object":case"embed":qe("load",a);break;case"video":case"audio":for(o=0;o<Ks.length;o++)qe(Ks[o],a);break;case"source":qe("error",a);break;case"img":case"image":case"link":qe("error",a),qe("load",a);break;case"details":qe("toggle",a);break;case"input":qu(a,d),qe("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!d.multiple},qe("invalid",a);break;case"textarea":Qu(a,d),qe("invalid",a)}al(r,d),o=null;for(var h in d)if(d.hasOwnProperty(h)){var y=d[h];h==="children"?typeof y=="string"?a.textContent!==y&&(d.suppressHydrationWarning!==!0&&Gi(a.textContent,y,e),o=["children",y]):typeof y=="number"&&a.textContent!==""+y&&(d.suppressHydrationWarning!==!0&&Gi(a.textContent,y,e),o=["children",""+y]):c.hasOwnProperty(h)&&y!=null&&h==="onScroll"&&qe("scroll",a)}switch(r){case"input":Ni(a),Vu(a,d,!0);break;case"textarea":Ni(a),Hu(a);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(a.onclick=Yi)}a=o,t.updateQueue=a,a!==null&&(t.flags|=4)}else{h=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ku(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=h.createElement(r,{is:a.is}):(e=h.createElement(r),r==="select"&&(h=e,a.multiple?h.multiple=!0:a.size&&(h.size=a.size))):e=h.createElementNS(e,r),e[rn]=t,e[Gs]=a,af(e,t,!1,!1),t.stateNode=e;e:{switch(h=ll(r,a),r){case"dialog":qe("cancel",e),qe("close",e),o=a;break;case"iframe":case"object":case"embed":qe("load",e),o=a;break;case"video":case"audio":for(o=0;o<Ks.length;o++)qe(Ks[o],e);o=a;break;case"source":qe("error",e),o=a;break;case"img":case"image":case"link":qe("error",e),qe("load",e),o=a;break;case"details":qe("toggle",e),o=a;break;case"input":qu(e,a),o=tl(e,a),qe("invalid",e);break;case"option":o=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},o=G({},a,{value:void 0}),qe("invalid",e);break;case"textarea":Qu(e,a),o=sl(e,a),qe("invalid",e);break;default:o=a}al(r,o),y=o;for(d in y)if(y.hasOwnProperty(d)){var x=y[d];d==="style"?Gu(e,x):d==="dangerouslySetInnerHTML"?(x=x?x.__html:void 0,x!=null&&Wu(e,x)):d==="children"?typeof x=="string"?(r!=="textarea"||x!=="")&&bs(e,x):typeof x=="number"&&bs(e,""+x):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(c.hasOwnProperty(d)?x!=null&&d==="onScroll"&&qe("scroll",e):x!=null&&A(e,d,x,h))}switch(r){case"input":Ni(e),Vu(e,a,!1);break;case"textarea":Ni(e),Hu(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Le(a.value));break;case"select":e.multiple=!!a.multiple,d=a.value,d!=null?Fr(e,!!a.multiple,d,!1):a.defaultValue!=null&&Fr(e,!!a.multiple,a.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Yi)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ht(t),null;case 6:if(e&&t.stateNode!=null)of(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(i(166));if(r=yr(ti.current),yr(sn.current),sa(t)){if(a=t.stateNode,r=t.memoizedProps,a[rn]=t,(d=a.nodeValue!==r)&&(e=Lt,e!==null))switch(e.tag){case 3:Gi(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gi(a.nodeValue,r,(e.mode&1)!==0)}d&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[rn]=t,t.stateNode=a}return ht(t),null;case 13:if($e(He),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Mt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)cd(),Jr(),t.flags|=98560,d=!1;else if(d=sa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[rn]=t}else Jr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),d=!1}else Zt!==null&&(zo(Zt),Zt=null),d=!0;if(!d)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(He.current&1)!==0?tt===0&&(tt=3):qo())),t.updateQueue!==null&&(t.flags|=4),ht(t),null);case 4:return ns(),No(e,t),e===null&&Ws(t.stateNode.containerInfo),ht(t),null;case 10:return eo(t.type._context),ht(t),null;case 17:return St(t.type)&&Xi(),ht(t),null;case 19:if($e(He),d=t.memoizedState,d===null)return ht(t),null;if(a=(t.flags&128)!==0,h=d.rendering,h===null)if(a)ai(d,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=ca(e),h!==null){for(t.flags|=128,ai(d,!1),a=h.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=r,r=t.child;r!==null;)d=r,e=a,d.flags&=14680066,h=d.alternate,h===null?(d.childLanes=0,d.lanes=e,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=h.childLanes,d.lanes=h.lanes,d.child=h.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=h.memoizedProps,d.memoizedState=h.memoizedState,d.updateQueue=h.updateQueue,d.type=h.type,e=h.dependencies,d.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ue(He,He.current&1|2),t.child}e=e.sibling}d.tail!==null&&Ge()>as&&(t.flags|=128,a=!0,ai(d,!1),t.lanes=4194304)}else{if(!a)if(e=ca(h),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ai(d,!0),d.tail===null&&d.tailMode==="hidden"&&!h.alternate&&!Qe)return ht(t),null}else 2*Ge()-d.renderingStartTime>as&&r!==1073741824&&(t.flags|=128,a=!0,ai(d,!1),t.lanes=4194304);d.isBackwards?(h.sibling=t.child,t.child=h):(r=d.last,r!==null?r.sibling=h:t.child=h,d.last=h)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Ge(),t.sibling=null,r=He.current,Ue(He,a?r&1|2:r&1),t):(ht(t),null);case 22:case 23:return Uo(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?(At&1073741824)!==0&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Zm(e,t){switch(Wl(t),t.tag){case 1:return St(t.type)&&Xi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ns(),$e(_t),$e(dt),lo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return io(t),null;case 13:if($e(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(He),null;case 4:return ns(),null;case 10:return eo(t.type._context),null;case 22:case 23:return Uo(),null;case 24:return null;default:return null}}var xa=!1,pt=!1,Gm=typeof WeakSet=="function"?WeakSet:Set,J=null;function ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){We(e,t,a)}else r.current=null}function bo(e,t,r){try{r()}catch(a){We(e,t,a)}}var uf=!1;function Ym(e,t){if(Dl=Di,e=Uc(),Pl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var o=a.anchorOffset,d=a.focusNode;a=a.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var h=0,y=-1,x=-1,N=0,L=0,M=e,O=null;t:for(;;){for(var Z;M!==r||o!==0&&M.nodeType!==3||(y=h+o),M!==d||a!==0&&M.nodeType!==3||(x=h+a),M.nodeType===3&&(h+=M.nodeValue.length),(Z=M.firstChild)!==null;)O=M,M=Z;for(;;){if(M===e)break t;if(O===r&&++N===o&&(y=h),O===d&&++L===a&&(x=h),(Z=M.nextSibling)!==null)break;M=O,O=M.parentNode}M=Z}r=y===-1||x===-1?null:{start:y,end:x}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ul={focusedElem:e,selectionRange:r},Di=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var X=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(X!==null){var ne=X.memoizedProps,Ye=X.memoizedState,_=t.stateNode,k=_.getSnapshotBeforeUpdate(t.elementType===t.type?ne:Gt(t.type,ne),Ye);_.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var j=t.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(q){We(t,t.return,q)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return X=uf,uf=!1,X}function li(e,t,r){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var o=a=a.next;do{if((o.tag&e)===e){var d=o.destroy;o.destroy=void 0,d!==void 0&&bo(t,r,d)}o=o.next}while(o!==a)}}function wa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var a=r.create;r.destroy=a()}r=r.next}while(r!==t)}}function Ro(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function cf(e){var t=e.alternate;t!==null&&(e.alternate=null,cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rn],delete t[Gs],delete t[Ql],delete t[Im],delete t[Lm])),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 df(e){return e.tag===5||e.tag===3||e.tag===4}function ff(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||df(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 To(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Yi));else if(a!==4&&(e=e.child,e!==null))for(To(e,t,r),e=e.sibling;e!==null;)To(e,t,r),e=e.sibling}function Po(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Po(e,t,r),e=e.sibling;e!==null;)Po(e,t,r),e=e.sibling}var ot=null,Yt=!1;function $n(e,t,r){for(r=r.child;r!==null;)hf(e,t,r),r=r.sibling}function hf(e,t,r){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(Ii,r)}catch{}switch(r.tag){case 5:pt||ss(r,t);case 6:var a=ot,o=Yt;ot=null,$n(e,t,r),ot=a,Yt=o,ot!==null&&(Yt?(e=ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ot.removeChild(r.stateNode));break;case 18:ot!==null&&(Yt?(e=ot,r=r.stateNode,e.nodeType===8?Vl(e.parentNode,r):e.nodeType===1&&Vl(e,r),Ds(e)):Vl(ot,r.stateNode));break;case 4:a=ot,o=Yt,ot=r.stateNode.containerInfo,Yt=!0,$n(e,t,r),ot=a,Yt=o;break;case 0:case 11:case 14:case 15:if(!pt&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){o=a=a.next;do{var d=o,h=d.destroy;d=d.tag,h!==void 0&&((d&2)!==0||(d&4)!==0)&&bo(r,t,h),o=o.next}while(o!==a)}$n(e,t,r);break;case 1:if(!pt&&(ss(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(y){We(r,t,y)}$n(e,t,r);break;case 21:$n(e,t,r);break;case 22:r.mode&1?(pt=(a=pt)||r.memoizedState!==null,$n(e,t,r),pt=a):$n(e,t,r);break;default:$n(e,t,r)}}function pf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Gm),t.forEach(function(a){var o=ay.bind(null,e,a);r.has(a)||(r.add(a),a.then(o,o))})}}function Jt(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];try{var d=e,h=t,y=h;e:for(;y!==null;){switch(y.tag){case 5:ot=y.stateNode,Yt=!1;break e;case 3:ot=y.stateNode.containerInfo,Yt=!0;break e;case 4:ot=y.stateNode.containerInfo,Yt=!0;break e}y=y.return}if(ot===null)throw Error(i(160));hf(d,h,o),ot=null,Yt=!1;var x=o.alternate;x!==null&&(x.return=null),o.return=null}catch(N){We(o,t,N)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mf(t,e),t=t.sibling}function mf(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jt(t,e),ln(e),a&4){try{li(3,e,e.return),wa(3,e)}catch(ne){We(e,e.return,ne)}try{li(5,e,e.return)}catch(ne){We(e,e.return,ne)}}break;case 1:Jt(t,e),ln(e),a&512&&r!==null&&ss(r,r.return);break;case 5:if(Jt(t,e),ln(e),a&512&&r!==null&&ss(r,r.return),e.flags&32){var o=e.stateNode;try{bs(o,"")}catch(ne){We(e,e.return,ne)}}if(a&4&&(o=e.stateNode,o!=null)){var d=e.memoizedProps,h=r!==null?r.memoizedProps:d,y=e.type,x=e.updateQueue;if(e.updateQueue=null,x!==null)try{y==="input"&&d.type==="radio"&&d.name!=null&&$u(o,d),ll(y,h);var N=ll(y,d);for(h=0;h<x.length;h+=2){var L=x[h],M=x[h+1];L==="style"?Gu(o,M):L==="dangerouslySetInnerHTML"?Wu(o,M):L==="children"?bs(o,M):A(o,L,M,N)}switch(y){case"input":nl(o,d);break;case"textarea":Bu(o,d);break;case"select":var O=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!d.multiple;var Z=d.value;Z!=null?Fr(o,!!d.multiple,Z,!1):O!==!!d.multiple&&(d.defaultValue!=null?Fr(o,!!d.multiple,d.defaultValue,!0):Fr(o,!!d.multiple,d.multiple?[]:"",!1))}o[Gs]=d}catch(ne){We(e,e.return,ne)}}break;case 6:if(Jt(t,e),ln(e),a&4){if(e.stateNode===null)throw Error(i(162));o=e.stateNode,d=e.memoizedProps;try{o.nodeValue=d}catch(ne){We(e,e.return,ne)}}break;case 3:if(Jt(t,e),ln(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Ds(t.containerInfo)}catch(ne){We(e,e.return,ne)}break;case 4:Jt(t,e),ln(e);break;case 13:Jt(t,e),ln(e),o=e.child,o.flags&8192&&(d=o.memoizedState!==null,o.stateNode.isHidden=d,!d||o.alternate!==null&&o.alternate.memoizedState!==null||(Lo=Ge())),a&4&&pf(e);break;case 22:if(L=r!==null&&r.memoizedState!==null,e.mode&1?(pt=(N=pt)||L,Jt(t,e),pt=N):Jt(t,e),ln(e),a&8192){if(N=e.memoizedState!==null,(e.stateNode.isHidden=N)&&!L&&(e.mode&1)!==0)for(J=e,L=e.child;L!==null;){for(M=J=L;J!==null;){switch(O=J,Z=O.child,O.tag){case 0:case 11:case 14:case 15:li(4,O,O.return);break;case 1:ss(O,O.return);var X=O.stateNode;if(typeof X.componentWillUnmount=="function"){a=O,r=O.return;try{t=a,X.props=t.memoizedProps,X.state=t.memoizedState,X.componentWillUnmount()}catch(ne){We(a,r,ne)}}break;case 5:ss(O,O.return);break;case 22:if(O.memoizedState!==null){gf(M);continue}}Z!==null?(Z.return=O,J=Z):gf(M)}L=L.sibling}e:for(L=null,M=e;;){if(M.tag===5){if(L===null){L=M;try{o=M.stateNode,N?(d=o.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(y=M.stateNode,x=M.memoizedProps.style,h=x!=null&&x.hasOwnProperty("display")?x.display:null,y.style.display=Zu("display",h))}catch(ne){We(e,e.return,ne)}}}else if(M.tag===6){if(L===null)try{M.stateNode.nodeValue=N?"":M.memoizedProps}catch(ne){We(e,e.return,ne)}}else if((M.tag!==22&&M.tag!==23||M.memoizedState===null||M===e)&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===e)break e;for(;M.sibling===null;){if(M.return===null||M.return===e)break e;L===M&&(L=null),M=M.return}L===M&&(L=null),M.sibling.return=M.return,M=M.sibling}}break;case 19:Jt(t,e),ln(e),a&4&&pf(e);break;case 21:break;default:Jt(t,e),ln(e)}}function ln(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(df(r)){var a=r;break e}r=r.return}throw Error(i(160))}switch(a.tag){case 5:var o=a.stateNode;a.flags&32&&(bs(o,""),a.flags&=-33);var d=ff(e);Po(e,d,o);break;case 3:case 4:var h=a.stateNode.containerInfo,y=ff(e);To(e,y,h);break;default:throw Error(i(161))}}catch(x){We(e,e.return,x)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jm(e,t,r){J=e,yf(e)}function yf(e,t,r){for(var a=(e.mode&1)!==0;J!==null;){var o=J,d=o.child;if(o.tag===22&&a){var h=o.memoizedState!==null||xa;if(!h){var y=o.alternate,x=y!==null&&y.memoizedState!==null||pt;y=xa;var N=pt;if(xa=h,(pt=x)&&!N)for(J=o;J!==null;)h=J,x=h.child,h.tag===22&&h.memoizedState!==null?xf(o):x!==null?(x.return=h,J=x):xf(o);for(;d!==null;)J=d,yf(d),d=d.sibling;J=o,xa=y,pt=N}vf(e)}else(o.subtreeFlags&8772)!==0&&d!==null?(d.return=o,J=d):vf(e)}}function vf(e){for(;J!==null;){var t=J;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:pt||wa(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!pt)if(r===null)a.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Gt(t.type,r.memoizedProps);a.componentDidUpdate(o,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&vd(t,d,a);break;case 3:var h=t.updateQueue;if(h!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}vd(t,h,r)}break;case 5:var y=t.stateNode;if(r===null&&t.flags&4){r=y;var x=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":x.autoFocus&&r.focus();break;case"img":x.src&&(r.src=x.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var N=t.alternate;if(N!==null){var L=N.memoizedState;if(L!==null){var M=L.dehydrated;M!==null&&Ds(M)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}pt||t.flags&512&&Ro(t)}catch(O){We(t,t.return,O)}}if(t===e){J=null;break}if(r=t.sibling,r!==null){r.return=t.return,J=r;break}J=t.return}}function gf(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var r=t.sibling;if(r!==null){r.return=t.return,J=r;break}J=t.return}}function xf(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{wa(4,t)}catch(x){We(t,r,x)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var o=t.return;try{a.componentDidMount()}catch(x){We(t,o,x)}}var d=t.return;try{Ro(t)}catch(x){We(t,d,x)}break;case 5:var h=t.return;try{Ro(t)}catch(x){We(t,h,x)}}}catch(x){We(t,t.return,x)}if(t===e){J=null;break}var y=t.sibling;if(y!==null){y.return=t.return,J=y;break}J=t.return}}var Xm=Math.ceil,ka=F.ReactCurrentDispatcher,Oo=F.ReactCurrentOwner,Vt=F.ReactCurrentBatchConfig,Re=0,it=null,Je=null,ut=0,At=0,is=Fn(0),tt=0,oi=null,gr=0,Ca=0,Io=0,ui=null,Et=null,Lo=0,as=1/0,wn=null,_a=!1,Mo=null,Vn=null,Sa=!1,Qn=null,ja=0,ci=0,Ao=null,Ea=-1,Na=0;function gt(){return(Re&6)!==0?Ge():Ea!==-1?Ea:Ea=Ge()}function Bn(e){return(e.mode&1)===0?1:(Re&2)!==0&&ut!==0?ut&-ut:Am.transition!==null?(Na===0&&(Na=dc()),Na):(e=Me,e!==0||(e=window.event,e=e===void 0?16:wc(e.type)),e)}function Xt(e,t,r,a){if(50<ci)throw ci=0,Ao=null,Error(i(185));Ls(e,r,a),((Re&2)===0||e!==it)&&(e===it&&((Re&2)===0&&(Ca|=r),tt===4&&Hn(e,ut)),Nt(e,a),r===1&&Re===0&&(t.mode&1)===0&&(as=Ge()+500,ta&&Dn()))}function Nt(e,t){var r=e.callbackNode;Ap(e,t);var a=Ai(e,e===it?ut:0);if(a===0)r!==null&&oc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&oc(r),t===1)e.tag===0?Mm(kf.bind(null,e)):id(kf.bind(null,e)),Pm(function(){(Re&6)===0&&Dn()}),r=null;else{switch(fc(a)){case 1:r=pl;break;case 4:r=uc;break;case 16:r=Oi;break;case 536870912:r=cc;break;default:r=Oi}r=Rf(r,wf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function wf(e,t){if(Ea=-1,Na=0,(Re&6)!==0)throw Error(i(327));var r=e.callbackNode;if(ls()&&e.callbackNode!==r)return null;var a=Ai(e,e===it?ut:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=ba(e,a);else{t=a;var o=Re;Re|=2;var d=_f();(it!==e||ut!==t)&&(wn=null,as=Ge()+500,wr(e,t));do try{ny();break}catch(y){Cf(e,y)}while(!0);Xl(),ka.current=d,Re=o,Je!==null?t=0:(it=null,ut=0,t=tt)}if(t!==0){if(t===2&&(o=ml(e),o!==0&&(a=o,t=Fo(e,o))),t===1)throw r=oi,wr(e,0),Hn(e,a),Nt(e,Ge()),r;if(t===6)Hn(e,a);else{if(o=e.current.alternate,(a&30)===0&&!ey(o)&&(t=ba(e,a),t===2&&(d=ml(e),d!==0&&(a=d,t=Fo(e,d))),t===1))throw r=oi,wr(e,0),Hn(e,a),Nt(e,Ge()),r;switch(e.finishedWork=o,e.finishedLanes=a,t){case 0:case 1:throw Error(i(345));case 2:kr(e,Et,wn);break;case 3:if(Hn(e,a),(a&130023424)===a&&(t=Lo+500-Ge(),10<t)){if(Ai(e,0)!==0)break;if(o=e.suspendedLanes,(o&a)!==a){gt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=$l(kr.bind(null,e,Et,wn),t);break}kr(e,Et,wn);break;case 4:if(Hn(e,a),(a&4194240)===a)break;for(t=e.eventTimes,o=-1;0<a;){var h=31-Kt(a);d=1<<h,h=t[h],h>o&&(o=h),a&=~d}if(a=o,a=Ge()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*Xm(a/1960))-a,10<a){e.timeoutHandle=$l(kr.bind(null,e,Et,wn),a);break}kr(e,Et,wn);break;case 5:kr(e,Et,wn);break;default:throw Error(i(329))}}}return Nt(e,Ge()),e.callbackNode===r?wf.bind(null,e):null}function Fo(e,t){var r=ui;return e.current.memoizedState.isDehydrated&&(wr(e,t).flags|=256),e=ba(e,t),e!==2&&(t=Et,Et=r,t!==null&&zo(t)),e}function zo(e){Et===null?Et=e:Et.push.apply(Et,e)}function ey(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var a=0;a<r.length;a++){var o=r[a],d=o.getSnapshot;o=o.value;try{if(!Wt(d(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Hn(e,t){for(t&=~Io,t&=~Ca,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Kt(t),a=1<<r;e[r]=-1,t&=~a}}function kf(e){if((Re&6)!==0)throw Error(i(327));ls();var t=Ai(e,0);if((t&1)===0)return Nt(e,Ge()),null;var r=ba(e,t);if(e.tag!==0&&r===2){var a=ml(e);a!==0&&(t=a,r=Fo(e,a))}if(r===1)throw r=oi,wr(e,0),Hn(e,t),Nt(e,Ge()),r;if(r===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,kr(e,Et,wn),Nt(e,Ge()),null}function Do(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(as=Ge()+500,ta&&Dn())}}function xr(e){Qn!==null&&Qn.tag===0&&(Re&6)===0&&ls();var t=Re;Re|=1;var r=Vt.transition,a=Me;try{if(Vt.transition=null,Me=1,e)return e()}finally{Me=a,Vt.transition=r,Re=t,(Re&6)===0&&Dn()}}function Uo(){At=is.current,$e(is)}function wr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Tm(r)),Je!==null)for(r=Je.return;r!==null;){var a=r;switch(Wl(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&Xi();break;case 3:ns(),$e(_t),$e(dt),lo();break;case 5:io(a);break;case 4:ns();break;case 13:$e(He);break;case 19:$e(He);break;case 10:eo(a.type._context);break;case 22:case 23:Uo()}r=r.return}if(it=e,Je=e=Kn(e.current,null),ut=At=t,tt=0,oi=null,Io=Ca=gr=0,Et=ui=null,mr!==null){for(t=0;t<mr.length;t++)if(r=mr[t],a=r.interleaved,a!==null){r.interleaved=null;var o=a.next,d=r.pending;if(d!==null){var h=d.next;d.next=o,a.next=h}r.pending=a}mr=null}return e}function Cf(e,t){do{var r=Je;try{if(Xl(),da.current=ma,fa){for(var a=Ke.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}fa=!1}if(vr=0,st=et=Ke=null,ni=!1,ri=0,Oo.current=null,r===null||r.return===null){tt=1,oi=t,Je=null;break}e:{var d=e,h=r.return,y=r,x=t;if(t=ut,y.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){var N=x,L=y,M=L.tag;if((L.mode&1)===0&&(M===0||M===11||M===15)){var O=L.alternate;O?(L.updateQueue=O.updateQueue,L.memoizedState=O.memoizedState,L.lanes=O.lanes):(L.updateQueue=null,L.memoizedState=null)}var Z=Hd(h);if(Z!==null){Z.flags&=-257,Kd(Z,h,y,d,t),Z.mode&1&&Bd(d,N,t),t=Z,x=N;var X=t.updateQueue;if(X===null){var ne=new Set;ne.add(x),t.updateQueue=ne}else X.add(x);break e}else{if((t&1)===0){Bd(d,N,t),qo();break e}x=Error(i(426))}}else if(Qe&&y.mode&1){var Ye=Hd(h);if(Ye!==null){(Ye.flags&65536)===0&&(Ye.flags|=256),Kd(Ye,h,y,d,t),Yl(rs(x,y));break e}}d=x=rs(x,y),tt!==4&&(tt=2),ui===null?ui=[d]:ui.push(d),d=h;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var _=Vd(d,x,t);yd(d,_);break e;case 1:y=x;var k=d.type,j=d.stateNode;if((d.flags&128)===0&&(typeof k.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Vn===null||!Vn.has(j)))){d.flags|=65536,t&=-t,d.lanes|=t;var q=Qd(d,y,t);yd(d,q);break e}}d=d.return}while(d!==null)}jf(r)}catch(re){t=re,Je===r&&r!==null&&(Je=r=r.return);continue}break}while(!0)}function _f(){var e=ka.current;return ka.current=ma,e===null?ma:e}function qo(){(tt===0||tt===3||tt===2)&&(tt=4),it===null||(gr&268435455)===0&&(Ca&268435455)===0||Hn(it,ut)}function ba(e,t){var r=Re;Re|=2;var a=_f();(it!==e||ut!==t)&&(wn=null,wr(e,t));do try{ty();break}catch(o){Cf(e,o)}while(!0);if(Xl(),Re=r,ka.current=a,Je!==null)throw Error(i(261));return it=null,ut=0,tt}function ty(){for(;Je!==null;)Sf(Je)}function ny(){for(;Je!==null&&!Np();)Sf(Je)}function Sf(e){var t=bf(e.alternate,e,At);e.memoizedProps=e.pendingProps,t===null?jf(e):Je=t,Oo.current=null}function jf(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Wm(r,t,At),r!==null){Je=r;return}}else{if(r=Zm(r,t),r!==null){r.flags&=32767,Je=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tt=6,Je=null;return}}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);tt===0&&(tt=5)}function kr(e,t,r){var a=Me,o=Vt.transition;try{Vt.transition=null,Me=1,ry(e,t,r,a)}finally{Vt.transition=o,Me=a}return null}function ry(e,t,r,a){do ls();while(Qn!==null);if((Re&6)!==0)throw Error(i(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var d=r.lanes|r.childLanes;if(Fp(e,d),e===it&&(Je=it=null,ut=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Sa||(Sa=!0,Rf(Oi,function(){return ls(),null})),d=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||d){d=Vt.transition,Vt.transition=null;var h=Me;Me=1;var y=Re;Re|=4,Oo.current=null,Ym(e,r),mf(r,e),_m(Ul),Di=!!Dl,Ul=Dl=null,e.current=r,Jm(r),bp(),Re=y,Me=h,Vt.transition=d}else e.current=r;if(Sa&&(Sa=!1,Qn=e,ja=o),d=e.pendingLanes,d===0&&(Vn=null),Pp(r.stateNode),Nt(e,Ge()),t!==null)for(a=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],a(o.value,{componentStack:o.stack,digest:o.digest});if(_a)throw _a=!1,e=Mo,Mo=null,e;return(ja&1)!==0&&e.tag!==0&&ls(),d=e.pendingLanes,(d&1)!==0?e===Ao?ci++:(ci=0,Ao=e):ci=0,Dn(),null}function ls(){if(Qn!==null){var e=fc(ja),t=Vt.transition,r=Me;try{if(Vt.transition=null,Me=16>e?16:e,Qn===null)var a=!1;else{if(e=Qn,Qn=null,ja=0,(Re&6)!==0)throw Error(i(331));var o=Re;for(Re|=4,J=e.current;J!==null;){var d=J,h=d.child;if((J.flags&16)!==0){var y=d.deletions;if(y!==null){for(var x=0;x<y.length;x++){var N=y[x];for(J=N;J!==null;){var L=J;switch(L.tag){case 0:case 11:case 15:li(8,L,d)}var M=L.child;if(M!==null)M.return=L,J=M;else for(;J!==null;){L=J;var O=L.sibling,Z=L.return;if(cf(L),L===N){J=null;break}if(O!==null){O.return=Z,J=O;break}J=Z}}}var X=d.alternate;if(X!==null){var ne=X.child;if(ne!==null){X.child=null;do{var Ye=ne.sibling;ne.sibling=null,ne=Ye}while(ne!==null)}}J=d}}if((d.subtreeFlags&2064)!==0&&h!==null)h.return=d,J=h;else e:for(;J!==null;){if(d=J,(d.flags&2048)!==0)switch(d.tag){case 0:case 11:case 15:li(9,d,d.return)}var _=d.sibling;if(_!==null){_.return=d.return,J=_;break e}J=d.return}}var k=e.current;for(J=k;J!==null;){h=J;var j=h.child;if((h.subtreeFlags&2064)!==0&&j!==null)j.return=h,J=j;else e:for(h=k;J!==null;){if(y=J,(y.flags&2048)!==0)try{switch(y.tag){case 0:case 11:case 15:wa(9,y)}}catch(re){We(y,y.return,re)}if(y===h){J=null;break e}var q=y.sibling;if(q!==null){q.return=y.return,J=q;break e}J=y.return}}if(Re=o,Dn(),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Ii,e)}catch{}a=!0}return a}finally{Me=r,Vt.transition=t}}return!1}function Ef(e,t,r){t=rs(r,t),t=Vd(e,t,1),e=qn(e,t,1),t=gt(),e!==null&&(Ls(e,1,t),Nt(e,t))}function We(e,t,r){if(e.tag===3)Ef(e,e,r);else for(;t!==null;){if(t.tag===3){Ef(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Vn===null||!Vn.has(a))){e=rs(r,e),e=Qd(t,e,1),t=qn(t,e,1),e=gt(),t!==null&&(Ls(t,1,e),Nt(t,e));break}}t=t.return}}function sy(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=gt(),e.pingedLanes|=e.suspendedLanes&r,it===e&&(ut&r)===r&&(tt===4||tt===3&&(ut&130023424)===ut&&500>Ge()-Lo?wr(e,0):Io|=r),Nt(e,t)}function Nf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Mi,Mi<<=1,(Mi&130023424)===0&&(Mi=4194304)));var r=gt();e=vn(e,t),e!==null&&(Ls(e,t,r),Nt(e,r))}function iy(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Nf(e,r)}function ay(e,t){var r=0;switch(e.tag){case 13:var a=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(t),Nf(e,r)}var bf;bf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||_t.current)jt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return jt=!1,Km(e,t,r);jt=(e.flags&131072)!==0}else jt=!1,Qe&&(t.flags&1048576)!==0&&ad(t,ra,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;ga(e,t),e=t.pendingProps;var o=Zr(t,dt.current);ts(t,r),o=co(null,t,a,e,o,r);var d=fo();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,St(a)?(d=!0,ea(t)):d=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ro(t),o.updater=ya,t.stateNode=o,o._reactInternals=t,go(t,a,e,r),t=Co(null,t,a,!0,d,r)):(t.tag=0,Qe&&d&&Kl(t),vt(null,t,o,r),t=t.child),t;case 16:a=t.elementType;e:{switch(ga(e,t),e=t.pendingProps,o=a._init,a=o(a._payload),t.type=a,o=t.tag=oy(a),e=Gt(a,e),o){case 0:t=ko(null,t,a,e,r);break e;case 1:t=Xd(null,t,a,e,r);break e;case 11:t=Wd(null,t,a,e,r);break e;case 14:t=Zd(null,t,a,Gt(a.type,e),r);break e}throw Error(i(306,a,""))}return t;case 0:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Gt(a,o),ko(e,t,a,o,r);case 1:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Gt(a,o),Xd(e,t,a,o,r);case 3:e:{if(ef(t),e===null)throw Error(i(387));a=t.pendingProps,d=t.memoizedState,o=d.element,md(e,t),ua(t,a,null,r);var h=t.memoizedState;if(a=h.element,d.isDehydrated)if(d={element:a,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){o=rs(Error(i(423)),t),t=tf(e,t,a,r,o);break e}else if(a!==o){o=rs(Error(i(424)),t),t=tf(e,t,a,r,o);break e}else for(Mt=An(t.stateNode.containerInfo.firstChild),Lt=t,Qe=!0,Zt=null,r=hd(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Jr(),a===o){t=xn(e,t,r);break e}vt(e,t,a,r)}t=t.child}return t;case 5:return gd(t),e===null&&Gl(t),a=t.type,o=t.pendingProps,d=e!==null?e.memoizedProps:null,h=o.children,ql(a,o)?h=null:d!==null&&ql(a,d)&&(t.flags|=32),Jd(e,t),vt(e,t,h,r),t.child;case 6:return e===null&&Gl(t),null;case 13:return nf(e,t,r);case 4:return so(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Xr(t,null,a,r):vt(e,t,a,r),t.child;case 11:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Gt(a,o),Wd(e,t,a,o,r);case 7:return vt(e,t,t.pendingProps,r),t.child;case 8:return vt(e,t,t.pendingProps.children,r),t.child;case 12:return vt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(a=t.type._context,o=t.pendingProps,d=t.memoizedProps,h=o.value,Ue(aa,a._currentValue),a._currentValue=h,d!==null)if(Wt(d.value,h)){if(d.children===o.children&&!_t.current){t=xn(e,t,r);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var y=d.dependencies;if(y!==null){h=d.child;for(var x=y.firstContext;x!==null;){if(x.context===a){if(d.tag===1){x=gn(-1,r&-r),x.tag=2;var N=d.updateQueue;if(N!==null){N=N.shared;var L=N.pending;L===null?x.next=x:(x.next=L.next,L.next=x),N.pending=x}}d.lanes|=r,x=d.alternate,x!==null&&(x.lanes|=r),to(d.return,r,t),y.lanes|=r;break}x=x.next}}else if(d.tag===10)h=d.type===t.type?null:d.child;else if(d.tag===18){if(h=d.return,h===null)throw Error(i(341));h.lanes|=r,y=h.alternate,y!==null&&(y.lanes|=r),to(h,r,t),h=d.sibling}else h=d.child;if(h!==null)h.return=d;else for(h=d;h!==null;){if(h===t){h=null;break}if(d=h.sibling,d!==null){d.return=h.return,h=d;break}h=h.return}d=h}vt(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,a=t.pendingProps.children,ts(t,r),o=qt(o),a=a(o),t.flags|=1,vt(e,t,a,r),t.child;case 14:return a=t.type,o=Gt(a,t.pendingProps),o=Gt(a.type,o),Zd(e,t,a,o,r);case 15:return Gd(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Gt(a,o),ga(e,t),t.tag=1,St(a)?(e=!0,ea(t)):e=!1,ts(t,r),qd(t,a,o),go(t,a,o,r),Co(null,t,a,!0,e,r);case 19:return sf(e,t,r);case 22:return Yd(e,t,r)}throw Error(i(156,t.tag))};function Rf(e,t){return lc(e,t)}function ly(e,t,r,a){this.tag=e,this.key=r,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,r,a){return new ly(e,t,r,a)}function $o(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oy(e){if(typeof e=="function")return $o(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Se)return 11;if(e===ze)return 14}return 2}function Kn(e,t){var r=e.alternate;return r===null?(r=Qt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ra(e,t,r,a,o,d){var h=2;if(a=e,typeof e=="function")$o(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case he:return Cr(r.children,o,d,t);case oe:h=8,o|=8;break;case U:return e=Qt(12,r,t,o|2),e.elementType=U,e.lanes=d,e;case te:return e=Qt(13,r,t,o),e.elementType=te,e.lanes=d,e;case ge:return e=Qt(19,r,t,o),e.elementType=ge,e.lanes=d,e;case Ie:return Ta(r,o,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:h=10;break e;case B:h=9;break e;case Se:h=11;break e;case ze:h=14;break e;case Be:h=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Qt(h,r,t,o),t.elementType=e,t.type=a,t.lanes=d,t}function Cr(e,t,r,a){return e=Qt(7,e,a,t),e.lanes=r,e}function Ta(e,t,r,a){return e=Qt(22,e,a,t),e.elementType=Ie,e.lanes=r,e.stateNode={isHidden:!1},e}function Vo(e,t,r){return e=Qt(6,e,null,t),e.lanes=r,e}function Qo(e,t,r){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uy(e,t,r,a,o){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=yl(0),this.expirationTimes=yl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yl(0),this.identifierPrefix=a,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Bo(e,t,r,a,o,d,h,y,x){return e=new uy(e,t,r,y,x),t===1?(t=1,d===!0&&(t|=8)):t=0,d=Qt(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(d),e}function cy(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ue,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function Tf(e){if(!e)return zn;e=e._reactInternals;e:{if(cr(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(St(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var r=e.type;if(St(r))return rd(e,r,t)}return t}function Pf(e,t,r,a,o,d,h,y,x){return e=Bo(r,a,!0,e,o,d,h,y,x),e.context=Tf(null),r=e.current,a=gt(),o=Bn(r),d=gn(a,o),d.callback=t??null,qn(r,d,o),e.current.lanes=o,Ls(e,o,a),Nt(e,a),e}function Pa(e,t,r,a){var o=t.current,d=gt(),h=Bn(o);return r=Tf(r),t.context===null?t.context=r:t.pendingContext=r,t=gn(d,h),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=qn(o,t,h),e!==null&&(Xt(e,o,h,d),oa(e,o,h)),h}function Oa(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 Of(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ho(e,t){Of(e,t),(e=e.alternate)&&Of(e,t)}function dy(){return null}var If=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ko(e){this._internalRoot=e}Ia.prototype.render=Ko.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));Pa(e,t,null,null)},Ia.prototype.unmount=Ko.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Pa(null,e,null,null)}),t[hn]=null}};function Ia(e){this._internalRoot=e}Ia.prototype.unstable_scheduleHydration=function(e){if(e){var t=mc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<In.length&&t!==0&&t<In[r].priority;r++);In.splice(r,0,e),r===0&&gc(e)}};function Wo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function La(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lf(){}function fy(e,t,r,a,o){if(o){if(typeof a=="function"){var d=a;a=function(){var N=Oa(h);d.call(N)}}var h=Pf(t,a,e,0,null,!1,!1,"",Lf);return e._reactRootContainer=h,e[hn]=h.current,Ws(e.nodeType===8?e.parentNode:e),xr(),h}for(;o=e.lastChild;)e.removeChild(o);if(typeof a=="function"){var y=a;a=function(){var N=Oa(x);y.call(N)}}var x=Bo(e,0,!1,null,null,!1,!1,"",Lf);return e._reactRootContainer=x,e[hn]=x.current,Ws(e.nodeType===8?e.parentNode:e),xr(function(){Pa(t,x,r,a)}),x}function Ma(e,t,r,a,o){var d=r._reactRootContainer;if(d){var h=d;if(typeof o=="function"){var y=o;o=function(){var x=Oa(h);y.call(x)}}Pa(t,h,e,o)}else h=fy(r,t,e,o,a);return Oa(h)}hc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Is(t.pendingLanes);r!==0&&(vl(t,r|1),Nt(t,Ge()),(Re&6)===0&&(as=Ge()+500,Dn()))}break;case 13:xr(function(){var a=vn(e,1);if(a!==null){var o=gt();Xt(a,e,1,o)}}),Ho(e,1)}},gl=function(e){if(e.tag===13){var t=vn(e,134217728);if(t!==null){var r=gt();Xt(t,e,134217728,r)}Ho(e,134217728)}},pc=function(e){if(e.tag===13){var t=Bn(e),r=vn(e,t);if(r!==null){var a=gt();Xt(r,e,t,a)}Ho(e,t)}},mc=function(){return Me},yc=function(e,t){var r=Me;try{return Me=e,t()}finally{Me=r}},cl=function(e,t,r){switch(t){case"input":if(nl(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var o=Ji(a);if(!o)throw Error(i(90));Uu(a),nl(a,o)}}}break;case"textarea":Bu(e,r);break;case"select":t=r.value,t!=null&&Fr(e,!!r.multiple,t,!1)}},ec=Do,tc=xr;var hy={usingClientEntryPoint:!1,Events:[Ys,Kr,Ji,Ju,Xu,Do]},di={findFiberByHostInstance:dr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},py={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:F.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ic(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||dy,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 Aa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Aa.isDisabled&&Aa.supportsFiber)try{Ii=Aa.inject(py),nn=Aa}catch{}}return bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hy,bt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wo(t))throw Error(i(200));return cy(e,t,null,r)},bt.createRoot=function(e,t){if(!Wo(e))throw Error(i(299));var r=!1,a="",o=If;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Bo(e,1,!1,null,null,r,!1,a,o),e[hn]=t.current,Ws(e.nodeType===8?e.parentNode:e),new Ko(t)},bt.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(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=ic(t),e=e===null?null:e.stateNode,e},bt.flushSync=function(e){return xr(e)},bt.hydrate=function(e,t,r){if(!La(t))throw Error(i(200));return Ma(null,e,t,!0,r)},bt.hydrateRoot=function(e,t,r){if(!Wo(e))throw Error(i(405));var a=r!=null&&r.hydratedSources||null,o=!1,d="",h=If;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(h=r.onRecoverableError)),t=Pf(t,null,e,1,r??null,o,!1,d,h),e[hn]=t.current,Ws(e),a)for(e=0;e<a.length;e++)r=a[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Ia(t)},bt.render=function(e,t,r){if(!La(t))throw Error(i(200));return Ma(null,e,t,!1,r)},bt.unmountComponentAtNode=function(e){if(!La(e))throw Error(i(40));return e._reactRootContainer?(xr(function(){Ma(null,null,e,!1,function(){e._reactRootContainer=null,e[hn]=null})}),!0):!1},bt.unstable_batchedUpdates=Do,bt.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!La(r))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Ma(e,t,r,!1,a)},bt.version="18.3.1-next-f1338f8080-20240426",bt}var Qf;function qh(){if(Qf)return Jo.exports;Qf=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),Jo.exports=_y(),Jo.exports}var Bf;function Sy(){if(Bf)return za;Bf=1;var s=qh();return za.createRoot=s.createRoot,za.hydrateRoot=s.hydrateRoot,za}var jy=Sy(),Es=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sr,Yn,us,Th,Ey=(Th=class extends Es{constructor(){super();ae(this,Sr);ae(this,Yn);ae(this,us);K(this,us,n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){g(this,Yn)||this.setEventListener(g(this,us))}onUnsubscribe(){var n;this.hasListeners()||((n=g(this,Yn))==null||n.call(this),K(this,Yn,void 0))}setEventListener(n){var i;K(this,us,n),(i=g(this,Yn))==null||i.call(this),K(this,Yn,n(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()}))}setFocused(n){g(this,Sr)!==n&&(K(this,Sr,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){var n;return typeof g(this,Sr)=="boolean"?g(this,Sr):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},Sr=new WeakMap,Yn=new WeakMap,us=new WeakMap,Th),Nu=new Ey,Ny={setTimeout:(s,n)=>setTimeout(s,n),clearTimeout:s=>clearTimeout(s),setInterval:(s,n)=>setInterval(s,n),clearInterval:s=>clearInterval(s)},Jn,ju,Ph,by=(Ph=class{constructor(){ae(this,Jn,Ny);ae(this,ju,!1)}setTimeoutProvider(s){K(this,Jn,s)}setTimeout(s,n){return g(this,Jn).setTimeout(s,n)}clearTimeout(s){g(this,Jn).clearTimeout(s)}setInterval(s,n){return g(this,Jn).setInterval(s,n)}clearInterval(s){g(this,Jn).clearInterval(s)}},Jn=new WeakMap,ju=new WeakMap,Ph),_r=new by;function Ry(s){setTimeout(s,0)}var Ty=typeof window>"u"||"Deno"in globalThis;function wt(){}function Py(s,n){return typeof s=="function"?s(n):s}function ru(s){return typeof s=="number"&&s>=0&&s!==1/0}function $h(s,n){return Math.max(s+(n||0)-Date.now(),0)}function ar(s,n){return typeof s=="function"?s(n):s}function zt(s,n){return typeof s=="function"?s(n):s}function Hf(s,n){const{type:i="all",exact:l,fetchStatus:c,predicate:f,queryKey:p,stale:m}=s;if(p){if(l){if(n.queryHash!==bu(p,n.options))return!1}else if(!mi(n.queryKey,p))return!1}if(i!=="all"){const w=n.isActive();if(i==="active"&&!w||i==="inactive"&&w)return!1}return!(typeof m=="boolean"&&n.isStale()!==m||c&&c!==n.state.fetchStatus||f&&!f(n))}function Kf(s,n){const{exact:i,status:l,predicate:c,mutationKey:f}=s;if(f){if(!n.options.mutationKey)return!1;if(i){if(Ir(n.options.mutationKey)!==Ir(f))return!1}else if(!mi(n.options.mutationKey,f))return!1}return!(l&&n.state.status!==l||c&&!c(n))}function bu(s,n){return((n==null?void 0:n.queryKeyHashFn)||Ir)(s)}function Ir(s){return JSON.stringify(s,(n,i)=>su(i)?Object.keys(i).sort().reduce((l,c)=>(l[c]=i[c],l),{}):i)}function mi(s,n){return s===n?!0:typeof s!=typeof n?!1:s&&n&&typeof s=="object"&&typeof n=="object"?Object.keys(n).every(i=>mi(s[i],n[i])):!1}var Oy=Object.prototype.hasOwnProperty;function Vh(s,n,i=0){if(s===n)return s;if(i>500)return n;const l=Wf(s)&&Wf(n);if(!l&&!(su(s)&&su(n)))return n;const f=(l?s:Object.keys(s)).length,p=l?n:Object.keys(n),m=p.length,w=l?new Array(m):{};let S=0;for(let C=0;C<m;C++){const E=l?C:p[C],I=s[E],z=n[E];if(I===z){w[E]=I,(l?C<f:Oy.call(s,E))&&S++;continue}if(I===null||z===null||typeof I!="object"||typeof z!="object"){w[E]=z;continue}const V=Vh(I,z,i+1);w[E]=V,V===I&&S++}return f===m&&S===f?s:w}function Ba(s,n){if(!n||Object.keys(s).length!==Object.keys(n).length)return!1;for(const i in s)if(s[i]!==n[i])return!1;return!0}function Wf(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function su(s){if(!Zf(s))return!1;const n=s.constructor;if(n===void 0)return!0;const i=n.prototype;return!(!Zf(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function Zf(s){return Object.prototype.toString.call(s)==="[object Object]"}function Iy(s){return new Promise(n=>{_r.setTimeout(n,s)})}function iu(s,n,i){return typeof i.structuralSharing=="function"?i.structuralSharing(s,n):i.structuralSharing!==!1?Vh(s,n):n}function Ly(s,n,i=0){const l=[...s,n];return i&&l.length>i?l.slice(1):l}function My(s,n,i=0){const l=[n,...s];return i&&l.length>i?l.slice(0,-1):l}var Ru=Symbol();function Qh(s,n){return!s.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!s.queryFn||s.queryFn===Ru?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function Tu(s,n){return typeof s=="function"?s(...n):!!s}function Ay(s,n,i){let l=!1,c;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(c??(c=n()),l||(l=!0,c.aborted?i():c.addEventListener("abort",i,{once:!0})),c)}),s}var yi=(()=>{let s=()=>Ty;return{isServer(){return s()},setIsServer(n){s=n}}})();function au(){let s,n;const i=new Promise((c,f)=>{s=c,n=f});i.status="pending",i.catch(()=>{});function l(c){Object.assign(i,c),delete i.resolve,delete i.reject}return i.resolve=c=>{l({status:"fulfilled",value:c}),s(c)},i.reject=c=>{l({status:"rejected",reason:c}),n(c)},i}var Fy=Ry;function zy(){let s=[],n=0,i=m=>{m()},l=m=>{m()},c=Fy;const f=m=>{n?s.push(m):c(()=>{i(m)})},p=()=>{const m=s;s=[],m.length&&c(()=>{l(()=>{m.forEach(w=>{i(w)})})})};return{batch:m=>{let w;n++;try{w=m()}finally{n--,n||p()}return w},batchCalls:m=>(...w)=>{f(()=>{m(...w)})},schedule:f,setNotifyFunction:m=>{i=m},setBatchNotifyFunction:m=>{l=m},setScheduler:m=>{c=m}}}var nt=zy(),cs,Xn,ds,Oh,Dy=(Oh=class extends Es{constructor(){super();ae(this,cs,!0);ae(this,Xn);ae(this,ds);K(this,ds,n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n(!0),l=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",l)}}})}onSubscribe(){g(this,Xn)||this.setEventListener(g(this,ds))}onUnsubscribe(){var n;this.hasListeners()||((n=g(this,Xn))==null||n.call(this),K(this,Xn,void 0))}setEventListener(n){var i;K(this,ds,n),(i=g(this,Xn))==null||i.call(this),K(this,Xn,n(this.setOnline.bind(this)))}setOnline(n){g(this,cs)!==n&&(K(this,cs,n),this.listeners.forEach(l=>{l(n)}))}isOnline(){return g(this,cs)}},cs=new WeakMap,Xn=new WeakMap,ds=new WeakMap,Oh),Ha=new Dy;function Uy(s){return Math.min(1e3*2**s,3e4)}function Bh(s){return(s??"online")==="online"?Ha.isOnline():!0}var lu=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function Hh(s){let n=!1,i=0,l;const c=au(),f=()=>c.status!=="pending",p=D=>{var P;if(!f()){const T=new lu(D);I(T),(P=s.onCancel)==null||P.call(s,T)}},m=()=>{n=!0},w=()=>{n=!1},S=()=>Nu.isFocused()&&(s.networkMode==="always"||Ha.isOnline())&&s.canRun(),C=()=>Bh(s.networkMode)&&s.canRun(),E=D=>{f()||(l==null||l(),c.resolve(D))},I=D=>{f()||(l==null||l(),c.reject(D))},z=()=>new Promise(D=>{var P;l=T=>{(f()||S())&&D(T)},(P=s.onPause)==null||P.call(s)}).then(()=>{var D;l=void 0,f()||(D=s.onContinue)==null||D.call(s)}),V=()=>{if(f())return;let D;const P=i===0?s.initialPromise:void 0;try{D=P??s.fn()}catch(T){D=Promise.reject(T)}Promise.resolve(D).then(E).catch(T=>{var ue;if(f())return;const Y=s.retry??(yi.isServer()?0:3),A=s.retryDelay??Uy,F=typeof A=="function"?A(i,T):A,Q=Y===!0||typeof Y=="number"&&i<Y||typeof Y=="function"&&Y(i,T);if(n||!Q){I(T);return}i++,(ue=s.onFail)==null||ue.call(s,i,T),Iy(F).then(()=>S()?void 0:z()).then(()=>{n?I(T):V()})})};return{promise:c,status:()=>c.status,cancel:p,continue:()=>(l==null||l(),c),cancelRetry:m,continueRetry:w,canStart:C,start:()=>(C()?V():z().then(V),c)}}var jr,Ih,Kh=(Ih=class{constructor(){ae(this,jr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ru(this.gcTime)&&K(this,jr,_r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(yi.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,jr)!==void 0&&(_r.clearTimeout(g(this,jr)),K(this,jr,void 0))}},jr=new WeakMap,Ih);function qy(s){return{onFetch:(n,i)=>{var C,E,I,z,V;const l=n.options,c=(I=(E=(C=n.fetchOptions)==null?void 0:C.meta)==null?void 0:E.fetchMore)==null?void 0:I.direction,f=((z=n.state.data)==null?void 0:z.pages)||[],p=((V=n.state.data)==null?void 0:V.pageParams)||[];let m={pages:[],pageParams:[]},w=0;const S=async()=>{let D=!1;const P=A=>{Ay(A,()=>n.signal,()=>D=!0)},T=Qh(n.options,n.fetchOptions),Y=async(A,F,Q)=>{if(D)return Promise.reject(n.signal.reason);if(F==null&&A.pages.length)return Promise.resolve(A);const he=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:F,direction:Q?"backward":"forward",meta:n.options.meta};return P(B),B})(),oe=await T(he),{maxPages:U}=n.options,le=Q?My:Ly;return{pages:le(A.pages,oe,U),pageParams:le(A.pageParams,F,U)}};if(c&&f.length){const A=c==="backward",F=A?$y:Gf,Q={pages:f,pageParams:p},ue=F(l,Q);m=await Y(Q,ue,A)}else{const A=s??f.length;do{const F=w===0?p[0]??l.initialPageParam:Gf(l,m);if(w>0&&F==null)break;m=await Y(m,F),w++}while(w<A)}return m};n.options.persister?n.fetchFn=()=>{var D,P;return(P=(D=n.options).persister)==null?void 0:P.call(D,S,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},i)}:n.fetchFn=S}}}function Gf(s,{pages:n,pageParams:i}){const l=n.length-1;return n.length>0?s.getNextPageParam(n[l],n,i[l],i):void 0}function $y(s,{pages:n,pageParams:i}){var l;return n.length>0?(l=s.getPreviousPageParam)==null?void 0:l.call(s,n[0],n,i[0],i):void 0}var fs,Er,hs,Bt,Nr,lt,Ci,br,Ft,Wh,kn,Lh,Vy=(Lh=class extends Kh{constructor(n){super();ae(this,Ft);ae(this,fs);ae(this,Er);ae(this,hs);ae(this,Bt);ae(this,Nr);ae(this,lt);ae(this,Ci);ae(this,br);K(this,br,!1),K(this,Ci,n.defaultOptions),this.setOptions(n.options),this.observers=[],K(this,Nr,n.client),K(this,Bt,g(this,Nr).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,K(this,Er,Jf(this.options)),this.state=n.state??g(this,Er),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,fs)}get promise(){var n;return(n=g(this,lt))==null?void 0:n.promise}setOptions(n){if(this.options={...g(this,Ci),...n},n!=null&&n._type&&K(this,fs,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=Jf(this.options);i.data!==void 0&&(this.setState(Yf(i.data,i.dataUpdatedAt)),K(this,Er,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Bt).remove(this)}setData(n,i){const l=iu(this.state.data,n,this.options);return xe(this,Ft,kn).call(this,{data:l,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),l}setState(n){xe(this,Ft,kn).call(this,{type:"setState",state:n})}cancel(n){var l,c;const i=(l=g(this,lt))==null?void 0:l.promise;return(c=g(this,lt))==null||c.cancel(n),i?i.then(wt).catch(wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,Er)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>zt(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ru||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>ar(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!$h(this.state.dataUpdatedAt,n)}onFocus(){var i;const n=this.observers.find(l=>l.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(i=g(this,lt))==null||i.continue()}onOnline(){var i;const n=this.observers.find(l=>l.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(i=g(this,lt))==null||i.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),g(this,Bt).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(i=>i!==n),this.observers.length||(g(this,lt)&&(g(this,br)||xe(this,Ft,Wh).call(this)?g(this,lt).cancel({revert:!0}):g(this,lt).cancelRetry()),this.scheduleGc()),g(this,Bt).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xe(this,Ft,kn).call(this,{type:"invalidate"})}async fetch(n,i){var S,C,E,I,z,V,D,P,T,Y,A;if(this.state.fetchStatus!=="idle"&&((S=g(this,lt))==null?void 0:S.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(g(this,lt))return g(this,lt).continueRetry(),g(this,lt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const F=this.observers.find(Q=>Q.options.queryFn);F&&this.setOptions(F.options)}const l=new AbortController,c=F=>{Object.defineProperty(F,"signal",{enumerable:!0,get:()=>(K(this,br,!0),l.signal)})},f=()=>{const F=Qh(this.options,i),ue=(()=>{const he={client:g(this,Nr),queryKey:this.queryKey,meta:this.meta};return c(he),he})();return K(this,br,!1),this.options.persister?this.options.persister(F,ue,this):F(ue)},m=(()=>{const F={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:g(this,Nr),state:this.state,fetchFn:f};return c(F),F})(),w=g(this,fs)==="infinite"?qy(this.options.pages):this.options.behavior;w==null||w.onFetch(m,this),K(this,hs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((C=m.fetchOptions)==null?void 0:C.meta))&&xe(this,Ft,kn).call(this,{type:"fetch",meta:(E=m.fetchOptions)==null?void 0:E.meta}),K(this,lt,Hh({initialPromise:i==null?void 0:i.initialPromise,fn:m.fetchFn,onCancel:F=>{F instanceof lu&&F.revert&&this.setState({...g(this,hs),fetchStatus:"idle"}),l.abort()},onFail:(F,Q)=>{xe(this,Ft,kn).call(this,{type:"failed",failureCount:F,error:Q})},onPause:()=>{xe(this,Ft,kn).call(this,{type:"pause"})},onContinue:()=>{xe(this,Ft,kn).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const F=await g(this,lt).start();if(F===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(F),(z=(I=g(this,Bt).config).onSuccess)==null||z.call(I,F,this),(D=(V=g(this,Bt).config).onSettled)==null||D.call(V,F,this.state.error,this),F}catch(F){if(F instanceof lu){if(F.silent)return g(this,lt).promise;if(F.revert){if(this.state.data===void 0)throw F;return this.state.data}}throw xe(this,Ft,kn).call(this,{type:"error",error:F}),(T=(P=g(this,Bt).config).onError)==null||T.call(P,F,this),(A=(Y=g(this,Bt).config).onSettled)==null||A.call(Y,this.state.data,F,this),F}finally{this.scheduleGc()}}},fs=new WeakMap,Er=new WeakMap,hs=new WeakMap,Bt=new WeakMap,Nr=new WeakMap,lt=new WeakMap,Ci=new WeakMap,br=new WeakMap,Ft=new WeakSet,Wh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},kn=function(n){const i=l=>{switch(n.type){case"failed":return{...l,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,...Zh(l.data,this.options),fetchMeta:n.meta??null};case"success":const c={...l,...Yf(n.data,n.dataUpdatedAt),dataUpdateCount:l.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return K(this,hs,n.manual?c:void 0),c;case"error":const f=n.error;return{...l,error:f,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...n.state}}};this.state=i(this.state),nt.batch(()=>{this.observers.forEach(l=>{l.onQueryUpdate()}),g(this,Bt).notify({query:this,type:"updated",action:n})})},Lh);function Zh(s,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bh(n.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function Yf(s,n){return{data:s,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jf(s){const n=typeof s.initialData=="function"?s.initialData():s.initialData,i=n!==void 0,l=i?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Tt,Ne,_i,xt,Rr,ps,_n,er,Si,ms,ys,Tr,Pr,tr,vs,Oe,hi,ou,uu,cu,du,fu,hu,pu,Gh,Mh,Qy=(Mh=class extends Es{constructor(n,i){super();ae(this,Oe);ae(this,Tt);ae(this,Ne);ae(this,_i);ae(this,xt);ae(this,Rr);ae(this,ps);ae(this,_n);ae(this,er);ae(this,Si);ae(this,ms);ae(this,ys);ae(this,Tr);ae(this,Pr);ae(this,tr);ae(this,vs,new Set);this.options=i,K(this,Tt,n),K(this,er,null),K(this,_n,au()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,Ne).addObserver(this),Xf(g(this,Ne),this.options)?xe(this,Oe,hi).call(this):this.updateResult(),xe(this,Oe,du).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mu(g(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mu(g(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xe(this,Oe,fu).call(this),xe(this,Oe,hu).call(this),g(this,Ne).removeObserver(this)}setOptions(n){const i=this.options,l=g(this,Ne);if(this.options=g(this,Tt).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zt(this.options.enabled,g(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");xe(this,Oe,pu).call(this),g(this,Ne).setOptions(this.options),i._defaulted&&!Ba(this.options,i)&&g(this,Tt).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,Ne),observer:this});const c=this.hasListeners();c&&eh(g(this,Ne),l,this.options,i)&&xe(this,Oe,hi).call(this),this.updateResult(),c&&(g(this,Ne)!==l||zt(this.options.enabled,g(this,Ne))!==zt(i.enabled,g(this,Ne))||ar(this.options.staleTime,g(this,Ne))!==ar(i.staleTime,g(this,Ne)))&&xe(this,Oe,ou).call(this);const f=xe(this,Oe,uu).call(this);c&&(g(this,Ne)!==l||zt(this.options.enabled,g(this,Ne))!==zt(i.enabled,g(this,Ne))||f!==g(this,tr))&&xe(this,Oe,cu).call(this,f)}getOptimisticResult(n){const i=g(this,Tt).getQueryCache().build(g(this,Tt),n),l=this.createResult(i,n);return Hy(this,l)&&(K(this,xt,l),K(this,ps,this.options),K(this,Rr,g(this,Ne).state)),l}getCurrentResult(){return g(this,xt)}trackResult(n,i){return new Proxy(n,{get:(l,c)=>(this.trackProp(c),i==null||i(c),c==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&g(this,_n).status==="pending"&&g(this,_n).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(l,c))})}trackProp(n){g(this,vs).add(n)}getCurrentQuery(){return g(this,Ne)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const i=g(this,Tt).defaultQueryOptions(n),l=g(this,Tt).getQueryCache().build(g(this,Tt),i);return l.fetch().then(()=>this.createResult(l,i))}fetch(n){return xe(this,Oe,hi).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,xt)))}createResult(n,i){var U;const l=g(this,Ne),c=this.options,f=g(this,xt),p=g(this,Rr),m=g(this,ps),S=n!==l?n.state:g(this,_i),{state:C}=n;let E={...C},I=!1,z;if(i._optimisticResults){const le=this.hasListeners(),B=!le&&Xf(n,i),Se=le&&eh(n,l,i,c);(B||Se)&&(E={...E,...Zh(C.data,n.options)}),i._optimisticResults==="isRestoring"&&(E.fetchStatus="idle")}let{error:V,errorUpdatedAt:D,status:P}=E;z=E.data;let T=!1;if(i.placeholderData!==void 0&&z===void 0&&P==="pending"){let le;f!=null&&f.isPlaceholderData&&i.placeholderData===(m==null?void 0:m.placeholderData)?(le=f.data,T=!0):le=typeof i.placeholderData=="function"?i.placeholderData((U=g(this,ys))==null?void 0:U.state.data,g(this,ys)):i.placeholderData,le!==void 0&&(P="success",z=iu(f==null?void 0:f.data,le,i),I=!0)}if(i.select&&z!==void 0&&!T)if(f&&z===(p==null?void 0:p.data)&&i.select===g(this,Si))z=g(this,ms);else try{K(this,Si,i.select),z=i.select(z),z=iu(f==null?void 0:f.data,z,i),K(this,ms,z),K(this,er,null)}catch(le){K(this,er,le)}g(this,er)&&(V=g(this,er),z=g(this,ms),D=Date.now(),P="error");const Y=E.fetchStatus==="fetching",A=P==="pending",F=P==="error",Q=A&&Y,ue=z!==void 0,oe={status:P,fetchStatus:E.fetchStatus,isPending:A,isSuccess:P==="success",isError:F,isInitialLoading:Q,isLoading:Q,data:z,dataUpdatedAt:E.dataUpdatedAt,error:V,errorUpdatedAt:D,failureCount:E.fetchFailureCount,failureReason:E.fetchFailureReason,errorUpdateCount:E.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:E.dataUpdateCount>S.dataUpdateCount||E.errorUpdateCount>S.errorUpdateCount,isFetching:Y,isRefetching:Y&&!A,isLoadingError:F&&!ue,isPaused:E.fetchStatus==="paused",isPlaceholderData:I,isRefetchError:F&&ue,isStale:Pu(n,i),refetch:this.refetch,promise:g(this,_n),isEnabled:zt(i.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const le=oe.data!==void 0,B=oe.status==="error"&&!le,Se=ze=>{B?ze.reject(oe.error):le&&ze.resolve(oe.data)},te=()=>{const ze=K(this,_n,oe.promise=au());Se(ze)},ge=g(this,_n);switch(ge.status){case"pending":n.queryHash===l.queryHash&&Se(ge);break;case"fulfilled":(B||oe.data!==ge.value)&&te();break;case"rejected":(!B||oe.error!==ge.reason)&&te();break}}return oe}updateResult(){const n=g(this,xt),i=this.createResult(g(this,Ne),this.options);if(K(this,Rr,g(this,Ne).state),K(this,ps,this.options),g(this,Rr).data!==void 0&&K(this,ys,g(this,Ne)),Ba(i,n))return;K(this,xt,i);const l=()=>{if(!n)return!0;const{notifyOnChangeProps:c}=this.options,f=typeof c=="function"?c():c;if(f==="all"||!f&&!g(this,vs).size)return!0;const p=new Set(f??g(this,vs));return this.options.throwOnError&&p.add("error"),Object.keys(g(this,xt)).some(m=>{const w=m;return g(this,xt)[w]!==n[w]&&p.has(w)})};xe(this,Oe,Gh).call(this,{listeners:l()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xe(this,Oe,du).call(this)}},Tt=new WeakMap,Ne=new WeakMap,_i=new WeakMap,xt=new WeakMap,Rr=new WeakMap,ps=new WeakMap,_n=new WeakMap,er=new WeakMap,Si=new WeakMap,ms=new WeakMap,ys=new WeakMap,Tr=new WeakMap,Pr=new WeakMap,tr=new WeakMap,vs=new WeakMap,Oe=new WeakSet,hi=function(n){xe(this,Oe,pu).call(this);let i=g(this,Ne).fetch(this.options,n);return n!=null&&n.throwOnError||(i=i.catch(wt)),i},ou=function(){xe(this,Oe,fu).call(this);const n=ar(this.options.staleTime,g(this,Ne));if(yi.isServer()||g(this,xt).isStale||!ru(n))return;const l=$h(g(this,xt).dataUpdatedAt,n)+1;K(this,Tr,_r.setTimeout(()=>{g(this,xt).isStale||this.updateResult()},l))},uu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,Ne)):this.options.refetchInterval)??!1},cu=function(n){xe(this,Oe,hu).call(this),K(this,tr,n),!(yi.isServer()||zt(this.options.enabled,g(this,Ne))===!1||!ru(g(this,tr))||g(this,tr)===0)&&K(this,Pr,_r.setInterval(()=>{(this.options.refetchIntervalInBackground||Nu.isFocused())&&xe(this,Oe,hi).call(this)},g(this,tr)))},du=function(){xe(this,Oe,ou).call(this),xe(this,Oe,cu).call(this,xe(this,Oe,uu).call(this))},fu=function(){g(this,Tr)!==void 0&&(_r.clearTimeout(g(this,Tr)),K(this,Tr,void 0))},hu=function(){g(this,Pr)!==void 0&&(_r.clearInterval(g(this,Pr)),K(this,Pr,void 0))},pu=function(){const n=g(this,Tt).getQueryCache().build(g(this,Tt),this.options);if(n===g(this,Ne))return;const i=g(this,Ne);K(this,Ne,n),K(this,_i,n.state),this.hasListeners()&&(i==null||i.removeObserver(this),n.addObserver(this))},Gh=function(n){nt.batch(()=>{n.listeners&&this.listeners.forEach(i=>{i(g(this,xt))}),g(this,Tt).getQueryCache().notify({query:g(this,Ne),type:"observerResultsUpdated"})})},Mh);function By(s,n){return zt(n.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&zt(n.retryOnMount,s)===!1)}function Xf(s,n){return By(s,n)||s.state.data!==void 0&&mu(s,n,n.refetchOnMount)}function mu(s,n,i){if(zt(n.enabled,s)!==!1&&ar(n.staleTime,s)!=="static"){const l=typeof i=="function"?i(s):i;return l==="always"||l!==!1&&Pu(s,n)}return!1}function eh(s,n,i,l){return(s!==n||zt(l.enabled,s)===!1)&&(!i.suspense||s.state.status!=="error")&&Pu(s,i)}function Pu(s,n){return zt(n.enabled,s)!==!1&&s.isStaleByTime(ar(n.staleTime,s))}function Hy(s,n){return!Ba(s.getCurrentResult(),n)}var ji,on,mt,Or,un,Zn,Ah,Ky=(Ah=class extends Kh{constructor(n){super();ae(this,un);ae(this,ji);ae(this,on);ae(this,mt);ae(this,Or);K(this,ji,n.client),this.mutationId=n.mutationId,K(this,mt,n.mutationCache),K(this,on,[]),this.state=n.state||Yh(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){g(this,on).includes(n)||(g(this,on).push(n),this.clearGcTimeout(),g(this,mt).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){K(this,on,g(this,on).filter(i=>i!==n)),this.scheduleGc(),g(this,mt).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){g(this,on).length||(this.state.status==="pending"?this.scheduleGc():g(this,mt).remove(this))}continue(){var n;return((n=g(this,Or))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var p,m,w,S,C,E,I,z,V,D,P,T,Y,A,F,Q,ue,he;const i=()=>{xe(this,un,Zn).call(this,{type:"continue"})},l={client:g(this,ji),meta:this.options.meta,mutationKey:this.options.mutationKey};K(this,Or,Hh({fn:()=>this.options.mutationFn?this.options.mutationFn(n,l):Promise.reject(new Error("No mutationFn found")),onFail:(oe,U)=>{xe(this,un,Zn).call(this,{type:"failed",failureCount:oe,error:U})},onPause:()=>{xe(this,un,Zn).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,mt).canRun(this)}));const c=this.state.status==="pending",f=!g(this,Or).canStart();try{if(c)i();else{xe(this,un,Zn).call(this,{type:"pending",variables:n,isPaused:f}),g(this,mt).config.onMutate&&await g(this,mt).config.onMutate(n,this,l);const U=await((m=(p=this.options).onMutate)==null?void 0:m.call(p,n,l));U!==this.state.context&&xe(this,un,Zn).call(this,{type:"pending",context:U,variables:n,isPaused:f})}const oe=await g(this,Or).start();return await((S=(w=g(this,mt).config).onSuccess)==null?void 0:S.call(w,oe,n,this.state.context,this,l)),await((E=(C=this.options).onSuccess)==null?void 0:E.call(C,oe,n,this.state.context,l)),await((z=(I=g(this,mt).config).onSettled)==null?void 0:z.call(I,oe,null,this.state.variables,this.state.context,this,l)),await((D=(V=this.options).onSettled)==null?void 0:D.call(V,oe,null,n,this.state.context,l)),xe(this,un,Zn).call(this,{type:"success",data:oe}),oe}catch(oe){try{await((T=(P=g(this,mt).config).onError)==null?void 0:T.call(P,oe,n,this.state.context,this,l))}catch(U){Promise.reject(U)}try{await((A=(Y=this.options).onError)==null?void 0:A.call(Y,oe,n,this.state.context,l))}catch(U){Promise.reject(U)}try{await((Q=(F=g(this,mt).config).onSettled)==null?void 0:Q.call(F,void 0,oe,this.state.variables,this.state.context,this,l))}catch(U){Promise.reject(U)}try{await((he=(ue=this.options).onSettled)==null?void 0:he.call(ue,void 0,oe,n,this.state.context,l))}catch(U){Promise.reject(U)}throw xe(this,un,Zn).call(this,{type:"error",error:oe}),oe}finally{g(this,mt).runNext(this)}}},ji=new WeakMap,on=new WeakMap,mt=new WeakMap,Or=new WeakMap,un=new WeakSet,Zn=function(n){const i=l=>{switch(n.type){case"failed":return{...l,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...l,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:n.error,failureCount:l.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),nt.batch(()=>{g(this,on).forEach(l=>{l.onMutationUpdate(n)}),g(this,mt).notify({mutation:this,type:"updated",action:n})})},Ah);function Yh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sn,en,Ei,Fh,Wy=(Fh=class extends Es{constructor(n={}){super();ae(this,Sn);ae(this,en);ae(this,Ei);this.config=n,K(this,Sn,new Set),K(this,en,new Map),K(this,Ei,0)}build(n,i,l){const c=new Ky({client:n,mutationCache:this,mutationId:++Fa(this,Ei)._,options:n.defaultMutationOptions(i),state:l});return this.add(c),c}add(n){g(this,Sn).add(n);const i=Da(n);if(typeof i=="string"){const l=g(this,en).get(i);l?l.push(n):g(this,en).set(i,[n])}this.notify({type:"added",mutation:n})}remove(n){if(g(this,Sn).delete(n)){const i=Da(n);if(typeof i=="string"){const l=g(this,en).get(i);if(l)if(l.length>1){const c=l.indexOf(n);c!==-1&&l.splice(c,1)}else l[0]===n&&g(this,en).delete(i)}}this.notify({type:"removed",mutation:n})}canRun(n){const i=Da(n);if(typeof i=="string"){const l=g(this,en).get(i),c=l==null?void 0:l.find(f=>f.state.status==="pending");return!c||c===n}else return!0}runNext(n){var l;const i=Da(n);if(typeof i=="string"){const c=(l=g(this,en).get(i))==null?void 0:l.find(f=>f!==n&&f.state.isPaused);return(c==null?void 0:c.continue())??Promise.resolve()}else return Promise.resolve()}clear(){nt.batch(()=>{g(this,Sn).forEach(n=>{this.notify({type:"removed",mutation:n})}),g(this,Sn).clear(),g(this,en).clear()})}getAll(){return Array.from(g(this,Sn))}find(n){const i={exact:!0,...n};return this.getAll().find(l=>Kf(i,l))}findAll(n={}){return this.getAll().filter(i=>Kf(n,i))}notify(n){nt.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return nt.batch(()=>Promise.all(n.map(i=>i.continue().catch(wt))))}},Sn=new WeakMap,en=new WeakMap,Ei=new WeakMap,Fh);function Da(s){var n;return(n=s.options.scope)==null?void 0:n.id}var jn,nr,Pt,En,bn,Va,yu,zh,Zy=(zh=class extends Es{constructor(i,l){super();ae(this,bn);ae(this,jn);ae(this,nr);ae(this,Pt);ae(this,En);K(this,jn,i),this.setOptions(l),this.bindMethods(),xe(this,bn,Va).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var c;const l=this.options;this.options=g(this,jn).defaultMutationOptions(i),Ba(this.options,l)||g(this,jn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:g(this,Pt),observer:this}),l!=null&&l.mutationKey&&this.options.mutationKey&&Ir(l.mutationKey)!==Ir(this.options.mutationKey)?this.reset():((c=g(this,Pt))==null?void 0:c.state.status)==="pending"&&g(this,Pt).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=g(this,Pt))==null||i.removeObserver(this)}onMutationUpdate(i){xe(this,bn,Va).call(this),xe(this,bn,yu).call(this,i)}getCurrentResult(){return g(this,nr)}reset(){var i;(i=g(this,Pt))==null||i.removeObserver(this),K(this,Pt,void 0),xe(this,bn,Va).call(this),xe(this,bn,yu).call(this)}mutate(i,l){var c;return K(this,En,l),(c=g(this,Pt))==null||c.removeObserver(this),K(this,Pt,g(this,jn).getMutationCache().build(g(this,jn),this.options)),g(this,Pt).addObserver(this),g(this,Pt).execute(i)}},jn=new WeakMap,nr=new WeakMap,Pt=new WeakMap,En=new WeakMap,bn=new WeakSet,Va=function(){var l;const i=((l=g(this,Pt))==null?void 0:l.state)??Yh();K(this,nr,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},yu=function(i){nt.batch(()=>{var l,c,f,p,m,w,S,C;if(g(this,En)&&this.hasListeners()){const E=g(this,nr).variables,I=g(this,nr).context,z={client:g(this,jn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(c=(l=g(this,En)).onSuccess)==null||c.call(l,i.data,E,I,z)}catch(V){Promise.reject(V)}try{(p=(f=g(this,En)).onSettled)==null||p.call(f,i.data,null,E,I,z)}catch(V){Promise.reject(V)}}else if((i==null?void 0:i.type)==="error"){try{(w=(m=g(this,En)).onError)==null||w.call(m,i.error,E,I,z)}catch(V){Promise.reject(V)}try{(C=(S=g(this,En)).onSettled)==null||C.call(S,void 0,i.error,E,I,z)}catch(V){Promise.reject(V)}}}this.listeners.forEach(E=>{E(g(this,nr))})})},zh),cn,Dh,Gy=(Dh=class extends Es{constructor(n={}){super();ae(this,cn);this.config=n,K(this,cn,new Map)}build(n,i,l){const c=i.queryKey,f=i.queryHash??bu(c,i);let p=this.get(f);return p||(p=new Vy({client:n,queryKey:c,queryHash:f,options:n.defaultQueryOptions(i),state:l,defaultOptions:n.getQueryDefaults(c)}),this.add(p)),p}add(n){g(this,cn).has(n.queryHash)||(g(this,cn).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const i=g(this,cn).get(n.queryHash);i&&(n.destroy(),i===n&&g(this,cn).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){nt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return g(this,cn).get(n)}getAll(){return[...g(this,cn).values()]}find(n){const i={exact:!0,...n};return this.getAll().find(l=>Hf(i,l))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(l=>Hf(n,l)):i}notify(n){nt.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){nt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){nt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},cn=new WeakMap,Dh),Ze,rr,sr,gs,xs,ir,ws,ks,Uh,Yy=(Uh=class{constructor(s={}){ae(this,Ze);ae(this,rr);ae(this,sr);ae(this,gs);ae(this,xs);ae(this,ir);ae(this,ws);ae(this,ks);K(this,Ze,s.queryCache||new Gy),K(this,rr,s.mutationCache||new Wy),K(this,sr,s.defaultOptions||{}),K(this,gs,new Map),K(this,xs,new Map),K(this,ir,0)}mount(){Fa(this,ir)._++,g(this,ir)===1&&(K(this,ws,Nu.subscribe(async s=>{s&&(await this.resumePausedMutations(),g(this,Ze).onFocus())})),K(this,ks,Ha.subscribe(async s=>{s&&(await this.resumePausedMutations(),g(this,Ze).onOnline())})))}unmount(){var s,n;Fa(this,ir)._--,g(this,ir)===0&&((s=g(this,ws))==null||s.call(this),K(this,ws,void 0),(n=g(this,ks))==null||n.call(this),K(this,ks,void 0))}isFetching(s){return g(this,Ze).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return g(this,rr).findAll({...s,status:"pending"}).length}getQueryData(s){var i;const n=this.defaultQueryOptions({queryKey:s});return(i=g(this,Ze).get(n.queryHash))==null?void 0:i.state.data}ensureQueryData(s){const n=this.defaultQueryOptions(s),i=g(this,Ze).build(this,n),l=i.state.data;return l===void 0?this.fetchQuery(s):(s.revalidateIfStale&&i.isStaleByTime(ar(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(l))}getQueriesData(s){return g(this,Ze).findAll(s).map(({queryKey:n,state:i})=>{const l=i.data;return[n,l]})}setQueryData(s,n,i){const l=this.defaultQueryOptions({queryKey:s}),c=g(this,Ze).get(l.queryHash),f=c==null?void 0:c.state.data,p=Py(n,f);if(p!==void 0)return g(this,Ze).build(this,l).setData(p,{...i,manual:!0})}setQueriesData(s,n,i){return nt.batch(()=>g(this,Ze).findAll(s).map(({queryKey:l})=>[l,this.setQueryData(l,n,i)]))}getQueryState(s){var i;const n=this.defaultQueryOptions({queryKey:s});return(i=g(this,Ze).get(n.queryHash))==null?void 0:i.state}removeQueries(s){const n=g(this,Ze);nt.batch(()=>{n.findAll(s).forEach(i=>{n.remove(i)})})}resetQueries(s,n){const i=g(this,Ze);return nt.batch(()=>(i.findAll(s).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...s},n)))}cancelQueries(s,n={}){const i={revert:!0,...n},l=nt.batch(()=>g(this,Ze).findAll(s).map(c=>c.cancel(i)));return Promise.all(l).then(wt).catch(wt)}invalidateQueries(s,n={}){return nt.batch(()=>(g(this,Ze).findAll(s).forEach(i=>{i.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},n)))}refetchQueries(s,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},l=nt.batch(()=>g(this,Ze).findAll(s).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,i);return i.throwOnError||(f=f.catch(wt)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(l).then(wt)}fetchQuery(s){const n=this.defaultQueryOptions(s);n.retry===void 0&&(n.retry=!1);const i=g(this,Ze).build(this,n);return i.isStaleByTime(ar(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(wt).catch(wt)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(wt).catch(wt)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return Ha.isOnline()?g(this,rr).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,Ze)}getMutationCache(){return g(this,rr)}getDefaultOptions(){return g(this,sr)}setDefaultOptions(s){K(this,sr,s)}setQueryDefaults(s,n){g(this,gs).set(Ir(s),{queryKey:s,defaultOptions:n})}getQueryDefaults(s){const n=[...g(this,gs).values()],i={};return n.forEach(l=>{mi(s,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(s,n){g(this,xs).set(Ir(s),{mutationKey:s,defaultOptions:n})}getMutationDefaults(s){const n=[...g(this,xs).values()],i={};return n.forEach(l=>{mi(s,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(s){if(s._defaulted)return s;const n={...g(this,sr).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return n.queryHash||(n.queryHash=bu(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Ru&&(n.enabled=!1),n}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...g(this,sr).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){g(this,Ze).clear(),g(this,rr).clear()}},Ze=new WeakMap,rr=new WeakMap,sr=new WeakMap,gs=new WeakMap,xs=new WeakMap,ir=new WeakMap,ws=new WeakMap,ks=new WeakMap,Uh),b=Eu(),Jh=b.createContext(void 0),Ou=s=>{const n=b.useContext(Jh);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},Jy=({client:s,children:n})=>(b.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),u.jsx(Jh.Provider,{value:s,children:n})),Xh=b.createContext(!1),Xy=()=>b.useContext(Xh);Xh.Provider;function ev(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var tv=b.createContext(ev()),nv=()=>b.useContext(tv),rv=(s,n,i)=>{const l=i!=null&&i.state.error&&typeof s.throwOnError=="function"?Tu(s.throwOnError,[i.state.error,i]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||l)&&(n.isReset()||(s.retryOnMount=!1))},sv=s=>{b.useEffect(()=>{s.clearReset()},[s])},iv=({result:s,errorResetBoundary:n,throwOnError:i,query:l,suspense:c})=>s.isError&&!n.isReset()&&!s.isFetching&&l&&(c&&s.data===void 0||Tu(i,[s.error,l])),av=s=>{if(s.suspense){const i=c=>c==="static"?c:Math.max(c??1e3,1e3),l=s.staleTime;s.staleTime=typeof l=="function"?(...c)=>i(l(...c)):i(l),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},lv=(s,n)=>s.isLoading&&s.isFetching&&!n,ov=(s,n)=>(s==null?void 0:s.suspense)&&n.isPending,th=(s,n,i)=>n.fetchOptimistic(s).catch(()=>{i.clearReset()});function uv(s,n,i){var z,V,D,P;const l=Xy(),c=nv(),f=Ou(),p=f.defaultQueryOptions(s);(V=(z=f.getDefaultOptions().queries)==null?void 0:z._experimental_beforeQuery)==null||V.call(z,p);const m=f.getQueryCache().get(p.queryHash),w=s.subscribed!==!1;p._optimisticResults=l?"isRestoring":w?"optimistic":void 0,av(p),rv(p,c,m),sv(c);const S=!f.getQueryCache().get(p.queryHash),[C]=b.useState(()=>new n(f,p)),E=C.getOptimisticResult(p),I=!l&&w;if(b.useSyncExternalStore(b.useCallback(T=>{const Y=I?C.subscribe(nt.batchCalls(T)):wt;return C.updateResult(),Y},[C,I]),()=>C.getCurrentResult(),()=>C.getCurrentResult()),b.useEffect(()=>{C.setOptions(p)},[p,C]),ov(p,E))throw th(p,C,c);if(iv({result:E,errorResetBoundary:c,throwOnError:p.throwOnError,query:m,suspense:p.suspense}))throw E.error;if((P=(D=f.getDefaultOptions().queries)==null?void 0:D._experimental_afterQuery)==null||P.call(D,p,E),p.experimental_prefetchInRender&&!yi.isServer()&&lv(E,l)){const T=S?th(p,C,c):m==null?void 0:m.promise;T==null||T.catch(wt).finally(()=>{C.updateResult()})}return p.notifyOnChangeProps?E:C.trackResult(E)}function rt(s,n){return uv(s,Qy)}function ct(s,n){const i=Ou(),[l]=b.useState(()=>new Zy(i,s));b.useEffect(()=>{l.setOptions(s)},[l,s]);const c=b.useSyncExternalStore(b.useCallback(p=>l.subscribe(nt.batchCalls(p)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f=b.useCallback((p,m)=>{l.mutate(p,m).catch(wt)},[l]);if(c.error&&Tu(l.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:f,mutateAsync:c.mutate}}/**
41
+ * @license lucide-react v0.468.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const cv=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ep=(...s)=>s.filter((n,i,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===i).join(" ").trim();/**
46
+ * @license lucide-react v0.468.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */var dv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51
+ * @license lucide-react v0.468.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const fv=b.forwardRef(({color:s="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:c="",children:f,iconNode:p,...m},w)=>b.createElement("svg",{ref:w,...dv,width:n,height:n,stroke:s,strokeWidth:l?Number(i)*24/Number(n):i,className:ep("lucide",c),...m},[...p.map(([S,C])=>b.createElement(S,C)),...Array.isArray(f)?f:[f]]));/**
56
+ * @license lucide-react v0.468.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const Ae=(s,n)=>{const i=b.forwardRef(({className:l,...c},f)=>b.createElement(fv,{ref:f,iconNode:n,className:ep(`lucide-${cv(s)}`,l),...c}));return i.displayName=`${s}`,i};/**
61
+ * @license lucide-react v0.468.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const tp=Ae("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
66
+ * @license lucide-react v0.468.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const hv=Ae("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]]);/**
71
+ * @license lucide-react v0.468.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const pv=Ae("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
76
+ * @license lucide-react v0.468.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const mv=Ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
81
+ * @license lucide-react v0.468.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const yv=Ae("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
86
+ * @license lucide-react v0.468.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const np=Ae("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
91
+ * @license lucide-react v0.468.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Iu=Ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
96
+ * @license lucide-react v0.468.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const vv=Ae("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
101
+ * @license lucide-react v0.468.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const gv=Ae("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
106
+ * @license lucide-react v0.468.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const nh=Ae("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
111
+ * @license lucide-react v0.468.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const xv=Ae("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
116
+ * @license lucide-react v0.468.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Lu=Ae("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
121
+ * @license lucide-react v0.468.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const wv=Ae("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
126
+ * @license lucide-react v0.468.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Qa=Ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
131
+ * @license lucide-react v0.468.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const kv=Ae("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
136
+ * @license lucide-react v0.468.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const rp=Ae("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
141
+ * @license lucide-react v0.468.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Cv=Ae("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
146
+ * @license lucide-react v0.468.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const _v=Ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
151
+ * @license lucide-react v0.468.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const Mu=Ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
156
+ * @license lucide-react v0.468.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const sp=Ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
161
+ * @license lucide-react v0.468.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const Sv=Ae("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
166
+ * @license lucide-react v0.468.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const jv=Ae("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
171
+ * @license lucide-react v0.468.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const Ev=Ae("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
176
+ * @license lucide-react v0.468.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const Nv=Ae("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
181
+ * @license lucide-react v0.468.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const bv=Ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
186
+ * @license lucide-react v0.468.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const Rv=Ae("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
191
+ * @license lucide-react v0.468.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const ip=Ae("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
196
+ * @license lucide-react v0.468.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Ka=Ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
201
+ * @license lucide-react v0.468.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const ap=Ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Au="asq_gateway_csrf";let lp="token";class or extends Error{constructor(n,i,l){super(l),this.status=n,this.code=i,this.name="GatewayHttpError"}static async from(n){var l,c;let i={};try{i=await n.json()}catch{}return new or(n.status,((l=i.error)==null?void 0:l.code)??"gateway_request_failed",((c=i.error)==null?void 0:c.message)??`Gateway request failed (${n.status})`)}static csrfRequired(){return new or(401,"admin_csrf_required","admin CSRF token required")}}function Tv(s){window.sessionStorage.setItem(Au,s)}function rh(){window.sessionStorage.removeItem(Au)}function Pv(){const s=window.sessionStorage.getItem(Au);if(!s)throw or.csrfRequired();return s}async function Fu(s,n){const i=await fetch(s,{...n,credentials:"same-origin"});if(!i.ok)throw await or.from(i);return i.status===204?void 0:i.json()}async function pe(s,n={}){const i=new Headers(n.headers);return lp==="token"&&i.set("x-csrf-token",Pv()),Fu(s,{...n,headers:i})}async function Ov(){const s=await Fu("/admin/auth/mode",{method:"GET"});if(s.mode!=="disabled"&&s.mode!=="token")throw new Error("invalid Web UI auth mode");return lp=s.mode,s.mode}function Iv(s){return Fu("/admin/bootstrap/exchange",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:s})})}function Lv(){return pe("/admin/session/csrf",{method:"POST"})}async function Mv(){try{await pe("/admin/session/logout",{method:"POST"})}finally{window.sessionStorage.clear()}}const op="asq_gateway_language",Av={Language:"语言",Overview:"概览","API Runs":"API 运行记录","Invocation Targets":"调用目标","Clients and Keys":"客户端与密钥",Extensions:"扩展","Core Sessions":"Core 会话","Pending Core Choices":"待处理的 Core 选择","CLI Availability":"CLI 可用性",Settings:"设置","Dismiss navigation":"关闭导航遮罩","Close navigation":"关闭导航","Open navigation":"打开导航","Local admin session":"本地管理员会话","Web UI auth disabled":"Web UI 认证已关闭","End local session":"结束本地会话","Core {status}":"Core {status}",connected:"已连接",reconnecting:"正在重连",offline:"离线","Recovering local session":"正在恢复本地会话",Locked:"已锁定",Unavailable:"不可用","Checking local session":"正在检查本地会话","Local session required":"需要本地会话","Session recovery failed":"会话恢复失败",queued:"排队中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消",interrupted:"已中断",Operational:"运行正常",Degraded:"性能降级",Cancel:"取消",Close:"关闭","Submit choice":"提交选择","Submitting...":"正在提交...",Recommendation:"推荐","Select one option":"选择一个选项",Rationale:"理由",Optional:"可选","Submitting choice. Please wait.":"正在提交选择,请稍候。","Choice resolution failed.":"选择提交失败。","Raw tail: {alias}":"原始输出尾部:{alias}","Copy raw tail for {alias}":"复制 {alias} 的原始输出尾部","No raw tail available.":"没有可用的原始输出尾部。","Raw tail copy failed":"复制原始输出失败","Key {label}":"密钥 {label}","Reveal key {label}":"显示密钥 {label}","Hide key {label}":"隐藏密钥 {label}","Copy key {label}":"复制密钥 {label}","Key operation failed":"密钥操作失败","1. Core connection":"1. Core 连接","2. CLI static scan":"2. CLI 静态扫描","3. Invocation Targets":"3. 调用目标","4. Client and key":"4. 客户端与密钥","API identities, recoverable credentials, and target access":"API 身份、可恢复密钥和目标访问权限","Acknowledge workspace isolation downgrade":"确认工作区隔离级别降低",Actions:"操作","Active / Blocked":"活跃 / 阻塞","Active Runs":"活跃运行","Admin secret path":"管理员密钥路径","Admin session":"管理员会话",Age:"时长",Aliases:"别名","All clients":"所有客户端","All statuses":"所有状态","All targets":"所有目标","All time":"全部时间","Allow best-effort isolation":"允许尽力隔离",Available:"可用","Best effort":"尽力模式","Bind address":"绑定地址","CLI availability unavailable":"无法获取 CLI 可用性","Cancel API run":"取消 API 运行","Cancel run {id}":"取消运行 {id}","Cancellation failed":"取消失败",Cancelled:"已取消","Canonical ID":"规范 ID","Check Core":"检查 Core",Checking:"检查中",Client:"客户端","Client could not be created":"无法创建客户端","Client could not be deleted":"无法删除客户端","Client enabled":"启用客户端","Client name":"客户端名称","Client unavailable":"客户端不可用",Clients:"客户端","Clients unavailable":"客户端不可用","Comma separated":"以逗号分隔","Compiled Gateway protocol manifests and endpoint state":"已编译的 Gateway 协议清单和端点状态","Config path":"配置路径","Configuration changed; verify again":"配置已更改,请重新验证","Confirm cancel":"确认取消",Connection:"连接状态","Copy native session ID for {alias}":"复制 {alias} 的原生会话 ID","Core URL":"Core URL","Core URL must be a loopback HTTP URL":"Core URL 必须是回环 HTTP URL","Core connection":"Core 连接","Core is offline":"Core 离线","Core session detail":"Core 会话详情","Core session unavailable":"Core 会话不可用","Create client":"创建客户端","Create client and key":"创建客户端和密钥","Create credential":"创建凭据","Create selected targets":"创建所选目标","Create target":"创建目标","Create and verify":"创建并验证","Creating and verifying...":"正在创建并验证...","Creating and verifying target":"正在创建并验证目标","Creating this target runs bounded model requests and may consume quota.":"创建此目标会运行有限的模型请求,可能消耗配额。","Credential name":"凭据名称","Credential operation failed":"凭据操作失败",Credentials:"凭据","Custom native model":"自定义原生模型","Custom reasoning effort":"自定义推理强度","Custom {label}":"自定义{label}","Custom...":"自定义...","Database path":"数据库路径",Default:"默认","Delete client":"删除客户端","Delete client permanently":"永久删除客户端","Delete client {name}":"删除客户端 {name}","Delete target":"删除目标","Delete target {id}? Historical run metadata is retained.":"删除目标 {id}?历史运行元数据将保留。","Delete {id}":"删除 {id}","Delete {name}? Credentials and grants will be removed immediately. Historical completed runs are retained.":"删除 {name}?凭据和授权将立即移除,已完成运行的历史记录会保留。","Edit {id}":"编辑 {id}",Effort:"推理强度","Enable target":"启用目标","Enable {id}":"启用 {id}","Enable {name}":"启用 {name}",Enabled:"已启用",Endpoint:"端点","Endpoint Status":"端点状态",Error:"错误",Executable:"可执行文件","Existing keys remain revealable under Clients and Keys":"现有密钥仍可在“客户端与密钥”中查看",Expired:"已过期","Expires {date}":"过期时间:{date}","Expiry (optional)":"过期时间(可选)","Explicit decisions requested by Core subagents.":"Core 子代理明确请求的决策。",Extension:"扩展","Extension and target grants":"扩展与目标授权","Extension is disabled":"扩展已禁用","Extensions unavailable":"扩展不可用","Finish setup":"完成设置","Fixed path...":"固定路径...","Fixed workspace path":"固定工作区路径","From {source}":"来自 {source}","Gateway and Core operational state":"Gateway 与 Core 运行状态","Gateway connection and local policy":"Gateway 连接与本地策略","Gateway definitions":"Gateway 配置定义","Gateway managed":"Gateway 托管","Gateway navigation remains available while Core reconnects.":"Core 重连期间仍可使用 Gateway 导航。","Gateway provider configurations and verified capabilities":"Gateway 提供方配置和已验证能力","Gateway remains available. Retry when Core is reachable.":"Gateway 仍可用。Core 可连接后请重试。","Gateway setup":"Gateway 设置","Gateway-owned provider invocations":"由 Gateway 管理的提供方调用","Grant {extension} to {target}":"授权 {extension} 使用 {target}",Grants:"授权","Installed executables and static provider ceilings":"已安装的可执行文件和提供方静态能力上限","Invocation targets":"调用目标",Isolation:"隔离","Keep running":"保持运行","Last 24 hours":"最近 24 小时","Last 7 days":"最近 7 天","Last Scan":"上次扫描","Last Used":"上次使用","Last active":"最近活跃","Last hour":"最近一小时","Last seen":"最近出现",Latency:"延迟","Live read-only session history from Core.":"来自 Core 的实时只读会话历史。","Live status":"实时状态","Loading Core session...":"正在加载 Core 会话...","Loading Core sessions...":"正在加载 Core 会话...","Loading client":"正在加载客户端","Loading pending Core choices...":"正在加载待处理的 Core 选择...","Loading settings":"正在加载设置","Local connections, targets, and client access":"本地连接、目标和客户端访问","Master key path":"主密钥路径",Messages:"消息","Metadata retention":"元数据保留时间","Model / effort":"模型 / 推理强度",Name:"名称",Native:"原生","Native Model":"原生模型","Native model":"原生模型","Native session":"原生会话","Network policy":"网络策略",Never:"从未","No API runs":"暂无 API 运行记录","No CLI scans":"暂无 CLI 扫描记录","No active queues":"暂无活跃队列","No clients":"暂无客户端","No compiled extensions":"暂无已编译扩展","No expiry":"永不过期","No installed CLIs found":"未发现已安装的 CLI","No invocation targets":"暂无调用目标","No live Core sessions":"暂无 Core 实时会话","No message content.":"无消息内容。","No messages.":"暂无消息。","No model usage":"不消耗模型用量","No models were returned by the latest CLI scan.":"最近一次 CLI 扫描未返回模型。","No pending Core choices":"暂无待处理的 Core 选择","No repository":"无仓库","No subagents.":"暂无子代理。",None:"无",Open:"打开","Operations status":"运行状态",Pending:"待处理","Previous key revoked":"旧密钥已吊销","Provider default":"使用提供方默认值",Question:"问题",Queue:"队列","Queue pressure":"队列压力",Queued:"排队中","Read only":"只读","Reasoning effort":"推理强度","Recent API Runs":"最近 API 运行记录","Refresh CLI availability":"刷新 CLI 可用性","Replay TTL":"重放 TTL",Repository:"仓库","Required Gateway":"Gateway 版本要求",Resolve:"处理","Resolve {question}":"处理:{question}",Resolved:"已解决","Retry Core":"重试 Core","Revoke credential":"吊销凭据","Revoke key {name}":"吊销密钥 {name}","Revoke {name}? Requests using this key will fail immediately.":"吊销 {name}?使用此密钥的请求将立即失败。",Revoked:"已吊销","Rotate and revoke":"轮换并吊销旧凭据","Rotate credential":"轮换凭据","Rotate key {name}":"轮换密钥 {name}",Run:"运行","Run filters":"运行筛选",Running:"运行中","Running provider conformance checks. This can take several minutes.":"正在运行提供方一致性检查,可能需要几分钟。","Save Core URL":"保存 Core URL","Save target":"保存目标","Select {id}":"选择 {id}",Selection:"选择结果","Session ID copy failed":"会话 ID 复制失败","Session task":"会话任务","Settings unavailable":"设置不可用","Skip Core":"跳过 Core",Started:"开始时间","Static / Verified":"静态 / 已验证","Static Ceiling":"静态能力上限",Status:"状态",Streaming:"流式输出",Strict:"严格","Structured output":"结构化输出",Subagent:"子代理",Subagents:"子代理",Supported:"支持",Target:"目标","Target could not be saved.":"无法保存目标。","Target could not be created or verified.":"无法创建或验证目标。","Target is disabled":"目标已禁用","Target is disabled and unverified":"目标已禁用且未验证","Target is unverified":"目标未验证","Targets unavailable":"调用目标不可用",Task:"任务","This CLI was not found by the latest scan.":"最近一次扫描未找到此 CLI。","This runs bounded model requests and may consume quota. Verification applies to this target's model and execution settings.":"此操作会运行有限的模型请求,可能消耗配额。验证仅适用于该目标的模型和执行设置。","This target provides best-effort rather than strict workspace isolation.":"此目标提供尽力隔离,而非严格工作区隔离。","Time range":"时间范围","Tool mode":"工具模式",Tools:"工具",Unsupported:"不支持",Unverified:"未验证",Updated:"更新时间","Use lowercase letters, numbers, dots, underscores, or hyphens; aliases must be unique.":"请使用小写字母、数字、点、下划线或连字符;别名必须唯一。","Verification Count":"验证次数","Verification failed":"验证失败","Verification failed for":"验证失败:","Verification in progress":"正在验证","Verification required":"需要验证","Verified Targets":"已验证目标","Verify target":"验证目标","Verifying target":"正在验证目标",Version:"版本","Version mismatch":"版本不匹配","View all":"查看全部","View raw tail for {alias}":"查看 {alias} 的原始输出尾部","Web UI authentication":"Web UI 认证",Workspace:"工作区","best effort":"尽力模式","capability checked":"能力已检查","no streaming":"无流式输出","no tools":"无工具调用","queued and running":"排队中和运行中",streaming:"流式输出","strict isolation":"严格隔离",system:"系统",tools:"工具调用",unknown:"未知","{action} {id}":"{action} {id}","{count} assigned":"已分配 {count} 个","{count} created":"已创建 {count} 个","{count} days":"{count} 天","{count} extensions":"{count} 个扩展","{count} minutes":"{count} 分钟","{count} pending":"{count} 个待处理","{count} queued":"{count} 个排队中","{count} runs":"{count} 次运行","{count} sessions":"{count} 个会话","{count} verified":"已验证 {count} 次",Complete:"已完成",Required:"必填","Refresh CLIs":"刷新 CLI","Scan CLIs":"扫描 CLI","No target suggestions":"暂无目标建议","Scan CLIs to load suggestions":"扫描 CLI 以加载建议","Core is online":"Core 在线","Core is offline; setup can continue":"Core 离线;可以继续设置","Edit target":"编辑目标",Verifying:"正在验证",Verify:"验证","Verifying...":"正在验证...",Hide:"隐藏","Select a native model or enter a custom model.":"请选择原生模型或输入自定义模型。","Enter a canonical ID using lowercase letters, numbers, dots, underscores, or hyphens.":"请输入仅包含小写字母、数字、点、下划线或连字符的规范 ID。","Aliases must be unique and different from the canonical ID.":"别名必须唯一,且不能与规范 ID 相同。","Enter a custom reasoning effort or select Provider default.":"请输入自定义推理强度,或选择提供方默认值。","Max concurrency must be a positive whole number.":"最大并发数必须是正整数。","Max queue must be zero or a positive whole number.":"最大队列数必须是零或正整数。","Queue timeout must be a positive whole number of milliseconds.":"队列超时必须是以毫秒为单位的正整数。","Run timeout must be blank or a positive whole number of milliseconds.":"运行超时必须留空,或填写以毫秒为单位的正整数。","Enter an absolute fixed workspace path.":"请输入固定工作区的绝对路径。","Acknowledge the fixed-workspace isolation downgrade.":"请确认固定工作区会降低隔离级别。","Max concurrency":"最大并发数","Max queue":"最大队列数","Queue timeout":"队列超时","Run timeout":"运行超时","1 request":"1 个请求","2 requests":"2 个请求","4 requests":"4 个请求","8 requests":"8 个请求","16 requests":"16 个请求","32 requests":"32 个请求","No queue":"无队列","30 seconds":"30 秒","1 minute":"1 分钟","5 minutes":"5 分钟","10 minutes":"10 分钟","20 minutes":"20 分钟","1 hour":"1 小时","No timeout":"无超时",active:"活跃",disabled:"已禁用",starting:"启动中",ready:"就绪",native_cli_blocked:"原生 CLI 阻塞",online:"在线",degraded:"性能降级","This choice was already resolved. Pending choices were refreshed.":"此选择已被处理,待处理列表已刷新。"},up=b.createContext(null);function Fv(){try{const s=window.localStorage.getItem(op);if(s==="en"||s==="zh-CN")return s}catch{}return navigator.languages.some(s=>s.toLowerCase().startsWith("zh"))?"zh-CN":"en"}function zv(s,n){return n?s.replace(/\{([a-zA-Z0-9_]+)\}/g,(i,l)=>Object.hasOwn(n,l)?String(n[l]):i):s}function Dv({children:s}){const[n,i]=b.useState(Fv),l=b.useCallback(p=>{i(p);try{window.localStorage.setItem(op,p)}catch{}},[]);b.useEffect(()=>{document.documentElement.lang=n},[n]);const c=b.useCallback((p,m)=>{const w=n==="zh-CN"?Av[p]??p:p;return zv(w,m)},[n]),f=b.useMemo(()=>({language:n,locale:n==="zh-CN"?"zh-CN":"en-US",setLanguage:l,t:c}),[n,l,c]);return u.jsx(up.Provider,{value:f,children:s})}function Fe(){const s=b.useContext(up);if(!s)throw new Error("i18n_provider_missing");return s}function Uv(){const{t:s}=Fe();return u.jsx("main",{className:"session-state",children:u.jsxs("section",{className:"session-state__panel","aria-labelledby":"gateway-error-title",children:[u.jsx("div",{className:"gateway-mark","aria-hidden":"true",children:"G"}),u.jsx("h1",{id:"gateway-error-title",children:"Gateway"}),u.jsx("p",{role:"status",children:s("Unavailable")}),u.jsx("button",{type:"button",disabled:!0,children:s("Session recovery failed")})]})})}class qv extends b.Component{constructor(){super(...arguments);Af(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(i,l){}render(){return this.state.failed?u.jsx(Uv,{}):this.props.children}}function cp({title:s,detail:n}){return u.jsxs("div",{className:"empty-state",role:"status",children:[u.jsx("strong",{children:s}),n?u.jsx("span",{children:n}):null]})}const $v={queued:"warning",running:"accent",completed:"success",failed:"danger",cancelled:"muted",interrupted:"warning"};function Vv({status:s}){const{t:n}=Fe();return u.jsx("span",{className:`semantic-status semantic-status--${$v[s]}`,children:n(s)})}function sh({ok:s,degraded:n=!1}){const{t:i}=Fe(),l=s?"success":n?"warning":"danger",c=s?"Operational":n?"Degraded":"Unavailable";return u.jsx("span",{className:`semantic-status semantic-status--${l}`,children:i(c)})}var dp=qh();const yt=new Yy({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}}),we=b.forwardRef(function({className:n="",variant:i="default",...l},c){return u.jsx("button",{ref:c,className:`button button--${i} ${n}`.trim(),...l})}),kt=b.forwardRef(function({label:n,className:i="",...l},c){const{children:f,...p}=l;return u.jsx(we,{className:`icon-button ${i}`.trim(),"aria-label":n,title:n,ref:c,...p,children:f})});function Ar({ariaLabel:s,columns:n,rows:i,rowKey:l,emptyTitle:c}){return u.jsx("div",{className:"data-table-wrap",children:u.jsxs("table",{className:"data-table","aria-label":s,children:[u.jsx("colgroup",{children:n.map(f=>u.jsx("col",{style:{width:f.width}},f.key))}),u.jsx("thead",{children:u.jsx("tr",{children:n.map(f=>u.jsx("th",{scope:"col",children:f.label},f.key))})}),u.jsx("tbody",{children:i.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:n.length,children:u.jsx(cp,{title:c})})}):i.map(f=>u.jsx("tr",{children:n.map(p=>u.jsx("td",{className:p.className,children:p.render(f)},p.key))},l(f)))})]})})}const Qv=["a[href]","button:not([disabled])","select:not([disabled])","input:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function zu(s,n,i,l){b.useEffect(()=>{if(!s||!n.current)return;const c=n.current,f=document.activeElement instanceof HTMLElement?document.activeElement:null,p=()=>[...c.querySelectorAll(Qv)].filter(w=>!w.hasAttribute("disabled"));((l==null?void 0:l.current)??p()[0]??c).focus();const m=w=>{if(w.key==="Escape"){w.preventDefault(),i();return}if(w.key!=="Tab")return;const S=p();if(S.length===0){w.preventDefault(),c.focus();return}const C=S[0],E=S[S.length-1];w.shiftKey&&(document.activeElement===C||document.activeElement===c)?(w.preventDefault(),E.focus()):!w.shiftKey&&document.activeElement===E&&(w.preventDefault(),C.focus())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),f==null||f.focus()}},[s,n,l,i])}const Bv={status:"",targetId:"",clientId:"",timeRange:"all"};function Hv(s){const n=new URLSearchParams({limit:"100"});return s.status&&n.set("status",s.status),s.targetId&&n.set("target_id",s.targetId),s.clientId&&n.set("client_id",s.clientId),`/admin/runs?${n.toString()}`}function Kv(s,n){if(!s)return"-";const i=new Date(s);return Number.isNaN(i.getTime())?s:new Intl.DateTimeFormat(n,{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(i)}function Wv(s){return s===null?"-":s<1e3?`${s} ms`:`${(s/1e3).toFixed(2)} s`}function Zv(s,n,i){return[{key:"started",label:s("Started"),width:"162px",className:"numeric",render:l=>u.jsx("time",{dateTime:l.startedAt??l.queuedAt,children:Kv(l.startedAt??l.queuedAt,n)})},{key:"client",label:s("Client"),width:"118px",render:l=>l.clientId??s("system")},{key:"extension",label:s("Extension"),width:"98px",render:l=>l.extensionId},{key:"endpoint",label:s("Endpoint"),width:"176px",className:"code-cell",render:l=>l.endpoint},{key:"target",label:s("Target"),width:"132px",render:l=>l.targetId},{key:"status",label:s("Status"),width:"92px",render:l=>u.jsx(Vv,{status:l.status})},{key:"latency",label:s("Latency"),width:"82px",className:"numeric",render:l=>Wv(l.latencyMs)},{key:"error",label:s("Error"),width:"144px",className:"code-cell",render:l=>l.errorCode??"-"},{key:"actions",label:s("Actions"),width:"72px",className:"actions-cell",render:l=>i&&(l.status==="queued"||l.status==="running")?u.jsx(kt,{label:s("Cancel run {id}",{id:l.id}),variant:"quiet",onClick:()=>i(l),children:u.jsx(np,{size:16,"aria-hidden":"true"})}):"-"}]}function fp({runs:s,onCancel:n}){const{locale:i,t:l}=Fe();return u.jsx(Ar,{ariaLabel:l("API Runs"),columns:Zv(l,i,n),rows:s,rowKey:c=>c.id,emptyTitle:l("No API runs")})}function Gv(s,n){if(n==="all")return!0;const i=n==="1h"?36e5:n==="24h"?864e5:6048e5;return Date.now()-Date.parse(s.queuedAt)<=i}function Yv(){var P;const{t:s}=Fe(),[n,i]=b.useState(Bv),[l,c]=b.useState(null),[f,p]=b.useState([]),m=b.useRef(null),w=b.useRef(null),S=b.useCallback(()=>c(null),[]),C=rt({queryKey:["runs","list",n.status,n.targetId,n.clientId],queryFn:()=>pe(Hv(n))});b.useEffect(()=>{C.data&&p(T=>{const Y=new Map(T.map(A=>[A.id,A]));return C.data.runs.forEach(A=>Y.set(A.id,A)),[...Y.values()]})},[C.data]);const E=b.useMemo(()=>[...new Set(f.map(T=>T.targetId))].sort(),[f]),I=b.useMemo(()=>[...new Set(f.flatMap(T=>T.clientId?[T.clientId]:[]))].sort(),[f]),z=(((P=C.data)==null?void 0:P.runs)??[]).filter(T=>Gv(T,n.timeRange));b.useEffect(()=>{const T=document.querySelector(".app-shell");if(T)return l?T.setAttribute("inert",""):T.removeAttribute("inert"),()=>T.removeAttribute("inert")},[l]),zu(l!==null,m,S,w);const V=ct({mutationFn:T=>pe(`/admin/runs/${encodeURIComponent(T)}/cancel`,{method:"POST"}),onSuccess:async()=>{c(null),await yt.invalidateQueries({queryKey:["runs"]})}}),D=(T,Y)=>{i(A=>({...A,[T]:Y}))};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:s("API Runs")}),u.jsx("p",{children:s("Gateway-owned provider invocations")})]}),u.jsx("span",{className:"record-count",children:s("{count} runs",{count:z.length})})]}),u.jsxs("section",{className:"filter-bar","aria-label":s("Run filters"),children:[u.jsxs("label",{children:[s("Status"),u.jsxs("select",{value:n.status,onChange:T=>D("status",T.target.value),children:[u.jsx("option",{value:"",children:s("All statuses")}),["queued","running","completed","failed","cancelled","interrupted"].map(T=>u.jsx("option",{value:T,children:s(T)},T))]})]}),u.jsxs("label",{children:[s("Target"),u.jsxs("select",{value:n.targetId,onChange:T=>D("targetId",T.target.value),children:[u.jsx("option",{value:"",children:s("All targets")}),E.map(T=>u.jsx("option",{value:T,children:T},T))]})]}),u.jsxs("label",{children:[s("Client"),u.jsxs("select",{value:n.clientId,onChange:T=>D("clientId",T.target.value),children:[u.jsx("option",{value:"",children:s("All clients")}),I.map(T=>u.jsx("option",{value:T,children:T},T))]})]}),u.jsxs("label",{children:[s("Time range"),u.jsxs("select",{value:n.timeRange,onChange:T=>D("timeRange",T.target.value),children:[u.jsx("option",{value:"1h",children:s("Last hour")}),u.jsx("option",{value:"24h",children:s("Last 24 hours")}),u.jsx("option",{value:"7d",children:s("Last 7 days")}),u.jsx("option",{value:"all",children:s("All time")})]})]})]}),u.jsxs("section",{className:"table-section","aria-labelledby":"runs-table-title",children:[u.jsx("h2",{id:"runs-table-title",className:"visually-hidden",children:s("API Runs")}),u.jsx(fp,{runs:z,onCancel:c})]}),l?dp.createPortal(u.jsx("div",{className:"dialog-layer",children:u.jsxs("div",{ref:m,className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cancel-run-title",tabIndex:-1,children:[u.jsx("h2",{id:"cancel-run-title",children:s("Cancel API run")}),u.jsxs("dl",{className:"dialog-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:s("Run")}),u.jsx("dd",{children:l.id})]}),u.jsxs("div",{children:[u.jsx("dt",{children:s("Target")}),u.jsx("dd",{children:l.targetId})]})]}),V.isError?u.jsx("p",{className:"dialog-error",children:s("Cancellation failed")}):null,u.jsxs("div",{className:"dialog-actions",children:[u.jsx(we,{ref:w,variant:"quiet",onClick:S,children:s("Keep running")}),u.jsxs(we,{variant:"danger",disabled:V.isPending,onClick:()=>V.mutate(l.id),children:[u.jsx(np,{size:16,"aria-hidden":"true"}),s("Confirm cancel")]})]})]})}),document.body):null]})}function Jv(){var p,m,w,S,C,E,I,z,V,D;const{t:s}=Fe(),n=rt({queryKey:["gateway-health"],queryFn:()=>pe("/health")}),i=rt({queryKey:["core-health"],queryFn:()=>pe("/admin/core/health")}),l=rt({queryKey:["runs","overview"],queryFn:()=>pe("/admin/runs/overview")}),c=((p=l.data)==null?void 0:p.runs)??[],f=((m=l.data)==null?void 0:m.queuePressure)??[];return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:s("Overview")}),u.jsx("p",{children:s("Gateway and Core operational state")})]}),u.jsx("span",{className:"record-count",children:s("Live status")})]}),u.jsxs("section",{className:"metric-band","aria-label":s("Operations status"),children:[u.jsxs("div",{className:"metric-cell",children:[u.jsx("span",{children:"Gateway"}),u.jsx("strong",{children:u.jsx(sh,{ok:((w=n.data)==null?void 0:w.ok)===!0})}),u.jsx("small",{children:((S=n.data)==null?void 0:S.version)??s("Checking")})]}),u.jsxs("div",{className:"metric-cell",children:[u.jsx("span",{children:"Core"}),u.jsx("strong",{children:u.jsx(sh,{ok:((C=i.data)==null?void 0:C.ok)===!0,degraded:((I=(E=i.data)==null?void 0:E.connection)==null?void 0:I.status)==="degraded"||i.isError})}),u.jsx("small",{children:((z=i.data)==null?void 0:z.version)??s("Connection")})]}),u.jsxs("div",{className:"metric-cell",children:[u.jsx("span",{children:s("Active Runs")}),u.jsx("strong",{className:"metric-value",children:((V=l.data)==null?void 0:V.activeRunCount)??0}),u.jsx("small",{children:s("queued and running")})]}),u.jsxs("div",{className:"metric-cell",children:[u.jsx("span",{children:s("Verified Targets")}),u.jsx("strong",{className:"metric-value",children:((D=l.data)==null?void 0:D.verifiedTargetCount)??0}),u.jsx("small",{children:s("capability checked")})]})]}),u.jsxs("section",{className:"operations-section","aria-label":s("Queue pressure"),children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{children:s("Queue pressure")}),u.jsx("span",{children:s("{count} queued",{count:f.reduce((P,T)=>P+T.queued,0)})})]}),f.length===0?u.jsx(cp,{title:s("No active queues")}):u.jsxs("div",{className:"pressure-list",children:[u.jsxs("div",{className:"pressure-row pressure-row--header",children:[u.jsx("span",{children:s("Target")}),u.jsx("span",{children:s("Queued")}),u.jsx("span",{children:s("Running")})]}),f.map(P=>u.jsxs("div",{className:"pressure-row",children:[u.jsx("strong",{children:P.targetId}),u.jsx("span",{children:P.queued}),u.jsx("span",{children:P.running})]},P.targetId))]})]}),u.jsxs("section",{className:"operations-section","aria-labelledby":"recent-runs-title",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"recent-runs-title",children:s("Recent API Runs")}),u.jsx("a",{href:"#/runs",children:s("View all")})]}),u.jsx(fp,{runs:c.slice(0,20)})]})]})}function tn({title:s,onClose:n,initialFocusRef:i,children:l,actions:c,wide:f=!1}){const p=b.useRef(null),m=`dialog-${s.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,w=b.useCallback(()=>n(),[n]);return b.useEffect(()=>{const S=document.querySelector(".app-shell");return S==null||S.setAttribute("inert",""),()=>S==null?void 0:S.removeAttribute("inert")},[]),zu(!0,p,w,i),dp.createPortal(u.jsx("div",{className:"dialog-layer",children:u.jsxs("div",{ref:p,className:`dialog ${f?"dialog--wide":""}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":m,tabIndex:-1,children:[u.jsx("h2",{id:m,children:s}),l,u.jsx("div",{className:"dialog-actions",children:c})]})}),document.body)}function Rt({label:s,hint:n,requirement:i,children:l}){return u.jsxs("div",{className:"field",children:[u.jsxs("label",{children:[u.jsx("span",{className:i?`field__label field__label--${i}`:void 0,children:s}),l]}),n?u.jsx("small",{children:n}):null]})}function Lr({label:s,checked:n,onCheckedChange:i,disabled:l=!1,required:c=!1,showLabel:f=!1,className:p="",children:m}){const w=f||m!==void 0;return u.jsxs("button",{type:"button",role:"switch",className:`toggle-control ${w?"toggle-control--labelled":""} ${p}`.trim(),"aria-checked":n,"aria-label":s,"aria-required":c||void 0,title:w?void 0:s,disabled:l,onClick:()=>i(!n),children:[u.jsx("span",{className:"toggle-control__track","aria-hidden":"true",children:u.jsx("span",{className:"toggle-control__thumb"})}),w?u.jsx("span",{className:"toggle-control__label","aria-hidden":"true",children:m??s}):null]})}const ih=/^[a-z0-9][a-z0-9._-]*$/,Cn="__custom__",hp={codex:"Codex",claude:"Claude Code",cursor:"Cursor Agent",opencode:"OpenCode",antigravity:"Antigravity",kimi:"Kimi Code"},Xv=[{value:"1",label:"1 request"},{value:"2",label:"2 requests"},{value:"4",label:"4 requests"}],eg=[{value:"0",label:"No queue"},{value:"4",label:"4 requests"},{value:"8",label:"8 requests"},{value:"16",label:"16 requests"},{value:"32",label:"32 requests"}],tg=[{value:"30000",label:"30 seconds"},{value:"60000",label:"1 minute"},{value:"300000",label:"5 minutes"},{value:"600000",label:"10 minutes"}],ng=[{value:"",label:"No timeout"},{value:"300000",label:"5 minutes"},{value:"1200000",label:"20 minutes"},{value:"3600000",label:"1 hour"}];function vi(s,n){return s.find(i=>i.cli===n)}function vu(s,n){var c;const i=((c=vi(s,n))==null?void 0:c.capabilities.modelOptions)??[],l=new Set;return i.flatMap(f=>{const p=n==="antigravity"?f.label:f.id;return l.has(p)?[]:(l.add(p),[{value:p,label:f.label,effortOptions:f.effortOptions??[]}])})}function gu(s){return s.includes("max")?"max":s.at(-1)??""}function rg(s){var n,i;return(n=vi(s,"codex"))!=null&&n.capabilities.available?"codex":((i=s.find(l=>l.capabilities.available&&l.cli in hp))==null?void 0:i.cli)??"codex"}function ah(s,n){return s?{id:s.id,aliases:s.aliases.join(", "),cli:s.cli,nativeModel:s.nativeModel,reasoningEffort:s.reasoningEffort??"",enabled:s.enabled,isolationLevel:s.isolationLevel,streamingMode:s.streamingMode,toolBridge:s.toolBridge,maxConcurrency:String(s.maxConcurrency),maxQueue:String(s.maxQueue),queueTimeoutMs:String(s.queueTimeoutMs),runTimeoutMs:s.runTimeoutMs===null?"":String(s.runTimeoutMs),fixedWorkspace:s.fixedWorkspace??"",acknowledgeFixedWorkspaceDowngrade:!1}:(()=>{const i=rg(n),l=vi(n,i),c=vu(n,i)[0],f=gu((c==null?void 0:c.effortOptions)??[]);return{id:c?pp(i,c.value,f):"",aliases:"",cli:i,nativeModel:(c==null?void 0:c.value)??"",reasoningEffort:f,enabled:!1,isolationLevel:(l==null?void 0:l.capabilities.isolationLevel)??"strict",streamingMode:(l==null?void 0:l.capabilities.streamingMode)??"native",toolBridge:(l==null?void 0:l.capabilities.toolBridge)??"structured_output",maxConcurrency:"1",maxQueue:"8",queueTimeoutMs:"300000",runTimeoutMs:"",fixedWorkspace:"",acknowledgeFixedWorkspaceDowngrade:!1}})()}function sg(s){return s.split(/[\n,]/).map(n=>n.trim()).filter(Boolean)}function pp(s,n,i){const l=n.toLowerCase().replace(/[^a-z0-9]+/g,"");return[s.toLowerCase(),l,i.toLowerCase()].filter(Boolean).join("-")}function lh(s){return s.nativeModel.trim()?pp(s.cli,s.nativeModel,s.reasoningEffort):""}function tu(s){return Number(s)>0&&Number.isInteger(Number(s))}function ig(s){return Number(s)>=0&&Number.isInteger(Number(s))}function Ua({label:s,value:n,presets:i,min:l,onChange:c}){const{t:f}=Fe(),p=i.some(C=>C.value===n),[m,w]=b.useState(!p),S=m||!p;return u.jsxs(u.Fragment,{children:[u.jsx(Rt,{label:f(s),children:u.jsxs("select",{value:S?Cn:n,onChange:C=>{C.target.value===Cn?(w(!0),c("")):(w(!1),c(C.target.value))},children:[i.map(C=>u.jsx("option",{value:C.value,children:f(C.label)},C.value||"none")),u.jsx("option",{value:Cn,children:f("Custom...")})]})}),S?u.jsx(Rt,{label:f("Custom {label}",{label:f(s).toLocaleLowerCase()}),requirement:"required",children:u.jsx("input",{type:"number",min:l,step:"1",required:!0,value:n,onChange:C=>c(C.target.value)})}):null]})}function ag(s,n){const i=s.capabilities;return!s.capabilityVersion||!s.capabilityVerifiedAt||s.capabilityError||!i||!(n!=null&&n.capabilities.available)||n.capabilities.version!==s.capabilityVersion?!1:(s.isolationLevel!=="strict"||i.isolationLevel==="strict")&&(s.streamingMode==="none"||i.streamingMode==="native")&&(s.toolBridge==="none"||i.toolBridge==="structured_output")&&i.modelSelection&&(s.reasoningEffort===null||i.effortSelection)}function oh(s,n,i){return s.capabilities?s.capabilityError?i("Unavailable"):s.capabilities[n]==="none"?i("Unsupported"):i("Supported"):i("Unverified")}function uh(s,n){if(s==="conformance_required")return n("Verification required");if(s==="configuration_changed")return n("Configuration changed; verify again");const i=s.replaceAll("_"," ");return`${i.charAt(0).toUpperCase()}${i.slice(1)}`}function lg({target:s,availability:n,onClose:i}){var G;const{t:l}=Fe(),[c,f]=b.useState(()=>ah(s,n)),[p,m]=b.useState(s!==null),[w,S]=b.useState(!1),[C,E]=b.useState(!1),[I,z]=b.useState(s!=null&&s.fixedWorkspace?"fixed":"managed"),[V,D]=b.useState(!1),P=b.useRef(s!==null||c.nativeModel.length>0),T=b.useRef(null);b.useEffect(()=>{s!==null||P.current||n.length===0||(P.current=!0,f(v=>v.nativeModel?v:ah(null,n)))},[n,s]);const Y=sg(c.aliases),A=I==="fixed"?c.fixedWorkspace.trim():"",F=c.runTimeoutMs.trim(),Q=vu(n,c.cli),ue=Q.find(v=>v.value===c.nativeModel),he=w||Q.length===0||c.nativeModel.length>0&&ue===void 0,oe=(ue==null?void 0:ue.effortOptions)??[],U=C||c.reasoningEffort.length>0&&!oe.includes(c.reasoningEffort),le=ih.test(c.id)&&Y.every(v=>v!==c.id)&&new Set(Y).size===Y.length,B=[];c.nativeModel.trim()||B.push("Select a native model or enter a custom model."),ih.test(c.id)?le||B.push("Aliases must be unique and different from the canonical ID."):B.push("Enter a canonical ID using lowercase letters, numbers, dots, underscores, or hyphens."),C&&!c.reasoningEffort.trim()&&B.push("Enter a custom reasoning effort or select Provider default."),tu(c.maxConcurrency)||B.push("Max concurrency must be a positive whole number."),ig(c.maxQueue)||B.push("Max queue must be zero or a positive whole number."),tu(c.queueTimeoutMs)||B.push("Queue timeout must be a positive whole number of milliseconds."),F!==""&&!tu(F)&&B.push("Run timeout must be blank or a positive whole number of milliseconds."),I==="fixed"&&A.length===0&&B.push("Enter an absolute fixed workspace path."),I==="fixed"&&!c.acknowledgeFixedWorkspaceDowngrade&&B.push("Acknowledge the fixed-workspace isolation downgrade.");const Se=B.length===0,te=ct({mutationFn:()=>pe(s?`/admin/targets/${encodeURIComponent(s.id)}`:"/admin/targets",{method:s?"PATCH":"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...s?{}:{id:c.id},aliases:Y,cli:c.cli,native_model:c.nativeModel.trim(),reasoning_effort:c.reasoningEffort.trim()||null,...s?{enabled:c.enabled}:{},isolation_level:I==="fixed"?"best_effort":c.isolationLevel,streaming_mode:c.streamingMode,tool_bridge:c.toolBridge,max_concurrency:Number(c.maxConcurrency),max_queue:Number(c.maxQueue),queue_timeout_ms:Number(c.queueTimeoutMs),run_timeout_ms:F===""?null:Number(F),fixed_workspace:I==="fixed"?A:null,acknowledge_fixed_workspace_downgrade:c.acknowledgeFixedWorkspaceDowngrade,...s?{}:{verify_on_create:!0,confirm_model_usage:!0}})}),onSuccess:async()=>{i(),await yt.invalidateQueries({queryKey:["targets"]}),await yt.invalidateQueries({queryKey:["cli-availability"]})}}),ge=(v,R)=>{f(ie=>({...ie,[v]:R}))},ze=v=>{f(R=>{const ie={...R,...v};return p?ie:{...ie,id:lh(ie)}})},Be=v=>{const R=vi(n,v),ie=vu(n,v)[0],Ce=gu((ie==null?void 0:ie.effortOptions)??[]);S(!1),E(!1),f(je=>{const Ee={...je,cli:v,nativeModel:(ie==null?void 0:ie.value)??"",reasoningEffort:Ce,isolationLevel:(R==null?void 0:R.capabilities.isolationLevel)??je.isolationLevel,streamingMode:(R==null?void 0:R.capabilities.streamingMode)??je.streamingMode,toolBridge:(R==null?void 0:R.capabilities.toolBridge)??je.toolBridge};return p?Ee:{...Ee,id:lh(Ee)}})},Ie=v=>{if(v===Cn){S(!0),E(!1),ze({nativeModel:"",reasoningEffort:""});return}const R=Q.find(ie=>ie.value===v);S(!1),E(!1),ze({nativeModel:v,reasoningEffort:gu((R==null?void 0:R.effortOptions)??[])})},H=v=>{if(v===Cn){E(!0),ze({reasoningEffort:""});return}E(!1),ze({reasoningEffort:v})},fe=()=>{D(!0),Se&&te.mutate()};return u.jsxs(tn,{title:l(s?"Edit target":"Create target"),onClose:i,initialFocusRef:T,wide:!0,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:T,variant:"quiet",onClick:i,children:l("Cancel")}),u.jsx(we,{"aria-busy":te.isPending||void 0,disabled:te.isPending,onClick:fe,children:l(s?"Save target":te.isPending?"Creating and verifying...":"Create and verify")})]}),children:[u.jsxs("div",{className:"target-form",children:[u.jsx(Rt,{label:l("Canonical ID"),requirement:"required",hint:le?void 0:l("Use lowercase letters, numbers, dots, underscores, or hyphens; aliases must be unique."),children:u.jsx("input",{value:c.id,readOnly:s!==null,required:!0,pattern:"[a-z0-9][a-z0-9._-]*",onChange:v=>{m(!0),ge("id",v.target.value)}})}),u.jsx(Rt,{label:l("Aliases"),requirement:"optional",children:u.jsx("input",{value:c.aliases,onChange:v=>ge("aliases",v.target.value),placeholder:l("Comma separated")})}),u.jsx(Rt,{label:"CLI",requirement:"required",hint:(G=vi(n,c.cli))!=null&&G.capabilities.available?void 0:l("This CLI was not found by the latest scan."),children:u.jsx("select",{required:!0,value:c.cli,onChange:v=>Be(v.target.value),children:Object.entries(hp).map(([v,R])=>u.jsx("option",{value:v,children:R},v))})}),u.jsx(Rt,{label:l("Native model"),requirement:"required",hint:Q.length===0?l("No models were returned by the latest CLI scan."):void 0,children:u.jsxs("select",{required:!0,value:he?Cn:c.nativeModel,onChange:v=>Ie(v.target.value),children:[Q.map(v=>u.jsx("option",{value:v.value,children:v.label},v.value)),u.jsx("option",{value:Cn,children:l("Custom...")})]})}),he?u.jsx(Rt,{label:l("Custom native model"),requirement:"required",children:u.jsx("input",{required:!0,value:c.nativeModel,onChange:v=>ze({nativeModel:v.target.value})})}):null,u.jsx(Rt,{label:l("Reasoning effort"),requirement:"optional",children:u.jsxs("select",{value:U?Cn:c.reasoningEffort,onChange:v=>H(v.target.value),children:[u.jsx("option",{value:"",children:l("Provider default")}),oe.map(v=>u.jsx("option",{value:v,children:v},v)),u.jsx("option",{value:Cn,children:l("Custom...")})]})}),U?u.jsx(Rt,{label:l("Custom reasoning effort"),requirement:"required",children:u.jsx("input",{required:!0,value:c.reasoningEffort,onChange:v=>ze({reasoningEffort:v.target.value})})}):null,u.jsx(Rt,{label:l("Isolation"),children:u.jsxs("select",{value:I==="fixed"?"best_effort":c.isolationLevel,disabled:I==="fixed",onChange:v=>ge("isolationLevel",v.target.value),children:[u.jsx("option",{value:"strict",children:l("Strict")}),u.jsx("option",{value:"best_effort",children:l("Best effort")})]})}),u.jsx(Rt,{label:l("Streaming"),children:u.jsxs("select",{value:c.streamingMode,onChange:v=>ge("streamingMode",v.target.value),children:[u.jsx("option",{value:"native",children:l("Native")}),u.jsx("option",{value:"none",children:l("None")})]})}),u.jsx(Rt,{label:l("Tool mode"),children:u.jsxs("select",{value:c.toolBridge,onChange:v=>ge("toolBridge",v.target.value),children:[u.jsx("option",{value:"structured_output",children:l("Structured output")}),u.jsx("option",{value:"none",children:l("None")})]})}),u.jsx(Ua,{label:"Max concurrency",value:c.maxConcurrency,presets:Xv,min:1,onChange:v=>ge("maxConcurrency",v)}),u.jsx(Ua,{label:"Max queue",value:c.maxQueue,presets:eg,min:0,onChange:v=>ge("maxQueue",v)}),u.jsx(Ua,{label:"Queue timeout",value:c.queueTimeoutMs,presets:tg,min:1,onChange:v=>ge("queueTimeoutMs",v)}),u.jsx(Ua,{label:"Run timeout",value:c.runTimeoutMs,presets:ng,min:1,onChange:v=>ge("runTimeoutMs",v)}),u.jsx(Rt,{label:l("Workspace"),children:u.jsxs("select",{value:I,onChange:v=>{const R=v.target.value;z(R),f(ie=>({...ie,fixedWorkspace:R==="managed"?"":ie.fixedWorkspace,isolationLevel:R==="fixed"?"best_effort":ie.isolationLevel,acknowledgeFixedWorkspaceDowngrade:!1}))},children:[u.jsx("option",{value:"managed",children:l("Gateway managed")}),u.jsx("option",{value:"fixed",children:l("Fixed path...")})]})}),I==="fixed"?u.jsx(Rt,{label:l("Fixed workspace path"),requirement:"required",children:u.jsx("input",{required:!0,value:c.fixedWorkspace,onChange:v=>ge("fixedWorkspace",v.target.value),placeholder:"/absolute/path/to/project"})}):null]}),I==="fixed"?u.jsx("div",{className:"acknowledgements",children:u.jsx(Lr,{label:l("Acknowledge workspace isolation downgrade"),showLabel:!0,required:!0,checked:c.acknowledgeFixedWorkspaceDowngrade,onCheckedChange:v=>ge("acknowledgeFixedWorkspaceDowngrade",v)})}):null,s===null?u.jsx("p",{className:"muted",children:l("Creating this target runs bounded model requests and may consume quota.")}):null,te.isPending&&s===null?u.jsxs("div",{className:"verification-status",role:"status","aria-live":"polite",children:[u.jsx(Qa,{className:"icon-spin",size:18,"aria-hidden":"true"}),u.jsxs("span",{children:[u.jsx("strong",{children:l("Creating and verifying target")}),u.jsx("small",{children:l("Running provider conformance checks. This can take several minutes.")})]})]}):null,Se?null:u.jsx("p",{className:V?"dialog-error target-validation":"muted target-validation",role:V?"alert":"status",children:l(B[0])}),te.isError?u.jsx("p",{className:"dialog-error",children:l(s?"Target could not be saved.":"Target could not be created or verified.")}):null]})}function og(){var ue,he,oe;const{t:s}=Fe(),[n,i]=b.useState(null),[l,c]=b.useState(void 0),[f,p]=b.useState(null),[m,w]=b.useState(null),[S,C]=b.useState(!1),E=b.useRef(null),I=rt({queryKey:["targets"],queryFn:()=>pe("/admin/targets")}),z=rt({queryKey:["cli-availability"],queryFn:()=>pe("/admin/cli-availability")}),V=new Map((((ue=z.data)==null?void 0:ue.cli_availability)??[]).map(U=>[U.cli,U])),D=()=>yt.invalidateQueries({queryKey:["targets"]}),P=ct({mutationFn:U=>pe(`/admin/targets/${encodeURIComponent(U)}/verify`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({confirm_model_usage:!0})}),onSuccess:async()=>{i(null),await D()}}),T=U=>{P.reset(),i(U)},Y=()=>{i(null),P.isPending||P.reset()},A=ct({mutationFn:({target:U,enabled:le})=>pe(`/admin/targets/${encodeURIComponent(U.id)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:le,enabled_best_effort:le&&U.isolationLevel==="best_effort"})}),onSuccess:async()=>{w(null),await D()}}),F=ct({mutationFn:U=>pe(`/admin/targets/${encodeURIComponent(U)}`,{method:"DELETE"}),onSuccess:async()=>{p(null),await D()}}),Q=[{key:"id",label:"ID",width:"176px",render:U=>U.id},{key:"cli",label:"CLI",width:"92px",render:U=>U.cli},{key:"model",label:s("Native Model"),width:"132px",render:U=>U.nativeModel},{key:"effort",label:s("Effort"),width:"82px",render:U=>U.reasoningEffort??"-"},{key:"isolation",label:s("Isolation"),width:"104px",render:U=>U.isolationLevel},{key:"streaming",label:s("Streaming"),width:"110px",render:U=>oh(U,"streamingMode",s)},{key:"tools",label:s("Tools"),width:"110px",render:U=>oh(U,"toolBridge",s)},{key:"version",label:s("Static / Verified"),width:"150px",render:U=>{const le=V.get(U.cli),B=(le==null?void 0:le.capabilities.version)??"-",Se=U.capabilityVerifiedAt?U.capabilityVersion??"-":"-",te=B!=="-"&&Se!=="-"&&B!==Se;return u.jsxs("div",{children:[B," / ",Se,te?u.jsx("div",{children:s("Version mismatch")}):null,U.capabilityError?u.jsx("div",{title:U.capabilityError,children:uh(U.capabilityError,s)}):null,le!=null&&le.capabilities.error?u.jsx("div",{title:le.capabilities.error,children:uh(le.capabilities.error,s)}):null]})}},{key:"queue",label:s("Queue"),width:"82px",render:U=>`${U.maxConcurrency}/${U.maxQueue}`},{key:"enabled",label:s("Enabled"),width:"78px",render:U=>u.jsx(Lr,{label:s("Enable {id}",{id:U.id}),checked:U.enabled,disabled:A.isPending||!U.enabled&&!ag(U,V.get(U.cli)),onCheckedChange:le=>{le&&U.isolationLevel==="best_effort"?(C(!1),w(U)):A.mutate({target:U,enabled:le})}})},{key:"actions",label:s("Actions"),width:"184px",className:"actions-cell",render:U=>{const le=P.isPending&&P.variables===U.id;return u.jsxs("div",{className:"table-actions",children:[u.jsxs(we,{variant:"quiet","aria-label":s("{action} {id}",{action:s(le?"Verifying":"Verify"),id:U.id}),"aria-busy":le||void 0,disabled:P.isPending,onClick:()=>T(U),children:[le?u.jsx(Qa,{className:"icon-spin",size:15,"aria-hidden":"true"}):u.jsx(nh,{size:15,"aria-hidden":"true"})," ",s(le?"Verifying":"Verify")]}),u.jsx(kt,{label:s("Edit {id}",{id:U.id}),variant:"quiet",onClick:()=>c(U),children:u.jsx(_v,{size:15,"aria-hidden":"true"})}),u.jsx(kt,{label:s("Delete {id}",{id:U.id}),variant:"quiet",disabled:U.enabled,onClick:()=>p(U),children:u.jsx(Ka,{size:15,"aria-hidden":"true"})})]})}}];return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:s("Invocation Targets")}),u.jsx("p",{children:s("Gateway provider configurations and verified capabilities")})]}),u.jsxs(we,{onClick:()=>c(null),children:[u.jsx(Mu,{size:16,"aria-hidden":"true"})," ",s("Create target")]})]}),P.isPending&&!n?u.jsxs("p",{className:"operation-status",role:"status",children:[u.jsx(Qa,{className:"icon-spin",size:16,"aria-hidden":"true"})," ",s("Verifying target")," ",u.jsx("strong",{children:P.variables})]}):null,P.isError&&!n?u.jsxs("p",{className:"dialog-error",role:"alert",children:[s("Verification failed for")," ",u.jsx("strong",{children:P.variables})]}):null,u.jsx("section",{className:"table-section","aria-label":s("Invocation targets"),children:u.jsx(Ar,{ariaLabel:s("Invocation Targets"),columns:Q,rows:((he=I.data)==null?void 0:he.targets)??[],rowKey:U=>U.id,emptyTitle:I.isError?s("Targets unavailable"):s("No invocation targets")})}),l!==void 0?u.jsx(lg,{target:l,availability:((oe=z.data)==null?void 0:oe.cli_availability)??[],onClose:()=>c(void 0)}):null,n?u.jsxs(tn,{title:s("Verify target"),onClose:Y,initialFocusRef:E,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:E,variant:"quiet",onClick:Y,children:s(P.isPending?"Hide":"Cancel")}),u.jsxs(we,{"aria-busy":P.isPending||void 0,disabled:P.isPending,onClick:()=>P.mutate(n.id),children:[u.jsx(nh,{size:16,"aria-hidden":"true"})," ",s(P.isPending?"Verifying...":"Verify target")]})]}),children:[u.jsx("p",{children:s("This runs bounded model requests and may consume quota. Verification applies to this target's model and execution settings.")}),P.isPending?u.jsxs("div",{className:"verification-status",role:"status","aria-live":"polite",children:[u.jsx(Qa,{className:"icon-spin",size:18,"aria-hidden":"true"}),u.jsxs("span",{children:[u.jsx("strong",{children:s("Verification in progress")}),u.jsx("small",{children:s("Running provider conformance checks. This can take several minutes.")})]})]}):null,P.isError?u.jsx("p",{className:"dialog-error",role:"alert",children:s("Verification failed")}):null]}):null,m?u.jsxs(tn,{title:s("Enable target"),onClose:()=>w(null),initialFocusRef:E,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:E,variant:"quiet",onClick:()=>w(null),children:s("Cancel")}),u.jsx(we,{disabled:!S||A.isPending,onClick:()=>A.mutate({target:m,enabled:!0}),children:s("Enable target")})]}),children:[u.jsx("p",{children:s("This target provides best-effort rather than strict workspace isolation.")}),u.jsx(Lr,{className:"dialog-toggle",label:s("Allow best-effort isolation"),showLabel:!0,required:!0,checked:S,onCheckedChange:C})]}):null,f?u.jsx(tn,{title:s("Delete target"),onClose:()=>p(null),initialFocusRef:E,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:E,variant:"quiet",onClick:()=>p(null),children:s("Cancel")}),u.jsx(we,{variant:"danger",onClick:()=>F.mutate(f.id),children:s("Delete target")})]}),children:u.jsx("p",{children:s("Delete target {id}? Historical run metadata is retained.",{id:f.id})})}):null]})}const ug={codex:"Codex",claude:"Claude Code",cursor:"Cursor Agent",kimi:"Kimi Code",opencode:"OpenCode",antigravity:"Antigravity"};function cg(s,n){const i=s.capabilities;return[i.isolationLevel==="strict"?n("strict isolation"):n("best effort"),i.streamingMode==="native"?n("streaming"):n("no streaming"),i.toolBridge==="structured_output"?n("tools"):n("no tools")].join(" / ")}function dg(s,n){const i=new Date(s);return Number.isNaN(i.getTime())?s:i.toLocaleString(n)}function fg(s,n){return[{key:"cli",label:"CLI",width:"150px",render:i=>ug[i.cli]??i.cli},{key:"executable",label:s("Executable"),width:"110px",render:i=>i.capabilities.available?s("Available"):s("Unavailable")},{key:"version",label:s("Version"),width:"110px",className:"code-cell",render:i=>i.capabilities.version??"-"},{key:"ceiling",label:s("Static Ceiling"),width:"290px",render:i=>cg(i,s)},{key:"verified",label:s("Verification Count"),width:"140px",render:i=>s("{count} verified",{count:i.verificationCount})},{key:"scan",label:s("Last Scan"),width:"190px",className:"numeric",render:i=>dg(i.scannedAt,n)}]}function hg(){var c;const{locale:s,t:n}=Fe(),i=rt({queryKey:["cli-availability"],queryFn:()=>pe("/admin/cli-availability")}),l=ct({mutationFn:()=>pe("/admin/cli-availability/refresh",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),onSuccess:f=>yt.setQueryData(["cli-availability"],f)});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:n("CLI Availability")}),u.jsx("p",{children:n("Installed executables and static provider ceilings")})]}),u.jsx(kt,{label:n("Refresh CLI availability"),disabled:l.isPending,onClick:()=>l.mutate(),children:u.jsx(sp,{size:16,"aria-hidden":"true"})})]}),u.jsx("section",{className:"table-section",children:u.jsx(Ar,{ariaLabel:n("CLI Availability"),columns:fg(n,s),rows:((c=i.data)==null?void 0:c.cli_availability)??[],rowKey:f=>f.cli,emptyTitle:i.isError?n("CLI availability unavailable"):n("No CLI scans")})})]})}const ch={openai:"OpenAI"};function pg(){var c,f;const{t:s}=Fe(),n=rt({queryKey:["extensions"],queryFn:()=>pe("/admin/extensions")}),i=ct({mutationFn:({item:p,enabled:m})=>pe(`/admin/extensions/${encodeURIComponent(p.id)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:m})}),onSuccess:()=>yt.invalidateQueries({queryKey:["extensions"]})}),l=[{key:"id",label:s("Extension"),width:"180px",render:p=>ch[p.id]??p.id},{key:"version",label:s("Version"),width:"120px",className:"code-cell",render:p=>p.version},{key:"gateway",label:s("Required Gateway"),width:"150px",className:"code-cell",render:p=>p.requiredGatewayVersion},{key:"endpoint",label:s("Endpoint"),width:"180px",className:"code-cell",render:p=>p.endpoint},{key:"health",label:s("Endpoint Status"),width:"150px",render:p=>p.health.ok?s("Operational"):p.health.detail??s("Unavailable")},{key:"enabled",label:s("Enabled"),width:"100px",render:p=>u.jsx(Lr,{label:s("Enable {name}",{name:ch[p.id]??p.id}),checked:p.enabled,disabled:i.isPending,onCheckedChange:m=>i.mutate({item:p,enabled:m})})}];return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:s("Extensions")}),u.jsx("p",{children:s("Compiled Gateway protocol manifests and endpoint state")})]}),u.jsx("span",{className:"record-count",children:s("{count} extensions",{count:((c=n.data)==null?void 0:c.extensions.length)??0})})]}),u.jsx("section",{className:"table-section",children:u.jsx(Ar,{ariaLabel:s("Extensions"),columns:l,rows:((f=n.data)==null?void 0:f.extensions)??[],rowKey:p=>p.id,emptyTitle:n.isError?s("Extensions unavailable"):s("No compiled extensions")})})]})}function mp({label:s,prefix:n,initialSecret:i,reveal:l}){const{t:c}=Fe(),[f,p]=b.useState(i??null),[m,w]=b.useState(!1),[S,C]=b.useState(!1),E=b.useRef(0);b.useEffect(()=>(E.current+=1,p(i??null),w(!1),C(!1),()=>{E.current+=1}),[i,n]);const I=async()=>{const D=++E.current;w(!0),C(!1);try{const P=await l();E.current===D&&p(P)}catch{E.current===D&&C(!0)}finally{E.current===D&&w(!1)}},z=()=>{E.current+=1,p(null),w(!1),C(!1)},V=async()=>{if(f!==null)try{await navigator.clipboard.writeText(f)}catch{C(!0)}};return u.jsxs("div",{className:"secret-field",children:[f===null?u.jsxs("span",{className:"secret-field__mask",children:[n,"_••••••••"]}):u.jsx("input",{"aria-label":c("Key {label}",{label:s}),value:f,readOnly:!0,autoComplete:"off",spellCheck:!1}),u.jsx(kt,{label:c(f===null?"Reveal key {label}":"Hide key {label}",{label:s}),disabled:m,onClick:()=>void(f===null?I():z()),children:f===null?u.jsx(gv,{size:15,"aria-hidden":"true"}):u.jsx(vv,{size:15,"aria-hidden":"true"})}),u.jsx(kt,{label:c("Copy key {label}",{label:s}),disabled:f===null,onClick:()=>void V(),children:u.jsx(Iu,{size:15,"aria-hidden":"true"})}),S?u.jsx("span",{className:"secret-field__error",role:"alert",children:c("Key operation failed")}):null]})}const dh={openai:"OpenAI"},mg=["clients","credentials","grants","models-preview"];async function Wa(){await Promise.all(mg.map(s=>yt.invalidateQueries({queryKey:[s],exact:!0})))}function yg(s){return s===""?null:new Date(s).toISOString()}function vg(s,n){return!s.enabled&&s.capabilityVerifiedAt===null?n("Target is disabled and unverified"):s.enabled?s.capabilityVerifiedAt===null?n("Target is unverified"):s.capabilityError?s.capabilityError:null:n("Target is disabled")}function gg({onClose:s}){const{t:n}=Fe(),[i,l]=b.useState(""),c=b.useRef(null),f=ct({mutationFn:()=>pe("/admin/clients",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:i})}),onSuccess:async()=>{await Wa(),s()}});return u.jsxs(tn,{title:n("Create client"),onClose:s,initialFocusRef:c,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:c,variant:"quiet",onClick:s,children:n("Cancel")}),u.jsxs(we,{disabled:!i.trim()||f.isPending,onClick:()=>f.mutate(),children:[u.jsx(Mu,{size:15,"aria-hidden":"true"})," ",n("Create client")]})]}),children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:n("Client name")}),u.jsx("input",{value:i,onChange:p=>l(p.target.value)})]}),f.isError?u.jsx("p",{className:"dialog-error",children:n("Client could not be created")}):null]})}function xg({clientId:s}){return s?u.jsx(kg,{clientId:s}):u.jsx(wg,{})}function wg(){var C;const{locale:s,t:n}=Fe(),[i,l]=b.useState(!1),[c,f]=b.useState(null),p=b.useRef(null),m=rt({queryKey:["clients"],queryFn:()=>pe("/admin/clients")}),w=ct({mutationFn:E=>pe(`/admin/clients/${encodeURIComponent(E)}`,{method:"DELETE"}),onSuccess:async()=>{f(null),await Wa()}}),S=[{key:"name",label:n("Name"),width:"240px",render:E=>u.jsx("a",{href:`#/clients/${encodeURIComponent(E.id)}`,children:E.name})},{key:"status",label:n("Status"),width:"110px",render:E=>n(E.status)},{key:"credentials",label:n("Credentials"),width:"110px",className:"numeric",render:E=>E.credentialCount},{key:"grants",label:n("Grants"),width:"90px",className:"numeric",render:E=>E.grantCount},{key:"used",label:n("Last Used"),width:"190px",render:E=>E.lastUsedAt?new Date(E.lastUsedAt).toLocaleString(s):n("Never")},{key:"actions",label:n("Actions"),width:"140px",render:E=>u.jsxs("div",{className:"table-actions",children:[u.jsx(we,{variant:"quiet",onClick:()=>{window.location.hash=`#/clients/${encodeURIComponent(E.id)}`},children:n("Open")}),u.jsx(kt,{label:n("Delete client {name}",{name:E.name}),variant:"quiet",onClick:()=>f(E),children:u.jsx(Ka,{size:15,"aria-hidden":"true"})})]})}];return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:n("Clients and Keys")}),u.jsx("p",{children:n("API identities, recoverable credentials, and target access")})]}),u.jsxs(we,{onClick:()=>l(!0),children:[u.jsx(Mu,{size:16,"aria-hidden":"true"})," ",n("Create client")]})]}),u.jsx("section",{className:"table-section",children:u.jsx(Ar,{ariaLabel:n("Clients"),columns:S,rows:((C=m.data)==null?void 0:C.clients)??[],rowKey:E=>E.id,emptyTitle:m.isError?n("Clients unavailable"):n("No clients")})}),i?u.jsx(gg,{onClose:()=>l(!1)}):null,c?u.jsxs(tn,{title:n("Delete client"),onClose:()=>f(null),initialFocusRef:p,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:p,variant:"quiet",onClick:()=>f(null),children:n("Cancel")}),u.jsx(we,{variant:"danger",disabled:w.isPending,onClick:()=>w.mutate(c.id),children:n("Delete client permanently")})]}),children:[u.jsx("p",{children:n("Delete {name}? Credentials and grants will be removed immediately. Historical completed runs are retained.",{name:c.name})}),w.isError?u.jsx("p",{className:"dialog-error",children:n("Client could not be deleted")}):null]}):null]})}function kg({clientId:s}){var he,oe,U,le;const{locale:n,t:i}=Fe(),[l,c]=b.useState(!1),[f,p]=b.useState(null),[m,w]=b.useState(null),[S,C]=b.useState(!1),[E,I]=b.useState(!1),z=b.useRef(null),V=rt({queryKey:["clients",s],queryFn:()=>pe(`/admin/clients/${encodeURIComponent(s)}`)}),D=rt({queryKey:["targets"],queryFn:()=>pe("/admin/targets")}),P=rt({queryKey:["extensions"],queryFn:()=>pe("/admin/extensions")}),T=async()=>{await Wa(),await yt.invalidateQueries({queryKey:["clients",s]})},Y=ct({mutationFn:B=>pe(`/admin/clients/${encodeURIComponent(s)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({status:B})}),onSuccess:T}),A=ct({mutationFn:()=>pe(`/admin/clients/${encodeURIComponent(s)}`,{method:"DELETE"}),onSuccess:async()=>{I(!1),yt.removeQueries({queryKey:["clients",s],exact:!0}),await Wa(),window.location.hash="#/clients"}}),F=ct({mutationFn:B=>pe(`/admin/credentials/${encodeURIComponent(B)}/revoke`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),onSuccess:async()=>{p(null),await T()}}),Q=ct({mutationFn:({extensionId:B,targetId:Se,enabled:te})=>pe("/admin/grants",{method:te?"POST":"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:s,extension_id:B,target_id:Se})}),onSuccess:T}),ue=(he=V.data)==null?void 0:he.client;return ue?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("a",{href:"#/clients",children:i("Clients and Keys")}),u.jsx("h1",{children:ue.name}),u.jsx("p",{children:ue.id})]}),u.jsxs("div",{className:"table-actions",children:[u.jsx(Lr,{label:i("Client enabled"),showLabel:!0,checked:ue.status==="active",disabled:Y.isPending,onCheckedChange:B=>Y.mutate(B?"active":"disabled")}),u.jsxs(we,{variant:"danger",onClick:()=>I(!0),children:[u.jsx(Ka,{size:15,"aria-hidden":"true"})," ",i("Delete client")]})]})]}),S?u.jsx("p",{role:"status",className:"operation-notice",children:i("Previous key revoked")}):null,u.jsxs("section",{className:"client-section","aria-labelledby":"credentials-title",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"credentials-title",children:i("Credentials")}),u.jsxs(we,{onClick:()=>c(!0),children:[u.jsx(Lu,{size:15,"aria-hidden":"true"})," ",i("Create credential")]})]}),u.jsx("div",{className:"credential-list",children:(((oe=V.data)==null?void 0:oe.credentials)??[]).map(B=>{const Se=B.expiresAt!==null&&B.expiresAt<=new Date().toISOString(),te=B.revokedAt!==null||Se;return u.jsxs("div",{className:"credential-row",children:[u.jsxs("div",{children:[u.jsx("strong",{children:B.name}),u.jsx("small",{children:B.revokedAt?i("Revoked"):Se?i("Expired"):B.expiresAt?i("Expires {date}",{date:new Date(B.expiresAt).toLocaleString(n)}):i("No expiry")})]}),u.jsx(mp,{label:B.name,prefix:B.prefix,reveal:async()=>(await pe(`/admin/credentials/${encodeURIComponent(B.id)}/reveal`)).api_key}),u.jsxs("div",{className:"table-actions",children:[u.jsx(kt,{label:i("Rotate key {name}",{name:B.name}),disabled:te,variant:"quiet",onClick:()=>w(B),children:u.jsx(Sv,{size:15,"aria-hidden":"true"})}),u.jsx(kt,{label:i("Revoke key {name}",{name:B.name}),disabled:te,variant:"quiet",onClick:()=>p(B),children:u.jsx(Ka,{size:15,"aria-hidden":"true"})})]})]},B.id)})})]}),u.jsxs("section",{className:"client-section","aria-labelledby":"grants-title",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"grants-title",children:i("Extension and target grants")}),u.jsx("span",{children:i("{count} assigned",{count:((U=V.data)==null?void 0:U.grants.length)??0})})]}),u.jsx("div",{className:"grant-matrix",children:(((le=P.data)==null?void 0:le.extensions)??[]).map(B=>{var Se;return u.jsxs("div",{className:"grant-group",children:[u.jsx("h3",{children:dh[B.id]??B.id}),(((Se=D.data)==null?void 0:Se.targets)??[]).map(te=>{var Be;const ge=B.enabled?vg(te,i):i("Extension is disabled"),ze=((Be=V.data)==null?void 0:Be.grants.some(Ie=>Ie.extensionId===B.id&&Ie.targetId===te.id))??!1;return u.jsxs(Lr,{className:"grant-row",label:i("Grant {extension} to {target}",{extension:dh[B.id]??B.id,target:te.id}),checked:ze,disabled:ge!==null||!B.enabled||Q.isPending,onCheckedChange:Ie=>Q.mutate({extensionId:B.id,targetId:te.id,enabled:Ie}),children:[u.jsx("strong",{children:te.id}),u.jsx("small",{children:ge??`${te.cli} / ${te.nativeModel}`})]},te.id)})]},B.id)})})]}),l?u.jsx(fh,{title:i("Create credential"),action:i("Create credential"),defaultName:ue.name,onClose:()=>c(!1),onSubmit:async(B,Se)=>{await pe(`/admin/clients/${encodeURIComponent(s)}/credentials`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:B,expires_at:Se})}),await T(),c(!1)}}):null,m?u.jsx(fh,{title:i("Rotate credential"),action:i("Rotate and revoke"),defaultName:m.name,onClose:()=>w(null),onSubmit:async(B,Se)=>{await pe(`/admin/credentials/${encodeURIComponent(m.id)}/rotate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:B,expires_at:Se})}),w(null),C(!0),await T()}}):null,f?u.jsx(tn,{title:i("Revoke credential"),onClose:()=>p(null),initialFocusRef:z,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:z,variant:"quiet",onClick:()=>p(null),children:i("Cancel")}),u.jsx(we,{variant:"danger",disabled:F.isPending,onClick:()=>F.mutate(f.id),children:i("Revoke credential")})]}),children:u.jsx("p",{children:i("Revoke {name}? Requests using this key will fail immediately.",{name:f.name})})}):null,E?u.jsxs(tn,{title:i("Delete client"),onClose:()=>I(!1),initialFocusRef:z,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:z,variant:"quiet",onClick:()=>I(!1),children:i("Cancel")}),u.jsx(we,{variant:"danger",disabled:A.isPending,onClick:()=>A.mutate(),children:i("Delete client permanently")})]}),children:[u.jsx("p",{children:i("Delete {name}? Credentials and grants will be removed immediately. Historical completed runs are retained.",{name:ue.name})}),A.isError?u.jsx("p",{className:"dialog-error",children:i("Client could not be deleted")}):null]}):null]}):u.jsx("div",{className:"page-heading",children:u.jsxs("div",{children:[u.jsx("h1",{children:i("Client")}),u.jsx("p",{children:V.isError?i("Client unavailable"):i("Loading client")})]})})}function fh({title:s,action:n,defaultName:i,onClose:l,onSubmit:c}){const{t:f}=Fe(),[p,m]=b.useState(i),[w,S]=b.useState(""),[C,E]=b.useState(!1),[I,z]=b.useState(!1),V=b.useRef(null),D=async()=>{E(!0),z(!1);try{await c(p,yg(w))}catch{z(!0),E(!1)}};return u.jsxs(tn,{title:s,onClose:l,initialFocusRef:V,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{ref:V,variant:"quiet",onClick:l,children:f("Cancel")}),u.jsx(we,{disabled:!p.trim()||C,onClick:()=>void D(),children:n})]}),children:[u.jsxs("div",{className:"credential-form",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:f("Credential name")}),u.jsx("input",{value:p,onChange:P=>m(P.target.value)})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:f("Expiry (optional)")}),u.jsx("input",{type:"datetime-local",value:w,onChange:P=>S(P.target.value)})]})]}),I?u.jsx("p",{className:"dialog-error",children:f("Credential operation failed")}):null]})}function Cg({alias:s,tail:n,onClose:i}){const{t:l}=Fe(),c=b.useRef(null),[f,p]=b.useState(!1),m=async()=>{if(n!==null)try{await navigator.clipboard.writeText(n)}catch{p(!0)}};return u.jsx(tn,{title:l("Raw tail: {alias}",{alias:s}),onClose:i,initialFocusRef:c,wide:!0,actions:u.jsxs(u.Fragment,{children:[u.jsx(kt,{label:l("Copy raw tail for {alias}",{alias:s}),disabled:n===null,onClick:()=>void m(),children:u.jsx(Iu,{size:16,"aria-hidden":"true"})}),u.jsxs(we,{ref:c,variant:"quiet",onClick:i,children:[u.jsx(ap,{size:16,"aria-hidden":"true"})," ",l("Close")]})]}),children:u.jsxs("div",{className:"raw-tail",children:[n===null?u.jsx("p",{className:"raw-tail__empty",children:l("No raw tail available.")}):u.jsx("pre",{className:"raw-tail__content",children:n}),f?u.jsx("p",{className:"dialog-error",role:"alert",children:l("Raw tail copy failed")}):null]})})}function _g(s,n){const i=Math.round((Date.parse(s)-Date.now())/1e3),l=Math.abs(i),[c,f]=l<60?[i,"second"]:l<3600?[Math.round(i/60),"minute"]:l<86400?[Math.round(i/3600),"hour"]:[Math.round(i/86400),"day"];return new Intl.RelativeTimeFormat(n,{numeric:"always"}).format(c,f)}function gi({value:s,relative:n=!1}){const{locale:i}=Fe();return u.jsx("time",{dateTime:s,title:s,children:n?_g(s,i):s})}const Sg="(max-width: 959px)";function jg(s){const n=b.useMemo(()=>window.matchMedia(s),[s]),[i,l]=b.useState(n.matches);return b.useEffect(()=>{const c=f=>l(f.matches);return l(n.matches),n.addEventListener("change",c),()=>n.removeEventListener("change",c)},[n]),i}function Eg({message:s,aliases:n}){const{t:i}=Fe(),l=s.from_peer_id===null?i("system"):n.get(s.from_peer_id)??s.from_peer_id;return u.jsxs("article",{className:"core-message","data-message-id":s.id,children:[u.jsxs("div",{className:"core-message__meta",children:[u.jsx("strong",{children:s.kind}),u.jsx("span",{children:i("From {source}",{source:l})}),u.jsx(gi,{value:s.created_at})]}),u.jsx("p",{children:s.content??i("No message content.")})]})}function Ng({subagent:s,onRawTail:n}){const{t:i}=Fe(),[l,c]=b.useState(!1),f=async()=>{if(s.native_session_id!==null)try{await navigator.clipboard.writeText(s.native_session_id)}catch{c(!0)}};return u.jsxs("article",{className:"core-subagent",children:[u.jsxs("div",{className:"core-subagent__heading",children:[u.jsx("strong",{children:s.alias}),u.jsx("span",{className:`semantic-status semantic-status--${["starting","ready","running"].includes(s.status)?"accent":s.status==="native_cli_blocked"?"warning":"muted"}`,children:i(s.status)})]}),u.jsxs("dl",{className:"core-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"CLI"}),u.jsx("dd",{children:s.cli_type})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Model / effort")}),u.jsxs("dd",{children:[s.model??i("Default")," / ",s.reasoning_effort??i("Default")]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Last seen")}),u.jsx("dd",{children:u.jsx(gi,{value:s.last_seen_at})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Last active")}),u.jsx("dd",{children:u.jsx(gi,{value:s.last_seen_at,relative:!0})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Native session")}),u.jsxs("dd",{className:"native-session",children:[u.jsx("code",{children:s.native_session_id??i("Unavailable")}),u.jsx(kt,{label:i("Copy native session ID for {alias}",{alias:s.alias}),disabled:s.native_session_id===null,onClick:()=>void f(),children:u.jsx(Iu,{size:15,"aria-hidden":"true"})})]})]})]}),l?u.jsx("p",{className:"dialog-error",role:"alert",children:i("Session ID copy failed")}):null,u.jsx(kt,{label:i("View raw tail for {alias}",{alias:s.alias}),onClick:n,children:u.jsx(Ev,{size:16,"aria-hidden":"true"})})]})}function bg({choice:s}){const{t:n}=Fe(),i={pending_main_agent:n("Pending"),resolved:n("Resolved"),expired:n("Expired"),cancelled:n("Cancelled")},l=s.options.find(f=>f.id===s.selected),c=s.selected===null?null:l?`${l.label} (${l.id})`:s.selected;return u.jsxs("article",{className:"core-choice",children:[u.jsxs("div",{className:"core-choice__heading",children:[u.jsx("strong",{children:s.question}),u.jsx("span",{className:"semantic-status semantic-status--muted",children:i[s.status]})]}),c!==null||s.rationale!==null?u.jsxs("dl",{className:"core-choice__facts",children:[c!==null?u.jsxs("div",{children:[u.jsx("dt",{children:n("Selection")}),u.jsx("dd",{children:c})]}):null,s.rationale!==null?u.jsxs("div",{children:[u.jsx("dt",{children:n("Rationale")}),u.jsx("dd",{children:s.rationale})]}):null]}):null]})}function Rg({sessionId:s}){var T,Y;const{t:n}=Fe(),i=jg(Sg),[l,c]=b.useState("messages"),[f,p]=b.useState(null),m=b.useRef(null),w=b.useRef(null),S=rt({queryKey:["core","session",s],queryFn:()=>pe(`/admin/core/sessions/${encodeURIComponent(s)}/debug`)}),C=b.useMemo(()=>{var A;return new Map(((A=S.data)==null?void 0:A.subagents.map(F=>[F.id,F.alias]))??[])},[(T=S.data)==null?void 0:T.subagents]),E=b.useMemo(()=>{var A;return[...((A=S.data)==null?void 0:A.messages)??[]].sort((F,Q)=>Date.parse(F.created_at)-Date.parse(Q.created_at)).slice(-500)},[(Y=S.data)==null?void 0:Y.messages]),I=A=>{var F;c(A),(F=(A==="messages"?m:w).current)==null||F.focus()},z=(A,F)=>{let Q=null;A.key==="Home"&&(Q="messages"),A.key==="End"&&(Q="subagents"),A.key==="ArrowLeft"&&(Q=F==="messages"?"subagents":"messages"),A.key==="ArrowRight"&&(Q=F==="messages"?"subagents":"messages"),Q!==null&&(A.preventDefault(),I(Q))};if(S.isPending)return u.jsx("p",{role:"status",children:n("Loading Core session...")});if(S.isError)return u.jsxs("section",{className:"core-unavailable","aria-labelledby":"core-unavailable-title",children:[u.jsx("h1",{id:"core-unavailable-title",children:n("Core session unavailable")}),u.jsx("p",{children:n("Gateway navigation remains available while Core reconnects.")}),u.jsx("button",{type:"button",onClick:()=>void S.refetch(),children:n("Retry Core")})]});const{session:V,subagents:D,choices:P}=S.data;return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"page-heading core-detail-heading",children:u.jsxs("div",{children:[u.jsx("a",{className:"core-back-link",href:"#/core/sessions",children:n("Core Sessions")}),u.jsx("h1",{children:V.root_task}),u.jsxs("p",{children:[u.jsx("code",{children:V.repo_path??n("No repository")})," ",u.jsx("span",{"aria-hidden":"true",children:"/"})," ",V.id]})]})}),i?u.jsxs("div",{className:"core-tabs",role:"tablist","aria-label":n("Core session detail"),children:[u.jsx("button",{id:"core-tab-messages",ref:m,type:"button",role:"tab",tabIndex:l==="messages"?0:-1,"aria-selected":l==="messages","aria-controls":"core-panel-messages",onClick:()=>c("messages"),onKeyDown:A=>z(A,"messages"),children:n("Messages")}),u.jsx("button",{id:"core-tab-subagents",ref:w,type:"button",role:"tab",tabIndex:l==="subagents"?0:-1,"aria-selected":l==="subagents","aria-controls":"core-panel-subagents",onClick:()=>c("subagents"),onKeyDown:A=>z(A,"subagents"),children:n("Subagents")})]}):null,u.jsxs("div",{className:"core-detail-grid",children:[u.jsxs("section",{id:"core-panel-messages",className:"core-panel core-panel--messages",role:i?"tabpanel":"region","aria-labelledby":i?"core-tab-messages":"core-heading-messages",hidden:i&&l!=="messages",children:[i?null:u.jsx("h2",{className:"core-panel__title",id:"core-heading-messages",children:n("Messages")}),E.length===0?u.jsx("p",{className:"core-empty",children:n("No messages.")}):E.map(A=>u.jsx(Eg,{message:A,aliases:C},A.id)),P.map(A=>u.jsx(bg,{choice:A},A.id))]}),u.jsxs("section",{id:"core-panel-subagents",className:"core-panel core-panel--subagents",role:i?"tabpanel":"region","aria-labelledby":i?"core-tab-subagents":"core-heading-subagents",hidden:i&&l!=="subagents",children:[i?null:u.jsx("h2",{className:"core-panel__title",id:"core-heading-subagents",children:n("Subagents")}),D.length===0?u.jsx("p",{className:"core-empty",children:n("No subagents.")}):D.map(A=>u.jsx(Ng,{subagent:A,onRawTail:()=>p(A)},A.id))]})]}),f?u.jsx(Cg,{alias:f.alias,tail:f.raw_tail,onClose:()=>p(null)}):null]})}const Tg=new Set(["starting","ready","running"]);async function Pg(s,n,i){const l=new Array(s.length);let c=0;const f=async()=>{for(;c<s.length;){const p=c;c+=1,l[p]=await i(s[p])}};return await Promise.all(Array.from({length:Math.min(n,s.length)},f)),l}async function Og(){const s=await pe("/admin/core/sessions"),n=await Pg(s.sessions,4,i=>pe(`/admin/core/sessions/${encodeURIComponent(i.id)}/debug`));return s.sessions.map((i,l)=>{const c=n[l].subagents;return{...i,subagentCount:c.length,activeCount:c.filter(f=>Tg.has(f.status)).length,blockedCount:c.filter(f=>f.status==="native_cli_blocked").length}}).sort((i,l)=>Date.parse(l.updated_at)-Date.parse(i.updated_at))}function Ig(s){return[{key:"updated",label:s("Updated"),width:"170px",className:"numeric",render:n=>u.jsx(gi,{value:n.updated_at,relative:!0})},{key:"task",label:s("Task"),width:"34%",render:n=>u.jsx("a",{className:"core-session-link",href:`#/core/sessions/${encodeURIComponent(n.id)}`,children:n.root_task})},{key:"repository",label:s("Repository"),width:"28%",className:"code-cell core-wrap-cell",render:n=>n.repo_path??s("No repository")},{key:"subagents",label:s("Subagents"),width:"100px",className:"numeric",render:n=>n.subagentCount},{key:"active-blocked",label:s("Active / Blocked"),width:"140px",className:"numeric",render:n=>`${n.activeCount} / ${n.blockedCount}`}]}function Lg(){const{t:s}=Fe(),n=rt({queryKey:["core","sessions"],queryFn:Og});return u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:s("Core Sessions")}),u.jsx("p",{children:s("Live read-only session history from Core.")})]}),n.data?u.jsx("span",{className:"record-count",children:s("{count} sessions",{count:n.data.length})}):null]}),n.isPending?u.jsx("p",{role:"status",children:s("Loading Core sessions...")}):n.isError?u.jsxs("section",{className:"core-unavailable","aria-labelledby":"core-sessions-unavailable-title",children:[u.jsx("h2",{id:"core-sessions-unavailable-title",children:s("Core is offline")}),u.jsx("p",{children:s("Gateway remains available. Retry when Core is reachable.")}),u.jsx("button",{type:"button",onClick:()=>void n.refetch(),children:s("Retry Core")})]}):u.jsx("section",{className:"table-section",children:u.jsx(Ar,{ariaLabel:s("Core Sessions"),columns:Ig(s),rows:n.data,rowKey:i=>i.id,emptyTitle:s("No live Core sessions")})})]})}function Mg({choice:s,onClose:n,onResolved:i,onConflict:l}){var F;const{t:c}=Fe(),f=(F=s.recommendation)==null?void 0:F.option_id,[p,m]=b.useState(f&&s.options.some(Q=>Q.id===f)?f:""),[w,S]=b.useState(""),[C,E]=b.useState(!1),[I,z]=b.useState(null),V=b.useRef(null),D=b.useRef(null),P=b.useRef(!1),T=`resolve-${s.id.replace(/[^a-zA-Z0-9_-]/g,"-")}`,Y=b.useCallback(()=>{P.current||n()},[n]);b.useEffect(()=>{var Q;(Q=(C?D:V).current)==null||Q.focus()},[C]);const A=async Q=>{if(Q.preventDefault(),!p||P.current)return;P.current=!0,E(!0),z(null);const ue=w.trim();try{await pe(`/admin/core/sessions/${encodeURIComponent(s.session_id)}/choices/${encodeURIComponent(s.id)}/resolve`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({selected:p,...ue?{rationale:ue}:{}})}),i()}catch(he){if(he instanceof or&&he.status===409){l();return}z(he instanceof Error?he.message:c("Choice resolution failed.")),P.current=!1,E(!1)}};return u.jsx(tn,{title:s.question,onClose:Y,initialFocusRef:V,actions:u.jsxs(u.Fragment,{children:[u.jsx(we,{type:"button",variant:"quiet",disabled:C,onClick:Y,children:c("Cancel")}),u.jsx(we,{type:"submit",form:T,disabled:!p||C,children:c(C?"Submitting...":"Submit choice")})]}),children:u.jsxs("form",{id:T,className:"choice-form",onSubmit:Q=>void A(Q),children:[s.recommendation?u.jsxs("p",{className:"choice-recommendation",children:[u.jsx("strong",{children:c("Recommendation")}),u.jsx("span",{children:s.recommendation.reason})]}):null,u.jsxs("fieldset",{disabled:C,children:[u.jsx("legend",{children:c("Select one option")}),s.options.map((Q,ue)=>u.jsxs("label",{className:"choice-option",children:[u.jsx("input",{ref:ue===0?V:void 0,type:"radio",name:`choice-${s.id}`,value:Q.id,checked:p===Q.id,disabled:C,required:!0,onChange:()=>m(Q.id)}),u.jsxs("span",{children:[u.jsx("strong",{children:Q.label}),Q.tradeoff?u.jsx("small",{children:Q.tradeoff}):null]})]},Q.id))]}),u.jsxs("label",{className:"choice-rationale",children:[u.jsx("span",{children:c("Rationale")}),u.jsx("textarea",{"aria-label":c("Rationale"),value:w,disabled:C,rows:3,onChange:Q=>S(Q.target.value)}),u.jsx("small",{children:c("Optional")})]}),C?u.jsx("p",{ref:D,role:"status",tabIndex:0,children:c("Submitting choice. Please wait.")}):null,I?u.jsx("p",{className:"dialog-error",role:"alert",children:I}):null]})})}const qa=["core","choices","pending"];async function Ag(){const[{choices:s},{sessions:n}]=await Promise.all([pe("/admin/core/choices?status=pending"),pe("/admin/core/sessions")]),i=new Map(n.map(p=>[p.id,p])),l=[...new Set(s.map(p=>p.session_id))],c=await Promise.all(l.map(p=>pe(`/admin/core/sessions/${encodeURIComponent(p)}/debug`))),f=new Map(c.map(p=>[p.session.id,p]));return s.map(p=>{var m,w,S;return{choice:p,sessionTask:((m=i.get(p.session_id))==null?void 0:m.root_task)??p.session_id,subagent:((S=(w=f.get(p.session_id))==null?void 0:w.subagents.find(C=>C.id===p.requester_subagent_id))==null?void 0:S.alias)??p.requester_subagent_id}})}function Fg(){const{t:s}=Fe(),n=Ou(),i=rt({queryKey:qa,queryFn:Ag}),[l,c]=b.useState(null),[f,p]=b.useState(null),m=C=>{n.setQueryData(qa,E=>E==null?void 0:E.filter(I=>!(I.choice.id===C.id&&I.choice.session_id===C.session_id))),c(null),n.invalidateQueries({queryKey:["core","session",C.session_id],exact:!0}),n.invalidateQueries({queryKey:qa,exact:!0})},w=()=>{c(null),p("This choice was already resolved. Pending choices were refreshed."),n.invalidateQueries({queryKey:qa,exact:!0})},S=[{key:"age",label:s("Age"),width:"110px",render:({choice:C})=>u.jsx(gi,{value:C.created_at,relative:!0})},{key:"task",label:s("Session task"),width:"220px",className:"core-wrap-cell",render:({choice:C,sessionTask:E})=>u.jsx("a",{href:`#/core/sessions/${encodeURIComponent(C.session_id)}`,children:E})},{key:"subagent",label:s("Subagent"),width:"110px",render:C=>C.subagent},{key:"question",label:s("Question"),width:"220px",className:"core-wrap-cell",render:({choice:C})=>C.question},{key:"recommendation",label:s("Recommendation"),width:"280px",className:"core-wrap-cell",render:({choice:C})=>{var E;return C.recommendation?u.jsxs("span",{className:"choice-cell-detail",children:[u.jsx("strong",{children:((E=C.options.find(I=>{var z;return I.id===((z=C.recommendation)==null?void 0:z.option_id)}))==null?void 0:E.label)??C.recommendation.option_id}),u.jsx("small",{children:C.recommendation.reason})]}):u.jsx("span",{className:"muted",children:s("None")})}},{key:"actions",label:"",width:"100px",className:"actions-cell",render:({choice:C})=>u.jsx(we,{type:"button","aria-label":s("Resolve {question}",{question:C.question}),onClick:()=>{p(null),c(C)},children:s("Resolve")})}];return u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"page-heading",children:[u.jsxs("div",{children:[u.jsx("h1",{children:s("Pending Core Choices")}),u.jsx("p",{children:s("Explicit decisions requested by Core subagents.")})]}),i.data?u.jsx("span",{className:"record-count",children:s("{count} pending",{count:i.data.length})}):null]}),f?u.jsx("p",{className:"operation-notice",role:"status",children:s(f)}):null,i.isPending?u.jsx("p",{role:"status",children:s("Loading pending Core choices...")}):i.isError?u.jsxs("section",{className:"core-unavailable","aria-labelledby":"core-choices-unavailable-title",children:[u.jsx("h2",{id:"core-choices-unavailable-title",children:s("Core is offline")}),u.jsx("p",{children:s("Gateway remains available. Retry when Core is reachable.")}),u.jsx(we,{type:"button",onClick:()=>void i.refetch(),children:s("Retry Core")})]}):u.jsx("section",{className:"table-section",children:u.jsx(Ar,{ariaLabel:s("Pending Core Choices"),columns:S,rows:i.data,rowKey:C=>C.choice.id,emptyTitle:s("No pending Core choices")})}),l?u.jsx(Mg,{choice:l,onClose:()=>c(null),onResolved:()=>m(l),onConflict:w}):null]})}function zg({onLogout:s,webUiAuth:n}){const{t:i}=Fe(),l=rt({queryKey:["settings"],queryFn:()=>pe("/admin/settings")}),[c,f]=b.useState(""),p=ct({mutationFn:()=>pe("/admin/settings/core",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({base_url:c})}),onSuccess:async()=>{await yt.invalidateQueries({queryKey:["settings"]})}});b.useEffect(()=>{l.data&&f(l.data.core.base_url)},[l.data]);const m=l.data;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-heading",children:u.jsxs("div",{children:[u.jsx("h1",{children:i("Settings")}),u.jsx("p",{children:i("Gateway connection and local policy")})]})}),u.jsxs("section",{className:"settings-section","aria-labelledby":"core-settings-title",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"core-settings-title",children:i("Core connection")}),u.jsx("span",{children:m!=null&&m.core.status?i(m.core.status):i("unknown")})]}),u.jsxs("div",{className:"settings-core-row",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:i("Core URL")}),u.jsx("input",{value:c,onChange:w=>f(w.target.value)})]}),u.jsxs(we,{disabled:!c||p.isPending,onClick:()=>p.mutate(),children:[u.jsx(jv,{size:15,"aria-hidden":"true"})," ",i("Save Core URL")]})]}),p.isError?u.jsx("p",{role:"alert",className:"dialog-error",children:i("Core URL must be a loopback HTTP URL")}):null]}),u.jsxs("section",{className:"settings-section","aria-labelledby":"gateway-definitions-title",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"gateway-definitions-title",children:i("Gateway definitions")}),u.jsx("span",{children:i("Read only")})]}),m?u.jsxs("dl",{className:"definition-list",children:[u.jsxs("div",{children:[u.jsx("dt",{children:i("Bind address")}),u.jsx("dd",{children:m.bind_address})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Config path")}),u.jsx("dd",{children:m.state_paths.config})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Database path")}),u.jsx("dd",{children:m.state_paths.database})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Master key path")}),u.jsx("dd",{children:m.state_paths.master_key})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Admin secret path")}),u.jsx("dd",{children:m.state_paths.admin_secret})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Metadata retention")}),u.jsx("dd",{children:i("{count} days",{count:m.retention.metadata_days})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Replay TTL")}),u.jsx("dd",{children:i("{count} minutes",{count:m.retention.replay_ttl_minutes})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Network policy")}),u.jsx("dd",{children:m.security.bind})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"CORS"}),u.jsx("dd",{children:m.security.cors})]}),u.jsxs("div",{children:[u.jsx("dt",{children:i("Web UI authentication")}),u.jsx("dd",{children:m.security.web_ui_auth})]})]}):u.jsx("p",{className:"muted",children:l.isError?i("Settings unavailable"):i("Loading settings")})]}),n==="token"?u.jsxs("section",{className:"settings-section","aria-labelledby":"session-settings-title",children:[u.jsx("div",{className:"section-heading",children:u.jsx("h2",{id:"session-settings-title",children:i("Admin session")})}),u.jsxs(we,{variant:"quiet",onClick:()=>void s(),children:[u.jsx(rp,{size:15,"aria-hidden":"true"})," ",i("End local session")]})]}):null]})}function Dg(s){return s.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Ug(s){return s.flatMap(n=>{const{cli:i,capabilities:l}=n;if(!l.available||!l.modelOptions)return[];if(i==="claude"){const c=l.modelOptions.find(f=>f.id==="default");return c?[{id:"claude-default-max",cli:i,label:`${c.label} / max`,nativeModel:"default",effort:"max",availability:n}]:[]}return i!=="codex"&&i!=="cursor"&&i!=="opencode"&&i!=="antigravity"?[]:l.modelOptions.map(c=>{var m,w;const f=i==="codex"?(m=c.effortOptions)!=null&&m.includes("max")?"max":((w=c.effortOptions)==null?void 0:w.at(-1))??null:null,p=i==="antigravity"?c.label:c.id;return{id:Dg([i,p,f].filter(Boolean).join("-")),cli:i,label:f?`${c.label} / ${f}`:c.label,nativeModel:p,effort:f,availability:n}})})}async function $a(){await yt.invalidateQueries({queryKey:["setup-status"]})}function qg(){var B,Se;const{t:s}=Fe(),n=rt({queryKey:["settings"],queryFn:()=>pe("/admin/settings")}),i=rt({queryKey:["setup-status"],queryFn:()=>pe("/admin/setup/status")}),l=rt({queryKey:["cli-availability"],queryFn:()=>pe("/admin/cli-availability"),enabled:((B=i.data)==null?void 0:B.cli_scan_complete)===!0}),[c,f]=b.useState(""),[p,m]=b.useState(!1),[w,S]=b.useState(null),[C,E]=b.useState(!1),[I,z]=b.useState(new Set),[V,D]=b.useState(""),[P,T]=b.useState(null);b.useEffect(()=>()=>T(null),[]),b.useEffect(()=>{n.data&&f(n.data.core.base_url)},[n.data]);const Y=ct({mutationFn:()=>pe("/admin/cli-availability/refresh",{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),onSuccess:async te=>{yt.setQueryData(["cli-availability"],te),await $a()}}),A=b.useMemo(()=>{var te;return Ug(((te=l.data)==null?void 0:te.cli_availability)??[])},[l.data]),F=ct({mutationFn:async()=>{const te=A.filter(ge=>I.has(ge.id));await Promise.all(te.map(ge=>pe("/admin/targets",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:ge.id,aliases:[],cli:ge.cli,native_model:ge.nativeModel,reasoning_effort:ge.effort,isolation_level:ge.availability.capabilities.isolationLevel,streaming_mode:ge.availability.capabilities.streamingMode,tool_bridge:ge.availability.capabilities.toolBridge,max_concurrency:1,max_queue:8,queue_timeout_ms:3e5,run_timeout_ms:null})})))},onSuccess:async()=>{z(new Set),await $a()}}),Q=ct({mutationFn:async()=>{const te=await pe("/admin/setup/client-credential",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:V})});T({...te,name:V})},onSuccess:$a}),ue=async()=>{E(!0),S(null);try{await pe("/admin/settings/core",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({base_url:c})});try{await pe("/admin/core/health"),S("Core is online")}catch{S("Core is offline; setup can continue")}await yt.invalidateQueries({queryKey:["settings"]}),await $a()}catch{S("Core URL must be a loopback HTTP URL")}finally{E(!1)}},he=i.data,oe=(he==null?void 0:he.cli_scan_complete)??!1,U=(((Se=l.data)==null?void 0:Se.cli_availability)??[]).filter(te=>te.capabilities.available),le=((he==null?void 0:he.credential_count)??0)>0||P!==null;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-heading",children:u.jsxs("div",{children:[u.jsx("h1",{children:s("Gateway setup")}),u.jsx("p",{children:s("Local connections, targets, and client access")})]})}),u.jsxs("div",{className:"setup-steps",children:[u.jsxs("section",{className:"setup-step","aria-labelledby":"setup-core-title",children:[u.jsx("div",{className:"setup-step__index",children:u.jsx(Nv,{size:16,"aria-hidden":"true"})}),u.jsxs("div",{className:"setup-step__body",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"setup-core-title",children:s("1. Core connection")}),u.jsx("span",{children:s(he!=null&&he.core_configured||p?"Complete":"Optional")})]}),u.jsxs("div",{className:"setup-inline",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("Core URL")}),u.jsx("input",{value:c,onChange:te=>f(te.target.value)})]}),u.jsx(we,{disabled:!c||C,onClick:()=>void ue(),children:s("Check Core")}),u.jsx(we,{variant:"quiet",onClick:()=>m(!0),children:s("Skip Core")})]}),w?u.jsx("p",{role:"status",className:w==="Core URL must be a loopback HTTP URL"?"dialog-error":"muted",children:s(w)}):null]})]}),u.jsxs("section",{className:"setup-step","aria-labelledby":"setup-cli-title",children:[u.jsx("div",{className:"setup-step__index",children:u.jsx(ip,{size:16,"aria-hidden":"true"})}),u.jsxs("div",{className:"setup-step__body",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"setup-cli-title",children:s("2. CLI static scan")}),u.jsx("span",{children:s(oe?"Complete":"Pending")})]}),u.jsxs("div",{className:"setup-actions",children:[u.jsxs(we,{disabled:Y.isPending,onClick:()=>Y.mutate(),children:[u.jsx(sp,{size:15,"aria-hidden":"true"})," ",s(oe?"Refresh CLIs":"Scan CLIs")]}),u.jsx("span",{children:s("No model usage")})]}),oe&&U.length===0?u.jsx("p",{role:"status",className:"muted",children:s("No installed CLIs found")}):null]})]}),u.jsxs("section",{className:"setup-step","aria-labelledby":"setup-targets-title",children:[u.jsx("div",{className:"setup-step__index",children:u.jsx(mv,{size:16,"aria-hidden":"true"})}),u.jsxs("div",{className:"setup-step__body",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"setup-targets-title",children:s("3. Invocation Targets")}),u.jsx("span",{children:s("{count} created",{count:(he==null?void 0:he.target_count)??0})})]}),A.length>0?u.jsx("div",{className:"suggestion-list",children:A.map(te=>u.jsxs(Lr,{className:"suggestion-row",label:s("Select {id}",{id:te.id}),checked:I.has(te.id),onCheckedChange:ge=>z(ze=>{const Be=new Set(ze);return ge?Be.add(te.id):Be.delete(te.id),Be}),children:[u.jsx("strong",{children:te.id}),u.jsxs("small",{children:[te.cli," / ",te.label]})]},te.id))}):u.jsx("p",{className:"muted",children:s(oe?"No target suggestions":"Scan CLIs to load suggestions")}),A.length>0?u.jsx(we,{disabled:I.size===0||F.isPending,onClick:()=>F.mutate(),children:s("Create selected targets")}):null]})]}),u.jsxs("section",{className:"setup-step","aria-labelledby":"setup-client-title",children:[u.jsx("div",{className:"setup-step__index",children:u.jsx(Lu,{size:16,"aria-hidden":"true"})}),u.jsxs("div",{className:"setup-step__body",children:[u.jsxs("div",{className:"section-heading",children:[u.jsx("h2",{id:"setup-client-title",children:s("4. Client and key")}),u.jsx("span",{children:s(le?"Complete":"Required")})]}),u.jsxs("div",{className:"setup-inline",children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:s("Client name")}),u.jsx("input",{value:V,onChange:te=>D(te.target.value)})]}),u.jsx(we,{disabled:!V.trim()||Q.isPending,onClick:()=>Q.mutate(),children:s("Create client and key")})]}),P?u.jsx(mp,{label:P.name,prefix:P.prefix,initialSecret:P.api_key,reveal:async()=>(await pe(`/admin/credentials/${encodeURIComponent(P.id)}/reveal`)).api_key}):le?u.jsx("p",{className:"muted",children:s("Existing keys remain revealable under Clients and Keys")}):null]})]})]}),u.jsx("div",{className:"setup-finish",children:u.jsx(we,{disabled:!le,onClick:()=>{window.location.hash="#/overview"},children:s("Finish setup")})})]})}var Pe;(function(s){s.assertEqual=c=>{};function n(c){}s.assertIs=n;function i(c){throw new Error}s.assertNever=i,s.arrayToEnum=c=>{const f={};for(const p of c)f[p]=p;return f},s.getValidEnumValues=c=>{const f=s.objectKeys(c).filter(m=>typeof c[c[m]]!="number"),p={};for(const m of f)p[m]=c[m];return s.objectValues(p)},s.objectValues=c=>s.objectKeys(c).map(function(f){return c[f]}),s.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{const f=[];for(const p in c)Object.prototype.hasOwnProperty.call(c,p)&&f.push(p);return f},s.find=(c,f)=>{for(const p of c)if(f(p))return p},s.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&Number.isFinite(c)&&Math.floor(c)===c;function l(c,f=" | "){return c.map(p=>typeof p=="string"?`'${p}'`:p).join(f)}s.joinValues=l,s.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(Pe||(Pe={}));var hh;(function(s){s.mergeShapes=(n,i)=>({...n,...i})})(hh||(hh={}));const ee=Pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gn=s=>{switch(typeof s){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return Number.isNaN(s)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"symbol":return ee.symbol;case"object":return Array.isArray(s)?ee.array:s===null?ee.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?ee.promise:typeof Map<"u"&&s instanceof Map?ee.map:typeof Set<"u"&&s instanceof Set?ee.set:typeof Date<"u"&&s instanceof Date?ee.date:ee.object;default:return ee.unknown}},$=Pe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Rn extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=n}format(n){const i=n||function(f){return f.message},l={_errors:[]},c=f=>{for(const p of f.issues)if(p.code==="invalid_union")p.unionErrors.map(c);else if(p.code==="invalid_return_type")c(p.returnTypeError);else if(p.code==="invalid_arguments")c(p.argumentsError);else if(p.path.length===0)l._errors.push(i(p));else{let m=l,w=0;for(;w<p.path.length;){const S=p.path[w];w===p.path.length-1?(m[S]=m[S]||{_errors:[]},m[S]._errors.push(i(p))):m[S]=m[S]||{_errors:[]},m=m[S],w++}}};return c(this),l}static assert(n){if(!(n instanceof Rn))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=i=>i.message){const i={},l=[];for(const c of this.issues)if(c.path.length>0){const f=c.path[0];i[f]=i[f]||[],i[f].push(n(c))}else l.push(n(c));return{formErrors:l,fieldErrors:i}}get formErrors(){return this.flatten()}}Rn.create=s=>new Rn(s);const xu=(s,n)=>{let i;switch(s.code){case $.invalid_type:s.received===ee.undefined?i="Required":i=`Expected ${s.expected}, received ${s.received}`;break;case $.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(s.expected,Pe.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:i=`Unrecognized key(s) in object: ${Pe.joinValues(s.keys,", ")}`;break;case $.invalid_union:i="Invalid input";break;case $.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Pe.joinValues(s.options)}`;break;case $.invalid_enum_value:i=`Invalid enum value. Expected ${Pe.joinValues(s.options)}, received '${s.received}'`;break;case $.invalid_arguments:i="Invalid function arguments";break;case $.invalid_return_type:i="Invalid function return type";break;case $.invalid_date:i="Invalid date";break;case $.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(i=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?i=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?i=`Invalid input: must end with "${s.validation.endsWith}"`:Pe.assertNever(s.validation):s.validation!=="regex"?i=`Invalid ${s.validation}`:i="Invalid";break;case $.too_small:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:i="Invalid input";break;case $.too_big:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?i=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:i="Invalid input";break;case $.custom:i="Invalid input";break;case $.invalid_intersection_types:i="Intersection results could not be merged";break;case $.not_multiple_of:i=`Number must be a multiple of ${s.multipleOf}`;break;case $.not_finite:i="Number must be finite";break;default:i=n.defaultError,Pe.assertNever(s)}return{message:i}};let $g=xu;function Vg(){return $g}const Qg=s=>{const{data:n,path:i,errorMaps:l,issueData:c}=s,f=[...i,...c.path||[]],p={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let m="";const w=l.filter(S=>!!S).slice().reverse();for(const S of w)m=S(p,{data:n,defaultError:m}).message;return{...c,path:f,message:m}};function W(s,n){const i=Vg(),l=Qg({issueData:n,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,i,i===xu?void 0:xu].filter(c=>!!c)});s.common.issues.push(l)}class Ct{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,i){const l=[];for(const c of i){if(c.status==="aborted")return ve;c.status==="dirty"&&n.dirty(),l.push(c.value)}return{status:n.value,value:l}}static async mergeObjectAsync(n,i){const l=[];for(const c of i){const f=await c.key,p=await c.value;l.push({key:f,value:p})}return Ct.mergeObjectSync(n,l)}static mergeObjectSync(n,i){const l={};for(const c of i){const{key:f,value:p}=c;if(f.status==="aborted"||p.status==="aborted")return ve;f.status==="dirty"&&n.dirty(),p.status==="dirty"&&n.dirty(),f.value!=="__proto__"&&(typeof p.value<"u"||c.alwaysSet)&&(l[f.value]=p.value)}return{status:n.value,value:l}}}const ve=Object.freeze({status:"aborted"}),pi=s=>({status:"dirty",value:s}),Ht=s=>({status:"valid",value:s}),ph=s=>s.status==="aborted",mh=s=>s.status==="dirty",Cs=s=>s.status==="valid",Za=s=>typeof Promise<"u"&&s instanceof Promise;var se;(function(s){s.errToObj=n=>typeof n=="string"?{message:n}:n||{},s.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(se||(se={}));class fn{constructor(n,i,l,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=l,this._key=c}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const yh=(s,n)=>{if(Cs(n))return{success:!0,data:n.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new Rn(s.common.issues);return this._error=i,this._error}}};function ke(s){if(!s)return{};const{errorMap:n,invalid_type_error:i,required_error:l,description:c}=s;if(n&&(i||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:c}:{errorMap:(p,m)=>{const{message:w}=s;return p.code==="invalid_enum_value"?{message:w??m.defaultError}:typeof m.data>"u"?{message:w??l??m.defaultError}:p.code!=="invalid_type"?{message:m.defaultError}:{message:w??i??m.defaultError}},description:c}}class be{get description(){return this._def.description}_getType(n){return Gn(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Gn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Ct,ctx:{common:n.parent.common,data:n.data,parsedType:Gn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const i=this._parse(n);if(Za(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){const i=this._parse(n);return Promise.resolve(i)}parse(n,i){const l=this.safeParse(n,i);if(l.success)return l.data;throw l.error}safeParse(n,i){const l={common:{issues:[],async:(i==null?void 0:i.async)??!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Gn(n)},c=this._parseSync({data:n,path:l.path,parent:l});return yh(l,c)}"~validate"(n){var l,c;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Gn(n)};if(!this["~standard"].async)try{const f=this._parseSync({data:n,path:[],parent:i});return Cs(f)?{value:f.value}:{issues:i.common.issues}}catch(f){(c=(l=f==null?void 0:f.message)==null?void 0:l.toLowerCase())!=null&&c.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:i}).then(f=>Cs(f)?{value:f.value}:{issues:i.common.issues})}async parseAsync(n,i){const l=await this.safeParseAsync(n,i);if(l.success)return l.data;throw l.error}async safeParseAsync(n,i){const l={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Gn(n)},c=this._parse({data:n,path:l.path,parent:l}),f=await(Za(c)?c:Promise.resolve(c));return yh(l,f)}refine(n,i){const l=c=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(c):i;return this._refinement((c,f)=>{const p=n(c),m=()=>f.addIssue({code:$.custom,...l(c)});return typeof Promise<"u"&&p instanceof Promise?p.then(w=>w?!0:(m(),!1)):p?!0:(m(),!1)})}refinement(n,i){return this._refinement((l,c)=>n(l)?!0:(c.addIssue(typeof i=="function"?i(l,c):i),!1))}_refinement(n){return new Ss({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return lr.create(this,this._def)}nullable(){return js.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dn.create(this)}promise(){return el.create(this,this._def)}or(n){return Ya.create([this,n],this._def)}and(n){return Ja.create(this,n,this._def)}transform(n){return new Ss({...ke(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const i=typeof n=="function"?n:()=>n;return new Cu({...ke(this._def),innerType:this,defaultValue:i,typeName:ye.ZodDefault})}brand(){return new h0({typeName:ye.ZodBranded,type:this,...ke(this._def)})}catch(n){const i=typeof n=="function"?n:()=>n;return new _u({...ke(this._def),innerType:this,catchValue:i,typeName:ye.ZodCatch})}describe(n){const i=this.constructor;return new i({...this._def,description:n})}pipe(n){return Du.create(this,n)}readonly(){return Su.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bg=/^c[^\s-]{8,}$/i,Hg=/^[0-9a-z]+$/,Kg=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Wg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Zg=/^[a-z0-9_-]{21}$/i,Gg=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Yg=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Jg=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let nu;const e0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,t0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,n0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,s0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,i0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yp="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",a0=new RegExp(`^${yp}$`);function vp(s){let n="[0-5]\\d";s.precision?n=`${n}\\.\\d{${s.precision}}`:s.precision==null&&(n=`${n}(\\.\\d+)?`);const i=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${i}`}function l0(s){return new RegExp(`^${vp(s)}$`)}function o0(s){let n=`${yp}T${vp(s)}`;const i=[];return i.push(s.local?"Z?":"Z"),s.offset&&i.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${i.join("|")})`,new RegExp(`^${n}$`)}function u0(s,n){return!!((n==="v4"||!n)&&e0.test(s)||(n==="v6"||!n)&&n0.test(s))}function c0(s,n){if(!Gg.test(s))return!1;try{const[i]=s.split(".");if(!i)return!1;const l=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),c=JSON.parse(atob(l));return!(typeof c!="object"||c===null||"typ"in c&&(c==null?void 0:c.typ)!=="JWT"||!c.alg||n&&c.alg!==n)}catch{return!1}}function d0(s,n){return!!((n==="v4"||!n)&&t0.test(s)||(n==="v6"||!n)&&r0.test(s))}class Nn extends be{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==ee.string){const f=this._getOrReturnCtx(n);return W(f,{code:$.invalid_type,expected:ee.string,received:f.parsedType}),ve}const l=new Ct;let c;for(const f of this._def.checks)if(f.kind==="min")n.data.length<f.value&&(c=this._getOrReturnCtx(n,c),W(c,{code:$.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),l.dirty());else if(f.kind==="max")n.data.length>f.value&&(c=this._getOrReturnCtx(n,c),W(c,{code:$.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),l.dirty());else if(f.kind==="length"){const p=n.data.length>f.value,m=n.data.length<f.value;(p||m)&&(c=this._getOrReturnCtx(n,c),p?W(c,{code:$.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):m&&W(c,{code:$.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),l.dirty())}else if(f.kind==="email")Jg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"email",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="emoji")nu||(nu=new RegExp(Xg,"u")),nu.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"emoji",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="uuid")Wg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"uuid",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="nanoid")Zg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"nanoid",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="cuid")Bg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"cuid",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="cuid2")Hg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"cuid2",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="ulid")Kg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"ulid",code:$.invalid_string,message:f.message}),l.dirty());else if(f.kind==="url")try{new URL(n.data)}catch{c=this._getOrReturnCtx(n,c),W(c,{validation:"url",code:$.invalid_string,message:f.message}),l.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"regex",code:$.invalid_string,message:f.message}),l.dirty())):f.kind==="trim"?n.data=n.data.trim():f.kind==="includes"?n.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(n,c),W(c,{code:$.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),l.dirty()):f.kind==="toLowerCase"?n.data=n.data.toLowerCase():f.kind==="toUpperCase"?n.data=n.data.toUpperCase():f.kind==="startsWith"?n.data.startsWith(f.value)||(c=this._getOrReturnCtx(n,c),W(c,{code:$.invalid_string,validation:{startsWith:f.value},message:f.message}),l.dirty()):f.kind==="endsWith"?n.data.endsWith(f.value)||(c=this._getOrReturnCtx(n,c),W(c,{code:$.invalid_string,validation:{endsWith:f.value},message:f.message}),l.dirty()):f.kind==="datetime"?o0(f).test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{code:$.invalid_string,validation:"datetime",message:f.message}),l.dirty()):f.kind==="date"?a0.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{code:$.invalid_string,validation:"date",message:f.message}),l.dirty()):f.kind==="time"?l0(f).test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{code:$.invalid_string,validation:"time",message:f.message}),l.dirty()):f.kind==="duration"?Yg.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"duration",code:$.invalid_string,message:f.message}),l.dirty()):f.kind==="ip"?u0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"ip",code:$.invalid_string,message:f.message}),l.dirty()):f.kind==="jwt"?c0(n.data,f.alg)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"jwt",code:$.invalid_string,message:f.message}),l.dirty()):f.kind==="cidr"?d0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"cidr",code:$.invalid_string,message:f.message}),l.dirty()):f.kind==="base64"?s0.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"base64",code:$.invalid_string,message:f.message}),l.dirty()):f.kind==="base64url"?i0.test(n.data)||(c=this._getOrReturnCtx(n,c),W(c,{validation:"base64url",code:$.invalid_string,message:f.message}),l.dirty()):Pe.assertNever(f);return{status:l.value,value:n.data}}_regex(n,i,l){return this.refinement(c=>n.test(c),{validation:i,code:$.invalid_string,...se.errToObj(l)})}_addCheck(n){return new Nn({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...se.errToObj(n)})}url(n){return this._addCheck({kind:"url",...se.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...se.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...se.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...se.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...se.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...se.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...se.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...se.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...se.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...se.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...se.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...se.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(n==null?void 0:n.offset)??!1,local:(n==null?void 0:n.local)??!1,...se.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...se.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...se.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...se.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i==null?void 0:i.position,...se.errToObj(i==null?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...se.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...se.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...se.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...se.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...se.errToObj(i)})}nonempty(n){return this.min(1,se.errToObj(n))}trim(){return new Nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Nn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxLength(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}Nn.create=s=>new Nn({checks:[],typeName:ye.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...ke(s)});function f0(s,n){const i=(s.toString().split(".")[1]||"").length,l=(n.toString().split(".")[1]||"").length,c=i>l?i:l,f=Number.parseInt(s.toFixed(c).replace(".","")),p=Number.parseInt(n.toFixed(c).replace(".",""));return f%p/10**c}class xi extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==ee.number){const f=this._getOrReturnCtx(n);return W(f,{code:$.invalid_type,expected:ee.number,received:f.parsedType}),ve}let l;const c=new Ct;for(const f of this._def.checks)f.kind==="int"?Pe.isInteger(n.data)||(l=this._getOrReturnCtx(n,l),W(l,{code:$.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(l=this._getOrReturnCtx(n,l),W(l,{code:$.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(l=this._getOrReturnCtx(n,l),W(l,{code:$.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?f0(n.data,f.value)!==0&&(l=this._getOrReturnCtx(n,l),W(l,{code:$.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(n.data)||(l=this._getOrReturnCtx(n,l),W(l,{code:$.not_finite,message:f.message}),c.dirty()):Pe.assertNever(f);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,se.toString(i))}gt(n,i){return this.setLimit("min",n,!1,se.toString(i))}lte(n,i){return this.setLimit("max",n,!0,se.toString(i))}lt(n,i){return this.setLimit("max",n,!1,se.toString(i))}setLimit(n,i,l,c){return new xi({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:l,message:se.toString(c)}]})}_addCheck(n){return new xi({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:se.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:se.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:se.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.toString(n)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&Pe.isInteger(n.value))}get isFinite(){let n=null,i=null;for(const l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(i===null||l.value>i)&&(i=l.value):l.kind==="max"&&(n===null||l.value<n)&&(n=l.value)}return Number.isFinite(i)&&Number.isFinite(n)}}xi.create=s=>new xi({checks:[],typeName:ye.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...ke(s)});class wi extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==ee.bigint)return this._getInvalidInput(n);let l;const c=new Ct;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(l=this._getOrReturnCtx(n,l),W(l,{code:$.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(l=this._getOrReturnCtx(n,l),W(l,{code:$.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?n.data%f.value!==BigInt(0)&&(l=this._getOrReturnCtx(n,l),W(l,{code:$.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):Pe.assertNever(f);return{status:c.value,value:n.data}}_getInvalidInput(n){const i=this._getOrReturnCtx(n);return W(i,{code:$.invalid_type,expected:ee.bigint,received:i.parsedType}),ve}gte(n,i){return this.setLimit("min",n,!0,se.toString(i))}gt(n,i){return this.setLimit("min",n,!1,se.toString(i))}lte(n,i){return this.setLimit("max",n,!0,se.toString(i))}lt(n,i){return this.setLimit("max",n,!1,se.toString(i))}setLimit(n,i,l,c){return new wi({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:l,message:se.toString(c)}]})}_addCheck(n){return new wi({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:se.toString(i)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}wi.create=s=>new wi({checks:[],typeName:ye.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...ke(s)});class vh extends be{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==ee.boolean){const l=this._getOrReturnCtx(n);return W(l,{code:$.invalid_type,expected:ee.boolean,received:l.parsedType}),ve}return Ht(n.data)}}vh.create=s=>new vh({typeName:ye.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...ke(s)});class Ga extends be{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==ee.date){const f=this._getOrReturnCtx(n);return W(f,{code:$.invalid_type,expected:ee.date,received:f.parsedType}),ve}if(Number.isNaN(n.data.getTime())){const f=this._getOrReturnCtx(n);return W(f,{code:$.invalid_date}),ve}const l=new Ct;let c;for(const f of this._def.checks)f.kind==="min"?n.data.getTime()<f.value&&(c=this._getOrReturnCtx(n,c),W(c,{code:$.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),l.dirty()):f.kind==="max"?n.data.getTime()>f.value&&(c=this._getOrReturnCtx(n,c),W(c,{code:$.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),l.dirty()):Pe.assertNever(f);return{status:l.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Ga({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:se.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:se.toString(i)})}get minDate(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n!=null?new Date(n):null}}Ga.create=s=>new Ga({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:ye.ZodDate,...ke(s)});class gh extends be{_parse(n){if(this._getType(n)!==ee.symbol){const l=this._getOrReturnCtx(n);return W(l,{code:$.invalid_type,expected:ee.symbol,received:l.parsedType}),ve}return Ht(n.data)}}gh.create=s=>new gh({typeName:ye.ZodSymbol,...ke(s)});class xh extends be{_parse(n){if(this._getType(n)!==ee.undefined){const l=this._getOrReturnCtx(n);return W(l,{code:$.invalid_type,expected:ee.undefined,received:l.parsedType}),ve}return Ht(n.data)}}xh.create=s=>new xh({typeName:ye.ZodUndefined,...ke(s)});class wh extends be{_parse(n){if(this._getType(n)!==ee.null){const l=this._getOrReturnCtx(n);return W(l,{code:$.invalid_type,expected:ee.null,received:l.parsedType}),ve}return Ht(n.data)}}wh.create=s=>new wh({typeName:ye.ZodNull,...ke(s)});class kh extends be{constructor(){super(...arguments),this._any=!0}_parse(n){return Ht(n.data)}}kh.create=s=>new kh({typeName:ye.ZodAny,...ke(s)});class wu extends be{constructor(){super(...arguments),this._unknown=!0}_parse(n){return Ht(n.data)}}wu.create=s=>new wu({typeName:ye.ZodUnknown,...ke(s)});class ur extends be{_parse(n){const i=this._getOrReturnCtx(n);return W(i,{code:$.invalid_type,expected:ee.never,received:i.parsedType}),ve}}ur.create=s=>new ur({typeName:ye.ZodNever,...ke(s)});class Ch extends be{_parse(n){if(this._getType(n)!==ee.undefined){const l=this._getOrReturnCtx(n);return W(l,{code:$.invalid_type,expected:ee.void,received:l.parsedType}),ve}return Ht(n.data)}}Ch.create=s=>new Ch({typeName:ye.ZodVoid,...ke(s)});class dn extends be{_parse(n){const{ctx:i,status:l}=this._processInputParams(n),c=this._def;if(i.parsedType!==ee.array)return W(i,{code:$.invalid_type,expected:ee.array,received:i.parsedType}),ve;if(c.exactLength!==null){const p=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;(p||m)&&(W(i,{code:p?$.too_big:$.too_small,minimum:m?c.exactLength.value:void 0,maximum:p?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),l.dirty())}if(c.minLength!==null&&i.data.length<c.minLength.value&&(W(i,{code:$.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),l.dirty()),c.maxLength!==null&&i.data.length>c.maxLength.value&&(W(i,{code:$.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),l.dirty()),i.common.async)return Promise.all([...i.data].map((p,m)=>c.type._parseAsync(new fn(i,p,i.path,m)))).then(p=>Ct.mergeArray(l,p));const f=[...i.data].map((p,m)=>c.type._parseSync(new fn(i,p,i.path,m)));return Ct.mergeArray(l,f)}get element(){return this._def.type}min(n,i){return new dn({...this._def,minLength:{value:n,message:se.toString(i)}})}max(n,i){return new dn({...this._def,maxLength:{value:n,message:se.toString(i)}})}length(n,i){return new dn({...this._def,exactLength:{value:n,message:se.toString(i)}})}nonempty(n){return this.min(1,n)}}dn.create=(s,n)=>new dn({type:s,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...ke(n)});function os(s){if(s instanceof Xe){const n={};for(const i in s.shape){const l=s.shape[i];n[i]=lr.create(os(l))}return new Xe({...s._def,shape:()=>n})}else return s instanceof dn?new dn({...s._def,type:os(s.element)}):s instanceof lr?lr.create(os(s.unwrap())):s instanceof js?js.create(os(s.unwrap())):s instanceof Mr?Mr.create(s.items.map(n=>os(n))):s}class Xe extends be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),i=Pe.objectKeys(n);return this._cached={shape:n,keys:i},this._cached}_parse(n){if(this._getType(n)!==ee.object){const S=this._getOrReturnCtx(n);return W(S,{code:$.invalid_type,expected:ee.object,received:S.parsedType}),ve}const{status:l,ctx:c}=this._processInputParams(n),{shape:f,keys:p}=this._getCached(),m=[];if(!(this._def.catchall instanceof ur&&this._def.unknownKeys==="strip"))for(const S in c.data)p.includes(S)||m.push(S);const w=[];for(const S of p){const C=f[S],E=c.data[S];w.push({key:{status:"valid",value:S},value:C._parse(new fn(c,E,c.path,S)),alwaysSet:S in c.data})}if(this._def.catchall instanceof ur){const S=this._def.unknownKeys;if(S==="passthrough")for(const C of m)w.push({key:{status:"valid",value:C},value:{status:"valid",value:c.data[C]}});else if(S==="strict")m.length>0&&(W(c,{code:$.unrecognized_keys,keys:m}),l.dirty());else if(S!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const S=this._def.catchall;for(const C of m){const E=c.data[C];w.push({key:{status:"valid",value:C},value:S._parse(new fn(c,E,c.path,C)),alwaysSet:C in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const S=[];for(const C of w){const E=await C.key,I=await C.value;S.push({key:E,value:I,alwaysSet:C.alwaysSet})}return S}).then(S=>Ct.mergeObjectSync(l,S)):Ct.mergeObjectSync(l,w)}get shape(){return this._def.shape()}strict(n){return se.errToObj,new Xe({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,l)=>{var f,p;const c=((p=(f=this._def).errorMap)==null?void 0:p.call(f,i,l).message)??l.defaultError;return i.code==="unrecognized_keys"?{message:se.errToObj(n).message??c}:{message:c}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(n){return new Xe({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Xe({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:ye.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new Xe({...this._def,catchall:n})}pick(n){const i={};for(const l of Pe.objectKeys(n))n[l]&&this.shape[l]&&(i[l]=this.shape[l]);return new Xe({...this._def,shape:()=>i})}omit(n){const i={};for(const l of Pe.objectKeys(this.shape))n[l]||(i[l]=this.shape[l]);return new Xe({...this._def,shape:()=>i})}deepPartial(){return os(this)}partial(n){const i={};for(const l of Pe.objectKeys(this.shape)){const c=this.shape[l];n&&!n[l]?i[l]=c:i[l]=c.optional()}return new Xe({...this._def,shape:()=>i})}required(n){const i={};for(const l of Pe.objectKeys(this.shape))if(n&&!n[l])i[l]=this.shape[l];else{let f=this.shape[l];for(;f instanceof lr;)f=f._def.innerType;i[l]=f}return new Xe({...this._def,shape:()=>i})}keyof(){return gp(Pe.objectKeys(this.shape))}}Xe.create=(s,n)=>new Xe({shape:()=>s,unknownKeys:"strip",catchall:ur.create(),typeName:ye.ZodObject,...ke(n)});Xe.strictCreate=(s,n)=>new Xe({shape:()=>s,unknownKeys:"strict",catchall:ur.create(),typeName:ye.ZodObject,...ke(n)});Xe.lazycreate=(s,n)=>new Xe({shape:s,unknownKeys:"strip",catchall:ur.create(),typeName:ye.ZodObject,...ke(n)});class Ya extends be{_parse(n){const{ctx:i}=this._processInputParams(n),l=this._def.options;function c(f){for(const m of f)if(m.result.status==="valid")return m.result;for(const m of f)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;const p=f.map(m=>new Rn(m.ctx.common.issues));return W(i,{code:$.invalid_union,unionErrors:p}),ve}if(i.common.async)return Promise.all(l.map(async f=>{const p={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:p}),ctx:p}})).then(c);{let f;const p=[];for(const w of l){const S={...i,common:{...i.common,issues:[]},parent:null},C=w._parseSync({data:i.data,path:i.path,parent:S});if(C.status==="valid")return C;C.status==="dirty"&&!f&&(f={result:C,ctx:S}),S.common.issues.length&&p.push(S.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const m=p.map(w=>new Rn(w));return W(i,{code:$.invalid_union,unionErrors:m}),ve}}get options(){return this._def.options}}Ya.create=(s,n)=>new Ya({options:s,typeName:ye.ZodUnion,...ke(n)});function ku(s,n){const i=Gn(s),l=Gn(n);if(s===n)return{valid:!0,data:s};if(i===ee.object&&l===ee.object){const c=Pe.objectKeys(n),f=Pe.objectKeys(s).filter(m=>c.indexOf(m)!==-1),p={...s,...n};for(const m of f){const w=ku(s[m],n[m]);if(!w.valid)return{valid:!1};p[m]=w.data}return{valid:!0,data:p}}else if(i===ee.array&&l===ee.array){if(s.length!==n.length)return{valid:!1};const c=[];for(let f=0;f<s.length;f++){const p=s[f],m=n[f],w=ku(p,m);if(!w.valid)return{valid:!1};c.push(w.data)}return{valid:!0,data:c}}else return i===ee.date&&l===ee.date&&+s==+n?{valid:!0,data:s}:{valid:!1}}class Ja extends be{_parse(n){const{status:i,ctx:l}=this._processInputParams(n),c=(f,p)=>{if(ph(f)||ph(p))return ve;const m=ku(f.value,p.value);return m.valid?((mh(f)||mh(p))&&i.dirty(),{status:i.value,value:m.data}):(W(l,{code:$.invalid_intersection_types}),ve)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([f,p])=>c(f,p)):c(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}}Ja.create=(s,n,i)=>new Ja({left:s,right:n,typeName:ye.ZodIntersection,...ke(i)});class Mr extends be{_parse(n){const{status:i,ctx:l}=this._processInputParams(n);if(l.parsedType!==ee.array)return W(l,{code:$.invalid_type,expected:ee.array,received:l.parsedType}),ve;if(l.data.length<this._def.items.length)return W(l,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&l.data.length>this._def.items.length&&(W(l,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...l.data].map((p,m)=>{const w=this._def.items[m]||this._def.rest;return w?w._parse(new fn(l,p,l.path,m)):null}).filter(p=>!!p);return l.common.async?Promise.all(f).then(p=>Ct.mergeArray(i,p)):Ct.mergeArray(i,f)}get items(){return this._def.items}rest(n){return new Mr({...this._def,rest:n})}}Mr.create=(s,n)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Mr({items:s,typeName:ye.ZodTuple,rest:null,...ke(n)})};class Xa extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:l}=this._processInputParams(n);if(l.parsedType!==ee.object)return W(l,{code:$.invalid_type,expected:ee.object,received:l.parsedType}),ve;const c=[],f=this._def.keyType,p=this._def.valueType;for(const m in l.data)c.push({key:f._parse(new fn(l,m,l.path,m)),value:p._parse(new fn(l,l.data[m],l.path,m)),alwaysSet:m in l.data});return l.common.async?Ct.mergeObjectAsync(i,c):Ct.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,l){return i instanceof be?new Xa({keyType:n,valueType:i,typeName:ye.ZodRecord,...ke(l)}):new Xa({keyType:Nn.create(),valueType:n,typeName:ye.ZodRecord,...ke(i)})}}class _h extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:l}=this._processInputParams(n);if(l.parsedType!==ee.map)return W(l,{code:$.invalid_type,expected:ee.map,received:l.parsedType}),ve;const c=this._def.keyType,f=this._def.valueType,p=[...l.data.entries()].map(([m,w],S)=>({key:c._parse(new fn(l,m,l.path,[S,"key"])),value:f._parse(new fn(l,w,l.path,[S,"value"]))}));if(l.common.async){const m=new Map;return Promise.resolve().then(async()=>{for(const w of p){const S=await w.key,C=await w.value;if(S.status==="aborted"||C.status==="aborted")return ve;(S.status==="dirty"||C.status==="dirty")&&i.dirty(),m.set(S.value,C.value)}return{status:i.value,value:m}})}else{const m=new Map;for(const w of p){const S=w.key,C=w.value;if(S.status==="aborted"||C.status==="aborted")return ve;(S.status==="dirty"||C.status==="dirty")&&i.dirty(),m.set(S.value,C.value)}return{status:i.value,value:m}}}}_h.create=(s,n,i)=>new _h({valueType:n,keyType:s,typeName:ye.ZodMap,...ke(i)});class ki extends be{_parse(n){const{status:i,ctx:l}=this._processInputParams(n);if(l.parsedType!==ee.set)return W(l,{code:$.invalid_type,expected:ee.set,received:l.parsedType}),ve;const c=this._def;c.minSize!==null&&l.data.size<c.minSize.value&&(W(l,{code:$.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()),c.maxSize!==null&&l.data.size>c.maxSize.value&&(W(l,{code:$.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty());const f=this._def.valueType;function p(w){const S=new Set;for(const C of w){if(C.status==="aborted")return ve;C.status==="dirty"&&i.dirty(),S.add(C.value)}return{status:i.value,value:S}}const m=[...l.data.values()].map((w,S)=>f._parse(new fn(l,w,l.path,S)));return l.common.async?Promise.all(m).then(w=>p(w)):p(m)}min(n,i){return new ki({...this._def,minSize:{value:n,message:se.toString(i)}})}max(n,i){return new ki({...this._def,maxSize:{value:n,message:se.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}ki.create=(s,n)=>new ki({valueType:s,minSize:null,maxSize:null,typeName:ye.ZodSet,...ke(n)});class Sh extends be{get schema(){return this._def.getter()}_parse(n){const{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Sh.create=(s,n)=>new Sh({getter:s,typeName:ye.ZodLazy,...ke(n)});class jh extends be{_parse(n){if(n.data!==this._def.value){const i=this._getOrReturnCtx(n);return W(i,{received:i.data,code:$.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:n.data}}get value(){return this._def.value}}jh.create=(s,n)=>new jh({value:s,typeName:ye.ZodLiteral,...ke(n)});function gp(s,n){return new _s({values:s,typeName:ye.ZodEnum,...ke(n)})}class _s extends be{_parse(n){if(typeof n.data!="string"){const i=this._getOrReturnCtx(n),l=this._def.values;return W(i,{expected:Pe.joinValues(l),received:i.parsedType,code:$.invalid_type}),ve}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const i=this._getOrReturnCtx(n),l=this._def.values;return W(i,{received:i.data,code:$.invalid_enum_value,options:l}),ve}return Ht(n.data)}get options(){return this._def.values}get enum(){const n={};for(const i of this._def.values)n[i]=i;return n}get Values(){const n={};for(const i of this._def.values)n[i]=i;return n}get Enum(){const n={};for(const i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return _s.create(n,{...this._def,...i})}exclude(n,i=this._def){return _s.create(this.options.filter(l=>!n.includes(l)),{...this._def,...i})}}_s.create=gp;class Eh extends be{_parse(n){const i=Pe.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(n);if(l.parsedType!==ee.string&&l.parsedType!==ee.number){const c=Pe.objectValues(i);return W(l,{expected:Pe.joinValues(c),received:l.parsedType,code:$.invalid_type}),ve}if(this._cache||(this._cache=new Set(Pe.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const c=Pe.objectValues(i);return W(l,{received:l.data,code:$.invalid_enum_value,options:c}),ve}return Ht(n.data)}get enum(){return this._def.values}}Eh.create=(s,n)=>new Eh({values:s,typeName:ye.ZodNativeEnum,...ke(n)});class el extends be{unwrap(){return this._def.type}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==ee.promise&&i.common.async===!1)return W(i,{code:$.invalid_type,expected:ee.promise,received:i.parsedType}),ve;const l=i.parsedType===ee.promise?i.data:Promise.resolve(i.data);return Ht(l.then(c=>this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})))}}el.create=(s,n)=>new el({type:s,typeName:ye.ZodPromise,...ke(n)});class Ss extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:i,ctx:l}=this._processInputParams(n),c=this._def.effect||null,f={addIssue:p=>{W(l,p),p.fatal?i.abort():i.dirty()},get path(){return l.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){const p=c.transform(l.data,f);if(l.common.async)return Promise.resolve(p).then(async m=>{if(i.value==="aborted")return ve;const w=await this._def.schema._parseAsync({data:m,path:l.path,parent:l});return w.status==="aborted"?ve:w.status==="dirty"||i.value==="dirty"?pi(w.value):w});{if(i.value==="aborted")return ve;const m=this._def.schema._parseSync({data:p,path:l.path,parent:l});return m.status==="aborted"?ve:m.status==="dirty"||i.value==="dirty"?pi(m.value):m}}if(c.type==="refinement"){const p=m=>{const w=c.refinement(m,f);if(l.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(l.common.async===!1){const m=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return m.status==="aborted"?ve:(m.status==="dirty"&&i.dirty(),p(m.value),{status:i.value,value:m.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(m=>m.status==="aborted"?ve:(m.status==="dirty"&&i.dirty(),p(m.value).then(()=>({status:i.value,value:m.value}))))}if(c.type==="transform")if(l.common.async===!1){const p=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!Cs(p))return ve;const m=c.transform(p.value,f);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(p=>Cs(p)?Promise.resolve(c.transform(p.value,f)).then(m=>({status:i.value,value:m})):ve);Pe.assertNever(c)}}Ss.create=(s,n,i)=>new Ss({schema:s,typeName:ye.ZodEffects,effect:n,...ke(i)});Ss.createWithPreprocess=(s,n,i)=>new Ss({schema:n,effect:{type:"preprocess",transform:s},typeName:ye.ZodEffects,...ke(i)});class lr extends be{_parse(n){return this._getType(n)===ee.undefined?Ht(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}lr.create=(s,n)=>new lr({innerType:s,typeName:ye.ZodOptional,...ke(n)});class js extends be{_parse(n){return this._getType(n)===ee.null?Ht(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}js.create=(s,n)=>new js({innerType:s,typeName:ye.ZodNullable,...ke(n)});class Cu extends be{_parse(n){const{ctx:i}=this._processInputParams(n);let l=i.data;return i.parsedType===ee.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}Cu.create=(s,n)=>new Cu({innerType:s,typeName:ye.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...ke(n)});class _u extends be{_parse(n){const{ctx:i}=this._processInputParams(n),l={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return Za(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new Rn(l.common.issues)},input:l.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Rn(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}}_u.create=(s,n)=>new _u({innerType:s,typeName:ye.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...ke(n)});class Nh extends be{_parse(n){if(this._getType(n)!==ee.nan){const l=this._getOrReturnCtx(n);return W(l,{code:$.invalid_type,expected:ee.nan,received:l.parsedType}),ve}return{status:"valid",value:n.data}}}Nh.create=s=>new Nh({typeName:ye.ZodNaN,...ke(s)});class h0 extends be{_parse(n){const{ctx:i}=this._processInputParams(n),l=i.data;return this._def.type._parse({data:l,path:i.path,parent:i})}unwrap(){return this._def.type}}class Du extends be{_parse(n){const{status:i,ctx:l}=this._processInputParams(n);if(l.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return f.status==="aborted"?ve:f.status==="dirty"?(i.dirty(),pi(f.value)):this._def.out._parseAsync({data:f.value,path:l.path,parent:l})})();{const c=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?ve:c.status==="dirty"?(i.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:l.path,parent:l})}}static create(n,i){return new Du({in:n,out:i,typeName:ye.ZodPipeline})}}class Su extends be{_parse(n){const i=this._def.innerType._parse(n),l=c=>(Cs(c)&&(c.value=Object.freeze(c.value)),c);return Za(i)?i.then(c=>l(c)):l(i)}unwrap(){return this._def.innerType}}Su.create=(s,n)=>new Su({innerType:s,typeName:ye.ZodReadonly,...ke(n)});var ye;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(ye||(ye={}));const p0=Nn.create,m0=wu.create;ur.create;dn.create;const y0=Xe.create;Ya.create;Ja.create;Mr.create;const v0=Xa.create;_s.create;el.create;lr.create;js.create;const g0=y0({type:p0(),payload:v0(m0())});function x0(s){if(s==="online"||s==="connected")return"connected";if(s==="reconnecting")return"reconnecting";if(s==="offline")return"offline"}function w0(s,n=()=>{}){if(typeof EventSource>"u")return n("offline"),()=>{};n("reconnecting");const i=new EventSource("/admin/core/events",{withCredentials:!0});return i.onopen=()=>n("connected"),i.onerror=()=>n(i.readyState===EventSource.CLOSED?"offline":"reconnecting"),i.onmessage=l=>{let c;try{c=g0.parse(JSON.parse(l.data))}catch{return}if(c.type==="core_connection"){const f=x0(c.payload.status);f&&n(f)}s.invalidateQueries({queryKey:["core","sessions"]}),typeof c.payload.session_id=="string"&&s.invalidateQueries({queryKey:["core","session",c.payload.session_id]})},()=>i.close()}const k0=[{label:"Overview",path:"/overview",icon:xv},{label:"API Runs",path:"/runs",icon:tp},{label:"Invocation Targets",path:"/targets",icon:Rv},{label:"Clients and Keys",path:"/clients",icon:Lu},{label:"Extensions",path:"/extensions",icon:hv},{label:"Core Sessions",path:"/core/sessions",icon:pv},{label:"Pending Core Choices",path:"/core/choices",icon:yv},{label:"CLI Availability",path:"/cli-availability",icon:ip},{label:"Settings",path:"/settings",icon:bv}];function C0({activePath:s,children:n,onLogout:i,webUiAuth:l}){const{language:c,setLanguage:f,t:p}=Fe(),[m,w]=b.useState(!1),[S,C]=b.useState(()=>window.innerWidth<760),[E,I]=b.useState("reconnecting"),z=b.useRef(null),V=b.useRef(null),D=b.useRef(null),P=b.useCallback(()=>w(!1),[]);return b.useEffect(()=>{const T=()=>{const Y=window.innerWidth<760;C(Y),Y||w(!1)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),b.useEffect(()=>w0(yt,I),[]),b.useLayoutEffect(()=>{const T=z.current,Y=V.current;!T||!Y||(S&&!m?T.setAttribute("inert",""):T.removeAttribute("inert"),S&&m?Y.setAttribute("inert",""):Y.removeAttribute("inert"))},[m,S]),zu(S&&m,z,P,D),u.jsxs("div",{className:"app-shell",children:[m?u.jsx("button",{className:"drawer-backdrop",type:"button","aria-label":p("Dismiss navigation"),onClick:P}):null,u.jsxs("nav",{ref:z,className:`sidebar ${m?"sidebar--open":""}`,"aria-label":"Gateway",children:[u.jsxs("div",{className:"identity",children:[u.jsx("span",{className:"gateway-mark","aria-hidden":"true",children:"G"}),u.jsx("span",{children:"Gateway"}),u.jsx(kt,{className:"drawer-close",label:p("Close navigation"),onClick:P,ref:D,children:u.jsx(ap,{size:16,"aria-hidden":"true"})})]}),u.jsx("div",{className:"nav-list",children:k0.map(T=>{const Y=s===T.path||T.path==="/clients"&&s.startsWith("/clients/")||T.path==="/core/sessions"&&s.startsWith("/core/sessions/"),A=T.icon,F=["nav-item",Y?"nav-item--active":"",T.disabled?"nav-item--disabled":"",T.degraded?"nav-item--degraded":""].filter(Boolean).join(" ");return u.jsxs("a",{className:F,href:`#${T.path}`,"aria-current":Y?"page":void 0,"aria-disabled":T.disabled?"true":void 0,onClick:Q=>{T.disabled?Q.preventDefault():w(!1)},children:[u.jsx(A,{size:16,"aria-hidden":"true"}),u.jsx("span",{children:p(T.label)}),T.degraded?u.jsx("span",{className:"nav-status-dot","aria-hidden":"true"}):null]},T.path)})})]}),u.jsxs("div",{className:"workspace",ref:V,children:[u.jsx("header",{className:"topbar",children:u.jsxs("div",{className:"topbar__content",children:[u.jsxs("div",{className:"topbar__leading",children:[u.jsx(kt,{className:"menu-button",label:p("Open navigation"),"aria-expanded":m,onClick:()=>w(!0),children:u.jsx(Cv,{size:17,"aria-hidden":"true"})}),u.jsxs("span",{className:"connection-status",children:[u.jsx("span",{className:"status-dot","aria-hidden":"true"}),p(l==="token"?"Local admin session":"Web UI auth disabled")]}),u.jsx("span",{className:`core-event-status core-event-status--${E}`,"aria-live":"polite",children:p("Core {status}",{status:p(E)})})]}),u.jsxs("div",{className:"topbar__actions",children:[u.jsxs("label",{className:"language-select",children:[u.jsx(wv,{size:15,"aria-hidden":"true"}),u.jsx("span",{className:"visually-hidden",children:p("Language")}),u.jsxs("select",{"aria-label":p("Language"),value:c,onChange:T=>f(T.target.value),children:[u.jsx("option",{value:"zh-CN",children:"中文"}),u.jsx("option",{value:"en",children:"English"})]})]}),l==="token"?u.jsx(kt,{label:p("End local session"),onClick:()=>void i(),children:u.jsx(rp,{size:16,"aria-hidden":"true"})}):null]})]})}),u.jsx("main",{className:"page",children:n})]})]})}function bh(){yt.clear(),window.sessionStorage.clear()}function _0(){const s=/^#\/bootstrap\/([^/]+)$/.exec(window.location.hash);if(s!=null&&s[1])try{return decodeURIComponent(s[1])}catch{return}}function S0(s){window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${s}`)}function j0({state:s}){const{t:n}=Fe(),i=s==="locked",l=s==="loading",c=n(l?"Recovering local session":i?"Locked":"Unavailable"),f=n(l?"Checking local session":i?"Local session required":"Session recovery failed");return u.jsx("main",{className:"session-state",children:u.jsxs("section",{className:"session-state__panel","aria-labelledby":"gateway-session-title",children:[u.jsx("div",{className:"gateway-mark","aria-hidden":"true",children:i?u.jsx(kv,{size:18}):u.jsx(tp,{size:18})}),u.jsx("h1",{id:"gateway-session-title",children:"Gateway"}),u.jsx("p",{role:"status",children:c}),u.jsx("button",{type:"button",disabled:!0,children:f})]})})}function Rh(){if(window.location.hash==="#/setup")return"/setup";if(window.location.hash==="#/settings")return"/settings";const s=/^#\/core\/sessions\/([^/]+)$/.exec(window.location.hash);if(s!=null&&s[1])return`/core/sessions/${decodeURIComponent(s[1])}`;if(window.location.hash==="#/core/choices")return"/core/choices";if(window.location.hash==="#/core/sessions")return"/core/sessions";const n=/^#\/clients\/([^/]+)$/.exec(window.location.hash);return n!=null&&n[1]?`/clients/${decodeURIComponent(n[1])}`:window.location.hash==="#/clients"?"/clients":window.location.hash==="#/runs"?"/runs":window.location.hash==="#/targets"?"/targets":window.location.hash==="#/extensions"?"/extensions":window.location.hash==="#/cli-availability"?"/cli-availability":"/overview"}function E0({onLogout:s,webUiAuth:n}){const[i,l]=b.useState(Rh);return b.useEffect(()=>{const c=()=>l(Rh());return window.addEventListener("hashchange",c),()=>window.removeEventListener("hashchange",c)},[]),u.jsx(C0,{activePath:i,onLogout:s,webUiAuth:n,children:i==="/runs"?u.jsx(Yv,{}):i==="/targets"?u.jsx(og,{}):i==="/setup"?u.jsx(qg,{}):i==="/settings"?u.jsx(zg,{onLogout:s,webUiAuth:n}):i.startsWith("/core/sessions/")?u.jsx(Rg,{sessionId:i.slice(15)}):i==="/core/sessions"?u.jsx(Lg,{}):i==="/core/choices"?u.jsx(Fg,{}):i.startsWith("/clients")?u.jsx(xg,{clientId:i==="/clients"?void 0:i.slice(9)}):i==="/extensions"?u.jsx(pg,{}):i==="/cli-availability"?u.jsx(hg,{}):u.jsx(Jv,{})})}function N0(){const[s,n]=b.useState("loading"),[i,l]=b.useState("token");b.useEffect(()=>{let f=!0;return(async()=>{try{const m=await Ov();if(!f)return;l(m);const w=_0();if(w&&S0("#/overview"),m==="disabled"){rh(),n("authenticated");return}const S=w?await Iv(w):await Lv();if(!f)return;Tv(S.csrf_token),n("authenticated")}catch(m){if(!f)return;if(rh(),bh(),m instanceof or&&m.status===401){n("locked");return}n("unavailable")}})(),()=>{f=!1}},[]);const c=async()=>{let f="locked";try{await Mv()}catch(p){f=p instanceof or&&p.status===401?"locked":"unavailable"}bh(),n(f)};return s==="authenticated"?u.jsx(E0,{onLogout:c,webUiAuth:i}):u.jsx(j0,{state:s})}function b0(){return u.jsx(Dv,{children:u.jsx(qv,{children:u.jsx(Jy,{client:yt,children:u.jsx(N0,{})})})})}const xp=document.getElementById("root");if(!xp)throw new Error("gateway_root_missing");jy.createRoot(xp).render(u.jsx(b0,{}));
206
+ //# sourceMappingURL=index-BhqNoPpE.js.map