@letra-ai/cli 0.5.3 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-6HSUVCTR.js +363 -0
- package/dist/chunk-BKAUN5QH.js +300 -0
- package/dist/chunk-DMOLJWWW.js +3321 -0
- package/dist/chunk-EDD55PWL.js +119 -0
- package/dist/chunk-H64RC3YS.js +254 -0
- package/dist/chunk-JMIC5NKB.js +235 -0
- package/dist/chunk-L6YKDTAQ.js +275 -0
- package/dist/chunk-MJ2QXNH6.js +130 -0
- package/dist/chunk-OIHMDOIN.js +1326 -0
- package/dist/chunk-PDX44BCA.js +11 -0
- package/dist/chunk-URUC6ZZP.js +4781 -0
- package/dist/client/assets/index-EyRsq1SH.css +1 -0
- package/dist/client/assets/index-WfKR7Xp6.js +232 -0
- package/dist/client/favicon.svg +16 -4
- package/dist/client/index.html +25 -20
- package/dist/fallback-MQLGS4KL.js +46 -0
- package/dist/flow-serve-G5MSSB3G.js +18 -0
- package/dist/focus-sync-3D3XWCTI.js +17 -0
- package/dist/generate-UPFERQMD.js +20 -0
- package/dist/harness/default/v0.1.0/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.0/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.0/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.0/gates/human-approved-code.yaml +8 -0
- package/dist/harness/default/v0.1.0/gates/human-approved-spec.yaml +8 -0
- package/dist/harness/default/v0.1.0/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.0/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.0/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.0/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.0/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.0/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.0/roles/security.yaml +8 -0
- package/dist/harness/default/v0.1.1/flows/flow-main.yaml +61 -0
- package/dist/harness/default/v0.1.1/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.1/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.1/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.1/gates/human-approved-code.yaml +8 -0
- package/dist/harness/default/v0.1.1/gates/human-approved-spec.yaml +8 -0
- package/dist/harness/default/v0.1.1/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.1/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.1/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.1/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.1/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.1/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.1/roles/security.yaml +8 -0
- package/dist/harness/default/v0.1.2/flows/flow-main.yaml +86 -0
- package/dist/harness/default/v0.1.2/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.2/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.2/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.2/gates/human-approved-code.yaml +8 -0
- package/dist/harness/default/v0.1.2/gates/human-approved-spec.yaml +8 -0
- package/dist/harness/default/v0.1.2/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.2/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.2/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.2/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.2/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.2/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.2/roles/security.yaml +8 -0
- package/dist/harness/default/v0.1.3/flows/flow-main.yaml +90 -0
- package/dist/harness/default/v0.1.3/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.3/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.3/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.3/gates/human-approved-code.yaml +9 -0
- package/dist/harness/default/v0.1.3/gates/human-approved-spec.yaml +9 -0
- package/dist/harness/default/v0.1.3/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.3/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.3/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.3/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.3/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.3/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.3/roles/security.yaml +8 -0
- package/dist/harness/default/v0.2.0/executors/registry.yaml +51 -0
- package/dist/harness/default/v0.2.0/flows/flow-main.yaml +249 -0
- package/dist/harness/default/v0.2.0/gates/code-reviewed.yaml +7 -0
- package/dist/harness/default/v0.2.0/gates/human-approved.yaml +10 -0
- package/dist/harness/default/v0.2.0/gates/security-clear.yaml +7 -0
- package/dist/harness/default/v0.2.0/gates/spec-approved.yaml +10 -0
- package/dist/harness/default/v0.2.0/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.2.0/roles/analyst.yaml +16 -0
- package/dist/harness/default/v0.2.0/roles/implementer.yaml +17 -0
- package/dist/harness/default/v0.2.0/roles/reviewer.yaml +17 -0
- package/dist/harness/default/v0.2.0/roles/security.yaml +17 -0
- package/dist/health-record-YDVXEVLR.js +21 -0
- package/dist/index.js +1951 -2530
- package/dist/init-wizard-NODBBNKO.js +178 -0
- package/dist/push-VJRSQGUD.js +116 -0
- package/dist/registry-6VPIA3EG.js +18 -0
- package/dist/server-P6GKRWDX.js +423 -0
- package/dist/service-2JN2KI4D.js +29 -0
- package/dist/session-log-WTQ5JBEN.js +21 -0
- package/dist/sitrep-OKNZJICV.js +16 -0
- package/package.json +37 -28
- package/dist/chunk-56GTTLC4.js +0 -1322
- package/dist/chunk-QWT5M4XU.js +0 -643
- package/dist/client/assets/index-CuLfFw4K.js +0 -85
- package/dist/client/assets/index-iyLqZcWx.css +0 -1
- package/dist/generate-BF5R5GGA.js +0 -7
- package/dist/sitrep-SI6ZFIAM.js +0 -10
- package/tsup.config.ts +0 -11
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
var bg=Object.defineProperty;var yg=(s,o,c)=>o in s?bg(s,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):s[o]=c;var Ha=(s,o,c)=>yg(s,typeof o!="symbol"?o+"":o,c);function jg(s,o){for(var c=0;c<o.length;c++){const u=o[c];if(typeof u!="string"&&!Array.isArray(u)){for(const d in u)if(d!=="default"&&!(d in s)){const m=Object.getOwnPropertyDescriptor(u,d);m&&Object.defineProperty(s,d,m.get?m:{enumerable:!0,get:()=>u[d]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function c(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(d){if(d.ep)return;d.ep=!0;const m=c(d);fetch(d.href,m)}})();function Ng(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Wc={exports:{}},Js={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Eh;function Sg(){if(Eh)return Js;Eh=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,d,m){var h=null;if(m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),"key"in d){m={};for(var x in d)x!=="key"&&(m[x]=d[x])}else m=d;return d=m.ref,{$$typeof:s,type:u,key:h,ref:d!==void 0?d:null,props:m}}return Js.Fragment=o,Js.jsx=c,Js.jsxs=c,Js}var kh;function wg(){return kh||(kh=1,Wc.exports=Sg()),Wc.exports}var l=wg(),Fc={exports:{}},He={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Th;function Cg(){if(Th)return He;Th=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),A=Symbol.iterator;function w(b){return b===null||typeof b!="object"?null:(b=A&&b[A]||b["@@iterator"],typeof b=="function"?b:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,te={};function P(b,D,Y){this.props=b,this.context=D,this.refs=te,this.updater=Y||T}P.prototype.isReactComponent={},P.prototype.setState=function(b,D){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,D,"setState")},P.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function ie(){}ie.prototype=P.prototype;function pe(b,D,Y){this.props=b,this.context=D,this.refs=te,this.updater=Y||T}var G=pe.prototype=new ie;G.constructor=pe,V(G,P.prototype),G.isPureReactComponent=!0;var ce=Array.isArray;function de(){}var ee={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function fe(b,D,Y){var Q=Y.ref;return{$$typeof:s,type:b,key:D,ref:Q!==void 0?Q:null,props:Y}}function Ee(b,D){return fe(b.type,D,b.props)}function xe(b){return typeof b=="object"&&b!==null&&b.$$typeof===s}function _(b){var D={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(Y){return D[Y]})}var se=/\/+/g;function oe(b,D){return typeof b=="object"&&b!==null&&b.key!=null?_(""+b.key):D.toString(36)}function ye(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(de,de):(b.status="pending",b.then(function(D){b.status==="pending"&&(b.status="fulfilled",b.value=D)},function(D){b.status==="pending"&&(b.status="rejected",b.reason=D)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function E(b,D,Y,Q,le){var B=typeof b;(B==="undefined"||B==="boolean")&&(b=null);var O=!1;if(b===null)O=!0;else switch(B){case"bigint":case"string":case"number":O=!0;break;case"object":switch(b.$$typeof){case s:case o:O=!0;break;case N:return O=b._init,E(O(b._payload),D,Y,Q,le)}}if(O)return le=le(b),O=Q===""?"."+oe(b,0):Q,ce(le)?(Y="",O!=null&&(Y=O.replace(se,"$&/")+"/"),E(le,D,Y,"",function(Oe){return Oe})):le!=null&&(xe(le)&&(le=Ee(le,Y+(le.key==null||b&&b.key===le.key?"":(""+le.key).replace(se,"$&/")+"/")+O)),D.push(le)),1;O=0;var Z=Q===""?".":Q+":";if(ce(b))for(var re=0;re<b.length;re++)Q=b[re],B=Z+oe(Q,re),O+=E(Q,D,Y,B,le);else if(re=w(b),typeof re=="function")for(b=re.call(b),re=0;!(Q=b.next()).done;)Q=Q.value,B=Z+oe(Q,re++),O+=E(Q,D,Y,B,le);else if(B==="object"){if(typeof b.then=="function")return E(ye(b),D,Y,Q,le);throw D=String(b),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return O}function $(b,D,Y){if(b==null)return b;var Q=[],le=0;return E(b,Q,"","",function(B){return D.call(Y,B,le++)}),Q}function me(b){if(b._status===-1){var D=b._result;D=D(),D.then(function(Y){(b._status===0||b._status===-1)&&(b._status=1,b._result=Y)},function(Y){(b._status===0||b._status===-1)&&(b._status=2,b._result=Y)}),b._status===-1&&(b._status=0,b._result=D)}if(b._status===1)return b._result.default;throw b._result}var ue=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},k={map:$,forEach:function(b,D,Y){$(b,function(){D.apply(this,arguments)},Y)},count:function(b){var D=0;return $(b,function(){D++}),D},toArray:function(b){return $(b,function(D){return D})||[]},only:function(b){if(!xe(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return He.Activity=j,He.Children=k,He.Component=P,He.Fragment=c,He.Profiler=d,He.PureComponent=pe,He.StrictMode=u,He.Suspense=y,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ee,He.__COMPILER_RUNTIME={__proto__:null,c:function(b){return ee.H.useMemoCache(b)}},He.cache=function(b){return function(){return b.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(b,D,Y){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var Q=V({},b.props),le=b.key;if(D!=null)for(B in D.key!==void 0&&(le=""+D.key),D)!U.call(D,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&D.ref===void 0||(Q[B]=D[B]);var B=arguments.length-2;if(B===1)Q.children=Y;else if(1<B){for(var O=Array(B),Z=0;Z<B;Z++)O[Z]=arguments[Z+2];Q.children=O}return fe(b.type,le,Q)},He.createContext=function(b){return b={$$typeof:h,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:m,_context:b},b},He.createElement=function(b,D,Y){var Q,le={},B=null;if(D!=null)for(Q in D.key!==void 0&&(B=""+D.key),D)U.call(D,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(le[Q]=D[Q]);var O=arguments.length-2;if(O===1)le.children=Y;else if(1<O){for(var Z=Array(O),re=0;re<O;re++)Z[re]=arguments[re+2];le.children=Z}if(b&&b.defaultProps)for(Q in O=b.defaultProps,O)le[Q]===void 0&&(le[Q]=O[Q]);return fe(b,B,le)},He.createRef=function(){return{current:null}},He.forwardRef=function(b){return{$$typeof:x,render:b}},He.isValidElement=xe,He.lazy=function(b){return{$$typeof:N,_payload:{_status:-1,_result:b},_init:me}},He.memo=function(b,D){return{$$typeof:g,type:b,compare:D===void 0?null:D}},He.startTransition=function(b){var D=ee.T,Y={};ee.T=Y;try{var Q=b(),le=ee.S;le!==null&&le(Y,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(de,ue)}catch(B){ue(B)}finally{D!==null&&Y.types!==null&&(D.types=Y.types),ee.T=D}},He.unstable_useCacheRefresh=function(){return ee.H.useCacheRefresh()},He.use=function(b){return ee.H.use(b)},He.useActionState=function(b,D,Y){return ee.H.useActionState(b,D,Y)},He.useCallback=function(b,D){return ee.H.useCallback(b,D)},He.useContext=function(b){return ee.H.useContext(b)},He.useDebugValue=function(){},He.useDeferredValue=function(b,D){return ee.H.useDeferredValue(b,D)},He.useEffect=function(b,D){return ee.H.useEffect(b,D)},He.useEffectEvent=function(b){return ee.H.useEffectEvent(b)},He.useId=function(){return ee.H.useId()},He.useImperativeHandle=function(b,D,Y){return ee.H.useImperativeHandle(b,D,Y)},He.useInsertionEffect=function(b,D){return ee.H.useInsertionEffect(b,D)},He.useLayoutEffect=function(b,D){return ee.H.useLayoutEffect(b,D)},He.useMemo=function(b,D){return ee.H.useMemo(b,D)},He.useOptimistic=function(b,D){return ee.H.useOptimistic(b,D)},He.useReducer=function(b,D,Y){return ee.H.useReducer(b,D,Y)},He.useRef=function(b){return ee.H.useRef(b)},He.useState=function(b){return ee.H.useState(b)},He.useSyncExternalStore=function(b,D,Y){return ee.H.useSyncExternalStore(b,D,Y)},He.useTransition=function(){return ee.H.useTransition()},He.version="19.2.7",He}var Mh;function yu(){return Mh||(Mh=1,Fc.exports=Cg()),Fc.exports}var v=yu();const zg=Ng(v),Ag=jg({__proto__:null,default:zg},[v]);var Ic={exports:{}},Ws={},Pc={exports:{}},eu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Dh;function Eg(){return Dh||(Dh=1,(function(s){function o(E,$){var me=E.length;E.push($);e:for(;0<me;){var ue=me-1>>>1,k=E[ue];if(0<d(k,$))E[ue]=$,E[me]=k,me=ue;else break e}}function c(E){return E.length===0?null:E[0]}function u(E){if(E.length===0)return null;var $=E[0],me=E.pop();if(me!==$){E[0]=me;e:for(var ue=0,k=E.length,b=k>>>1;ue<b;){var D=2*(ue+1)-1,Y=E[D],Q=D+1,le=E[Q];if(0>d(Y,me))Q<k&&0>d(le,Y)?(E[ue]=le,E[Q]=me,ue=Q):(E[ue]=Y,E[D]=me,ue=D);else if(Q<k&&0>d(le,me))E[ue]=le,E[Q]=me,ue=Q;else break e}}return $}function d(E,$){var me=E.sortIndex-$.sortIndex;return me!==0?me:E.id-$.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var h=Date,x=h.now();s.unstable_now=function(){return h.now()-x}}var y=[],g=[],N=1,j=null,A=3,w=!1,T=!1,V=!1,te=!1,P=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,pe=typeof setImmediate<"u"?setImmediate:null;function G(E){for(var $=c(g);$!==null;){if($.callback===null)u(g);else if($.startTime<=E)u(g),$.sortIndex=$.expirationTime,o(y,$);else break;$=c(g)}}function ce(E){if(V=!1,G(E),!T)if(c(y)!==null)T=!0,de||(de=!0,_());else{var $=c(g);$!==null&&ye(ce,$.startTime-E)}}var de=!1,ee=-1,U=5,fe=-1;function Ee(){return te?!0:!(s.unstable_now()-fe<U)}function xe(){if(te=!1,de){var E=s.unstable_now();fe=E;var $=!0;try{e:{T=!1,V&&(V=!1,ie(ee),ee=-1),w=!0;var me=A;try{t:{for(G(E),j=c(y);j!==null&&!(j.expirationTime>E&&Ee());){var ue=j.callback;if(typeof ue=="function"){j.callback=null,A=j.priorityLevel;var k=ue(j.expirationTime<=E);if(E=s.unstable_now(),typeof k=="function"){j.callback=k,G(E),$=!0;break t}j===c(y)&&u(y),G(E)}else u(y);j=c(y)}if(j!==null)$=!0;else{var b=c(g);b!==null&&ye(ce,b.startTime-E),$=!1}}break e}finally{j=null,A=me,w=!1}$=void 0}}finally{$?_():de=!1}}}var _;if(typeof pe=="function")_=function(){pe(xe)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,oe=se.port2;se.port1.onmessage=xe,_=function(){oe.postMessage(null)}}else _=function(){P(xe,0)};function ye(E,$){ee=P(function(){E(s.unstable_now())},$)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return A},s.unstable_next=function(E){switch(A){case 1:case 2:case 3:var $=3;break;default:$=A}var me=A;A=$;try{return E()}finally{A=me}},s.unstable_requestPaint=function(){te=!0},s.unstable_runWithPriority=function(E,$){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var me=A;A=E;try{return $()}finally{A=me}},s.unstable_scheduleCallback=function(E,$,me){var ue=s.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?ue+me:ue):me=ue,E){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=me+k,E={id:N++,callback:$,priorityLevel:E,startTime:me,expirationTime:k,sortIndex:-1},me>ue?(E.sortIndex=me,o(g,E),c(y)===null&&E===c(g)&&(V?(ie(ee),ee=-1):V=!0,ye(ce,me-ue))):(E.sortIndex=k,o(y,E),T||w||(T=!0,de||(de=!0,_()))),E},s.unstable_shouldYield=Ee,s.unstable_wrapCallback=function(E){var $=A;return function(){var me=A;A=$;try{return E.apply(this,arguments)}finally{A=me}}}})(eu)),eu}var Oh;function kg(){return Oh||(Oh=1,Pc.exports=Eg()),Pc.exports}var tu={exports:{}},Qt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var _h;function Tg(){if(_h)return Qt;_h=1;var s=yu();function o(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)g+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var u={d:{f:c,r:function(){throw Error(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(y,g,N){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:y,containerInfo:g,implementation:N}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Qt.createPortal=function(y,g){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(o(299));return m(y,g,null,N)},Qt.flushSync=function(y){var g=h.T,N=u.p;try{if(h.T=null,u.p=2,y)return y()}finally{h.T=g,u.p=N,u.d.f()}},Qt.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(y,g))},Qt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},Qt.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var N=g.as,j=x(N,g.crossOrigin),A=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;N==="style"?u.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:A,fetchPriority:w}):N==="script"&&u.d.X(y,{crossOrigin:j,integrity:A,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Qt.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var N=x(g.as,g.crossOrigin);u.d.M(y,{crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(y)},Qt.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var N=g.as,j=x(N,g.crossOrigin);u.d.L(y,N,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Qt.preloadModule=function(y,g){if(typeof y=="string")if(g){var N=x(g.as,g.crossOrigin);u.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(y)},Qt.requestFormReset=function(y){u.d.r(y)},Qt.unstable_batchedUpdates=function(y,g){return y(g)},Qt.useFormState=function(y,g,N){return h.H.useFormState(y,g,N)},Qt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Qt.version="19.2.7",Qt}var Rh;function bp(){if(Rh)return tu.exports;Rh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),tu.exports=Tg(),tu.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Lh;function Mg(){if(Lh)return Ws;Lh=1;var s=kg(),o=yu(),c=bp();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(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 x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(m(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var i=r.alternate;if(i===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===a)return y(r),e;if(i===n)return y(r),t;i=i.sibling}throw Error(u(188))}if(a.return!==n.return)a=r,n=i;else{for(var f=!1,p=r.child;p;){if(p===a){f=!0,a=r,n=i;break}if(p===n){f=!0,n=r,a=i;break}p=p.sibling}if(!f){for(p=i.child;p;){if(p===a){f=!0,a=i,n=r;break}if(p===n){f=!0,n=i,a=r;break}p=p.sibling}if(!f)throw Error(u(189))}}if(a.alternate!==n)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,A=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),pe=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),Ee=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function _(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case P:return"Profiler";case te:return"StrictMode";case ce:return"Suspense";case de:return"SuspenseList";case fe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case pe:return e.displayName||"Context";case ie:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var ye=Array.isArray,E=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},ue=[],k=-1;function b(e){return{current:e}}function D(e){0>k||(e.current=ue[k],ue[k]=null,k--)}function Y(e,t){k++,ue[k]=e.current,e.current=t}var Q=b(null),le=b(null),B=b(null),O=b(null);function Z(e,t){switch(Y(B,t),Y(le,e),Y(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fm(t),e=Im(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(Q),Y(Q,e)}function re(){D(Q),D(le),D(B)}function Oe(e){e.memoizedState!==null&&Y(O,e);var t=Q.current,a=Im(t,e.type);t!==a&&(Y(le,e),Y(Q,a))}function ve(e){le.current===e&&(D(Q),D(le)),O.current===e&&(D(O),Xs._currentValue=me)}var Se,ze;function X(e){if(Se===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||"",ze=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Se+e+ze}var we=!1;function _e(e,t){if(!e||we)return"";we=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(q){var H=q}Reflect.construct(e,[],I)}else{try{I.call()}catch(q){H=q}e.call(I.prototype)}}else{try{throw Error()}catch(q){H=q}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(q){if(q&&H&&typeof q.stack=="string")return[q.stack,H.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),f=i[0],p=i[1];if(f&&p){var S=f.split(`
|
|
44
|
+
`),L=p.split(`
|
|
45
|
+
`);for(r=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;r<L.length&&!L[r].includes("DetermineComponentFrameRoot");)r++;if(n===S.length||r===L.length)for(n=S.length-1,r=L.length-1;1<=n&&0<=r&&S[n]!==L[r];)r--;for(;1<=n&&0<=r;n--,r--)if(S[n]!==L[r]){if(n!==1||r!==1)do if(n--,r--,0>r||S[n]!==L[r]){var K=`
|
|
46
|
+
`+S[n].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=n&&0<=r);break}}}finally{we=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?X(a):""}function _t(e,t){switch(e.tag){case 26:case 27:case 5:return X(e.type);case 16:return X("Lazy");case 13:return e.child!==t&&t!==null?X("Suspense Fallback"):X("Suspense");case 19:return X("SuspenseList");case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return X("Activity");default:return""}}function ft(e){try{var t="",a=null;do t+=_t(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var Me=Object.prototype.hasOwnProperty,Pe=s.unstable_scheduleCallback,mt=s.unstable_cancelCallback,Le=s.unstable_shouldYield,kt=s.unstable_requestPaint,et=s.unstable_now,Ma=s.unstable_getCurrentPriorityLevel,ul=s.unstable_ImmediatePriority,Ul=s.unstable_UserBlockingPriority,Zt=s.unstable_NormalPriority,J=s.unstable_LowPriority,Te=s.unstable_IdlePriority,Ue=s.log,rt=s.unstable_setDisableYieldValue,bt=null,pt=null;function Rt(e){if(typeof Ue=="function"&&rt(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(bt,e)}catch{}}var Tt=Math.clz32?Math.clz32:$t,da=Math.log,Kt=Math.LN2;function $t(e){return e>>>=0,e===0?32:31-(da(e)/Kt|0)|0}var Ht=256,wa=262144,fn=4194304;function Ba(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mn(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var p=n&134217727;return p!==0?(n=p&~i,n!==0?r=Ba(n):(f&=p,f!==0?r=Ba(f):a||(a=p&~e,a!==0&&(r=Ba(a))))):(p=n&~i,p!==0?r=Ba(p):f!==0?r=Ba(f):a||(a=n&~e,a!==0&&(r=Ba(a)))),r===0?0:t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:r}function Bl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qi(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hn(){var e=fn;return fn<<=1,(fn&62914560)===0&&(fn=4194304),e}function ss(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ql(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Gi(e,t,a,n,r,i){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var p=e.entanglements,S=e.expirationTimes,L=e.hiddenUpdates;for(a=f&~a;0<a;){var K=31-Tt(a),I=1<<K;p[K]=0,S[K]=-1;var H=L[K];if(H!==null)for(L[K]=null,K=0;K<H.length;K++){var q=H[K];q!==null&&(q.lane&=-536870913)}a&=~I}n!==0&&rs(e,n,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(f&~t))}function rs(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Tt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function dr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Tt(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function fr(e,t){var a=t&-t;return a=(a&42)!==0?1:is(a),(a&(e.suspendedLanes|t))!==0?0:a}function is(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function mr(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:jh(e.type))}function hr(e,t){var a=$.p;try{return $.p=e,t()}finally{$.p=a}}var Da=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Da,Vt="__reactProps$"+Da,dl="__reactContainer$"+Da,Gl="__reactEvents$"+Da,pr="__reactListeners$"+Da,ne="__reactHandles$"+Da,ae="__reactResources$"+Da,ge="__reactMarker$"+Da;function Re(e){delete e[Mt],delete e[Vt],delete e[Gl],delete e[pr],delete e[ne]}function Ge(e){var t=e[Mt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[dl]||a[Mt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=sh(e);e!==null;){if(a=e[Mt])return a;e=sh(e)}return t}e=a,a=e.parentNode}return null}function Ve(e){if(e=e[Mt]||e[dl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Qe(e){var t=e[ae];return t||(t=e[ae]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[ge]=!0}var Ca=new Set,xn={};function Vl(e,t){vn(e,t),vn(e+"Capture",t)}function vn(e,t){for(xn[e]=t,e=0;e<t.length;e++)Ca.add(t[e])}var ux=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),qu={},Gu={};function dx(e){return Me.call(Gu,e)?!0:Me.call(qu,e)?!1:ux.test(e)?Gu[e]=!0:(qu[e]=!0,!1)}function xr(e,t,a){if(dx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function vr(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function qa(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fx(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(f){a=""+f,i.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vi(e){if(!e._valueTracker){var t=Vu(e)?"checked":"value";e._valueTracker=fx(e,t,""+e[t])}}function Yu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Vu(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function gr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var mx=/[\n"\\]/g;function ma(e){return e.replace(mx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yi(e,t,a,n,r,i,f,p){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fa(t)):e.value!==""+fa(t)&&(e.value=""+fa(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Qi(e,f,fa(t)):a!=null?Qi(e,f,fa(a)):n!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+fa(p):e.removeAttribute("name")}function Qu(e,t,a,n,r,i,f,p){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Vi(e);return}a=a!=null?""+fa(a):"",t=t!=null?""+fa(t):a,p||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=p?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Vi(e)}function Qi(e,t,a){t==="number"&&gr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function gn(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+fa(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Xu(e,t,a){if(t!=null&&(t=""+fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+fa(a):""}function Zu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(u(92));if(ye(n)){if(1<n.length)throw Error(u(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=fa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Vi(e)}function bn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var hx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ku(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||hx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function $u(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&Ku(e,r,n)}else for(var i in t)t.hasOwnProperty(i)&&Ku(e,i,t[i])}function Xi(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var px=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function br(e){return xx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ga(){}var Zi=null;function Ki(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,jn=null;function Ju(e){var t=Ve(e);if(t&&(e=t.stateNode)){var a=e[Vt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ma(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Vt]||null;if(!r)throw Error(u(90));Yi(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Yu(n)}break e;case"textarea":Xu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&gn(e,!!a.multiple,t,!1)}}}var $i=!1;function Wu(e,t,a){if($i)return e(t,a);$i=!0;try{var n=e(t);return n}finally{if($i=!1,(yn!==null||jn!==null)&&(ri(),yn&&(t=yn,e=jn,jn=yn=null,Ju(t),e)))for(t=0;t<e.length;t++)Ju(e[t])}}function os(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Vt]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var Va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ji=!1;if(Va)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){Ji=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{Ji=!1}var fl=null,Wi=null,yr=null;function Fu(){if(yr)return yr;var e,t=Wi,a=t.length,n,r="value"in fl?fl.value:fl.textContent,i=r.length;for(e=0;e<a&&t[e]===r[e];e++);var f=a-e;for(n=1;n<=f&&t[a-n]===r[i-n];n++);return yr=r.slice(e,1<n?1-n:void 0)}function jr(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 Nr(){return!0}function Iu(){return!1}function Jt(e){function t(a,n,r,i,f){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=f,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(a=e[p],this[p]=a?a(i):i[p]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Nr:Iu,this.isPropagationStopped=Iu,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nr)},persist:function(){},isPersistent:Nr}),t}var Yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sr=Jt(Yl),us=j({},Yl,{view:0,detail:0}),vx=Jt(us),Fi,Ii,ds,wr=j({},us,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eo,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!==ds&&(ds&&e.type==="mousemove"?(Fi=e.screenX-ds.screenX,Ii=e.screenY-ds.screenY):Ii=Fi=0,ds=e),Fi)},movementY:function(e){return"movementY"in e?e.movementY:Ii}}),Pu=Jt(wr),gx=j({},wr,{dataTransfer:0}),bx=Jt(gx),yx=j({},us,{relatedTarget:0}),Pi=Jt(yx),jx=j({},Yl,{animationName:0,elapsedTime:0,pseudoElement:0}),Nx=Jt(jx),Sx=j({},Yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wx=Jt(Sx),Cx=j({},Yl,{data:0}),ed=Jt(Cx),zx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ax={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"},Ex={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ex[e])?!!t[e]:!1}function eo(){return kx}var Tx=j({},us,{key:function(e){if(e.key){var t=zx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ax[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eo,charCode:function(e){return e.type==="keypress"?jr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mx=Jt(Tx),Dx=j({},wr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),td=Jt(Dx),Ox=j({},us,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eo}),_x=Jt(Ox),Rx=j({},Yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lx=Jt(Rx),Hx=j({},wr,{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}),Ux=Jt(Hx),Bx=j({},Yl,{newState:0,oldState:0}),qx=Jt(Bx),Gx=[9,13,27,32],to=Va&&"CompositionEvent"in window,fs=null;Va&&"documentMode"in document&&(fs=document.documentMode);var Vx=Va&&"TextEvent"in window&&!fs,ad=Va&&(!to||fs&&8<fs&&11>=fs),ld=" ",nd=!1;function sd(e,t){switch(e){case"keyup":return Gx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nn=!1;function Yx(e,t){switch(e){case"compositionend":return rd(t);case"keypress":return t.which!==32?null:(nd=!0,ld);case"textInput":return e=t.data,e===ld&&nd?null:e;default:return null}}function Qx(e,t){if(Nn)return e==="compositionend"||!to&&sd(e,t)?(e=Fu(),yr=Wi=fl=null,Nn=!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 ad&&t.locale!=="ko"?null:t.data;default:return null}}var Xx={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 id(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xx[e.type]:t==="textarea"}function od(e,t,a,n){yn?jn?jn.push(n):jn=[n]:yn=n,t=mi(t,"onChange"),0<t.length&&(a=new Sr("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var ms=null,hs=null;function Zx(e){Xm(e,0)}function Cr(e){var t=Yt(e);if(Yu(t))return e}function cd(e,t){if(e==="change")return t}var ud=!1;if(Va){var ao;if(Va){var lo="oninput"in document;if(!lo){var dd=document.createElement("div");dd.setAttribute("oninput","return;"),lo=typeof dd.oninput=="function"}ao=lo}else ao=!1;ud=ao&&(!document.documentMode||9<document.documentMode)}function fd(){ms&&(ms.detachEvent("onpropertychange",md),hs=ms=null)}function md(e){if(e.propertyName==="value"&&Cr(hs)){var t=[];od(t,hs,e,Ki(e)),Wu(Zx,t)}}function Kx(e,t,a){e==="focusin"?(fd(),ms=t,hs=a,ms.attachEvent("onpropertychange",md)):e==="focusout"&&fd()}function $x(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cr(hs)}function Jx(e,t){if(e==="click")return Cr(t)}function Wx(e,t){if(e==="input"||e==="change")return Cr(t)}function Fx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aa=typeof Object.is=="function"?Object.is:Fx;function ps(e,t){if(aa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!Me.call(t,r)||!aa(e[r],t[r]))return!1}return!0}function hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pd(e,t){var a=hd(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=hd(a)}}function xd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gr(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=gr(e.document)}return t}function no(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ix=Va&&"documentMode"in document&&11>=document.documentMode,Sn=null,so=null,xs=null,ro=!1;function gd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ro||Sn==null||Sn!==gr(n)||(n=Sn,"selectionStart"in n&&no(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),xs&&ps(xs,n)||(xs=n,n=mi(so,"onSelect"),0<n.length&&(t=new Sr("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Sn)))}function Ql(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var wn={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionrun:Ql("Transition","TransitionRun"),transitionstart:Ql("Transition","TransitionStart"),transitioncancel:Ql("Transition","TransitionCancel"),transitionend:Ql("Transition","TransitionEnd")},io={},bd={};Va&&(bd=document.createElement("div").style,"AnimationEvent"in window||(delete wn.animationend.animation,delete wn.animationiteration.animation,delete wn.animationstart.animation),"TransitionEvent"in window||delete wn.transitionend.transition);function Xl(e){if(io[e])return io[e];if(!wn[e])return e;var t=wn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in bd)return io[e]=t[a];return e}var yd=Xl("animationend"),jd=Xl("animationiteration"),Nd=Xl("animationstart"),Px=Xl("transitionrun"),ev=Xl("transitionstart"),tv=Xl("transitioncancel"),Sd=Xl("transitionend"),wd=new Map,oo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");oo.push("scrollEnd");function za(e,t){wd.set(e,t),Vl(t,[e])}var zr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ha=[],Cn=0,co=0;function Ar(){for(var e=Cn,t=co=Cn=0;t<e;){var a=ha[t];ha[t++]=null;var n=ha[t];ha[t++]=null;var r=ha[t];ha[t++]=null;var i=ha[t];if(ha[t++]=null,n!==null&&r!==null){var f=n.pending;f===null?r.next=r:(r.next=f.next,f.next=r),n.pending=r}i!==0&&Cd(a,r,i)}}function Er(e,t,a,n){ha[Cn++]=e,ha[Cn++]=t,ha[Cn++]=a,ha[Cn++]=n,co|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function uo(e,t,a,n){return Er(e,t,a,n),kr(e)}function Zl(e,t){return Er(e,null,null,t),kr(e)}function Cd(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-Tt(a),e=i.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),i):null}function kr(e){if(50<Us)throw Us=0,yc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zn={};function av(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function la(e,t,a,n){return new av(e,t,a,n)}function fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ya(e,t){var a=e.alternate;return a===null?(a=la(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function zd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Tr(e,t,a,n,r,i){var f=0;if(n=e,typeof e=="function")fo(e)&&(f=1);else if(typeof e=="string")f=ig(e,a,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case fe:return e=la(31,a,t,r),e.elementType=fe,e.lanes=i,e;case V:return Kl(a.children,r,i,t);case te:f=8,r|=24;break;case P:return e=la(12,a,t,r|2),e.elementType=P,e.lanes=i,e;case ce:return e=la(13,a,t,r),e.elementType=ce,e.lanes=i,e;case de:return e=la(19,a,t,r),e.elementType=de,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pe:f=10;break e;case ie:f=9;break e;case G:f=11;break e;case ee:f=14;break e;case U:f=16,n=null;break e}f=29,a=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=la(f,a,t,r),t.elementType=e,t.type=n,t.lanes=i,t}function Kl(e,t,a,n){return e=la(7,e,n,t),e.lanes=a,e}function mo(e,t,a){return e=la(6,e,null,t),e.lanes=a,e}function Ad(e){var t=la(18,null,null,0);return t.stateNode=e,t}function ho(e,t,a){return t=la(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ed=new WeakMap;function pa(e,t){if(typeof e=="object"&&e!==null){var a=Ed.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ft(t)},Ed.set(e,t),t)}return{value:e,source:t,stack:ft(t)}}var An=[],En=0,Mr=null,vs=0,xa=[],va=0,ml=null,Oa=1,_a="";function Qa(e,t){An[En++]=vs,An[En++]=Mr,Mr=e,vs=t}function kd(e,t,a){xa[va++]=Oa,xa[va++]=_a,xa[va++]=ml,ml=e;var n=Oa;e=_a;var r=32-Tt(n)-1;n&=~(1<<r),a+=1;var i=32-Tt(t)+r;if(30<i){var f=r-r%5;i=(n&(1<<f)-1).toString(32),n>>=f,r-=f,Oa=1<<32-Tt(t)+r|a<<r|n,_a=i+e}else Oa=1<<i|a<<r|n,_a=e}function po(e){e.return!==null&&(Qa(e,1),kd(e,1,0))}function xo(e){for(;e===Mr;)Mr=An[--En],An[En]=null,vs=An[--En],An[En]=null;for(;e===ml;)ml=xa[--va],xa[va]=null,_a=xa[--va],xa[va]=null,Oa=xa[--va],xa[va]=null}function Td(e,t){xa[va++]=Oa,xa[va++]=_a,xa[va++]=ml,Oa=t.id,_a=t.overflow,ml=e}var Ut=null,xt=null,We=!1,hl=null,ga=!1,vo=Error(u(519));function pl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gs(pa(t,e)),vo}function Md(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Mt]=e,t[Vt]=n,a){case"dialog":Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":case"embed":Ze("load",t);break;case"video":case"audio":for(a=0;a<qs.length;a++)Ze(qs[a],t);break;case"source":Ze("error",t);break;case"img":case"image":case"link":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"input":Ze("invalid",t),Qu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ze("invalid",t);break;case"textarea":Ze("invalid",t),Zu(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Jm(t.textContent,a)?(n.popover!=null&&(Ze("beforetoggle",t),Ze("toggle",t)),n.onScroll!=null&&Ze("scroll",t),n.onScrollEnd!=null&&Ze("scrollend",t),n.onClick!=null&&(t.onclick=Ga),t=!0):t=!1,t||pl(e,!0)}function Dd(e){for(Ut=e.return;Ut;)switch(Ut.tag){case 5:case 31:case 13:ga=!1;return;case 27:case 3:ga=!0;return;default:Ut=Ut.return}}function kn(e){if(e!==Ut)return!1;if(!We)return Dd(e),We=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Rc(e.type,e.memoizedProps)),a=!a),a&&xt&&pl(e),Dd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));xt=nh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));xt=nh(e)}else t===27?(t=xt,kl(e.type)?(e=qc,qc=null,xt=e):xt=t):xt=Ut?ya(e.stateNode.nextSibling):null;return!0}function $l(){xt=Ut=null,We=!1}function go(){var e=hl;return e!==null&&(Pt===null?Pt=e:Pt.push.apply(Pt,e),hl=null),e}function gs(e){hl===null?hl=[e]:hl.push(e)}var bo=b(null),Jl=null,Xa=null;function xl(e,t,a){Y(bo,t._currentValue),t._currentValue=a}function Za(e){e._currentValue=bo.current,D(bo)}function yo(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function jo(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var f=r.child;i=i.firstContext;e:for(;i!==null;){var p=i;i=r;for(var S=0;S<t.length;S++)if(p.context===t[S]){i.lanes|=a,p=i.alternate,p!==null&&(p.lanes|=a),yo(i.return,a,e),n||(f=null);break e}i=p.next}}else if(r.tag===18){if(f=r.return,f===null)throw Error(u(341));f.lanes|=a,i=f.alternate,i!==null&&(i.lanes|=a),yo(f,a,e),f=null}else f=r.child;if(f!==null)f.return=r;else for(f=r;f!==null;){if(f===e){f=null;break}if(r=f.sibling,r!==null){r.return=f.return,f=r;break}f=f.return}r=f}}function Tn(e,t,a,n){e=null;for(var r=t,i=!1;r!==null;){if(!i){if((r.flags&524288)!==0)i=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var f=r.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var p=r.type;aa(r.pendingProps.value,f.value)||(e!==null?e.push(p):e=[p])}}else if(r===O.current){if(f=r.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Xs):e=[Xs])}r=r.return}e!==null&&jo(t,e,a,n),t.flags|=262144}function Dr(e){for(e=e.firstContext;e!==null;){if(!aa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){Jl=e,Xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return Od(Jl,e)}function Or(e,t){return Jl===null&&Wl(e),Od(e,t)}function Od(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Xa===null){if(e===null)throw Error(u(308));Xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xa=Xa.next=t;return a}var lv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},nv=s.unstable_scheduleCallback,sv=s.unstable_NormalPriority,Ct={$$typeof:pe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function No(){return{controller:new lv,data:new Map,refCount:0}}function bs(e){e.refCount--,e.refCount===0&&nv(sv,function(){e.controller.abort()})}var ys=null,So=0,Mn=0,Dn=null;function rv(e,t){if(ys===null){var a=ys=[];So=0,Mn=zc(),Dn={status:"pending",value:void 0,then:function(n){a.push(n)}}}return So++,t.then(_d,_d),t}function _d(){if(--So===0&&ys!==null){Dn!==null&&(Dn.status="fulfilled");var e=ys;ys=null,Mn=0,Dn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function iv(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var Rd=E.S;E.S=function(e,t){bm=et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rv(e,t),Rd!==null&&Rd(e,t)};var Fl=b(null);function wo(){var e=Fl.current;return e!==null?e:dt.pooledCache}function _r(e,t){t===null?Y(Fl,Fl.current):Y(Fl,t.pool)}function Ld(){var e=wo();return e===null?null:{parent:Ct._currentValue,pool:e}}var On=Error(u(460)),Co=Error(u(474)),Rr=Error(u(542)),Lr={then:function(){}};function Hd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ud(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ga,Ga),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qd(e),e;default:if(typeof t.status=="string")t.then(Ga,Ga);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qd(e),e}throw Pl=t,On}}function Il(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Pl=a,On):a}}var Pl=null;function Bd(){if(Pl===null)throw Error(u(459));var e=Pl;return Pl=null,e}function qd(e){if(e===On||e===Rr)throw Error(u(483))}var _n=null,js=0;function Hr(e){var t=js;return js+=1,_n===null&&(_n=[]),Ud(_n,e,t)}function Ns(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ur(e,t){throw t.$$typeof===A?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gd(e){function t(M,C){if(e){var R=M.deletions;R===null?(M.deletions=[C],M.flags|=16):R.push(C)}}function a(M,C){if(!e)return null;for(;C!==null;)t(M,C),C=C.sibling;return null}function n(M){for(var C=new Map;M!==null;)M.key!==null?C.set(M.key,M):C.set(M.index,M),M=M.sibling;return C}function r(M,C){return M=Ya(M,C),M.index=0,M.sibling=null,M}function i(M,C,R){return M.index=R,e?(R=M.alternate,R!==null?(R=R.index,R<C?(M.flags|=67108866,C):R):(M.flags|=67108866,C)):(M.flags|=1048576,C)}function f(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function p(M,C,R,W){return C===null||C.tag!==6?(C=mo(R,M.mode,W),C.return=M,C):(C=r(C,R),C.return=M,C)}function S(M,C,R,W){var ke=R.type;return ke===V?K(M,C,R.props.children,W,R.key):C!==null&&(C.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===U&&Il(ke)===C.type)?(C=r(C,R.props),Ns(C,R),C.return=M,C):(C=Tr(R.type,R.key,R.props,null,M.mode,W),Ns(C,R),C.return=M,C)}function L(M,C,R,W){return C===null||C.tag!==4||C.stateNode.containerInfo!==R.containerInfo||C.stateNode.implementation!==R.implementation?(C=ho(R,M.mode,W),C.return=M,C):(C=r(C,R.children||[]),C.return=M,C)}function K(M,C,R,W,ke){return C===null||C.tag!==7?(C=Kl(R,M.mode,W,ke),C.return=M,C):(C=r(C,R),C.return=M,C)}function I(M,C,R){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=mo(""+C,M.mode,R),C.return=M,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case w:return R=Tr(C.type,C.key,C.props,null,M.mode,R),Ns(R,C),R.return=M,R;case T:return C=ho(C,M.mode,R),C.return=M,C;case U:return C=Il(C),I(M,C,R)}if(ye(C)||_(C))return C=Kl(C,M.mode,R,null),C.return=M,C;if(typeof C.then=="function")return I(M,Hr(C),R);if(C.$$typeof===pe)return I(M,Or(M,C),R);Ur(M,C)}return null}function H(M,C,R,W){var ke=C!==null?C.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ke!==null?null:p(M,C,""+R,W);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case w:return R.key===ke?S(M,C,R,W):null;case T:return R.key===ke?L(M,C,R,W):null;case U:return R=Il(R),H(M,C,R,W)}if(ye(R)||_(R))return ke!==null?null:K(M,C,R,W,null);if(typeof R.then=="function")return H(M,C,Hr(R),W);if(R.$$typeof===pe)return H(M,C,Or(M,R),W);Ur(M,R)}return null}function q(M,C,R,W,ke){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return M=M.get(R)||null,p(C,M,""+W,ke);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case w:return M=M.get(W.key===null?R:W.key)||null,S(C,M,W,ke);case T:return M=M.get(W.key===null?R:W.key)||null,L(C,M,W,ke);case U:return W=Il(W),q(M,C,R,W,ke)}if(ye(W)||_(W))return M=M.get(R)||null,K(C,M,W,ke,null);if(typeof W.then=="function")return q(M,C,R,Hr(W),ke);if(W.$$typeof===pe)return q(M,C,R,Or(C,W),ke);Ur(C,W)}return null}function Ne(M,C,R,W){for(var ke=null,Fe=null,Ce=C,qe=C=0,$e=null;Ce!==null&&qe<R.length;qe++){Ce.index>qe?($e=Ce,Ce=null):$e=Ce.sibling;var Ie=H(M,Ce,R[qe],W);if(Ie===null){Ce===null&&(Ce=$e);break}e&&Ce&&Ie.alternate===null&&t(M,Ce),C=i(Ie,C,qe),Fe===null?ke=Ie:Fe.sibling=Ie,Fe=Ie,Ce=$e}if(qe===R.length)return a(M,Ce),We&&Qa(M,qe),ke;if(Ce===null){for(;qe<R.length;qe++)Ce=I(M,R[qe],W),Ce!==null&&(C=i(Ce,C,qe),Fe===null?ke=Ce:Fe.sibling=Ce,Fe=Ce);return We&&Qa(M,qe),ke}for(Ce=n(Ce);qe<R.length;qe++)$e=q(Ce,M,qe,R[qe],W),$e!==null&&(e&&$e.alternate!==null&&Ce.delete($e.key===null?qe:$e.key),C=i($e,C,qe),Fe===null?ke=$e:Fe.sibling=$e,Fe=$e);return e&&Ce.forEach(function(_l){return t(M,_l)}),We&&Qa(M,qe),ke}function De(M,C,R,W){if(R==null)throw Error(u(151));for(var ke=null,Fe=null,Ce=C,qe=C=0,$e=null,Ie=R.next();Ce!==null&&!Ie.done;qe++,Ie=R.next()){Ce.index>qe?($e=Ce,Ce=null):$e=Ce.sibling;var _l=H(M,Ce,Ie.value,W);if(_l===null){Ce===null&&(Ce=$e);break}e&&Ce&&_l.alternate===null&&t(M,Ce),C=i(_l,C,qe),Fe===null?ke=_l:Fe.sibling=_l,Fe=_l,Ce=$e}if(Ie.done)return a(M,Ce),We&&Qa(M,qe),ke;if(Ce===null){for(;!Ie.done;qe++,Ie=R.next())Ie=I(M,Ie.value,W),Ie!==null&&(C=i(Ie,C,qe),Fe===null?ke=Ie:Fe.sibling=Ie,Fe=Ie);return We&&Qa(M,qe),ke}for(Ce=n(Ce);!Ie.done;qe++,Ie=R.next())Ie=q(Ce,M,qe,Ie.value,W),Ie!==null&&(e&&Ie.alternate!==null&&Ce.delete(Ie.key===null?qe:Ie.key),C=i(Ie,C,qe),Fe===null?ke=Ie:Fe.sibling=Ie,Fe=Ie);return e&&Ce.forEach(function(gg){return t(M,gg)}),We&&Qa(M,qe),ke}function ut(M,C,R,W){if(typeof R=="object"&&R!==null&&R.type===V&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case w:e:{for(var ke=R.key;C!==null;){if(C.key===ke){if(ke=R.type,ke===V){if(C.tag===7){a(M,C.sibling),W=r(C,R.props.children),W.return=M,M=W;break e}}else if(C.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===U&&Il(ke)===C.type){a(M,C.sibling),W=r(C,R.props),Ns(W,R),W.return=M,M=W;break e}a(M,C);break}else t(M,C);C=C.sibling}R.type===V?(W=Kl(R.props.children,M.mode,W,R.key),W.return=M,M=W):(W=Tr(R.type,R.key,R.props,null,M.mode,W),Ns(W,R),W.return=M,M=W)}return f(M);case T:e:{for(ke=R.key;C!==null;){if(C.key===ke)if(C.tag===4&&C.stateNode.containerInfo===R.containerInfo&&C.stateNode.implementation===R.implementation){a(M,C.sibling),W=r(C,R.children||[]),W.return=M,M=W;break e}else{a(M,C);break}else t(M,C);C=C.sibling}W=ho(R,M.mode,W),W.return=M,M=W}return f(M);case U:return R=Il(R),ut(M,C,R,W)}if(ye(R))return Ne(M,C,R,W);if(_(R)){if(ke=_(R),typeof ke!="function")throw Error(u(150));return R=ke.call(R),De(M,C,R,W)}if(typeof R.then=="function")return ut(M,C,Hr(R),W);if(R.$$typeof===pe)return ut(M,C,Or(M,R),W);Ur(M,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,C!==null&&C.tag===6?(a(M,C.sibling),W=r(C,R),W.return=M,M=W):(a(M,C),W=mo(R,M.mode,W),W.return=M,M=W),f(M)):a(M,C)}return function(M,C,R,W){try{js=0;var ke=ut(M,C,R,W);return _n=null,ke}catch(Ce){if(Ce===On||Ce===Rr)throw Ce;var Fe=la(29,Ce,null,M.mode);return Fe.lanes=W,Fe.return=M,Fe}finally{}}}var en=Gd(!0),Vd=Gd(!1),vl=!1;function zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ao(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function gl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bl(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(tt&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=kr(e),Cd(e,null,a),t}return Er(e,n,t,a),kr(e)}function Ss(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,dr(e,a)}}function Eo(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?r=i=f:i=i.next=f,a=a.next}while(a!==null);i===null?r=i=t:i=i.next=t}else r=i=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ko=!1;function ws(){if(ko){var e=Dn;if(e!==null)throw e}}function Cs(e,t,a,n){ko=!1;var r=e.updateQueue;vl=!1;var i=r.firstBaseUpdate,f=r.lastBaseUpdate,p=r.shared.pending;if(p!==null){r.shared.pending=null;var S=p,L=S.next;S.next=null,f===null?i=L:f.next=L,f=S;var K=e.alternate;K!==null&&(K=K.updateQueue,p=K.lastBaseUpdate,p!==f&&(p===null?K.firstBaseUpdate=L:p.next=L,K.lastBaseUpdate=S))}if(i!==null){var I=r.baseState;f=0,K=L=S=null,p=i;do{var H=p.lane&-536870913,q=H!==p.lane;if(q?(Ke&H)===H:(n&H)===H){H!==0&&H===Mn&&(ko=!0),K!==null&&(K=K.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var Ne=e,De=p;H=t;var ut=a;switch(De.tag){case 1:if(Ne=De.payload,typeof Ne=="function"){I=Ne.call(ut,I,H);break e}I=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=De.payload,H=typeof Ne=="function"?Ne.call(ut,I,H):Ne,H==null)break e;I=j({},I,H);break e;case 2:vl=!0}}H=p.callback,H!==null&&(e.flags|=64,q&&(e.flags|=8192),q=r.callbacks,q===null?r.callbacks=[H]:q.push(H))}else q={lane:H,tag:p.tag,payload:p.payload,callback:p.callback,next:null},K===null?(L=K=q,S=I):K=K.next=q,f|=H;if(p=p.next,p===null){if(p=r.shared.pending,p===null)break;q=p,p=q.next,q.next=null,r.lastBaseUpdate=q,r.shared.pending=null}}while(!0);K===null&&(S=I),r.baseState=S,r.firstBaseUpdate=L,r.lastBaseUpdate=K,i===null&&(r.shared.lanes=0),wl|=f,e.lanes=f,e.memoizedState=I}}function Yd(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Qd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Yd(a[e],t)}var Rn=b(null),Br=b(0);function Xd(e,t){e=tl,Y(Br,e),Y(Rn,t),tl=e|t.baseLanes}function To(){Y(Br,tl),Y(Rn,Rn.current)}function Mo(){tl=Br.current,D(Rn),D(Br)}var na=b(null),ba=null;function yl(e){var t=e.alternate;Y(St,St.current&1),Y(na,e),ba===null&&(t===null||Rn.current!==null||t.memoizedState!==null)&&(ba=e)}function Do(e){Y(St,St.current),Y(na,e),ba===null&&(ba=e)}function Zd(e){e.tag===22?(Y(St,St.current),Y(na,e),ba===null&&(ba=e)):jl()}function jl(){Y(St,St.current),Y(na,na.current)}function sa(e){D(na),ba===e&&(ba=null),D(St)}var St=b(0);function qr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Uc(a)||Bc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ka=0,Be=null,ot=null,zt=null,Gr=!1,Ln=!1,tn=!1,Vr=0,zs=0,Hn=null,ov=0;function jt(){throw Error(u(321))}function Oo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!aa(e[a],t[a]))return!1;return!0}function _o(e,t,a,n,r,i){return Ka=i,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Tf:Jo,tn=!1,i=a(n,r),tn=!1,Ln&&(i=$d(t,a,n,r)),Kd(e),i}function Kd(e){E.H=ks;var t=ot!==null&&ot.next!==null;if(Ka=0,zt=ot=Be=null,Gr=!1,zs=0,Hn=null,t)throw Error(u(300));e===null||At||(e=e.dependencies,e!==null&&Dr(e)&&(At=!0))}function $d(e,t,a,n){Be=e;var r=0;do{if(Ln&&(Hn=null),zs=0,Ln=!1,25<=r)throw Error(u(301));if(r+=1,zt=ot=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}E.H=Mf,i=t(a,n)}while(Ln);return i}function cv(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?As(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Be.flags|=1024),t}function Ro(){var e=Vr!==0;return Vr=0,e}function Lo(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ho(e){if(Gr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Gr=!1}Ka=0,zt=ot=Be=null,Ln=!1,zs=Vr=0,Hn=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Be.memoizedState=zt=e:zt=zt.next=e,zt}function wt(){if(ot===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=zt===null?Be.memoizedState:zt.next;if(t!==null)zt=t,ot=e;else{if(e===null)throw Be.alternate===null?Error(u(467)):Error(u(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},zt===null?Be.memoizedState=zt=e:zt=zt.next=e}return zt}function Yr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function As(e){var t=zs;return zs+=1,Hn===null&&(Hn=[]),e=Ud(Hn,e,t),t=Be,(zt===null?t.memoizedState:zt.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Tf:Jo),e}function Qr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return As(e);if(e.$$typeof===pe)return Bt(e)}throw Error(u(438,String(e)))}function Uo(e){var t=null,a=Be.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Be.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Yr(),Be.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=Ee;return t.index++,a}function $a(e,t){return typeof t=="function"?t(e):t}function Xr(e){var t=wt();return Bo(t,ot,e)}function Bo(e,t,a){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=a;var r=e.baseQueue,i=n.pending;if(i!==null){if(r!==null){var f=r.next;r.next=i.next,i.next=f}t.baseQueue=r=i,n.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var p=f=null,S=null,L=t,K=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Ke&I)===I:(Ka&I)===I){var H=L.revertLane;if(H===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===Mn&&(K=!0);else if((Ka&H)===H){L=L.next,H===Mn&&(K=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},S===null?(p=S=I,f=i):S=S.next=I,Be.lanes|=H,wl|=H;I=L.action,tn&&a(i,I),i=L.hasEagerState?L.eagerState:a(i,I)}else H={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},S===null?(p=S=H,f=i):S=S.next=H,Be.lanes|=I,wl|=I;L=L.next}while(L!==null&&L!==t);if(S===null?f=i:S.next=p,!aa(i,e.memoizedState)&&(At=!0,K&&(a=Dn,a!==null)))throw a;e.memoizedState=i,e.baseState=f,e.baseQueue=S,n.lastRenderedState=i}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function qo(e){var t=wt(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,i=t.memoizedState;if(r!==null){a.pending=null;var f=r=r.next;do i=e(i,f.action),f=f.next;while(f!==r);aa(i,t.memoizedState)||(At=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function Jd(e,t,a){var n=Be,r=wt(),i=We;if(i){if(a===void 0)throw Error(u(407));a=a()}else a=t();var f=!aa((ot||r).memoizedState,a);if(f&&(r.memoizedState=a,At=!0),r=r.queue,Yo(Id.bind(null,n,r,e),[e]),r.getSnapshot!==t||f||zt!==null&&zt.memoizedState.tag&1){if(n.flags|=2048,Un(9,{destroy:void 0},Fd.bind(null,n,r,a,t),null),dt===null)throw Error(u(349));i||(Ka&127)!==0||Wd(n,t,a)}return a}function Wd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Be.updateQueue,t===null?(t=Yr(),Be.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Fd(e,t,a,n){t.value=a,t.getSnapshot=n,Pd(t)&&ef(e)}function Id(e,t,a){return a(function(){Pd(t)&&ef(e)})}function Pd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!aa(e,a)}catch{return!0}}function ef(e){var t=Zl(e,2);t!==null&&ea(t,e,2)}function Go(e){var t=Xt();if(typeof e=="function"){var a=e;if(e=a(),tn){Rt(!0);try{a()}finally{Rt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:e},t}function tf(e,t,a,n){return e.baseState=a,Bo(e,ot,typeof n=="function"?n:$a)}function uv(e,t,a,n,r){if($r(e))throw Error(u(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){i.listeners.push(f)}};E.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,af(t,i)):(i.next=a.next,t.pending=a.next=i)}}function af(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var i=E.T,f={};E.T=f;try{var p=a(r,n),S=E.S;S!==null&&S(f,p),lf(e,t,p)}catch(L){Vo(e,t,L)}finally{i!==null&&f.types!==null&&(i.types=f.types),E.T=i}}else try{i=a(r,n),lf(e,t,i)}catch(L){Vo(e,t,L)}}function lf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){nf(e,t,n)},function(n){return Vo(e,t,n)}):nf(e,t,a)}function nf(e,t,a){t.status="fulfilled",t.value=a,sf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,af(e,a)))}function Vo(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,sf(t),t=t.next;while(t!==n)}e.action=null}function sf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rf(e,t){return t}function of(e,t){if(We){var a=dt.formState;if(a!==null){e:{var n=Be;if(We){if(xt){t:{for(var r=xt,i=ga;r.nodeType!==8;){if(!i){r=null;break t}if(r=ya(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){xt=ya(r.nextSibling),n=r.data==="F!";break e}}pl(n)}n=!1}n&&(t=a[0])}}return a=Xt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rf,lastRenderedState:t},a.queue=n,a=Af.bind(null,Be,n),n.dispatch=a,n=Go(!1),i=$o.bind(null,Be,!1,n.queue),n=Xt(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=uv.bind(null,Be,r,i,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function cf(e){var t=wt();return uf(t,ot,e)}function uf(e,t,a){if(t=Bo(e,t,rf)[0],e=Xr($a)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=As(t)}catch(f){throw f===On?Rr:f}else n=t;t=wt();var r=t.queue,i=r.dispatch;return a!==t.memoizedState&&(Be.flags|=2048,Un(9,{destroy:void 0},dv.bind(null,r,a),null)),[n,i,e]}function dv(e,t){e.action=t}function df(e){var t=wt(),a=ot;if(a!==null)return uf(t,a,e);wt(),t=t.memoizedState,a=wt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Un(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Be.updateQueue,t===null&&(t=Yr(),Be.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function ff(){return wt().memoizedState}function Zr(e,t,a,n){var r=Xt();Be.flags|=e,r.memoizedState=Un(1|t,{destroy:void 0},a,n===void 0?null:n)}function Kr(e,t,a,n){var r=wt();n=n===void 0?null:n;var i=r.memoizedState.inst;ot!==null&&n!==null&&Oo(n,ot.memoizedState.deps)?r.memoizedState=Un(t,i,a,n):(Be.flags|=e,r.memoizedState=Un(1|t,i,a,n))}function mf(e,t){Zr(8390656,8,e,t)}function Yo(e,t){Kr(2048,8,e,t)}function fv(e){Be.flags|=4;var t=Be.updateQueue;if(t===null)t=Yr(),Be.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function hf(e){var t=wt().memoizedState;return fv({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function pf(e,t){return Kr(4,2,e,t)}function xf(e,t){return Kr(4,4,e,t)}function vf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gf(e,t,a){a=a!=null?a.concat([e]):null,Kr(4,4,vf.bind(null,t,e),a)}function Qo(){}function bf(e,t){var a=wt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Oo(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function yf(e,t){var a=wt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Oo(t,n[1]))return n[0];if(n=e(),tn){Rt(!0);try{e()}finally{Rt(!1)}}return a.memoizedState=[n,t],n}function Xo(e,t,a){return a===void 0||(Ka&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=jm(),Be.lanes|=e,wl|=e,a)}function jf(e,t,a,n){return aa(a,t)?a:Rn.current!==null?(e=Xo(e,a,n),aa(e,t)||(At=!0),e):(Ka&42)===0||(Ka&1073741824)!==0&&(Ke&261930)===0?(At=!0,e.memoizedState=a):(e=jm(),Be.lanes|=e,wl|=e,t)}function Nf(e,t,a,n,r){var i=$.p;$.p=i!==0&&8>i?i:8;var f=E.T,p={};E.T=p,$o(e,!1,t,a);try{var S=r(),L=E.S;if(L!==null&&L(p,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var K=iv(S,n);Es(e,t,K,oa(e))}else Es(e,t,n,oa(e))}catch(I){Es(e,t,{then:function(){},status:"rejected",reason:I},oa())}finally{$.p=i,f!==null&&p.types!==null&&(f.types=p.types),E.T=f}}function mv(){}function Zo(e,t,a,n){if(e.tag!==5)throw Error(u(476));var r=Sf(e).queue;Nf(e,r,t,me,a===null?mv:function(){return wf(e),a(n)})}function Sf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:me},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wf(e){var t=Sf(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},oa())}function Ko(){return Bt(Xs)}function Cf(){return wt().memoizedState}function zf(){return wt().memoizedState}function hv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=oa();e=gl(a);var n=bl(t,e,a);n!==null&&(ea(n,t,a),Ss(n,t,a)),t={cache:No()},e.payload=t;return}t=t.return}}function pv(e,t,a){var n=oa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$r(e)?Ef(t,a):(a=uo(e,t,a,n),a!==null&&(ea(a,e,n),kf(a,t,n)))}function Af(e,t,a){var n=oa();Es(e,t,a,n)}function Es(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($r(e))Ef(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var f=t.lastRenderedState,p=i(f,a);if(r.hasEagerState=!0,r.eagerState=p,aa(p,f))return Er(e,t,r,0),dt===null&&Ar(),!1}catch{}finally{}if(a=uo(e,t,r,n),a!==null)return ea(a,e,n),kf(a,t,n),!0}return!1}function $o(e,t,a,n){if(n={lane:2,revertLane:zc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$r(e)){if(t)throw Error(u(479))}else t=uo(e,a,n,2),t!==null&&ea(t,e,2)}function $r(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Ef(e,t){Ln=Gr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function kf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,dr(e,a)}}var ks={readContext:Bt,use:Qr,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};ks.useEffectEvent=jt;var Tf={readContext:Bt,use:Qr,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:mf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Zr(4194308,4,vf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Zr(4194308,4,e,t)},useInsertionEffect:function(e,t){Zr(4,2,e,t)},useMemo:function(e,t){var a=Xt();t=t===void 0?null:t;var n=e();if(tn){Rt(!0);try{e()}finally{Rt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Xt();if(a!==void 0){var r=a(t);if(tn){Rt(!0);try{a(t)}finally{Rt(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=pv.bind(null,Be,e),[n.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,a=Af.bind(null,Be,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Qo,useDeferredValue:function(e,t){var a=Xt();return Xo(a,e,t)},useTransition:function(){var e=Go(!1);return e=Nf.bind(null,Be,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Be,r=Xt();if(We){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),dt===null)throw Error(u(349));(Ke&127)!==0||Wd(n,t,a)}r.memoizedState=a;var i={value:a,getSnapshot:t};return r.queue=i,mf(Id.bind(null,n,i,e),[e]),n.flags|=2048,Un(9,{destroy:void 0},Fd.bind(null,n,i,a,t),null),a},useId:function(){var e=Xt(),t=dt.identifierPrefix;if(We){var a=_a,n=Oa;a=(n&~(1<<32-Tt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Vr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=ov++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ko,useFormState:of,useActionState:of,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=$o.bind(null,Be,!0,a),a.dispatch=t,[e,t]},useMemoCache:Uo,useCacheRefresh:function(){return Xt().memoizedState=hv.bind(null,Be)},useEffectEvent:function(e){var t=Xt(),a={impl:e};return t.memoizedState=a,function(){if((tt&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Jo={readContext:Bt,use:Qr,useCallback:bf,useContext:Bt,useEffect:Yo,useImperativeHandle:gf,useInsertionEffect:pf,useLayoutEffect:xf,useMemo:yf,useReducer:Xr,useRef:ff,useState:function(){return Xr($a)},useDebugValue:Qo,useDeferredValue:function(e,t){var a=wt();return jf(a,ot.memoizedState,e,t)},useTransition:function(){var e=Xr($a)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:As(e),t]},useSyncExternalStore:Jd,useId:Cf,useHostTransitionStatus:Ko,useFormState:cf,useActionState:cf,useOptimistic:function(e,t){var a=wt();return tf(a,ot,e,t)},useMemoCache:Uo,useCacheRefresh:zf};Jo.useEffectEvent=hf;var Mf={readContext:Bt,use:Qr,useCallback:bf,useContext:Bt,useEffect:Yo,useImperativeHandle:gf,useInsertionEffect:pf,useLayoutEffect:xf,useMemo:yf,useReducer:qo,useRef:ff,useState:function(){return qo($a)},useDebugValue:Qo,useDeferredValue:function(e,t){var a=wt();return ot===null?Xo(a,e,t):jf(a,ot.memoizedState,e,t)},useTransition:function(){var e=qo($a)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:As(e),t]},useSyncExternalStore:Jd,useId:Cf,useHostTransitionStatus:Ko,useFormState:df,useActionState:df,useOptimistic:function(e,t){var a=wt();return ot!==null?tf(a,ot,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Uo,useCacheRefresh:zf};Mf.useEffectEvent=hf;function Wo(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Fo={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=oa(),r=gl(n);r.payload=t,a!=null&&(r.callback=a),t=bl(e,r,n),t!==null&&(ea(t,e,n),Ss(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=oa(),r=gl(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=bl(e,r,n),t!==null&&(ea(t,e,n),Ss(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=oa(),n=gl(a);n.tag=2,t!=null&&(n.callback=t),t=bl(e,n,a),t!==null&&(ea(t,e,a),Ss(t,e,a))}};function Df(e,t,a,n,r,i,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,f):t.prototype&&t.prototype.isPureReactComponent?!ps(a,n)||!ps(r,i):!0}function Of(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Fo.enqueueReplaceState(t,t.state,null)}function an(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function _f(e){zr(e)}function Rf(e){console.error(e)}function Lf(e){zr(e)}function Jr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Hf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Io(e,t,a){return a=gl(a),a.tag=3,a.payload={element:null},a.callback=function(){Jr(e,t)},a}function Uf(e){return e=gl(e),e.tag=3,e}function Bf(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var i=n.value;e.payload=function(){return r(i)},e.callback=function(){Hf(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Hf(t,a,n),typeof r!="function"&&(Cl===null?Cl=new Set([this]):Cl.add(this));var p=n.stack;this.componentDidCatch(n.value,{componentStack:p!==null?p:""})})}function xv(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Tn(t,a,r,!0),a=na.current,a!==null){switch(a.tag){case 31:case 13:return ba===null?ii():a.alternate===null&&Nt===0&&(Nt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===Lr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Sc(e,n,r)),!1;case 22:return a.flags|=65536,n===Lr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Sc(e,n,r)),!1}throw Error(u(435,a.tag))}return Sc(e,n,r),ii(),!1}if(We)return t=na.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==vo&&(e=Error(u(422),{cause:n}),gs(pa(e,a)))):(n!==vo&&(t=Error(u(423),{cause:n}),gs(pa(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=pa(n,a),r=Io(e.stateNode,n,r),Eo(e,r),Nt!==4&&(Nt=2)),!1;var i=Error(u(520),{cause:n});if(i=pa(i,a),Hs===null?Hs=[i]:Hs.push(i),Nt!==4&&(Nt=2),t===null)return!0;n=pa(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Io(a.stateNode,n,e),Eo(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Cl===null||!Cl.has(i))))return a.flags|=65536,r&=-r,a.lanes|=r,r=Uf(r),Bf(r,e,a,n),Eo(a,r),!1}a=a.return}while(a!==null);return!1}var Po=Error(u(461)),At=!1;function qt(e,t,a,n){t.child=e===null?Vd(t,null,a,n):en(t,e.child,a,n)}function qf(e,t,a,n,r){a=a.render;var i=t.ref;if("ref"in n){var f={};for(var p in n)p!=="ref"&&(f[p]=n[p])}else f=n;return Wl(t),n=_o(e,t,a,f,i,r),p=Ro(),e!==null&&!At?(Lo(e,t,r),Ja(e,t,r)):(We&&p&&po(t),t.flags|=1,qt(e,t,n,r),t.child)}function Gf(e,t,a,n,r){if(e===null){var i=a.type;return typeof i=="function"&&!fo(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Vf(e,t,i,n,r)):(e=Tr(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!ic(e,r)){var f=i.memoizedProps;if(a=a.compare,a=a!==null?a:ps,a(f,n)&&e.ref===t.ref)return Ja(e,t,r)}return t.flags|=1,e=Ya(i,n),e.ref=t.ref,e.return=t,t.child=e}function Vf(e,t,a,n,r){if(e!==null){var i=e.memoizedProps;if(ps(i,n)&&e.ref===t.ref)if(At=!1,t.pendingProps=n=i,ic(e,r))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,Ja(e,t,r)}return ec(e,t,a,n,r)}function Yf(e,t,a,n){var r=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~i}else n=0,t.child=null;return Qf(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_r(t,i!==null?i.cachePool:null),i!==null?Xd(t,i):To(),Zd(t);else return n=t.lanes=536870912,Qf(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(_r(t,i.cachePool),Xd(t,i),jl(),t.memoizedState=null):(e!==null&&_r(t,null),To(),jl());return qt(e,t,r,a),t.child}function Ts(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qf(e,t,a,n,r){var i=wo();return i=i===null?null:{parent:Ct._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&_r(t,null),To(),Zd(t),e!==null&&Tn(e,t,n,!0),t.childLanes=r,null}function Wr(e,t){return t=Ir({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xf(e,t,a){return en(t,e.child,null,a),e=Wr(t,t.pendingProps),e.flags|=2,sa(t),t.memoizedState=null,e}function vv(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(n.mode==="hidden")return e=Wr(t,n),t.lanes=536870912,Ts(null,e);if(Do(t),(e=xt)?(e=lh(e,ga),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ml!==null?{id:Oa,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},a=Ad(e),a.return=t,t.child=a,Ut=t,xt=null)):e=null,e===null)throw pl(t);return t.lanes=536870912,null}return Wr(t,n)}var i=e.memoizedState;if(i!==null){var f=i.dehydrated;if(Do(t),r)if(t.flags&256)t.flags&=-257,t=Xf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(At||Tn(e,t,a,!1),r=(a&e.childLanes)!==0,At||r){if(n=dt,n!==null&&(f=fr(n,a),f!==0&&f!==i.retryLane))throw i.retryLane=f,Zl(e,f),ea(n,e,f),Po;ii(),t=Xf(e,t,a)}else e=i.treeContext,xt=ya(f.nextSibling),Ut=t,We=!0,hl=null,ga=!1,e!==null&&Td(t,e),t=Wr(t,n),t.flags|=4096;return t}return e=Ya(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ec(e,t,a,n,r){return Wl(t),a=_o(e,t,a,n,void 0,r),n=Ro(),e!==null&&!At?(Lo(e,t,r),Ja(e,t,r)):(We&&n&&po(t),t.flags|=1,qt(e,t,a,r),t.child)}function Zf(e,t,a,n,r,i){return Wl(t),t.updateQueue=null,a=$d(t,n,a,r),Kd(e),n=Ro(),e!==null&&!At?(Lo(e,t,i),Ja(e,t,i)):(We&&n&&po(t),t.flags|=1,qt(e,t,a,i),t.child)}function Kf(e,t,a,n,r){if(Wl(t),t.stateNode===null){var i=zn,f=a.contextType;typeof f=="object"&&f!==null&&(i=Bt(f)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Fo,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},zo(t),f=a.contextType,i.context=typeof f=="object"&&f!==null?Bt(f):zn,i.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Wo(t,a,f,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(f=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),f!==i.state&&Fo.enqueueReplaceState(i,i.state,null),Cs(t,n,i,r),ws(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var p=t.memoizedProps,S=an(a,p);i.props=S;var L=i.context,K=a.contextType;f=zn,typeof K=="object"&&K!==null&&(f=Bt(K));var I=a.getDerivedStateFromProps;K=typeof I=="function"||typeof i.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,K||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(p||L!==f)&&Of(t,i,n,f),vl=!1;var H=t.memoizedState;i.state=H,Cs(t,n,i,r),ws(),L=t.memoizedState,p||H!==L||vl?(typeof I=="function"&&(Wo(t,a,I,n),L=t.memoizedState),(S=vl||Df(t,a,S,n,H,L,f))?(K||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=L),i.props=n,i.state=L,i.context=f,n=S):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Ao(e,t),f=t.memoizedProps,K=an(a,f),i.props=K,I=t.pendingProps,H=i.context,L=a.contextType,S=zn,typeof L=="object"&&L!==null&&(S=Bt(L)),p=a.getDerivedStateFromProps,(L=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f!==I||H!==S)&&Of(t,i,n,S),vl=!1,H=t.memoizedState,i.state=H,Cs(t,n,i,r),ws();var q=t.memoizedState;f!==I||H!==q||vl||e!==null&&e.dependencies!==null&&Dr(e.dependencies)?(typeof p=="function"&&(Wo(t,a,p,n),q=t.memoizedState),(K=vl||Df(t,a,K,n,H,q,S)||e!==null&&e.dependencies!==null&&Dr(e.dependencies))?(L||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,q,S),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,q,S)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=q),i.props=n,i.state=q,i.context=S,n=K):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Fr(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=en(t,e.child,null,r),t.child=en(t,null,a,r)):qt(e,t,a,r),t.memoizedState=i.state,e=t.child):e=Ja(e,t,r),e}function $f(e,t,a,n){return $l(),t.flags|=256,qt(e,t,a,n),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:Ld()}}function lc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ia),e}function Jf(e,t,a){var n=t.pendingProps,r=!1,i=(t.flags&128)!==0,f;if((f=i)||(f=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),f&&(r=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(r?yl(t):jl(),(e=xt)?(e=lh(e,ga),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ml!==null?{id:Oa,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},a=Ad(e),a.return=t,t.child=a,Ut=t,xt=null)):e=null,e===null)throw pl(t);return Bc(e)?t.lanes=32:t.lanes=536870912,null}var p=n.children;return n=n.fallback,r?(jl(),r=t.mode,p=Ir({mode:"hidden",children:p},r),n=Kl(n,r,a,null),p.return=t,n.return=t,p.sibling=n,t.child=p,n=t.child,n.memoizedState=ac(a),n.childLanes=lc(e,f,a),t.memoizedState=tc,Ts(null,n)):(yl(t),nc(t,p))}var S=e.memoizedState;if(S!==null&&(p=S.dehydrated,p!==null)){if(i)t.flags&256?(yl(t),t.flags&=-257,t=sc(e,t,a)):t.memoizedState!==null?(jl(),t.child=e.child,t.flags|=128,t=null):(jl(),p=n.fallback,r=t.mode,n=Ir({mode:"visible",children:n.children},r),p=Kl(p,r,a,null),p.flags|=2,n.return=t,p.return=t,n.sibling=p,t.child=n,en(t,e.child,null,a),n=t.child,n.memoizedState=ac(a),n.childLanes=lc(e,f,a),t.memoizedState=tc,t=Ts(null,n));else if(yl(t),Bc(p)){if(f=p.nextSibling&&p.nextSibling.dataset,f)var L=f.dgst;f=L,n=Error(u(419)),n.stack="",n.digest=f,gs({value:n,source:null,stack:null}),t=sc(e,t,a)}else if(At||Tn(e,t,a,!1),f=(a&e.childLanes)!==0,At||f){if(f=dt,f!==null&&(n=fr(f,a),n!==0&&n!==S.retryLane))throw S.retryLane=n,Zl(e,n),ea(f,e,n),Po;Uc(p)||ii(),t=sc(e,t,a)}else Uc(p)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,xt=ya(p.nextSibling),Ut=t,We=!0,hl=null,ga=!1,e!==null&&Td(t,e),t=nc(t,n.children),t.flags|=4096);return t}return r?(jl(),p=n.fallback,r=t.mode,S=e.child,L=S.sibling,n=Ya(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,L!==null?p=Ya(L,p):(p=Kl(p,r,a,null),p.flags|=2),p.return=t,n.return=t,n.sibling=p,t.child=n,Ts(null,n),n=t.child,p=e.child.memoizedState,p===null?p=ac(a):(r=p.cachePool,r!==null?(S=Ct._currentValue,r=r.parent!==S?{parent:S,pool:S}:r):r=Ld(),p={baseLanes:p.baseLanes|a,cachePool:r}),n.memoizedState=p,n.childLanes=lc(e,f,a),t.memoizedState=tc,Ts(e.child,n)):(yl(t),a=e.child,e=a.sibling,a=Ya(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function nc(e,t){return t=Ir({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ir(e,t){return e=la(22,e,null,t),e.lanes=0,e}function sc(e,t,a){return en(t,e.child,null,a),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),yo(e.return,t,a)}function rc(e,t,a,n,r,i){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:i}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=a,f.tailMode=r,f.treeForkCount=i)}function Ff(e,t,a){var n=t.pendingProps,r=n.revealOrder,i=n.tail;n=n.children;var f=St.current,p=(f&2)!==0;if(p?(f=f&1|2,t.flags|=128):f&=1,Y(St,f),qt(e,t,n,a),n=We?vs:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wf(e,a,t);else if(e.tag===19)Wf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&qr(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),rc(t,!1,r,a,i,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&qr(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}rc(t,!0,a,null,i,n);break;case"together":rc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ja(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),wl|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Tn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=Ya(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ya(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ic(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Dr(e)))}function gv(e,t,a){switch(t.tag){case 3:Z(t,t.stateNode.containerInfo),xl(t,Ct,e.memoizedState.cache),$l();break;case 27:case 5:Oe(t);break;case 4:Z(t,t.stateNode.containerInfo);break;case 10:xl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Do(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(yl(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Jf(e,t,a):(yl(t),e=Ja(e,t,a),e!==null?e.sibling:null);yl(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Tn(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return Ff(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Y(St,St.current),n)break;return null;case 22:return t.lanes=0,Yf(e,t,a,t.pendingProps);case 24:xl(t,Ct,e.memoizedState.cache)}return Ja(e,t,a)}function If(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!ic(e,a)&&(t.flags&128)===0)return At=!1,gv(e,t,a);At=(e.flags&131072)!==0}else At=!1,We&&(t.flags&1048576)!==0&&kd(t,vs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Il(t.elementType),t.type=e,typeof e=="function")fo(e)?(n=an(e,n),t.tag=1,t=Kf(null,t,e,n,a)):(t.tag=0,t=ec(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===G){t.tag=11,t=qf(null,t,e,n,a);break e}else if(r===ee){t.tag=14,t=Gf(null,t,e,n,a);break e}}throw t=oe(e)||e,Error(u(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=an(n,t.pendingProps),Kf(e,t,n,r,a);case 3:e:{if(Z(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var i=t.memoizedState;r=i.element,Ao(e,t),Cs(t,n,null,a);var f=t.memoizedState;if(n=f.cache,xl(t,Ct,n),n!==i.cache&&jo(t,[Ct],a,!0),ws(),n=f.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=$f(e,t,n,a);break e}else if(n!==r){r=pa(Error(u(424)),t),gs(r),t=$f(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(xt=ya(e.firstChild),Ut=t,We=!0,hl=null,ga=!0,a=Vd(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($l(),n===r){t=Ja(e,t,a);break e}qt(e,t,n,a)}t=t.child}return t;case 26:return Fr(e,t),e===null?(a=ch(t.type,null,t.pendingProps,null))?t.memoizedState=a:We||(a=t.type,e=t.pendingProps,n=hi(B.current).createElement(a),n[Mt]=t,n[Vt]=e,Gt(n,a,e),it(n),t.stateNode=n):t.memoizedState=ch(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&We&&(n=t.stateNode=rh(t.type,t.pendingProps,B.current),Ut=t,ga=!0,r=xt,kl(t.type)?(qc=r,xt=ya(n.firstChild)):xt=r),qt(e,t,t.pendingProps.children,a),Fr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((r=n=xt)&&(n=$v(n,t.type,t.pendingProps,ga),n!==null?(t.stateNode=n,Ut=t,xt=ya(n.firstChild),ga=!1,r=!0):r=!1),r||pl(t)),Oe(t),r=t.type,i=t.pendingProps,f=e!==null?e.memoizedProps:null,n=i.children,Rc(r,i)?n=null:f!==null&&Rc(r,f)&&(t.flags|=32),t.memoizedState!==null&&(r=_o(e,t,cv,null,null,a),Xs._currentValue=r),Fr(e,t),qt(e,t,n,a),t.child;case 6:return e===null&&We&&((e=a=xt)&&(a=Jv(a,t.pendingProps,ga),a!==null?(t.stateNode=a,Ut=t,xt=null,e=!0):e=!1),e||pl(t)),null;case 13:return Jf(e,t,a);case 4:return Z(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=en(t,null,n,a):qt(e,t,n,a),t.child;case 11:return qf(e,t,t.type,t.pendingProps,a);case 7:return qt(e,t,t.pendingProps,a),t.child;case 8:return qt(e,t,t.pendingProps.children,a),t.child;case 12:return qt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,xl(t,t.type,n.value),qt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Wl(t),r=Bt(r),n=n(r),t.flags|=1,qt(e,t,n,a),t.child;case 14:return Gf(e,t,t.type,t.pendingProps,a);case 15:return Vf(e,t,t.type,t.pendingProps,a);case 19:return Ff(e,t,a);case 31:return vv(e,t,a);case 22:return Yf(e,t,a,t.pendingProps);case 24:return Wl(t),n=Bt(Ct),e===null?(r=wo(),r===null&&(r=dt,i=No(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=a),r=i),t.memoizedState={parent:n,cache:r},zo(t),xl(t,Ct,r)):((e.lanes&a)!==0&&(Ao(e,t),Cs(t,null,null,a),ws()),r=e.memoizedState,i=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),xl(t,Ct,n)):(n=i.cache,xl(t,Ct,n),n!==r.cache&&jo(t,[Ct],a,!0))),qt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Wa(e){e.flags|=4}function oc(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Cm())e.flags|=8192;else throw Pl=Lr,Co}else e.flags&=-16777217}function Pf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hh(t))if(Cm())e.flags|=8192;else throw Pl=Lr,Co}function Pr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hn():536870912,e.lanes|=t,Vn|=t)}function Ms(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function bv(e,t,a){var n=t.pendingProps;switch(xo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(t),null;case 1:return vt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Za(Ct),re(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(kn(t)?Wa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,go())),vt(t),null;case 26:var r=t.type,i=t.memoizedState;return e===null?(Wa(t),i!==null?(vt(t),Pf(t,i)):(vt(t),oc(t,r,null,n,a))):i?i!==e.memoizedState?(Wa(t),vt(t),Pf(t,i)):(vt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Wa(t),vt(t),oc(t,r,e,n,a)),null;case 27:if(ve(t),a=B.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Wa(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return vt(t),null}e=Q.current,kn(t)?Md(t):(e=rh(r,n,a),t.stateNode=e,Wa(t))}return vt(t),null;case 5:if(ve(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Wa(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return vt(t),null}if(i=Q.current,kn(t))Md(t);else{var f=hi(B.current);switch(i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?f.createElement(r,{is:n.is}):f.createElement(r)}}i[Mt]=t,i[Vt]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=i;e:switch(Gt(i,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Wa(t)}}return vt(t),oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Wa(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=B.current,kn(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=Ut,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Jm(e.nodeValue,a)),e||pl(t,!0)}else e=hi(e).createTextNode(n),e[Mt]=t,t.stateNode=e}return vt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=kn(t),a!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Mt]=t}else $l(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;vt(t),e=!1}else a=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(sa(t),t):(sa(t),null);if((t.flags&128)!==0)throw Error(u(558))}return vt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=kn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[Mt]=t}else $l(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;vt(t),r=!1}else r=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(sa(t),t):(sa(t),null)}return sa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Pr(t,t.updateQueue),vt(t),null);case 4:return re(),e===null&&Tc(t.stateNode.containerInfo),vt(t),null;case 10:return Za(t.type),vt(t),null;case 19:if(D(St),n=t.memoizedState,n===null)return vt(t),null;if(r=(t.flags&128)!==0,i=n.rendering,i===null)if(r)Ms(n,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=qr(e),i!==null){for(t.flags|=128,Ms(n,!1),e=i.updateQueue,t.updateQueue=e,Pr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)zd(a,e),a=a.sibling;return Y(St,St.current&1|2),We&&Qa(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&et()>ni&&(t.flags|=128,r=!0,Ms(n,!1),t.lanes=4194304)}else{if(!r)if(e=qr(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Pr(t,e),Ms(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!We)return vt(t),null}else 2*et()-n.renderingStartTime>ni&&a!==536870912&&(t.flags|=128,r=!0,Ms(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=et(),e.sibling=null,a=St.current,Y(St,r?a&1|2:a&1),We&&Qa(t,n.treeForkCount),e):(vt(t),null);case 22:case 23:return sa(t),Mo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(vt(t),t.subtreeFlags&6&&(t.flags|=8192)):vt(t),a=t.updateQueue,a!==null&&Pr(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&D(Fl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Za(Ct),vt(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function yv(e,t){switch(xo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Za(Ct),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(sa(t),t.alternate===null)throw Error(u(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(St),null;case 4:return re(),null;case 10:return Za(t.type),null;case 22:case 23:return sa(t),Mo(),e!==null&&D(Fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Za(Ct),null;case 25:return null;default:return null}}function em(e,t){switch(xo(t),t.tag){case 3:Za(Ct),re();break;case 26:case 27:case 5:ve(t);break;case 4:re();break;case 31:t.memoizedState!==null&&sa(t);break;case 13:sa(t);break;case 19:D(St);break;case 10:Za(t.type);break;case 22:case 23:sa(t),Mo(),e!==null&&D(Fl);break;case 24:Za(Ct)}}function Ds(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var i=a.create,f=a.inst;n=i(),f.destroy=n}a=a.next}while(a!==r)}}catch(p){st(t,t.return,p)}}function Nl(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){var f=n.inst,p=f.destroy;if(p!==void 0){f.destroy=void 0,r=t;var S=a,L=p;try{L()}catch(K){st(r,S,K)}}}n=n.next}while(n!==i)}}catch(K){st(t,t.return,K)}}function tm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Qd(t,a)}catch(n){st(e,e.return,n)}}}function am(e,t,a){a.props=an(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){st(e,t,n)}}function Os(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){st(e,t,r)}}function Ra(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){st(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){st(e,t,r)}else a.current=null}function lm(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){st(e,e.return,r)}}function cc(e,t,a){try{var n=e.stateNode;Vv(n,e.type,a,t),n[Vt]=t}catch(r){st(e,e.return,r)}}function nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kl(e.type)||e.tag===4}function uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ga));else if(n!==4&&(n===27&&kl(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,a),e=e.sibling;e!==null;)dc(e,t,a),e=e.sibling}function ei(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&kl(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ei(e,t,a),e=e.sibling;e!==null;)ei(e,t,a),e=e.sibling}function sm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Gt(t,n,a),t[Mt]=e,t[Vt]=a}catch(i){st(e,e.return,i)}}var Fa=!1,Et=!1,fc=!1,rm=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function jv(e,t){if(e=e.containerInfo,Oc=ji,e=vd(e),no(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var f=0,p=-1,S=-1,L=0,K=0,I=e,H=null;t:for(;;){for(var q;I!==a||r!==0&&I.nodeType!==3||(p=f+r),I!==i||n!==0&&I.nodeType!==3||(S=f+n),I.nodeType===3&&(f+=I.nodeValue.length),(q=I.firstChild)!==null;)H=I,I=q;for(;;){if(I===e)break t;if(H===a&&++L===r&&(p=f),H===i&&++K===n&&(S=f),(q=I.nextSibling)!==null)break;I=H,H=I.parentNode}I=q}a=p===-1||S===-1?null:{start:p,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(_c={focusedElem:e,selectionRange:a},ji=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,r=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var Ne=an(a.type,r);e=n.getSnapshotBeforeUpdate(Ne,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(De){st(a,a.return,De)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Hc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Lt=e;break}Lt=t.return}}function im(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Pa(e,a),n&4&&Ds(5,a);break;case 1:if(Pa(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){st(a,a.return,f)}else{var r=an(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){st(a,a.return,f)}}n&64&&tm(a),n&512&&Os(a,a.return);break;case 3:if(Pa(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Qd(e,t)}catch(f){st(a,a.return,f)}}break;case 27:t===null&&n&4&&sm(a);case 26:case 5:Pa(e,a),t===null&&n&4&&lm(a),n&512&&Os(a,a.return);break;case 12:Pa(e,a);break;case 31:Pa(e,a),n&4&&um(e,a);break;case 13:Pa(e,a),n&4&&dm(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Tv.bind(null,a),Wv(e,a))));break;case 22:if(n=a.memoizedState!==null||Fa,!n){t=t!==null&&t.memoizedState!==null||Et,r=Fa;var i=Et;Fa=n,(Et=t)&&!i?el(e,a,(a.subtreeFlags&8772)!==0):Pa(e,a),Fa=r,Et=i}break;case 30:break;default:Pa(e,a)}}function om(e){var t=e.alternate;t!==null&&(e.alternate=null,om(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Re(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gt=null,Wt=!1;function Ia(e,t,a){for(a=a.child;a!==null;)cm(e,t,a),a=a.sibling}function cm(e,t,a){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(bt,a)}catch{}switch(a.tag){case 26:Et||Ra(a,t),Ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Et||Ra(a,t);var n=gt,r=Wt;kl(a.type)&&(gt=a.stateNode,Wt=!1),Ia(e,t,a),Vs(a.stateNode),gt=n,Wt=r;break;case 5:Et||Ra(a,t);case 6:if(n=gt,r=Wt,gt=null,Ia(e,t,a),gt=n,Wt=r,gt!==null)if(Wt)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(a.stateNode)}catch(i){st(a,t,i)}else try{gt.removeChild(a.stateNode)}catch(i){st(a,t,i)}break;case 18:gt!==null&&(Wt?(e=gt,th(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Wn(e)):th(gt,a.stateNode));break;case 4:n=gt,r=Wt,gt=a.stateNode.containerInfo,Wt=!0,Ia(e,t,a),gt=n,Wt=r;break;case 0:case 11:case 14:case 15:Nl(2,a,t),Et||Nl(4,a,t),Ia(e,t,a);break;case 1:Et||(Ra(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&am(a,t,n)),Ia(e,t,a);break;case 21:Ia(e,t,a);break;case 22:Et=(n=Et)||a.memoizedState!==null,Ia(e,t,a),Et=n;break;default:Ia(e,t,a)}}function um(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wn(e)}catch(a){st(t,t.return,a)}}}function dm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wn(e)}catch(a){st(t,t.return,a)}}function Nv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rm),t;default:throw Error(u(435,e.tag))}}function ti(e,t){var a=Nv(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=Mv.bind(null,e,n);n.then(r,r)}})}function Ft(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],i=e,f=t,p=f;e:for(;p!==null;){switch(p.tag){case 27:if(kl(p.type)){gt=p.stateNode,Wt=!1;break e}break;case 5:gt=p.stateNode,Wt=!1;break e;case 3:case 4:gt=p.stateNode.containerInfo,Wt=!0;break e}p=p.return}if(gt===null)throw Error(u(160));cm(i,f,r),gt=null,Wt=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fm(t,e),t=t.sibling}var Aa=null;function fm(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(t,e),It(e),n&4&&(Nl(3,e,e.return),Ds(3,e),Nl(5,e,e.return));break;case 1:Ft(t,e),It(e),n&512&&(Et||a===null||Ra(a,a.return)),n&64&&Fa&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=Aa;if(Ft(t,e),It(e),n&512&&(Et||a===null||Ra(a,a.return)),n&4){var i=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":i=r.getElementsByTagName("title")[0],(!i||i[ge]||i[Mt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(n),r.head.insertBefore(i,r.querySelector("head > title"))),Gt(i,n,a),i[Mt]=e,it(i),n=i;break e;case"link":var f=fh("link","href",r).get(n+(a.href||""));if(f){for(var p=0;p<f.length;p++)if(i=f[p],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(p,1);break t}}i=r.createElement(n),Gt(i,n,a),r.head.appendChild(i);break;case"meta":if(f=fh("meta","content",r).get(n+(a.content||""))){for(p=0;p<f.length;p++)if(i=f[p],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(p,1);break t}}i=r.createElement(n),Gt(i,n,a),r.head.appendChild(i);break;default:throw Error(u(468,n))}i[Mt]=e,it(i),n=i}e.stateNode=n}else mh(r,e.type,e.stateNode);else e.stateNode=dh(r,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?mh(r,e.type,e.stateNode):dh(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&cc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ft(t,e),It(e),n&512&&(Et||a===null||Ra(a,a.return)),a!==null&&n&4&&cc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ft(t,e),It(e),n&512&&(Et||a===null||Ra(a,a.return)),e.flags&32){r=e.stateNode;try{bn(r,"")}catch(Ne){st(e,e.return,Ne)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,cc(e,r,a!==null?a.memoizedProps:r)),n&1024&&(fc=!0);break;case 6:if(Ft(t,e),It(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(Ne){st(e,e.return,Ne)}}break;case 3:if(vi=null,r=Aa,Aa=pi(t.containerInfo),Ft(t,e),Aa=r,It(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Wn(t.containerInfo)}catch(Ne){st(e,e.return,Ne)}fc&&(fc=!1,mm(e));break;case 4:n=Aa,Aa=pi(e.stateNode.containerInfo),Ft(t,e),It(e),Aa=n;break;case 12:Ft(t,e),It(e);break;case 31:Ft(t,e),It(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ti(e,n)));break;case 13:Ft(t,e),It(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(li=et()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ti(e,n)));break;case 22:r=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,L=Fa,K=Et;if(Fa=L||r,Et=K||S,Ft(t,e),Et=K,Fa=L,It(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||S||Fa||Et||ln(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(i=S.stateNode,r)f=i.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{p=S.stateNode;var I=S.memoizedProps.style,H=I!=null&&I.hasOwnProperty("display")?I.display:null;p.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(Ne){st(S,S.return,Ne)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=r?"":S.memoizedProps}catch(Ne){st(S,S.return,Ne)}}}else if(t.tag===18){if(a===null){S=t;try{var q=S.stateNode;r?ah(q,!0):ah(S.stateNode,!1)}catch(Ne){st(S,S.return,Ne)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,ti(e,a))));break;case 19:Ft(t,e),It(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ti(e,n)));break;case 30:break;case 21:break;default:Ft(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(nm(n)){a=n;break}n=n.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var r=a.stateNode,i=uc(e);ei(e,i,r);break;case 5:var f=a.stateNode;a.flags&32&&(bn(f,""),a.flags&=-33);var p=uc(e);ei(e,p,f);break;case 3:case 4:var S=a.stateNode.containerInfo,L=uc(e);dc(e,L,S);break;default:throw Error(u(161))}}catch(K){st(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Pa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)im(e,t.alternate,t),t=t.sibling}function ln(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Nl(4,t,t.return),ln(t);break;case 1:Ra(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&am(t,t.return,a),ln(t);break;case 27:Vs(t.stateNode);case 26:case 5:Ra(t,t.return),ln(t);break;case 22:t.memoizedState===null&&ln(t);break;case 30:ln(t);break;default:ln(t)}e=e.sibling}}function el(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,i=t,f=i.flags;switch(i.tag){case 0:case 11:case 15:el(r,i,a),Ds(4,i);break;case 1:if(el(r,i,a),n=i,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(L){st(n,n.return,L)}if(n=i,r=n.updateQueue,r!==null){var p=n.stateNode;try{var S=r.shared.hiddenCallbacks;if(S!==null)for(r.shared.hiddenCallbacks=null,r=0;r<S.length;r++)Yd(S[r],p)}catch(L){st(n,n.return,L)}}a&&f&64&&tm(i),Os(i,i.return);break;case 27:sm(i);case 26:case 5:el(r,i,a),a&&n===null&&f&4&&lm(i),Os(i,i.return);break;case 12:el(r,i,a);break;case 31:el(r,i,a),a&&f&4&&um(r,i);break;case 13:el(r,i,a),a&&f&4&&dm(r,i);break;case 22:i.memoizedState===null&&el(r,i,a),Os(i,i.return);break;case 30:break;default:el(r,i,a)}t=t.sibling}}function mc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&bs(a))}function hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bs(e))}function Ea(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hm(e,t,a,n),t=t.sibling}function hm(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,n),r&2048&&Ds(9,t);break;case 1:Ea(e,t,a,n);break;case 3:Ea(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bs(e)));break;case 12:if(r&2048){Ea(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,f=i.id,p=i.onPostCommit;typeof p=="function"&&p(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){st(t,t.return,S)}}else Ea(e,t,a,n);break;case 31:Ea(e,t,a,n);break;case 13:Ea(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,f=t.alternate,t.memoizedState!==null?i._visibility&2?Ea(e,t,a,n):_s(e,t):i._visibility&2?Ea(e,t,a,n):(i._visibility|=2,Bn(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&mc(f,t);break;case 24:Ea(e,t,a,n),r&2048&&hc(t.alternate,t);break;default:Ea(e,t,a,n)}}function Bn(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,f=t,p=a,S=n,L=f.flags;switch(f.tag){case 0:case 11:case 15:Bn(i,f,p,S,r),Ds(8,f);break;case 23:break;case 22:var K=f.stateNode;f.memoizedState!==null?K._visibility&2?Bn(i,f,p,S,r):_s(i,f):(K._visibility|=2,Bn(i,f,p,S,r)),r&&L&2048&&mc(f.alternate,f);break;case 24:Bn(i,f,p,S,r),r&&L&2048&&hc(f.alternate,f);break;default:Bn(i,f,p,S,r)}t=t.sibling}}function _s(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:_s(a,n),r&2048&&mc(n.alternate,n);break;case 24:_s(a,n),r&2048&&hc(n.alternate,n);break;default:_s(a,n)}t=t.sibling}}var Rs=8192;function qn(e,t,a){if(e.subtreeFlags&Rs)for(e=e.child;e!==null;)pm(e,t,a),e=e.sibling}function pm(e,t,a){switch(e.tag){case 26:qn(e,t,a),e.flags&Rs&&e.memoizedState!==null&&og(a,Aa,e.memoizedState,e.memoizedProps);break;case 5:qn(e,t,a);break;case 3:case 4:var n=Aa;Aa=pi(e.stateNode.containerInfo),qn(e,t,a),Aa=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Rs,Rs=16777216,qn(e,t,a),Rs=n):qn(e,t,a));break;default:qn(e,t,a)}}function xm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ls(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Lt=n,gm(n,e)}xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vm(e),e=e.sibling}function vm(e){switch(e.tag){case 0:case 11:case 15:Ls(e),e.flags&2048&&Nl(9,e,e.return);break;case 3:Ls(e);break;case 12:Ls(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ai(e)):Ls(e);break;default:Ls(e)}}function ai(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Lt=n,gm(n,e)}xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Nl(8,t,t.return),ai(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ai(t));break;default:ai(t)}e=e.sibling}}function gm(e,t){for(;Lt!==null;){var a=Lt;switch(a.tag){case 0:case 11:case 15:Nl(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:bs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Lt=n;else e:for(a=e;Lt!==null;){n=Lt;var r=n.sibling,i=n.return;if(om(n),n===a){Lt=null;break e}if(r!==null){r.return=i,Lt=r;break e}Lt=i}}}var Sv={getCacheForType:function(e){var t=Bt(Ct),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Bt(Ct).controller.signal}},wv=typeof WeakMap=="function"?WeakMap:Map,tt=0,dt=null,Xe=null,Ke=0,nt=0,ra=null,Sl=!1,Gn=!1,pc=!1,tl=0,Nt=0,wl=0,nn=0,xc=0,ia=0,Vn=0,Hs=null,Pt=null,vc=!1,li=0,bm=0,ni=1/0,si=null,Cl=null,Dt=0,zl=null,Yn=null,al=0,gc=0,bc=null,ym=null,Us=0,yc=null;function oa(){return(tt&2)!==0&&Ke!==0?Ke&-Ke:E.T!==null?zc():mr()}function jm(){if(ia===0)if((Ke&536870912)===0||We){var e=wa;wa<<=1,(wa&3932160)===0&&(wa=262144),ia=e}else ia=536870912;return e=na.current,e!==null&&(e.flags|=32),ia}function ea(e,t,a){(e===dt&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(Qn(e,0),Al(e,Ke,ia,!1)),ql(e,a),((tt&2)===0||e!==dt)&&(e===dt&&((tt&2)===0&&(nn|=a),Nt===4&&Al(e,Ke,ia,!1)),La(e))}function Nm(e,t,a){if((tt&6)!==0)throw Error(u(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Bl(e,t),r=n?Av(e,t):Nc(e,t,!0),i=n;do{if(r===0){Gn&&!n&&Al(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Cv(a)){r=Nc(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var p=e;r=Hs;var S=p.current.memoizedState.isDehydrated;if(S&&(Qn(p,f).flags|=256),f=Nc(p,f,!1),f!==2){if(pc&&!S){p.errorRecoveryDisabledLanes|=i,nn|=i,r=4;break e}i=Pt,Pt=r,i!==null&&(Pt===null?Pt=i:Pt.push.apply(Pt,i))}r=f}if(i=!1,r!==2)continue}}if(r===1){Qn(e,0),Al(e,t,0,!0);break}e:{switch(n=e,i=r,i){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Al(n,t,ia,!Sl);break e;case 2:Pt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(r=li+300-et(),10<r)){if(Al(n,t,ia,!Sl),mn(n,0,!0)!==0)break e;al=t,n.timeoutHandle=Pm(Sm.bind(null,n,a,Pt,si,vc,t,ia,nn,Vn,Sl,i,"Throttled",-0,0),r);break e}Sm(n,a,Pt,si,vc,t,ia,nn,Vn,Sl,i,null,-0,0)}}break}while(!0);La(e)}function Sm(e,t,a,n,r,i,f,p,S,L,K,I,H,q){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ga},pm(t,i,I);var Ne=(i&62914560)===i?li-et():(i&4194048)===i?bm-et():0;if(Ne=cg(I,Ne),Ne!==null){al=i,e.cancelPendingCommit=Ne(Mm.bind(null,e,t,i,a,n,r,f,p,S,K,I,null,H,q)),Al(e,i,f,!L);return}}Mm(e,t,i,a,n,r,f,p,S)}function Cv(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],i=r.getSnapshot;r=r.value;try{if(!aa(i(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Al(e,t,a,n){t&=~xc,t&=~nn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var i=31-Tt(r),f=1<<i;n[i]=-1,r&=~f}a!==0&&rs(e,a,t)}function ri(){return(tt&6)===0?(Bs(0),!1):!0}function jc(){if(Xe!==null){if(nt===0)var e=Xe.return;else e=Xe,Xa=Jl=null,Ho(e),_n=null,js=0,e=Xe;for(;e!==null;)em(e.alternate,e),e=e.return;Xe=null}}function Qn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Xv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),al=0,jc(),dt=e,Xe=a=Ya(e.current,null),Ke=t,nt=0,ra=null,Sl=!1,Gn=Bl(e,t),pc=!1,Vn=ia=xc=nn=wl=Nt=0,Pt=Hs=null,vc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Tt(n),i=1<<r;t|=e[r],n&=~i}return tl=t,Ar(),a}function wm(e,t){Be=null,E.H=ks,t===On||t===Rr?(t=Bd(),nt=3):t===Co?(t=Bd(),nt=4):nt=t===Po?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ra=t,Xe===null&&(Nt=1,Jr(e,pa(t,e.current)))}function Cm(){var e=na.current;return e===null?!0:(Ke&4194048)===Ke?ba===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===ba:!1}function zm(){var e=E.H;return E.H=ks,e===null?ks:e}function Am(){var e=E.A;return E.A=Sv,e}function ii(){Nt=4,Sl||(Ke&4194048)!==Ke&&na.current!==null||(Gn=!0),(wl&134217727)===0&&(nn&134217727)===0||dt===null||Al(dt,Ke,ia,!1)}function Nc(e,t,a){var n=tt;tt|=2;var r=zm(),i=Am();(dt!==e||Ke!==t)&&(si=null,Qn(e,t)),t=!1;var f=Nt;e:do try{if(nt!==0&&Xe!==null){var p=Xe,S=ra;switch(nt){case 8:jc(),f=6;break e;case 3:case 2:case 9:case 6:na.current===null&&(t=!0);var L=nt;if(nt=0,ra=null,Xn(e,p,S,L),a&&Gn){f=0;break e}break;default:L=nt,nt=0,ra=null,Xn(e,p,S,L)}}zv(),f=Nt;break}catch(K){wm(e,K)}while(!0);return t&&e.shellSuspendCounter++,Xa=Jl=null,tt=n,E.H=r,E.A=i,Xe===null&&(dt=null,Ke=0,Ar()),f}function zv(){for(;Xe!==null;)Em(Xe)}function Av(e,t){var a=tt;tt|=2;var n=zm(),r=Am();dt!==e||Ke!==t?(si=null,ni=et()+500,Qn(e,t)):Gn=Bl(e,t);e:do try{if(nt!==0&&Xe!==null){t=Xe;var i=ra;t:switch(nt){case 1:nt=0,ra=null,Xn(e,t,i,1);break;case 2:case 9:if(Hd(i)){nt=0,ra=null,km(t);break}t=function(){nt!==2&&nt!==9||dt!==e||(nt=7),La(e)},i.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:Hd(i)?(nt=0,ra=null,km(t)):(nt=0,ra=null,Xn(e,t,i,7));break;case 5:var f=null;switch(Xe.tag){case 26:f=Xe.memoizedState;case 5:case 27:var p=Xe;if(f?hh(f):p.stateNode.complete){nt=0,ra=null;var S=p.sibling;if(S!==null)Xe=S;else{var L=p.return;L!==null?(Xe=L,oi(L)):Xe=null}break t}}nt=0,ra=null,Xn(e,t,i,5);break;case 6:nt=0,ra=null,Xn(e,t,i,6);break;case 8:jc(),Nt=6;break e;default:throw Error(u(462))}}Ev();break}catch(K){wm(e,K)}while(!0);return Xa=Jl=null,E.H=n,E.A=r,tt=a,Xe!==null?0:(dt=null,Ke=0,Ar(),Nt)}function Ev(){for(;Xe!==null&&!Le();)Em(Xe)}function Em(e){var t=If(e.alternate,e,tl);e.memoizedProps=e.pendingProps,t===null?oi(e):Xe=t}function km(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Zf(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Zf(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:Ho(t);default:em(a,t),t=Xe=zd(t,tl),t=If(a,t,tl)}e.memoizedProps=e.pendingProps,t===null?oi(e):Xe=t}function Xn(e,t,a,n){Xa=Jl=null,Ho(t),_n=null,js=0;var r=t.return;try{if(xv(e,r,t,a,Ke)){Nt=1,Jr(e,pa(a,e.current)),Xe=null;return}}catch(i){if(r!==null)throw Xe=r,i;Nt=1,Jr(e,pa(a,e.current)),Xe=null;return}t.flags&32768?(We||n===1?e=!0:Gn||(Ke&536870912)!==0?e=!1:(Sl=e=!0,(n===2||n===9||n===3||n===6)&&(n=na.current,n!==null&&n.tag===13&&(n.flags|=16384))),Tm(t,e)):oi(t)}function oi(e){var t=e;do{if((t.flags&32768)!==0){Tm(t,Sl);return}e=t.return;var a=bv(t.alternate,t,tl);if(a!==null){Xe=a;return}if(t=t.sibling,t!==null){Xe=t;return}Xe=t=e}while(t!==null);Nt===0&&(Nt=5)}function Tm(e,t){do{var a=yv(e.alternate,e);if(a!==null){a.flags&=32767,Xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=a}while(e!==null);Nt=6,Xe=null}function Mm(e,t,a,n,r,i,f,p,S){e.cancelPendingCommit=null;do ci();while(Dt!==0);if((tt&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(i=t.lanes|t.childLanes,i|=co,Gi(e,a,i,f,p,S),e===dt&&(Xe=dt=null,Ke=0),Yn=t,zl=e,al=a,gc=i,bc=r,ym=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Dv(Zt,function(){return Lm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null,r=$.p,$.p=2,f=tt,tt|=4;try{jv(e,t,a)}finally{tt=f,$.p=r,E.T=n}}Dt=1,Dm(),Om(),_m()}}function Dm(){if(Dt===1){Dt=0;var e=zl,t=Yn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=E.T,E.T=null;var n=$.p;$.p=2;var r=tt;tt|=4;try{fm(t,e);var i=_c,f=vd(e.containerInfo),p=i.focusedElem,S=i.selectionRange;if(f!==p&&p&&p.ownerDocument&&xd(p.ownerDocument.documentElement,p)){if(S!==null&&no(p)){var L=S.start,K=S.end;if(K===void 0&&(K=L),"selectionStart"in p)p.selectionStart=L,p.selectionEnd=Math.min(K,p.value.length);else{var I=p.ownerDocument||document,H=I&&I.defaultView||window;if(H.getSelection){var q=H.getSelection(),Ne=p.textContent.length,De=Math.min(S.start,Ne),ut=S.end===void 0?De:Math.min(S.end,Ne);!q.extend&&De>ut&&(f=ut,ut=De,De=f);var M=pd(p,De),C=pd(p,ut);if(M&&C&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==C.node||q.focusOffset!==C.offset)){var R=I.createRange();R.setStart(M.node,M.offset),q.removeAllRanges(),De>ut?(q.addRange(R),q.extend(C.node,C.offset)):(R.setEnd(C.node,C.offset),q.addRange(R))}}}}for(I=[],q=p;q=q.parentNode;)q.nodeType===1&&I.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<I.length;p++){var W=I[p];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}ji=!!Oc,_c=Oc=null}finally{tt=r,$.p=n,E.T=a}}e.current=t,Dt=2}}function Om(){if(Dt===2){Dt=0;var e=zl,t=Yn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=E.T,E.T=null;var n=$.p;$.p=2;var r=tt;tt|=4;try{im(e,t.alternate,t)}finally{tt=r,$.p=n,E.T=a}}Dt=3}}function _m(){if(Dt===4||Dt===3){Dt=0,kt();var e=zl,t=Yn,a=al,n=ym;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,Yn=zl=null,Rm(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Cl=null),pn(a),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(bt,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=E.T,r=$.p,$.p=2,E.T=null;try{for(var i=e.onRecoverableError,f=0;f<n.length;f++){var p=n[f];i(p.value,{componentStack:p.stack})}}finally{E.T=t,$.p=r}}(al&3)!==0&&ci(),La(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===yc?Us++:(Us=0,yc=e):Us=0,Bs(0)}}function Rm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bs(t)))}function ci(){return Dm(),Om(),_m(),Lm()}function Lm(){if(Dt!==5)return!1;var e=zl,t=gc;gc=0;var a=pn(al),n=E.T,r=$.p;try{$.p=32>a?32:a,E.T=null,a=bc,bc=null;var i=zl,f=al;if(Dt=0,Yn=zl=null,al=0,(tt&6)!==0)throw Error(u(331));var p=tt;if(tt|=4,vm(i.current),hm(i,i.current,f,a),tt=p,Bs(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(bt,i)}catch{}return!0}finally{$.p=r,E.T=n,Rm(e,t)}}function Hm(e,t,a){t=pa(a,t),t=Io(e.stateNode,t,2),e=bl(e,t,2),e!==null&&(ql(e,2),La(e))}function st(e,t,a){if(e.tag===3)Hm(e,e,a);else for(;t!==null;){if(t.tag===3){Hm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Cl===null||!Cl.has(n))){e=pa(a,e),a=Uf(2),n=bl(t,a,2),n!==null&&(Bf(a,n,t,e),ql(n,2),La(n));break}}t=t.return}}function Sc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new wv;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(pc=!0,r.add(a),e=kv.bind(null,e,t,a),t.then(e,e))}function kv(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,dt===e&&(Ke&a)===a&&(Nt===4||Nt===3&&(Ke&62914560)===Ke&&300>et()-li?(tt&2)===0&&Qn(e,0):xc|=a,Vn===Ke&&(Vn=0)),La(e)}function Um(e,t){t===0&&(t=hn()),e=Zl(e,t),e!==null&&(ql(e,t),La(e))}function Tv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Um(e,a)}function Mv(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),Um(e,a)}function Dv(e,t){return Pe(e,t)}var ui=null,Zn=null,wc=!1,di=!1,Cc=!1,El=0;function La(e){e!==Zn&&e.next===null&&(Zn===null?ui=Zn=e:Zn=Zn.next=e),di=!0,wc||(wc=!0,_v())}function Bs(e,t){if(!Cc&&di){Cc=!0;do for(var a=!1,n=ui;n!==null;){if(e!==0){var r=n.pendingLanes;if(r===0)var i=0;else{var f=n.suspendedLanes,p=n.pingedLanes;i=(1<<31-Tt(42|e)+1)-1,i&=r&~(f&~p),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Vm(n,i))}else i=Ke,i=mn(n,n===dt?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||Bl(n,i)||(a=!0,Vm(n,i));n=n.next}while(a);Cc=!1}}function Ov(){Bm()}function Bm(){di=wc=!1;var e=0;El!==0&&Qv()&&(e=El);for(var t=et(),a=null,n=ui;n!==null;){var r=n.next,i=qm(n,t);i===0?(n.next=null,a===null?ui=r:a.next=r,r===null&&(Zn=a)):(a=n,(e!==0||(i&3)!==0)&&(di=!0)),n=r}Dt!==0&&Dt!==5||Bs(e),El!==0&&(El=0)}function qm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var f=31-Tt(i),p=1<<f,S=r[f];S===-1?((p&a)===0||(p&n)!==0)&&(r[f]=qi(p,t)):S<=t&&(e.expiredLanes|=p),i&=~p}if(t=dt,a=Ke,a=mn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&mt(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Bl(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&mt(n),pn(a)){case 2:case 8:a=Ul;break;case 32:a=Zt;break;case 268435456:a=Te;break;default:a=Zt}return n=Gm.bind(null,e),a=Pe(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&mt(n),e.callbackPriority=2,e.callbackNode=null,2}function Gm(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ci()&&e.callbackNode!==a)return null;var n=Ke;return n=mn(e,e===dt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Nm(e,n,t),qm(e,et()),e.callbackNode!=null&&e.callbackNode===a?Gm.bind(null,e):null)}function Vm(e,t){if(ci())return null;Nm(e,t,!0)}function _v(){Zv(function(){(tt&6)!==0?Pe(ul,Ov):Bm()})}function zc(){if(El===0){var e=Mn;e===0&&(e=Ht,Ht<<=1,(Ht&261888)===0&&(Ht=256)),El=e}return El}function Ym(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:br(""+e)}function Qm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Rv(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var i=Ym((r[Vt]||null).action),f=n.submitter;f&&(t=(t=f[Vt]||null)?Ym(t.formAction):f.getAttribute("formAction"),t!==null&&(i=t,f=null));var p=new Sr("action","action",null,n,r);e.push({event:p,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(El!==0){var S=f?Qm(r,f):new FormData(r);Zo(a,{pending:!0,data:S,method:r.method,action:i},null,S)}}else typeof i=="function"&&(p.preventDefault(),S=f?Qm(r,f):new FormData(r),Zo(a,{pending:!0,data:S,method:r.method,action:i},i,S))},currentTarget:r}]})}}for(var Ac=0;Ac<oo.length;Ac++){var Ec=oo[Ac],Lv=Ec.toLowerCase(),Hv=Ec[0].toUpperCase()+Ec.slice(1);za(Lv,"on"+Hv)}za(yd,"onAnimationEnd"),za(jd,"onAnimationIteration"),za(Nd,"onAnimationStart"),za("dblclick","onDoubleClick"),za("focusin","onFocus"),za("focusout","onBlur"),za(Px,"onTransitionRun"),za(ev,"onTransitionStart"),za(tv,"onTransitionCancel"),za(Sd,"onTransitionEnd"),vn("onMouseEnter",["mouseout","mouseover"]),vn("onMouseLeave",["mouseout","mouseover"]),vn("onPointerEnter",["pointerout","pointerover"]),vn("onPointerLeave",["pointerout","pointerover"]),Vl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qs="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(" "),Uv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qs));function Xm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var f=n.length-1;0<=f;f--){var p=n[f],S=p.instance,L=p.currentTarget;if(p=p.listener,S!==i&&r.isPropagationStopped())break e;i=p,r.currentTarget=L;try{i(r)}catch(K){zr(K)}r.currentTarget=null,i=S}else for(f=0;f<n.length;f++){if(p=n[f],S=p.instance,L=p.currentTarget,p=p.listener,S!==i&&r.isPropagationStopped())break e;i=p,r.currentTarget=L;try{i(r)}catch(K){zr(K)}r.currentTarget=null,i=S}}}}function Ze(e,t){var a=t[Gl];a===void 0&&(a=t[Gl]=new Set);var n=e+"__bubble";a.has(n)||(Zm(t,e,2,!1),a.add(n))}function kc(e,t,a){var n=0;t&&(n|=4),Zm(a,e,n,t)}var fi="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[fi]){e[fi]=!0,Ca.forEach(function(a){a!=="selectionchange"&&(Uv.has(a)||kc(a,!1,e),kc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fi]||(t[fi]=!0,kc("selectionchange",!1,t))}}function Zm(e,t,a,n){switch(jh(t)){case 2:var r=fg;break;case 8:r=mg;break;default:r=Xc}a=r.bind(null,t,a,e),r=void 0,!Ji||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Mc(e,t,a,n,r){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var p=n.stateNode.containerInfo;if(p===r)break;if(f===4)for(f=n.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===r)return;f=f.return}for(;p!==null;){if(f=Ge(p),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){n=i=f;continue e}p=p.parentNode}}n=n.return}Wu(function(){var L=i,K=Ki(a),I=[];e:{var H=wd.get(e);if(H!==void 0){var q=Sr,Ne=e;switch(e){case"keypress":if(jr(a)===0)break e;case"keydown":case"keyup":q=Mx;break;case"focusin":Ne="focus",q=Pi;break;case"focusout":Ne="blur",q=Pi;break;case"beforeblur":case"afterblur":q=Pi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Pu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=bx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=_x;break;case yd:case jd:case Nd:q=Nx;break;case Sd:q=Lx;break;case"scroll":case"scrollend":q=vx;break;case"wheel":q=Ux;break;case"copy":case"cut":case"paste":q=wx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=td;break;case"toggle":case"beforetoggle":q=qx}var De=(t&4)!==0,ut=!De&&(e==="scroll"||e==="scrollend"),M=De?H!==null?H+"Capture":null:H;De=[];for(var C=L,R;C!==null;){var W=C;if(R=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||R===null||M===null||(W=os(C,M),W!=null&&De.push(Gs(C,W,R))),ut)break;C=C.return}0<De.length&&(H=new q(H,Ne,null,a,K),I.push({event:H,listeners:De}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",H&&a!==Zi&&(Ne=a.relatedTarget||a.fromElement)&&(Ge(Ne)||Ne[dl]))break e;if((q||H)&&(H=K.window===K?K:(H=K.ownerDocument)?H.defaultView||H.parentWindow:window,q?(Ne=a.relatedTarget||a.toElement,q=L,Ne=Ne?Ge(Ne):null,Ne!==null&&(ut=m(Ne),De=Ne.tag,Ne!==ut||De!==5&&De!==27&&De!==6)&&(Ne=null)):(q=null,Ne=L),q!==Ne)){if(De=Pu,W="onMouseLeave",M="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(De=td,W="onPointerLeave",M="onPointerEnter",C="pointer"),ut=q==null?H:Yt(q),R=Ne==null?H:Yt(Ne),H=new De(W,C+"leave",q,a,K),H.target=ut,H.relatedTarget=R,W=null,Ge(K)===L&&(De=new De(M,C+"enter",Ne,a,K),De.target=R,De.relatedTarget=ut,W=De),ut=W,q&&Ne)t:{for(De=Bv,M=q,C=Ne,R=0,W=M;W;W=De(W))R++;W=0;for(var ke=C;ke;ke=De(ke))W++;for(;0<R-W;)M=De(M),R--;for(;0<W-R;)C=De(C),W--;for(;R--;){if(M===C||C!==null&&M===C.alternate){De=M;break t}M=De(M),C=De(C)}De=null}else De=null;q!==null&&Km(I,H,q,De,!1),Ne!==null&&ut!==null&&Km(I,ut,Ne,De,!0)}}e:{if(H=L?Yt(L):window,q=H.nodeName&&H.nodeName.toLowerCase(),q==="select"||q==="input"&&H.type==="file")var Fe=cd;else if(id(H))if(ud)Fe=Wx;else{Fe=$x;var Ce=Kx}else q=H.nodeName,!q||q.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?L&&Xi(L.elementType)&&(Fe=cd):Fe=Jx;if(Fe&&(Fe=Fe(e,L))){od(I,Fe,a,K);break e}Ce&&Ce(e,H,L),e==="focusout"&&L&&H.type==="number"&&L.memoizedProps.value!=null&&Qi(H,"number",H.value)}switch(Ce=L?Yt(L):window,e){case"focusin":(id(Ce)||Ce.contentEditable==="true")&&(Sn=Ce,so=L,xs=null);break;case"focusout":xs=so=Sn=null;break;case"mousedown":ro=!0;break;case"contextmenu":case"mouseup":case"dragend":ro=!1,gd(I,a,K);break;case"selectionchange":if(Ix)break;case"keydown":case"keyup":gd(I,a,K)}var qe;if(to)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Nn?sd(e,a)&&($e="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&($e="onCompositionStart");$e&&(ad&&a.locale!=="ko"&&(Nn||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Nn&&(qe=Fu()):(fl=K,Wi="value"in fl?fl.value:fl.textContent,Nn=!0)),Ce=mi(L,$e),0<Ce.length&&($e=new ed($e,e,null,a,K),I.push({event:$e,listeners:Ce}),qe?$e.data=qe:(qe=rd(a),qe!==null&&($e.data=qe)))),(qe=Vx?Yx(e,a):Qx(e,a))&&($e=mi(L,"onBeforeInput"),0<$e.length&&(Ce=new ed("onBeforeInput","beforeinput",null,a,K),I.push({event:Ce,listeners:$e}),Ce.data=qe)),Rv(I,e,L,a,K)}Xm(I,t)})}function Gs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function mi(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=os(e,a),r!=null&&n.unshift(Gs(e,r,i)),r=os(e,t),r!=null&&n.push(Gs(e,r,i))),e.tag===3)return n;e=e.return}return[]}function Bv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Km(e,t,a,n,r){for(var i=t._reactName,f=[];a!==null&&a!==n;){var p=a,S=p.alternate,L=p.stateNode;if(p=p.tag,S!==null&&S===n)break;p!==5&&p!==26&&p!==27||L===null||(S=L,r?(L=os(a,i),L!=null&&f.unshift(Gs(a,L,S))):r||(L=os(a,i),L!=null&&f.push(Gs(a,L,S)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var qv=/\r\n?/g,Gv=/\u0000|\uFFFD/g;function $m(e){return(typeof e=="string"?e:""+e).replace(qv,`
|
|
49
|
+
`).replace(Gv,"")}function Jm(e,t){return t=$m(t),$m(e)===t}function ct(e,t,a,n,r,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||bn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&bn(e,""+n);break;case"className":vr(e,"class",n);break;case"tabIndex":vr(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":vr(e,a,n);break;case"style":$u(e,n,i);break;case"data":if(t!=="object"){vr(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=br(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&ct(e,t,"name",r.name,r,null),ct(e,t,"formEncType",r.formEncType,r,null),ct(e,t,"formMethod",r.formMethod,r,null),ct(e,t,"formTarget",r.formTarget,r,null)):(ct(e,t,"encType",r.encType,r,null),ct(e,t,"method",r.method,r,null),ct(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=br(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Ga);break;case"onScroll":n!=null&&Ze("scroll",e);break;case"onScrollEnd":n!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=br(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),xr(e,"popover",n);break;case"xlinkActuate":qa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":qa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":qa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":qa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":qa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":qa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":qa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":qa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":qa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":xr(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=px.get(a)||a,xr(e,a,n))}}function Dc(e,t,a,n,r,i){switch(a){case"style":$u(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof n=="string"?bn(e,n):(typeof n=="number"||typeof n=="bigint")&&bn(e,""+n);break;case"onScroll":n!=null&&Ze("scroll",e);break;case"onScrollEnd":n!=null&&Ze("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ga);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xn.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),i=e[Vt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof n=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):xr(e,a,n)}}}function Gt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var n=!1,r=!1,i;for(i in a)if(a.hasOwnProperty(i)){var f=a[i];if(f!=null)switch(i){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ct(e,t,i,f,a,null)}}r&&ct(e,t,"srcSet",a.srcSet,a,null),n&&ct(e,t,"src",a.src,a,null);return;case"input":Ze("invalid",e);var p=i=f=r=null,S=null,L=null;for(n in a)if(a.hasOwnProperty(n)){var K=a[n];if(K!=null)switch(n){case"name":r=K;break;case"type":f=K;break;case"checked":S=K;break;case"defaultChecked":L=K;break;case"value":i=K;break;case"defaultValue":p=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(u(137,t));break;default:ct(e,t,n,K,a,null)}}Qu(e,i,p,S,L,f,r,!1);return;case"select":Ze("invalid",e),n=f=i=null;for(r in a)if(a.hasOwnProperty(r)&&(p=a[r],p!=null))switch(r){case"value":i=p;break;case"defaultValue":f=p;break;case"multiple":n=p;default:ct(e,t,r,p,a,null)}t=i,a=f,e.multiple=!!n,t!=null?gn(e,!!n,t,!1):a!=null&&gn(e,!!n,a,!0);return;case"textarea":Ze("invalid",e),i=r=n=null;for(f in a)if(a.hasOwnProperty(f)&&(p=a[f],p!=null))switch(f){case"value":n=p;break;case"defaultValue":r=p;break;case"children":i=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(u(91));break;default:ct(e,t,f,p,a,null)}Zu(e,n,r,i);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(n=a[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:ct(e,t,S,n,a,null)}return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(n=0;n<qs.length;n++)Ze(qs[n],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(n=a[L],n!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ct(e,t,L,n,a,null)}return;default:if(Xi(t)){for(K in a)a.hasOwnProperty(K)&&(n=a[K],n!==void 0&&Dc(e,t,K,n,a,void 0));return}}for(p in a)a.hasOwnProperty(p)&&(n=a[p],n!=null&&ct(e,t,p,n,a,null))}function Vv(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,f=null,p=null,S=null,L=null,K=null;for(q in a){var I=a[q];if(a.hasOwnProperty(q)&&I!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":S=I;default:n.hasOwnProperty(q)||ct(e,t,q,null,n,I)}}for(var H in n){var q=n[H];if(I=a[H],n.hasOwnProperty(H)&&(q!=null||I!=null))switch(H){case"type":i=q;break;case"name":r=q;break;case"checked":L=q;break;case"defaultChecked":K=q;break;case"value":f=q;break;case"defaultValue":p=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:q!==I&&ct(e,t,H,q,n,I)}}Yi(e,f,p,S,L,K,i,r);return;case"select":q=f=p=H=null;for(i in a)if(S=a[i],a.hasOwnProperty(i)&&S!=null)switch(i){case"value":break;case"multiple":q=S;default:n.hasOwnProperty(i)||ct(e,t,i,null,n,S)}for(r in n)if(i=n[r],S=a[r],n.hasOwnProperty(r)&&(i!=null||S!=null))switch(r){case"value":H=i;break;case"defaultValue":p=i;break;case"multiple":f=i;default:i!==S&&ct(e,t,r,i,n,S)}t=p,a=f,n=q,H!=null?gn(e,!!a,H,!1):!!n!=!!a&&(t!=null?gn(e,!!a,t,!0):gn(e,!!a,a?[]:"",!1));return;case"textarea":q=H=null;for(p in a)if(r=a[p],a.hasOwnProperty(p)&&r!=null&&!n.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:ct(e,t,p,null,n,r)}for(f in n)if(r=n[f],i=a[f],n.hasOwnProperty(f)&&(r!=null||i!=null))switch(f){case"value":H=r;break;case"defaultValue":q=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==i&&ct(e,t,f,r,n,i)}Xu(e,H,q);return;case"option":for(var Ne in a)if(H=a[Ne],a.hasOwnProperty(Ne)&&H!=null&&!n.hasOwnProperty(Ne))switch(Ne){case"selected":e.selected=!1;break;default:ct(e,t,Ne,null,n,H)}for(S in n)if(H=n[S],q=a[S],n.hasOwnProperty(S)&&H!==q&&(H!=null||q!=null))switch(S){case"selected":e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:ct(e,t,S,H,n,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in a)H=a[De],a.hasOwnProperty(De)&&H!=null&&!n.hasOwnProperty(De)&&ct(e,t,De,null,n,H);for(L in n)if(H=n[L],q=a[L],n.hasOwnProperty(L)&&H!==q&&(H!=null||q!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:ct(e,t,L,H,n,q)}return;default:if(Xi(t)){for(var ut in a)H=a[ut],a.hasOwnProperty(ut)&&H!==void 0&&!n.hasOwnProperty(ut)&&Dc(e,t,ut,void 0,n,H);for(K in n)H=n[K],q=a[K],!n.hasOwnProperty(K)||H===q||H===void 0&&q===void 0||Dc(e,t,K,H,n,q);return}}for(var M in a)H=a[M],a.hasOwnProperty(M)&&H!=null&&!n.hasOwnProperty(M)&&ct(e,t,M,null,n,H);for(I in n)H=n[I],q=a[I],!n.hasOwnProperty(I)||H===q||H==null&&q==null||ct(e,t,I,H,n,q)}function Wm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Yv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],i=r.transferSize,f=r.initiatorType,p=r.duration;if(i&&p&&Wm(f)){for(f=0,p=r.responseEnd,n+=1;n<a.length;n++){var S=a[n],L=S.startTime;if(L>p)break;var K=S.transferSize,I=S.initiatorType;K&&Wm(I)&&(S=S.responseEnd,f+=K*(S<p?1:(p-L)/(S-L)))}if(--n,t+=8*(i+f)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Oc=null,_c=null;function hi(e){return e.nodeType===9?e:e.ownerDocument}function Fm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Im(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Rc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lc=null;function Qv(){var e=window.event;return e&&e.type==="popstate"?e===Lc?!1:(Lc=e,!0):(Lc=null,!1)}var Pm=typeof setTimeout=="function"?setTimeout:void 0,Xv=typeof clearTimeout=="function"?clearTimeout:void 0,eh=typeof Promise=="function"?Promise:void 0,Zv=typeof queueMicrotask=="function"?queueMicrotask:typeof eh<"u"?function(e){return eh.resolve(null).then(e).catch(Kv)}:Pm;function Kv(e){setTimeout(function(){throw e})}function kl(e){return e==="head"}function th(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),Wn(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Vs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Vs(a);for(var i=a.firstChild;i;){var f=i.nextSibling,p=i.nodeName;i[ge]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=f}}else a==="body"&&Vs(e.ownerDocument.body);a=r}while(a);Wn(t)}function ah(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Hc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Hc(a),Re(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function $v(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ge])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function Jv(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ya(e.nextSibling),e===null))return null;return e}function lh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ya(e.nextSibling),e===null))return null;return e}function Uc(e){return e.data==="$?"||e.data==="$~"}function Bc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Wv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var qc=null;function nh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ya(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function sh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function rh(e,t,a){switch(t=hi(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Re(e)}var ja=new Map,ih=new Set;function pi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ll=$.d;$.d={f:Fv,r:Iv,D:Pv,C:eg,L:tg,m:ag,X:ng,S:lg,M:sg};function Fv(){var e=ll.f(),t=ri();return e||t}function Iv(e){var t=Ve(e);t!==null&&t.tag===5&&t.type==="form"?wf(t):ll.r(e)}var Kn=typeof document>"u"?null:document;function oh(e,t,a){var n=Kn;if(n&&typeof t=="string"&&t){var r=ma(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),ih.has(r)||(ih.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Gt(t,"link",e),it(t),n.head.appendChild(t)))}}function Pv(e){ll.D(e),oh("dns-prefetch",e,null)}function eg(e,t){ll.C(e,t),oh("preconnect",e,t)}function tg(e,t,a){ll.L(e,t,a);var n=Kn;if(n&&e&&t){var r='link[rel="preload"][as="'+ma(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+ma(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+ma(a.imageSizes)+'"]')):r+='[href="'+ma(e)+'"]';var i=r;switch(t){case"style":i=$n(e);break;case"script":i=Jn(e)}ja.has(i)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ja.set(i,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Ys(i))||t==="script"&&n.querySelector(Qs(i))||(t=n.createElement("link"),Gt(t,"link",e),it(t),n.head.appendChild(t)))}}function ag(e,t){ll.m(e,t);var a=Kn;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+ma(n)+'"][href="'+ma(e)+'"]',i=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Jn(e)}if(!ja.has(i)&&(e=j({rel:"modulepreload",href:e},t),ja.set(i,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Qs(i)))return}n=a.createElement("link"),Gt(n,"link",e),it(n),a.head.appendChild(n)}}}function lg(e,t,a){ll.S(e,t,a);var n=Kn;if(n&&e){var r=Qe(n).hoistableStyles,i=$n(e);t=t||"default";var f=r.get(i);if(!f){var p={loading:0,preload:null};if(f=n.querySelector(Ys(i)))p.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ja.get(i))&&Gc(e,a);var S=f=n.createElement("link");it(S),Gt(S,"link",e),S._p=new Promise(function(L,K){S.onload=L,S.onerror=K}),S.addEventListener("load",function(){p.loading|=1}),S.addEventListener("error",function(){p.loading|=2}),p.loading|=4,xi(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:p},r.set(i,f)}}}function ng(e,t){ll.X(e,t);var a=Kn;if(a&&e){var n=Qe(a).hoistableScripts,r=Jn(e),i=n.get(r);i||(i=a.querySelector(Qs(r)),i||(e=j({src:e,async:!0},t),(t=ja.get(r))&&Vc(e,t),i=a.createElement("script"),it(i),Gt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(r,i))}}function sg(e,t){ll.M(e,t);var a=Kn;if(a&&e){var n=Qe(a).hoistableScripts,r=Jn(e),i=n.get(r);i||(i=a.querySelector(Qs(r)),i||(e=j({src:e,async:!0,type:"module"},t),(t=ja.get(r))&&Vc(e,t),i=a.createElement("script"),it(i),Gt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(r,i))}}function ch(e,t,a,n){var r=(r=B.current)?pi(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=$n(a.href),a=Qe(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=$n(a.href);var i=Qe(r).hoistableStyles,f=i.get(e);if(f||(r=r.ownerDocument||r,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,f),(i=r.querySelector(Ys(e)))&&!i._p&&(f.instance=i,f.state.loading=5),ja.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ja.set(e,a),i||rg(r,e,a,f.state))),t&&n===null)throw Error(u(528,""));return f}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jn(a),a=Qe(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function $n(e){return'href="'+ma(e)+'"'}function Ys(e){return'link[rel="stylesheet"]['+e+"]"}function uh(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function rg(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Gt(t,"link",a),it(t),e.head.appendChild(t))}function Jn(e){return'[src="'+ma(e)+'"]'}function Qs(e){return"script[async]"+e}function dh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+ma(a.href)+'"]');if(n)return t.instance=n,it(n),n;var r=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),it(n),Gt(n,"style",r),xi(n,a.precedence,e),t.instance=n;case"stylesheet":r=$n(a.href);var i=e.querySelector(Ys(r));if(i)return t.state.loading|=4,t.instance=i,it(i),i;n=uh(a),(r=ja.get(r))&&Gc(n,r),i=(e.ownerDocument||e).createElement("link"),it(i);var f=i;return f._p=new Promise(function(p,S){f.onload=p,f.onerror=S}),Gt(i,"link",n),t.state.loading|=4,xi(i,a.precedence,e),t.instance=i;case"script":return i=Jn(a.src),(r=e.querySelector(Qs(i)))?(t.instance=r,it(r),r):(n=a,(r=ja.get(i))&&(n=j({},a),Vc(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),it(r),Gt(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,xi(n,a.precedence,e));return t.instance}function xi(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,i=r,f=0;f<n.length;f++){var p=n[f];if(p.dataset.precedence===t)i=p;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var vi=null;function fh(e,t,a){if(vi===null){var n=new Map,r=vi=new Map;r.set(a,n)}else r=vi,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var i=a[r];if(!(i[ge]||i[Mt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var f=i.getAttribute(t)||"";f=e+f;var p=n.get(f);p?p.push(i):n.set(f,[i])}}return n}function mh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function ig(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function hh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function og(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=$n(n.href),i=t.querySelector(Ys(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=gi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,it(i);return}i=t.ownerDocument||t,n=uh(n),(r=ja.get(r))&&Gc(n,r),i=i.createElement("link"),it(i);var f=i;f._p=new Promise(function(p,S){f.onload=p,f.onerror=S}),Gt(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=gi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Yc=0;function cg(e,t){return e.stylesheets&&e.count===0&&yi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&yi(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Yc===0&&(Yc=62500*Yv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yi(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Yc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bi=null;function yi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bi=new Map,t.forEach(ug,e),bi=null,gi.call(e))}function ug(e,t){if(!(t.state.loading&4)){var a=bi.get(e);if(a)var n=a.get(null);else{a=new Map,bi.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var f=r[i];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),n=f)}n&&a.set(null,n)}r=t.instance,f=r.getAttribute("data-precedence"),i=a.get(f)||n,i===n&&a.set(null,r),a.set(f,r),this.count++,n=gi.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Xs={$$typeof:pe,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function dg(e,t,a,n,r,i,f,p,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ss(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ss(0),this.hiddenUpdates=ss(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function ph(e,t,a,n,r,i,f,p,S,L,K,I){return e=new dg(e,t,a,f,S,L,K,I,p),t=1,i===!0&&(t|=24),i=la(3,null,null,t),e.current=i,i.stateNode=e,t=No(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},zo(i),e}function xh(e){return e?(e=zn,e):zn}function vh(e,t,a,n,r,i){r=xh(r),n.context===null?n.context=r:n.pendingContext=r,n=gl(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=bl(e,n,t),a!==null&&(ea(a,e,t),Ss(a,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Qc(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Zl(e,67108864);t!==null&&ea(t,e,67108864),Qc(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=oa();t=is(t);var a=Zl(e,t);a!==null&&ea(a,e,t),Qc(e,t)}}var ji=!0;function fg(e,t,a,n){var r=E.T;E.T=null;var i=$.p;try{$.p=2,Xc(e,t,a,n)}finally{$.p=i,E.T=r}}function mg(e,t,a,n){var r=E.T;E.T=null;var i=$.p;try{$.p=8,Xc(e,t,a,n)}finally{$.p=i,E.T=r}}function Xc(e,t,a,n){if(ji){var r=Zc(n);if(r===null)Mc(e,t,n,Ni,a),Nh(e,n);else if(pg(r,e,t,a,n))n.stopPropagation();else if(Nh(e,n),t&4&&-1<hg.indexOf(e)){for(;r!==null;){var i=Ve(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var f=Ba(i.pendingLanes);if(f!==0){var p=i;for(p.pendingLanes|=2,p.entangledLanes|=2;f;){var S=1<<31-Tt(f);p.entanglements[1]|=S,f&=~S}La(i),(tt&6)===0&&(ni=et()+500,Bs(0))}}break;case 31:case 13:p=Zl(i,2),p!==null&&ea(p,i,2),ri(),Qc(i,2)}if(i=Zc(n),i===null&&Mc(e,t,n,Ni,a),i===r)break;r=i}r!==null&&n.stopPropagation()}else Mc(e,t,n,null,a)}}function Zc(e){return e=Ki(e),Kc(e)}var Ni=null;function Kc(e){if(Ni=null,e=Ge(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=x(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ni=e,null}function jh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ma()){case ul:return 2;case Ul:return 8;case Zt:case J:return 32;case Te:return 268435456;default:return 32}default:return 32}}var $c=!1,Tl=null,Ml=null,Dl=null,Zs=new Map,Ks=new Map,Ol=[],hg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Nh(e,t){switch(e){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":Dl=null;break;case"pointerover":case"pointerout":Zs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function $s(e,t,a,n,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Ve(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function pg(e,t,a,n,r){switch(t){case"focusin":return Tl=$s(Tl,e,t,a,n,r),!0;case"dragenter":return Ml=$s(Ml,e,t,a,n,r),!0;case"mouseover":return Dl=$s(Dl,e,t,a,n,r),!0;case"pointerover":var i=r.pointerId;return Zs.set(i,$s(Zs.get(i)||null,e,t,a,n,r)),!0;case"gotpointercapture":return i=r.pointerId,Ks.set(i,$s(Ks.get(i)||null,e,t,a,n,r)),!0}return!1}function Sh(e){var t=Ge(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,hr(e.priority,function(){yh(a)});return}}else if(t===31){if(t=x(a),t!==null){e.blockedOn=t,hr(e.priority,function(){yh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Si(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Zc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Zi=n,a.target.dispatchEvent(n),Zi=null}else return t=Ve(a),t!==null&&bh(t),e.blockedOn=a,!1;t.shift()}return!0}function wh(e,t,a){Si(e)&&a.delete(t)}function xg(){$c=!1,Tl!==null&&Si(Tl)&&(Tl=null),Ml!==null&&Si(Ml)&&(Ml=null),Dl!==null&&Si(Dl)&&(Dl=null),Zs.forEach(wh),Ks.forEach(wh)}function wi(e,t){e.blockedOn===t&&(e.blockedOn=null,$c||($c=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,xg)))}var Ci=null;function Ch(e){Ci!==e&&(Ci=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ci===e&&(Ci=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(Kc(n||a)===null)continue;break}var i=Ve(a);i!==null&&(e.splice(t,3),t-=3,Zo(i,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Wn(e){function t(S){return wi(S,e)}Tl!==null&&wi(Tl,e),Ml!==null&&wi(Ml,e),Dl!==null&&wi(Dl,e),Zs.forEach(t),Ks.forEach(t);for(var a=0;a<Ol.length;a++){var n=Ol[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ol.length&&(a=Ol[0],a.blockedOn===null);)Sh(a),a.blockedOn===null&&Ol.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],i=a[n+1],f=r[Vt]||null;if(typeof i=="function")f||Ch(a);else if(f){var p=null;if(i&&i.hasAttribute("formAction")){if(r=i,f=i[Vt]||null)p=f.formAction;else if(Kc(r)!==null)continue}else p=f.action;typeof p=="function"?a[n+1]=p:(a.splice(n,3),n-=3),Ch(a)}}}function zh(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(f){return r=f})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Jc(e){this._internalRoot=e}zi.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,n=oa();vh(a,n,e,t,null,null)},zi.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),ri(),t[dl]=null}};function zi(e){this._internalRoot=e}zi.prototype.unstable_scheduleHydration=function(e){if(e){var t=mr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ol.length&&t!==0&&t<Ol[a].priority;a++);Ol.splice(a,0,e),a===0&&Sh(e)}};var Ah=o.version;if(Ah!=="19.2.7")throw Error(u(527,Ah,"19.2.7"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var vg={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ai=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ai.isDisabled&&Ai.supportsFiber)try{bt=Ai.inject(vg),pt=Ai}catch{}}return Ws.createRoot=function(e,t){if(!d(e))throw Error(u(299));var a=!1,n="",r=_f,i=Rf,f=Lf;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=ph(e,1,!1,null,null,a,n,null,r,i,f,zh),e[dl]=t.current,Tc(e),new Jc(t)},Ws.hydrateRoot=function(e,t,a){if(!d(e))throw Error(u(299));var n=!1,r="",i=_f,f=Rf,p=Lf,S=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(p=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=ph(e,1,!0,t,a??null,n,r,S,i,f,p,zh),t.context=xh(null),a=t.current,n=oa(),n=is(n),r=gl(n),r.callback=null,bl(a,r,n),a=n,t.current.lanes=a,ql(t,a),La(t),e[dl]=t.current,Tc(e),new zi(t)},Ws.version="19.2.7",Ws}var Hh;function Dg(){if(Hh)return Ic.exports;Hh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),Ic.exports=Mg(),Ic.exports}var Og=Dg();function yp(s){var o,c,u="";if(typeof s=="string"||typeof s=="number")u+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(o=0;o<d;o++)s[o]&&(c=yp(s[o]))&&(u&&(u+=" "),u+=c)}else for(c in s)s[c]&&(u&&(u+=" "),u+=c);return u}function jp(){for(var s,o,c=0,u="",d=arguments.length;c<d;c++)(s=arguments[c])&&(o=yp(s))&&(u&&(u+=" "),u+=o);return u}const _g=(s,o)=>{const c=new Array(s.length+o.length);for(let u=0;u<s.length;u++)c[u]=s[u];for(let u=0;u<o.length;u++)c[s.length+u]=o[u];return c},Rg=(s,o)=>({classGroupId:s,validator:o}),Np=(s=new Map,o=null,c)=>({nextPart:s,validators:o,classGroupId:c}),_i="-",Uh=[],Lg="arbitrary..",Hg=s=>{const o=Bg(s),{conflictingClassGroups:c,conflictingClassGroupModifiers:u}=s;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return Ug(h);const x=h.split(_i),y=x[0]===""&&x.length>1?1:0;return Sp(x,y,o)},getConflictingClassGroupIds:(h,x)=>{if(x){const y=u[h],g=c[h];return y?g?_g(g,y):y:g||Uh}return c[h]||Uh}}},Sp=(s,o,c)=>{if(s.length-o===0)return c.classGroupId;const d=s[o],m=c.nextPart.get(d);if(m){const g=Sp(s,o+1,m);if(g)return g}const h=c.validators;if(h===null)return;const x=o===0?s.join(_i):s.slice(o).join(_i),y=h.length;for(let g=0;g<y;g++){const N=h[g];if(N.validator(x))return N.classGroupId}},Ug=s=>s.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=s.slice(1,-1),c=o.indexOf(":"),u=o.slice(0,c);return u?Lg+u:void 0})(),Bg=s=>{const{theme:o,classGroups:c}=s;return qg(c,o)},qg=(s,o)=>{const c=Np();for(const u in s){const d=s[u];ju(d,c,u,o)}return c},ju=(s,o,c,u)=>{const d=s.length;for(let m=0;m<d;m++){const h=s[m];Gg(h,o,c,u)}},Gg=(s,o,c,u)=>{if(typeof s=="string"){Vg(s,o,c);return}if(typeof s=="function"){Yg(s,o,c,u);return}Qg(s,o,c,u)},Vg=(s,o,c)=>{const u=s===""?o:wp(o,s);u.classGroupId=c},Yg=(s,o,c,u)=>{if(Xg(s)){ju(s(u),o,c,u);return}o.validators===null&&(o.validators=[]),o.validators.push(Rg(c,s))},Qg=(s,o,c,u)=>{const d=Object.entries(s),m=d.length;for(let h=0;h<m;h++){const[x,y]=d[h];ju(y,wp(o,x),c,u)}},wp=(s,o)=>{let c=s;const u=o.split(_i),d=u.length;for(let m=0;m<d;m++){const h=u[m];let x=c.nextPart.get(h);x||(x=Np(),c.nextPart.set(h,x)),c=x}return c},Xg=s=>"isThemeGetter"in s&&s.isThemeGetter===!0,Zg=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,c=Object.create(null),u=Object.create(null);const d=(m,h)=>{c[m]=h,o++,o>s&&(o=0,u=c,c=Object.create(null))};return{get(m){let h=c[m];if(h!==void 0)return h;if((h=u[m])!==void 0)return d(m,h),h},set(m,h){m in c?c[m]=h:d(m,h)}}},du="!",Bh=":",Kg=[],qh=(s,o,c,u,d)=>({modifiers:s,hasImportantModifier:o,baseClassName:c,maybePostfixModifierPosition:u,isExternal:d}),$g=s=>{const{prefix:o,experimentalParseClassName:c}=s;let u=d=>{const m=[];let h=0,x=0,y=0,g;const N=d.length;for(let V=0;V<N;V++){const te=d[V];if(h===0&&x===0){if(te===Bh){m.push(d.slice(y,V)),y=V+1;continue}if(te==="/"){g=V;continue}}te==="["?h++:te==="]"?h--:te==="("?x++:te===")"&&x--}const j=m.length===0?d:d.slice(y);let A=j,w=!1;j.endsWith(du)?(A=j.slice(0,-1),w=!0):j.startsWith(du)&&(A=j.slice(1),w=!0);const T=g&&g>y?g-y:void 0;return qh(m,w,A,T)};if(o){const d=o+Bh,m=u;u=h=>h.startsWith(d)?m(h.slice(d.length)):qh(Kg,!1,h,void 0,!0)}if(c){const d=u;u=m=>c({className:m,parseClassName:d})}return u},Jg=s=>{const o=new Map;return s.orderSensitiveModifiers.forEach((c,u)=>{o.set(c,1e6+u)}),c=>{const u=[];let d=[];for(let m=0;m<c.length;m++){const h=c[m],x=h[0]==="[",y=o.has(h);x||y?(d.length>0&&(d.sort(),u.push(...d),d=[]),u.push(h)):d.push(h)}return d.length>0&&(d.sort(),u.push(...d)),u}},Wg=s=>({cache:Zg(s.cacheSize),parseClassName:$g(s),sortModifiers:Jg(s),postfixLookupClassGroupIds:Fg(s),...Hg(s)}),Fg=s=>{const o=Object.create(null),c=s.postfixLookupClassGroups;if(c)for(let u=0;u<c.length;u++)o[c[u]]=!0;return o},Ig=/\s+/,Pg=(s,o)=>{const{parseClassName:c,getClassGroupId:u,getConflictingClassGroupIds:d,sortModifiers:m,postfixLookupClassGroupIds:h}=o,x=[],y=s.trim().split(Ig);let g="";for(let N=y.length-1;N>=0;N-=1){const j=y[N],{isExternal:A,modifiers:w,hasImportantModifier:T,baseClassName:V,maybePostfixModifierPosition:te}=c(j);if(A){g=j+(g.length>0?" "+g:g);continue}let P=!!te,ie;if(P){const ee=V.substring(0,te);ie=u(ee);const U=ie&&h[ie]?u(V):void 0;U&&U!==ie&&(ie=U,P=!1)}else ie=u(V);if(!ie){if(!P){g=j+(g.length>0?" "+g:g);continue}if(ie=u(V),!ie){g=j+(g.length>0?" "+g:g);continue}P=!1}const pe=w.length===0?"":w.length===1?w[0]:m(w).join(":"),G=T?pe+du:pe,ce=G+ie;if(x.indexOf(ce)>-1)continue;x.push(ce);const de=d(ie,P);for(let ee=0;ee<de.length;++ee){const U=de[ee];x.push(G+U)}g=j+(g.length>0?" "+g:g)}return g},eb=(...s)=>{let o=0,c,u,d="";for(;o<s.length;)(c=s[o++])&&(u=Cp(c))&&(d&&(d+=" "),d+=u);return d},Cp=s=>{if(typeof s=="string")return s;let o,c="";for(let u=0;u<s.length;u++)s[u]&&(o=Cp(s[u]))&&(c&&(c+=" "),c+=o);return c},tb=(s,...o)=>{let c,u,d,m;const h=y=>{const g=o.reduce((N,j)=>j(N),s());return c=Wg(g),u=c.cache.get,d=c.cache.set,m=x,x(y)},x=y=>{const g=u(y);if(g)return g;const N=Pg(y,c);return d(y,N),N};return m=h,(...y)=>m(eb(...y))},ab=[],Ot=s=>{const o=c=>c[s]||ab;return o.isThemeGetter=!0,o},zp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ap=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ib=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ob=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rl=s=>lb.test(s),Ye=s=>!!s&&!Number.isNaN(Number(s)),Ua=s=>!!s&&Number.isInteger(Number(s)),au=s=>s.endsWith("%")&&Ye(s.slice(0,-1)),nl=s=>nb.test(s),Ep=()=>!0,cb=s=>sb.test(s)&&!rb.test(s),Nu=()=>!1,ub=s=>ib.test(s),db=s=>ob.test(s),fb=s=>!be(s)&&!je(s),mb=s=>s.startsWith("@container")&&(s[10]==="/"&&s[11]!==void 0||s[11]==="s"&&s[16]!==void 0&&s.startsWith("-size/",10)||s[11]==="n"&&s[18]!==void 0&&s.startsWith("-normal/",10)),hb=s=>Hl(s,Mp,Nu),be=s=>zp.test(s),sn=s=>Hl(s,Dp,cb),Gh=s=>Hl(s,Nb,Ye),pb=s=>Hl(s,_p,Ep),xb=s=>Hl(s,Op,Nu),Vh=s=>Hl(s,kp,Nu),vb=s=>Hl(s,Tp,db),Ei=s=>Hl(s,Rp,ub),je=s=>Ap.test(s),Fs=s=>dn(s,Dp),gb=s=>dn(s,Op),Yh=s=>dn(s,kp),bb=s=>dn(s,Mp),yb=s=>dn(s,Tp),ki=s=>dn(s,Rp,!0),jb=s=>dn(s,_p,!0),Hl=(s,o,c)=>{const u=zp.exec(s);return u?u[1]?o(u[1]):c(u[2]):!1},dn=(s,o,c=!1)=>{const u=Ap.exec(s);return u?u[1]?o(u[1]):c:!1},kp=s=>s==="position"||s==="percentage",Tp=s=>s==="image"||s==="url",Mp=s=>s==="length"||s==="size"||s==="bg-size",Dp=s=>s==="length",Nb=s=>s==="number",Op=s=>s==="family-name",_p=s=>s==="number"||s==="weight",Rp=s=>s==="shadow",Sb=()=>{const s=Ot("color"),o=Ot("font"),c=Ot("text"),u=Ot("font-weight"),d=Ot("tracking"),m=Ot("leading"),h=Ot("breakpoint"),x=Ot("container"),y=Ot("spacing"),g=Ot("radius"),N=Ot("shadow"),j=Ot("inset-shadow"),A=Ot("text-shadow"),w=Ot("drop-shadow"),T=Ot("blur"),V=Ot("perspective"),te=Ot("aspect"),P=Ot("ease"),ie=Ot("animate"),pe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ce=()=>[...G(),je,be],de=()=>["auto","hidden","clip","visible","scroll"],ee=()=>["auto","contain","none"],U=()=>[je,be,y],fe=()=>[Rl,"full","auto",...U()],Ee=()=>[Ua,"none","subgrid",je,be],xe=()=>["auto",{span:["full",Ua,je,be]},Ua,je,be],_=()=>[Ua,"auto",je,be],se=()=>["auto","min","max","fr",je,be],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ye=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...U()],$=()=>[Rl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],me=()=>[Rl,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ue=()=>[Rl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],k=()=>[s,je,be],b=()=>[...G(),Yh,Vh,{position:[je,be]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",bb,hb,{size:[je,be]}],Q=()=>[au,Fs,sn],le=()=>["","none","full",g,je,be],B=()=>["",Ye,Fs,sn],O=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ye,au,Yh,Vh],Oe=()=>["","none",T,je,be],ve=()=>["none",Ye,je,be],Se=()=>["none",Ye,je,be],ze=()=>[Ye,je,be],X=()=>[Rl,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nl],breakpoint:[nl],color:[Ep],container:[nl],"drop-shadow":[nl],ease:["in","out","in-out"],font:[fb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nl],shadow:[nl],spacing:["px",Ye],text:[nl],"text-shadow":[nl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rl,be,je,te]}],container:["container"],"container-type":[{"@container":["","normal","size",je,be]}],"container-named":[mb],columns:[{columns:[Ye,be,je,x]}],"break-after":[{"break-after":pe()}],"break-before":[{"break-before":pe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ce()}],overflow:[{overflow:de()}],"overflow-x":[{"overflow-x":de()}],"overflow-y":[{"overflow-y":de()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:fe()}],"inset-x":[{"inset-x":fe()}],"inset-y":[{"inset-y":fe()}],start:[{"inset-s":fe(),start:fe()}],end:[{"inset-e":fe(),end:fe()}],"inset-bs":[{"inset-bs":fe()}],"inset-be":[{"inset-be":fe()}],top:[{top:fe()}],right:[{right:fe()}],bottom:[{bottom:fe()}],left:[{left:fe()}],visibility:["visible","invisible","collapse"],z:[{z:[Ua,"auto",je,be]}],basis:[{basis:[Rl,"full","auto",x,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Rl,"auto","initial","none",be]}],grow:[{grow:["",Ye,je,be]}],shrink:[{shrink:["",Ye,je,be]}],order:[{order:[Ua,"first","last","none",je,be]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:xe()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:xe()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ye(),"normal"]}],"justify-self":[{"justify-self":["auto",...ye()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ye(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ye(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ye(),"baseline"]}],"place-self":[{"place-self":["auto",...ye()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...me()]}],"min-inline-size":[{"min-inline":["auto",...me()]}],"max-inline-size":[{"max-inline":["none",...me()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[x,"screen",...$()]}],"min-w":[{"min-w":[x,"screen","none",...$()]}],"max-w":[{"max-w":[x,"screen","none","prose",{screen:[h]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",c,Fs,sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[u,jb,pb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",au,be]}],"font-family":[{font:[gb,xb,o]}],"font-features":[{"font-features":[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,je,be]}],"line-clamp":[{"line-clamp":[Ye,"none",je,Gh]}],leading:[{leading:[m,...U()]}],"list-image":[{"list-image":["none",je,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",je,sn]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[Ye,"auto",je,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Ua,je,be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:b()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ua,je,be],radial:["",je,be],conic:[Ua,je,be]},yb,vb]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,je,be]}],"outline-w":[{outline:["",Ye,Fs,sn]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",N,ki,Ei]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",j,ki,Ei]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[Ye,sn]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",A,ki,Ei]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[Ye,je,be]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[je,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":G()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:b()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,be]}],filter:[{filter:["","none",je,be]}],blur:[{blur:Oe()}],brightness:[{brightness:[Ye,je,be]}],contrast:[{contrast:[Ye,je,be]}],"drop-shadow":[{"drop-shadow":["","none",w,ki,Ei]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",Ye,je,be]}],"hue-rotate":[{"hue-rotate":[Ye,je,be]}],invert:[{invert:["",Ye,je,be]}],saturate:[{saturate:[Ye,je,be]}],sepia:[{sepia:["",Ye,je,be]}],"backdrop-filter":[{"backdrop-filter":["","none",je,be]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,je,be]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,je,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,je,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,je,be]}],"backdrop-invert":[{"backdrop-invert":["",Ye,je,be]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,je,be]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,je,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,je,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",je,be]}],ease:[{ease:["linear","initial",P,je,be]}],delay:[{delay:[Ye,je,be]}],animate:[{animate:["none",ie,je,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[V,je,be]}],"perspective-origin":[{"perspective-origin":ce()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[je,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:ce()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],zoom:[{zoom:[Ua,je,be]}],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,be]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[Ye,Fs,sn,Gh]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lp=tb(Sb);var Hp=bp();const Su={...Ag},Qh={};function lr(s,o){const c=v.useRef(Qh);return c.current===Qh&&(c.current=s(o)),c}const lu=Su.useInsertionEffect,wb=lu&&lu!==Su.useLayoutEffect?lu:s=>s();function rl(s){const o=lr(Cb).current;return o.next=s,wb(o.effect),o.trampoline}function Cb(){const s={next:void 0,callback:zb,trampoline:(...o)=>{var c;return(c=s.callback)==null?void 0:c.call(s,...o)},effect:()=>{s.callback=s.next}};return s}function zb(){}function Ab(s,o){return function(u,...d){const m=new URL(s);return m.searchParams.set("code",u.toString()),d.forEach(h=>m.searchParams.append("args[]",h)),`${o} error #${u}; visit ${m} for the full message.`}}const wu=Ab("https://base-ui.com/production-error","Base UI");function fu(s,o,c,u){const d=lr(Up).current;return kb(d,s,o,c,u)&&Bp(d,[s,o,c,u]),d.callback}function Eb(s){const o=lr(Up).current;return Tb(o,s)&&Bp(o,s),o.callback}function Up(){return{callback:null,cleanup:null,refs:[]}}function kb(s,o,c,u,d){return s.refs[0]!==o||s.refs[1]!==c||s.refs[2]!==u||s.refs[3]!==d}function Tb(s,o){return s.refs.length!==o.length||s.refs.some((c,u)=>c!==o[u])}function Bp(s,o){if(s.refs=o,o.every(c=>c==null)){s.callback=null;return}s.callback=c=>{if(s.cleanup&&(s.cleanup(),s.cleanup=null),c!=null){const u=Array(o.length).fill(null);for(let d=0;d<o.length;d+=1){const m=o[d];if(m!=null)switch(typeof m){case"function":{const h=m(c);typeof h=="function"&&(u[d]=h);break}case"object":{m.current=c;break}}}s.cleanup=()=>{for(let d=0;d<o.length;d+=1){const m=o[d];if(m!=null)switch(typeof m){case"function":{const h=u[d];typeof h=="function"?h():m(null);break}case"object":{m.current=null;break}}}}}}}const Mb=parseInt(v.version,10);function Db(s){return Mb>=s}function Xh(s){if(!v.isValidElement(s))return null;const o=s,c=o.props;return(Db(19)?c==null?void 0:c.ref:o.ref)??null}function mu(s,o){if(s&&!o)return s;if(!s&&o)return o;if(s||o)return{...s,...o}}const es=Object.freeze({});function Ob(s,o){const c={};for(const u in s){const d=s[u];if(o!=null&&o.hasOwnProperty(u)){const m=o[u](d);m!=null&&Object.assign(c,m);continue}d===!0?c[`data-${u.toLowerCase()}`]="":d&&(c[`data-${u.toLowerCase()}`]=d.toString())}return c}function _b(s,o){return typeof s=="function"?s(o):s}function qp(s,o){return typeof s=="function"?s(o):s}const Cu={};function zu(s,o,c,u,d){if(!c&&!u&&!s)return Ri(o);let m=Ri(s);return o&&(m=Oi(m,o)),c&&(m=Oi(m,c)),u&&(m=Oi(m,u)),m}function Rb(s){if(s.length===0)return Cu;if(s.length===1)return Ri(s[0]);let o=Ri(s[0]);for(let c=1;c<s.length;c+=1)o=Oi(o,s[c]);return o}function Ri(s){return Au(s)?{...Vp(s,Cu)}:Lb(s)}function Oi(s,o){return Au(o)?Vp(o,s):Hb(s,o)}function Lb(s){const o={...s};for(const c in o){const u=o[c];Gp(c,u)&&(o[c]=Yp(u))}return o}function Hb(s,o){if(!o)return s;for(const c in o){const u=o[c];switch(c){case"style":{s[c]=mu(s.style,u);break}case"className":{s[c]=Qp(s.className,u);break}default:Gp(c,u)?s[c]=Ub(s[c],u):s[c]=u}}return s}function Gp(s,o){const c=s.charCodeAt(0),u=s.charCodeAt(1),d=s.charCodeAt(2);return c===111&&u===110&&d>=65&&d<=90&&(typeof o=="function"||typeof o>"u")}function Au(s){return typeof s=="function"}function Vp(s,o){return Au(s)?s(o):s??Cu}function Ub(s,o){return o?s?(...c)=>{const u=c[0];if(Xp(u)){const m=u;Li(m);const h=o(...c);return m.baseUIHandlerPrevented||s==null||s(...c),h}const d=o(...c);return s==null||s(...c),d}:Yp(o):s}function Yp(s){return s&&((...o)=>{const c=o[0];return Xp(c)&&Li(c),s(...o)})}function Li(s){return s.preventBaseUIHandler=()=>{s.baseUIHandlerPrevented=!0},s}function Qp(s,o){return o?s?o+" "+s:o:s}function Xp(s){return s!=null&&typeof s=="object"&&"nativeEvent"in s}function Eu(s,o,c={}){const u=o.render,d=Bb(o,c);if(c.enabled===!1)return null;const m=c.state??es;return Vb(s,u,d,m)}function Bb(s,o={}){const{className:c,style:u,render:d}=s,{state:m=es,ref:h,props:x,stateAttributesMapping:y,enabled:g=!0}=o,N=g?_b(c,m):void 0,j=g?qp(u,m):void 0,A=g?Ob(m,y):es,w=g&&x?qb(x):void 0,T=g?mu(A,w)??{}:es;return typeof document<"u"&&(g?Array.isArray(h)?T.ref=Eb([T.ref,Xh(d),...h]):T.ref=fu(T.ref,Xh(d),h):fu(null,null)),g?(N!==void 0&&(T.className=Qp(T.className,N)),j!==void 0&&(T.style=mu(T.style,j)),T):es}function qb(s){return Array.isArray(s)?Rb(s):zu(void 0,s)}const Gb=Symbol.for("react.lazy");function Vb(s,o,c,u){if(o){if(typeof o=="function")return o(c,u);const d=zu(c,o.props);d.ref=c.ref;let m=o;return(m==null?void 0:m.$$typeof)===Gb&&(m=v.Children.toArray(o)[0]),v.cloneElement(m,d)}if(s&&typeof s=="string")return Yb(s,c);throw new Error(wu(8))}function Yb(s,o){return s==="button"?v.createElement("button",{type:"button",...o,key:o.key}):s==="img"?v.createElement("img",{alt:"",...o,key:o.key}):v.createElement(s,o)}function Qb({controlled:s,default:o,name:c,state:u="value"}){const{current:d}=v.useRef(s!==void 0),[m,h]=v.useState(o),x=d?s:m,y=v.useCallback(g=>{d||h(g)},[]);return[x,y]}let Zh=0;function Xb(s,o="mui"){const[c,u]=v.useState(s),d=s||c;return v.useEffect(()=>{c==null&&(Zh+=1,u(`${o}-${Zh}`))},[c,o]),d}const Kh=Su.useId;function Zb(s,o){if(Kh!==void 0){const c=Kh();return`${o}-${c}`}return Xb(s,o)}function Kb(s){return Zb(s,"base-ui")}const $b="none",Jb="trigger-press";function Zp(s,o,c,u){let d=!1,m=!1;const h=es;return{reason:s,event:o??new Event("base-ui"),cancel(){d=!0},allowPropagation(){m=!0},get isCanceled(){return d},get isPropagationAllowed(){return m},trigger:c,...h}}const Wb=()=>{},il=typeof document<"u"?v.useLayoutEffect:Wb,Fb=[];function Ib(s){v.useEffect(s,Fb)}const Ti=null;class Pb{constructor(){Ha(this,"callbacks",[]);Ha(this,"callbacksCount",0);Ha(this,"nextId",1);Ha(this,"startId",1);Ha(this,"isScheduled",!1);Ha(this,"tick",o=>{var d;this.isScheduled=!1;const c=this.callbacks,u=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,u>0)for(let m=0;m<c.length;m+=1)(d=c[m])==null||d.call(c,o)})}request(o){const c=this.nextId;return this.nextId+=1,this.callbacks.push(o),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),c}cancel(o){const c=o-this.startId;c<0||c>=this.callbacks.length||(this.callbacks[c]=null,this.callbacksCount-=1)}}const Mi=new Pb;class ca{constructor(){Ha(this,"currentId",Ti);Ha(this,"cancel",()=>{this.currentId!==Ti&&(Mi.cancel(this.currentId),this.currentId=Ti)});Ha(this,"disposeEffect",()=>this.cancel)}static create(){return new ca}static request(o){return Mi.request(o)}static cancel(o){return Mi.cancel(o)}request(o){this.cancel(),this.currentId=Mi.request(()=>{this.currentId=Ti,o()})}}function ey(){const s=lr(ca.create).current;return Ib(s.disposeEffect),s}function ty(s,o=!1,c=!1){const[u,d]=v.useState(s&&o?"idle":void 0),[m,h]=v.useState(s);return s&&!m&&(h(!0),d("starting")),!s&&m&&u!=="ending"&&!c&&d("ending"),!s&&!m&&u==="ending"&&d(void 0),il(()=>{if(!s&&m&&u!=="ending"&&c){const x=ca.request(()=>{d("ending")});return()=>{ca.cancel(x)}}},[s,m,u,c]),il(()=>{if(!s||o)return;const x=ca.request(()=>{d(void 0)});return()=>{ca.cancel(x)}},[o,s]),il(()=>{if(!s||!o)return;s&&m&&u!=="idle"&&d("starting");const x=ca.request(()=>{d("idle")});return()=>{ca.cancel(x)}},[o,s,m,u]),{mounted:m,setMounted:h,transitionStatus:u}}function ay(s){const{open:o,defaultOpen:c,onOpenChange:u,disabled:d}=s,[m,h]=Qb({controlled:o,default:c,name:"Collapsible",state:"open"}),{mounted:x,setMounted:y,transitionStatus:g}=ty(m,!0,!0),N=Kb(),[j,A]=v.useState(),w=j??N,T=rl(V=>{const te=!m,P=Zp(Jb,V.nativeEvent);u(te,P),!P.isCanceled&&h(te)});return v.useMemo(()=>({disabled:d,handleTrigger:T,mounted:x,open:m,panelId:w,setMounted:y,setOpen:h,setPanelIdState:A,transitionStatus:g}),[d,T,x,m,w,y,h,A,g])}const Kp=v.createContext(void 0);function $p(){const s=v.useContext(Kp);if(s===void 0)throw new Error(wu(15));return s}let tr=(function(s){return s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s})({});const ly={[tr.startingStyle]:""},ny={[tr.endingStyle]:""},Jp={transitionStatus(s){return s==="starting"?ly:s==="ending"?ny:null}};let ku=(function(s){return s.open="data-open",s.closed="data-closed",s[s.startingStyle=tr.startingStyle]="startingStyle",s[s.endingStyle=tr.endingStyle]="endingStyle",s})({}),sy=(function(s){return s.panelOpen="data-panel-open",s})({});const ry={[ku.open]:""},iy={[ku.closed]:""},oy={open(s){return s?{[sy.panelOpen]:""}:null}},cy={open(s){return s?ry:iy}},Wp={...cy,...Jp},uy=v.forwardRef(function(o,c){const{render:u,className:d,defaultOpen:m=!1,disabled:h=!1,onOpenChange:x,open:y,style:g,...N}=o,j=rl(x),A=ay({open:y,defaultOpen:m,onOpenChange:j,disabled:h}),w=v.useMemo(()=>({open:A.open,disabled:A.disabled,transitionStatus:A.transitionStatus}),[A.open,A.disabled,A.transitionStatus]),T=v.useMemo(()=>({...A,onOpenChange:j,state:w}),[A,j,w]),V=Eu("div",o,{state:w,ref:c,props:N,stateAttributesMapping:Wp});return l.jsx(Kp.Provider,{value:T,children:V})});function dy(){return typeof window<"u"}function Fp(s){var o;return(s==null||(o=s.ownerDocument)==null?void 0:o.defaultView)||window}function fy(s){return dy()?s instanceof HTMLElement||s instanceof Fp(s).HTMLElement:!1}const my=v.createContext(void 0);function hy(s=!1){const o=v.useContext(my);if(o===void 0&&!s)throw new Error(wu(16));return o}function py(s){const{focusableWhenDisabled:o,disabled:c,composite:u=!1,tabIndex:d=0,isNativeButton:m}=s,h=u&&o!==!1,x=u&&o===!1;return{props:v.useMemo(()=>{const g={onKeyDown(N){c&&o&&N.key!=="Tab"&&N.preventDefault()}};return u||(g.tabIndex=d,!m&&c&&(g.tabIndex=o?d:-1)),(m&&(o||h)||!m&&c)&&(g["aria-disabled"]=c),m&&(!o||x)&&(g.disabled=c),g},[u,c,o,h,x,m,d])}}function xy(s={}){const{disabled:o=!1,focusableWhenDisabled:c,tabIndex:u=0,native:d=!0,composite:m}=s,h=v.useRef(null),x=hy(!0),y=m??x!==void 0,{props:g}=py({focusableWhenDisabled:c,disabled:o,composite:y,tabIndex:u,isNativeButton:d}),N=v.useCallback(()=>{const w=h.current;nu(w)&&y&&o&&g.disabled===void 0&&w.disabled&&(w.disabled=!1)},[o,g.disabled,y]);il(N,[N]);const j=v.useCallback((w={})=>{const{onClick:T,onMouseDown:V,onKeyUp:te,onKeyDown:P,onPointerDown:ie,...pe}=w;return zu({onClick(G){if(o){G.preventDefault();return}T==null||T(G)},onMouseDown(G){o||V==null||V(G)},onKeyDown(G){if(o||(Li(G),P==null||P(G),G.baseUIHandlerPrevented))return;const ce=G.target===G.currentTarget,de=G.currentTarget,ee=nu(de),U=!d&&vy(de),fe=ce&&(d?ee:!U),Ee=G.key==="Enter",xe=G.key===" ",_=de.getAttribute("role"),se=(_==null?void 0:_.startsWith("menuitem"))||_==="option"||_==="gridcell";if(ce&&y&&xe){if(G.defaultPrevented&&se)return;G.preventDefault(),U||d&&ee?(de.click(),G.preventBaseUIHandler()):fe&&(T==null||T(G),G.preventBaseUIHandler());return}fe&&(!d&&(xe||Ee)&&G.preventDefault(),!d&&Ee&&(T==null||T(G)))},onKeyUp(G){if(!o){if(Li(G),te==null||te(G),G.target===G.currentTarget&&d&&y&&nu(G.currentTarget)&&G.key===" "){G.preventDefault();return}G.baseUIHandlerPrevented||G.target===G.currentTarget&&!d&&!y&&G.key===" "&&(T==null||T(G))}},onPointerDown(G){if(o){G.preventDefault();return}ie==null||ie(G)}},d?{type:"button"}:{role:"button"},g,pe)},[o,g,y,d]),A=rl(w=>{h.current=w,N()});return{getButtonProps:j,buttonRef:A}}function nu(s){return fy(s)&&s.tagName==="BUTTON"}function vy(s){return!!((s==null?void 0:s.tagName)==="A"&&(s!=null&&s.href))}const gy={...oy,...Jp},by=v.forwardRef(function(o,c){const{panelId:u,open:d,handleTrigger:m,state:h,disabled:x}=$p(),{className:y,disabled:g=x,render:N,nativeButton:j=!0,style:A,...w}=o,{getButtonProps:T,buttonRef:V}=xy({disabled:g,focusableWhenDisabled:!0,native:j});return Eu("button",o,{state:h,ref:[c,V],props:[{"aria-controls":d?u:void 0,"aria-expanded":d,onClick:m},w,T],stateAttributesMapping:gy})});function yy(s,o,c,u){return s.addEventListener(o,c,u),()=>{s.removeEventListener(o,c,u)}}function jy(s){const o=lr(Ny,s).current;return o.next=s,il(o.effect),o}function Ny(s){const o={current:s,next:s,effect:()=>{o.current=o.next}};return o}function Sy(s){return s==null?s:"current"in s?s.current:s}function Ip(s,o=!1,c=!0){const u=ey();return rl((d,m=null)=>{u.cancel();const h=Sy(s);if(h==null)return;const x=h,y=()=>{Hp.flushSync(d)};if(typeof x.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){d();return}function g(){Promise.all(x.getAnimations().map(N=>N.finished)).then(()=>{m!=null&&m.aborted||y()}).catch(()=>{if(c){m!=null&&m.aborted||y();return}const N=x.getAnimations();!(m!=null&&m.aborted)&&N.length>0&&N.some(j=>j.pending||j.playState!=="finished")&&g()})}if(o){const N=tr.startingStyle;if(!x.hasAttribute(N)){u.request(g);return}const j=new MutationObserver(()=>{x.hasAttribute(N)||(j.disconnect(),g())});j.observe(x,{attributes:!0,attributeFilter:[N]}),m==null||m.addEventListener("abort",()=>j.disconnect(),{once:!0});return}u.request(g)})}function wy(s){const{enabled:o=!0,open:c,ref:u,onComplete:d}=s,m=rl(d),h=Ip(u,c,!1);v.useEffect(()=>{if(!o)return;const x=new AbortController;return h(m,x.signal),()=>{x.abort()}},[o,c,m,h])}const Is={height:void 0,width:void 0};function Cy(s){const{externalRef:o,hiddenUntilFound:c,id:u,keepMounted:d,mounted:m,onOpenChange:h,open:x,setMounted:y,setOpen:g,transitionStatus:N}=s,j=v.useRef(null),A=v.useRef(null),[w,T]=v.useState(Is),V=v.useRef(Is),te=v.useRef(!1),P=v.useRef(x),ie=v.useRef(!1),[pe,G]=v.useState(!1),ce=v.useRef(null),de=fu(o,j),ee=jy({mounted:m,open:x}),U=Ip(j,!1,!1),fe=!x&&!m,Ee=pe?"idle":N,xe=x&&(P.current||ie.current),_=!x&&m&&A.current==="css-animation"&&w.height===void 0&&w.width===void 0?V.current:w,se=c&&fe&&A.current!=="css-animation",oe=rl((ue,k=!0)=>{k&&(V.current=ue),T(ue)}),ye=rl(()=>{var ue;(ue=ce.current)==null||ue.call(ce),ce.current=null}),E=rl(ue=>{ye(),ce.current=()=>{ce.current=null,ue()}}),$=rl(()=>{x&&m&&A.current==="css-animation"&&(ie.current=!0)});il(()=>{!pe||N==="starting"||G(!1)},[pe,N]),v.useEffect(()=>()=>{$(),ye()},[$,ye]),il(()=>{const ue=j.current;if(!ue)return;!x&&ce.current&&ye();const k=zy(ue,xe);if(A.current=k,x&&N==="idle"&&P.current&&k==="css-animation"){V.current=Fn(ue);return}if(x&&N==="starting"){const Y=te.current;if(te.current=!1,k==="none"){oe(Fn(ue)),G(!0);return}if(k==="css-transition"){const Q=Ay(ue);if(oe(Fn(ue)),!Y)return Q;const le=Ps(ue,"transition-duration","0s");return E(le),G(!0),Q}if(k==="css-animation"){if(oe(Fn(ue)),!Y){Ps(ue,"animation-name","none")();return}const Q=Ps(ue,"animation-name","none"),le=Ps(ue,"animation-duration","0s");Q(),E(le),G(!0);return}}if(!x&&m&&(N==="idle"||N==="starting")){if(P.current=!1,ie.current=!1,k==="none"){oe(Is,!1),y(!1);return}oe(Fn(ue));return}if(N!=="ending")return;if(k==="none"){y(!1);return}const b=Fn(ue);if(!((b.height??0)>0||(b.width??0)>0)){y(!1);return}oe(b),k==="css-animation"&&Ps(ue,"animation-name","none")()},[m,x,ye,oe,y,E,xe,N]),wy({enabled:x&&m&&Ee==="idle",open:!0,ref:j,onComplete(){x&&oe(Is,!1)}}),v.useEffect(()=>{if(x||!m||Ee!=="ending"||!j.current)return;const k=new AbortController;let b=-1;function D(){ee.current.open||(y(!1),oe(Is,!1))}return b=ca.request(()=>{k.signal.aborted||U(D,k.signal)}),()=>{ca.cancel(b),k.abort()}},[ee,m,x,Ee,U,oe,y]),il(()=>{const ue=j.current;!ue||!c||!fe||ue.setAttribute("hidden","until-found")},[fe,c]),v.useEffect(function(){const k=j.current;if(!k)return;function b(D){const Y=Zp($b,D);h(!0,Y),!Y.isCanceled&&(te.current=!0,g(!0))}return yy(k,"beforematch",b)},[h,g]);const me=d||c||m||x;return{height:_.height,props:{...se?{[ku.startingStyle]:""}:void 0,hidden:fe,id:u},ref:de,shouldPreventOpenAnimation:xe,shouldRender:me,transitionStatus:Ee,width:_.width}}function Fn(s){return{height:s.scrollHeight,width:s.scrollWidth}}function zy(s,o=!1){const c=Fp(s).getComputedStyle(s),u=(c.animationName.split(",").map(m=>m.trim()).some(m=>m!==""&&m!=="none")||o)&&$h(c.animationDuration),d=$h(c.transitionDuration);return u&&d||d?"css-transition":u?"css-animation":"none"}function $h(s){return s.split(",").map(o=>o.trim()).some(o=>o!==""&&Number.parseFloat(o)>0)}function Ps(s,o,c){const u=s.style.getPropertyValue(o),d=s.style.getPropertyPriority(o);return s.style.setProperty(o,c),()=>{if(u===""){s.style.removeProperty(o);return}s.style.setProperty(o,u,d)}}function Ay(s){const o={"justify-content":s.style.justifyContent,"align-items":s.style.alignItems,"align-content":s.style.alignContent,"justify-items":s.style.justifyItems};Object.keys(o).forEach(d=>{s.style.setProperty(d,"initial","important")});function c(){Object.entries(o).forEach(([d,m])=>{if(m===""){s.style.removeProperty(d);return}s.style.setProperty(d,m)})}const u=ca.request(c);return()=>{ca.cancel(u),c()}}let Jh=(function(s){return s.collapsiblePanelHeight="--collapsible-panel-height",s.collapsiblePanelWidth="--collapsible-panel-width",s})({});const Ey=v.forwardRef(function(o,c){const{className:u,hiddenUntilFound:d,keepMounted:m,render:h,id:x,style:y,...g}=o,{mounted:N,onOpenChange:j,open:A,panelId:w,setMounted:T,setPanelIdState:V,setOpen:te,state:P,transitionStatus:ie}=$p(),pe=d??!1,G=m??!1;il(()=>{if(x)return V(x),()=>{V(void 0)}},[x,V]);const{height:ce,props:de,ref:ee,shouldPreventOpenAnimation:U,shouldRender:fe,transitionStatus:Ee,width:xe}=Cy({externalRef:c,hiddenUntilFound:pe,id:w,keepMounted:G,mounted:N,onOpenChange:j,open:A,setMounted:T,setOpen:te,transitionStatus:ie}),_={...P,transitionStatus:Ee},se=qp(y,_),oe=Eu("div",{...o,style:void 0},{state:_,ref:ee,props:[de,{style:{[Jh.collapsiblePanelHeight]:ce===void 0?"auto":`${ce}px`,[Jh.collapsiblePanelWidth]:xe===void 0?"auto":`${xe}px`}},g,se?{style:se}:void 0,U?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Wp});return fe?oe:null});function he(...s){return Lp(jp(s))}var ky={home:["M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],specs:["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"],flow:["M4 16l4.586-4.586a2 2 0 0 1 2.828 0L16 16m-2-2l1.586-1.586a2 2 0 0 1 2.828 0L20 14m-6-6h.01M6 20h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2z"],context:["M11 4a2 2 0 1 1 4 0v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4a2 2 0 1 1 4 0z","M8 10h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z"],sun:["M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42","M12 5a7 7 0 1 0 0 14 7 7 0 0 0 0-14z"],moon:["M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"],grid:["M16 3h5v5","M8 3H3v5","M3 16v5h5","M16 21h5v-5","M3 12h3","M18 12h3","M12 3v3","M12 18v3"],plus:["M12 5v14","M5 12h14"],trash:["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2","M10 11v6","M14 11v6"],check:["M20 6L9 17l-5-5"],edit:["M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"],search:["M21 21l-4.35-4.35","M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z"],info:["M12 16v-4","M12 8h.01","M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10z"],"chevron-left":["M15 18l-6-6 6-6"],"chevron-right":["M9 18l6-6-6-6"],"arrow-up":["M12 19V5","M5 12l7-7 7 7"],star:["M12 2l3 7h7l-5.5 4 2 7L12 16l-5.5 4 2-7L3 9h7z"],"list-three":["M4 6h16","M4 12h16","M4 18h16"],settings:["M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z","M15 12a3 3 0 11-6 0 3 3 0 016 0z"],cross:["M3 12h3","M18 12h3","M12 3v3","M12 18v3","M5 5l14 14","M5 19l14-14"],x:["M18 6l-12 12","M6 6l12 12"],"alert-triangle":["M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","M12 9v4","M12 17h.01"],user:["M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2","M12 7a4 4 0 1 0 0-8 4 4 0 0 0 0 8z"],"x-circle":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M15 9l-6 6M9 9l6 6"],"check-circle":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M8 12l3 3 5-5"],"alert-circle":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M12 8v5","M12 16h.01"],help:["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M8 9.5a4 4 0 1 1 4.75 3.94c-.41.11-.75.4-.75.81V15","M12 18h.01"],"bar-chart":["M3 21h18","M5 21V10","M9 21V6","M13 21V3","M17 21V8"],code:["M16 18l6-6-6-6","M8 6l-6 6 6 6"],"file-text":["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"],"chevron-down":["M6 9l6 6 6-6"],"chevron-up":["M18 15l-6-6-6 6"],clock:["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M12 6v6l4 2"],folder:["M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"],box:["M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"],cpu:["M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2","M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v0a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2z","M13 13h2","M9 13h.01"],book:["M4 19.5A2.5 2.5 0 0 1 6.5 17H20","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z","M8 7h8","M8 11h6"],"pen-tool":["M12 19l7-7 3 3-7 7-3-3z","M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z","M2 2l7.586 7.586","M11 11l-4 4"],"git-branch":["M6 3v12","M6 3a4 4 0 0 1 4 4v0a4 4 0 0 1-4 4","M6 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6z","M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M18 9v1a2 2 0 0 1-2 2H10"],workflow:["M6 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6z","M18 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6z","M6 9v2a3 3 0 0 0 3 3h6a3 3 0 0 1 3 3v0","M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M18 9v6"],activity:["M22 12h-4l-3 9L9 3l-3 9H2"],shield:["M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"],copy:["M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2","M12 11h4","M12 16h4","M8 11h.01","M8 16h.01","M15 2H9a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1z"],bot:["M12 2c-2.5 0-5 1.5-5 4 0 1.5.8 2.8 2 3.5A5 5 0 0 0 7 14v1a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-1a5 5 0 0 0-2-4.5c1.2-.7 2-2 2-3.5 0-2.5-2.5-4-5-4z","M9 17v3a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-3","M9 11h.01","M15 11h.01"],circle:["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"],"loader-circle":["M21 12a9 9 0 1 1-6.219-8.56"],sparkles:["M12 3l1.5 3.5L17 8l-3.5 1.5L12 13l-1.5-3.5L7 8l3.5-1.5z","M17.5 14l.5 1.5L19.5 16l-1.5.5-.5 1.5-.5-1.5L15.5 16l1.5-.5z","M5.5 4l.5 1.5L7.5 6 6 6.5 5.5 8 5 6.5 3.5 6 5 5.5z"],zap:["M13 2L3 14h9l-1 8 10-12h-9l1-8z"],terminal:["M4 17l6-6-6-6","M12 19h8"],"circle-check":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M8 12l3 3 5-5"],"circle-x":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M15 9l-6 6M9 9l6 6"],"octagon-alert":["M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86z","M12 8v4","M12 16h.01"],hourglass:["M6 2v4a4 4 0 0 0 4 4 4 4 0 0 0-4 4v4H6","M18 2v4a4 4 0 0 1-4 4 4 4 0 0 1 4 4v4h0","M6 2h12","M6 22h12"],plug:["M12 22v-5","M5 12h14","M7 12V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v7","M9 9V5","M15 9V5"],"settings-2":["M20 7h-9","M14 17H5","M17 12H3","M7 7h.01","M21 17h.01","M12 12h.01"],"sliders-horizontal":["M4 6h16","M4 18h16","M10 4v4","M14 16v4","M7 10v0a2 2 0 0 0 2 2h0a2 2 0 0 0 2-2v0a2 2 0 0 0-2-2h0a2 2 0 0 0-2 2z","M17 14v0a2 2 0 0 0 2 2h0a2 2 0 0 0 2-2v0a2 2 0 0 0-2-2h0a2 2 0 0 0-2 2z"],"scroll-text":["M8 21h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H8","M16 3v18","M4 3h4v18H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z","M10 8h4","M10 12h4","M10 16h2"]};function z({name:s,size:o=16,className:c,...u}){const d=ky[s];return d?l.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",width:o,height:o,className:he("shrink-0",c),"aria-hidden":"true",...u,children:d.map(m=>l.jsx("path",{d:m},m))}):null}var Ty={primary:"bg-[var(--color-primary)] text-[var(--color-on-accent)] hover:bg-[var(--color-primary-hover)] hover:scale-[1.02] active:bg-[var(--color-primary-pressed)] border border-transparent",secondary:"bg-[var(--color-bg-sunken)] text-[var(--color-text-primary)] border border-[var(--color-border)] hover:border-[var(--color-text-secondary)]",danger:"bg-[var(--color-danger)] text-[var(--color-on-accent)] border border-transparent hover:opacity-90",ghost:"bg-transparent hover:bg-[var(--color-bg-sunken)] text-[var(--color-text-primary)] border border-transparent"},My={sm:"h-8 px-[var(--space-3)] text-xs rounded-[var(--radius-sm)]",default:"h-10 px-[var(--space-4)] text-sm rounded-[var(--radius-md)]",lg:"h-11 px-[var(--space-5)] text-base rounded-[var(--radius-md)]"};function F({variant:s="primary",size:o="default",loading:c,disabled:u,children:d,className:m,...h}){return l.jsxs("button",{className:he("inline-flex items-center justify-center gap-[var(--space-2)] font-medium disabled:opacity-50 disabled:pointer-events-none cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-base)]","transition-[background-color,border-color,box-shadow,opacity,color,transform] duration-[var(--motion-fast)] ease-[var(--ease-standard)] active:translate-y-px",c&&"opacity-80",Ty[s],My[o],m),disabled:u||c,...h,children:[c&&l.jsx(z,{name:"loader-circle",size:14,className:"animate-spin"}),d]})}function Tu({ariaLabel:s,className:o,children:c,...u}){return l.jsx("div",{role:"group","aria-label":s,className:he("inline-flex min-w-0 flex-wrap items-center gap-0.5 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-0.5",o),...u,children:c})}function Mu({selected:s=!1,count:o,children:c,className:u,type:d="button",...m}){return l.jsxs(F,{type:d,size:"sm",variant:"ghost","aria-pressed":s,"data-selected":s?"true":"false",className:he("h-7 min-w-0 rounded-[var(--radius-xs)] border-transparent px-2 text-caption text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-surface)] hover:text-[var(--color-text-primary)]","data-[selected=true]:border-[var(--color-border)] data-[selected=true]:bg-[var(--color-bg-surface)] data-[selected=true]:text-[var(--color-text-primary)] data-[selected=true]:shadow-sm",u),...m,children:[l.jsx("span",{className:"min-w-0 truncate",children:c}),o!==void 0?l.jsx("span",{className:"font-mono text-[11px] tabular-nums text-[var(--color-text-tertiary)]",children:o}):null]})}var Dy={amber:{color:"var(--color-primary)",onColor:"var(--color-on-accent)",softColor:"#FFB800",softBg:"#1C1808",softBorder:"#5C4F1A",outlineBorder:"#8B7A25",solidBg:"var(--color-primary)"},success:{color:"var(--color-success)",onColor:"var(--color-on-status)",softColor:"#4ADE80",softBg:"#1A2B20",softBorder:"#244A33",outlineBorder:"#2D6A45",solidBg:"#178640"},info:{color:"var(--color-info)",onColor:"var(--color-on-status)",softColor:"#93C5FD",softBg:"#1C2636",softBorder:"#2B4264",outlineBorder:"#3B5E8A",solidBg:"#2858A7"},error:{color:"var(--color-danger)",onColor:"var(--color-on-status)",softColor:"#F87171",softBg:"#2C1A1A",softBorder:"#542626",outlineBorder:"#7A3636",solidBg:"#A22E2E"},agent:{color:"var(--color-agent)",onColor:"var(--color-on-status)",softColor:"#C4B5FD",softBg:"#22203A",softBorder:"#3C3568",outlineBorder:"#564D96",solidBg:"#7260AA"}},Oy={amber:"clock",success:"circle-check",info:"info",error:"circle-x",agent:"sparkles"};function _y(s,o){const c=Dy[s];return o==="outline"?{background:"transparent",color:c.softColor,borderColor:c.outlineBorder}:o==="soft"?{background:c.softBg,color:c.softColor,borderColor:c.softBorder}:{background:c.solidBg,color:c.onColor,borderColor:c.solidBg}}function Ae({variant:s="amber",tone:o="solid",icon:c,className:u,children:d,style:m,...h}){const x=_y(s,o),y=c??Oy[s];return l.jsxs("span",{className:he("inline-flex items-center gap-[var(--space-1)] text-caption font-medium px-[var(--space-2)] py-[var(--space-1)] rounded-[var(--radius-full)] border-[length:var(--border-thin)]",u),style:{...x,...m},...h,children:[l.jsx(z,{name:y,size:12}),d]})}var Ry={default:"border-[var(--color-border)]",warning:"ds-action-panel--warning",danger:"ds-action-panel--danger",success:"ds-action-panel--success",info:"ds-action-panel--info"};function ar({icon:s,title:o,description:c,meta:u,action:d,secondaryAction:m,tone:h="default",density:x="default",className:y,children:g,...N}){return l.jsxs("section",{className:he("grid rounded-[var(--radius-md)] border bg-[var(--color-bg-surface)] shadow-sm",x==="compact"?"gap-[var(--layout-inline-gap)] p-[var(--space-4)]":"gap-[var(--layout-cluster-gap)] p-[var(--card-padding)]","sm:grid-cols-[auto_minmax(0,1fr)_auto] sm:items-center",Ry[h],y),...N,children:[s?l.jsx("div",{className:he("flex items-center justify-center rounded-[var(--radius-sm)] bg-[var(--color-bg-sunken)] text-[var(--color-text-secondary)]",x==="compact"?"size-8":"size-10"),children:s}):null,l.jsxs("div",{className:"grid min-w-0 gap-[var(--space-1)]",children:[u?l.jsx("div",{className:"ds-cluster",children:u}):null,l.jsx("h2",{className:he("text-[var(--color-text-primary)]",x==="compact"?"text-body-sm font-semibold":"text-h3 sm:text-h2"),children:o}),c?l.jsx("p",{className:he("max-w-3xl text-[var(--color-text-secondary)]",x==="compact"?"text-caption":"text-body-sm"),children:c}):null,g]}),d||m?l.jsxs("div",{className:"flex flex-wrap items-center gap-[var(--layout-toolbar-gap)] sm:justify-end",children:[m,d]}):null]})}function Na({items:s,className:o,...c}){return s.length===0?null:l.jsx("dl",{className:he("grid gap-[var(--layout-inline-gap)] sm:grid-cols-[repeat(auto-fit,minmax(8rem,1fr))]",o),...c,children:s.map((u,d)=>l.jsxs("div",{className:"grid gap-[var(--space-1)] rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-[var(--space-3)]",children:[l.jsxs("dt",{className:"ds-cluster text-caption font-medium uppercase text-[var(--color-text-tertiary)]",children:[u.icon,l.jsx("span",{children:u.label})]}),l.jsx("dd",{className:"min-w-0 break-words text-body-sm font-medium text-[var(--color-text-primary)]",children:u.value})]},d))})}function at({variant:s="default",className:o,children:c,style:u,...d}){return l.jsx("div",{className:he("rounded-[var(--radius-md)] border-[length:var(--border-thin)] shadow-sm transition-shadow duration-[var(--motion-fast)] ease-[var(--ease-standard)]",s==="default"&&"hover:shadow-[var(--card-hover-shadow)]",s==="agent"&&"border-l-2",s==="agent"&&"hover:shadow-[var(--card-hover-shadow)]",o),style:{background:"var(--color-bg-surface)",borderColor:s==="agent"?"var(--color-agent)":"var(--color-border)","--card-hover-shadow":s==="agent"?"0 0 28px color-mix(in oklch, var(--color-agent) 20%, transparent)":"0 0 24px color-mix(in oklch, var(--color-primary) 12%, transparent)",...u},...d,children:c})}function Sa({className:s,children:o,...c}){return l.jsx("div",{className:he("grid gap-[var(--card-header-gap)] border-b border-[var(--color-border)] p-[var(--card-padding)]",s),...c,children:o})}function lt({className:s,children:o,...c}){return l.jsx("div",{className:he("grid gap-[var(--card-content-gap)] p-[var(--card-padding)]",s),...c,children:o})}function as({className:s,label:o,id:c,...u}){const d=c||(o==null?void 0:o.replace(/\s+/g,"-").toLowerCase());return l.jsxs("label",{htmlFor:d,className:"group flex cursor-pointer items-center gap-[var(--space-2)]",children:[l.jsx("input",{type:"checkbox",id:d,className:he("peer sr-only",s),...u}),l.jsx("span",{"data-slot":"checkbox-control","aria-hidden":"true",className:"flex size-[var(--icon-md)] shrink-0 items-center justify-center rounded-[var(--radius-xs)] border-[length:var(--border-thin)] border-[var(--color-border)] bg-[var(--color-bg-base)] text-[var(--color-on-accent)] transition-colors [&_svg]:opacity-0 peer-checked:border-[var(--color-primary)] peer-checked:bg-[var(--color-primary)] peer-checked:[&_svg]:opacity-100 peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--focus-ring-color)] peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-[var(--color-bg-base)] peer-disabled:opacity-50",children:l.jsx(z,{name:"check",size:12,className:"transition-opacity"})}),o&&l.jsx("span",{className:"select-none text-sm transition-colors group-hover:text-[var(--color-text-primary)] peer-disabled:opacity-50",style:{color:"var(--color-text-secondary)"},children:o})]})}var ht=v.forwardRef(function({className:o,...c},u){return l.jsx("input",{ref:u,className:he("w-full px-[var(--space-3)] py-[var(--space-2)] rounded-[var(--radius-sm)] border-[length:var(--border-thin)] text-sm transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)]","focus-visible:outline-none focus-visible:border-[var(--focus-ring-color)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-base)] focus-visible:shadow-[0_0_0_4px_color-mix(in_oklch,var(--color-primary)_14%,transparent)]","placeholder:opacity-50",o),style:{borderColor:"var(--color-border)",background:"var(--color-bg-base)",color:"var(--color-text-primary)"},...c})}),ls=v.forwardRef(function({className:o,...c},u){return l.jsx("textarea",{ref:u,className:he("w-full px-[var(--space-3)] py-[var(--space-2)] rounded-[var(--radius-sm)] border-[length:var(--border-thin)] text-sm transition-colors font-mono","focus-visible:outline-none focus-visible:border-[var(--focus-ring-color)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-base)]","resize-y",o),style:{borderColor:"var(--color-border)",background:"var(--color-bg-base)",color:"var(--color-text-primary)"},...c})});function ts({className:s,...o}){return l.jsx("label",{"data-slot":"label",className:he("flex items-center gap-[var(--space-2)] text-sm leading-none font-medium select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),...o})}function ns({open:s,onClose:o,title:c,children:u,actions:d,variant:m="default",hideHeader:h=!1,className:x,bodyClassName:y,contentRef:g}){const N=v.useRef(null);return v.useEffect(()=>{if(!s)return;const j=A=>{A.key==="Escape"&&o()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[s,o]),s?l.jsx("div",{ref:N,className:"fixed inset-0 z-[var(--z-modal)] flex items-center justify-center animate-fade-in backdrop-blur-sm",style:{background:"var(--overlay)"},onClick:j=>{j.target===N.current&&o()},onKeyDown:j=>{j.key==="Escape"&&o()},children:l.jsxs("dialog",{ref:g,open:!0,className:he("border-[length:var(--border-thin)] shadow-xl animate-slide-up",m==="fullscreen"?"m-0 flex h-screen max-h-none w-screen max-w-none flex-col overflow-hidden rounded-none":"mx-4 w-full max-w-md rounded-[var(--radius-lg)]",x),style:{background:"var(--color-bg-surface)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"},"aria-label":c,children:[!h&&l.jsxs("div",{className:"flex items-center justify-between border-b px-[var(--space-4)] py-[var(--space-3)]",style:{borderColor:"var(--color-border)"},children:[l.jsx("h2",{className:"text-h2",style:{color:"var(--color-text-primary)"},children:c}),l.jsx("button",{type:"button",onClick:o,className:"inline-flex size-8 items-center justify-center rounded-[var(--radius-sm)] transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]",style:{color:"var(--color-text-secondary)"},"aria-label":"Close dialog",children:l.jsx(z,{name:"x",size:16})})]}),l.jsx("div",{className:he(m==="fullscreen"?"flex min-h-0 flex-1 flex-col":"px-[var(--space-4)] py-[var(--space-3)]",y),children:u}),d&&l.jsx("div",{className:"flex justify-end gap-[var(--space-3)] border-t px-[var(--space-4)] py-[var(--space-3)]",style:{borderColor:"var(--color-border)"},children:d})]})}):null}function Du({open:s,onClose:o,onConfirm:c,title:u,message:d,confirmLabel:m="Confirmar",cancelLabel:h="Cancelar",variant:x="default"}){return l.jsx(ns,{open:s,onClose:o,title:u,actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:o,children:h}),l.jsx(F,{type:"button",variant:x==="danger"?"danger":"primary",onClick:()=>{c(),o()},children:m})]}),children:l.jsx("p",{className:"text-body",style:{color:"var(--color-text-secondary)"},children:d})})}function Pp({open:s,onClose:o,onSubmit:c,title:u,label:d,placeholder:m,submitLabel:h="Criar",cancelLabel:x="Cancelar"}){const y=v.useRef(null);v.useEffect(()=>{s&&y.current&&y.current.focus()},[s]);const g=()=>{var j;const N=(j=y.current)==null?void 0:j.value.trim();N&&(c(N),o())};return l.jsx(ns,{open:s,onClose:o,title:u,actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:o,children:x}),l.jsx(F,{type:"button",onClick:g,children:h})]}),children:l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:d}),l.jsx(ht,{ref:y,type:"text",placeholder:m,onKeyDown:N=>{N.key==="Enter"&&g()}})]})})}function un({className:s,...o}){return l.jsx("div",{className:he("skeleton-shimmer rounded-[var(--radius-sm)]",s),...o})}function ta(){return l.jsxs("div",{className:"rounded-[var(--radius-md)] border-[length:var(--border-thin)] p-[var(--space-4)] flex flex-col gap-[var(--space-3)]",style:{background:"var(--card)",borderColor:"var(--border)"},children:[l.jsx(un,{className:"h-4 w-1/3"}),l.jsx(un,{className:"h-3 w-full"}),l.jsx(un,{className:"h-3 w-2/3"})]})}var Wh={success:"color-success",error:"color-danger",info:"color-info",agent:"color-agent"},Ly={success:"circle-check",error:"circle-x",info:"info",agent:"sparkles"},ex=v.createContext({toast:()=>{},toastWithOptions:()=>{}});function nr(){return v.useContext(ex)}var Fh=0;function Hy({children:s}){const[o,c]=v.useState([]),u=v.useRef(new Map),d=v.useCallback(x=>{c(g=>g.filter(N=>N.id!==x));const y=u.current.get(x);y&&(clearTimeout(y),u.current.delete(x))},[]),m=v.useCallback((x,y="info")=>{const g=++Fh;c(j=>[...j,{id:g,message:x,type:y}]);const N=setTimeout(()=>d(g),3e3);u.current.set(g,N)},[d]),h=v.useCallback((x,y)=>{const g=++Fh;c(j=>[...j,{id:g,message:x,type:(y==null?void 0:y.type)??"info",action:y==null?void 0:y.action}]);const N=setTimeout(()=>d(g),(y==null?void 0:y.duration)??3e3);u.current.set(g,N)},[d]);return l.jsxs(ex.Provider,{value:{toast:m,toastWithOptions:h},children:[s,l.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-[var(--space-2)]",children:o.map(x=>l.jsxs("div",{className:"flex max-w-sm items-start gap-[var(--space-3)] rounded-[var(--radius-md)] border-[length:var(--border-thin)] px-[var(--space-4)] py-[var(--space-3)] text-body font-medium shadow-lg animate-slide-in-right",style:{background:"var(--color-bg-surface)",color:"var(--color-text-primary)",borderColor:`color-mix(in srgb, var(--${Wh[x.type]}) 35%, var(--color-border))`},children:[l.jsx(z,{name:Ly[x.type],size:18,style:{color:`var(--${Wh[x.type]})`}}),l.jsx("span",{className:"flex-1",children:x.message}),x.action&&l.jsx(F,{type:"button",size:"sm",variant:x.type==="error"?"danger":"secondary",className:"shrink-0",onClick:()=>{var y;(y=x.action)==null||y.onClick(),d(x.id)},children:x.action.label})]},x.id))})]})}function Uy({tabs:s,activeTab:o,onChange:c,children:u,className:d,ariaLabel:m}){var N;const[h,x]=v.useState(((N=s[0])==null?void 0:N.id)||""),y=o??h;function g(j){o||x(j),c==null||c(j)}return l.jsxs("div",{className:he("flex flex-col h-full",d),children:[l.jsx("div",{className:"flex border-b shrink-0",style:{borderColor:"var(--color-border)"},role:"tablist","aria-label":m,children:s.map(j=>l.jsxs("button",{type:"button",role:"tab","aria-selected":y===j.id,onClick:()=>g(j.id),className:he("flex items-center gap-[var(--space-1)] px-[var(--space-3)] py-[var(--space-2)] text-body font-medium transition-colors border-b-2 -mb-px cursor-pointer",y===j.id?"border-[var(--color-primary)]":"border-transparent"),style:{color:y===j.id?"var(--color-primary)":"var(--color-text-secondary)"},children:[j.icon,j.label]},j.id))}),u&&l.jsx("div",{className:"flex-1 overflow-y-auto",children:u(y)})]})}var By={default:"var(--color-primary)",active:"var(--color-primary)",warning:"var(--color-warning)",error:"var(--color-danger)",complete:"var(--color-success)",agent:"var(--color-agent)"};function Ou({value:s,max:o=100,label:c,size:u="md",state:d="default",barColor:m,showValue:h,indeterminate:x=!1,className:y}){const g=Math.min(Math.max(s/o*100,0),100),j={xs:"h-1",sm:"h-1.5",md:"h-2"}[u],A=m??By[d];return l.jsxs("div",{className:he("flex flex-col gap-[var(--space-1)]",y),children:[(c||h)&&l.jsxs("div",{className:"flex items-center justify-between",children:[c&&l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:c}),h&&l.jsxs("span",{className:"text-caption tabular-nums",style:{color:"var(--color-text-secondary)"},children:[Math.round(g),"%"]})]}),l.jsx("div",{className:he("w-full rounded-full overflow-hidden",j),style:{background:"var(--color-bg-sunken)"},role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":x?void 0:s,"aria-label":c??"Progresso",children:l.jsx("div",{className:he("rounded-full transition-all duration-300",j,x&&"animate-progress-stripes"),style:{width:x?"100%":`${g}%`,background:d==="complete"&&g>0?"var(--color-success)":A,color:"var(--color-text-primary)"}})})]})}function on({icon:s,title:o,description:c,action:u,className:d}){return l.jsxs("div",{className:he("flex flex-col items-center justify-center gap-[var(--layout-inline-gap)] px-[var(--empty-state-padding-inline)] py-[var(--empty-state-padding-block)] text-center",d),children:[s&&l.jsx("div",{style:{color:"var(--color-text-secondary)"},children:s}),l.jsx("h3",{className:"text-h2",style:{color:"var(--color-text-primary)"},children:o}),c&&l.jsx("p",{className:"max-w-sm text-body",style:{color:"var(--color-text-secondary)"},children:c}),u]})}var qy={info:"info",success:"check-circle",warning:"alert-triangle",error:"x-circle"};function Gy({title:s,children:o,variant:c="info",className:u}){const m={info:"color-info",success:"color-success",warning:"color-warning",error:"color-danger"}[c]??"color-info";return l.jsxs("div",{className:he("flex gap-[var(--space-2)] p-[var(--space-3)] rounded-[var(--radius-md)] border-[length:var(--border-thin)]",u),style:{background:`color-mix(in srgb, var(--${m}) 12%, transparent)`,borderColor:`color-mix(in srgb, var(--${m}) 35%, transparent)`,color:"var(--color-text-primary)"},children:[l.jsx(z,{name:qy[c]||"info",width:"var(--icon-md)",height:"var(--icon-md)",className:"shrink-0 mt-0.5",style:{color:`var(--${m})`}}),l.jsxs("div",{className:"text-body",style:{color:"var(--color-text-primary)"},children:[s&&l.jsx("strong",{className:"block font-semibold mb-0.5",children:s}),o]})]})}function Vy({title:s,children:o,details:c,onRetry:u,className:d}){const[m,h]=v.useState(!1);return l.jsxs("div",{className:he("rounded-[var(--radius-md)] border-[length:var(--border-thin)] text-body",d),style:{background:"color-mix(in srgb, var(--color-danger) 10%, transparent)",borderColor:"var(--color-danger)"},role:"alert",children:[l.jsxs("div",{className:"flex items-start gap-[var(--space-2)] p-[var(--space-3)]",children:[l.jsx(z,{name:"x-circle",width:"var(--icon-md)",height:"var(--icon-md)",className:"shrink-0 mt-0.5",style:{color:"var(--color-danger)"}}),l.jsxs("div",{className:"flex-1 min-w-0",style:{color:"var(--color-text-primary)"},children:[s&&l.jsx("strong",{className:"block font-semibold mb-0.5",children:s}),l.jsx("div",{children:o})]}),l.jsxs("div",{className:"flex items-center gap-[var(--space-1)] shrink-0",children:[u&&l.jsx("button",{onClick:u,className:"text-caption font-medium px-[var(--space-2)] py-[var(--space-1)] rounded transition-colors hover:opacity-80",style:{background:"color-mix(in srgb, var(--color-danger) 15%, transparent)",color:"var(--color-danger)"},children:"Tentar novamente"}),c&&l.jsx("button",{onClick:()=>h(!m),className:"text-caption px-[var(--space-1)] py-[var(--space-1)] rounded transition-colors hover:opacity-80",style:{color:"var(--color-text-secondary)"},"aria-label":m?"Recolher detalhes":"Expandir detalhes","aria-expanded":m,children:l.jsx(z,{name:m?"chevron-up":"chevron-down",width:"var(--icon-sm)",height:"var(--icon-sm)"})})]})]}),c&&m&&l.jsx("div",{className:"px-[var(--space-3)] pb-[var(--space-3)] pt-0 text-caption",style:{color:"var(--color-text-secondary)"},children:l.jsx("pre",{className:"p-[var(--space-2)] rounded whitespace-pre-wrap break-words max-h-48 overflow-y-auto",style:{background:"color-mix(in srgb, var(--color-bg-sunken) 50%, transparent)",fontFamily:"var(--font-code)"},children:c})})]})}function Yy({content:s,children:o,position:c="top",className:u}){const[d,m]=v.useState(!1),[h,x]=v.useState(null),y=v.useRef(null);function g(){var j;x(((j=y.current)==null?void 0:j.getBoundingClientRect())??null),m(!0)}function N(){if(!h)return{};const j=8;return c==="right"?{left:h.right+j,top:h.top+h.height/2,transform:"translateY(-50%)"}:c==="left"?{left:h.left-j,top:h.top+h.height/2,transform:"translate(-100%, -50%)"}:c==="bottom"?{left:h.left+h.width/2,top:h.bottom+j,transform:"translateX(-50%)"}:{left:h.left+h.width/2,top:h.top-j,transform:"translate(-50%, -100%)"}}return l.jsxs("div",{ref:y,className:he("relative inline-flex",u),onMouseEnter:g,onMouseLeave:()=>m(!1),onFocus:g,onBlur:()=>m(!1),children:[o,d&&typeof document<"u"?Hp.createPortal(l.jsx("div",{className:he("fixed z-[var(--z-tooltip)] px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs whitespace-nowrap pointer-events-none"),style:{...N(),background:"var(--foreground)",color:"var(--background)"},role:"tooltip",children:s}),document.body):null]})}var Qy={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"};function Xy({className:s,...o}){return l.jsx("img",{className:he("aspect-square h-full w-full object-cover",s),...o})}function Zy({className:s,delayMs:o,size:c="md",children:u,...d}){return l.jsx("span",{className:he("flex items-center justify-center rounded-full font-medium",Qy[c],s),style:{background:"color-mix(in srgb, var(--color-text-secondary) 20%, transparent)",color:"var(--color-text-primary)"},...d,children:u})}function Ky({size:s="md",status:o="offline",statusClassName:c,children:u,className:d,...m}){const h=s==="lg"?"var(--icon-lg)":s==="sm"?"var(--icon-sm)":"var(--icon-md)",x=o==="online"?"var(--color-success)":o==="busy"?"var(--color-danger)":o==="thinking"?"var(--color-agent)":o==="away"?"var(--color-warning)":"var(--color-border)";return l.jsxs("div",{className:he("relative inline-flex shrink-0",d),...m,children:[l.jsx("div",{className:he("relative flex shrink-0 overflow-hidden rounded-full border-[length:var(--border-thin)] transition-shadow duration-[var(--motion-base)] ease-[var(--ease-standard)]",o==="thinking"&&"animate-agent-thinking-avatar",s==="lg"?"h-12 w-12 text-base":s==="sm"?"h-8 w-8 text-xs":"h-10 w-10 text-sm"),style:{borderColor:o==="thinking"?"var(--color-agent)":"var(--color-border)",background:"var(--color-bg-sunken)",boxShadow:o==="thinking"?"0 0 0 3px color-mix(in oklch, var(--color-agent) 16%, transparent), 0 0 16px color-mix(in oklch, var(--color-agent) 28%, transparent)":void 0},children:u}),l.jsx("span",{className:he("absolute bottom-0 right-0 rounded-full border-2",c),style:{width:h,height:h,backgroundColor:x,borderColor:"var(--color-bg-surface)",boxShadow:o==="thinking"?"0 0 8px var(--color-agent)":void 0},"aria-hidden":!0})]})}function tx({agent:s,size:o="md"}){const c=(s.avatar.type==="initials",s.avatar.value);return l.jsx(Ky,{size:o,status:s.status,"aria-label":`${s.displayName} (${s.status})`,title:s.displayName,children:s.avatar.type==="image"?l.jsx(Xy,{src:s.avatar.value,alt:s.displayName}):l.jsx(Zy,{size:o,style:{background:s.color},children:c})})}function $y({className:s,orientation:o="horizontal",decorative:c=!0,...u}){return l.jsx("div",{"data-slot":"separator",role:c?void 0:"separator","aria-orientation":o,"aria-hidden":c?!0:void 0,className:he("shrink-0 border-0 bg-[var(--color-border)]",o==="horizontal"?"h-px w-full":"h-full w-px",s),...u})}function Jy({className:s,invalid:o,disabled:c,...u}){return l.jsx("div",{"data-slot":"field","data-invalid":o?!0:void 0,"data-disabled":c?!0:void 0,className:he("flex min-w-0 flex-col gap-[var(--space-2)]",s),...u})}function Wy({className:s,...o}){return l.jsx(ts,{"data-slot":"field-label",className:he("text-[var(--color-text-primary)]",s),...o})}function Fy({className:s,...o}){return l.jsx("p",{"data-slot":"field-description",className:he("text-xs leading-relaxed text-[var(--color-text-secondary)]",s),...o})}function Iy({className:s,children:o,...c}){return o?l.jsx("p",{"data-slot":"field-error",role:"alert",className:he("text-xs font-medium leading-relaxed text-[var(--color-danger)]",s),...c,children:o}):null}function Py({label:s,description:o,error:c,id:u,required:d,disabled:m,...h}){const x=v.useId(),y=u??x,g=o?`${y}-description`:void 0,N=c?`${y}-error`:void 0;return l.jsxs(Jy,{invalid:!!c,disabled:m,children:[l.jsxs(Wy,{htmlFor:y,children:[s,d?l.jsx("span",{"aria-hidden":"true",children:"*"}):null]}),l.jsx(ht,{id:y,type:"date",required:d,disabled:m,"aria-invalid":!!c,"aria-describedby":[g,N].filter(Boolean).join(" ")||void 0,...h}),o?l.jsx(Fy,{id:g,children:o}):null,l.jsx(Iy,{id:N,children:c})]})}function e0({children:s,open:o,onOpenChange:c}){const[u,d]=v.useState(!1),m=o!==void 0,h=m?o:u,x=y=>{m||d(y),c==null||c(y)};return l.jsx("div",{className:"relative inline-block",children:typeof s=="function"?s({open:h,setOpen:x}):s})}function t0({className:s,asChild:o,children:c,...u}){return o?l.jsx(l.Fragment,{children:c}):l.jsx("button",{className:he("inline-flex items-center justify-center gap-[var(--space-1)] rounded-[var(--radius-md)] px-[var(--space-2)] py-[var(--space-1)] text-sm font-medium transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-primary/30",s),type:"button","aria-haspopup":"true",...u,children:c})}function a0({className:s,align:o="start",sideOffset:c=4,children:u,...d}){const m={start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"};return l.jsx("div",{className:he("absolute z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-md)] border-[length:var(--border-thin)] bg-card p-[var(--space-2)] shadow-md",m[o],s),style:{top:`calc(100% + ${c}px)`,borderColor:"var(--border)",background:"var(--card)"},role:"menu",...d,children:u})}function Ih({className:s,inset:o,children:c,...u}){return l.jsx("button",{className:he("relative flex w-full cursor-default select-none items-center gap-[var(--space-2)] rounded-[var(--radius-sm)] px-[var(--space-2)] py-[var(--space-1)] text-sm outline-none transition-colors hover:bg-muted focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-[var(--space-3)]",s),role:"menuitem",type:"button",...u,children:c})}function l0({className:s,...o}){return l.jsx("div",{className:he("-mx-1 my-1 h-px bg-border",s),...o})}function n0({className:s,inset:o,children:c,...u}){return l.jsx("div",{className:he("px-[var(--space-2)] py-[var(--space-1)] text-xs font-semibold text-muted-foreground",o&&"pl-[var(--space-3)]",s),...u,children:c})}var _u=v.createContext(null);function sr({children:s,open:o,onOpenChange:c}){const[u,d]=v.useState(!1),m=o!==void 0,h=m?o:u,x=v.useCallback(y=>{m||d(y),c==null||c(y)},[m,c]);return l.jsx(_u.Provider,{value:{open:h,setOpen:x},children:typeof s=="function"?s({open:h,setOpen:x}):s})}function rr({className:s,side:o="right",children:c,...u}){const d=v.useContext(_u);if(v.useEffect(()=>{if(!(d!=null&&d.open))return;const h=x=>{x.key==="Escape"&&d.setOpen(!1)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[d]),d&&!d.open)return null;const m={top:"inset-x-0 top-0 border-b",bottom:"inset-x-0 bottom-0 border-t",left:"inset-y-0 left-0 border-r",right:"inset-y-0 right-0 border-l"};return l.jsx("div",{className:"fixed inset-0 z-50 animate-fade-in backdrop-blur-sm",style:{background:"var(--overlay)"},onClick:()=>d==null?void 0:d.setOpen(!1),children:l.jsx("div",{className:he("fixed flex flex-col shadow-xl max-h-full animate-slide-up",o==="left"||o==="right"?"h-full w-full sm:max-w-lg":"max-h-[85vh] w-full rounded-t-[var(--radius-lg)]",m[o],s),style:{borderColor:"var(--color-border)",background:"var(--color-bg-surface)"},role:"dialog","aria-modal":"true",tabIndex:-1,onClick:h=>h.stopPropagation(),...u,children:c})})}function Hi({className:s,children:o,...c}){return l.jsx("div",{className:he("flex items-center justify-between border-b px-[var(--space-6)] py-[var(--space-4)]",s),style:{borderColor:"var(--color-border)"},...c,children:o})}function Ui({className:s,children:o,...c}){return l.jsx("h2",{className:he("text-h2",s),...c,children:o})}function Ru({className:s,children:o,...c}){return l.jsx("p",{className:he("text-body",s),style:{color:"var(--color-text-secondary)"},children:o})}function ax({className:s,asChild:o,children:c,onClick:u,...d}){const m=v.useContext(_u);return o?l.jsx(l.Fragment,{children:c}):l.jsx("button",{className:he("inline-flex items-center justify-center rounded-[var(--radius-md)] p-1.5 transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]",s),style:{color:"var(--color-text-secondary)"},type:"button",onClick:h=>{m==null||m.setOpen(!1),u==null||u(h)},...d,children:c})}function Lu({className:s,children:o,...c}){return l.jsx("div",{className:he("flex items-center justify-end gap-[var(--space-3)] border-t px-[var(--space-6)] py-[var(--space-4)]",s),style:{borderColor:"var(--color-border)"},...c,children:o})}var lx=v.createContext(null);function Hu(){const s=v.useContext(lx);if(!s)throw new Error("Select sub-components must be used within <Select>");return s}function hu({children:s,value:o,onValueChange:c,defaultValue:u}){const[d,m]=v.useState(u??""),[h,x]=v.useState(!1),y=o!==void 0,g=y?o:d,N=v.useRef(null),j=v.useCallback(A=>{y||m(A),c==null||c(A),x(!1)},[y,c]);return v.useEffect(()=>{if(!h)return;function A(T){N.current&&!N.current.contains(T.target)&&x(!1)}function w(T){T.key==="Escape"&&x(!1)}return document.addEventListener("mousedown",A),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",w)}},[h]),l.jsx(lx.Provider,{value:{value:g,setValue:j,open:h,setOpen:x,selectedValue:g},children:l.jsx("div",{ref:N,className:"relative",children:typeof s=="function"?s({value:g,setValue:j}):s})})}function pu({className:s,children:o,placeholder:c,...u}){const{open:d,setOpen:m}=Hu();return l.jsxs("button",{className:he("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-[var(--radius-sm)] border-[length:var(--border-thin)] bg-transparent px-[var(--space-3)] py-[var(--space-2)] text-sm shadow-sm transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] disabled:cursor-not-allowed disabled:opacity-50",s),style:{borderColor:"var(--color-border)"},type:"button",onClick:()=>m(!d),...u,children:[o??(c?l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:c}):null),l.jsx(z,{name:"chevron-down",size:16,className:he("opacity-50 transition-transform",d&&"rotate-180")})]})}function xu({className:s,position:o="popper",children:c,...u}){const{open:d}=Hu();return d?l.jsx("div",{className:he("absolute z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-xs)] border-[length:var(--border-thin)] bg-card p-[var(--space-2)] shadow-md mt-1 w-full",s),style:{borderColor:"var(--color-border)",background:"var(--color-bg-surface)"},...u,children:c}):null}function er({className:s,value:o,children:c,...u}){const{setValue:d,selectedValue:m}=Hu(),h=m===o;return l.jsx("button",{className:he("relative flex w-full cursor-default select-none items-center rounded-[var(--radius-xs)] px-[var(--space-2)] py-[var(--space-1)] text-sm outline-none transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",h&&"bg-[var(--color-primary)]/10",s),style:{color:h?"var(--color-primary)":"var(--color-text-primary)"},type:"button",role:"option","aria-selected":h,onClick:()=>d(o),...u,children:c})}function Ph({className:s,placeholder:o,...c}){return l.jsx("span",{className:he("text-sm",s),...c,children:c.children??o??""})}function ir(s){return l.jsx(uy,{"data-slot":"collapsible",...s})}function or(s){return l.jsx(by,{"data-slot":"collapsible-trigger",...s})}function cr(s){return l.jsx(Ey,{"data-slot":"collapsible-content",...s})}var s0={default:"border-[var(--color-border)]",warning:"ds-list-item--warning",danger:"ds-list-item--danger",success:"ds-list-item--success",info:"ds-list-item--info"};function ol({tone:s="default",className:o,children:c,...u}){return l.jsx("ul",{className:he("grid gap-[var(--layout-list-gap)]",s==="surface"&&"rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-base)] p-[var(--layout-list-gap)]",o),...u,children:c})}function cl({leading:s,title:o,description:c,meta:u,action:d,tone:m="default",className:h,children:x,...y}){return l.jsxs("li",{className:he("grid gap-[var(--layout-cluster-gap)] rounded-[var(--radius-sm)] border bg-[var(--color-bg-base)] p-[var(--layout-list-item-padding)]","transition-[background-color,border-color] duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--surface-hover)]","sm:grid-cols-[auto_minmax(0,1fr)_auto] sm:items-center",s0[m],h),...y,children:[s?l.jsx("div",{className:"flex items-start sm:items-center",children:s}):null,l.jsxs("div",{className:"grid min-w-0 gap-[var(--space-1)]",children:[u?l.jsx("div",{className:"ds-cluster",children:u}):null,l.jsx("div",{className:"min-w-0 break-words text-body-sm font-medium text-[var(--color-text-primary)]",children:o}),c?l.jsx("div",{className:"min-w-0 break-words text-caption text-[var(--color-text-secondary)]",children:c}):null,x]}),d?l.jsx("div",{className:"flex min-w-0 flex-wrap items-center sm:justify-end",children:d}):null]})}v.createContext(null);var nx=v.createContext(null);function r0(){const[s,o]=v.useState(!1);return v.useEffect(()=>{const c=window.matchMedia("(max-width: 767px)"),u=()=>o(c.matches);return u(),c.addEventListener("change",u),()=>c.removeEventListener("change",u)},[]),s}function i0({defaultOpen:s=!0,open:o,onOpenChange:c,className:u,style:d,children:m,...h}){const x=r0(),[y,g]=v.useState(s),[N,j]=v.useState(!1),A=o!==void 0,w=A?o:y,T=v.useCallback(P=>{A||g(P),c==null||c(P)},[A,c]),V=v.useCallback(()=>{if(x){j(P=>!P);return}T(!w)},[x,T,w]),te=v.useMemo(()=>({open:w,setOpen:T,openMobile:N,setOpenMobile:j,isMobile:x,state:w?"expanded":"collapsed",toggleSidebar:V}),[x,N,T,w,V]);return l.jsx(nx.Provider,{value:te,children:l.jsx("div",{"data-sidebar-wrapper":!0,className:he("group/sidebar-wrapper flex min-h-svh w-full",u),style:{"--sidebar-width":"18rem","--sidebar-width-icon":"3rem",...d},...h,children:m})})}function Ta(){const s=v.useContext(nx);if(!s)throw new Error("useSidebar must be used within SidebarProvider.");return s}function o0({side:s="left",collapsible:o="icon",className:c,children:u,...d}){const{open:m,openMobile:h,setOpenMobile:x,isMobile:y}=Ta();return y?l.jsx(sr,{open:h,onOpenChange:x,children:l.jsx(rr,{side:s,className:"w-[var(--sidebar-width)] max-w-[88vw] p-0",children:l.jsx("div",{className:"flex h-full w-full flex-col bg-[var(--color-sidebar)] text-[var(--color-sidebar-foreground)]",children:u})})}):l.jsx("aside",{"data-sidebar":"sidebar","data-state":m?"expanded":"collapsed","data-collapsible":m?"":o,"data-side":s,className:he("relative z-[var(--z-sticky)] hidden h-full min-h-svh shrink-0 overflow-visible border-r bg-[var(--color-sidebar)] text-[var(--color-sidebar-foreground)] transition-[width] duration-[var(--motion-base)] ease-[var(--ease-standard)] md:flex md:flex-col",m?"w-[var(--sidebar-width)]":"w-[var(--sidebar-width-icon)]",s==="right"&&"border-l border-r-0",c),style:{borderColor:"var(--app-sidebar-border, var(--color-sidebar-border))"},...d,children:u})}function c0({className:s,...o}){return l.jsx("div",{className:he("flex shrink-0 items-center gap-2",s),...o})}function u0({className:s,...o}){const{open:c}=Ta();return l.jsx("div",{className:he("flex min-h-0 flex-1 flex-col overflow-y-auto",c?"p-2":"px-1 py-2",s),...o})}function ep({className:s,...o}){const{open:c}=Ta();return l.jsx("div",{className:he("grid gap-2 py-2",!c&&"justify-items-center",s),...o})}function tp({className:s,...o}){const{open:c}=Ta();return l.jsx("div",{className:he("grid gap-1",!c&&"justify-items-center",s),...o})}function ap({className:s,...o}){const{open:c}=Ta();return l.jsx("div",{className:he("px-2 text-caption font-semibold uppercase text-[var(--color-text-secondary)] transition-[opacity,transform] duration-[var(--motion-fast)] ease-[var(--ease-standard)]",!c&&"sr-only",s),...o})}function lp({className:s,...o}){const{open:c}=Ta();return l.jsx("ul",{className:he("grid gap-1",!c&&"justify-items-center",s),...o})}function np({className:s,...o}){const{open:c}=Ta();return l.jsx("li",{className:he("min-w-0",!c&&"size-9",s),...o})}function sp({isActive:s,tooltip:o,className:c,children:u,...d}){const{open:m}=Ta(),h=l.jsx("button",{type:"button","data-active":s?"true":void 0,className:he("group/sidebar-menu-button flex h-9 w-full min-w-0 items-center gap-2 rounded-[var(--radius-sm)] px-2 text-left text-sm font-medium text-[var(--color-sidebar-foreground)] transition-[background-color,color,border-color,box-shadow,transform] duration-[var(--motion-fast)] ease-[var(--ease-standard)]","hover:bg-[var(--color-sidebar-accent)] hover:text-[var(--color-sidebar-accent-foreground)] hover:translate-x-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]","active:translate-y-px disabled:pointer-events-none disabled:opacity-50",s&&"bg-[var(--color-sidebar-accent)] text-[var(--color-sidebar-accent-foreground)] border border-[var(--app-sidebar-border,var(--color-sidebar-border))]",!m&&"size-9 justify-center px-0",c),title:m?void 0:o,...d,children:u});return m||!o?h:l.jsx(Yy,{content:o,position:"right",className:"w-full",children:h})}function sl(s){const o=[],c=/(\*\*(.+?)\*\*)|(\*(.+?)\*)|(`(.+?)`)|(\[(.+?)\]\((.+?)\))/g;let u=0,d,m=0;for(;(d=c.exec(s))!==null;)d.index>u&&o.push(s.slice(u,d.index)),d[2]?o.push(l.jsx("strong",{children:d[2]},m++)):d[4]?o.push(l.jsx("em",{children:d[4]},m++)):d[6]?o.push(l.jsx("code",{className:"rounded px-1 py-0.5 text-xs",style:{backgroundColor:"var(--color-bg-surface)",color:"var(--color-text-primary)"},children:d[6]},m++)):d[8]&&d[9]&&o.push(l.jsx("a",{href:d[9],target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2",style:{color:"var(--color-primary)"},children:d[8]},m++)),u=c.lastIndex;return u<s.length&&o.push(s.slice(u)),o}function Ll({content:s,className:o}){var h;const c=s.split(`
|
|
50
|
+
`),u=[];let d=0,m=0;for(;d<c.length;){const x=c[d],y=x.trim();if(y===""){d++;continue}if(y.startsWith("```")){const N=[];for(d++;d<c.length&&!c[d].trim().startsWith("```");)N.push(c[d]),d++;d++,u.push(l.jsx("pre",{className:"overflow-x-auto rounded-[var(--radius-sm)] p-4 text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx("code",{children:N.join(`
|
|
51
|
+
`)})},m++));continue}if(y.startsWith("> ")){const N=[];for(;d<c.length&&c[d].trim().startsWith("> ");)N.push(c[d].trim().slice(2)),d++;u.push(l.jsx("blockquote",{className:"my-2 border-l-2 py-1 pl-4 text-sm",style:{borderColor:"var(--color-primary)",color:"var(--color-text-secondary)"},children:N.map((j,A)=>l.jsxs(v.Fragment,{children:[sl(j),A<N.length-1&&l.jsx("br",{})]},j))},m++));continue}if(y.startsWith("- ")){const N=[];for(;d<c.length&&c[d].trim().startsWith("- ");)N.push(l.jsx("li",{className:"text-sm",children:sl(c[d].trim().slice(2))},N.length)),d++;u.push(l.jsx("ul",{className:"my-2 list-disc space-y-1 pl-5",children:N},m++));continue}if(/^\d+\.\s/.test(y)){const N=[];for(;d<c.length&&/^\d+\.\s/.test(c[d].trim());)N.push(l.jsx("li",{className:"text-sm",children:sl(c[d].trim().replace(/^\d+\.\s/,""))},N.length)),d++;u.push(l.jsx("ol",{className:"my-2 list-decimal space-y-1 pl-5",children:N},m++));continue}if(y.startsWith("|")&&d+1<c.length&&/^\|[\s\-:]+\|/.test(c[d+1].trim())){const N=[];for(;d<c.length&&c[d].trim().startsWith("|");)N.push(c[d].trim()),d++;const j=T=>T.split("|").slice(1,-1).map(V=>V.trim()),A=j(N[0]),w=N.slice(2).map(j);u.push(l.jsx("div",{className:"my-3 overflow-x-auto",children:l.jsxs("table",{className:"w-full border-collapse text-sm",style:{color:"var(--color-text-primary)"},children:[l.jsx("thead",{children:l.jsx("tr",{children:A.map(T=>l.jsx("th",{className:"border-b-2 px-3 py-2 text-left font-semibold",style:{borderColor:"var(--border)"},children:sl(T)},T))})}),l.jsx("tbody",{children:w.map((T,V)=>l.jsx("tr",{children:T.map((te,P)=>l.jsx("td",{className:"border-b px-3 py-1.5",style:{borderColor:"var(--border)"},children:sl(te)},`${te}-${P}`))},T.join("|")||V))})]})},m++));continue}if(/^-{3,}$/.test(y)){u.push(l.jsx("hr",{className:"my-4",style:{borderColor:"var(--border)"}},m++)),d++;continue}if(/^#{1,3}\s/.test(y)){const N=(h=y.match(/^#+/))==null?void 0:h[0].length,j=y.replace(/^#+\s/,""),A=m++;N===1?u.push(l.jsx("h2",{className:"mb-3 mt-1 text-xl font-bold",children:sl(j)},A)):N===2?u.push(l.jsx("h2",{className:"mb-2 mt-4 text-lg font-semibold",children:sl(j)},A)):u.push(l.jsx("h3",{className:"mb-1 mt-3 text-base font-semibold",children:sl(j)},A)),d++;continue}const g=[x];for(d++;d<c.length&&c[d].trim()!==""&&!c[d].trim().startsWith("#")&&!c[d].trim().startsWith("- ")&&!/^\d+\.\s/.test(c[d].trim())&&!c[d].trim().startsWith("> ")&&!c[d].trim().startsWith("```")&&!c[d].trim().startsWith("|")&&!/^-{3,}$/.test(c[d].trim());)g.push(c[d]),d++;u.push(l.jsx("p",{className:"mb-2 text-sm leading-relaxed",children:sl(g.join(`
|
|
52
|
+
`))},m++))}return l.jsx("div",{className:he("space-y-0",o),children:u})}function d0({title:s,description:o,progress:c,sections:u,activeSection:d,actions:m}){var y,g;const h=Math.round(c*100),x=d?((y=u.find(N=>N.id===d))==null?void 0:y.label)??d:(g=u[0])==null?void 0:g.label;return l.jsxs("div",{className:"shrink-0 border-b border-border bg-[var(--color-bg-surface)]",children:[l.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between lg:px-6",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-[var(--radius-sm)] bg-[var(--color-bg-sunken)] text-[var(--color-primary)]",children:l.jsx(z,{name:"file-text",size:16})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"truncate text-base font-semibold text-[var(--color-text-primary)]",children:s}),o?l.jsx("p",{className:"mt-1 line-clamp-2 text-sm leading-snug text-[var(--color-text-secondary)]",children:o}):null,x?l.jsx("p",{className:"mt-2 text-caption font-medium text-[var(--color-primary)]",children:x}):null]})]}),l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-end",children:[l.jsxs("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:[h,"% lido"]}),m]})]}),l.jsxs("div",{className:"px-4 pb-3 lg:px-6",children:[l.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-[var(--color-border)]",children:l.jsx("div",{className:"h-full rounded-full bg-[var(--color-primary)] transition-[width] duration-[var(--duration-fast)] ease-[var(--ease-standard)]",style:{width:`${h}%`}})}),u.length>0?l.jsxs("div",{className:"mt-2 hidden items-center gap-1 overflow-hidden sm:flex",children:[u.slice(0,8).map(N=>{const j=d===N.id;return l.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-caption text-[var(--color-text-secondary)]",children:[l.jsx("span",{className:j?"size-1.5 shrink-0 rounded-full bg-[var(--color-primary)]":"size-1 shrink-0 rounded-full bg-[var(--color-text-disabled)]"}),l.jsx("span",{className:j?"truncate text-[var(--color-primary)]":"truncate",children:N.label})]},N.id)}),u.length>8?l.jsxs("span",{className:"text-caption text-[var(--color-text-secondary)]",children:["+",u.length-8]}):null]}):null]})]})}function f0(s){const o=s.match(/^##\s+(.+)/gm);return o?o.map(c=>{const u=c.replace(/^##\s+/,"");return{id:u.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),label:u}}):[]}function vu({file:s,initialContent:o,onSave:c,title:u,description:d}){const[m,h]=v.useState("read"),[x,y]=v.useState(o),[g,N]=v.useState(!1),j=v.useRef(null),[A,w]=v.useState(0),[T,V]=v.useState(null),te=x!==o,P=v.useMemo(()=>f0(x),[x]),ie=v.useMemo(()=>P.map(de=>de.label),[P]);v.useEffect(()=>{y(o),h("read")},[s,o]),v.useEffect(()=>{const de=j.current;if(!de||m!=="read")return;const ee=de;function U(){var ye,E,$;const{scrollTop:fe,scrollHeight:Ee,clientHeight:xe}=ee,_=Ee-xe;w(_>0?Math.min(fe/_,1):0);const se=ee.querySelectorAll("h2");let oe=((ye=P[0])==null?void 0:ye.id)??null;for(const me of se){const ue=((E=me.textContent)==null?void 0:E.trim())??"",k=ie.indexOf(ue);if(k===-1)continue;me.getBoundingClientRect().top-ee.getBoundingClientRect().top<200&&(oe=(($=P[k])==null?void 0:$.id)??null)}V(oe)}return ee.addEventListener("scroll",U,{passive:!0}),U(),()=>ee.removeEventListener("scroll",U)},[m,P,ie]);const pe=v.useCallback(async()=>{N(!0);try{await c(x),h("read")}finally{N(!1)}},[x,c]);function G(){te&&!window.confirm("Descartar alterações não salvas?")||(y(o),h("read"))}const ce=v.useCallback(de=>{(de.metaKey||de.ctrlKey)&&de.key==="s"&&(de.preventDefault(),te&&pe())},[pe,te]);return m==="read"?l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsx(d0,{title:u,description:d,progress:A,sections:P,activeSection:T,actions:l.jsxs(F,{size:"sm",onClick:()=>h("edit"),children:[l.jsx(z,{name:"edit",size:14}),"Editar"]})}),l.jsx("div",{ref:j,className:"flex-1 overflow-y-auto bg-[var(--color-bg-base)] px-4 py-6 sm:px-6 lg:px-8",tabIndex:0,children:l.jsx("div",{className:"mx-auto max-w-3xl rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-surface)] px-5 py-5 shadow-sm sm:px-7 sm:py-6",children:l.jsx(Ll,{content:x})})})]}):l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",onKeyDown:ce,children:[l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-[var(--color-bg-surface)] px-4 py-3 lg:px-6",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(z,{name:"edit",size:16,className:"shrink-0 text-[var(--color-primary)]"}),l.jsx("span",{className:"truncate text-sm font-semibold text-[var(--color-text-primary)]",children:u})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:"Edite o Markdown e revise a prévia antes de salvar."})]}),te?l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-[var(--radius-full)] border border-[color-mix(in_oklch,var(--color-warning)_42%,transparent)] px-2 py-1 text-caption font-medium text-[var(--color-warning)]",title:"Alterações não salvas",role:"status","aria-label":"Alterações não salvas",children:[l.jsx("span",{className:"size-1.5 rounded-full bg-[var(--color-warning)]"}),"Alterações não salvas"]}):null,l.jsxs(F,{size:"sm",onClick:pe,loading:g,disabled:!te,children:[l.jsx(z,{name:"check",size:14}),"Salvar"]}),l.jsx(F,{size:"sm",variant:"ghost",onClick:G,children:"Cancelar"})]}),l.jsxs("div",{className:"relative grid flex-1 grid-cols-1 overflow-y-auto lg:min-h-0 lg:grid-cols-2 lg:overflow-hidden",children:[l.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 lg:px-6",children:l.jsx("span",{className:"text-caption font-medium uppercase text-[var(--color-text-secondary)]",children:"Editor"})}),l.jsx(ls,{"aria-label":"Conteúdo Markdown",value:x,onChange:de=>y(de.target.value),className:"min-h-[42svh] flex-1 resize-none rounded-none border-none px-4 py-4 text-sm leading-relaxed outline-none lg:min-h-0 lg:px-6",style:{background:"var(--color-bg-base)",color:"var(--color-text-primary)",fontFamily:"var(--font-code)"},spellCheck:!1})]}),l.jsx("div",{className:"absolute inset-y-0 left-1/2 hidden w-px bg-[var(--color-border)] lg:block"}),l.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex shrink-0 items-center gap-2 border-y border-border px-4 py-2 lg:border-b lg:border-t-0 lg:px-6",children:l.jsx("span",{className:"text-caption font-medium uppercase text-[var(--color-text-secondary)]",children:"Preview"})}),l.jsx("div",{className:"min-h-[42svh] flex-1 overflow-y-auto bg-[var(--surface-1)] px-4 py-4 lg:min-h-0 lg:px-6",children:l.jsx("div",{className:"mx-auto max-w-3xl",children:l.jsx(Ll,{content:x})})})]})]})]})}function m0(s){switch(s){case"success":return{dot:"bg-[var(--color-success)]",line:"bg-[var(--color-success)]"};case"error":return{dot:"bg-[var(--color-danger)]",line:"bg-[var(--color-danger)]"};case"agent":return{dot:"bg-[var(--color-agent)]",line:"bg-[var(--color-agent)]"};case"info":return{dot:"bg-[var(--color-info)]",line:"bg-[var(--color-info)]"};default:return{dot:"bg-[var(--color-text-secondary)]",line:"bg-[var(--color-border)]"}}}function h0({className:s,children:o}){return l.jsx("div",{className:he("flex flex-col",s),children:o})}function rp({title:s,description:o,timestamp:c,status:u="default",icon:d,action:m,className:h,last:x=!1}){const y=m0(u);return l.jsxs("div",{className:he("flex gap-[var(--space-3)]",h),children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:he("mt-1 size-[var(--icon-xs)] shrink-0 rounded-full",y.dot),"aria-hidden":"true"}),!x&&l.jsx("div",{className:he("w-px flex-1 my-[var(--space-2)]",y.line),"aria-hidden":"true"})]}),l.jsx("div",{className:"min-w-0 flex-1 pb-[var(--space-5)]",children:l.jsxs("div",{className:"flex flex-col gap-[var(--space-3)] sm:flex-row sm:items-start sm:justify-between sm:gap-[var(--space-2)]",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-[var(--space-2)]",children:[d&&l.jsx("span",{className:"shrink-0 size-[var(--icon-md)] flex items-center justify-center",children:d}),l.jsx("span",{className:"min-w-0 text-body font-medium leading-snug",style:{color:"var(--color-text-primary)"},children:s})]}),o&&l.jsx("p",{className:"mt-[var(--space-1)] text-caption leading-relaxed",style:{color:"var(--color-text-secondary)"},children:o})]}),l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-[var(--space-2)] sm:justify-end",children:[c&&l.jsx("span",{className:"whitespace-nowrap text-caption tabular-nums",style:{color:"var(--color-text-secondary)"},children:c}),m&&l.jsx("div",{className:"shrink-0",children:m})]})]})})]})}function sx({title:s,titleId:o,description:c,left:u,right:d,className:m}){return l.jsxs("header",{className:he("flex flex-col items-stretch justify-between gap-[var(--layout-cluster-gap)] border-b border-[var(--color-border)] bg-[var(--color-bg-surface)] px-[var(--card-padding)] py-[var(--layout-cluster-gap)] sm:flex-row sm:items-center",m),style:{color:"var(--color-text-primary)"},children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-[var(--layout-cluster-gap)]",children:[u,l.jsxs("div",{className:"flex min-w-0 flex-col",children:[s&&l.jsx("h1",{id:o,className:"text-h2",children:s}),c&&l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:c})]})]}),l.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-[var(--layout-toolbar-gap)] sm:justify-end",children:d})]})}var su="workspace:",In="scope:",ru="__workspace__";function Pn(s,o,c){return s===1?o:c}function p0({sidebarOpen:s=!0,onToggleSidebar:o,workspaces:c,activeWorkspaceId:u,scopes:d=[],activeScopeId:m=null,onWorkspaceChange:h,onScopeChange:x,pendingDecisions:y=0,health:g,onOpenHealthCenter:N,onOpenSettings:j,theme:A,onThemeChange:w,userSlot:T,className:V}){const te=u===void 0?c[0]:c.find(xe=>xe.id===u),P=(te==null?void 0:te.name)??"Escolha um workspace",ie=d.find(xe=>xe.id===m),pe=(ie==null?void 0:ie.label)??"Todo o workspace",G=m?`${In}${m}`:`${In}${ru}`,ce=y>0,de=!!(g&&g.activeAlerts>0),ee=ce||de,U=(g==null?void 0:g.activeAlerts)??0,fe=(g==null?void 0:g.criticalAlerts)??0,Ee=A==="dark"?"light":"dark";return l.jsxs("header",{className:he("app-header-surface grid min-h-16 grid-cols-[auto_minmax(0,1fr)_auto] grid-rows-[auto_auto] items-center gap-x-2 gap-y-2 px-4 py-3 sm:grid-cols-[auto_minmax(0,420px)_minmax(0,1fr)_auto]",V),children:[l.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"col-start-1 row-start-1 size-8 px-0","aria-label":s?"Recolher menu global":"Expandir menu global",title:s?"Recolher menu":"Expandir menu",onClick:o,children:l.jsx(z,{name:"list-three",size:16})}),l.jsxs(hu,{value:G,onValueChange:xe=>{if(xe.startsWith(su)){h==null||h(xe.slice(su.length));return}if(xe.startsWith(In)){const _=xe.slice(In.length);x==null||x(_===ru?null:_)}},children:[l.jsx(pu,{"aria-label":`Contexto atual: workspace ${P}, escopo ${pe}`,className:"col-start-2 row-start-1 min-w-0 max-w-[420px] justify-self-start sm:min-w-[240px]",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(z,{name:"box",size:16}),l.jsx("span",{className:"truncate",children:P}),l.jsx("span",{className:"text-[var(--color-text-secondary)]",children:"/"}),l.jsx(z,{name:"folder",size:14,className:"text-[var(--color-text-secondary)]"}),l.jsx("span",{className:"truncate text-[var(--color-text-secondary)]",children:pe})]})}),l.jsxs(xu,{className:"min-w-[280px]",children:[l.jsx("div",{className:"px-2 py-1 text-caption font-semibold uppercase text-[var(--color-text-secondary)]",children:"Workspace"}),c.length===0?l.jsx("div",{className:"px-2 py-2 text-sm text-[var(--color-text-secondary)]",children:"Nenhum workspace encontrado"}):c.map(xe=>l.jsx(er,{value:`${su}${xe.id}`,children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(z,{name:(te==null?void 0:te.id)===xe.id?"check":"box",size:14}),l.jsx("span",{className:"truncate",children:xe.name})]})},xe.id)),l.jsx("div",{className:"my-2 border-t border-[var(--color-border)]"}),l.jsx("div",{className:"px-2 py-1 text-caption font-semibold uppercase text-[var(--color-text-secondary)]",children:"Escopo"}),l.jsx(er,{value:`${In}${ru}`,children:"Todo o workspace"}),d.map(xe=>l.jsx(er,{value:`${In}${xe.id}`,children:xe.label},xe.id))]})]}),l.jsx("div",{className:"col-start-1 col-end-4 row-start-2 flex min-w-0 flex-wrap items-center gap-2 sm:col-start-3 sm:col-end-4 sm:row-start-1 sm:justify-self-start",children:ee?l.jsxs(F,{type:"button",variant:"secondary",size:"sm","aria-label":`Abrir supervisao: ${y} ${Pn(y,"decisao pendente","decisoes pendentes")}, ${U} ${Pn(U,"sinal ativo","sinais ativos")}, ${fe} ${Pn(fe,"bloqueia conclusao","bloqueiam conclusao")}`,className:"app-status-pill app-status-pill--action whitespace-nowrap",onClick:N,children:[l.jsx(z,{name:"shield",size:14}),l.jsx("span",{children:"Supervisao"}),ce?l.jsxs(Ae,{variant:"amber",icon:"clock",children:[y," ",Pn(y,"decisao","decisoes")]}):null,de?l.jsxs(Ae,{variant:"amber",icon:"octagon-alert",children:[U," ",Pn(U,"sinal","sinais")]}):null,fe>0?l.jsxs(Ae,{variant:"error",icon:"circle-x",children:[fe," ",Pn(fe,"bloqueia","bloqueiam")]}):null]}):null}),l.jsxs("div",{className:"col-start-3 row-start-1 flex shrink-0 items-center justify-end gap-2 sm:col-start-4",children:[A&&w?l.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:()=>w(Ee),"aria-label":`Alternar para tema ${Ee==="light"?"claro":"escuro"}`,title:`Tema ${Ee==="light"?"claro":"escuro"}`,children:l.jsx(z,{name:A==="dark"?"sun":"moon",size:16})}):null,j?l.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:j,"aria-label":"Abrir configurações do workspace",title:"Configurações do workspace",children:l.jsx(z,{name:"settings",size:16})}):null,T]})]})}function x0({sidebar:s,header:o,children:c,sidebarCollapsed:u=!1,className:d,...m}){const h=["app-shell",u?"app-shell--sidebar-collapsed":"",d??""].filter(Boolean).join(" ");return l.jsxs("div",{className:h,...m,children:[l.jsx("div",{className:"app-shell__sidebar",children:s}),l.jsx("div",{className:"app-shell__header",children:o}),l.jsx("div",{className:"app-shell__content",children:c})]})}var v0={default:{backgroundColor:"#282B32",color:"var(--color-text-secondary)",borderColor:"#2E3138"},agent:{backgroundColor:"#22203A",color:"#C4B5FD",borderColor:"#53497C"},success:{backgroundColor:"#1A2B20",color:"#4ADE80",borderColor:"#1C623A"},info:{backgroundColor:"#1C2636",color:"#93C5FD",borderColor:"#36547C"},warning:{backgroundColor:"#1C1808",color:"#FCD34D",borderColor:"#866611"},danger:{backgroundColor:"#2C1A1A",color:"#FCA5A5",borderColor:"#762C2F"}};function Je({variant:s="default",className:o,children:c,style:u,...d}){const m=v0[s];return l.jsx("span",{"data-slot":"tag",className:he("inline-flex items-center gap-[var(--space-1)] rounded-[var(--radius-full)] border-[length:var(--border-thin)] px-[var(--space-2)] py-[var(--space-1)] text-caption font-medium leading-none",o),style:{...m,...u},...d,children:c})}function g0(s){return s?s.split(/[/\\]/).pop()||s:"Todo o workspace"}function b0({theme:s,onThemeChange:o,gateCount:c=0,activeDirectory:u,workspaces:d,activeWorkspace:m,onWorkspaceChange:h,onDirectoryChange:x,health:y,onOpenHealthCenter:g,onOpenWorkspaceSettings:N}){const{open:j,setOpen:A}=Ta(),w=(m==null?void 0:m.directories)??[];return l.jsx(p0,{sidebarOpen:j,onToggleSidebar:()=>A(!j),workspaces:d.map(T=>({id:T.slug,name:T.name})),activeWorkspaceId:(m==null?void 0:m.slug)??null,scopes:w.map(T=>({id:T,label:g0(T)})),activeScopeId:u??null,onWorkspaceChange:T=>{const V=d.find(te=>te.slug===T);V&&(h==null||h(V))},onScopeChange:x,pendingDecisions:c,health:y,onOpenHealthCenter:g,onOpenSettings:m?N:void 0,theme:s,onThemeChange:o})}function y0({size:s=64}){return l.jsxs("svg",{width:s,height:s,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Letra L",role:"img",children:[l.jsx("circle",{cx:"16",cy:"10",r:"6",fill:"var(--color-primary)"}),l.jsx("path",{d:"M16 10V50H38",stroke:"var(--color-primary)",strokeWidth:"8",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("circle",{cx:"16",cy:"30",r:"7",fill:"var(--color-primary-pressed)"}),l.jsx("circle",{cx:"16",cy:"50",r:"6",fill:"var(--color-primary)"}),l.jsx("circle",{cx:"44",cy:"50",r:"6",fill:"var(--color-primary)"}),l.jsx("circle",{cx:"57",cy:"50",r:"6",fill:"var(--color-text-primary)",opacity:"0.9"})]})}const j0=[{id:"supervision",label:"Supervisão",icon:"shield",color:"var(--color-info)"},{id:"work",label:"Trabalho",icon:"grid",color:"var(--color-primary)"},{id:"knowledge",label:"Conhecimento e Regras",icon:"book",color:"var(--color-agent)"},{id:"activity",label:"Atividade",icon:"activity",color:"var(--color-success)"},{id:"agents",label:"Agentes",icon:"user",color:"var(--color-agent)"}],N0=[{id:"settings",label:"Workspace",icon:"settings",color:"var(--color-text-secondary)"}];function S0({activeTab:s,onTabChange:o,workspaceActive:c,onOpenWorkspaceSettings:u}){const{open:d,isMobile:m,setOpenMobile:h}=Ta();return l.jsxs(o0,{collapsible:"icon",side:"left",children:[l.jsx(c0,{className:d?"flex flex-row items-center border-b px-4":"flex flex-row items-center justify-center border-b px-0",style:{borderColor:"var(--app-sidebar-border, var(--color-border))",height:"64px"},children:l.jsxs("div",{className:d?"flex min-w-0 items-center gap-2":"flex min-w-0 items-center justify-center",children:[l.jsx(y0,{size:28}),l.jsx("span",{"data-sidebar-label":"brand",className:d?"truncate text-sm font-semibold text-[var(--color-text-primary)]":"sr-only",children:"Letra"})]})}),l.jsxs(u0,{children:[l.jsxs(ep,{children:[l.jsx(ap,{children:"Navegação"}),l.jsx(tp,{children:l.jsx(lp,{children:j0.map(x=>l.jsx(np,{children:l.jsxs(sp,{"aria-label":x.label,isActive:s===x.id,disabled:!c,onClick:()=>{x.id==="settings"?u==null||u():o(x.id),m&&h(!1)},tooltip:x.label,children:[l.jsx(z,{name:x.icon,size:16,className:"transition-transform duration-[var(--motion-fast)] group-hover/sidebar-menu-button:scale-110",style:{color:x.color}}),l.jsx("span",{"data-sidebar-label":x.id,className:d?"truncate":"sr-only",children:x.label})]})},x.id))})})]}),l.jsx($y,{}),l.jsxs(ep,{children:[l.jsx(ap,{children:"Configuração"}),l.jsx(tp,{children:l.jsx(lp,{children:N0.map(x=>l.jsx(np,{children:l.jsxs(sp,{"aria-label":x.label,isActive:s===x.id,disabled:!c,onClick:()=>{u==null||u(),m&&h(!1)},tooltip:x.label,children:[l.jsx(z,{name:x.icon,size:16,className:"transition-transform duration-[var(--motion-fast)] group-hover/sidebar-menu-button:scale-110",style:{color:x.color}}),l.jsx("span",{"data-sidebar-label":x.id,className:d?"truncate":"sr-only",children:x.label})]})},x.id))})})]})]})]})}function yt(...s){return Lp(jp(s))}const iu=[{id:"opencode",label:"OpenCode"},{id:"cursor",label:"Cursor"},{id:"claude-code",label:"Claude Code"},{id:"windsurf",label:"Windsurf"},{id:"hermes",label:"Hermes"},{id:"vscode",label:"VS Code"},{id:"copilot",label:"Copilot"}],w0=[{path:"C:/Workspace",label:"C:/Workspace"},{path:"C:/Dev",label:"C:/Dev"},{path:"C:/Projects",label:"C:/Projects"},{path:"C:/Users",label:"C:/Users"},{path:"D:/",label:"D:/"}],ip={opencode:s=>`Você é um arquiteto de software especializado em configurar o Letra (framework SDD — Specification-Driven Development) para novos workspaces.
|
|
53
|
+
|
|
54
|
+
## Missão
|
|
55
|
+
Analise profundamente o workspace em **${s.workspacePath}** e seus diretórios monitorados (${s.dirs.join(", ")}) para gerar o harness completo do Letra - conjunto de arquivos de contexto que descrevem a arquitetura, decisões, glossário e fluxo de trabalho.
|
|
56
|
+
|
|
57
|
+
## Passos
|
|
58
|
+
|
|
59
|
+
### 1. Explorar o Workspace
|
|
60
|
+
- Varra todos os diretórios listados acima
|
|
61
|
+
- Identifique a stack principal (linguagem, framework, runtime, banco de dados)
|
|
62
|
+
- Detecte padrões de arquitetura (MVC, hexagonal, microsserviços, monólito, etc.)
|
|
63
|
+
- Mapeie a estrutura de diretórios e o propósito de cada módulo/pasta
|
|
64
|
+
- Identifique convenções de código (ESLint, Prettier, tsconfig, Dockerfile, CI/CD)
|
|
65
|
+
- Verifique se há package.json, Cargo.toml, pyproject.toml, Gemfile, go.mod, etc.
|
|
66
|
+
- Analise testes existentes (framework de teste, cobertura, padrões)
|
|
67
|
+
|
|
68
|
+
### 2. Gerar Constitution (${s.workspacePath}/.letra/constitution.md)
|
|
69
|
+
Regras não-negociáveis do workspace:
|
|
70
|
+
- Stack e versões obrigatórias
|
|
71
|
+
- Padrões de arquitetura que devem ser seguidos
|
|
72
|
+
- Convenções de código (naming, organização de imports, testes)
|
|
73
|
+
- Regras de segurança (nunca expor secrets, validação de input, etc.)
|
|
74
|
+
- Práticas de CI/CD e deploy
|
|
75
|
+
- Como as specs devem ser escritas (thin specs, formato)
|
|
76
|
+
|
|
77
|
+
### 3. Gerar Context (${s.workspacePath}/.letra/context.md)
|
|
78
|
+
Visão geral do workspace:
|
|
79
|
+
- Intent: propósito do workspace "${s.name}" — ${s.description}
|
|
80
|
+
- Domínio: problema de negócio que o workspace resolve
|
|
81
|
+
- Stack técnica completa (linguagem, frameworks, banco, infra)
|
|
82
|
+
- Restrições reais (prazos, equipe, limitações técnicas)
|
|
83
|
+
- Decisões arquiteturais importantes (com links para ADRs)
|
|
84
|
+
- Glossário de termos específicos do domínio
|
|
85
|
+
|
|
86
|
+
### 4. Gerar Glossary (${s.workspacePath}/.letra/glossary.md)
|
|
87
|
+
- Termos técnicos e de domínio mapeados
|
|
88
|
+
- Abreviações e siglas usadas no projeto
|
|
89
|
+
- Nomes de módulos, pacotes e suas responsabilidades
|
|
90
|
+
|
|
91
|
+
### 5. Configurar Fluxo SDLC
|
|
92
|
+
- Crie ${s.workspacePath}/.letra/workflow.json com os estágios:
|
|
93
|
+
- Backlog (todo)
|
|
94
|
+
- Spec Draft (doing)
|
|
95
|
+
- Spec Review (doing)
|
|
96
|
+
- Code (doing)
|
|
97
|
+
- Code Review (doing)
|
|
98
|
+
- Ready to PR (doing)
|
|
99
|
+
- Done (done)
|
|
100
|
+
- Para cada item existente no backlog, crie entries no workflow
|
|
101
|
+
|
|
102
|
+
### 6. Gerar Spec Inicial
|
|
103
|
+
- ${s.workspacePath}/.letra/specs/_template/spec.md — template de spec
|
|
104
|
+
- ${s.workspacePath}/.letra/specs/README.md — guia do diretório de specs
|
|
105
|
+
|
|
106
|
+
### 7. Adaptadores
|
|
107
|
+
Configure os adaptadores para: ${s.dirs.join(", ")}
|
|
108
|
+
- AGENTS.md (formato OpenCode)
|
|
109
|
+
- .cursorrules (formato Cursor)
|
|
110
|
+
- CLAUDE.md (formato Claude Code)
|
|
111
|
+
- .windsurfrules (formato Windsurf)
|
|
112
|
+
- .opencode/instructions.md (formato OpenCode)
|
|
113
|
+
- .github/copilot-instructions.md (formato GitHub Copilot)
|
|
114
|
+
|
|
115
|
+
Cada adaptador deve conter:
|
|
116
|
+
- Seção de contexto com os diretórios monitorados
|
|
117
|
+
- Comandos disponíveis (pulse, sitrep, flow move, health)
|
|
118
|
+
- Seção de item ativo (se houver)
|
|
119
|
+
- Regras de handoff entre agentes
|
|
120
|
+
|
|
121
|
+
## Formato de Saída
|
|
122
|
+
Gere todos os arquivos dentro de ${s.workspacePath}/.letra/. Retorne um resumo do que foi criado.`,cursor:s=>`You are an expert software architect configuring the Letra framework (SDD — Specification-Driven Development) for a workspace.
|
|
123
|
+
|
|
124
|
+
## Mission
|
|
125
|
+
Deeply analyze the workspace at **${s.workspacePath}** and its monitored directories (${s.dirs.join(", ")}) to generate the complete Letra harness.
|
|
126
|
+
|
|
127
|
+
## Steps
|
|
128
|
+
|
|
129
|
+
### 1. Explore the Workspace
|
|
130
|
+
- Walk all listed directories
|
|
131
|
+
- Identify the main stack (language, framework, runtime, database)
|
|
132
|
+
- Detect architecture patterns (MVC, hexagonal, microservices, monolith, etc.)
|
|
133
|
+
- Map directory structure and each module's purpose
|
|
134
|
+
- Identify code conventions (linting, formatting, tsconfig, Dockerfile, CI/CD)
|
|
135
|
+
- Check for package.json, Cargo.toml, pyproject.toml, etc.
|
|
136
|
+
- Analyze existing tests (framework, coverage, patterns)
|
|
137
|
+
|
|
138
|
+
### 2. Generate Constitution
|
|
139
|
+
Non-negotiable workspace rules in ${s.workspacePath}/.letra/constitution.md
|
|
140
|
+
|
|
141
|
+
### 3. Generate Context
|
|
142
|
+
Workspace overview in ${s.workspacePath}/.letra/context.md including intent, domain, tech stack, constraints, architectural decisions.
|
|
143
|
+
|
|
144
|
+
### 4. Generate Glossary
|
|
145
|
+
Technical and domain terms in ${s.workspacePath}/.letra/glossary.md
|
|
146
|
+
|
|
147
|
+
### 5. Configure SDLC Flow
|
|
148
|
+
Workflow with stages: Backlog, Spec Draft, Spec Review, Code, Code Review, Ready to PR, Done.
|
|
149
|
+
|
|
150
|
+
### 6. Generate Spec Template
|
|
151
|
+
- ${s.workspacePath}/.letra/specs/_template/spec.md
|
|
152
|
+
- ${s.workspacePath}/.letra/specs/README.md
|
|
153
|
+
|
|
154
|
+
### 7. Configure .cursorrules
|
|
155
|
+
Generate .cursorrules with context, available commands, active item section, and handoff rules.
|
|
156
|
+
|
|
157
|
+
Return a summary of everything created.`,"claude-code":s=>`You are configuring the Letra SDD framework for "${s.name}" at ${s.workspacePath}. Deeply analyze the workspace (${s.dirs.join(", ")}) — explore its stack, architecture, code conventions, and test patterns — then generate the complete Letra harness:
|
|
158
|
+
|
|
159
|
+
1. **${s.workspacePath}/.letra/constitution.md** — architecture rules, code conventions, security policies
|
|
160
|
+
2. **${s.workspacePath}/.letra/context.md** — workspace intent, domain, tech stack, constraints, decisions
|
|
161
|
+
3. **${s.workspacePath}/.letra/glossary.md** — domain and technical terms
|
|
162
|
+
4. **${s.workspacePath}/.letra/workflow.json** — SDLC stages
|
|
163
|
+
5. **${s.workspacePath}/.letra/specs/** — template and README
|
|
164
|
+
6. **CLAUDE.md** — Claude Code adapter with workspace context, available commands, active items, and handoff rules
|
|
165
|
+
|
|
166
|
+
For each file, reflect the actual project patterns you discover during exploration. The harness must match the real project profile.`,windsurf:s=>`Configure the Letra SDD framework for "${s.name}" at ${s.workspacePath}. Explore the codebase in ${s.dirs.join(", ")}, identify stack, architecture, patterns, and generate the full Letra harness:
|
|
167
|
+
|
|
168
|
+
- .letra/constitution.md — rules and conventions
|
|
169
|
+
- .letra/context.md — workspace overview and decisions
|
|
170
|
+
- .letra/glossary.md — terms
|
|
171
|
+
- .letra/workflow.json — SDLC pipeline
|
|
172
|
+
- .letra/specs/ — spec template
|
|
173
|
+
- .windsurfrules — Windsurf adapter with workspace context, commands, and handoff
|
|
174
|
+
|
|
175
|
+
Base every file on real project analysis, not generic templates.`,hermes:s=>`Configure Letra for "${s.name}" at ${s.workspacePath}. Analyze ${s.dirs.join(", ")} deeply — stack, architecture, code style, tests — then generate:
|
|
176
|
+
|
|
177
|
+
- .letra/constitution.md, context.md, glossary.md
|
|
178
|
+
- .letra/workflow.json with SDLC stages
|
|
179
|
+
- .letra/specs/ template
|
|
180
|
+
- .hermes/instructions.md with workspace context, commands, and handoff rules
|
|
181
|
+
|
|
182
|
+
Tailor every file to the actual project profile found during exploration.`,vscode:s=>`Configure Letra SDD for "${s.name}" at ${s.workspacePath}. Explore ${s.dirs.join(", ")}, detect tech stack, architecture, and conventions, then generate:
|
|
183
|
+
|
|
184
|
+
- .letra/constitution.md, context.md, glossary.md
|
|
185
|
+
- .letra/workflow.json
|
|
186
|
+
- .letra/specs/ template
|
|
187
|
+
- .vscode/settings.json with recommended extensions for the detected stack
|
|
188
|
+
- .vscode/copilot-instructions.md with workspace context
|
|
189
|
+
|
|
190
|
+
All files must reflect real project analysis, not generic templates.`,copilot:s=>`Analyze the workspace "${s.name}" at ${s.workspacePath}. Walk directories ${s.dirs.join(", ")}, identify stack, architecture, patterns, and configure Letra:
|
|
191
|
+
|
|
192
|
+
- .letra/constitution.md — workspace rules
|
|
193
|
+
- .letra/context.md — intent, domain, stack, constraints
|
|
194
|
+
- .letra/glossary.md — terms
|
|
195
|
+
- .letra/workflow.json — SDLC stages
|
|
196
|
+
- .letra/specs/ — spec template
|
|
197
|
+
- .github/copilot-instructions.md — Copilot adapter with full workspace context
|
|
198
|
+
|
|
199
|
+
Infer everything from actual codebase analysis.`};function C0({onComplete:s}){var ze;const[o,c]=v.useState("name"),u=["name","directories","template","review"],d={name:"Nome",directories:"Diretórios",template:"Template",review:"Revisão",done:"Concluído"},m=u.indexOf(o),[h,x]=v.useState(""),[y,g]=v.useState(""),[N,j]=v.useState(""),A=h.trim().length>0,w=y.trim().length>=10,T=N.trim().length>0,V=A&&w&&T,te=v.useRef(null),[P,ie]=v.useState([]),[pe,G]=v.useState(""),[ce,de]=v.useState([]),[ee,U]=v.useState(w0.map(X=>({name:X.label,path:X.path,expanded:!1,loading:!1,children:[]}))),fe=[...P,...ce],Ee=fe.length>=1;function xe(X){ie(we=>we.includes(X)?we.filter(_e=>_e!==X):[...we,X])}function _(){const X=pe.trim();X&&!ce.includes(X)&&!fe.includes(X)&&(de([...ce,X]),G(""))}function se(X){de(ce.filter(we=>we!==X))}function oe(X){const we=X.target.files;if(we&&we.length>0){const _e=we[0].webkitRelativePath;_e&&j(_e.split("/")[0])}}async function ye(X){if(X.expanded){X.expanded=!1,U([...ee]);return}if(X.children.length===0&&!X.loading){X.loading=!0,U([...ee]);try{const _e=await(await fetch(`/api/fs/dirs?path=${encodeURIComponent(X.path)}`)).json();X.children=(_e.dirs||[]).map(_t=>({name:_t.name,path:_t.path,expanded:!1,loading:!1,children:[]}))}catch{}X.loading=!1}X.expanded=!0,U([...ee])}const[E,$]=v.useState(["opencode"]),me=E.length>=1;function ue(X){$(we=>we.includes(X)?we.filter(_e=>_e!==X):[...we,X])}const[k,b]=v.useState(!1),[D,Y]=v.useState(""),[Q,le]=v.useState(""),[B,O]=v.useState(null);async function Z(){b(!0),Y("");const X={tools:E,name:h.trim(),description:y.trim(),workspacePath:N.trim(),directories:fe,template:"padrao"};try{const _e=await(await fetch("/api/workflow/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();if(b(!1),_e&&!_e.error){O(_e);const _t=E[0],ft=ip[_t]||ip.opencode;le(ft({dirs:fe,name:h.trim(),description:y.trim(),workspacePath:N.trim()})),c("done")}else Y((_e==null?void 0:_e.error)||"Erro desconhecido ao criar workspace")}catch{b(!1),Y("Erro de conexão com o servidor")}}function re(){const X=u.indexOf(o);X<u.length-1&&c(u[X+1])}function Oe(){const X=u.indexOf(o);X>0&&c(u[X-1])}function ve(X,we=0){return X.map(_e=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1",style:{paddingLeft:we*16},children:[l.jsx(F,{onClick:()=>ye(_e),className:"flex items-center justify-center w-5 h-5 rounded hover:bg-primary/10 transition-colors shrink-0","aria-label":_e.expanded?"Recolher":"Expandir",children:_e.loading?l.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-primary border-t-transparent animate-spin"}):l.jsx(z,{name:"chevron-right",size:12,className:yt("transition-transform",_e.expanded&&"rotate-90"),style:_e.children.length===0?{opacity:.3}:void 0})}),l.jsxs("label",{className:"flex items-center gap-2 flex-1 py-1 rounded cursor-pointer hover:bg-primary/5 px-1",children:[l.jsx(as,{checked:P.includes(_e.path),onChange:()=>xe(_e.path)}),l.jsx(z,{name:"folder",size:14,className:"text-primary shrink-0"}),l.jsx("span",{className:"text-sm truncate",children:_e.name}),l.jsx("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--color-text-secondary)"},children:_e.path})]})]}),_e.expanded&&_e.children.length>0&&ve(_e.children,we+1)]},_e.path))}const Se="transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] disabled:opacity-40 disabled:hover:scale-100";return l.jsx("div",{className:"h-full overflow-y-auto p-6",children:l.jsxs("div",{className:"max-w-2xl mx-auto flex flex-col gap-6",children:[o!=="done"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-center justify-center gap-0",children:u.map((X,we)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(F,{onClick:()=>{we<m&&c(X)},disabled:we>m,className:yt("w-8 h-8 rounded-full text-xs font-medium flex items-center justify-center transition-all",we===m&&"ring-2 ring-primary/30",we<m&&"cursor-pointer"),style:{background:we<m?"var(--color-success)":we===m?"var(--color-primary)":"var(--color-bg-surface)",color:we<m?"var(--color-success)":we===m?"var(--color-primary)":"var(--color-text-secondary)"},"aria-label":`Passo ${we+1}: ${d[X]}${we<m?" (concluído)":""}`,children:we<m?l.jsx(z,{name:"check",size:14}):we+1}),we<u.length-1&&l.jsx("div",{className:"w-8 h-0.5 mx-1",style:{background:we<m?"var(--color-success)":"var(--color-border)"}})]},X))}),l.jsx("div",{className:"flex justify-center gap-0 text-xs -mt-4",style:{color:"var(--color-text-secondary)"},children:u.map((X,we)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx("span",{className:yt("px-1",we===m&&"font-semibold text-primary"),children:d[X]}),we<u.length-1&&l.jsx("span",{className:"w-8"})]},X))})]}),o==="name"&&l.jsxs("div",{className:"flex flex-col items-center text-center gap-6 pt-8 animate-fade-in",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-[var(--radius-lg)] bg-primary/10",children:l.jsx(z,{name:"grid",size:24,className:"text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Configurar Workspace"}),l.jsx("p",{className:"text-muted-foreground text-base max-w-md",children:"Defina o nome, descrição e local do workspace."})]}),l.jsxs("div",{className:"w-full max-w-sm flex flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-col gap-1.5 text-left",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Nome do workspace ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx(ht,{placeholder:"Ex: Meu Projeto",value:h,onChange:X=>x(X.target.value)})]}),l.jsxs("div",{className:"flex flex-col gap-1.5 text-left",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Descrição ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx(ls,{className:"w-full px-3 py-2 rounded-[var(--radius-sm)] border text-sm resize-none",rows:3,placeholder:"Descreva o propósito do workspace (mín. 10 caracteres)",value:y,onChange:X=>g(X.target.value),style:{borderColor:"var(--color-border)",background:"var(--color-bg-base)",color:"var(--color-text-primary)"}}),y.length>0&&!w&&l.jsxs("span",{className:"text-xs text-red-500",children:["Faltam ",10-y.trim().length," caracteres"]})]}),l.jsxs("div",{className:"flex flex-col gap-1.5 text-left",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Caminho do workspace ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ht,{placeholder:"Ex: C:/MeusProjetos/meu-app",value:N,onChange:X=>j(X.target.value),className:"flex-1 font-mono text-xs"}),l.jsx(ht,{ref:te,type:"file",webkitdirectory:"",style:{display:"none"},onChange:oe}),l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>{var X;return(X=te.current)==null?void 0:X.click()},children:l.jsx(z,{name:"search",size:14})})]}),l.jsxs("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:["Onde o ",l.jsx("code",{children:".letra/"})," será criado"]})]}),l.jsx(F,{className:Se,disabled:!V,onClick:re,children:"Próximo"})]})]}),o==="directories"&&l.jsxs("div",{className:"flex flex-col gap-4 pt-4 animate-fade-in",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold",children:"Diretórios do Projeto"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:"Navegue e selecione os diretórios que o Letra deve monitorar."})]}),l.jsx("div",{className:"rounded-[var(--radius-md)] border p-2 max-h-64 overflow-y-auto",style:{borderColor:"var(--color-border)"},children:ve(ee)}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Adicionar outro diretório"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ht,{placeholder:"Ex: D:/Projects",value:pe,onChange:X=>G(X.target.value),onKeyDown:X=>{X.key==="Enter"&&_()},className:"flex-1 font-mono text-xs"}),l.jsxs(F,{variant:"secondary",size:"sm",onClick:_,disabled:!pe.trim(),children:[l.jsx(z,{name:"plus",size:14,className:"mr-1"})," Adicionar"]})]}),ce.length>0&&l.jsx("div",{className:"flex flex-col gap-1 mt-1",children:ce.map(X=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-[var(--radius-sm)] border text-sm font-mono",style:{borderColor:"var(--color-border)"},children:[l.jsx(z,{name:"folder",size:14,className:"text-primary shrink-0"}),l.jsx("span",{className:"flex-1",children:X}),l.jsx(F,{onClick:()=>se(X),className:"w-6 h-6 rounded hover:bg-red-500/10 hover:text-red-500",style:{color:"var(--color-text-secondary)"},"aria-label":`Remover ${X}`,children:l.jsx(z,{name:"x",size:12})})]},X))})]}),!Ee&&l.jsx("p",{className:"text-xs text-red-500",children:"Selecione ou adicione pelo menos 1 diretório"}),l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsx(F,{variant:"ghost",onClick:Oe,children:"Voltar"}),l.jsx(F,{disabled:!Ee,onClick:re,className:Se,children:"Próximo"})]})]}),o==="template"&&l.jsxs("div",{className:"flex flex-col gap-6 pt-4 animate-fade-in",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold",children:"Template e Ferramentas"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:"Escolha o template de fluxo e as ferramentas agênticas."})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Template de fluxo"}),l.jsx("div",{className:"rounded-[var(--radius-md)] border border-primary bg-primary/5 ring-2 ring-primary/20 p-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(z,{name:"flow",size:16,className:"text-primary"})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-semibold",children:"SDLC — Desenvolvimento de Software"}),l.jsx(Ae,{variant:"info",children:"5 estágios"})]}),l.jsx("p",{className:"text-sm mt-0.5",style:{color:"var(--color-text-secondary)"},children:"Fluxo completo: Backlog, Design, Code, Review, Done"}),l.jsx("div",{className:"flex gap-1.5 mt-2 flex-wrap",children:["Backlog","Design","Code","Review","Done"].map(X=>l.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full border border-amber-500/30 text-amber-600 dark:text-amber-400 bg-amber-500/10",children:X},X))})]})]})})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Ferramentas agênticas"}),E.length>0&&l.jsxs(Ae,{variant:"info",children:[E.length," selecionada",E.length>1?"s":""]})]}),l.jsx("div",{className:"grid grid-cols-2 gap-3",children:iu.map((X,we)=>l.jsxs("label",{className:yt("flex items-center gap-3 p-4 rounded-[var(--radius-md)] border transition-all duration-200 cursor-pointer hover:scale-[1.02] hover:shadow-sm",E.includes(X.id)?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50"),style:{animation:`fade-in 0.2s ease-out ${we*40}ms both`},children:[l.jsx(as,{checked:E.includes(X.id),onChange:()=>ue(X.id)}),l.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(z,{name:"code",size:16,className:"text-primary"})}),l.jsx("span",{className:"font-medium",children:X.label})]},X.id))}),!me&&l.jsx("p",{className:"text-xs text-red-500 mt-2",children:"Selecione pelo menos 1 ferramenta"})]}),l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsx(F,{variant:"ghost",onClick:Oe,children:"Voltar"}),l.jsx(F,{disabled:!me,onClick:re,className:Se,children:"Revisar"})]})]}),o==="review"&&l.jsxs("div",{className:"flex flex-col gap-6 pt-4 animate-fade-in",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold",children:"Revisar Configuração"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:"Confira os dados antes de finalizar."})]}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"p-4 rounded-[var(--radius-md)]",style:{background:"var(--color-bg-surface)"},children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Workspace"}),l.jsxs("div",{className:"text-sm space-y-1",children:[l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:"Nome:"})," ",l.jsx("span",{className:"font-medium",children:h})]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:"Descrição:"})," ",y]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:"Caminho:"})," ",l.jsx("span",{className:"font-mono text-xs",children:N})]})]})]}),l.jsxs("div",{className:"p-4 rounded-[var(--radius-md)]",style:{background:"var(--color-bg-surface)"},children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Diretórios monitorados"}),fe.map(X=>l.jsxs("div",{className:"flex items-center gap-2 text-sm font-mono",children:[l.jsx(z,{name:"folder",size:14,className:"text-primary shrink-0"}),l.jsx("span",{children:X})]},X))]}),l.jsxs("div",{className:"p-4 rounded-[var(--radius-md)]",style:{background:"var(--color-bg-surface)"},children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Template e Ferramentas"}),l.jsx("div",{className:"text-sm",children:"SDLC — Desenvolvimento de Software"}),l.jsx("div",{className:"flex gap-2 flex-wrap mt-2",children:E.map(X=>{const we=iu.find(_e=>_e.id===X);return we?l.jsx(Ae,{variant:"info",children:we.label},X):null})})]})]}),D&&l.jsxs("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm text-red-500",style:{background:"var(--surface-1)",border:"1px solid var(--color-border)"},children:[l.jsx(z,{name:"alert-triangle",size:14,className:"inline mr-1"}),D]}),l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsx(F,{variant:"ghost",onClick:Oe,children:"Voltar"}),l.jsx(F,{disabled:k,onClick:Z,className:Se,children:k?l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-white border-t-transparent animate-spin"}),"Criando..."]}):"Finalizar"})]})]}),o==="done"&&l.jsxs("div",{className:"flex flex-col gap-6 pt-4 animate-fade-in",children:[l.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-[var(--radius-lg)] bg-success/20",children:l.jsx(z,{name:"check-circle",size:24,className:"text-success"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold",children:"Workspace criado!"}),l.jsxs("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:["O workspace ",l.jsx("strong",{children:h})," foi registrado."]}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Agora cole o prompt abaixo na sua ferramenta agêntica para gerar o harness Letra completo."})]}),B?l.jsx(F,{onClick:()=>s(B),className:"mt-2",children:"Abrir workspace"}):null]}),Q&&l.jsxs("div",{className:"rounded-[var(--radius-md)] border",style:{borderColor:"var(--color-border)",background:"var(--surface-1)"},children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 p-4 border-b",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(z,{name:"code",size:16,className:"text-primary"}),l.jsxs("h3",{className:"text-sm font-semibold",children:["Prompt para"," ",((ze=iu.find(X=>X.id===E[0]))==null?void 0:ze.label)||E[0]]})]}),l.jsxs(F,{variant:"secondary",size:"sm",onClick:()=>navigator.clipboard.writeText(Q),children:[l.jsx(z,{name:"copy",size:14,className:"mr-1"}),"Copiar"]})]}),l.jsxs("div",{className:"p-4",children:[l.jsx("p",{className:"text-xs mb-3",style:{color:"var(--color-text-secondary)"},children:"Este prompt instrui o agente a analisar profundamente o projeto e configurar o harness Letra."}),l.jsx("pre",{className:"text-xs p-4 rounded-[var(--radius-sm)] whitespace-pre-wrap font-code leading-relaxed",style:{background:"var(--color-bg-surface)",color:"var(--color-text-primary)",border:"1px solid var(--color-border)",maxHeight:"50vh",overflowY:"auto"},children:Q})]})]})]})]})})}function ua(s,o){var c;return(c=o==null?void 0:o.stages)!=null&&c.length?[...o.stages].sort((u,d)=>u.order-d.order):s.stages.map(u=>({id:u.id,name:u.name,order:u.order,zone:u.zone,description:void 0,roleIds:[],roles:[],agents:[],gate:null,provenance:"workflow-instance"})).sort((u,d)=>u.order-d.order)}function ur(s,o){return new Set(ua(s,o).filter(c=>{var u;return((u=c.gate)==null?void 0:u.type)==="human"&&c.gate.blocking}).map(c=>c.id))}function rx(s,o){return new Set(ua(s,o).filter((c,u,d)=>c.zone==="done"||!c.zone&&u===d.length-1).map(c=>c.id))}function z0(s,o,c){const u=ua(o,c),d=u.findIndex(m=>m.id===s);return d<0||d>=u.length-1?null:u[d+1].id}function op(s,o,c){var d;const u=ua(o,c).find(m=>m.id===s);return u?((d=u.gate)==null?void 0:d.type)==="human"?"Human":u.roles[0]?u.roles[0].label:u.roleIds[0]?u.roleIds[0]:u.name:"Agent"}function Uu(s){var o;return((o=s.gate)==null?void 0:o.type)==="human"?`Aguardando ${s.gate.name.toLowerCase()}`:s.zone==="done"?"Concluído":s.description?s.description:`Processando em ${s.name}`}function A0(s){var o;return s.zone==="done"?"check":((o=s.gate)==null?void 0:o.type)==="human"?"user":s.gate?"shield":s.roles.length>0||s.roleIds.length>0?"cpu":"circle"}function Bu(s){var d,m,h;const o=((d=s.gate)==null?void 0:d.type)==="human"&&s.gate.blocking,c=!!((m=s.gate)!=null&&m.blocking);return{actorLabel:o?"Human":((h=s.roles[0])==null?void 0:h.label)??s.roleIds[0]??s.name,actionLabel:Uu(s),icon:A0(s),color:s.zone==="done"?"var(--success)":o?"var(--gate-available)":c?"var(--gate-blocked)":"var(--primary)",isHumanGate:o,isBlockingGate:c}}function ka(s,o,c){var d,m;const u=ua(o,c).find(h=>h.id===s.stage);return u?u.zone==="done"?"done":((d=u.gate)==null?void 0:d.type)==="human"&&u.gate.blocking?"waiting":(m=u.gate)!=null&&m.blocking?"blocked":s.claimedBy?"running":"idle":s.claimedBy?"running":"idle"}function E0(s,o){return ua(s,o).map(c=>{const u=s.items.filter(h=>h.stage===c.id),d=u.map(h=>ka(h,s,o)),m=d.includes("waiting")?"waiting":d.includes("blocked")?"blocked":d.includes("running")?"running":d.includes("done")?"done":"idle";return{...c,itemCount:u.length,status:m,presentation:Bu(c)}})}function k0(s){return(s==null?void 0:s.warnings.map(o=>({...o})))??[]}function T0(s){try{return new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return s}}function M0(s){return s==="alta"?"error":s==="baixa"?"info":"amber"}function D0(s){return s==="alta"?"danger":s==="baixa"?"info":"warning"}function O0(s){return s==="ciente"?"em acompanhamento":s==="descartado"?"descartado":s==="resolvido"?"resolvido":"novo"}function _0(s){return s==="ciente"?"warning":s==="resolvido"?"success":s==="descartado"?"default":"info"}function R0(s){const o=s.toLowerCase();return o.includes("fail")||o.includes("erro")||o.includes("error")?{icon:"circle-x",variant:"error",tagVariant:"danger",tone:"danger",label:"falha"}:o.includes("validate")||o.includes("build")||o.includes("test")?{icon:"terminal",variant:"amber",tagVariant:"warning",tone:"warning",label:"validacao"}:o.includes("done")||o.includes("complete")||o.includes("pass")?{icon:"circle-check",variant:"success",tagVariant:"success",tone:"success",label:"concluido"}:o.includes("agent")||o.includes("automation")?{icon:"bot",variant:"agent",tagVariant:"agent",tone:"info",label:"agente"}:{icon:"activity",variant:"info",tagVariant:"info",tone:"info",label:"evento"}}function L0({decisions:s,signals:o,healthSummary:c,activity:u,signalsAvailable:d=!0,activityAvailable:m=!0,primaryItemId:h,primaryWork:x,onReviewDecision:y,onOpenItem:g,onOpenActivity:N,onOpenWork:j,onOpenSignal:A,onScanHealth:w,healthBusy:T=!1}){const V=x??(h?{id:h,title:h}:null),te=s[0]?{label:"Revisar decisao prioritaria",reason:"Um gate humano impede o fluxo de avancar sem sua decisao.",description:`Responder a solicitacao sobre ${s[0].itemId}.`,consequence:"A revisao abre a evidencia do item; nenhuma mudanca ocorre antes da sua decisao.",icon:"shield",tone:"warning",run:()=>y(s[0].itemId)}:o.length>0?{label:"Examinar evidencias",reason:"Ha sinal ativo de saude pedindo investigacao antes de qualquer correcao.",description:"Compreender o impacto e a evidencia do sinal antes de agir.",consequence:"Abre a central de saude; nenhuma correcao e aplicada automaticamente.",icon:"alert-triangle",tone:"info",run:()=>A(o[0])}:V?{label:"Abrir trabalho em foco",reason:"Nao ha decisao ou sinal ativo; acompanhe o item central da sessao.",description:`Continuar a supervisao de ${V.id}.`,consequence:"Abre o item sem alterar seu estagio ou estado canonico.",icon:"box",tone:"default",run:()=>g(V.id)}:{label:"Ver trabalho disponivel",reason:"Nao ha decisao ou sinal ativo; escolha um item para supervisionar.",description:"Escolher com seguranca o proximo trabalho a supervisionar.",consequence:"Abre Trabalho sem iniciar ou mover qualquer item.",icon:"grid",tone:"default",run:j},ie=s.length+o.length>0?l.jsxs("div",{className:"ds-cluster justify-end",children:[s.length>0?l.jsxs(Ae,{icon:"shield",variant:"amber",tone:"soft",children:[s.length," decisoes"]}):null,o.length>0?l.jsxs(Ae,{icon:"alert-triangle",variant:"amber",tone:"soft",children:[o.length," ",o.length===1?"sinal":"sinais"]}):null]}):l.jsx(Ae,{icon:"circle-check",variant:"success",tone:"soft",children:"nada aguardando voce"}),pe=V?[{label:"Item",value:l.jsx(Ae,{icon:"box",variant:"info",tone:"soft",children:V.id}),icon:l.jsx(z,{name:"box",size:14})},...V.stage?[{label:"Estagio",value:l.jsx(Je,{variant:"info",children:V.stage}),icon:l.jsx(z,{name:"circle",size:14})}]:[],...V.ageLabel?[{label:"Idade",value:V.ageLabel,icon:l.jsx(z,{name:"clock",size:14})}]:[],...V.actor?[{label:"Responsavel",value:V.actor,icon:l.jsx(z,{name:"user",size:14})}]:[]]:[];return l.jsxs("section",{"aria-labelledby":"supervision-inbox-title",className:"ds-section",children:[l.jsx(sx,{className:"rounded-[var(--radius-md)]",titleId:"supervision-inbox-title",title:"Supervisao",description:"O que precisa da sua atencao agora, sem misturar acompanhamento com operacao.",left:l.jsx(z,{name:"shield",size:20}),right:ie}),l.jsx(ar,{tone:te.tone,icon:l.jsx(z,{name:te.icon,size:20}),title:"Prioridade agora",description:te.description,action:l.jsx(F,{onClick:te.run,children:te.label}),children:l.jsxs("div",{className:"grid gap-[var(--space-1)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Je,{variant:"info",children:te.label}),l.jsx(Je,{children:"nao altera estado"})]}),l.jsx("p",{className:"text-caption font-medium text-[var(--color-text-primary)]",children:te.reason}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:te.consequence})]})}),l.jsxs("div",{className:"ds-panel-grid",children:[l.jsxs("div",{className:"ds-panel-grid content-start xl:grid-cols-2",children:[l.jsxs(at,{children:[l.jsxs(Sa,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(z,{name:"shield",size:16}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"font-semibold",children:"Decisoes pendentes"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Gates humanos que precisam da sua decisao antes do fluxo avancar."})]})]}),l.jsx(Ae,{icon:s.length>0?"alert-triangle":"circle",variant:s.length>0?"amber":"info",tone:"soft",children:s.length})]}),l.jsx(lt,{children:s.length===0?l.jsx(on,{className:"items-start text-left",icon:l.jsx(z,{name:"circle-check",size:20}),title:"Nenhuma decisao aguarda voce.",description:"Quando um gate humano aparecer, ele entra nesta fila com origem e consequencia."}):l.jsx(ol,{children:s.map(G=>l.jsx(cl,{leading:l.jsx(z,{name:"shield",size:18}),title:G.title,description:"Aguardando decisao humana antes do fluxo avancar.",meta:l.jsxs(l.Fragment,{children:[l.jsx(Ae,{icon:"box",variant:"info",tone:"soft",children:G.itemId}),l.jsx(Je,{variant:"warning",children:"gate humano"})]}),action:l.jsx(F,{size:"sm",onClick:()=>y(G.itemId),"aria-label":`Revisar ${G.itemId}`,children:"Revisar"}),tone:"warning",children:l.jsx(Na,{className:"mt-[var(--space-2)]",items:[{label:"Estagio",value:l.jsx(Je,{variant:"info",children:G.stage}),icon:l.jsx(z,{name:"circle",size:14})},{label:"Responsavel",value:G.actor,icon:l.jsx(z,{name:"user",size:14})},{label:"Desde",value:G.since,icon:l.jsx(z,{name:"clock",size:14})}]})},G.itemId))})})]}),l.jsxs(at,{children:[l.jsxs(Sa,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(z,{name:"alert-triangle",size:16}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"font-semibold",children:"Saude do workspace"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Sinais priorizados por impacto, evidencia e proxima acao segura."})]})]}),l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Ae,{icon:o.length>0?"alert-triangle":"circle",variant:o.length>0?"amber":"info",tone:"soft",children:o.length}),w?l.jsxs(F,{variant:"secondary",size:"sm",onClick:w,disabled:T,children:[l.jsx(z,{name:T?"loader-circle":"activity",size:14}),T?"Verificando":"Verificar agora"]}):null]})]}),l.jsxs(lt,{children:[c&&o.length>0?l.jsx(Na,{className:"mb-[var(--space-4)]",items:[{label:"Novos",value:c.novo,icon:l.jsx(z,{name:"alert-triangle",size:14})},{label:"Em acompanhamento",value:c.ciente,icon:l.jsx(z,{name:"clock",size:14})},{label:"Resolvidos",value:c.resolvido,icon:l.jsx(z,{name:"circle-check",size:14})},{label:"Descartados",value:c.descartado,icon:l.jsx(z,{name:"circle-x",size:14})}]}):null,d?o.length===0?l.jsx(on,{className:"items-start text-left",icon:l.jsx(z,{name:"circle-check",size:20}),title:"Nenhum sinal ativo de saude.",description:"Historico resolvido ou descartado fica em Atividade; esta area mostra apenas o que pede investigacao agora."}):l.jsx(ol,{children:o.map(G=>l.jsx(cl,{leading:l.jsx(z,{name:"alert-triangle",size:18}),title:G.title,description:G.impact??"Pede investigacao antes de qualquer correcao.",meta:l.jsxs(l.Fragment,{children:[l.jsx(Ae,{icon:"alert-triangle",variant:M0(G.severity),tone:"soft",children:G.impact??"pede investigacao"}),l.jsx(Je,{variant:_0(G.status),children:O0(G.status)})]}),action:l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>A(G),children:"Detalhes"}),tone:D0(G.severity),children:l.jsx(Na,{className:"mt-[var(--space-2)]",items:[{label:"Origem",value:G.source,icon:l.jsx(z,{name:"file-text",size:14})},{label:"Urgencia",value:l.jsx(Je,{variant:G.severity==="alta"?"danger":G.severity==="baixa"?"info":"warning",children:G.severity}),icon:l.jsx(z,{name:"alert-triangle",size:14})},{label:"Acao segura",value:G.nextAction??"investigar",icon:l.jsx(z,{name:"activity",size:14})}]})},G.id))}):l.jsx(on,{className:"items-start text-left",icon:l.jsx(z,{name:"alert-circle",size:20}),title:"Saude indisponivel agora.",description:"A supervisao continua disponivel, mas sem a fotografia de saude do workspace."})]})]})]}),l.jsx("div",{className:"ds-panel-grid content-start",children:l.jsxs(at,{children:[l.jsxs(Sa,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(z,{name:"box",size:16}),l.jsx("h2",{className:"font-semibold",children:"Trabalho em foco"})]}),V?l.jsx(Ae,{icon:"box",variant:"info",tone:"soft",children:V.id}):null]}),l.jsx(lt,{children:V?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-[var(--space-1)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Je,{variant:"agent",children:"supervisionavel"}),V.actor?l.jsx(Je,{children:V.actor}):null]}),l.jsx("h3",{className:"text-body-sm font-semibold text-[var(--color-text-primary)]",children:V.title}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:s.length>0?"Em foco porque esta relacionado a uma decisao humana.":o.length>0?"Em foco para cruzar sinais ativos com o trabalho atual.":"Em foco por ser o item central da sessao atual."})]}),l.jsx(Na,{items:pe}),l.jsxs("div",{className:"flex flex-wrap items-center gap-[var(--layout-toolbar-gap)]",children:[l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>g(V.id),children:"Abrir item"}),l.jsx(Je,{variant:"info",children:"somente leitura"})]})]}):l.jsx(on,{className:"items-start text-left",icon:l.jsx(z,{name:"grid",size:20}),title:"Nenhum trabalho em foco.",description:"Abra Trabalho para escolher o proximo item a supervisionar.",action:l.jsx(F,{variant:"secondary",size:"sm",onClick:j,children:"Ver trabalho disponivel"})})})]})})]}),l.jsxs(at,{children:[l.jsxs(Sa,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(z,{name:"activity",size:16}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"font-semibold",children:"Ultimas evidencias"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Eventos recentes que comprovam o que aconteceu no workspace."})]})]}),l.jsx(F,{variant:"ghost",size:"sm",onClick:N,children:"Ver toda atividade"})]}),l.jsx(lt,{children:m?u.length===0?l.jsx(on,{className:"items-start text-left",icon:l.jsx(z,{name:"activity",size:20}),title:"Nenhuma atividade registrada.",description:"Eventos reais do workspace aparecem aqui como evidencia."}):l.jsx(ol,{tone:"surface",children:u.map(G=>{const ce=R0(G.action);return l.jsx(cl,{leading:l.jsx(z,{name:ce.icon,size:18}),title:G.description,description:T0(G.timestamp),meta:l.jsxs(l.Fragment,{children:[l.jsx(Ae,{icon:ce.icon,variant:ce.variant,tone:"soft",children:ce.label}),l.jsx(Je,{variant:ce.tagVariant,children:G.action}),G.itemId?l.jsx(Je,{children:G.itemId}):null]}),action:G.itemId?l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>g(G.itemId),children:"Abrir item"}):null,tone:ce.tone},G.id)})}):l.jsx(on,{className:"items-start text-left",icon:l.jsx(z,{name:"alert-circle",size:20}),title:"Atividade indisponivel no momento.",description:"A timeline completa permanece em Atividade quando o log voltar."})})]})]})}function H0(){return l.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-[var(--layout-page-gap)] p-[var(--layout-page-padding)]",children:[l.jsx(ta,{}),l.jsxs("div",{className:"ds-panel-grid xl:grid-cols-[minmax(0,1.15fr)_minmax(20rem,0.85fr)]",children:[l.jsx(ta,{}),l.jsx(ta,{})]}),l.jsx(ta,{})]})}function U0(s){return Math.floor((Date.now()-new Date(s).getTime())/(1e3*60*60*24))}function ix(s){const o=U0(s);return o===0?"Hoje":o===1?"1 dia":`${o} dias`}function B0(s){const o=Date.now()-new Date(s).getTime(),c=Math.floor(o/(1e3*60*60));return c<1?`há ${Math.max(1,Math.floor(o/6e4))}min`:c<24?`há ${c}h`:`há ${Math.floor(c/24)}d`}function q0(s){if(!s)return"media";const o=s.toLowerCase();return o.includes("crit")||o.includes("alta")||o.includes("high")?"alta":o.includes("low")||o.includes("baixa")?"baixa":"media"}function G0(s){return s==="alta"?"bloqueia conclusao":s==="media"?"pede investigacao":"pode aguardar"}function V0(s){return s==="ciente"?"acompanhar":s==="resolvido"?"ver evidencia":s==="descartado"?"ver justificativa":"investigar"}function cp(s){if(!s)return"nao registrado";try{return new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function Y0(s){var c,u,d,m;const o=s.entries??[];return{novo:((c=s.summary)==null?void 0:c.novo)??o.filter(h=>h.status==="novo").length,ciente:((u=s.summary)==null?void 0:u.ciente)??o.filter(h=>h.status==="ciente").length,resolvido:((d=s.summary)==null?void 0:d.resolvido)??o.filter(h=>h.status==="resolvido").length,descartado:((m=s.summary)==null?void 0:m.descartado)??o.filter(h=>h.status==="descartado").length}}function Q0(s,o){const c=[s.id,s.type,s.source,s.where,s.title,s.what].filter(Boolean).map(u=>String(u).toLowerCase());return o.find(u=>{const d=u.diagnosticId.toLowerCase(),m=u.diagnosticTitle.toLowerCase();return c.some(h=>h?d===h||d.includes(h)||m.includes(h):!1)})}function up(s){return(s.snapshots??[]).filter(o=>Array.isArray(o.files))}function X0(s,o,c=16){const u=s.split(/\r?\n/),d=o.split(/\r?\n/);let m=0;for(;m<u.length&&m<d.length&&u[m]===d[m];)m+=1;let h=u.length-1,x=d.length-1;for(;h>=m&&x>=m&&u[h]===d[x];)h-=1,x-=1;const y=u.slice(m,h+1).slice(0,Math.floor(c/2)),g=d.slice(m,x+1).slice(0,c-y.length),N=[...y.map(j=>`- ${j||"(linha vazia)"}`),...g.map(j=>`+ ${j||"(linha vazia)"}`)];return N.length>0?N:["Sem diferenca textual entre before/after."]}function Z0(s,o=[]){return(s.active??[]).slice(0,4).map((c,u)=>{const d=q0(c.severity);return{id:c.id??`health-${u}`,title:c.title??c.what??"Alerta ativo",source:c.source??c.where??"health",severity:d,status:c.status??"novo",detectedAt:c.detectedAt,impact:G0(d),nextAction:V0(c.status),technicalType:c.type,relatedSnapshot:Q0(c,o)}})}function K0({spec:s,primaryItem:o,primaryStageName:c}){return l.jsx(ar,{density:"compact",tone:"info",icon:l.jsx(z,{name:"file-text",size:20}),title:"Governança do workspace",description:"Contexto canônico usado para interpretar decisões, evidências e trabalho em foco nesta sessão.",meta:l.jsxs(l.Fragment,{children:[l.jsx(Ae,{icon:"file-text",variant:"info",tone:"soft",children:s}),l.jsx(Je,{variant:"info",children:"contrato ativo"})]}),children:l.jsx(Na,{items:[{label:"Spec",value:s,icon:l.jsx(z,{name:"file-text",size:14})},...o?[{label:"Item vinculado",value:l.jsx(Ae,{icon:"box",variant:"info",tone:"soft",children:o.id}),icon:l.jsx(z,{name:"box",size:14})}]:[],...c?[{label:"Estágio",value:l.jsx(Je,{variant:"info",children:c}),icon:l.jsx(z,{name:"circle",size:14})}]:[]]})})}function $0({item:s,stageName:o,open:c,onOpenChange:u}){if(!s)return null;const d=[{label:"Estágio",value:l.jsx(Je,{variant:"info",children:o??s.stage}),icon:l.jsx(z,{name:"circle",size:14})},{label:"Idade",value:ix(s.createdAt),icon:l.jsx(z,{name:"clock",size:14})},...s.spec?[{label:"Spec",value:s.spec,icon:l.jsx(z,{name:"file-text",size:14})}]:[],...s.claimedBy?[{label:"Responsável",value:s.claimedBy,icon:l.jsx(z,{name:"user",size:14})}]:[]];return l.jsx(sr,{open:c,onOpenChange:u,children:l.jsxs(rr,{children:[l.jsx(Hi,{children:l.jsx(Ui,{children:s.id})}),l.jsx("div",{className:"grid gap-[var(--layout-panel-gap)] p-[var(--card-padding)]",children:l.jsx(at,{children:l.jsx(lt,{children:l.jsxs("div",{className:"ds-stack",children:[l.jsxs("div",{className:"grid gap-[var(--space-1)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Ae,{icon:"box",variant:"info",tone:"soft",children:s.id}),s.claimedBy?l.jsx(Je,{children:s.claimedBy}):null]}),l.jsx("p",{className:"text-body-sm font-medium text-[var(--color-text-primary)]",children:s.description||"Sem descrição"})]}),l.jsx(Na,{items:d}),s.tasks&&s.tasks.length>0?l.jsxs("div",{className:"ds-stack",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(z,{name:"list-three",size:16}),l.jsx("h3",{className:"font-semibold",children:"Tasks"}),l.jsx(Ae,{variant:"info",tone:"soft",children:s.tasks.length})]}),l.jsx(ol,{children:s.tasks.map(m=>l.jsx(cl,{leading:l.jsx(z,{name:m.done?"circle-check":"circle",size:18}),title:m.description,meta:l.jsx(Je,{variant:m.done?"success":"info",children:m.done?"feito":"pendente"})},m.id))})]}):null]})})})}),l.jsx(Lu,{children:l.jsx(F,{variant:"secondary",onClick:()=>u(!1),children:"Fechar"})})]})})}function J0({signal:s,open:o,onOpenChange:c,onAcknowledge:u,onDismiss:d,onScan:m,actionBusy:h,actionMessage:x}){var N;if(!s)return null;const y=(N=s.relatedSnapshot)==null?void 0:N.files[0],g=y?X0(y.before,y.after):[];return l.jsx(sr,{open:o,onOpenChange:c,children:l.jsxs(rr,{side:"right",className:"w-full max-w-[100vw] sm:max-w-3xl lg:max-w-4xl","aria-labelledby":"signal-sheet-title","aria-describedby":"signal-sheet-description",children:[l.jsxs(Hi,{className:"items-start gap-4",children:[l.jsxs("div",{className:"grid min-w-0 gap-[var(--space-2)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Ae,{icon:"alert-triangle",variant:s.severity==="alta"?"error":s.severity==="baixa"?"info":"amber",tone:"soft",children:s.impact??"pede investigacao"}),l.jsx(Je,{variant:s.status==="ciente"?"warning":s.status==="resolvido"?"success":s.status==="descartado"?"default":"info",children:s.status==="ciente"?"em acompanhamento":s.status??"novo"})]}),l.jsx(Ui,{id:"signal-sheet-title",className:"break-words leading-tight",children:s.title}),l.jsx(Ru,{id:"signal-sheet-description",children:"Evidencia do workspace para entender o impacto antes de agir."})]}),l.jsx(ax,{"aria-label":"Fechar detalhes do sinal",onClick:()=>c(!1),children:l.jsx(z,{name:"x",size:16})})]}),l.jsxs("div",{className:"grid gap-[var(--layout-panel-gap)] overflow-y-auto p-[var(--card-padding)]",children:[l.jsxs(at,{children:[l.jsx(Sa,{children:l.jsxs("div",{className:"ds-cluster",children:[l.jsx(z,{name:"shield",size:16}),l.jsx("h3",{className:"font-semibold",children:"Leitura de supervisao"})]})}),l.jsx(lt,{children:l.jsx(Na,{items:[{label:"Impacto",value:s.impact??"pede investigacao",icon:l.jsx(z,{name:"alert-triangle",size:14})},{label:"Acao segura",value:s.nextAction??"investigar",icon:l.jsx(z,{name:"activity",size:14})},{label:"Detectado em",value:cp(s.detectedAt),icon:l.jsx(z,{name:"clock",size:14})}]})})]}),l.jsxs(at,{children:[l.jsx(Sa,{children:l.jsxs("div",{className:"ds-cluster",children:[l.jsx(z,{name:"file-text",size:16}),l.jsx("h3",{className:"font-semibold",children:"Evidencia"})]})}),l.jsx(lt,{children:l.jsx(ol,{tone:"surface",children:l.jsx(cl,{leading:l.jsx(z,{name:"alert-circle",size:18}),title:s.title,description:"Sinal ativo registrado no prontuario de saude do workspace.",meta:l.jsxs(l.Fragment,{children:[l.jsx(Je,{variant:"info",children:s.source}),l.jsx(Je,{children:s.id})]}),tone:s.severity==="alta"?"danger":s.severity==="baixa"?"info":"warning"})})})]}),l.jsxs(at,{children:[l.jsx(Sa,{children:l.jsxs("div",{className:"ds-cluster",children:[l.jsx(z,{name:"git-branch",size:16}),l.jsx("h3",{className:"font-semibold",children:"Comparacao de drift"})]})}),l.jsx(lt,{children:s.relatedSnapshot?l.jsxs("div",{className:"grid gap-[var(--space-4)]",children:[l.jsx(Na,{items:[{label:"Snapshot",value:s.relatedSnapshot.id,icon:l.jsx(z,{name:"info",size:14})},{label:"Registrado em",value:cp(s.relatedSnapshot.timestamp),icon:l.jsx(z,{name:"clock",size:14})},{label:"Arquivos",value:s.relatedSnapshot.files.length,icon:l.jsx(z,{name:"file-text",size:14})}]}),l.jsx(ol,{tone:"surface",children:s.relatedSnapshot.files.map(j=>l.jsx(cl,{leading:l.jsx(z,{name:"file-text",size:18}),title:j.path,description:"Arquivo capturado no snapshot do diagnostico.",meta:l.jsx(Je,{variant:"info",children:"before/after"})},j.path))}),y?l.jsx("pre",{className:"max-h-72 max-w-full overflow-auto rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-[var(--space-3)] text-xs leading-relaxed text-[var(--color-text-primary)]",children:g.join(`
|
|
200
|
+
`)}):null]}):l.jsx(ol,{tone:"surface",children:l.jsx(cl,{leading:l.jsx(z,{name:"info",size:18}),title:"Nenhum snapshot relacionado encontrado.",description:"Este sinal nao possui comparacao before/after disponivel; a evidencia atual vem do health-record.",meta:l.jsx(Je,{children:"fallback honesto"}),tone:"info"})})})]}),l.jsx(ir,{children:l.jsxs(at,{children:[l.jsxs(Sa,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(z,{name:"code",size:16}),l.jsx("h3",{className:"font-semibold",children:"Origem tecnica"})]}),l.jsx(or,{className:"rounded-[var(--radius-md)] px-[var(--space-3)] py-[var(--space-2)] text-body-sm font-medium text-[var(--color-text-secondary)] hover:bg-[var(--surface-hover)]",children:"Mostrar dados"})]}),l.jsx(cr,{children:l.jsx(lt,{children:l.jsx(Na,{items:[{label:"ID",value:s.id,icon:l.jsx(z,{name:"info",size:14})},{label:"Origem",value:s.source,icon:l.jsx(z,{name:"file-text",size:14})},{label:"Tipo",value:s.technicalType??"nao informado",icon:l.jsx(z,{name:"code",size:14})},{label:"Urgencia",value:s.severity,icon:l.jsx(z,{name:"alert-triangle",size:14})}]})})})]})})]}),l.jsxs(Lu,{className:"grid gap-[var(--space-2)] sm:flex sm:flex-wrap sm:justify-between",children:[x?l.jsx("p",{className:"min-w-0 break-words text-caption text-[var(--color-text-secondary)] sm:mr-auto",children:x}):null,l.jsxs(F,{className:"w-full sm:w-auto",variant:"secondary",onClick:m,disabled:h,children:[l.jsx(z,{name:h?"loader-circle":"activity",size:14}),"Verificar agora"]}),l.jsxs(F,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>u(s),disabled:h||s.status==="ciente",children:[l.jsx(z,{name:"clock",size:14}),"Acompanhar"]}),l.jsxs(F,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>d(s),disabled:h,children:[l.jsx(z,{name:"circle-x",size:14}),"Descartar"]})]})]})})}function dp({workflow:s,activeFlow:o,onTabChange:c}){var Z,re,Oe;const[u,d]=v.useState(null),[m,h]=v.useState([]),[x,y]=v.useState(null),[g,N]=v.useState(!0),[j,A]=v.useState([]),[w,T]=v.useState([]),[V,te]=v.useState(!0),[P,ie]=v.useState(!0),[pe,G]=v.useState(!1),[ce,de]=v.useState(null),[ee,U]=v.useState(null),[fe,Ee]=v.useState(!1),[xe,_]=v.useState(""),se=v.useCallback((ve,Se=[])=>{const ze=Z0(ve,Se);return y(Y0(ve)),h(ze),N(!0),U(X=>X&&(ze.find(we=>we.id===X.id)??null)),ze},[]),oe=v.useCallback(async()=>{const[ve,Se]=await Promise.all([fetch("/api/health"),fetch("/api/diagnostics/snapshots?limit=20")]);if(!ve.ok)throw new Error("health unavailable");const ze=await ve.json(),X=Se.ok?up(await Se.json()):j;return A(X),se(ze,X)},[se]);v.useEffect(()=>{let ve=!1;async function Se(){ie(!0),G(!1);const[ze,X,we,_e]=await Promise.allSettled([fetch("/api/focus").then(ft=>ft.json()),fetch("/api/health").then(ft=>ft.json()),fetch("/api/diagnostics/snapshots?limit=20").then(ft=>ft.json()),fetch("/api/log?limit=4").then(ft=>ft.json())]);if(ve)return;ze.status==="fulfilled"&&d(ze.value);const _t=we.status==="fulfilled"?up(we.value):[];if(A(_t),X.status==="fulfilled"){const ft=X.value;se(ft,_t)}else h([]),y(null),N(!1);if(_e.status==="fulfilled"){const ft=_e.value;T((ft.entries??[]).slice(0,4).map(Me=>({id:Me.id,action:Me.action,description:Me.description,timestamp:Me.timestamp,itemId:Me.itemId??null}))),te(!0)}else T([]),te(!1);ze.status==="rejected"&&X.status==="rejected"&&_e.status==="rejected"&&G(!0),ie(!1)}return Se(),()=>{ve=!0}},[se]);const ye=v.useMemo(()=>ua(s,o),[o,s]),E=v.useMemo(()=>{const ve=ur(s,o);return s.items.filter(Se=>ve.has(Se.stage)).map(Se=>{var ze;return{itemId:Se.id,title:Se.description||Se.id,stage:((ze=ye.find(X=>X.id===Se.stage))==null?void 0:ze.name)??Se.stage,actor:op(Se.stage,s,o),since:B0(Se.createdAt)}})},[o,ye,s]),$=ce?s.items.find(ve=>ve.id===ce)??null:null,me=$?((Z=ye.find(ve=>ve.id===$.stage))==null?void 0:Z.name)??null:null,ue=(u==null?void 0:u.itemId)??s.primaryItemId??((re=s.items[0])==null?void 0:re.id),k=ue?s.items.find(ve=>ve.id===ue):void 0,b=k?((Oe=ye.find(ve=>ve.id===k.stage))==null?void 0:Oe.name)??k.stage:void 0,D=k?{id:k.id,title:k.description||k.id,description:"Resumo operacional do item que está no centro da supervisão agora.",stage:b,spec:k.spec??(u==null?void 0:u.spec),ageLabel:ix(k.createdAt),actor:k.claimedBy??op(k.stage,s,o)}:void 0;function Y(ve){de(ve),window.dispatchEvent(new CustomEvent("letra-open-item",{detail:ve}))}async function Q(ve,Se){Ee(!0),_("Atualizando saude do workspace...");try{if(!(await fetch(ve,{method:"POST",headers:Se?{"Content-Type":"application/json"}:void 0,body:Se?JSON.stringify(Se):void 0})).ok)throw new Error("health action failed");const X=await oe();return _("Saude do workspace atualizada."),X}catch{return _("Nao foi possivel atualizar a saude agora."),null}finally{Ee(!1)}}async function le(){await Q("/api/health/scan")}async function B(ve){const Se=await Q("/api/health/ack",{id:ve.id});Se&&U(Se.find(ze=>ze.id===ve.id)??null)}async function O(ve){await Q("/api/health/dismiss",{id:ve.id})&&U(null)}return P?l.jsx(H0,{}):l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-[var(--layout-page-gap)] p-[var(--layout-page-padding)]",children:[pe?l.jsx(Vy,{onRetry:()=>window.location.reload(),children:"Não foi possível carregar a supervisão agora."}):null,l.jsx(L0,{decisions:E,signals:m,healthSummary:x??void 0,activity:w,signalsAvailable:g,activityAvailable:V,primaryItemId:ue,primaryWork:D,onReviewDecision:Y,onOpenItem:Y,onOpenActivity:()=>c==null?void 0:c("activity"),onOpenWork:()=>c==null?void 0:c("work"),onOpenSignal:U,onScanHealth:le,healthBusy:fe}),u!=null&&u.active&&u.spec?l.jsx(K0,{spec:u.spec,primaryItem:k,primaryStageName:b}):null]})}),l.jsx($0,{item:$,stageName:me,open:!!$,onOpenChange:ve=>{ve||de(null)}}),l.jsx(J0,{signal:ee,open:!!ee,onOpenChange:ve=>{ve||U(null)},onAcknowledge:B,onDismiss:O,onScan:le,actionBusy:fe,actionMessage:xe})]})}function Bi(s,o,c){var y;if(s.spec&&((y=c.specLinks)==null?void 0:y[s.spec]))return s.spec.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");const d=s.description.trim().split(/\s+/).filter(Boolean).slice(0,3).join("-").toLowerCase().replace(/[^a-z0-9-]/g,"")||s.id.toLowerCase(),m=new Set(c.items.filter(g=>g.id!==s.id).map(g=>W0(g,o,c)));let h=d,x=2;for(;m.has(h);)h=`${d}-${x}`,x++;return h}function W0(s,o,c){var d;return s.spec&&((d=c.specLinks)==null?void 0:d[s.spec])?s.spec.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""):s.description.trim().split(/\s+/).filter(Boolean).slice(0,3).join("-").toLowerCase().replace(/[^a-z0-9-]/g,"")||s.id.toLowerCase()}function ox(s){const o=s.split(`
|
|
201
|
+
`);let c=0,u=0;for(const d of o){const m=d.trim();/^- \[ \]/.test(m)&&u++,/^- \[x\]/i.test(m)&&(c++,u++)}return{done:c,total:u}}const F0={builder:"implementer",implementer:"implementer"};function I0(s,o,c,u){const d=[c==null?void 0:c.agentId,o,u,c==null?void 0:c.toolId].filter(Boolean),m=[...d,...d.map(h=>F0[h]??h)];return s.find(h=>m.includes(h.id))??s.find(h=>m.includes(h.role))}function P0(s,o,c,u,d){var j,A,w;const m=s.spec?u.find(T=>T.id===s.spec):void 0,h=m?ox(m.content):{done:0,total:0},x=ua(o,c).find(T=>T.id===s.stage),y=((j=x==null?void 0:x.roles[0])==null?void 0:j.id)??(x==null?void 0:x.roleIds[0]),g=I0(d,s.claimedBy,{agentId:y},s.claimExecutorId)??null,N=ka(s,o,c);return{itemId:s.id,title:((A=s.description)==null?void 0:A.trim())||(m==null?void 0:m.id)||Bi(s,u,o),stage:s.stage,stageLabel:(x==null?void 0:x.name)??s.stage,state:N,stateLabel:N==="waiting"?"Aguardando decisão":N==="running"?"Em execução":N==="done"?"Concluído":N==="blocked"?"Bloqueado":"Na fila",progress:h,identity:g,persona:(g==null?void 0:g.role)??((w=x==null?void 0:x.roles[0])==null?void 0:w.label)??"Sem persona",actionLabel:"Acompanhar trabalho ativo"}}const ej={approve:"Decisão aprovada e registrada.","request-changes":"Alterações solicitadas e registradas.",reject:"Rejeição registrada."};function tj({itemId:s,onDecided:o}){const{toast:c}=nr(),[u,d]=v.useState(null),[m,h]=v.useState(null);async function x(y,g){h(y);try{const N=await fetch(`/api/items/${s}/gate-decisions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:y,reason:g})}),j=await N.json().catch(()=>({}));if(!N.ok)throw new Error(j.error||"Não foi possível registrar a decisão.");c(ej[y],"success"),o==null||o()}catch(N){c(N instanceof Error?N.message:"Não foi possível registrar a decisão.","error")}finally{h(null)}}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(F,{variant:"primary",size:"sm",disabled:m!==null,onClick:()=>void x("approve"),children:[l.jsx(z,{name:"check",size:14}),m==="approve"?"Registrando...":"Aprovar"]}),l.jsxs(F,{variant:"ghost",size:"sm",disabled:m!==null,onClick:()=>d("request-changes"),children:[l.jsx(z,{name:"edit",size:14}),"Solicitar alterações"]}),l.jsxs(F,{variant:"ghost",size:"sm",disabled:m!==null,onClick:()=>d("reject"),children:[l.jsx(z,{name:"x",size:14}),"Rejeitar"]})]}),l.jsx(Pp,{open:u!==null,onClose:()=>d(null),onSubmit:y=>{u&&x(u,y)},title:u==="reject"?"Rejeitar item":"Solicitar alterações",label:"Motivo obrigatório",placeholder:"Explique o direcionamento para manter a decisão auditável",submitLabel:u==="reject"?"Rejeitar":"Solicitar alterações"})]})}function aj(s){return s==="done"?{key:s,label:"Concluído",variant:"success",tagVariant:"success",action:"Sem ação pendente",icon:"check-circle",animate:""}:s==="waiting"?{key:s,label:"Precisa de atenção",variant:"amber",tagVariant:"warning",action:"Revisar decisão humana",icon:"clock",animate:"animate-timeline-dot"}:s==="blocked"?{key:s,label:"Bloqueado",variant:"error",tagVariant:"danger",action:"Examinar bloqueio",icon:"shield",animate:""}:s==="running"?{key:s,label:"Em andamento",variant:"agent",tagVariant:"agent",action:"Acompanhar trabalho ativo",icon:"chevron-right",animate:"animate-agent-running"}:{key:s,label:"Na fila",variant:"info",tagVariant:"default",action:"Aguardando responsável",icon:"circle",animate:""}}function lj(s){return s==="attention"?{title:"Nenhum trabalho precisa de atenção agora.",description:"Gates humanos e bloqueios aparecerão aqui quando exigirem revisão."}:s==="running"?{title:"Nenhum trabalho está em andamento.",description:"Quando um item estiver associado a um ator, ele aparecerá neste recorte."}:s==="queued"?{title:"Nenhum trabalho está na fila.",description:"Itens sem responsável declarado aparecerão aqui antes de entrarem em andamento."}:s==="done"?{title:"Nenhum trabalho concluído ainda.",description:"Itens em estágios finais aparecerão neste recorte."}:{title:"Nenhum trabalho neste fluxo.",description:"Crie um item quando houver algo para supervisionar."}}function nj({item:s,workflow:o,activeFlow:c,specs:u,agents:d,onClick:m,onOpenSpec:h,onDragStart:x,onDragEnd:y}){var Ee,xe;const g=Bi(s,u,o),N=P0(s,o,c,u,d),j=ur(o,c).has(s.stage),A=aj(ka(s,o,c)),w=s.spec?u.find(_=>_.id===s.spec):null,T=w?(()=>{const _=(w.content.match(/-\s+\[x\]/g)||[]).length,se=(w.content.match(/-\s+\[(\s|x)\]/g)||[]).length;return{done:_,total:se,label:se>0?`${_}/${se} critérios`:"Sem critérios",source:"Critérios"}})():s.tasks&&s.tasks.length>0?{done:s.tasks.filter(_=>_.done).length,total:s.tasks.length,label:`${s.tasks.filter(_=>_.done).length}/${s.tasks.length} tarefas`,source:"Tarefas"}:{done:0,total:0,label:"Sem checklist",source:"Evidência"},V=N.identity,te=((Ee=N.identity)==null?void 0:Ee.displayName)??"Não atribuído",P=N.persona,ie=A.key==="running",pe=T.total>0,G=T.total>0?T.done:0,ce=T.total>0?T.total:1,de=A.key==="blocked"?"error":A.key==="waiting"?"warning":A.key==="done"?"complete":A.key==="running"?"agent":"default",ee=((xe=s.description)==null?void 0:xe.trim())||(w==null?void 0:w.id)||g,U=A.key==="blocked"?"var(--color-danger)":A.key==="waiting"?"var(--color-primary)":ie?"var(--color-agent)":j?"var(--color-success)":"var(--color-border)",fe=A.key==="blocked"?"color-mix(in oklch, var(--color-danger) 5%, var(--color-bg-surface))":A.key==="waiting"?"color-mix(in oklch, var(--color-primary) 6%, var(--color-bg-surface))":ie?"color-mix(in oklch, var(--color-agent) 5%, var(--color-bg-surface))":"var(--color-bg-surface)";return l.jsx(at,{variant:ie?"agent":"default",className:yt("app-board-card cursor-grab select-none active:cursor-grabbing hover:-translate-y-0.5 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",j&&"animate-human-pulse",s.claimedBy&&"ring-1"),style:{borderColor:U,background:fe},"data-claimed":s.claimedBy?"true":"false","data-gate":j?"true":"false","data-running":ie?"true":"false",draggable:!0,role:"group",tabIndex:0,"aria-label":`Abrir ${s.id}: ${ee}`,onClick:m,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),m())},onDragStart:x,onDragEnd:y,children:l.jsxs(lt,{className:"min-w-0 gap-3 p-3.5",children:[l.jsxs("div",{className:"grid min-w-0 gap-2",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[l.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] font-medium text-[var(--color-text-tertiary)]",children:s.id}),l.jsx(Ae,{variant:A.variant,tone:"soft",className:yt("max-w-full shrink-0",A.animate),icon:A.icon,children:A.label})]}),l.jsx("h3",{className:"line-clamp-3 text-body-sm font-semibold leading-snug text-[var(--color-text-primary)]",children:ee})]}),l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5 text-caption text-[var(--color-text-secondary)]",children:[l.jsxs(Je,{variant:s.claimedBy?"agent":"default",children:[V?l.jsx(tx,{agent:V,size:"sm"}):l.jsx(z,{name:s.claimedBy?"bot":"circle",size:10}),te]}),l.jsx(Je,{children:P})]}),pe?l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-caption font-medium text-[var(--color-text-secondary)]",children:T.source}),l.jsx("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:T.label})]}),l.jsx(Ou,{value:G,max:ce,size:"xs",state:de})]}):null,l.jsx("div",{className:"flex items-center justify-end pt-1",children:l.jsxs(F,{type:"button",size:"sm",variant:"secondary",onClick:_=>{_.stopPropagation(),m()},"aria-label":`Acompanhar trabalho ativo de ${s.id}`,children:[l.jsx(z,{name:"activity",size:12})," Acompanhar trabalho ativo"]})})]})})}function sj({workflow:s,activeFlow:o,onSelectItem:c,onDropItem:u,onApproveGate:d,onItemDecided:m,allowDrop:h,specRefreshKey:x,onAddItem:y,onOpenSpec:g,filter:N="all",className:j}){const[A,w]=v.useState(null),[T,V]=v.useState(null),[te,P]=v.useState([]),[ie,pe]=v.useState([]),G=v.useRef(null),ce=v.useCallback(async()=>{try{const k=await fetch("/api/specs");if(!k.ok)return;const b=await k.json();P(b)}catch{}},[]);v.useEffect(()=>{ce(),fetch("/api/agents").then(k=>k.json()).then(k=>Array.isArray(k)&&pe(k)).catch(()=>{})},[ce]),v.useEffect(()=>{x&&ce()},[x,ce]);const de=v.useCallback((k,b)=>{const D=s.items.find(Y=>Y.id===b);D&&(G.current=D,V(b),k.dataTransfer.setData("text/plain",b),k.dataTransfer.dropEffect="move")},[s.items]),ee=v.useCallback(()=>{w(null),V(null),G.current=null},[]),U=v.useCallback(k=>{k.preventDefault(),k.dataTransfer.dropEffect="move"},[]),fe=v.useCallback(k=>{w(k)},[]),Ee=v.useCallback(()=>{w(null)},[]),xe=v.useCallback((k,b)=>{k.preventDefault(),w(null);const D=k.dataTransfer.getData("text/plain"),Y=s.items.find(Q=>Q.id===D);Y&&Y.stage!==b&&(h&&!h(Y,b)||u(D,b))},[s.items,h,u]),_=ur(s,o),se=rx(s,o),oe=ua(s,o).map(k=>({id:k.id,label:k.name,color:Bu(k).color,gate:_.has(k.id)})),ye={all:()=>!0,attention:k=>{const b=ka(k,s,o);return b==="waiting"||b==="blocked"},running:k=>ka(k,s,o)==="running",queued:k=>ka(k,s,o)==="idle",done:k=>se.has(k.stage)},E=ye[N]||ye.all,$=s.items.filter(E),me=lj(N);function ue(k){const b=s.items.filter(le=>le.stage===k.id).filter(E),D=A===k.id,Y=k.gate,Q=s.items.some(le=>le.stage===k.id);return l.jsxs("div",{className:"flex min-h-[200px] w-[18rem] min-w-[18rem] flex-none flex-col gap-2 xl:w-[19.5rem] xl:min-w-[19.5rem]",children:[l.jsx("div",{className:"app-board-column-header flex items-center justify-between px-1 pb-1","data-gate":Y&&Q?"true":"false",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[Y&&Q?l.jsx("div",{className:"w-2 h-4 rounded-full bg-[var(--color-success)] animate-timeline-dot"}):l.jsx("div",{className:"w-1.5 h-4 rounded-full",style:{background:k.color}}),l.jsx("span",{className:yt("min-w-0 truncate text-xs font-semibold",Y&&Q&&"text-[var(--color-success)]"),children:k.label}),l.jsx(Ae,{variant:Y&&Q?"amber":"info",className:yt("shrink-0 text-caption px-1.5",Y&&Q&&"animate-pulse"),children:s.items.filter(le=>le.stage===k.id).length})]})}),l.jsxs("div",{className:"app-board-dropzone flex flex-col gap-2 p-2","data-over":D?"true":"false","data-gate":Y&&Q?"true":"false",onDragOver:U,onDragEnter:()=>fe(k.id),onDragLeave:Ee,onDrop:le=>xe(le,k.id),children:[b.length===0&&!D&&l.jsx("div",{className:"flex items-center justify-center h-full py-4",children:l.jsx("span",{className:"app-board-empty text-[11px]",children:"Vazio"})}),b.map(le=>l.jsx(nj,{item:le,workflow:s,activeFlow:o,specs:te,agents:ie,onClick:()=>c(le.id),onOpenSpec:le.spec&&g?g:void 0,onDragStart:B=>de(B,le.id),onDragEnd:ee},le.id)),Y&&Q&&l.jsxs("div",{className:"app-board-gate-banner mt-1 pt-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-caption mb-1.5 px-1",children:[l.jsx(z,{name:"clock",size:10,style:{color:"var(--color-success)"}}),l.jsx("span",{style:{color:"var(--color-success)"},className:"font-medium",children:"Aprovação necessária"})]}),b.map(le=>l.jsx("div",{className:"mb-2",children:l.jsx(tj,{itemId:le.id,onDecided:m})},le.id))]})]})]},k.id)}return l.jsxs("div",{className:yt("flex min-h-0 min-w-0 flex-1 flex-col gap-4 p-4",j),children:[$.length===0?l.jsxs("div",{className:"app-board-filter-empty flex min-h-[16rem] flex-1 flex-col items-center justify-center gap-3 rounded-[var(--radius-lg)] border border-dashed border-[var(--color-border)] p-6 text-center",children:[l.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-[var(--color-bg-sunken)] text-[var(--color-text-secondary)]",children:l.jsx(z,{name:N==="attention"?"shield":N==="running"?"cpu":N==="done"?"check-circle":"circle",size:18})}),l.jsxs("div",{className:"grid max-w-sm gap-1",children:[l.jsx("p",{className:"text-body-sm font-semibold text-[var(--color-text-primary)]",children:me.title}),l.jsx("p",{className:"text-caption leading-snug text-[var(--color-text-secondary)]",children:me.description})]})]}):l.jsx("div",{className:"flex min-w-max gap-4 overflow-x-auto pb-2 [scrollbar-width:thin]",children:oe.map(ue)}),y&&l.jsx("div",{className:"flex justify-center",children:l.jsxs(F,{variant:"secondary",size:"sm",onClick:y,children:[l.jsx(z,{name:"plus",size:14}),"Adicionar item"]})})]})}function rj(s){const o=new Date(s).getTime();return Number.isNaN(o)?0:Math.max(0,Math.floor((Date.now()-o)/864e5))}function ij(s){return s===0?"Hoje":s===1?"1d no fluxo":`${s}d no fluxo`}function oj(s,o){return s==="waiting"?{statusLabel:"Decisão",actionLabel:"Revisar gate",tone:"warning",badgeVariant:"amber",icon:"clock",priority:0}:s==="blocked"?{statusLabel:"Bloqueio",actionLabel:"Examinar causa",tone:"danger",badgeVariant:"error",icon:"shield",priority:1}:s==="running"?{statusLabel:"Em execução",actionLabel:"Acompanhar",tone:"info",badgeVariant:"agent",icon:"chevron-right",priority:2}:s==="done"?{statusLabel:"Concluído",actionLabel:"Ver evidência",tone:"success",badgeVariant:"success",icon:"check-circle",priority:o>14?5:4}:{statusLabel:o>=14?"Maior espera":"Na fila",actionLabel:"Avaliar prioridade",tone:"default",badgeVariant:"info",icon:"circle",priority:o>=14?3:6}}function cj({workflow:s,activeFlow:o,onSelectItem:c}){const u=s.items,d=ua(s,o),m=u.map(x=>{var T,V;const y=d.find(te=>te.id===x.stage),g=y?Bu(y):null,N=ka(x,s,o),j=rj(x.createdAt),A=oj(N,j),w=Bi(x,[],s);return{id:`signal-${x.id}-${x.stage}`,itemId:x.id,title:((T=x.description)==null?void 0:T.trim())||w,subtitle:x.spec??w,owner:x.claimedBy??((V=y==null?void 0:y.roles[0])==null?void 0:V.label)??"Não atribuído",age:ij(j),stage:(y==null?void 0:y.name)??x.stage,...A,icon:(g==null?void 0:g.icon)??A.icon,createdAt:new Date(x.createdAt).getTime()}}).sort((x,y)=>x.priority-y.priority||y.createdAt-x.createdAt).slice(0,6),h=m.filter(x=>x.priority<=3).length;return m.length===0?l.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[l.jsx("h3",{className:"app-section-muted text-xs font-semibold uppercase tracking-wider",children:"O que observar agora"}),l.jsx("p",{className:"app-section-muted text-xs",children:"Nenhum item para observar agora."})]}):l.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("h3",{className:"app-section-muted text-xs font-semibold uppercase tracking-wider",children:"O que observar agora"}),l.jsxs(Ae,{variant:h>0?"amber":"info",tone:"soft",className:"tabular-nums",children:[h," prioridade",h===1?"":"s"]})]}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:"Decisões, bloqueios e esperas aparecem antes do restante."})]}),l.jsx(ol,{className:"gap-2",children:m.map(x=>l.jsx(cl,{tone:x.tone,className:"grid-cols-1 items-start p-3 sm:grid-cols-1",meta:l.jsxs(l.Fragment,{children:[l.jsx(Ae,{variant:x.badgeVariant,tone:"soft",icon:x.icon,children:x.statusLabel}),l.jsx(Je,{children:x.stage}),l.jsx(Je,{children:x.age})]}),title:l.jsx("span",{className:"line-clamp-2",children:x.title}),description:l.jsxs("span",{className:"grid gap-1",children:[l.jsx("span",{className:"truncate font-mono",children:x.subtitle}),l.jsxs("span",{className:"truncate",children:[x.owner," · ",x.actionLabel]})]}),action:c?l.jsxs(F,{type:"button",variant:"secondary",size:"sm",className:"w-full justify-between text-caption",onClick:()=>c(x.itemId),"aria-label":`Abrir ${x.itemId}`,children:["Abrir",l.jsx(z,{name:"chevron-right",size:12})]}):null},x.id))}),u.length>m.length&&l.jsxs("p",{className:"app-section-muted text-caption text-center",children:["Mostrando 6 de ",u.length," itens"]})]})}function uj(s){var o,c;return((o=s.gate)==null?void 0:o.type)==="human"?"Humano":((c=s.roles[0])==null?void 0:c.label)??s.roleIds[0]??"Sem papel"}function dj(s){var c;const o=Object.values(((c=s.phases)==null?void 0:c.states)??{}).flatMap(u=>(u.transitions??[]).map(d=>`${u.label} → ${d.target}`));return[...new Set(o)]}function fj({stages:s,activeFlow:o,items:c=[]}){return l.jsx(at,{className:"shrink-0",children:l.jsxs(lt,{className:"p-3 sm:p-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(z,{name:"git-branch",size:16,style:{color:"var(--color-primary)"}}),l.jsx("h2",{className:"text-sm font-semibold",children:"Configuração da esteira"})]}),l.jsxs("p",{className:"app-section-muted text-caption mt-1",children:[(o==null?void 0:o.name)??"Fluxo legado"," · ",o?`fonte: ${o.source}`:"fonte: instância do workflow"]})]}),o!=null&&o.harnessVersion?l.jsxs(Je,{children:["harness ",o.harnessVersion]}):null]}),l.jsx("div",{className:"flex min-w-0 items-stretch gap-2 overflow-x-auto pb-1",tabIndex:0,"aria-label":"Configuração da esteira",children:s.map((u,d)=>{var w,T;const m=u.roles[0],h=u.gate,x=(w=u.activity)==null?void 0:w.gate,y=(h==null?void 0:h.type)==="human"&&h.blocking,g=y||!!x,N=(c==null?void 0:c.filter(V=>V.stage===u.id).length)??0,j=dj(u),A=s[d+1];return l.jsxs("div",{className:"flex min-w-[230px] items-center gap-2",children:[l.jsxs("div",{className:"min-w-0 flex-1 rounded-[var(--radius-sm)] border p-3",style:{borderColor:y?"var(--color-warning)":"var(--color-border)",background:y?"color-mix(in oklch, var(--color-warning) 8%, transparent)":"var(--color-bg-surface)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(z,{name:y?"user":u.zone==="done"?"check":"cpu",size:14,style:{color:y?"var(--color-warning)":"var(--color-primary)"}}),l.jsx("span",{className:"truncate text-sm font-semibold",children:u.name})]}),l.jsxs("div",{className:"mt-2 grid gap-1 text-caption",style:{color:"var(--color-text-secondary)"},children:[l.jsxs("div",{children:[l.jsx("strong",{className:"font-medium text-[var(--color-text-primary)]",children:"Atua:"})," ",uj(u)]}),m!=null&&m.description?l.jsx("div",{className:"line-clamp-2",children:m.description}):null]}),(T=m==null?void 0:m.capabilities)!=null&&T.length?l.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:m.capabilities.map(V=>l.jsx(Je,{children:V},V))}):null,l.jsxs("div",{className:"mt-2 text-caption",style:{color:"var(--color-text-secondary)"},children:["Executor: ",u.preferredExecutor??"fallback do registro"]}),u.phases?l.jsxs("div",{className:"mt-2 text-caption",style:{color:"var(--color-text-secondary)"},children:["Fases: ",Object.values(u.phases.states).map(V=>V.label).join(" · ")]}):null,j.length>0?l.jsx("div",{className:"mt-1 text-caption",style:{color:"var(--color-text-secondary)"},children:l.jsxs("span",{className:"font-medium text-[var(--color-text-primary)]",children:["Transições: ",j.join(" · ")]})}):A?l.jsxs("div",{className:"mt-1 text-caption",style:{color:"var(--color-text-secondary)"},children:[l.jsx("strong",{className:"font-medium text-[var(--color-text-primary)]",children:"Transição:"})," concluir critérios e validação → ",A.name]}):null,h?l.jsxs("div",{className:"mt-2 text-caption font-medium",style:{color:y?"var(--color-warning)":"var(--color-text-secondary)"},children:[y?"Gate humano":"Gate automático",": ",h.name]}):null,x?l.jsxs("div",{className:"mt-2 grid gap-1 rounded border px-2 py-1.5 text-caption",style:{borderColor:"var(--color-warning)",color:"var(--color-warning)",background:"color-mix(in oklch, var(--color-warning) 8%, transparent)"},children:[l.jsxs("div",{className:"font-semibold",children:["Aprovação humana: ",x.label??"necessária"]}),x.decision?l.jsxs("div",{children:["Decisão: ",x.decision]}):null,x.evidence?l.jsxs("div",{children:["Evidências: ",x.evidence]}):null,N>0?l.jsxs("div",{className:"font-semibold",children:[N," item(ns) aguardam este gate"]}):l.jsx("div",{children:"Nenhum item aguardando agora"})]}):g&&N>0?l.jsxs("div",{className:"mt-2 text-caption font-medium",style:{color:"var(--color-warning)"},children:["Aprovação pendente para ",N," item(ns)"]}):null]}),d<s.length-1?l.jsx(z,{name:"chevron-right",size:14,className:"shrink-0",style:{color:"var(--color-text-secondary)"}}):null]},u.id)})})]})})}function cx(s){let o,c=!1,u=1e3,d=null;const m=new Map;function h(j,A){var w;m.has(j)||m.set(j,new Set),(w=m.get(j))==null||w.add(A),o.addEventListener(j,A)}function x(j,A){var w;(w=m.get(j))==null||w.delete(A),o.removeEventListener(j,A)}function y(){c=!0,d&&clearTimeout(d),o.close()}function g(){c||(console.warn(`[SSE] Reconnecting in ${u/1e3}s...`),d=setTimeout(()=>{N(),u=Math.min(u*2,3e4)},u))}function N(){c||(o=new EventSource(s),o.onopen=()=>{u=1e3,console.warn("[SSE] Connected")},m.forEach((j,A)=>{for(const w of j)o.addEventListener(A,w)}),o.onerror=()=>{o.close(),g()})}return N(),new Proxy({},{get(j,A){return A==="addEventListener"?h:A==="removeEventListener"?x:A==="close"?y:Reflect.get(o,A)},set(j,A,w){return Reflect.set(o,A,w)}})}function mj(s){const o=new Date(s).getTime();return Number.isNaN(o)?0:Math.max(0,Math.floor((Date.now()-o)/864e5))}function hj(s){return s==="waiting"?{label:"Aguardando decisão",action:"Revisar o gate antes de avançar.",tone:"warning",badge:"amber",icon:"clock"}:s==="blocked"?{label:"Bloqueado",action:"Examinar a causa do bloqueio.",tone:"danger",badge:"error",icon:"shield"}:s==="running"?{label:"Em execução",action:"Acompanhar o responsável e evidências.",tone:"info",badge:"agent",icon:"chevron-right"}:s==="done"?{label:"Concluído",action:"Verificar evidências registradas.",tone:"success",badge:"success",icon:"check-circle"}:{label:"Na fila",action:"Avaliar prioridade e próximo responsável.",tone:"default",badge:"info",icon:"circle"}}function pj({item:s,workflow:o,activeFlow:c,specs:u,onClose:d,onItemMoved:m,onOpenSpec:h}){var we,_e,_t,ft;const x=v.useRef(null),y=v.useRef(null),[g,N]=v.useState(""),[j,A]=v.useState(null),[w,T]=v.useState(!0),[V,te]=v.useState([]),[P,ie]=v.useState(!1),[pe,G]=v.useState(1),[ce,de]=v.useState(0),[ee,U]=v.useState(!1),[fe,Ee]=v.useState(!1),[xe,_]=v.useState(!1),se=Bi(s,u,o),oe=((we=s.description)==null?void 0:we.trim())||se,ye=ua(o,c),E=ye.find(Me=>Me.id===s.stage),$=s.spec?u.find(Me=>Me.id===s.spec):null,me=$?ox($.content):null,ue=s.tasks&&s.tasks.length>0,k=me?me.total:ue?((_e=s.tasks)==null?void 0:_e.length)??0:0,b=me?me.done:ue?((_t=s.tasks)==null?void 0:_t.filter(Me=>Me.done).length)??0:0,D=mj(s.createdAt),Y=ka(s,o,c),Q=hj(Y),le=E?Uu(E):"Item registrado no fluxo.",B=s.claimedBy??((ft=E==null?void 0:E.roles[0])==null?void 0:ft.label)??"Não atribuído",O=ye.filter(Me=>Me.id!==s.stage),Z=s.lastHeartbeatAt?Date.now()-new Date(s.lastHeartbeatAt).getTime():null,re=Z!==null&&Z>6e4,Oe=V.filter(Me=>/retry|retrying|re-emit/i.test(`${Me.action} ${Me.description}`)).length;v.useEffect(()=>{var Me;return y.current=document.activeElement,(Me=x.current)==null||Me.focus(),()=>{var Pe;(Pe=y.current)==null||Pe.focus()}},[]),v.useEffect(()=>{const Me='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Pe(mt){const Le=x.current;if(!Le)return;if(mt.key==="Escape"){d();return}if(mt.key!=="Tab")return;const kt=Le.querySelectorAll(Me);if(kt.length===0)return;const et=kt[0],Ma=kt[kt.length-1];mt.shiftKey&&document.activeElement===et?(mt.preventDefault(),Ma.focus()):!mt.shiftKey&&document.activeElement===Ma&&(mt.preventDefault(),et.focus())}return window.addEventListener("keydown",Pe),()=>window.removeEventListener("keydown",Pe)},[d]),v.useEffect(()=>{const Me=cx("/events");return Me.addEventListener("workflow-updated",Pe=>{try{const mt=JSON.parse(Pe.data);if(mt.itemId===s.id&&mt.stage&&mt.stage!==s.stage){const Le=ye.find(kt=>kt.id===mt.stage);A(`${s.id} movido para ${(Le==null?void 0:Le.name)??mt.stage}`),(Le==null?void 0:Le.zone)==="done"&&setTimeout(()=>d(),3e3)}}catch{}}),()=>Me.close()},[s.id,s.stage,d,ye]),v.useEffect(()=>{const Me=setTimeout(()=>T(!1),150);return()=>clearTimeout(Me)},[]);const ve=v.useCallback(Me=>{ie(!1),fetch(`/api/log?item=${s.id}&limit=50&page=${Me}`).then(Pe=>Pe.json()).then(Pe=>{Pe.entries&&te(mt=>Me===1?Pe.entries:[...mt,...Pe.entries]),typeof Pe.total=="number"&&de(Pe.total)}).catch(()=>{}).finally(()=>ie(!0))},[s.id]);v.useEffect(()=>{G(1),te([]),ve(1)},[ve]);const Se=v.useCallback(()=>{g&&fetch(`/api/items/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stage:g})}).then(()=>{m(),N("")})},[s.id,g,m]),ze=v.useCallback(()=>{fetch(`/api/items/${s.id}`,{method:"DELETE"}).then(()=>{m(),d()})},[s.id,d,m]),X=v.useCallback((Me,Pe)=>{var mt;fetch(`/api/items/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tasks:(mt=s.tasks)==null?void 0:mt.map(Le=>Le.id===Me?{...Le,done:Pe}:Le)})}).then(()=>m())},[s.id,s.tasks,m]);return l.jsxs(l.Fragment,{children:[l.jsxs(ns,{open:!0,onClose:d,title:oe,variant:"fullscreen",hideHeader:!0,contentRef:x,className:"animate-fade-in",children:[j&&l.jsxs("div",{className:"app-warning-banner flex shrink-0 items-center gap-2 px-4 py-2 text-sm",children:[l.jsx(z,{name:"alert-triangle",size:14}),l.jsx("span",{children:j}),l.jsx(F,{onClick:()=>A(null),className:"ml-auto",size:"sm",variant:"ghost","aria-label":"Dispensar aviso",children:l.jsx(z,{name:"x",size:14})})]}),l.jsxs("header",{className:"app-header-surface flex shrink-0 items-start gap-3 px-5 py-4",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[l.jsx(Ae,{variant:"info",tone:"soft",className:"font-mono",children:s.id}),l.jsx(Ae,{variant:Q.badge,tone:"soft",icon:Q.icon,children:Q.label}),l.jsx(Je,{children:(E==null?void 0:E.name)??s.stage})]}),l.jsx("h2",{className:"line-clamp-2 text-lg font-semibold leading-snug text-[var(--color-text-primary)]",children:oe}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:s.spec??se})]}),s.spec&&h&&l.jsxs(F,{size:"sm",variant:"secondary",onClick:h,children:[l.jsx(z,{name:"file-text",size:14}),"Abrir especificação"]}),l.jsx(F,{onClick:d,size:"sm",variant:"ghost","aria-label":"Fechar",children:l.jsx(z,{name:"x",size:16})})]}),l.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]",children:[l.jsxs("aside",{className:"app-section-card hidden min-h-0 flex-col gap-4 overflow-y-auto rounded-none border-y-0 border-l-0 p-4 lg:flex",children:[l.jsx(ar,{tone:Q.tone,density:"compact",icon:l.jsx(z,{name:Q.icon,size:16}),title:"Próxima ação",description:`${Q.action} ${le}`}),l.jsx(at,{children:l.jsxs(lt,{className:"gap-3 p-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Estado do trabalho"}),l.jsx("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:k>0?`${b}/${k}`:"sem checklist"})]}),k>0&&l.jsx(Ou,{value:b,max:k,size:"sm",state:Y==="done"?"complete":Y==="blocked"?"error":Y==="waiting"?"warning":"default"}),l.jsx(Na,{className:"grid-cols-1",items:[{label:"Responsável",value:B},{label:"Tempo no fluxo",value:D===0?"Hoje":`${D}d`},{label:"Evidência",value:$?$.id:"Sem especificação vinculada"}]})]})}),l.jsx(at,{children:l.jsxs(lt,{className:"gap-3 p-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Execução e handoff"}),re?l.jsx(Ae,{variant:"error",tone:"soft",children:"Heartbeat expirado"}):null]}),l.jsx(Na,{className:"grid-cols-1",items:[{label:"Claim",value:s.claimedBy?`${s.claimedBy}${s.claimRevision?` · ${s.claimRevision.slice(0,12)}`:""}`:"Nenhum claim ativo"},{label:"Executor",value:s.claimExecutorId??"Nenhum executor"},{label:"Heartbeat",value:s.lastHeartbeatAt?`${s.lastHeartbeatAt}${re?" · stale":" · ativo"}`:"Nenhum heartbeat registrado"},{label:"Retries",value:Oe?String(Oe):"Nenhuma tentativa de retry"},{label:"Gate",value:E!=null&&E.gate?`${E.gate.name} · ${E.gate.blocking?"bloqueante":"informativo"}`:"Nenhum gate configurado"}]}),s.handoff?l.jsxs("div",{className:"grid gap-1 rounded border border-[var(--color-border)] p-3 text-xs",children:[l.jsxs("strong",{children:["Handoff: ",s.handoff.from," → ",s.handoff.to]}),l.jsx("span",{children:s.handoff.summary}),l.jsxs("span",{className:"app-section-muted",children:["Expira em ",s.handoff.expiresAt," · ",s.handoff.evidence.length," evidência(s)"]}),s.handoff.evidence.length>0?l.jsx("span",{className:"break-words",children:s.handoff.evidence.join(" · ")}):l.jsx("span",{className:"app-section-muted",children:"Nenhuma evidência anexada ao handoff."})]}):l.jsx("p",{className:"app-section-muted text-xs",children:"Nenhum handoff pendente."}),s.lastFailure?l.jsxs("p",{className:"text-xs text-[var(--color-danger)]",children:["Falha ",s.lastFailure.code,": ",s.lastFailure.message," · recuperação: ",s.lastFailure.recovery]}):null]})}),l.jsx(at,{children:l.jsxs(lt,{className:"gap-3 p-4",children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Movimentação"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(hu,{value:g,onValueChange:N,children:[l.jsx(pu,{className:"app-select-surface flex-1 text-xs","aria-label":"Mover para",children:l.jsx(Ph,{placeholder:"Mover para..."})}),l.jsx(xu,{children:O.map(Me=>l.jsx(er,{value:Me.id,children:Me.name},Me.id))})]}),l.jsx(F,{size:"sm",disabled:!g,onClick:Se,children:"Mover"})]}),s.spec&&h&&l.jsxs(F,{size:"sm",variant:"secondary",onClick:h,children:[l.jsx(z,{name:"file-text",size:14}),"Abrir especificação vinculada"]}),l.jsxs(ir,{open:fe,onOpenChange:Ee,children:[l.jsxs(or,{className:"app-section-muted flex w-full items-center gap-2 text-xs font-semibold",children:[l.jsx(z,{name:"chevron-right",size:12,className:yt("transition-transform",fe&&"rotate-90")}),"Ações avançadas"]}),l.jsx(cr,{className:"mt-2",children:l.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>_(!0),className:"app-danger-text w-full justify-start",children:[l.jsx(z,{name:"trash",size:14}),"Excluir item"]})})]})]})}),l.jsx(vj,{activities:V,loaded:P,hasMore:ce>V.length,onLoadMore:()=>{const Me=pe+1;G(Me),ve(Me)},open:ee,onOpenChange:U})]}),l.jsx("main",{className:"flex min-h-0 flex-col overflow-hidden",children:l.jsx("div",{className:"app-section-shell flex min-h-0 flex-1 overflow-y-auto p-5",children:l.jsxs("div",{className:"mx-auto grid w-full max-w-5xl gap-4",children:[l.jsx(ar,{className:"lg:hidden",tone:Q.tone,icon:l.jsx(z,{name:Q.icon,size:18}),title:Q.label,description:`${Q.action} ${le}`,meta:l.jsxs(l.Fragment,{children:[l.jsx(Je,{children:B}),l.jsx(Je,{children:D===0?"Hoje no fluxo":`${D}d no fluxo`})]}),action:s.spec&&h?l.jsxs(F,{size:"sm",variant:"secondary",onClick:h,children:[l.jsx(z,{name:"file-text",size:14}),"Abrir especificação"]}):null}),ue&&l.jsx(xj,{item:s,onToggle:X}),l.jsx(at,{children:l.jsxs(lt,{className:"gap-4 p-5",children:[l.jsx("div",{className:"flex items-center justify-between gap-2",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Evidência vinculada"}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:$?$.id:"Nenhuma especificação vinculada a este item."})]})}),w?l.jsxs("div",{className:"grid gap-3",children:[l.jsx(un,{className:"h-6 w-48"}),l.jsx(un,{className:"h-4 w-full"}),l.jsx(un,{className:"h-4 w-3/4"}),l.jsx(un,{className:"h-20 w-full"})]}):$?l.jsx("div",{className:"max-w-none rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-base)] p-4",children:l.jsx(Ll,{content:$.content})}):l.jsx("div",{className:"flex min-h-48 items-center justify-center rounded-[var(--radius-md)] border border-dashed border-[var(--color-border)]",children:l.jsxs("div",{className:"grid justify-items-center gap-2 text-center",children:[l.jsx(z,{name:"file-text",size:24,className:"app-section-muted"}),l.jsx("p",{className:"app-section-muted text-sm",children:s.spec?"Especificação não encontrada":"Nenhuma especificação vinculada"})]})})]})})]})})})]}),l.jsxs("div",{className:"app-section-card flex shrink-0 items-center gap-2 rounded-none border-x-0 border-b-0 px-4 py-3 lg:hidden",children:[l.jsxs(hu,{value:g,onValueChange:N,children:[l.jsx(pu,{className:"app-select-surface flex-1 text-xs","aria-label":"Mover para",children:l.jsx(Ph,{placeholder:"Mover para..."})}),l.jsx(xu,{children:O.map(Me=>l.jsx(er,{value:Me.id,children:Me.name},Me.id))})]}),l.jsx(F,{size:"sm",disabled:!g,onClick:Se,children:"Mover"})]})]}),l.jsx(Du,{open:xe,onClose:()=>_(!1),onConfirm:ze,title:"Excluir item",message:`Excluir ${s.id} remove este item do fluxo. Esta ação deve ser usada apenas quando o item não representa mais trabalho real.`,confirmLabel:"Excluir",cancelLabel:"Cancelar",variant:"danger"})]})}function xj({item:s,onToggle:o}){return!s.tasks||s.tasks.length===0?null:l.jsx(at,{children:l.jsxs(lt,{className:"gap-3 p-4",children:[l.jsxs("h3",{className:"text-body-sm font-semibold",children:["Tarefas (",s.tasks.filter(c=>c.done).length,"/",s.tasks.length,")"]}),l.jsx("div",{className:"grid gap-1",children:s.tasks.map(c=>l.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-[var(--radius-sm)] px-1 py-1 text-xs hover:bg-[var(--surface-hover)]",children:[l.jsx(as,{checked:c.done,onChange:u=>o(c.id,u.target.checked)}),l.jsx("span",{className:yt("text-[var(--color-text-primary)]",c.done&&"text-[var(--color-text-secondary)] line-through"),children:c.description})]},c.id))})]})})}function vj({activities:s,loaded:o,hasMore:c,onLoadMore:u,open:d,onOpenChange:m}){return l.jsx(at,{children:l.jsx(lt,{className:"gap-3 p-4",children:l.jsxs(ir,{open:d,onOpenChange:m,children:[l.jsxs(or,{className:"app-section-muted flex w-full items-center gap-2 text-xs font-semibold",children:[l.jsx(z,{name:"chevron-right",size:12,className:yt("transition-transform",d&&"rotate-90")}),"Log de eventos",o&&l.jsxs("span",{className:"text-caption font-normal",children:["(",s.length,")"]})]}),l.jsx(cr,{className:"mt-3",children:l.jsxs("div",{className:"grid max-h-72 gap-2 overflow-y-auto",children:[o?s.length===0?l.jsx("p",{className:"app-section-muted text-xs",children:"Nenhum evento registrado para este item."}):s.map(h=>l.jsxs("div",{className:"grid gap-0.5 border-l-2 border-[var(--color-primary)] pl-2",children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"app-primary-text text-caption font-medium uppercase",children:h.action}),l.jsx("span",{className:"app-section-muted text-caption",children:new Date(h.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),l.jsx("p",{className:"text-xs leading-relaxed",children:h.description})]},h.id)):l.jsx("p",{className:"app-section-muted text-xs",children:"Carregando..."}),o&&c?l.jsx(F,{type:"button",size:"sm",variant:"ghost",onClick:u,children:"Carregar eventos anteriores"}):null]})})]})})})}function gj({workflow:s,activeFlow:o,specRefreshKey:c,onItemMoved:u,onOpenSpec:d}){var Zt;const[m,h]=v.useState(null),[x,y]=v.useState([]),[g,N]=v.useState(!1),[j,A]=v.useState(!1),[w,T]=v.useState(null),[V,te]=v.useState(s.webhooks??[]),[P,ie]=v.useState(null),[pe,G]=v.useState("all"),[ce,de]=v.useState(()=>{try{return localStorage.getItem("letra-observation-panel")!=="false"}catch{return!0}}),ee=ur(s,o),U=rx(s,o),fe=ua(s,o),Ee=()=>{const J=!ce;de(J);try{localStorage.setItem("letra-observation-panel",String(J))}catch{}},xe=v.useCallback(()=>{fetch("/api/specs").then(J=>J.json()).then(J=>{Array.isArray(J)&&y(J)}).catch(()=>{})},[]);v.useEffect(()=>{xe()},[xe,c]),v.useEffect(()=>{function J(Te){const Ue=Te.detail;if(!Ue)return;s.items.some(bt=>bt.id===Ue)&&h(Ue)}return window.addEventListener("letra-open-item",J),()=>window.removeEventListener("letra-open-item",J)},[s.items]),v.useEffect(()=>{te(s.webhooks??[])},[s.webhooks]);const _=m?s.items.find(J=>J.id===m):null;_&&fe.find(J=>J.id===_.stage),_!=null&&_.spec&&x.find(J=>J.id===_.spec);const se=_?z0(_.stage,s,o):null;se&&((Zt=fe.find(J=>J.id===se))==null||Zt.name);function oe(J,Te){const Ue=s.stages.find(rt=>rt.id===J.stage);return!Ue||!Ue.allow||Ue.allow.length===0?!0:!(!Ue.allow.includes(Te)||ee.has(Te))}function ye(J){const Te=s.stages.find(Ue=>Ue.id===J.stage);return(Te==null?void 0:Te.validate)??[]}const{toast:E}=nr();function $(J,Te){if(ee.has(Te)){fetch(`/api/items/${J}/gate-decisions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:"approve"})}).then(Ue=>Ue.json().then(rt=>({ok:Ue.ok,data:rt}))).then(({ok:Ue,data:rt})=>{if(!Ue){E(rt.error||"Não foi possível registrar a decisão.","error");return}E("Decisão aprovada e registrada.","success"),u(),m===J&&h(null)}).catch(()=>E("Erro ao registrar decisão.","error"));return}fetch(`/api/items/${J}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stage:Te})}).then(Ue=>{if(!Ue.ok)throw new Error("Falha ao mover item");u(),m===J&&h(null)}).catch(()=>E("Erro ao mover item.","error"))}function me(J,Te){const Ue=s.items.find(bt=>bt.id===J);if(!Ue||Ue.stage===Te||!oe(Ue,Te))return;const rt=ye(Ue);if(rt.length>0){ie({itemId:J,targetStage:Te,pendingChecks:rt.map(()=>!1)});return}$(J,Te)}function ue(){P&&($(P.itemId,P.targetStage),ie(null))}function k(){_&&fetch(`/api/items/${_.id}`,{method:"DELETE"}).then(()=>{u(),h(null)})}function b(J){var Ue;const Te=(Ue=fe[0])==null?void 0:Ue.id;Te&&fetch("/api/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:J.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),description:J.trim(),stage:Te})}).then(rt=>rt.json()).then(rt=>{rt&&!rt.error&&u()})}function D(){fetch("/api/workflow",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({webhooks:V})}).then(J=>J.json()).then(()=>{T(null),u()})}function Y(){const J=`wh-${Date.now()}`;te(Te=>[...Te,{id:J,url:"",events:["item.moved"],label:""}])}function Q(J,Te,Ue){te(rt=>{const bt=[...rt];return bt[J]={...bt[J],[Te]:Ue},bt})}function le(J){te(Te=>Te.filter((Ue,rt)=>rt!==J))}const B=s.items.length,O=s.items.map(J=>({item:J,state:ka(J,s,o)})),Z=O.filter(({state:J})=>J==="done").length,re=B>0?Math.round(Z/B*100):0,Oe=s.items.filter(J=>J.claimedBy&&!U.has(J.stage)).length,ve=O.filter(({state:J})=>J==="waiting").length,Se=O.filter(({state:J})=>J==="blocked").length,ze=ve+Se,X=O.filter(({state:J})=>J==="running").length,we=O.filter(({state:J})=>J==="idle").length;E0(s,o).map(J=>({...J,pct:J.status==="done"?100:0,isRunning:J.status==="running",isHumanGate:J.presentation.isHumanGate})).findIndex(J=>J.itemCount>0&&!U.has(J.id)&&J.zone!=="todo");const _t=s.items.filter(J=>J.claimedBy).reduce((J,Te)=>((J[Te.claimedBy]=J[Te.claimedBy]||[]).push(Te),J),{}),ft=["var(--color-primary)","var(--color-warning)","var(--color-primary)","var(--color-success)","var(--color-danger)"],Me={all:B,attention:ze,running:X,queued:we,done:Z},Pe=[{key:"all",label:"Todos"},{key:"attention",label:"Precisa de atenção"},{key:"running",label:"Em andamento"},{key:"queued",label:"Na fila"},{key:"done",label:"Concluídos"}],mt=w==="webhooks",Le=s.items.find(J=>ee.has(J.stage))??s.items.find(J=>ka(J,s,o)==="blocked")??s.items.find(J=>J.claimedBy&&!U.has(J.stage))??s.items.find(J=>!U.has(J.stage))??s.items[0]??null,kt=Le?fe.find(J=>J.id===Le.stage):null,et=Le?ka(Le,s,o):null,Ma=et==="blocked"?"danger":et==="waiting"?"warning":et==="done"?"success":"info",ul=et==="blocked"?"Examinar bloqueio":et==="waiting"?"Revisar decisão":Le?"Abrir trabalho em foco":"Criar item",Ul=Le?`${Le.description||Le.id} está em ${(kt==null?void 0:kt.name)??Le.stage}. ${Le.claimedBy?`${Le.claimedBy} está responsável por este trabalho.`:"Nenhum responsável declarado."}`:"Nenhum item foi criado neste fluxo. Crie o primeiro item quando houver trabalho supervisionável.";return l.jsxs("div",{className:"app-section-shell min-w-0",children:[l.jsx(sx,{title:"Trabalho",description:`${B} itens · ${ze} atenção`,left:l.jsx(z,{name:"grid",size:20}),right:l.jsxs(l.Fragment,{children:[l.jsxs(Ae,{icon:"cpu",variant:Oe>0?"agent":"info",tone:"soft",children:[Oe," em andamento"]}),l.jsxs(Ae,{icon:"shield",variant:ze>0?Se>0?"error":"amber":"info",tone:"soft",children:[ze," atenção"]}),l.jsxs(F,{variant:ce?"secondary":"ghost",size:"sm",onClick:Ee,className:"h-8 px-2 text-caption",children:[l.jsx(z,{name:"list-three",size:12}),"Observar"]}),l.jsx(e0,{children:({open:J,setOpen:Te})=>l.jsxs(l.Fragment,{children:[l.jsxs(t0,{className:"h-8 px-2 text-caption",onClick:()=>Te(!J),children:[l.jsx(z,{name:"settings",size:12}),"Administração"]}),J?l.jsxs(a0,{align:"end",className:"min-w-48",children:[l.jsx(n0,{children:"Operações do fluxo"}),l.jsxs(Ih,{onClick:()=>{N(!0),Te(!1)},children:[l.jsx(z,{name:"plus",size:12}),"Novo item"]}),l.jsx(l0,{}),l.jsxs(Ih,{onClick:()=>{T("webhooks"),Te(!1)},children:[l.jsx(z,{name:"activity",size:12}),"Configurar webhooks"]})]}):null]})})]})}),l.jsxs("div",{className:"flex min-w-0 flex-1 overflow-hidden",children:[mt?l.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:l.jsxs("div",{className:"flex flex-col gap-3 max-w-2xl",children:[l.jsx("p",{className:"app-section-muted text-xs font-medium",children:"Configure webhooks para receber notificações quando itens forem movidos entre estágios."}),V.map((J,Te)=>l.jsx("div",{className:"app-section-card p-3",children:l.jsx("div",{className:"flex flex-col gap-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ht,{value:J.label??"",onChange:Ue=>Q(Te,"label",Ue.target.value||void 0),placeholder:"Label",className:"app-input-surface flex-1 text-sm px-2 py-1 rounded border-none focus:outline-none focus:ring-2 focus:ring-primary/30"}),l.jsx(F,{onClick:()=>le(Te),className:"app-danger-button text-xs px-2 py-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30","aria-label":"Remover webhook",children:l.jsx(z,{name:"x",size:12})})]})})},J.id)),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(F,{size:"sm",variant:"secondary",onClick:Y,children:"Adicionar webhook"}),l.jsx(F,{size:"sm",onClick:D,children:"Salvar"}),l.jsx(F,{size:"sm",variant:"secondary",onClick:()=>{T(null),te(s.webhooks??[])},children:"Voltar"})]})]})}):l.jsxs("div",{className:"flex min-w-0 flex-1 overflow-y-hidden",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-y-auto p-3 sm:p-4 gap-3",children:[l.jsx(fj,{stages:fe,activeFlow:o,items:s.items}),l.jsx(ar,{className:"min-w-0",tone:Ma,icon:l.jsx(z,{name:et==="blocked"?"shield":et==="waiting"?"clock":"grid",size:20}),title:Le?`Próximo trabalho seguro: ${Le.id}`:"Nenhum trabalho em foco",description:Ul,meta:l.jsxs(l.Fragment,{children:[Le?l.jsx(Ae,{variant:"info",tone:"soft",children:(kt==null?void 0:kt.name)??Le.stage}):null,Le!=null&&Le.claimedBy?l.jsx(Je,{children:Le.claimedBy}):null]}),action:l.jsx(F,{size:"sm",onClick:()=>{Le?h(Le.id):N(!0)},children:ul}),secondaryAction:Le?l.jsx(F,{size:"sm",variant:"secondary",onClick:()=>N(!0),children:"Novo item"}):null}),l.jsx("div",{className:"grid shrink-0 grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Atenção",value:ze,sub:Se>0?`${Se} bloqueado${Se===1?"":"s"}`:"decisão humana",color:ze>0?"var(--color-warning)":"var(--color-text-secondary)",icon:"shield",urgent:ze>0},{label:"Em andamento",value:X,sub:`${Oe} ator${Oe===1?"":"es"} ativo${Oe===1?"":"s"}`,color:"var(--color-primary)",icon:"cpu",pulse:X>0},{label:"Na fila",value:we,sub:"sem responsável",color:"var(--color-text-secondary)",icon:"circle"},{label:"Progresso",value:`${re}%`,sub:`${Z}/${B} concluídos`,color:"var(--color-primary)",icon:"bar-chart"}].map(J=>l.jsx(at,{className:"app-summary-card hover:shadow-sm","data-urgent":J.urgent?"true":"false",children:l.jsxs(lt,{className:"grid gap-0.5 p-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"app-section-muted text-caption font-medium uppercase tracking-wider",children:J.label}),J.icon&&l.jsx(z,{name:J.icon,size:10,style:{color:J.color}})]}),l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:yt("text-lg font-bold tabular-nums",J.pulse&&"animate-pulse"),style:{color:J.color},children:J.value}),J.pulse&&l.jsx("span",{className:"w-1 h-1 rounded-full bg-[var(--color-primary)] animate-pulse"})]}),l.jsx("span",{className:"app-section-muted text-caption",children:J.sub})]})},J.label))}),Object.keys(_t).length>0&&l.jsxs("div",{className:"min-w-0 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-primary)]",children:"Atores em andamento"}),l.jsxs("div",{className:"app-section-muted flex items-center gap-1 text-caption",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-[var(--color-primary)] animate-pulse"}),l.jsxs("span",{children:[Oe," ativo",Oe!==1?"s":""]})]})]}),l.jsx("div",{className:"flex min-w-0 gap-2 overflow-x-auto pb-1 scrollbar-none",children:Object.entries(_t).map(([J,Te],Ue)=>{const rt=Te[0],bt=ua(s,o).find($t=>$t.id===rt.stage),pt=bt?Uu(bt):"Processando",Rt=Te.reduce(($t,Ht)=>Ht.tasks?$t+Ht.tasks.filter(wa=>wa.done).length:$t,0),Tt=Te.reduce(($t,Ht)=>{var wa;return $t+(((wa=Ht.tasks)==null?void 0:wa.length)||0)},0),da=Tt>0?Math.round(Rt/Tt*100):null,Kt=!ee.has(rt.stage)&&!U.has(rt.stage);return l.jsxs("div",{className:yt("app-agent-card p-3 min-w-[160px] flex flex-col gap-1.5 shrink-0 transition-all hover:shadow-sm",Kt&&"animate-agent-breathe"),"data-running":Kt?"true":"false",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-caption font-bold",style:{background:`color-mix(in oklch, ${ft[Ue%ft.length]} 20%, transparent)`,color:ft[Ue%ft.length]},children:J.charAt(0).toUpperCase()}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-xs font-semibold truncate",children:J}),Kt&&l.jsx("span",{className:"w-1 h-1 rounded-full bg-[var(--color-primary)] animate-pulse"})]}),l.jsx("span",{className:"app-section-muted text-caption",children:pt})]})]}),l.jsxs("div",{className:"flex flex-col gap-0.5",children:[da===null?l.jsx("span",{className:"app-section-muted text-caption",children:"Sem progresso declarado"}):l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Ou,{value:da,max:100,size:"xs",className:"flex-1"}),l.jsxs("span",{className:"text-caption tabular-nums font-medium text-[var(--color-text-primary)]",children:[da,"%"]})]}),l.jsxs("span",{className:"app-section-muted text-caption",children:[Te.length," ",Te.length===1?"item":"itens"]})]}),l.jsx("div",{className:yt("text-caption font-medium px-1.5 py-0.5 rounded-full self-start",Kt?"":"bg-muted text-muted-foreground"),style:Kt?{backgroundColor:"#282414",color:"#FFB800"}:void 0,children:Kt?"Em andamento":"Na fila"})]},J)})})]}),l.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-1.5 overflow-x-auto pb-1 [scrollbar-width:thin]",children:l.jsx(Tu,{ariaLabel:"Filtrar trabalho",className:"w-max max-w-none flex-nowrap sm:w-auto sm:max-w-full sm:flex-wrap",children:Pe.map(({key:J,label:Te})=>l.jsx(Mu,{selected:pe===J,count:Me[J],onClick:()=>G(J),children:Te},J))})}),l.jsx("div",{className:"app-section-card flex min-w-0 flex-1 flex-col overflow-hidden",children:l.jsx(sj,{workflow:s,activeFlow:o,onSelectItem:h,onDropItem:me,allowDrop:oe,specRefreshKey:c,filter:pe,onItemDecided:u,onOpenSpec:d})})]}),l.jsx("div",{className:yt("app-section-card shrink-0 overflow-y-auto transition-all duration-300 ease-in-out",ce?"w-80 border-l opacity-100":"w-0 border-l-0 opacity-0 overflow-hidden"),children:l.jsx(cj,{workflow:s,activeFlow:o,onSelectItem:h})})]}),_&&l.jsx(pj,{item:_,workflow:s,activeFlow:o,specs:x,onClose:()=>h(null),onItemMoved:u,onOpenSpec:d})]}),l.jsx(Pp,{open:g,onClose:()=>N(!1),onSubmit:b,title:"Adicionar Item",label:"Nome do item",placeholder:"ex: my-feature",submitLabel:"Criar"}),l.jsx(Du,{open:j,onClose:()=>A(!1),onConfirm:k,title:"Excluir Item",message:`Tem certeza que deseja excluir ${_==null?void 0:_.id}?`,confirmLabel:"Excluir",cancelLabel:"Cancelar",variant:"danger"}),l.jsx(ns,{open:P!==null,onClose:()=>ie(null),title:"Validação necessária",actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{onClick:()=>ie(null),className:"inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-primary/30 text-sm px-4 py-2 rounded-[var(--radius-sm)] border border-border bg-transparent hover:bg-muted text-foreground cursor-pointer",children:"Cancelar"}),l.jsx(F,{onClick:ue,disabled:!(P!=null&&P.pendingChecks.every(Boolean)),className:"app-primary-button inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-primary/30 text-sm px-4 py-2 rounded-[var(--radius-sm)] border border-transparent cursor-pointer disabled:opacity-50",children:"Mover"})]}),children:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("p",{className:"app-section-muted text-xs mb-1",children:"Antes de mover, confirme os itens abaixo:"}),P==null?void 0:P.pendingChecks.map((J,Te)=>{const Ue=s.stages.find(bt=>bt.id===((_==null?void 0:_.stage)??"")),rt=(Ue==null?void 0:Ue.validate)??[];return l.jsx(as,{checked:J,label:rt[Te]??`Check ${Te+1}`,onChange:bt=>{ie(pt=>{if(!pt)return pt;const Rt=[...pt.pendingChecks];return Rt[Te]=bt.target.checked,{...pt,pendingChecks:Rt}})}},Te)})]})})]})}const bj={l1:{title:"Contexto Principal",icon:"book",desc:"Arquivos fundamentais do projeto"},l2:{title:"Foco e Especificação",icon:"target",desc:"Foco atual e especificação ativa"},l3:{title:"Sinais e Estado",icon:"activity",desc:"Alertas, eventos e estado da sessão"},l4:{title:"Restrições e Regras",icon:"shield",desc:"Regras compiladas do sistema"}};function yj(){const[s,o]=v.useState(!1);return{copy:v.useCallback(async u=>{try{await navigator.clipboard.writeText(u),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[]),copied:s}}function Di({layerKey:s,children:o,defaultOpen:c=!1}){const[u,d]=v.useState(c),m=bj[s];return l.jsxs(ir,{open:u,onOpenChange:d,children:[l.jsxs(or,{className:"flex items-center gap-2.5 w-full text-left px-3 py-2.5 rounded-[var(--radius-sm)] text-sm transition-all duration-150 hover:bg-primary/5 active:scale-[0.98]",style:{color:"var(--color-text-primary)"},children:[l.jsx(z,{name:m.icon,size:16,className:"text-primary shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"font-semibold text-sm",children:m.title}),l.jsx("div",{className:"text-xs truncate",style:{color:"var(--color-text-secondary)"},children:m.desc})]}),l.jsx(z,{name:"chevron-down",size:16,style:{color:"var(--color-text-secondary)"},className:u?"rotate-180":""})]}),l.jsx(cr,{className:"overflow-hidden transition-all duration-200",children:l.jsx("div",{className:"px-3 pb-3 pt-1",children:o})})]})}function jj({files:s}){return l.jsx("div",{className:"space-y-3",children:s.map(o=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(z,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:o.path})]}),o.content?l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Ll,{content:o.content})}):l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"(vazio)"})]},o.path))})}function Nj({l2:s}){return l.jsxs("div",{className:"space-y-3",children:[s.focus&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(z,{name:"star",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:".letra/focus.md"}),s.focus.specName&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium",style:{backgroundColor:"var(--color-primary)",color:"var(--color-primary)"},children:s.focus.specName})]}),s.focus.content?l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Ll,{content:s.focus.content})}):l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"(sem conteúdo de foco)"})]}),s.spec&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(z,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:s.spec.path})]}),l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Ll,{content:s.spec.content})})]}),!s.focus&&!s.spec&&l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"Nenhum foco ou spec ativo no momento."})]})}function Sj({l3:s}){return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex gap-2 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs",style:{backgroundColor:"var(--color-bg-surface)"},children:[l.jsx(z,{name:"alert-triangle",size:12,className:"text-amber-500"}),l.jsxs("span",{children:[s.alertCount," alerta(s) ativo(s)"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs",style:{backgroundColor:"var(--color-bg-surface)"},children:[l.jsx(z,{name:"activity",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsxs("span",{children:[s.sessionEventCount," evento(s) na sessão"]})]})]}),s.alerts.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--color-text-secondary)"},children:"Alertas recentes"}),l.jsx("div",{className:"space-y-1",children:s.alerts.map(o=>l.jsxs("div",{className:"flex items-start gap-2 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs",style:{backgroundColor:"var(--color-bg-surface)"},children:[l.jsx(z,{name:"alert-circle",size:12,style:{color:o.severity==="alta"?"var(--color-danger)":"var(--color-warning)"}}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"font-medium",children:o.id}),l.jsx("div",{style:{color:"var(--color-text-secondary)"},children:o.message})]})]},o.id))})]})]})}function wj({l4:s}){return l.jsxs("div",{className:"space-y-3",children:[s.constraintsContent&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(z,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:".letra/constraints.md"})]}),l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Ll,{content:s.constraintsContent})})]}),s.glossaryContent&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(z,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:".letra/glossary.md"})]}),l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Ll,{content:s.glossaryContent})})]}),!s.constraintsContent&&!s.glossaryContent&&l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"Nenhuma regra ou restrição adicional."})]})}function Cj(){const[s,o]=v.useState(null),[c,u]=v.useState(!0),{copy:d,copied:m}=yj();return v.useEffect(()=>{fetch("/api/harness-viewer").then(h=>h.ok?h.json():Promise.reject()).then(h=>{o(h),u(!1)}).catch(()=>{u(!1)})},[]),c?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-sm animate-pulse",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):s?l.jsxs("div",{className:"flex flex-col min-h-0 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b shrink-0",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Composição da Configuração"}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Camadas do prompt compilado para o agente"})]}),l.jsxs(F,{type:"button",onClick:()=>{const h=JSON.stringify(s,null,2);d(h)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs transition-all duration-150 hover:bg-primary/10 active:scale-95",style:{backgroundColor:"var(--color-bg-surface)"},"aria-label":"Copiar dados da configuração",children:[l.jsx(z,{name:m?"check":"copy",size:12}),m?"Copiado!":"Copiar"]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:[l.jsx(Di,{layerKey:"l1",defaultOpen:!0,children:l.jsx(jj,{files:s.layers.l1})}),l.jsx(Di,{layerKey:"l2",defaultOpen:!0,children:l.jsx(Nj,{l2:s.layers.l2})}),l.jsx(Di,{layerKey:"l3",children:l.jsx(Sj,{l3:s.layers.l3})}),l.jsx(Di,{layerKey:"l4",children:l.jsx(wj,{l4:s.layers.l4})})]})]}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Não foi possível carregar os dados da configuração."})})}const zj={read_code:"Ler código",write_code:"Escrever código",run_tests:"Executar testes",write_spec:"Escrever especificações",generate_doc:"Gerar documentação",comment_pr:"Comentar PR",suggest_changes:"Sugerir alterações",scan_dependencies:"Escaneiar dependências",report_findings:"Reportar vulnerabilidades",create_pr:"Criar PR",assign_reviewers:"Atribuir revisores"},Aj={analyst:"search",builder:"code",reviewer:"info",security:"shield","pr-bot":"user"};function Ej(){const[s,o]=v.useState([]),[c,u]=v.useState(!0);return v.useEffect(()=>{fetch("/api/harness/roles").then(d=>d.json()).then(d=>{Array.isArray(d)&&o(d),u(!1)}).catch(()=>{o([]),u(!1)})},[]),c?l.jsx("div",{className:"flex h-full items-center justify-center p-6",children:l.jsx("p",{className:"animate-pulse text-sm text-[var(--color-text-secondary)]",children:"Carregando papéis..."})}):s.length===0?l.jsx("div",{className:"flex h-full items-center justify-center p-6 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Nenhum papel configurado no harness."})}):l.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Papéis do Harness"}),l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Agentes disponíveis no fluxo e suas capacidades."})]}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:s.map(d=>l.jsx("div",{className:"app-section-card p-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--color-bg-sunken)]",children:l.jsx(z,{name:Aj[d.id]??"user",size:16,className:"text-[var(--color-text-secondary)]"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"text-sm font-medium",children:d.label}),l.jsx(Ae,{variant:"info",tone:"soft",className:"text-[10px]",children:d.id})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:d.description}),l.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:(d.allowedStages??[]).map(m=>l.jsx(Ae,{variant:"amber",tone:"soft",className:"text-[10px]",children:m},m))}),(d.capabilities??[]).length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"mb-1 text-[10px] font-medium uppercase text-[var(--color-text-secondary)]",children:"Capacidades"}),l.jsx("div",{className:"flex flex-wrap gap-1",children:(d.capabilities??[]).map(m=>l.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-[var(--color-bg-sunken)] px-1.5 py-0.5 text-[10px] text-[var(--color-text-secondary)]",children:zj[m]||m},m))})]})]})]})},d.id))})]})}const kj=`# Spec: {{name}}
|
|
202
|
+
|
|
203
|
+
> Updated: {{date}}
|
|
204
|
+
|
|
205
|
+
## Outcome
|
|
206
|
+
|
|
207
|
+
O que o usuário consegue fazer quando isso estiver pronto.
|
|
208
|
+
|
|
209
|
+
## Constraints
|
|
210
|
+
|
|
211
|
+
- Limitação técnica ou de negócio
|
|
212
|
+
|
|
213
|
+
## Exclusions
|
|
214
|
+
|
|
215
|
+
O que explicitamente NÃO está neste escopo.
|
|
216
|
+
|
|
217
|
+
## Acceptance Criteria
|
|
218
|
+
|
|
219
|
+
- [ ] **Critério 1**: Descrição binária (passa/falha).
|
|
220
|
+
- [ ] **Critério 2**: Descrição binária (passa/falha).
|
|
221
|
+
|
|
222
|
+
## Context
|
|
223
|
+
|
|
224
|
+
Por que estamos construindo isso. Trade-offs considerados. Decisões anteriores relevantes.
|
|
225
|
+
`;function Tj(s){const o=s.split(`
|
|
226
|
+
`),c=[];let u=!1;return o.forEach((d,m)=>{if(/^## Acceptance Criteria/.test(d))u=!0;else if(/^## /.test(d)&&u)u=!1;else if(u){const h=d.match(/^\s*-\s+\[(\s|x)\]\s+(.+)/i);h&&c.push({text:h[2],checked:h[1].toLowerCase()==="x",line:m})}}),c}function Mj(s){const o=s.match(/## Outcome\s+([\s\S]*?)(?=\n## |$)/);return o?o[1].replace(/\*\*/g,"").replace(/\n+/g," ").trim():""}function Dj(s){const o=[],c=["Outcome","Constraints","Exclusions","Acceptance Criteria","Context"];for(const d of c)new RegExp(`## ${d}`).test(s)||o.push({type:"error",msg:`Seção obrigatória ausente: ## ${d}`});const u=s.match(/## Acceptance Criteria\s+([\s\S]*?)(?=\n## |$)/);return u&&[...u[1].matchAll(/-\s+\[(\s|x)\]\s+/g)].length===0&&o.push({type:"warning",msg:"Critérios de aceite sem itens de checklist"}),s.length>3e3&&o.push({type:"warning",msg:"Especificação excede 3000 caracteres; considere manter enxuta"}),{id:"",issues:o,valid:o.filter(d=>d.type==="error").length===0}}function Oj(s,o,c){const u=s.split(`
|
|
227
|
+
`),m=u[o].match(/^(\s*-\s+\[)(\s|x)(\]\s+.*)/i);return m&&(u[o]=`${m[1]}${c?"x":" "}${m[3]}`),u.join(`
|
|
228
|
+
`)}function fp(s,o){const c=new Date().toISOString().split("T")[0];return s.replace(/(# Spec:?)\s*.*/,`$1 ${o}`).replace(/\{\{date\}\}/g,c)}function gu(s){const o=s.match(/> Updated:\s*(\d{4}-\d{2}-\d{2})/);return o?o[1]:""}function _j(s){if(!s)return"";const[o,c,u]=s.split("-");return`${u}/${c}/${o}`}function Rj(s){return s?s.valid?s.issues.some(o=>o.type==="warning")?"warning":"success":"danger":"neutral"}function Lj({tone:s}){return s==="danger"?l.jsx(z,{name:"x",size:14,className:"text-[var(--color-danger)]"}):s==="warning"?l.jsx(z,{name:"alert-triangle",size:14,className:"text-[var(--color-warning)]"}):s==="success"?l.jsx(z,{name:"check",size:14,className:"text-[var(--color-success)]"}):l.jsx(z,{name:"circle",size:14,className:"text-[var(--color-text-secondary)]"})}function Hj({spec:s,selected:o,validation:c,onSelect:u,onValidate:d}){const m=Rj(c),h=Mj(s.content),x=_j(gu(s.content)),y=(c==null?void 0:c.issues.filter(N=>N.type==="error").length)??0,g=(c==null?void 0:c.issues.filter(N=>N.type==="warning").length)??0;return l.jsx(F,{type:"button",variant:"ghost",onClick:u,onContextMenu:N=>{N.preventDefault(),d()},"aria-pressed":o,className:yt("h-auto w-full justify-start rounded-[var(--radius-sm)] border border-transparent px-3 py-3 text-left","hover:border-[var(--color-border)] hover:bg-[var(--surface-hover)]",o&&"border-[var(--color-border)] bg-[var(--surface-selected)] shadow-sm"),children:l.jsxs("span",{className:"grid min-w-0 flex-1 gap-2",children:[l.jsxs("span",{className:"flex min-w-0 items-start gap-2",children:[l.jsx("span",{className:"mt-0.5 shrink-0",children:l.jsx(Lj,{tone:m})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-sm font-semibold text-[var(--color-text-primary)]",children:s.id}),h?l.jsx("span",{className:"mt-1 line-clamp-2 block text-xs font-normal leading-snug text-[var(--color-text-secondary)]",children:h}):null]})]}),l.jsxs("span",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[c&&c.issues.length>0?l.jsxs(Ae,{variant:c.valid?"amber":"error",tone:"soft",children:[y," erros · ",g," avisos"]}):c?l.jsx(Ae,{variant:"success",children:"Válida"}):l.jsx(Ae,{variant:"info",tone:"outline",children:"Não validada"}),x?l.jsx("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:x}):null]})]})})}function Uj(){var Ee,xe;const{toast:s}=nr(),[o,c]=v.useState([]),[u,d]=v.useState(null),[m,h]=v.useState(""),[x,y]=v.useState("all"),[g,N]=v.useState(!1),[j,A]=v.useState(""),[w,T]=v.useState(new Map),V=v.useRef(new Set),te=v.useCallback(()=>{fetch("/api/specs").then(_=>_.json()).then(_=>{Array.isArray(_)&&c(_)}).catch(()=>{})},[]);v.useEffect(()=>{te()},[te]),v.useEffect(()=>{if(o.length===0)return;const _=new Map(w);let se=!1;for(const oe of o)if(!V.current.has(oe.id)){const ye=Dj(oe.content);ye.id=oe.id,_.set(oe.id,ye),V.current.add(oe.id),se=!0}se&&T(_),!u&&!g&&d(o[0].id)},[o,u,g,w]);const P=o.find(_=>_.id===u),ie=v.useMemo(()=>P?Tj(P.content):[],[P]),pe=ie.filter(_=>_.checked).length,ce=[...o].sort((_,se)=>{const oe=gu(_.content),ye=gu(se.content);return!oe&&!ye?_.id.localeCompare(se.id):oe?ye?ye.localeCompare(oe):-1:1}).filter(_=>{if(m){const oe=m.toLowerCase();if(!_.id.toLowerCase().includes(oe)&&!_.content.toLowerCase().includes(oe))return!1}const se=w.get(_.id);switch(x){case"errors":return se&&!se.valid;case"warnings":return se==null?void 0:se.issues.some(oe=>oe.type==="warning");case"valid":return se==null?void 0:se.valid;default:return!0}});function de(_){d(_),N(!1)}function ee(_){fetch(`/api/specs/${_}/validate`,{method:"POST"}).then(se=>se.json()).then(se=>{T(ye=>new Map(ye).set(_,se));const oe=se.issues.filter(ye=>ye.type==="error").length;oe===0?s("Spec válida","success"):s(`${oe} erro(s) encontrado(s)`,"error")})}function U(){if(!j.trim())return;const _=j.trim().toLowerCase().replace(/\s+/g,"-"),se=fp(kj,_);fetch("/api/specs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:_,content:se})}).then(oe=>oe.json()).then(oe=>{oe&&!oe.error&&(N(!1),A(""),d(_),te())})}function fe(_){return _==="all"?o.length:o.filter(se=>{const oe=w.get(se.id);switch(_){case"errors":return oe&&!oe.valid;case"warnings":return oe==null?void 0:oe.issues.some(ye=>ye.type==="warning");case"valid":return oe==null?void 0:oe.valid;default:return!0}}).length}return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden lg:flex-row",children:[l.jsxs("aside",{className:"app-surface-panel flex max-h-[46svh] w-full shrink-0 flex-col overflow-hidden border-b border-l-0 border-r-0 border-t-0 lg:max-h-none lg:w-[24rem] lg:border-b-0 lg:border-r",children:[l.jsxs("div",{className:"grid shrink-0 gap-3 border-b border-border p-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Especificações"}),l.jsx("p",{className:"text-xs text-[var(--color-text-secondary)]",children:"Outcomes, constraints e critérios aprovados."})]}),l.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>{N(!0),d(null)},children:[l.jsx(z,{name:"plus",size:14}),"Nova"]})]}),l.jsx(ht,{placeholder:"Buscar especificações...",value:m,onChange:_=>h(_.target.value),"aria-label":"Buscar especificações"}),l.jsx("div",{className:"overflow-x-auto",tabIndex:0,children:l.jsx(Tu,{ariaLabel:"Filtrar especificações",className:"w-max flex-nowrap lg:w-full",children:[{id:"all",label:"Todas"},{id:"errors",label:"Erros"},{id:"warnings",label:"Avisos"},{id:"valid",label:"Válidas"}].map(_=>l.jsx(Mu,{selected:x===_.id,count:fe(_.id),onClick:()=>y(_.id),className:"justify-center lg:flex-1",title:_.id==="errors"?"Especificações com erro de validação":_.id==="warnings"?"Especificações com avisos":_.id==="valid"?"Especificações válidas":"Todas as especificações",children:_.label},_.id))})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-2",tabIndex:0,children:[g?l.jsxs("div",{className:"mb-2 grid gap-2 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-surface)] p-3",children:[l.jsx(ht,{placeholder:"Nome da especificação (ex: fluxo-de-autenticacao)",value:j,onChange:_=>A(_.target.value),"aria-label":"Nome da nova especificação",autoFocus:!0}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(F,{size:"sm",onClick:U,children:"Criar"}),l.jsx(F,{size:"sm",variant:"ghost",onClick:()=>N(!1),children:"Cancelar"})]})]}):null,l.jsx("div",{className:"grid gap-1",children:ce.map(_=>l.jsx(Hj,{spec:_,selected:u===_.id,validation:w.get(_.id),onSelect:()=>de(_.id),onValidate:()=>ee(_.id)},_.id))}),ce.length===0&&!g?l.jsx("p",{className:"px-3 py-4 text-center text-sm text-[var(--color-text-secondary)]",children:m?"Nenhuma especificação encontrada.":"Nenhuma especificação registrada."}):null]})]}),l.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:P?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid shrink-0 gap-3 border-b border-border px-4 py-3 lg:px-6",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(Ae,{variant:"info",tone:"outline",children:[ie.length," critérios"]}),l.jsxs(Ae,{variant:pe===ie.length&&ie.length>0?"success":"amber",children:[pe,"/",ie.length," concluídos"]}),l.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>ee(P.id),children:[l.jsx(z,{name:"check",size:14}),"Validar"]})]}),w.get(P.id)?l.jsxs("div",{className:"flex flex-wrap gap-2",children:[(Ee=w.get(P.id))==null?void 0:Ee.issues.map((_,se)=>l.jsxs(Ae,{variant:_.type==="error"?"error":"amber",tone:"soft",children:[_.type==="error"?"Erro":"Aviso"," ·"," ",_.msg]},`${_.msg}-${se}`)),((xe=w.get(P.id))==null?void 0:xe.issues.length)===0?l.jsx(Ae,{variant:"success",children:"Especificação válida"}):null]}):null,ie.length>0?l.jsx("div",{className:"grid max-h-40 gap-2 overflow-y-auto pr-1",tabIndex:0,children:ie.map(_=>l.jsx(as,{checked:_.checked,label:_.text,onChange:se=>{const oe=Oj(P.content,_.line,se.target.checked);fetch(`/api/specs/${P.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:oe})}).then(()=>te())}},_.line))}):null]}),l.jsx(vu,{file:P.id,initialContent:P.content,onSave:async _=>{const se=fp(_,P.id);await fetch(`/api/specs/${P.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:se})}),te()},title:P.id,description:"Especificação de funcionalidade: define objetivo, restrições, critérios de aceite e contexto."},P.id)]}):l.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Selecione uma especificação ou crie uma nova."})})})]})}const Bj=[{title:"Verdade do workspace",sources:[{id:"context.md",label:"Contexto do workspace",description:"Propósito, estado atual, domínio e restrições em vigor.",icon:"context"},{id:"glossary.md",label:"Glossário",description:"Linguagem comum para decisões, specs e comunicação.",icon:"search"},{id:"decisions",label:"Decisões",description:"Registro de escolhas relevantes e seus motivos.",icon:"list-three"}]},{title:"Regras de governança",sources:[{id:"constitution.md",label:"Constituição",description:"Regras não negociáveis de produto, arquitetura e workflow.",icon:"star"},{id:"harness",label:"Harness",description:"Autoridade versionada que define fluxos, gates e agentes.",icon:"cpu"},{id:"roles",label:"Papéis",description:"Quem são os agentes e suas capacidades no fluxo.",icon:"user"}]},{title:"Trabalho especificado",sources:[{id:"specs",label:"Especificações",description:"Outcomes, constraints e critérios de aceite aprovados.",icon:"specs"}]}],mp={"context.md":{description:"Fonte de verdade operacional do workspace: propósito, domínio, estado atual e restrições."},"constitution.md":{description:"Regras fundamentais que governam decisões, implementação, supervisão humana e regressão."},"glossary.md":{description:"Termos e definições para manter a linguagem do produto consistente."},decisions:{description:"Registro de decisões e seus contextos operacionais."},specs:{description:"Especificações ativas do workspace e seus critérios de aceite."},harness:{description:"Autoridade versionada que define como o workspace deve operar."},roles:{description:"Agentes disponíveis no fluxo e suas capacidades."}};function ou(s){const o=s.match(/^#\s+(.+)/m);return o?o[1]:""}function qj(s){const o=s.match(/^(\d{4}-\d{2}-\d{2})/);if(o){const[c,u,d]=o[1].split("-");return`${d}/${u}/${c}`}return s.replace(/\.md$/,"").replace(/-/g," ")}function Gj({entry:s,selected:o,onSelect:c}){return l.jsxs(F,{type:"button",variant:"ghost",onClick:c,role:"tab","aria-selected":o,className:yt("h-auto min-w-[15rem] flex-1 items-start justify-start gap-2.5 rounded-[var(--radius-sm)] border border-transparent px-3 py-2.5 text-left md:min-w-0","hover:border-[var(--color-border)] hover:bg-[var(--surface-hover)]",o&&"border-[var(--color-border)] bg-[var(--surface-selected)] text-[var(--color-primary)] shadow-sm"),children:[l.jsx(z,{name:s.icon,size:16,className:yt("mt-0.5 shrink-0",o?"text-[var(--color-primary)]":"text-[var(--color-text-secondary)]")}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block text-sm font-medium leading-tight",children:s.label}),l.jsx("span",{className:yt("mt-1 line-clamp-2 block text-xs font-normal leading-snug",o?"text-[var(--color-primary)]":"text-[var(--color-text-secondary)]"),children:s.description})]})]})}function Vj({initialTab:s="context.md"}){var A;const[o,c]=v.useState(s),[u,d]=v.useState(""),[m,h]=v.useState([]),[x,y]=v.useState(null),[g,N]=v.useState(!0);v.useEffect(()=>{c(s),y(null)},[s]),v.useEffect(()=>{if(N(!0),o==="specs"||o==="harness"||o==="roles"){N(!1);return}if(o==="decisions"){fetch("/api/context?file=decisions").then(w=>w.ok?w.json():Promise.reject()).then(w=>{Array.isArray(w)&&h(w),N(!1)}).catch(()=>{h([]),N(!1)});return}fetch(`/api/context?file=${o}`).then(w=>w.ok?w.text():Promise.reject()).then(w=>{d(w||`# ${o}
|
|
229
|
+
|
|
230
|
+
Arquivo vazio.`),N(!1)}).catch(()=>{d(`# ${o}
|
|
231
|
+
|
|
232
|
+
Arquivo não encontrado ou indisponível.`),N(!1)})},[o]);const j=m.find(w=>w.name===x);return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden md:flex-row",children:[l.jsxs("aside",{className:"app-surface-panel flex max-h-[42svh] w-full shrink-0 flex-col overflow-hidden border-b border-l-0 border-r-0 border-t-0 md:max-h-none md:w-80 md:border-b-0 md:border-r",children:[l.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-4",children:[l.jsxs("h1",{className:"flex items-center gap-2 text-sm font-semibold",children:[l.jsx(z,{name:"book",size:16,className:"text-[var(--color-primary)]"}),"Biblioteca de governança"]}),l.jsx("p",{className:"mt-1 text-xs leading-relaxed text-[var(--color-text-secondary)]",children:"Contexto, regras e specs que explicam o que pode ser feito e por quê."})]}),l.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto overflow-y-hidden p-3 md:flex-col md:gap-4 md:overflow-x-hidden md:overflow-y-auto",children:Bj.map(w=>l.jsxs("section",{className:"flex min-w-[17rem] flex-col gap-1 md:min-w-0",children:[l.jsx("h3",{className:"px-1 text-xs font-semibold uppercase text-[var(--color-text-secondary)]",children:w.title}),l.jsx("div",{role:"tablist","aria-label":w.title,children:w.sources.map(T=>l.jsx(Gj,{entry:T,selected:o===T.id,onSelect:()=>{c(T.id),y(null)}},T.id))})]},w.title))}),o==="decisions"&&m.length>0?l.jsxs("div",{className:"shrink-0 border-t border-border",children:[l.jsxs("h3",{className:"flex items-center gap-1.5 px-4 py-2 text-xs font-semibold uppercase text-[var(--color-text-secondary)]",children:[l.jsx(z,{name:"list-three",size:14}),"Decisões (",m.length,")"]}),l.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto px-2 pb-2 md:max-h-64",children:m.map(w=>l.jsxs(F,{type:"button",variant:"ghost",onClick:()=>y(w.name),className:yt("h-auto w-full justify-start gap-2 rounded-[var(--radius-sm)] px-3 py-2 text-left text-sm","hover:bg-[var(--surface-hover)]",x===w.name&&"bg-[var(--surface-selected)] text-[var(--color-primary)]"),children:[l.jsx(z,{name:"chevron-right",size:14,className:yt("shrink-0",x===w.name?"text-[var(--color-primary)]":"text-[var(--color-text-secondary)]")}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block text-xs text-[var(--color-text-secondary)]",children:qj(w.name)}),l.jsx("span",{className:"block truncate",children:ou(w.content)||w.name})]})]},w.name))})]}):null]}),l.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:g?l.jsx("div",{className:"flex h-full animate-fade-in items-center justify-center",children:l.jsx("p",{className:"animate-pulse text-sm text-[var(--color-text-secondary)]",children:"Carregando..."})}):o==="harness"?l.jsx(Cj,{}):o==="roles"?l.jsx(Ej,{}):o==="specs"?l.jsx(Uj,{}):o==="decisions"&&j?l.jsx(vu,{file:`decisions/${j.name}`,initialContent:j.content,onSave:async w=>{await fetch(`/api/context?file=decisions/${j.name}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:w})});const V=await(await fetch("/api/context?file=decisions")).json();Array.isArray(V)&&h(V)},title:ou(j.content)||j.name,description:mp.decisions.description},`${o}-${x}`):o==="decisions"?l.jsx("div",{className:"flex h-full animate-fade-in items-center justify-center p-6 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Selecione uma decisão para visualizar."})}):l.jsx(vu,{file:o,initialContent:u,onSave:async w=>{await fetch(`/api/context?file=${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:w})})},title:ou(u)||o,description:(A=mp[o])==null?void 0:A.description},o)})]})}function Yj(s){return{item:"Item",spec:"Especificação",ac:"Critério",gate:"Aprovação",workspace:"Ambiente",execution:"Execução",artifact:"Artefato"}[s]||s}const Qj={ac_done:"Critério concluído",ac_complete:"Critério concluído",item_move:"Item movido",item_release:"Item liberado",spec_create:"Especificação criada",spec_update:"Especificação atualizada",validate:"Validação",diagnose:"Diagnóstico",health_scan:"Verificação de saúde",health_ack:"Alerta reconhecido",health_dismiss:"Alerta descartado",focus_set:"Foco definido",focus_sync:"Foco sincronizado",focus_clear:"Foco limpo",decision:"Decisão registrada",sitrep:"Situação atualizada",system:"Automação",manual:"Ação manual",session_end:"Sessão encerrada",agent_direction_read:"Direção consultada",agent_validation_run:"Validação executada",agent_ac_completion_requested:"Conclusão solicitada",agent_transition_requested:"Transição solicitada",agent_operation_rejected:"Operação rejeitada",flow_move:"Movimento no fluxo",flow_init:"Fluxo inicializado",flow_import:"Fluxo importado",flow_export:"Fluxo exportado",harness_load:"Configuração carregada",mcp_serve:"MCP iniciado",workspace_init:"Ambiente inicializado",workspace_switch:"Ambiente alternado"};function cu(s){return Qj[s]||s}const Xj=[{label:"Todos",value:""},{label:"Humano",value:"human"},{label:"Agente",value:"flow"},{label:"Sistema",value:"system"},{label:"Execução",value:"execution"}];function hp(s){const o=new Date(s),u=Math.floor((new Date().getTime()-o.getTime())/864e5);return u===0?{label:"Hoje",order:0}:u===1?{label:"Ontem",order:1}:u<=7?{label:"Esta semana",order:2}:u<=30?{label:"Este mês",order:3}:{label:"Mais antigo",order:4}}function pp(s){try{return new Date(s).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}catch{return s}}function uu(s){try{return new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return s}}function xp(s){var c,u;if(s.kind!=="system")return null;const o=s.correlationId||((c=s.details)==null?void 0:c.actionId);return o?`${o}:${((u=s.details)==null?void 0:u.outcome)||"unknown"}`:null}function vp(s){return s==="succeeded"?"success":s==="failed"||s==="blocked"?"amber":"info"}function Zj(s){return s.status==="failed"||s.status==="blocked"?"error":s.status==="succeeded"?"success":s.kind==="system"?"info":s.kind==="human"?"default":"agent"}function Kj(s){return s.status==="failed"||s.status==="blocked"?"circle-x":s.status==="succeeded"?"circle-check":s.kind==="system"?"activity":s.kind==="human"?"user":"bot"}function cn(s,o){var u;const c=(u=s.details)==null?void 0:u[o];return typeof c=="string"&&c.trim()?c.trim():null}function bu(s){return Yj(s)}function $j(s){const o=[];s.subject&&o.push({label:bu(s.subject.type),value:s.subject.id,tone:"info"});const c=cn(s,"decisionFile");c&&o.push({label:"Decisão",value:c,tone:"info"});const u=cn(s,"path");return u&&o.push({label:"Arquivo",value:u,tone:"info"}),o}function Jj(s){var c,u;const o=cn(s,"path")??cn(s,"decisionFile");return{who:s.actor.label,what:s.summary||s.action,where:((c=s.subject)==null?void 0:c.id)||o||cn(s,"source")||"Workspace",result:cn(s,"outcome")||((u=s.details)==null?void 0:u.effect)||"Registrado como evidência",why:s.reason||cn(s,"trigger")||null,evidence:$j(s)}}function Wj(){var le;const[s,o]=v.useState([]),[c,u]=v.useState({kinds:{},statuses:{},sources:{},actions:{}}),[d,m]=v.useState(0),[h,x]=v.useState(1),[y,g]=v.useState(!0),[N,j]=v.useState(null),[A,w]=v.useState(""),[T,V]=v.useState(""),[te,P]=v.useState(""),[ie,pe]=v.useState(""),[G,ce]=v.useState(""),[de,ee]=v.useState(!1),[U,fe]=v.useState(null),[Ee,xe]=v.useState(!1),[_,se]=v.useState(new Set),[oe,ye]=v.useState(new Set(["Hoje","Ontem"])),E=50;v.useEffect(()=>{const B=setTimeout(()=>V(A),300);return()=>clearTimeout(B)},[A]);const $=v.useCallback(async B=>{g(!0),j(null);try{const O=new URLSearchParams;T&&O.set("q",T),te&&O.set("action",te),G&&O.set("since",G),de&&O.set("debug","true"),O.set("page",String(B)),O.set("limit",String(E));const Z=await fetch(`/api/log?${O}`);if(!Z.ok)throw new Error(`HTTP ${Z.status}`);const re=await Z.json();o(re.items||[]),u(re.facets||{kinds:{},statuses:{},sources:{},actions:{}}),m(re.total||0),x(re.page||1)}catch(O){j(O instanceof Error?O.message:"Falha ao carregar log"),o([]),m(0)}finally{g(!1)}},[T,te,G,de]);v.useEffect(()=>{x(1)},[T,te,ie,G,de]),v.useEffect(()=>{$(h)},[$,h]),v.useEffect(()=>{xe(!1)},[U==null?void 0:U.id]);const me=v.useMemo(()=>{const B=ie?s.filter(re=>re.kind===ie):s,O=[];let Z=0;for(;Z<B.length;){const re=xp(B[Z]);if(re){const Oe=[B[Z]];let ve=Z+1;for(;ve<B.length&&xp(B[ve])===re;)Oe.push(B[ve]),ve++;Oe.length>1?_.has(re)?O.push(...Oe):O.push({...Oe[0],_noiseCount:Oe.length,_noiseKey:re}):O.push(Oe[0]),Z=ve}else O.push(B[Z]),Z++}return O},[s,ie,_]),ue=v.useMemo(()=>{const B=new Map;for(const Z of me){const{label:re}=hp(Z.timestamp),Oe=B.get(re)||[];Oe.push(Z),B.set(re,Oe)}const O={Hoje:0,Ontem:1,"Esta semana":2,"Este mês":3};return Array.from(B.entries()).map(([Z,re])=>({label:Z,entries:re,order:O[Z]??4})).sort((Z,re)=>Z.order-re.order)},[me]),k=v.useMemo(()=>{const B=s.length,O=s.filter(ze=>ze.kind==="system").length,Z=s.filter(ze=>ze.kind==="human").length,re=s.filter(ze=>ze.kind==="execution"||ze.kind==="flow").length,Oe=s.filter(ze=>hp(ze.timestamp).label==="Hoje").length,ve=s.filter(ze=>ze.status==="succeeded").length,Se=s.filter(ze=>ze.status==="failed").length;return{totalEvents:B,systemEvents:O,humanEvents:Z,agentEvents:re,todayEvents:Oe,succeededEvents:ve,failedEvents:Se}},[s]),b=Math.ceil(d/E),D=U?Jj(U):null;function Y(B){se(O=>{const Z=new Set(O);return Z.has(B)?Z.delete(B):Z.add(B),Z})}function Q(B){ye(O=>{const Z=new Set(O);return Z.has(B)?Z.delete(B):Z.add(B),Z})}return N?l.jsxs("div",{className:"app-section-shell items-center justify-center gap-3 p-12",children:[l.jsx(z,{name:"alert-circle",size:24,style:{color:"var(--color-danger)"}}),l.jsx("p",{className:"app-section-muted text-sm",children:N}),l.jsxs(F,{variant:"secondary",size:"sm",onClick:()=>$(1),children:[l.jsx(z,{name:"check",size:12}),"Tentar novamente"]})]}):l.jsxs("div",{className:"app-section-shell",children:[l.jsx(sr,{open:!!U,onOpenChange:B=>{B||fe(null)},children:l.jsx(rr,{side:"right",className:"w-full sm:max-w-3xl lg:max-w-4xl",children:U&&l.jsxs(l.Fragment,{children:[l.jsxs(Hi,{className:"items-start gap-4",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[l.jsx(Ae,{variant:vp(U.status),tone:"soft",className:"text-caption uppercase",children:cu(U.action)}),l.jsx(Ae,{variant:U.kind==="human"||U.kind==="system"?"info":"agent",tone:"soft",children:U.actor.label}),U.status==="failed"||U.status==="blocked"?l.jsx(Ae,{variant:"amber",tone:"soft",children:U.status}):null]}),l.jsx(Ui,{className:"leading-tight",children:"Evidência da atividade"}),l.jsx(Ru,{className:"mt-1",children:D?`${D.what} · ${uu(U.timestamp)}`:uu(U.timestamp)})]}),l.jsx(ax,{"aria-label":"Fechar detalhes da atividade",onClick:()=>fe(null),children:l.jsx(z,{name:"x",size:16})})]}),l.jsxs("div",{className:"flex flex-1 flex-col gap-6 overflow-y-auto p-6",children:[D&&l.jsxs(at,{children:[l.jsx(Sa,{children:l.jsxs("div",{className:"grid gap-1",children:[l.jsx("h3",{className:"text-body font-semibold",children:"Resumo investigativo"}),l.jsxs("p",{className:"text-body-sm leading-relaxed text-[var(--color-text-secondary)]",children:[D.who," registrou"," ",l.jsx("strong",{className:"text-[var(--color-text-primary)]",children:D.what})," ","em"," ",l.jsx("strong",{className:"text-[var(--color-text-primary)]",children:D.where}),". Resultado: ",String(D.result),"."]})]})}),l.jsxs(lt,{children:[l.jsx(Na,{items:[{label:"Ator",value:`${U.actor.label} (${U.actor.type})`,icon:l.jsx(z,{name:"user",size:14})},{label:"Quando",value:uu(U.timestamp),icon:l.jsx(z,{name:"clock",size:14})},{label:"Onde",value:((le=U.subject)==null?void 0:le.id)||D.where,icon:l.jsx(z,{name:"box",size:14})},{label:"Resultado",value:U.status,icon:l.jsx(z,{name:"check-circle",size:14})}]}),D.why?l.jsxs("div",{className:"grid gap-1 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-3",children:[l.jsx("h4",{className:"text-caption font-semibold uppercase text-[var(--color-text-tertiary)]",children:"Por quê"}),l.jsx("p",{className:"text-body-sm text-[var(--color-text-primary)]",children:String(D.why)})]}):null]})]}),D&&D.evidence.length>0?l.jsxs(at,{children:[l.jsx(Sa,{children:l.jsxs("div",{className:"grid gap-1",children:[l.jsx("h3",{className:"text-body font-semibold",children:"Evidências relacionadas"}),l.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Referências que sustentam este registro."})]})}),l.jsx(lt,{children:l.jsx(ol,{children:D.evidence.map(B=>l.jsx(cl,{leading:l.jsx(z,{name:B.label==="Item"?"box":B.label==="Spec"?"specs":"activity",size:16}),title:B.value,meta:l.jsx(Ae,{variant:B.tone,tone:"soft",children:B.label}),action:B.label==="Item"?l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>window.dispatchEvent(new CustomEvent("letra-open-item",{detail:B.value})),children:"Abrir"}):B.label==="Spec"?l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>window.dispatchEvent(new CustomEvent("letra-open-spec",{detail:B.value})),children:"Abrir"}):null},`${B.label}-${B.value}`))})})]}):null,l.jsxs(at,{children:[l.jsx(Sa,{children:l.jsxs("div",{className:"grid gap-1",children:[l.jsx("h3",{className:"text-body font-semibold",children:"Registro original"}),l.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Mensagem capturada na trilha de atividade."})]})}),l.jsxs(lt,{className:"grid gap-3",children:[l.jsx("p",{className:"text-body-sm leading-relaxed text-[var(--color-text-primary)]",children:U.summary}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[U.correlationId?l.jsx(Je,{children:U.correlationId}):null,U.subject?l.jsxs(Je,{children:[bu(U.subject.type),":"," ",U.subject.id]}):null,l.jsx(Je,{children:U.id})]})]})]}),U.details?l.jsx(at,{children:l.jsxs(ir,{open:Ee,onOpenChange:xe,children:[l.jsxs(or,{className:"flex w-full items-center justify-between gap-3 p-4 text-left transition-colors hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]",children:[l.jsxs("div",{className:"grid gap-1",children:[l.jsx("span",{className:"text-body font-semibold text-[var(--color-text-primary)]",children:"Detalhes técnicos"}),l.jsx("span",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"JSON bruto para auditoria e depuração."})]}),l.jsx(z,{name:Ee?"chevron-up":"chevron-down",size:16})]}),l.jsx(cr,{children:l.jsx(lt,{className:"border-t border-[var(--color-border)] pt-4",children:l.jsx("pre",{className:"max-h-80 overflow-auto rounded-[var(--radius-sm)] bg-[var(--color-bg-base)] p-4 text-caption text-[var(--color-text-secondary)]",children:JSON.stringify(U.details,null,2)})})})]})}):null]})]})})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"p-6",children:[l.jsxs(at,{className:"mb-6",children:[l.jsxs(Sa,{className:"flex flex-wrap items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsx(z,{name:"activity",size:18}),l.jsx(Ae,{variant:"info",className:"text-caption",children:"trilha investigativa"})]}),l.jsx("h1",{className:"text-xl font-bold",children:"Atividade"}),l.jsx("p",{className:"app-section-muted mt-1 max-w-3xl text-sm",style:{color:void 0},children:"Origem, resultado e evidências do workspace em uma linha do tempo auditável."})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-right",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-lg font-bold",children:k.succeededEvents}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"sucesso"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-lg font-bold",style:{color:"var(--color-primary)"},children:k.failedEvents}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"falhas"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-lg font-bold",children:k.todayEvents}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"hoje"})]})]})]}),l.jsx(lt,{children:l.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Origem"}),l.jsx("p",{className:"mt-1 text-sm",children:"quem ou qual automação registrou"})]}),l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Evento"}),l.jsx("p",{className:"mt-1 text-sm",children:"o que mudou no trabalho"})]}),l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Evidência"}),l.jsx("p",{className:"mt-1 text-sm",children:"item, AC, decisão ou arquivo"})]}),l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Resultado"}),l.jsx("p",{className:"mt-1 text-sm",children:"efeito observável antes de agir"})]})]})})]}),de?l.jsx(at,{className:"mb-6 border-[var(--color-border-warning)]",children:l.jsxs(lt,{className:"flex flex-wrap items-center justify-between gap-3 p-4",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx(z,{name:"activity",size:18,className:"text-[var(--color-warning)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-body-sm font-semibold text-[var(--color-text-primary)]",children:"Eventos técnicos incluídos"}),l.jsxs("p",{className:"text-caption text-[var(--color-text-secondary)]",children:[k.systemEvents," automaçõ",k.systemEvents!==1?"es":"o"," nesta consulta"]})]})]}),l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>ee(!1),children:"Ocultar"})]})}):null,l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:[l.jsx(at,{children:l.jsxs(lt,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",children:k.totalEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Total"})]})}),l.jsx(at,{children:l.jsxs(lt,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--color-text-secondary)"},children:k.systemEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Sistema"})]})}),l.jsx(at,{children:l.jsxs(lt,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--color-primary)"},children:k.humanEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Humano"})]})}),l.jsx(at,{children:l.jsxs(lt,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--color-success)"},children:k.agentEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Agente"})]})})]}),l.jsx(at,{className:"mb-6",children:l.jsx(lt,{className:"grid gap-4 p-4",children:l.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("label",{className:"mb-1.5 block text-caption font-semibold uppercase text-[var(--color-text-tertiary)]",htmlFor:"activity-search",children:"Buscar"}),l.jsx(ht,{id:"activity-search",placeholder:"Buscar atividade e evidências...",value:A,onChange:B=>w(B.target.value),"aria-label":"Buscar atividade"})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"mb-1.5 text-caption font-semibold uppercase text-[var(--color-text-tertiary)]",children:"Ator"}),l.jsx(Tu,{ariaLabel:"Filtrar atividade por ator",className:"w-full sm:w-auto",children:Xj.map(B=>l.jsx(Mu,{selected:ie===B.value,onClick:()=>pe(B.value),children:B.label},B.label))})]}),l.jsx("div",{className:"w-full min-w-0 sm:w-[220px]",children:l.jsx(Py,{id:"activity-since",label:"Desde",value:G,onChange:B=>ce(B.target.value)})}),l.jsxs("div",{className:"flex flex-wrap gap-2 lg:pb-0.5",children:[l.jsxs(F,{variant:"secondary",size:"sm",onClick:()=>$(h),children:[l.jsx(z,{name:"check",size:14}),"Atualizar"]}),(A||ie||G)&&l.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{w(""),V(""),pe(""),ce("")},children:"Limpar"})]})]})})}),y?l.jsx("div",{className:"flex items-center justify-center py-16",children:l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):s.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2 py-16",children:[l.jsx(z,{name:"search",size:24,style:{color:"var(--color-text-secondary)"}}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Nenhuma atividade encontrada"})]}):l.jsx("div",{className:"space-y-6",children:ue.map(B=>{const O=oe.has(B.label);return l.jsxs("section",{"aria-label":`${B.label} — ${B.entries.length} atividades`,children:[l.jsxs(F,{type:"button",variant:"ghost",onClick:()=>Q(B.label),"aria-expanded":O,"aria-label":`${B.label} — ${B.entries.length} atividades`,className:"mb-3 h-auto justify-start gap-2 bg-transparent px-0 py-0 text-xs font-semibold uppercase hover:bg-transparent",style:{color:"var(--color-text-secondary)"},children:[l.jsx(z,{name:O?"chevron-down":"chevron-right",size:12}),B.label,l.jsxs("span",{className:"font-normal normal-case ml-1",children:[B.entries.length," atividade",B.entries.length!==1?"s":""]})]}),O&&l.jsx(h0,{className:"rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-surface)] p-4",children:B.entries.map((Z,re)=>{var X;const Oe=Z._noiseCount!==void 0,ve=Z._noiseCount,Se=Z._noiseKey,ze=re===B.entries.length-1;return Oe?l.jsx(rp,{status:"info",icon:l.jsx(z,{name:_.has(Se||"")?"chevron-down":"chevron-right",size:16}),title:cu(Z.action),description:`${ve} atividades similares agrupadas para reduzir ruído operacional.`,timestamp:pp(Z.timestamp),action:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(Ae,{variant:"info",tone:"soft",children:["x",ve]}),l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>Se&&Y(Se),children:_.has(Se||"")?"Recolher":"Expandir"})]}),last:ze},`${Z.id}-${re}`):l.jsx(rp,{status:Zj(Z),icon:l.jsx(z,{name:Kj(Z),size:16}),title:Z.summary||Z.action,description:`${Z.actor.label} · ${((X=Z.subject)==null?void 0:X.id)||"workspace"}`,timestamp:pp(Z.timestamp),action:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Ae,{variant:vp(Z.status),tone:"soft",className:"text-caption uppercase",children:cu(Z.action)}),l.jsx(Ae,{variant:Z.kind==="human"||Z.kind==="system"?"info":"agent",tone:"soft",className:"text-[10px]",children:Z.actor.label}),Z.subject?l.jsxs(Je,{variant:"info",children:[bu(Z.subject.type),": ",Z.subject.id]}):null,l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>fe(Z),children:"Detalhes"})]}),last:ze},`${Z.id}-${re}`)})})]},B.label)})}),d>0&&l.jsxs("div",{className:"app-section-muted mt-6 flex items-center justify-between border-t pt-4 text-xs",style:{borderColor:"var(--color-border)",color:void 0},children:[l.jsxs("span",{children:[d," atividade",d!==1?"s":""," no total"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{variant:"secondary",size:"sm",disabled:h<=1,onClick:()=>x(B=>Math.max(1,B-1)),children:"Anterior"}),l.jsxs("span",{children:["Página ",h," de ",b]}),l.jsx(F,{variant:"secondary",size:"sm",disabled:h>=b,onClick:()=>x(B=>B+1),children:"Próxima"})]})]})]})})]})}const Fj={id:"",displayName:"",role:"implementer",bio:"",avatar:{type:"initials",value:"AG"},color:"oklch(0.7 0.12 280)",skills:[],status:"offline",stageBindings:[],adapterHints:{}};function Ij(){var A;const[s,o]=v.useState([]),[c,u]=v.useState(null),[d,m]=v.useState(""),[h,x]=v.useState(!1),y=()=>fetch("/api/agents").then(async w=>{if(!w.ok)throw new Error("Não foi possível carregar a equipe");return w.json()}).then(w=>Array.isArray(w)&&o(w)).catch(w=>m(w.message));v.useEffect(()=>{y()},[]);const g=(w,T)=>u(V=>V&&{...V,[w]:T});function N(w){g("skills",w.split(",").map(T=>({id:T.trim().toLowerCase().replace(/\s+/g,"-"),label:T.trim(),level:"intermediate",category:"engineering"})).filter(T=>T.label))}async function j(){if(!(c!=null&&c.id)||!c.displayName.trim()){m("ID e nome são obrigatórios");return}x(!0),m("");const w=s.some(T=>T.id===c.id);try{const T=await fetch(w?`/api/agents/${encodeURIComponent(c.id)}`:"/api/agents",{method:w?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!T.ok)throw new Error((await T.json()).error??"Falha ao salvar agente");u(null),await y()}catch(T){m(T.message)}finally{x(!1)}}return l.jsxs("div",{className:"grid gap-6 p-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:"Equipe de agentes"}),l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Identidades, skills e status do harness."})]}),l.jsx(F,{onClick:()=>{m(""),u({...Fj,id:`agent-${Date.now()}`})},children:"Novo agente"})]}),d&&l.jsx("p",{role:"alert",className:"text-sm text-red-600",children:d}),l.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:s.map(w=>l.jsx(at,{children:l.jsxs(lt,{className:"gap-3 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(tx,{agent:w}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"font-semibold",children:w.displayName}),l.jsxs("p",{className:"text-xs text-[var(--color-text-secondary)]",children:[w.role," · ",w.status]})]}),l.jsx(F,{size:"sm",variant:"ghost",onClick:()=>u({...w}),children:"Editar"})]}),l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:w.bio}),l.jsx("div",{className:"flex flex-wrap gap-1",children:w.skills.map(T=>l.jsxs(Ae,{variant:"info",tone:"soft",children:[T.label," · ",T.level]},T.id))})]})},w.id))}),c&&l.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"agent-editor-title",className:"grid max-w-xl gap-3 rounded-lg border border-border bg-background p-4",children:[l.jsx("h2",{id:"agent-editor-title",className:"font-semibold",children:s.some(w=>w.id===c.id)?"Editar agente":"Novo agente"}),l.jsxs("label",{children:["ID",l.jsx(ht,{value:c.id,disabled:s.some(w=>w.id===c.id),onChange:w=>g("id",w.target.value)})]}),l.jsxs("label",{children:["Nome",l.jsx(ht,{value:c.displayName,onChange:w=>g("displayName",w.target.value)})]}),l.jsxs("label",{children:["Role",l.jsx(ht,{value:c.role,onChange:w=>g("role",w.target.value)})]}),l.jsxs("label",{children:["Bio",l.jsx(ls,{value:c.bio??"",onChange:w=>g("bio",w.target.value)})]}),l.jsxs("label",{children:["Avatar tipo",l.jsx(ht,{value:c.avatar.type,onChange:w=>g("avatar",{...c.avatar,type:w.target.value})})]}),l.jsxs("label",{children:["Avatar valor",l.jsx(ht,{value:c.avatar.value,onChange:w=>g("avatar",{...c.avatar,value:w.target.value})})]}),l.jsxs("label",{children:["Cor OKLCH",l.jsx(ht,{value:c.color,onChange:w=>g("color",w.target.value)})]}),l.jsxs("label",{children:["Status",l.jsxs("select",{className:"rounded border p-2",value:c.status,onChange:w=>g("status",w.target.value),children:[l.jsx("option",{children:"online"}),l.jsx("option",{children:"offline"}),l.jsx("option",{children:"busy"})]})]}),l.jsxs("label",{children:["Stages",l.jsx(ht,{value:c.stageBindings.join(", "),onChange:w=>g("stageBindings",w.target.value.split(",").map(T=>T.trim()).filter(Boolean))})]}),l.jsxs("label",{children:["Skills",l.jsx(ht,{value:c.skills.map(w=>w.label).join(", "),onChange:w=>N(w.target.value)})]}),l.jsxs("label",{children:["Hint generic",l.jsx(ls,{value:((A=c.adapterHints)==null?void 0:A.generic)??"",onChange:w=>g("adapterHints",{...c.adapterHints,generic:w.target.value})})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(F,{disabled:h,onClick:j,children:h?"Salvando…":"Salvar"}),l.jsx(F,{variant:"ghost",onClick:()=>u(null),children:"Cancelar"})]})]})]})}function rn(s,o){return`${s}:${o}`}function Pj(s){return(s||"workspace").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"workspace"}function gp(s){return s.replace(/\\/g,"/").replace(/\/+$/,"")}function e1({onComplete:s,onCancel:o,existingNames:c}){const{toast:u}=nr(),[d,m]=v.useState(""),[h,x]=v.useState(""),[y,g]=v.useState(""),[N,j]=v.useState(!1),[A,w]=v.useState(null),[T,V]=v.useState(null),[te,P]=v.useState(!1),[ie,pe]=v.useState({}),[G,ce]=v.useState(!1),[de,ee]=v.useState(""),U=c.some(O=>O.toLowerCase()===d.trim().toLowerCase()),fe=`~/.letra/workspaces/${Pj(d.trim())}`,Ee=d.trim()?U?"Já existe um workspace com este nome":"":"Nome é obrigatório",xe=!Ee&&y.trim().length>0&&!G,_=v.useMemo(()=>A?A.locations??[]:[],[A]),se=v.useMemo(()=>_.map(O=>({id:O.id,label:O.label,path:O.path,adapters:O.adapters.filter(Z=>ie[rn(O.id,Z.tool)]).map(Z=>Z.tool)})),[_,ie]),oe=v.useMemo(()=>[...new Set(se.flatMap(O=>O.adapters))],[se]),ye=(T==null?void 0:T.operations.filter(O=>O.path.endsWith("/workflow.json")).length)??0,E=(T==null?void 0:T.operations.filter(O=>O.path.endsWith("/.letra-link")).length)??0,$=(T==null?void 0:T.operations.filter(O=>!O.path.endsWith("/workflow.json")&&!O.path.endsWith("/.letra-link")).length)??0,me=se.filter(O=>O.adapters.length>0),ue=!!A&&se.length>0&&!G,k=!!A&&!!T&&T.conflictCount===0&&!G;async function b(){if(xe){ce(!0),ee(""),V(null),P(!1);try{const O=await fetch("/api/workspace/setup/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.trim(),root:y.trim()})}),Z=await O.json();if(!O.ok)throw new Error(Z.error||"Não foi possível analisar a pasta.");const re=Z,Oe={},ve=re.locations??[];for(const Se of ve)for(const ze of Se.adapters)Oe[rn(Se.id,ze.tool)]=ze.selected;w(re),pe(Oe)}catch(O){ee(O.message)}finally{ce(!1)}}}async function D(){if(!(!A||se.length===0)){ce(!0),ee("");try{const O=await fetch("/api/workspace/setup/plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proposalId:A.id,workspaceRoot:fe,dataDir:fe,name:d.trim(),template:"padrao",locations:se})}),Z=await O.json();if(!O.ok)throw new Error(Z.error||"Não foi possível revisar a instalação.");V(Z)}catch(O){ee(O.message)}finally{ce(!1)}}}async function Y(){if(!(!A||!T||T.conflictCount>0)){ce(!0),ee("");try{const O=await fetch("/api/workflow/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proposalId:A.id,name:d.trim(),description:h.trim(),workspacePath:fe,dataDir:fe,directories:se.map(re=>re.path),locations:se,tools:oe,template:"padrao"})}),Z=await O.json();if(!O.ok)throw new Error(Z.error||"Não foi possível criar o workspace.");u("Workspace criado com sucesso!","success"),P(!0),s({name:d.trim()})}catch(O){ee(O.message)}finally{ce(!1)}}}function Q(O,Z){const re=rn(O,Z);pe(Oe=>({...Oe,[re]:!Oe[re]})),V(null),P(!1)}function le(O){return O.adapters.filter(Z=>ie[rn(O.id,Z.tool)]).length}function B(O){return gp(O.path)===gp((A==null?void 0:A.workspace.root)??"")?"Raiz da solução":le(O)>0?"Pasta com adapters":"Somente vínculo"}return l.jsx("div",{className:"h-full overflow-y-auto p-6",children:l.jsxs("div",{className:"mx-auto grid max-w-6xl gap-6 lg:grid-cols-[minmax(0,1.12fr)_minmax(340px,0.88fr)]",children:[l.jsxs("section",{className:"flex flex-col gap-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 sm:grid sm:grid-cols-[1fr_auto]",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Novo workspace"}),l.jsx("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-secondary)"},children:"Crie a pasta de governança do Letra e vincule as pastas/projetos que ela deve acompanhar."})]}),l.jsx(F,{type:"button",variant:"ghost",onClick:o,children:"Voltar para Meus Workspaces"})]}),l.jsxs("div",{className:"grid gap-4 rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Workspace e pastas/projetos"}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Informe o nome do workspace e uma pasta de projeto inicial. Nada será escrito antes da confirmação final."})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Nome do workspace"}),l.jsx(ht,{value:d,onBlur:()=>j(!0),onChange:O=>{m(O.target.value),w(null),V(null),P(!1)},placeholder:"Ex: Portal de atendimento","aria-invalid":N&&!!Ee}),N&&Ee&&l.jsx("span",{className:"text-xs",style:{color:"var(--color-danger)"},children:Ee})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Descrição opcional"}),l.jsx(ls,{value:h,onChange:O=>x(O.target.value),placeholder:"Descreva o propósito deste workspace",rows:3})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Data directory do workspace"}),l.jsx(ht,{value:fe,readOnly:!0,"aria-readonly":"true"})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Pasta/projeto inicial"}),l.jsx(ht,{value:y,onChange:O=>{g(O.target.value),w(null),V(null),P(!1)},placeholder:"C:/Workspace/meu-projeto"})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(F,{type:"button",onClick:b,loading:G,disabled:!xe,children:[l.jsx(z,{name:"search",size:14}),"Analisar pasta/projeto"]}),l.jsx("span",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"O harness fica fora do projeto; a pasta recebe apenas o vínculo."})]})]}),l.jsxs("div",{className:"flex flex-col gap-4 rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Proposta do Letra"}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Revise as pastas/projetos vinculadas ao workspace antes de gerar a prévia."})]}),A?l.jsxs(l.Fragment,{children:[A.warnings.map(O=>l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3 text-sm",style:{borderColor:"var(--color-border)"},children:[O,l.jsx("span",{className:"mt-1 block text-xs",style:{color:"var(--color-text-secondary)"},children:"Adapters disponíveis aparecem nas opções avançadas e só serão escritos nas pastas onde forem marcados."})]},O)),l.jsx("div",{className:"flex flex-col gap-3",children:_.map(O=>l.jsx("div",{className:"rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("h3",{className:"font-semibold",children:O.label}),l.jsx(Ae,{variant:"info",tone:"soft",children:B(O)})]}),l.jsx("p",{className:"truncate font-mono text-xs",style:{color:"var(--color-text-secondary)"},children:O.path})]}),l.jsx(Ae,{variant:le(O)>0?"success":"info",tone:"soft",children:le(O)>0?`${le(O)} adapter(s)`:"só .letra-link"})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.stack.map(Z=>l.jsx(Ae,{variant:"info",tone:"soft",children:Z},Z)),O.evidence.map(Z=>l.jsx(Ae,{variant:"info",tone:"soft",children:Z},Z))]}),l.jsxs("details",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Opções avançadas"}),l.jsx("p",{className:"mt-2 text-xs",style:{color:"var(--color-text-secondary)"},children:"Marque adapters apenas nas pastas onde o Letra deve criar instruções para agentes. Em geral, use a raiz Git/solução."}),l.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:O.adapters.map(Z=>l.jsxs("div",{className:yt("rounded-[var(--radius-sm)] border p-3",ie[rn(O.id,Z.tool)]&&"bg-[var(--color-primary-subtle)]"),style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(as,{"aria-label":`${Z.label} em ${O.label}`,checked:!!ie[rn(O.id,Z.tool)],onChange:()=>Q(O.id,Z.tool)}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-medium",children:Z.label}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:ie[rn(O.id,Z.tool)]?`Será escrito em ${O.label}`:`Disponível para ${O.label}`})]})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[l.jsx(Ae,{variant:Z.state==="detected"?"success":"info",tone:"soft",children:Z.state==="detected"?"detectado":"disponível"}),Z.evidence.map(re=>l.jsx(Ae,{variant:"info",tone:"soft",children:re},re))]})]},Z.tool))})]})]})},O.id))}),l.jsx("div",{className:"flex justify-end",children:l.jsx(F,{type:"button",onClick:D,loading:G,disabled:!ue,children:"Gerar prévia de escrita"})})]}):l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-4 text-sm",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"A proposta aparecerá aqui depois da análise da pasta/projeto inicial."})]}),te&&l.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-[var(--radius-md)] border p-8 text-center",style:{borderColor:"var(--color-border)"},children:[l.jsx(z,{name:"check-circle",size:24,style:{color:"var(--color-success)"}}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold",children:"Workspace criado!"}),l.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-secondary)"},children:["O workspace ",d.trim()," já pode ser supervisionado no Letra."]})]}),l.jsx(F,{type:"button",onClick:o,children:"Ir para Meus Workspaces"})]}),de&&l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-3 text-sm",style:{borderColor:"var(--color-danger)",color:"var(--color-danger)"},children:de})]}),l.jsxs("aside",{className:"flex flex-col gap-4 rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Prévia de escrita"}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Confira os artefatos antes de criar o workspace."})]}),A&&T?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-2 rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Resumo"}),l.jsxs("p",{className:"text-sm",children:[ye||1," pasta de governança fora do projeto, ",E," vínculo(s) .letra-link e"," ",$," arquivo(s) de adapter."]}),l.jsxs("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:["Adapters serão escritos em"," ",me.length>0?me.map(O=>O.label).join(", "):"nenhuma pasta","."]})]}),l.jsxs("div",{className:"grid gap-3",children:[l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"workflow.json"}),l.jsxs("p",{className:"mt-1 text-sm",children:["Criado em ",fe,"/workflow.json"]})]}),l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Vínculo"}),l.jsx("p",{className:"mt-1 text-sm",children:"Cada pasta/projeto recebe apenas .letra-link apontando para o data directory."})]}),l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Adapters"}),l.jsx("p",{className:"mt-1 text-sm",children:oe.length>0?oe.join(", "):"Nenhum adapter selecionado"})]})]}),l.jsx("div",{className:"flex flex-col gap-2",children:T.operations.map(O=>l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate font-mono text-xs",children:O.path}),l.jsx("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-secondary)"},children:O.reason})]}),l.jsx(Ae,{variant:O.kind==="conflict"?"error":O.kind==="preserve"?"info":"success",tone:"soft",children:O.kind})]})},`${O.kind}:${O.path}:${O.tool||""}`))}),T.conflictCount>0&&l.jsx("p",{className:"text-sm",style:{color:"var(--color-danger)"},children:"Resolva os conflitos antes de criar o workspace."})]}):l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-4 text-sm",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Gere a prévia para ver exatamente quais arquivos serão criados, preservados ou bloqueados por conflito."}),l.jsx(F,{type:"button",onClick:Y,loading:G,disabled:!k,children:"Criar workspace"}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Checklist do cadastro"}),[["Analisar pasta",!!A],["Revisar proposta",!!T],["Revisar opções avançadas",!!A],["Confirmar criação",te],["Validar workflow.json",te],["Validar .letra-link",te],["Validar pastas/projetos",te]].map(([O,Z])=>l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(z,{name:Z?"check":"circle",size:14,style:{color:Z?"var(--color-success)":"var(--color-text-secondary)"}}),l.jsx("span",{children:O})]},String(O)))]}),A&&l.jsxs("div",{className:"mt-2 rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Pasta analisada"}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs",children:A.workspace.root}),l.jsxs("p",{className:"mt-2 text-sm",children:[_.length," pasta(s)/projeto(s) detectado(s)"]}),l.jsxs("p",{className:"text-sm",children:[oe.length," adapter(s): ",oe.join(", ")]})]})]})]})})}function t1(s){try{return new Date(s).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return s}}function a1({onSelect:s,activeSlug:o,gateMode:c,activeDirectory:u}){const[d,m]=v.useState([]),[h,x]=v.useState(!1),[y,g]=v.useState(!0);v.useEffect(()=>{fetch("/api/workspaces").then(j=>j.json()).then(j=>{Array.isArray(j)&&m(j)}).catch(()=>{}).finally(()=>g(!1))},[]);function N(j){m(A=>{var w;return[...A,{id:((w=crypto.randomUUID)==null?void 0:w.call(crypto))||`${Date.now()}`,name:j.name,slug:j.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),createdAt:new Date().toISOString()}]}),x(!1)}return h?l.jsx(e1,{onComplete:j=>{N(j),s&&fetch("/api/workspaces").then(A=>A.json()).then(A=>{if(Array.isArray(A)&&A.length>0){const w=A[A.length-1];s(w)}}).catch(()=>{})},onCancel:()=>x(!1),existingNames:d.map(j=>j.name)}):l.jsxs("div",{className:"flex flex-col flex-1 p-6 gap-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Meus Workspaces"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:c?"Selecione ou crie um workspace para começar":"Gerencie seus espaços de trabalho"})]}),l.jsxs(F,{onClick:()=>x(!0),children:[l.jsx(z,{name:"plus",size:16,className:"mr-1"}),c?"Criar novo workspace":"Novo Workspace"]})]}),y?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):d.length===0?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(on,{icon:l.jsx(z,{name:"box",size:24}),title:"Nenhum workspace encontrado",description:"Crie seu primeiro workspace para organizar seus projetos e começar a trabalhar.",action:l.jsx(F,{onClick:()=>x(!0),children:"Crie agora seu workspace"})})}):l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4",children:d.map(j=>l.jsx(at,{className:`transition-all duration-200 hover:shadow-md hover:-translate-y-0.5 ${s?"cursor-pointer":""} ${o===j.slug?"ring-2 ring-primary":""}`,onClick:()=>s==null?void 0:s(j),children:l.jsxs(lt,{className:"p-4 flex flex-col gap-3",children:[l.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[l.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] flex items-center justify-center shrink-0",style:{background:o===j.slug?"var(--color-primary)":"var(--color-bg-surface)",color:o===j.slug?"var(--color-primary)":"var(--color-text-secondary)"},children:l.jsx(z,{name:o===j.slug?"check":"box",size:16})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-sm font-semibold truncate",children:j.name}),j.description&&l.jsx("p",{className:"text-xs mt-0.5 truncate",style:{color:"var(--color-text-secondary)"},children:j.description}),l.jsxs("span",{className:"text-[11px]",style:{color:"var(--color-text-secondary)"},children:["Criado em ",t1(j.createdAt)]})]})]}),j.directories&&j.directories.length>0&&l.jsxs("div",{className:"flex flex-col gap-1 pt-1 border-t",style:{borderColor:"var(--color-border)"},children:[l.jsx("span",{className:"text-caption uppercase tracking-wider font-semibold",style:{color:"var(--color-text-secondary)"},children:"Pastas gerenciadas"}),j.directories.map(A=>{const w=o===j.slug&&u===A,T=A.split(/[/\\]/).pop()||A;return l.jsxs("div",{className:"flex items-center gap-1.5 text-xs",style:{color:w?"var(--color-primary)":"var(--color-text-secondary)"},children:[l.jsx(z,{name:w?"check":"folder",size:12}),l.jsx("span",{className:"truncate",children:T})]},A)})]})]})},j.id))})]})}function l1({workspace:s,onWorkspaceUpdated:o,onWorkspaceDeleted:c,onRefreshWorkflow:u,onCreateWorkspace:d,onClose:m}){const{toast:h,toastWithOptions:x}=nr(),[y,g]=v.useState("general"),[N,j]=v.useState(s.name),[A,w]=v.useState(s.description||""),[T,V]=v.useState(!1),[te,P]=v.useState(!1),[ie,pe]=v.useState("confirm"),[G,ce]=v.useState(""),[de,ee]=v.useState([]),[U,fe]=v.useState(!1),[Ee,xe]=v.useState(!1),[_,se]=v.useState(null),[oe,ye]=v.useState(""),[E,$]=v.useState(null),[me,ue]=v.useState(""),[k,b]=v.useState({}),[D,Y]=v.useState(!1),[Q,le]=v.useState(!1),[B,O]=v.useState(""),[Z,re]=v.useState([]),[Oe,ve]=v.useState(!1),[Se,ze]=v.useState(""),[X,we]=v.useState(null),[_e,_t]=v.useState([]),[ft,Me]=v.useState(!1),[Pe,mt]=v.useState(null),[Le,kt]=v.useState(""),[et,Ma]=v.useState([]),[ul,Ul]=v.useState(!1),[Zt,J]=v.useState([]),[Te,Ue]=v.useState(!1),[rt,bt]=v.useState(!1),[pt,Rt]=v.useState(!1),[Tt,da]=v.useState(""),Kt=v.useState(null),$t=v.useState(null);function Ht(ne,ae){Kt[0]&&clearTimeout(Kt[0]),$t[0]={undo:ae,label:ne};const ge=setTimeout(()=>{$t[0]=null},3e4);Kt[0]=ge,x(`${ne} — desfazer disponível por 30s`,{type:"success",duration:3e4,action:{label:"Desfazer",onClick:wa}})}function wa(){$t[0]&&($t[0].undo(),$t[0]=null,Kt[0]&&clearTimeout(Kt[0]),h("Alteração desfeita","success"))}v.useEffect(()=>{j(s.name),w(s.description||""),g("general"),pe("confirm"),ce(""),Bl(),fn(),Ba(),mn()},[s.name,s.description]);const fn=v.useCallback(async()=>{Me(!0);try{const ae=await(await fetch("/api/harness/templates")).json();_t(Array.isArray(ae)?ae:[])}catch{_t([])}finally{Me(!1)}},[]),Ba=v.useCallback(async()=>{var ne;try{const ge=await(await fetch("/api/workflow")).json();kt(ge.template||""),Ma(((ne=ge.stages)==null?void 0:ne.map(Re=>({id:Re.id,name:Re.name})))||[])}catch{}},[]),mn=v.useCallback(async()=>{Ue(!0);try{const ae=await(await fetch("/api/workflow/adapters")).json();J(Array.isArray(ae)?ae:[])}catch{J([])}finally{Ue(!1)}},[]),Bl=v.useCallback(async()=>{fe(!0);try{const ge=(await(await fetch("/api/workflow")).json()).locations||[];ee(ge);const Re={};for(const Ge of ge)Ge.id&&(Re[Ge.id]=Array.isArray(Ge.adapters)?Ge.adapters:[]);b(Re)}catch{ee([]),b({})}finally{fe(!1)}},[]),qi=N!==s.name||A!==(s.description||""),hn=N.trim().length>=2;async function ss(){if(!hn||T)return;const ne=s.name,ae=s.description||"";V(!0);try{const ge=await fetch("/api/workflow",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.trim(),description:A.trim()})});if(!ge.ok)throw new Error("Failed to save");const Re=await ge.json();o({...s,name:Re.name||N.trim(),description:Re.description??A.trim()}),Ht("Configurações salvas",()=>{j(ne),w(ae),fetch("/api/workflow",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ne,description:ae})}),o({...s,name:ne,description:ae})})}catch{h("Erro ao salvar configurações","error")}finally{V(!1)}}async function ql(){if(G===s.name)try{if(!(await fetch(`/api/workspaces/${s.id}`,{method:"DELETE"})).ok)throw new Error("Failed to delete");h("Workspace excluído","success"),P(!1),c()}catch{h("Erro ao excluir workspace","error")}}async function Gi(){if(!X)return;const ne=`loc-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ae=X.name,ge=[...de];try{const Re=await fetch("/api/workflow/locations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:ne,path:X.path,label:ae})});if(!Re.ok)throw new Error("Failed to add location");const Ge=await Re.json();ee(Ve=>[...Ve,Ge]),le(!1),we(null),O(""),re([]),Ht("Local adicionado",()=>{ee(ge),fetch(`/api/workflow/locations/${ne}`,{method:"DELETE"})})}catch{h("Erro ao adicionar local","error")}}async function rs(ne){if(!oe.trim())return;const ae=de.find(ge=>ge.id===ne);try{const ge=await fetch(`/api/workflow/locations/${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:oe.trim()})});if(!ge.ok)throw new Error("Failed to update");const Re=await ge.json();ee(Ge=>Ge.map(Ve=>Ve.id===ne?Re:Ve)),se(null),ae?Ht("Label atualizado",()=>{ee(Ge=>Ge.map(Ve=>Ve.id===ne?ae:Ve)),fetch(`/api/workflow/locations/${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:ae.label})})}):h("Label atualizado","success")}catch{h("Erro ao atualizar label","error")}}async function dr(){if(!E)return;const ne=de.find(ge=>ge.id===E),ae=[...de];try{if(!(await fetch(`/api/workflow/locations/${E}`,{method:"DELETE"})).ok)throw new Error("Failed to delete");ee(Re=>Re.filter(Ge=>Ge.id!==E)),$(null),ue(""),ne&&Ht("Local removido",()=>{ee(ae),fetch("/api/workflow/locations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ne)})})}catch{h("Erro ao remover local","error")}}async function fr(ne){const ae=de.find(ge=>ge.id===ne);try{const ge=await fetch(`/api/workflow/locations/${ne}/repair-link`,{method:"POST"});if(!ge.ok)throw new Error("Failed to repair link");const Re=await ge.json();Re.location?ee(Ge=>Ge.map(Ve=>Ve.id===ne?{...Ve,...Re.location,linkStatus:"ok",linkOk:!0}:Ve)):ae&&ee(Ge=>Ge.map(Ve=>Ve.id===ne?{...Ve,linkStatus:"ok",linkOk:!0}:Ve)),h("Vínculo reparado","success")}catch{h("Erro ao reparar vínculo","error")}}function is(ne){return ne.linkOk===!0||ne.linkStatus==="ok"?"Vínculo ok":ne.linkOk===!1||ne.linkStatus==="missing"?".letra-link ausente":ne.linkStatus==="broken"?".letra-link quebrado":"Vínculo não verificado"}function pn(ne){return ne.linkOk===!0||ne.linkStatus==="ok"?"success":ne.linkOk===!1||ne.linkStatus==="missing"||ne.linkStatus==="broken"?"warning":"info"}const mr=[{id:"opencode",label:"OpenCode"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"claude-code",label:"Claude Code"},{id:"vscode",label:"VS Code"},{id:"windsurf",label:"Windsurf"},{id:"hermes",label:"Hermes"}];async function hr(ne,ae){const ge=k[ne]||[],Re=ge.includes(ae)?ge.filter(Ge=>Ge!==ae):[...ge,ae];b(Ge=>({...Ge,[ne]:Re})),Y(!0);try{if(!(await fetch(`/api/workflow/locations/${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapters:Re})})).ok)throw new Error("Failed to update adapters");Ht("Adapters atualizados",()=>{b(Ve=>({...Ve,[ne]:ge})),fetch(`/api/workflow/locations/${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapters:ge})})})}catch{b(Ge=>({...Ge,[ne]:ge})),h("Erro ao atualizar adapters","error")}finally{Y(!1)}}async function Da(ne){var Ve,Yt;const ae=[...Zt],ge=((Ve=Zt.find(Qe=>Qe.id===ne))==null?void 0:Ve.displayName)||ne,Re=Zt.map(Qe=>Qe.id===ne?{...Qe,active:!Qe.active}:Qe),Ge=Re.filter(Qe=>Qe.active).map(Qe=>Qe.id);J(Re),bt(!0);try{if(!(await fetch("/api/workflow/adapters",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tools:Ge})})).ok)throw new Error("Failed to update adapters");u();const it=(Yt=ae.find(Ca=>Ca.id===ne))==null?void 0:Yt.active;Ht(`${ge} ${it?"desativado":"ativado"}`,()=>{J(ae),fetch("/api/workflow/adapters",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tools:ae.filter(Ca=>Ca.active).map(Ca=>Ca.id)})}),u()})}catch{J(Zt),h("Erro ao atualizar adapters","error")}finally{bt(!1)}}async function Mt(){var Ge;if(!Pe||ul)return;const ne=Le,ae=[...et],ge=_e.find(Ve=>Ve.id===Pe),Re=ae.filter(Ve=>!(ge!=null&&ge.stages.some(Yt=>Yt.id===Ve.id)));Ul(!0);try{const Ve=await fetch("/api/workflow/template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:Pe})});if(!Ve.ok)throw new Error("Failed to switch template");const Yt=await Ve.json();kt(Yt.template||Pe),Ma(((Ge=Yt.stages)==null?void 0:Ge.map(Qe=>({id:Qe.id,name:Qe.name})))||[]),mt(null),u(),Re.length>0&&h(`${Re.length} estágio(s) removido(s); itens preservados no backlog`,"success"),Ht("Template atualizado",()=>{kt(ne),Ma(ae),fetch("/api/workflow/template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:ne})}),u()})}catch{h("Erro ao atualizar template","error")}finally{Ul(!1)}}async function Vt(){if(!(!s.root||pt)){Rt(!0),da("");try{const ne=await fetch("/api/workflow/migrate-harness",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceRoot:s.root,clean:!1})});if(!ne.ok)throw new Error(`Migration failed (${ne.status})`);const ae=await ne.json();ae.ok?(h("Workspace externalizado com sucesso","success"),u()):da(ae.message||"Erro ao externalizar")}catch(ne){da((ne==null?void 0:ne.message)||"Erro ao externalizar")}finally{Rt(!1)}}}async function dl(){if(!(!s.root||pt)){Rt(!0),da("");try{const ne=await fetch("/api/workflow/migrate-harness",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceRoot:s.root,clean:!0})});if(!ne.ok)throw new Error(`Migration failed (${ne.status})`);const ae=await ne.json();ae.ok?(h("Workspace externalizado e pasta original removida","success"),u()):da(ae.message||"Erro ao externalizar")}catch(ne){da((ne==null?void 0:ne.message)||"Erro ao externalizar")}finally{Rt(!1)}}}async function Gl(ne){ve(!0),ze("");try{const ae=ne?`/api/fs/dirs?path=${encodeURIComponent(ne)}`:"/api/fs/dirs",Re=await(await fetch(ae)).json();O(Re.path||""),re(Re.dirs||[]),Re.error&&ze(Re.error)}catch{ze("Erro ao listar diretórios")}finally{ve(!1)}}function pr(){le(!0),we(null),O(""),re([]),Gl()}return l.jsxs("div",{className:"flex h-full flex-col",children:[l.jsx("div",{className:"border-b px-6 py-4",style:{borderColor:"var(--color-border)"},children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Configurações do Workspace"}),l.jsx("p",{className:"text-caption mt-0.5",style:{color:"var(--color-text-secondary)"},children:s.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[d?l.jsxs(F,{type:"button",variant:"secondary",onClick:d,children:[l.jsx(z,{name:"plus",size:14}),"Novo workspace"]}):null,y==="general"&&l.jsx(F,{onClick:ss,disabled:!qi||!hn||T,loading:T,children:"Salvar"}),m?l.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"size-8 px-0","aria-label":"Fechar configurações do workspace",onClick:m,children:l.jsx(z,{name:"x",size:16})}):null]})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(Uy,{tabs:[{id:"general",label:"Geral",icon:l.jsx(z,{name:"settings",size:14})},{id:"locations",label:"Pastas/projetos",icon:l.jsx(z,{name:"folder",size:14})},{id:"flow",label:"Fluxo",icon:l.jsx(z,{name:"flow",size:14})},{id:"adapters",label:"Adapters",icon:l.jsx(z,{name:"cpu",size:14})},{id:"advanced",label:"Avançado",icon:l.jsx(z,{name:"shield",size:14})},{id:"externalization",label:"Externalização",icon:l.jsx(z,{name:"folder",size:14})}],activeTab:y,onChange:g,ariaLabel:"Configurações do workspace",children:ne=>l.jsxs("div",{"data-testid":"workspace-settings-tab-panel",className:"px-4 py-5 sm:px-6 lg:px-8",children:[ne==="general"&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Nome"}),l.jsx(ht,{value:N,onChange:ae=>j(ae.target.value),placeholder:"Nome do workspace",autoFocus:!0}),!hn&&N.length>0&&l.jsx("span",{className:"text-caption",style:{color:"var(--color-error)"},children:"Mínimo 2 caracteres"})]}),l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Descrição"}),l.jsx(ls,{value:A,onChange:ae=>w(ae.target.value),placeholder:"Descreva o propósito deste workspace",rows:3})]})]}),l.jsxs("div",{className:"pt-2",children:[l.jsxs("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:["Criado em"," ",new Date(s.createdAt).toLocaleDateString("pt-BR")]}),s.root&&l.jsx("p",{className:"text-caption mt-1 font-mono",style:{color:"var(--color-text-secondary)"},children:s.root})]})]}),ne==="locations"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Data directory do workspace"}),l.jsx(ht,{value:s.dataDir||s.root||"",readOnly:!0,"aria-readonly":"true"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Gerencie as pastas/projetos vinculadas a este workspace."}),l.jsxs(F,{size:"sm",onClick:pr,children:[l.jsx(z,{name:"plus",size:14}),"Adicionar pasta"]})]}),U?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):de.length===0?l.jsxs("div",{className:"rounded-[var(--radius-md)] border border-dashed p-6 text-center",style:{borderColor:"var(--color-border)"},children:[l.jsx(z,{name:"folder",size:24,className:"mx-auto mb-2",style:{color:"var(--color-text-secondary)"}}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Nenhuma pasta/projeto vinculada"}),l.jsx(F,{size:"sm",className:"mt-3",onClick:pr,children:"Adicionar primeira pasta"})]}):l.jsx("div",{className:"space-y-2",children:de.map(ae=>l.jsxs("div",{className:"flex items-center gap-3 rounded-[var(--radius-md)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx(z,{name:"folder",size:16,style:{color:"var(--color-text-secondary)"}}),l.jsx("div",{className:"flex-1 min-w-0",children:_===ae.id?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ht,{value:oe,onChange:ge=>ye(ge.target.value),className:"h-8","aria-label":`Label do local ${ae.label}`,autoFocus:!0,onKeyDown:ge=>{ge.key==="Enter"&&rs(ae.id),ge.key==="Escape"&&se(null)}}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Salvar local ${ae.label}`,onClick:()=>rs(ae.id),children:l.jsx(z,{name:"check",size:14})}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Cancelar edição de ${ae.label}`,onClick:()=>se(null),children:l.jsx(z,{name:"x",size:14})})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm font-medium truncate",children:ae.label}),l.jsx("p",{className:"text-caption font-mono truncate",style:{color:"var(--color-text-secondary)"},children:ae.path}),l.jsx("span",{className:"mt-2 inline-flex rounded-full px-2 py-0.5 text-caption",style:{background:pn(ae)==="success"?"var(--color-success-subtle)":"var(--color-surface-secondary)",color:pn(ae)==="success"?"var(--color-success)":"var(--color-text-secondary)"},children:is(ae)}),!D&&l.jsxs("details",{className:"mt-2 rounded-[var(--radius-sm)] border p-2",style:{borderColor:"var(--color-border)"},children:[l.jsx("summary",{className:"cursor-pointer text-caption font-medium",children:"Adapters da pasta"}),l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:mr.map(ge=>{const Re=(k[ae.id]||[]).includes(ge.id);return l.jsx(F,{size:"sm",variant:Re?"secondary":"ghost",className:"h-7 px-2","aria-pressed":Re,disabled:D,onClick:()=>hr(ae.id,ge.id),children:ge.label},ge.id)})})]})]})}),_!==ae.id&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Editar label da pasta ${ae.label}`,onClick:()=>{se(ae.id),ye(ae.label)},children:l.jsx(z,{name:"edit",size:14})}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Reparar vínculo da pasta ${ae.label}`,onClick:()=>fr(ae.id),children:l.jsx(z,{name:"activity",size:14})}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Remover vínculo da pasta ${ae.label}`,onClick:()=>{$(ae.id),ue(ae.path)},children:l.jsx(z,{name:"trash",size:14})})]})]},ae.id))})]}),ne==="flow"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Altere o template do fluxo de trabalho. Itens em estágios removidos vão para o backlog."}),Le&&l.jsxs("div",{className:"rounded-[var(--radius-md)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsxs("p",{className:"text-caption font-medium",children:["Template atual: ",Le]}),l.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:et.map(ae=>l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-surface-secondary)",color:"var(--color-text-secondary)"},children:ae.name},ae.id))})]}),ft?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando templates..."})}):_e.length===0?l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Nenhum template disponível"}):l.jsx("div",{className:"space-y-2",children:_e.map(ae=>{const ge=ae.id===Le,Re=ae.id===Pe,Ge=ae.stages.filter(Qe=>!et.some(it=>it.id===Qe.id)),Ve=et.filter(Qe=>!ae.stages.some(it=>it.id===Qe.id)),Yt=ae.stages.filter(Qe=>et.some(it=>it.id===Qe.id));return l.jsxs(F,{type:"button",variant:"ghost",className:`h-auto w-full flex-col items-stretch gap-2 rounded-[var(--radius-md)] border p-3 text-left ${Re?"border-[var(--color-primary)] bg-[var(--color-primary-subtle)]":"hover:bg-[var(--color-surface-secondary)]"}`,style:{borderColor:Re?void 0:"var(--color-border)"},onClick:()=>mt(ge?null:ae.id),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium",children:[ae.name,ge&&l.jsx("span",{className:"ml-2 text-caption",style:{color:"var(--color-text-secondary)"},children:"(atual)"})]}),ge&&l.jsx(z,{name:"check",size:14,style:{color:"var(--color-primary)"}})]}),ae.description&&l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:ae.description}),l.jsx("div",{className:"flex flex-wrap gap-1",children:ae.stages.map(Qe=>{const it=et.some(xn=>xn.id===Qe.id),Ca=Ge.some(xn=>xn.id===Qe.id);return l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:Ca?"var(--color-success-subtle)":"var(--color-surface-secondary)",color:Ca?"var(--color-success)":"var(--color-text-secondary)"},children:Qe.name},Qe.id)})}),!ge&&(Ge.length>0||Ve.length>0)&&l.jsxs("div",{className:"text-caption flex flex-col gap-1",style:{color:"var(--color-text-secondary)"},children:[Yt.length>0&&l.jsxs("p",{children:["Inalterados:"," ",Yt.map(Qe=>Qe.name).join(", ")]}),Ge.length>0&&l.jsxs("p",{style:{color:"var(--color-success)"},children:["Adicionados:"," ",Ge.map(Qe=>Qe.name).join(", ")]}),Ve.length>0&&l.jsxs("p",{style:{color:"var(--color-error)"},children:["Removidos:"," ",Ve.map(Qe=>Qe.name).join(", ")]}),Ve.length>0&&l.jsx("p",{children:"Itens nesses estágios serão preservados no backlog."})]})]},ae.id)})}),Pe&&Pe!==Le&&l.jsx(F,{onClick:Mt,disabled:ul,loading:ul,children:"Aplicar template"})]}),ne==="adapters"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Selecione quais adapters estão ativos. Adapters são regenerados automaticamente."}),Te?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando adapters..."})}):Zt.length===0?l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Nenhum adapter disponível"}):l.jsx("div",{className:"space-y-2",children:Zt.map(ae=>{const ge=[];return ae.capabilities.instructions&&ge.push("Instructions"),ae.capabilities.skills&&ge.push("Skills"),ae.capabilities.mcp&&ge.push("MCP"),ae.capabilities.hooks&&ge.push("Hooks"),l.jsxs(F,{type:"button",variant:"ghost",className:`h-auto w-full items-start justify-start gap-3 rounded-[var(--radius-md)] border p-3 text-left ${ae.active?"border-[var(--color-primary)] bg-[var(--color-primary-subtle)]":"hover:bg-[var(--color-surface-secondary)]"}`,style:{borderColor:ae.active?void 0:"var(--color-border)"},"aria-label":`${ae.active?"Desativar":"Ativar"} adapter ${ae.displayName}`,"aria-pressed":ae.active,onClick:()=>Da(ae.id),disabled:rt,children:[l.jsx("div",{className:"mt-0.5",children:l.jsx("div",{className:`flex h-4 w-4 items-center justify-center rounded border ${ae.active?"border-[var(--color-primary)] bg-[var(--color-primary)]":"border-[var(--color-border)]"}`,children:ae.active&&l.jsx(z,{name:"check",size:10,style:{color:"var(--color-text-on-primary)"}})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium",children:ae.displayName}),ae.detected&&l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-success-subtle)",color:"var(--color-success)"},children:"Detectado"})]}),ge.length>0&&l.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:ge.map(Re=>l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-surface-secondary)",color:"var(--color-text-secondary)"},children:Re},Re))}),l.jsxs("p",{className:"text-caption mt-1",style:{color:"var(--color-text-secondary)"},children:["Arquivo(s) esperado(s):"," ",ae.detectionPaths.join(", ")]})]})]},ae.id)})})]}),ne==="advanced"&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-error)"},children:[l.jsx("h4",{className:"text-sm font-semibold",style:{color:"var(--color-error)"},children:"Zona de perigo"}),l.jsx("p",{className:"text-caption mt-1",style:{color:"var(--color-text-secondary)"},children:"Excluir este workspace remove o registro mas preserva os arquivos no disco."}),l.jsx(F,{variant:"danger",size:"sm",className:"mt-3",onClick:()=>P(!0),children:"Excluir Workspace"})]})}),ne==="externalization"&&l.jsxs("div",{className:"space-y-6",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Externalização de dados"}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Os arquivos do workspace (workflow.json, harness, specs, memories) podem ser externalizados para fora do projeto, mantendo apenas o link .le.etra-link."}),s.dataDir?l.jsx("div",{className:"text-caption break-all",style:{color:"var(--color-text-secondary)"},children:s.dataDir}):l.jsx(F,{size:"sm",variant:"secondary",onClick:u,children:"Atualizar localização"}),Tt&&l.jsx("p",{className:"text-caption",style:{color:"var(--color-error)"},children:Tt}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{size:"sm",loading:pt,onClick:Vt,children:"Migrar para diretório externo"}),l.jsx(F,{size:"sm",variant:"secondary",loading:pt,onClick:dl,children:"Migrar e remover origem"})]})]})]})})}),ie==="confirm"&&l.jsx(ns,{open:te,onClose:()=>P(!1),title:"Excluir workspace?",actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:()=>P(!1),children:"Cancelar"}),l.jsx(F,{type:"button",variant:"danger",onClick:()=>pe("type-name"),children:"Continuar"})]}),children:l.jsxs("p",{className:"text-body",style:{color:"var(--color-text-secondary)"},children:['Tem certeza que deseja excluir "',s.name,'"? Esta ação é irreversível.']})}),ie==="type-name"&&l.jsx(ns,{open:te,onClose:()=>{P(!1),pe("confirm"),ce("")},title:`Digite "${s.name}" para confirmar`,actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:()=>{P(!1),pe("confirm"),ce("")},children:"Cancelar"}),l.jsx(F,{type:"button",variant:"danger",disabled:G!==s.name,onClick:ql,children:"Excluir permanentemente"})]}),children:l.jsxs("div",{className:"grid gap-3",children:[l.jsx("p",{className:"text-body",style:{color:"var(--color-text-secondary)"},children:"Todos os dados serão preservados no disco, mas o registro será removido."}),l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Nome do workspace"}),l.jsx(ht,{value:G,onChange:ne=>ce(ne.target.value),"aria-label":"Digite o nome do workspace para confirmar exclusão",placeholder:s.name,autoFocus:!0})]})]})}),E&&l.jsx(Du,{open:!!E,onClose:()=>{$(null),ue("")},onConfirm:dr,title:"Remover local?",message:`Remover ${me}?`,confirmLabel:"Confirmar remoção",variant:"danger"}),Q&&l.jsx(sr,{open:Q,onOpenChange:le,children:l.jsxs(rr,{side:"right",className:"w-full sm:max-w-md flex flex-col",children:[l.jsxs(Hi,{children:[l.jsx(Ui,{children:"Selecionar diretório"}),l.jsx(Ru,{children:"Navegue e selecione o diretório para adicionar como local."})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ht,{value:B,onChange:ne=>O(ne.target.value),"aria-label":"Caminho do diretório",placeholder:"Caminho do diretório",onKeyDown:ne=>{ne.key==="Enter"&&Gl(B)}}),l.jsx(F,{size:"sm","aria-label":"Buscar diretório",onClick:()=>Gl(B),children:l.jsx(z,{name:"search",size:14})})]}),Se&&l.jsx("p",{className:"text-caption",style:{color:"var(--color-error)"},children:Se}),Oe?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):l.jsxs("div",{className:"space-y-1",children:[Z.map(ne=>l.jsxs(F,{type:"button",variant:"ghost",className:`h-auto w-full justify-start gap-2 rounded-[var(--radius-sm)] px-3 py-2 text-left text-sm ${(X==null?void 0:X.path)===ne.path?"bg-[var(--color-primary)] text-[var(--color-text-on-primary)]":"hover:bg-[var(--color-surface-secondary)]"}`,onClick:()=>we(ne),children:[l.jsx(z,{name:"folder",size:14}),l.jsx("span",{className:"truncate",children:ne.name})]},ne.path)),X&&l.jsxs("div",{className:"rounded-[var(--radius-md)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-caption font-medium",children:"Diretório selecionado"}),l.jsx("p",{className:"mt-1 truncate font-mono text-caption",style:{color:"var(--color-text-secondary)"},children:X.path})]}),Z.length===0&&!Se&&l.jsx("p",{className:"text-caption py-4 text-center",style:{color:"var(--color-text-secondary)"},children:"Nenhum subdiretório encontrado"})]})]})}),l.jsxs(Lu,{children:[l.jsx(F,{variant:"secondary",onClick:()=>le(!1),children:"Cancelar"}),l.jsx(F,{disabled:!X,onClick:Gi,children:"Adicionar"})]})]})})]})}function n1({activeFlow:s}){const o=k0(s);return o.length===0?null:l.jsx("div",{className:"p-4",children:l.jsx(Gy,{variant:"warning",title:`Flow ativo com ${o.length} aviso${o.length===1?"":"s"}`,children:l.jsx("div",{className:"grid grid-cols-1 gap-2 pt-1 lg:grid-cols-2",children:o.map((c,u)=>l.jsxs("div",{className:"grid grid-cols-1 items-start gap-1.5 sm:grid-cols-[auto_minmax(0,1fr)] sm:gap-2",children:[l.jsx(Ae,{variant:"info",className:"w-fit max-w-full break-all text-caption",children:c.code}),l.jsxs("span",{children:[c.message,c.artifactRef?` (${c.artifactRef})`:""]})]},`${c.code}-${c.artifactRef??u}`))})})})}function s1({sidebar:s,header:o,children:c}){const{open:u}=Ta();return l.jsx(x0,{sidebar:s,header:o,sidebarCollapsed:!u,className:"app-surface-base min-h-svh",style:{"--layout-sidebar-width":"var(--sidebar-width)","--layout-sidebar-width-collapsed":"var(--sidebar-width-icon)"},children:c})}function r1(){const[s,o]=v.useState(null),[c,u]=v.useState(null),[d,m]=v.useState(!0),[h,x]=v.useState("supervision"),[y,g]=v.useState("context.md"),[N,j]=v.useState(()=>{try{const b=localStorage.getItem("letra-active-workspace");return b?JSON.parse(b):null}catch{return null}}),[A,w]=v.useState([]),[T,V]=v.useState(()=>{var D;if(typeof window>"u")return"dark";const b=localStorage.getItem("letra-theme");return b==="light"||b==="dark"?b:(D=window.matchMedia)!=null&&D.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"}),[te,P]=v.useState(null),[ie,pe]=v.useState(0),[G,ce]=v.useState(""),[de,ee]=v.useState(()=>{try{return localStorage.getItem("letra-active-directory")}catch{return null}}),[U,fe]=v.useState(!1);v.useEffect(()=>{document.documentElement.classList.toggle("dark",T==="dark"),document.documentElement.classList.toggle("light",T==="light"),localStorage.setItem("letra-theme",T)},[T]);function Ee(b){fe(!1),localStorage.setItem("letra-active-workspace",JSON.stringify(b)),de&&(localStorage.removeItem("letra-active-directory"),ee(null)),j(b),x("supervision"),(b.root?fetch("/api/workspace/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:b.root})}):Promise.resolve()).then(()=>se()).catch(()=>se())}function xe(b){b?localStorage.setItem("letra-active-directory",b):localStorage.removeItem("letra-active-directory"),ee(b),fetch("/api/workspace/directory/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:b})}).then(()=>se()).catch(()=>se())}function _(){localStorage.removeItem("letra-active-workspace"),localStorage.removeItem("letra-active-directory"),j(null),ee(null),fe(!0),x("supervision")}function se(){Promise.all([fetch("/api/workflow").then(b=>b.json()),fetch("/api/workflow/active-flow").then(b=>b.json()).catch(()=>null)]).then(([b,D])=>{b&&!b.error&&o(b),u(D)})}function oe(b){b==="knowledge"&&g("context.md"),x(b)}function ye(b="context.md"){g(b),x("knowledge")}const E=v.useCallback(()=>{fetch("/api/health").then(b=>b.json()).then(b=>{const D=Array.isArray(b==null?void 0:b.active)?b.active:[],Y=(b==null?void 0:b.summary)??{};P({activeAlerts:typeof Y.activeAlerts=="number"?Y.activeAlerts:D.length,criticalAlerts:typeof Y.criticalAlerts=="number"?Y.criticalAlerts:D.filter(Q=>/crit|alta|high/.test(String((Q==null?void 0:Q.severity)??"").toLowerCase())).length})}).catch(()=>P(null))},[]);if(v.useEffect(()=>{const b=N!=null&&N.root?fetch("/api/workspace/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:N.root})}).then(()=>{}):Promise.resolve(),D=de?fetch("/api/workspace/directory/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:de})}).then(()=>{}):Promise.resolve();Promise.all([b,D]).then(()=>Promise.all([fetch("/api/workflow").then(Q=>Q.json()),fetch("/api/workflow/active-flow").then(Q=>Q.json()).catch(()=>null)])).then(([Q,le])=>{Q&&!Q.error&&o(Q),u(le),m(!1)}).catch(()=>m(!1)),E(),fetch("/api/workspaces").then(Q=>Q.json()).then(Q=>{Array.isArray(Q)&&w(Q)}).catch(()=>{});const Y=cx("/events");return Y.addEventListener("workflow-updated",()=>{se(),pe(Q=>Q+1),ce("Fluxo atualizado.")}),Y.addEventListener("diagnostics-updated",()=>{E(),pe(Q=>Q+1),ce("Diagnosticos atualizados.")}),()=>Y.close()},[E]),d)return l.jsxs("div",{className:"app-surface-base flex h-screen flex-col gap-6 p-6",children:[l.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-4",children:[l.jsx(ta,{}),l.jsx(ta,{}),l.jsx(ta,{}),l.jsx(ta,{})]}),l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3",children:[l.jsx(ta,{}),l.jsx(ta,{}),l.jsx(ta,{}),l.jsx(ta,{}),l.jsx(ta,{}),l.jsx(ta,{})]})]});const $=new URLSearchParams(window.location.search).get("setup")==="true";function me(){if(!s||$)return l.jsx(C0,{onComplete:b=>{o(b);const D=new URL(window.location.href);D.searchParams.delete("setup"),window.history.replaceState({},"",D.toString())}});if(!N)return l.jsx(a1,{onSelect:Ee,onWorkspacesLoaded:w,gateMode:!0,activeDirectory:de,startCreating:U});switch(h){case"supervision":return l.jsx(dp,{workflow:s,activeFlow:c,onTabChange:b=>x(b)});case"work":return l.jsx(gj,{workflow:s,activeFlow:c,specRefreshKey:ie,onItemMoved:se,onOpenSpec:()=>ye("specs")});case"knowledge":return l.jsx(Vj,{initialTab:y});case"activity":return l.jsx(Wj,{});case"agents":return l.jsx(Ij,{});case"settings":return l.jsx(l1,{workspace:N,onWorkspaceUpdated:b=>{j(b),w(D=>D.map(Y=>Y.id===b.id?b:Y))},onWorkspaceDeleted:()=>{fe(!1),j(null),x("supervision")},onRefreshWorkflow:se,onCreateWorkspace:_});default:return l.jsx(dp,{workflow:s,activeFlow:c,onTabChange:b=>x(b)})}}const ue=s?ur(s,c):new Set,k=(s==null?void 0:s.items.filter(b=>ue.has(b.stage)).length)??0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:G}),l.jsx(i0,{className:"min-h-svh w-full",style:{"--sidebar-width":"308px","--sidebar-width-icon":"3rem"},children:l.jsx(s1,{sidebar:l.jsx(S0,{activeTab:h,onTabChange:oe,gateCount:k,workspaceActive:!!N,activeWorkspace:N,activeDirectory:de,onDirectoryChange:xe,onOpenWorkspaceSettings:()=>x("settings")}),header:l.jsx(b0,{theme:T,onThemeChange:V,gateCount:k,activeDirectory:de,workspaces:A,activeWorkspace:N,onWorkspaceChange:Ee,onDirectoryChange:xe,health:te,onOpenHealthCenter:()=>x("supervision"),onOpenWorkspaceSettings:()=>x("settings")}),children:l.jsxs("main",{className:"flex min-h-0 flex-1 flex-col animate-fade-in",children:[l.jsx(n1,{activeFlow:c}),me()]})})})]})}function i1(){return l.jsx(Hy,{children:l.jsx(r1,{})})}Og.createRoot(document.getElementById("root")).render(l.jsx(v.StrictMode,{children:l.jsx(i1,{})}));
|