@wolpertingerlabs/drawlatch 1.0.0-alpha.3 → 1.0.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONNECTIONS.md +3 -0
- package/README.md +393 -465
- package/bin/drawlatch.js +1151 -49
- package/dist/auth/auth.d.ts +10 -0
- package/dist/auth/auth.js +146 -0
- package/dist/auth/env-writer.d.ts +6 -0
- package/dist/auth/env-writer.js +52 -0
- package/dist/auth/password.d.ts +8 -0
- package/dist/auth/password.js +28 -0
- package/dist/auth/sessions.d.ts +13 -0
- package/dist/auth/sessions.js +85 -0
- package/dist/cli/generate-keys.d.ts +4 -4
- package/dist/cli/generate-keys.js +30 -25
- package/dist/connections/{anthropic.json → ai/anthropic.json} +19 -1
- package/dist/connections/{devin.json → ai/devin.json} +7 -1
- package/dist/connections/{google-ai.json → ai/google-ai.json} +7 -1
- package/dist/connections/{openai.json → ai/openai.json} +7 -1
- package/dist/connections/{openrouter.json → ai/openrouter.json} +7 -1
- package/dist/connections/developer-tools/github.json +138 -0
- package/dist/connections/{hex.json → developer-tools/hex.json} +7 -1
- package/dist/connections/developer-tools/linear.json +75 -0
- package/dist/connections/{lichess.json → gaming/lichess.json} +7 -1
- package/dist/connections/messaging/agentmail.json +21 -0
- package/dist/connections/messaging/discord-bot.json +114 -0
- package/dist/connections/{discord-oauth.json → messaging/discord-oauth.json} +7 -1
- package/dist/connections/messaging/slack.json +75 -0
- package/dist/connections/messaging/telegram.json +66 -0
- package/dist/connections/{google.json → productivity/google.json} +7 -1
- package/dist/connections/productivity/notion.json +75 -0
- package/dist/connections/productivity/stripe.json +74 -0
- package/dist/connections/productivity/trello.json +113 -0
- package/dist/connections/{bluesky.json → social-media/bluesky.json} +41 -0
- package/dist/connections/social-media/mastodon.json +65 -0
- package/dist/connections/social-media/reddit.json +80 -0
- package/dist/connections/{twitch.json → social-media/twitch.json} +40 -0
- package/dist/connections/social-media/x.json +67 -0
- package/dist/mcp/server.js +544 -31
- package/dist/remote/admin-mutations.d.ts +43 -0
- package/dist/remote/admin-mutations.js +321 -0
- package/dist/remote/admin-types.d.ts +153 -0
- package/dist/remote/admin-types.js +11 -0
- package/dist/remote/admin.d.ts +37 -0
- package/dist/remote/admin.js +317 -0
- package/dist/remote/caller-bootstrap.d.ts +121 -0
- package/dist/remote/caller-bootstrap.js +270 -0
- package/dist/remote/ingestors/base-ingestor.d.ts +19 -3
- package/dist/remote/ingestors/base-ingestor.js +27 -6
- package/dist/remote/ingestors/discord/discord-gateway.d.ts +2 -2
- package/dist/remote/ingestors/discord/discord-gateway.js +29 -6
- package/dist/remote/ingestors/e2e/setup.d.ts +69 -0
- package/dist/remote/ingestors/e2e/setup.js +147 -0
- package/dist/remote/ingestors/manager.d.ts +110 -10
- package/dist/remote/ingestors/manager.js +449 -42
- package/dist/remote/ingestors/poll/poll-ingestor.d.ts +4 -2
- package/dist/remote/ingestors/poll/poll-ingestor.js +26 -5
- package/dist/remote/ingestors/registry.d.ts +2 -2
- package/dist/remote/ingestors/registry.js +2 -2
- package/dist/remote/ingestors/slack/socket-mode.d.ts +2 -2
- package/dist/remote/ingestors/slack/socket-mode.js +28 -6
- package/dist/remote/ingestors/types.d.ts +25 -0
- package/dist/remote/ingestors/webhook/base-webhook-ingestor.d.ts +46 -7
- package/dist/remote/ingestors/webhook/base-webhook-ingestor.js +115 -10
- package/dist/remote/ingestors/webhook/github-webhook-ingestor.d.ts +30 -0
- package/dist/remote/ingestors/webhook/github-webhook-ingestor.js +73 -2
- package/dist/remote/ingestors/webhook/lifecycle-types.d.ts +63 -0
- package/dist/remote/ingestors/webhook/lifecycle-types.js +12 -0
- package/dist/remote/ingestors/webhook/stripe-webhook-ingestor.js +2 -2
- package/dist/remote/ingestors/webhook/trello-webhook-ingestor.d.ts +17 -5
- package/dist/remote/ingestors/webhook/trello-webhook-ingestor.js +32 -26
- package/dist/remote/ingestors/webhook/webhook-lifecycle-manager.d.ts +46 -0
- package/dist/remote/ingestors/webhook/webhook-lifecycle-manager.js +261 -0
- package/dist/remote/server.d.ts +25 -33
- package/dist/remote/server.js +595 -186
- package/dist/remote/tool-dispatch.d.ts +84 -0
- package/dist/remote/tool-dispatch.js +910 -0
- package/dist/remote/triggers/rule-engine.d.ts +40 -0
- package/dist/remote/triggers/rule-engine.js +228 -0
- package/dist/remote/triggers/types.d.ts +69 -0
- package/dist/remote/triggers/types.js +10 -0
- package/dist/remote/tunnel-state.d.ts +14 -0
- package/dist/remote/tunnel-state.js +20 -0
- package/dist/remote/tunnel.d.ts +13 -0
- package/dist/remote/tunnel.js +33 -0
- package/dist/shared/config.d.ts +104 -25
- package/dist/shared/config.js +48 -35
- package/dist/shared/connections.d.ts +21 -5
- package/dist/shared/connections.js +56 -14
- package/dist/shared/crypto/index.d.ts +1 -0
- package/dist/shared/crypto/index.js +1 -0
- package/dist/shared/crypto/key-manager.d.ts +81 -0
- package/dist/shared/crypto/key-manager.js +174 -0
- package/dist/shared/env-utils.d.ts +42 -0
- package/dist/shared/env-utils.js +150 -0
- package/dist/shared/listener-config.d.ts +157 -0
- package/dist/shared/listener-config.js +10 -0
- package/dist/shared/migrations.d.ts +40 -0
- package/dist/shared/migrations.js +122 -0
- package/dist/shared/protocol/caller-bundle-crypto.d.ts +37 -0
- package/dist/shared/protocol/caller-bundle-crypto.js +62 -0
- package/dist/shared/protocol/caller-bundle.d.ts +75 -0
- package/dist/shared/protocol/caller-bundle.js +24 -0
- package/dist/shared/protocol/handshake.js +14 -1
- package/dist/shared/protocol/index.d.ts +2 -0
- package/dist/shared/protocol/index.js +2 -0
- package/dist/shared/protocol/sync-client.d.ts +52 -0
- package/dist/shared/protocol/sync-client.js +99 -0
- package/dist/shared/protocol/sync.d.ts +71 -0
- package/dist/shared/protocol/sync.js +176 -0
- package/frontend/dist/assets/index-BdCSPSZK.js +282 -0
- package/frontend/dist/assets/index-BmK26bY2.css +1 -0
- package/frontend/dist/index.html +15 -0
- package/package.json +65 -13
- package/dist/connections/discord-bot.json +0 -24
- package/dist/connections/github.json +0 -25
- package/dist/connections/linear.json +0 -29
- package/dist/connections/mastodon.json +0 -25
- package/dist/connections/notion.json +0 -33
- package/dist/connections/reddit.json +0 -28
- package/dist/connections/slack.json +0 -23
- package/dist/connections/stripe.json +0 -25
- package/dist/connections/telegram.json +0 -26
- package/dist/connections/trello.json +0 -25
- package/dist/connections/x.json +0 -27
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
function Af(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const a=Object.getOwnPropertyDescriptor(r,l);a&&Object.defineProperty(e,l,a.get?a:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const a of l)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const a={};return l.integrity&&(a.integrity=l.integrity),l.referrerPolicy&&(a.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?a.credentials="include":l.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(l){if(l.ep)return;l.ep=!0;const a=n(l);fetch(l.href,a)}})();function Uf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wc={exports:{}},tl={},Hc={exports:{}},V={};/**
|
|
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 Vr=Symbol.for("react.element"),Vf=Symbol.for("react.portal"),Bf=Symbol.for("react.fragment"),Wf=Symbol.for("react.strict_mode"),Hf=Symbol.for("react.profiler"),Qf=Symbol.for("react.provider"),Kf=Symbol.for("react.context"),qf=Symbol.for("react.forward_ref"),Gf=Symbol.for("react.suspense"),Yf=Symbol.for("react.memo"),Xf=Symbol.for("react.lazy"),lo=Symbol.iterator;function Jf(e){return e===null||typeof e!="object"?null:(e=lo&&e[lo]||e["@@iterator"],typeof e=="function"?e:null)}var Qc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kc=Object.assign,qc={};function Hn(e,t,n){this.props=e,this.context=t,this.refs=qc,this.updater=n||Qc}Hn.prototype.isReactComponent={};Hn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Hn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Gc(){}Gc.prototype=Hn.prototype;function Xa(e,t,n){this.props=e,this.context=t,this.refs=qc,this.updater=n||Qc}var Ja=Xa.prototype=new Gc;Ja.constructor=Xa;Kc(Ja,Hn.prototype);Ja.isPureReactComponent=!0;var ao=Array.isArray,Yc=Object.prototype.hasOwnProperty,Za={current:null},Xc={key:!0,ref:!0,__self:!0,__source:!0};function Jc(e,t,n){var r,l={},a=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)Yc.call(t,r)&&!Xc.hasOwnProperty(r)&&(l[r]=t[r]);var c=arguments.length-2;if(c===1)l.children=n;else if(1<c){for(var o=Array(c),u=0;u<c;u++)o[u]=arguments[u+2];l.children=o}if(e&&e.defaultProps)for(r in c=e.defaultProps,c)l[r]===void 0&&(l[r]=c[r]);return{$$typeof:Vr,type:e,key:a,ref:i,props:l,_owner:Za.current}}function Zf(e,t){return{$$typeof:Vr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ei(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vr}function ep(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var io=/\/+/g;function El(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ep(""+e.key):t.toString(36)}function hs(e,t,n,r,l){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Vr:case Vf:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+El(i,0):r,ao(l)?(n="",e!=null&&(n=e.replace(io,"$&/")+"/"),hs(l,t,n,"",function(u){return u})):l!=null&&(ei(l)&&(l=Zf(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(io,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",ao(e))for(var c=0;c<e.length;c++){a=e[c];var o=r+El(a,c);i+=hs(a,t,n,o,l)}else if(o=Jf(e),typeof o=="function")for(e=o.call(e),c=0;!(a=e.next()).done;)a=a.value,o=r+El(a,c++),i+=hs(a,t,n,o,l);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Yr(e,t,n){if(e==null)return e;var r=[],l=0;return hs(e,r,"","",function(a){return t.call(n,a,l++)}),r}function tp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Le={current:null},ms={transition:null},np={ReactCurrentDispatcher:Le,ReactCurrentBatchConfig:ms,ReactCurrentOwner:Za};function Zc(){throw Error("act(...) is not supported in production builds of React.")}V.Children={map:Yr,forEach:function(e,t,n){Yr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Yr(e,function(){t++}),t},toArray:function(e){return Yr(e,function(t){return t})||[]},only:function(e){if(!ei(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};V.Component=Hn;V.Fragment=Bf;V.Profiler=Hf;V.PureComponent=Xa;V.StrictMode=Wf;V.Suspense=Gf;V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=np;V.act=Zc;V.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Kc({},e.props),l=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=Za.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(o in t)Yc.call(t,o)&&!Xc.hasOwnProperty(o)&&(r[o]=t[o]===void 0&&c!==void 0?c[o]:t[o])}var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){c=Array(o);for(var u=0;u<o;u++)c[u]=arguments[u+2];r.children=c}return{$$typeof:Vr,type:e.type,key:l,ref:a,props:r,_owner:i}};V.createContext=function(e){return e={$$typeof:Kf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Qf,_context:e},e.Consumer=e};V.createElement=Jc;V.createFactory=function(e){var t=Jc.bind(null,e);return t.type=e,t};V.createRef=function(){return{current:null}};V.forwardRef=function(e){return{$$typeof:qf,render:e}};V.isValidElement=ei;V.lazy=function(e){return{$$typeof:Xf,_payload:{_status:-1,_result:e},_init:tp}};V.memo=function(e,t){return{$$typeof:Yf,type:e,compare:t===void 0?null:t}};V.startTransition=function(e){var t=ms.transition;ms.transition={};try{e()}finally{ms.transition=t}};V.unstable_act=Zc;V.useCallback=function(e,t){return Le.current.useCallback(e,t)};V.useContext=function(e){return Le.current.useContext(e)};V.useDebugValue=function(){};V.useDeferredValue=function(e){return Le.current.useDeferredValue(e)};V.useEffect=function(e,t){return Le.current.useEffect(e,t)};V.useId=function(){return Le.current.useId()};V.useImperativeHandle=function(e,t,n){return Le.current.useImperativeHandle(e,t,n)};V.useInsertionEffect=function(e,t){return Le.current.useInsertionEffect(e,t)};V.useLayoutEffect=function(e,t){return Le.current.useLayoutEffect(e,t)};V.useMemo=function(e,t){return Le.current.useMemo(e,t)};V.useReducer=function(e,t,n){return Le.current.useReducer(e,t,n)};V.useRef=function(e){return Le.current.useRef(e)};V.useState=function(e){return Le.current.useState(e)};V.useSyncExternalStore=function(e,t,n){return Le.current.useSyncExternalStore(e,t,n)};V.useTransition=function(){return Le.current.useTransition()};V.version="18.3.1";Hc.exports=V;var h=Hc.exports;const eu=Uf(h),rp=Af({__proto__:null,default:eu},[h]);/**
|
|
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 sp=h,lp=Symbol.for("react.element"),ap=Symbol.for("react.fragment"),ip=Object.prototype.hasOwnProperty,op=sp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cp={key:!0,ref:!0,__self:!0,__source:!0};function tu(e,t,n){var r,l={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)ip.call(t,r)&&!cp.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:lp,type:e,key:a,ref:i,props:l,_owner:op.current}}tl.Fragment=ap;tl.jsx=tu;tl.jsxs=tu;Wc.exports=tl;var s=Wc.exports,ea={},nu={exports:{}},We={},ru={exports:{}},su={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,T){var O=R.length;R.push(T);e:for(;0<O;){var A=O-1>>>1,U=R[A];if(0<l(U,T))R[A]=T,R[O]=U,O=A;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var T=R[0],O=R.pop();if(O!==T){R[0]=O;e:for(var A=0,U=R.length,he=U>>>1;A<he;){var me=2*(A+1)-1,Pt=R[me],Qe=me+1,mt=R[Qe];if(0>l(Pt,O))Qe<U&&0>l(mt,Pt)?(R[A]=mt,R[Qe]=O,A=Qe):(R[A]=Pt,R[me]=O,A=me);else if(Qe<U&&0>l(mt,O))R[A]=mt,R[Qe]=O,A=Qe;else break e}}return T}function l(R,T){var O=R.sortIndex-T.sortIndex;return O!==0?O:R.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();e.unstable_now=function(){return i.now()-c}}var o=[],u=[],d=1,f=null,g=3,y=!1,j=!1,x=!1,C=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(R){for(var T=n(u);T!==null;){if(T.callback===null)r(u);else if(T.startTime<=R)r(u),T.sortIndex=T.expirationTime,t(o,T);else break;T=n(u)}}function w(R){if(x=!1,m(R),!j)if(n(o)!==null)j=!0,M(E);else{var T=n(u);T!==null&&b(w,T.startTime-R)}}function E(R,T){j=!1,x&&(x=!1,v(k),k=-1),y=!0;var O=g;try{for(m(T),f=n(o);f!==null&&(!(f.expirationTime>T)||R&&!$());){var A=f.callback;if(typeof A=="function"){f.callback=null,g=f.priorityLevel;var U=A(f.expirationTime<=T);T=e.unstable_now(),typeof U=="function"?f.callback=U:f===n(o)&&r(o),m(T)}else r(o);f=n(o)}if(f!==null)var he=!0;else{var me=n(u);me!==null&&b(w,me.startTime-T),he=!1}return he}finally{f=null,g=O,y=!1}}var S=!1,_=null,k=-1,z=5,N=-1;function $(){return!(e.unstable_now()-N<z)}function Q(){if(_!==null){var R=e.unstable_now();N=R;var T=!0;try{T=_(!0,R)}finally{T?re():(S=!1,_=null)}}else S=!1}var re;if(typeof p=="function")re=function(){p(Q)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,ze=Ce.port2;Ce.port1.onmessage=Q,re=function(){ze.postMessage(null)}}else re=function(){C(Q,0)};function M(R){_=R,S||(S=!0,re())}function b(R,T){k=C(function(){R(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){j||y||(j=!0,M(E))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(o)},e.unstable_next=function(R){switch(g){case 1:case 2:case 3:var T=3;break;default:T=g}var O=g;g=T;try{return R()}finally{g=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,T){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var O=g;g=R;try{return T()}finally{g=O}},e.unstable_scheduleCallback=function(R,T,O){var A=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?A+O:A):O=A,R){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=O+U,R={id:d++,callback:T,priorityLevel:R,startTime:O,expirationTime:U,sortIndex:-1},O>A?(R.sortIndex=O,t(u,R),n(o)===null&&R===n(u)&&(x?(v(k),k=-1):x=!0,b(w,O-A))):(R.sortIndex=U,t(o,R),j||y||(j=!0,M(E))),R},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(R){var T=g;return function(){var O=g;g=T;try{return R.apply(this,arguments)}finally{g=O}}}})(su);ru.exports=su;var up=ru.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 dp=h,Be=up;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var lu=new Set,Nr={};function pn(e,t){bn(e,t),bn(e+"Capture",t)}function bn(e,t){for(Nr[e]=t,e=0;e<t.length;e++)lu.add(t[e])}var kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ta=Object.prototype.hasOwnProperty,fp=/^[: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]*$/,oo={},co={};function pp(e){return ta.call(co,e)?!0:ta.call(oo,e)?!1:fp.test(e)?co[e]=!0:(oo[e]=!0,!1)}function hp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mp(e,t,n,r){if(t===null||typeof t>"u"||hp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pe(e,t,n,r,l,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Pe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Pe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Pe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Pe(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){je[e]=new Pe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Pe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Pe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Pe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Pe(e,5,!1,e.toLowerCase(),null,!1,!1)});var ti=/[\-:]([a-z])/g;function ni(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(ti,ni);je[t]=new Pe(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(ti,ni);je[t]=new Pe(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(ti,ni);je[t]=new Pe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Pe(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Pe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Pe(e,1,!1,e.toLowerCase(),null,!0,!0)});function ri(e,t,n,r){var l=je.hasOwnProperty(t)?je[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mp(t,n,l,r)&&(n=null),r||l===null?pp(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var _t=dp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xr=Symbol.for("react.element"),vn=Symbol.for("react.portal"),gn=Symbol.for("react.fragment"),si=Symbol.for("react.strict_mode"),na=Symbol.for("react.profiler"),au=Symbol.for("react.provider"),iu=Symbol.for("react.context"),li=Symbol.for("react.forward_ref"),ra=Symbol.for("react.suspense"),sa=Symbol.for("react.suspense_list"),ai=Symbol.for("react.memo"),Rt=Symbol.for("react.lazy"),ou=Symbol.for("react.offscreen"),uo=Symbol.iterator;function Zn(e){return e===null||typeof e!="object"?null:(e=uo&&e[uo]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Object.assign,_l;function cr(e){if(_l===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_l=t&&t[1]||""}return`
|
|
34
|
+
`+_l+e}var Ll=!1;function Pl(e,t){if(!e||Ll)return"";Ll=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var l=u.stack.split(`
|
|
35
|
+
`),a=r.stack.split(`
|
|
36
|
+
`),i=l.length-1,c=a.length-1;1<=i&&0<=c&&l[i]!==a[c];)c--;for(;1<=i&&0<=c;i--,c--)if(l[i]!==a[c]){if(i!==1||c!==1)do if(i--,c--,0>c||l[i]!==a[c]){var o=`
|
|
37
|
+
`+l[i].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=i&&0<=c);break}}}finally{Ll=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cr(e):""}function vp(e){switch(e.tag){case 5:return cr(e.type);case 16:return cr("Lazy");case 13:return cr("Suspense");case 19:return cr("SuspenseList");case 0:case 2:case 15:return e=Pl(e.type,!1),e;case 11:return e=Pl(e.type.render,!1),e;case 1:return e=Pl(e.type,!0),e;default:return""}}function la(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 gn:return"Fragment";case vn:return"Portal";case na:return"Profiler";case si:return"StrictMode";case ra:return"Suspense";case sa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iu:return(e.displayName||"Context")+".Consumer";case au:return(e._context.displayName||"Context")+".Provider";case li:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ai:return t=e.displayName||null,t!==null?t:la(e.type)||"Memo";case Rt:t=e._payload,e=e._init;try{return la(e(t))}catch{}}return null}function gp(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 la(t);case 8:return t===si?"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 Kt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yp(e){var t=cu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jr(e){e._valueTracker||(e._valueTracker=yp(e))}function uu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=cu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ps(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 aa(e,t){var n=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function du(e,t){t=t.checked,t!=null&&ri(e,"checked",t,!1)}function ia(e,t){du(e,t);var n=Kt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?oa(e,t.type,n):t.hasOwnProperty("defaultValue")&&oa(e,t.type,Kt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function po(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function oa(e,t,n){(t!=="number"||Ps(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ur=Array.isArray;function Ln(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Kt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function ca(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ho(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(L(92));if(ur(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Kt(n)}}function fu(e,t){var n=Kt(t.value),r=Kt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function pu(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 ua(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?pu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zr,hu=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Zr=Zr||document.createElement("div"),Zr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function kr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pr={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},xp=["Webkit","ms","Moz","O"];Object.keys(pr).forEach(function(e){xp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pr[t]=pr[e]})});function mu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||pr.hasOwnProperty(e)&&pr[e]?(""+t).trim():t+"px"}function vu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=mu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var jp=ne({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 da(e,t){if(t){if(jp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function fa(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 pa=null;function ii(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ha=null,Pn=null,zn=null;function vo(e){if(e=Hr(e)){if(typeof ha!="function")throw Error(L(280));var t=e.stateNode;t&&(t=al(t),ha(e.stateNode,e.type,t))}}function gu(e){Pn?zn?zn.push(e):zn=[e]:Pn=e}function yu(){if(Pn){var e=Pn,t=zn;if(zn=Pn=null,vo(e),t)for(e=0;e<t.length;e++)vo(t[e])}}function xu(e,t){return e(t)}function ju(){}var zl=!1;function wu(e,t,n){if(zl)return e(t,n);zl=!0;try{return xu(e,t,n)}finally{zl=!1,(Pn!==null||zn!==null)&&(ju(),yu())}}function Sr(e,t){var n=e.stateNode;if(n===null)return null;var r=al(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(L(231,t,typeof n));return n}var ma=!1;if(kt)try{var er={};Object.defineProperty(er,"passive",{get:function(){ma=!0}}),window.addEventListener("test",er,er),window.removeEventListener("test",er,er)}catch{ma=!1}function wp(e,t,n,r,l,a,i,c,o){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var hr=!1,zs=null,Rs=!1,va=null,Np={onError:function(e){hr=!0,zs=e}};function kp(e,t,n,r,l,a,i,c,o){hr=!1,zs=null,wp.apply(Np,arguments)}function Sp(e,t,n,r,l,a,i,c,o){if(kp.apply(this,arguments),hr){if(hr){var u=zs;hr=!1,zs=null}else throw Error(L(198));Rs||(Rs=!0,va=u)}}function hn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Nu(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 go(e){if(hn(e)!==e)throw Error(L(188))}function Cp(e){var t=e.alternate;if(!t){if(t=hn(e),t===null)throw Error(L(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var a=l.alternate;if(a===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===a.child){for(a=l.child;a;){if(a===n)return go(l),e;if(a===r)return go(l),t;a=a.sibling}throw Error(L(188))}if(n.return!==r.return)n=l,r=a;else{for(var i=!1,c=l.child;c;){if(c===n){i=!0,n=l,r=a;break}if(c===r){i=!0,r=l,n=a;break}c=c.sibling}if(!i){for(c=a.child;c;){if(c===n){i=!0,n=a,r=l;break}if(c===r){i=!0,r=a,n=l;break}c=c.sibling}if(!i)throw Error(L(189))}}if(n.alternate!==r)throw Error(L(190))}if(n.tag!==3)throw Error(L(188));return n.stateNode.current===n?e:t}function ku(e){return e=Cp(e),e!==null?Su(e):null}function Su(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Su(e);if(t!==null)return t;e=e.sibling}return null}var Cu=Be.unstable_scheduleCallback,yo=Be.unstable_cancelCallback,Ep=Be.unstable_shouldYield,_p=Be.unstable_requestPaint,ue=Be.unstable_now,Lp=Be.unstable_getCurrentPriorityLevel,oi=Be.unstable_ImmediatePriority,Eu=Be.unstable_UserBlockingPriority,Ts=Be.unstable_NormalPriority,Pp=Be.unstable_LowPriority,_u=Be.unstable_IdlePriority,nl=null,ft=null;function zp(e){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(nl,e,void 0,(e.current.flags&128)===128)}catch{}}var lt=Math.clz32?Math.clz32:Ip,Rp=Math.log,Tp=Math.LN2;function Ip(e){return e>>>=0,e===0?32:31-(Rp(e)/Tp|0)|0}var es=64,ts=4194304;function dr(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 Is(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,i=n&268435455;if(i!==0){var c=i&~l;c!==0?r=dr(c):(a&=i,a!==0&&(r=dr(a)))}else i=n&~l,i!==0?r=dr(i):a!==0&&(r=dr(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,a=t&-t,l>=a||l===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-lt(t),l=1<<n,r|=e[n],t&=~l;return r}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 Op(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-lt(a),c=1<<i,o=l[i];o===-1?(!(c&n)||c&r)&&(l[i]=Mp(c,t)):o<=t&&(e.expiredLanes|=c),a&=~c}}function ga(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Lu(){var e=es;return es<<=1,!(es&4194240)&&(es=64),e}function Rl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Br(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-lt(t),e[t]=n}function $p(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-lt(n),a=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~a}}function ci(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-lt(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var q=0;function Pu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zu,ui,Ru,Tu,Iu,ya=!1,ns=[],Dt=null,Ft=null,At=null,Cr=new Map,Er=new Map,It=[],bp="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 xo(e,t){switch(e){case"focusin":case"focusout":Dt=null;break;case"dragenter":case"dragleave":Ft=null;break;case"mouseover":case"mouseout":At=null;break;case"pointerover":case"pointerout":Cr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Er.delete(t.pointerId)}}function tr(e,t,n,r,l,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},t!==null&&(t=Hr(t),t!==null&&ui(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Dp(e,t,n,r,l){switch(t){case"focusin":return Dt=tr(Dt,e,t,n,r,l),!0;case"dragenter":return Ft=tr(Ft,e,t,n,r,l),!0;case"mouseover":return At=tr(At,e,t,n,r,l),!0;case"pointerover":var a=l.pointerId;return Cr.set(a,tr(Cr.get(a)||null,e,t,n,r,l)),!0;case"gotpointercapture":return a=l.pointerId,Er.set(a,tr(Er.get(a)||null,e,t,n,r,l)),!0}return!1}function Mu(e){var t=nn(e.target);if(t!==null){var n=hn(t);if(n!==null){if(t=n.tag,t===13){if(t=Nu(n),t!==null){e.blockedOn=t,Iu(e.priority,function(){Ru(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pa=r,n.target.dispatchEvent(r),pa=null}else return t=Hr(n),t!==null&&ui(t),e.blockedOn=n,!1;t.shift()}return!0}function jo(e,t,n){vs(e)&&n.delete(t)}function Fp(){ya=!1,Dt!==null&&vs(Dt)&&(Dt=null),Ft!==null&&vs(Ft)&&(Ft=null),At!==null&&vs(At)&&(At=null),Cr.forEach(jo),Er.forEach(jo)}function nr(e,t){e.blockedOn===t&&(e.blockedOn=null,ya||(ya=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,Fp)))}function _r(e){function t(l){return nr(l,e)}if(0<ns.length){nr(ns[0],e);for(var n=1;n<ns.length;n++){var r=ns[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Dt!==null&&nr(Dt,e),Ft!==null&&nr(Ft,e),At!==null&&nr(At,e),Cr.forEach(t),Er.forEach(t),n=0;n<It.length;n++)r=It[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<It.length&&(n=It[0],n.blockedOn===null);)Mu(n),n.blockedOn===null&&It.shift()}var Rn=_t.ReactCurrentBatchConfig,Ms=!0;function Ap(e,t,n,r){var l=q,a=Rn.transition;Rn.transition=null;try{q=1,di(e,t,n,r)}finally{q=l,Rn.transition=a}}function Up(e,t,n,r){var l=q,a=Rn.transition;Rn.transition=null;try{q=4,di(e,t,n,r)}finally{q=l,Rn.transition=a}}function di(e,t,n,r){if(Ms){var l=xa(e,t,n,r);if(l===null)Ul(e,t,r,Os,n),xo(e,r);else if(Dp(l,e,t,n,r))r.stopPropagation();else if(xo(e,r),t&4&&-1<bp.indexOf(e)){for(;l!==null;){var a=Hr(l);if(a!==null&&zu(a),a=xa(e,t,n,r),a===null&&Ul(e,t,r,Os,n),a===l)break;l=a}l!==null&&r.stopPropagation()}else Ul(e,t,r,null,n)}}var Os=null;function xa(e,t,n,r){if(Os=null,e=ii(r),e=nn(e),e!==null)if(t=hn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Nu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Os=e,null}function Ou(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(Lp()){case oi:return 1;case Eu:return 4;case Ts:case Pp:return 16;case _u:return 536870912;default:return 16}default:return 16}}var Ot=null,fi=null,gs=null;function $u(){if(gs)return gs;var e,t=fi,n=t.length,r,l="value"in Ot?Ot.value:Ot.textContent,a=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[a-r];r++);return gs=l.slice(e,1<r?1-r:void 0)}function ys(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 rs(){return!0}function wo(){return!1}function He(e){function t(n,r,l,a,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var c in e)e.hasOwnProperty(c)&&(n=e[c],this[c]=n?n(a):a[c]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?rs:wo,this.isPropagationStopped=wo,this}return ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=rs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=rs)},persist:function(){},isPersistent:rs}),t}var Qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pi=He(Qn),Wr=ne({},Qn,{view:0,detail:0}),Vp=He(Wr),Tl,Il,rr,rl=ne({},Wr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hi,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!==rr&&(rr&&e.type==="mousemove"?(Tl=e.screenX-rr.screenX,Il=e.screenY-rr.screenY):Il=Tl=0,rr=e),Tl)},movementY:function(e){return"movementY"in e?e.movementY:Il}}),No=He(rl),Bp=ne({},rl,{dataTransfer:0}),Wp=He(Bp),Hp=ne({},Wr,{relatedTarget:0}),Ml=He(Hp),Qp=ne({},Qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Kp=He(Qp),qp=ne({},Qn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gp=He(qp),Yp=ne({},Qn,{data:0}),ko=He(Yp),Xp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jp={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"},Zp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zp[e])?!!t[e]:!1}function hi(){return eh}var th=ne({},Wr,{key:function(e){if(e.key){var t=Xp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Jp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hi,charCode:function(e){return e.type==="keypress"?ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nh=He(th),rh=ne({},rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),So=He(rh),sh=ne({},Wr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hi}),lh=He(sh),ah=ne({},Qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ih=He(ah),oh=ne({},rl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ch=He(oh),uh=[9,13,27,32],mi=kt&&"CompositionEvent"in window,mr=null;kt&&"documentMode"in document&&(mr=document.documentMode);var dh=kt&&"TextEvent"in window&&!mr,bu=kt&&(!mi||mr&&8<mr&&11>=mr),Co=" ",Eo=!1;function Du(e,t){switch(e){case"keyup":return uh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function fh(e,t){switch(e){case"compositionend":return Fu(t);case"keypress":return t.which!==32?null:(Eo=!0,Co);case"textInput":return e=t.data,e===Co&&Eo?null:e;default:return null}}function ph(e,t){if(yn)return e==="compositionend"||!mi&&Du(e,t)?(e=$u(),gs=fi=Ot=null,yn=!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 bu&&t.locale!=="ko"?null:t.data;default:return null}}var hh={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 _o(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hh[e.type]:t==="textarea"}function Au(e,t,n,r){gu(r),t=$s(t,"onChange"),0<t.length&&(n=new pi("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var vr=null,Lr=null;function mh(e){Xu(e,0)}function sl(e){var t=wn(e);if(uu(t))return e}function vh(e,t){if(e==="change")return t}var Uu=!1;if(kt){var Ol;if(kt){var $l="oninput"in document;if(!$l){var Lo=document.createElement("div");Lo.setAttribute("oninput","return;"),$l=typeof Lo.oninput=="function"}Ol=$l}else Ol=!1;Uu=Ol&&(!document.documentMode||9<document.documentMode)}function Po(){vr&&(vr.detachEvent("onpropertychange",Vu),Lr=vr=null)}function Vu(e){if(e.propertyName==="value"&&sl(Lr)){var t=[];Au(t,Lr,e,ii(e)),wu(mh,t)}}function gh(e,t,n){e==="focusin"?(Po(),vr=t,Lr=n,vr.attachEvent("onpropertychange",Vu)):e==="focusout"&&Po()}function yh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sl(Lr)}function xh(e,t){if(e==="click")return sl(t)}function jh(e,t){if(e==="input"||e==="change")return sl(t)}function wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:wh;function Pr(e,t){if(it(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!ta.call(t,l)||!it(e[l],t[l]))return!1}return!0}function zo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ro(e,t){var n=zo(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zo(n)}}function Bu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wu(){for(var e=window,t=Ps();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ps(e.document)}return t}function vi(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 Nh(e){var t=Wu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bu(n.ownerDocument.documentElement,n)){if(r!==null&&vi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,a=Math.min(r.start,l);r=r.end===void 0?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=Ro(n,a);var i=Ro(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kh=kt&&"documentMode"in document&&11>=document.documentMode,xn=null,ja=null,gr=null,wa=!1;function To(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wa||xn==null||xn!==Ps(r)||(r=xn,"selectionStart"in r&&vi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),gr&&Pr(gr,r)||(gr=r,r=$s(ja,"onSelect"),0<r.length&&(t=new pi("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xn)))}function ss(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jn={animationend:ss("Animation","AnimationEnd"),animationiteration:ss("Animation","AnimationIteration"),animationstart:ss("Animation","AnimationStart"),transitionend:ss("Transition","TransitionEnd")},bl={},Hu={};kt&&(Hu=document.createElement("div").style,"AnimationEvent"in window||(delete jn.animationend.animation,delete jn.animationiteration.animation,delete jn.animationstart.animation),"TransitionEvent"in window||delete jn.transitionend.transition);function ll(e){if(bl[e])return bl[e];if(!jn[e])return e;var t=jn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hu)return bl[e]=t[n];return e}var Qu=ll("animationend"),Ku=ll("animationiteration"),qu=ll("animationstart"),Gu=ll("transitionend"),Yu=new Map,Io="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 Gt(e,t){Yu.set(e,t),pn(t,[e])}for(var Dl=0;Dl<Io.length;Dl++){var Fl=Io[Dl],Sh=Fl.toLowerCase(),Ch=Fl[0].toUpperCase()+Fl.slice(1);Gt(Sh,"on"+Ch)}Gt(Qu,"onAnimationEnd");Gt(Ku,"onAnimationIteration");Gt(qu,"onAnimationStart");Gt("dblclick","onDoubleClick");Gt("focusin","onFocus");Gt("focusout","onBlur");Gt(Gu,"onTransitionEnd");bn("onMouseEnter",["mouseout","mouseover"]);bn("onMouseLeave",["mouseout","mouseover"]);bn("onPointerEnter",["pointerout","pointerover"]);bn("onPointerLeave",["pointerout","pointerover"]);pn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pn("onBeforeInput",["compositionend","keypress","textInput","paste"]);pn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fr="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(" "),Eh=new Set("cancel close invalid load scroll toggle".split(" ").concat(fr));function Mo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Sp(r,t,void 0,e),e.currentTarget=null}function Xu(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var c=r[i],o=c.instance,u=c.currentTarget;if(c=c.listener,o!==a&&l.isPropagationStopped())break e;Mo(l,c,u),a=o}else for(i=0;i<r.length;i++){if(c=r[i],o=c.instance,u=c.currentTarget,c=c.listener,o!==a&&l.isPropagationStopped())break e;Mo(l,c,u),a=o}}}if(Rs)throw e=va,Rs=!1,va=null,e}function X(e,t){var n=t[Ea];n===void 0&&(n=t[Ea]=new Set);var r=e+"__bubble";n.has(r)||(Ju(t,e,2,!1),n.add(r))}function Al(e,t,n){var r=0;t&&(r|=4),Ju(n,e,r,t)}var ls="_reactListening"+Math.random().toString(36).slice(2);function zr(e){if(!e[ls]){e[ls]=!0,lu.forEach(function(n){n!=="selectionchange"&&(Eh.has(n)||Al(n,!1,e),Al(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ls]||(t[ls]=!0,Al("selectionchange",!1,t))}}function Ju(e,t,n,r){switch(Ou(t)){case 1:var l=Ap;break;case 4:l=Up;break;default:l=di}n=l.bind(null,t,n,e),l=void 0,!ma||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Ul(e,t,n,r,l){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var c=r.stateNode.containerInfo;if(c===l||c.nodeType===8&&c.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var o=i.tag;if((o===3||o===4)&&(o=i.stateNode.containerInfo,o===l||o.nodeType===8&&o.parentNode===l))return;i=i.return}for(;c!==null;){if(i=nn(c),i===null)return;if(o=i.tag,o===5||o===6){r=a=i;continue e}c=c.parentNode}}r=r.return}wu(function(){var u=a,d=ii(n),f=[];e:{var g=Yu.get(e);if(g!==void 0){var y=pi,j=e;switch(e){case"keypress":if(ys(n)===0)break e;case"keydown":case"keyup":y=nh;break;case"focusin":j="focus",y=Ml;break;case"focusout":j="blur",y=Ml;break;case"beforeblur":case"afterblur":y=Ml;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=No;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Wp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=lh;break;case Qu:case Ku:case qu:y=Kp;break;case Gu:y=ih;break;case"scroll":y=Vp;break;case"wheel":y=ch;break;case"copy":case"cut":case"paste":y=Gp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=So}var x=(t&4)!==0,C=!x&&e==="scroll",v=x?g!==null?g+"Capture":null:g;x=[];for(var p=u,m;p!==null;){m=p;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,v!==null&&(w=Sr(p,v),w!=null&&x.push(Rr(p,w,m)))),C)break;p=p.return}0<x.length&&(g=new y(g,j,null,n,d),f.push({event:g,listeners:x}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",g&&n!==pa&&(j=n.relatedTarget||n.fromElement)&&(nn(j)||j[St]))break e;if((y||g)&&(g=d.window===d?d:(g=d.ownerDocument)?g.defaultView||g.parentWindow:window,y?(j=n.relatedTarget||n.toElement,y=u,j=j?nn(j):null,j!==null&&(C=hn(j),j!==C||j.tag!==5&&j.tag!==6)&&(j=null)):(y=null,j=u),y!==j)){if(x=No,w="onMouseLeave",v="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(x=So,w="onPointerLeave",v="onPointerEnter",p="pointer"),C=y==null?g:wn(y),m=j==null?g:wn(j),g=new x(w,p+"leave",y,n,d),g.target=C,g.relatedTarget=m,w=null,nn(d)===u&&(x=new x(v,p+"enter",j,n,d),x.target=m,x.relatedTarget=C,w=x),C=w,y&&j)t:{for(x=y,v=j,p=0,m=x;m;m=mn(m))p++;for(m=0,w=v;w;w=mn(w))m++;for(;0<p-m;)x=mn(x),p--;for(;0<m-p;)v=mn(v),m--;for(;p--;){if(x===v||v!==null&&x===v.alternate)break t;x=mn(x),v=mn(v)}x=null}else x=null;y!==null&&Oo(f,g,y,x,!1),j!==null&&C!==null&&Oo(f,C,j,x,!0)}}e:{if(g=u?wn(u):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var E=vh;else if(_o(g))if(Uu)E=jh;else{E=yh;var S=gh}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(E=xh);if(E&&(E=E(e,u))){Au(f,E,n,d);break e}S&&S(e,g,u),e==="focusout"&&(S=g._wrapperState)&&S.controlled&&g.type==="number"&&oa(g,"number",g.value)}switch(S=u?wn(u):window,e){case"focusin":(_o(S)||S.contentEditable==="true")&&(xn=S,ja=u,gr=null);break;case"focusout":gr=ja=xn=null;break;case"mousedown":wa=!0;break;case"contextmenu":case"mouseup":case"dragend":wa=!1,To(f,n,d);break;case"selectionchange":if(kh)break;case"keydown":case"keyup":To(f,n,d)}var _;if(mi)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else yn?Du(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(bu&&n.locale!=="ko"&&(yn||k!=="onCompositionStart"?k==="onCompositionEnd"&&yn&&(_=$u()):(Ot=d,fi="value"in Ot?Ot.value:Ot.textContent,yn=!0)),S=$s(u,k),0<S.length&&(k=new ko(k,e,null,n,d),f.push({event:k,listeners:S}),_?k.data=_:(_=Fu(n),_!==null&&(k.data=_)))),(_=dh?fh(e,n):ph(e,n))&&(u=$s(u,"onBeforeInput"),0<u.length&&(d=new ko("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=_))}Xu(f,t)})}function Rr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $s(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,a=l.stateNode;l.tag===5&&a!==null&&(l=a,a=Sr(e,n),a!=null&&r.unshift(Rr(e,a,l)),a=Sr(e,t),a!=null&&r.push(Rr(e,a,l))),e=e.return}return r}function mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Oo(e,t,n,r,l){for(var a=t._reactName,i=[];n!==null&&n!==r;){var c=n,o=c.alternate,u=c.stateNode;if(o!==null&&o===r)break;c.tag===5&&u!==null&&(c=u,l?(o=Sr(n,a),o!=null&&i.unshift(Rr(n,o,c))):l||(o=Sr(n,a),o!=null&&i.push(Rr(n,o,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var _h=/\r\n?/g,Lh=/\u0000|\uFFFD/g;function $o(e){return(typeof e=="string"?e:""+e).replace(_h,`
|
|
38
|
+
`).replace(Lh,"")}function as(e,t,n){if(t=$o(t),$o(e)!==t&&n)throw Error(L(425))}function bs(){}var Na=null,ka=null;function Sa(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 Ca=typeof setTimeout=="function"?setTimeout:void 0,Ph=typeof clearTimeout=="function"?clearTimeout:void 0,bo=typeof Promise=="function"?Promise:void 0,zh=typeof queueMicrotask=="function"?queueMicrotask:typeof bo<"u"?function(e){return bo.resolve(null).then(e).catch(Rh)}:Ca;function Rh(e){setTimeout(function(){throw e})}function Vl(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),_r(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);_r(t)}function Ut(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 Do(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Kn=Math.random().toString(36).slice(2),dt="__reactFiber$"+Kn,Tr="__reactProps$"+Kn,St="__reactContainer$"+Kn,Ea="__reactEvents$"+Kn,Th="__reactListeners$"+Kn,Ih="__reactHandles$"+Kn;function nn(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[St]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Do(e);e!==null;){if(n=e[dt])return n;e=Do(e)}return t}e=n,n=e.parentNode}return null}function Hr(e){return e=e[dt]||e[St],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function al(e){return e[Tr]||null}var _a=[],Nn=-1;function Yt(e){return{current:e}}function J(e){0>Nn||(e.current=_a[Nn],_a[Nn]=null,Nn--)}function G(e,t){Nn++,_a[Nn]=e.current,e.current=t}var qt={},Se=Yt(qt),Oe=Yt(!1),on=qt;function Dn(e,t){var n=e.type.contextTypes;if(!n)return qt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function $e(e){return e=e.childContextTypes,e!=null}function Ds(){J(Oe),J(Se)}function Fo(e,t,n){if(Se.current!==qt)throw Error(L(168));G(Se,t),G(Oe,n)}function Zu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(L(108,gp(e)||"Unknown",l));return ne({},n,r)}function Fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qt,on=Se.current,G(Se,e),G(Oe,Oe.current),!0}function Ao(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Zu(e,t,on),r.__reactInternalMemoizedMergedChildContext=e,J(Oe),J(Se),G(Se,e)):J(Oe),G(Oe,n)}var yt=null,il=!1,Bl=!1;function ed(e){yt===null?yt=[e]:yt.push(e)}function Mh(e){il=!0,ed(e)}function Xt(){if(!Bl&&yt!==null){Bl=!0;var e=0,t=q;try{var n=yt;for(q=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}yt=null,il=!1}catch(l){throw yt!==null&&(yt=yt.slice(e+1)),Cu(oi,Xt),l}finally{q=t,Bl=!1}}return null}var kn=[],Sn=0,As=null,Us=0,qe=[],Ge=0,cn=null,xt=1,jt="";function en(e,t){kn[Sn++]=Us,kn[Sn++]=As,As=e,Us=t}function td(e,t,n){qe[Ge++]=xt,qe[Ge++]=jt,qe[Ge++]=cn,cn=e;var r=xt;e=jt;var l=32-lt(r)-1;r&=~(1<<l),n+=1;var a=32-lt(t)+l;if(30<a){var i=l-l%5;a=(r&(1<<i)-1).toString(32),r>>=i,l-=i,xt=1<<32-lt(t)+l|n<<l|r,jt=a+e}else xt=1<<a|n<<l|r,jt=e}function gi(e){e.return!==null&&(en(e,1),td(e,1,0))}function yi(e){for(;e===As;)As=kn[--Sn],kn[Sn]=null,Us=kn[--Sn],kn[Sn]=null;for(;e===cn;)cn=qe[--Ge],qe[Ge]=null,jt=qe[--Ge],qe[Ge]=null,xt=qe[--Ge],qe[Ge]=null}var Ve=null,Ue=null,Z=!1,st=null;function nd(e,t){var n=Ye(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Uo(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ve=e,Ue=Ut(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ve=e,Ue=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cn!==null?{id:xt,overflow:jt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ye(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ve=e,Ue=null,!0):!1;default:return!1}}function La(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pa(e){if(Z){var t=Ue;if(t){var n=t;if(!Uo(e,t)){if(La(e))throw Error(L(418));t=Ut(n.nextSibling);var r=Ve;t&&Uo(e,t)?nd(r,n):(e.flags=e.flags&-4097|2,Z=!1,Ve=e)}}else{if(La(e))throw Error(L(418));e.flags=e.flags&-4097|2,Z=!1,Ve=e}}}function Vo(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ve=e}function is(e){if(e!==Ve)return!1;if(!Z)return Vo(e),Z=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Sa(e.type,e.memoizedProps)),t&&(t=Ue)){if(La(e))throw rd(),Error(L(418));for(;t;)nd(e,t),t=Ut(t.nextSibling)}if(Vo(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ue=Ut(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ue=null}}else Ue=Ve?Ut(e.stateNode.nextSibling):null;return!0}function rd(){for(var e=Ue;e;)e=Ut(e.nextSibling)}function Fn(){Ue=Ve=null,Z=!1}function xi(e){st===null?st=[e]:st.push(e)}var Oh=_t.ReactCurrentBatchConfig;function sr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(L(309));var r=n.stateNode}if(!r)throw Error(L(147,e));var l=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var c=l.refs;i===null?delete c[a]:c[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(L(284));if(!n._owner)throw Error(L(290,e))}return e}function os(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bo(e){var t=e._init;return t(e._payload)}function sd(e){function t(v,p){if(e){var m=v.deletions;m===null?(v.deletions=[p],v.flags|=16):m.push(p)}}function n(v,p){if(!e)return null;for(;p!==null;)t(v,p),p=p.sibling;return null}function r(v,p){for(v=new Map;p!==null;)p.key!==null?v.set(p.key,p):v.set(p.index,p),p=p.sibling;return v}function l(v,p){return v=Ht(v,p),v.index=0,v.sibling=null,v}function a(v,p,m){return v.index=m,e?(m=v.alternate,m!==null?(m=m.index,m<p?(v.flags|=2,p):m):(v.flags|=2,p)):(v.flags|=1048576,p)}function i(v){return e&&v.alternate===null&&(v.flags|=2),v}function c(v,p,m,w){return p===null||p.tag!==6?(p=Yl(m,v.mode,w),p.return=v,p):(p=l(p,m),p.return=v,p)}function o(v,p,m,w){var E=m.type;return E===gn?d(v,p,m.props.children,w,m.key):p!==null&&(p.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Rt&&Bo(E)===p.type)?(w=l(p,m.props),w.ref=sr(v,p,m),w.return=v,w):(w=Cs(m.type,m.key,m.props,null,v.mode,w),w.ref=sr(v,p,m),w.return=v,w)}function u(v,p,m,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Xl(m,v.mode,w),p.return=v,p):(p=l(p,m.children||[]),p.return=v,p)}function d(v,p,m,w,E){return p===null||p.tag!==7?(p=an(m,v.mode,w,E),p.return=v,p):(p=l(p,m),p.return=v,p)}function f(v,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Yl(""+p,v.mode,m),p.return=v,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Xr:return m=Cs(p.type,p.key,p.props,null,v.mode,m),m.ref=sr(v,null,p),m.return=v,m;case vn:return p=Xl(p,v.mode,m),p.return=v,p;case Rt:var w=p._init;return f(v,w(p._payload),m)}if(ur(p)||Zn(p))return p=an(p,v.mode,m,null),p.return=v,p;os(v,p)}return null}function g(v,p,m,w){var E=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return E!==null?null:c(v,p,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Xr:return m.key===E?o(v,p,m,w):null;case vn:return m.key===E?u(v,p,m,w):null;case Rt:return E=m._init,g(v,p,E(m._payload),w)}if(ur(m)||Zn(m))return E!==null?null:d(v,p,m,w,null);os(v,m)}return null}function y(v,p,m,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return v=v.get(m)||null,c(p,v,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Xr:return v=v.get(w.key===null?m:w.key)||null,o(p,v,w,E);case vn:return v=v.get(w.key===null?m:w.key)||null,u(p,v,w,E);case Rt:var S=w._init;return y(v,p,m,S(w._payload),E)}if(ur(w)||Zn(w))return v=v.get(m)||null,d(p,v,w,E,null);os(p,w)}return null}function j(v,p,m,w){for(var E=null,S=null,_=p,k=p=0,z=null;_!==null&&k<m.length;k++){_.index>k?(z=_,_=null):z=_.sibling;var N=g(v,_,m[k],w);if(N===null){_===null&&(_=z);break}e&&_&&N.alternate===null&&t(v,_),p=a(N,p,k),S===null?E=N:S.sibling=N,S=N,_=z}if(k===m.length)return n(v,_),Z&&en(v,k),E;if(_===null){for(;k<m.length;k++)_=f(v,m[k],w),_!==null&&(p=a(_,p,k),S===null?E=_:S.sibling=_,S=_);return Z&&en(v,k),E}for(_=r(v,_);k<m.length;k++)z=y(_,v,k,m[k],w),z!==null&&(e&&z.alternate!==null&&_.delete(z.key===null?k:z.key),p=a(z,p,k),S===null?E=z:S.sibling=z,S=z);return e&&_.forEach(function($){return t(v,$)}),Z&&en(v,k),E}function x(v,p,m,w){var E=Zn(m);if(typeof E!="function")throw Error(L(150));if(m=E.call(m),m==null)throw Error(L(151));for(var S=E=null,_=p,k=p=0,z=null,N=m.next();_!==null&&!N.done;k++,N=m.next()){_.index>k?(z=_,_=null):z=_.sibling;var $=g(v,_,N.value,w);if($===null){_===null&&(_=z);break}e&&_&&$.alternate===null&&t(v,_),p=a($,p,k),S===null?E=$:S.sibling=$,S=$,_=z}if(N.done)return n(v,_),Z&&en(v,k),E;if(_===null){for(;!N.done;k++,N=m.next())N=f(v,N.value,w),N!==null&&(p=a(N,p,k),S===null?E=N:S.sibling=N,S=N);return Z&&en(v,k),E}for(_=r(v,_);!N.done;k++,N=m.next())N=y(_,v,k,N.value,w),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?k:N.key),p=a(N,p,k),S===null?E=N:S.sibling=N,S=N);return e&&_.forEach(function(Q){return t(v,Q)}),Z&&en(v,k),E}function C(v,p,m,w){if(typeof m=="object"&&m!==null&&m.type===gn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Xr:e:{for(var E=m.key,S=p;S!==null;){if(S.key===E){if(E=m.type,E===gn){if(S.tag===7){n(v,S.sibling),p=l(S,m.props.children),p.return=v,v=p;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Rt&&Bo(E)===S.type){n(v,S.sibling),p=l(S,m.props),p.ref=sr(v,S,m),p.return=v,v=p;break e}n(v,S);break}else t(v,S);S=S.sibling}m.type===gn?(p=an(m.props.children,v.mode,w,m.key),p.return=v,v=p):(w=Cs(m.type,m.key,m.props,null,v.mode,w),w.ref=sr(v,p,m),w.return=v,v=w)}return i(v);case vn:e:{for(S=m.key;p!==null;){if(p.key===S)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(v,p.sibling),p=l(p,m.children||[]),p.return=v,v=p;break e}else{n(v,p);break}else t(v,p);p=p.sibling}p=Xl(m,v.mode,w),p.return=v,v=p}return i(v);case Rt:return S=m._init,C(v,p,S(m._payload),w)}if(ur(m))return j(v,p,m,w);if(Zn(m))return x(v,p,m,w);os(v,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(v,p.sibling),p=l(p,m),p.return=v,v=p):(n(v,p),p=Yl(m,v.mode,w),p.return=v,v=p),i(v)):n(v,p)}return C}var An=sd(!0),ld=sd(!1),Vs=Yt(null),Bs=null,Cn=null,ji=null;function wi(){ji=Cn=Bs=null}function Ni(e){var t=Vs.current;J(Vs),e._currentValue=t}function za(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Tn(e,t){Bs=e,ji=Cn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Me=!0),e.firstContext=null)}function Je(e){var t=e._currentValue;if(ji!==e)if(e={context:e,memoizedValue:t,next:null},Cn===null){if(Bs===null)throw Error(L(308));Cn=e,Bs.dependencies={lanes:0,firstContext:e}}else Cn=Cn.next=e;return t}var rn=null;function ki(e){rn===null?rn=[e]:rn.push(e)}function ad(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ki(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ct(e,r)}function Ct(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tt=!1;function Si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function id(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 wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ct(e,n)}return l=r.interleaved,l===null?(t.next=t,ki(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ct(e,n)}function xs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ci(e,n)}}function Wo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?l=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?l=a=t:a=a.next=t}else l=a=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ws(e,t,n,r){var l=e.updateQueue;Tt=!1;var a=l.firstBaseUpdate,i=l.lastBaseUpdate,c=l.shared.pending;if(c!==null){l.shared.pending=null;var o=c,u=o.next;o.next=null,i===null?a=u:i.next=u,i=o;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==i&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=o))}if(a!==null){var f=l.baseState;i=0,d=u=o=null,c=a;do{var g=c.lane,y=c.eventTime;if((r&g)===g){d!==null&&(d=d.next={eventTime:y,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var j=e,x=c;switch(g=t,y=n,x.tag){case 1:if(j=x.payload,typeof j=="function"){f=j.call(y,f,g);break e}f=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=x.payload,g=typeof j=="function"?j.call(y,f,g):j,g==null)break e;f=ne({},f,g);break e;case 2:Tt=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[c]:g.push(c))}else y={eventTime:y,lane:g,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=y,o=f):d=d.next=y,i|=g;if(c=c.next,c===null){if(c=l.shared.pending,c===null)break;g=c,c=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(d===null&&(o=f),l.baseState=o,l.firstBaseUpdate=u,l.lastBaseUpdate=d,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else a===null&&(l.shared.lanes=0);dn|=i,e.lanes=i,e.memoizedState=f}}function Ho(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(L(191,l));l.call(r)}}}var Qr={},pt=Yt(Qr),Ir=Yt(Qr),Mr=Yt(Qr);function sn(e){if(e===Qr)throw Error(L(174));return e}function Ci(e,t){switch(G(Mr,t),G(Ir,e),G(pt,Qr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ua(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ua(t,e)}J(pt),G(pt,t)}function Un(){J(pt),J(Ir),J(Mr)}function od(e){sn(Mr.current);var t=sn(pt.current),n=ua(t,e.type);t!==n&&(G(Ir,e),G(pt,n))}function Ei(e){Ir.current===e&&(J(pt),J(Ir))}var ee=Yt(0);function Hs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wl=[];function _i(){for(var e=0;e<Wl.length;e++)Wl[e]._workInProgressVersionPrimary=null;Wl.length=0}var js=_t.ReactCurrentDispatcher,Hl=_t.ReactCurrentBatchConfig,un=0,te=null,fe=null,ve=null,Qs=!1,yr=!1,Or=0,$h=0;function we(){throw Error(L(321))}function Li(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!it(e[n],t[n]))return!1;return!0}function Pi(e,t,n,r,l,a){if(un=a,te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,js.current=e===null||e.memoizedState===null?Ah:Uh,e=n(r,l),yr){a=0;do{if(yr=!1,Or=0,25<=a)throw Error(L(301));a+=1,ve=fe=null,t.updateQueue=null,js.current=Vh,e=n(r,l)}while(yr)}if(js.current=Ks,t=fe!==null&&fe.next!==null,un=0,ve=fe=te=null,Qs=!1,t)throw Error(L(300));return e}function zi(){var e=Or!==0;return Or=0,e}function ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ve===null?te.memoizedState=ve=e:ve=ve.next=e,ve}function Ze(){if(fe===null){var e=te.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=ve===null?te.memoizedState:ve.next;if(t!==null)ve=t,fe=e;else{if(e===null)throw Error(L(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},ve===null?te.memoizedState=ve=e:ve=ve.next=e}return ve}function $r(e,t){return typeof t=="function"?t(e):t}function Ql(e){var t=Ze(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=fe,l=r.baseQueue,a=n.pending;if(a!==null){if(l!==null){var i=l.next;l.next=a.next,a.next=i}r.baseQueue=l=a,n.pending=null}if(l!==null){a=l.next,r=r.baseState;var c=i=null,o=null,u=a;do{var d=u.lane;if((un&d)===d)o!==null&&(o=o.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};o===null?(c=o=f,i=r):o=o.next=f,te.lanes|=d,dn|=d}u=u.next}while(u!==null&&u!==a);o===null?i=r:o.next=c,it(r,t.memoizedState)||(Me=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=o,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do a=l.lane,te.lanes|=a,dn|=a,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Kl(e){var t=Ze(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,a=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do a=e(a,i.action),i=i.next;while(i!==l);it(a,t.memoizedState)||(Me=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function cd(){}function ud(e,t){var n=te,r=Ze(),l=t(),a=!it(r.memoizedState,l);if(a&&(r.memoizedState=l,Me=!0),r=r.queue,Ri(pd.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||ve!==null&&ve.memoizedState.tag&1){if(n.flags|=2048,br(9,fd.bind(null,n,r,l,t),void 0,null),ge===null)throw Error(L(349));un&30||dd(n,t,l)}return l}function dd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=te.updateQueue,t===null?(t={lastEffect:null,stores:null},te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fd(e,t,n,r){t.value=n,t.getSnapshot=r,hd(t)&&md(e)}function pd(e,t,n){return n(function(){hd(t)&&md(e)})}function hd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!it(e,n)}catch{return!0}}function md(e){var t=Ct(e,1);t!==null&&at(t,e,1,-1)}function Qo(e){var t=ut();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:e},t.queue=e,e=e.dispatch=Fh.bind(null,te,e),[t.memoizedState,e]}function br(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=te.updateQueue,t===null?(t={lastEffect:null,stores:null},te.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function vd(){return Ze().memoizedState}function ws(e,t,n,r){var l=ut();te.flags|=e,l.memoizedState=br(1|t,n,void 0,r===void 0?null:r)}function ol(e,t,n,r){var l=Ze();r=r===void 0?null:r;var a=void 0;if(fe!==null){var i=fe.memoizedState;if(a=i.destroy,r!==null&&Li(r,i.deps)){l.memoizedState=br(t,n,a,r);return}}te.flags|=e,l.memoizedState=br(1|t,n,a,r)}function Ko(e,t){return ws(8390656,8,e,t)}function Ri(e,t){return ol(2048,8,e,t)}function gd(e,t){return ol(4,2,e,t)}function yd(e,t){return ol(4,4,e,t)}function xd(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 jd(e,t,n){return n=n!=null?n.concat([e]):null,ol(4,4,xd.bind(null,t,e),n)}function Ti(){}function wd(e,t){var n=Ze();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Li(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Nd(e,t){var n=Ze();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Li(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function kd(e,t,n){return un&21?(it(n,t)||(n=Lu(),te.lanes|=n,dn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Me=!0),e.memoizedState=n)}function bh(e,t){var n=q;q=n!==0&&4>n?n:4,e(!0);var r=Hl.transition;Hl.transition={};try{e(!1),t()}finally{q=n,Hl.transition=r}}function Sd(){return Ze().memoizedState}function Dh(e,t,n){var r=Wt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cd(e))Ed(t,n);else if(n=ad(e,t,n,r),n!==null){var l=_e();at(n,e,r,l),_d(n,t,r)}}function Fh(e,t,n){var r=Wt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cd(e))Ed(t,l);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,c=a(i,n);if(l.hasEagerState=!0,l.eagerState=c,it(c,i)){var o=t.interleaved;o===null?(l.next=l,ki(t)):(l.next=o.next,o.next=l),t.interleaved=l;return}}catch{}finally{}n=ad(e,t,l,r),n!==null&&(l=_e(),at(n,e,r,l),_d(n,t,r))}}function Cd(e){var t=e.alternate;return e===te||t!==null&&t===te}function Ed(e,t){yr=Qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _d(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ci(e,n)}}var Ks={readContext:Je,useCallback:we,useContext:we,useEffect:we,useImperativeHandle:we,useInsertionEffect:we,useLayoutEffect:we,useMemo:we,useReducer:we,useRef:we,useState:we,useDebugValue:we,useDeferredValue:we,useTransition:we,useMutableSource:we,useSyncExternalStore:we,useId:we,unstable_isNewReconciler:!1},Ah={readContext:Je,useCallback:function(e,t){return ut().memoizedState=[e,t===void 0?null:t],e},useContext:Je,useEffect:Ko,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ws(4194308,4,xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ws(4194308,4,e,t)},useInsertionEffect:function(e,t){return ws(4,2,e,t)},useMemo:function(e,t){var n=ut();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ut();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Dh.bind(null,te,e),[r.memoizedState,e]},useRef:function(e){var t=ut();return e={current:e},t.memoizedState=e},useState:Qo,useDebugValue:Ti,useDeferredValue:function(e){return ut().memoizedState=e},useTransition:function(){var e=Qo(!1),t=e[0];return e=bh.bind(null,e[1]),ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=te,l=ut();if(Z){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),ge===null)throw Error(L(349));un&30||dd(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,Ko(pd.bind(null,r,a,e),[e]),r.flags|=2048,br(9,fd.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=ut(),t=ge.identifierPrefix;if(Z){var n=jt,r=xt;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Or++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=$h++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Uh={readContext:Je,useCallback:wd,useContext:Je,useEffect:Ri,useImperativeHandle:jd,useInsertionEffect:gd,useLayoutEffect:yd,useMemo:Nd,useReducer:Ql,useRef:vd,useState:function(){return Ql($r)},useDebugValue:Ti,useDeferredValue:function(e){var t=Ze();return kd(t,fe.memoizedState,e)},useTransition:function(){var e=Ql($r)[0],t=Ze().memoizedState;return[e,t]},useMutableSource:cd,useSyncExternalStore:ud,useId:Sd,unstable_isNewReconciler:!1},Vh={readContext:Je,useCallback:wd,useContext:Je,useEffect:Ri,useImperativeHandle:jd,useInsertionEffect:gd,useLayoutEffect:yd,useMemo:Nd,useReducer:Kl,useRef:vd,useState:function(){return Kl($r)},useDebugValue:Ti,useDeferredValue:function(e){var t=Ze();return fe===null?t.memoizedState=e:kd(t,fe.memoizedState,e)},useTransition:function(){var e=Kl($r)[0],t=Ze().memoizedState;return[e,t]},useMutableSource:cd,useSyncExternalStore:ud,useId:Sd,unstable_isNewReconciler:!1};function nt(e,t){if(e&&e.defaultProps){t=ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ra(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var cl={isMounted:function(e){return(e=e._reactInternals)?hn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_e(),l=Wt(e),a=wt(r,l);a.payload=t,n!=null&&(a.callback=n),t=Vt(e,a,l),t!==null&&(at(t,e,l,r),xs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_e(),l=Wt(e),a=wt(r,l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Vt(e,a,l),t!==null&&(at(t,e,l,r),xs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_e(),r=Wt(e),l=wt(n,r);l.tag=2,t!=null&&(l.callback=t),t=Vt(e,l,r),t!==null&&(at(t,e,r,n),xs(t,e,r))}};function qo(e,t,n,r,l,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!Pr(n,r)||!Pr(l,a):!0}function Ld(e,t,n){var r=!1,l=qt,a=t.contextType;return typeof a=="object"&&a!==null?a=Je(a):(l=$e(t)?on:Se.current,r=t.contextTypes,a=(r=r!=null)?Dn(e,l):qt),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function Go(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&cl.enqueueReplaceState(t,t.state,null)}function Ta(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Si(e);var a=t.contextType;typeof a=="object"&&a!==null?l.context=Je(a):(a=$e(t)?on:Se.current,l.context=Dn(e,a)),l.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ra(e,t,a,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&cl.enqueueReplaceState(l,l.state,null),Ws(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Vn(e,t){try{var n="",r=t;do n+=vp(r),r=r.return;while(r);var l=n}catch(a){l=`
|
|
39
|
+
Error generating stack: `+a.message+`
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:l,digest:null}}function ql(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ia(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Bh=typeof WeakMap=="function"?WeakMap:Map;function Pd(e,t,n){n=wt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gs||(Gs=!0,Ba=r),Ia(e,t)},n}function zd(e,t,n){n=wt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Ia(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Ia(e,t),typeof r!="function"&&(Bt===null?Bt=new Set([this]):Bt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Yo(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bh;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=rm.bind(null,e,t,n),t.then(e,e))}function Xo(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 Jo(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=wt(-1,1),t.tag=2,Vt(n,t,1))),n.lanes|=1),e)}var Wh=_t.ReactCurrentOwner,Me=!1;function Ee(e,t,n,r){t.child=e===null?ld(t,null,n,r):An(t,e.child,n,r)}function Zo(e,t,n,r,l){n=n.render;var a=t.ref;return Tn(t,l),r=Pi(e,t,n,r,a,l),n=zi(),e!==null&&!Me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Et(e,t,l)):(Z&&n&&gi(t),t.flags|=1,Ee(e,t,r,l),t.child)}function ec(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Rd(e,t,a,r,l)):(e=Cs(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&l)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:Pr,n(i,r)&&e.ref===t.ref)return Et(e,t,l)}return t.flags|=1,e=Ht(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rd(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(Pr(a,r)&&e.ref===t.ref)if(Me=!1,t.pendingProps=r=a,(e.lanes&l)!==0)e.flags&131072&&(Me=!0);else return t.lanes=e.lanes,Et(e,t,l)}return Ma(e,t,n,r,l)}function Td(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(_n,Ae),Ae|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,G(_n,Ae),Ae|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,G(_n,Ae),Ae|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,G(_n,Ae),Ae|=r;return Ee(e,t,l,n),t.child}function Id(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ma(e,t,n,r,l){var a=$e(n)?on:Se.current;return a=Dn(t,a),Tn(t,l),n=Pi(e,t,n,r,a,l),r=zi(),e!==null&&!Me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Et(e,t,l)):(Z&&r&&gi(t),t.flags|=1,Ee(e,t,n,l),t.child)}function tc(e,t,n,r,l){if($e(n)){var a=!0;Fs(t)}else a=!1;if(Tn(t,l),t.stateNode===null)Ns(e,t),Ld(t,n,r),Ta(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,c=t.memoizedProps;i.props=c;var o=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=Je(u):(u=$e(n)?on:Se.current,u=Dn(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==r||o!==u)&&Go(t,i,r,u),Tt=!1;var g=t.memoizedState;i.state=g,Ws(t,r,i,l),o=t.memoizedState,c!==r||g!==o||Oe.current||Tt?(typeof d=="function"&&(Ra(t,n,d,r),o=t.memoizedState),(c=Tt||qo(t,n,c,r,g,o,u))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=o),i.props=r,i.state=o,i.context=u,r=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,id(e,t),c=t.memoizedProps,u=t.type===t.elementType?c:nt(t.type,c),i.props=u,f=t.pendingProps,g=i.context,o=n.contextType,typeof o=="object"&&o!==null?o=Je(o):(o=$e(n)?on:Se.current,o=Dn(t,o));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==f||g!==o)&&Go(t,i,r,o),Tt=!1,g=t.memoizedState,i.state=g,Ws(t,r,i,l);var j=t.memoizedState;c!==f||g!==j||Oe.current||Tt?(typeof y=="function"&&(Ra(t,n,y,r),j=t.memoizedState),(u=Tt||qo(t,n,u,r,g,j,o)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,j,o),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,j,o)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=j),i.props=r,i.state=j,i.context=o,r=u):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return Oa(e,t,n,r,a,l)}function Oa(e,t,n,r,l,a){Id(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&Ao(t,n,!1),Et(e,t,a);r=t.stateNode,Wh.current=t;var c=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=An(t,e.child,null,a),t.child=An(t,null,c,a)):Ee(e,t,c,a),t.memoizedState=r.state,l&&Ao(t,n,!0),t.child}function Md(e){var t=e.stateNode;t.pendingContext?Fo(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Fo(e,t.context,!1),Ci(e,t.containerInfo)}function nc(e,t,n,r,l){return Fn(),xi(l),t.flags|=256,Ee(e,t,n,r),t.child}var $a={dehydrated:null,treeContext:null,retryLane:0};function ba(e){return{baseLanes:e,cachePool:null,transitions:null}}function Od(e,t,n){var r=t.pendingProps,l=ee.current,a=!1,i=(t.flags&128)!==0,c;if((c=i)||(c=e!==null&&e.memoizedState===null?!1:(l&2)!==0),c?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),G(ee,l&1),e===null)return Pa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,a?(r=t.mode,a=t.child,i={mode:"hidden",children:i},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=fl(i,r,0,null),e=an(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ba(n),t.memoizedState=$a,e):Ii(t,i));if(l=e.memoizedState,l!==null&&(c=l.dehydrated,c!==null))return Hh(e,t,i,r,c,l,n);if(a){a=r.fallback,i=t.mode,l=e.child,c=l.sibling;var o={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=o,t.deletions=null):(r=Ht(l,o),r.subtreeFlags=l.subtreeFlags&14680064),c!==null?a=Ht(c,a):(a=an(a,i,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,i=e.child.memoizedState,i=i===null?ba(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=$a,r}return a=e.child,e=a.sibling,r=Ht(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ii(e,t){return t=fl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cs(e,t,n,r){return r!==null&&xi(r),An(t,e.child,null,n),e=Ii(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hh(e,t,n,r,l,a,i){if(n)return t.flags&256?(t.flags&=-257,r=ql(Error(L(422))),cs(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,l=t.mode,r=fl({mode:"visible",children:r.children},l,0,null),a=an(a,l,i,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&An(t,e.child,null,i),t.child.memoizedState=ba(i),t.memoizedState=$a,a);if(!(t.mode&1))return cs(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var c=r.dgst;return r=c,a=Error(L(419)),r=ql(a,r,void 0),cs(e,t,i,r)}if(c=(i&e.childLanes)!==0,Me||c){if(r=ge,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==a.retryLane&&(a.retryLane=l,Ct(e,l),at(r,e,l,-1))}return Fi(),r=ql(Error(L(421))),cs(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=sm.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,Ue=Ut(l.nextSibling),Ve=t,Z=!0,st=null,e!==null&&(qe[Ge++]=xt,qe[Ge++]=jt,qe[Ge++]=cn,xt=e.id,jt=e.overflow,cn=t),t=Ii(t,r.children),t.flags|=4096,t)}function rc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),za(e.return,t,n)}function Gl(e,t,n,r,l){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function $d(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(Ee(e,t,r.children,n),r=ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rc(e,n,t);else if(e.tag===19)rc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(G(ee,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Hs(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Gl(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Hs(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Gl(t,!0,n,null,a);break;case"together":Gl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ns(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Et(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,n=Ht(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ht(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Qh(e,t,n){switch(t.tag){case 3:Md(t),Fn();break;case 5:od(t);break;case 1:$e(t.type)&&Fs(t);break;case 4:Ci(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;G(Vs,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(G(ee,ee.current&1),t.flags|=128,null):n&t.child.childLanes?Od(e,t,n):(G(ee,ee.current&1),e=Et(e,t,n),e!==null?e.sibling:null);G(ee,ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return $d(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),G(ee,ee.current),r)break;return null;case 22:case 23:return t.lanes=0,Td(e,t,n)}return Et(e,t,n)}var bd,Da,Dd,Fd;bd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Da=function(){};Dd=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,sn(pt.current);var a=null;switch(n){case"input":l=aa(e,l),r=aa(e,r),a=[];break;case"select":l=ne({},l,{value:void 0}),r=ne({},r,{value:void 0}),a=[];break;case"textarea":l=ca(e,l),r=ca(e,r),a=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bs)}da(n,r);var i;n=null;for(u in l)if(!r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&l[u]!=null)if(u==="style"){var c=l[u];for(i in c)c.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Nr.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var o=r[u];if(c=l!=null?l[u]:void 0,r.hasOwnProperty(u)&&o!==c&&(o!=null||c!=null))if(u==="style")if(c){for(i in c)!c.hasOwnProperty(i)||o&&o.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in o)o.hasOwnProperty(i)&&c[i]!==o[i]&&(n||(n={}),n[i]=o[i])}else n||(a||(a=[]),a.push(u,n)),n=o;else u==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,c=c?c.__html:void 0,o!=null&&c!==o&&(a=a||[]).push(u,o)):u==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(u,""+o):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Nr.hasOwnProperty(u)?(o!=null&&u==="onScroll"&&X("scroll",e),a||c===o||(a=[])):(a=a||[]).push(u,o))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Fd=function(e,t,n,r){n!==r&&(t.flags|=4)};function lr(e,t){if(!Z)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Kh(e,t,n){var r=t.pendingProps;switch(yi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return $e(t.type)&&Ds(),Ne(t),null;case 3:return r=t.stateNode,Un(),J(Oe),J(Se),_i(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(is(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,st!==null&&(Qa(st),st=null))),Da(e,t),Ne(t),null;case 5:Ei(t);var l=sn(Mr.current);if(n=t.type,e!==null&&t.stateNode!=null)Dd(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return Ne(t),null}if(e=sn(pt.current),is(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[dt]=t,r[Tr]=a,e=(t.mode&1)!==0,n){case"dialog":X("cancel",r),X("close",r);break;case"iframe":case"object":case"embed":X("load",r);break;case"video":case"audio":for(l=0;l<fr.length;l++)X(fr[l],r);break;case"source":X("error",r);break;case"img":case"image":case"link":X("error",r),X("load",r);break;case"details":X("toggle",r);break;case"input":fo(r,a),X("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},X("invalid",r);break;case"textarea":ho(r,a),X("invalid",r)}da(n,a),l=null;for(var i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="children"?typeof c=="string"?r.textContent!==c&&(a.suppressHydrationWarning!==!0&&as(r.textContent,c,e),l=["children",c]):typeof c=="number"&&r.textContent!==""+c&&(a.suppressHydrationWarning!==!0&&as(r.textContent,c,e),l=["children",""+c]):Nr.hasOwnProperty(i)&&c!=null&&i==="onScroll"&&X("scroll",r)}switch(n){case"input":Jr(r),po(r,a,!0);break;case"textarea":Jr(r),mo(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=bs)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=pu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[dt]=t,e[Tr]=r,bd(e,t,!1,!1),t.stateNode=e;e:{switch(i=fa(n,r),n){case"dialog":X("cancel",e),X("close",e),l=r;break;case"iframe":case"object":case"embed":X("load",e),l=r;break;case"video":case"audio":for(l=0;l<fr.length;l++)X(fr[l],e);l=r;break;case"source":X("error",e),l=r;break;case"img":case"image":case"link":X("error",e),X("load",e),l=r;break;case"details":X("toggle",e),l=r;break;case"input":fo(e,r),l=aa(e,r),X("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=ne({},r,{value:void 0}),X("invalid",e);break;case"textarea":ho(e,r),l=ca(e,r),X("invalid",e);break;default:l=r}da(n,l),c=l;for(a in c)if(c.hasOwnProperty(a)){var o=c[a];a==="style"?vu(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&hu(e,o)):a==="children"?typeof o=="string"?(n!=="textarea"||o!=="")&&kr(e,o):typeof o=="number"&&kr(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Nr.hasOwnProperty(a)?o!=null&&a==="onScroll"&&X("scroll",e):o!=null&&ri(e,a,o,i))}switch(n){case"input":Jr(e),po(e,r,!1);break;case"textarea":Jr(e),mo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kt(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Ln(e,!!r.multiple,a,!1):r.defaultValue!=null&&Ln(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=bs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ne(t),null;case 6:if(e&&t.stateNode!=null)Fd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=sn(Mr.current),sn(pt.current),is(t)){if(r=t.stateNode,n=t.memoizedProps,r[dt]=t,(a=r.nodeValue!==n)&&(e=Ve,e!==null))switch(e.tag){case 3:as(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&as(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[dt]=t,t.stateNode=r}return Ne(t),null;case 13:if(J(ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Z&&Ue!==null&&t.mode&1&&!(t.flags&128))rd(),Fn(),t.flags|=98560,a=!1;else if(a=is(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(L(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(L(317));a[dt]=t}else Fn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ne(t),a=!1}else st!==null&&(Qa(st),st=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ee.current&1?pe===0&&(pe=3):Fi())),t.updateQueue!==null&&(t.flags|=4),Ne(t),null);case 4:return Un(),Da(e,t),e===null&&zr(t.stateNode.containerInfo),Ne(t),null;case 10:return Ni(t.type._context),Ne(t),null;case 17:return $e(t.type)&&Ds(),Ne(t),null;case 19:if(J(ee),a=t.memoizedState,a===null)return Ne(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)lr(a,!1);else{if(pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Hs(e),i!==null){for(t.flags|=128,lr(a,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return G(ee,ee.current&1|2),t.child}e=e.sibling}a.tail!==null&&ue()>Bn&&(t.flags|=128,r=!0,lr(a,!1),t.lanes=4194304)}else{if(!r)if(e=Hs(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lr(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!Z)return Ne(t),null}else 2*ue()-a.renderingStartTime>Bn&&n!==1073741824&&(t.flags|=128,r=!0,lr(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(n=a.last,n!==null?n.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ue(),t.sibling=null,n=ee.current,G(ee,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return Di(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ae&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function qh(e,t){switch(yi(t),t.tag){case 1:return $e(t.type)&&Ds(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Un(),J(Oe),J(Se),_i(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ei(t),null;case 13:if(J(ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));Fn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return J(ee),null;case 4:return Un(),null;case 10:return Ni(t.type._context),null;case 22:case 23:return Di(),null;case 24:return null;default:return null}}var us=!1,ke=!1,Gh=typeof WeakSet=="function"?WeakSet:Set,I=null;function En(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){le(e,t,r)}else n.current=null}function Fa(e,t,n){try{n()}catch(r){le(e,t,r)}}var sc=!1;function Yh(e,t){if(Na=Ms,e=Wu(),vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,c=-1,o=-1,u=0,d=0,f=e,g=null;t:for(;;){for(var y;f!==n||l!==0&&f.nodeType!==3||(c=i+l),f!==a||r!==0&&f.nodeType!==3||(o=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(y=f.firstChild)!==null;)g=f,f=y;for(;;){if(f===e)break t;if(g===n&&++u===l&&(c=i),g===a&&++d===r&&(o=i),(y=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=y}n=c===-1||o===-1?null:{start:c,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(ka={focusedElem:e,selectionRange:n},Ms=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var x=j.memoizedProps,C=j.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:nt(t.type,x),C);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(w){le(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return j=sc,sc=!1,j}function xr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,a!==void 0&&Fa(t,n,a)}l=l.next}while(l!==r)}}function ul(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Aa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ad(e){var t=e.alternate;t!==null&&(e.alternate=null,Ad(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dt],delete t[Tr],delete t[Ea],delete t[Th],delete t[Ih])),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 Ud(e){return e.tag===5||e.tag===3||e.tag===4}function lc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ud(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 Ua(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bs));else if(r!==4&&(e=e.child,e!==null))for(Ua(e,t,n),e=e.sibling;e!==null;)Ua(e,t,n),e=e.sibling}function Va(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Va(e,t,n),e=e.sibling;e!==null;)Va(e,t,n),e=e.sibling}var ye=null,rt=!1;function zt(e,t,n){for(n=n.child;n!==null;)Vd(e,t,n),n=n.sibling}function Vd(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(nl,n)}catch{}switch(n.tag){case 5:ke||En(n,t);case 6:var r=ye,l=rt;ye=null,zt(e,t,n),ye=r,rt=l,ye!==null&&(rt?(e=ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ye.removeChild(n.stateNode));break;case 18:ye!==null&&(rt?(e=ye,n=n.stateNode,e.nodeType===8?Vl(e.parentNode,n):e.nodeType===1&&Vl(e,n),_r(e)):Vl(ye,n.stateNode));break;case 4:r=ye,l=rt,ye=n.stateNode.containerInfo,rt=!0,zt(e,t,n),ye=r,rt=l;break;case 0:case 11:case 14:case 15:if(!ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var a=l,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&Fa(n,t,i),l=l.next}while(l!==r)}zt(e,t,n);break;case 1:if(!ke&&(En(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){le(n,t,c)}zt(e,t,n);break;case 21:zt(e,t,n);break;case 22:n.mode&1?(ke=(r=ke)||n.memoizedState!==null,zt(e,t,n),ke=r):zt(e,t,n);break;default:zt(e,t,n)}}function ac(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Gh),t.forEach(function(r){var l=lm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function tt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var a=e,i=t,c=i;e:for(;c!==null;){switch(c.tag){case 5:ye=c.stateNode,rt=!1;break e;case 3:ye=c.stateNode.containerInfo,rt=!0;break e;case 4:ye=c.stateNode.containerInfo,rt=!0;break e}c=c.return}if(ye===null)throw Error(L(160));Vd(a,i,l),ye=null,rt=!1;var o=l.alternate;o!==null&&(o.return=null),l.return=null}catch(u){le(l,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bd(t,e),t=t.sibling}function Bd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(tt(t,e),ct(e),r&4){try{xr(3,e,e.return),ul(3,e)}catch(x){le(e,e.return,x)}try{xr(5,e,e.return)}catch(x){le(e,e.return,x)}}break;case 1:tt(t,e),ct(e),r&512&&n!==null&&En(n,n.return);break;case 5:if(tt(t,e),ct(e),r&512&&n!==null&&En(n,n.return),e.flags&32){var l=e.stateNode;try{kr(l,"")}catch(x){le(e,e.return,x)}}if(r&4&&(l=e.stateNode,l!=null)){var a=e.memoizedProps,i=n!==null?n.memoizedProps:a,c=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{c==="input"&&a.type==="radio"&&a.name!=null&&du(l,a),fa(c,i);var u=fa(c,a);for(i=0;i<o.length;i+=2){var d=o[i],f=o[i+1];d==="style"?vu(l,f):d==="dangerouslySetInnerHTML"?hu(l,f):d==="children"?kr(l,f):ri(l,d,f,u)}switch(c){case"input":ia(l,a);break;case"textarea":fu(l,a);break;case"select":var g=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?Ln(l,!!a.multiple,y,!1):g!==!!a.multiple&&(a.defaultValue!=null?Ln(l,!!a.multiple,a.defaultValue,!0):Ln(l,!!a.multiple,a.multiple?[]:"",!1))}l[Tr]=a}catch(x){le(e,e.return,x)}}break;case 6:if(tt(t,e),ct(e),r&4){if(e.stateNode===null)throw Error(L(162));l=e.stateNode,a=e.memoizedProps;try{l.nodeValue=a}catch(x){le(e,e.return,x)}}break;case 3:if(tt(t,e),ct(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{_r(t.containerInfo)}catch(x){le(e,e.return,x)}break;case 4:tt(t,e),ct(e);break;case 13:tt(t,e),ct(e),l=e.child,l.flags&8192&&(a=l.memoizedState!==null,l.stateNode.isHidden=a,!a||l.alternate!==null&&l.alternate.memoizedState!==null||($i=ue())),r&4&&ac(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ke=(u=ke)||d,tt(t,e),ke=u):tt(t,e),ct(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(I=e,d=e.child;d!==null;){for(f=I=d;I!==null;){switch(g=I,y=g.child,g.tag){case 0:case 11:case 14:case 15:xr(4,g,g.return);break;case 1:En(g,g.return);var j=g.stateNode;if(typeof j.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(x){le(r,n,x)}}break;case 5:En(g,g.return);break;case 22:if(g.memoizedState!==null){oc(f);continue}}y!==null?(y.return=g,I=y):oc(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{l=f.stateNode,u?(a=l.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(c=f.stateNode,o=f.memoizedProps.style,i=o!=null&&o.hasOwnProperty("display")?o.display:null,c.style.display=mu("display",i))}catch(x){le(e,e.return,x)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(x){le(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:tt(t,e),ct(e),r&4&&ac(e);break;case 21:break;default:tt(t,e),ct(e)}}function ct(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ud(n)){var r=n;break e}n=n.return}throw Error(L(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(kr(l,""),r.flags&=-33);var a=lc(e);Va(e,a,l);break;case 3:case 4:var i=r.stateNode.containerInfo,c=lc(e);Ua(e,c,i);break;default:throw Error(L(161))}}catch(o){le(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xh(e,t,n){I=e,Wd(e)}function Wd(e,t,n){for(var r=(e.mode&1)!==0;I!==null;){var l=I,a=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||us;if(!i){var c=l.alternate,o=c!==null&&c.memoizedState!==null||ke;c=us;var u=ke;if(us=i,(ke=o)&&!u)for(I=l;I!==null;)i=I,o=i.child,i.tag===22&&i.memoizedState!==null?cc(l):o!==null?(o.return=i,I=o):cc(l);for(;a!==null;)I=a,Wd(a),a=a.sibling;I=l,us=c,ke=u}ic(e)}else l.subtreeFlags&8772&&a!==null?(a.return=l,I=a):ic(e)}}function ic(e){for(;I!==null;){var t=I;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ke||ul(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ke)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:nt(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Ho(t,a,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ho(t,i,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&n.focus();break;case"img":o.src&&(n.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&_r(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}ke||t.flags&512&&Aa(t)}catch(g){le(t,t.return,g)}}if(t===e){I=null;break}if(n=t.sibling,n!==null){n.return=t.return,I=n;break}I=t.return}}function oc(e){for(;I!==null;){var t=I;if(t===e){I=null;break}var n=t.sibling;if(n!==null){n.return=t.return,I=n;break}I=t.return}}function cc(e){for(;I!==null;){var t=I;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ul(4,t)}catch(o){le(t,n,o)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(o){le(t,l,o)}}var a=t.return;try{Aa(t)}catch(o){le(t,a,o)}break;case 5:var i=t.return;try{Aa(t)}catch(o){le(t,i,o)}}}catch(o){le(t,t.return,o)}if(t===e){I=null;break}var c=t.sibling;if(c!==null){c.return=t.return,I=c;break}I=t.return}}var Jh=Math.ceil,qs=_t.ReactCurrentDispatcher,Mi=_t.ReactCurrentOwner,Xe=_t.ReactCurrentBatchConfig,W=0,ge=null,de=null,xe=0,Ae=0,_n=Yt(0),pe=0,Dr=null,dn=0,dl=0,Oi=0,jr=null,Ie=null,$i=0,Bn=1/0,gt=null,Gs=!1,Ba=null,Bt=null,ds=!1,$t=null,Ys=0,wr=0,Wa=null,ks=-1,Ss=0;function _e(){return W&6?ue():ks!==-1?ks:ks=ue()}function Wt(e){return e.mode&1?W&2&&xe!==0?xe&-xe:Oh.transition!==null?(Ss===0&&(Ss=Lu()),Ss):(e=q,e!==0||(e=window.event,e=e===void 0?16:Ou(e.type)),e):1}function at(e,t,n,r){if(50<wr)throw wr=0,Wa=null,Error(L(185));Br(e,n,r),(!(W&2)||e!==ge)&&(e===ge&&(!(W&2)&&(dl|=n),pe===4&&Mt(e,xe)),be(e,r),n===1&&W===0&&!(t.mode&1)&&(Bn=ue()+500,il&&Xt()))}function be(e,t){var n=e.callbackNode;Op(e,t);var r=Is(e,e===ge?xe:0);if(r===0)n!==null&&yo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yo(n),t===1)e.tag===0?Mh(uc.bind(null,e)):ed(uc.bind(null,e)),zh(function(){!(W&6)&&Xt()}),n=null;else{switch(Pu(r)){case 1:n=oi;break;case 4:n=Eu;break;case 16:n=Ts;break;case 536870912:n=_u;break;default:n=Ts}n=Jd(n,Hd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Hd(e,t){if(ks=-1,Ss=0,W&6)throw Error(L(327));var n=e.callbackNode;if(In()&&e.callbackNode!==n)return null;var r=Is(e,e===ge?xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Xs(e,r);else{t=r;var l=W;W|=2;var a=Kd();(ge!==e||xe!==t)&&(gt=null,Bn=ue()+500,ln(e,t));do try{tm();break}catch(c){Qd(e,c)}while(!0);wi(),qs.current=a,W=l,de!==null?t=0:(ge=null,xe=0,t=pe)}if(t!==0){if(t===2&&(l=ga(e),l!==0&&(r=l,t=Ha(e,l))),t===1)throw n=Dr,ln(e,0),Mt(e,r),be(e,ue()),n;if(t===6)Mt(e,r);else{if(l=e.current.alternate,!(r&30)&&!Zh(l)&&(t=Xs(e,r),t===2&&(a=ga(e),a!==0&&(r=a,t=Ha(e,a))),t===1))throw n=Dr,ln(e,0),Mt(e,r),be(e,ue()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:tn(e,Ie,gt);break;case 3:if(Mt(e,r),(r&130023424)===r&&(t=$i+500-ue(),10<t)){if(Is(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){_e(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Ca(tn.bind(null,e,Ie,gt),t);break}tn(e,Ie,gt);break;case 4:if(Mt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-lt(r);a=1<<i,i=t[i],i>l&&(l=i),r&=~a}if(r=l,r=ue()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Jh(r/1960))-r,10<r){e.timeoutHandle=Ca(tn.bind(null,e,Ie,gt),r);break}tn(e,Ie,gt);break;case 5:tn(e,Ie,gt);break;default:throw Error(L(329))}}}return be(e,ue()),e.callbackNode===n?Hd.bind(null,e):null}function Ha(e,t){var n=jr;return e.current.memoizedState.isDehydrated&&(ln(e,t).flags|=256),e=Xs(e,t),e!==2&&(t=Ie,Ie=n,t!==null&&Qa(t)),e}function Qa(e){Ie===null?Ie=e:Ie.push.apply(Ie,e)}function Zh(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],a=l.getSnapshot;l=l.value;try{if(!it(a(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mt(e,t){for(t&=~Oi,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-lt(t),r=1<<n;e[n]=-1,t&=~r}}function uc(e){if(W&6)throw Error(L(327));In();var t=Is(e,0);if(!(t&1))return be(e,ue()),null;var n=Xs(e,t);if(e.tag!==0&&n===2){var r=ga(e);r!==0&&(t=r,n=Ha(e,r))}if(n===1)throw n=Dr,ln(e,0),Mt(e,t),be(e,ue()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,tn(e,Ie,gt),be(e,ue()),null}function bi(e,t){var n=W;W|=1;try{return e(t)}finally{W=n,W===0&&(Bn=ue()+500,il&&Xt())}}function fn(e){$t!==null&&$t.tag===0&&!(W&6)&&In();var t=W;W|=1;var n=Xe.transition,r=q;try{if(Xe.transition=null,q=1,e)return e()}finally{q=r,Xe.transition=n,W=t,!(W&6)&&Xt()}}function Di(){Ae=_n.current,J(_n)}function ln(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ph(n)),de!==null)for(n=de.return;n!==null;){var r=n;switch(yi(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ds();break;case 3:Un(),J(Oe),J(Se),_i();break;case 5:Ei(r);break;case 4:Un();break;case 13:J(ee);break;case 19:J(ee);break;case 10:Ni(r.type._context);break;case 22:case 23:Di()}n=n.return}if(ge=e,de=e=Ht(e.current,null),xe=Ae=t,pe=0,Dr=null,Oi=dl=dn=0,Ie=jr=null,rn!==null){for(t=0;t<rn.length;t++)if(n=rn[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,a=n.pending;if(a!==null){var i=a.next;a.next=l,r.next=i}n.pending=r}rn=null}return e}function Qd(e,t){do{var n=de;try{if(wi(),js.current=Ks,Qs){for(var r=te.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Qs=!1}if(un=0,ve=fe=te=null,yr=!1,Or=0,Mi.current=null,n===null||n.return===null){pe=1,Dr=t,de=null;break}e:{var a=e,i=n.return,c=n,o=t;if(t=xe,c.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var u=o,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var g=d.alternate;g?(d.updateQueue=g.updateQueue,d.memoizedState=g.memoizedState,d.lanes=g.lanes):(d.updateQueue=null,d.memoizedState=null)}var y=Xo(i);if(y!==null){y.flags&=-257,Jo(y,i,c,a,t),y.mode&1&&Yo(a,u,t),t=y,o=u;var j=t.updateQueue;if(j===null){var x=new Set;x.add(o),t.updateQueue=x}else j.add(o);break e}else{if(!(t&1)){Yo(a,u,t),Fi();break e}o=Error(L(426))}}else if(Z&&c.mode&1){var C=Xo(i);if(C!==null){!(C.flags&65536)&&(C.flags|=256),Jo(C,i,c,a,t),xi(Vn(o,c));break e}}a=o=Vn(o,c),pe!==4&&(pe=2),jr===null?jr=[a]:jr.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=Pd(a,o,t);Wo(a,v);break e;case 1:c=o;var p=a.type,m=a.stateNode;if(!(a.flags&128)&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Bt===null||!Bt.has(m)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=zd(a,c,t);Wo(a,w);break e}}a=a.return}while(a!==null)}Gd(n)}catch(E){t=E,de===n&&n!==null&&(de=n=n.return);continue}break}while(!0)}function Kd(){var e=qs.current;return qs.current=Ks,e===null?Ks:e}function Fi(){(pe===0||pe===3||pe===2)&&(pe=4),ge===null||!(dn&268435455)&&!(dl&268435455)||Mt(ge,xe)}function Xs(e,t){var n=W;W|=2;var r=Kd();(ge!==e||xe!==t)&&(gt=null,ln(e,t));do try{em();break}catch(l){Qd(e,l)}while(!0);if(wi(),W=n,qs.current=r,de!==null)throw Error(L(261));return ge=null,xe=0,pe}function em(){for(;de!==null;)qd(de)}function tm(){for(;de!==null&&!Ep();)qd(de)}function qd(e){var t=Xd(e.alternate,e,Ae);e.memoizedProps=e.pendingProps,t===null?Gd(e):de=t,Mi.current=null}function Gd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=qh(n,t),n!==null){n.flags&=32767,de=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pe=6,de=null;return}}else if(n=Kh(n,t,Ae),n!==null){de=n;return}if(t=t.sibling,t!==null){de=t;return}de=t=e}while(t!==null);pe===0&&(pe=5)}function tn(e,t,n){var r=q,l=Xe.transition;try{Xe.transition=null,q=1,nm(e,t,n,r)}finally{Xe.transition=l,q=r}return null}function nm(e,t,n,r){do In();while($t!==null);if(W&6)throw Error(L(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(L(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if($p(e,a),e===ge&&(de=ge=null,xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ds||(ds=!0,Jd(Ts,function(){return In(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Xe.transition,Xe.transition=null;var i=q;q=1;var c=W;W|=4,Mi.current=null,Yh(e,n),Bd(n,e),Nh(ka),Ms=!!Na,ka=Na=null,e.current=n,Xh(n),_p(),W=c,q=i,Xe.transition=a}else e.current=n;if(ds&&(ds=!1,$t=e,Ys=l),a=e.pendingLanes,a===0&&(Bt=null),zp(n.stateNode),be(e,ue()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(Gs)throw Gs=!1,e=Ba,Ba=null,e;return Ys&1&&e.tag!==0&&In(),a=e.pendingLanes,a&1?e===Wa?wr++:(wr=0,Wa=e):wr=0,Xt(),null}function In(){if($t!==null){var e=Pu(Ys),t=Xe.transition,n=q;try{if(Xe.transition=null,q=16>e?16:e,$t===null)var r=!1;else{if(e=$t,$t=null,Ys=0,W&6)throw Error(L(331));var l=W;for(W|=4,I=e.current;I!==null;){var a=I,i=a.child;if(I.flags&16){var c=a.deletions;if(c!==null){for(var o=0;o<c.length;o++){var u=c[o];for(I=u;I!==null;){var d=I;switch(d.tag){case 0:case 11:case 15:xr(8,d,a)}var f=d.child;if(f!==null)f.return=d,I=f;else for(;I!==null;){d=I;var g=d.sibling,y=d.return;if(Ad(d),d===u){I=null;break}if(g!==null){g.return=y,I=g;break}I=y}}}var j=a.alternate;if(j!==null){var x=j.child;if(x!==null){j.child=null;do{var C=x.sibling;x.sibling=null,x=C}while(x!==null)}}I=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,I=i;else e:for(;I!==null;){if(a=I,a.flags&2048)switch(a.tag){case 0:case 11:case 15:xr(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,I=v;break e}I=a.return}}var p=e.current;for(I=p;I!==null;){i=I;var m=i.child;if(i.subtreeFlags&2064&&m!==null)m.return=i,I=m;else e:for(i=p;I!==null;){if(c=I,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:ul(9,c)}}catch(E){le(c,c.return,E)}if(c===i){I=null;break e}var w=c.sibling;if(w!==null){w.return=c.return,I=w;break e}I=c.return}}if(W=l,Xt(),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(nl,e)}catch{}r=!0}return r}finally{q=n,Xe.transition=t}}return!1}function dc(e,t,n){t=Vn(n,t),t=Pd(e,t,1),e=Vt(e,t,1),t=_e(),e!==null&&(Br(e,1,t),be(e,t))}function le(e,t,n){if(e.tag===3)dc(e,e,n);else for(;t!==null;){if(t.tag===3){dc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Bt===null||!Bt.has(r))){e=Vn(n,e),e=zd(t,e,1),t=Vt(t,e,1),e=_e(),t!==null&&(Br(t,1,e),be(t,e));break}}t=t.return}}function rm(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_e(),e.pingedLanes|=e.suspendedLanes&n,ge===e&&(xe&n)===n&&(pe===4||pe===3&&(xe&130023424)===xe&&500>ue()-$i?ln(e,0):Oi|=n),be(e,t)}function Yd(e,t){t===0&&(e.mode&1?(t=ts,ts<<=1,!(ts&130023424)&&(ts=4194304)):t=1);var n=_e();e=Ct(e,t),e!==null&&(Br(e,t,n),be(e,n))}function sm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yd(e,n)}function lm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),Yd(e,n)}var Xd;Xd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)Me=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Me=!1,Qh(e,t,n);Me=!!(e.flags&131072)}else Me=!1,Z&&t.flags&1048576&&td(t,Us,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ns(e,t),e=t.pendingProps;var l=Dn(t,Se.current);Tn(t,n),l=Pi(null,t,r,e,l,n);var a=zi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$e(r)?(a=!0,Fs(t)):a=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Si(t),l.updater=cl,t.stateNode=l,l._reactInternals=t,Ta(t,r,e,n),t=Oa(null,t,r,!0,a,n)):(t.tag=0,Z&&a&&gi(t),Ee(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ns(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=im(r),e=nt(r,e),l){case 0:t=Ma(null,t,r,e,n);break e;case 1:t=tc(null,t,r,e,n);break e;case 11:t=Zo(null,t,r,e,n);break e;case 14:t=ec(null,t,r,nt(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:nt(r,l),Ma(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:nt(r,l),tc(e,t,r,l,n);case 3:e:{if(Md(t),e===null)throw Error(L(387));r=t.pendingProps,a=t.memoizedState,l=a.element,id(e,t),Ws(t,r,null,n);var i=t.memoizedState;if(r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){l=Vn(Error(L(423)),t),t=nc(e,t,r,n,l);break e}else if(r!==l){l=Vn(Error(L(424)),t),t=nc(e,t,r,n,l);break e}else for(Ue=Ut(t.stateNode.containerInfo.firstChild),Ve=t,Z=!0,st=null,n=ld(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fn(),r===l){t=Et(e,t,n);break e}Ee(e,t,r,n)}t=t.child}return t;case 5:return od(t),e===null&&Pa(t),r=t.type,l=t.pendingProps,a=e!==null?e.memoizedProps:null,i=l.children,Sa(r,l)?i=null:a!==null&&Sa(r,a)&&(t.flags|=32),Id(e,t),Ee(e,t,i,n),t.child;case 6:return e===null&&Pa(t),null;case 13:return Od(e,t,n);case 4:return Ci(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=An(t,null,r,n):Ee(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:nt(r,l),Zo(e,t,r,l,n);case 7:return Ee(e,t,t.pendingProps,n),t.child;case 8:return Ee(e,t,t.pendingProps.children,n),t.child;case 12:return Ee(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,a=t.memoizedProps,i=l.value,G(Vs,r._currentValue),r._currentValue=i,a!==null)if(it(a.value,i)){if(a.children===l.children&&!Oe.current){t=Et(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){i=a.child;for(var o=c.firstContext;o!==null;){if(o.context===r){if(a.tag===1){o=wt(-1,n&-n),o.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?o.next=o:(o.next=d.next,d.next=o),u.pending=o}}a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),za(a.return,n,t),c.lanes|=n;break}o=o.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(L(341));i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),za(i,n,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Ee(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Tn(t,n),l=Je(l),r=r(l),t.flags|=1,Ee(e,t,r,n),t.child;case 14:return r=t.type,l=nt(r,t.pendingProps),l=nt(r.type,l),ec(e,t,r,l,n);case 15:return Rd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:nt(r,l),Ns(e,t),t.tag=1,$e(r)?(e=!0,Fs(t)):e=!1,Tn(t,n),Ld(t,r,l),Ta(t,r,l,n),Oa(null,t,r,!0,e,n);case 19:return $d(e,t,n);case 22:return Td(e,t,n)}throw Error(L(156,t.tag))};function Jd(e,t){return Cu(e,t)}function am(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ye(e,t,n,r){return new am(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function im(e){if(typeof e=="function")return Ai(e)?1:0;if(e!=null){if(e=e.$$typeof,e===li)return 11;if(e===ai)return 14}return 2}function Ht(e,t){var n=e.alternate;return n===null?(n=Ye(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Cs(e,t,n,r,l,a){var i=2;if(r=e,typeof e=="function")Ai(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case gn:return an(n.children,l,a,t);case si:i=8,l|=8;break;case na:return e=Ye(12,n,t,l|2),e.elementType=na,e.lanes=a,e;case ra:return e=Ye(13,n,t,l),e.elementType=ra,e.lanes=a,e;case sa:return e=Ye(19,n,t,l),e.elementType=sa,e.lanes=a,e;case ou:return fl(n,l,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case au:i=10;break e;case iu:i=9;break e;case li:i=11;break e;case ai:i=14;break e;case Rt:i=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Ye(i,n,t,l),t.elementType=e,t.type=r,t.lanes=a,t}function an(e,t,n,r){return e=Ye(7,e,r,t),e.lanes=n,e}function fl(e,t,n,r){return e=Ye(22,e,r,t),e.elementType=ou,e.lanes=n,e.stateNode={isHidden:!1},e}function Yl(e,t,n){return e=Ye(6,e,null,t),e.lanes=n,e}function Xl(e,t,n){return t=Ye(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function om(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rl(0),this.expirationTimes=Rl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ui(e,t,n,r,l,a,i,c,o){return e=new om(e,t,n,c,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ye(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Si(a),e}function cm(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Zd(e){if(!e)return qt;e=e._reactInternals;e:{if(hn(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if($e(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var n=e.type;if($e(n))return Zu(e,n,t)}return t}function ef(e,t,n,r,l,a,i,c,o){return e=Ui(n,r,!0,e,l,a,i,c,o),e.context=Zd(null),n=e.current,r=_e(),l=Wt(n),a=wt(r,l),a.callback=t??null,Vt(n,a,l),e.current.lanes=l,Br(e,l,r),be(e,r),e}function pl(e,t,n,r){var l=t.current,a=_e(),i=Wt(l);return n=Zd(n),t.context===null?t.context=n:t.pendingContext=n,t=wt(a,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vt(l,t,i),e!==null&&(at(e,l,i,a),xs(e,l,i)),i}function Js(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 fc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vi(e,t){fc(e,t),(e=e.alternate)&&fc(e,t)}function um(){return null}var tf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bi(e){this._internalRoot=e}hl.prototype.render=Bi.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));pl(e,t,null,null)};hl.prototype.unmount=Bi.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fn(function(){pl(null,e,null,null)}),t[St]=null}};function hl(e){this._internalRoot=e}hl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<It.length&&t!==0&&t<It[n].priority;n++);It.splice(n,0,e),n===0&&Mu(e)}};function Wi(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ml(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pc(){}function dm(e,t,n,r,l){if(l){if(typeof r=="function"){var a=r;r=function(){var u=Js(i);a.call(u)}}var i=ef(t,r,e,0,null,!1,!1,"",pc);return e._reactRootContainer=i,e[St]=i.current,zr(e.nodeType===8?e.parentNode:e),fn(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var c=r;r=function(){var u=Js(o);c.call(u)}}var o=Ui(e,0,!1,null,null,!1,!1,"",pc);return e._reactRootContainer=o,e[St]=o.current,zr(e.nodeType===8?e.parentNode:e),fn(function(){pl(t,o,n,r)}),o}function vl(e,t,n,r,l){var a=n._reactRootContainer;if(a){var i=a;if(typeof l=="function"){var c=l;l=function(){var o=Js(i);c.call(o)}}pl(t,i,e,l)}else i=dm(n,t,e,l,r);return Js(i)}zu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dr(t.pendingLanes);n!==0&&(ci(t,n|1),be(t,ue()),!(W&6)&&(Bn=ue()+500,Xt()))}break;case 13:fn(function(){var r=Ct(e,1);if(r!==null){var l=_e();at(r,e,1,l)}}),Vi(e,1)}};ui=function(e){if(e.tag===13){var t=Ct(e,134217728);if(t!==null){var n=_e();at(t,e,134217728,n)}Vi(e,134217728)}};Ru=function(e){if(e.tag===13){var t=Wt(e),n=Ct(e,t);if(n!==null){var r=_e();at(n,e,t,r)}Vi(e,t)}};Tu=function(){return q};Iu=function(e,t){var n=q;try{return q=e,t()}finally{q=n}};ha=function(e,t,n){switch(t){case"input":if(ia(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=al(r);if(!l)throw Error(L(90));uu(r),ia(r,l)}}}break;case"textarea":fu(e,n);break;case"select":t=n.value,t!=null&&Ln(e,!!n.multiple,t,!1)}};xu=bi;ju=fn;var fm={usingClientEntryPoint:!1,Events:[Hr,wn,al,gu,yu,bi]},ar={findFiberByHostInstance:nn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pm={bundleType:ar.bundleType,version:ar.version,rendererPackageName:ar.rendererPackageName,rendererConfig:ar.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ku(e),e===null?null:e.stateNode},findFiberByHostInstance:ar.findFiberByHostInstance||um,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 fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fs.isDisabled&&fs.supportsFiber)try{nl=fs.inject(pm),ft=fs}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fm;We.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wi(t))throw Error(L(200));return cm(e,t,null,n)};We.createRoot=function(e,t){if(!Wi(e))throw Error(L(299));var n=!1,r="",l=tf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=Ui(e,1,!1,null,null,n,!1,r,l),e[St]=t.current,zr(e.nodeType===8?e.parentNode:e),new Bi(t)};We.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(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=ku(t),e=e===null?null:e.stateNode,e};We.flushSync=function(e){return fn(e)};We.hydrate=function(e,t,n){if(!ml(t))throw Error(L(200));return vl(null,e,t,!0,n)};We.hydrateRoot=function(e,t,n){if(!Wi(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,l=!1,a="",i=tf;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=ef(t,null,e,1,n??null,l,!1,a,i),e[St]=t.current,zr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new hl(t)};We.render=function(e,t,n){if(!ml(t))throw Error(L(200));return vl(null,e,t,!1,n)};We.unmountComponentAtNode=function(e){if(!ml(e))throw Error(L(40));return e._reactRootContainer?(fn(function(){vl(null,null,e,!1,function(){e._reactRootContainer=null,e[St]=null})}),!0):!1};We.unstable_batchedUpdates=bi;We.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ml(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return vl(e,t,n,!1,r)};We.version="18.3.1-next-f1338f8080-20240426";function nf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nf)}catch(e){console.error(e)}}nf(),nu.exports=We;var hm=nu.exports,hc=hm;ea.createRoot=hc.createRoot,ea.hydrateRoot=hc.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.3
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function Fr(){return Fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fr.apply(null,arguments)}var bt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(bt||(bt={}));const mc="popstate";function mm(e){e===void 0&&(e={});function t(r,l){let{pathname:a,search:i,hash:c}=r.location;return Ka("",{pathname:a,search:i,hash:c},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Zs(l)}return gm(t,n,null,e)}function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vm(){return Math.random().toString(36).substr(2,8)}function vc(e,t){return{usr:e.state,key:e.key,idx:t}}function Ka(e,t,n,r){return n===void 0&&(n=null),Fr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qn(t):t,{state:n,key:t&&t.key||r||vm()})}function Zs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function qn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function gm(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:a=!1}=r,i=l.history,c=bt.Pop,o=null,u=d();u==null&&(u=0,i.replaceState(Fr({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function f(){c=bt.Pop;let C=d(),v=C==null?null:C-u;u=C,o&&o({action:c,location:x.location,delta:v})}function g(C,v){c=bt.Push;let p=Ka(x.location,C,v);u=d()+1;let m=vc(p,u),w=x.createHref(p);try{i.pushState(m,"",w)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;l.location.assign(w)}a&&o&&o({action:c,location:x.location,delta:1})}function y(C,v){c=bt.Replace;let p=Ka(x.location,C,v);u=d();let m=vc(p,u),w=x.createHref(p);i.replaceState(m,"",w),a&&o&&o({action:c,location:x.location,delta:0})}function j(C){let v=l.location.origin!=="null"?l.location.origin:l.location.href,p=typeof C=="string"?C:Zs(C);return p=p.replace(/ $/,"%20"),ae(v,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,v)}let x={get action(){return c},get location(){return e(l,i)},listen(C){if(o)throw new Error("A history only accepts one active listener");return l.addEventListener(mc,f),o=C,()=>{l.removeEventListener(mc,f),o=null}},createHref(C){return t(l,C)},createURL:j,encodeLocation(C){let v=j(C);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:g,replace:y,go(C){return i.go(C)}};return x}var gc;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gc||(gc={}));function ym(e,t,n){return n===void 0&&(n="/"),xm(e,t,n)}function xm(e,t,n,r){let l=typeof t=="string"?qn(t):t,a=Wn(l.pathname||"/",n);if(a==null)return null;let i=rf(e);jm(i);let c=null,o=Rm(a);for(let u=0;c==null&&u<i.length;++u)c=Pm(i[u],o);return c}function rf(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(a,i,c)=>{let o={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};o.relativePath.startsWith("/")&&(ae(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(r.length));let u=Qt([r,o.relativePath]),d=n.concat(o);a.children&&a.children.length>0&&(ae(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),rf(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:_m(u,a.index),routesMeta:d})};return e.forEach((a,i)=>{var c;if(a.path===""||!((c=a.path)!=null&&c.includes("?")))l(a,i);else for(let o of sf(a.path))l(a,i,o)}),t}function sf(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return l?[a,""]:[a];let i=sf(r.join("/")),c=[];return c.push(...i.map(o=>o===""?a:[a,o].join("/"))),l&&c.push(...i),c.map(o=>e.startsWith("/")&&o===""?"/":o)}function jm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Lm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wm=/^:[\w-]+$/,Nm=3,km=2,Sm=1,Cm=10,Em=-2,yc=e=>e==="*";function _m(e,t){let n=e.split("/"),r=n.length;return n.some(yc)&&(r+=Em),t&&(r+=km),n.filter(l=>!yc(l)).reduce((l,a)=>l+(wm.test(a)?Nm:a===""?Sm:Cm),r)}function Lm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Pm(e,t,n){let{routesMeta:r}=e,l={},a="/",i=[];for(let c=0;c<r.length;++c){let o=r[c],u=c===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=qa({path:o.relativePath,caseSensitive:o.caseSensitive,end:u},d),g=o.route;if(!f)return null;Object.assign(l,f.params),i.push({params:l,pathname:Qt([a,f.pathname]),pathnameBase:$m(Qt([a,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(a=Qt([a,f.pathnameBase]))}return i}function qa(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zm(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let a=l[0],i=a.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:g,isOptional:y}=d;if(g==="*"){let x=c[f]||"";i=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const j=c[f];return y&&!j?u[g]=void 0:u[g]=(j||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:i,pattern:e}}function zm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Hi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,c,o)=>(r.push({paramName:c,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Rm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hi(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Wn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Tm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Im=e=>Tm.test(e);function Mm(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?qn(e):e,a;if(n)if(Im(n))a=n;else{if(n.includes("//")){let i=n;n=of(n),Hi(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?a=xc(n.substring(1),"/"):a=xc(n,t)}else a=t;return{pathname:a,search:bm(r),hash:Dm(l)}}function xc(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Jl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Om(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lf(e,t){let n=Om(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function af(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=qn(e):(l=Fr({},e),ae(!l.pathname||!l.pathname.includes("?"),Jl("?","pathname","search",l)),ae(!l.pathname||!l.pathname.includes("#"),Jl("#","pathname","hash",l)),ae(!l.search||!l.search.includes("#"),Jl("#","search","hash",l)));let a=e===""||l.pathname==="",i=a?"/":l.pathname,c;if(i==null)c=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;l.pathname=g.join("/")}c=f>=0?t[f]:"/"}let o=Mm(l,c),u=i&&i!=="/"&&i.endsWith("/"),d=(a||i===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(u||d)&&(o.pathname+="/"),o}const of=e=>e.replace(/\/\/+/g,"/"),Qt=e=>of(e.join("/")),$m=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Dm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Fm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cf=["post","put","patch","delete"];new Set(cf);const Am=["get",...cf];new Set(Am);/**
|
|
50
|
+
* React Router v6.30.4
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(null,arguments)}const gl=h.createContext(null),uf=h.createContext(null),Jt=h.createContext(null),yl=h.createContext(null),Lt=h.createContext({outlet:null,matches:[],isDataRoute:!1}),df=h.createContext(null);function Um(e,t){let{relative:n}=t===void 0?{}:t;Kr()||ae(!1);let{basename:r,navigator:l}=h.useContext(Jt),{hash:a,pathname:i,search:c}=xl(e,{relative:n}),o=i;return r!=="/"&&(o=i==="/"?r:Qt([r,i])),l.createHref({pathname:o,search:c,hash:a})}function Kr(){return h.useContext(yl)!=null}function qr(){return Kr()||ae(!1),h.useContext(yl).location}function ff(e){h.useContext(Jt).static||h.useLayoutEffect(e)}function Gn(){let{isDataRoute:e}=h.useContext(Lt);return e?nv():Vm()}function Vm(){Kr()||ae(!1);let e=h.useContext(gl),{basename:t,future:n,navigator:r}=h.useContext(Jt),{matches:l}=h.useContext(Lt),{pathname:a}=qr(),i=JSON.stringify(lf(l,n.v7_relativeSplatPath)),c=h.useRef(!1);return ff(()=>{c.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!c.current)return;if(typeof u=="number"){r.go(u);return}let f=af(u,JSON.parse(i),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Qt([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,i,a,e])}const Bm=h.createContext(null);function Wm(e){let t=h.useContext(Lt).outlet;return t&&h.createElement(Bm.Provider,{value:e},t)}function pf(){let{matches:e}=h.useContext(Lt),t=e[e.length-1];return t?t.params:{}}function xl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(Jt),{matches:l}=h.useContext(Lt),{pathname:a}=qr(),i=JSON.stringify(lf(l,r.v7_relativeSplatPath));return h.useMemo(()=>af(e,JSON.parse(i),a,n==="path"),[e,i,a,n])}function Hm(e,t){return Qm(e,t)}function Qm(e,t,n,r){Kr()||ae(!1);let{navigator:l}=h.useContext(Jt),{matches:a}=h.useContext(Lt),i=a[a.length-1],c=i?i.params:{};i&&i.pathname;let o=i?i.pathnameBase:"/";i&&i.route;let u=qr(),d;if(t){var f;let C=typeof t=="string"?qn(t):t;o==="/"||(f=C.pathname)!=null&&f.startsWith(o)||ae(!1),d=C}else d=u;let g=d.pathname||"/",y=g;if(o!=="/"){let C=o.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(C.length).join("/")}let j=ym(e,{pathname:y}),x=Xm(j&&j.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:Qt([o,l.encodeLocation?l.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?o:Qt([o,l.encodeLocation?l.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&x?h.createElement(yl.Provider,{value:{location:Ar({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:bt.Pop}},x):x}function Km(){let e=tv(),t=Fm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:l},n):null,null)}const qm=h.createElement(Km,null);class Gm extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Lt.Provider,{value:this.props.routeContext},h.createElement(df.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ym(e){let{routeContext:t,match:n,children:r}=e,l=h.useContext(gl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Lt.Provider,{value:t},r)}function Xm(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,c=(l=n)==null?void 0:l.errors;if(c!=null){let d=i.findIndex(f=>f.route.id&&(c==null?void 0:c[f.route.id])!==void 0);d>=0||ae(!1),i=i.slice(0,Math.min(i.length,d+1))}let o=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<i.length;d++){let f=i[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:g,errors:y}=n,j=f.route.loader&&g[f.route.id]===void 0&&(!y||y[f.route.id]===void 0);if(f.route.lazy||j){o=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,f,g)=>{let y,j=!1,x=null,C=null;n&&(y=c&&f.route.id?c[f.route.id]:void 0,x=f.route.errorElement||qm,o&&(u<0&&g===0?(rv("route-fallback"),j=!0,C=null):u===g&&(j=!0,C=f.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,g+1)),p=()=>{let m;return y?m=x:j?m=C:f.route.Component?m=h.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=d,h.createElement(Ym,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:m})};return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?h.createElement(Gm,{location:n.location,revalidation:n.revalidation,component:x,error:y,children:p(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):p()},null)}var hf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hf||{}),mf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(mf||{});function Jm(e){let t=h.useContext(gl);return t||ae(!1),t}function Zm(e){let t=h.useContext(uf);return t||ae(!1),t}function ev(e){let t=h.useContext(Lt);return t||ae(!1),t}function vf(e){let t=ev(),n=t.matches[t.matches.length-1];return n.route.id||ae(!1),n.route.id}function tv(){var e;let t=h.useContext(df),n=Zm(),r=vf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function nv(){let{router:e}=Jm(hf.UseNavigateStable),t=vf(mf.UseNavigateStable),n=h.useRef(!1);return ff(()=>{n.current=!0}),h.useCallback(function(l,a){a===void 0&&(a={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Ar({fromRouteId:t},a)))},[e,t])}const jc={};function rv(e,t,n){jc[e]||(jc[e]=!0)}function sv(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wc(e){return Wm(e.context)}function Fe(e){ae(!1)}function lv(e){let{basename:t="/",children:n=null,location:r,navigationType:l=bt.Pop,navigator:a,static:i=!1,future:c}=e;Kr()&&ae(!1);let o=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:o,navigator:a,static:i,future:Ar({v7_relativeSplatPath:!1},c)}),[o,c,a,i]);typeof r=="string"&&(r=qn(r));let{pathname:d="/",search:f="",hash:g="",state:y=null,key:j="default"}=r,x=h.useMemo(()=>{let C=Wn(d,o);return C==null?null:{location:{pathname:C,search:f,hash:g,state:y,key:j},navigationType:l}},[o,d,f,g,y,j,l]);return x==null?null:h.createElement(Jt.Provider,{value:u},h.createElement(yl.Provider,{children:n,value:x}))}function av(e){let{children:t,location:n}=e;return Hm(Ga(t),n)}new Promise(()=>{});function Ga(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,l)=>{if(!h.isValidElement(r))return;let a=[...t,l];if(r.type===h.Fragment){n.push.apply(n,Ga(r.props.children,a));return}r.type!==Fe&&ae(!1),!r.props.index||!r.props.children||ae(!1);let i={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ga(r.props.children,a)),n.push(i)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.4
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function el(){return el=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},el.apply(null,arguments)}function gf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function iv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ov(e,t){return e.button===0&&(!t||t==="_self")&&!iv(e)}const cv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uv=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],dv="6";try{window.__reactRouterVersion=dv}catch{}const fv=h.createContext({isTransitioning:!1}),pv="startTransition",Nc=rp[pv];function hv(e){let{basename:t,children:n,future:r,window:l}=e,a=h.useRef();a.current==null&&(a.current=mm({window:l,v5Compat:!0}));let i=a.current,[c,o]=h.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},d=h.useCallback(f=>{u&&Nc?Nc(()=>o(f)):o(f)},[o,u]);return h.useLayoutEffect(()=>i.listen(d),[i,d]),h.useEffect(()=>sv(r),[r]),h.createElement(lv,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:i,future:r})}const mv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yn=h.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:a,replace:i,state:c,target:o,to:u,preventScrollReset:d,viewTransition:f}=t,g=gf(t,cv),{basename:y}=h.useContext(Jt),j,x=!1;if(typeof u=="string"&&vv.test(u)&&(j=u,mv))try{let m=new URL(window.location.href),w=u.startsWith("//")?new URL(m.protocol+u):new URL(u),E=Wn(w.pathname,y);w.origin===m.origin&&E!=null?u=E+w.search+w.hash:x=!0}catch{}let C=Um(u,{relative:l}),v=yv(u,{replace:i,state:c,target:o,preventScrollReset:d,relative:l,viewTransition:f});function p(m){r&&r(m),m.defaultPrevented||v(m)}return h.createElement("a",el({},g,{href:j||C,onClick:x||a?r:p,ref:n,target:o}))}),kc=h.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:a="",end:i=!1,style:c,to:o,viewTransition:u,children:d}=t,f=gf(t,uv),g=xl(o,{relative:f.relative}),y=qr(),j=h.useContext(uf),{navigator:x,basename:C}=h.useContext(Jt),v=j!=null&&xv(g)&&u===!0,p=x.encodeLocation?x.encodeLocation(g).pathname:g.pathname,m=y.pathname,w=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;l||(m=m.toLowerCase(),w=w?w.toLowerCase():null,p=p.toLowerCase()),w&&C&&(w=Wn(w,C)||w);const E=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let S=m===p||!i&&m.startsWith(p)&&m.charAt(E)==="/",_=w!=null&&(w===p||!i&&w.startsWith(p)&&w.charAt(p.length)==="/"),k={isActive:S,isPending:_,isTransitioning:v},z=S?r:void 0,N;typeof a=="function"?N=a(k):N=[a,S?"active":null,_?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let $=typeof c=="function"?c(k):c;return h.createElement(Yn,el({},f,{"aria-current":z,className:N,ref:n,style:$,to:o,viewTransition:u}),typeof d=="function"?d(k):d)});var Ya;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ya||(Ya={}));var Sc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sc||(Sc={}));function gv(e){let t=h.useContext(gl);return t||ae(!1),t}function yv(e,t){let{target:n,replace:r,state:l,preventScrollReset:a,relative:i,viewTransition:c}=t===void 0?{}:t,o=Gn(),u=qr(),d=xl(e,{relative:i});return h.useCallback(f=>{if(ov(f,n)){f.preventDefault();let g=r!==void 0?r:Zs(u)===Zs(d);o(e,{replace:g,state:l,preventScrollReset:a,relative:i,viewTransition:c})}},[u,o,d,r,l,n,e,a,i,c])}function xv(e,t){t===void 0&&(t={});let n=h.useContext(fv);n==null&&ae(!1);let{basename:r}=gv(Ya.useViewTransitionState),l=xl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qa(l.pathname,i)!=null||qa(l.pathname,a)!=null}/**
|
|
68
|
+
* @license lucide-react v0.563.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const yf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
73
|
+
* @license lucide-react v0.563.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const jv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
78
|
+
* @license lucide-react v0.563.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const wv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
83
|
+
* @license lucide-react v0.563.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const Cc=e=>{const t=wv(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
88
|
+
* @license lucide-react v0.563.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/var Nv={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"};/**
|
|
93
|
+
* @license lucide-react v0.563.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const kv=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
98
|
+
* @license lucide-react v0.563.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Sv=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:a,iconNode:i,...c},o)=>h.createElement("svg",{ref:o,...Nv,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yf("lucide",l),...!a&&!kv(c)&&{"aria-hidden":"true"},...c},[...i.map(([u,d])=>h.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
|
|
103
|
+
* @license lucide-react v0.563.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const B=(e,t)=>{const n=h.forwardRef(({className:r,...l},a)=>h.createElement(Sv,{ref:a,iconNode:t,className:yf(`lucide-${jv(Cc(e))}`,`lucide-${e}`,r),...l}));return n.displayName=Cc(e),n};/**
|
|
108
|
+
* @license lucide-react v0.563.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const Cv=[["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"}]],Ev=B("activity",Cv);/**
|
|
113
|
+
* @license lucide-react v0.563.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const _v=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Lv=B("arrow-right",_v);/**
|
|
118
|
+
* @license lucide-react v0.563.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const Pv=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zv=B("ban",Pv);/**
|
|
123
|
+
* @license lucide-react v0.563.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const Rv=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],Tv=B("cable",Rv);/**
|
|
128
|
+
* @license lucide-react v0.563.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Iv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nt=B("check",Iv);/**
|
|
133
|
+
* @license lucide-react v0.563.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const Mv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jl=B("chevron-down",Mv);/**
|
|
138
|
+
* @license lucide-react v0.563.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Ov=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qi=B("chevron-right",Ov);/**
|
|
143
|
+
* @license lucide-react v0.563.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const $v=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],bv=B("download",$v);/**
|
|
148
|
+
* @license lucide-react v0.563.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const Dv=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ur=B("external-link",Dv);/**
|
|
153
|
+
* @license lucide-react v0.563.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const Fv=[["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"}]],Av=B("eye-off",Fv);/**
|
|
158
|
+
* @license lucide-react v0.563.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const Uv=[["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"}]],Vv=B("eye",Uv);/**
|
|
163
|
+
* @license lucide-react v0.563.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const Bv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Wv=B("globe",Bv);/**
|
|
168
|
+
* @license lucide-react v0.563.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const Hv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Qv=B("info",Hv);/**
|
|
173
|
+
* @license lucide-react v0.563.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const Kv=[["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"}]],Ki=B("key-round",Kv);/**
|
|
178
|
+
* @license lucide-react v0.563.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const qv=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Gv=B("layout-dashboard",qv);/**
|
|
183
|
+
* @license lucide-react v0.563.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const Yv=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],se=B("loader-circle",Yv);/**
|
|
188
|
+
* @license lucide-react v0.563.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const Xv=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Jv=B("lock",Xv);/**
|
|
193
|
+
* @license lucide-react v0.563.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const Zv=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],eg=B("log-out",Zv);/**
|
|
198
|
+
* @license lucide-react v0.563.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const tg=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ng=B("menu",tg);/**
|
|
203
|
+
* @license lucide-react v0.563.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const rg=[["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"}]],Ec=B("pencil",rg);/**
|
|
208
|
+
* @license lucide-react v0.563.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const sg=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Es=B("play",sg);/**
|
|
213
|
+
* @license lucide-react v0.563.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const lg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],qi=B("plus",lg);/**
|
|
218
|
+
* @license lucide-react v0.563.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const ag=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Mn=B("radio",ag);/**
|
|
223
|
+
* @license lucide-react v0.563.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const ig=[["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"}]],og=B("refresh-cw",ig);/**
|
|
228
|
+
* @license lucide-react v0.563.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const cg=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xf=B("rotate-ccw",cg);/**
|
|
233
|
+
* @license lucide-react v0.563.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const ug=[["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"}]],_s=B("rotate-cw",ug);/**
|
|
238
|
+
* @license lucide-react v0.563.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const dg=[["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"}]],fg=B("scroll-text",dg);/**
|
|
243
|
+
* @license lucide-react v0.563.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const pg=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hg=B("search",pg);/**
|
|
248
|
+
* @license lucide-react v0.563.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const mg=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vg=B("shield-check",mg);/**
|
|
253
|
+
* @license lucide-react v0.563.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const gg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ls=B("square",gg);/**
|
|
258
|
+
* @license lucide-react v0.563.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const yg=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gi=B("trash-2",yg);/**
|
|
263
|
+
* @license lucide-react v0.563.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const xg=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ke=B("triangle-alert",xg);/**
|
|
268
|
+
* @license lucide-react v0.563.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const jg=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],jf=B("users",jg);/**
|
|
273
|
+
* @license lucide-react v0.563.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const wg=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],_c=B("wifi",wg);/**
|
|
278
|
+
* @license lucide-react v0.563.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const Ng=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xn=B("x",Ng);let On=null;function kg(e){return On=e,()=>{On===e&&(On=null)}}function wf(){On==null||On()}function Nf(){return"Too many attempts. Try again in a minute."}async function Sg(){try{const e=await fetch("/api/auth/check",{credentials:"include",headers:{accept:"application/json"}}),t=await e.json().catch(()=>({}));return e.ok?{authenticated:!!t.authenticated}:{authenticated:!1,error:t.error}}catch{return{authenticated:!1}}}async function Cg(e){const t=await fetch("/api/auth/login",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({password:e})});if(t.ok)return;if(t.status===429)throw{status:429,message:Nf()};const n=await t.json().catch(()=>({}));throw{status:t.status,message:n.error||"Login failed"}}async function Eg(){await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:{accept:"application/json"}}).catch(()=>{})}async function _g(e,t){const n=await fetch("/api/auth/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({currentPassword:e,newPassword:t})});if(n.ok)return;if(n.status===429)throw{status:429,message:Nf()};const r=await n.json().catch(()=>({}));throw{status:n.status,message:r.error||"Password change failed"}}function Y(e){return typeof e=="object"&&e!==null&&e.daemon==="down"}async function Te(e){const t=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});return t.status===401?(wf(),{daemon:"down",error:"Not authenticated"}):t.ok?await t.json():{daemon:"down",error:`HTTP ${t.status}`}}async function De(e,t,n){let r;try{r=await fetch(t,{method:e,credentials:"include",headers:{accept:"application/json",...n!==void 0?{"content-type":"application/json"}:{}},...n!==void 0?{body:JSON.stringify(n)}:{}})}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}if(r.status===401)return wf(),{ok:!1,error:"Not authenticated"};let l=null;try{l=await r.json()}catch{}return r.ok?{ok:!0,data:l}:{ok:!1,error:(l==null?void 0:l.error)??`HTTP ${r.status}`}}const K=encodeURIComponent,F={meta:()=>Te("/api/admin/meta"),health:()=>Te("/api/admin/health"),secrets:()=>Te("/api/admin/secrets"),connections:()=>Te("/api/admin/connections"),callers:()=>Te("/api/admin/callers"),callerConnections:e=>Te(`/api/admin/callers/${K(e)}/connections`),connectionStatus:e=>Te(`/api/admin/callers/${K(e)}/connection-status`),ingestors:()=>Te("/api/admin/ingestors"),callerIngestors:e=>Te(`/api/admin/callers/${K(e)}/ingestors`),callerEvents:(e,t=-1)=>Te(`/api/admin/callers/${K(e)}/events?after_id=${t}`),sessions:()=>Te("/api/admin/sessions"),createCaller:(e,t)=>De("POST","/api/admin/callers",{alias:e,...t?{name:t}:{}}),deleteCaller:e=>De("DELETE",`/api/admin/callers/${K(e)}`),issueCaller:(e,t)=>De("POST",`/api/admin/callers/${K(e)}/issue`,t),setTunnel:e=>De("PUT","/api/admin/tunnel",{enabled:e}),setConnectionEnabled:(e,t,n)=>De("POST",`/api/admin/callers/${K(e)}/connections/${K(t)}`,{enabled:n}),setSecrets:(e,t,n)=>De("PUT",`/api/admin/callers/${K(e)}/connections/${K(t)}/secrets`,{secrets:n}),testConnection:(e,t)=>De("POST",`/api/admin/callers/${K(e)}/connections/${K(t)}/test`),testIngestor:(e,t)=>De("POST",`/api/admin/callers/${K(e)}/connections/${K(t)}/test-ingestor`),controlListener:(e,t,n,r)=>De("POST",`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/control`,{action:n,...r?{instance_id:r}:{}}),listenerConfigs:e=>Te(`/api/admin/callers/${K(e)}/listener-configs`),getListenerParams:(e,t,n)=>Te(`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/params${n?`?instance_id=${K(n)}`:""}`),setListenerParams:(e,t,n,r={})=>De("PUT",`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/params`,{params:n,...r.instanceId?{instance_id:r.instanceId}:{},...r.createInstance?{create_instance:!0}:{}}),listListenerInstances:(e,t)=>Te(`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/instances`),createListenerInstance:(e,t,n,r)=>De("POST",`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/instances`,{instance_id:n,params:r}),deleteListenerInstance:(e,t,n)=>De("DELETE",`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/instances/${K(n)}`),resolveListenerOptions:(e,t,n)=>De("POST",`/api/admin/callers/${K(e)}/connections/${K(t)}/listener/resolve-options`,{paramKey:n})},kf=h.createContext({daemon:"unknown",meta:null,tick:0}),Lg=5e3;function ht(){return h.useContext(kf)}function Pg({children:e}){const[t,n]=h.useState("unknown"),[r,l]=h.useState(null),[a,i]=h.useState(0),c=h.useRef(!0),o=h.useRef(()=>Promise.resolve());return h.useEffect(()=>{c.current=!0;const u=async()=>{const j=await F.health();if(!c.current)return;if(Y(j)){n("down"),l(null),i(C=>C+1);return}const x=await F.meta();c.current&&(Y(x)?(n("down"),l(null)):(n("up"),l(x)),i(C=>C+1))};o.current=u,u();let d=null;const f=()=>{d===null&&(d=setInterval(()=>{o.current()},Lg))},g=()=>{d!==null&&(clearInterval(d),d=null)};document.visibilityState==="visible"&&f();const y=()=>{document.visibilityState==="visible"?(o.current(),f()):g()};return document.addEventListener("visibilitychange",y),()=>{c.current=!1,g(),document.removeEventListener("visibilitychange",y)}},[]),s.jsx(kf.Provider,{value:{daemon:t,meta:r,tick:a},children:e})}function Yi(){const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=()=>t(window.innerWidth<=768);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const zg=[{to:"/",label:"Overview",icon:Gv,end:!0},{to:"/connections",label:"Connections",icon:Tv},{to:"/callers",label:"Callers",icon:jf},{to:"/ingestors",label:"Ingestors",icon:Mn},{to:"/sessions",label:"Sessions",icon:Ev},{to:"/secrets",label:"Secrets",icon:Ki},{to:"/logs",label:"Logs",icon:fg}];function Lc({onLogout:e,onNavigate:t}){const{daemon:n,meta:r}=ht(),l=Gn(),[a,i]=h.useState(!1),c=n==="up"?`daemon up · v${(r==null?void 0:r.version)??"?"}`:n==="down"?"daemon offline":"checking…";async function o(){a||(i(!0),await Eg(),t==null||t(),e(),l("/",{replace:!0}))}return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"sidebar-brand",children:[s.jsx("span",{className:"sidebar-brand-mark","aria-hidden":"true"}),s.jsx("span",{className:"sidebar-brand-text",children:"drawlatch"})]}),s.jsxs("div",{className:"sidebar-status",title:(r==null?void 0:r.configPath)??"",children:[s.jsx("span",{className:`status-dot ${n==="up"?"up":n==="down"?"down":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"sidebar-status-text",children:c})]}),s.jsx("nav",{className:"sidebar-nav",children:zg.map(({to:u,label:d,icon:f,end:g})=>s.jsxs(kc,{to:u,end:g,onClick:t,className:({isActive:y})=>`sidebar-nav-link${y?" active":""}`,title:d,children:[s.jsx(f,{size:16,"aria-hidden":"true"}),s.jsx("span",{className:"sidebar-nav-label",children:d})]},u))}),s.jsxs("div",{className:"sidebar-footer",children:[s.jsxs(kc,{to:"/settings/password",onClick:t,className:({isActive:u})=>`sidebar-nav-link${u?" active":""}`,title:"Change password",children:[s.jsx(Jv,{size:16,"aria-hidden":"true"}),s.jsx("span",{className:"sidebar-nav-label",children:"Change password"})]}),s.jsxs("button",{type:"button",className:"sidebar-nav-link sidebar-logout",onClick:o,disabled:a,title:"Log out",children:[s.jsx(eg,{size:16,"aria-hidden":"true"}),s.jsx("span",{className:"sidebar-nav-label",children:a?"Signing out…":"Log out"})]})]})]})}function Rg({onLogout:e}){const t=Yi(),[n,r]=h.useState(!1),l=t&&n;return h.useEffect(()=>{if(!l)return;const a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[l]),t?s.jsxs("div",{className:"app-shell app-shell-mobile",children:[s.jsxs("header",{className:"mobile-topbar",children:[s.jsx("button",{type:"button",className:"mobile-topbar-button","aria-label":"Open navigation","aria-expanded":n,onClick:()=>r(!0),children:s.jsx(ng,{size:20,"aria-hidden":"true"})}),s.jsxs("div",{className:"mobile-topbar-title",children:[s.jsx("span",{className:"sidebar-brand-mark","aria-hidden":"true"}),s.jsx("span",{children:"drawlatch"})]})]}),s.jsx("main",{className:"main-content main-content-mobile",children:s.jsx(wc,{})}),l&&s.jsx("div",{className:"mobile-drawer-overlay",role:"dialog","aria-modal":"true","aria-label":"Navigation",onClick:()=>r(!1),children:s.jsxs("aside",{className:"sidebar mobile-drawer",onClick:a=>a.stopPropagation(),children:[s.jsx("button",{type:"button",className:"mobile-drawer-close","aria-label":"Close navigation",onClick:()=>r(!1),children:s.jsx(Xn,{size:20,"aria-hidden":"true"})}),s.jsx(Lc,{onLogout:e,onNavigate:()=>r(!1)})]})})]}):s.jsxs("div",{className:"app-shell",children:[s.jsx("aside",{className:"sidebar",children:s.jsx(Lc,{onLogout:e})}),s.jsx("main",{className:"main-content",children:s.jsx(wc,{})})]})}function Tg(e){if(!Number.isFinite(e)||e<0)return"—";const t=Math.floor(e),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),l=Math.floor(t%3600/60),a=t%60;return n>0?`${n}d ${r}h`:r>0?`${r}h ${l}m`:l>0?`${l}m ${a}s`:`${a}s`}function Ig(){const{daemon:e,meta:t,tick:n}=ht(),[r,l]=h.useState(null),[a,i]=h.useState(null),[c,o]=h.useState(!1),[u,d]=h.useState(null),[f,g]=h.useState(null);if(h.useEffect(()=>{g(null)},[t==null?void 0:t.tunnelEnabled]),h.useEffect(()=>{if(e!=="up")return;let m=!1;return(async()=>{const[w,E]=await Promise.all([F.health(),F.secrets()]);if(!m&&(Y(w)||l(w),!Y(E))){const S=E.length,_=E.filter(k=>k.present).length;i({total:S,configured:_})}})(),()=>{m=!0}},[e,n]),e==="unknown")return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Overview"})}),s.jsx("div",{className:"banner banner-loading",children:"Connecting to daemon…"})]});if(e==="down")return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Overview"})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable on its loopback admin port. Start it with ",s.jsx("code",{children:"drawlatch start"})," and this view will recover automatically."]})]})]});const y=r==null?void 0:r.ingestorCounts,j=y?y.connected+y.error+y.starting+y.stopped:0,x=f??(t==null?void 0:t.tunnelEnabled)??!1,C=(t==null?void 0:t.tunnelUrl)??null,v=!!t&&x!==(C!==null),p=async()=>{if(c||!t)return;const m=!x;o(!0),d(null);const w=await F.setTunnel(m);if(o(!1),!w.ok){d(w.error);return}g(m)};return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Overview"}),s.jsx("div",{className:"page-subtitle",children:(t==null?void 0:t.configPath)??""})]})}),s.jsxs("section",{className:"card-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("span",{className:"card-label",children:"Status"}),s.jsx("span",{className:"card-value",style:{color:"var(--success)"},children:"running"}),s.jsxs("span",{className:"card-sub",children:["pid ",(t==null?void 0:t.pid)??"—"]})]}),s.jsxs("div",{className:"card",children:[s.jsx("span",{className:"card-label",children:"Port"}),s.jsx("span",{className:"card-value card-value-mono",children:(t==null?void 0:t.port)??"—"}),s.jsx("span",{className:"card-sub",children:"loopback only"})]}),s.jsxs("div",{className:"card",children:[s.jsx("span",{className:"card-label",children:"Uptime"}),s.jsx("span",{className:"card-value",children:r?Tg(r.uptimeSec):"—"}),(t==null?void 0:t.startedAt)&&s.jsxs("span",{className:"card-sub",children:["since ",new Date(t.startedAt).toLocaleString()]})]}),s.jsxs("div",{className:"card",children:[s.jsx("span",{className:"card-label",children:"Version"}),s.jsx("span",{className:"card-value card-value-mono",children:(t==null?void 0:t.version)??"—"})]}),s.jsxs("div",{className:"card",children:[s.jsx("span",{className:"card-label",children:"Active Sessions"}),s.jsx("span",{className:"card-value",children:(r==null?void 0:r.activeSessions)??"—"})]}),s.jsxs("div",{className:"card span-2 dl-tunnel-card",children:[s.jsxs("div",{className:"dl-tunnel-head",children:[s.jsx("span",{className:"card-label",children:"Tunnel"}),s.jsxs("button",{type:"button",role:"switch","aria-checked":x,"aria-label":"Toggle cloudflared tunnel",className:`dl-tunnel-switch ${x?"is-on":""}`,disabled:c||!t,onClick:()=>void p(),children:[s.jsx("span",{className:"dl-tunnel-switch-knob"}),c&&s.jsx(se,{size:12,className:"dl-tunnel-switch-spin"})]})]}),s.jsx("div",{className:"dl-tunnel-status",children:x&&C?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"status-dot up","aria-hidden":"true"}),s.jsxs("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:"dl-tunnel-url mono",children:[C,s.jsx(Ur,{size:12})]})]}):x&&!C?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"status-dot warn","aria-hidden":"true"}),s.jsx("span",{className:"card-sub",children:"Enabled — restart to activate"})]}):!x&&C?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"status-dot warn","aria-hidden":"true"}),s.jsx("span",{className:"card-sub",children:"Disabled — restart to take effect"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"status-dot stopped","aria-hidden":"true"}),s.jsx("span",{className:"card-sub",children:"Disabled"})]})}),s.jsxs("span",{className:"card-sub dl-tunnel-hint",children:["Public cloudflared URL for webhook callbacks. Persists to"," ",s.jsx("code",{className:"mono",children:"remote.config.json"}),"."]}),u&&s.jsxs("div",{className:"dl-tunnel-error",children:[s.jsx(Ke,{size:12})," ",u]})]}),v&&s.jsxs("div",{className:"banner banner-warn dl-tunnel-restart-banner",children:[s.jsx(Ke,{size:14,"aria-hidden":"true"}),s.jsxs("span",{children:["Restart drawlatch to apply tunnel changes — run"," ",s.jsx("code",{className:"mono",children:"drawlatch restart"}),", or restart callboard if it manages the daemon."]})]}),s.jsxs("div",{className:"card span-2",children:[s.jsxs("span",{className:"card-label",children:["Ingestors (",j,")"]}),s.jsxs("div",{className:"ingestor-breakdown",children:[s.jsxs("span",{className:"ingestor-stat ingestor-stat-connected",children:[s.jsx("span",{className:"status-dot","aria-hidden":"true"}),(y==null?void 0:y.connected)??0," connected"]}),s.jsxs("span",{className:"ingestor-stat ingestor-stat-starting",children:[s.jsx("span",{className:"status-dot","aria-hidden":"true"}),(y==null?void 0:y.starting)??0," starting"]}),s.jsxs("span",{className:"ingestor-stat ingestor-stat-error",children:[s.jsx("span",{className:"status-dot","aria-hidden":"true"}),(y==null?void 0:y.error)??0," error"]}),s.jsxs("span",{className:"ingestor-stat ingestor-stat-stopped",children:[s.jsx("span",{className:"status-dot","aria-hidden":"true"}),(y==null?void 0:y.stopped)??0," stopped"]})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("span",{className:"card-label",children:"Secrets"}),s.jsx("span",{className:"card-value",children:a?`${a.configured} of ${a.total}`:"—"}),s.jsx("span",{className:"card-sub",children:"configured"})]})]})]})}function Sf({stability:e}){return s.jsx("span",{className:`stability-badge stability-${e}`,children:e})}function Mg({caller:e,connection:t,onClose:n,onSaved:r}){const[l,a]=h.useState({}),[i,c]=h.useState(new Set),[o,u]=h.useState(!1),[d,f]=h.useState({phase:"idle"}),{requiredSecrets:g,optionalSecrets:y}=t,j=h.useMemo(()=>({...t.requiredSecretsSet,...t.optionalSecretsSet}),[t.requiredSecretsSet,t.optionalSecretsSet]);h.useEffect(()=>{const S=_=>{_.key==="Escape"&&n()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[n]);const x=h.useCallback((S,_)=>{a(k=>({...k,[S]:_})),c(k=>{if(!k.has(S))return k;const z=new Set(k);return z.delete(S),z})},[]),C=h.useCallback(S=>{c(_=>new Set(_).add(S)),a(_=>{if(!(S in _))return _;const k={..._};return delete k[S],k})},[]),v=h.useCallback(S=>{c(_=>{if(!_.has(S))return _;const k=new Set(_);return k.delete(S),k})},[]),p=h.useMemo(()=>{const S={};for(const[_,k]of Object.entries(l))k!==""&&(S[_]=k);for(const _ of i)S[_]="";return S},[l,i]),m=Object.keys(p).length>0,w=h.useCallback(async()=>{if(!m)return;f({phase:"saving"});const S=await F.setSecrets(e,t.alias,p);if(!S.ok){f({phase:"error",message:S.error});return}f({phase:"saved"}),r(),n()},[m,e,t.alias,p,r,n]),E=g.length>0||y.length>0;return s.jsx("div",{className:"dl-secrets-overlay",role:"presentation",onClick:n,children:s.jsxs("div",{className:"dl-secrets-panel",role:"dialog","aria-modal":"true","aria-label":`Configure secrets for ${t.name}`,onClick:S=>S.stopPropagation(),children:[s.jsxs("div",{className:"dl-secrets-header",children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsx("h2",{className:"dl-secrets-title",children:t.name}),s.jsxs("div",{className:"dl-secrets-alias",children:[s.jsx("span",{className:"mono dl-secrets-pill",children:t.alias})," → ",s.jsx("span",{className:"mono dl-secrets-pill",children:e})]}),t.description&&s.jsx("p",{className:"dl-secrets-desc",children:t.description}),t.docsUrl&&s.jsxs("a",{className:"dl-secrets-docs",href:t.docsUrl,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ur,{size:12}),"API docs"]})]}),s.jsx("button",{type:"button",className:"dl-secrets-close",onClick:n,"aria-label":"Close",title:"Close",children:s.jsx(Xn,{size:18})})]}),s.jsx("div",{className:"dl-secrets-body",children:E?s.jsxs(s.Fragment,{children:[g.length>0&&s.jsxs("div",{className:"dl-secrets-section",children:[s.jsx("h3",{className:"dl-secrets-section-title",children:"Required Secrets"}),s.jsx("div",{className:"dl-secrets-fields",children:g.map(S=>s.jsx(Pc,{name:S,currentlySet:j[S]??!1,clearing:i.has(S),value:l[S]??"",onChange:_=>x(S,_),onClear:()=>C(S),onUndoClear:()=>v(S)},S))})]}),y.length>0&&s.jsxs("div",{className:"dl-secrets-section",children:[s.jsxs("button",{type:"button",className:"dl-secrets-optional-toggle","aria-expanded":o,onClick:()=>u(S=>!S),children:[o?s.jsx(jl,{size:14}):s.jsx(Qi,{size:14}),"Optional Secrets"," ",s.jsxs("span",{className:"dl-secrets-count",children:["(",y.length,")"]})]}),o&&s.jsx("div",{className:"dl-secrets-fields",children:y.map(S=>s.jsx(Pc,{name:S,currentlySet:j[S]??!1,clearing:i.has(S),value:l[S]??"",onChange:_=>x(S,_),onClear:()=>C(S),onUndoClear:()=>v(S)},S))})]})]}):s.jsxs("div",{className:"dl-secrets-empty",children:[s.jsx("span",{className:"dl-secrets-empty-title",children:"No secrets needed"}),"This connection works without any configured secrets."]})}),s.jsxs("div",{className:"dl-secrets-footer",children:[s.jsxs("div",{className:"dl-secrets-status"+(d.phase==="error"?" is-error":"")+(d.phase==="saved"?" is-success":""),children:[d.phase==="error"&&d.message,d.phase==="saved"&&s.jsxs(s.Fragment,{children:[s.jsx(Nt,{size:14}),"Saved"]})]}),s.jsxs("div",{className:"dl-secrets-actions",children:[s.jsx("button",{type:"button",className:"dl-secrets-btn dl-secrets-btn-secondary",onClick:n,children:"Cancel"}),s.jsxs("button",{type:"button",className:"dl-secrets-btn dl-secrets-btn-primary"+(d.phase==="saved"?" is-saved":""),onClick:w,disabled:!m||d.phase==="saving"||d.phase==="saved",children:[d.phase==="saving"&&s.jsx(se,{size:14,className:"dl-secrets-spin"}),d.phase==="saved"&&s.jsx(Nt,{size:14}),d.phase==="saving"?"Saving…":d.phase==="saved"?"Saved":"Save"]})]})]})]})})}function Pc({name:e,currentlySet:t,clearing:n,value:r,onChange:l,onClear:a,onUndoClear:i}){const[c,o]=h.useState(!1),u=n?"(will be removed on save)":t?"•••••••• (set)":"Enter value";return s.jsxs("div",{className:"dl-secrets-field",children:[s.jsxs("div",{className:"dl-secrets-field-head",children:[s.jsx("label",{className:"dl-secrets-label",htmlFor:`dl-secret-${e}`,children:e}),s.jsx("div",{className:"dl-secrets-field-meta",children:n?s.jsxs("button",{type:"button",className:"dl-secrets-undo-btn",onClick:i,title:"Keep this secret",children:[s.jsx(xf,{size:11}),"Undo clear"]}):t&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"dl-secrets-set-badge",children:[s.jsx(Nt,{size:11}),"Set"]}),s.jsxs("button",{type:"button",className:"dl-secrets-clear-btn",onClick:a,title:"Remove this secret on save",children:[s.jsx(Xn,{size:11}),"Clear"]})]})})]}),s.jsxs("div",{className:"dl-secrets-input-wrap",children:[s.jsx("input",{id:`dl-secret-${e}`,className:"dl-secrets-input"+(n?" is-clearing":""),type:c?"text":"password",autoComplete:"off",spellCheck:!1,disabled:n,value:n?"":r,placeholder:u,onChange:d=>l(d.target.value)}),!n&&s.jsx("button",{type:"button",className:"dl-secrets-eye",onClick:()=>o(d=>!d),"aria-label":c?"Hide value":"Show value",title:c?"Hide value":"Show value",children:c?s.jsx(Av,{size:14}):s.jsx(Vv,{size:14})})]})]})}function Xi({title:e,description:t,confirmLabel:n="Delete",cancelLabel:r="Cancel",busy:l=!1,error:a=null,onConfirm:i,onCancel:c}){return h.useEffect(()=>{const o=u=>{u.key==="Escape"&&!l&&c()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[c,l]),s.jsx("div",{className:"dl-confirm-overlay",onClick:()=>{l||c()},children:s.jsxs("div",{className:"dl-confirm-panel",role:"alertdialog","aria-modal":"true","aria-labelledby":"dl-confirm-title",onClick:o=>o.stopPropagation(),children:[s.jsxs("div",{className:"dl-confirm-header",children:[s.jsxs("div",{className:"dl-confirm-header-text",children:[s.jsx("span",{className:"dl-confirm-icon","aria-hidden":"true",children:s.jsx(Ke,{size:18})}),s.jsx("h2",{id:"dl-confirm-title",className:"dl-confirm-title",children:e})]}),s.jsx("button",{type:"button",className:"dl-confirm-close","aria-label":"Close",disabled:l,onClick:c,children:s.jsx(Xn,{size:16})})]}),s.jsx("div",{className:"dl-confirm-body",children:t}),a&&s.jsx("div",{className:"dl-confirm-error",children:a}),s.jsxs("div",{className:"dl-confirm-footer",children:[s.jsx("button",{type:"button",className:"dl-confirm-btn dl-confirm-btn-secondary",disabled:l,onClick:c,children:r}),s.jsxs("button",{type:"button",className:"dl-confirm-btn dl-confirm-btn-danger",disabled:l,onClick:()=>void i(),autoFocus:!0,children:[l&&s.jsx(se,{size:14,className:"dl-confirm-spin"}),n]})]})]})})}const Og=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/,zc="__default__";function Rc(e){switch(e){case"connected":return"dl-lcp-dot-connected";case"error":return"dl-lcp-dot-error";case"starting":case"reconnecting":return"dl-lcp-dot-starting";case"stopped":default:return"dl-lcp-dot-stopped"}}function $g(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString()}function Tc(e,t){return JSON.stringify(e)===JSON.stringify(t)}function bg({caller:e,connection:t,connectionName:n,supportsMultiInstance:r,onClose:l,onChanged:a}){const[i,c]=h.useState(null),[o,u]=h.useState(!0),[d,f]=h.useState(!1),[g,y]=h.useState(null),[j,x]=h.useState([]),[C,v]=h.useState(null),[p,m]=h.useState(null),[w,E]=h.useState({}),[S,_]=h.useState(null),[k,z]=h.useState(null),[N,$]=h.useState([]),[Q,re]=h.useState(!1),[Ce,ze]=h.useState(!1),[M,b]=h.useState(""),[R,T]=h.useState(null),[O,A]=h.useState(!1),[U,he]=h.useState(null),[me,Pt]=h.useState({}),[Qe,mt]=h.useState({}),[Ji,Zi]=h.useState(!1),[Gr,Jn]=h.useState(null),[wl,Rf]=h.useState({}),[Nl,eo]=h.useState(null),[Tf,If]=h.useState(new Set),Re=(i==null?void 0:i.supportsMultiInstance)??r,to=h.useMemo(()=>Object.keys(me).some(P=>!Tc(me[P],Qe[P])),[me,Qe]);h.useEffect(()=>{const P=D=>{D.key==="Escape"&&l()};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[l]);const no=h.useCallback(async()=>{u(!0),y(null);const P=await F.listenerConfigs(e);if(Y(P)){f(!0),u(!1);return}f(!1);const D=P.find(H=>H.connection===t)??null;c(D),D||y("No listener configuration found for this connection."),u(!1)},[e,t]);h.useEffect(()=>{no()},[no]);const et=h.useCallback(async()=>{const P=await F.callerIngestors(e);if(Y(P)){f(!0);return}f(!1),x(P.filter(D=>D.connection===t))},[e,t]);h.useEffect(()=>{et();const P=window.setInterval(()=>void et(),5e3);return()=>window.clearInterval(P)},[et]);const ot=h.useCallback(async()=>{re(!0);const P=await F.listListenerInstances(e,t);if(re(!1),Y(P)){f(!0);return}f(!1),$(P.instances)},[e,t]);h.useEffect(()=>{i&&Re&&ot()},[i,Re,ot]);const kl=h.useCallback(async P=>{const D=await F.getListenerParams(e,t,P);if(Y(D)){f(!0);return}f(!1);const H=D,oe={...H.defaults,...H.params};Pt(oe),mt(oe),Jn(null)},[e,t]);h.useEffect(()=>{i&&(Re?U&&kl(U):kl())},[i,Re,U,kl]);const vt=h.useCallback(async(P,D)=>{const H=D?`${D}:${P}`:P;D?E(ce=>({...ce,[D]:P})):(v(P),m(null));const oe=await F.controlListener(e,t,P,D);return D?E(ce=>{const Zt={...ce};return delete Zt[D],Zt}):(v(null),m(oe.ok?{ok:!0,message:`Listener ${P} ok`}:{ok:!1,message:oe.error})),oe.ok&&(a(),et(),Re&&ot()),H},[e,t,a,et,ot,Re]),Mf=h.useCallback(async P=>{if(!P.dynamicOptions||wl[P.key]||Nl===P.key)return;eo(P.key);const D=await F.resolveListenerOptions(e,t,P.key);if(eo(null),D.ok){const H=D.data;H.options&&Rf(oe=>({...oe,[P.key]:H.options??[]}))}},[e,t,wl,Nl]),Of=h.useCallback(async()=>{const P={};for(const[H,oe]of Object.entries(me))Tc(oe,Qe[H])||(P[H]=oe);if(Object.keys(P).length===0)return;Zi(!0),Jn(null);const D=await F.setListenerParams(e,t,P,{instanceId:U??void 0});Zi(!1),D.ok?(mt({...me}),Jn({ok:!0,message:"Parameters saved"}),a(),et(),Re&&ot()):Jn({ok:!1,message:D.error})},[me,Qe,e,t,U,a,et,ot,Re]),ro=h.useCallback(async()=>{const P=M.trim();if(!P){T("Instance ID is required.");return}if(!Og.test(P)){T("Must start with a letter/number and contain only letters, numbers, _ or -.");return}if(N.some(H=>H.instanceId===P)){T("An instance with that ID already exists.");return}A(!0),T(null);const D=await F.createListenerInstance(e,t,P,{});A(!1),D.ok?(b(""),ze(!1),a(),ot(),et()):T(D.error)},[M,N,e,t,a,ot,et]),$f=h.useCallback(async P=>{_(P);const D=await F.deleteListenerInstance(e,t,P);_(null),z(null),D.ok&&(U===P&&(he(null),Pt({}),mt({})),a(),ot(),et())},[e,t,U,a,ot,et]),bf=h.useMemo(()=>{const P=[],D=new Map;for(const H of(i==null?void 0:i.fields)??[]){const oe=H.group??zc;let ce=D.get(oe);ce||(ce=[],D.set(oe,ce),P.push({group:oe,fields:ce})),ce.push(H)}return P},[i]),Df=P=>{If(D=>{const H=new Set(D);return H.has(P)?H.delete(P):H.add(P),H})},ie=h.useMemo(()=>j.find(P=>!P.instanceId)??j[0],[j]),Ff=h.useCallback(P=>j.find(D=>D.instanceId===P),[j]),so=h.useRef(null),Sl=i!==null&&i.fields.length>0&&(!Re||U!==null);return s.jsxs("div",{className:"dl-lcp-overlay",ref:so,onMouseDown:P=>{P.target===so.current&&l()},children:[s.jsxs("div",{className:"dl-lcp-panel",role:"dialog","aria-modal":"true",children:[s.jsxs("div",{className:"dl-lcp-header",children:[s.jsxs("div",{className:"dl-lcp-header-text",children:[s.jsxs("h2",{className:"dl-lcp-title",children:[s.jsx(Mn,{size:16,className:"dl-lcp-title-icon"}),n," Listener"]}),i&&s.jsx("p",{className:"dl-lcp-subtitle",children:i.description??i.name})]}),s.jsx("button",{className:"dl-lcp-close",onClick:l,"aria-label":"Close",children:s.jsx(Xn,{size:18})})]}),s.jsxs("div",{className:"dl-lcp-body",children:[d&&s.jsxs("div",{className:"banner banner-offline dl-lcp-banner",children:[s.jsx(Ke,{size:16}),s.jsx("span",{children:"Daemon is offline. Showing last known data; actions are unavailable."})]}),o&&s.jsxs("div",{className:"dl-lcp-state",children:[s.jsx(se,{size:18,className:"dl-lcp-spin"}),s.jsx("span",{children:"Loading listener configuration…"})]}),!o&&g&&!i&&s.jsx("div",{className:"dl-lcp-state",children:g}),!o&&i&&!Re&&s.jsxs("section",{className:"dl-lcp-section",children:[s.jsx("h3",{className:"dl-lcp-section-title",children:"Listener Status"}),s.jsxs("div",{className:"dl-lcp-card",children:[s.jsx("div",{className:"dl-lcp-status-row",children:s.jsxs("div",{className:"dl-lcp-status-state",children:[s.jsx("span",{className:`status-dot dl-lcp-dot ${Rc((ie==null?void 0:ie.state)??"stopped")}`}),s.jsx("span",{className:"dl-lcp-state-label",children:(ie==null?void 0:ie.state)??"stopped"}),ie&&s.jsx("span",{className:"tag dl-lcp-type-tag",children:ie.type})]})}),s.jsxs("div",{className:"dl-lcp-stats",children:[s.jsxs("span",{children:["Events: ",(ie==null?void 0:ie.totalEventsReceived)??0]}),s.jsxs("span",{children:["Buffered: ",(ie==null?void 0:ie.bufferedEvents)??0]}),s.jsxs("span",{children:["Last: ",$g((ie==null?void 0:ie.lastEventAt)??null)]})]}),(ie==null?void 0:ie.error)&&s.jsxs("div",{className:"dl-lcp-error-box",children:[s.jsx(Ke,{size:12}),s.jsx("span",{children:ie.error})]}),s.jsxs("div",{className:"dl-lcp-controls",children:[s.jsxs("button",{className:"dl-lcp-ctrl dl-lcp-ctrl-start",disabled:!!C||d,onClick:()=>void vt("start"),children:[C==="start"?s.jsx(se,{size:12,className:"dl-lcp-spin"}):s.jsx(Es,{size:12}),"Start"]}),s.jsxs("button",{className:"dl-lcp-ctrl dl-lcp-ctrl-stop",disabled:!!C||d,onClick:()=>void vt("stop"),children:[C==="stop"?s.jsx(se,{size:12,className:"dl-lcp-spin"}):s.jsx(Ls,{size:12}),"Stop"]}),s.jsxs("button",{className:"dl-lcp-ctrl",disabled:!!C||d,onClick:()=>void vt("restart"),children:[C==="restart"?s.jsx(se,{size:12,className:"dl-lcp-spin"}):s.jsx(_s,{size:12}),"Restart"]})]}),p&&s.jsxs("div",{className:`dl-lcp-inline-result ${p.ok?"is-ok":"is-err"}`,children:[p.ok?s.jsx(Nt,{size:12}):s.jsx(Ke,{size:12}),p.message]})]})]}),!o&&i&&Re&&s.jsxs("section",{className:"dl-lcp-section",children:[s.jsxs("div",{className:"dl-lcp-section-head",children:[s.jsx("h3",{className:"dl-lcp-section-title",children:"Listener Instances"}),s.jsxs("div",{className:"dl-lcp-bulk",children:[s.jsxs("button",{className:"dl-lcp-bulk-btn dl-lcp-ctrl-start",disabled:!!C||d,title:"Start all instances",onClick:()=>void vt("start"),children:[C==="start"?s.jsx(se,{size:10,className:"dl-lcp-spin"}):s.jsx(Es,{size:10}),"All"]}),s.jsxs("button",{className:"dl-lcp-bulk-btn dl-lcp-ctrl-stop",disabled:!!C||d,title:"Stop all instances",onClick:()=>void vt("stop"),children:[C==="stop"?s.jsx(se,{size:10,className:"dl-lcp-spin"}):s.jsx(Ls,{size:10}),"All"]}),s.jsxs("button",{className:"dl-lcp-bulk-btn",disabled:!!C||d,title:"Restart all instances",onClick:()=>void vt("restart"),children:[C==="restart"?s.jsx(se,{size:10,className:"dl-lcp-spin"}):s.jsx(_s,{size:10}),"All"]})]})]}),p&&s.jsxs("div",{className:`dl-lcp-inline-result ${p.ok?"is-ok":"is-err"}`,children:[p.ok?s.jsx(Nt,{size:12}):s.jsx(Ke,{size:12}),p.message]}),Q&&s.jsx("div",{className:"dl-lcp-state dl-lcp-state-sm",children:s.jsx(se,{size:14,className:"dl-lcp-spin"})}),!Q&&N.length===0&&s.jsxs("div",{className:"dl-lcp-empty",children:["No listener instances configured.",s.jsx("span",{className:"dl-lcp-empty-hint",children:"Create an instance to start listening for events."})]}),!Q&&N.length>0&&s.jsx("div",{className:"dl-lcp-instance-list",children:N.map(P=>{const D=Ff(P.instanceId),H=w[P.instanceId],oe=S===P.instanceId,ce=U===P.instanceId;return s.jsxs("div",{className:`dl-lcp-instance ${P.disabled?"is-disabled":""}`,children:[s.jsxs("div",{className:"dl-lcp-instance-head",children:[s.jsxs("div",{className:"dl-lcp-instance-id-wrap",children:[s.jsx("span",{className:`status-dot dl-lcp-dot ${Rc((D==null?void 0:D.state)??"stopped")}`,title:(D==null?void 0:D.state)??"stopped"}),s.jsx("span",{className:"mono dl-lcp-instance-id",children:P.instanceId}),P.disabled&&s.jsx("span",{className:"tag dl-lcp-disabled-badge",children:"Disabled"})]}),s.jsxs("div",{className:"dl-lcp-instance-actions",children:[s.jsx("button",{className:`dl-lcp-icon-btn ${ce?"is-active":""}`,title:ce?"Close editor":`Edit params for "${P.instanceId}"`,onClick:()=>he(ce?null:P.instanceId),children:s.jsx(Ec,{size:12})}),s.jsx("button",{className:"dl-lcp-icon-btn dl-lcp-icon-btn-danger",title:`Delete instance "${P.instanceId}"`,disabled:oe,onClick:()=>z(P.instanceId),children:oe?s.jsx(se,{size:12,className:"dl-lcp-spin"}):s.jsx(Gi,{size:12})})]})]}),Object.keys(P.params).length>0&&s.jsx("div",{className:"dl-lcp-chips",children:Object.entries(P.params).map(([Zt,Cl])=>s.jsxs("span",{className:"mono dl-lcp-chip",children:[Zt,"=",String(Cl)]},Zt))}),s.jsxs("div",{className:"dl-lcp-instance-ctrls",children:[s.jsxs("button",{className:"dl-lcp-ctrl dl-lcp-ctrl-start dl-lcp-ctrl-sm",disabled:!!H||d,onClick:()=>void vt("start",P.instanceId),children:[H==="start"?s.jsx(se,{size:10,className:"dl-lcp-spin"}):s.jsx(Es,{size:10}),"Start"]}),s.jsxs("button",{className:"dl-lcp-ctrl dl-lcp-ctrl-stop dl-lcp-ctrl-sm",disabled:!!H||d,onClick:()=>void vt("stop",P.instanceId),children:[H==="stop"?s.jsx(se,{size:10,className:"dl-lcp-spin"}):s.jsx(Ls,{size:10}),"Stop"]}),s.jsxs("button",{className:"dl-lcp-ctrl dl-lcp-ctrl-sm",disabled:!!H||d,onClick:()=>void vt("restart",P.instanceId),children:[H==="restart"?s.jsx(se,{size:10,className:"dl-lcp-spin"}):s.jsx(_s,{size:10}),"Restart"]})]})]},P.instanceId)})}),s.jsx("div",{className:"dl-lcp-create",children:Ce?s.jsxs("div",{className:"dl-lcp-create-form",children:[s.jsx("label",{className:"dl-lcp-create-label",children:i.instanceKeyField?`Instance ID (${i.instanceKeyField})`:"Instance ID"}),s.jsxs("div",{className:"dl-lcp-create-row",children:[s.jsx("input",{className:`dl-lcp-input mono ${R?"is-err":""}`,type:"text",autoFocus:!0,placeholder:"e.g. my-instance-1",value:M,onChange:P=>{b(P.target.value),T(null)},onKeyDown:P=>{P.key==="Enter"&&ro(),P.key==="Escape"&&(ze(!1),b(""),T(null))}}),s.jsxs("button",{className:"dl-lcp-btn dl-lcp-btn-primary",disabled:O||!M.trim()||d,onClick:()=>void ro(),children:[O&&s.jsx(se,{size:10,className:"dl-lcp-spin"}),"Create"]}),s.jsx("button",{className:"dl-lcp-btn dl-lcp-btn-secondary",onClick:()=>{ze(!1),b(""),T(null)},children:"Cancel"})]}),R&&s.jsxs("div",{className:"dl-lcp-field-error",children:[s.jsx(Ke,{size:10}),R]}),s.jsx("div",{className:"dl-lcp-hint",children:"Pattern: letters, numbers, _ or - (must start alphanumeric)"})]}):s.jsxs("button",{className:"dl-lcp-add-btn",disabled:d,onClick:()=>ze(!0),children:[s.jsx(qi,{size:14}),"Add Instance"]})})]}),!o&&i&&Sl&&s.jsxs("section",{className:"dl-lcp-section",children:[Re&&U&&s.jsxs("div",{className:"dl-lcp-editing-banner",children:[s.jsx(Ec,{size:12}),s.jsxs("span",{children:["Editing instance: ",s.jsx("code",{className:"mono",children:U})]}),s.jsx("button",{className:"dl-lcp-editing-cancel",onClick:()=>{he(null),Pt({}),mt({}),Jn(null)},children:"Cancel"})]}),s.jsx("h3",{className:"dl-lcp-section-title",children:"Configuration"}),bf.map(({group:P,fields:D})=>{const H=P===zc,oe=Tf.has(P);return s.jsxs("div",{className:"dl-lcp-group",children:[!H&&s.jsxs("button",{className:"dl-lcp-group-toggle",onClick:()=>Df(P),children:[oe?s.jsx(Qi,{size:14}):s.jsx(jl,{size:14}),P]}),(H||!oe)&&s.jsx("div",{className:"dl-lcp-fields",children:D.map(ce=>s.jsx(Dg,{field:ce,value:me[ce.key],options:wl[ce.key],loadingOptions:Nl===ce.key,onFetchOptions:()=>void Mf(ce),onChange:Zt=>Pt(Cl=>({...Cl,[ce.key]:Zt}))},ce.key))})]},P)})]}),!o&&i&&i.fields.length===0&&!Re&&s.jsx("div",{className:"dl-lcp-state",children:"This listener has no configurable parameters."}),!o&&i&&s.jsxs("div",{className:"dl-lcp-meta",children:[i.ingestorType&&s.jsxs("span",{children:["Type: ",i.ingestorType]}),s.jsxs("span",{children:["Multi-instance: ",i.supportsMultiInstance?"Yes":"No"]}),i.instanceKeyField&&s.jsxs("span",{children:["Instance key: ",i.instanceKeyField]}),Re&&s.jsxs("span",{children:["Instances: ",N.length]})]})]}),s.jsxs("div",{className:"dl-lcp-footer",children:[s.jsxs("div",{className:"dl-lcp-footer-status",children:[to&&Sl&&s.jsxs("span",{className:"dl-lcp-dirty",children:[s.jsx(Ke,{size:12}),"Unsaved changes"]}),Gr&&s.jsxs("span",{className:Gr.ok?"dl-lcp-save-ok":"dl-lcp-save-err",children:[Gr.ok?s.jsx(Nt,{size:12}):s.jsx(Ke,{size:12}),Gr.message]})]}),s.jsxs("div",{className:"dl-lcp-footer-actions",children:[s.jsx("button",{className:"dl-lcp-btn dl-lcp-btn-secondary",onClick:l,children:"Close"}),Sl&&s.jsxs("button",{className:"dl-lcp-btn dl-lcp-btn-primary",disabled:!to||Ji||d,onClick:()=>void Of(),children:[Ji&&s.jsx(se,{size:14,className:"dl-lcp-spin"}),"Save"]})]})]})]}),k&&s.jsx(Xi,{title:"Delete listener instance?",description:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:k})," will stop and its config will be removed. This cannot be undone."]}),busy:S===k,onConfirm:()=>void $f(k),onCancel:()=>{S!==k&&z(null)}})]})}function Zl(e){return Array.isArray(e)?e.map(t=>String(t)):[]}function Dg({field:e,value:t,options:n,loadingOptions:r,onFetchOptions:l,onChange:a}){const i=n??e.options??[],c=e.min!==void 0||e.max!==void 0||e.pattern!==void 0||e.placeholder!==void 0;return s.jsxs("div",{className:"dl-lcp-field",children:[s.jsxs("div",{className:"dl-lcp-field-head",children:[s.jsxs("div",{className:"dl-lcp-field-labels",children:[s.jsx("span",{className:"mono dl-lcp-field-label",children:e.label}),e.required&&s.jsx("span",{className:"dl-lcp-required",children:"Required"}),e.instanceKey&&s.jsx("span",{className:"tag dl-lcp-instance-key",children:"Instance Key"})]}),s.jsx("span",{className:"tag dl-lcp-field-type",children:e.type})]}),e.description&&s.jsxs("p",{className:"dl-lcp-field-desc",children:[s.jsx(Qv,{size:12,className:"dl-lcp-field-desc-icon"}),e.description]}),s.jsxs("div",{className:"dl-lcp-field-control",children:[e.type==="text"&&s.jsx("input",{className:"dl-lcp-input mono",type:"text",value:typeof t=="string"?t:"",placeholder:e.placeholder??`Enter ${e.label.toLowerCase()}`,pattern:e.pattern,onChange:o=>a(o.target.value)}),e.type==="number"&&s.jsx("input",{className:"dl-lcp-input mono",type:"number",value:typeof t=="number"?t:"",min:e.min,max:e.max,placeholder:e.placeholder,onChange:o=>a(o.target.value===""?void 0:Number(o.target.value))}),e.type==="boolean"&&s.jsx("button",{type:"button",className:`dl-lcp-toggle ${t===!0||t===void 0&&e.default===!0?"is-on":""}`,onClick:()=>a(!(t??e.default??!1)),"aria-pressed":t===!0,children:s.jsx("span",{className:"dl-lcp-toggle-knob"})}),e.type==="select"&&s.jsxs("select",{className:"dl-lcp-input",value:typeof t=="string"?t:t===void 0&&typeof e.default=="string"?e.default:"",onFocus:()=>{e.dynamicOptions&&!n&&l()},onChange:o=>a(o.target.value||void 0),children:[s.jsx("option",{value:"",children:"-- Select --"}),r&&s.jsx("option",{disabled:!0,children:"Loading options…"}),i.map(o=>s.jsx("option",{value:String(o.value),children:o.label},String(o.value)))]}),e.type==="multiselect"&&s.jsxs("div",{className:"dl-lcp-checklist",children:[r&&s.jsx("span",{className:"dl-lcp-hint",children:"Loading options…"}),!r&&i.length===0&&e.dynamicOptions!==void 0&&s.jsx("button",{type:"button",className:"dl-lcp-link",onClick:l,children:"Load options from API"}),i.map(o=>{const u=Zl(t).includes(String(o.value));return s.jsxs("label",{className:"dl-lcp-check",children:[s.jsx("input",{type:"checkbox",checked:u,onChange:d=>{const f=Zl(t),g=d.target.checked?[...f,String(o.value)]:f.filter(y=>y!==String(o.value));a(g.length>0?g:void 0)}}),o.label]},String(o.value))})]}),e.type==="secret"&&s.jsx("input",{className:"dl-lcp-input mono",type:"password",value:typeof t=="string"?t:"",placeholder:e.placeholder??"Enter secret value",onChange:o=>a(o.target.value)}),e.type==="text[]"&&s.jsx(Fg,{values:Zl(t),placeholder:e.placeholder,onChange:o=>a(o.length>0?o:void 0)})]}),c&&s.jsxs("div",{className:"dl-lcp-field-hints",children:[e.min!==void 0&&s.jsxs("span",{children:["Min: ",e.min]}),e.max!==void 0&&s.jsxs("span",{children:["Max: ",e.max]}),e.pattern&&s.jsxs("span",{children:["Pattern: ",e.pattern]}),e.placeholder&&s.jsxs("span",{children:["Hint: ",e.placeholder]})]})]})}function Fg({values:e,placeholder:t,onChange:n}){return s.jsxs("div",{className:"dl-lcp-textlist",children:[e.map((r,l)=>s.jsxs("div",{className:"dl-lcp-textlist-row",children:[s.jsx("input",{className:"dl-lcp-input mono",type:"text",value:r,placeholder:t,onChange:a=>{const i=[...e];i[l]=a.target.value,n(i)}}),s.jsx("button",{type:"button",className:"dl-lcp-icon-btn dl-lcp-icon-btn-danger",title:"Remove",onClick:()=>n(e.filter((a,i)=>i!==l)),children:s.jsx(Gi,{size:12})})]},l)),s.jsxs("button",{type:"button",className:"dl-lcp-link",onClick:()=>n([...e,""]),children:[s.jsx(qi,{size:12}),"Add value"]})]})}const Ag=5e3,Ic={ai:"AI","developer-tools":"Developer Tools",gaming:"Gaming",messaging:"Messaging",productivity:"Productivity","social-media":"Social Media"},Ug=["ai","developer-tools","gaming","messaging","productivity","social-media","other"];function Vg(e){switch(e){case"connected":return"connected";case"starting":case"reconnecting":return"warn";case"error":return"error";case"stopped":default:return"stopped"}}function Bg(e){return e==="stable"?new Set(["stable"]):e==="beta"?new Set(["stable","beta"]):new Set(["stable","beta","dev"])}function Wg(e){const t=new Map;for(const n of e){const r=t.get(n.connection);r?r.push(n):t.set(n.connection,[n])}return t}function Hg(){const{daemon:e}=ht(),[t,n]=h.useState([]),[r,l]=h.useState("default"),[a,i]=h.useState([]),[c,o]=h.useState([]),[u,d]=h.useState(!0),[f,g]=h.useState(""),[y,j]=h.useState("stable"),[x,C]=h.useState(null),[v,p]=h.useState(null),[m,w]=h.useState(null),[E,S]=h.useState(!1),_=h.useRef(r);_.current=r;const k=h.useCallback(async M=>{const[b,R]=await Promise.all([F.callers(),F.connectionStatus(M)]);_.current===M&&(Y(b)||n(b),Y(R)||i(R),d(!1))},[]),z=h.useCallback(async M=>{const b=await F.callerIngestors(M);_.current===M&&(Y(b)||o(b))},[]);h.useEffect(()=>{if(e!=="up")return;const M=r;d(!0),i([]),o([]),k(M),z(M)},[e,r,k,z]),h.useEffect(()=>{if(e!=="up")return;const M=r;let b=null;const R=()=>{b===null&&(b=setInterval(()=>void z(M),Ag))},T=()=>{b!==null&&(clearInterval(b),b=null)};document.visibilityState==="visible"&&R();const O=()=>{document.visibilityState==="visible"?(z(M),R()):T()};return document.addEventListener("visibilitychange",O),()=>{T(),document.removeEventListener("visibilitychange",O)}},[e,r,z]);const N=M=>{S(!1),M!==r&&l(M)};h.useEffect(()=>{t.length!==0&&(t.some(M=>M.alias===r)||l("default"))},[t,r]);const $=async(M,b)=>{if(C(M),i(T=>T.map(O=>O.alias===M?{...O,enabled:b}:O)),!(await F.setConnectionEnabled(_.current,M,b)).ok){i(T=>T.map(O=>O.alias===M?{...O,enabled:!b}:O)),C(null);return}C(null),k(_.current)},Q=h.useCallback(()=>{k(_.current),z(_.current)},[k,z]),re=h.useMemo(()=>Wg(c),[c]),Ce=h.useMemo(()=>{const M=Bg(y),b=f.trim().toLowerCase(),R=a.filter(A=>{var he;return A.enabled||M.has(A.stability)?b?A.name.toLowerCase().includes(b)||A.alias.toLowerCase().includes(b)||(((he=A.description)==null?void 0:he.toLowerCase().includes(b))??!1):!0:!1}),T=new Map;for(const A of R){const U=A.category&&A.category in Ic?A.category:"other",he=T.get(U);he?he.push(A):T.set(U,[A])}const O=[];for(const A of Ug){const U=T.get(A);U!=null&&U.length&&(U.sort((he,me)=>he.enabled!==me.enabled?he.enabled?-1:1:he.name.localeCompare(me.name)),O.push({key:A,label:Ic[A]??"Other",connections:U}))}return O},[a,f,y]),ze=Ce.reduce((M,b)=>M+b.connections.length,0);return e==="down"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Connections"}),s.jsx("div",{className:"page-subtitle",children:"Manage per-caller connections, secrets and listeners"})]})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"})," to manage connections."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Connections"}),s.jsx("div",{className:"page-subtitle",children:"Manage per-caller connections, secrets and listeners"})]})}),s.jsxs("div",{className:"dl-conn-controls",children:[s.jsxs("div",{className:"dl-conn-caller",children:[s.jsxs("button",{type:"button",className:"dl-conn-caller-btn",onClick:()=>S(M=>!M),children:[s.jsx(jf,{size:14,className:"dl-conn-muted-icon"}),s.jsx("span",{className:"dl-conn-caller-name",children:r}),s.jsx(jl,{size:14,className:"dl-conn-muted-icon"})]}),E&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"dl-conn-overlay",onClick:()=>S(!1)}),s.jsxs("div",{className:"dl-conn-caller-menu",children:[t.map(M=>s.jsx("div",{className:`dl-conn-caller-item ${M.alias===r?"dl-conn-caller-item-active":""}`,onClick:()=>N(M.alias),children:s.jsxs("div",{className:"dl-conn-caller-item-main",children:[M.alias===r&&s.jsx(Nt,{size:12,className:"dl-conn-check"}),s.jsxs("div",{className:"dl-conn-caller-item-text",children:[s.jsx("div",{className:"dl-conn-caller-item-alias",children:M.alias}),s.jsxs("div",{className:"dl-conn-caller-item-count",children:[M.connections.length," connection",M.connections.length===1?"":"s"]})]})]})},M.alias)),s.jsx("div",{className:"dl-conn-caller-divider"}),s.jsxs(Yn,{to:"/callers",className:"dl-conn-caller-manage",onClick:()=>S(!1),children:[s.jsx("span",{children:"Manage callers"}),s.jsx(Lv,{size:12})]})]})]})]}),s.jsxs("div",{className:"dl-conn-search",children:[s.jsx(hg,{size:16,className:"dl-conn-search-icon"}),s.jsx("input",{type:"text",placeholder:"Search connections…",value:f,onChange:M=>g(M.target.value)})]}),s.jsx("div",{className:"dl-conn-stability",children:[{key:"stable",label:"Stable"},{key:"beta",label:"+ Beta"},{key:"dev",label:"All (dev)"}].map(({key:M,label:b})=>s.jsx("button",{type:"button",className:`dl-conn-stability-btn ${y===M?"dl-conn-stability-active":""}`,onClick:()=>j(M),children:b},M))})]}),u?s.jsx("div",{className:"banner banner-loading",children:"Loading connections…"}):ze===0?s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:f?`No connections match "${f}"`:"No connections to show"}),y!=="dev"&&s.jsxs("span",{children:["Try"," ",s.jsx("button",{type:"button",className:"dl-conn-link-btn",onClick:()=>j("dev"),children:"All (dev)"})," ","to see more connections."]})]}):Ce.map(M=>s.jsxs("section",{className:"dl-conn-group",children:[s.jsx("h2",{className:"dl-conn-group-title",children:M.label}),s.jsx("div",{className:"dl-conn-grid",children:M.connections.map(b=>s.jsx(Qg,{caller:r,connection:b,toggling:x===b.alias,ingestors:re.get(b.alias)??[],onToggle:R=>void $(b.alias,R),onConfigure:()=>p(b),onOpenListener:()=>w(b),onChanged:Q},b.alias))})]},M.key)),v&&s.jsx(Mg,{caller:r,connection:v,onClose:()=>p(null),onSaved:()=>{p(null),Q()}}),m&&s.jsx(bg,{caller:r,connection:m.alias,connectionName:m.name,supportsMultiInstance:m.supportsMultiInstance,onClose:()=>w(null),onChanged:Q})]})}function Mc(e){for(const t of["error","message","description","status"]){const n=e[t];if(typeof n=="string"&&n)return n;if(typeof n=="number")return String(n)}}function Qg({caller:e,connection:t,toggling:n,ingestors:r,onToggle:l,onConfigure:a,onOpenListener:i,onChanged:c}){const o=t,[u,d]=h.useState(null),[f,g]=h.useState(null),[y,j]=h.useState(null),x=o.requiredSecrets.length,C=o.requiredSecrets.filter(N=>o.requiredSecretsSet[N]).length;let v,p;x===0?(v="No secrets needed",p="dl-conn-secret-none"):C===x?(v="Ready",p="dl-conn-secret-ready"):C>0?(v=`${C}/${x} secrets`,p="dl-conn-secret-partial"):(v=`${x} secret${x===1?"":"s"} needed`,p="dl-conn-secret-missing");const m=r[0],w=r.length,E=r.filter(N=>N.state==="connected").length,S=async()=>{d("connection"),g(null);const N=await F.testConnection(e,o.alias);N.ok?g({ok:!0,label:"Test passed",detail:Mc(N.data)}):g({ok:!1,label:"Test failed",detail:N.error}),d(null)},_=async()=>{d("ingestor"),g(null);const N=await F.testIngestor(e,o.alias);N.ok?g({ok:!0,label:"Listener test passed",detail:Mc(N.data)}):g({ok:!1,label:"Listener test failed",detail:N.error}),d(null)},k=async N=>{j(N),await F.controlListener(e,o.alias,N),j(null),c()},z=(m==null?void 0:m.state)==="connected";return s.jsxs("article",{className:`dl-conn-card ${o.enabled?"":"dl-conn-card-off"}`,children:[s.jsxs("div",{className:"dl-conn-card-head",children:[s.jsxs("div",{className:"dl-conn-card-id",children:[s.jsx("span",{className:`dl-conn-icon ${o.enabled?"dl-conn-icon-on":""}`,children:s.jsx(_c,{size:18})}),s.jsxs("div",{className:"dl-conn-card-text",children:[s.jsx("h3",{className:"dl-conn-card-name",children:o.name}),o.description&&s.jsx("p",{className:"dl-conn-card-desc",children:o.description})]})]}),s.jsx("button",{type:"button",className:`dl-conn-toggle ${o.enabled?"dl-conn-toggle-on":""}`,disabled:n,onClick:()=>l(!o.enabled),title:o.enabled?"Disable connection":"Enable connection","aria-pressed":o.enabled,children:s.jsx("span",{className:"dl-conn-toggle-knob"})})]}),s.jsxs("div",{className:"dl-conn-badges",children:[s.jsx(Sf,{stability:o.stability}),s.jsxs("span",{className:"dl-conn-badge mono",children:[s.jsx(Wv,{size:10}),o.allowedEndpoints.length," endpoint",o.allowedEndpoints.length===1?"":"s"]}),o.hasIngestor&&o.ingestorType&&s.jsxs("span",{className:"dl-conn-badge dl-conn-badge-ingestor",children:[s.jsx(Mn,{size:10}),o.ingestorType,m&&s.jsx("span",{className:`status-dot dl-conn-dot dl-conn-dot-${Vg(m.state)}`,title:`Listener: ${m.state}`,"aria-hidden":"true"}),w>1&&s.jsxs("span",{className:"dl-conn-dot-count",children:[E,"/",w]})]}),s.jsxs("span",{className:`dl-conn-badge dl-conn-secret ${p}`,children:[x>0&&C===x?s.jsx(Nt,{size:10}):x>0?s.jsx(Ke,{size:10}):null,v]}),o.docsUrl&&s.jsxs("a",{className:"dl-conn-docs",href:o.docsUrl,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ur,{size:10}),"Docs"]})]}),s.jsxs("div",{className:"dl-conn-actions",children:[s.jsx("button",{type:"button",className:"dl-conn-btn dl-conn-btn-primary",onClick:a,children:"Configure"}),s.jsxs("button",{type:"button",className:"dl-conn-btn",disabled:u!==null,onClick:()=>void S(),title:"Test API credentials",children:[u==="connection"?s.jsx(se,{size:12,className:"dl-conn-spin"}):s.jsx(_c,{size:12}),"Test"]}),o.hasIngestor&&s.jsxs("button",{type:"button",className:"dl-conn-btn",disabled:u!==null,onClick:()=>void _(),title:"Test event listener",children:[u==="ingestor"?s.jsx(se,{size:12,className:"dl-conn-spin"}):s.jsx(Mn,{size:12}),"Test Listener"]})]}),o.hasIngestor&&s.jsxs("div",{className:"dl-conn-listener-row",children:[s.jsxs("button",{type:"button",className:`dl-conn-mini ${z?"dl-conn-mini-stop":"dl-conn-mini-start"}`,disabled:y!==null,onClick:()=>void k(z?"stop":"start"),title:z?"Stop listener":"Start listener",children:[y==="start"||y==="stop"?s.jsx(se,{size:10,className:"dl-conn-spin"}):z?s.jsx(Ls,{size:10}):s.jsx(Es,{size:10}),z?"Stop":"Start"]}),s.jsxs("button",{type:"button",className:"dl-conn-mini",disabled:y!==null,onClick:()=>void k("restart"),title:"Restart listener",children:[y==="restart"?s.jsx(se,{size:10,className:"dl-conn-spin"}):s.jsx(_s,{size:10}),"Restart"]}),s.jsx("div",{className:"dl-conn-spacer"}),s.jsxs("button",{type:"button",className:"dl-conn-mini dl-conn-mini-accent",onClick:i,title:"Configure listener",children:[s.jsx(Mn,{size:10}),"Listener"]})]}),f&&s.jsxs("div",{className:`dl-conn-result ${f.ok?"dl-conn-result-ok":"dl-conn-result-err"}`,children:[f.ok?s.jsx(Nt,{size:14,className:"dl-conn-result-icon"}):s.jsx(Ke,{size:14,className:"dl-conn-result-icon"}),s.jsxs("div",{className:"dl-conn-result-text",children:[s.jsx("div",{className:"dl-conn-result-label",children:f.label}),f.detail&&s.jsx("div",{className:"dl-conn-result-detail",children:f.detail})]}),s.jsx("button",{type:"button",className:"dl-conn-result-close",onClick:()=>g(null),title:"Dismiss",children:"×"})]})]})}function Kg(){const{alias:e}=pf(),{daemon:t}=ht(),[n,r]=h.useState({status:"loading"});if(h.useEffect(()=>{if(!e||t!=="up")return;let a=!1;return(async()=>{const i=await F.connections();if(a)return;if(Y(i)){r({status:"error",message:i.error});return}const c=i.find(o=>o.alias===e);r(c?{status:"ok",template:c}:{status:"not-found"})})(),()=>{a=!0}},[e,t]),t==="down")return s.jsxs(s.Fragment,{children:[s.jsx(ir,{}),s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:e})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"}),"."]})]})]});if(n.status==="loading")return s.jsxs(s.Fragment,{children:[s.jsx(ir,{}),s.jsx("div",{className:"banner banner-loading",children:"Loading…"})]});if(n.status==="error")return s.jsxs(s.Fragment,{children:[s.jsx(ir,{}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Failed to load connection: ",n.message]})]})]});if(n.status==="not-found")return s.jsxs(s.Fragment,{children:[s.jsx(ir,{}),s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Not found"})}),s.jsxs("div",{className:"placeholder",children:[s.jsxs("span",{className:"placeholder-title",children:['No connection template named "',e,'"']}),s.jsxs("span",{children:["Return to the ",s.jsx(Yn,{to:"/connections",children:"connection list"}),"."]})]})]});const l=n.template;return s.jsxs(s.Fragment,{children:[s.jsx(ir,{}),s.jsx("header",{className:"page-header",children:s.jsxs("div",{children:[s.jsxs("div",{className:"title-row",children:[s.jsx("h1",{className:"page-title",children:l.name}),s.jsx(Sf,{stability:l.stability})]}),s.jsxs("div",{className:"subtitle-meta",children:[s.jsx("span",{className:"mono",children:l.alias}),s.jsx("span",{className:"dot-sep",children:"·"}),s.jsx("span",{className:"tag",children:l.category}),l.docsUrl&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"dot-sep",children:"·"}),s.jsxs("a",{href:l.docsUrl,target:"_blank",rel:"noreferrer noopener",children:["docs ",s.jsx(Ur,{size:12,"aria-hidden":"true"})]})]}),l.openApiUrl&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"dot-sep",children:"·"}),s.jsxs("a",{href:l.openApiUrl,target:"_blank",rel:"noreferrer noopener",children:["OpenAPI ",s.jsx(Ur,{size:12,"aria-hidden":"true"})]})]})]})]})}),l.description&&s.jsx("section",{className:"detail-section",children:s.jsx("p",{className:"detail-description",children:l.description})}),s.jsxs("section",{className:"detail-section",children:[s.jsx("h2",{className:"section-title",children:"Auth"}),s.jsxs("p",{className:"detail-note",children:["The daemon auto-injects the secrets below into request headers. Exact header strings (e.g."," ",s.jsxs("code",{className:"mono",children:["Authorization: Bearer $","{TOKEN}"]}),") are defined in the connection template; the admin API exposes only the referenced secret names. Secret values are never exposed."]}),s.jsx(Oc,{label:"Required secrets",secrets:l.requiredSecrets,emptyText:"No required secrets"}),s.jsx(Oc,{label:"Optional secrets",secrets:l.optionalSecrets,emptyText:"No optional secrets"})]}),s.jsxs("section",{className:"detail-section",children:[s.jsxs("h2",{className:"section-title",children:["Allowed endpoints (",l.allowedEndpoints.length,")"]}),l.allowedEndpoints.length===0?s.jsx("p",{className:"detail-note",children:"No allowlisted endpoints."}):s.jsx("ul",{className:"endpoint-list",children:l.allowedEndpoints.map(a=>s.jsx("li",{className:"endpoint-item mono",children:a},a))})]}),l.hasIngestor&&s.jsxs("section",{className:"detail-section",children:[s.jsx("h2",{className:"section-title",children:"Ingestor"}),s.jsxs("dl",{className:"kv-grid",children:[s.jsx("dt",{children:"Type"}),s.jsx("dd",{className:"mono",children:l.ingestorType??"—"}),s.jsx("dt",{children:"Listener config"}),s.jsx("dd",{children:l.hasListenerConfig?"yes":"no"}),s.jsx("dt",{children:"Multi-instance"}),s.jsx("dd",{children:l.supportsMultiInstance?"yes":"no"}),s.jsx("dt",{children:"Test ingestor"}),s.jsx("dd",{children:l.hasTestIngestor?"yes":"no"})]})]}),s.jsxs("section",{className:"detail-section",children:[s.jsx("h2",{className:"section-title",children:"Capabilities"}),s.jsxs("dl",{className:"kv-grid",children:[s.jsx("dt",{children:"Test connection"}),s.jsx("dd",{children:l.hasTestConnection?"yes":"no"}),s.jsx("dt",{children:"Has ingestor"}),s.jsx("dd",{children:l.hasIngestor?"yes":"no"})]})]})]})}function ir(){return s.jsx(Yn,{to:"/connections",className:"back-link",children:"← Back to connections"})}function Oc({label:e,secrets:t,emptyText:n}){return s.jsxs("div",{className:"secret-list-block",children:[s.jsx("div",{className:"card-label",children:e}),t.length===0?s.jsx("div",{className:"cell-muted",children:n}):s.jsx("ul",{className:"secret-list",children:t.map(r=>s.jsx("li",{className:"secret-pill mono",children:r},r))})]})}const qg=5e3,$c=120;function bc(e){switch(e){case"connected":return"connected";case"starting":case"reconnecting":return"warn";case"stopped":return"stopped";case"error":return"error";default:return"stopped"}}function Dc(e){const t=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(t))return"—";const n=Date.now()-t;if(n<0)return"just now";const r=Math.floor(n/1e3);if(r<5)return"just now";if(r<60)return`${r}s ago`;const l=Math.floor(r/60);if(l<60)return`${l}m ago`;const a=Math.floor(l/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Gg(e){let t;if(typeof e=="string")t=e;else if(e==null)t=String(e);else if(typeof e=="number"||typeof e=="boolean")t=String(e);else try{t=JSON.stringify(e)}catch{t=String(e)}return t=t.replace(/\s+/g," ").trim(),t.length>$c?`${t.slice(0,$c)}…`:t}function Yg(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Xg(e){return e.length===0?null:e.some(n=>n.alias==="default")?"default":e[0].alias}function Jg(){const{daemon:e}=ht(),[t,n]=h.useState([]),[r,l]=h.useState(null),[a,i]=h.useState(!1),[c,o]=h.useState([]),[u,d]=h.useState([]),[f,g]=h.useState(null),[y,j]=h.useState(null),[x,C]=h.useState(!0),[v,p]=h.useState(!1),[m,w]=h.useState(()=>Date.now()),E=(N,$)=>{if($.length===0)return N;const Q=new Set(N.map(Ce=>Ce.id)),re=$.filter(Ce=>!Q.has(Ce.id));return re.length===0?N:[...re.sort((Ce,ze)=>ze.id-Ce.id),...N]};h.useEffect(()=>{if(e!=="up")return;let N=!1;return(async()=>{const $=await F.callers();if(!N){if(Y($)){i(!0);return}n($),l(Q=>Q&&$.some(re=>re.alias===Q)?Q:Xg($)),i(!0)}})(),()=>{N=!0}},[e]),h.useEffect(()=>{o([]),d([]),g(null),j(null),C(!0)},[r]),h.useEffect(()=>{if(e!=="up"||!r)return;const N=r;let $=!1,Q=null;const re=async()=>{const T=await F.callerEvents(N,-1);if(!$){if(Y(T)){C(!1);return}o(O=>E(O,T)),C(!1)}},Ce=async()=>{const T=await F.callerIngestors(N);$||Y(T)||d(T)},ze=()=>{re(),Ce()},M=()=>{Q===null&&(Q=setInterval(ze,qg))},b=()=>{Q!==null&&(clearInterval(Q),Q=null)};ze(),document.visibilityState==="visible"&&M();const R=()=>{document.visibilityState==="visible"?(ze(),M()):b()};return document.addEventListener("visibilitychange",R),()=>{$=!0,b(),document.removeEventListener("visibilitychange",R)}},[e,r]),h.useEffect(()=>{let N=null;const $=()=>{N===null&&(N=setInterval(()=>w(Date.now()),1e3))},Q=()=>{N!==null&&(clearInterval(N),N=null)};document.visibilityState==="visible"&&$();const re=()=>{document.visibilityState==="visible"?$():Q()};return document.addEventListener("visibilitychange",re),()=>{Q(),document.removeEventListener("visibilitychange",re)}},[]);const S=async()=>{if(!r||e!=="up")return;const N=r;p(!0);try{const[$,Q]=await Promise.all([F.callerEvents(N,-1),F.callerIngestors(N)]);if(r!==N)return;Y($)||o(re=>E(re,$)),Y(Q)||d(Q),C(!1)}finally{p(!1)}},_=new Map;for(const N of c)_.set(N.source,(_.get(N.source)??0)+1);const k=[..._.keys()].sort((N,$)=>N.localeCompare($)),z=f?c.filter(N=>N.source===f):c;return e==="down"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Logs"}),s.jsx("div",{className:"page-subtitle",children:"Live event feed from caller ingestors"})]})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"})," to load events."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Logs"}),s.jsx("div",{className:"page-subtitle",children:"Live event feed from caller ingestors — polled every 5s"})]}),s.jsxs("div",{className:"dl-events-controls",children:[s.jsxs("label",{className:"dl-events-caller-select",children:[s.jsx("span",{className:"dl-events-caller-label",children:"Caller"}),s.jsxs("select",{value:r??"",disabled:t.length===0,onChange:N=>l(N.target.value||null),children:[t.length===0&&s.jsx("option",{value:"",children:"No callers"}),t.map(N=>s.jsx("option",{value:N.alias,children:N.name?`${N.name} (${N.alias})`:N.alias},N.alias))]})]}),s.jsxs("button",{type:"button",className:"dl-events-refresh",onClick:S,disabled:!r||v,title:"Refresh now",children:[s.jsx(og,{size:14,className:v?"dl-events-spin":void 0}),s.jsx("span",{children:"Refresh"})]})]})]}),a&&t.length===0&&s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"No callers configured"}),s.jsx("span",{children:"Create a caller before events can be ingested."})]}),r&&s.jsxs(s.Fragment,{children:[u.length>0&&s.jsx("section",{className:"dl-events-ingestors",children:u.map(N=>s.jsxs("article",{className:"dl-events-ingestor-card",children:[s.jsxs("div",{className:"dl-events-ingestor-head",children:[s.jsx("span",{className:`status-dot dl-events-dot dl-events-dot-${bc(N.state)}`,"aria-hidden":"true"}),s.jsx("span",{className:"mono dl-events-ingestor-conn",children:N.connection}),N.instanceId&&s.jsx("span",{className:"mono dl-events-instance",children:N.instanceId})]}),s.jsxs("div",{className:"dl-events-ingestor-meta",children:[s.jsx("span",{className:`dl-events-state dl-events-state-${bc(N.state)}`,children:N.state}),s.jsx("span",{className:"tag",children:N.type}),s.jsxs("span",{className:"dl-events-muted",children:[N.totalEventsReceived," event",N.totalEventsReceived===1?"":"s"]}),N.lastEventAt&&s.jsxs("span",{className:"dl-events-muted",children:["last: ",Dc(N.lastEventAt)]})]}),N.error&&s.jsx("div",{className:"dl-events-ingestor-error",title:N.error,children:N.error})]},`${N.connection}::${N.instanceId??""}`))}),k.length>0&&s.jsxs("div",{className:"dl-events-pills",children:[s.jsxs("button",{type:"button",className:`dl-events-pill ${f===null?"dl-events-pill-active":""}`,onClick:()=>g(null),children:["All (",c.length,")"]}),k.map(N=>s.jsxs("button",{type:"button",className:`dl-events-pill mono ${f===N?"dl-events-pill-active":""}`,onClick:()=>g(N),children:[N," (",_.get(N),")"]},N))]}),x?s.jsx("div",{className:"banner banner-loading",children:"Loading events…"}):z.length===0?s.jsxs("div",{className:"placeholder",children:[s.jsx(Mn,{size:22,className:"dl-events-empty-icon","aria-hidden":"true"}),s.jsx("span",{className:"placeholder-title",children:"No events yet"}),s.jsx("span",{children:"Events from this caller's ingestors will appear here as they arrive."})]}):s.jsx("div",{className:"dl-events-feed",children:z.map(N=>{const $=y===N.id;return s.jsxs("div",{className:"dl-events-row-wrap",children:[s.jsxs("button",{type:"button",className:"dl-events-row","aria-expanded":$,onClick:()=>j($?null:N.id),children:[$?s.jsx(jl,{size:14,className:"dl-events-chevron"}):s.jsx(Qi,{size:14,className:"dl-events-chevron"}),s.jsx("span",{className:"dl-events-source mono",children:N.source}),N.instanceId&&s.jsx("span",{className:"dl-events-instance mono",children:N.instanceId}),s.jsx("span",{className:"dl-events-type mono",children:N.eventType}),s.jsx("span",{className:"dl-events-preview",children:Gg(N.data)}),s.jsx("span",{className:"dl-events-time",children:Dc(N.receivedAtMs)})]}),$&&s.jsxs("div",{className:"dl-events-detail",children:[s.jsxs("div",{className:"dl-events-detail-meta",children:[s.jsxs("span",{children:[s.jsx("span",{className:"dl-events-muted",children:"id:"})," ",s.jsx("span",{className:"mono",children:N.id})]}),s.jsxs("span",{children:[s.jsx("span",{className:"dl-events-muted",children:"idempotencyKey:"})," ",s.jsx("span",{className:"mono",children:N.idempotencyKey})]}),s.jsxs("span",{children:[s.jsx("span",{className:"dl-events-muted",children:"receivedAt:"})," ",s.jsx("span",{className:"mono",title:N.receivedAt,children:new Date(N.receivedAtMs).toLocaleString()})]})]}),s.jsx("pre",{className:"dl-events-json mono",children:Yg(N.data)})]})]},`${N.source}::${N.id}`)})})]}),s.jsx("span",{hidden:!0,"aria-hidden":"true","data-now":m})]})}const Fc=12,Zg=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function ey(){const{daemon:e}=ht(),t=Gn(),[n,r]=h.useState({status:"loading"}),[l,a]=h.useState(!1),[i,c]=h.useState(""),[o,u]=h.useState(""),[d,f]=h.useState(null),[g,y]=h.useState(!1),[j,x]=h.useState(null),[C,v]=h.useState(!1),[p,m]=h.useState(null),w=h.useCallback(async()=>{const k=await F.callers();if(Y(k)){r({status:"error",message:k.error});return}r({status:"ok",callers:k})},[]);h.useEffect(()=>{if(e!=="up")return;let k=!1;return(async()=>{const z=await F.callers();if(!k){if(Y(z)){r({status:"error",message:z.error});return}r({status:"ok",callers:z})}})(),()=>{k=!0}},[e]);const E=()=>{a(!1),c(""),u(""),f(null)},S=async()=>{const k=i.trim();if(!k){f("Alias is required");return}if(!Zg.test(k)){f("Use letters, numbers, dashes or underscores (must start alphanumeric)");return}f(null),y(!0);const z=o.trim(),N=await F.createCaller(k,z||void 0);if(y(!1),!N.ok){f(N.error);return}E(),await w()},_=async()=>{if(!j)return;v(!0),m(null);const k=await F.deleteCaller(j);if(v(!1),!k.ok){m(k.error);return}x(null),await w()};return e==="down"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Callers"})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"})," to load callers."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Callers"}),s.jsxs("div",{className:"page-subtitle",children:["Registered callers from ",s.jsx("code",{children:"remote.config.json"})]})]}),s.jsxs("div",{className:"dl-callers-header-right",children:[n.status==="ok"&&s.jsxs("span",{className:"page-subtitle",children:[n.callers.length," caller",n.callers.length===1?"":"s"]}),!l&&s.jsxs("button",{type:"button",className:"dl-callers-new-btn",onClick:()=>a(!0),children:[s.jsx(qi,{size:14}),"New caller"]})]})]}),l&&s.jsxs("div",{className:"dl-callers-newcaller",children:[s.jsx("input",{type:"text",className:"dl-callers-newcaller-input mono",placeholder:"alias",value:i,autoFocus:!0,onChange:k=>{c(k.target.value),f(null)},onKeyDown:k=>{k.key==="Enter"&&S(),k.key==="Escape"&&E()}}),s.jsx("input",{type:"text",className:"dl-callers-newcaller-input",placeholder:"name (optional)",value:o,onChange:k=>u(k.target.value),onKeyDown:k=>{k.key==="Enter"&&S(),k.key==="Escape"&&E()}}),s.jsx("button",{type:"button",className:"dl-callers-newcaller-add",disabled:g,onClick:()=>void S(),children:g?"Creating…":"Create caller"}),s.jsx("button",{type:"button",className:"dl-callers-newcaller-cancel",disabled:g,onClick:E,children:"Cancel"}),d&&s.jsx("div",{className:"dl-callers-newcaller-error",children:d})]}),n.status==="loading"&&s.jsx("div",{className:"banner banner-loading",children:"Loading callers…"}),n.status==="error"&&s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Failed to load callers: ",n.message]})]}),n.status==="ok"&&n.callers.length===0&&s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"No callers registered"}),s.jsxs("span",{children:["Use ",s.jsx("strong",{children:"New caller"})," above, then open it to"," ",s.jsx("strong",{children:"Issue credentials"})," for a callboard instance."]})]}),n.status==="ok"&&n.callers.length>0&&s.jsx("div",{className:"data-table-wrap",children:s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Alias"}),s.jsx("th",{children:"Name"}),s.jsx("th",{className:"num",children:"Connections"}),s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Fingerprint"}),s.jsx("th",{children:"Keys dir"}),s.jsx("th",{"aria-label":"Actions"})]})}),s.jsx("tbody",{children:n.callers.map(k=>s.jsxs("tr",{className:"data-table-row-clickable",onClick:()=>t(`/callers/${k.alias}`),onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),t(`/callers/${k.alias}`))},tabIndex:0,role:"link",children:[s.jsx("td",{children:s.jsx("div",{className:"cell-primary mono",children:k.alias})}),s.jsx("td",{children:k.name??s.jsx("span",{className:"cell-muted",children:"—"})}),s.jsx("td",{className:"num",children:k.connections.length}),s.jsx("td",{children:s.jsx(Ef,{source:k.source})}),s.jsx("td",{children:k.fingerprint?s.jsxs("span",{className:"mono",title:k.fingerprint,children:[k.fingerprint.slice(0,Fc),k.fingerprint.length>Fc?"…":""]}):s.jsx("span",{className:"cell-muted",children:"—"})}),s.jsx("td",{children:s.jsx(Cf,{exists:k.keysDirExists})}),s.jsx("td",{className:"dl-callers-action-cell",children:k.alias!=="default"&&s.jsx("button",{type:"button",className:"dl-callers-del-btn",title:`Delete "${k.alias}"`,"aria-label":`Delete caller ${k.alias}`,onClick:z=>{z.stopPropagation(),m(null),x(k.alias)},children:s.jsx(Gi,{size:14})})})]},k.alias))})]})}),j&&s.jsx(Xi,{title:`Delete caller "${j}"?`,description:s.jsxs(s.Fragment,{children:["This removes ",s.jsx("code",{children:j}),", its enabled connections, and its public-key entry in"," ",s.jsx("code",{children:"remote.config.json"}),". Any active sessions for this caller will be dropped. This cannot be undone."]}),busy:C,error:p,onConfirm:_,onCancel:()=>{C||(x(null),m(null))}})]})}function Cf({exists:e}){return s.jsx("span",{className:`keys-dir-badge keys-dir-${e?"ok":"missing"}`,children:e?"ok":"missing"})}function Ef({source:e}){return e?s.jsx("span",{className:`dl-source-badge dl-source-${e}`,children:e}):s.jsx("span",{className:"cell-muted",children:"—"})}const Ac=!1;function Uc(e,t){const n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),r=URL.createObjectURL(n),l=document.createElement("a");l.href=r,l.download=`${e}.drawlatch-caller.json`,document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(r)}function ty({alias:e,callerConnections:t,availableConnections:n,defaultEndpoint:r,isRotation:l,onClose:a,onIssued:i}){const[c,o]=h.useState(r),[u,d]=h.useState(()=>new Set(t)),[f,g]=h.useState(!1),[y,j]=h.useState(""),[x,C]=h.useState(""),[v,p]=h.useState(!1),[m,w]=h.useState(null),[E,S]=h.useState(null);h.useEffect(()=>{const z=N=>{N.key==="Escape"&&!v&&a()};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[a,v]);const _=z=>{d(N=>{const $=new Set(N);return $.has(z)?$.delete(z):$.add(z),$})},k=async()=>{if(!c.trim()){w("Endpoint URL is required.");return}if(f){if(!y){w("Enter a passphrase, or uncheck passphrase protection.");return}if(y!==x){w("Passphrases do not match.");return}}w(null),p(!0);const z=await F.issueCaller(e,{endpointUrl:c.trim(),connections:[...u],...f?{passphrase:y}:{}});if(p(!1),!z.ok){w(z.error);return}Uc(e,z.data),S(z.data),j(""),C(""),i()};return s.jsx("div",{className:"dl-issue-overlay",onClick:()=>{v||a()},children:s.jsxs("div",{className:"dl-issue-panel",role:"dialog","aria-modal":"true","aria-labelledby":"dl-issue-title",onClick:z=>z.stopPropagation(),children:[s.jsxs("div",{className:"dl-issue-header",children:[s.jsxs("div",{className:"dl-issue-header-text",children:[s.jsx("span",{className:"dl-issue-icon","aria-hidden":"true",children:s.jsx(Ki,{size:18})}),s.jsx("h2",{id:"dl-issue-title",className:"dl-issue-title",children:E?"Credentials issued":l?`Rotate credentials for "${e}"`:`Issue credentials for "${e}"`})]}),s.jsx("button",{type:"button",className:"dl-issue-close","aria-label":"Close",disabled:v,onClick:a,children:s.jsx(Xn,{size:16})})]}),E?s.jsxs("div",{className:"dl-issue-body",children:[s.jsxs("div",{className:"dl-issue-banner",children:[s.jsx(vg,{size:16,"aria-hidden":"true"}),s.jsxs("span",{children:["The downloaded"," ",s.jsxs("code",{children:[e,".drawlatch-caller.json"]})," contains the caller"," ",s.jsx("strong",{children:"private keys"}),". It is shown"," ",s.jsx("strong",{children:"once"})," and cannot be re-downloaded — drawlatch keeps only the public key. Store it securely; re-issue to rotate."]})]}),s.jsxs("dl",{className:"dl-issue-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Fingerprint"}),s.jsx("dd",{className:"mono",children:E.fingerprint})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Server key"}),s.jsx("dd",{className:"mono",children:E.serverKeyFingerprint})]}),Ac,s.jsxs("div",{children:[s.jsx("dt",{children:"Private keys"}),s.jsx("dd",{children:E.encryption?"passphrase-protected":"plaintext (protect the file)"})]})]}),s.jsxs("div",{className:"dl-issue-footer",children:[s.jsxs("button",{type:"button",className:"dl-issue-btn dl-issue-btn-secondary",onClick:()=>Uc(e,E),children:[s.jsx(bv,{size:14}),"Download again"]}),s.jsx("button",{type:"button",className:"dl-issue-btn dl-issue-btn-primary",onClick:a,autoFocus:!0,children:"Done"})]})]}):s.jsxs("div",{className:"dl-issue-body",children:[Ac,s.jsxs("div",{className:"dl-issue-field",children:[s.jsxs("span",{className:"dl-issue-label",children:["Connections (",u.size,")"]}),n.length===0?s.jsx("span",{className:"dl-issue-hint",children:"No connections available."}):s.jsx("div",{className:"dl-issue-conns",children:n.map(z=>s.jsxs("label",{className:"dl-issue-conn",children:[s.jsx("input",{type:"checkbox",checked:u.has(z),onChange:()=>_(z)}),s.jsx("span",{className:"mono",children:z})]},z))}),s.jsx("span",{className:"dl-issue-hint",children:"Informational in the bundle — authorization is enforced server-side."})]}),s.jsxs("div",{className:"dl-issue-field",children:[s.jsxs("label",{className:"dl-issue-check",children:[s.jsx("input",{type:"checkbox",checked:f,onChange:z=>g(z.target.checked)}),s.jsx("span",{children:"Protect the private key with a passphrase"})]}),f&&s.jsxs("div",{className:"dl-issue-pass",children:[s.jsx("input",{type:"password",className:"dl-issue-input",value:y,onChange:z=>j(z.target.value),placeholder:"passphrase",autoComplete:"new-password"}),s.jsx("input",{type:"password",className:"dl-issue-input",value:x,onChange:z=>C(z.target.value),placeholder:"confirm passphrase",autoComplete:"new-password"}),s.jsx("span",{className:"dl-issue-hint",children:"For transfer over untrusted media — share the passphrase out-of-band. Skip for same-host/local."})]})]}),l&&s.jsxs("div",{className:"dl-issue-warn",children:["Rotating mints a fresh keypair and"," ",s.jsx("strong",{children:"invalidates the prior credential"})," immediately."]}),m&&s.jsx("div",{className:"dl-issue-error",children:m}),s.jsxs("div",{className:"dl-issue-footer",children:[s.jsx("button",{type:"button",className:"dl-issue-btn dl-issue-btn-secondary",disabled:v,onClick:a,children:"Cancel"}),s.jsxs("button",{type:"button",className:"dl-issue-btn dl-issue-btn-primary",disabled:v,onClick:()=>void k(),children:[v&&s.jsx(se,{size:14,className:"dl-issue-spin"}),l?"Rotate & download":"Issue & download"]})]})]})]})})}function ny(){const{alias:e}=pf(),{daemon:t}=ht(),n=Gn(),[r,l]=h.useState({status:"loading"}),[a,i]=h.useState([]),[c,o]=h.useState(window.location.origin),[u,d]=h.useState(!1),[f,g]=h.useState(!1),[y,j]=h.useState(!1),[x,C]=h.useState(null),v=h.useCallback(async()=>{if(!e)return;const E=await F.callers();if(Y(E)){l({status:"error",message:E.error});return}const S=E.find(k=>k.alias===e);if(!S){l({status:"not-found"});return}const _=await F.callerConnections(e);if(Y(_)){l({status:"error",message:_.error});return}l({status:"ok",caller:S,connections:_})},[e]);h.useEffect(()=>{e&&t==="up"&&v()},[e,t,v]),h.useEffect(()=>{if(t!=="up")return;let E=!1;return(async()=>{const[S,_]=await Promise.all([F.connections(),F.meta()]);E||(Y(S)||i(S.map(k=>k.alias)),!Y(_)&&_.tunnelUrl&&o(_.tunnelUrl))})(),()=>{E=!0}},[t]);const p=async()=>{if(!e)return;j(!0),C(null);const E=await F.deleteCaller(e);if(j(!1),!E.ok){C(E.error);return}n("/callers")};if(t==="down")return s.jsxs(s.Fragment,{children:[s.jsx(or,{}),s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:e})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"}),"."]})]})]});if(r.status==="loading")return s.jsxs(s.Fragment,{children:[s.jsx(or,{}),s.jsx("div",{className:"banner banner-loading",children:"Loading…"})]});if(r.status==="error")return s.jsxs(s.Fragment,{children:[s.jsx(or,{}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Failed to load caller: ",r.message]})]})]});if(r.status==="not-found")return s.jsxs(s.Fragment,{children:[s.jsx(or,{}),s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Not found"})}),s.jsxs("div",{className:"placeholder",children:[s.jsxs("span",{className:"placeholder-title",children:['No caller named "',e,'"']}),s.jsxs("span",{children:["Return to the ",s.jsx(Yn,{to:"/callers",children:"caller list"}),"."]})]})]});const{caller:m,connections:w}=r;return s.jsxs(s.Fragment,{children:[s.jsx(or,{}),s.jsx("header",{className:"page-header",children:s.jsxs("div",{children:[s.jsxs("div",{className:"title-row",children:[s.jsx("h1",{className:"page-title",children:m.name??m.alias}),s.jsx(Cf,{exists:m.keysDirExists}),s.jsx(Ef,{source:m.source})]}),s.jsxs("div",{className:"subtitle-meta",children:[s.jsx("span",{className:"mono",children:m.alias}),m.fingerprint&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"dot-sep",children:"·"}),s.jsx("span",{className:"mono",title:"Ed25519 public key fingerprint",children:m.fingerprint})]})]})]})}),s.jsxs("section",{className:"detail-section",children:[s.jsx("h2",{className:"section-title",children:"Credentials"}),s.jsxs("div",{className:"dl-cred-lifecycle",children:[s.jsx("p",{className:"detail-note",children:m.source==="local-auto"?s.jsxs(s.Fragment,{children:["Auto-shared to a co-located callboard over the filesystem (",s.jsx("code",{children:"local-auto"}),"). Issuing here mints a fresh keypair and hands back a downloadable bundle instead."]}):m.source==="bundle-issued"?s.jsx(s.Fragment,{children:"Credentials were issued as a downloadable bundle. drawlatch holds only the public key — rotate to mint a fresh keypair, or revoke to end access."}):s.jsx(s.Fragment,{children:"No credential bundle has been issued from drawlatch for this caller yet. Issue one to hand a callboard instance its identity."})}),s.jsxs("div",{className:"dl-cred-actions",children:[s.jsx("button",{type:"button",className:"dl-cred-btn dl-cred-btn-primary",onClick:()=>d(!0),children:m.source?s.jsxs(s.Fragment,{children:[s.jsx(xf,{size:14}),"Rotate credentials"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ki,{size:14}),"Issue credentials"]})}),m.alias!=="default"&&s.jsxs("button",{type:"button",className:"dl-cred-btn dl-cred-btn-danger",onClick:()=>{C(null),g(!0)},children:[s.jsx(zv,{size:14}),"Revoke"]})]})]})]}),s.jsxs("section",{className:"detail-section",children:[s.jsxs("h2",{className:"section-title",children:["Connections (",w.length,")"]}),w.length===0?s.jsx("p",{className:"detail-note",children:"This caller has no connections enabled."}):s.jsx("div",{className:"data-table-wrap",children:s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Connection"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Required secrets"}),s.jsx("th",{children:"Optional secrets"}),s.jsx("th",{children:"Ingestor"}),s.jsx("th",{className:"num",children:"Instances"})]})}),s.jsx("tbody",{children:w.map(E=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("div",{className:"cell-primary mono",children:E.connectionAlias})}),s.jsx("td",{children:s.jsxs("div",{className:"badge-row",children:[s.jsx(ry,{enabled:E.enabled}),E.isCustom&&s.jsx("span",{className:"tag tag-custom",children:"custom"})]})}),s.jsx("td",{children:s.jsx(Vc,{secrets:E.requiredSecrets,emptyText:"—"})}),s.jsx("td",{children:s.jsx(Vc,{secrets:E.optionalSecrets,emptyText:"—"})}),s.jsx("td",{children:E.hasIngestor?s.jsx("span",{className:"tag",children:"yes"}):s.jsx("span",{className:"cell-muted",children:"—"})}),s.jsx("td",{className:"num",children:E.instances.length})]},E.connectionAlias))})]})})]}),u&&s.jsx(ty,{alias:m.alias,callerConnections:m.connections,availableConnections:[...new Set([...a,...m.connections])],defaultEndpoint:c,isRotation:m.source!==null,onClose:()=>d(!1),onIssued:()=>void v()}),f&&s.jsx(Xi,{title:`Revoke "${m.alias}"?`,confirmLabel:"Revoke",description:s.jsxs(s.Fragment,{children:["This deletes ",s.jsx("code",{children:m.alias})," and its public-key entry, so it can no longer authenticate. Any active sessions are dropped. This cannot be undone."]}),busy:y,error:x,onConfirm:p,onCancel:()=>{y||(g(!1),C(null))}})]})}function or(){return s.jsx(Yn,{to:"/callers",className:"back-link",children:"← Back to callers"})}function ry({enabled:e}){return s.jsx("span",{className:`enabled-badge enabled-${e?"yes":"no"}`,children:e?"enabled":"disabled"})}function Vc({secrets:e,emptyText:t}){return e.length===0?s.jsx("span",{className:"cell-muted",children:t}):s.jsx("ul",{className:"secret-ref-list",children:e.map(n=>s.jsxs("li",{className:`secret-ref-pill mono secret-ref-${n.present?"present":"missing"}`,children:[s.jsx("span",{className:"secret-ref-mark","aria-hidden":"true",children:n.present?"✓":"✗"}),s.jsx("span",{children:n.name})]},n.name))})}const sy=2e3,Bc=80;function ly(){const{daemon:e}=ht(),t=Yi(),[n,r]=h.useState({status:"loading"}),[l,a]=h.useState(()=>Date.now());if(h.useEffect(()=>{if(e!=="up")return;let d=!1,f=null;const g=async()=>{const C=await F.ingestors();if(!d){if(Y(C)){r({status:"error",message:C.error});return}r({status:"ok",ingestors:C})}},y=()=>{f===null&&(f=setInterval(g,sy))},j=()=>{f!==null&&(clearInterval(f),f=null)};g(),document.visibilityState==="visible"&&y();const x=()=>{document.visibilityState==="visible"?(g(),y()):j()};return document.addEventListener("visibilitychange",x),()=>{d=!0,j(),document.removeEventListener("visibilitychange",x)}},[e]),h.useEffect(()=>{let d=null;const f=()=>{d===null&&(d=setInterval(()=>a(Date.now()),1e3))},g=()=>{d!==null&&(clearInterval(d),d=null)};document.visibilityState==="visible"&&f();const y=()=>{document.visibilityState==="visible"?f():g()};return document.addEventListener("visibilitychange",y),()=>{g(),document.removeEventListener("visibilitychange",y)}},[]),e==="down")return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Ingestors"})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"})," to load ingestor status."]})]})]});const i=n.status==="loading",c=n.status==="error",o=n.status==="ok"?n.ingestors:[],u=iy(o);return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Ingestors"}),s.jsxs("div",{className:"subtitle-meta",children:[s.jsx("span",{children:"Live status of websocket / webhook / poll listeners"}),s.jsx("span",{className:"dot-sep",children:"·"}),s.jsx("span",{children:"polling every 2s"})]})]}),n.status==="ok"&&s.jsxs("span",{className:"page-subtitle",children:[o.length," ingestor",o.length===1?"":"s"]})]}),i&&s.jsx("div",{className:"banner banner-loading",children:"Loading ingestors…"}),c&&s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Failed to load ingestors: ",n.message]})]}),n.status==="ok"&&o.length===0&&s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"No active ingestors"}),s.jsx("span",{children:"Ingestors start when a caller opens an MCP session for a connection that has a listener."})]}),n.status==="ok"&&o.length>0&&!t&&s.jsx("div",{className:"data-table-wrap",children:s.jsxs("table",{className:"data-table ingestor-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Caller"}),s.jsx("th",{children:"Connection"}),s.jsx("th",{children:"Instance"}),s.jsx("th",{children:"State"}),s.jsx("th",{className:"num",children:"Buffer"}),s.jsx("th",{children:"Last event"}),s.jsx("th",{children:"Error"})]})}),s.jsx("tbody",{children:u.map(d=>s.jsx(oy,{group:d,now:l},d.caller))})]})}),n.status==="ok"&&o.length>0&&t&&s.jsx("div",{className:"mobile-card-groups",children:u.map(d=>s.jsxs("section",{className:"mobile-card-group",children:[s.jsxs("header",{className:"mobile-card-group-header",children:[s.jsx("span",{className:"mobile-card-group-label",children:"caller"}),s.jsx("span",{className:"mono",children:d.caller}),s.jsxs("span",{className:"mobile-card-group-count",children:[d.rows.length," ingestor",d.rows.length===1?"":"s"]})]}),s.jsx("div",{className:"mobile-card-list",children:d.rows.map(f=>s.jsx(ay,{ing:f,now:l},_f(f)))})]},d.caller))})]})}function ay({ing:e,now:t}){return s.jsxs("article",{className:"mobile-card",children:[s.jsxs("div",{className:"mobile-card-header",children:[s.jsx("div",{className:"mobile-card-title mono",children:e.connection}),s.jsx(Lf,{state:e.state})]}),s.jsxs("div",{className:"mobile-card-meta",children:[s.jsx("span",{className:"tag",children:e.type}),e.instanceId&&s.jsx("span",{className:"mono cell-muted",children:e.instanceId})]}),s.jsxs("dl",{className:"mobile-card-kv",children:[s.jsxs("div",{className:"mobile-card-kv-row",children:[s.jsx("dt",{children:"Buffer"}),s.jsxs("dd",{className:"mono",children:[e.bufferedEvents,s.jsxs("span",{className:"cell-muted",children:[" ","· ",e.totalEventsReceived," total"]})]})]}),s.jsxs("div",{className:"mobile-card-kv-row",children:[s.jsx("dt",{children:"Last event"}),s.jsx("dd",{children:s.jsx(Pf,{iso:e.lastEventAt,now:t})})]})]}),e.error&&s.jsx("div",{className:"mobile-card-error",children:s.jsx(zf,{error:e.error})})]})}function iy(e){const t=new Map;for(const n of e){const r=t.get(n.callerAlias);r?r.push(n):t.set(n.callerAlias,[n])}return[...t.entries()].sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>({caller:n,rows:[...r].sort((l,a)=>{const i=l.connection.localeCompare(a.connection);return i!==0?i:(l.instanceId??"").localeCompare(a.instanceId??"")})}))}function oy({group:e,now:t}){return s.jsxs(s.Fragment,{children:[s.jsx("tr",{className:"ingestor-group-header",children:s.jsxs("th",{colSpan:7,scope:"colgroup",children:[s.jsx("span",{className:"ingestor-group-label",children:"caller"}),s.jsx("span",{className:"mono",children:e.caller}),s.jsxs("span",{className:"ingestor-group-count",children:[e.rows.length," ingestor",e.rows.length===1?"":"s"]})]})}),e.rows.map(n=>s.jsx(cy,{ing:n,now:t},_f(n)))]})}function _f(e){return`${e.callerAlias}::${e.connection}::${e.instanceId??""}`}function cy({ing:e,now:t}){return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:"cell-muted mono",children:e.callerAlias})}),s.jsxs("td",{children:[s.jsx("div",{className:"cell-primary mono",children:e.connection}),s.jsx("div",{className:"cell-secondary",children:s.jsx("span",{className:"tag",children:e.type})})]}),s.jsx("td",{children:e.instanceId?s.jsx("span",{className:"mono",children:e.instanceId}):s.jsx("span",{className:"cell-muted",children:"—"})}),s.jsx("td",{children:s.jsx(Lf,{state:e.state})}),s.jsx("td",{className:"num",children:s.jsx(uy,{buffered:e.bufferedEvents,total:e.totalEventsReceived})}),s.jsx("td",{children:s.jsx(Pf,{iso:e.lastEventAt,now:t})}),s.jsx("td",{children:s.jsx(zf,{error:e.error})})]})}function Lf({state:e}){return s.jsx("span",{className:`ingestor-state ingestor-state-${e}`,children:e})}function uy({buffered:e,total:t}){return s.jsx("span",{className:"mono",title:`${t} total event${t===1?"":"s"} received`,children:e})}function Pf({iso:e,now:t}){if(!e)return s.jsx("span",{className:"cell-muted",children:"never"});const n=Date.parse(e);return Number.isFinite(n)?s.jsx("span",{className:"cell-muted",title:e,children:dy(t-n)}):s.jsx("span",{className:"cell-muted",children:"—"})}function dy(e){if(e<0)return"just now";const t=Math.floor(e/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function zf({error:e}){if(!e)return s.jsx("span",{className:"cell-muted",children:"—"});const t=e.length>Bc?`${e.slice(0,Bc)}…`:e;return s.jsx("span",{className:"ingestor-error",title:e,children:t})}const fy=5e3;function py(){const{daemon:e}=ht(),t=Yi(),[n,r]=h.useState({status:"loading"}),[l,a]=h.useState(()=>Date.now());h.useEffect(()=>{if(e!=="up")return;let u=!1,d=null;const f=async()=>{const x=await F.sessions();if(!u){if(Y(x)){r({status:"error",message:x.error});return}r({status:"ok",sessions:x})}},g=()=>{d===null&&(d=setInterval(f,fy))},y=()=>{d!==null&&(clearInterval(d),d=null)};f(),document.visibilityState==="visible"&&g();const j=()=>{document.visibilityState==="visible"?(f(),g()):y()};return document.addEventListener("visibilitychange",j),()=>{u=!0,y(),document.removeEventListener("visibilitychange",j)}},[e]),h.useEffect(()=>{let u=null;const d=()=>{u===null&&(u=setInterval(()=>a(Date.now()),1e3))},f=()=>{u!==null&&(clearInterval(u),u=null)};document.visibilityState==="visible"&&d();const g=()=>{document.visibilityState==="visible"?d():f()};return document.addEventListener("visibilitychange",g),()=>{f(),document.removeEventListener("visibilitychange",g)}},[]);const i=h.useMemo(()=>n.status!=="ok"?[]:[...n.sessions].sort((u,d)=>d.lastActivity-u.lastActivity),[n]);if(e==="down")return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Sessions"})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"})," to load active sessions."]})]})]});const c=n.status==="loading",o=n.status==="error";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Sessions"}),s.jsxs("div",{className:"subtitle-meta",children:[s.jsx("span",{children:"Active MCP sessions and rate-limit windows"}),s.jsx("span",{className:"dot-sep",children:"·"}),s.jsx("span",{children:"polling every 5s"})]})]}),n.status==="ok"&&s.jsxs("span",{className:"page-subtitle",children:[i.length," session",i.length===1?"":"s"]})]}),c&&s.jsx("div",{className:"banner banner-loading",children:"Loading sessions…"}),o&&s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Failed to load sessions: ",n.message]})]}),n.status==="ok"&&i.length===0&&s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"No active sessions"}),s.jsx("span",{children:"Sessions are created when a caller opens an MCP connection against drawlatch."})]}),n.status==="ok"&&i.length>0&&!t&&s.jsx("div",{className:"data-table-wrap",children:s.jsxs("table",{className:"data-table session-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Session"}),s.jsx("th",{children:"Caller"}),s.jsx("th",{children:"Created"}),s.jsx("th",{children:"Last activity"}),s.jsx("th",{className:"num",children:"Requests"}),s.jsx("th",{children:"Rate-limit window"})]})}),s.jsx("tbody",{children:i.map(u=>s.jsx(vy,{session:u,now:l},u.sessionIdShort))})]})}),n.status==="ok"&&i.length>0&&t&&s.jsx("div",{className:"mobile-card-list",children:i.map(u=>s.jsx(my,{session:u,now:l},u.sessionIdShort))})]})}function hy(e,t=14){if(e.length<=t)return e;const n=Math.ceil((t-1)/2),r=Math.floor((t-1)/2);return`${e.slice(0,n)}…${e.slice(e.length-r)}`}function my({session:e,now:t}){return s.jsxs("article",{className:"mobile-card",children:[s.jsxs("div",{className:"mobile-card-header",children:[s.jsx("div",{className:"mobile-card-title mono",title:e.sessionIdShort,children:hy(e.sessionIdShort)}),s.jsx("span",{className:"mono cell-muted",children:e.callerAlias})]}),s.jsxs("dl",{className:"mobile-card-kv",children:[s.jsxs("div",{className:"mobile-card-kv-row",children:[s.jsx("dt",{children:"Created"}),s.jsx("dd",{children:s.jsx($n,{epochMs:e.createdAt,now:t})})]}),s.jsxs("div",{className:"mobile-card-kv-row",children:[s.jsx("dt",{children:"Last activity"}),s.jsx("dd",{children:s.jsx($n,{epochMs:e.lastActivity,now:t})})]}),s.jsxs("div",{className:"mobile-card-kv-row",children:[s.jsx("dt",{children:"Requests"}),s.jsxs("dd",{className:"mono",children:[e.requestCount,s.jsxs("span",{className:"cell-muted",children:[" ","· ",e.windowRequests," in window"]})]})]}),s.jsxs("div",{className:"mobile-card-kv-row",children:[s.jsx("dt",{children:"Window started"}),s.jsx("dd",{children:s.jsx($n,{epochMs:e.windowStart,now:t})})]})]})]})}function vy({session:e,now:t}){return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:"mono",children:e.sessionIdShort})}),s.jsx("td",{children:s.jsx("span",{className:"cell-muted mono",children:e.callerAlias})}),s.jsx("td",{children:s.jsx($n,{epochMs:e.createdAt,now:t})}),s.jsx("td",{children:s.jsx($n,{epochMs:e.lastActivity,now:t})}),s.jsx("td",{className:"num",children:s.jsx("span",{className:"mono",children:e.requestCount})}),s.jsx("td",{children:s.jsx(gy,{requests:e.windowRequests,windowStart:e.windowStart,now:t})})]})}function gy({requests:e,windowStart:t,now:n}){return s.jsxs("div",{children:[s.jsxs("div",{className:"cell-primary mono",children:[e," request",e===1?"":"s"]}),s.jsxs("div",{className:"cell-secondary",children:["window started ",s.jsx($n,{epochMs:t,now:n})]})]})}function $n({epochMs:e,now:t}){if(!Number.isFinite(e)||e<=0)return s.jsx("span",{className:"cell-muted",children:"—"});const n=new Date(e).toISOString();return s.jsx("span",{className:"cell-muted",title:n,children:yy(t-e)})}function yy(e){if(e<0)return"just now";const t=Math.floor(e/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}const xy=1e4;function jy(){const{daemon:e}=ht(),[t,n]=h.useState({status:"loading"}),[r,l]=h.useState(!1);h.useEffect(()=>{if(e!=="up")return;let u=!1,d=null;const f=async()=>{const x=await F.secrets();if(!u){if(Y(x)){n({status:"error",message:x.error});return}n({status:"ok",secrets:x})}},g=()=>{d===null&&(d=setInterval(f,xy))},y=()=>{d!==null&&(clearInterval(d),d=null)};f(),document.visibilityState==="visible"&&g();const j=()=>{document.visibilityState==="visible"?(f(),g()):y()};return document.addEventListener("visibilitychange",j),()=>{u=!0,y(),document.removeEventListener("visibilitychange",j)}},[e]);const a=h.useMemo(()=>t.status!=="ok"?null:wy(t.secrets),[t]),i=h.useMemo(()=>{if(t.status!=="ok")return null;let u=0,d=0;for(const f of t.secrets)f.required&&(u+=1,f.present&&(d+=1));return{total:u,present:d}},[t]);if(e==="down")return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Secrets"})}),s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Drawlatch daemon is not reachable. Start it with"," ",s.jsx("code",{children:"drawlatch start"})," to load the secrets matrix."]})]})]});const c=t.status==="loading",o=t.status==="error";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Secrets"}),s.jsxs("div",{className:"subtitle-meta",children:[s.jsx("span",{children:"Presence of required and optional secrets per caller"}),s.jsx("span",{className:"dot-sep",children:"·"}),s.jsx("span",{children:"polling every 10s"})]})]}),i&&s.jsxs("span",{className:"page-subtitle",children:[i.present," of ",i.total," required secrets configured"]})]}),t.status==="ok"&&t.secrets.length>0&&s.jsx("div",{className:"secret-matrix-controls",children:s.jsxs("label",{className:"secret-matrix-toggle",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:u=>l(u.target.checked)}),s.jsx("span",{children:"Only show callers with missing required secrets"})]})}),c&&s.jsx("div",{className:"banner banner-loading",children:"Loading secrets…"}),o&&s.jsxs("div",{className:"banner banner-offline",children:[s.jsx("span",{className:"status-dot down","aria-hidden":"true"}),s.jsxs("span",{children:["Failed to load secrets: ",t.message]})]}),t.status==="ok"&&t.secrets.length===0&&s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"No secrets declared"}),s.jsx("span",{children:"No callers have connections that declare required or optional secrets."})]}),t.status==="ok"&&a&&a.length>0&&s.jsx(Ny,{pivot:a,onlyMissing:r})]})}function wy(e){const t=new Map;for(const r of e){const l=t.get(r.connection);l?l.push(r):t.set(r.connection,[r])}const n=[];for(const[r,l]of t){const a=new Map;for(const u of l){const d=a.get(u.name);a.set(u.name,(d??!1)||u.required)}const i=[...a.entries()].map(([u,d])=>({name:u,required:d})).sort((u,d)=>u.required!==d.required?u.required?-1:1:u.name.localeCompare(d.name)),c=new Map;for(const u of l){const d=c.get(u.callerAlias);d?d.push(u):c.set(u.callerAlias,[u])}const o=[];for(const[u,d]of c){const f=new Map;for(const y of d)f.set(y.name,{required:y.required,present:y.present});let g=!1;for(const y of i){const j=f.get(y.name);if(y.required&&(!j||!j.present)){g=!0;break}}o.push({callerAlias:u,cells:f,hasMissingRequired:g})}o.sort((u,d)=>u.callerAlias.localeCompare(d.callerAlias)),n.push({connection:r,columns:i,rows:o})}return n.sort((r,l)=>r.connection.localeCompare(l.connection)),n}function Ny({pivot:e,onlyMissing:t}){const n=t?e.map(r=>({...r,rows:r.rows.filter(l=>l.hasMissingRequired)})).filter(r=>r.rows.length>0):e;return n.length===0?s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"All required secrets present"}),s.jsx("span",{children:"Every caller has every required secret configured."})]}):s.jsx("div",{className:"secret-matrix",children:n.map(r=>s.jsx(ky,{group:r},r.connection))})}function ky({group:e}){return s.jsxs("section",{className:"secret-matrix-section",children:[s.jsxs("header",{className:"secret-matrix-section-header",children:[s.jsx("span",{className:"secret-matrix-section-label",children:"connection"}),s.jsx("span",{className:"mono",children:e.connection}),s.jsxs("span",{className:"secret-matrix-section-meta",children:[e.rows.length," caller",e.rows.length===1?"":"s"," · ",e.columns.length," secret",e.columns.length===1?"":"s"]})]}),s.jsx("div",{className:"secret-matrix-scroll",children:s.jsx("div",{className:"data-table-wrap secret-matrix-wrap",children:s.jsxs("table",{className:"data-table secret-matrix-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"secret-matrix-caller-col",children:"Caller"}),e.columns.map(t=>s.jsxs("th",{className:`secret-matrix-col ${t.required?"secret-matrix-col-required":"secret-matrix-col-optional"}`,title:t.required?"required secret":"optional secret",children:[s.jsx("span",{className:"mono",children:t.name}),t.required&&s.jsx("span",{className:"secret-matrix-required-mark","aria-label":"required",children:"*"})]},t.name))]})}),s.jsx("tbody",{children:e.rows.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"secret-matrix-caller-col",children:s.jsx("span",{className:"mono",children:t.callerAlias})}),e.columns.map(n=>{const r=t.cells.get(n.name);return s.jsx("td",{className:"secret-matrix-cell",children:s.jsx(Sy,{required:n.required,cell:r})},n.name)})]},t.callerAlias))})]})})})]})}function Sy({required:e,cell:t}){return t?t.present?s.jsx("span",{className:`secret-matrix-mark ${e?"secret-matrix-mark-required-present":"secret-matrix-mark-optional-present"}`,"aria-label":"present",children:"✓"}):s.jsx("span",{className:`secret-matrix-mark ${e?"secret-matrix-mark-required-missing":"secret-matrix-mark-optional-missing"}`,"aria-label":"missing",children:"✗"}):s.jsx("span",{className:"cell-muted","aria-label":"not declared",children:"—"})}const ps=8;function Cy(){const e=Gn(),[t,n]=h.useState(""),[r,l]=h.useState(""),[a,i]=h.useState(""),[c,o]=h.useState(""),[u,d]=h.useState(!1),[f,g]=h.useState(!1);function y(){return t?r.length<ps?`New password must be at least ${ps} characters.`:r!==a?"New password and confirmation do not match.":r===t?"New password must differ from the current password.":null:"Enter your current password."}async function j(x){if(x.preventDefault(),f)return;o(""),d(!1);const C=y();if(C){o(C);return}g(!0);try{await _g(t,r),n(""),l(""),i(""),d(!0),g(!1),setTimeout(()=>{e("/")},1500)}catch(v){o(v.message||"Could not change password"),g(!1)}}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:"Change password"})}),s.jsx("div",{className:"subtitle-meta auth-page-subtitle",children:"Update the password for this drawlatch-ui daemon. Other browsers will be signed out."}),s.jsxs("form",{onSubmit:j,className:"auth-form-card",noValidate:!0,children:[s.jsx("label",{className:"auth-label",htmlFor:"current-password",children:"Current password"}),s.jsx("input",{id:"current-password",type:"password",autoComplete:"current-password",value:t,onChange:x=>n(x.target.value),disabled:f,className:"auth-input"}),s.jsx("label",{className:"auth-label",htmlFor:"new-password",children:"New password"}),s.jsx("input",{id:"new-password",type:"password",autoComplete:"new-password",value:r,onChange:x=>l(x.target.value),disabled:f,minLength:ps,className:"auth-input"}),s.jsxs("div",{className:"auth-hint",children:["Minimum ",ps," characters."]}),s.jsx("label",{className:"auth-label",htmlFor:"confirm-password",children:"Confirm new password"}),s.jsx("input",{id:"confirm-password",type:"password",autoComplete:"new-password",value:a,onChange:x=>i(x.target.value),disabled:f,className:"auth-input"}),c&&s.jsx("div",{className:"auth-error",role:"alert",children:c}),u&&s.jsx("div",{className:"auth-success",role:"status",children:"Password updated."}),s.jsx("div",{className:"auth-actions",children:s.jsx("button",{type:"submit",className:"auth-submit",disabled:f||!t||!r||!a,children:f?"Updating…":"Update password"})})]})]})}function Ey({title:e}){return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"page-header",children:s.jsx("h1",{className:"page-title",children:e})}),s.jsxs("div",{className:"placeholder",children:[s.jsx("span",{className:"placeholder-title",children:"Coming soon"}),s.jsx("span",{children:"This view ships in a follow-up phase."})]})]})}function _y({onLogin:e,serverError:t}){const[n,r]=h.useState(""),[l,a]=h.useState(""),[i,c]=h.useState(!1),o=h.useRef(null),u=!!t;h.useEffect(()=>{var f;(f=o.current)==null||f.focus()},[]);async function d(f){var g;if(f.preventDefault(),!(i||u)){a(""),c(!0);try{await Cg(n),r(""),e()}catch(y){a(y.message||"Login failed"),r(""),c(!1),(g=o.current)==null||g.focus()}}}return s.jsx("div",{className:"auth-screen",children:s.jsxs("form",{onSubmit:d,className:"auth-card",noValidate:!0,children:[s.jsxs("div",{className:"auth-brand",children:[s.jsx("span",{className:"sidebar-brand-mark","aria-hidden":"true"}),s.jsx("span",{children:"drawlatch"})]}),s.jsx("h1",{className:"auth-title",children:"Sign in"}),t&&s.jsx("div",{className:"auth-banner auth-banner-error",role:"alert",children:t}),s.jsx("label",{className:"auth-label",htmlFor:"login-password",children:"Password"}),s.jsx("input",{id:"login-password",ref:o,type:"password",autoComplete:"current-password",value:n,onChange:f=>r(f.target.value),disabled:u||i,className:"auth-input"}),l&&s.jsx("div",{className:"auth-error",role:"alert",children:l}),s.jsx("button",{type:"submit",className:"auth-submit",disabled:u||i||!n,children:i?"Signing in…":"Sign in"})]})})}function Ly(){const[e,t]=h.useState(null),[n,r]=h.useState(""),l=Gn(),a=h.useCallback(()=>{Sg().then(i=>{t(i.authenticated),r(i.error??"")})},[]);return h.useEffect(()=>{a()},[a]),h.useEffect(()=>kg(()=>{t(!1),l("/",{replace:!0})}),[l]),e===null?s.jsx("div",{className:"auth-splash",children:"Loading…"}):e?s.jsx(Pg,{children:s.jsx(av,{children:s.jsxs(Fe,{element:s.jsx(Rg,{onLogout:()=>t(!1)}),children:[s.jsx(Fe,{index:!0,element:s.jsx(Ig,{})}),s.jsx(Fe,{path:"connections",element:s.jsx(Hg,{})}),s.jsx(Fe,{path:"connections/:alias",element:s.jsx(Kg,{})}),s.jsx(Fe,{path:"callers",element:s.jsx(ey,{})}),s.jsx(Fe,{path:"callers/:alias",element:s.jsx(ny,{})}),s.jsx(Fe,{path:"ingestors",element:s.jsx(ly,{})}),s.jsx(Fe,{path:"sessions",element:s.jsx(py,{})}),s.jsx(Fe,{path:"secrets",element:s.jsx(jy,{})}),s.jsx(Fe,{path:"logs",element:s.jsx(Jg,{})}),s.jsx(Fe,{path:"settings/password",element:s.jsx(Cy,{})}),s.jsx(Fe,{path:"*",element:s.jsx(Ey,{title:"Not found"})})]})})}):s.jsx(_y,{onLogin:a,serverError:n||void 0})}ea.createRoot(document.getElementById("root")).render(s.jsx(eu.StrictMode,{children:s.jsx(hv,{children:s.jsx(Ly,{})})}));
|