@agent-plan/pi-adapter 0.2.26 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,328 +0,0 @@
1
- var fS=Object.defineProperty;var hS=(e,n,r)=>n in e?fS(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var pa=(e,n,r)=>hS(e,typeof n!="symbol"?n+"":n,r);function mS(e,n){for(var r=0;r<n.length;r++){const s=n[r];if(typeof s!="string"&&!Array.isArray(s)){for(const u in s)if(u!=="default"&&!(u in e)){const c=Object.getOwnPropertyDescriptor(s,u);c&&Object.defineProperty(e,u,c.get?c:{enumerable:!0,get:()=>s[u]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function r(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(u){if(u.ep)return;u.ep=!0;const c=r(u);fetch(u.href,c)}})();function pS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ch={exports:{}},xo={};/**
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 qv;function gS(){if(qv)return xo;qv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,u,c){var f=null;if(c!==void 0&&(f=""+c),u.key!==void 0&&(f=""+u.key),"key"in u){c={};for(var h in u)h!=="key"&&(c[h]=u[h])}else c=u;return u=c.ref,{$$typeof:e,type:s,key:f,ref:u!==void 0?u:null,props:c}}return xo.Fragment=n,xo.jsx=r,xo.jsxs=r,xo}var Pv;function xS(){return Pv||(Pv=1,Ch.exports=gS()),Ch.exports}var o=xS(),Ah={exports:{}},at={};/**
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 Fv;function vS(){if(Fv)return at;Fv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),E=Symbol.iterator;function S(C){return C===null||typeof C!="object"?null:(C=E&&C[E]||C["@@iterator"],typeof C=="function"?C:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,R={};function z(C,B,K){this.props=C,this.context=B,this.refs=R,this.updater=K||w}z.prototype.isReactComponent={},z.prototype.setState=function(C,B){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,B,"setState")},z.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function I(){}I.prototype=z.prototype;function $(C,B,K){this.props=C,this.context=B,this.refs=R,this.updater=K||w}var Q=$.prototype=new I;Q.constructor=$,j(Q,z.prototype),Q.isPureReactComponent=!0;var J=Array.isArray;function ne(){}var M={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function fe(C,B,K){var ue=K.ref;return{$$typeof:e,type:C,key:B,ref:ue!==void 0?ue:null,props:K}}function pe(C,B){return fe(C.type,B,C.props)}function we(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function re(C){var B={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(K){return B[K]})}var je=/\/+/g;function Te(C,B){return typeof C=="object"&&C!==null&&C.key!=null?re(""+C.key):B.toString(36)}function ee(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(ne,ne):(C.status="pending",C.then(function(B){C.status==="pending"&&(C.status="fulfilled",C.value=B)},function(B){C.status==="pending"&&(C.status="rejected",C.reason=B)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function L(C,B,K,ue,ge){var xe=typeof C;(xe==="undefined"||xe==="boolean")&&(C=null);var Re=!1;if(C===null)Re=!0;else switch(xe){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(C.$$typeof){case e:case n:Re=!0;break;case y:return Re=C._init,L(Re(C._payload),B,K,ue,ge)}}if(Re)return ge=ge(C),Re=ue===""?"."+Te(C,0):ue,J(ge)?(K="",Re!=null&&(K=Re.replace(je,"$&/")+"/"),L(ge,B,K,"",function(Qe){return Qe})):ge!=null&&(we(ge)&&(ge=pe(ge,K+(ge.key==null||C&&C.key===ge.key?"":(""+ge.key).replace(je,"$&/")+"/")+Re)),B.push(ge)),1;Re=0;var He=ue===""?".":ue+":";if(J(C))for(var $e=0;$e<C.length;$e++)ue=C[$e],xe=He+Te(ue,$e),Re+=L(ue,B,K,xe,ge);else if($e=S(C),typeof $e=="function")for(C=$e.call(C),$e=0;!(ue=C.next()).done;)ue=ue.value,xe=He+Te(ue,$e++),Re+=L(ue,B,K,xe,ge);else if(xe==="object"){if(typeof C.then=="function")return L(ee(C),B,K,ue,ge);throw B=String(C),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return Re}function F(C,B,K){if(C==null)return C;var ue=[],ge=0;return L(C,ue,"","",function(xe){return B.call(K,xe,ge++)}),ue}function he(C){if(C._status===-1){var B=C._result;B=B(),B.then(function(K){(C._status===0||C._status===-1)&&(C._status=1,C._result=K)},function(K){(C._status===0||C._status===-1)&&(C._status=2,C._result=K)}),C._status===-1&&(C._status=0,C._result=B)}if(C._status===1)return C._result.default;throw C._result}var P=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},se={map:F,forEach:function(C,B,K){F(C,function(){B.apply(this,arguments)},K)},count:function(C){var B=0;return F(C,function(){B++}),B},toArray:function(C){return F(C,function(B){return B})||[]},only:function(C){if(!we(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return at.Activity=v,at.Children=se,at.Component=z,at.Fragment=r,at.Profiler=u,at.PureComponent=$,at.StrictMode=s,at.Suspense=p,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,at.__COMPILER_RUNTIME={__proto__:null,c:function(C){return M.H.useMemoCache(C)}},at.cache=function(C){return function(){return C.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(C,B,K){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ue=j({},C.props),ge=C.key;if(B!=null)for(xe in B.key!==void 0&&(ge=""+B.key),B)!T.call(B,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&B.ref===void 0||(ue[xe]=B[xe]);var xe=arguments.length-2;if(xe===1)ue.children=K;else if(1<xe){for(var Re=Array(xe),He=0;He<xe;He++)Re[He]=arguments[He+2];ue.children=Re}return fe(C.type,ge,ue)},at.createContext=function(C){return C={$$typeof:f,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},at.createElement=function(C,B,K){var ue,ge={},xe=null;if(B!=null)for(ue in B.key!==void 0&&(xe=""+B.key),B)T.call(B,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ge[ue]=B[ue]);var Re=arguments.length-2;if(Re===1)ge.children=K;else if(1<Re){for(var He=Array(Re),$e=0;$e<Re;$e++)He[$e]=arguments[$e+2];ge.children=He}if(C&&C.defaultProps)for(ue in Re=C.defaultProps,Re)ge[ue]===void 0&&(ge[ue]=Re[ue]);return fe(C,xe,ge)},at.createRef=function(){return{current:null}},at.forwardRef=function(C){return{$$typeof:h,render:C}},at.isValidElement=we,at.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:he}},at.memo=function(C,B){return{$$typeof:g,type:C,compare:B===void 0?null:B}},at.startTransition=function(C){var B=M.T,K={};M.T=K;try{var ue=C(),ge=M.S;ge!==null&&ge(K,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(ne,P)}catch(xe){P(xe)}finally{B!==null&&K.types!==null&&(B.types=K.types),M.T=B}},at.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},at.use=function(C){return M.H.use(C)},at.useActionState=function(C,B,K){return M.H.useActionState(C,B,K)},at.useCallback=function(C,B){return M.H.useCallback(C,B)},at.useContext=function(C){return M.H.useContext(C)},at.useDebugValue=function(){},at.useDeferredValue=function(C,B){return M.H.useDeferredValue(C,B)},at.useEffect=function(C,B){return M.H.useEffect(C,B)},at.useEffectEvent=function(C){return M.H.useEffectEvent(C)},at.useId=function(){return M.H.useId()},at.useImperativeHandle=function(C,B,K){return M.H.useImperativeHandle(C,B,K)},at.useInsertionEffect=function(C,B){return M.H.useInsertionEffect(C,B)},at.useLayoutEffect=function(C,B){return M.H.useLayoutEffect(C,B)},at.useMemo=function(C,B){return M.H.useMemo(C,B)},at.useOptimistic=function(C,B){return M.H.useOptimistic(C,B)},at.useReducer=function(C,B,K){return M.H.useReducer(C,B,K)},at.useRef=function(C){return M.H.useRef(C)},at.useState=function(C){return M.H.useState(C)},at.useSyncExternalStore=function(C,B,K){return M.H.useSyncExternalStore(C,B,K)},at.useTransition=function(){return M.H.useTransition()},at.version="19.2.7",at}var Vv;function Em(){return Vv||(Vv=1,Ah.exports=vS()),Ah.exports}var x=Em();const ua=pS(x),yS=mS({__proto__:null,default:ua},[x]);var Dh={exports:{}},vo={},Oh={exports:{}},Mh={};/**
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 Yv;function bS(){return Yv||(Yv=1,(function(e){function n(L,F){var he=L.length;L.push(F);e:for(;0<he;){var P=he-1>>>1,se=L[P];if(0<u(se,F))L[P]=F,L[he]=se,he=P;else break e}}function r(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var F=L[0],he=L.pop();if(he!==F){L[0]=he;e:for(var P=0,se=L.length,C=se>>>1;P<C;){var B=2*(P+1)-1,K=L[B],ue=B+1,ge=L[ue];if(0>u(K,he))ue<se&&0>u(ge,K)?(L[P]=ge,L[ue]=he,P=ue):(L[P]=K,L[B]=he,P=B);else if(ue<se&&0>u(ge,he))L[P]=ge,L[ue]=he,P=ue;else break e}}return F}function u(L,F){var he=L.sortIndex-F.sortIndex;return he!==0?he:L.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();e.unstable_now=function(){return f.now()-h}}var p=[],g=[],y=1,v=null,E=3,S=!1,w=!1,j=!1,R=!1,z=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function Q(L){for(var F=r(g);F!==null;){if(F.callback===null)s(g);else if(F.startTime<=L)s(g),F.sortIndex=F.expirationTime,n(p,F);else break;F=r(g)}}function J(L){if(j=!1,Q(L),!w)if(r(p)!==null)w=!0,ne||(ne=!0,re());else{var F=r(g);F!==null&&ee(J,F.startTime-L)}}var ne=!1,M=-1,T=5,fe=-1;function pe(){return R?!0:!(e.unstable_now()-fe<T)}function we(){if(R=!1,ne){var L=e.unstable_now();fe=L;var F=!0;try{e:{w=!1,j&&(j=!1,I(M),M=-1),S=!0;var he=E;try{t:{for(Q(L),v=r(p);v!==null&&!(v.expirationTime>L&&pe());){var P=v.callback;if(typeof P=="function"){v.callback=null,E=v.priorityLevel;var se=P(v.expirationTime<=L);if(L=e.unstable_now(),typeof se=="function"){v.callback=se,Q(L),F=!0;break t}v===r(p)&&s(p),Q(L)}else s(p);v=r(p)}if(v!==null)F=!0;else{var C=r(g);C!==null&&ee(J,C.startTime-L),F=!1}}break e}finally{v=null,E=he,S=!1}F=void 0}}finally{F?re():ne=!1}}}var re;if(typeof $=="function")re=function(){$(we)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Te=je.port2;je.port1.onmessage=we,re=function(){Te.postMessage(null)}}else re=function(){z(we,0)};function ee(L,F){M=z(function(){L(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return E},e.unstable_next=function(L){switch(E){case 1:case 2:case 3:var F=3;break;default:F=E}var he=E;E=F;try{return L()}finally{E=he}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(L,F){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var he=E;E=L;try{return F()}finally{E=he}},e.unstable_scheduleCallback=function(L,F,he){var P=e.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?P+he:P):he=P,L){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=he+se,L={id:y++,callback:F,priorityLevel:L,startTime:he,expirationTime:se,sortIndex:-1},he>P?(L.sortIndex=he,n(g,L),r(p)===null&&L===r(g)&&(j?(I(M),M=-1):j=!0,ee(J,he-P))):(L.sortIndex=se,n(p,L),w||S||(w=!0,ne||(ne=!0,re()))),L},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(L){var F=E;return function(){var he=E;E=F;try{return L.apply(this,arguments)}finally{E=he}}}})(Mh)),Mh}var Gv;function wS(){return Gv||(Gv=1,Oh.exports=bS()),Oh.exports}var _h={exports:{}},on={};/**
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 Xv;function SS(){if(Xv)return on;Xv=1;var e=Em();function n(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(p,g,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:v==null?null:""+v,children:p,containerInfo:g,implementation:y}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return on.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,on.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return c(p,g,null,y)},on.flushSync=function(p){var g=f.T,y=s.p;try{if(f.T=null,s.p=2,p)return p()}finally{f.T=g,s.p=y,s.d.f()}},on.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(p,g))},on.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},on.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,v=h(y,g.crossOrigin),E=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?s.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:E,fetchPriority:S}):y==="script"&&s.d.X(p,{crossOrigin:v,integrity:E,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},on.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=h(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(p)},on.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,v=h(y,g.crossOrigin);s.d.L(p,y,{crossOrigin:v,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})}},on.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=h(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(p)},on.requestFormReset=function(p){s.d.r(p)},on.unstable_batchedUpdates=function(p,g){return p(g)},on.useFormState=function(p,g,y){return f.H.useFormState(p,g,y)},on.useFormStatus=function(){return f.H.useHostTransitionStatus()},on.version="19.2.7",on}var Qv;function bb(){if(Qv)return _h.exports;Qv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),_h.exports=SS(),_h.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 Kv;function ES(){if(Kv)return vo;Kv=1;var e=wS(),n=Em(),r=bb();function s(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)a+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,l=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(l=a.return),t=a.return;while(t)}return a.tag===3?l:null}function f(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(s(188))}function g(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(s(188));return a!==t?null:t}for(var l=t,i=a;;){var d=l.return;if(d===null)break;var m=d.alternate;if(m===null){if(i=d.return,i!==null){l=i;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===l)return p(d),t;if(m===i)return p(d),a;m=m.sibling}throw Error(s(188))}if(l.return!==i.return)l=d,i=m;else{for(var b=!1,N=d.child;N;){if(N===l){b=!0,l=d,i=m;break}if(N===i){b=!0,i=d,l=m;break}N=N.sibling}if(!b){for(N=m.child;N;){if(N===l){b=!0,l=m,i=d;break}if(N===i){b=!0,i=m,l=d;break}N=N.sibling}if(!b)throw Error(s(189))}}if(l.alternate!==i)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?t:a}function y(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=y(t),a!==null)return a;t=t.sibling}return null}var v=Object.assign,E=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),$=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function re(t){return t===null||typeof t!="object"?null:(t=we&&t[we]||t["@@iterator"],typeof t=="function"?t:null)}var je=Symbol.for("react.client.reference");function Te(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===je?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case j:return"Fragment";case z:return"Profiler";case R:return"StrictMode";case J:return"Suspense";case ne:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case $:return t.displayName||"Context";case I:return(t._context.displayName||"Context")+".Consumer";case Q:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return a=t.displayName||null,a!==null?a:Te(t.type)||"Memo";case T:a=t._payload,t=t._init;try{return Te(t(a))}catch{}}return null}var ee=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},P=[],se=-1;function C(t){return{current:t}}function B(t){0>se||(t.current=P[se],P[se]=null,se--)}function K(t,a){se++,P[se]=t.current,t.current=a}var ue=C(null),ge=C(null),xe=C(null),Re=C(null);function He(t,a){switch(K(xe,a),K(ge,t),K(ue,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?dv(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=dv(a),t=fv(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}B(ue),K(ue,t)}function $e(){B(ue),B(ge),B(xe)}function Qe(t){t.memoizedState!==null&&K(Re,t);var a=ue.current,l=fv(a,t.type);a!==l&&(K(ge,t),K(ue,l))}function ia(t){ge.current===t&&(B(ue),B(ge)),Re.current===t&&(B(Re),ho._currentValue=he)}var $t,mt;function ce(t){if($t===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);$t=a&&a[1]||"",mt=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+$t+t+mt}var qe=!1;function lt(t,a){if(!t||qe)return"";qe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(a){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(Z){var X=Z}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(Z){X=Z}t.call(oe.prototype)}}else{try{throw Error()}catch(Z){X=Z}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(Z){if(Z&&X&&typeof Z.stack=="string")return[Z.stack,X.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),b=m[0],N=m[1];if(b&&N){var D=b.split(`
44
- `),Y=N.split(`
45
- `);for(d=i=0;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(i===D.length||d===Y.length)for(i=D.length-1,d=Y.length-1;1<=i&&0<=d&&D[i]!==Y[d];)d--;for(;1<=i&&0<=d;i--,d--)if(D[i]!==Y[d]){if(i!==1||d!==1)do if(i--,d--,0>d||D[i]!==Y[d]){var ae=`
46
- `+D[i].replace(" at new "," at ");return t.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",t.displayName)),ae}while(1<=i&&0<=d);break}}}finally{qe=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?ce(l):""}function Bt(t,a){switch(t.tag){case 26:case 27:case 5:return ce(t.type);case 16:return ce("Lazy");case 13:return t.child!==a&&a!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return lt(t.type,!1);case 11:return lt(t.type.render,!1);case 1:return lt(t.type,!0);case 31:return ce("Activity");default:return""}}function xa(t){try{var a="",l=null;do a+=Bt(t,l),l=t,t=t.return;while(t);return a}catch(i){return`
47
- Error generating stack: `+i.message+`
48
- `+i.stack}}var kt=Object.prototype.hasOwnProperty,Lt=e.unstable_scheduleCallback,Kt=e.unstable_cancelCallback,$a=e.unstable_shouldYield,Ba=e.unstable_requestPaint,aa=e.unstable_now,fn=e.unstable_getCurrentPriorityLevel,hn=e.unstable_ImmediatePriority,en=e.unstable_UserBlockingPriority,Ha=e.unstable_NormalPriority,me=e.unstable_LowPriority,Ce=e.unstable_IdlePriority,Ae=e.log,Xe=e.unstable_setDisableYieldValue,Pe=null,te=null;function Tt(t){if(typeof Ae=="function"&&Xe(t),te&&typeof te.setStrictMode=="function")try{te.setStrictMode(Pe,t)}catch{}}var Zt=Math.clz32?Math.clz32:qn,Fa=Math.log,va=Math.LN2;function qn(t){return t>>>=0,t===0?32:31-(Fa(t)/va|0)|0}var _e=256,vt=262144,yt=4194304;function St(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ht(t,a,l){var i=t.pendingLanes;if(i===0)return 0;var d=0,m=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var N=i&134217727;return N!==0?(i=N&~m,i!==0?d=St(i):(b&=N,b!==0?d=St(b):l||(l=N&~t,l!==0&&(d=St(l))))):(N=i&~m,N!==0?d=St(N):b!==0?d=St(b):l||(l=i&~t,l!==0&&(d=St(l)))),d===0?0:a!==0&&a!==d&&(a&m)===0&&(m=d&-d,l=a&-a,m>=l||m===32&&(l&4194048)!==0)?a:d}function Ct(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function na(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Wt(){var t=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),t}function It(t){for(var a=[],l=0;31>l;l++)a.push(t);return a}function pt(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function et(t,a,l,i,d,m){var b=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var N=t.entanglements,D=t.expirationTimes,Y=t.hiddenUpdates;for(l=b&~l;0<l;){var ae=31-Zt(l),oe=1<<ae;N[ae]=0,D[ae]=-1;var X=Y[ae];if(X!==null)for(Y[ae]=null,ae=0;ae<X.length;ae++){var Z=X[ae];Z!==null&&(Z.lane&=-536870913)}l&=~oe}i!==0&&Sa(t,i,0),m!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=m&~(b&~a))}function Sa(t,a,l){t.pendingLanes|=a,t.suspendedLanes&=~a;var i=31-Zt(a);t.entangledLanes|=a,t.entanglements[i]=t.entanglements[i]|1073741824|l&261930}function Da(t,a){var l=t.entangledLanes|=a;for(t=t.entanglements;l;){var i=31-Zt(l),d=1<<i;d&a|t[i]&a&&(t[i]|=a),l&=~d}}function A(t,a){var l=a&-a;return l=(l&42)!==0?1:_(l),(l&(t.suspendedLanes|a))!==0?0:l}function _(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function q(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function W(){var t=F.p;return t!==0?t:(t=window.event,t===void 0?32:Lv(t.type))}function ie(t,a){var l=F.p;try{return F.p=t,a()}finally{F.p=l}}var ke=Math.random().toString(36).slice(2),ye="__reactFiber$"+ke,De="__reactProps$"+ke,Ne="__reactContainer$"+ke,Le="__reactEvents$"+ke,Ue="__reactListeners$"+ke,Ke="__reactHandles$"+ke,Oe="__reactResources$"+ke,Je="__reactMarker$"+ke;function Fe(t){delete t[ye],delete t[De],delete t[Le],delete t[Ue],delete t[Ke]}function qt(t){var a=t[ye];if(a)return a;for(var l=t.parentNode;l;){if(a=l[Ne]||l[ye]){if(l=a.alternate,a.child!==null||l!==null&&l.child!==null)for(t=yv(t);t!==null;){if(l=t[ye])return l;t=yv(t)}return a}t=l,l=t.parentNode}return null}function tt(t){if(t=t[ye]||t[Ne]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function ft(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(s(33))}function ut(t){var a=t[Oe];return a||(a=t[Oe]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function ht(t){t[Je]=!0}var Jt=new Set,Va={};function Ea(t,a){Oa(t,a),Oa(t+"Capture",a)}function Oa(t,a){for(Va[t]=a,t=0;t<a.length;t++)Jt.add(a[t])}var Ma=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]*$"),Ya={},xn={};function hl(t){return kt.call(xn,t)?!0:kt.call(Ya,t)?!1:Ma.test(t)?xn[t]=!0:(Ya[t]=!0,!1)}function tn(t,a,l){if(hl(a))if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var i=a.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+l)}}function xr(t,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+l)}}function Ze(t,a,l,i){if(i===null)t.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(a,l,""+i)}}function Nt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ea(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function an(t,a,l){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,m=i.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return d.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,a,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function _a(t){if(!t._valueTracker){var a=ea(t)?"checked":"value";t._valueTracker=an(t,a,""+t[a])}}function _r(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var l=a.getValue(),i="";return t&&(i=ea(t)?t.checked?"true":"false":t.value),t=i,t!==l?(a.setValue(t),!0):!1}function jt(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Cn=/[\n"\\]/g;function Ga(t){return t.replace(Cn,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Zl(t,a,l,i,d,m,b,N){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),a!=null?b==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+Nt(a)):t.value!==""+Nt(a)&&(t.value=""+Nt(a)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),a!=null?At(t,b,Nt(a)):l!=null?At(t,b,Nt(l)):i!=null&&t.removeAttribute("value"),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.name=""+Nt(N):t.removeAttribute("name")}function Ti(t,a,l,i,d,m,b,N){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),a!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||a!=null)){_a(t);return}l=l!=null?""+Nt(l):"",a=a!=null?""+Nt(a):l,N||a===t.value||(t.value=a),t.defaultValue=a}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=N?t.checked:!!i,t.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),_a(t)}function At(t,a,l){a==="number"&&jt(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function vr(t,a,l,i){if(t=t.options,a){a={};for(var d=0;d<l.length;d++)a["$"+l[d]]=!0;for(l=0;l<t.length;l++)d=a.hasOwnProperty("$"+t[l].value),t[l].selected!==d&&(t[l].selected=d),d&&i&&(t[l].defaultSelected=!0)}else{for(l=""+Nt(l),a=null,d=0;d<t.length;d++){if(t[d].value===l){t[d].selected=!0,i&&(t[d].defaultSelected=!0);return}a!==null||t[d].disabled||(a=t[d])}a!==null&&(a.selected=!0)}}function uc(t,a,l){if(a!=null&&(a=""+Nt(a),a!==t.value&&(t.value=a),l==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=l!=null?""+Nt(l):""}function ir(t,a,l,i){if(a==null){if(i!=null){if(l!=null)throw Error(s(92));if(ee(i)){if(1<i.length)throw Error(s(93));i=i[0]}l=i}l==null&&(l=""),a=l}l=Nt(a),t.defaultValue=l,i=t.textContent,i===l&&i!==""&&i!==null&&(t.value=i),_a(t)}function ml(t,a){if(a){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=a;return}}t.textContent=a}var Cd=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 ks(t,a,l){var i=a.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":i?t.setProperty(a,l):typeof l!="number"||l===0||Cd.has(a)?a==="float"?t.cssFloat=l:t[a]=(""+l).trim():t[a]=l+"px"}function vn(t,a,l){if(a!=null&&typeof a!="object")throw Error(s(62));if(t=t.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||a!=null&&a.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var d in a)i=a[d],a.hasOwnProperty(d)&&l[d]!==i&&ks(t,d,i)}else for(var m in a)a.hasOwnProperty(m)&&ks(t,m,a[m])}function Wl(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Ts=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"]]),yn=/^[\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 ra(t){return yn.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function nn(){}var An=null;function Lr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var yr=null,zr=null;function Ci(t){var a=tt(t);if(a&&(t=a.stateNode)){var l=t[De]||null;e:switch(t=a.stateNode,a.type){case"input":if(Zl(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),a=l.name,l.type==="radio"&&a!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ga(""+a)+'"][type="radio"]'),a=0;a<l.length;a++){var i=l[a];if(i!==t&&i.form===t.form){var d=i[De]||null;if(!d)throw Error(s(90));Zl(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(a=0;a<l.length;a++)i=l[a],i.form===t.form&&_r(i)}break e;case"textarea":uc(t,l.value,l.defaultValue);break e;case"select":a=l.value,a!=null&&vr(t,!!l.multiple,a,!1)}}}var br=!1;function Ai(t,a,l){if(br)return t(a,l);br=!0;try{var i=t(a);return i}finally{if(br=!1,(yr!==null||zr!==null)&&(Zc(),yr&&(a=yr,t=zr,zr=yr=null,Ci(a),t)))for(a=0;a<t.length;a++)Ci(t[a])}}function Pn(t,a){var l=t.stateNode;if(l===null)return null;var i=l[De]||null;if(i===null)return null;l=i[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(s(231,a,typeof l));return l}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Di=!1;if(or)try{var Ur={};Object.defineProperty(Ur,"passive",{get:function(){Di=!0}}),window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{Di=!1}var Fn=null,Oi=null,Cs=null;function dc(){if(Cs)return Cs;var t,a=Oi,l=a.length,i,d="value"in Fn?Fn.value:Fn.textContent,m=d.length;for(t=0;t<l&&a[t]===d[t];t++);var b=l-t;for(i=1;i<=b&&a[l-i]===d[m-i];i++);return Cs=d.slice(t,1<i?1-i:void 0)}function As(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function $r(){return!0}function fc(){return!1}function rn(t){function a(l,i,d,m,b){this._reactName=l,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var N in t)t.hasOwnProperty(N)&&(l=t[N],this[N]=l?l(m):m[N]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?$r:fc,this.isPropagationStopped=fc,this}return v(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=$r)},persist:function(){},isPersistent:$r}),a}var Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hr=rn(Br),Jl=v({},Br,{view:0,detail:0}),Ad=rn(Jl),pl,es,ts,Ir=v({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sn,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ts&&(ts&&t.type==="mousemove"?(pl=t.screenX-ts.screenX,es=t.screenY-ts.screenY):es=pl=0,ts=t),pl)},movementY:function(t){return"movementY"in t?t.movementY:es}}),hc=rn(Ir),k=v({},Ir,{dataTransfer:0}),G=rn(k),Ee=v({},Jl,{relatedTarget:0}),be=rn(Ee),Ge=v({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),de=rn(Ge),ve=v({},Br,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Se=rn(ve),We=v({},Br,{data:0}),st=rn(We),Be={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Na={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"},zt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ln(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=zt[t])?!!a[t]:!1}function sn(){return ln}var bn=v({},Jl,{key:function(t){if(t.key){var a=Be[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=As(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Na[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sn,charCode:function(t){return t.type==="keypress"?As(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?As(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ja=rn(bn),da=v({},Ir,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ut=rn(da),as=v({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sn}),wr=rn(as),Dd=v({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),mc=rn(Dd),pc=v({},Ir,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Od=rn(pc),Md=v({},Br,{newState:0,oldState:0}),M1=rn(Md),_1=[9,13,27,32],_d=or&&"CompositionEvent"in window,Mi=null;or&&"documentMode"in document&&(Mi=document.documentMode);var L1=or&&"TextEvent"in window&&!Mi,xp=or&&(!_d||Mi&&8<Mi&&11>=Mi),vp=" ",yp=!1;function bp(t,a){switch(t){case"keyup":return _1.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ds=!1;function z1(t,a){switch(t){case"compositionend":return wp(a);case"keypress":return a.which!==32?null:(yp=!0,vp);case"textInput":return t=a.data,t===vp&&yp?null:t;default:return null}}function U1(t,a){if(Ds)return t==="compositionend"||!_d&&bp(t,a)?(t=dc(),Cs=Oi=Fn=null,Ds=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return xp&&a.locale!=="ko"?null:a.data;default:return null}}var $1={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 Sp(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!$1[t.type]:a==="textarea"}function Ep(t,a,l,i){yr?zr?zr.push(i):zr=[i]:yr=i,a=ru(a,"onChange"),0<a.length&&(l=new Hr("onChange","change",null,l,i),t.push({event:l,listeners:a}))}var _i=null,Li=null;function B1(t){lv(t,0)}function gc(t){var a=ft(t);if(_r(a))return t}function Np(t,a){if(t==="change")return a}var jp=!1;if(or){var Ld;if(or){var zd="oninput"in document;if(!zd){var Rp=document.createElement("div");Rp.setAttribute("oninput","return;"),zd=typeof Rp.oninput=="function"}Ld=zd}else Ld=!1;jp=Ld&&(!document.documentMode||9<document.documentMode)}function kp(){_i&&(_i.detachEvent("onpropertychange",Tp),Li=_i=null)}function Tp(t){if(t.propertyName==="value"&&gc(Li)){var a=[];Ep(a,Li,t,Lr(t)),Ai(B1,a)}}function H1(t,a,l){t==="focusin"?(kp(),_i=a,Li=l,_i.attachEvent("onpropertychange",Tp)):t==="focusout"&&kp()}function I1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return gc(Li)}function q1(t,a){if(t==="click")return gc(a)}function P1(t,a){if(t==="input"||t==="change")return gc(a)}function F1(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var Dn=typeof Object.is=="function"?Object.is:F1;function zi(t,a){if(Dn(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var l=Object.keys(t),i=Object.keys(a);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var d=l[i];if(!kt.call(a,d)||!Dn(t[d],a[d]))return!1}return!0}function Cp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ap(t,a){var l=Cp(t);t=0;for(var i;l;){if(l.nodeType===3){if(i=t+l.textContent.length,t<=a&&i>=a)return{node:l,offset:a-t};t=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Cp(l)}}function Dp(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Dp(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Op(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=jt(t.document);a instanceof t.HTMLIFrameElement;){try{var l=typeof a.contentWindow.location.href=="string"}catch{l=!1}if(l)t=a.contentWindow;else break;a=jt(t.document)}return a}function Ud(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var V1=or&&"documentMode"in document&&11>=document.documentMode,Os=null,$d=null,Ui=null,Bd=!1;function Mp(t,a,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Bd||Os==null||Os!==jt(i)||(i=Os,"selectionStart"in i&&Ud(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ui&&zi(Ui,i)||(Ui=i,i=ru($d,"onSelect"),0<i.length&&(a=new Hr("onSelect","select",null,a,l),t.push({event:a,listeners:i}),a.target=Os)))}function ns(t,a){var l={};return l[t.toLowerCase()]=a.toLowerCase(),l["Webkit"+t]="webkit"+a,l["Moz"+t]="moz"+a,l}var Ms={animationend:ns("Animation","AnimationEnd"),animationiteration:ns("Animation","AnimationIteration"),animationstart:ns("Animation","AnimationStart"),transitionrun:ns("Transition","TransitionRun"),transitionstart:ns("Transition","TransitionStart"),transitioncancel:ns("Transition","TransitionCancel"),transitionend:ns("Transition","TransitionEnd")},Hd={},_p={};or&&(_p=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function rs(t){if(Hd[t])return Hd[t];if(!Ms[t])return t;var a=Ms[t],l;for(l in a)if(a.hasOwnProperty(l)&&l in _p)return Hd[t]=a[l];return t}var Lp=rs("animationend"),zp=rs("animationiteration"),Up=rs("animationstart"),Y1=rs("transitionrun"),G1=rs("transitionstart"),X1=rs("transitioncancel"),$p=rs("transitionend"),Bp=new Map,Id="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(" ");Id.push("scrollEnd");function cr(t,a){Bp.set(t,a),Ea(a,[t])}var xc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Vn=[],_s=0,qd=0;function vc(){for(var t=_s,a=qd=_s=0;a<t;){var l=Vn[a];Vn[a++]=null;var i=Vn[a];Vn[a++]=null;var d=Vn[a];Vn[a++]=null;var m=Vn[a];if(Vn[a++]=null,i!==null&&d!==null){var b=i.pending;b===null?d.next=d:(d.next=b.next,b.next=d),i.pending=d}m!==0&&Hp(l,d,m)}}function yc(t,a,l,i){Vn[_s++]=t,Vn[_s++]=a,Vn[_s++]=l,Vn[_s++]=i,qd|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Pd(t,a,l,i){return yc(t,a,l,i),bc(t)}function ls(t,a){return yc(t,null,null,a),bc(t)}function Hp(t,a,l){t.lanes|=l;var i=t.alternate;i!==null&&(i.lanes|=l);for(var d=!1,m=t.return;m!==null;)m.childLanes|=l,i=m.alternate,i!==null&&(i.childLanes|=l),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(d=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,d&&a!==null&&(d=31-Zt(l),t=m.hiddenUpdates,i=t[d],i===null?t[d]=[a]:i.push(a),a.lane=l|536870912),m):null}function bc(t){if(50<lo)throw lo=0,Jf=null,Error(s(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var Ls={};function Q1(t,a,l,i){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(t,a,l,i){return new Q1(t,a,l,i)}function Fd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qr(t,a){var l=t.alternate;return l===null?(l=On(t.tag,a,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=a,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,a=t.dependencies,l.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Ip(t,a){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,a=l.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function wc(t,a,l,i,d,m){var b=0;if(i=t,typeof t=="function")Fd(t)&&(b=1);else if(typeof t=="string")b=eS(t,l,ue.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=On(31,l,a,d),t.elementType=fe,t.lanes=m,t;case j:return ss(l.children,d,m,a);case R:b=8,d|=24;break;case z:return t=On(12,l,a,d|2),t.elementType=z,t.lanes=m,t;case J:return t=On(13,l,a,d),t.elementType=J,t.lanes=m,t;case ne:return t=On(19,l,a,d),t.elementType=ne,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:b=10;break e;case I:b=9;break e;case Q:b=11;break e;case M:b=14;break e;case T:b=16,i=null;break e}b=29,l=Error(s(130,t===null?"null":typeof t,"")),i=null}return a=On(b,l,a,d),a.elementType=t,a.type=i,a.lanes=m,a}function ss(t,a,l,i){return t=On(7,t,i,a),t.lanes=l,t}function Vd(t,a,l){return t=On(6,t,null,a),t.lanes=l,t}function qp(t){var a=On(18,null,null,0);return a.stateNode=t,a}function Yd(t,a,l){return a=On(4,t.children!==null?t.children:[],t.key,a),a.lanes=l,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var Pp=new WeakMap;function Yn(t,a){if(typeof t=="object"&&t!==null){var l=Pp.get(t);return l!==void 0?l:(a={value:t,source:a,stack:xa(a)},Pp.set(t,a),a)}return{value:t,source:a,stack:xa(a)}}var zs=[],Us=0,Sc=null,$i=0,Gn=[],Xn=0,gl=null,Sr=1,Er="";function Pr(t,a){zs[Us++]=$i,zs[Us++]=Sc,Sc=t,$i=a}function Fp(t,a,l){Gn[Xn++]=Sr,Gn[Xn++]=Er,Gn[Xn++]=gl,gl=t;var i=Sr;t=Er;var d=32-Zt(i)-1;i&=~(1<<d),l+=1;var m=32-Zt(a)+d;if(30<m){var b=d-d%5;m=(i&(1<<b)-1).toString(32),i>>=b,d-=b,Sr=1<<32-Zt(a)+d|l<<d|i,Er=m+t}else Sr=1<<m|l<<d|i,Er=t}function Gd(t){t.return!==null&&(Pr(t,1),Fp(t,1,0))}function Xd(t){for(;t===Sc;)Sc=zs[--Us],zs[Us]=null,$i=zs[--Us],zs[Us]=null;for(;t===gl;)gl=Gn[--Xn],Gn[Xn]=null,Er=Gn[--Xn],Gn[Xn]=null,Sr=Gn[--Xn],Gn[Xn]=null}function Vp(t,a){Gn[Xn++]=Sr,Gn[Xn++]=Er,Gn[Xn++]=gl,Sr=a.id,Er=a.overflow,gl=t}var Xa=null,la=null,Et=!1,xl=null,Qn=!1,Qd=Error(s(519));function vl(t){var a=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bi(Yn(a,t)),Qd}function Yp(t){var a=t.stateNode,l=t.type,i=t.memoizedProps;switch(a[ye]=t,a[De]=i,l){case"dialog":xt("cancel",a),xt("close",a);break;case"iframe":case"object":case"embed":xt("load",a);break;case"video":case"audio":for(l=0;l<io.length;l++)xt(io[l],a);break;case"source":xt("error",a);break;case"img":case"image":case"link":xt("error",a),xt("load",a);break;case"details":xt("toggle",a);break;case"input":xt("invalid",a),Ti(a,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":xt("invalid",a);break;case"textarea":xt("invalid",a),ir(a,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||a.textContent===""+l||i.suppressHydrationWarning===!0||cv(a.textContent,l)?(i.popover!=null&&(xt("beforetoggle",a),xt("toggle",a)),i.onScroll!=null&&xt("scroll",a),i.onScrollEnd!=null&&xt("scrollend",a),i.onClick!=null&&(a.onclick=nn),a=!0):a=!1,a||vl(t,!0)}function Gp(t){for(Xa=t.return;Xa;)switch(Xa.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Xa=Xa.return}}function $s(t){if(t!==Xa)return!1;if(!Et)return Gp(t),Et=!0,!1;var a=t.tag,l;if((l=a!==3&&a!==27)&&((l=a===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||mh(t.type,t.memoizedProps)),l=!l),l&&la&&vl(t),Gp(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));la=vv(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));la=vv(t)}else a===27?(a=la,Ol(t.type)?(t=yh,yh=null,la=t):la=a):la=Xa?Zn(t.stateNode.nextSibling):null;return!0}function is(){la=Xa=null,Et=!1}function Kd(){var t=xl;return t!==null&&(Nn===null?Nn=t:Nn.push.apply(Nn,t),xl=null),t}function Bi(t){xl===null?xl=[t]:xl.push(t)}var Zd=C(null),os=null,Fr=null;function yl(t,a,l){K(Zd,a._currentValue),a._currentValue=l}function Vr(t){t._currentValue=Zd.current,B(Zd)}function Wd(t,a,l){for(;t!==null;){var i=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,i!==null&&(i.childLanes|=a)):i!==null&&(i.childLanes&a)!==a&&(i.childLanes|=a),t===l)break;t=t.return}}function Jd(t,a,l,i){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var m=d.dependencies;if(m!==null){var b=d.child;m=m.firstContext;e:for(;m!==null;){var N=m;m=d;for(var D=0;D<a.length;D++)if(N.context===a[D]){m.lanes|=l,N=m.alternate,N!==null&&(N.lanes|=l),Wd(m.return,l,t),i||(b=null);break e}m=N.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(s(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),Wd(b,l,t),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===t){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Bs(t,a,l,i){t=null;for(var d=a,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var b=d.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var N=d.type;Dn(d.pendingProps.value,b.value)||(t!==null?t.push(N):t=[N])}}else if(d===Re.current){if(b=d.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(ho):t=[ho])}d=d.return}t!==null&&Jd(a,t,l,i),a.flags|=262144}function Ec(t){for(t=t.firstContext;t!==null;){if(!Dn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function cs(t){os=t,Fr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Qa(t){return Xp(os,t)}function Nc(t,a){return os===null&&cs(t),Xp(t,a)}function Xp(t,a){var l=a._currentValue;if(a={context:a,memoizedValue:l,next:null},Fr===null){if(t===null)throw Error(s(308));Fr=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else Fr=Fr.next=a;return l}var K1=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(l,i){t.push(i)}};this.abort=function(){a.aborted=!0,t.forEach(function(l){return l()})}},Z1=e.unstable_scheduleCallback,W1=e.unstable_NormalPriority,Ra={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ef(){return{controller:new K1,data:new Map,refCount:0}}function Hi(t){t.refCount--,t.refCount===0&&Z1(W1,function(){t.controller.abort()})}var Ii=null,tf=0,Hs=0,Is=null;function J1(t,a){if(Ii===null){var l=Ii=[];tf=0,Hs=lh(),Is={status:"pending",value:void 0,then:function(i){l.push(i)}}}return tf++,a.then(Qp,Qp),a}function Qp(){if(--tf===0&&Ii!==null){Is!==null&&(Is.status="fulfilled");var t=Ii;Ii=null,Hs=0,Is=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function ew(t,a){var l=[],i={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return t.then(function(){i.status="fulfilled",i.value=a;for(var d=0;d<l.length;d++)(0,l[d])(a)},function(d){for(i.status="rejected",i.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),i}var Kp=L.S;L.S=function(t,a){Mx=aa(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&J1(t,a),Kp!==null&&Kp(t,a)};var us=C(null);function af(){var t=us.current;return t!==null?t:ta.pooledCache}function jc(t,a){a===null?K(us,us.current):K(us,a.pool)}function Zp(){var t=af();return t===null?null:{parent:Ra._currentValue,pool:t}}var qs=Error(s(460)),nf=Error(s(474)),Rc=Error(s(542)),kc={then:function(){}};function Wp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Jp(t,a,l){switch(l=t[l],l===void 0?t.push(a):l!==a&&(a.then(nn,nn),a=l),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,tg(t),t;default:if(typeof a.status=="string")a.then(nn,nn);else{if(t=ta,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=a,t.status="pending",t.then(function(i){if(a.status==="pending"){var d=a;d.status="fulfilled",d.value=i}},function(i){if(a.status==="pending"){var d=a;d.status="rejected",d.reason=i}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,tg(t),t}throw fs=a,qs}}function ds(t){try{var a=t._init;return a(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(fs=l,qs):l}}var fs=null;function eg(){if(fs===null)throw Error(s(459));var t=fs;return fs=null,t}function tg(t){if(t===qs||t===Rc)throw Error(s(483))}var Ps=null,qi=0;function Tc(t){var a=qi;return qi+=1,Ps===null&&(Ps=[]),Jp(Ps,t,a)}function Pi(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Cc(t,a){throw a.$$typeof===E?Error(s(525)):(t=Object.prototype.toString.call(a),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function ag(t){function a(H,U){if(t){var V=H.deletions;V===null?(H.deletions=[U],H.flags|=16):V.push(U)}}function l(H,U){if(!t)return null;for(;U!==null;)a(H,U),U=U.sibling;return null}function i(H){for(var U=new Map;H!==null;)H.key!==null?U.set(H.key,H):U.set(H.index,H),H=H.sibling;return U}function d(H,U){return H=qr(H,U),H.index=0,H.sibling=null,H}function m(H,U,V){return H.index=V,t?(V=H.alternate,V!==null?(V=V.index,V<U?(H.flags|=67108866,U):V):(H.flags|=67108866,U)):(H.flags|=1048576,U)}function b(H){return t&&H.alternate===null&&(H.flags|=67108866),H}function N(H,U,V,le){return U===null||U.tag!==6?(U=Vd(V,H.mode,le),U.return=H,U):(U=d(U,V),U.return=H,U)}function D(H,U,V,le){var Ie=V.type;return Ie===j?ae(H,U,V.props.children,le,V.key):U!==null&&(U.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===T&&ds(Ie)===U.type)?(U=d(U,V.props),Pi(U,V),U.return=H,U):(U=wc(V.type,V.key,V.props,null,H.mode,le),Pi(U,V),U.return=H,U)}function Y(H,U,V,le){return U===null||U.tag!==4||U.stateNode.containerInfo!==V.containerInfo||U.stateNode.implementation!==V.implementation?(U=Yd(V,H.mode,le),U.return=H,U):(U=d(U,V.children||[]),U.return=H,U)}function ae(H,U,V,le,Ie){return U===null||U.tag!==7?(U=ss(V,H.mode,le,Ie),U.return=H,U):(U=d(U,V),U.return=H,U)}function oe(H,U,V){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Vd(""+U,H.mode,V),U.return=H,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return V=wc(U.type,U.key,U.props,null,H.mode,V),Pi(V,U),V.return=H,V;case w:return U=Yd(U,H.mode,V),U.return=H,U;case T:return U=ds(U),oe(H,U,V)}if(ee(U)||re(U))return U=ss(U,H.mode,V,null),U.return=H,U;if(typeof U.then=="function")return oe(H,Tc(U),V);if(U.$$typeof===$)return oe(H,Nc(H,U),V);Cc(H,U)}return null}function X(H,U,V,le){var Ie=U!==null?U.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ie!==null?null:N(H,U,""+V,le);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===Ie?D(H,U,V,le):null;case w:return V.key===Ie?Y(H,U,V,le):null;case T:return V=ds(V),X(H,U,V,le)}if(ee(V)||re(V))return Ie!==null?null:ae(H,U,V,le,null);if(typeof V.then=="function")return X(H,U,Tc(V),le);if(V.$$typeof===$)return X(H,U,Nc(H,V),le);Cc(H,V)}return null}function Z(H,U,V,le,Ie){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(V)||null,N(U,H,""+le,Ie);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case S:return H=H.get(le.key===null?V:le.key)||null,D(U,H,le,Ie);case w:return H=H.get(le.key===null?V:le.key)||null,Y(U,H,le,Ie);case T:return le=ds(le),Z(H,U,V,le,Ie)}if(ee(le)||re(le))return H=H.get(V)||null,ae(U,H,le,Ie,null);if(typeof le.then=="function")return Z(H,U,V,Tc(le),Ie);if(le.$$typeof===$)return Z(H,U,V,Nc(U,le),Ie);Cc(U,le)}return null}function Me(H,U,V,le){for(var Ie=null,Dt=null,ze=U,dt=U=0,wt=null;ze!==null&&dt<V.length;dt++){ze.index>dt?(wt=ze,ze=null):wt=ze.sibling;var Ot=X(H,ze,V[dt],le);if(Ot===null){ze===null&&(ze=wt);break}t&&ze&&Ot.alternate===null&&a(H,ze),U=m(Ot,U,dt),Dt===null?Ie=Ot:Dt.sibling=Ot,Dt=Ot,ze=wt}if(dt===V.length)return l(H,ze),Et&&Pr(H,dt),Ie;if(ze===null){for(;dt<V.length;dt++)ze=oe(H,V[dt],le),ze!==null&&(U=m(ze,U,dt),Dt===null?Ie=ze:Dt.sibling=ze,Dt=ze);return Et&&Pr(H,dt),Ie}for(ze=i(ze);dt<V.length;dt++)wt=Z(ze,H,dt,V[dt],le),wt!==null&&(t&&wt.alternate!==null&&ze.delete(wt.key===null?dt:wt.key),U=m(wt,U,dt),Dt===null?Ie=wt:Dt.sibling=wt,Dt=wt);return t&&ze.forEach(function(Ul){return a(H,Ul)}),Et&&Pr(H,dt),Ie}function Ye(H,U,V,le){if(V==null)throw Error(s(151));for(var Ie=null,Dt=null,ze=U,dt=U=0,wt=null,Ot=V.next();ze!==null&&!Ot.done;dt++,Ot=V.next()){ze.index>dt?(wt=ze,ze=null):wt=ze.sibling;var Ul=X(H,ze,Ot.value,le);if(Ul===null){ze===null&&(ze=wt);break}t&&ze&&Ul.alternate===null&&a(H,ze),U=m(Ul,U,dt),Dt===null?Ie=Ul:Dt.sibling=Ul,Dt=Ul,ze=wt}if(Ot.done)return l(H,ze),Et&&Pr(H,dt),Ie;if(ze===null){for(;!Ot.done;dt++,Ot=V.next())Ot=oe(H,Ot.value,le),Ot!==null&&(U=m(Ot,U,dt),Dt===null?Ie=Ot:Dt.sibling=Ot,Dt=Ot);return Et&&Pr(H,dt),Ie}for(ze=i(ze);!Ot.done;dt++,Ot=V.next())Ot=Z(ze,H,dt,Ot.value,le),Ot!==null&&(t&&Ot.alternate!==null&&ze.delete(Ot.key===null?dt:Ot.key),U=m(Ot,U,dt),Dt===null?Ie=Ot:Dt.sibling=Ot,Dt=Ot);return t&&ze.forEach(function(dS){return a(H,dS)}),Et&&Pr(H,dt),Ie}function Xt(H,U,V,le){if(typeof V=="object"&&V!==null&&V.type===j&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case S:e:{for(var Ie=V.key;U!==null;){if(U.key===Ie){if(Ie=V.type,Ie===j){if(U.tag===7){l(H,U.sibling),le=d(U,V.props.children),le.return=H,H=le;break e}}else if(U.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===T&&ds(Ie)===U.type){l(H,U.sibling),le=d(U,V.props),Pi(le,V),le.return=H,H=le;break e}l(H,U);break}else a(H,U);U=U.sibling}V.type===j?(le=ss(V.props.children,H.mode,le,V.key),le.return=H,H=le):(le=wc(V.type,V.key,V.props,null,H.mode,le),Pi(le,V),le.return=H,H=le)}return b(H);case w:e:{for(Ie=V.key;U!==null;){if(U.key===Ie)if(U.tag===4&&U.stateNode.containerInfo===V.containerInfo&&U.stateNode.implementation===V.implementation){l(H,U.sibling),le=d(U,V.children||[]),le.return=H,H=le;break e}else{l(H,U);break}else a(H,U);U=U.sibling}le=Yd(V,H.mode,le),le.return=H,H=le}return b(H);case T:return V=ds(V),Xt(H,U,V,le)}if(ee(V))return Me(H,U,V,le);if(re(V)){if(Ie=re(V),typeof Ie!="function")throw Error(s(150));return V=Ie.call(V),Ye(H,U,V,le)}if(typeof V.then=="function")return Xt(H,U,Tc(V),le);if(V.$$typeof===$)return Xt(H,U,Nc(H,V),le);Cc(H,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,U!==null&&U.tag===6?(l(H,U.sibling),le=d(U,V),le.return=H,H=le):(l(H,U),le=Vd(V,H.mode,le),le.return=H,H=le),b(H)):l(H,U)}return function(H,U,V,le){try{qi=0;var Ie=Xt(H,U,V,le);return Ps=null,Ie}catch(ze){if(ze===qs||ze===Rc)throw ze;var Dt=On(29,ze,null,H.mode);return Dt.lanes=le,Dt.return=H,Dt}finally{}}}var hs=ag(!0),ng=ag(!1),bl=!1;function rf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function wl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Sl(t,a,l){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Mt&2)!==0){var d=i.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),i.pending=a,a=bc(t),Hp(t,null,l),a}return yc(t,i,a,l),bc(t)}function Fi(t,a,l){if(a=a.updateQueue,a!==null&&(a=a.shared,(l&4194048)!==0)){var i=a.lanes;i&=t.pendingLanes,l|=i,a.lanes=l,Da(t,l)}}function sf(t,a){var l=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var d=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?d=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?d=m=a:m=m.next=a}else d=m=a;l={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=a:t.next=a,l.lastBaseUpdate=a}var of=!1;function Vi(){if(of){var t=Is;if(t!==null)throw t}}function Yi(t,a,l,i){of=!1;var d=t.updateQueue;bl=!1;var m=d.firstBaseUpdate,b=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var D=N,Y=D.next;D.next=null,b===null?m=Y:b.next=Y,b=D;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,N=ae.lastBaseUpdate,N!==b&&(N===null?ae.firstBaseUpdate=Y:N.next=Y,ae.lastBaseUpdate=D))}if(m!==null){var oe=d.baseState;b=0,ae=Y=D=null,N=m;do{var X=N.lane&-536870913,Z=X!==N.lane;if(Z?(bt&X)===X:(i&X)===X){X!==0&&X===Hs&&(of=!0),ae!==null&&(ae=ae.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Me=t,Ye=N;X=a;var Xt=l;switch(Ye.tag){case 1:if(Me=Ye.payload,typeof Me=="function"){oe=Me.call(Xt,oe,X);break e}oe=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ye.payload,X=typeof Me=="function"?Me.call(Xt,oe,X):Me,X==null)break e;oe=v({},oe,X);break e;case 2:bl=!0}}X=N.callback,X!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=d.callbacks,Z===null?d.callbacks=[X]:Z.push(X))}else Z={lane:X,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ae===null?(Y=ae=Z,D=oe):ae=ae.next=Z,b|=X;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);ae===null&&(D=oe),d.baseState=D,d.firstBaseUpdate=Y,d.lastBaseUpdate=ae,m===null&&(d.shared.lanes=0),kl|=b,t.lanes=b,t.memoizedState=oe}}function rg(t,a){if(typeof t!="function")throw Error(s(191,t));t.call(a)}function lg(t,a){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)rg(l[t],a)}var Fs=C(null),Ac=C(0);function sg(t,a){t=el,K(Ac,t),K(Fs,a),el=t|a.baseLanes}function cf(){K(Ac,el),K(Fs,Fs.current)}function uf(){el=Ac.current,B(Fs),B(Ac)}var Mn=C(null),Kn=null;function El(t){var a=t.alternate;K(ya,ya.current&1),K(Mn,t),Kn===null&&(a===null||Fs.current!==null||a.memoizedState!==null)&&(Kn=t)}function df(t){K(ya,ya.current),K(Mn,t),Kn===null&&(Kn=t)}function ig(t){t.tag===22?(K(ya,ya.current),K(Mn,t),Kn===null&&(Kn=t)):Nl()}function Nl(){K(ya,ya.current),K(Mn,Mn.current)}function _n(t){B(Mn),Kn===t&&(Kn=null),B(ya)}var ya=C(0);function Dc(t){for(var a=t;a!==null;){if(a.tag===13){var l=a.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||xh(l)||vh(l)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Yr=0,it=null,Yt=null,ka=null,Oc=!1,Vs=!1,ms=!1,Mc=0,Gi=0,Ys=null,tw=0;function ha(){throw Error(s(321))}function ff(t,a){if(a===null)return!1;for(var l=0;l<a.length&&l<t.length;l++)if(!Dn(t[l],a[l]))return!1;return!0}function hf(t,a,l,i,d,m){return Yr=m,it=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,L.H=t===null||t.memoizedState===null?Fg:Tf,ms=!1,m=l(i,d),ms=!1,Vs&&(m=cg(a,l,i,d)),og(t),m}function og(t){L.H=Ki;var a=Yt!==null&&Yt.next!==null;if(Yr=0,ka=Yt=it=null,Oc=!1,Gi=0,Ys=null,a)throw Error(s(300));t===null||Ta||(t=t.dependencies,t!==null&&Ec(t)&&(Ta=!0))}function cg(t,a,l,i){it=t;var d=0;do{if(Vs&&(Ys=null),Gi=0,Vs=!1,25<=d)throw Error(s(301));if(d+=1,ka=Yt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}L.H=Vg,m=a(l,i)}while(Vs);return m}function aw(){var t=L.H,a=t.useState()[0];return a=typeof a.then=="function"?Xi(a):a,t=t.useState()[0],(Yt!==null?Yt.memoizedState:null)!==t&&(it.flags|=1024),a}function mf(){var t=Mc!==0;return Mc=0,t}function pf(t,a,l){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~l}function gf(t){if(Oc){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Oc=!1}Yr=0,ka=Yt=it=null,Vs=!1,Gi=Mc=0,Ys=null}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ka===null?it.memoizedState=ka=t:ka=ka.next=t,ka}function ba(){if(Yt===null){var t=it.alternate;t=t!==null?t.memoizedState:null}else t=Yt.next;var a=ka===null?it.memoizedState:ka.next;if(a!==null)ka=a,Yt=t;else{if(t===null)throw it.alternate===null?Error(s(467)):Error(s(310));Yt=t,t={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},ka===null?it.memoizedState=ka=t:ka=ka.next=t}return ka}function _c(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xi(t){var a=Gi;return Gi+=1,Ys===null&&(Ys=[]),t=Jp(Ys,t,a),a=it,(ka===null?a.memoizedState:ka.next)===null&&(a=a.alternate,L.H=a===null||a.memoizedState===null?Fg:Tf),t}function Lc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Xi(t);if(t.$$typeof===$)return Qa(t)}throw Error(s(438,String(t)))}function xf(t){var a=null,l=it.updateQueue;if(l!==null&&(a=l.memoCache),a==null){var i=it.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(a={data:i.data.map(function(d){return d.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),l===null&&(l=_c(),it.updateQueue=l),l.memoCache=a,l=a.data[a.index],l===void 0)for(l=a.data[a.index]=Array(t),i=0;i<t;i++)l[i]=pe;return a.index++,l}function Gr(t,a){return typeof a=="function"?a(t):a}function zc(t){var a=ba();return vf(a,Yt,t)}function vf(t,a,l){var i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=l;var d=t.baseQueue,m=i.pending;if(m!==null){if(d!==null){var b=d.next;d.next=m.next,m.next=b}a.baseQueue=d=m,i.pending=null}if(m=t.baseState,d===null)t.memoizedState=m;else{a=d.next;var N=b=null,D=null,Y=a,ae=!1;do{var oe=Y.lane&-536870913;if(oe!==Y.lane?(bt&oe)===oe:(Yr&oe)===oe){var X=Y.revertLane;if(X===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),oe===Hs&&(ae=!0);else if((Yr&X)===X){Y=Y.next,X===Hs&&(ae=!0);continue}else oe={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},D===null?(N=D=oe,b=m):D=D.next=oe,it.lanes|=X,kl|=X;oe=Y.action,ms&&l(m,oe),m=Y.hasEagerState?Y.eagerState:l(m,oe)}else X={lane:oe,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},D===null?(N=D=X,b=m):D=D.next=X,it.lanes|=oe,kl|=oe;Y=Y.next}while(Y!==null&&Y!==a);if(D===null?b=m:D.next=N,!Dn(m,t.memoizedState)&&(Ta=!0,ae&&(l=Is,l!==null)))throw l;t.memoizedState=m,t.baseState=b,t.baseQueue=D,i.lastRenderedState=m}return d===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function yf(t){var a=ba(),l=a.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=t;var i=l.dispatch,d=l.pending,m=a.memoizedState;if(d!==null){l.pending=null;var b=d=d.next;do m=t(m,b.action),b=b.next;while(b!==d);Dn(m,a.memoizedState)||(Ta=!0),a.memoizedState=m,a.baseQueue===null&&(a.baseState=m),l.lastRenderedState=m}return[m,i]}function ug(t,a,l){var i=it,d=ba(),m=Et;if(m){if(l===void 0)throw Error(s(407));l=l()}else l=a();var b=!Dn((Yt||d).memoizedState,l);if(b&&(d.memoizedState=l,Ta=!0),d=d.queue,Sf(hg.bind(null,i,d,t),[t]),d.getSnapshot!==a||b||ka!==null&&ka.memoizedState.tag&1){if(i.flags|=2048,Gs(9,{destroy:void 0},fg.bind(null,i,d,l,a),null),ta===null)throw Error(s(349));m||(Yr&127)!==0||dg(i,a,l)}return l}function dg(t,a,l){t.flags|=16384,t={getSnapshot:a,value:l},a=it.updateQueue,a===null?(a=_c(),it.updateQueue=a,a.stores=[t]):(l=a.stores,l===null?a.stores=[t]:l.push(t))}function fg(t,a,l,i){a.value=l,a.getSnapshot=i,mg(a)&&pg(t)}function hg(t,a,l){return l(function(){mg(a)&&pg(t)})}function mg(t){var a=t.getSnapshot;t=t.value;try{var l=a();return!Dn(t,l)}catch{return!0}}function pg(t){var a=ls(t,2);a!==null&&jn(a,t,2)}function bf(t){var a=mn();if(typeof t=="function"){var l=t;if(t=l(),ms){Tt(!0);try{l()}finally{Tt(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:t},a}function gg(t,a,l,i){return t.baseState=l,vf(t,Yt,typeof i=="function"?i:Gr)}function nw(t,a,l,i,d){if(Bc(t))throw Error(s(485));if(t=a.action,t!==null){var m={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};L.T!==null?l(!0):m.isTransition=!1,i(m),l=a.pending,l===null?(m.next=a.pending=m,xg(a,m)):(m.next=l.next,a.pending=l.next=m)}}function xg(t,a){var l=a.action,i=a.payload,d=t.state;if(a.isTransition){var m=L.T,b={};L.T=b;try{var N=l(d,i),D=L.S;D!==null&&D(b,N),vg(t,a,N)}catch(Y){wf(t,a,Y)}finally{m!==null&&b.types!==null&&(m.types=b.types),L.T=m}}else try{m=l(d,i),vg(t,a,m)}catch(Y){wf(t,a,Y)}}function vg(t,a,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){yg(t,a,i)},function(i){return wf(t,a,i)}):yg(t,a,l)}function yg(t,a,l){a.status="fulfilled",a.value=l,bg(a),t.state=l,a=t.pending,a!==null&&(l=a.next,l===a?t.pending=null:(l=l.next,a.next=l,xg(t,l)))}function wf(t,a,l){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do a.status="rejected",a.reason=l,bg(a),a=a.next;while(a!==i)}t.action=null}function bg(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function wg(t,a){return a}function Sg(t,a){if(Et){var l=ta.formState;if(l!==null){e:{var i=it;if(Et){if(la){t:{for(var d=la,m=Qn;d.nodeType!==8;){if(!m){d=null;break t}if(d=Zn(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){la=Zn(d.nextSibling),i=d.data==="F!";break e}}vl(i)}i=!1}i&&(a=l[0])}}return l=mn(),l.memoizedState=l.baseState=a,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wg,lastRenderedState:a},l.queue=i,l=Ig.bind(null,it,i),i.dispatch=l,i=bf(!1),m=kf.bind(null,it,!1,i.queue),i=mn(),d={state:a,dispatch:null,action:t,pending:null},i.queue=d,l=nw.bind(null,it,d,m,l),d.dispatch=l,i.memoizedState=t,[a,l,!1]}function Eg(t){var a=ba();return Ng(a,Yt,t)}function Ng(t,a,l){if(a=vf(t,a,wg)[0],t=zc(Gr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var i=Xi(a)}catch(b){throw b===qs?Rc:b}else i=a;a=ba();var d=a.queue,m=d.dispatch;return l!==a.memoizedState&&(it.flags|=2048,Gs(9,{destroy:void 0},rw.bind(null,d,l),null)),[i,m,t]}function rw(t,a){t.action=a}function jg(t){var a=ba(),l=Yt;if(l!==null)return Ng(a,l,t);ba(),a=a.memoizedState,l=ba();var i=l.queue.dispatch;return l.memoizedState=t,[a,i,!1]}function Gs(t,a,l,i){return t={tag:t,create:l,deps:i,inst:a,next:null},a=it.updateQueue,a===null&&(a=_c(),it.updateQueue=a),l=a.lastEffect,l===null?a.lastEffect=t.next=t:(i=l.next,l.next=t,t.next=i,a.lastEffect=t),t}function Rg(){return ba().memoizedState}function Uc(t,a,l,i){var d=mn();it.flags|=t,d.memoizedState=Gs(1|a,{destroy:void 0},l,i===void 0?null:i)}function $c(t,a,l,i){var d=ba();i=i===void 0?null:i;var m=d.memoizedState.inst;Yt!==null&&i!==null&&ff(i,Yt.memoizedState.deps)?d.memoizedState=Gs(a,m,l,i):(it.flags|=t,d.memoizedState=Gs(1|a,m,l,i))}function kg(t,a){Uc(8390656,8,t,a)}function Sf(t,a){$c(2048,8,t,a)}function lw(t){it.flags|=4;var a=it.updateQueue;if(a===null)a=_c(),it.updateQueue=a,a.events=[t];else{var l=a.events;l===null?a.events=[t]:l.push(t)}}function Tg(t){var a=ba().memoizedState;return lw({ref:a,nextImpl:t}),function(){if((Mt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}function Cg(t,a){return $c(4,2,t,a)}function Ag(t,a){return $c(4,4,t,a)}function Dg(t,a){if(typeof a=="function"){t=t();var l=a(t);return function(){typeof l=="function"?l():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function Og(t,a,l){l=l!=null?l.concat([t]):null,$c(4,4,Dg.bind(null,a,t),l)}function Ef(){}function Mg(t,a){var l=ba();a=a===void 0?null:a;var i=l.memoizedState;return a!==null&&ff(a,i[1])?i[0]:(l.memoizedState=[t,a],t)}function _g(t,a){var l=ba();a=a===void 0?null:a;var i=l.memoizedState;if(a!==null&&ff(a,i[1]))return i[0];if(i=t(),ms){Tt(!0);try{t()}finally{Tt(!1)}}return l.memoizedState=[i,a],i}function Nf(t,a,l){return l===void 0||(Yr&1073741824)!==0&&(bt&261930)===0?t.memoizedState=a:(t.memoizedState=l,t=Lx(),it.lanes|=t,kl|=t,l)}function Lg(t,a,l,i){return Dn(l,a)?l:Fs.current!==null?(t=Nf(t,l,i),Dn(t,a)||(Ta=!0),t):(Yr&42)===0||(Yr&1073741824)!==0&&(bt&261930)===0?(Ta=!0,t.memoizedState=l):(t=Lx(),it.lanes|=t,kl|=t,a)}function zg(t,a,l,i,d){var m=F.p;F.p=m!==0&&8>m?m:8;var b=L.T,N={};L.T=N,kf(t,!1,a,l);try{var D=d(),Y=L.S;if(Y!==null&&Y(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ae=ew(D,i);Qi(t,a,ae,Un(t))}else Qi(t,a,i,Un(t))}catch(oe){Qi(t,a,{then:function(){},status:"rejected",reason:oe},Un())}finally{F.p=m,b!==null&&N.types!==null&&(b.types=N.types),L.T=b}}function sw(){}function jf(t,a,l,i){if(t.tag!==5)throw Error(s(476));var d=Ug(t).queue;zg(t,d,a,he,l===null?sw:function(){return $g(t),l(i)})}function Ug(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:he},next:null};var l={};return a.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:l},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function $g(t){var a=Ug(t);a.next===null&&(a=t.alternate.memoizedState),Qi(t,a.next.queue,{},Un())}function Rf(){return Qa(ho)}function Bg(){return ba().memoizedState}function Hg(){return ba().memoizedState}function iw(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var l=Un();t=wl(l);var i=Sl(a,t,l);i!==null&&(jn(i,a,l),Fi(i,a,l)),a={cache:ef()},t.payload=a;return}a=a.return}}function ow(t,a,l){var i=Un();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Bc(t)?qg(a,l):(l=Pd(t,a,l,i),l!==null&&(jn(l,t,i),Pg(l,a,i)))}function Ig(t,a,l){var i=Un();Qi(t,a,l,i)}function Qi(t,a,l,i){var d={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Bc(t))qg(a,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=a.lastRenderedReducer,m!==null))try{var b=a.lastRenderedState,N=m(b,l);if(d.hasEagerState=!0,d.eagerState=N,Dn(N,b))return yc(t,a,d,0),ta===null&&vc(),!1}catch{}finally{}if(l=Pd(t,a,d,i),l!==null)return jn(l,t,i),Pg(l,a,i),!0}return!1}function kf(t,a,l,i){if(i={lane:2,revertLane:lh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bc(t)){if(a)throw Error(s(479))}else a=Pd(t,l,i,2),a!==null&&jn(a,t,2)}function Bc(t){var a=t.alternate;return t===it||a!==null&&a===it}function qg(t,a){Vs=Oc=!0;var l=t.pending;l===null?a.next=a:(a.next=l.next,l.next=a),t.pending=a}function Pg(t,a,l){if((l&4194048)!==0){var i=a.lanes;i&=t.pendingLanes,l|=i,a.lanes=l,Da(t,l)}}var Ki={readContext:Qa,use:Lc,useCallback:ha,useContext:ha,useEffect:ha,useImperativeHandle:ha,useLayoutEffect:ha,useInsertionEffect:ha,useMemo:ha,useReducer:ha,useRef:ha,useState:ha,useDebugValue:ha,useDeferredValue:ha,useTransition:ha,useSyncExternalStore:ha,useId:ha,useHostTransitionStatus:ha,useFormState:ha,useActionState:ha,useOptimistic:ha,useMemoCache:ha,useCacheRefresh:ha};Ki.useEffectEvent=ha;var Fg={readContext:Qa,use:Lc,useCallback:function(t,a){return mn().memoizedState=[t,a===void 0?null:a],t},useContext:Qa,useEffect:kg,useImperativeHandle:function(t,a,l){l=l!=null?l.concat([t]):null,Uc(4194308,4,Dg.bind(null,a,t),l)},useLayoutEffect:function(t,a){return Uc(4194308,4,t,a)},useInsertionEffect:function(t,a){Uc(4,2,t,a)},useMemo:function(t,a){var l=mn();a=a===void 0?null:a;var i=t();if(ms){Tt(!0);try{t()}finally{Tt(!1)}}return l.memoizedState=[i,a],i},useReducer:function(t,a,l){var i=mn();if(l!==void 0){var d=l(a);if(ms){Tt(!0);try{l(a)}finally{Tt(!1)}}}else d=a;return i.memoizedState=i.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},i.queue=t,t=t.dispatch=ow.bind(null,it,t),[i.memoizedState,t]},useRef:function(t){var a=mn();return t={current:t},a.memoizedState=t},useState:function(t){t=bf(t);var a=t.queue,l=Ig.bind(null,it,a);return a.dispatch=l,[t.memoizedState,l]},useDebugValue:Ef,useDeferredValue:function(t,a){var l=mn();return Nf(l,t,a)},useTransition:function(){var t=bf(!1);return t=zg.bind(null,it,t.queue,!0,!1),mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,l){var i=it,d=mn();if(Et){if(l===void 0)throw Error(s(407));l=l()}else{if(l=a(),ta===null)throw Error(s(349));(bt&127)!==0||dg(i,a,l)}d.memoizedState=l;var m={value:l,getSnapshot:a};return d.queue=m,kg(hg.bind(null,i,m,t),[t]),i.flags|=2048,Gs(9,{destroy:void 0},fg.bind(null,i,m,l,a),null),l},useId:function(){var t=mn(),a=ta.identifierPrefix;if(Et){var l=Er,i=Sr;l=(i&~(1<<32-Zt(i)-1)).toString(32)+l,a="_"+a+"R_"+l,l=Mc++,0<l&&(a+="H"+l.toString(32)),a+="_"}else l=tw++,a="_"+a+"r_"+l.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Rf,useFormState:Sg,useActionState:Sg,useOptimistic:function(t){var a=mn();a.memoizedState=a.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=l,a=kf.bind(null,it,!0,l),l.dispatch=a,[t,a]},useMemoCache:xf,useCacheRefresh:function(){return mn().memoizedState=iw.bind(null,it)},useEffectEvent:function(t){var a=mn(),l={impl:t};return a.memoizedState=l,function(){if((Mt&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Tf={readContext:Qa,use:Lc,useCallback:Mg,useContext:Qa,useEffect:Sf,useImperativeHandle:Og,useInsertionEffect:Cg,useLayoutEffect:Ag,useMemo:_g,useReducer:zc,useRef:Rg,useState:function(){return zc(Gr)},useDebugValue:Ef,useDeferredValue:function(t,a){var l=ba();return Lg(l,Yt.memoizedState,t,a)},useTransition:function(){var t=zc(Gr)[0],a=ba().memoizedState;return[typeof t=="boolean"?t:Xi(t),a]},useSyncExternalStore:ug,useId:Bg,useHostTransitionStatus:Rf,useFormState:Eg,useActionState:Eg,useOptimistic:function(t,a){var l=ba();return gg(l,Yt,t,a)},useMemoCache:xf,useCacheRefresh:Hg};Tf.useEffectEvent=Tg;var Vg={readContext:Qa,use:Lc,useCallback:Mg,useContext:Qa,useEffect:Sf,useImperativeHandle:Og,useInsertionEffect:Cg,useLayoutEffect:Ag,useMemo:_g,useReducer:yf,useRef:Rg,useState:function(){return yf(Gr)},useDebugValue:Ef,useDeferredValue:function(t,a){var l=ba();return Yt===null?Nf(l,t,a):Lg(l,Yt.memoizedState,t,a)},useTransition:function(){var t=yf(Gr)[0],a=ba().memoizedState;return[typeof t=="boolean"?t:Xi(t),a]},useSyncExternalStore:ug,useId:Bg,useHostTransitionStatus:Rf,useFormState:jg,useActionState:jg,useOptimistic:function(t,a){var l=ba();return Yt!==null?gg(l,Yt,t,a):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:xf,useCacheRefresh:Hg};Vg.useEffectEvent=Tg;function Cf(t,a,l,i){a=t.memoizedState,l=l(i,a),l=l==null?a:v({},a,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Af={enqueueSetState:function(t,a,l){t=t._reactInternals;var i=Un(),d=wl(i);d.payload=a,l!=null&&(d.callback=l),a=Sl(t,d,i),a!==null&&(jn(a,t,i),Fi(a,t,i))},enqueueReplaceState:function(t,a,l){t=t._reactInternals;var i=Un(),d=wl(i);d.tag=1,d.payload=a,l!=null&&(d.callback=l),a=Sl(t,d,i),a!==null&&(jn(a,t,i),Fi(a,t,i))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var l=Un(),i=wl(l);i.tag=2,a!=null&&(i.callback=a),a=Sl(t,i,l),a!==null&&(jn(a,t,l),Fi(a,t,l))}};function Yg(t,a,l,i,d,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,m,b):a.prototype&&a.prototype.isPureReactComponent?!zi(l,i)||!zi(d,m):!0}function Gg(t,a,l,i){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(l,i),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(l,i),a.state!==t&&Af.enqueueReplaceState(a,a.state,null)}function ps(t,a){var l=a;if("ref"in a){l={};for(var i in a)i!=="ref"&&(l[i]=a[i])}if(t=t.defaultProps){l===a&&(l=v({},l));for(var d in t)l[d]===void 0&&(l[d]=t[d])}return l}function Xg(t){xc(t)}function Qg(t){console.error(t)}function Kg(t){xc(t)}function Hc(t,a){try{var l=t.onUncaughtError;l(a.value,{componentStack:a.stack})}catch(i){setTimeout(function(){throw i})}}function Zg(t,a,l){try{var i=t.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Df(t,a,l){return l=wl(l),l.tag=3,l.payload={element:null},l.callback=function(){Hc(t,a)},l}function Wg(t){return t=wl(t),t.tag=3,t}function Jg(t,a,l,i){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var m=i.value;t.payload=function(){return d(m)},t.callback=function(){Zg(a,l,i)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){Zg(a,l,i),typeof d!="function"&&(Tl===null?Tl=new Set([this]):Tl.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function cw(t,a,l,i,d){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(a=l.alternate,a!==null&&Bs(a,l,d,!0),l=Mn.current,l!==null){switch(l.tag){case 31:case 13:return Kn===null?Wc():l.alternate===null&&ma===0&&(ma=3),l.flags&=-257,l.flags|=65536,l.lanes=d,i===kc?l.flags|=16384:(a=l.updateQueue,a===null?l.updateQueue=new Set([i]):a.add(i),ah(t,i,d)),!1;case 22:return l.flags|=65536,i===kc?l.flags|=16384:(a=l.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=a):(l=a.retryQueue,l===null?a.retryQueue=new Set([i]):l.add(i)),ah(t,i,d)),!1}throw Error(s(435,l.tag))}return ah(t,i,d),Wc(),!1}if(Et)return a=Mn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=d,i!==Qd&&(t=Error(s(422),{cause:i}),Bi(Yn(t,l)))):(i!==Qd&&(a=Error(s(423),{cause:i}),Bi(Yn(a,l))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,i=Yn(i,l),d=Df(t.stateNode,i,d),sf(t,d),ma!==4&&(ma=2)),!1;var m=Error(s(520),{cause:i});if(m=Yn(m,l),ro===null?ro=[m]:ro.push(m),ma!==4&&(ma=2),a===null)return!0;i=Yn(i,l),l=a;do{switch(l.tag){case 3:return l.flags|=65536,t=d&-d,l.lanes|=t,t=Df(l.stateNode,i,t),sf(l,t),!1;case 1:if(a=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Tl===null||!Tl.has(m))))return l.flags|=65536,d&=-d,l.lanes|=d,d=Wg(d),Jg(d,t,l,i),sf(l,d),!1}l=l.return}while(l!==null);return!1}var Of=Error(s(461)),Ta=!1;function Ka(t,a,l,i){a.child=t===null?ng(a,null,l,i):hs(a,t.child,l,i)}function ex(t,a,l,i,d){l=l.render;var m=a.ref;if("ref"in i){var b={};for(var N in i)N!=="ref"&&(b[N]=i[N])}else b=i;return cs(a),i=hf(t,a,l,b,m,d),N=mf(),t!==null&&!Ta?(pf(t,a,d),Xr(t,a,d)):(Et&&N&&Gd(a),a.flags|=1,Ka(t,a,i,d),a.child)}function tx(t,a,l,i,d){if(t===null){var m=l.type;return typeof m=="function"&&!Fd(m)&&m.defaultProps===void 0&&l.compare===null?(a.tag=15,a.type=m,ax(t,a,m,i,d)):(t=wc(l.type,null,i,a,a.mode,d),t.ref=a.ref,t.return=a,a.child=t)}if(m=t.child,!Hf(t,d)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:zi,l(b,i)&&t.ref===a.ref)return Xr(t,a,d)}return a.flags|=1,t=qr(m,i),t.ref=a.ref,t.return=a,a.child=t}function ax(t,a,l,i,d){if(t!==null){var m=t.memoizedProps;if(zi(m,i)&&t.ref===a.ref)if(Ta=!1,a.pendingProps=i=m,Hf(t,d))(t.flags&131072)!==0&&(Ta=!0);else return a.lanes=t.lanes,Xr(t,a,d)}return Mf(t,a,l,i,d)}function nx(t,a,l,i){var d=i.children,m=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((a.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,t!==null){for(i=a.child=t.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~m}else i=0,a.child=null;return rx(t,a,m,l,i)}if((l&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&jc(a,m!==null?m.cachePool:null),m!==null?sg(a,m):cf(),ig(a);else return i=a.lanes=536870912,rx(t,a,m!==null?m.baseLanes|l:l,l,i)}else m!==null?(jc(a,m.cachePool),sg(a,m),Nl(),a.memoizedState=null):(t!==null&&jc(a,null),cf(),Nl());return Ka(t,a,d,l),a.child}function Zi(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function rx(t,a,l,i,d){var m=af();return m=m===null?null:{parent:Ra._currentValue,pool:m},a.memoizedState={baseLanes:l,cachePool:m},t!==null&&jc(a,null),cf(),ig(a),t!==null&&Bs(t,a,i,!0),a.childLanes=d,null}function Ic(t,a){return a=Pc({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function lx(t,a,l){return hs(a,t.child,null,l),t=Ic(a,a.pendingProps),t.flags|=2,_n(a),a.memoizedState=null,t}function uw(t,a,l){var i=a.pendingProps,d=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(Et){if(i.mode==="hidden")return t=Ic(a,i),a.lanes=536870912,Zi(null,t);if(df(a),(t=la)?(t=xv(t,Qn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:gl!==null?{id:Sr,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},l=qp(t),l.return=a,a.child=l,Xa=a,la=null)):t=null,t===null)throw vl(a);return a.lanes=536870912,null}return Ic(a,i)}var m=t.memoizedState;if(m!==null){var b=m.dehydrated;if(df(a),d)if(a.flags&256)a.flags&=-257,a=lx(t,a,l);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(s(558));else if(Ta||Bs(t,a,l,!1),d=(l&t.childLanes)!==0,Ta||d){if(i=ta,i!==null&&(b=A(i,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,ls(t,b),jn(i,t,b),Of;Wc(),a=lx(t,a,l)}else t=m.treeContext,la=Zn(b.nextSibling),Xa=a,Et=!0,xl=null,Qn=!1,t!==null&&Vp(a,t),a=Ic(a,i),a.flags|=4096;return a}return t=qr(t.child,{mode:i.mode,children:i.children}),t.ref=a.ref,a.child=t,t.return=a,t}function qc(t,a){var l=a.ref;if(l===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(t===null||t.ref!==l)&&(a.flags|=4194816)}}function Mf(t,a,l,i,d){return cs(a),l=hf(t,a,l,i,void 0,d),i=mf(),t!==null&&!Ta?(pf(t,a,d),Xr(t,a,d)):(Et&&i&&Gd(a),a.flags|=1,Ka(t,a,l,d),a.child)}function sx(t,a,l,i,d,m){return cs(a),a.updateQueue=null,l=cg(a,i,l,d),og(t),i=mf(),t!==null&&!Ta?(pf(t,a,m),Xr(t,a,m)):(Et&&i&&Gd(a),a.flags|=1,Ka(t,a,l,m),a.child)}function ix(t,a,l,i,d){if(cs(a),a.stateNode===null){var m=Ls,b=l.contextType;typeof b=="object"&&b!==null&&(m=Qa(b)),m=new l(i,m),a.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Af,a.stateNode=m,m._reactInternals=a,m=a.stateNode,m.props=i,m.state=a.memoizedState,m.refs={},rf(a),b=l.contextType,m.context=typeof b=="object"&&b!==null?Qa(b):Ls,m.state=a.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Cf(a,l,b,i),m.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&Af.enqueueReplaceState(m,m.state,null),Yi(a,i,m,d),Vi(),m.state=a.memoizedState),typeof m.componentDidMount=="function"&&(a.flags|=4194308),i=!0}else if(t===null){m=a.stateNode;var N=a.memoizedProps,D=ps(l,N);m.props=D;var Y=m.context,ae=l.contextType;b=Ls,typeof ae=="object"&&ae!==null&&(b=Qa(ae));var oe=l.getDerivedStateFromProps;ae=typeof oe=="function"||typeof m.getSnapshotBeforeUpdate=="function",N=a.pendingProps!==N,ae||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(N||Y!==b)&&Gg(a,m,i,b),bl=!1;var X=a.memoizedState;m.state=X,Yi(a,i,m,d),Vi(),Y=a.memoizedState,N||X!==Y||bl?(typeof oe=="function"&&(Cf(a,l,oe,i),Y=a.memoizedState),(D=bl||Yg(a,l,D,i,X,Y,b))?(ae||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(a.flags|=4194308)):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=i,a.memoizedState=Y),m.props=i,m.state=Y,m.context=b,i=D):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),i=!1)}else{m=a.stateNode,lf(t,a),b=a.memoizedProps,ae=ps(l,b),m.props=ae,oe=a.pendingProps,X=m.context,Y=l.contextType,D=Ls,typeof Y=="object"&&Y!==null&&(D=Qa(Y)),N=l.getDerivedStateFromProps,(Y=typeof N=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==oe||X!==D)&&Gg(a,m,i,D),bl=!1,X=a.memoizedState,m.state=X,Yi(a,i,m,d),Vi();var Z=a.memoizedState;b!==oe||X!==Z||bl||t!==null&&t.dependencies!==null&&Ec(t.dependencies)?(typeof N=="function"&&(Cf(a,l,N,i),Z=a.memoizedState),(ae=bl||Yg(a,l,ae,i,X,Z,D)||t!==null&&t.dependencies!==null&&Ec(t.dependencies))?(Y||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,Z,D),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,Z,D)),typeof m.componentDidUpdate=="function"&&(a.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&X===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&X===t.memoizedState||(a.flags|=1024),a.memoizedProps=i,a.memoizedState=Z),m.props=i,m.state=Z,m.context=D,i=ae):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&X===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&X===t.memoizedState||(a.flags|=1024),i=!1)}return m=i,qc(t,a),i=(a.flags&128)!==0,m||i?(m=a.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:m.render(),a.flags|=1,t!==null&&i?(a.child=hs(a,t.child,null,d),a.child=hs(a,null,l,d)):Ka(t,a,l,d),a.memoizedState=m.state,t=a.child):t=Xr(t,a,d),t}function ox(t,a,l,i){return is(),a.flags|=256,Ka(t,a,l,i),a.child}var _f={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lf(t){return{baseLanes:t,cachePool:Zp()}}function zf(t,a,l){return t=t!==null?t.childLanes&~l:0,a&&(t|=zn),t}function cx(t,a,l){var i=a.pendingProps,d=!1,m=(a.flags&128)!==0,b;if((b=m)||(b=t!==null&&t.memoizedState===null?!1:(ya.current&2)!==0),b&&(d=!0,a.flags&=-129),b=(a.flags&32)!==0,a.flags&=-33,t===null){if(Et){if(d?El(a):Nl(),(t=la)?(t=xv(t,Qn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:gl!==null?{id:Sr,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},l=qp(t),l.return=a,a.child=l,Xa=a,la=null)):t=null,t===null)throw vl(a);return vh(t)?a.lanes=32:a.lanes=536870912,null}var N=i.children;return i=i.fallback,d?(Nl(),d=a.mode,N=Pc({mode:"hidden",children:N},d),i=ss(i,d,l,null),N.return=a,i.return=a,N.sibling=i,a.child=N,i=a.child,i.memoizedState=Lf(l),i.childLanes=zf(t,b,l),a.memoizedState=_f,Zi(null,i)):(El(a),Uf(a,N))}var D=t.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(m)a.flags&256?(El(a),a.flags&=-257,a=$f(t,a,l)):a.memoizedState!==null?(Nl(),a.child=t.child,a.flags|=128,a=null):(Nl(),N=i.fallback,d=a.mode,i=Pc({mode:"visible",children:i.children},d),N=ss(N,d,l,null),N.flags|=2,i.return=a,N.return=a,i.sibling=N,a.child=i,hs(a,t.child,null,l),i=a.child,i.memoizedState=Lf(l),i.childLanes=zf(t,b,l),a.memoizedState=_f,a=Zi(null,i));else if(El(a),vh(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var Y=b.dgst;b=Y,i=Error(s(419)),i.stack="",i.digest=b,Bi({value:i,source:null,stack:null}),a=$f(t,a,l)}else if(Ta||Bs(t,a,l,!1),b=(l&t.childLanes)!==0,Ta||b){if(b=ta,b!==null&&(i=A(b,l),i!==0&&i!==D.retryLane))throw D.retryLane=i,ls(t,i),jn(b,t,i),Of;xh(N)||Wc(),a=$f(t,a,l)}else xh(N)?(a.flags|=192,a.child=t.child,a=null):(t=D.treeContext,la=Zn(N.nextSibling),Xa=a,Et=!0,xl=null,Qn=!1,t!==null&&Vp(a,t),a=Uf(a,i.children),a.flags|=4096);return a}return d?(Nl(),N=i.fallback,d=a.mode,D=t.child,Y=D.sibling,i=qr(D,{mode:"hidden",children:i.children}),i.subtreeFlags=D.subtreeFlags&65011712,Y!==null?N=qr(Y,N):(N=ss(N,d,l,null),N.flags|=2),N.return=a,i.return=a,i.sibling=N,a.child=i,Zi(null,i),i=a.child,N=t.child.memoizedState,N===null?N=Lf(l):(d=N.cachePool,d!==null?(D=Ra._currentValue,d=d.parent!==D?{parent:D,pool:D}:d):d=Zp(),N={baseLanes:N.baseLanes|l,cachePool:d}),i.memoizedState=N,i.childLanes=zf(t,b,l),a.memoizedState=_f,Zi(t.child,i)):(El(a),l=t.child,t=l.sibling,l=qr(l,{mode:"visible",children:i.children}),l.return=a,l.sibling=null,t!==null&&(b=a.deletions,b===null?(a.deletions=[t],a.flags|=16):b.push(t)),a.child=l,a.memoizedState=null,l)}function Uf(t,a){return a=Pc({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function Pc(t,a){return t=On(22,t,null,a),t.lanes=0,t}function $f(t,a,l){return hs(a,t.child,null,l),t=Uf(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function ux(t,a,l){t.lanes|=a;var i=t.alternate;i!==null&&(i.lanes|=a),Wd(t.return,a,l)}function Bf(t,a,l,i,d,m){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:d,treeForkCount:m}:(b.isBackwards=a,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=l,b.tailMode=d,b.treeForkCount=m)}function dx(t,a,l){var i=a.pendingProps,d=i.revealOrder,m=i.tail;i=i.children;var b=ya.current,N=(b&2)!==0;if(N?(b=b&1|2,a.flags|=128):b&=1,K(ya,b),Ka(t,a,i,l),i=Et?$i:0,!N&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ux(t,l,a);else if(t.tag===19)ux(t,l,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(l=a.child,d=null;l!==null;)t=l.alternate,t!==null&&Dc(t)===null&&(d=l),l=l.sibling;l=d,l===null?(d=a.child,a.child=null):(d=l.sibling,l.sibling=null),Bf(a,!1,d,l,m,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=a.child,a.child=null;d!==null;){if(t=d.alternate,t!==null&&Dc(t)===null){a.child=d;break}t=d.sibling,d.sibling=l,l=d,d=t}Bf(a,!0,l,null,m,i);break;case"together":Bf(a,!1,null,null,void 0,i);break;default:a.memoizedState=null}return a.child}function Xr(t,a,l){if(t!==null&&(a.dependencies=t.dependencies),kl|=a.lanes,(l&a.childLanes)===0)if(t!==null){if(Bs(t,a,l,!1),(l&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(s(153));if(a.child!==null){for(t=a.child,l=qr(t,t.pendingProps),a.child=l,l.return=a;t.sibling!==null;)t=t.sibling,l=l.sibling=qr(t,t.pendingProps),l.return=a;l.sibling=null}return a.child}function Hf(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Ec(t)))}function dw(t,a,l){switch(a.tag){case 3:He(a,a.stateNode.containerInfo),yl(a,Ra,t.memoizedState.cache),is();break;case 27:case 5:Qe(a);break;case 4:He(a,a.stateNode.containerInfo);break;case 10:yl(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,df(a),null;break;case 13:var i=a.memoizedState;if(i!==null)return i.dehydrated!==null?(El(a),a.flags|=128,null):(l&a.child.childLanes)!==0?cx(t,a,l):(El(a),t=Xr(t,a,l),t!==null?t.sibling:null);El(a);break;case 19:var d=(t.flags&128)!==0;if(i=(l&a.childLanes)!==0,i||(Bs(t,a,l,!1),i=(l&a.childLanes)!==0),d){if(i)return dx(t,a,l);a.flags|=128}if(d=a.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),K(ya,ya.current),i)break;return null;case 22:return a.lanes=0,nx(t,a,l,a.pendingProps);case 24:yl(a,Ra,t.memoizedState.cache)}return Xr(t,a,l)}function fx(t,a,l){if(t!==null)if(t.memoizedProps!==a.pendingProps)Ta=!0;else{if(!Hf(t,l)&&(a.flags&128)===0)return Ta=!1,dw(t,a,l);Ta=(t.flags&131072)!==0}else Ta=!1,Et&&(a.flags&1048576)!==0&&Fp(a,$i,a.index);switch(a.lanes=0,a.tag){case 16:e:{var i=a.pendingProps;if(t=ds(a.elementType),a.type=t,typeof t=="function")Fd(t)?(i=ps(t,i),a.tag=1,a=ix(null,a,t,i,l)):(a.tag=0,a=Mf(null,a,t,i,l));else{if(t!=null){var d=t.$$typeof;if(d===Q){a.tag=11,a=ex(null,a,t,i,l);break e}else if(d===M){a.tag=14,a=tx(null,a,t,i,l);break e}}throw a=Te(t)||t,Error(s(306,a,""))}}return a;case 0:return Mf(t,a,a.type,a.pendingProps,l);case 1:return i=a.type,d=ps(i,a.pendingProps),ix(t,a,i,d,l);case 3:e:{if(He(a,a.stateNode.containerInfo),t===null)throw Error(s(387));i=a.pendingProps;var m=a.memoizedState;d=m.element,lf(t,a),Yi(a,i,null,l);var b=a.memoizedState;if(i=b.cache,yl(a,Ra,i),i!==m.cache&&Jd(a,[Ra],l,!0),Vi(),i=b.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:b.cache},a.updateQueue.baseState=m,a.memoizedState=m,a.flags&256){a=ox(t,a,i,l);break e}else if(i!==d){d=Yn(Error(s(424)),a),Bi(d),a=ox(t,a,i,l);break e}else{switch(t=a.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(la=Zn(t.firstChild),Xa=a,Et=!0,xl=null,Qn=!0,l=ng(a,null,i,l),a.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(is(),i===d){a=Xr(t,a,l);break e}Ka(t,a,i,l)}a=a.child}return a;case 26:return qc(t,a),t===null?(l=Ev(a.type,null,a.pendingProps,null))?a.memoizedState=l:Et||(l=a.type,t=a.pendingProps,i=lu(xe.current).createElement(l),i[ye]=a,i[De]=t,Za(i,l,t),ht(i),a.stateNode=i):a.memoizedState=Ev(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Qe(a),t===null&&Et&&(i=a.stateNode=bv(a.type,a.pendingProps,xe.current),Xa=a,Qn=!0,d=la,Ol(a.type)?(yh=d,la=Zn(i.firstChild)):la=d),Ka(t,a,a.pendingProps.children,l),qc(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&Et&&((d=i=la)&&(i=Iw(i,a.type,a.pendingProps,Qn),i!==null?(a.stateNode=i,Xa=a,la=Zn(i.firstChild),Qn=!1,d=!0):d=!1),d||vl(a)),Qe(a),d=a.type,m=a.pendingProps,b=t!==null?t.memoizedProps:null,i=m.children,mh(d,m)?i=null:b!==null&&mh(d,b)&&(a.flags|=32),a.memoizedState!==null&&(d=hf(t,a,aw,null,null,l),ho._currentValue=d),qc(t,a),Ka(t,a,i,l),a.child;case 6:return t===null&&Et&&((t=l=la)&&(l=qw(l,a.pendingProps,Qn),l!==null?(a.stateNode=l,Xa=a,la=null,t=!0):t=!1),t||vl(a)),null;case 13:return cx(t,a,l);case 4:return He(a,a.stateNode.containerInfo),i=a.pendingProps,t===null?a.child=hs(a,null,i,l):Ka(t,a,i,l),a.child;case 11:return ex(t,a,a.type,a.pendingProps,l);case 7:return Ka(t,a,a.pendingProps,l),a.child;case 8:return Ka(t,a,a.pendingProps.children,l),a.child;case 12:return Ka(t,a,a.pendingProps.children,l),a.child;case 10:return i=a.pendingProps,yl(a,a.type,i.value),Ka(t,a,i.children,l),a.child;case 9:return d=a.type._context,i=a.pendingProps.children,cs(a),d=Qa(d),i=i(d),a.flags|=1,Ka(t,a,i,l),a.child;case 14:return tx(t,a,a.type,a.pendingProps,l);case 15:return ax(t,a,a.type,a.pendingProps,l);case 19:return dx(t,a,l);case 31:return uw(t,a,l);case 22:return nx(t,a,l,a.pendingProps);case 24:return cs(a),i=Qa(Ra),t===null?(d=af(),d===null&&(d=ta,m=ef(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=l),d=m),a.memoizedState={parent:i,cache:d},rf(a),yl(a,Ra,d)):((t.lanes&l)!==0&&(lf(t,a),Yi(a,null,null,l),Vi()),d=t.memoizedState,m=a.memoizedState,d.parent!==i?(d={parent:i,cache:i},a.memoizedState=d,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=d),yl(a,Ra,i)):(i=m.cache,yl(a,Ra,i),i!==d.cache&&Jd(a,[Ra],l,!0))),Ka(t,a,a.pendingProps.children,l),a.child;case 29:throw a.pendingProps}throw Error(s(156,a.tag))}function Qr(t){t.flags|=4}function If(t,a,l,i,d){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(Bx())t.flags|=8192;else throw fs=kc,nf}else t.flags&=-16777217}function hx(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Tv(a))if(Bx())t.flags|=8192;else throw fs=kc,nf}function Fc(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?Wt():536870912,t.lanes|=a,Zs|=a)}function Wi(t,a){if(!Et)switch(t.tailMode){case"hidden":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function sa(t){var a=t.alternate!==null&&t.alternate.child===t.child,l=0,i=0;if(a)for(var d=t.child;d!==null;)l|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)l|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=i,t.childLanes=l,a}function fw(t,a,l){var i=a.pendingProps;switch(Xd(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sa(a),null;case 1:return sa(a),null;case 3:return l=a.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Vr(Ra),$e(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&($s(a)?Qr(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Kd())),sa(a),null;case 26:var d=a.type,m=a.memoizedState;return t===null?(Qr(a),m!==null?(sa(a),hx(a,m)):(sa(a),If(a,d,null,i,l))):m?m!==t.memoizedState?(Qr(a),sa(a),hx(a,m)):(sa(a),a.flags&=-16777217):(t=t.memoizedProps,t!==i&&Qr(a),sa(a),If(a,d,t,i,l)),null;case 27:if(ia(a),l=xe.current,d=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==i&&Qr(a);else{if(!i){if(a.stateNode===null)throw Error(s(166));return sa(a),null}t=ue.current,$s(a)?Yp(a):(t=bv(d,i,l),a.stateNode=t,Qr(a))}return sa(a),null;case 5:if(ia(a),d=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==i&&Qr(a);else{if(!i){if(a.stateNode===null)throw Error(s(166));return sa(a),null}if(m=ue.current,$s(a))Yp(a);else{var b=lu(xe.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?b.createElement(d,{is:i.is}):b.createElement(d)}}m[ye]=a,m[De]=i;e:for(b=a.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===a)break e;for(;b.sibling===null;){if(b.return===null||b.return===a)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}a.stateNode=m;e:switch(Za(m,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Qr(a)}}return sa(a),If(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,l),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==i&&Qr(a);else{if(typeof i!="string"&&a.stateNode===null)throw Error(s(166));if(t=xe.current,$s(a)){if(t=a.stateNode,l=a.memoizedProps,i=null,d=Xa,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}t[ye]=a,t=!!(t.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||cv(t.nodeValue,l)),t||vl(a,!0)}else t=lu(t).createTextNode(i),t[ye]=a,a.stateNode=t}return sa(a),null;case 31:if(l=a.memoizedState,t===null||t.memoizedState!==null){if(i=$s(a),l!==null){if(t===null){if(!i)throw Error(s(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[ye]=a}else is(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;sa(a),t=!1}else l=Kd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return a.flags&256?(_n(a),a):(_n(a),null);if((a.flags&128)!==0)throw Error(s(558))}return sa(a),null;case 13:if(i=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=$s(a),i!==null&&i.dehydrated!==null){if(t===null){if(!d)throw Error(s(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[ye]=a}else is(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;sa(a),d=!1}else d=Kd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(_n(a),a):(_n(a),null)}return _n(a),(a.flags&128)!==0?(a.lanes=l,a):(l=i!==null,t=t!==null&&t.memoizedState!==null,l&&(i=a.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==d&&(i.flags|=2048)),l!==t&&l&&(a.child.flags|=8192),Fc(a,a.updateQueue),sa(a),null);case 4:return $e(),t===null&&ch(a.stateNode.containerInfo),sa(a),null;case 10:return Vr(a.type),sa(a),null;case 19:if(B(ya),i=a.memoizedState,i===null)return sa(a),null;if(d=(a.flags&128)!==0,m=i.rendering,m===null)if(d)Wi(i,!1);else{if(ma!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(m=Dc(t),m!==null){for(a.flags|=128,Wi(i,!1),t=m.updateQueue,a.updateQueue=t,Fc(a,t),a.subtreeFlags=0,t=l,l=a.child;l!==null;)Ip(l,t),l=l.sibling;return K(ya,ya.current&1|2),Et&&Pr(a,i.treeForkCount),a.child}t=t.sibling}i.tail!==null&&aa()>Qc&&(a.flags|=128,d=!0,Wi(i,!1),a.lanes=4194304)}else{if(!d)if(t=Dc(m),t!==null){if(a.flags|=128,d=!0,t=t.updateQueue,a.updateQueue=t,Fc(a,t),Wi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Et)return sa(a),null}else 2*aa()-i.renderingStartTime>Qc&&l!==536870912&&(a.flags|=128,d=!0,Wi(i,!1),a.lanes=4194304);i.isBackwards?(m.sibling=a.child,a.child=m):(t=i.last,t!==null?t.sibling=m:a.child=m,i.last=m)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=aa(),t.sibling=null,l=ya.current,K(ya,d?l&1|2:l&1),Et&&Pr(a,i.treeForkCount),t):(sa(a),null);case 22:case 23:return _n(a),uf(),i=a.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(a.flags|=8192):i&&(a.flags|=8192),i?(l&536870912)!==0&&(a.flags&128)===0&&(sa(a),a.subtreeFlags&6&&(a.flags|=8192)):sa(a),l=a.updateQueue,l!==null&&Fc(a,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048),t!==null&&B(us),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),Vr(Ra),sa(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function hw(t,a){switch(Xd(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Vr(Ra),$e(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return ia(a),null;case 31:if(a.memoizedState!==null){if(_n(a),a.alternate===null)throw Error(s(340));is()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(_n(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(s(340));is()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return B(ya),null;case 4:return $e(),null;case 10:return Vr(a.type),null;case 22:case 23:return _n(a),uf(),t!==null&&B(us),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Vr(Ra),null;case 25:return null;default:return null}}function mx(t,a){switch(Xd(a),a.tag){case 3:Vr(Ra),$e();break;case 26:case 27:case 5:ia(a);break;case 4:$e();break;case 31:a.memoizedState!==null&&_n(a);break;case 13:_n(a);break;case 19:B(ya);break;case 10:Vr(a.type);break;case 22:case 23:_n(a),uf(),t!==null&&B(us);break;case 24:Vr(Ra)}}function Ji(t,a){try{var l=a.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var d=i.next;l=d;do{if((l.tag&t)===t){i=void 0;var m=l.create,b=l.inst;i=m(),b.destroy=i}l=l.next}while(l!==d)}}catch(N){Ft(a,a.return,N)}}function jl(t,a,l){try{var i=a.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var m=d.next;i=m;do{if((i.tag&t)===t){var b=i.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,d=a;var D=l,Y=N;try{Y()}catch(ae){Ft(d,D,ae)}}}i=i.next}while(i!==m)}}catch(ae){Ft(a,a.return,ae)}}function px(t){var a=t.updateQueue;if(a!==null){var l=t.stateNode;try{lg(a,l)}catch(i){Ft(t,t.return,i)}}}function gx(t,a,l){l.props=ps(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(i){Ft(t,a,i)}}function eo(t,a){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof l=="function"?t.refCleanup=l(i):l.current=i}}catch(d){Ft(t,a,d)}}function Nr(t,a){var l=t.ref,i=t.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(d){Ft(t,a,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){Ft(t,a,d)}else l.current=null}function xx(t){var a=t.type,l=t.memoizedProps,i=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(d){Ft(t,t.return,d)}}function qf(t,a,l){try{var i=t.stateNode;Lw(i,t.type,l,a),i[De]=a}catch(d){Ft(t,t.return,d)}}function vx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ol(t.type)||t.tag===4}function Pf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||vx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ol(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ff(t,a,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,a?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,a):(a=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,a.appendChild(t),l=l._reactRootContainer,l!=null||a.onclick!==null||(a.onclick=nn));else if(i!==4&&(i===27&&Ol(t.type)&&(l=t.stateNode,a=null),t=t.child,t!==null))for(Ff(t,a,l),t=t.sibling;t!==null;)Ff(t,a,l),t=t.sibling}function Vc(t,a,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,a?l.insertBefore(t,a):l.appendChild(t);else if(i!==4&&(i===27&&Ol(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Vc(t,a,l),t=t.sibling;t!==null;)Vc(t,a,l),t=t.sibling}function yx(t){var a=t.stateNode,l=t.memoizedProps;try{for(var i=t.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Za(a,i,l),a[ye]=t,a[De]=l}catch(m){Ft(t,t.return,m)}}var Kr=!1,Ca=!1,Vf=!1,bx=typeof WeakSet=="function"?WeakSet:Set,Ia=null;function mw(t,a){if(t=t.containerInfo,fh=fu,t=Op(t),Ud(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,N=-1,D=-1,Y=0,ae=0,oe=t,X=null;t:for(;;){for(var Z;oe!==l||d!==0&&oe.nodeType!==3||(N=b+d),oe!==m||i!==0&&oe.nodeType!==3||(D=b+i),oe.nodeType===3&&(b+=oe.nodeValue.length),(Z=oe.firstChild)!==null;)X=oe,oe=Z;for(;;){if(oe===t)break t;if(X===l&&++Y===d&&(N=b),X===m&&++ae===i&&(D=b),(Z=oe.nextSibling)!==null)break;oe=X,X=oe.parentNode}oe=Z}l=N===-1||D===-1?null:{start:N,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(hh={focusedElem:t,selectionRange:l},fu=!1,Ia=a;Ia!==null;)if(a=Ia,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Ia=t;else for(;Ia!==null;){switch(a=Ia,m=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)d=t[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,l=a,d=m.memoizedProps,m=m.memoizedState,i=l.stateNode;try{var Me=ps(l.type,d);t=i.getSnapshotBeforeUpdate(Me,m),i.__reactInternalSnapshotBeforeUpdate=t}catch(Ye){Ft(l,l.return,Ye)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,l=t.nodeType,l===9)gh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":gh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=a.sibling,t!==null){t.return=a.return,Ia=t;break}Ia=a.return}}function wx(t,a,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:Wr(t,l),i&4&&Ji(5,l);break;case 1:if(Wr(t,l),i&4)if(t=l.stateNode,a===null)try{t.componentDidMount()}catch(b){Ft(l,l.return,b)}else{var d=ps(l.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(d,a,t.__reactInternalSnapshotBeforeUpdate)}catch(b){Ft(l,l.return,b)}}i&64&&px(l),i&512&&eo(l,l.return);break;case 3:if(Wr(t,l),i&64&&(t=l.updateQueue,t!==null)){if(a=null,l.child!==null)switch(l.child.tag){case 27:case 5:a=l.child.stateNode;break;case 1:a=l.child.stateNode}try{lg(t,a)}catch(b){Ft(l,l.return,b)}}break;case 27:a===null&&i&4&&yx(l);case 26:case 5:Wr(t,l),a===null&&i&4&&xx(l),i&512&&eo(l,l.return);break;case 12:Wr(t,l);break;case 31:Wr(t,l),i&4&&Nx(t,l);break;case 13:Wr(t,l),i&4&&jx(t,l),i&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Ew.bind(null,l),Pw(t,l))));break;case 22:if(i=l.memoizedState!==null||Kr,!i){a=a!==null&&a.memoizedState!==null||Ca,d=Kr;var m=Ca;Kr=i,(Ca=a)&&!m?Jr(t,l,(l.subtreeFlags&8772)!==0):Wr(t,l),Kr=d,Ca=m}break;case 30:break;default:Wr(t,l)}}function Sx(t){var a=t.alternate;a!==null&&(t.alternate=null,Sx(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Fe(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var oa=null,wn=!1;function Zr(t,a,l){for(l=l.child;l!==null;)Ex(t,a,l),l=l.sibling}function Ex(t,a,l){if(te&&typeof te.onCommitFiberUnmount=="function")try{te.onCommitFiberUnmount(Pe,l)}catch{}switch(l.tag){case 26:Ca||Nr(l,a),Zr(t,a,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ca||Nr(l,a);var i=oa,d=wn;Ol(l.type)&&(oa=l.stateNode,wn=!1),Zr(t,a,l),co(l.stateNode),oa=i,wn=d;break;case 5:Ca||Nr(l,a);case 6:if(i=oa,d=wn,oa=null,Zr(t,a,l),oa=i,wn=d,oa!==null)if(wn)try{(oa.nodeType===9?oa.body:oa.nodeName==="HTML"?oa.ownerDocument.body:oa).removeChild(l.stateNode)}catch(m){Ft(l,a,m)}else try{oa.removeChild(l.stateNode)}catch(m){Ft(l,a,m)}break;case 18:oa!==null&&(wn?(t=oa,pv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),li(t)):pv(oa,l.stateNode));break;case 4:i=oa,d=wn,oa=l.stateNode.containerInfo,wn=!0,Zr(t,a,l),oa=i,wn=d;break;case 0:case 11:case 14:case 15:jl(2,l,a),Ca||jl(4,l,a),Zr(t,a,l);break;case 1:Ca||(Nr(l,a),i=l.stateNode,typeof i.componentWillUnmount=="function"&&gx(l,a,i)),Zr(t,a,l);break;case 21:Zr(t,a,l);break;case 22:Ca=(i=Ca)||l.memoizedState!==null,Zr(t,a,l),Ca=i;break;default:Zr(t,a,l)}}function Nx(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{li(t)}catch(l){Ft(a,a.return,l)}}}function jx(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{li(t)}catch(l){Ft(a,a.return,l)}}function pw(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new bx),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new bx),a;default:throw Error(s(435,t.tag))}}function Yc(t,a){var l=pw(t);a.forEach(function(i){if(!l.has(i)){l.add(i);var d=Nw.bind(null,t,i);i.then(d,d)}})}function Sn(t,a){var l=a.deletions;if(l!==null)for(var i=0;i<l.length;i++){var d=l[i],m=t,b=a,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(Ol(N.type)){oa=N.stateNode,wn=!1;break e}break;case 5:oa=N.stateNode,wn=!1;break e;case 3:case 4:oa=N.stateNode.containerInfo,wn=!0;break e}N=N.return}if(oa===null)throw Error(s(160));Ex(m,b,d),oa=null,wn=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Rx(a,t),a=a.sibling}var ur=null;function Rx(t,a){var l=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Sn(a,t),En(t),i&4&&(jl(3,t,t.return),Ji(3,t),jl(5,t,t.return));break;case 1:Sn(a,t),En(t),i&512&&(Ca||l===null||Nr(l,l.return)),i&64&&Kr&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var d=ur;if(Sn(a,t),En(t),i&512&&(Ca||l===null||Nr(l,l.return)),i&4){var m=l!==null?l.memoizedState:null;if(i=t.memoizedState,l===null)if(i===null)if(t.stateNode===null){e:{i=t.type,l=t.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":m=d.getElementsByTagName("title")[0],(!m||m[Je]||m[ye]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(i),d.head.insertBefore(m,d.querySelector("head > title"))),Za(m,i,l),m[ye]=t,ht(m),i=m;break e;case"link":var b=Rv("link","href",d).get(i+(l.href||""));if(b){for(var N=0;N<b.length;N++)if(m=b[N],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(N,1);break t}}m=d.createElement(i),Za(m,i,l),d.head.appendChild(m);break;case"meta":if(b=Rv("meta","content",d).get(i+(l.content||""))){for(N=0;N<b.length;N++)if(m=b[N],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(N,1);break t}}m=d.createElement(i),Za(m,i,l),d.head.appendChild(m);break;default:throw Error(s(468,i))}m[ye]=t,ht(m),i=m}t.stateNode=i}else kv(d,t.type,t.stateNode);else t.stateNode=jv(d,i,t.memoizedProps);else m!==i?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,i===null?kv(d,t.type,t.stateNode):jv(d,i,t.memoizedProps)):i===null&&t.stateNode!==null&&qf(t,t.memoizedProps,l.memoizedProps)}break;case 27:Sn(a,t),En(t),i&512&&(Ca||l===null||Nr(l,l.return)),l!==null&&i&4&&qf(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Sn(a,t),En(t),i&512&&(Ca||l===null||Nr(l,l.return)),t.flags&32){d=t.stateNode;try{ml(d,"")}catch(Me){Ft(t,t.return,Me)}}i&4&&t.stateNode!=null&&(d=t.memoizedProps,qf(t,d,l!==null?l.memoizedProps:d)),i&1024&&(Vf=!0);break;case 6:if(Sn(a,t),En(t),i&4){if(t.stateNode===null)throw Error(s(162));i=t.memoizedProps,l=t.stateNode;try{l.nodeValue=i}catch(Me){Ft(t,t.return,Me)}}break;case 3:if(ou=null,d=ur,ur=su(a.containerInfo),Sn(a,t),ur=d,En(t),i&4&&l!==null&&l.memoizedState.isDehydrated)try{li(a.containerInfo)}catch(Me){Ft(t,t.return,Me)}Vf&&(Vf=!1,kx(t));break;case 4:i=ur,ur=su(t.stateNode.containerInfo),Sn(a,t),En(t),ur=i;break;case 12:Sn(a,t),En(t);break;case 31:Sn(a,t),En(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Yc(t,i)));break;case 13:Sn(a,t),En(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Xc=aa()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Yc(t,i)));break;case 22:d=t.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,Y=Kr,ae=Ca;if(Kr=Y||d,Ca=ae||D,Sn(a,t),Ca=ae,Kr=Y,En(t),i&8192)e:for(a=t.stateNode,a._visibility=d?a._visibility&-2:a._visibility|1,d&&(l===null||D||Kr||Ca||gs(t)),l=null,a=t;;){if(a.tag===5||a.tag===26){if(l===null){D=l=a;try{if(m=D.stateNode,d)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=D.stateNode;var oe=D.memoizedProps.style,X=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;N.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Me){Ft(D,D.return,Me)}}}else if(a.tag===6){if(l===null){D=a;try{D.stateNode.nodeValue=d?"":D.memoizedProps}catch(Me){Ft(D,D.return,Me)}}}else if(a.tag===18){if(l===null){D=a;try{var Z=D.stateNode;d?gv(Z,!0):gv(D.stateNode,!1)}catch(Me){Ft(D,D.return,Me)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;l===a&&(l=null),a=a.return}l===a&&(l=null),a.sibling.return=a.return,a=a.sibling}i&4&&(i=t.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,Yc(t,l))));break;case 19:Sn(a,t),En(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Yc(t,i)));break;case 30:break;case 21:break;default:Sn(a,t),En(t)}}function En(t){var a=t.flags;if(a&2){try{for(var l,i=t.return;i!==null;){if(vx(i)){l=i;break}i=i.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var d=l.stateNode,m=Pf(t);Vc(t,m,d);break;case 5:var b=l.stateNode;l.flags&32&&(ml(b,""),l.flags&=-33);var N=Pf(t);Vc(t,N,b);break;case 3:case 4:var D=l.stateNode.containerInfo,Y=Pf(t);Ff(t,Y,D);break;default:throw Error(s(161))}}catch(ae){Ft(t,t.return,ae)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function kx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;kx(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function Wr(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)wx(t,a.alternate,a),a=a.sibling}function gs(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:jl(4,a,a.return),gs(a);break;case 1:Nr(a,a.return);var l=a.stateNode;typeof l.componentWillUnmount=="function"&&gx(a,a.return,l),gs(a);break;case 27:co(a.stateNode);case 26:case 5:Nr(a,a.return),gs(a);break;case 22:a.memoizedState===null&&gs(a);break;case 30:gs(a);break;default:gs(a)}t=t.sibling}}function Jr(t,a,l){for(l=l&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var i=a.alternate,d=t,m=a,b=m.flags;switch(m.tag){case 0:case 11:case 15:Jr(d,m,l),Ji(4,m);break;case 1:if(Jr(d,m,l),i=m,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){Ft(i,i.return,Y)}if(i=m,d=i.updateQueue,d!==null){var N=i.stateNode;try{var D=d.shared.hiddenCallbacks;if(D!==null)for(d.shared.hiddenCallbacks=null,d=0;d<D.length;d++)rg(D[d],N)}catch(Y){Ft(i,i.return,Y)}}l&&b&64&&px(m),eo(m,m.return);break;case 27:yx(m);case 26:case 5:Jr(d,m,l),l&&i===null&&b&4&&xx(m),eo(m,m.return);break;case 12:Jr(d,m,l);break;case 31:Jr(d,m,l),l&&b&4&&Nx(d,m);break;case 13:Jr(d,m,l),l&&b&4&&jx(d,m);break;case 22:m.memoizedState===null&&Jr(d,m,l),eo(m,m.return);break;case 30:break;default:Jr(d,m,l)}a=a.sibling}}function Yf(t,a){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Hi(l))}function Gf(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Hi(t))}function dr(t,a,l,i){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Tx(t,a,l,i),a=a.sibling}function Tx(t,a,l,i){var d=a.flags;switch(a.tag){case 0:case 11:case 15:dr(t,a,l,i),d&2048&&Ji(9,a);break;case 1:dr(t,a,l,i);break;case 3:dr(t,a,l,i),d&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Hi(t)));break;case 12:if(d&2048){dr(t,a,l,i),t=a.stateNode;try{var m=a.memoizedProps,b=m.id,N=m.onPostCommit;typeof N=="function"&&N(b,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(D){Ft(a,a.return,D)}}else dr(t,a,l,i);break;case 31:dr(t,a,l,i);break;case 13:dr(t,a,l,i);break;case 23:break;case 22:m=a.stateNode,b=a.alternate,a.memoizedState!==null?m._visibility&2?dr(t,a,l,i):to(t,a):m._visibility&2?dr(t,a,l,i):(m._visibility|=2,Xs(t,a,l,i,(a.subtreeFlags&10256)!==0||!1)),d&2048&&Yf(b,a);break;case 24:dr(t,a,l,i),d&2048&&Gf(a.alternate,a);break;default:dr(t,a,l,i)}}function Xs(t,a,l,i,d){for(d=d&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var m=t,b=a,N=l,D=i,Y=b.flags;switch(b.tag){case 0:case 11:case 15:Xs(m,b,N,D,d),Ji(8,b);break;case 23:break;case 22:var ae=b.stateNode;b.memoizedState!==null?ae._visibility&2?Xs(m,b,N,D,d):to(m,b):(ae._visibility|=2,Xs(m,b,N,D,d)),d&&Y&2048&&Yf(b.alternate,b);break;case 24:Xs(m,b,N,D,d),d&&Y&2048&&Gf(b.alternate,b);break;default:Xs(m,b,N,D,d)}a=a.sibling}}function to(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var l=t,i=a,d=i.flags;switch(i.tag){case 22:to(l,i),d&2048&&Yf(i.alternate,i);break;case 24:to(l,i),d&2048&&Gf(i.alternate,i);break;default:to(l,i)}a=a.sibling}}var ao=8192;function Qs(t,a,l){if(t.subtreeFlags&ao)for(t=t.child;t!==null;)Cx(t,a,l),t=t.sibling}function Cx(t,a,l){switch(t.tag){case 26:Qs(t,a,l),t.flags&ao&&t.memoizedState!==null&&tS(l,ur,t.memoizedState,t.memoizedProps);break;case 5:Qs(t,a,l);break;case 3:case 4:var i=ur;ur=su(t.stateNode.containerInfo),Qs(t,a,l),ur=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=ao,ao=16777216,Qs(t,a,l),ao=i):Qs(t,a,l));break;default:Qs(t,a,l)}}function Ax(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function no(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var l=0;l<a.length;l++){var i=a[l];Ia=i,Ox(i,t)}Ax(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dx(t),t=t.sibling}function Dx(t){switch(t.tag){case 0:case 11:case 15:no(t),t.flags&2048&&jl(9,t,t.return);break;case 3:no(t);break;case 12:no(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,Gc(t)):no(t);break;default:no(t)}}function Gc(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var l=0;l<a.length;l++){var i=a[l];Ia=i,Ox(i,t)}Ax(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:jl(8,a,a.return),Gc(a);break;case 22:l=a.stateNode,l._visibility&2&&(l._visibility&=-3,Gc(a));break;default:Gc(a)}t=t.sibling}}function Ox(t,a){for(;Ia!==null;){var l=Ia;switch(l.tag){case 0:case 11:case 15:jl(8,l,a);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Hi(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,Ia=i;else e:for(l=t;Ia!==null;){i=Ia;var d=i.sibling,m=i.return;if(Sx(i),i===l){Ia=null;break e}if(d!==null){d.return=m,Ia=d;break e}Ia=m}}}var gw={getCacheForType:function(t){var a=Qa(Ra),l=a.data.get(t);return l===void 0&&(l=t(),a.data.set(t,l)),l},cacheSignal:function(){return Qa(Ra).controller.signal}},xw=typeof WeakMap=="function"?WeakMap:Map,Mt=0,ta=null,gt=null,bt=0,Pt=0,Ln=null,Rl=!1,Ks=!1,Xf=!1,el=0,ma=0,kl=0,xs=0,Qf=0,zn=0,Zs=0,ro=null,Nn=null,Kf=!1,Xc=0,Mx=0,Qc=1/0,Kc=null,Tl=null,La=0,Cl=null,Ws=null,tl=0,Zf=0,Wf=null,_x=null,lo=0,Jf=null;function Un(){return(Mt&2)!==0&&bt!==0?bt&-bt:L.T!==null?lh():W()}function Lx(){if(zn===0)if((bt&536870912)===0||Et){var t=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),zn=t}else zn=536870912;return t=Mn.current,t!==null&&(t.flags|=32),zn}function jn(t,a,l){(t===ta&&(Pt===2||Pt===9)||t.cancelPendingCommit!==null)&&(Js(t,0),Al(t,bt,zn,!1)),pt(t,l),((Mt&2)===0||t!==ta)&&(t===ta&&((Mt&2)===0&&(xs|=l),ma===4&&Al(t,bt,zn,!1)),jr(t))}function zx(t,a,l){if((Mt&6)!==0)throw Error(s(327));var i=!l&&(a&127)===0&&(a&t.expiredLanes)===0||Ct(t,a),d=i?bw(t,a):th(t,a,!0),m=i;do{if(d===0){Ks&&!i&&Al(t,a,0,!1);break}else{if(l=t.current.alternate,m&&!vw(l)){d=th(t,a,!1),m=!1;continue}if(d===2){if(m=a,t.errorRecoveryDisabledLanes&m)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){a=b;e:{var N=t;d=ro;var D=N.current.memoizedState.isDehydrated;if(D&&(Js(N,b).flags|=256),b=th(N,b,!1),b!==2){if(Xf&&!D){N.errorRecoveryDisabledLanes|=m,xs|=m,d=4;break e}m=Nn,Nn=d,m!==null&&(Nn===null?Nn=m:Nn.push.apply(Nn,m))}d=b}if(m=!1,d!==2)continue}}if(d===1){Js(t,0),Al(t,a,0,!0);break}e:{switch(i=t,m=d,m){case 0:case 1:throw Error(s(345));case 4:if((a&4194048)!==a)break;case 6:Al(i,a,zn,!Rl);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((a&62914560)===a&&(d=Xc+300-aa(),10<d)){if(Al(i,a,zn,!Rl),Ht(i,0,!0)!==0)break e;tl=a,i.timeoutHandle=hv(Ux.bind(null,i,l,Nn,Kc,Kf,a,zn,xs,Zs,Rl,m,"Throttled",-0,0),d);break e}Ux(i,l,Nn,Kc,Kf,a,zn,xs,Zs,Rl,m,null,-0,0)}}break}while(!0);jr(t)}function Ux(t,a,l,i,d,m,b,N,D,Y,ae,oe,X,Z){if(t.timeoutHandle=-1,oe=a.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Cx(a,m,oe);var Me=(m&62914560)===m?Xc-aa():(m&4194048)===m?Mx-aa():0;if(Me=aS(oe,Me),Me!==null){tl=m,t.cancelPendingCommit=Me(Vx.bind(null,t,a,m,l,i,d,b,N,D,ae,oe,null,X,Z)),Al(t,m,b,!Y);return}}Vx(t,a,m,l,i,d,b,N,D)}function vw(t){for(var a=t;;){var l=a.tag;if((l===0||l===11||l===15)&&a.flags&16384&&(l=a.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var d=l[i],m=d.getSnapshot;d=d.value;try{if(!Dn(m(),d))return!1}catch{return!1}}if(l=a.child,a.subtreeFlags&16384&&l!==null)l.return=a,a=l;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Al(t,a,l,i){a&=~Qf,a&=~xs,t.suspendedLanes|=a,t.pingedLanes&=~a,i&&(t.warmLanes|=a),i=t.expirationTimes;for(var d=a;0<d;){var m=31-Zt(d),b=1<<m;i[m]=-1,d&=~b}l!==0&&Sa(t,l,a)}function Zc(){return(Mt&6)===0?(so(0),!1):!0}function eh(){if(gt!==null){if(Pt===0)var t=gt.return;else t=gt,Fr=os=null,gf(t),Ps=null,qi=0,t=gt;for(;t!==null;)mx(t.alternate,t),t=t.return;gt=null}}function Js(t,a){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,$w(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),tl=0,eh(),ta=t,gt=l=qr(t.current,null),bt=a,Pt=0,Ln=null,Rl=!1,Ks=Ct(t,a),Xf=!1,Zs=zn=Qf=xs=kl=ma=0,Nn=ro=null,Kf=!1,(a&8)!==0&&(a|=a&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=a;0<i;){var d=31-Zt(i),m=1<<d;a|=t[d],i&=~m}return el=a,vc(),l}function $x(t,a){it=null,L.H=Ki,a===qs||a===Rc?(a=eg(),Pt=3):a===nf?(a=eg(),Pt=4):Pt=a===Of?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Ln=a,gt===null&&(ma=1,Hc(t,Yn(a,t.current)))}function Bx(){var t=Mn.current;return t===null?!0:(bt&4194048)===bt?Kn===null:(bt&62914560)===bt||(bt&536870912)!==0?t===Kn:!1}function Hx(){var t=L.H;return L.H=Ki,t===null?Ki:t}function Ix(){var t=L.A;return L.A=gw,t}function Wc(){ma=4,Rl||(bt&4194048)!==bt&&Mn.current!==null||(Ks=!0),(kl&134217727)===0&&(xs&134217727)===0||ta===null||Al(ta,bt,zn,!1)}function th(t,a,l){var i=Mt;Mt|=2;var d=Hx(),m=Ix();(ta!==t||bt!==a)&&(Kc=null,Js(t,a)),a=!1;var b=ma;e:do try{if(Pt!==0&&gt!==null){var N=gt,D=Ln;switch(Pt){case 8:eh(),b=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(a=!0);var Y=Pt;if(Pt=0,Ln=null,ei(t,N,D,Y),l&&Ks){b=0;break e}break;default:Y=Pt,Pt=0,Ln=null,ei(t,N,D,Y)}}yw(),b=ma;break}catch(ae){$x(t,ae)}while(!0);return a&&t.shellSuspendCounter++,Fr=os=null,Mt=i,L.H=d,L.A=m,gt===null&&(ta=null,bt=0,vc()),b}function yw(){for(;gt!==null;)qx(gt)}function bw(t,a){var l=Mt;Mt|=2;var i=Hx(),d=Ix();ta!==t||bt!==a?(Kc=null,Qc=aa()+500,Js(t,a)):Ks=Ct(t,a);e:do try{if(Pt!==0&&gt!==null){a=gt;var m=Ln;t:switch(Pt){case 1:Pt=0,Ln=null,ei(t,a,m,1);break;case 2:case 9:if(Wp(m)){Pt=0,Ln=null,Px(a);break}a=function(){Pt!==2&&Pt!==9||ta!==t||(Pt=7),jr(t)},m.then(a,a);break e;case 3:Pt=7;break e;case 4:Pt=5;break e;case 7:Wp(m)?(Pt=0,Ln=null,Px(a)):(Pt=0,Ln=null,ei(t,a,m,7));break;case 5:var b=null;switch(gt.tag){case 26:b=gt.memoizedState;case 5:case 27:var N=gt;if(b?Tv(b):N.stateNode.complete){Pt=0,Ln=null;var D=N.sibling;if(D!==null)gt=D;else{var Y=N.return;Y!==null?(gt=Y,Jc(Y)):gt=null}break t}}Pt=0,Ln=null,ei(t,a,m,5);break;case 6:Pt=0,Ln=null,ei(t,a,m,6);break;case 8:eh(),ma=6;break e;default:throw Error(s(462))}}ww();break}catch(ae){$x(t,ae)}while(!0);return Fr=os=null,L.H=i,L.A=d,Mt=l,gt!==null?0:(ta=null,bt=0,vc(),ma)}function ww(){for(;gt!==null&&!$a();)qx(gt)}function qx(t){var a=fx(t.alternate,t,el);t.memoizedProps=t.pendingProps,a===null?Jc(t):gt=a}function Px(t){var a=t,l=a.alternate;switch(a.tag){case 15:case 0:a=sx(l,a,a.pendingProps,a.type,void 0,bt);break;case 11:a=sx(l,a,a.pendingProps,a.type.render,a.ref,bt);break;case 5:gf(a);default:mx(l,a),a=gt=Ip(a,el),a=fx(l,a,el)}t.memoizedProps=t.pendingProps,a===null?Jc(t):gt=a}function ei(t,a,l,i){Fr=os=null,gf(a),Ps=null,qi=0;var d=a.return;try{if(cw(t,d,a,l,bt)){ma=1,Hc(t,Yn(l,t.current)),gt=null;return}}catch(m){if(d!==null)throw gt=d,m;ma=1,Hc(t,Yn(l,t.current)),gt=null;return}a.flags&32768?(Et||i===1?t=!0:Ks||(bt&536870912)!==0?t=!1:(Rl=t=!0,(i===2||i===9||i===3||i===6)&&(i=Mn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Fx(a,t)):Jc(a)}function Jc(t){var a=t;do{if((a.flags&32768)!==0){Fx(a,Rl);return}t=a.return;var l=fw(a.alternate,a,el);if(l!==null){gt=l;return}if(a=a.sibling,a!==null){gt=a;return}gt=a=t}while(a!==null);ma===0&&(ma=5)}function Fx(t,a){do{var l=hw(t.alternate,t);if(l!==null){l.flags&=32767,gt=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!a&&(t=t.sibling,t!==null)){gt=t;return}gt=t=l}while(t!==null);ma=6,gt=null}function Vx(t,a,l,i,d,m,b,N,D){t.cancelPendingCommit=null;do eu();while(La!==0);if((Mt&6)!==0)throw Error(s(327));if(a!==null){if(a===t.current)throw Error(s(177));if(m=a.lanes|a.childLanes,m|=qd,et(t,l,m,b,N,D),t===ta&&(gt=ta=null,bt=0),Ws=a,Cl=t,tl=l,Zf=m,Wf=d,_x=i,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,jw(Ha,function(){return Kx(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||i){i=L.T,L.T=null,d=F.p,F.p=2,b=Mt,Mt|=4;try{mw(t,a,l)}finally{Mt=b,F.p=d,L.T=i}}La=1,Yx(),Gx(),Xx()}}function Yx(){if(La===1){La=0;var t=Cl,a=Ws,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=L.T,L.T=null;var i=F.p;F.p=2;var d=Mt;Mt|=4;try{Rx(a,t);var m=hh,b=Op(t.containerInfo),N=m.focusedElem,D=m.selectionRange;if(b!==N&&N&&N.ownerDocument&&Dp(N.ownerDocument.documentElement,N)){if(D!==null&&Ud(N)){var Y=D.start,ae=D.end;if(ae===void 0&&(ae=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ae,N.value.length);else{var oe=N.ownerDocument||document,X=oe&&oe.defaultView||window;if(X.getSelection){var Z=X.getSelection(),Me=N.textContent.length,Ye=Math.min(D.start,Me),Xt=D.end===void 0?Ye:Math.min(D.end,Me);!Z.extend&&Ye>Xt&&(b=Xt,Xt=Ye,Ye=b);var H=Ap(N,Ye),U=Ap(N,Xt);if(H&&U&&(Z.rangeCount!==1||Z.anchorNode!==H.node||Z.anchorOffset!==H.offset||Z.focusNode!==U.node||Z.focusOffset!==U.offset)){var V=oe.createRange();V.setStart(H.node,H.offset),Z.removeAllRanges(),Ye>Xt?(Z.addRange(V),Z.extend(U.node,U.offset)):(V.setEnd(U.node,U.offset),Z.addRange(V))}}}}for(oe=[],Z=N;Z=Z.parentNode;)Z.nodeType===1&&oe.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<oe.length;N++){var le=oe[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}fu=!!fh,hh=fh=null}finally{Mt=d,F.p=i,L.T=l}}t.current=a,La=2}}function Gx(){if(La===2){La=0;var t=Cl,a=Ws,l=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||l){l=L.T,L.T=null;var i=F.p;F.p=2;var d=Mt;Mt|=4;try{wx(t,a.alternate,a)}finally{Mt=d,F.p=i,L.T=l}}La=3}}function Xx(){if(La===4||La===3){La=0,Ba();var t=Cl,a=Ws,l=tl,i=_x;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?La=5:(La=0,Ws=Cl=null,Qx(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(Tl=null),q(l),a=a.stateNode,te&&typeof te.onCommitFiberRoot=="function")try{te.onCommitFiberRoot(Pe,a,void 0,(a.current.flags&128)===128)}catch{}if(i!==null){a=L.T,d=F.p,F.p=2,L.T=null;try{for(var m=t.onRecoverableError,b=0;b<i.length;b++){var N=i[b];m(N.value,{componentStack:N.stack})}}finally{L.T=a,F.p=d}}(tl&3)!==0&&eu(),jr(t),d=t.pendingLanes,(l&261930)!==0&&(d&42)!==0?t===Jf?lo++:(lo=0,Jf=t):lo=0,so(0)}}function Qx(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Hi(a)))}function eu(){return Yx(),Gx(),Xx(),Kx()}function Kx(){if(La!==5)return!1;var t=Cl,a=Zf;Zf=0;var l=q(tl),i=L.T,d=F.p;try{F.p=32>l?32:l,L.T=null,l=Wf,Wf=null;var m=Cl,b=tl;if(La=0,Ws=Cl=null,tl=0,(Mt&6)!==0)throw Error(s(331));var N=Mt;if(Mt|=4,Dx(m.current),Tx(m,m.current,b,l),Mt=N,so(0,!1),te&&typeof te.onPostCommitFiberRoot=="function")try{te.onPostCommitFiberRoot(Pe,m)}catch{}return!0}finally{F.p=d,L.T=i,Qx(t,a)}}function Zx(t,a,l){a=Yn(l,a),a=Df(t.stateNode,a,2),t=Sl(t,a,2),t!==null&&(pt(t,2),jr(t))}function Ft(t,a,l){if(t.tag===3)Zx(t,t,l);else for(;a!==null;){if(a.tag===3){Zx(a,t,l);break}else if(a.tag===1){var i=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Tl===null||!Tl.has(i))){t=Yn(l,t),l=Wg(2),i=Sl(a,l,2),i!==null&&(Jg(l,i,a,t),pt(i,2),jr(i));break}}a=a.return}}function ah(t,a,l){var i=t.pingCache;if(i===null){i=t.pingCache=new xw;var d=new Set;i.set(a,d)}else d=i.get(a),d===void 0&&(d=new Set,i.set(a,d));d.has(l)||(Xf=!0,d.add(l),t=Sw.bind(null,t,a,l),a.then(t,t))}function Sw(t,a,l){var i=t.pingCache;i!==null&&i.delete(a),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ta===t&&(bt&l)===l&&(ma===4||ma===3&&(bt&62914560)===bt&&300>aa()-Xc?(Mt&2)===0&&Js(t,0):Qf|=l,Zs===bt&&(Zs=0)),jr(t)}function Wx(t,a){a===0&&(a=Wt()),t=ls(t,a),t!==null&&(pt(t,a),jr(t))}function Ew(t){var a=t.memoizedState,l=0;a!==null&&(l=a.retryLane),Wx(t,l)}function Nw(t,a){var l=0;switch(t.tag){case 31:case 13:var i=t.stateNode,d=t.memoizedState;d!==null&&(l=d.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(a),Wx(t,l)}function jw(t,a){return Lt(t,a)}var tu=null,ti=null,nh=!1,au=!1,rh=!1,Dl=0;function jr(t){t!==ti&&t.next===null&&(ti===null?tu=ti=t:ti=ti.next=t),au=!0,nh||(nh=!0,kw())}function so(t,a){if(!rh&&au){rh=!0;do for(var l=!1,i=tu;i!==null;){if(t!==0){var d=i.pendingLanes;if(d===0)var m=0;else{var b=i.suspendedLanes,N=i.pingedLanes;m=(1<<31-Zt(42|t)+1)-1,m&=d&~(b&~N),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,av(i,m))}else m=bt,m=Ht(i,i===ta?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Ct(i,m)||(l=!0,av(i,m));i=i.next}while(l);rh=!1}}function Rw(){Jx()}function Jx(){au=nh=!1;var t=0;Dl!==0&&Uw()&&(t=Dl);for(var a=aa(),l=null,i=tu;i!==null;){var d=i.next,m=ev(i,a);m===0?(i.next=null,l===null?tu=d:l.next=d,d===null&&(ti=l)):(l=i,(t!==0||(m&3)!==0)&&(au=!0)),i=d}La!==0&&La!==5||so(t),Dl!==0&&(Dl=0)}function ev(t,a){for(var l=t.suspendedLanes,i=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var b=31-Zt(m),N=1<<b,D=d[b];D===-1?((N&l)===0||(N&i)!==0)&&(d[b]=na(N,a)):D<=a&&(t.expiredLanes|=N),m&=~N}if(a=ta,l=bt,l=Ht(t,t===a?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,l===0||t===a&&(Pt===2||Pt===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Kt(i),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Ct(t,l)){if(a=l&-l,a===t.callbackPriority)return a;switch(i!==null&&Kt(i),q(l)){case 2:case 8:l=en;break;case 32:l=Ha;break;case 268435456:l=Ce;break;default:l=Ha}return i=tv.bind(null,t),l=Lt(l,i),t.callbackPriority=a,t.callbackNode=l,a}return i!==null&&i!==null&&Kt(i),t.callbackPriority=2,t.callbackNode=null,2}function tv(t,a){if(La!==0&&La!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(eu()&&t.callbackNode!==l)return null;var i=bt;return i=Ht(t,t===ta?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(zx(t,i,a),ev(t,aa()),t.callbackNode!=null&&t.callbackNode===l?tv.bind(null,t):null)}function av(t,a){if(eu())return null;zx(t,a,!0)}function kw(){Bw(function(){(Mt&6)!==0?Lt(hn,Rw):Jx()})}function lh(){if(Dl===0){var t=Hs;t===0&&(t=_e,_e<<=1,(_e&261888)===0&&(_e=256)),Dl=t}return Dl}function nv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ra(""+t)}function rv(t,a){var l=a.ownerDocument.createElement("input");return l.name=a.name,l.value=a.value,t.id&&l.setAttribute("form",t.id),a.parentNode.insertBefore(l,a),t=new FormData(t),l.parentNode.removeChild(l),t}function Tw(t,a,l,i,d){if(a==="submit"&&l&&l.stateNode===d){var m=nv((d[De]||null).action),b=i.submitter;b&&(a=(a=b[De]||null)?nv(a.formAction):b.getAttribute("formAction"),a!==null&&(m=a,b=null));var N=new Hr("action","action",null,i,d);t.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Dl!==0){var D=b?rv(d,b):new FormData(d);jf(l,{pending:!0,data:D,method:d.method,action:m},null,D)}}else typeof m=="function"&&(N.preventDefault(),D=b?rv(d,b):new FormData(d),jf(l,{pending:!0,data:D,method:d.method,action:m},m,D))},currentTarget:d}]})}}for(var sh=0;sh<Id.length;sh++){var ih=Id[sh],Cw=ih.toLowerCase(),Aw=ih[0].toUpperCase()+ih.slice(1);cr(Cw,"on"+Aw)}cr(Lp,"onAnimationEnd"),cr(zp,"onAnimationIteration"),cr(Up,"onAnimationStart"),cr("dblclick","onDoubleClick"),cr("focusin","onFocus"),cr("focusout","onBlur"),cr(Y1,"onTransitionRun"),cr(G1,"onTransitionStart"),cr(X1,"onTransitionCancel"),cr($p,"onTransitionEnd"),Oa("onMouseEnter",["mouseout","mouseover"]),Oa("onMouseLeave",["mouseout","mouseover"]),Oa("onPointerEnter",["pointerout","pointerover"]),Oa("onPointerLeave",["pointerout","pointerover"]),Ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var io="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(" "),Dw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(io));function lv(t,a){a=(a&4)!==0;for(var l=0;l<t.length;l++){var i=t[l],d=i.event;i=i.listeners;e:{var m=void 0;if(a)for(var b=i.length-1;0<=b;b--){var N=i[b],D=N.instance,Y=N.currentTarget;if(N=N.listener,D!==m&&d.isPropagationStopped())break e;m=N,d.currentTarget=Y;try{m(d)}catch(ae){xc(ae)}d.currentTarget=null,m=D}else for(b=0;b<i.length;b++){if(N=i[b],D=N.instance,Y=N.currentTarget,N=N.listener,D!==m&&d.isPropagationStopped())break e;m=N,d.currentTarget=Y;try{m(d)}catch(ae){xc(ae)}d.currentTarget=null,m=D}}}}function xt(t,a){var l=a[Le];l===void 0&&(l=a[Le]=new Set);var i=t+"__bubble";l.has(i)||(sv(a,t,2,!1),l.add(i))}function oh(t,a,l){var i=0;a&&(i|=4),sv(l,t,i,a)}var nu="_reactListening"+Math.random().toString(36).slice(2);function ch(t){if(!t[nu]){t[nu]=!0,Jt.forEach(function(l){l!=="selectionchange"&&(Dw.has(l)||oh(l,!1,t),oh(l,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[nu]||(a[nu]=!0,oh("selectionchange",!1,a))}}function sv(t,a,l,i){switch(Lv(a)){case 2:var d=lS;break;case 8:d=sS;break;default:d=Nh}l=d.bind(null,a,l,t),d=void 0,!Di||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(d=!0),i?d!==void 0?t.addEventListener(a,l,{capture:!0,passive:d}):t.addEventListener(a,l,!0):d!==void 0?t.addEventListener(a,l,{passive:d}):t.addEventListener(a,l,!1)}function uh(t,a,l,i,d){var m=i;if((a&1)===0&&(a&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var N=i.stateNode.containerInfo;if(N===d)break;if(b===4)for(b=i.return;b!==null;){var D=b.tag;if((D===3||D===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;N!==null;){if(b=qt(N),b===null)return;if(D=b.tag,D===5||D===6||D===26||D===27){i=m=b;continue e}N=N.parentNode}}i=i.return}Ai(function(){var Y=m,ae=Lr(l),oe=[];e:{var X=Bp.get(t);if(X!==void 0){var Z=Hr,Me=t;switch(t){case"keypress":if(As(l)===0)break e;case"keydown":case"keyup":Z=ja;break;case"focusin":Me="focus",Z=be;break;case"focusout":Me="blur",Z=be;break;case"beforeblur":case"afterblur":Z=be;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=hc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=G;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=wr;break;case Lp:case zp:case Up:Z=de;break;case $p:Z=mc;break;case"scroll":case"scrollend":Z=Ad;break;case"wheel":Z=Od;break;case"copy":case"cut":case"paste":Z=Se;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=Ut;break;case"toggle":case"beforetoggle":Z=M1}var Ye=(a&4)!==0,Xt=!Ye&&(t==="scroll"||t==="scrollend"),H=Ye?X!==null?X+"Capture":null:X;Ye=[];for(var U=Y,V;U!==null;){var le=U;if(V=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||V===null||H===null||(le=Pn(U,H),le!=null&&Ye.push(oo(U,le,V))),Xt)break;U=U.return}0<Ye.length&&(X=new Z(X,Me,null,l,ae),oe.push({event:X,listeners:Ye}))}}if((a&7)===0){e:{if(X=t==="mouseover"||t==="pointerover",Z=t==="mouseout"||t==="pointerout",X&&l!==An&&(Me=l.relatedTarget||l.fromElement)&&(qt(Me)||Me[Ne]))break e;if((Z||X)&&(X=ae.window===ae?ae:(X=ae.ownerDocument)?X.defaultView||X.parentWindow:window,Z?(Me=l.relatedTarget||l.toElement,Z=Y,Me=Me?qt(Me):null,Me!==null&&(Xt=c(Me),Ye=Me.tag,Me!==Xt||Ye!==5&&Ye!==27&&Ye!==6)&&(Me=null)):(Z=null,Me=Y),Z!==Me)){if(Ye=hc,le="onMouseLeave",H="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Ye=Ut,le="onPointerLeave",H="onPointerEnter",U="pointer"),Xt=Z==null?X:ft(Z),V=Me==null?X:ft(Me),X=new Ye(le,U+"leave",Z,l,ae),X.target=Xt,X.relatedTarget=V,le=null,qt(ae)===Y&&(Ye=new Ye(H,U+"enter",Me,l,ae),Ye.target=V,Ye.relatedTarget=Xt,le=Ye),Xt=le,Z&&Me)t:{for(Ye=Ow,H=Z,U=Me,V=0,le=H;le;le=Ye(le))V++;le=0;for(var Ie=U;Ie;Ie=Ye(Ie))le++;for(;0<V-le;)H=Ye(H),V--;for(;0<le-V;)U=Ye(U),le--;for(;V--;){if(H===U||U!==null&&H===U.alternate){Ye=H;break t}H=Ye(H),U=Ye(U)}Ye=null}else Ye=null;Z!==null&&iv(oe,X,Z,Ye,!1),Me!==null&&Xt!==null&&iv(oe,Xt,Me,Ye,!0)}}e:{if(X=Y?ft(Y):window,Z=X.nodeName&&X.nodeName.toLowerCase(),Z==="select"||Z==="input"&&X.type==="file")var Dt=Np;else if(Sp(X))if(jp)Dt=P1;else{Dt=I1;var ze=H1}else Z=X.nodeName,!Z||Z.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&Wl(Y.elementType)&&(Dt=Np):Dt=q1;if(Dt&&(Dt=Dt(t,Y))){Ep(oe,Dt,l,ae);break e}ze&&ze(t,X,Y),t==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&At(X,"number",X.value)}switch(ze=Y?ft(Y):window,t){case"focusin":(Sp(ze)||ze.contentEditable==="true")&&(Os=ze,$d=Y,Ui=null);break;case"focusout":Ui=$d=Os=null;break;case"mousedown":Bd=!0;break;case"contextmenu":case"mouseup":case"dragend":Bd=!1,Mp(oe,l,ae);break;case"selectionchange":if(V1)break;case"keydown":case"keyup":Mp(oe,l,ae)}var dt;if(_d)e:{switch(t){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else Ds?bp(t,l)&&(wt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(wt="onCompositionStart");wt&&(xp&&l.locale!=="ko"&&(Ds||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&Ds&&(dt=dc()):(Fn=ae,Oi="value"in Fn?Fn.value:Fn.textContent,Ds=!0)),ze=ru(Y,wt),0<ze.length&&(wt=new st(wt,t,null,l,ae),oe.push({event:wt,listeners:ze}),dt?wt.data=dt:(dt=wp(l),dt!==null&&(wt.data=dt)))),(dt=L1?z1(t,l):U1(t,l))&&(wt=ru(Y,"onBeforeInput"),0<wt.length&&(ze=new st("onBeforeInput","beforeinput",null,l,ae),oe.push({event:ze,listeners:wt}),ze.data=dt)),Tw(oe,t,Y,l,ae)}lv(oe,a)})}function oo(t,a,l){return{instance:t,listener:a,currentTarget:l}}function ru(t,a){for(var l=a+"Capture",i=[];t!==null;){var d=t,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=Pn(t,l),d!=null&&i.unshift(oo(t,d,m)),d=Pn(t,a),d!=null&&i.push(oo(t,d,m))),t.tag===3)return i;t=t.return}return[]}function Ow(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function iv(t,a,l,i,d){for(var m=a._reactName,b=[];l!==null&&l!==i;){var N=l,D=N.alternate,Y=N.stateNode;if(N=N.tag,D!==null&&D===i)break;N!==5&&N!==26&&N!==27||Y===null||(D=Y,d?(Y=Pn(l,m),Y!=null&&b.unshift(oo(l,Y,D))):d||(Y=Pn(l,m),Y!=null&&b.push(oo(l,Y,D)))),l=l.return}b.length!==0&&t.push({event:a,listeners:b})}var Mw=/\r\n?/g,_w=/\u0000|\uFFFD/g;function ov(t){return(typeof t=="string"?t:""+t).replace(Mw,`
49
- `).replace(_w,"")}function cv(t,a){return a=ov(a),ov(t)===a}function Gt(t,a,l,i,d,m){switch(l){case"children":typeof i=="string"?a==="body"||a==="textarea"&&i===""||ml(t,i):(typeof i=="number"||typeof i=="bigint")&&a!=="body"&&ml(t,""+i);break;case"className":xr(t,"class",i);break;case"tabIndex":xr(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":xr(t,l,i);break;case"style":vn(t,i,m);break;case"data":if(a!=="object"){xr(t,"data",i);break}case"src":case"href":if(i===""&&(a!=="a"||l!=="href")){t.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=ra(""+i),t.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(a!=="input"&&Gt(t,a,"name",d.name,d,null),Gt(t,a,"formEncType",d.formEncType,d,null),Gt(t,a,"formMethod",d.formMethod,d,null),Gt(t,a,"formTarget",d.formTarget,d,null)):(Gt(t,a,"encType",d.encType,d,null),Gt(t,a,"method",d.method,d,null),Gt(t,a,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=ra(""+i),t.setAttribute(l,i);break;case"onClick":i!=null&&(t.onclick=nn);break;case"onScroll":i!=null&&xt("scroll",t);break;case"onScrollEnd":i!=null&&xt("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(l=i.__html,l!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}l=ra(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,""+i):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":i===!0?t.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,i):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(l,i):t.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(l):t.setAttribute(l,i);break;case"popover":xt("beforetoggle",t),xt("toggle",t),tn(t,"popover",i);break;case"xlinkActuate":Ze(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ze(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ze(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ze(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ze(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ze(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ze(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ze(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ze(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":tn(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Ts.get(l)||l,tn(t,l,i))}}function dh(t,a,l,i,d,m){switch(l){case"style":vn(t,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(l=i.__html,l!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"children":typeof i=="string"?ml(t,i):(typeof i=="number"||typeof i=="bigint")&&ml(t,""+i);break;case"onScroll":i!=null&&xt("scroll",t);break;case"onScrollEnd":i!=null&&xt("scrollend",t);break;case"onClick":i!=null&&(t.onclick=nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Va.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),a=l.slice(2,d?l.length-7:void 0),m=t[De]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(a,m,d),typeof i=="function")){typeof m!="function"&&m!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(a,i,d);break e}l in t?t[l]=i:i===!0?t.setAttribute(l,""):tn(t,l,i)}}}function Za(t,a,l){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",t),xt("load",t);var i=!1,d=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Gt(t,a,m,b,l,null)}}d&&Gt(t,a,"srcSet",l.srcSet,l,null),i&&Gt(t,a,"src",l.src,l,null);return;case"input":xt("invalid",t);var N=m=b=d=null,D=null,Y=null;for(i in l)if(l.hasOwnProperty(i)){var ae=l[i];if(ae!=null)switch(i){case"name":d=ae;break;case"type":b=ae;break;case"checked":D=ae;break;case"defaultChecked":Y=ae;break;case"value":m=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,a));break;default:Gt(t,a,i,ae,l,null)}}Ti(t,m,N,D,Y,b,d,!1);return;case"select":xt("invalid",t),i=b=m=null;for(d in l)if(l.hasOwnProperty(d)&&(N=l[d],N!=null))switch(d){case"value":m=N;break;case"defaultValue":b=N;break;case"multiple":i=N;default:Gt(t,a,d,N,l,null)}a=m,l=b,t.multiple=!!i,a!=null?vr(t,!!i,a,!1):l!=null&&vr(t,!!i,l,!0);return;case"textarea":xt("invalid",t),m=d=i=null;for(b in l)if(l.hasOwnProperty(b)&&(N=l[b],N!=null))switch(b){case"value":i=N;break;case"defaultValue":d=N;break;case"children":m=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(s(91));break;default:Gt(t,a,b,N,l,null)}ir(t,i,d,m);return;case"option":for(D in l)if(l.hasOwnProperty(D)&&(i=l[D],i!=null))switch(D){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Gt(t,a,D,i,l,null)}return;case"dialog":xt("beforetoggle",t),xt("toggle",t),xt("cancel",t),xt("close",t);break;case"iframe":case"object":xt("load",t);break;case"video":case"audio":for(i=0;i<io.length;i++)xt(io[i],t);break;case"image":xt("error",t),xt("load",t);break;case"details":xt("toggle",t);break;case"embed":case"source":case"link":xt("error",t),xt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in l)if(l.hasOwnProperty(Y)&&(i=l[Y],i!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Gt(t,a,Y,i,l,null)}return;default:if(Wl(a)){for(ae in l)l.hasOwnProperty(ae)&&(i=l[ae],i!==void 0&&dh(t,a,ae,i,l,void 0));return}}for(N in l)l.hasOwnProperty(N)&&(i=l[N],i!=null&&Gt(t,a,N,i,l,null))}function Lw(t,a,l,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,b=null,N=null,D=null,Y=null,ae=null;for(Z in l){var oe=l[Z];if(l.hasOwnProperty(Z)&&oe!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":D=oe;default:i.hasOwnProperty(Z)||Gt(t,a,Z,null,i,oe)}}for(var X in i){var Z=i[X];if(oe=l[X],i.hasOwnProperty(X)&&(Z!=null||oe!=null))switch(X){case"type":m=Z;break;case"name":d=Z;break;case"checked":Y=Z;break;case"defaultChecked":ae=Z;break;case"value":b=Z;break;case"defaultValue":N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,a));break;default:Z!==oe&&Gt(t,a,X,Z,i,oe)}}Zl(t,b,N,D,Y,ae,m,d);return;case"select":Z=b=N=X=null;for(m in l)if(D=l[m],l.hasOwnProperty(m)&&D!=null)switch(m){case"value":break;case"multiple":Z=D;default:i.hasOwnProperty(m)||Gt(t,a,m,null,i,D)}for(d in i)if(m=i[d],D=l[d],i.hasOwnProperty(d)&&(m!=null||D!=null))switch(d){case"value":X=m;break;case"defaultValue":N=m;break;case"multiple":b=m;default:m!==D&&Gt(t,a,d,m,i,D)}a=N,l=b,i=Z,X!=null?vr(t,!!l,X,!1):!!i!=!!l&&(a!=null?vr(t,!!l,a,!0):vr(t,!!l,l?[]:"",!1));return;case"textarea":Z=X=null;for(N in l)if(d=l[N],l.hasOwnProperty(N)&&d!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Gt(t,a,N,null,i,d)}for(b in i)if(d=i[b],m=l[b],i.hasOwnProperty(b)&&(d!=null||m!=null))switch(b){case"value":X=d;break;case"defaultValue":Z=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==m&&Gt(t,a,b,d,i,m)}uc(t,X,Z);return;case"option":for(var Me in l)if(X=l[Me],l.hasOwnProperty(Me)&&X!=null&&!i.hasOwnProperty(Me))switch(Me){case"selected":t.selected=!1;break;default:Gt(t,a,Me,null,i,X)}for(D in i)if(X=i[D],Z=l[D],i.hasOwnProperty(D)&&X!==Z&&(X!=null||Z!=null))switch(D){case"selected":t.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Gt(t,a,D,X,i,Z)}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 Ye in l)X=l[Ye],l.hasOwnProperty(Ye)&&X!=null&&!i.hasOwnProperty(Ye)&&Gt(t,a,Ye,null,i,X);for(Y in i)if(X=i[Y],Z=l[Y],i.hasOwnProperty(Y)&&X!==Z&&(X!=null||Z!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(s(137,a));break;default:Gt(t,a,Y,X,i,Z)}return;default:if(Wl(a)){for(var Xt in l)X=l[Xt],l.hasOwnProperty(Xt)&&X!==void 0&&!i.hasOwnProperty(Xt)&&dh(t,a,Xt,void 0,i,X);for(ae in i)X=i[ae],Z=l[ae],!i.hasOwnProperty(ae)||X===Z||X===void 0&&Z===void 0||dh(t,a,ae,X,i,Z);return}}for(var H in l)X=l[H],l.hasOwnProperty(H)&&X!=null&&!i.hasOwnProperty(H)&&Gt(t,a,H,null,i,X);for(oe in i)X=i[oe],Z=l[oe],!i.hasOwnProperty(oe)||X===Z||X==null&&Z==null||Gt(t,a,oe,X,i,Z)}function uv(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var d=l[i],m=d.transferSize,b=d.initiatorType,N=d.duration;if(m&&N&&uv(b)){for(b=0,N=d.responseEnd,i+=1;i<l.length;i++){var D=l[i],Y=D.startTime;if(Y>N)break;var ae=D.transferSize,oe=D.initiatorType;ae&&uv(oe)&&(D=D.responseEnd,b+=ae*(D<N?1:(N-Y)/(D-Y)))}if(--i,a+=8*(m+b)/(d.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var fh=null,hh=null;function lu(t){return t.nodeType===9?t:t.ownerDocument}function dv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fv(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function mh(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var ph=null;function Uw(){var t=window.event;return t&&t.type==="popstate"?t===ph?!1:(ph=t,!0):(ph=null,!1)}var hv=typeof setTimeout=="function"?setTimeout:void 0,$w=typeof clearTimeout=="function"?clearTimeout:void 0,mv=typeof Promise=="function"?Promise:void 0,Bw=typeof queueMicrotask=="function"?queueMicrotask:typeof mv<"u"?function(t){return mv.resolve(null).then(t).catch(Hw)}:hv;function Hw(t){setTimeout(function(){throw t})}function Ol(t){return t==="head"}function pv(t,a){var l=a,i=0;do{var d=l.nextSibling;if(t.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(i===0){t.removeChild(d),li(a);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")co(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,co(l);for(var m=l.firstChild;m;){var b=m.nextSibling,N=m.nodeName;m[Je]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&co(t.ownerDocument.body);l=d}while(l);li(a)}function gv(t,a){var l=t;t=0;do{var i=l.nextSibling;if(l.nodeType===1?a?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(a?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=i}while(l)}function gh(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var l=a;switch(a=a.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":gh(l),Fe(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Iw(t,a,l,i){for(;t.nodeType===1;){var d=l;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Je])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Zn(t.nextSibling),t===null)break}return null}function qw(t,a,l){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Zn(t.nextSibling),t===null))return null;return t}function xv(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Zn(t.nextSibling),t===null))return null;return t}function xh(t){return t.data==="$?"||t.data==="$~"}function vh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Pw(t,a){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||l.readyState!=="loading")a();else{var i=function(){a(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Zn(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var yh=null;function vv(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(a===0)return Zn(t.nextSibling);a--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||a++}t=t.nextSibling}return null}function yv(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(a===0)return t;a--}else l!=="/$"&&l!=="/&"||a++}t=t.previousSibling}return null}function bv(t,a,l){switch(a=lu(l),t){case"html":if(t=a.documentElement,!t)throw Error(s(452));return t;case"head":if(t=a.head,!t)throw Error(s(453));return t;case"body":if(t=a.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function co(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Fe(t)}var Wn=new Map,wv=new Set;function su(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var al=F.d;F.d={f:Fw,r:Vw,D:Yw,C:Gw,L:Xw,m:Qw,X:Zw,S:Kw,M:Ww};function Fw(){var t=al.f(),a=Zc();return t||a}function Vw(t){var a=tt(t);a!==null&&a.tag===5&&a.type==="form"?$g(a):al.r(t)}var ai=typeof document>"u"?null:document;function Sv(t,a,l){var i=ai;if(i&&typeof a=="string"&&a){var d=Ga(a);d='link[rel="'+t+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),wv.has(d)||(wv.add(d),t={rel:t,crossOrigin:l,href:a},i.querySelector(d)===null&&(a=i.createElement("link"),Za(a,"link",t),ht(a),i.head.appendChild(a)))}}function Yw(t){al.D(t),Sv("dns-prefetch",t,null)}function Gw(t,a){al.C(t,a),Sv("preconnect",t,a)}function Xw(t,a,l){al.L(t,a,l);var i=ai;if(i&&t&&a){var d='link[rel="preload"][as="'+Ga(a)+'"]';a==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+Ga(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+Ga(l.imageSizes)+'"]')):d+='[href="'+Ga(t)+'"]';var m=d;switch(a){case"style":m=ni(t);break;case"script":m=ri(t)}Wn.has(m)||(t=v({rel:"preload",href:a==="image"&&l&&l.imageSrcSet?void 0:t,as:a},l),Wn.set(m,t),i.querySelector(d)!==null||a==="style"&&i.querySelector(uo(m))||a==="script"&&i.querySelector(fo(m))||(a=i.createElement("link"),Za(a,"link",t),ht(a),i.head.appendChild(a)))}}function Qw(t,a){al.m(t,a);var l=ai;if(l&&t){var i=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+Ga(i)+'"][href="'+Ga(t)+'"]',m=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ri(t)}if(!Wn.has(m)&&(t=v({rel:"modulepreload",href:t},a),Wn.set(m,t),l.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(fo(m)))return}i=l.createElement("link"),Za(i,"link",t),ht(i),l.head.appendChild(i)}}}function Kw(t,a,l){al.S(t,a,l);var i=ai;if(i&&t){var d=ut(i).hoistableStyles,m=ni(t);a=a||"default";var b=d.get(m);if(!b){var N={loading:0,preload:null};if(b=i.querySelector(uo(m)))N.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":a},l),(l=Wn.get(m))&&bh(t,l);var D=b=i.createElement("link");ht(D),Za(D,"link",t),D._p=new Promise(function(Y,ae){D.onload=Y,D.onerror=ae}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,iu(b,a,i)}b={type:"stylesheet",instance:b,count:1,state:N},d.set(m,b)}}}function Zw(t,a){al.X(t,a);var l=ai;if(l&&t){var i=ut(l).hoistableScripts,d=ri(t),m=i.get(d);m||(m=l.querySelector(fo(d)),m||(t=v({src:t,async:!0},a),(a=Wn.get(d))&&wh(t,a),m=l.createElement("script"),ht(m),Za(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function Ww(t,a){al.M(t,a);var l=ai;if(l&&t){var i=ut(l).hoistableScripts,d=ri(t),m=i.get(d);m||(m=l.querySelector(fo(d)),m||(t=v({src:t,async:!0,type:"module"},a),(a=Wn.get(d))&&wh(t,a),m=l.createElement("script"),ht(m),Za(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function Ev(t,a,l,i){var d=(d=xe.current)?su(d):null;if(!d)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(a=ni(l.href),l=ut(d).hoistableStyles,i=l.get(a),i||(i={type:"style",instance:null,count:0,state:null},l.set(a,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=ni(l.href);var m=ut(d).hoistableStyles,b=m.get(t);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,b),(m=d.querySelector(uo(t)))&&!m._p&&(b.instance=m,b.state.loading=5),Wn.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Wn.set(t,l),m||Jw(d,t,l,b.state))),a&&i===null)throw Error(s(528,""));return b}if(a&&i!==null)throw Error(s(529,""));return null;case"script":return a=l.async,l=l.src,typeof l=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ri(l),l=ut(d).hoistableScripts,i=l.get(a),i||(i={type:"script",instance:null,count:0,state:null},l.set(a,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function ni(t){return'href="'+Ga(t)+'"'}function uo(t){return'link[rel="stylesheet"]['+t+"]"}function Nv(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function Jw(t,a,l,i){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?i.loading=1:(a=t.createElement("link"),i.preload=a,a.addEventListener("load",function(){return i.loading|=1}),a.addEventListener("error",function(){return i.loading|=2}),Za(a,"link",l),ht(a),t.head.appendChild(a))}function ri(t){return'[src="'+Ga(t)+'"]'}function fo(t){return"script[async]"+t}function jv(t,a,l){if(a.count++,a.instance===null)switch(a.type){case"style":var i=t.querySelector('style[data-href~="'+Ga(l.href)+'"]');if(i)return a.instance=i,ht(i),i;var d=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ht(i),Za(i,"style",d),iu(i,l.precedence,t),a.instance=i;case"stylesheet":d=ni(l.href);var m=t.querySelector(uo(d));if(m)return a.state.loading|=4,a.instance=m,ht(m),m;i=Nv(l),(d=Wn.get(d))&&bh(i,d),m=(t.ownerDocument||t).createElement("link"),ht(m);var b=m;return b._p=new Promise(function(N,D){b.onload=N,b.onerror=D}),Za(m,"link",i),a.state.loading|=4,iu(m,l.precedence,t),a.instance=m;case"script":return m=ri(l.src),(d=t.querySelector(fo(m)))?(a.instance=d,ht(d),d):(i=l,(d=Wn.get(m))&&(i=v({},l),wh(i,d)),t=t.ownerDocument||t,d=t.createElement("script"),ht(d),Za(d,"link",i),t.head.appendChild(d),a.instance=d);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(i=a.instance,a.state.loading|=4,iu(i,l.precedence,t));return a.instance}function iu(t,a,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,m=d,b=0;b<i.length;b++){var N=i[b];if(N.dataset.precedence===a)m=N;else if(m!==d)break}m?m.parentNode.insertBefore(t,m.nextSibling):(a=l.nodeType===9?l.head:l,a.insertBefore(t,a.firstChild))}function bh(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function wh(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var ou=null;function Rv(t,a,l){if(ou===null){var i=new Map,d=ou=new Map;d.set(l,i)}else d=ou,i=d.get(l),i||(i=new Map,d.set(l,i));if(i.has(t))return i;for(i.set(t,null),l=l.getElementsByTagName(t),d=0;d<l.length;d++){var m=l[d];if(!(m[Je]||m[ye]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(a)||"";b=t+b;var N=i.get(b);N?N.push(m):i.set(b,[m])}}return i}function kv(t,a,l){t=t.ownerDocument||t,t.head.insertBefore(l,a==="title"?t.querySelector("head > title"):null)}function eS(t,a,l){if(l===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return t=a.disabled,typeof a.precedence=="string"&&t==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Tv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function tS(t,a,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=ni(i.href),m=a.querySelector(uo(d));if(m){a=m._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=cu.bind(t),a.then(t,t)),l.state.loading|=4,l.instance=m,ht(m);return}m=a.ownerDocument||a,i=Nv(i),(d=Wn.get(d))&&bh(i,d),m=m.createElement("link"),ht(m);var b=m;b._p=new Promise(function(N,D){b.onload=N,b.onerror=D}),Za(m,"link",i),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,a),(a=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=cu.bind(t),a.addEventListener("load",l),a.addEventListener("error",l))}}var Sh=0;function aS(t,a){return t.stylesheets&&t.count===0&&du(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var i=setTimeout(function(){if(t.stylesheets&&du(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+a);0<t.imgBytes&&Sh===0&&(Sh=62500*zw());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&du(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Sh?50:800)+a);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function cu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)du(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var uu=null;function du(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,uu=new Map,a.forEach(nS,t),uu=null,cu.call(t))}function nS(t,a){if(!(a.state.loading&4)){var l=uu.get(t);if(l)var i=l.get(null);else{l=new Map,uu.set(t,l);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var b=d[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),i=b)}i&&l.set(null,i)}d=a.instance,b=d.getAttribute("data-precedence"),m=l.get(b)||i,m===i&&l.set(null,d),l.set(b,d),this.count++,i=cu.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),m?m.parentNode.insertBefore(d,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),a.state.loading|=4}}var ho={$$typeof:$,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function rS(t,a,l,i,d,m,b,N,D){this.tag=1,this.containerInfo=t,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=It(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=It(0),this.hiddenUpdates=It(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Cv(t,a,l,i,d,m,b,N,D,Y,ae,oe){return t=new rS(t,a,l,b,D,Y,ae,oe,N),a=1,m===!0&&(a|=24),m=On(3,null,null,a),t.current=m,m.stateNode=t,a=ef(),a.refCount++,t.pooledCache=a,a.refCount++,m.memoizedState={element:i,isDehydrated:l,cache:a},rf(m),t}function Av(t){return t?(t=Ls,t):Ls}function Dv(t,a,l,i,d,m){d=Av(d),i.context===null?i.context=d:i.pendingContext=d,i=wl(a),i.payload={element:l},m=m===void 0?null:m,m!==null&&(i.callback=m),l=Sl(t,i,a),l!==null&&(jn(l,t,a),Fi(l,t,a))}function Ov(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<a?l:a}}function Eh(t,a){Ov(t,a),(t=t.alternate)&&Ov(t,a)}function Mv(t){if(t.tag===13||t.tag===31){var a=ls(t,67108864);a!==null&&jn(a,t,67108864),Eh(t,67108864)}}function _v(t){if(t.tag===13||t.tag===31){var a=Un();a=_(a);var l=ls(t,a);l!==null&&jn(l,t,a),Eh(t,a)}}var fu=!0;function lS(t,a,l,i){var d=L.T;L.T=null;var m=F.p;try{F.p=2,Nh(t,a,l,i)}finally{F.p=m,L.T=d}}function sS(t,a,l,i){var d=L.T;L.T=null;var m=F.p;try{F.p=8,Nh(t,a,l,i)}finally{F.p=m,L.T=d}}function Nh(t,a,l,i){if(fu){var d=jh(i);if(d===null)uh(t,a,i,hu,l),zv(t,i);else if(oS(d,t,a,l,i))i.stopPropagation();else if(zv(t,i),a&4&&-1<iS.indexOf(t)){for(;d!==null;){var m=tt(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=St(m.pendingLanes);if(b!==0){var N=m;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var D=1<<31-Zt(b);N.entanglements[1]|=D,b&=~D}jr(m),(Mt&6)===0&&(Qc=aa()+500,so(0))}}break;case 31:case 13:N=ls(m,2),N!==null&&jn(N,m,2),Zc(),Eh(m,2)}if(m=jh(i),m===null&&uh(t,a,i,hu,l),m===d)break;d=m}d!==null&&i.stopPropagation()}else uh(t,a,i,null,l)}}function jh(t){return t=Lr(t),Rh(t)}var hu=null;function Rh(t){if(hu=null,t=qt(t),t!==null){var a=c(t);if(a===null)t=null;else{var l=a.tag;if(l===13){if(t=f(a),t!==null)return t;t=null}else if(l===31){if(t=h(a),t!==null)return t;t=null}else if(l===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return hu=t,null}function Lv(t){switch(t){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(fn()){case hn:return 2;case en:return 8;case Ha:case me:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var kh=!1,Ml=null,_l=null,Ll=null,mo=new Map,po=new Map,zl=[],iS="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 zv(t,a){switch(t){case"focusin":case"focusout":Ml=null;break;case"dragenter":case"dragleave":_l=null;break;case"mouseover":case"mouseout":Ll=null;break;case"pointerover":case"pointerout":mo.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":po.delete(a.pointerId)}}function go(t,a,l,i,d,m){return t===null||t.nativeEvent!==m?(t={blockedOn:a,domEventName:l,eventSystemFlags:i,nativeEvent:m,targetContainers:[d]},a!==null&&(a=tt(a),a!==null&&Mv(a)),t):(t.eventSystemFlags|=i,a=t.targetContainers,d!==null&&a.indexOf(d)===-1&&a.push(d),t)}function oS(t,a,l,i,d){switch(a){case"focusin":return Ml=go(Ml,t,a,l,i,d),!0;case"dragenter":return _l=go(_l,t,a,l,i,d),!0;case"mouseover":return Ll=go(Ll,t,a,l,i,d),!0;case"pointerover":var m=d.pointerId;return mo.set(m,go(mo.get(m)||null,t,a,l,i,d)),!0;case"gotpointercapture":return m=d.pointerId,po.set(m,go(po.get(m)||null,t,a,l,i,d)),!0}return!1}function Uv(t){var a=qt(t.target);if(a!==null){var l=c(a);if(l!==null){if(a=l.tag,a===13){if(a=f(l),a!==null){t.blockedOn=a,ie(t.priority,function(){_v(l)});return}}else if(a===31){if(a=h(l),a!==null){t.blockedOn=a,ie(t.priority,function(){_v(l)});return}}else if(a===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function mu(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var l=jh(t.nativeEvent);if(l===null){l=t.nativeEvent;var i=new l.constructor(l.type,l);An=i,l.target.dispatchEvent(i),An=null}else return a=tt(l),a!==null&&Mv(a),t.blockedOn=l,!1;a.shift()}return!0}function $v(t,a,l){mu(t)&&l.delete(a)}function cS(){kh=!1,Ml!==null&&mu(Ml)&&(Ml=null),_l!==null&&mu(_l)&&(_l=null),Ll!==null&&mu(Ll)&&(Ll=null),mo.forEach($v),po.forEach($v)}function pu(t,a){t.blockedOn===a&&(t.blockedOn=null,kh||(kh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,cS)))}var gu=null;function Bv(t){gu!==t&&(gu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gu===t&&(gu=null);for(var a=0;a<t.length;a+=3){var l=t[a],i=t[a+1],d=t[a+2];if(typeof i!="function"){if(Rh(i||l)===null)continue;break}var m=tt(l);m!==null&&(t.splice(a,3),a-=3,jf(m,{pending:!0,data:d,method:l.method,action:i},i,d))}}))}function li(t){function a(D){return pu(D,t)}Ml!==null&&pu(Ml,t),_l!==null&&pu(_l,t),Ll!==null&&pu(Ll,t),mo.forEach(a),po.forEach(a);for(var l=0;l<zl.length;l++){var i=zl[l];i.blockedOn===t&&(i.blockedOn=null)}for(;0<zl.length&&(l=zl[0],l.blockedOn===null);)Uv(l),l.blockedOn===null&&zl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var d=l[i],m=l[i+1],b=d[De]||null;if(typeof m=="function")b||Bv(l);else if(b){var N=null;if(m&&m.hasAttribute("formAction")){if(d=m,b=m[De]||null)N=b.formAction;else if(Rh(d)!==null)continue}else N=b.action;typeof N=="function"?l[i+1]=N:(l.splice(i,3),i-=3),Bv(l)}}}function Hv(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return d=b})},focusReset:"manual",scroll:"manual"})}function a(){d!==null&&(d(),d=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),d!==null&&(d(),d=null)}}}function Th(t){this._internalRoot=t}xu.prototype.render=Th.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(s(409));var l=a.current,i=Un();Dv(l,i,t,a,null,null)},xu.prototype.unmount=Th.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Dv(t.current,2,null,t,null,null),Zc(),a[Ne]=null}};function xu(t){this._internalRoot=t}xu.prototype.unstable_scheduleHydration=function(t){if(t){var a=W();t={blockedOn:null,target:t,priority:a};for(var l=0;l<zl.length&&a!==0&&a<zl[l].priority;l++);zl.splice(l,0,t),l===0&&Uv(t)}};var Iv=n.version;if(Iv!=="19.2.7")throw Error(s(527,Iv,"19.2.7"));F.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=g(a),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var uS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{Pe=vu.inject(uS),te=vu}catch{}}return vo.createRoot=function(t,a){if(!u(t))throw Error(s(299));var l=!1,i="",d=Xg,m=Qg,b=Kg;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(m=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError)),a=Cv(t,1,!1,null,null,l,i,null,d,m,b,Hv),t[Ne]=a.current,ch(t),new Th(a)},vo.hydrateRoot=function(t,a,l){if(!u(t))throw Error(s(299));var i=!1,d="",m=Xg,b=Qg,N=Kg,D=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError),l.formState!==void 0&&(D=l.formState)),a=Cv(t,1,!0,a,l??null,i,d,D,m,b,N,Hv),a.context=Av(null),l=a.current,i=Un(),i=_(i),d=wl(i),d.callback=null,Sl(l,d,i),l=i,a.current.lanes=l,pt(a,l),jr(a),t[Ne]=a.current,ch(t),new xu(a)},vo.version="19.2.7",vo}var Zv;function NS(){if(Zv)return Dh.exports;Zv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Dh.exports=ES(),Dh.exports}var jS=NS();/**
50
- * react-router v7.18.0
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var wb=e=>{throw TypeError(e)},Sb=(e,n,r)=>n.has(e)||wb("Cannot "+r),Jn=(e,n,r)=>(Sb(e,n,"read from private field"),r?r.call(e):n.get(e)),To=(e,n,r)=>n.has(e)?wb("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),Rr=(e,n,r,s)=>(Sb(e,n,"write to private field"),n.set(e,r),r),ld=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Nm=/^[\\/]{2}/;function Eb(e,n){return n+e.replace(/\\/g,"/")}var Wv="popstate";function Jv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function RS(e={}){function n(s,u){var g;let c=(g=u.state)==null?void 0:g.masked,{pathname:f,search:h,hash:p}=c||s.location;return Ho("",{pathname:f,search:h,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default",c?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function r(s,u){return typeof u=="string"?u:Ar(u)}return TS(n,r,null,e)}function rt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function fa(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function kS(){return Math.random().toString(36).substring(2,10)}function ey(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ho(e,n,r=null,s,u){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Dr(n):n,state:r,key:n&&n.key||s||kS(),mask:u}}function Ar({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Dr(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function TS(e,n,r,s={}){let{window:u=document.defaultView,v5Compat:c=!1}=s,f=u.history,h="POP",p=null,g=y();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function y(){return(f.state||{idx:null}).idx}function v(){h="POP";let R=y(),z=R==null?null:R-g;g=R,p&&p({action:h,location:j.location,delta:z})}function E(R,z){h="PUSH";let I=Jv(R)?R:Ho(j.location,R,z);g=y()+1;let $=ey(I,g),Q=j.createHref(I.mask||I);try{f.pushState($,"",Q)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;u.location.assign(Q)}c&&p&&p({action:h,location:j.location,delta:1})}function S(R,z){h="REPLACE";let I=Jv(R)?R:Ho(j.location,R,z);g=y();let $=ey(I,g),Q=j.createHref(I.mask||I);f.replaceState($,"",Q),c&&p&&p({action:h,location:j.location,delta:0})}function w(R){return Nb(u,R)}let j={get action(){return h},get location(){return e(u,f)},listen(R){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(Wv,v),p=R,()=>{u.removeEventListener(Wv,v),p=null}},createHref(R){return n(u,R)},createURL:w,encodeLocation(R){let z=w(R);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:E,replace:S,go(R){return f.go(R)}};return j}function Nb(e,n,r=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),rt(s,"No window.location.(origin|href) available to create URL");let u=typeof n=="string"?n:Ar(n);return u=u.replace(/ $/,"%20"),!r&&Nm.test(u)&&(u=s+u),new URL(u,s)}var Co,ty=class{constructor(e){if(To(this,Co,new Map),e)for(let[n,r]of e)this.set(n,r)}get(e){if(Jn(this,Co).has(e))return Jn(this,Co).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Jn(this,Co).set(e,n)}};Co=new WeakMap;var CS=new Set(["lazy","caseSensitive","path","id","index","children"]);function AS(e){return CS.has(e)}var DS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function OS(e){return DS.has(e)}function MS(e){return e.index===!0}function Io(e,n,r=[],s={},u=!1){return e.map((c,f)=>{let h=[...r,String(f)],p=typeof c.id=="string"?c.id:h.join("-");if(rt(c.index!==!0||!c.children,"Cannot specify children on an index route"),rt(u||!s[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),MS(c)){let g={...c,id:p};return s[p]=ay(g,n(g)),g}else{let g={...c,id:p,children:void 0};return s[p]=ay(g,n(g)),c.children&&(g.children=Io(c.children,n,h,s,u)),g}})}function ay(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function jb(e,n,r="/"){return hr(e,n,r,!1)}function hr(e,n,r,s,u){let c=typeof n=="string"?Dr(n):n,f=Hn(c.pathname||"/",r);if(f==null)return null;let h=u??zu(e),p=null,g=FS(f);for(let y=0;p==null&&y<h.length;++y)p=PS(h[y],g,s);return p}function Rb(e,n){let{route:r,pathname:s,params:u}=e;return{id:r.id,pathname:s,params:u,data:n[r.id],loaderData:n[r.id],handle:r.handle}}function zu(e){let n=kb(e);return _S(n),n}function kb(e,n=[],r=[],s="",u=!1){let c=(f,h,p=u,g)=>{let y={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&p)return;rt(y.relativePath.startsWith(s),`Absolute route path "${y.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(s.length)}let v=nr([s,y.relativePath]),E=r.concat(y);f.children&&f.children.length>0&&(rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),kb(f.children,n,E,v,p)),!(f.path==null&&!f.index)&&n.push({path:v,score:IS(v,f.index),routesMeta:E.map((S,w)=>{let[j,R]=Ab(S.relativePath,S.caseSensitive,w===E.length-1);return{...S,matcher:j,compiledParams:R}})})};return e.forEach((f,h)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))c(f,h);else for(let g of Tb(f.path))c(f,h,!0,g)}),n}function Tb(e){let n=e.split("/");if(n.length===0)return[];let[r,...s]=n,u=r.endsWith("?"),c=r.replace(/\?$/,"");if(s.length===0)return u?[c,""]:[c];let f=Tb(s.join("/")),h=[];return h.push(...f.map(p=>p===""?c:[c,p].join("/"))),u&&h.push(...f),h.map(p=>e.startsWith("/")&&p===""?"/":p)}function _S(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:qS(n.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var LS=/^:[\w-]+$/,zS=3,US=2,$S=1,BS=10,HS=-2,ny=e=>e==="*";function IS(e,n){let r=e.split("/"),s=r.length;return r.some(ny)&&(s+=HS),n&&(s+=US),r.filter(u=>!ny(u)).reduce((u,c)=>u+(LS.test(c)?zS:c===""?$S:BS),s)}function qS(e,n){return e.length===n.length&&e.slice(0,-1).every((s,u)=>s===n[u])?e[e.length-1]-n[n.length-1]:0}function PS(e,n,r=!1){let{routesMeta:s}=e,u={},c="/",f=[];for(let h=0;h<s.length;++h){let p=s[h],g=h===s.length-1,y=c==="/"?n:n.slice(c.length)||"/",v={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},E=p.matcher&&p.compiledParams?Cb(v,y,p.matcher,p.compiledParams):Fu(v,y),S=p.route;if(!E&&g&&r&&!s[s.length-1].route.index&&(E=Fu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!E)return null;Object.assign(u,E.params),f.push({params:u,pathname:nr([c,E.pathname]),pathnameBase:GS(nr([c,E.pathnameBase])),route:S}),E.pathnameBase!=="/"&&(c=nr([c,E.pathnameBase]))}return f}function Fu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=Ab(e.path,e.caseSensitive,e.end);return Cb(e,n,r,s)}function Cb(e,n,r,s){let u=n.match(r);if(!u)return null;let c=u[0],f=c.replace(/(.)\/+$/,"$1"),h=u.slice(1);return{params:s.reduce((g,{paramName:y,isOptional:v},E)=>{if(y==="*"){let w=h[E]||"";f=c.slice(0,c.length-w.length).replace(/(.)\/+$/,"$1")}const S=h[E];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:c,pathnameBase:f,pattern:e}}function Ab(e,n=!1,r=!0){fa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],u="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,p,g,y)=>{if(s.push({paramName:h,isOptional:p!=null}),p){let v=y.charAt(g+f.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),u+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?u+="\\/*$":e!==""&&e!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,n?void 0:"i"),s]}function FS(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return fa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Hn(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}function VS({basename:e,pathname:n}){return n==="/"?e:nr([e,n])}var jm=e=>ld.test(e);function YS(e,n="/"){let{pathname:r,search:s="",hash:u=""}=typeof e=="string"?Dr(e):e,c;return r?(r=km(r),r.startsWith("/")?c=ry(r.substring(1),"/"):c=ry(r,n)):c=n,{pathname:c,search:XS(s),hash:QS(u)}}function ry(e,n){let r=Vu(n).split("/");return e.split("/").forEach(u=>{u===".."?r.length>1&&r.pop():u!=="."&&r.push(u)}),r.length>1?r.join("/"):"/"}function Lh(e,n,r,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Db(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Rm(e){let n=Db(e);return n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase)}function sd(e,n,r,s=!1){let u;typeof e=="string"?u=Dr(e):(u={...e},rt(!u.pathname||!u.pathname.includes("?"),Lh("?","pathname","search",u)),rt(!u.pathname||!u.pathname.includes("#"),Lh("#","pathname","hash",u)),rt(!u.search||!u.search.includes("#"),Lh("#","search","hash",u)));let c=e===""||u.pathname==="",f=c?"/":u.pathname,h;if(f==null)h=r;else{let v=n.length-1;if(!s&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),v-=1;u.pathname=E.join("/")}h=v>=0?n[v]:"/"}let p=YS(u,h),g=f&&f!=="/"&&f.endsWith("/"),y=(c||f===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(g||y)&&(p.pathname+="/"),p}var km=e=>e.replace(/[\\/]{2,}/g,"/"),nr=e=>km(e.join("/")),Vu=e=>e.replace(/\/+$/,""),GS=e=>Vu(e).replace(/^\/*/,"/"),XS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,kn=(e,n=302)=>{let r=n;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let s=new Headers(r.headers);return s.set("Location",e),new Response(null,{...r,headers:s})},KS=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xo=class{constructor(e,n,r,s=!1){this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function yi(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Qo(e){let n=e.map(r=>r.route.path).filter(Boolean);return nr(n)||"/"}var Ob=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mb(e,n){let r=e;if(typeof r!="string"||!ld.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,u=!1;if(Ob)try{let c=new URL(window.location.href),f=Nm.test(r)?new URL(Eb(r,c.protocol)):new URL(r),h=Hn(f.pathname,n);f.origin===c.origin&&h!=null?r=h+f.search+f.hash:u=!0}catch{fa(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:u,to:r}}var Fl=Symbol("Uninstrumented");function ZS(e,n){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(u=>u({id:n.id,index:n.index,path:n.path,instrument(c){let f=Object.keys(r);for(let h of f)c[h]&&r[h].push(c[h])}}));let s={};if(typeof n.lazy=="function"&&r.lazy.length>0){let u=mi(r.lazy,n.lazy,()=>{});u&&(s.lazy=u)}if(typeof n.lazy=="object"){let u=n.lazy;["middleware","loader","action"].forEach(c=>{let f=u[c],h=r[`lazy.${c}`];if(typeof f=="function"&&h.length>0){let p=mi(h,f,()=>{});p&&(s.lazy=Object.assign(s.lazy||{},{[c]:p}))}})}return["loader","action"].forEach(u=>{let c=n[u];if(typeof c=="function"&&r[u].length>0){let f=c[Fl]??c,h=mi(r[u],f,(...p)=>ly(p[0]));h&&(u==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[Fl]=f,s[u]=h)}}),n.middleware&&n.middleware.length>0&&r.middleware.length>0&&(s.middleware=n.middleware.map(u=>{let c=u[Fl]??u,f=mi(r.middleware,c,(...h)=>ly(h[0]));return f?(f[Fl]=c,f):u})),s}function WS(e,n){let r={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(u){let c=Object.keys(u);for(let f of c)u[f]&&r[f].push(u[f])}})),r.navigate.length>0){let s=e.navigate[Fl]??e.navigate,u=mi(r.navigate,s,(...c)=>{let[f,h]=c;return{to:typeof f=="number"||typeof f=="string"?f:f?Ar(f):".",...sy(e,h??{})}});u&&(u[Fl]=s,e.navigate=u)}if(r.fetch.length>0){let s=e.fetch[Fl]??e.fetch,u=mi(r.fetch,s,(...c)=>{let[f,,h,p]=c;return{href:h??".",fetcherKey:f,...sy(e,p??{})}});u&&(u[Fl]=s,e.fetch=u)}return e}function mi(e,n,r){return e.length===0?null:async(...s)=>{let u=await _b(e,r(...s),()=>n(...s),e.length-1);if(u.type==="error")throw u.value;return u.value}}async function _b(e,n,r,s){let u=e[s],c;if(u){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=_b(e,n,r,s-1),c=await f,rt(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await u(h,n)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await h(),await f}else try{c={type:"success",value:await r()}}catch(f){c={type:"error",value:f}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ly(e){let{request:n,context:r,params:s,pattern:u}=e;return{request:JS(n),params:{...s},pattern:u,context:eE(r)}}function sy(e,n){return{currentUrl:Ar(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function JS(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function eE(e){if(aE(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var tE=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function aE(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===tE}var Lb=["POST","PUT","PATCH","DELETE"],nE=new Set(Lb),rE=["GET",...Lb],lE=new Set(rE),zb=new Set([301,302,303,307,308]),sE=new Set([307,308]),zh={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ub={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},iE=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),$b="remix-router-transitions",Bb=Symbol("ResetLoaderData"),ys,di,Bl,fi,oE=class{constructor(e){To(this,ys),To(this,di),To(this,Bl),To(this,fi),Rr(this,ys,e),Rr(this,di,zu(e))}get stableRoutes(){return Jn(this,ys)}get activeRoutes(){return Jn(this,Bl)??Jn(this,ys)}get branches(){return Jn(this,fi)??Jn(this,di)}get hasHMRRoutes(){return Jn(this,Bl)!=null}setRoutes(e){Rr(this,ys,e),Rr(this,di,zu(e))}setHmrRoutes(e){Rr(this,Bl,e),Rr(this,fi,zu(e))}commitHmrRoutes(){Jn(this,Bl)&&(Rr(this,ys,Jn(this,Bl)),Rr(this,di,Jn(this,fi)),Rr(this,Bl,void 0),Rr(this,fi,void 0))}};ys=new WeakMap;di=new WeakMap;Bl=new WeakMap;fi=new WeakMap;function cE(e){const n=e.window?e.window:typeof window<"u"?window:void 0,r=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";rt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],u=e.mapRouteProperties||iE,c=u;if(e.instrumentations){let A=e.instrumentations;c=_=>({...u(_),...ZS(A.map(q=>q.route).filter(Boolean),_)})}let f={},h=new oE(Io(e.routes,c,void 0,f)),p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=e.dataStrategy||mE,y={...e.future},v=null,E=new Set,S=null,w=null,j=null,R=null,z=e.hydrationData!=null,I=hr(h.activeRoutes,e.history.location,p,!1,h.branches),$=!1,Q=null,J,ne;if(I==null&&!e.patchRoutesOnNavigation){let A=er(404,{pathname:e.history.location.pathname}),{matches:_,route:q}=yu(h.activeRoutes);J=!0,ne=!J,I=_,Q={[q.id]:A}}else if(I&&!e.hydrationData&&It(I,h.activeRoutes,e.history.location.pathname).active&&(I=null),I)if(I.some(A=>A.route.lazy))J=!1,ne=!J;else if(!I.some(A=>Tm(A.route)))J=!0,ne=!J;else{let A=e.hydrationData?e.hydrationData.loaderData:null,_=e.hydrationData?e.hydrationData.errors:null,q=I;if(_){let W=I.findIndex(ie=>_[ie.route.id]!==void 0);q=q.slice(0,W+1)}ne=!1,J=!0,q.forEach(W=>{let ie=Hb(W.route,A,_);ne=ne||ie.renderFallback,J=J&&!ie.shouldLoad})}else{J=!1,ne=!J,I=[];let A=It(null,h.activeRoutes,e.history.location.pathname);A.active&&A.matches&&($=!0,I=A.matches)}let M,T={historyAction:e.history.action,location:e.history.location,matches:I,initialized:J,renderFallback:ne,navigation:zh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||Q,fetchers:new Map,blockers:new Map},fe="POP",pe=null,we=!1,re,je=!1,Te=new Map,ee=null,L=!1,F=!1,he=new Set,P=new Map,se=0,C=-1,B=new Map,K=new Set,ue=new Map,ge=new Map,xe=new Set,Re=new Map,He,$e=null;function Qe(){if(v=e.history.listen(({action:A,location:_,delta:q})=>{if(He){He(),He=void 0;return}fa(Re.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let W=yt({currentLocation:T.location,nextLocation:_,historyAction:A});if(W&&q!=null){let ie=new Promise(ke=>{He=ke});e.history.go(q*-1),vt(W,{state:"blocked",location:_,proceed(){vt(W,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),ie.then(()=>e.history.go(q))},reset(){let ke=new Map(T.blockers);ke.set(W,yo),mt({blockers:ke})}}),pe==null||pe.resolve(),pe=null;return}return Bt(A,_)}),r){ME(n,Te);let A=()=>_E(n,Te);n.addEventListener("pagehide",A),ee=()=>n.removeEventListener("pagehide",A)}return T.initialized||Bt("POP",T.location,{initialHydration:!0}),M}function ia(){v&&v(),ee&&ee(),E.clear(),re&&re.abort(),T.fetchers.forEach((A,_)=>Pe(T.fetchers,_)),T.blockers.forEach((A,_)=>_e(_))}function $t(A){if(E.add(A),S){let{newErrors:_}=S;S=null,A(T,{deletedFetchers:[],newErrors:_,viewTransitionOpts:void 0,flushSync:!1})}return()=>E.delete(A)}function mt(A,_={}){A.matches&&(A.matches=A.matches.map(ie=>{let ke=f[ie.route.id],ye=ie.route;return ye.element!==ke.element||ye.errorElement!==ke.errorElement||ye.hydrateFallbackElement!==ke.hydrateFallbackElement?{...ie,route:ke}:ie})),T={...T,...A};let q=[],W=[];T.fetchers.forEach((ie,ke)=>{ie.state==="idle"&&(xe.has(ke)?q.push(ke):W.push(ke))}),xe.forEach(ie=>{!T.fetchers.has(ie)&&!P.has(ie)&&q.push(ie)}),E.size===0&&(S={newErrors:A.errors??null}),[...E].forEach(ie=>ie(T,{deletedFetchers:q,newErrors:A.errors??null,viewTransitionOpts:_.viewTransitionOpts,flushSync:_.flushSync===!0})),q.forEach(ie=>Pe(T.fetchers,ie)),W.forEach(ie=>T.fetchers.delete(ie))}function ce(A,_,{flushSync:q}={}){var Ue,Ke;let W=T.actionData!=null&&T.navigation.formMethod!=null&&un(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ue=A.state)==null?void 0:Ue._isRedirect)!==!0,ie;_.actionData?Object.keys(_.actionData).length>0?ie=_.actionData:ie=null:W?ie=T.actionData:ie=null;let ke=_.loaderData?gy(T.loaderData,_.loaderData,_.matches||[],_.errors):T.loaderData,ye=T.blockers;ye.size>0&&(ye=new Map(ye),ye.forEach((Oe,Je)=>ye.set(Je,yo)));let De=L?!1:Wt(A,_.matches||T.matches),Ne=we===!0||T.navigation.formMethod!=null&&un(T.navigation.formMethod)&&((Ke=A.state)==null?void 0:Ke._isRedirect)!==!0;h.commitHmrRoutes(),L||fe==="POP"||(fe==="PUSH"?e.history.push(A,A.state):fe==="REPLACE"&&e.history.replace(A,A.state));let Le;if(fe==="POP"){let Oe=Te.get(T.location.pathname);Oe&&Oe.has(A.pathname)?Le={currentLocation:T.location,nextLocation:A}:Te.has(A.pathname)&&(Le={currentLocation:A,nextLocation:T.location})}else if(je){let Oe=Te.get(T.location.pathname);Oe?Oe.add(A.pathname):(Oe=new Set([A.pathname]),Te.set(T.location.pathname,Oe)),Le={currentLocation:T.location,nextLocation:A}}mt({..._,actionData:ie,loaderData:ke,historyAction:fe,location:A,initialized:!0,renderFallback:!1,navigation:zh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:Ne,blockers:ye},{viewTransitionOpts:Le,flushSync:q===!0}),fe="POP",we=!1,je=!1,L=!1,F=!1,pe==null||pe.resolve(),pe=null,$e==null||$e.resolve(),$e=null}async function qe(A,_){if(pe==null||pe.resolve(),pe=null,typeof A=="number"){pe||(pe=by());let Fe=pe.promise;return e.history.go(A),Fe}let q=sm(T.location,T.matches,p,A,_==null?void 0:_.fromRouteId,_==null?void 0:_.relative),{path:W,submission:ie,error:ke}=iy(!1,q,_),ye;_!=null&&_.mask&&(ye={pathname:"",search:"",hash:"",...typeof _.mask=="string"?Dr(_.mask):{...T.location.mask,..._.mask}});let De=T.location,Ne=Ho(De,W,_&&_.state,void 0,ye);Ne={...Ne,...e.history.encodeLocation(Ne)};let Le=_&&_.replace!=null?_.replace:void 0,Ue="PUSH";Le===!0?Ue="REPLACE":Le===!1||ie!=null&&un(ie.formMethod)&&ie.formAction===T.location.pathname+T.location.search&&(Ue="REPLACE");let Ke=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,Oe=(_&&_.flushSync)===!0,Je=yt({currentLocation:De,nextLocation:Ne,historyAction:Ue});if(Je){vt(Je,{state:"blocked",location:Ne,proceed(){vt(Je,{state:"proceeding",proceed:void 0,reset:void 0,location:Ne}),qe(A,_)},reset(){let Fe=new Map(T.blockers);Fe.set(Je,yo),mt({blockers:Fe})}});return}await Bt(Ue,Ne,{submission:ie,pendingError:ke,preventScrollReset:Ke,replace:_&&_.replace,enableViewTransition:_&&_.viewTransition,flushSync:Oe,callSiteDefaultShouldRevalidate:_&&_.defaultShouldRevalidate})}function lt(){$e||($e=by()),Ha(),mt({revalidation:"loading"});let A=$e.promise;return T.navigation.state==="submitting"?A:T.navigation.state==="idle"?(Bt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),A):(Bt(fe||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:je===!0}),A)}async function Bt(A,_,q){re&&re.abort(),re=null,fe=A,L=(q&&q.startUninterruptedRevalidation)===!0,na(T.location,T.matches),we=(q&&q.preventScrollReset)===!0,je=(q&&q.enableViewTransition)===!0;let W=h.activeRoutes,ie=q!=null&&q.initialHydration&&T.matches&&T.matches.length>0&&!$?T.matches:hr(W,_,p,!1,h.branches),ke=(q&&q.flushSync)===!0;if(ie&&T.initialized&&!F&&EE(T.location,_)&&!(q&&q.submission&&un(q.submission.formMethod))){ce(_,{matches:ie},{flushSync:ke});return}let ye=It(ie,W,_.pathname);if(ye.active&&ye.matches&&(ie=ye.matches),!ie){let{error:tt,notFoundMatches:ft,route:ut}=St(_.pathname);ce(_,{matches:ft,loaderData:{},errors:{[ut.id]:tt}},{flushSync:ke});return}let De=q&&q.overrideNavigation?{...q.overrideNavigation,matches:ie,historyAction:A}:void 0;re=new AbortController;let Ne=hi(e.history,_,re.signal,q&&q.submission),Le=e.getContext?await e.getContext():new ty,Ue;if(q&&q.pendingError)Ue=[Pl(ie).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&un(q.submission.formMethod)){let tt=await xa(Ne,_,q.submission,ie,A,Le,ye.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:ke});if(tt.shortCircuited)return;if(tt.pendingActionResult){let[ft,ut]=tt.pendingActionResult;if($n(ut)&&yi(ut.error)&&ut.error.status===404){re=null,ce(_,{matches:tt.matches,loaderData:{},errors:{[ft]:ut.error}});return}}ie=tt.matches||ie,Ue=tt.pendingActionResult,De=Uh(_,ie,A,q.submission),ke=!1,ye.active=!1,Ne=hi(e.history,Ne.url,Ne.signal)}let{shortCircuited:Ke,matches:Oe,loaderData:Je,errors:Fe,workingFetchers:qt}=await kt(Ne,_,ie,A,Le,ye.active,De,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,ke,Ue,q&&q.callSiteDefaultShouldRevalidate);Ke||(re=null,ce(_,{matches:Oe||ie,...xy(Ue),loaderData:Je,errors:Fe,...qt?{fetchers:qt}:{}}))}async function xa(A,_,q,W,ie,ke,ye,De,Ne={}){Ha();let Le=DE(_,W,ie,q);if(mt({navigation:Le},{flushSync:Ne.flushSync===!0}),ye){let Oe=await pt(W,_.pathname,A.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:Fe,route:qt}=yu(h.activeRoutes);return{matches:Fe,pendingActionResult:[qt.id,{type:"error",error:Oe.error}]}}let Je=Pl(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,pendingActionResult:[Je,{type:"error",error:Oe.error}]}}else if(Oe.matches)W=Oe.matches;else{let{notFoundMatches:Je,error:Fe,route:qt}=St(_.pathname);return{matches:Je,pendingActionResult:[qt.id,{type:"error",error:Fe}]}}}let Ue,Ke=Uu(W,_);if(!Ke.route.action&&!Ke.route.lazy)Ue={type:"error",error:er(405,{method:A.method,pathname:_.pathname,routeId:Ke.route.id})};else{let Oe=xi(c,f,A,_,W,Ke,De?[]:s,ke),Je=await hn(A,_,Oe,ke,null);if(Ue=Je[Ke.route.id],!Ue){for(let Fe of W)if(Je[Fe.route.id]){Ue=Je[Fe.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(bs(Ue)){let Oe;return Ne&&Ne.replace!=null?Oe=Ne.replace:Oe=hy(Ue.response.headers.get("Location"),new URL(A.url),p,e.history)===T.location.pathname+T.location.search,await fn(A,Ue,!0,{submission:q,replace:Oe}),{shortCircuited:!0}}if($n(Ue)){let Oe=Pl(W,Ke.route.id);return(Ne&&Ne.replace)!==!0&&(fe="PUSH"),{matches:W,pendingActionResult:[Oe.route.id,Ue,Ke.route.id]}}return{matches:W,pendingActionResult:[Ke.route.id,Ue]}}async function kt(A,_,q,W,ie,ke,ye,De,Ne,Le,Ue,Ke,Oe,Je){let Fe=ye||Uh(_,q,W,De),qt=De||Ne||yy(Fe),tt=!L&&!Ue;if(ke){if(tt){let Nt=Lt(Oe);mt({navigation:Fe,...Nt!==void 0?{actionData:Nt}:{}},{flushSync:Ke})}let Ze=await pt(q,_.pathname,A.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){if(Ze.partialMatches.length===0){let{matches:ea,route:an}=yu(h.activeRoutes);return{matches:ea,loaderData:{},errors:{[an.id]:Ze.error}}}let Nt=Pl(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,loaderData:{},errors:{[Nt]:Ze.error}}}else if(Ze.matches)q=Ze.matches;else{let{error:Nt,notFoundMatches:ea,route:an}=St(_.pathname);return{matches:ea,loaderData:{},errors:{[an.id]:Nt}}}}let ft=h.activeRoutes,{dsMatches:ut,revalidatingFetchers:ht}=oy(A,ie,c,f,e.history,T,q,qt,_,Ue?[]:s,Ue===!0,F,he,xe,ue,K,ft,p,e.patchRoutesOnNavigation!=null,h.branches,Oe,Je);if(C=++se,!e.dataStrategy&&!ut.some(Ze=>Ze.shouldLoad)&&!ut.some(Ze=>Ze.route.middleware&&Ze.route.middleware.length>0)&&ht.length===0){let Ze=new Map(T.fetchers),Nt=Fa(Ze);return ce(_,{matches:q,loaderData:{},errors:Oe&&$n(Oe[1])?{[Oe[0]]:Oe[1].error}:null,...xy(Oe),...Nt?{fetchers:Ze}:{}},{flushSync:Ke}),{shortCircuited:!0}}if(tt){let Ze={};if(!ke){Ze.navigation=Fe;let Nt=Lt(Oe);Nt!==void 0&&(Ze.actionData=Nt)}ht.length>0&&(Ze.fetchers=Kt(ht)),mt(Ze,{flushSync:Ke})}ht.forEach(Ze=>{Tt(Ze.key),Ze.controller&&P.set(Ze.key,Ze.controller)});let Jt=()=>ht.forEach(Ze=>Tt(Ze.key));re&&re.signal.addEventListener("abort",Jt);let{loaderResults:Va,fetcherResults:Ea}=await en(ut,ht,A,_,ie);if(A.signal.aborted)return{shortCircuited:!0};re&&re.signal.removeEventListener("abort",Jt),ht.forEach(Ze=>P.delete(Ze.key));let Oa=bu(Va);if(Oa)return await fn(A,Oa.result,!0,{replace:Le}),{shortCircuited:!0};if(Oa=bu(Ea),Oa)return K.add(Oa.key),await fn(A,Oa.result,!0,{replace:Le}),{shortCircuited:!0};let Ma=new Map(T.fetchers),{loaderData:Ya,errors:xn}=py(T,q,Va,Oe,ht,Ea,Ma);Ue&&T.errors&&(xn={...T.errors,...xn});let hl=Fa(Ma),tn=va(C,Ma),xr=hl||tn||ht.length>0;return{matches:q,loaderData:Ya,errors:xn,...xr?{workingFetchers:Ma}:{}}}function Lt(A){if(A&&!$n(A[1]))return{[A[0]]:A[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Kt(A){let _=new Map(T.fetchers);return A.forEach(q=>{let W=_.get(q.key),ie=bo(void 0,W?W.data:void 0);_.set(q.key,ie)}),_}async function $a(A,_,q,W){Tt(A);let ie=(W&&W.flushSync)===!0,ke=h.activeRoutes,ye=sm(T.location,T.matches,p,q,_,W==null?void 0:W.relative),De=hr(ke,ye,p,!1,h.branches),Ne=It(De,ke,ye);if(Ne.active&&Ne.matches&&(De=Ne.matches),!De){Ce(A,_,er(404,{pathname:ye}),{flushSync:ie});return}let{path:Le,submission:Ue,error:Ke}=iy(!0,ye,W);if(Ke){Ce(A,_,Ke,{flushSync:ie});return}let Oe=e.getContext?await e.getContext():new ty,Je=(W&&W.preventScrollReset)===!0;if(Ue&&un(Ue.formMethod)){await Ba(A,_,Le,De,Oe,Ne.active,ie,Je,Ue,W&&W.defaultShouldRevalidate);return}ue.set(A,{routeId:_,path:Le}),await aa(A,_,Le,De,Oe,Ne.active,ie,Je,Ue)}async function Ba(A,_,q,W,ie,ke,ye,De,Ne,Le){Ha(),ue.delete(A);let Ue=T.fetchers.get(A);me(A,OE(Ne,Ue),{flushSync:ye});let Ke=new AbortController,Oe=hi(e.history,q,Ke.signal,Ne);if(ke){let jt=await pt(W,new URL(Oe.url).pathname,Oe.signal,A);if(jt.type==="aborted")return;if(jt.type==="error"){Ce(A,_,jt.error,{flushSync:ye});return}else if(jt.matches)W=jt.matches;else{Ce(A,_,er(404,{pathname:q}),{flushSync:ye});return}}let Je=Uu(W,q);if(!Je.route.action&&!Je.route.lazy){let jt=er(405,{method:Ne.formMethod,pathname:q,routeId:_});Ce(A,_,jt,{flushSync:ye});return}P.set(A,Ke);let Fe=se,qt=xi(c,f,Oe,q,W,Je,s,ie),tt=await hn(Oe,q,qt,ie,A),ft=tt[Je.route.id];if(!ft){for(let jt of qt)if(tt[jt.route.id]){ft=tt[jt.route.id];break}}if(Oe.signal.aborted){P.get(A)===Ke&&P.delete(A);return}if(xe.has(A)){if(bs(ft)||$n(ft)){me(A,Tr(void 0));return}}else{if(bs(ft))if(P.delete(A),C>Fe){me(A,Tr(void 0));return}else return K.add(A),me(A,bo(Ne)),fn(Oe,ft,!1,{fetcherSubmission:Ne,preventScrollReset:De});if($n(ft)){Ce(A,_,ft.error);return}}let ut=T.navigation.location||T.location,ht=hi(e.history,ut,Ke.signal),Jt=h.activeRoutes,Va=T.navigation.state!=="idle"?hr(Jt,T.navigation.location,p,!1,h.branches):T.matches;rt(Va,"Didn't find any matches after fetcher action");let Ea=++se;B.set(A,Ea);let{dsMatches:Oa,revalidatingFetchers:Ma}=oy(ht,ie,c,f,e.history,T,Va,Ne,ut,s,!1,F,he,xe,ue,K,Jt,p,e.patchRoutesOnNavigation!=null,h.branches,[Je.route.id,ft],Le),Ya=bo(Ne,ft.data),xn=new Map(T.fetchers);xn.set(A,Ya),Ma.filter(jt=>jt.key!==A).forEach(jt=>{let Cn=jt.key,Ga=xn.get(Cn),Zl=bo(void 0,Ga?Ga.data:void 0);xn.set(Cn,Zl),Tt(Cn),jt.controller&&P.set(Cn,jt.controller)}),mt({fetchers:xn});let hl=()=>Ma.forEach(jt=>Tt(jt.key));Ke.signal.addEventListener("abort",hl);let{loaderResults:tn,fetcherResults:xr}=await en(Oa,Ma,ht,ut,ie);if(Ke.signal.aborted)return;Ke.signal.removeEventListener("abort",hl),B.delete(A),P.delete(A),Ma.forEach(jt=>P.delete(jt.key));let Ze=T.fetchers.has(A),Nt=jt=>{if(!Ze)return jt;let Cn=new Map(jt.fetchers);return Cn.set(A,Tr(ft.data)),{...jt,fetchers:Cn}},ea=bu(tn);if(ea)return T=Nt(T),fn(ht,ea.result,!1,{preventScrollReset:De});if(ea=bu(xr),ea)return K.add(ea.key),T=Nt(T),fn(ht,ea.result,!1,{preventScrollReset:De});let an=new Map(T.fetchers);Ze&&an.set(A,Tr(ft.data));let{loaderData:_a,errors:_r}=py(T,Va,tn,void 0,Ma,xr,an);va(Ea,an),T.navigation.state==="loading"&&Ea>C?(rt(fe,"Expected pending action"),re&&re.abort(),ce(T.navigation.location,{matches:Va,loaderData:_a,errors:_r,fetchers:an})):(mt({errors:_r,loaderData:gy(T.loaderData,_a,Va,_r),fetchers:an}),F=!1)}async function aa(A,_,q,W,ie,ke,ye,De,Ne){let Le=T.fetchers.get(A);me(A,bo(Ne,Le?Le.data:void 0),{flushSync:ye});let Ue=new AbortController,Ke=hi(e.history,q,Ue.signal);if(ke){let ft=await pt(W,new URL(Ke.url).pathname,Ke.signal,A);if(ft.type==="aborted")return;if(ft.type==="error"){Ce(A,_,ft.error,{flushSync:ye});return}else if(ft.matches)W=ft.matches;else{Ce(A,_,er(404,{pathname:q}),{flushSync:ye});return}}let Oe=Uu(W,q);P.set(A,Ue);let Je=se,Fe=xi(c,f,Ke,q,W,Oe,s,ie),qt=await hn(Ke,q,Fe,ie,A),tt=qt[Oe.route.id];if(!tt){for(let ft of W)if(qt[ft.route.id]){tt=qt[ft.route.id];break}}if(P.get(A)===Ue&&P.delete(A),!Ke.signal.aborted){if(xe.has(A)){me(A,Tr(void 0));return}if(bs(tt))if(C>Je){me(A,Tr(void 0));return}else{K.add(A),await fn(Ke,tt,!1,{preventScrollReset:De});return}if($n(tt)){Ce(A,_,tt.error);return}me(A,Tr(tt.data))}}async function fn(A,_,q,{submission:W,fetcherSubmission:ie,preventScrollReset:ke,replace:ye}={}){q||(pe==null||pe.resolve(),pe=null),_.response.headers.has("X-Remix-Revalidate")&&(F=!0);let De=_.response.headers.get("Location");rt(De,"Expected a Location header on the redirect Response"),De=hy(De,new URL(A.url),p,e.history);let Ne=Ho(T.location,De,{_isRedirect:!0});if(r){let Fe=!1;if(_.response.headers.has("X-Remix-Reload-Document"))Fe=!0;else if(jm(De)){const qt=Nb(n,De,!0);Fe=qt.origin!==n.location.origin||Hn(qt.pathname,p)==null}if(Fe){ye?n.location.replace(De):n.location.assign(De);return}}re=null;let Le=ye===!0||_.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Ke,formEncType:Oe}=T.navigation;!W&&!ie&&Ue&&Ke&&Oe&&(W=yy(T.navigation));let Je=W||ie;if(sE.has(_.response.status)&&Je&&un(Je.formMethod))await Bt(Le,Ne,{submission:{...Je,formAction:De},preventScrollReset:ke||we,enableViewTransition:q?je:void 0});else{let Fe=Uh(Ne,[],Le,W);await Bt(Le,Ne,{overrideNavigation:Fe,fetcherSubmission:ie,preventScrollReset:ke||we,enableViewTransition:q?je:void 0})}}async function hn(A,_,q,W,ie){var De;let ke,ye={};try{ke=await gE(g,A,_,q,ie,W,!1)}catch(Ne){return q.filter(Le=>Le.shouldLoad).forEach(Le=>{ye[Le.route.id]={type:"error",error:Ne}}),ye}if(A.signal.aborted)return ye;if(!un(A.method))for(let Ne of q){if(((De=ke[Ne.route.id])==null?void 0:De.type)==="error")break;!ke.hasOwnProperty(Ne.route.id)&&!T.loaderData.hasOwnProperty(Ne.route.id)&&(!T.errors||!T.errors.hasOwnProperty(Ne.route.id))&&Ne.shouldCallHandler()&&(ke[Ne.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ne.route.id}`)})}for(let[Ne,Le]of Object.entries(ke))if(kE(Le)){let Ue=Le.result;ye[Ne]={type:"redirect",response:bE(Ue,A,Ne,q,p)}}else ye[Ne]=await yE(Le);return ye}async function en(A,_,q,W,ie){let ke=hn(q,W,A,ie,null),ye=Promise.all(_.map(async Le=>{if(Le.matches&&Le.match&&Le.request&&Le.controller){let Ke=(await hn(Le.request,Le.path,Le.matches,ie,Le.key))[Le.match.route.id];return{[Le.key]:Ke}}else return Promise.resolve({[Le.key]:{type:"error",error:er(404,{pathname:Le.path})}})})),De=await ke,Ne=(await ye).reduce((Le,Ue)=>Object.assign(Le,Ue),{});return{loaderResults:De,fetcherResults:Ne}}function Ha(){F=!0,ue.forEach((A,_)=>{P.has(_)&&he.add(_),Tt(_)})}function me(A,_,q={}){let W=new Map(T.fetchers);W.set(A,_),mt({fetchers:W},{flushSync:(q&&q.flushSync)===!0})}function Ce(A,_,q,W={}){let ie=Pl(T.matches,_),ke=new Map(T.fetchers);Pe(ke,A),mt({errors:{[ie.route.id]:q},fetchers:ke},{flushSync:(W&&W.flushSync)===!0})}function Ae(A){return ge.set(A,(ge.get(A)||0)+1),xe.has(A)&&xe.delete(A),T.fetchers.get(A)||Ub}function Xe(A,_){Tt(A,_==null?void 0:_.reason),me(A,Tr(null))}function Pe(A,_){let q=T.fetchers.get(_);P.has(_)&&!(q&&q.state==="loading"&&B.has(_))&&Tt(_),ue.delete(_),B.delete(_),K.delete(_),xe.delete(_),he.delete(_),A.delete(_)}function te(A){let _=(ge.get(A)||0)-1;_<=0?(ge.delete(A),xe.add(A)):ge.set(A,_),mt({fetchers:new Map(T.fetchers)})}function Tt(A,_){let q=P.get(A);q&&(q.abort(_),P.delete(A))}function Zt(A,_){for(let q of A){let W=_.get(q);rt(W,`Expected fetcher: ${q}`);let ie=Tr(W.data);_.set(q,ie)}}function Fa(A){let _=[],q=!1;for(let W of K){let ie=A.get(W);rt(ie,`Expected fetcher: ${W}`),ie.state==="loading"&&(K.delete(W),_.push(W),q=!0)}return Zt(_,A),q}function va(A,_){let q=[];for(let[W,ie]of B)if(ie<A){let ke=_.get(W);rt(ke,`Expected fetcher: ${W}`),ke.state==="loading"&&(Tt(W),B.delete(W),q.push(W))}return Zt(q,_),q.length>0}function qn(A,_){let q=T.blockers.get(A)||yo;return Re.get(A)!==_&&Re.set(A,_),q}function _e(A){T.blockers.delete(A),Re.delete(A)}function vt(A,_){let q=T.blockers.get(A)||yo;rt(q.state==="unblocked"&&_.state==="blocked"||q.state==="blocked"&&_.state==="blocked"||q.state==="blocked"&&_.state==="proceeding"||q.state==="blocked"&&_.state==="unblocked"||q.state==="proceeding"&&_.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${_.state}`);let W=new Map(T.blockers);W.set(A,_),mt({blockers:W})}function yt({currentLocation:A,nextLocation:_,historyAction:q}){if(Re.size===0)return;Re.size>1&&fa(!1,"A router only supports one blocker at a time");let W=Array.from(Re.entries()),[ie,ke]=W[W.length-1],ye=T.blockers.get(ie);if(!(ye&&ye.state==="proceeding")&&ke({currentLocation:A,nextLocation:_,historyAction:q}))return ie}function St(A){let _=er(404,{pathname:A}),q=h.activeRoutes,{matches:W,route:ie}=yu(q);return{notFoundMatches:W,route:ie,error:_}}function Ht(A,_,q){if(w=A,R=_,j=q||null,!z&&T.navigation===zh){z=!0;let W=Wt(T.location,T.matches);W!=null&&mt({restoreScrollPosition:W})}return()=>{w=null,R=null,j=null}}function Ct(A,_){return j&&j(A,_.map(W=>Rb(W,T.loaderData)))||A.key}function na(A,_){if(w&&R){let q=Ct(A,_);w[q]=R()}}function Wt(A,_){if(w){let q=Ct(A,_),W=w[q];if(typeof W=="number")return W}return null}function It(A,_,q){if(e.patchRoutesOnNavigation){let W=h.branches;if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:hr(_,q,p,!0,W)}}else return{active:!0,matches:hr(_,q,p,!0,W)||[]}}return{active:!1,matches:null}}async function pt(A,_,q,W){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ie=A;for(;;){let ke=f;try{await e.patchRoutesOnNavigation({signal:q,path:_,matches:ie,fetcherKey:W,patch:(Le,Ue)=>{q.aborted||cy(Le,Ue,h,ke,c,!1)}})}catch(Le){return{type:"error",error:Le,partialMatches:ie}}if(q.aborted)return{type:"aborted"};let ye=h.branches,De=hr(h.activeRoutes,_,p,!1,ye),Ne=null;if(De){if(Object.keys(De[0].params).length===0)return{type:"success",matches:De};if(Ne=hr(h.activeRoutes,_,p,!0,ye),!(Ne&&ie.length<Ne.length&&et(ie,Ne.slice(0,ie.length))))return{type:"success",matches:De}}if(Ne||(Ne=hr(h.activeRoutes,_,p,!0,ye)),!Ne||et(ie,Ne))return{type:"success",matches:null};ie=Ne}}function et(A,_){return A.length===_.length&&A.every((q,W)=>q.route.id===_[W].route.id)}function Sa(A){f={},h.setHmrRoutes(Io(A,c,void 0,f))}function Da(A,_,q=!1){cy(A,_,h,f,c,q),h.hasHMRRoutes||mt({})}return M={get basename(){return p},get future(){return y},get state(){return T},get routes(){return h.stableRoutes},get branches(){return h.branches},get manifest(){return f},get window(){return n},initialize:Qe,subscribe:$t,enableScrollRestoration:Ht,navigate:qe,fetch:$a,revalidate:lt,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Ae,resetFetcher:Xe,deleteFetcher:te,dispose:ia,getBlocker:qn,deleteBlocker:_e,patchRoutes:Da,_internalFetchControllers:P,_internalSetRoutes:Sa,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){mt(A)}},e.instrumentations&&(M=WS(M,e.instrumentations.map(A=>A.router).filter(Boolean))),M}function uE(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function sm(e,n,r,s,u,c){let f,h;if(u){f=[];for(let g of n)if(f.push(g),g.route.id===u){h=g;break}}else f=n,h=n[n.length-1];let p=sd(s||".",Rm(f),Hn(e.pathname,r)||e.pathname,c==="path");if(s==null&&(p.search=e.search,p.hash=e.hash),(s==null||s===""||s===".")&&h){let g=Am(p.search);if(h.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&g){let y=new URLSearchParams(p.search),v=y.getAll("index");y.delete("index"),v.filter(S=>S).forEach(S=>y.append("index",S));let E=y.toString();p.search=E?`?${E}`:""}}return r!=="/"&&(p.pathname=VS({basename:r,pathname:p.pathname})),Ar(p)}function iy(e,n,r){if(!r||!uE(r))return{path:n};if(r.formMethod&&!AE(r.formMethod))return{path:n,error:er(405,{method:r.formMethod})};let s=()=>({path:n,error:er(400,{type:"invalid-body"})}),c=(r.formMethod||"get").toUpperCase(),f=Gb(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!un(c))return s();let v=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((E,[S,w])=>`${E}${S}=${w}
59
- `,""):String(r.body);return{path:n,submission:{formMethod:c,formAction:f,formEncType:r.formEncType,formData:void 0,json:void 0,text:v}}}else if(r.formEncType==="application/json"){if(!un(c))return s();try{let v=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:c,formAction:f,formEncType:r.formEncType,formData:void 0,json:v,text:void 0}}}catch{return s()}}}rt(typeof FormData=="function","FormData is not available in this environment");let h,p;if(r.formData)h=cm(r.formData),p=r.formData;else if(r.body instanceof FormData)h=cm(r.body),p=r.body;else if(r.body instanceof URLSearchParams)h=r.body,p=my(h);else if(r.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(r.body),p=my(h)}catch{return s()}let g={formMethod:c,formAction:f,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(un(g.formMethod))return{path:n,submission:g};let y=Dr(n);return e&&y.search&&Am(y.search)&&h.append("index",""),y.search=`?${h}`,{path:Ar(y),submission:g}}function oy(e,n,r,s,u,c,f,h,p,g,y,v,E,S,w,j,R,z,I,$,Q,J){var L;let ne=Q?$n(Q[1])?Q[1].error:Q[1].data:void 0,M=u.createURL(c.location),T=u.createURL(p),fe;if(y&&c.errors){let F=Object.keys(c.errors)[0];fe=f.findIndex(he=>he.route.id===F)}else if(Q&&$n(Q[1])){let F=Q[0];fe=f.findIndex(he=>he.route.id===F)-1}let pe=Q?Q[1].statusCode:void 0,we=pe&&pe>=400,re={currentUrl:M,currentParams:((L=c.matches[0])==null?void 0:L.params)||{},nextUrl:T,nextParams:f[0].params,...h,actionResult:ne,actionStatus:pe},je=Qo(f),Te=f.map((F,he)=>{let{route:P}=F,se=null;if(fe!=null&&he>fe)se=!1;else if(P.lazy)se=!0;else if(!Tm(P))se=!1;else if(y){let{shouldLoad:ue}=Hb(P,c.loaderData,c.errors);se=ue}else dE(c.loaderData,c.matches[he],F)&&(se=!0);if(se!==null)return im(r,s,e,p,je,F,g,n,se);let C=!1;typeof J=="boolean"?C=J:we?C=!1:(v||M.pathname+M.search===T.pathname+T.search||M.search!==T.search||fE(c.matches[he],F))&&(C=!0);let B={...re,defaultShouldRevalidate:C},K=Oo(F,B);return im(r,s,e,p,je,F,g,n,K,B,J)}),ee=[];return w.forEach((F,he)=>{if(y||!f.some(xe=>xe.route.id===F.routeId)||S.has(he))return;let P=c.fetchers.get(he),se=P&&P.state!=="idle"&&P.data===void 0,C=hr(R,F.path,z??"/",!1,$);if(!C){if(I&&se)return;ee.push({key:he,routeId:F.routeId,path:F.path,matches:null,match:null,request:null,controller:null});return}if(j.has(he))return;let B=Uu(C,F.path),K=new AbortController,ue=hi(u,F.path,K.signal),ge=null;if(E.has(he))E.delete(he),ge=xi(r,s,ue,F.path,C,B,g,n);else if(se)v&&(ge=xi(r,s,ue,F.path,C,B,g,n));else{let xe;typeof J=="boolean"?xe=J:we?xe=!1:xe=v;let Re={...re,defaultShouldRevalidate:xe};Oo(B,Re)&&(ge=xi(r,s,ue,F.path,C,B,g,n,Re))}ge&&ee.push({key:he,routeId:F.routeId,path:F.path,matches:ge,match:B,request:ue,controller:K})}),{dsMatches:Te,revalidatingFetchers:ee}}function Tm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Hb(e,n,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Tm(e))return{shouldLoad:!1,renderFallback:!1};let s=n!=null&&e.id in n,u=r!=null&&r[e.id]!==void 0;if(!s&&u)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let c=!s&&!u;return{shouldLoad:c,renderFallback:c}}function dE(e,n,r){let s=!n||r.route.id!==n.route.id,u=!e.hasOwnProperty(r.route.id);return s||u}function fE(e,n){let r=e.route.path;return e.pathname!==n.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==n.params["*"]}function Oo(e,n){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(n);if(typeof r=="boolean")return r}return n.defaultShouldRevalidate}function cy(e,n,r,s,u,c){let f;if(e){let g=s[e];rt(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),f=g.children}else f=r.activeRoutes;let h=[],p=[];if(n.forEach(g=>{let y=f.find(v=>Ib(g,v));y?p.push({existingRoute:y,newRoute:g}):h.push(g)}),h.length>0){let g=Io(h,u,[e||"_","patch",String((f==null?void 0:f.length)||"0")],s);f.push(...g)}if(c&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:y,newRoute:v}=p[g],E=y,[S]=Io([v],u,[],{},!0);Object.assign(E,{element:S.element?S.element:E.element,errorElement:S.errorElement?S.errorElement:E.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:E.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function Ib(e,n){var r;return"id"in e&&"id"in n&&e.id===n.id?!0:e.index===n.index&&e.path===n.path&&e.caseSensitive===n.caseSensitive?(!e.children||e.children.length===0)&&(!n.children||n.children.length===0)?!0:((r=e.children)==null?void 0:r.every((s,u)=>{var c;return(c=n.children)==null?void 0:c.some(f=>Ib(s,f))}))??!1:!1}var uy=new WeakMap,qb=({key:e,route:n,manifest:r,mapRouteProperties:s})=>{let u=r[n.id];if(rt(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let c=u.lazy[e];if(!c)return;let f=uy.get(u);f||(f={},uy.set(u,f));let h=f[e];if(h)return h;let p=(async()=>{let g=AS(e),v=u[e]!==void 0&&e!=="hasErrorBoundary";if(g)fa(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),f[e]=Promise.resolve();else if(v)fa(!1,`Route "${u.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let E=await c();E!=null&&(Object.assign(u,{[e]:E}),Object.assign(u,s(u)))}typeof u.lazy=="object"&&(u.lazy[e]=void 0,Object.values(u.lazy).every(E=>E===void 0)&&(u.lazy=void 0))})();return f[e]=p,p},dy=new WeakMap;function hE(e,n,r,s,u){let c=r[e.id];if(rt(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=dy.get(c);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let v=(async()=>{rt(typeof e.lazy=="function","No lazy route function found");let E=await e.lazy(),S={};for(let w in E){let j=E[w];if(j===void 0)continue;let R=OS(w),I=c[w]!==void 0&&w!=="hasErrorBoundary";R?fa(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?fa(!I,`Route "${c.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):S[w]=j}Object.assign(c,S),Object.assign(c,{...s(c),lazy:void 0})})();return dy.set(c,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let f=Object.keys(e.lazy),h=[],p;for(let y of f){if(u&&u.includes(y))continue;let v=qb({key:y,route:e,manifest:r,mapRouteProperties:s});v&&(h.push(v),y===n&&(p=v))}let g=h.length>0?Promise.all(h).then(()=>{}):void 0;return g==null||g.catch(()=>{}),p==null||p.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:p}}async function fy(e){let n=e.matches.filter(u=>u.shouldLoad),r={};return(await Promise.all(n.map(u=>u.resolve()))).forEach((u,c)=>{r[n[c].route.id]=u}),r}async function mE(e){return e.matches.some(n=>n.route.middleware)?Pb(e,()=>fy(e)):fy(e)}function Pb(e,n){return pE(e,n,s=>{if(CE(s))throw s;return s},jE,r);function r(s,u,c){if(c)return Promise.resolve(Object.assign(c.value,{[u]:{type:"error",result:s}}));{let{matches:f}=e,h=Math.min(Math.max(f.findIndex(g=>g.route.id===u),0),Math.max(f.findIndex(g=>g.shouldCallHandler()),0)),p=Pl(f,f[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function pE(e,n,r,s,u){let{matches:c,...f}=e,h=c.flatMap(g=>g.route.middleware?g.route.middleware.map(y=>[g.route.id,y]):[]);return await Fb(f,h,n,r,s,u)}async function Fb(e,n,r,s,u,c,f=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=n[f];if(!p)return await r();let[g,y]=p,v,E=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Fb(e,n,r,s,u,c,f+1)},v.value}catch(S){return v={value:await c(S,g,v)},v.value}};try{let S=await y(e,E),w=S!=null?s(S):void 0;return u(w)?w:v?w??v.value:(v={value:await E()},v.value)}catch(S){return await c(S,g,v)}}function Vb(e,n,r,s,u){let c=qb({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),f=hE(s.route,un(r.method)?"action":"loader",n,e,u);return{middleware:c,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function im(e,n,r,s,u,c,f,h,p,g=null,y){let v=!1,E=Vb(e,n,r,c,f);return{...c,_lazyPromises:E,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return v=!0,g?typeof y=="boolean"?Oo(c,{...g,defaultShouldRevalidate:y}):typeof S=="boolean"?Oo(c,{...g,defaultShouldRevalidate:S}):Oo(c,g):p},resolve(S){let{lazy:w,loader:j,middleware:R}=c.route,z=v||p||S&&!un(r.method)&&(w||j),I=R&&R.length>0&&!j&&!w;return z&&(un(r.method)||!I)?xE({request:r,path:s,pattern:u,match:c,lazyHandlerPromise:E==null?void 0:E.handler,lazyRoutePromise:E==null?void 0:E.route,handlerOverride:S,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function xi(e,n,r,s,u,c,f,h,p=null){return u.map(g=>g.route.id!==c.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Vb(e,n,r,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:im(e,n,r,s,Qo(u),g,f,h,!0,p))}async function gE(e,n,r,s,u,c,f){s.some(y=>{var v;return(v=y._lazyPromises)==null?void 0:v.middleware})&&await Promise.all(s.map(y=>{var v;return(v=y._lazyPromises)==null?void 0:v.middleware}));let h={request:n,url:Yb(n,r),pattern:Qo(s),params:s[0].params,context:c,matches:s},g=await e({...h,fetcherKey:u,runClientMiddleware:y=>{let v=h;return Pb(v,()=>y({...v,fetcherKey:u,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(y=>{var v,E;return[(v=y._lazyPromises)==null?void 0:v.handler,(E=y._lazyPromises)==null?void 0:E.route]}))}catch{}return g}async function xE({request:e,path:n,pattern:r,match:s,lazyHandlerPromise:u,lazyRoutePromise:c,handlerOverride:f,scopedContext:h}){let p,g,y=un(e.method),v=y?"action":"loader",E=S=>{let w,j=new Promise((I,$)=>w=$);g=()=>w(),e.signal.addEventListener("abort",g);let R=I=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):S({request:e,url:Yb(e,n),pattern:r,params:s.params,context:h},...I!==void 0?[I]:[]),z=(async()=>{try{return{type:"data",result:await(f?f($=>R($)):R())}}catch(I){return{type:"error",result:I}}})();return Promise.race([z,j])};try{let S=y?s.route.action:s.route.loader;if(u||c)if(S){let w,[j]=await Promise.all([E(S).catch(R=>{w=R}),u,c]);if(w!==void 0)throw w;p=j}else{await u;let w=y?s.route.action:s.route.loader;if(w)[p]=await Promise.all([E(w),c]);else if(v==="action"){let j=new URL(e.url),R=j.pathname+j.search;throw er(405,{method:e.method,pathname:R,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(S)p=await E(S);else{let w=new URL(e.url),j=w.pathname+w.search;throw er(404,{pathname:j})}}catch(S){return{type:"error",result:S}}finally{g&&e.signal.removeEventListener("abort",g)}return p}async function vE(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function yE(e){var s,u,c,f,h;let{result:n,type:r}=e;if(Cm(n)){let p;try{p=await vE(n)}catch(g){return{type:"error",error:g}}return r==="error"?{type:"error",error:new Xo(n.status,n.statusText,p),statusCode:n.status,headers:n.headers}:{type:"data",data:p,statusCode:n.status,headers:n.headers}}return r==="error"?vy(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:(s=n.init)==null?void 0:s.status,headers:(u=n.init)!=null&&u.headers?new Headers(n.init.headers):void 0}:{type:"error",error:NE(n),statusCode:yi(n)?n.status:void 0,headers:(c=n.init)!=null&&c.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:yi(n)?n.status:void 0}:vy(n)?{type:"data",data:n.data,statusCode:(f=n.init)==null?void 0:f.status,headers:(h=n.init)!=null&&h.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function bE(e,n,r,s,u){let c=e.headers.get("Location");if(rt(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!jm(c)){let f=s.slice(0,s.findIndex(h=>h.route.id===r)+1);c=sm(new URL(n.url),f,u,c),e.headers.set("Location",c)}return e}var wE=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function om(e){try{return wE.includes(new URL(e).protocol)}catch{return!1}}function hy(e,n,r,s){if(jm(e)){let u=e,c=Nm.test(u)?new URL(Eb(u,n.protocol)):new URL(u);if(om(c.toString()))throw new Error("Invalid redirect location");let f=Hn(c.pathname,r)!=null;if(c.origin===n.origin&&f)return km(c.pathname)+c.search+c.hash}try{let u=s.createURL(e);if(om(u.toString()))throw new Error("Invalid redirect location")}catch{}return e}function hi(e,n,r,s){let u=e.createURL(Gb(n)).toString(),c={signal:r};if(s&&un(s.formMethod)){let{formMethod:f,formEncType:h}=s;c.method=f.toUpperCase(),h==="application/json"?(c.headers=new Headers({"Content-Type":h}),c.body=JSON.stringify(s.json)):h==="text/plain"?c.body=s.text:h==="application/x-www-form-urlencoded"&&s.formData?c.body=cm(s.formData):c.body=s.formData}return new Request(u,c)}function Yb(e,n){let r=new URL(e.url),s=typeof n=="string"?Dr(n):n;if(r.pathname=s.pathname||"/",s.search){let u=new URLSearchParams(s.search),c=u.getAll("index");u.delete("index");for(let f of c.filter(Boolean))u.append("index",f);r.search=u.size?`?${u.toString()}`:""}else r.search="";return r.hash=s.hash||"",r}function cm(e){let n=new URLSearchParams;for(let[r,s]of e.entries())n.append(r,typeof s=="string"?s:s.name);return n}function my(e){let n=new FormData;for(let[r,s]of e.entries())n.append(r,s);return n}function SE(e,n,r,s=!1,u=!1){let c={},f=null,h,p=!1,g={},y=r&&$n(r[1])?r[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in n))return;let E=v.route.id,S=n[E];if(rt(!bs(S),"Cannot handle redirect results in processLoaderData"),$n(S)){let w=S.error;if(y!==void 0&&(w=y,y=void 0),f=f||{},u)f[E]=w;else{let j=Pl(e,E);f[j.route.id]==null&&(f[j.route.id]=w)}s||(c[E]=Bb),p||(p=!0,h=yi(S.error)?S.error.status:500),S.headers&&(g[E]=S.headers)}else c[E]=S.data,S.statusCode&&S.statusCode!==200&&!p&&(h=S.statusCode),S.headers&&(g[E]=S.headers)}),y!==void 0&&r&&(f={[r[0]]:y},r[2]&&(c[r[2]]=void 0)),{loaderData:c,errors:f,statusCode:h||200,loaderHeaders:g}}function py(e,n,r,s,u,c,f){let{loaderData:h,errors:p}=SE(n,r,s);return u.filter(g=>!g.matches||g.matches.some(y=>y.shouldLoad)).forEach(g=>{let{key:y,match:v,controller:E}=g;if(E&&E.signal.aborted)return;let S=c[y];if(rt(S,"Did not find corresponding fetcher result"),$n(S)){let w=Pl(e.matches,v==null?void 0:v.route.id);p&&p[w.route.id]||(p={...p,[w.route.id]:S.error}),f.delete(y)}else if(bs(S))rt(!1,"Unhandled fetcher revalidation redirect");else{let w=Tr(S.data);f.set(y,w)}}),{loaderData:h,errors:p}}function gy(e,n,r,s){let u=Object.entries(n).filter(([,c])=>c!==Bb).reduce((c,[f,h])=>(c[f]=h,c),{});for(let c of r){let f=c.route.id;if(!n.hasOwnProperty(f)&&e.hasOwnProperty(f)&&c.route.loader&&(u[f]=e[f]),s&&s.hasOwnProperty(f))break}return u}function xy(e){return e?$n(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Pl(e,n){return(n?e.slice(0,e.findIndex(s=>s.route.id===n)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function yu(e){let n=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function er(e,{pathname:n,routeId:r,method:s,type:u,message:c}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(f="Bad Request",s&&n&&r?h=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:u==="invalid-body"&&(h="Unable to encode submission body")):e===403?(f="Forbidden",h=`Route "${r}" does not match URL "${n}"`):e===404?(f="Not Found",h=`No route matches URL "${n}"`):e===405&&(f="Method Not Allowed",s&&n&&r?h=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:s&&(h=`Invalid request method "${s.toUpperCase()}"`)),new Xo(e||500,f,new Error(h),!0)}function bu(e){let n=Object.entries(e);for(let r=n.length-1;r>=0;r--){let[s,u]=n[r];if(bs(u))return{key:s,result:u}}}function Gb(e){let n=typeof e=="string"?Dr(e):e;return Ar({...n,hash:""})}function EE(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function NE(e){var n,r;return new Xo(((n=e.init)==null?void 0:n.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function jE(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,r])=>typeof n=="string"&&RE(r))}function RE(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function kE(e){return Cm(e.result)&&zb.has(e.result.status)}function $n(e){return e.type==="error"}function bs(e){return(e&&e.type)==="redirect"}function vy(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Cm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function TE(e){return zb.has(e)}function CE(e){return Cm(e)&&TE(e.status)&&e.headers.has("Location")}function AE(e){return lE.has(e.toUpperCase())}function un(e){return nE.has(e.toUpperCase())}function Am(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function Uu(e,n){let r=typeof n=="string"?Dr(n).search:n.search;if(e[e.length-1].route.index&&Am(r||""))return e[e.length-1];let s=Db(e);return s[s.length-1]}function yy(e){let{formMethod:n,formAction:r,formEncType:s,text:u,formData:c,json:f}=e;if(!(!n||!r||!s)){if(u!=null)return{formMethod:n,formAction:r,formEncType:s,formData:void 0,json:void 0,text:u};if(c!=null)return{formMethod:n,formAction:r,formEncType:s,formData:c,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:r,formEncType:s,formData:void 0,json:f,text:void 0}}}function Uh(e,n,r,s){return s?{state:"loading",location:e,matches:n,historyAction:r,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}:{state:"loading",location:e,matches:n,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function DE(e,n,r,s){return{state:"submitting",location:e,matches:n,historyAction:r,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function bo(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function OE(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function Tr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ME(e,n){try{let r=e.sessionStorage.getItem($b);if(r){let s=JSON.parse(r);for(let[u,c]of Object.entries(s||{}))c&&Array.isArray(c)&&n.set(u,new Set(c||[]))}}catch{}}function _E(e,n){if(n.size>0){let r={};for(let[s,u]of n)r[s]=[...u];try{e.sessionStorage.setItem($b,JSON.stringify(r))}catch(s){fa(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function by(){let e,n,r=new Promise((s,u)=>{e=async c=>{s(c);try{await r}catch{}},n=async c=>{u(c);try{await r}catch{}}});return{promise:r,resolve:e,reject:n}}var Ns=x.createContext(null);Ns.displayName="DataRouter";var wi=x.createContext(null);wi.displayName="DataRouterState";var Xb=x.createContext(!1);function Qb(){return x.useContext(Xb)}var Dm=x.createContext({isTransitioning:!1});Dm.displayName="ViewTransition";var Om=x.createContext(new Map);Om.displayName="Fetchers";var LE=x.createContext(null);LE.displayName="Await";var Tn=x.createContext(null);Tn.displayName="Navigation";var id=x.createContext(null);id.displayName="Location";var lr=x.createContext({outlet:null,matches:[],isDataRoute:!1});lr.displayName="Route";var Mm=x.createContext(null);Mm.displayName="RouteError";var Kb="REACT_ROUTER_ERROR",zE="REDIRECT",UE="ROUTE_ERROR_RESPONSE";function $E(e){if(e.startsWith(`${Kb}:${zE}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function BE(e){if(e.startsWith(`${Kb}:${UE}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Xo(n.status,n.statusText,n.data)}catch{}}function HE(e,{relative:n}={}){rt(Ko(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=x.useContext(Tn),{hash:u,pathname:c,search:f}=Zo(e,{relative:n}),h=c;return r!=="/"&&(h=c==="/"?r:nr([r,c])),s.createHref({pathname:h,search:f,hash:u})}function Ko(){return x.useContext(id)!=null}function In(){return rt(Ko(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(id).location}var Zb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Wb(e){x.useContext(Tn).static||x.useLayoutEffect(e)}function Or(){let{isDataRoute:e}=x.useContext(lr);return e?eN():IE()}function IE(){rt(Ko(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ns),{basename:n,navigator:r}=x.useContext(Tn),{matches:s}=x.useContext(lr),{pathname:u}=In(),c=JSON.stringify(Rm(s)),f=x.useRef(!1);return Wb(()=>{f.current=!0}),x.useCallback((p,g={})=>{if(fa(f.current,Zb),!f.current)return;if(typeof p=="number"){r.go(p);return}let y=sd(p,JSON.parse(c),u,g.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:nr([n,y.pathname])),(g.replace?r.replace:r.push)(y,g.state,g)},[n,r,c,u,e])}var qE=x.createContext(null);function PE(e){let n=x.useContext(lr).outlet;return x.useMemo(()=>n&&x.createElement(qE.Provider,{value:e},n),[n,e])}function FE(){let{matches:e}=x.useContext(lr),n=e[e.length-1];return(n==null?void 0:n.params)??{}}function Zo(e,{relative:n}={}){let{matches:r}=x.useContext(lr),{pathname:s}=In(),u=JSON.stringify(Rm(r));return x.useMemo(()=>sd(e,JSON.parse(u),s,n==="path"),[e,u,s,n])}function VE(e,n,r){rt(Ko(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=x.useContext(Tn),{matches:u}=x.useContext(lr),c=u[u.length-1],f=c?c.params:{},h=c?c.pathname:"/",p=c?c.pathnameBase:"/",g=c&&c.route;{let R=g&&g.path||"";n0(h,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=In(),v;v=y;let E=v.pathname||"/",S=E;if(p!=="/"){let R=p.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(R.length).join("/")}let w=r&&r.state.matches.length?r.state.matches.map(R=>Object.assign(R,{route:r.manifest[R.route.id]||R.route})):jb(e,{pathname:S});return fa(g||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),fa(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),KE(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:nr([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:nr([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),u,r)}function YE(){let e=a0(),n=yi(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:c},"ErrorBoundary")," or"," ",x.createElement("code",{style:c},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),r?x.createElement("pre",{style:u},r):null,f)}var GE=x.createElement(YE,null),Jb=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=BE(e.digest);r&&(e=r)}let n=e!==void 0?x.createElement(lr.Provider,{value:this.props.routeContext},x.createElement(Mm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(XE,{error:e},n):n}};Jb.contextType=Xb;var $h=new WeakMap;function XE({children:e,error:n}){let{basename:r}=x.useContext(Tn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=$E(n.digest);if(s){let u=$h.get(n);if(u)throw u;let c=Mb(s.location,r),f=c.absoluteURL||c.to;if(om(f))throw new Error("Invalid redirect location");if(Ob&&!$h.get(n))if(c.isExternal||s.reloadDocument)window.location.href=f;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw $h.set(n,h),h}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return e}function QE({routeContext:e,match:n,children:r}){let s=x.useContext(Ns);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(lr.Provider,{value:e},r)}function KE(e,n=[],r){let s=r==null?void 0:r.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let u=e,c=s==null?void 0:s.errors;if(c!=null){let y=u.findIndex(v=>v.route.id&&(c==null?void 0:c[v.route.id])!==void 0);rt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),u=u.slice(0,Math.min(u.length,y+1))}let f=!1,h=-1;if(r&&s){f=s.renderFallback;for(let y=0;y<u.length;y++){let v=u[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(h=y),v.route.id){let{loaderData:E,errors:S}=s,w=v.route.loader&&!E.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||w){r.isStatic&&(f=!0),h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}}let p=r==null?void 0:r.onError,g=s&&p?(y,v)=>{var E,S;p(y,{location:s.location,params:((S=(E=s.matches)==null?void 0:E[0])==null?void 0:S.params)??{},pattern:Qo(s.matches),errorInfo:v})}:void 0;return u.reduceRight((y,v,E)=>{let S,w=!1,j=null,R=null;s&&(S=c&&v.route.id?c[v.route.id]:void 0,j=v.route.errorElement||GE,f&&(h<0&&E===0?(n0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):h===E&&(w=!0,R=v.route.hydrateFallbackElement||null)));let z=n.concat(u.slice(0,E+1)),I=()=>{let $;return S?$=j:w?$=R:v.route.Component?$=x.createElement(v.route.Component,null):v.route.element?$=v.route.element:$=y,x.createElement(QE,{match:v,routeContext:{outlet:y,matches:z,isDataRoute:s!=null},children:$})};return s&&(v.route.ErrorBoundary||v.route.errorElement||E===0)?x.createElement(Jb,{location:s.location,revalidation:s.revalidation,component:j,error:S,children:I(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:g}):I()},null)}function _m(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e0(e){let n=x.useContext(Ns);return rt(n,_m(e)),n}function Si(e){let n=x.useContext(wi);return rt(n,_m(e)),n}function ZE(e){let n=x.useContext(lr);return rt(n,_m(e)),n}function od(e){let n=ZE(e),r=n.matches[n.matches.length-1];return rt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function WE(){return od("useRouteId")}function gr(){let e=Si("useNavigation");return x.useMemo(()=>{let{matches:n,historyAction:r,...s}=e.navigation;return s},[e.navigation])}function JE(){let e=e0("useRevalidator"),n=Si("useRevalidator"),r=x.useCallback(async()=>{await e.router.revalidate()},[e.router]);return x.useMemo(()=>({revalidate:r,state:n.revalidation}),[r,n.revalidation])}function t0(){let{matches:e,loaderData:n}=Si("useMatches");return x.useMemo(()=>e.map(r=>Rb(r,n)),[e,n])}function Mr(){let e=Si("useLoaderData"),n=od("useLoaderData");return e.loaderData[n]}function js(e){return Si("useRouteLoaderData").loaderData[e]}function a0(){var s;let e=x.useContext(Mm),n=Si("useRouteError"),r=od("useRouteError");return e!==void 0?e:(s=n.errors)==null?void 0:s[r]}function eN(){let{router:e}=e0("useNavigate"),n=od("useNavigate"),r=x.useRef(!1);return Wb(()=>{r.current=!0}),x.useCallback(async(u,c={})=>{fa(r.current,Zb),r.current&&(typeof u=="number"?await e.navigate(u):await e.navigate(u,{fromRouteId:n,...c}))},[e,n])}var wy={};function n0(e,n,r){!n&&!wy[e]&&(wy[e]=!0,fa(!1,r))}var Sy={};function Ey(e,n){!e&&!Sy[n]&&(Sy[n]=!0,console.warn(n))}var tN="useOptimistic",Ny=yS[tN],aN=()=>{};function nN(e){return Ny?Ny(e):[e,aN]}function rN(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&fa(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:x.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&fa(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:x.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&fa(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:x.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var lN=["HydrateFallback","hydrateFallbackElement"],sN=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function iN({router:e,flushSync:n,onError:r,useTransitions:s}){s=Qb()||s;let[c,f]=x.useState(e.state),[h,p]=nN(c),[g,y]=x.useState(),[v,E]=x.useState({isTransitioning:!1}),[S,w]=x.useState(),[j,R]=x.useState(),[z,I]=x.useState(),$=x.useRef(new Map),Q=x.useCallback((T,{deletedFetchers:fe,newErrors:pe,flushSync:we,viewTransitionOpts:re})=>{pe&&r&&Object.values(pe).forEach(Te=>{var ee;return r(Te,{location:T.location,params:((ee=T.matches[0])==null?void 0:ee.params)??{},pattern:Qo(T.matches)})}),T.fetchers.forEach((Te,ee)=>{Te.data!==void 0&&$.current.set(ee,Te.data)}),fe.forEach(Te=>$.current.delete(Te)),Ey(we===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let je=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Ey(re==null||je,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!re||!je){n&&we?n(()=>f(T)):s===!1?f(T):x.startTransition(()=>{s===!0&&p(Te=>jy(Te,T)),f(T)});return}if(n&&we){n(()=>{j&&(S==null||S.resolve(),j.skipTransition()),E({isTransitioning:!0,flushSync:!0,currentLocation:re.currentLocation,nextLocation:re.nextLocation})});let Te=e.window.document.startViewTransition(()=>{n(()=>f(T))});Te.finished.finally(()=>{n(()=>{w(void 0),R(void 0),y(void 0),E({isTransitioning:!1})})}),n(()=>R(Te));return}j?(S==null||S.resolve(),j.skipTransition(),I({state:T,currentLocation:re.currentLocation,nextLocation:re.nextLocation})):(y(T),E({isTransitioning:!0,flushSync:!1,currentLocation:re.currentLocation,nextLocation:re.nextLocation}))},[e.window,n,j,S,s,p,r]);x.useLayoutEffect(()=>e.subscribe(Q),[e,Q]),x.useEffect(()=>{v.isTransitioning&&!v.flushSync&&w(new sN)},[v]),x.useEffect(()=>{if(S&&g&&e.window){let T=g,fe=S.promise,pe=e.window.document.startViewTransition(async()=>{s===!1?f(T):x.startTransition(()=>{s===!0&&p(we=>jy(we,T)),f(T)}),await fe});pe.finished.finally(()=>{w(void 0),R(void 0),y(void 0),E({isTransitioning:!1})}),R(pe)}},[g,S,e.window,s,p]),x.useEffect(()=>{S&&g&&h.location.key===g.location.key&&S.resolve()},[S,j,h.location,g]),x.useEffect(()=>{!v.isTransitioning&&z&&(y(z.state),E({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}),I(void 0))},[v.isTransitioning,z]);let J=x.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,fe,pe)=>e.navigate(T,{state:fe,preventScrollReset:pe==null?void 0:pe.preventScrollReset}),replace:(T,fe,pe)=>e.navigate(T,{replace:!0,state:fe,preventScrollReset:pe==null?void 0:pe.preventScrollReset})}),[e]),ne=e.basename||"/",M=x.useMemo(()=>({router:e,navigator:J,static:!1,basename:ne,onError:r}),[e,J,ne,r]);return x.createElement(x.Fragment,null,x.createElement(Ns.Provider,{value:M},x.createElement(wi.Provider,{value:h},x.createElement(Om.Provider,{value:$.current},x.createElement(Dm.Provider,{value:v},x.createElement(uN,{basename:ne,location:h.location,navigationType:h.historyAction,navigator:J,useTransitions:s},x.createElement(oN,{routes:e.routes,manifest:e.manifest,future:e.future,state:h,isStatic:!1,onError:r})))))),null)}function jy(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var oN=x.memo(cN);function cN({routes:e,manifest:n,future:r,state:s,isStatic:u,onError:c}){return VE(e,void 0,{manifest:n,state:s,isStatic:u,onError:c})}function Ei(e){return PE(e.context)}function uN({basename:e="/",children:n=null,location:r,navigationType:s="POP",navigator:u,static:c=!1,useTransitions:f}){rt(!Ko(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),p=x.useMemo(()=>({basename:h,navigator:u,static:c,useTransitions:f,future:{}}),[h,u,c,f]);typeof r=="string"&&(r=Dr(r));let{pathname:g="/",search:y="",hash:v="",state:E=null,key:S="default",mask:w}=r,j=x.useMemo(()=>{let R=Hn(g,h);return R==null?null:{location:{pathname:R,search:y,hash:v,state:E,key:S,mask:w},navigationType:s}},[h,g,y,v,E,S,s,w]);return fa(j!=null,`<Router basename="${h}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(Tn.Provider,{value:p},x.createElement(id.Provider,{children:n,value:j}))}var $u="get",Bu="application/x-www-form-urlencoded";function cd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function dN(e){return cd(e)&&e.tagName.toLowerCase()==="button"}function fN(e){return cd(e)&&e.tagName.toLowerCase()==="form"}function hN(e){return cd(e)&&e.tagName.toLowerCase()==="input"}function mN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pN(e,n){return e.button===0&&(!n||n==="_self")&&!mN(e)}function um(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,r)=>{let s=e[r];return n.concat(Array.isArray(s)?s.map(u=>[r,u]):[[r,s]])},[]))}function gN(e,n){let r=um(e);return n&&n.forEach((s,u)=>{r.has(u)||n.getAll(u).forEach(c=>{r.append(u,c)})}),r}var wu=null;function xN(){if(wu===null)try{new FormData(document.createElement("form"),0),wu=!1}catch{wu=!0}return wu}var vN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bh(e){return e!=null&&!vN.has(e)?(fa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bu}"`),null):e}function yN(e,n){let r,s,u,c,f;if(fN(e)){let h=e.getAttribute("action");s=h?Hn(h,n):null,r=e.getAttribute("method")||$u,u=Bh(e.getAttribute("enctype"))||Bu,c=new FormData(e)}else if(dN(e)||hN(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||h.getAttribute("action");if(s=p?Hn(p,n):null,r=e.getAttribute("formmethod")||h.getAttribute("method")||$u,u=Bh(e.getAttribute("formenctype"))||Bh(h.getAttribute("enctype"))||Bu,c=new FormData(h,e),!xN()){let{name:g,type:y,value:v}=e;if(y==="image"){let E=g?`${g}.`:"";c.append(`${E}x`,"0"),c.append(`${E}y`,"0")}else g&&c.append(g,v)}}else{if(cd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=$u,s=null,u=Bu,f=e}return c&&u==="text/plain"&&(f=c,c=void 0),{action:s,method:r.toLowerCase(),encType:u,formData:c,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var bN={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},wN=/[&><\u2028\u2029]/g;function Ry(e){return e.replace(wN,n=>bN[n])}function Lm(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function r0(e,n,r,s){let u=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${s}`:u.pathname=`${u.pathname}.${s}`:u.pathname==="/"?u.pathname=`_root.${s}`:n&&Hn(u.pathname,n)==="/"?u.pathname=`${Vu(n)}/_root.${s}`:u.pathname=`${Vu(u.pathname)}.${s}`,u}async function SN(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function EN(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function NN(e,n,r){let s=await Promise.all(e.map(async u=>{let c=n.routes[u.route.id];if(c){let f=await SN(c,r);return f.links?f.links():[]}return[]}));return TN(s.flat(1).filter(EN).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function ky(e,n,r,s,u,c){let f=(p,g)=>r[g]?p.route.id!==r[g].route.id:!0,h=(p,g)=>{var y;return r[g].pathname!==p.pathname||((y=r[g].route.path)==null?void 0:y.endsWith("*"))&&r[g].params["*"]!==p.params["*"]};return c==="assets"?n.filter((p,g)=>f(p,g)||h(p,g)):c==="data"?n.filter((p,g)=>{var v;let y=s.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(f(p,g)||h(p,g))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function jN(e,n,{includeHydrateFallback:r}={}){return RN(e.map(s=>{let u=n.routes[s.route.id];if(!u)return[];let c=[u.module];return u.clientActionModule&&(c=c.concat(u.clientActionModule)),u.clientLoaderModule&&(c=c.concat(u.clientLoaderModule)),r&&u.hydrateFallbackModule&&(c=c.concat(u.hydrateFallbackModule)),u.imports&&(c=c.concat(u.imports)),c}).flat(1))}function RN(e){return[...new Set(e)]}function kN(e){let n={},r=Object.keys(e).sort();for(let s of r)n[s]=e[s];return n}function TN(e,n){let r=new Set;return new Set(n),e.reduce((s,u)=>{let c=JSON.stringify(kN(u));return r.has(c)||(r.add(c),s.push({key:c,link:u})),s},[])}function zm(){let e=x.useContext(Ns);return Lm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function CN(){let e=x.useContext(wi);return Lm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ud=x.createContext(void 0);ud.displayName="FrameworkContext";function dd(){let e=x.useContext(ud);return Lm(e,"You must render this element inside a <HydratedRouter> element"),e}function AN(e,n){let r=x.useContext(ud),[s,u]=x.useState(!1),[c,f]=x.useState(!1),{onFocus:h,onBlur:p,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=n,E=x.useRef(null);x.useEffect(()=>{if(e==="render"&&f(!0),e==="viewport"){let j=z=>{z.forEach(I=>{f(I.isIntersecting)})},R=new IntersectionObserver(j,{threshold:.5});return E.current&&R.observe(E.current),()=>{R.disconnect()}}},[e]),x.useEffect(()=>{if(s){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[s]);let S=()=>{u(!0)},w=()=>{u(!1),f(!1)};return r?e!=="intent"?[c,E,{}]:[c,E,{onFocus:wo(h,S),onBlur:wo(p,w),onMouseEnter:wo(g,S),onMouseLeave:wo(y,w),onTouchStart:wo(v,S)}]:[!1,E,{}]}function wo(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function DN({page:e,...n}){let r=Qb(),{nonce:s}=dd(),{router:u}=zm(),c=x.useMemo(()=>jb(u.routes,e,u.basename),[u.routes,e,u.basename]);return c?(n.nonce==null&&s&&(n={...n,nonce:s}),r?x.createElement(MN,{page:e,matches:c,...n}):x.createElement(_N,{page:e,matches:c,...n})):null}function ON(e){let{manifest:n,routeModules:r}=dd(),[s,u]=x.useState([]);return x.useEffect(()=>{let c=!1;return NN(e,n,r).then(f=>{c||u(f)}),()=>{c=!0}},[e,n,r]),s}function MN({page:e,matches:n,...r}){let s=In(),{future:u}=dd(),{basename:c}=zm(),f=x.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let h=r0(e,c,u.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?p=!0:g.push(y.route.id);return p&&g.length>0&&h.searchParams.set("_routes",g.join(",")),[h.pathname+h.search]},[c,u.v8_trailingSlashAwareDataRequests,e,s,n]);return x.createElement(x.Fragment,null,f.map(h=>x.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...r})))}function _N({page:e,matches:n,...r}){let s=In(),{future:u,manifest:c,routeModules:f}=dd(),{basename:h}=zm(),{loaderData:p,matches:g}=CN(),y=x.useMemo(()=>ky(e,n,g,c,s,"data"),[e,n,g,c,s]),v=x.useMemo(()=>ky(e,n,g,c,s,"assets"),[e,n,g,c,s]),E=x.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let j=new Set,R=!1;if(n.forEach(I=>{var Q;let $=c.routes[I.route.id];!$||!$.hasLoader||(!y.some(J=>J.route.id===I.route.id)&&I.route.id in p&&((Q=f[I.route.id])!=null&&Q.shouldRevalidate)||$.hasClientLoader?R=!0:j.add(I.route.id))}),j.size===0)return[];let z=r0(e,h,u.v8_trailingSlashAwareDataRequests,"data");return R&&j.size>0&&z.searchParams.set("_routes",n.filter(I=>j.has(I.route.id)).map(I=>I.route.id).join(",")),[z.pathname+z.search]},[h,u.v8_trailingSlashAwareDataRequests,p,s,c,y,n,e,f]),S=x.useMemo(()=>jN(v,c),[v,c]),w=ON(v);return x.createElement(x.Fragment,null,E.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...r})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...r})),w.map(({key:j,link:R})=>x.createElement("link",{key:j,nonce:r.nonce,...R,crossOrigin:R.crossOrigin??r.crossOrigin})))}function LN(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var zN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zN&&(window.__reactRouterVersion="7.18.0")}catch{}function UN(e,n){return cE({basename:n==null?void 0:n.basename,getContext:n==null?void 0:n.getContext,future:n==null?void 0:n.future,history:RS({window:n==null?void 0:n.window}),hydrationData:$N(),routes:e,mapRouteProperties:rN,hydrationRouteProperties:lN,dataStrategy:n==null?void 0:n.dataStrategy,patchRoutesOnNavigation:n==null?void 0:n.patchRoutesOnNavigation,window:n==null?void 0:n.window,instrumentations:n==null?void 0:n.instrumentations}).initialize()}function $N(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:BN(e.errors)}),e}function BN(e){if(!e)return null;let n=Object.entries(e),r={};for(let[s,u]of n)if(u&&u.__type==="RouteErrorResponse")r[s]=new Xo(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(typeof u.__subType=="string"&&KS.includes(u.__subType)){let c=window[u.__subType];if(typeof c=="function")try{let f=new c(u.message);f.stack="",r[s]=f}catch{}}if(r[s]==null){let c=new Error(u.message);c.stack="",r[s]=c}}else r[s]=u;return r}var Ve=x.forwardRef(function({onClick:n,discover:r="render",prefetch:s="none",relative:u,reloadDocument:c,replace:f,mask:h,state:p,target:g,to:y,preventScrollReset:v,viewTransition:E,defaultShouldRevalidate:S,...w},j){let{basename:R,navigator:z,useTransitions:I}=x.useContext(Tn),$=typeof y=="string"&&ld.test(y),Q=Mb(y,R);y=Q.to;let J=HE(y,{relative:u}),ne=In(),M=null;if(h){let ee=sd(h,[],ne.mask?ne.mask.pathname:"/",!0);R!=="/"&&(ee.pathname=ee.pathname==="/"?R:nr([R,ee.pathname])),M=z.createHref(ee)}let[T,fe,pe]=AN(s,w),we=HN(y,{replace:f,mask:h,state:p,target:g,preventScrollReset:v,relative:u,viewTransition:E,defaultShouldRevalidate:S,useTransitions:I});function re(ee){n&&n(ee),ee.defaultPrevented||we(ee)}let je=!(Q.isExternal||c),Te=x.createElement("a",{...w,...pe,href:(je?M:void 0)||Q.absoluteURL||J,onClick:je?re:n,ref:LN(j,fe),target:g,"data-discover":!$&&r==="render"?"true":void 0});return T&&!$?x.createElement(x.Fragment,null,Te,x.createElement(DN,{page:J})):Te});Ve.displayName="Link";var dm=x.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:s="",end:u=!1,style:c,to:f,viewTransition:h,children:p,...g},y){let v=Zo(f,{relative:g.relative}),E=In(),S=x.useContext(wi),{navigator:w,basename:j}=x.useContext(Tn),R=S!=null&&YN(v)&&h===!0,z=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,I=E.pathname,$=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(I=I.toLowerCase(),$=$?$.toLowerCase():null,z=z.toLowerCase()),$&&j&&($=Hn($,j)||$);const Q=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let J=I===z||!u&&I.startsWith(z)&&I.charAt(Q)==="/",ne=$!=null&&($===z||!u&&$.startsWith(z)&&$.charAt(z.length)==="/"),M={isActive:J,isPending:ne,isTransitioning:R},T=J?n:void 0,fe;typeof s=="function"?fe=s(M):fe=[s,J?"active":null,ne?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let pe=typeof c=="function"?c(M):c;return x.createElement(Ve,{...g,"aria-current":T,className:fe,ref:y,style:pe,to:f,viewTransition:h},typeof p=="function"?p(M):p)});dm.displayName="NavLink";var Pa=x.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:s,replace:u,state:c,method:f=$u,action:h,onSubmit:p,relative:g,preventScrollReset:y,viewTransition:v,defaultShouldRevalidate:E,...S},w)=>{let{useTransitions:j}=x.useContext(Tn),R=Um(),z=PN(h,{relative:g}),I=f.toLowerCase()==="get"?"get":"post",$=typeof h=="string"&&ld.test(h),Q=J=>{if(p&&p(J),J.defaultPrevented)return;J.preventDefault();let ne=J.nativeEvent.submitter,M=(ne==null?void 0:ne.getAttribute("formmethod"))||f,T=()=>R(ne||J.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:u,state:c,relative:g,preventScrollReset:y,viewTransition:v,defaultShouldRevalidate:E});j&&r!==!1?x.startTransition(()=>T()):T()};return x.createElement("form",{ref:w,method:I,action:z,onSubmit:s?p:Q,...S,"data-discover":!$&&e==="render"?"true":void 0})});Pa.displayName="Form";function l0({getKey:e,storageKey:n,...r}){let s=x.useContext(ud),{basename:u}=x.useContext(Tn),c=In(),f=t0();FN({getKey:e,storageKey:n});let h=x.useMemo(()=>{if(!s||!e)return null;let g=hm(c,f,u,e);return g!==c.key?g:null},[]);if(!s||s.isSpaMode)return null;let p=((g,y)=>{if(!window.history.state||!window.history.state.key){let v=Math.random().toString(32).slice(2);window.history.replaceState({key:v},"")}try{let E=JSON.parse(sessionStorage.getItem(g)||"{}")[y||window.history.state.key];typeof E=="number"&&window.scrollTo(0,E)}catch(v){console.error(v),sessionStorage.removeItem(g)}}).toString();return r.nonce==null&&(s!=null&&s.nonce)&&(r.nonce=s.nonce),x.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p})(${Ry(JSON.stringify(n||fm))}, ${Ry(JSON.stringify(h))})`}})}l0.displayName="ScrollRestoration";function s0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fd(e){let n=x.useContext(Ns);return rt(n,s0(e)),n}function i0(e){let n=x.useContext(wi);return rt(n,s0(e)),n}function HN(e,{target:n,replace:r,mask:s,state:u,preventScrollReset:c,relative:f,viewTransition:h,defaultShouldRevalidate:p,useTransitions:g}={}){let y=Or(),v=In(),E=Zo(e,{relative:f});return x.useCallback(S=>{if(pN(S,n)){S.preventDefault();let w=r!==void 0?r:Ar(v)===Ar(E),j=()=>y(e,{replace:w,mask:s,state:u,preventScrollReset:c,relative:f,viewTransition:h,defaultShouldRevalidate:p});g?x.startTransition(()=>j()):j()}},[v,y,E,r,s,u,n,e,c,f,h,p,g])}function Wo(e){fa(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=x.useRef(um(e)),r=x.useRef(!1),s=In(),u=x.useMemo(()=>gN(s.search,r.current?null:n.current),[s.search]),c=Or(),f=x.useCallback((h,p)=>{const g=um(typeof h=="function"?h(new URLSearchParams(u)):h);r.current=!0,c("?"+g,p)},[c,u]);return[u,f]}var IN=0,qN=()=>`__${String(++IN)}__`;function Um(){let{router:e}=fd("useSubmit"),{basename:n}=x.useContext(Tn),r=WE(),s=e.fetch,u=e.navigate;return x.useCallback(async(c,f={})=>{let{action:h,method:p,encType:g,formData:y,body:v}=yN(c,n);if(f.navigate===!1){let E=f.fetcherKey||qN();await s(E,r,f.action||h,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:v,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await u(f.action||h,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:v,formMethod:f.method||p,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:r,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,u,n,r])}function PN(e,{relative:n}={}){let{basename:r}=x.useContext(Tn),s=x.useContext(lr);rt(s,"useFormAction must be used inside a RouteContext");let[u]=s.matches.slice(-1),c={...Zo(e||".",{relative:n})},f=In();if(e==null){c.search=f.search;let h=new URLSearchParams(c.search),p=h.getAll("index");if(p.some(y=>y==="")){h.delete("index"),p.filter(v=>v).forEach(v=>h.append("index",v));let y=h.toString();c.search=y?`?${y}`:""}}return(!e||e===".")&&u.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(c.pathname=c.pathname==="/"?r:nr([r,c.pathname])),Ar(c)}function Vl({key:e}={}){var J;let{router:n}=fd("useFetcher"),r=i0("useFetcher"),s=x.useContext(Om),u=x.useContext(lr),c=(J=u.matches[u.matches.length-1])==null?void 0:J.route.id;rt(s,"useFetcher must be used inside a FetchersContext"),rt(u,"useFetcher must be used inside a RouteContext"),rt(c!=null,'useFetcher can only be used on routes that contain a unique "id"');let f=x.useId(),[h,p]=x.useState(e||f);e&&e!==h&&p(e);let{deleteFetcher:g,getFetcher:y,resetFetcher:v,fetch:E}=n;x.useEffect(()=>(y(h),()=>g(h)),[g,y,h]);let S=x.useCallback(async(ne,M)=>{rt(c,"No routeId available for fetcher.load()"),await E(h,c,ne,M)},[h,c,E]),w=Um(),j=x.useCallback(async(ne,M)=>{await w(ne,{...M,navigate:!1,fetcherKey:h})},[h,w]),R=x.useCallback(ne=>v(h,ne),[v,h]),z=x.useMemo(()=>{let ne=x.forwardRef((M,T)=>x.createElement(Pa,{...M,navigate:!1,fetcherKey:h,ref:T}));return ne.displayName="fetcher.Form",ne},[h]),I=r.fetchers.get(h)||Ub,$=s.get(h);return x.useMemo(()=>({Form:z,submit:j,load:S,reset:R,...I,data:$}),[z,j,S,R,I,$])}var fm="react-router-scroll-positions",Su={};function hm(e,n,r,s){let u=null;return s&&(r!=="/"?u=s({...e,pathname:Hn(e.pathname,r)||e.pathname},n):u=s(e,n)),u==null&&(u=e.key),u}function FN({getKey:e,storageKey:n}={}){let{router:r}=fd("useScrollRestoration"),{restoreScrollPosition:s,preventScrollReset:u}=i0("useScrollRestoration"),{basename:c}=x.useContext(Tn),f=In(),h=t0(),p=gr();x.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),VN(x.useCallback(()=>{if(p.state==="idle"){let g=hm(f,h,c,e);Su[g]=window.scrollY}try{sessionStorage.setItem(n||fm,JSON.stringify(Su))}catch(g){fa(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${g}).`)}window.history.scrollRestoration="auto"},[p.state,e,c,f,h,n])),typeof document<"u"&&(x.useLayoutEffect(()=>{try{let g=sessionStorage.getItem(n||fm);g&&(Su=JSON.parse(g))}catch{}},[n]),x.useLayoutEffect(()=>{let g=r==null?void 0:r.enableScrollRestoration(Su,()=>window.scrollY,e?(y,v)=>hm(y,v,c,e):void 0);return()=>g&&g()},[r,c,e]),x.useLayoutEffect(()=>{if(s!==!1){if(typeof s=="number"){window.scrollTo(0,s);return}try{if(f.hash){let g=document.getElementById(decodeURIComponent(f.hash.slice(1)));if(g){g.scrollIntoView();return}}}catch{fa(!1,`"${f.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}u!==!0&&window.scrollTo(0,0)}},[f,s,u]))}function VN(e,n){let{capture:r}={};x.useEffect(()=>{let s=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,s),()=>{window.removeEventListener("pagehide",e,s)}},[e,r])}function YN(e,{relative:n}={}){let r=x.useContext(Dm);rt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=fd("useViewTransitionState"),u=Zo(e,{relative:n});if(!r.isTransitioning)return!1;let c=Hn(r.currentLocation.pathname,s)||r.currentLocation.pathname,f=Hn(r.nextLocation.pathname,s)||r.nextLocation.pathname;return Fu(u.pathname,f)!=null||Fu(u.pathname,c)!=null}var sl=bb();function GN(e){return x.createElement(iN,{flushSync:sl.flushSync,...e})}/**
62
- * @license lucide-react v1.21.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const o0=(...e)=>e.filter((n,r,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===r).join(" ").trim();/**
67
- * @license lucide-react v1.21.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const XN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
72
- * @license lucide-react v1.21.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const QN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,s)=>s?s.toUpperCase():r.toLowerCase());/**
77
- * @license lucide-react v1.21.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const Ty=e=>{const n=QN(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
82
- * @license lucide-react v1.21.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */var Hh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
87
- * @license lucide-react v1.21.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const KN=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},ZN=x.createContext({}),WN=()=>x.useContext(ZN),JN=x.forwardRef(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:s,className:u="",children:c,iconNode:f,...h},p)=>{const{size:g=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:E="currentColor",className:S=""}=WN()??{},w=s??v?Number(r??y)*24/Number(n??g):r??y;return x.createElement("svg",{ref:p,...Hh,width:n??g??Hh.width,height:n??g??Hh.height,stroke:e??E,strokeWidth:w,className:o0("lucide",S,u),...!c&&!KN(h)&&{"aria-hidden":"true"},...h},[...f.map(([j,R])=>x.createElement(j,R)),...Array.isArray(c)?c:[c]])});/**
92
- * @license lucide-react v1.21.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const ct=(e,n)=>{const r=x.forwardRef(({className:s,...u},c)=>x.createElement(JN,{ref:c,iconNode:n,className:o0(`lucide-${XN(Ty(e))}`,`lucide-${e}`,s),...u}));return r.displayName=Ty(e),r};/**
97
- * @license lucide-react v1.21.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const ej=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],tj=ct("activity",ej);/**
102
- * @license lucide-react v1.21.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const aj=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],nj=ct("arrow-down-right",aj);/**
107
- * @license lucide-react v1.21.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const rj=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],lj=ct("arrow-down-wide-narrow",rj);/**
112
- * @license lucide-react v1.21.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const sj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],hd=ct("arrow-left",sj);/**
117
- * @license lucide-react v1.21.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const ij=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],oj=ct("arrow-up-narrow-wide",ij);/**
122
- * @license lucide-react v1.21.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const cj=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],uj=ct("arrow-up-right",cj);/**
127
- * @license lucide-react v1.21.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const dj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],c0=ct("ban",dj);/**
132
- * @license lucide-react v1.21.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const fj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],hj=ct("chart-column",fj);/**
137
- * @license lucide-react v1.21.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const mj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pj=ct("check",mj);/**
142
- * @license lucide-react v1.21.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const gj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rs=ct("chevron-down",gj);/**
147
- * @license lucide-react v1.21.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const xj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],u0=ct("chevron-right",xj);/**
152
- * @license lucide-react v1.21.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const vj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],yj=ct("circle-check-big",vj);/**
157
- * @license lucide-react v1.21.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const bj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$m=ct("circle-check",bj);/**
162
- * @license lucide-react v1.21.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const wj=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],Sj=ct("circle-dashed",wj);/**
167
- * @license lucide-react v1.21.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const Ej=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Nj=ct("circle-minus",Ej);/**
172
- * @license lucide-react v1.21.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const jj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],Bm=ct("circle-pause",jj);/**
177
- * @license lucide-react v1.21.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const Rj=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],d0=ct("circle-play",Rj);/**
182
- * @license lucide-react v1.21.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Tj=ct("circle-x",kj);/**
187
- * @license lucide-react v1.21.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const Cj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],md=ct("circle",Cj);/**
192
- * @license lucide-react v1.21.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const Aj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Dj=ct("clock",Aj);/**
197
- * @license lucide-react v1.21.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const Oj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Mj=ct("copy",Oj);/**
202
- * @license lucide-react v1.21.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const _j=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Lj=ct("download",_j);/**
207
- * @license lucide-react v1.21.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const zj=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Uj=ct("git-branch",zj);/**
212
- * @license lucide-react v1.21.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const $j=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Bj=ct("grip-vertical",$j);/**
217
- * @license lucide-react v1.21.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const Hj=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Yu=ct("layers",Hj);/**
222
- * @license lucide-react v1.21.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const Ij=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],f0=ct("lightbulb",Ij);/**
227
- * @license lucide-react v1.21.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const qj=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Jo=ct("list-todo",qj);/**
232
- * @license lucide-react v1.21.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const Pj=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Fj=ct("locate-fixed",Pj);/**
237
- * @license lucide-react v1.21.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const Vj=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Yj=ct("menu",Vj);/**
242
- * @license lucide-react v1.21.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const Gj=[["path",{d:"M5 12h14",key:"1ays0h"}]],Xj=ct("minus",Gj);/**
247
- * @license lucide-react v1.21.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const Qj=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Kj=ct("moon",Qj);/**
252
- * @license lucide-react v1.21.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const Zj=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],h0=ct("octagon-alert",Zj);/**
257
- * @license lucide-react v1.21.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const Wj=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Yl=ct("pencil",Wj);/**
262
- * @license lucide-react v1.21.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const Jj=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],e2=ct("play",Jj);/**
267
- * @license lucide-react v1.21.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const t2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],a2=ct("plus",t2);/**
272
- * @license lucide-react v1.21.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const n2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],m0=ct("rotate-ccw",n2);/**
277
- * @license lucide-react v1.21.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const r2=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],p0=ct("scroll-text",r2);/**
282
- * @license lucide-react v1.21.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const l2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],s2=ct("search",l2);/**
287
- * @license lucide-react v1.21.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const i2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],o2=ct("sun",i2);/**
292
- * @license lucide-react v1.21.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const c2=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],u2=ct("timer-reset",c2);/**
297
- * @license lucide-react v1.21.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const d2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Es=ct("trash-2",d2);/**
302
- * @license lucide-react v1.21.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const f2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],g0=ct("x",f2),h2="/api",m2=120,p2=40;function ec(e){return{...e,number:e.number??0,decisions:e.decisions??[],acceptedDecisions:e.acceptedDecisions??[],checklist:e.checklist??[],subtasks:e.subtasks??[],pauseSnapshot:e.pauseSnapshot??null,pauseHistory:e.pauseHistory??[],startedAt:e.startedAt??"",completedAt:e.completedAt??"",descriptionUpdatedAt:e.descriptionUpdatedAt??""}}function pd(e){return{...e,discussedAt:e.discussedAt??"",contextReady:e.contextReady??!1,contextReadyReason:e.contextReadyReason??"",notes:e.notes??"",goals:e.goals??[],nonGoals:e.nonGoals??[],dependencies:e.dependencies??[],risks:e.risks??[],openQuestions:e.openQuestions??[],decisions:e.decisions??[],acceptedDecisions:e.acceptedDecisions??[],completionCriteria:e.completionCriteria??[],taskIds:e.taskIds??[],tasks:(e.tasks??[]).map(ec),linkedRequirements:e.linkedRequirements??[],handoff:e.handoff??"",handoffUpdatedAt:e.handoffUpdatedAt??"",descriptionUpdatedAt:e.descriptionUpdatedAt??""}}function gd(e){return{...e,number:e.number??0,discussedAt:e.discussedAt??"",contextReady:e.contextReady??!1,contextReadyReason:e.contextReadyReason??"",acceptedDecisions:e.acceptedDecisions??[],phaseIds:e.phaseIds??[],descriptionUpdatedAt:e.descriptionUpdatedAt??""}}function x0(e){var n,r,s,u,c,f;return{...e,descriptionRef:e.descriptionRef??"",projectGuidelines:{content:((n=e.projectGuidelines)==null?void 0:n.content)??"",updatedAt:((r=e.projectGuidelines)==null?void 0:r.updatedAt)??"",sessionInfo:((s=e.projectGuidelines)==null?void 0:s.sessionInfo)??[]},scope:e.scope??[],outOfScope:e.outOfScope??[],decisions:e.decisions??[],globalRules:e.globalRules??[],technologies:e.technologies??[],tools:e.tools??[],acceptedDecisions:e.acceptedDecisions??[],workDeviations:e.workDeviations??[],planRoot:e.planRoot??"",projectRoot:e.projectRoot??"",workflowRules:{beforePhaseStart:((u=e.workflowRules)==null?void 0:u.beforePhaseStart)??[],beforeTaskStart:((c=e.workflowRules)==null?void 0:c.beforeTaskStart)??[],afterPhaseComplete:((f=e.workflowRules)==null?void 0:f.afterPhaseComplete)??[]}}}function Hm(e){return{...e,description:e.description??"",macroTasks:e.macroTasks??[],linkedPhaseIds:e.linkedPhaseIds??[]}}async function Cy(e,n){const r={"Content-Type":"application/json","X-Planner-Source":"web-ui",...n==null?void 0:n.headers};try{return await fetch(`${h2}${e}`,{...n,headers:r})}catch{throw new Response("Planner web server unavailable. Pi or planner-web may have stopped. Restart the planner web UI or Pi, then reload this page.",{status:503,statusText:"Planner web server unavailable"})}}async function Rt(e,n){let r=await Cy(e,n),s=0;for(;r.status===503&&s<p2;)await new Promise(u=>setTimeout(u,m2)),s+=1,r=await Cy(e,n);if(!r.ok){const u=await r.text().catch(()=>r.statusText);throw new Response(u||r.statusText,{status:r.status,statusText:r.statusText})}return r.json()}async function Im(){return x0(await Rt("/project"))}async function g2(e){const{descriptionRef:n,workDeviations:r,...s}=e,u={...s,...n?{descriptionRef:n}:{},workDeviations:[]};return x0(await Rt("/project",{method:"PUT",body:JSON.stringify(u)}))}async function x2(){return Rt("/ui-config")}async function v0(){return(await Rt("/features")).map(gd)}async function tc(e){return gd(await Rt(`/features/${e}`))}async function v2(e){return gd(await Rt("/features",{method:"POST",body:JSON.stringify(e)}))}async function y0(e){return gd(await Rt(`/features/${e.id}`,{method:"PUT",body:JSON.stringify(e)}))}async function y2(e){return Rt(`/features/${e}`,{method:"DELETE"})}async function b2(){return(await Rt("/ideas")).ideas}async function w2(e){return Rt("/ideas",{method:"POST",body:JSON.stringify(e)})}async function S2(e){return Rt(`/ideas/${e.id}`,{method:"PUT",body:JSON.stringify(e)})}async function E2(e){return Rt(`/ideas/${e}`,{method:"DELETE"})}async function qm(){return(await Rt("/requirements")).requirements.map(Hm)}async function N2(e){return Hm(await Rt("/requirements",{method:"POST",body:JSON.stringify(e)}))}async function j2(e){return Hm(await Rt(`/requirements/${e.id}`,{method:"PUT",body:JSON.stringify({...e,updatedAt:new Date().toISOString()})}))}async function R2(e){return Rt(`/requirements/${e}`,{method:"DELETE"})}async function xd(e){const n=e?`?featureId=${encodeURIComponent(e)}`:"";return(await Rt(`/phases${n}`)).map(pd)}async function vd(e){return pd(await Rt(`/phases/${e}`))}async function k2(e){return pd(await Rt("/phases",{method:"POST",body:JSON.stringify(e)}))}async function b0(e){return pd(await Rt(`/phases/${e.id}`,{method:"PUT",body:JSON.stringify(e)}))}async function T2(e){return Rt(`/phases/${e}`,{method:"DELETE"})}async function C2(e,n){return ec(await Rt(`/phases/${e}/tasks`,{method:"POST",body:JSON.stringify(n)}))}async function yd(e){return ec(await Rt(`/tasks/${e}`))}async function Pm(e){return ec(await Rt(`/tasks/${e.id}`,{method:"PUT",body:JSON.stringify(e)}))}async function A2(e){return ec(await Rt(`/tasks/${e}/start`,{method:"POST"}))}async function D2(e){return Rt(`/tasks/${e}`,{method:"DELETE"})}async function O2(){return Rt("/tasks/active")}async function M2(){const e=await Rt("/tasks/focus");return{active:e.active??[],pendingResume:e.pendingResume??[]}}async function mm(){return(await Rt("/handoffs")).handoffs??[]}async function _2(){return(await Rt("/handoffs/archive")).archived??[]}async function w0(e){return Rt(`/phases/${e}/handoff`,{method:"DELETE"})}async function L2(e=!1){return Rt(`/export?full=${e?"true":"false"}`)}async function z2(){return Rt("/repair",{method:"POST"})}async function Ih(e,n,r,s){return Rt("/reorder",{method:"POST",body:JSON.stringify({kind:e,movedId:n,beforeId:r,afterId:s})})}function U2(){const[e,n]=x.useState(()=>{if(typeof window>"u")return"dark";const r=window.localStorage.getItem("plan-ui-theme");return r||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return x.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),window.localStorage.setItem("plan-ui-theme",e)},[e]),{theme:e,toggleTheme:()=>n(r=>r==="dark"?"light":"dark")}}function $2({liveStatus:e}){const n=e==="live"?{label:"Live",className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",dotClassName:"bg-emerald-500"}:e==="reconnecting"?{label:"Reconnecting…",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-400",dotClassName:"bg-amber-500 animate-pulse"}:e==="disconnected"?{label:"Disconnected",className:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-400",dotClassName:"bg-rose-500"}:{label:"Connecting…",className:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-400",dotClassName:"bg-sky-500 animate-pulse"};return o.jsxs("span",{className:`inline-flex max-w-full min-h-7 items-center gap-1.5 rounded-[10px] border px-2 py-1 text-xs font-semibold sm:min-h-8 sm:rounded-[12px] sm:px-2.5 sm:py-1.5 sm:text-sm ${n.className}`,children:[o.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${n.dotClassName}`}),o.jsx("span",{className:"truncate",children:n.label})]})}function B2({projectName:e,projectRoot:n,planRoot:r,liveStatus:s}){const{theme:u,toggleTheme:c}=U2(),[f,h]=x.useState(!1),[p,g]=x.useState(null),[y,v]=x.useState(!1),E=[{to:"/ideas",label:"Ideas",icon:f0},{to:"/features",label:"Features",icon:Yu},{to:"/requirements",label:"Requirements",icon:Jo},{to:"/handoff",label:"Handoff",icon:p0}];async function S(w){g(w?"full":"summary");try{const R=await L2(w),z=new Blob([R.markdown],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(z),$=document.createElement("a");$.href=I,$.download=w?"EXPORT-full.md":R.filePath||"EXPORT.md",document.body.appendChild($),$.click(),$.remove(),URL.revokeObjectURL(I),h(!1)}catch(R){window.alert(`Export failed: ${R instanceof Error?R.message:String(R)}`)}finally{g(null)}}return o.jsx("div",{className:"relative z-20 overflow-visible border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:o.jsxs("div",{className:"page-container flex items-center gap-2 py-2 sm:gap-3 sm:py-2.5",children:[o.jsxs(Ve,{to:"/",title:n??e??"Agent Plan",className:"flex min-w-0 shrink items-center gap-2 sm:gap-2.5",children:[o.jsx("div",{className:"surface-card flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-[var(--border)] text-[var(--accent)] sm:h-9 sm:w-9",children:o.jsx(Yu,{className:"h-4 w-4"})}),o.jsx("span",{className:"truncate text-sm font-black tracking-tight sm:text-base",children:e??"Agent Plan"})]}),o.jsx("nav",{className:"ml-1 hidden items-center gap-1 md:flex",children:E.map(w=>o.jsxs(dm,{to:w.to,"aria-label":w.label,className:({isActive:j})=>`inline-flex min-h-7 shrink-0 items-center gap-1.5 rounded-[10px] border px-2 py-1 text-xs font-semibold transition sm:min-h-8 sm:rounded-[12px] sm:px-3 sm:py-1.5 sm:text-sm ${j?"border-transparent bg-[var(--accent-soft)] text-[var(--accent)]":"border-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`,children:[o.jsx(w.icon,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),o.jsx("span",{children:w.label})]},w.to))}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5 sm:gap-2",children:[o.jsx($2,{liveStatus:s}),o.jsx("button",{type:"button",onClick:c,"aria-label":u==="dark"?"Switch to light theme":"Switch to dark theme",title:u==="dark"?"Switch to light theme":"Switch to dark theme",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)] sm:h-9 sm:w-9 sm:rounded-[12px]",children:u==="dark"?o.jsx(o2,{className:"h-4 w-4"}):o.jsx(Kj,{className:"h-4 w-4"})}),o.jsxs("div",{className:"relative md:hidden",children:[o.jsx("button",{type:"button","aria-label":"Open menu","aria-haspopup":"menu","aria-expanded":y,onClick:()=>v(w=>!w),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)]",children:y?o.jsx(g0,{className:"h-4 w-4"}):o.jsx(Yj,{className:"h-4 w-4"})}),y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-[150]","aria-hidden":"true",onClick:()=>v(!1)}),o.jsxs("div",{role:"menu",onKeyDown:w=>{w.key==="Escape"&&v(!1)},className:"absolute right-0 top-full z-[200] mt-2 w-52 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[E.map(w=>o.jsxs(dm,{to:w.to,"aria-label":w.label,onClick:()=>v(!1),className:({isActive:j})=>`flex items-center gap-2 rounded-[10px] px-3 py-2 text-sm font-semibold transition ${j?"bg-[var(--accent-soft)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[var(--accent-soft)]"}`,children:[o.jsx(w.icon,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{children:w.label})]},w.to)),o.jsx("div",{className:"my-1 h-px bg-[var(--border)]"}),o.jsxs("button",{type:"button",role:"menuitem",disabled:p!==null,onClick:()=>{v(!1),S(!1)},className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Export summary",p==="summary"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),o.jsxs("button",{type:"button",role:"menuitem",disabled:p!==null,onClick:()=>{v(!1),S(!0)},className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Export full",p==="full"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]})]}):null]}),o.jsxs("div",{className:"relative z-30 hidden md:block",children:[o.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":f,"aria-label":"Export",onClick:()=>h(w=>!w),className:"inline-flex min-h-7 items-center gap-1.5 rounded-[10px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-1 text-xs font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:min-h-8 sm:rounded-[12px] sm:px-3 sm:py-1.5 sm:text-sm",children:[o.jsx(Lj,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),o.jsx("span",{children:"Export"}),o.jsx(Rs,{className:`h-3.5 w-3.5 shrink-0 transition-transform sm:h-4 sm:w-4 ${f?"rotate-180":""}`})]}),f?o.jsxs("div",{role:"menu",onKeyDown:w=>{var I;const j=Array.from(w.currentTarget.querySelectorAll("[role=menuitem]")).filter($=>!$.hasAttribute("disabled"));if(j.length===0)return;const R=j.indexOf(document.activeElement);let z=R;if(w.key==="ArrowDown")z=R===-1?0:(R+1)%j.length;else if(w.key==="ArrowUp")z=R===-1?j.length-1:(R-1+j.length)%j.length;else if(w.key==="Home")z=0;else if(w.key==="End")z=j.length-1;else return;w.preventDefault(),(I=j[z])==null||I.focus()},className:"absolute right-0 top-full z-[200] mt-2 min-w-44 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",disabled:p!==null,onClick:()=>void S(!1),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Summary",p==="summary"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),o.jsxs("button",{type:"button",role:"menuitem",disabled:p!==null,onClick:()=>void S(!0),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Full",p==="full"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]})]})]})})}function Ay(e,n,r){e.split(`
307
- `).forEach((u,c)=>{c>0&&n.push(o.jsx("br",{},`${r}-br-${c}`)),u&&n.push(u)})}function So(e,n){const r=[],s=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let u=0,c=null,f=0;for(;(c=s.exec(e))!==null;)c.index>u&&Ay(e.slice(u,c.index),r,`${n}-${f}`),c[2]&&c[3]?r.push(o.jsx("a",{href:c[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:c[2]},`${n}-link-${f}`)):c[4]?r.push(o.jsx("strong",{className:"font-semibold text-[var(--text)]",children:c[4]},`${n}-strong-${f}`)):c[5]?r.push(o.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:c[5]},`${n}-code-${f}`)):c[6]&&r.push(o.jsx("em",{className:"italic",children:c[6]},`${n}-em-${f}`)),u=s.lastIndex,f+=1;return u<e.length&&Ay(e.slice(u),r,`${n}-tail`),r}function H2(e,n){var u;const r=e.split(`
308
- `);if(e.startsWith("```")){const c=e.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return o.jsx("pre",{className:"overflow-x-auto rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] p-3 text-sm font-mono text-[var(--text)]",children:o.jsx("code",{children:c})},`code-${n}`)}const s=e.match(/^(#{1,6})\s+(.+)$/);if(s&&s[2]){const c=((u=s[1])==null?void 0:u.length)??1,f=s[2],h=c<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return o.jsx("p",{className:h,children:So(f,`h-${n}`)},`h-${n}`)}return r.every(c=>/^\s*>\s?/.test(c))?o.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:r.map((c,f)=>o.jsx("div",{children:So(c.replace(/^\s*>\s?/,""),`bq-${n}-${f}`)},`bq-${n}-${f}`))},`bq-${n}`):/^\s*([-*_])\1{2,}\s*$/.test(e.trim())?o.jsx("hr",{className:"border-[var(--border)]"},`hr-${n}`):r.every(c=>/^\s*[-*]\s+/.test(c))?o.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:r.map((c,f)=>o.jsx("li",{className:"list-disc",children:So(c.replace(/^\s*[-*]\s+/,""),`ul-${n}-${f}`)},`ul-${n}-${f}`))},`ul-${n}`):r.every(c=>/^\s*\d+\.\s+/.test(c))?o.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:r.map((c,f)=>o.jsx("li",{children:So(c.replace(/^\s*\d+\.\s+/,""),`ol-${n}-${f}`)},`ol-${n}-${f}`))},`ol-${n}`):o.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:So(e,`p-${n}`)},`p-${n}`)}function ga({text:e,className:n=""}){if(!(e!=null&&e.trim()))return null;const r=e.trim().split(/\n\s*\n/).filter(Boolean);return o.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${n}`,children:r.map((s,u)=>H2(s,u))})}function il(e){return String(e&&e>0?e:0).padStart(3,"0")}function cl({featureNum:e,phaseNum:n,taskNum:r}){const s=[];return e!==void 0&&s.push(`F${il(e)}`),n!==void 0&&s.push(`P${il(n)}`),r!==void 0&&s.push(`T${il(r)}`),s.join("/")}async function I2(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="-1000px",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select();const r=document.execCommand("copy");return n.remove(),r}catch{return!1}}function S0({type:e,phaseNum:n,featureNum:r}){return e==="feature"?null:e==="phase"?r===void 0?null:o.jsx("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:o.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",il(r)]})}):e==="task"?n===void 0?null:o.jsxs("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:[o.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",il(n)]}),r!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),o.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",il(r)]})]})]}):null}function rr({featureNum:e,phaseNum:n,taskNum:r,featureId:s,phaseId:u,taskId:c,featureName:f,phaseName:h,taskTitle:p}){const g=f?{title:f}:{},y=h?{title:h}:{},v=p?{title:p}:{},E=s?({children:j})=>o.jsx(Ve,{to:`/features/${s}`,...g,className:"entity-path-seg entity-path-seg--feature entity-path-seg--link",children:j}):({children:j})=>o.jsx("span",{className:"entity-path-seg entity-path-seg--feature",...g,children:j}),S=u?({children:j})=>o.jsx(Ve,{to:`/features/${s}/phases/${u}`,...y,className:"entity-path-seg entity-path-seg--phase entity-path-seg--link",children:j}):({children:j})=>o.jsx("span",{className:"entity-path-seg entity-path-seg--phase",...y,children:j}),w=c?({children:j})=>o.jsx(Ve,{to:`/features/${s}/phases/${u}/tasks/${c}`,...v,className:"entity-path-seg entity-path-seg--task entity-path-seg--link",children:j}):({children:j})=>o.jsx("span",{className:"entity-path-seg entity-path-seg--task",...v,children:j});return o.jsxs("span",{className:"entity-path-badge",children:[e!==void 0?o.jsxs(E,{children:["F",il(e)]}):null,n!==void 0?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),o.jsxs(S,{children:["P",il(n)]})]}):null,r!==void 0?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),o.jsxs(w,{children:["T",il(r)]})]}):null]})}function sr({id:e,children:n}){const[r,s]=x.useState(!1);return o.jsxs("button",{type:"button",onClick:async u=>{u.preventDefault(),u.stopPropagation(),await I2(e)&&(s(!0),window.setTimeout(()=>s(!1),1200))},title:r?"Copied":`Copy ${e}`,"aria-label":r?"Copied":`Copy ${e}`,className:"copyable-id group inline-flex items-center gap-1.5",children:[n,o.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:r?o.jsx(pj,{className:"h-3 w-3 text-emerald-500"}):o.jsx(Mj,{className:"h-3 w-3"})})]})}function ul({shortId:e}){return o.jsx(sr,{id:e,children:o.jsx("span",{className:"short-id-badge",children:e})})}function E0({featureNum:e,phaseNum:n,taskNum:r,featureId:s,phaseId:u,taskId:c,shortId:f,featureName:h,phaseName:p,taskTitle:g}){return o.jsxs(o.Fragment,{children:[o.jsx(rr,{featureNum:e,phaseNum:n,taskNum:r,featureId:s,phaseId:u,taskId:c,featureName:h,phaseName:p,taskTitle:g}),o.jsx(sr,{id:cl({featureNum:e,phaseNum:n,taskNum:r}),children:o.jsx("span",{className:"sr-only",children:"Copy path"})}),f?o.jsx(ul,{shortId:f}):null]})}function Fm({phaseId:e,updatedAt:n}){const r=`Phase handoff pending${n?` · updated ${new Date(n).toLocaleString()}`:""}`;return o.jsxs("a",{href:`/handoff#${e}`,className:"handoff-badge flex items-center gap-1 ml-2 shrink-0",title:r,"aria-label":r,children:[o.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),o.jsx("path",{d:"M9 2v3h3"}),o.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),o.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}const pm={planned:{colorVar:"--color-status-planned",icon:"circle",pattern:"",label:"Planned",description:"Not started",borderStyle:"solid",bgOpacity:10,borderOpacity:30},started:{colorVar:"--color-status-started",icon:"play-start",pattern:"dashed",label:"Started",description:"Begun but not active now",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},"in-progress":{colorVar:"--color-status-in-progress",icon:"play",pattern:"pulse",label:"In progress",description:"Active now",borderStyle:"solid",bgOpacity:12,borderOpacity:30},waiting:{colorVar:"--color-status-waiting",icon:"clock",pattern:"dashed",label:"Waiting",description:"Waiting on a dependency",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},blocked:{colorVar:"--color-status-blocked",icon:"stop",pattern:"",label:"Blocked",description:"Impediment",borderStyle:"solid",bgOpacity:12,borderOpacity:30},deferred:{colorVar:"--color-status-deferred",icon:"pause",pattern:"dashed",label:"Deferred",description:"Postponed",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},done:{colorVar:"--color-status-done",icon:"check",pattern:"",label:"Done",description:"Completed",borderStyle:"solid",bgOpacity:14,borderOpacity:30},closed:{colorVar:"--color-status-closed",icon:"check-mixed",pattern:"",label:"Closed",description:"Closed with mixed outcomes",borderStyle:"solid",bgOpacity:14,borderOpacity:30},canceled:{colorVar:"--color-status-canceled",icon:"ban",pattern:"hatch",label:"Canceled",description:"Canceled",borderStyle:"solid",bgOpacity:8,borderOpacity:30},rejected:{colorVar:"--color-status-rejected",icon:"x",pattern:"crosshatch",label:"Rejected",description:"Rejected",borderStyle:"solid",bgOpacity:10,borderOpacity:30}};function Xl(e){return pm[e]??pm.planned}function Gu(e,n,r){switch(n){case"bg":return`color-mix(in srgb, var(${e.colorVar}) ${e.bgOpacity}%, transparent)`;case"border":return`color-mix(in srgb, var(${e.colorVar}) ${e.borderOpacity}%, transparent)`}}function q2(e){const n=Xl(e);return{backgroundColor:Gu(n,"bg"),borderStyle:n.borderStyle,borderColor:Gu(n,"border"),borderWidth:"1px"}}function P2(e){const n=Xl(e);return{backgroundColor:Gu(n,"bg"),borderStyle:n.borderStyle,borderColor:Gu(n,"border"),borderWidth:"1px"}}function Vm(e){const{pattern:n}=Xl(e);return n?n==="dashed"?`status-pattern-dashed status-pattern-dashed-${e}`:`status-pattern-${n}`:""}function N0(e){return`status-${e}`}function j0(e,n=30){return`color-mix(in srgb, var(${Xl(e).colorVar}) ${n}%, transparent)`}function R0(e){return e in pm?e:"planned"}function F2(e,n){const s=[Xl(e).label],u=[["done",n.done],["in-progress",n.inProgress],["planned",n.planned],["waiting",n.waiting],["blocked",n.blocked],["deferred",n.deferred],["canceled",n.canceled],["rejected",n.rejected]];for(const[c,f]of u)f>0&&s.push(`${f} ${c}`);return s.join(" · ")}const k0={circle:md,"play-start":e2,play:d0,clock:Dj,stop:h0,pause:Bm,check:$m,"check-mixed":yj,ban:c0,x:Tj};function V2({status:e,className:n=""}){const r=Xl(e),s=k0[r.icon]??md;return o.jsx(s,{className:`h-4 w-4 shrink-0 ${n}`.trim(),"aria-hidden":"true"})}function ar({status:e}){const n=R0(e),r=Xl(n);return o.jsxs("span",{className:`status-chip ${N0(n)} ${Vm(n)}`,title:r.description,"aria-label":r.description,children:[o.jsx(V2,{status:n,className:"h-3.5 w-3.5"}),o.jsx("span",{children:r.label})]})}function ac({status:e,breakdown:n,size:r="md",children:s}){const u=Xl(e),c=k0[u.icon]??md,f=Vm(e),h=n?F2(e,n):u.description,p=r==="sm"?"px-2 py-0.5 text-[10px]":"px-2.5 py-1 text-[11px]";return o.jsxs("span",{className:`status-chip ${N0(e)} ${f} ${p}`,title:h,"aria-label":h,children:[o.jsx(c,{className:"h-3.5 w-3.5"}),o.jsx("span",{children:u.label}),s]})}function Xu({status:e,breakdown:n,doneTasks:r,totalTasks:s,recentlyChanged:u,className:c}){const f=r!=null&&s!=null;return o.jsxs("div",{className:c,children:[u?o.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"}):null,f?o.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",r,"/",s||0,")"]}):null,o.jsx(ac,{status:e,breakdown:n})]})}function T0({task:e}){const n=Or(),r=e.featureId?`/features/${e.featureId}/phases/${e.phaseId}/tasks/${e.id}`:"/features";return o.jsx("article",{className:`min-w-0 rounded-[12px] border bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] ${e.pendingResume?"border-[var(--accent)]":"border-[var(--border)]"}`,children:o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[o.jsx(rr,{featureNum:e.featureNumber,phaseNum:e.phaseNumber,taskNum:e.number,featureId:e.featureId,phaseId:e.phaseId,taskId:e.id}),o.jsx(sr,{id:cl({featureNum:e.featureNumber,phaseNum:e.phaseNumber,taskNum:e.number}),children:o.jsx("span",{className:"sr-only",children:"Copy task path"})}),e.shortId?o.jsx(ul,{shortId:e.shortId}):null,o.jsx("span",{className:"shrink-0",children:o.jsx(ar,{status:e.status})}),o.jsx(Ve,{to:r,className:"min-w-0 flex-1 truncate font-medium hover:text-[var(--accent)]",children:e.title})]}),o.jsx("button",{type:"button",onClick:s=>{s.preventDefault(),s.stopPropagation(),n(`/?locate=T${e.number}`)},"aria-label":`Locate T${e.number} in work tree`,title:"Locate in work tree",className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-[8px] text-[var(--text-subtle)] transition-colors hover:bg-[var(--accent)] hover:text-white",children:o.jsx(Fj,{className:"h-4 w-4"})})]})})}function Y2({taskFocus:e}){const n=x.useMemo(()=>{const r=s=>{const u=new Set;return s.filter(c=>u.has(c.id)?!1:(u.add(c.id),!0))};return{active:r(e.active),pendingResume:r(e.pendingResume)}},[e.active,e.pendingResume]);return n.active.length===0?null:o.jsx("div",{className:"relative z-10 border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:o.jsx("div",{className:"page-container grid gap-3 py-2.5",children:n.active.length>0?o.jsxs("section",{"aria-labelledby":"active-task-heading",className:"grid gap-1.5",children:[o.jsxs("h2",{id:"active-task-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Active tasks (",n.active.length,")"]}),n.active.map(r=>o.jsx(T0,{task:r},r.id))]}):null})})}function G2({project:e,taskFocus:n,serverInfo:r}){const s=gr(),[u,c]=x.useState("connecting");return x.useEffect(()=>{const f=h=>{var g;const p=(g=h.detail)==null?void 0:g.status;p&&c(p)};return window.addEventListener("agent-plan:ws-status",f),()=>window.removeEventListener("agent-plan:ws-status",f)},[]),o.jsxs("div",{className:"page-shell",children:[o.jsxs("header",{className:"sticky top-0 z-30 overflow-visible",children:[o.jsx(B2,{projectName:e==null?void 0:e.name,projectRoot:e==null?void 0:e.projectRoot,planRoot:e==null?void 0:e.planRoot,liveStatus:u}),o.jsx(Y2,{taskFocus:n})]}),o.jsxs("div",{className:"page-container py-8",children:[o.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),o.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:o.jsx(Ve,{to:"/",className:"hover:text-[var(--accent)]",children:(e==null?void 0:e.name)??"Agent Plan"})}),e!=null&&e.projectRoot?o.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:e.projectRoot,children:e.projectRoot}):null,r?o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[o.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-semibold uppercase tracking-[0.12em] ${r.mode==="lan"?"bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] text-[var(--accent)]":"bg-[var(--surface-elevated)] text-[var(--text-muted)]"}`,children:[o.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full bg-current"}),r.mode==="lan"?"LAN visible":"Local only"]}),o.jsx("a",{href:r.localUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:r.localUrl}),r.lanUrl?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),o.jsx("a",{href:r.lanUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:r.lanUrl})]}):null]}):null,e!=null&&e.description?o.jsx(ga,{text:e.description,className:"mt-2 max-w-3xl"}):null]}),s.state!=="idle"?o.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),o.jsx(Ei,{})]})]})}const Rn=32,C0=4,X2=Math.PI*1.2;function A0(){if(typeof document>"u")return"#7b68ee";const e=document.createElement("div");e.style.color="var(--accent, #7b68ee)",document.body.appendChild(e);const n=getComputedStyle(e).color||"#7b68ee";return e.remove(),n}function Q2(){const e=document.createElement("canvas");e.width=Rn,e.height=Rn;const n=e.getContext("2d");if(!n)return"";const r=A0();return n.beginPath(),n.arc(Rn/2,Rn/2,Rn/2-C0,0,Math.PI*2),n.fillStyle=r,n.fill(),n.fillStyle="#ffffff",n.font="bold 16px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle",n.fillText("A",Rn/2,Rn/2+1),e.toDataURL("image/png")}function K2(e,n){const r=e.getContext("2d");if(!r)return"";const s=A0();r.clearRect(0,0,Rn,Rn);const u=Rn/2,c=Rn/2,f=Rn/2-C0;return r.beginPath(),r.arc(u,c,f,0,Math.PI*2),r.fillStyle=s,r.globalAlpha=.85,r.fill(),r.globalAlpha=1,r.beginPath(),r.arc(u,c,f-3,n,n+X2),r.strokeStyle="#ffffff",r.lineWidth=3,r.lineCap="round",r.stroke(),r.fillStyle="#ffffff",r.font="bold 14px system-ui, sans-serif",r.textAlign="center",r.textBaseline="middle",r.fillText("A",u,c+1),e.toDataURL("image/png")}function Z2(){let e=document.querySelector("link[rel~='icon']");return e||(e=document.createElement("link"),e.rel="icon",e.type="image/png",document.head.appendChild(e)),e}function W2(e){const n=x.useRef(null),r=x.useRef(null),s=x.useRef(null),u=x.useRef(0);x.useEffect(()=>{if(n.current||(n.current=Z2()),s.current||(s.current=Q2()),!r.current){const h=document.createElement("canvas");h.width=Rn,h.height=Rn,r.current=h}const c=n.current;if(!e){c.href=s.current;return}const f=window.setInterval(()=>{document.hidden||(u.current+=Math.PI/10,c.href=K2(r.current,u.current))},100);return()=>{window.clearInterval(f),c.href=s.current}},[e])}const Ao={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},D0=x.createContext(Ao);function O0(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function J2(e){return typeof e!="string"}function eR(e){return{create:(e==null?void 0:e.create)??Ao.create,edit:(e==null?void 0:e.edit)??Ao.edit,delete:(e==null?void 0:e.delete)??Ao.delete,submit:(e==null?void 0:e.submit)??Ao.submit}}function tR(e){const n=[],r=O0();e.primary&&n.push(r?"⌘":"Ctrl"),e.meta&&n.push(r?"⌘":"Meta"),e.ctrl&&n.push(r?"⌃":"Ctrl"),e.shift&&n.push(r?"⇧":"Shift"),e.alt&&n.push(r?"⌥":"Alt");const s=e.key==="Backspace"?r?"⌫":"Backspace":e.key==="Enter"?r?"↩":"Enter":e.key.length===1?e.key.toUpperCase():e.key;return n.push(s),r?n.join(""):n.join("+")}function aR(e){return e instanceof HTMLElement?!!e.closest("input, textarea, select, [contenteditable='true']"):!1}function nR(e,n){const r=n.key.length===1?n.key.toLowerCase():n.key,s=e.key.length===1?e.key.toLowerCase():e.key,u=O0(),c=n.meta??(n.primary?u:!1),f=n.ctrl??(n.primary?!u:!1);return s===r&&!!c===e.metaKey&&!!f===e.ctrlKey&&!!n.shift===e.shiftKey&&!!n.alt===e.altKey}function rR({shortcuts:e,children:n}){return x.createElement(D0.Provider,{value:eR(e)},n)}function M0(e){const n=x.useContext(D0);if(e)return J2(e)?e:n[e]}function Aa(e,n,r){const s=M0(e);x.useEffect(()=>{if(!s||(r==null?void 0:r.enabled)===!1)return;const u=c=>{!(r!=null&&r.allowInEditable)&&aR(c.target)||nR(c,s)&&(c.preventDefault(),n())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[n,r==null?void 0:r.allowInEditable,r==null?void 0:r.enabled,s])}const lR=1500,sR=80,iR=12e3,oR=5e3;function cR(){const{revalidate:e}=JE(),n=x.useRef(null),r=x.useRef(null),s=x.useRef(null),u=x.useRef(null),c=x.useRef(null);return x.useEffect(()=>{let f=!0;const h=Q=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:Q}}))},p=()=>{r.current!==null&&(window.clearTimeout(r.current),r.current=null)},g=()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},y=()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},v=()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},E=()=>{g(),s.current=window.setTimeout(()=>{e()},sR)},S=()=>{!f||r.current!==null||(h("reconnecting"),r.current=window.setTimeout(()=>{r.current=null,R()},lR))},w=()=>{v(),y();const Q=n.current;if(n.current=null,Q&&(Q.readyState===WebSocket.OPEN||Q.readyState===WebSocket.CONNECTING))try{Q.close()}catch{}},j=()=>{v(),y(),u.current=window.setInterval(()=>{const Q=n.current;if(!(!Q||Q.readyState!==WebSocket.OPEN)){try{Q.send(JSON.stringify({type:"ping"}))}catch{w(),S();return}y(),c.current=window.setTimeout(()=>{w(),S()},oR)}},iR)},R=()=>{if(!f)return;const Q=n.current;if(Q&&(Q.readyState===WebSocket.OPEN||Q.readyState===WebSocket.CONNECTING))return;h(r.current!==null?"reconnecting":"connecting"),p();const J=window.location.protocol==="https:"?"wss":"ws",ne=new WebSocket(`${J}://${window.location.host}/ws`);n.current=ne,ne.onopen=()=>{p(),h("live"),j()},ne.onmessage=M=>{y();try{const T=JSON.parse(M.data);if(!T.type||T.type==="pong"||T.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:T})),T.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":E();break;default:break}}catch{}},ne.onclose=()=>{v(),y(),n.current===ne&&(n.current=null),f&&S()},ne.onerror=()=>{try{ne.close()}catch{}}},z=()=>{const Q=n.current;(!Q||Q.readyState===WebSocket.CLOSED||Q.readyState===WebSocket.CLOSING)&&R()},I=()=>{document.visibilityState==="visible"&&z()},$=()=>{z()};return h("connecting"),R(),window.addEventListener("online",$),document.addEventListener("visibilitychange",I),()=>{f=!1,h("disconnected"),window.removeEventListener("online",$),document.removeEventListener("visibilitychange",I),p(),g(),v(),y(),w()}},[e]),null}async function uR(){const[e,n,r]=await Promise.all([Im(),x2(),M2()]);return{project:e,uiConfig:n,taskFocus:r}}function dR(){const{project:e,uiConfig:n,taskFocus:r}=Mr();return x.useEffect(()=>{var f,h;const s=(f=e==null?void 0:e.name)==null?void 0:f.trim(),u=(h=e==null?void 0:e.projectRoot)==null?void 0:h.trim(),c=u?u.split(/[/\\]/).filter(Boolean).pop():void 0;s?c&&c!==s?document.title=`${s} · ${c}`:document.title=`${s} · Agent Plan`:document.title="Agent Plan"},[e==null?void 0:e.name,e==null?void 0:e.projectRoot]),W2(r.active.length>0),o.jsxs(rR,{shortcuts:n.shortcuts,children:[o.jsx(cR,{}),o.jsx(l0,{getKey:s=>s.pathname}),o.jsx(G2,{project:e,taskFocus:r,serverInfo:n.server})]})}function fR(){const e=a0(),n=yi(e),r=n&&e.status===503,s=n?r?"Planner web UI disconnected":`Request failed (${e.status})`:"Planner web UI unavailable",u=n?e.data||e.statusText:e instanceof Error?e.message:"The planner web UI could not reach its local server.";return x.useEffect(()=>{document.title="Agent Plan"},[]),o.jsx("div",{className:"page-shell min-h-screen",children:o.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:o.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[o.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),o.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:s}),o.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(u)}),o.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:r?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),o.jsx("p",{children:"What to do:"}),o.jsxs("ul",{className:"grid gap-1 pl-5",children:[o.jsxs("li",{className:"list-disc",children:["restart Pi or run ",o.jsx("code",{children:"planner-web start"})]}),o.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),o.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),o.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),o.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:o.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex min-h-9 items-center whitespace-nowrap rounded-[12px] bg-[var(--accent)] px-3 py-1.5 text-sm font-semibold text-white transition hover:opacity-90 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2",children:"Reload page"})})]})})})}async function hR(){const[e,n,r]=await Promise.all([v0(),xd(),O2()]);return{features:e,phases:n,activeTasks:r}}function mR({shortcut:e}){const n=M0(e);return n?o.jsx("span",{className:"hidden rounded-md border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[11px] font-bold tracking-wide text-[var(--text-muted)] sm:inline-block",children:tR(n)}):null}const pR={primary:"border-transparent bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)]",secondary:"border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",ghost:"border-transparent bg-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",danger:"border-transparent bg-[var(--danger-soft)] text-[var(--color-status-blocked)] hover:bg-[color-mix(in_srgb,var(--danger-soft)_88%,black_12%)]"};function ot({variant:e="secondary",className:n="",children:r,shortcut:s,...u}){return o.jsxs("button",{className:`inline-flex min-h-9 items-center justify-center gap-1.5 whitespace-nowrap rounded-[12px] border px-3 py-1.5 text-sm font-semibold transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)] disabled:cursor-not-allowed disabled:opacity-60 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2 sm:gap-2 ${pR[e]} ${n}`,...u,children:[o.jsx("span",{className:"inline-flex items-center gap-1.5 sm:gap-2",children:r}),s?o.jsx(mR,{shortcut:s}):null]})}function Vt({className:e="",children:n,...r}){return o.jsx("div",{className:`surface-card p-6 ${e}`,...r,children:n})}function Eu({title:e,items:n}){return n.length===0?null:o.jsxs("section",{children:[o.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:e}),o.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:n.map(r=>o.jsx("li",{className:"list-disc",children:r},r))})]})}function gR({decisions:e}){return e.length===0?null:o.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[o.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",e.length,")"]}),o.jsx("div",{className:"mt-4 grid gap-3",children:e.map(n=>o.jsxs("article",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[o.jsx("h3",{className:"text-sm font-semibold text-[var(--text)]",children:n.title}),n.decision?o.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",o.jsx(ga,{text:n.decision})]}):null,n.rationale?o.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",o.jsx(ga,{text:n.rationale})]}):null,n.implementationNotes?o.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",o.jsx(ga,{text:n.implementationNotes})]}):null]},n.id))})]})}function xR({project:e}){const n=e.projectGuidelines.content.trim(),r=e.workflowRules.beforePhaseStart.length+e.workflowRules.beforeTaskStart.length+e.workflowRules.afterPhaseComplete.length,s=e.globalRules.length+r+e.decisions.length;return e.scope.length>0||e.outOfScope.length>0||e.technologies.length>0||e.tools.length>0||n.length>0||e.acceptedDecisions.length>0||s>0?o.jsx(Vt,{className:"grid gap-4",children:o.jsxs("details",{className:"group",children:[o.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"Project Context"}),o.jsxs("div",{className:"mt-4 grid gap-4",children:[o.jsx(Eu,{title:"In scope",items:e.scope}),o.jsx(Eu,{title:"Out of scope",items:e.outOfScope}),e.technologies.length>0||e.tools.length>0?o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(Eu,{title:"Technologies",items:e.technologies}),o.jsx(Eu,{title:"Tools",items:e.tools})]}):null,n?o.jsxs("section",{children:[o.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Project Guidelines"}),o.jsx("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:o.jsx(ga,{text:n})})]}):null,o.jsx(gR,{decisions:e.acceptedDecisions}),s>0?o.jsxs("aside",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]","aria-label":"Legacy project context",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Legacy project context remains."})," ",s," legacy rule or decision ",s===1?"entry will":"entries will"," migrate automatically on the next explicit planner load."]}):null]})]})}):null}function za({className:e="",children:n,...r}){return o.jsx("div",{className:`surface-card p-4 ${e}`,...r,children:n})}function gm(...e){return e.filter(Boolean).join(" ")}function Ym({items:e,className:n}){const r=e.filter(s=>s.visible!==!1);return r.length===0?null:o.jsx("div",{className:gm("grid gap-4 md:grid-cols-2 xl:grid-cols-4",n),children:r.map(s=>o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:s.label}),o.jsx("div",{className:gm("mt-2 text-sm font-semibold break-words text-[var(--text)] [overflow-wrap:anywhere]",s.valueClassName),children:s.value})]},s.label))})}function bd(e){return e&&e>0?`P${e}`:""}function nc({priority:e,className:n}){const r=bd(e);if(!r)return null;const s=`Priority ${e}`;return o.jsx("span",{className:gm("inline-flex items-center rounded-full border border-[var(--border)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-[var(--text-muted)]",n),"aria-label":s,title:s,children:r})}function vR(e,n){return!e&&!n?"":`${e||"Start not set"} → ${n||"End not set"}`}function yR(e){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}function bR({features:e,phases:n}){const r=x.useMemo(()=>{const s=new Map(e.map(u=>[u.id,u.name]));return n.flatMap(u=>u.tasks.filter(c=>c.status==="done").map(c=>({task:c,phase:u,feature:e.find(f=>f.id===u.featureId),featureName:u.featureId?s.get(u.featureId)??u.featureId:"Unlinked feature",completedAt:c.completedAt||c.updatedAt}))).sort((u,c)=>c.completedAt.localeCompare(u.completedAt)).slice(0,3)},[e,n]);return o.jsxs(Vt,{className:"grid gap-4",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),o.jsx("div",{className:"grid gap-3",children:r.length>0?r.map(({task:s,phase:u,feature:c,featureName:f,completedAt:h})=>o.jsxs("div",{className:"surface-card grid min-w-0 grid-cols-1 gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(E0,{featureNum:c==null?void 0:c.number,phaseNum:u.number,taskNum:s.number,featureId:c==null?void 0:c.id,phaseId:u.id,taskId:s.id,shortId:s.shortId,featureName:c==null?void 0:c.name,phaseName:u.title,taskTitle:s.title}),o.jsx(nc,{priority:s.priority}),o.jsx("span",{className:"ml-auto shrink-0",children:o.jsx(ar,{status:s.status})})]}),o.jsx(Ve,{to:u.featureId?`/features/${u.featureId}/phases/${u.id}/tasks/${s.id}`:"/features",className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:s.title}),o.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[o.jsx(S0,{type:"phase",featureNum:c==null?void 0:c.number}),o.jsxs("span",{className:"min-w-0 truncate",children:[f," · ",u.title]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",yR(h)]})]},s.id)):o.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const Dy=1440*60*1e3;function wR(e){const n=Date.now()-new Date(e).getTime();if(n<0)return"just now";const r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);return s<60?`${s}m ago`:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}function SR({features:e,phases:n}){const[,r]=x.useState(0),s=Date.now(),u=x.useMemo(()=>{const c=new Map(e.map(f=>[f.id,f.name]));return n.flatMap(f=>f.tasks.map(h=>({task:h,phase:f,feature:e.find(p=>p.id===f.featureId),featureName:f.featureId?c.get(f.featureId)??f.featureId:"Unlinked feature",createdAt:h.createdAt}))).filter(f=>{const h=new Date(f.createdAt).getTime();return Number.isFinite(h)&&s-h<Dy&&s-h>=0&&f.task.status==="planned"&&!f.task.startedAt}).sort((f,h)=>h.createdAt.localeCompare(f.createdAt)).slice(0,10)},[e,n,s]);return x.useEffect(()=>{if(u.length===0)return;const c=u.reduce((h,p)=>{const g=new Date(p.createdAt).getTime()+Dy-Date.now();return Math.min(h,g)},1/0);if(!Number.isFinite(c)||c<=0)return;const f=window.setTimeout(()=>r(h=>h+1),c+50);return()=>window.clearTimeout(f)},[u]),u.length===0?null:o.jsxs(Vt,{className:"grid gap-4",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"New Added Tasks"}),o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Tasks created in the last 24 hours."})]}),o.jsx("div",{className:"grid gap-3",children:u.map(({task:c,phase:f,feature:h,featureName:p,createdAt:g})=>o.jsxs("div",{className:"surface-card grid min-w-0 grid-cols-1 gap-1 border-[color:color-mix(in_srgb,var(--color-status-done)_0%,transparent)] px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(E0,{featureNum:h==null?void 0:h.number,phaseNum:f.number,taskNum:c.number,featureId:h==null?void 0:h.id,phaseId:f.id,taskId:c.id,shortId:c.shortId,featureName:h==null?void 0:h.name,phaseName:f.title,taskTitle:c.title}),o.jsx(nc,{priority:c.priority}),o.jsx("span",{className:"inline-flex items-center rounded-full bg-[color:color-mix(in_srgb,var(--accent)_18%,transparent)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-[var(--accent)]",children:"New"}),o.jsx("span",{className:"ml-auto shrink-0",children:o.jsx(ar,{status:c.status})})]}),o.jsx(Ve,{to:f.featureId?`/features/${f.featureId}/phases/${f.id}/tasks/${c.id}`:"/features",className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:c.title}),o.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[o.jsx(S0,{type:"phase",featureNum:h==null?void 0:h.number}),o.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",f.title]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",wR(g)]})]},c.id))})]})}const ER=new Set(["in-progress"]),NR=new Set(["planned","waiting","blocked","deferred"]),jR=new Set(["done","canceled","rejected"]);function _0(e){return e==="discovery"?"in-progress":e==="draft"?"planned":e}function RR(e){const n={planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0};for(const r of e)switch(r){case"planned":n.planned++;break;case"in-progress":n.inProgress++;break;case"waiting":n.waiting++;break;case"blocked":n.blocked++;break;case"deferred":n.deferred++;break;case"done":n.done++;break;case"canceled":n.canceled++;break;case"rejected":n.rejected++;break}return n}function kR(){return{planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function L0(e){const n=e,r=RR(n),s=n.length;if(s===0)return{displayStatus:"planned",breakdown:kR(),hasStarted:!1,totalChildren:0,meaningfulChildren:0};const u=n.filter(g=>g!=="canceled"&&g!=="rejected"),c=u.length,f=u.some(g=>g!=="planned");if(u.some(g=>ER.has(g)))return{displayStatus:"in-progress",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c};if(n.every(g=>jR.has(g)))return n.every(g=>g==="done")?{displayStatus:"done",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:n.every(g=>g==="canceled")?{displayStatus:"canceled",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:n.every(g=>g==="rejected")?{displayStatus:"rejected",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:{displayStatus:"closed",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c};const h=u.filter(g=>NR.has(g));return h.length>0&&h.every(g=>g==="waiting")?{displayStatus:"waiting",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:h.length>0&&h.every(g=>g==="blocked")?{displayStatus:"blocked",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:h.length>0&&h.every(g=>g==="deferred")?{displayStatus:"deferred",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:h.length>0&&h.every(g=>g==="planned")&&!f?{displayStatus:"planned",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}:{displayStatus:"started",breakdown:r,hasStarted:f,totalChildren:s,meaningfulChildren:c}}function Gm(e){const n=e.map(r=>_0(r.status));return L0(n)}function Xm(e){const n=e.map(r=>_0(r.status));return L0(n)}function z0(e){return Xm(e)}function U0(e){return Gm(e)}const Do={key:"priority",direction:"asc"},TR=4200;function CR(e){return e.reduce((n,r)=>n+r.tasks.length,0)}function AR(e){return e.reduce((n,r)=>n+r.tasks.filter(s=>s.status==="done").length,0)}function DR(e){return String(e&&e>0?e:0).padStart(3,"0")}const OR={draft:0,discovery:1,planned:2,waiting:3,blocked:4,deferred:5,"in-progress":7,done:8,canceled:9,rejected:10};function Oy(e,n){if(n==="title")return"name"in e?e.name:e.title;if(n==="status")return OR[e.status]??99;if(n==="startedAt"){if("startedAt"in e){const r=e.startedAt;return r?new Date(r).getTime():Number.MAX_SAFE_INTEGER}return Number.MAX_SAFE_INTEGER}if(n==="completedAt"){if("completedAt"in e){const r=e.completedAt;return r?new Date(r).getTime():Number.MAX_SAFE_INTEGER}return Number.MAX_SAFE_INTEGER}if(n==="shortId")return e.shortId??"";if(n==="priority"||n==="number")return e[n]??0;if(n==="createdAt"||n==="updatedAt"){const r=e[n];return r?new Date(r).getTime():0}return 0}function Mo(e,n,r,s){const u=Oy(e,r),c=Oy(n,r);let f;return typeof u=="number"&&typeof c=="number"?f=u-c:f=String(u).localeCompare(String(c)),f===0&&(f=(e.priority??0)-(n.priority??0)||e.number-n.number||e.createdAt.localeCompare(n.createdAt)),s==="desc"?-f:f}function MR(e,n,r=Do){const s=new Map;for(const u of n){if(!u.featureId)continue;const c=s.get(u.featureId)??[];c.push(u),s.set(u.featureId,c)}return e.map(u=>{const c=s.get(u.id)??[],f=c.reduce((y,v)=>y+v.tasks.length,0),h=c.reduce((y,v)=>y+v.tasks.filter(E=>E.status==="done").length,0),p=c.map(y=>{const v=[...y.tasks].sort((S,w)=>Mo(S,w,r.key,r.direction)),E=v.some(S=>S.status==="in-progress");return{phase:y,totalTasks:y.tasks.length,doneTasks:y.tasks.filter(S=>S.status==="done").length,allTasks:v,hasActiveTask:E,display:Gm(v)}}),g=p.some(({phase:y,allTasks:v})=>y.status==="in-progress"||y.status==="discovery"||v.some(E=>E.status==="in-progress"));return{feature:u,totalTasks:f,doneTasks:h,allPhases:p.sort((y,v)=>Mo(y.phase,v.phase,r.key,r.direction)),hasActiveTask:p.some(y=>y.hasActiveTask),isActive:g,display:Xm(p.map(y=>y.phase))}}).sort((u,c)=>Mo(u.feature,c.feature,r.key,r.direction))}function Nu({title:e,value:n,valueSuffix:r,subtitle:s,icon:u,valueClassName:c,iconClassName:f}){return o.jsxs(Vt,{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:e}),o.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[o.jsx("p",{className:`text-3xl font-black tracking-tight ${c??"text-[var(--text)]"}`,children:n}),r?o.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:r}):null]}),o.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:s})]}),o.jsx("div",{className:`surface-card flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] bg-[var(--accent-soft)] ${f??"text-[var(--accent)]"}`,children:u})]})}function My(e){return e>=80?"text-emerald-600 dark:text-emerald-400":e>=30?"text-amber-600 dark:text-amber-400":"text-rose-600 dark:text-rose-400"}function _R({features:e,phases:n}){const r=new Map;for(const v of n)v.featureId&&r.set(v.featureId,[...r.get(v.featureId)??[],v]);const s=e.filter(v=>{const E=r.get(v.id)??[];return Xm(E).displayStatus==="done"}).length,u=Math.max(e.length-s,0),c=n.filter(v=>Gm(v.tasks).displayStatus==="done").length,f=Math.max(n.length-c,0),h=CR(n),p=AR(n),g=Math.max(h-p,0),y=h>0?Math.round(p/h*100):0;return o.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[o.jsx(Nu,{title:"Features",value:String(e.length),valueSuffix:"total",subtitle:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[s," done"]}),o.jsx("span",{children:" · "}),o.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[u," left"]})]}),icon:o.jsx(Yu,{className:"h-4 w-4"})}),o.jsx(Nu,{title:"Phases",value:String(n.length),valueSuffix:"total",subtitle:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[c," done"]}),o.jsx("span",{children:" · "}),o.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[f," left"]})]}),icon:o.jsx(hj,{className:"h-4 w-4"})}),o.jsx(Nu,{title:"Tasks",value:String(h),valueSuffix:"total",subtitle:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[p," done"]}),o.jsx("span",{children:" · "}),o.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[g," left"]})]}),icon:o.jsx(Jo,{className:"h-4 w-4"})}),o.jsx(Nu,{title:"Completion",value:`${y}%`,subtitle:"Task completion rate",valueClassName:My(y),iconClassName:My(y),icon:o.jsx($m,{className:"h-4 w-4"})})]})}const LR=["done","canceled","rejected"],zR=["planned","in-progress","blocked","waiting","deferred"],UR=1440*60*1e3,$R=10;function _o(e){return LR.includes(e)}function Qu(e){return zR.includes(e)}const $0=[{label:"0-7d",minDays:0,maxDays:7},{label:"8-14d",minDays:8,maxDays:14},{label:"15-30d",minDays:15,maxDays:30},{label:"31-60d",minDays:31,maxDays:60},{label:"61+d",minDays:61,maxDays:null}];function BR(e){const n=[];for(const r of e)r.tasks&&n.push(...r.tasks);return n}function Hl(e){if(!e)return null;const n=Date.parse(e);return Number.isNaN(n)?null:new Date(n).toISOString().slice(0,$R)}function pi(e){return Date.parse(`${e}T00:00:00.000Z`)}function B0(e,n){const r=Date.parse(e.date),s=Date.parse(n.date);return r!==s&&!Number.isNaN(r)&&!Number.isNaN(s)?r-s:e.id<n.id?-1:e.id>n.id?1:0}function HR(e,n){const r=Hl(e.createdAt),s=pi(n),u=[...e.statusLog??[]].sort(B0);let c=null;for(const f of u){const h=_o(f.fromStatus);if(!_o(f.toStatus)&&h){const g=Hl(f.date);g&&pi(g)<=s&&(c=g)}}return c??r}function ju(e,n){return n>0?e/n:0}function IR(){return{deletedTasksNotRepresented:!0,legacyHistoryFallbackUsed:!1,notes:["Deleted tasks are absent from the current persisted planner files, so they never appear in any series, count, or backlog total."]}}function qR(){return $0.map(e=>({...e,count:0,taskIds:[]}))}function _y(e,n){const r=e.filter(c=>c.kind==="added").length,s=e.filter(c=>c.kind==="closed").length,u=e.filter(c=>c.kind==="reopened").length;return{addedTotal:r,closedTotal:s,reopenedTotal:u,netBacklog:r+u-s,activeDays:n,addRatePerActiveDay:ju(r,n),closeRatePerActiveDay:ju(s,n),reopenRatePerActiveDay:ju(u,n),closureRatio:ju(s,r)}}function H0(e){return{currentOpen:e.filter(n=>Qu(n.status)).length,currentTotal:e.length,currentDone:e.filter(n=>n.status==="done").length,currentCanceled:e.filter(n=>n.status==="canceled").length,currentRejected:e.filter(n=>n.status==="rejected").length}}function PR(e,n,r){const s={addedTotal:0,closedTotal:0,reopenedTotal:0,netBacklog:0,activeDays:0,addRatePerActiveDay:0,closeRatePerActiveDay:0,reopenRatePerActiveDay:0,closureRatio:0};return{windowDays:e,asOf:null,calendarRange:null,dailyPoints:[],cumulativePoints:[],agingBuckets:qR(),summary:{...s,...H0(n)},allTime:s,currentOpenIds:n.filter(u=>Qu(u.status)).map(u=>u.id).sort(),windowAddedIds:[],windowClosedIds:[],windowReopenedIds:[],limitations:r}}function FR(e,n={}){const r=n.windowDays??21,s=IR(),u=new Set(s.notes),c=ee=>{u.add(ee),s.legacyHistoryFallbackUsed=!0},f=[];for(const ee of e){const L=Hl(ee.createdAt);L&&f.push({day:L,kind:"added",taskId:ee.id});const F=[...ee.statusLog??[]].sort(B0);let he=null;for(const se of F){const C=_o(se.fromStatus),B=_o(se.toStatus),K=Hl(se.date);K&&(B&&!C?f.push({day:K,kind:"closed",taskId:ee.id}):!B&&C&&f.push({day:K,kind:"reopened",taskId:ee.id}),he=B)}const P=_o(ee.status);if(P&&he!==!0){const se=Hl(ee.completedAt)??Hl(ee.updatedAt)??L;se&&f.push({day:se,kind:"closed",taskId:ee.id}),c("A terminal task's history does not record a closure; a close was inferred from completedAt/updatedAt/createdAt.")}else if(!P&&he===!0){const se=Hl(ee.updatedAt)??L;se&&f.push({day:se,kind:"reopened",taskId:ee.id}),c("A task whose history ends in a terminal status is currently open; a reopen was inferred from updatedAt/createdAt.")}}if(f.length===0)return s.notes=[...u],PR(r,e,s);const h=f.map(ee=>ee.day).reduce((ee,L)=>L>ee?L:ee),p=n.asOf&&Hl(n.asOf)||h,g=pi(p),y=f.filter(ee=>pi(ee.day)<=g),v=[...new Set(y.map(ee=>ee.day))].sort(),E=new Map;for(const ee of y){const L=E.get(ee.day)??{added:0,closed:0,reopened:0,addedIds:new Set,closedIds:new Set,reopenedIds:new Set};ee.kind==="added"?(L.added+=1,L.addedIds.add(ee.taskId)):ee.kind==="closed"?(L.closed+=1,L.closedIds.add(ee.taskId)):(L.reopened+=1,L.reopenedIds.add(ee.taskId)),E.set(ee.day,L)}const S=[];let w=0,j=0,R=0;for(const ee of v){const L=E.get(ee)??{added:0,closed:0,reopened:0,addedIds:new Set,closedIds:new Set,reopenedIds:new Set};w+=L.added,j+=L.closed,R+=L.reopened;const F=j-R,he=w+R-j;S.push({date:ee,added:L.added,closed:L.closed,reopened:L.reopened,netBacklog:he,cumulativeScope:w,cumulativeCompletion:F,addedTaskIds:[...L.addedIds].sort(),closedTaskIds:[...L.closedIds].sort(),reopenedTaskIds:[...L.reopenedIds].sort()})}const z=S.slice(Math.max(0,S.length-r)),I=new Set(z.map(ee=>ee.date)),$=y.filter(ee=>I.has(ee.day)),Q=z[0],J=z[z.length-1],ne=Q&&J?{start:Q.date,end:J.date}:null,M=$0.map(ee=>({...ee,count:0,taskIds:new Set}));for(const ee of e){if(!Qu(ee.status))continue;const L=HR(ee,p);if(!L||pi(L)>g)continue;const F=Math.max(0,Math.floor((g-pi(L))/UR)),he=M.find(P=>F>=P.minDays&&(P.maxDays===null||F<=P.maxDays));he&&(he.count+=1,he.taskIds.add(ee.id))}const T=M.map(ee=>({...ee,taskIds:[...ee.taskIds].sort()})),fe={..._y($,z.length),...H0(e)},pe=_y(y,v.length),we=e.filter(ee=>Qu(ee.status)).map(ee=>ee.id).sort(),re=[...new Set($.filter(ee=>ee.kind==="added").map(ee=>ee.taskId))].sort(),je=[...new Set($.filter(ee=>ee.kind==="closed").map(ee=>ee.taskId))].sort(),Te=[...new Set($.filter(ee=>ee.kind==="reopened").map(ee=>ee.taskId))].sort();return r>v.length&&u.add(`Requested ${r}-active-day window exceeds the ${v.length} active days available at or before asOf; the window was clamped to all available active days.`),s.notes=[...u],{windowDays:r,asOf:p,calendarRange:ne,dailyPoints:z,cumulativePoints:S,agingBuckets:T,summary:fe,allTime:pe,currentOpenIds:we,windowAddedIds:re,windowClosedIds:je,windowReopenedIds:Te,limitations:s}}const Ss=184,bi=16,Ku=16,Qm=30,pn=34;function I0(e){return 420}function q0(e,n,r){const s=r-pn-Ku;return n<=1?pn+s/2:pn+e/(n-1)*s}function qo(e,n){const r=Ss-bi-Qm;return bi+r-e/Math.max(n,1)*r}function P0(e){return e<=3?new Set(Array.from({length:e},(n,r)=>r)):new Set([0,Math.floor((e-1)/2),e-1])}function F0(e){return e.slice(5)}function Po({title:e,description:n,children:r}){return o.jsxs("article",{className:"min-w-0 max-w-full overflow-hidden [contain:inline-size] rounded-xl border border-[var(--border)] bg-[var(--surface-elevated)] p-3",children:[o.jsx("h3",{className:"text-sm font-bold text-[var(--text)]",children:e}),o.jsx("p",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:n}),o.jsx("div",{className:"mt-3",children:r})]})}function nl(e,n,r){return`${n} ${n===1?"task":"tasks"} ${e} on ${r}`}function VR({points:e,onSelect:n}){if(e.length===0)return o.jsx(Po,{title:"Added vs Closed",description:"Task-flow events by active UTC day.",children:o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No active-day flow data."})});const r=I0(e.length),s=Math.max(1,...e.flatMap(p=>[p.added,p.closed])),u=Ss-Qm,c=(r-pn-Ku)/Math.max(e.length,1),f=Math.max(1.5,Math.min(10,c*.28)),h=P0(e.length);return o.jsxs(Po,{title:"Added vs Closed",description:"Solid bars are additions; striped bars are closures. Reopens and net change are available in the data table.",children:[o.jsxs("div",{className:"flex items-center gap-4 text-xs font-semibold text-[var(--text-muted)]","aria-hidden":"true",children:[o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:"h-2.5 w-4 rounded-sm bg-[var(--accent)]"}),"Added (solid)"]}),o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:"h-2.5 w-4 rounded-sm border border-[var(--text-muted)] bg-[repeating-linear-gradient(135deg,var(--text-muted)_0_1px,transparent_1px_3px)]"}),"Closed (striped)"]})]}),o.jsx("div",{className:"mt-2 w-full min-w-0 max-w-full overflow-x-auto [contain:inline-size] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5","data-responsive-chart":"horizontal-scroll",children:o.jsxs("svg",{width:"100%",viewBox:`0 0 ${r} ${Ss}`,"data-coordinate-width":r,className:"block h-auto max-h-[184px] max-w-full",role:"img","aria-labelledby":"flow-chart-title flow-chart-desc",children:[o.jsx("title",{id:"flow-chart-title",children:"Added versus closed tasks by active UTC day"}),o.jsx("desc",{id:"flow-chart-desc",children:"Grouped bars use solid shapes for additions and striped shapes for closures. Exact values are provided in an accessible table."}),o.jsx("defs",{children:o.jsx("pattern",{id:"flow-closed-stripes",width:"4",height:"4",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:o.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"4",stroke:"currentColor",strokeWidth:"2"})})}),o.jsx("line",{x1:pn,y1:bi,x2:pn,y2:u,stroke:"var(--border-strong)"}),o.jsx("line",{x1:pn,y1:u,x2:r-Ku,y2:u,stroke:"var(--border-strong)"}),o.jsx("text",{x:pn-6,y:bi+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:s}),o.jsx("text",{x:pn-6,y:u+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:"0"}),e.map((p,g)=>{const y=pn+(g+.5)*c,v=qo(p.added,s),E=qo(p.closed,s);return o.jsxs("g",{children:[o.jsx("title",{children:`${p.date}: ${p.added} added, ${p.closed} closed, ${p.reopened} reopened, net backlog ${p.netBacklog}`}),n&&p.addedTaskIds.length>0?o.jsx("g",{role:"button",tabIndex:0,"aria-label":`Filter Work Tree to ${nl("added",p.addedTaskIds.length,p.date)}`,className:"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>n({key:`added:${p.date}`,label:nl("added",p.addedTaskIds.length,p.date),taskIds:p.addedTaskIds}),onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),n({key:`added:${p.date}`,label:nl("added",p.addedTaskIds.length,p.date),taskIds:p.addedTaskIds}))},children:o.jsx("rect",{x:y-f-1,y:v,width:f,height:Math.max(2,u-v),rx:"1.5",fill:"var(--accent)"})}):o.jsx("rect",{x:y-f-1,y:v,width:f,height:Math.max(0,u-v),rx:"1.5",fill:"var(--accent)"}),n&&p.closedTaskIds.length>0?o.jsx("g",{role:"button",tabIndex:0,"aria-label":`Filter Work Tree to ${nl("closed",p.closedTaskIds.length,p.date)}`,className:"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>n({key:`closed:${p.date}`,label:nl("closed",p.closedTaskIds.length,p.date),taskIds:p.closedTaskIds}),onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),n({key:`closed:${p.date}`,label:nl("closed",p.closedTaskIds.length,p.date),taskIds:p.closedTaskIds}))},children:o.jsx("rect",{x:y+1,y:E,width:f,height:Math.max(2,u-E),rx:"1.5",fill:"url(#flow-closed-stripes)",stroke:"var(--text-muted)",strokeWidth:"0.5"})}):o.jsx("rect",{x:y+1,y:E,width:f,height:Math.max(0,u-E),rx:"1.5",fill:"url(#flow-closed-stripes)",stroke:"var(--text-muted)",strokeWidth:"0.5"}),h.has(g)?o.jsx("text",{x:y,y:Ss-9,textAnchor:"middle",className:"fill-[var(--text-subtle)] text-[10px]",children:F0(p.date)}):null]},p.date)})]})}),o.jsxs("details",{className:"mt-2 min-w-0 max-w-full overflow-hidden [contain:inline-size] text-xs text-[var(--text-muted)]",children:[o.jsx("summary",{className:"cursor-pointer font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",children:"View exact flow data"}),o.jsx("div",{className:"mt-2 w-full min-w-0 max-w-full overflow-x-auto [contain:inline-size] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5",children:o.jsxs("table",{className:"w-full table-fixed border-collapse text-left",children:[o.jsx("caption",{className:"sr-only",children:"Exact added, closed, reopened, and net backlog values by active UTC day"}),o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-[var(--border)]",children:[o.jsx("th",{className:"px-2 py-1",children:"Date"}),o.jsx("th",{className:"px-2 py-1",children:"Added"}),o.jsx("th",{className:"px-2 py-1",children:"Closed"}),o.jsx("th",{className:"px-2 py-1",children:"Reopened"}),o.jsx("th",{className:"px-2 py-1",children:"Net backlog"})]})}),o.jsx("tbody",{children:e.map(p=>o.jsxs("tr",{className:"border-b border-[var(--border)] last:border-0",children:[o.jsx("th",{className:"px-2 py-1 font-mono font-medium",children:p.date}),o.jsx("td",{className:"px-2 py-1",children:n&&p.addedTaskIds.length>0?o.jsx("button",{type:"button",className:"font-bold underline decoration-dotted underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>n({key:`added:${p.date}`,label:nl("added",p.addedTaskIds.length,p.date),taskIds:p.addedTaskIds}),children:p.added}):p.added}),o.jsx("td",{className:"px-2 py-1",children:n&&p.closedTaskIds.length>0?o.jsx("button",{type:"button",className:"font-bold underline decoration-dotted underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>n({key:`closed:${p.date}`,label:nl("closed",p.closedTaskIds.length,p.date),taskIds:p.closedTaskIds}),children:p.closed}):p.closed}),o.jsx("td",{className:"px-2 py-1",children:n&&p.reopenedTaskIds.length>0?o.jsx("button",{type:"button",className:"font-bold underline decoration-dotted underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>n({key:`reopened:${p.date}`,label:nl("reopened",p.reopenedTaskIds.length,p.date),taskIds:p.reopenedTaskIds}),children:p.reopened}):p.reopened}),o.jsx("td",{className:"px-2 py-1",children:p.netBacklog})]},p.date))})]})})]})]})}function Ly(e,n,r,s){return e.map((u,c)=>`${c===0?"M":"L"} ${q0(c,e.length,n).toFixed(2)} ${qo(Math.max(0,r(u)),s).toFixed(2)}`).join(" ")}function YR({points:e}){if(e.length===0)return o.jsx(Po,{title:"Scope vs Completion",description:"Cumulative burn-up across the selected active days.",children:o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No cumulative flow data."})});const n=I0(e.length),r=Math.max(1,...e.flatMap(h=>[h.cumulativeScope,h.cumulativeCompletion])),s=Ss-Qm,u=P0(e.length),c=Ly(e,n,h=>h.cumulativeScope,r),f=Ly(e,n,h=>h.cumulativeCompletion,r);return o.jsxs(Po,{title:"Scope vs Completion",description:"The solid scope line and dashed completion line expose the open-backlog gap without relying on color.",children:[o.jsxs("div",{className:"flex items-center gap-4 text-xs font-semibold text-[var(--text-muted)]","aria-hidden":"true",children:[o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:"h-0.5 w-5 bg-[var(--accent)]"}),"Scope (solid)"]}),o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:"w-5 border-t-2 border-dashed border-[var(--color-status-done)]"}),"Completion (dashed)"]})]}),o.jsx("div",{className:"mt-2 w-full min-w-0 max-w-full overflow-x-auto [contain:inline-size] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5","data-responsive-chart":"horizontal-scroll",children:o.jsxs("svg",{width:"100%",viewBox:`0 0 ${n} ${Ss}`,"data-coordinate-width":n,className:"block h-auto max-h-[184px] max-w-full",role:"img","aria-labelledby":"burnup-chart-title burnup-chart-desc",children:[o.jsx("title",{id:"burnup-chart-title",children:"Cumulative scope versus completion"}),o.jsx("desc",{id:"burnup-chart-desc",children:"A solid scope line and dashed completion line show the cumulative open-backlog gap. Exact values are provided in an accessible table."}),o.jsx("line",{x1:pn,y1:bi,x2:pn,y2:s,stroke:"var(--border-strong)"}),o.jsx("line",{x1:pn,y1:s,x2:n-Ku,y2:s,stroke:"var(--border-strong)"}),o.jsx("text",{x:pn-6,y:bi+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:r}),o.jsx("text",{x:pn-6,y:s+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:"0"}),o.jsx("path",{d:c,fill:"none",stroke:"var(--accent)",strokeWidth:"2.5"}),o.jsx("path",{d:f,fill:"none",stroke:"var(--color-status-done)",strokeWidth:"2.5",strokeDasharray:"6 4"}),e.map((h,p)=>{const g=q0(p,e.length,n);return o.jsxs("g",{children:[o.jsx("title",{children:`${h.date}: cumulative scope ${h.cumulativeScope}, cumulative completion ${h.cumulativeCompletion}, open backlog ${h.netBacklog}`}),o.jsx("circle",{cx:g,cy:qo(h.cumulativeScope,r),r:"2.5",fill:"var(--accent)"}),o.jsx("rect",{x:g-2.5,y:qo(Math.max(0,h.cumulativeCompletion),r)-2.5,width:"5",height:"5",fill:"var(--color-status-done)"}),u.has(p)?o.jsx("text",{x:g,y:Ss-9,textAnchor:"middle",className:"fill-[var(--text-subtle)] text-[10px]",children:F0(h.date)}):null]},h.date)})]})}),o.jsx("div",{className:"sr-only",children:o.jsxs("table",{children:[o.jsx("caption",{children:"Exact cumulative scope, completion, and open backlog values by active UTC day"}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Date"}),o.jsx("th",{children:"Scope"}),o.jsx("th",{children:"Completion"}),o.jsx("th",{children:"Open backlog"})]})}),o.jsx("tbody",{children:e.map(h=>o.jsxs("tr",{children:[o.jsx("th",{children:h.date}),o.jsx("td",{children:h.cumulativeScope}),o.jsx("td",{children:h.cumulativeCompletion}),o.jsx("td",{children:h.netBacklog})]},h.date))})]})})]})}function GR({analytics:e,onSelect:n}){const r=Math.max(1,...e.agingBuckets.map(u=>u.count)),s=e.agingBuckets.reduce((u,c)=>u+c.count,0);return o.jsxs(Po,{title:"Open-task aging",description:"Whole UTC days since creation or the latest reopen.",children:[s===0?o.jsx("p",{className:"mb-3 text-sm text-[var(--text-muted)]",children:"No open tasks have an aging anchor at this cutoff."}):null,o.jsx("ul",{className:"grid gap-2","aria-label":"Open-task aging buckets",children:e.agingBuckets.map(u=>{const c=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:u.label}),o.jsx("span",{className:"h-3 overflow-hidden rounded-full border border-[var(--border)] bg-[var(--surface-card)]",children:o.jsx("span",{className:"block h-full rounded-full bg-[var(--accent)]",style:{width:`${u.count/r*100}%`}})}),o.jsx("span",{className:"text-right font-bold tabular-nums text-[var(--text)]","aria-label":`${u.count} tasks`,children:u.count})]});return o.jsx("li",{children:n&&u.taskIds.length>0?o.jsx("button",{type:"button",className:"grid w-full grid-cols-[3.75rem_minmax(0,1fr)_2rem] items-center gap-2 rounded-lg text-xs hover:bg-[var(--accent-soft)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]","aria-label":`Filter Work Tree to ${u.count} ${u.count===1?"task":"tasks"} aged ${u.label}`,onClick:()=>n({key:`aging:${u.label}`,label:`${u.count} ${u.count===1?"task":"tasks"} aged ${u.label}`,taskIds:u.taskIds}),children:c}):o.jsx("div",{className:"grid grid-cols-[3.75rem_minmax(0,1fr)_2rem] items-center gap-2 text-xs",children:c})},u.label)})}),o.jsx("div",{className:"sr-only",children:o.jsxs("table",{children:[o.jsx("caption",{children:"Exact open-task aging bucket counts"}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Age"}),o.jsx("th",{children:"Open tasks"})]})}),o.jsx("tbody",{children:e.agingBuckets.map(u=>o.jsxs("tr",{children:[o.jsx("th",{children:u.label}),o.jsx("td",{children:u.count})]},u.label))})]})})]})}function XR({analytics:e,onSelect:n}){const r=n?{onSelect:n}:{};return o.jsxs("div",{className:"grid min-w-0 max-w-full overflow-hidden gap-3 xl:grid-cols-2",children:[o.jsx(VR,{points:e.dailyPoints,...r}),o.jsx(YR,{points:e.dailyPoints}),o.jsx("div",{className:"min-w-0 xl:col-span-2",children:o.jsx(GR,{analytics:e,...r})})]})}const QR=[7,21,60];function KR(e){return e>0?`+${e}`:String(e)}function Ru(e){return e.toFixed(1)}function ZR(e){return`${(e*100).toFixed(0)}%`}function WR(e){const{netBacklog:n,activeDays:r}=e.summary;if(r===0)return"No task-flow activity is recorded for this period.";if(n>0)return`Backlog grew by ${n} ${n===1?"task":"tasks"} across the selected active days.`;if(n<0){const s=Math.abs(n);return`Backlog shrank by ${s} ${s===1?"task":"tasks"} across the selected active days.`}return"Backlog stayed level across the selected active days."}function JR({value:e}){return e>0?o.jsx(uj,{className:"h-4 w-4","aria-hidden":"true"}):e<0?o.jsx(nj,{className:"h-4 w-4","aria-hidden":"true"}):o.jsx(Xj,{className:"h-4 w-4","aria-hidden":"true"})}function vs({label:e,value:n,detail:r,valueClassName:s="text-[var(--text)]",onSelect:u,selected:c}){return o.jsxs("div",{className:`min-w-28 rounded-xl border bg-[var(--surface-elevated)] px-3 py-2.5 ${c?"border-[var(--accent)] ring-1 ring-[var(--accent)]":"border-[var(--border)]"}`,children:[o.jsx("dt",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:e}),o.jsx("dd",{className:`mt-1 text-xl font-black tracking-tight ${s}`,children:u?o.jsx("button",{type:"button","aria-pressed":c,"aria-label":`Filter Work Tree by ${e}`,onClick:u,className:"rounded-md underline decoration-dotted underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",children:n}):n}),r?o.jsx("p",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:r}):null]})}function ek({phases:e,asOf:n,activeDrilldown:r,onDrilldown:s,onClearDrilldown:u}){const[c,f]=x.useState(21),h=x.useMemo(()=>BR(e),[e]),p=n??new Date().toISOString().slice(0,10),g=x.useMemo(()=>FR(h,{windowDays:c,asOf:p}),[p,h,c]),y=g.summary.netBacklog>0?"text-rose-600 dark:text-rose-400":g.summary.netBacklog<0?"text-emerald-600 dark:text-emerald-400":"text-[var(--text)]",v=g.limitations.notes.join(" "),E=(S,w,j)=>s&&j.length>0?()=>s({key:S,label:w,taskIds:j}):null;return o.jsx(Vt,{className:"min-w-0 overflow-hidden [contain:inline-size]",children:o.jsxs("section",{"aria-labelledby":"flow-backlog-heading",className:"grid min-w-0 max-w-full gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(tj,{className:"h-4 w-4 text-[var(--accent)]","aria-hidden":"true"}),o.jsx("h2",{id:"flow-backlog-heading",className:"text-lg font-bold text-[var(--text)]",children:"Flow & Backlog"})]}),o.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]","aria-live":"polite",children:WR(g)})]}),o.jsx("div",{role:"group","aria-label":"Active-day period",className:"flex w-full min-w-0 items-center gap-1 overflow-x-auto [contain:inline-size] sm:w-auto sm:max-w-full sm:shrink-0 rounded-xl border border-[var(--border)] bg-[var(--surface-card)] p-1 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5",children:QR.map(S=>o.jsxs("button",{type:"button","aria-label":`${S} active days`,"aria-pressed":c===S,onClick:()=>f(S),className:`h-8 shrink-0 rounded-lg px-2.5 text-xs font-bold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--surface)] ${c===S?"bg-[var(--accent)] text-white":"text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`,children:[o.jsx("span",{children:S}),o.jsx("span",{className:"hidden sm:inline",children:" active days"})]},S))})]}),o.jsx("p",{className:"text-xs text-[var(--text-subtle)]",children:g.calendarRange?o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"UTC range "}),o.jsx("time",{dateTime:g.calendarRange.start,children:g.calendarRange.start}),o.jsx("span",{children:" – "}),o.jsx("time",{dateTime:g.calendarRange.end,children:g.calendarRange.end}),o.jsxs("span",{children:[" · ",g.summary.activeDays," active ",g.summary.activeDays===1?"day":"days"]})]}):"No UTC activity range is available."}),o.jsxs("dl",{className:"grid min-w-0 grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-8",children:[o.jsx(vs,{label:"Added",value:String(g.summary.addedTotal),detail:`${Ru(g.summary.addRatePerActiveDay)} / active day`,onSelect:E("window-added",`${g.windowAddedIds.length} ${g.windowAddedIds.length===1?"task":"tasks"} added in the selected window`,g.windowAddedIds),selected:(r==null?void 0:r.key)==="window-added"}),o.jsx(vs,{label:"Closed",value:String(g.summary.closedTotal),detail:`${Ru(g.summary.closeRatePerActiveDay)} / active day`,onSelect:E("window-closed",`${g.windowClosedIds.length} ${g.windowClosedIds.length===1?"task":"tasks"} closed in the selected window`,g.windowClosedIds),selected:(r==null?void 0:r.key)==="window-closed"}),g.summary.reopenedTotal>0?o.jsx(vs,{label:"Reopened",value:String(g.summary.reopenedTotal),onSelect:E("window-reopened",`${g.windowReopenedIds.length} ${g.windowReopenedIds.length===1?"task":"tasks"} reopened in the selected window`,g.windowReopenedIds),selected:(r==null?void 0:r.key)==="window-reopened"}):null,o.jsxs("div",{className:"min-w-28 rounded-xl border border-[var(--border)] bg-[var(--surface-elevated)] px-3 py-2.5",children:[o.jsx("dt",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Net change"}),o.jsxs("dd",{className:`mt-1 flex items-center gap-1 text-xl font-black tracking-tight ${y}`,children:[o.jsx(JR,{value:g.summary.netBacklog}),KR(g.summary.netBacklog)]})]}),o.jsx(vs,{label:"Open now",value:String(g.summary.currentOpen),detail:`${g.summary.currentTotal} total`,onSelect:E("current-open",`${g.currentOpenIds.length} currently open ${g.currentOpenIds.length===1?"task":"tasks"}`,g.currentOpenIds),selected:(r==null?void 0:r.key)==="current-open"}),o.jsx(vs,{label:"Add rate",value:Ru(g.summary.addRatePerActiveDay),detail:"per active day",onSelect:null,selected:!1}),o.jsx(vs,{label:"Close rate",value:Ru(g.summary.closeRatePerActiveDay),detail:"per active day",onSelect:null,selected:!1}),o.jsx(vs,{label:"Closure ratio",value:ZR(g.summary.closureRatio),detail:"closed / added",onSelect:null,selected:!1})]}),o.jsx(XR,{analytics:g,...s?{onSelect:s}:{}}),r?o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-xl border border-[var(--accent)] bg-[var(--accent-soft)] px-3 py-2 text-sm",role:"status",children:[o.jsxs("span",{className:"font-semibold text-[var(--text)]",children:["Work Tree filter: ",r.label]}),u?o.jsx("button",{type:"button",onClick:u,className:"rounded-lg px-2 py-1 text-xs font-bold text-[var(--accent)] underline decoration-dotted underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",children:"Clear analytics filter"}):null]}):null,o.jsx("p",{className:"text-xs text-[var(--text-subtle)]",title:v,children:"Current planner files exclude deleted tasks; legacy gaps are inferred from available timestamps."})]})})}function tk(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return x.useMemo(()=>s=>{n.forEach(u=>u(s))},n)}const wd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ni(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function Km(e){return"nodeType"in e}function gn(e){var n,r;return e?Ni(e)?e:Km(e)&&(n=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?n:window:window}function Zm(e){const{Document:n}=gn(e);return e instanceof n}function rc(e){return Ni(e)?!1:e instanceof gn(e).HTMLElement}function V0(e){return e instanceof gn(e).SVGElement}function ji(e){return e?Ni(e)?e.document:Km(e)?Zm(e)?e:rc(e)||V0(e)?e.ownerDocument:document:document:document}const mr=wd?x.useLayoutEffect:x.useEffect;function Sd(e){const n=x.useRef(e);return mr(()=>{n.current=e}),x.useCallback(function(){for(var r=arguments.length,s=new Array(r),u=0;u<r;u++)s[u]=arguments[u];return n.current==null?void 0:n.current(...s)},[])}function ak(){const e=x.useRef(null),n=x.useCallback((s,u)=>{e.current=setInterval(s,u)},[]),r=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,r]}function Fo(e,n){n===void 0&&(n=[e]);const r=x.useRef(e);return mr(()=>{r.current!==e&&(r.current=e)},n),r}function lc(e,n){const r=x.useRef();return x.useMemo(()=>{const s=e(r.current);return r.current=s,s},[...n])}function Zu(e){const n=Sd(e),r=x.useRef(null),s=x.useCallback(u=>{u!==r.current&&(n==null||n(u,r.current)),r.current=u},[]);return[r,s]}function Wu(e){const n=x.useRef();return x.useEffect(()=>{n.current=e},[e]),n.current}let qh={};function sc(e,n){return x.useMemo(()=>{if(n)return n;const r=qh[e]==null?0:qh[e]+1;return qh[e]=r,e+"-"+r},[e,n])}function Y0(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),u=1;u<r;u++)s[u-1]=arguments[u];return s.reduce((c,f)=>{const h=Object.entries(f);for(const[p,g]of h){const y=c[p];y!=null&&(c[p]=y+e*g)}return c},{...n})}}const vi=Y0(1),Ju=Y0(-1);function nk(e){return"clientX"in e&&"clientY"in e}function Ed(e){if(!e)return!1;const{KeyboardEvent:n}=gn(e.target);return n&&e instanceof n}function rk(e){if(!e)return!1;const{TouchEvent:n}=gn(e.target);return n&&e instanceof n}function ed(e){if(rk(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:r}=e.touches[0];return{x:n,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:r}=e.changedTouches[0];return{x:n,y:r}}}return nk(e)?{x:e.clientX,y:e.clientY}:null}const Gl=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:r}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:r}=e;return"scaleX("+n+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Gl.Translate.toString(e),Gl.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:r,easing:s}=e;return n+" "+r+"ms "+s}}}),zy="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lk(e){return e.matches(zy)?e:e.querySelector(zy)}const sk={display:"none"};function ik(e){let{id:n,value:r}=e;return ua.createElement("div",{id:n,style:sk},r)}function ok(e){let{id:n,announcement:r,ariaLiveType:s="assertive"}=e;const u={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ua.createElement("div",{id:n,style:u,role:"status","aria-live":s,"aria-atomic":!0},r)}function ck(){const[e,n]=x.useState("");return{announce:x.useCallback(s=>{s!=null&&n(s)},[]),announcement:e}}const G0=x.createContext(null);function uk(e){const n=x.useContext(G0);x.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function dk(){const[e]=x.useState(()=>new Set),n=x.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[x.useCallback(s=>{let{type:u,event:c}=s;e.forEach(f=>{var h;return(h=f[u])==null?void 0:h.call(f,c)})},[e]),n]}const fk={draggable:`
309
- To pick up a draggable item, press the space bar.
310
- While dragging, use the arrow keys to move the item.
311
- Press space again to drop the item in its new position, or press escape to cancel.
312
- `},hk={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:r}=e;return r?"Draggable item "+n.id+" was moved over droppable area "+r.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:r}=e;return r?"Draggable item "+n.id+" was dropped over droppable area "+r.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function mk(e){let{announcements:n=hk,container:r,hiddenTextDescribedById:s,screenReaderInstructions:u=fk}=e;const{announce:c,announcement:f}=ck(),h=sc("DndLiveRegion"),[p,g]=x.useState(!1);if(x.useEffect(()=>{g(!0)},[]),uk(x.useMemo(()=>({onDragStart(v){let{active:E}=v;c(n.onDragStart({active:E}))},onDragMove(v){let{active:E,over:S}=v;n.onDragMove&&c(n.onDragMove({active:E,over:S}))},onDragOver(v){let{active:E,over:S}=v;c(n.onDragOver({active:E,over:S}))},onDragEnd(v){let{active:E,over:S}=v;c(n.onDragEnd({active:E,over:S}))},onDragCancel(v){let{active:E,over:S}=v;c(n.onDragCancel({active:E,over:S}))}}),[c,n])),!p)return null;const y=ua.createElement(ua.Fragment,null,ua.createElement(ik,{id:s,value:u.draggable}),ua.createElement(ok,{id:h,announcement:f}));return r?sl.createPortal(y,r):y}var Ua;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Ua||(Ua={}));function td(){}function pk(e,n){return x.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function gk(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return x.useMemo(()=>[...n].filter(s=>s!=null),[...n])}const pr=Object.freeze({x:0,y:0});function xk(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function vk(e,n){const r=ed(e);if(!r)return"0 0";const s={x:(r.x-n.left)/n.width*100,y:(r.y-n.top)/n.height*100};return s.x+"% "+s.y+"%"}function yk(e,n){let{data:{value:r}}=e,{data:{value:s}}=n;return r-s}function bk(e,n){let{data:{value:r}}=e,{data:{value:s}}=n;return s-r}function wk(e,n){if(!e||e.length===0)return null;const[r]=e;return r[n]}function Uy(e,n,r){return n===void 0&&(n=e.left),r===void 0&&(r=e.top),{x:n+e.width*.5,y:r+e.height*.5}}const Sk=e=>{let{collisionRect:n,droppableRects:r,droppableContainers:s}=e;const u=Uy(n,n.left,n.top),c=[];for(const f of s){const{id:h}=f,p=r.get(h);if(p){const g=xk(Uy(p),u);c.push({id:h,data:{droppableContainer:f,value:g}})}}return c.sort(yk)};function Ek(e,n){const r=Math.max(n.top,e.top),s=Math.max(n.left,e.left),u=Math.min(n.left+n.width,e.left+e.width),c=Math.min(n.top+n.height,e.top+e.height),f=u-s,h=c-r;if(s<u&&r<c){const p=n.width*n.height,g=e.width*e.height,y=f*h,v=y/(p+g-y);return Number(v.toFixed(4))}return 0}const Nk=e=>{let{collisionRect:n,droppableRects:r,droppableContainers:s}=e;const u=[];for(const c of s){const{id:f}=c,h=r.get(f);if(h){const p=Ek(h,n);p>0&&u.push({id:f,data:{droppableContainer:c,value:p}})}}return u.sort(bk)};function jk(e,n,r){return{...e,scaleX:n&&r?n.width/r.width:1,scaleY:n&&r?n.height/r.height:1}}function X0(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:pr}function Rk(e){return function(r){for(var s=arguments.length,u=new Array(s>1?s-1:0),c=1;c<s;c++)u[c-1]=arguments[c];return u.reduce((f,h)=>({...f,top:f.top+e*h.y,bottom:f.bottom+e*h.y,left:f.left+e*h.x,right:f.right+e*h.x}),{...r})}}const kk=Rk(1);function Q0(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function Tk(e,n,r){const s=Q0(n);if(!s)return e;const{scaleX:u,scaleY:c,x:f,y:h}=s,p=e.left-f-(1-u)*parseFloat(r),g=e.top-h-(1-c)*parseFloat(r.slice(r.indexOf(" ")+1)),y=u?e.width/u:e.width,v=c?e.height/c:e.height;return{width:y,height:v,top:g,right:p+y,bottom:g+v,left:p}}const Ck={ignoreTransform:!1};function Ri(e,n){n===void 0&&(n=Ck);let r=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:g,transformOrigin:y}=gn(e).getComputedStyle(e);g&&(r=Tk(r,g,y))}const{top:s,left:u,width:c,height:f,bottom:h,right:p}=r;return{top:s,left:u,width:c,height:f,bottom:h,right:p}}function $y(e){return Ri(e,{ignoreTransform:!0})}function Ak(e){const n=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function Dk(e,n){return n===void 0&&(n=gn(e).getComputedStyle(e)),n.position==="fixed"}function Ok(e,n){n===void 0&&(n=gn(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const c=n[u];return typeof c=="string"?r.test(c):!1})}function Wm(e,n){const r=[];function s(u){if(n!=null&&r.length>=n||!u)return r;if(Zm(u)&&u.scrollingElement!=null&&!r.includes(u.scrollingElement))return r.push(u.scrollingElement),r;if(!rc(u)||V0(u)||r.includes(u))return r;const c=gn(e).getComputedStyle(u);return u!==e&&Ok(u,c)&&r.push(u),Dk(u,c)?r:s(u.parentNode)}return e?s(e):r}function K0(e){const[n]=Wm(e,1);return n??null}function Ph(e){return!wd||!e?null:Ni(e)?e:Km(e)?Zm(e)||e===ji(e).scrollingElement?window:rc(e)?e:null:null}function Z0(e){return Ni(e)?e.scrollX:e.scrollLeft}function W0(e){return Ni(e)?e.scrollY:e.scrollTop}function xm(e){return{x:Z0(e),y:W0(e)}}var qa;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(qa||(qa={}));function J0(e){return!wd||!e?!1:e===document.scrollingElement}function e1(e){const n={x:0,y:0},r=J0(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},u=e.scrollTop<=n.y,c=e.scrollLeft<=n.x,f=e.scrollTop>=s.y,h=e.scrollLeft>=s.x;return{isTop:u,isLeft:c,isBottom:f,isRight:h,maxScroll:s,minScroll:n}}const Mk={x:.2,y:.2};function _k(e,n,r,s,u){let{top:c,left:f,right:h,bottom:p}=r;s===void 0&&(s=10),u===void 0&&(u=Mk);const{isTop:g,isBottom:y,isLeft:v,isRight:E}=e1(e),S={x:0,y:0},w={x:0,y:0},j={height:n.height*u.y,width:n.width*u.x};return!g&&c<=n.top+j.height?(S.y=qa.Backward,w.y=s*Math.abs((n.top+j.height-c)/j.height)):!y&&p>=n.bottom-j.height&&(S.y=qa.Forward,w.y=s*Math.abs((n.bottom-j.height-p)/j.height)),!E&&h>=n.right-j.width?(S.x=qa.Forward,w.x=s*Math.abs((n.right-j.width-h)/j.width)):!v&&f<=n.left+j.width&&(S.x=qa.Backward,w.x=s*Math.abs((n.left+j.width-f)/j.width)),{direction:S,speed:w}}function Lk(e){if(e===document.scrollingElement){const{innerWidth:c,innerHeight:f}=window;return{top:0,left:0,right:c,bottom:f,width:c,height:f}}const{top:n,left:r,right:s,bottom:u}=e.getBoundingClientRect();return{top:n,left:r,right:s,bottom:u,width:e.clientWidth,height:e.clientHeight}}function t1(e){return e.reduce((n,r)=>vi(n,xm(r)),pr)}function zk(e){return e.reduce((n,r)=>n+Z0(r),0)}function Uk(e){return e.reduce((n,r)=>n+W0(r),0)}function a1(e,n){if(n===void 0&&(n=Ri),!e)return;const{top:r,left:s,bottom:u,right:c}=n(e);K0(e)&&(u<=0||c<=0||r>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $k=[["x",["left","right"],zk],["y",["top","bottom"],Uk]];class Jm{constructor(n,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Wm(r),u=t1(s);this.rect={...n},this.width=n.width,this.height=n.height;for(const[c,f,h]of $k)for(const p of f)Object.defineProperty(this,p,{get:()=>{const g=h(s),y=u[c]-g;return this.rect[p]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Lo{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...r)})},this.target=n}add(n,r,s){var u;(u=this.target)==null||u.addEventListener(n,r,s),this.listeners.push([n,r,s])}}function Bk(e){const{EventTarget:n}=gn(e);return e instanceof n?e:ji(e)}function Fh(e,n){const r=Math.abs(e.x),s=Math.abs(e.y);return typeof n=="number"?Math.sqrt(r**2+s**2)>n:"x"in n&&"y"in n?r>n.x&&s>n.y:"x"in n?r>n.x:"y"in n?s>n.y:!1}var tr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(tr||(tr={}));function By(e){e.preventDefault()}function Hk(e){e.stopPropagation()}var _t;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_t||(_t={}));const n1={start:[_t.Space,_t.Enter],cancel:[_t.Esc],end:[_t.Space,_t.Enter,_t.Tab]},Ik=(e,n)=>{let{currentCoordinates:r}=n;switch(e.code){case _t.Right:return{...r,x:r.x+25};case _t.Left:return{...r,x:r.x-25};case _t.Down:return{...r,y:r.y+25};case _t.Up:return{...r,y:r.y-25}}};class r1{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:r}}=n;this.props=n,this.listeners=new Lo(ji(r)),this.windowListeners=new Lo(gn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(tr.Resize,this.handleCancel),this.windowListeners.add(tr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(tr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:r}=this.props,s=n.node.current;s&&a1(s),r(pr)}handleKeyDown(n){if(Ed(n)){const{active:r,context:s,options:u}=this.props,{keyboardCodes:c=n1,coordinateGetter:f=Ik,scrollBehavior:h="smooth"}=u,{code:p}=n;if(c.end.includes(p)){this.handleEnd(n);return}if(c.cancel.includes(p)){this.handleCancel(n);return}const{collisionRect:g}=s.current,y=g?{x:g.left,y:g.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=y);const v=f(n,{active:r,context:s.current,currentCoordinates:y});if(v){const E=Ju(v,y),S={x:0,y:0},{scrollableAncestors:w}=s.current;for(const j of w){const R=n.code,{isTop:z,isRight:I,isLeft:$,isBottom:Q,maxScroll:J,minScroll:ne}=e1(j),M=Lk(j),T={x:Math.min(R===_t.Right?M.right-M.width/2:M.right,Math.max(R===_t.Right?M.left:M.left+M.width/2,v.x)),y:Math.min(R===_t.Down?M.bottom-M.height/2:M.bottom,Math.max(R===_t.Down?M.top:M.top+M.height/2,v.y))},fe=R===_t.Right&&!I||R===_t.Left&&!$,pe=R===_t.Down&&!Q||R===_t.Up&&!z;if(fe&&T.x!==v.x){const we=j.scrollLeft+E.x,re=R===_t.Right&&we<=J.x||R===_t.Left&&we>=ne.x;if(re&&!E.y){j.scrollTo({left:we,behavior:h});return}re?S.x=j.scrollLeft-we:S.x=R===_t.Right?j.scrollLeft-J.x:j.scrollLeft-ne.x,S.x&&j.scrollBy({left:-S.x,behavior:h});break}else if(pe&&T.y!==v.y){const we=j.scrollTop+E.y,re=R===_t.Down&&we<=J.y||R===_t.Up&&we>=ne.y;if(re&&!E.x){j.scrollTo({top:we,behavior:h});return}re?S.y=j.scrollTop-we:S.y=R===_t.Down?j.scrollTop-J.y:j.scrollTop-ne.y,S.y&&j.scrollBy({top:-S.y,behavior:h});break}}this.handleMove(n,vi(Ju(v,this.referenceCoordinates),S))}}}handleMove(n,r){const{onMove:s}=this.props;n.preventDefault(),s(r)}handleEnd(n){const{onEnd:r}=this.props;n.preventDefault(),this.detach(),r()}handleCancel(n){const{onCancel:r}=this.props;n.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}r1.activators=[{eventName:"onKeyDown",handler:(e,n,r)=>{let{keyboardCodes:s=n1,onActivation:u}=n,{active:c}=r;const{code:f}=e.nativeEvent;if(s.start.includes(f)){const h=c.activatorNode.current;return h&&e.target!==h?!1:(e.preventDefault(),u==null||u({event:e.nativeEvent}),!0)}return!1}}];function Hy(e){return!!(e&&"distance"in e)}function Iy(e){return!!(e&&"delay"in e)}class ep{constructor(n,r,s){var u;s===void 0&&(s=Bk(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=r;const{event:c}=n,{target:f}=c;this.props=n,this.events=r,this.document=ji(f),this.documentListeners=new Lo(this.document),this.listeners=new Lo(s),this.windowListeners=new Lo(gn(f)),this.initialCoordinates=(u=ed(c))!=null?u:pr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:r,bypassActivationConstraint:s}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(tr.Resize,this.handleCancel),this.windowListeners.add(tr.DragStart,By),this.windowListeners.add(tr.VisibilityChange,this.handleCancel),this.windowListeners.add(tr.ContextMenu,By),this.documentListeners.add(tr.Keydown,this.handleKeydown),r){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Iy(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Hy(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,r){const{active:s,onPending:u}=this.props;u(s,n,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:n}=this,{onStart:r}=this.props;n&&(this.activated=!0,this.documentListeners.add(tr.Click,Hk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(tr.SelectionChange,this.removeTextSelection),r(n))}handleMove(n){var r;const{activated:s,initialCoordinates:u,props:c}=this,{onMove:f,options:{activationConstraint:h}}=c;if(!u)return;const p=(r=ed(n))!=null?r:pr,g=Ju(u,p);if(!s&&h){if(Hy(h)){if(h.tolerance!=null&&Fh(g,h.tolerance))return this.handleCancel();if(Fh(g,h.distance))return this.handleStart()}if(Iy(h)&&Fh(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}n.cancelable&&n.preventDefault(),f(p)}handleEnd(){const{onAbort:n,onEnd:r}=this.props;this.detach(),this.activated||n(this.props.active),r()}handleCancel(){const{onAbort:n,onCancel:r}=this.props;this.detach(),this.activated||n(this.props.active),r()}handleKeydown(n){n.code===_t.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const qk={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tp extends ep{constructor(n){const{event:r}=n,s=ji(r.target);super(n,qk,s)}}tp.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:r}=e,{onActivation:s}=n;return!r.isPrimary||r.button!==0?!1:(s==null||s({event:r}),!0)}}];const Pk={move:{name:"mousemove"},end:{name:"mouseup"}};var vm;(function(e){e[e.RightClick=2]="RightClick"})(vm||(vm={}));class Fk extends ep{constructor(n){super(n,Pk,ji(n.event.target))}}Fk.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:r}=e,{onActivation:s}=n;return r.button===vm.RightClick?!1:(s==null||s({event:r}),!0)}}];const Vh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Vk extends ep{constructor(n){super(n,Vh)}static setup(){return window.addEventListener(Vh.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(Vh.move.name,n)};function n(){}}}Vk.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:r}=e,{onActivation:s}=n;const{touches:u}=r;return u.length>1?!1:(s==null||s({event:r}),!0)}}];var zo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(zo||(zo={}));var ad;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ad||(ad={}));function Yk(e){let{acceleration:n,activator:r=zo.Pointer,canScroll:s,draggingRect:u,enabled:c,interval:f=5,order:h=ad.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:y,delta:v,threshold:E}=e;const S=Xk({delta:v,disabled:!c}),[w,j]=ak(),R=x.useRef({x:0,y:0}),z=x.useRef({x:0,y:0}),I=x.useMemo(()=>{switch(r){case zo.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case zo.DraggableRect:return u}},[r,u,p]),$=x.useRef(null),Q=x.useCallback(()=>{const ne=$.current;if(!ne)return;const M=R.current.x*z.current.x,T=R.current.y*z.current.y;ne.scrollBy(M,T)},[]),J=x.useMemo(()=>h===ad.TreeOrder?[...g].reverse():g,[h,g]);x.useEffect(()=>{if(!c||!g.length||!I){j();return}for(const ne of J){if((s==null?void 0:s(ne))===!1)continue;const M=g.indexOf(ne),T=y[M];if(!T)continue;const{direction:fe,speed:pe}=_k(ne,T,I,n,E);for(const we of["x","y"])S[we][fe[we]]||(pe[we]=0,fe[we]=0);if(pe.x>0||pe.y>0){j(),$.current=ne,w(Q,f),R.current=pe,z.current=fe;return}}R.current={x:0,y:0},z.current={x:0,y:0},j()},[n,Q,s,j,c,f,JSON.stringify(I),JSON.stringify(S),w,g,J,y,JSON.stringify(E)])}const Gk={x:{[qa.Backward]:!1,[qa.Forward]:!1},y:{[qa.Backward]:!1,[qa.Forward]:!1}};function Xk(e){let{delta:n,disabled:r}=e;const s=Wu(n);return lc(u=>{if(r||!s||!u)return Gk;const c={x:Math.sign(n.x-s.x),y:Math.sign(n.y-s.y)};return{x:{[qa.Backward]:u.x[qa.Backward]||c.x===-1,[qa.Forward]:u.x[qa.Forward]||c.x===1},y:{[qa.Backward]:u.y[qa.Backward]||c.y===-1,[qa.Forward]:u.y[qa.Forward]||c.y===1}}},[r,n,s])}function Qk(e,n){const r=n!=null?e.get(n):void 0,s=r?r.node.current:null;return lc(u=>{var c;return n==null?null:(c=s??u)!=null?c:null},[s,n])}function Kk(e,n){return x.useMemo(()=>e.reduce((r,s)=>{const{sensor:u}=s,c=u.activators.map(f=>({eventName:f.eventName,handler:n(f.handler,s)}));return[...r,...c]},[]),[e,n])}var Vo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Vo||(Vo={}));var ym;(function(e){e.Optimized="optimized"})(ym||(ym={}));const qy=new Map;function Zk(e,n){let{dragging:r,dependencies:s,config:u}=n;const[c,f]=x.useState(null),{frequency:h,measure:p,strategy:g}=u,y=x.useRef(e),v=R(),E=Fo(v),S=x.useCallback(function(z){z===void 0&&(z=[]),!E.current&&f(I=>I===null?z:I.concat(z.filter($=>!I.includes($))))},[E]),w=x.useRef(null),j=lc(z=>{if(v&&!r)return qy;if(!z||z===qy||y.current!==e||c!=null){const I=new Map;for(let $ of e){if(!$)continue;if(c&&c.length>0&&!c.includes($.id)&&$.rect.current){I.set($.id,$.rect.current);continue}const Q=$.node.current,J=Q?new Jm(p(Q),Q):null;$.rect.current=J,J&&I.set($.id,J)}return I}return z},[e,c,r,v,p]);return x.useEffect(()=>{y.current=e},[e]),x.useEffect(()=>{v||S()},[r,v]),x.useEffect(()=>{c&&c.length>0&&f(null)},[JSON.stringify(c)]),x.useEffect(()=>{v||typeof h!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},h))},[h,v,S,...s]),{droppableRects:j,measureDroppableContainers:S,measuringScheduled:c!=null};function R(){switch(g){case Vo.Always:return!1;case Vo.BeforeDragging:return r;default:return!r}}}function ap(e,n){return lc(r=>e?r||(typeof n=="function"?n(e):e):null,[n,e])}function Wk(e,n){return ap(e,n)}function Jk(e){let{callback:n,disabled:r}=e;const s=Sd(n),u=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(s)},[s,r]);return x.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function Nd(e){let{callback:n,disabled:r}=e;const s=Sd(n),u=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(s)},[r]);return x.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function eT(e){return new Jm(Ri(e),e)}function Py(e,n,r){n===void 0&&(n=eT);const[s,u]=x.useState(null);function c(){u(p=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=p??r)!=null?g:null}const y=n(e);return JSON.stringify(p)===JSON.stringify(y)?p:y})}const f=Jk({callback(p){if(e)for(const g of p){const{type:y,target:v}=g;if(y==="childList"&&v instanceof HTMLElement&&v.contains(e)){c();break}}}}),h=Nd({callback:c});return mr(()=>{c(),e?(h==null||h.observe(e),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),f==null||f.disconnect())},[e]),s}function tT(e){const n=ap(e);return X0(e,n)}const Fy=[];function aT(e){const n=x.useRef(e),r=lc(s=>e?s&&s!==Fy&&e&&n.current&&e.parentNode===n.current.parentNode?s:Wm(e):Fy,[e]);return x.useEffect(()=>{n.current=e},[e]),r}function nT(e){const[n,r]=x.useState(null),s=x.useRef(e),u=x.useCallback(c=>{const f=Ph(c.target);f&&r(h=>h?(h.set(f,xm(f)),new Map(h)):null)},[]);return x.useEffect(()=>{const c=s.current;if(e!==c){f(c);const h=e.map(p=>{const g=Ph(p);return g?(g.addEventListener("scroll",u,{passive:!0}),[g,xm(g)]):null}).filter(p=>p!=null);r(h.length?new Map(h):null),s.current=e}return()=>{f(e),f(c)};function f(h){h.forEach(p=>{const g=Ph(p);g==null||g.removeEventListener("scroll",u)})}},[u,e]),x.useMemo(()=>e.length?n?Array.from(n.values()).reduce((c,f)=>vi(c,f),pr):t1(e):pr,[e,n])}function Vy(e,n){n===void 0&&(n=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},n),x.useEffect(()=>{const s=e!==pr;s&&!r.current&&(r.current=e),!s&&r.current&&(r.current=null)},[e]),r.current?Ju(e,r.current):pr}function rT(e){x.useEffect(()=>{if(!wd)return;const n=e.map(r=>{let{sensor:s}=r;return s.setup==null?void 0:s.setup()});return()=>{for(const r of n)r==null||r()}},e.map(n=>{let{sensor:r}=n;return r}))}function lT(e,n){return x.useMemo(()=>e.reduce((r,s)=>{let{eventName:u,handler:c}=s;return r[u]=f=>{c(f,n)},r},{}),[e,n])}function l1(e){return x.useMemo(()=>e?Ak(e):null,[e])}const Yy=[];function sT(e,n){n===void 0&&(n=Ri);const[r]=e,s=l1(r?gn(r):null),[u,c]=x.useState(Yy);function f(){c(()=>e.length?e.map(p=>J0(p)?s:new Jm(n(p),p)):Yy)}const h=Nd({callback:f});return mr(()=>{h==null||h.disconnect(),f(),e.forEach(p=>h==null?void 0:h.observe(p))},[e]),u}function s1(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return rc(n)?n:e}function iT(e){let{measure:n}=e;const[r,s]=x.useState(null),u=x.useCallback(g=>{for(const{target:y}of g)if(rc(y)){s(v=>{const E=n(y);return v?{...v,width:E.width,height:E.height}:E});break}},[n]),c=Nd({callback:u}),f=x.useCallback(g=>{const y=s1(g);c==null||c.disconnect(),y&&(c==null||c.observe(y)),s(y?n(y):null)},[n,c]),[h,p]=Zu(f);return x.useMemo(()=>({nodeRef:h,rect:r,setRef:p}),[r,h,p])}const oT=[{sensor:tp,options:{}},{sensor:r1,options:{}}],cT={current:{}},Hu={draggable:{measure:$y},droppable:{measure:$y,strategy:Vo.WhileDragging,frequency:ym.Optimized},dragOverlay:{measure:Ri}};class Uo extends Map{get(n){var r;return n!=null&&(r=super.get(n))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:r}=n;return!r})}getNodeFor(n){var r,s;return(r=(s=this.get(n))==null?void 0:s.node.current)!=null?r:void 0}}const uT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Uo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:td},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hu,measureDroppableContainers:td,windowRect:null,measuringScheduled:!1},i1={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:td,draggableNodes:new Map,over:null,measureDroppableContainers:td},ic=x.createContext(i1),o1=x.createContext(uT);function dT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Uo}}}function fT(e,n){switch(n.type){case Ua.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Ua.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case Ua.DragEnd:case Ua.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ua.RegisterDroppable:{const{element:r}=n,{id:s}=r,u=new Uo(e.droppable.containers);return u.set(s,r),{...e,droppable:{...e.droppable,containers:u}}}case Ua.SetDroppableDisabled:{const{id:r,key:s,disabled:u}=n,c=e.droppable.containers.get(r);if(!c||s!==c.key)return e;const f=new Uo(e.droppable.containers);return f.set(r,{...c,disabled:u}),{...e,droppable:{...e.droppable,containers:f}}}case Ua.UnregisterDroppable:{const{id:r,key:s}=n,u=e.droppable.containers.get(r);if(!u||s!==u.key)return e;const c=new Uo(e.droppable.containers);return c.delete(r),{...e,droppable:{...e.droppable,containers:c}}}default:return e}}function hT(e){let{disabled:n}=e;const{active:r,activatorEvent:s,draggableNodes:u}=x.useContext(ic),c=Wu(s),f=Wu(r==null?void 0:r.id);return x.useEffect(()=>{if(!n&&!s&&c&&f!=null){if(!Ed(c)||document.activeElement===c.target)return;const h=u.get(f);if(!h)return;const{activatorNode:p,node:g}=h;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const y of[p.current,g.current]){if(!y)continue;const v=lk(y);if(v){v.focus();break}}})}},[s,n,u,f,c]),null}function c1(e,n){let{transform:r,...s}=n;return e!=null&&e.length?e.reduce((u,c)=>c({transform:u,...s}),r):r}function mT(e){return x.useMemo(()=>({draggable:{...Hu.draggable,...e==null?void 0:e.draggable},droppable:{...Hu.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Hu.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function pT(e){let{activeNode:n,measure:r,initialRect:s,config:u=!0}=e;const c=x.useRef(!1),{x:f,y:h}=typeof u=="boolean"?{x:u,y:u}:u;mr(()=>{if(!f&&!h||!n){c.current=!1;return}if(c.current||!s)return;const g=n==null?void 0:n.node.current;if(!g||g.isConnected===!1)return;const y=r(g),v=X0(y,s);if(f||(v.x=0),h||(v.y=0),c.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const E=K0(g);E&&E.scrollBy({top:v.y,left:v.x})}},[n,f,h,s,r])}const jd=x.createContext({...pr,scaleX:1,scaleY:1});var Il;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Il||(Il={}));const gT=x.memo(function(n){var r,s,u,c;let{id:f,accessibility:h,autoScroll:p=!0,children:g,sensors:y=oT,collisionDetection:v=Nk,measuring:E,modifiers:S,...w}=n;const j=x.useReducer(fT,void 0,dT),[R,z]=j,[I,$]=dk(),[Q,J]=x.useState(Il.Uninitialized),ne=Q===Il.Initialized,{draggable:{active:M,nodes:T,translate:fe},droppable:{containers:pe}}=R,we=M!=null?T.get(M):null,re=x.useRef({initial:null,translated:null}),je=x.useMemo(()=>{var yt;return M!=null?{id:M,data:(yt=we==null?void 0:we.data)!=null?yt:cT,rect:re}:null},[M,we]),Te=x.useRef(null),[ee,L]=x.useState(null),[F,he]=x.useState(null),P=Fo(w,Object.values(w)),se=sc("DndDescribedBy",f),C=x.useMemo(()=>pe.getEnabled(),[pe]),B=mT(E),{droppableRects:K,measureDroppableContainers:ue,measuringScheduled:ge}=Zk(C,{dragging:ne,dependencies:[fe.x,fe.y],config:B.droppable}),xe=Qk(T,M),Re=x.useMemo(()=>F?ed(F):null,[F]),He=vt(),$e=Wk(xe,B.draggable.measure);pT({activeNode:M!=null?T.get(M):null,config:He.layoutShiftCompensation,initialRect:$e,measure:B.draggable.measure});const Qe=Py(xe,B.draggable.measure,$e),ia=Py(xe?xe.parentElement:null),$t=x.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:pe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),mt=pe.getNodeFor((r=$t.current.over)==null?void 0:r.id),ce=iT({measure:B.dragOverlay.measure}),qe=(s=ce.nodeRef.current)!=null?s:xe,lt=ne?(u=ce.rect)!=null?u:Qe:null,Bt=!!(ce.nodeRef.current&&ce.rect),xa=tT(Bt?null:Qe),kt=l1(qe?gn(qe):null),Lt=aT(ne?mt??xe:null),Kt=sT(Lt),$a=c1(S,{transform:{x:fe.x-xa.x,y:fe.y-xa.y,scaleX:1,scaleY:1},activatorEvent:F,active:je,activeNodeRect:Qe,containerNodeRect:ia,draggingNodeRect:lt,over:$t.current.over,overlayNodeRect:ce.rect,scrollableAncestors:Lt,scrollableAncestorRects:Kt,windowRect:kt}),Ba=Re?vi(Re,fe):null,aa=nT(Lt),fn=Vy(aa),hn=Vy(aa,[Qe]),en=vi($a,fn),Ha=lt?kk(lt,$a):null,me=je&&Ha?v({active:je,collisionRect:Ha,droppableRects:K,droppableContainers:C,pointerCoordinates:Ba}):null,Ce=wk(me,"id"),[Ae,Xe]=x.useState(null),Pe=Bt?$a:vi($a,hn),te=jk(Pe,(c=Ae==null?void 0:Ae.rect)!=null?c:null,Qe),Tt=x.useRef(null),Zt=x.useCallback((yt,St)=>{let{sensor:Ht,options:Ct}=St;if(Te.current==null)return;const na=T.get(Te.current);if(!na)return;const Wt=yt.nativeEvent,It=new Ht({active:Te.current,activeNode:na,event:Wt,options:Ct,context:$t,onAbort(et){if(!T.get(et))return;const{onDragAbort:Da}=P.current,A={id:et};Da==null||Da(A),I({type:"onDragAbort",event:A})},onPending(et,Sa,Da,A){if(!T.get(et))return;const{onDragPending:q}=P.current,W={id:et,constraint:Sa,initialCoordinates:Da,offset:A};q==null||q(W),I({type:"onDragPending",event:W})},onStart(et){const Sa=Te.current;if(Sa==null)return;const Da=T.get(Sa);if(!Da)return;const{onDragStart:A}=P.current,_={activatorEvent:Wt,active:{id:Sa,data:Da.data,rect:re}};sl.unstable_batchedUpdates(()=>{A==null||A(_),J(Il.Initializing),z({type:Ua.DragStart,initialCoordinates:et,active:Sa}),I({type:"onDragStart",event:_}),L(Tt.current),he(Wt)})},onMove(et){z({type:Ua.DragMove,coordinates:et})},onEnd:pt(Ua.DragEnd),onCancel:pt(Ua.DragCancel)});Tt.current=It;function pt(et){return async function(){const{active:Da,collisions:A,over:_,scrollAdjustedTranslate:q}=$t.current;let W=null;if(Da&&q){const{cancelDrop:ie}=P.current;W={activatorEvent:Wt,active:Da,collisions:A,delta:q,over:_},et===Ua.DragEnd&&typeof ie=="function"&&await Promise.resolve(ie(W))&&(et=Ua.DragCancel)}Te.current=null,sl.unstable_batchedUpdates(()=>{z({type:et}),J(Il.Uninitialized),Xe(null),L(null),he(null),Tt.current=null;const ie=et===Ua.DragEnd?"onDragEnd":"onDragCancel";if(W){const ke=P.current[ie];ke==null||ke(W),I({type:ie,event:W})}})}}},[T]),Fa=x.useCallback((yt,St)=>(Ht,Ct)=>{const na=Ht.nativeEvent,Wt=T.get(Ct);if(Te.current!==null||!Wt||na.dndKit||na.defaultPrevented)return;const It={active:Wt};yt(Ht,St.options,It)===!0&&(na.dndKit={capturedBy:St.sensor},Te.current=Ct,Zt(Ht,St))},[T,Zt]),va=Kk(y,Fa);rT(y),mr(()=>{Qe&&Q===Il.Initializing&&J(Il.Initialized)},[Qe,Q]),x.useEffect(()=>{const{onDragMove:yt}=P.current,{active:St,activatorEvent:Ht,collisions:Ct,over:na}=$t.current;if(!St||!Ht)return;const Wt={active:St,activatorEvent:Ht,collisions:Ct,delta:{x:en.x,y:en.y},over:na};sl.unstable_batchedUpdates(()=>{yt==null||yt(Wt),I({type:"onDragMove",event:Wt})})},[en.x,en.y]),x.useEffect(()=>{const{active:yt,activatorEvent:St,collisions:Ht,droppableContainers:Ct,scrollAdjustedTranslate:na}=$t.current;if(!yt||Te.current==null||!St||!na)return;const{onDragOver:Wt}=P.current,It=Ct.get(Ce),pt=It&&It.rect.current?{id:It.id,rect:It.rect.current,data:It.data,disabled:It.disabled}:null,et={active:yt,activatorEvent:St,collisions:Ht,delta:{x:na.x,y:na.y},over:pt};sl.unstable_batchedUpdates(()=>{Xe(pt),Wt==null||Wt(et),I({type:"onDragOver",event:et})})},[Ce]),mr(()=>{$t.current={activatorEvent:F,active:je,activeNode:xe,collisionRect:Ha,collisions:me,droppableRects:K,draggableNodes:T,draggingNode:qe,draggingNodeRect:lt,droppableContainers:pe,over:Ae,scrollableAncestors:Lt,scrollAdjustedTranslate:en},re.current={initial:lt,translated:Ha}},[je,xe,me,Ha,T,qe,lt,K,pe,Ae,Lt,en]),Yk({...He,delta:fe,draggingRect:Ha,pointerCoordinates:Ba,scrollableAncestors:Lt,scrollableAncestorRects:Kt});const qn=x.useMemo(()=>({active:je,activeNode:xe,activeNodeRect:Qe,activatorEvent:F,collisions:me,containerNodeRect:ia,dragOverlay:ce,draggableNodes:T,droppableContainers:pe,droppableRects:K,over:Ae,measureDroppableContainers:ue,scrollableAncestors:Lt,scrollableAncestorRects:Kt,measuringConfiguration:B,measuringScheduled:ge,windowRect:kt}),[je,xe,Qe,F,me,ia,ce,T,pe,K,Ae,ue,Lt,Kt,B,ge,kt]),_e=x.useMemo(()=>({activatorEvent:F,activators:va,active:je,activeNodeRect:Qe,ariaDescribedById:{draggable:se},dispatch:z,draggableNodes:T,over:Ae,measureDroppableContainers:ue}),[F,va,je,Qe,z,se,T,Ae,ue]);return ua.createElement(G0.Provider,{value:$},ua.createElement(ic.Provider,{value:_e},ua.createElement(o1.Provider,{value:qn},ua.createElement(jd.Provider,{value:te},g)),ua.createElement(hT,{disabled:(h==null?void 0:h.restoreFocus)===!1})),ua.createElement(mk,{...h,hiddenTextDescribedById:se}));function vt(){const yt=(ee==null?void 0:ee.autoScrollEnabled)===!1,St=typeof p=="object"?p.enabled===!1:p===!1,Ht=ne&&!yt&&!St;return typeof p=="object"?{...p,enabled:Ht}:{enabled:Ht}}}),xT=x.createContext(null),Gy="button",vT="Draggable";function yT(e){let{id:n,data:r,disabled:s=!1,attributes:u}=e;const c=sc(vT),{activators:f,activatorEvent:h,active:p,activeNodeRect:g,ariaDescribedById:y,draggableNodes:v,over:E}=x.useContext(ic),{role:S=Gy,roleDescription:w="draggable",tabIndex:j=0}=u??{},R=(p==null?void 0:p.id)===n,z=x.useContext(R?jd:xT),[I,$]=Zu(),[Q,J]=Zu(),ne=lT(f,n),M=Fo(r);mr(()=>(v.set(n,{id:n,key:c,node:I,activatorNode:Q,data:M}),()=>{const fe=v.get(n);fe&&fe.key===c&&v.delete(n)}),[v,n]);const T=x.useMemo(()=>({role:S,tabIndex:j,"aria-disabled":s,"aria-pressed":R&&S===Gy?!0:void 0,"aria-roledescription":w,"aria-describedby":y.draggable}),[s,S,j,R,w,y.draggable]);return{active:p,activatorEvent:h,activeNodeRect:g,attributes:T,isDragging:R,listeners:s?void 0:ne,node:I,over:E,setNodeRef:$,setActivatorNodeRef:J,transform:z}}function u1(){return x.useContext(o1)}const bT="Droppable",wT={timeout:25};function ST(e){let{data:n,disabled:r=!1,id:s,resizeObserverConfig:u}=e;const c=sc(bT),{active:f,dispatch:h,over:p,measureDroppableContainers:g}=x.useContext(ic),y=x.useRef({disabled:r}),v=x.useRef(!1),E=x.useRef(null),S=x.useRef(null),{disabled:w,updateMeasurementsFor:j,timeout:R}={...wT,...u},z=Fo(j??s),I=x.useCallback(()=>{if(!v.current){v.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(z.current)?z.current:[z.current]),S.current=null},R)},[R]),$=Nd({callback:I,disabled:w||!f}),Q=x.useCallback((T,fe)=>{$&&(fe&&($.unobserve(fe),v.current=!1),T&&$.observe(T))},[$]),[J,ne]=Zu(Q),M=Fo(n);return x.useEffect(()=>{!$||!J.current||($.disconnect(),v.current=!1,$.observe(J.current))},[J,$]),x.useEffect(()=>(h({type:Ua.RegisterDroppable,element:{id:s,key:c,disabled:r,node:J,rect:E,data:M}}),()=>h({type:Ua.UnregisterDroppable,key:c,id:s})),[s]),x.useEffect(()=>{r!==y.current.disabled&&(h({type:Ua.SetDroppableDisabled,id:s,key:c,disabled:r}),y.current.disabled=r)},[s,c,r,h]),{active:f,rect:E,isOver:(p==null?void 0:p.id)===s,node:J,over:p,setNodeRef:ne}}function ET(e){let{animation:n,children:r}=e;const[s,u]=x.useState(null),[c,f]=x.useState(null),h=Wu(r);return!r&&!s&&h&&u(h),mr(()=>{if(!c)return;const p=s==null?void 0:s.key,g=s==null?void 0:s.props.id;if(p==null||g==null){u(null);return}Promise.resolve(n(g,c)).then(()=>{u(null)})},[n,s,c]),ua.createElement(ua.Fragment,null,r,s?x.cloneElement(s,{ref:f}):null)}const NT={x:0,y:0,scaleX:1,scaleY:1};function jT(e){let{children:n}=e;return ua.createElement(ic.Provider,{value:i1},ua.createElement(jd.Provider,{value:NT},n))}const RT={position:"fixed",touchAction:"none"},kT=e=>Ed(e)?"transform 250ms ease":void 0,TT=x.forwardRef((e,n)=>{let{as:r,activatorEvent:s,adjustScale:u,children:c,className:f,rect:h,style:p,transform:g,transition:y=kT}=e;if(!h)return null;const v=u?g:{...g,scaleX:1,scaleY:1},E={...RT,width:h.width,height:h.height,top:h.top,left:h.left,transform:Gl.Transform.toString(v),transformOrigin:u&&s?vk(s,h):void 0,transition:typeof y=="function"?y(s):y,...p};return ua.createElement(r,{className:f,style:E,ref:n},c)}),CT=e=>n=>{let{active:r,dragOverlay:s}=n;const u={},{styles:c,className:f}=e;if(c!=null&&c.active)for(const[h,p]of Object.entries(c.active))p!==void 0&&(u[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,p));if(c!=null&&c.dragOverlay)for(const[h,p]of Object.entries(c.dragOverlay))p!==void 0&&s.node.style.setProperty(h,p);return f!=null&&f.active&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&s.node.classList.add(f.dragOverlay),function(){for(const[p,g]of Object.entries(u))r.node.style.setProperty(p,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},AT=e=>{let{transform:{initial:n,final:r}}=e;return[{transform:Gl.Transform.toString(n)},{transform:Gl.Transform.toString(r)}]},DT={duration:250,easing:"ease",keyframes:AT,sideEffects:CT({styles:{active:{opacity:"0"}}})};function OT(e){let{config:n,draggableNodes:r,droppableContainers:s,measuringConfiguration:u}=e;return Sd((c,f)=>{if(n===null)return;const h=r.get(c);if(!h)return;const p=h.node.current;if(!p)return;const g=s1(f);if(!g)return;const{transform:y}=gn(f).getComputedStyle(f),v=Q0(y);if(!v)return;const E=typeof n=="function"?n:MT(n);return a1(p,u.draggable.measure),E({active:{id:c,data:h.data,node:p,rect:u.draggable.measure(p)},draggableNodes:r,dragOverlay:{node:f,rect:u.dragOverlay.measure(g)},droppableContainers:s,measuringConfiguration:u,transform:v})})}function MT(e){const{duration:n,easing:r,sideEffects:s,keyframes:u}={...DT,...e};return c=>{let{active:f,dragOverlay:h,transform:p,...g}=c;if(!n)return;const y={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},v={scaleX:p.scaleX!==1?f.rect.width*p.scaleX/h.rect.width:1,scaleY:p.scaleY!==1?f.rect.height*p.scaleY/h.rect.height:1},E={x:p.x-y.x,y:p.y-y.y,...v},S=u({...g,active:f,dragOverlay:h,transform:{initial:p,final:E}}),[w]=S,j=S[S.length-1];if(JSON.stringify(w)===JSON.stringify(j))return;const R=s==null?void 0:s({active:f,dragOverlay:h,...g}),z=h.node.animate(S,{duration:n,easing:r,fill:"forwards"});return new Promise(I=>{z.onfinish=()=>{R==null||R(),I()}})}}let Xy=0;function _T(e){return x.useMemo(()=>{if(e!=null)return Xy++,Xy},[e])}const LT=ua.memo(e=>{let{adjustScale:n=!1,children:r,dropAnimation:s,style:u,transition:c,modifiers:f,wrapperElement:h="div",className:p,zIndex:g=999}=e;const{activatorEvent:y,active:v,activeNodeRect:E,containerNodeRect:S,draggableNodes:w,droppableContainers:j,dragOverlay:R,over:z,measuringConfiguration:I,scrollableAncestors:$,scrollableAncestorRects:Q,windowRect:J}=u1(),ne=x.useContext(jd),M=_T(v==null?void 0:v.id),T=c1(f,{activatorEvent:y,active:v,activeNodeRect:E,containerNodeRect:S,draggingNodeRect:R.rect,over:z,overlayNodeRect:R.rect,scrollableAncestors:$,scrollableAncestorRects:Q,transform:ne,windowRect:J}),fe=ap(E),pe=OT({config:s,draggableNodes:w,droppableContainers:j,measuringConfiguration:I}),we=fe?R.setRef:void 0;return ua.createElement(jT,null,ua.createElement(ET,{animation:pe},v&&M?ua.createElement(TT,{key:M,id:v.id,ref:we,as:h,activatorEvent:y,adjustScale:n,className:p,transition:c,rect:fe,style:{zIndex:g,...u},transform:T},r):null))});function $o(e,n,r){const s=e.slice();return s.splice(r<0?s.length+r:r,0,s.splice(n,1)[0]),s}function zT(e,n){return e.reduce((r,s,u)=>{const c=n.get(s);return c&&(r[u]=c),r},Array(e.length))}function ku(e){return e!==null&&e>=0}function UT(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function $T(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const d1=e=>{let{rects:n,activeIndex:r,overIndex:s,index:u}=e;const c=$o(n,s,r),f=n[u],h=c[u];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},Tu={scaleX:1,scaleY:1},np=e=>{var n;let{activeIndex:r,activeNodeRect:s,index:u,rects:c,overIndex:f}=e;const h=(n=c[r])!=null?n:s;if(!h)return null;if(u===r){const g=c[f];return g?{x:0,y:r<f?g.top+g.height-(h.top+h.height):g.top-h.top,...Tu}:null}const p=BT(c,u,r);return u>r&&u<=f?{x:0,y:-h.height-p,...Tu}:u<r&&u>=f?{x:0,y:h.height+p,...Tu}:{x:0,y:0,...Tu}};function BT(e,n,r){const s=e[n],u=e[n-1],c=e[n+1];return s?r<n?u?s.top-(u.top+u.height):c?c.top-(s.top+s.height):0:c?c.top-(s.top+s.height):u?s.top-(u.top+u.height):0:0}const f1="Sortable",h1=ua.createContext({activeIndex:-1,containerId:f1,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:d1,disabled:{draggable:!1,droppable:!1}});function rp(e){let{children:n,id:r,items:s,strategy:u=d1,disabled:c=!1}=e;const{active:f,dragOverlay:h,droppableRects:p,over:g,measureDroppableContainers:y}=u1(),v=sc(f1,r),E=h.rect!==null,S=x.useMemo(()=>s.map(ne=>typeof ne=="object"&&"id"in ne?ne.id:ne),[s]),w=f!=null,j=f?S.indexOf(f.id):-1,R=g?S.indexOf(g.id):-1,z=x.useRef(S),I=!UT(S,z.current),$=R!==-1&&j===-1||I,Q=$T(c);mr(()=>{I&&w&&y(S)},[I,S,w,y]),x.useEffect(()=>{z.current=S},[S]);const J=x.useMemo(()=>({activeIndex:j,containerId:v,disabled:Q,disableTransforms:$,items:S,overIndex:R,useDragOverlay:E,sortedRects:zT(S,p),strategy:u}),[j,v,Q.draggable,Q.droppable,$,S,R,p,E,u]);return ua.createElement(h1.Provider,{value:J},n)}const HT=e=>{let{id:n,items:r,activeIndex:s,overIndex:u}=e;return $o(r,s,u).indexOf(n)},IT=e=>{let{containerId:n,isSorting:r,wasDragging:s,index:u,items:c,newIndex:f,previousItems:h,previousContainerId:p,transition:g}=e;return!g||!s||h!==c&&u===f?!1:r?!0:f!==u&&n===p},qT={duration:200,easing:"ease"},m1="transform",PT=Gl.Transition.toString({property:m1,duration:0,easing:"linear"}),FT={roleDescription:"sortable"};function VT(e){let{disabled:n,index:r,node:s,rect:u}=e;const[c,f]=x.useState(null),h=x.useRef(r);return mr(()=>{if(!n&&r!==h.current&&s.current){const p=u.current;if(p){const g=Ri(s.current,{ignoreTransform:!0}),y={x:p.left-g.left,y:p.top-g.top,scaleX:p.width/g.width,scaleY:p.height/g.height};(y.x||y.y)&&f(y)}}r!==h.current&&(h.current=r)},[n,r,s,u]),x.useEffect(()=>{c&&f(null)},[c]),c}function YT(e){let{animateLayoutChanges:n=IT,attributes:r,disabled:s,data:u,getNewIndex:c=HT,id:f,strategy:h,resizeObserverConfig:p,transition:g=qT}=e;const{items:y,containerId:v,activeIndex:E,disabled:S,disableTransforms:w,sortedRects:j,overIndex:R,useDragOverlay:z,strategy:I}=x.useContext(h1),$=GT(s,S),Q=y.indexOf(f),J=x.useMemo(()=>({sortable:{containerId:v,index:Q,items:y},...u}),[v,u,Q,y]),ne=x.useMemo(()=>y.slice(y.indexOf(f)),[y,f]),{rect:M,node:T,isOver:fe,setNodeRef:pe}=ST({id:f,data:J,disabled:$.droppable,resizeObserverConfig:{updateMeasurementsFor:ne,...p}}),{active:we,activatorEvent:re,activeNodeRect:je,attributes:Te,setNodeRef:ee,listeners:L,isDragging:F,over:he,setActivatorNodeRef:P,transform:se}=yT({id:f,data:J,attributes:{...FT,...r},disabled:$.draggable}),C=tk(pe,ee),B=!!we,K=B&&!w&&ku(E)&&ku(R),ue=!z&&F,ge=ue&&K?se:null,Re=K?ge??(h??I)({rects:j,activeNodeRect:je,activeIndex:E,overIndex:R,index:Q}):null,He=ku(E)&&ku(R)?c({id:f,items:y,activeIndex:E,overIndex:R}):Q,$e=we==null?void 0:we.id,Qe=x.useRef({activeId:$e,items:y,newIndex:He,containerId:v}),ia=y!==Qe.current.items,$t=n({active:we,containerId:v,isDragging:F,isSorting:B,id:f,index:Q,items:y,newIndex:Qe.current.newIndex,previousItems:Qe.current.items,previousContainerId:Qe.current.containerId,transition:g,wasDragging:Qe.current.activeId!=null}),mt=VT({disabled:!$t,index:Q,node:T,rect:M});return x.useEffect(()=>{B&&Qe.current.newIndex!==He&&(Qe.current.newIndex=He),v!==Qe.current.containerId&&(Qe.current.containerId=v),y!==Qe.current.items&&(Qe.current.items=y)},[B,He,v,y]),x.useEffect(()=>{if($e===Qe.current.activeId)return;if($e!=null&&Qe.current.activeId==null){Qe.current.activeId=$e;return}const qe=setTimeout(()=>{Qe.current.activeId=$e},50);return()=>clearTimeout(qe)},[$e]),{active:we,activeIndex:E,attributes:Te,data:J,rect:M,index:Q,newIndex:He,items:y,isOver:fe,isSorting:B,isDragging:F,listeners:L,node:T,overIndex:R,over:he,setNodeRef:C,setActivatorNodeRef:P,setDroppableNodeRef:pe,setDraggableNodeRef:ee,transform:mt??Re,transition:ce()};function ce(){if(mt||ia&&Qe.current.newIndex===Q)return PT;if(!(ue&&!Ed(re)||!g)&&(B||$t))return Gl.Transition.toString({...g,property:m1})}}function GT(e,n){var r,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:n.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:n.droppable}}_t.Down,_t.Right,_t.Up,_t.Left;const XT=[{value:"priority",label:"Priority"},{value:"number",label:"Number"},{value:"createdAt",label:"Created date"},{value:"updatedAt",label:"Updated date"},{value:"title",label:"Title"},{value:"shortId",label:"Short ID"},{value:"status",label:"Status"},{value:"startedAt",label:"Started"},{value:"completedAt",label:"Completed"}];function lp({sort:e,onChange:n,label:r="Sort by"}){return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("label",{htmlFor:"sort-control",className:"hidden text-xs text-[var(--text-muted)] sm:inline",children:r}),o.jsxs("div",{className:"inline-flex h-9 items-center gap-1 rounded-lg border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1 shadow-sm",children:[o.jsxs("div",{className:"relative",children:[o.jsx("select",{id:"sort-control",value:e.key,onChange:s=>n({key:s.target.value,direction:e.direction}),className:"h-7 w-full min-w-[7.5rem] cursor-pointer appearance-none border-0 bg-transparent pr-6 pl-1 text-xs font-medium text-[var(--text)] outline-none hover:text-[var(--accent)] sm:w-auto",children:XT.map(s=>o.jsx("option",{value:s.value,children:s.label},s.value))}),o.jsx(Rs,{className:"pointer-events-none absolute right-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]","aria-hidden":"true"})]}),o.jsx("button",{type:"button",onClick:()=>n({key:e.key,direction:e.direction==="asc"?"desc":"asc"}),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[var(--text-muted)] transition hover:bg-[var(--surface-strong)] hover:text-[var(--text)]","aria-label":`Sort direction: ${e.direction}`,title:`Sort direction: ${e.direction}`,children:e.direction==="asc"?o.jsx(oj,{className:"h-3.5 w-3.5","aria-hidden":"true"}):o.jsx(lj,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})}const Rd=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],kd=[{value:"draft",label:"Draft"},{value:"discovery",label:"Discovery"},{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],sp=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],nd=sp,ip=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Eo=Rd.map(e=>e.value),No=kd.map(e=>e.value),jo=sp.map(e=>e.value);function Yh(e,n,r){if(e.includes(n)){const s=e.filter(u=>u!==n);return s.length===0?[...r]:s}return[...e,n]}function si(e,n){return n.includes(e)}function fr(e,n){return`agent-plan:dashboard:${e}:${n}`}function Gh(e,n,r){if(typeof window>"u")return n;try{const s=window.localStorage.getItem(e);if(!s)return n;const u=JSON.parse(s);if(!Array.isArray(u))return n;const c=`${e}-schema`,f=r.slice().sort().join(",");if(window.localStorage.getItem(c)!==f)return window.localStorage.setItem(c,f),n;const p=u.filter(g=>typeof g=="string"&&r.includes(g));return p.length>0?p:n}catch{return n}}function Xh(e,n,r){typeof window>"u"||(window.localStorage.setItem(e,JSON.stringify(n)),window.localStorage.setItem(`${e}-schema`,r.slice().sort().join(",")))}function Qh(e,n){if(typeof window>"u")return n;const r=window.localStorage.getItem(e);return r===null?n:r==="true"}const Qy={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Ky=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function p1(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function QT(e){return new Set(p1(e).map(n=>Number(n)).filter(n=>Number.isFinite(n)&&n>0))}function Zy(e){const n=e.toUpperCase();return n==="AND"||n==="OR"}function Kh(e,n){const r=e??new Set;for(const s of QT(n))r.add(s);return r}function KT(e,n){const r=e??new Set;for(const s of p1(n).map(u=>u.toUpperCase()))r.add(s);return r}function ZT(e){const n=e.trim();if(!n)return{...Qy};const r={...Qy},s=[],u=[];let c=0;for(;c<n.length;){const h=n[c];if(h==='"'){const p=n.indexOf('"',c+1);if(p===-1){u.push(n.slice(c+1));break}u.push(n.slice(c+1,p)),c=p+1}else if(h===" ")c+=1;else{let p=c;for(;p<n.length&&n[p]!==" ";)p+=1;u.push(n.slice(c,p)),c=p}}let f=0;for(;f<u.length;){const h=u[f];if(Zy(h)){f+=1;continue}const p=h.match(Ky);if(p){const g=(p[1]??"").toLowerCase();let y=p[2]??"";if(y.trim()===""&&f+1<u.length){let v=f+1;for(;v<u.length&&Zy(u[v]);)v+=1;v<u.length&&!u[v].match(Ky)&&(y=u[v],f=v)}if(g==="feature"){const v=Kh(r.featureNumbers,y);v.size&&(r.featureNumbers=v)}else if(g==="phase"){const v=Kh(r.phaseNumbers,y);v.size&&(r.phaseNumbers=v)}else if(g==="task"){const v=Kh(r.taskNumbers,y);v.size&&(r.taskNumbers=v)}else if(g==="id"){const v=KT(r.shortIds,y);v.size&&(r.shortIds=v)}else g==="status"?y.trim()&&(r.status=y.toLowerCase()):g==="feature-status"?y.trim()&&(r.featureStatus=y.toLowerCase()):g==="phase-status"?y.trim()&&(r.phaseStatus=y.toLowerCase()):g==="title"&&y.trim()&&(r.text=y.toLowerCase())}else s.push(h.toLowerCase());f+=1}return s.length>0&&!r.text&&(r.text=s.join(" ")),r}function WT(e){return!!(e.featureNumbers||e.phaseNumbers||e.taskNumbers||e.shortIds||e.status||e.featureStatus||e.phaseStatus||e.text)}function g1(e){const n=r=>String(r).padStart(3,"0");return[e.task.title,e.task.shortName??"",e.task.shortId??"",String(e.task.number),`T${n(e.task.number)}`,e.task.description??"",e.task.notes??"",e.phase.title,e.phase.slug??"",e.phase.shortId??"",String(e.phase.number),`P${n(e.phase.number)}`,e.phase.description??"",e.phase.summary??"",e.phase.notes??"",e.feature.name,e.feature.shortId??"",String(e.feature.number),`F${n(e.feature.number)}`,e.feature.description??""].join(" ").toLowerCase()}function JT(e,n,r){if(e.featureNumbers&&!e.featureNumbers.has(n.feature.number)||e.phaseNumbers&&!e.phaseNumbers.has(n.phase.number)||e.taskNumbers&&!e.taskNumbers.has(n.task.number)||e.shortIds&&!(e.shortIds.has(n.task.shortId??"")||e.shortIds.has(n.phase.shortId??"")||e.shortIds.has(n.feature.shortId??""))||e.status&&n.task.status!==e.status||e.featureStatus&&n.feature.status!==e.featureStatus||e.phaseStatus&&n.phase.status!==e.phaseStatus)return!1;if(e.text){const s=e.text;if(!(r??g1(n)).includes(s))return!1}return!0}function eC({features:e,phases:n,projectStorageScope:r}){const s=fr(r,"show-all-features"),u=fr(r,"tree-open-mode"),c=fr(r,"expanded-features"),f=fr(r,"expanded-phases"),h=fr(r,"feature-status-filters"),p=fr(r,"phase-status-filters"),g=fr(r,"task-status-filters"),y=fr(r,"hide-done"),v=fr(r,"hide-planned"),E=fr(r,"only-active-branches"),S=fr(r,"work-tree-sort"),[w,j]=x.useState(""),[R,z]=x.useState(()=>{if(typeof window>"u")return Do;try{const me=window.localStorage.getItem(S);if(!me)return Do;const Ce=JSON.parse(me);if(Ce.key&&Ce.direction)return{key:Ce.key,direction:Ce.direction}}catch{}return Do}),I=x.useMemo(()=>MR(e,n,R),[e,n,R]),$=x.useMemo(()=>ZT(w),[w]),Q=WT($),J=x.useMemo(()=>{if(!Q||!$.text)return null;const me=new Map;for(const Ce of I)for(const Ae of Ce.allPhases)for(const Xe of Ae.allTasks)me.set(Xe.id,g1({feature:Ce.feature,phase:Ae.phase,task:Xe}));return me},[Q,$.text,I]),{matchedTaskIds:ne,matchedFeatureIds:M,matchedPhaseIds:T}=x.useMemo(()=>{const me=new Set,Ce=new Set,Ae=new Set;if(!Q)return{matchedTaskIds:me,matchedFeatureIds:Ce,matchedPhaseIds:Ae};for(const Xe of I)for(const Pe of Xe.allPhases)for(const te of Pe.allTasks)JT($,{feature:Xe.feature,phase:Pe.phase,task:te},J==null?void 0:J.get(te.id))&&(me.add(te.id),Ce.add(Xe.feature.id),Ae.add(Pe.phase.id));return{matchedTaskIds:me,matchedFeatureIds:Ce,matchedPhaseIds:Ae}},[Q,$,I,J]),[fe,pe]=x.useState(()=>{if(typeof window>"u")return!0;const me=window.localStorage.getItem(s);return me===null?!0:me==="true"}),[we,re]=x.useState(()=>{if(typeof window>"u")return"all";const me=window.localStorage.getItem(u);return me==="smart"||me==="none"||me==="all"?me:"all"}),[je,Te]=x.useState(()=>{if(typeof window>"u")return[];try{const me=window.localStorage.getItem(c);return me?JSON.parse(me):[]}catch{return[]}}),[ee,L]=x.useState(()=>{if(typeof window>"u")return[];try{const me=window.localStorage.getItem(f);return me?JSON.parse(me):[]}catch{return[]}}),[F,he]=x.useState(()=>Gh(h,Eo,Eo)),[P,se]=x.useState(()=>Gh(p,No,No)),[C,B]=x.useState(()=>Gh(g,jo,jo)),[K,ue]=x.useState(()=>Qh(y,!1)),[ge,xe]=x.useState(()=>Qh(v,!1)),[Re,He]=x.useState(()=>Qh(E,!1)),[$e,Qe]=x.useState([]),[ia,$t]=x.useState([]),[mt,ce]=x.useState([]),qe=x.useRef({});x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(s,String(fe))},[fe,s]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,we)},[we,u]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(c,JSON.stringify(je))},[je,c]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(ee))},[ee,f]),x.useEffect(()=>{typeof window>"u"||Xh(h,F,Eo)},[F,h]),x.useEffect(()=>{typeof window>"u"||Xh(p,P,No)},[P,p]),x.useEffect(()=>{typeof window>"u"||Xh(g,C,jo)},[C,g]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y,String(K))},[K,y]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(v,String(ge))},[ge,v]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(E,String(Re))},[Re,E]),x.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(S,JSON.stringify(R))},[R,S]),x.useEffect(()=>()=>{Object.values(qe.current).forEach(me=>window.clearTimeout(me)),qe.current={}},[]);const lt=x.useMemo(()=>{let me=[...F];return K&&(me=me.filter(Ce=>Ce!=="done")),ge&&(me=me.filter(Ce=>Ce!=="planned")),me},[F,K,ge]),Bt=x.useMemo(()=>{let me=[...P];return K&&(me=me.filter(Ce=>Ce!=="done")),ge&&(me=me.filter(Ce=>Ce!=="planned"&&Ce!=="draft")),me},[P,K,ge]),xa=x.useMemo(()=>{let me=[...C];return K&&(me=me.filter(Ce=>Ce!=="done")),ge&&(me=me.filter(Ce=>Ce!=="planned")),me},[C,K,ge]),kt=x.useMemo(()=>{if(Q)return I.filter(Ae=>si(Ae.feature.status,lt)).map(Ae=>({...Ae,allPhases:Ae.allPhases.filter(Xe=>si(Xe.phase.status,Bt)).map(Xe=>({...Xe,allTasks:Xe.allTasks.filter(Pe=>ne.has(Pe.id)&&si(Pe.status,xa))})).filter(Xe=>Xe.allTasks.length>0)})).filter(Ae=>Ae.allPhases.length>0);const me=!fe||Re;return(fe?I:I.filter(Ae=>Ae.isActive)).filter(({feature:Ae})=>si(Ae.status,lt)).map(Ae=>({...Ae,allPhases:Ae.allPhases.filter(({phase:Xe,hasActiveTask:Pe})=>si(Xe.status,Bt)?me?Xe.status==="in-progress"||Xe.status==="discovery"||Pe:!0:!1).map(Xe=>({...Xe,allTasks:Xe.allTasks.filter(Pe=>!!si(Pe.status,xa))})).filter(Xe=>Xe.allTasks.length>0||fe||!me)})).filter(({hasActiveTask:Ae,allPhases:Xe})=>me?Ae||Xe.some(Pe=>Pe.hasActiveTask):Xe.length>0||fe)},[Q,ne,I,lt,Bt,xa,Re,fe]);x.useEffect(()=>{if(we==="none"){Te([]),L([]);return}if(we==="all"){Te(kt.filter(({feature:Ae})=>Ae.status!=="done").map(({feature:Ae})=>Ae.id)),L(kt.flatMap(({allPhases:Ae})=>Ae.map(({phase:Xe})=>Xe.id)));return}const me=new Set(kt.map(({feature:Ae})=>Ae.id)),Ce=new Set(kt.flatMap(({allPhases:Ae})=>Ae.map(({phase:Xe})=>Xe.id)));Te(Ae=>Ae.filter(Xe=>me.has(Xe))),L(Ae=>Ae.filter(Xe=>Ce.has(Xe)))},[kt,we]),x.useEffect(()=>{Q&&(re("smart"),Te(Array.from(M)),L(Array.from(T)))},[Q,M,T]);const Lt=me=>{re("smart"),Te(Ce=>Ce.includes(me)?Ce.filter(Ae=>Ae!==me):[...Ce,me])},Kt=me=>{re("smart"),L(Ce=>Ce.includes(me)?Ce.filter(Ae=>Ae!==me):[...Ce,me])},$a=()=>{re("smart"),Te(kt.map(({feature:me})=>me.id)),L(kt.flatMap(({allPhases:me})=>me.map(({phase:Ce})=>Ce.id)))},Ba=()=>{re("smart"),Te([]),L([])},aa=x.useMemo(()=>{const me=new Set(kt.map(({feature:Pe})=>Pe.id)),Ce=new Set(kt.flatMap(({allPhases:Pe})=>Pe.map(({phase:te})=>te.id)));if(me.size===0)return!1;const Ae=Array.from(me).every(Pe=>je.includes(Pe)),Xe=Array.from(Ce).every(Pe=>ee.includes(Pe));return Ae&&Xe},[kt,je,ee]);return x.useEffect(()=>{const me=(Ae,Xe)=>{const Pe=Xe.filter(te=>!!te);for(const te of Pe){const Tt=`${Ae}:${te}`,Zt=Ae==="feature"?Qe:Ae==="phase"?$t:ce;Zt(Fa=>Fa.includes(te)?Fa:[...Fa,te]),qe.current[Tt]!==void 0&&window.clearTimeout(qe.current[Tt]),qe.current[Tt]=window.setTimeout(()=>{Zt(Fa=>Fa.filter(va=>va!==te)),delete qe.current[Tt]},TR)}},Ce=Ae=>{var te,Tt,Zt,Fa,va,qn;const Pe=Ae.detail;if(Pe!=null&&Pe.type){if(Pe.type==="features-updated"){const _e=((te=Pe.data)==null?void 0:te.featureId)??((Tt=Pe.data)==null?void 0:Tt.id);me("feature",[_e]),_e&&(re("smart"),Te(vt=>vt.includes(_e)?vt:[...vt,_e]));return}if(Pe.type==="phases-updated"){const _e=(Zt=Pe.data)==null?void 0:Zt.featureId,vt=((Fa=Pe.data)==null?void 0:Fa.phaseId)??((va=Pe.data)==null?void 0:va.id);me("phase",[vt]),me("feature",[_e]),me("task",[(qn=Pe.data)==null?void 0:qn.taskId]),re("smart"),_e&&Te(yt=>yt.includes(_e)?yt:[...yt,_e]),vt&&L(yt=>yt.includes(vt)?yt:[...yt,vt])}}};return window.addEventListener("agent-plan:ws-event",Ce),()=>{window.removeEventListener("agent-plan:ws-event",Ce)}},[]),{workTree:I,displayedWorkTree:kt,treeOpenMode:we,setTreeOpenMode:re,expandAll:$a,collapseAll:Ba,isAllExpanded:aa,expandedFeatureIds:je,expandedPhaseIds:ee,setExpandedFeatureIds:Te,setExpandedPhaseIds:L,toggleExpandedFeature:Lt,toggleExpandedPhase:Kt,recentFeatureIds:$e,recentPhaseIds:ia,recentTaskIds:mt,setRecentTaskIds:ce,showAllFeatures:fe,setShowAllFeatures:pe,featureStatusFilters:F,phaseStatusFilters:P,taskStatusFilters:C,hideDone:K,setHideDone:ue,hidePlanned:ge,setHidePlanned:xe,onlyActiveBranches:Re,setOnlyActiveBranches:He,resetFilters:()=>{j(""),pe(!0),ue(!1),xe(!1),he(Eo),se(No),B(jo),He(!1),z(Do),re("all")},toggleFeatureStatusFilter:me=>he(Ce=>Yh(Ce,me,Eo)),togglePhaseStatusFilter:me=>se(Ce=>Yh(Ce,me,No)),toggleTaskStatusFilter:me=>B(Ce=>Yh(Ce,me,jo)),searchQuery:w,setSearchQuery:j,searchActive:Q,matchedTaskIds:ne,matchedFeatureIds:M,matchedPhaseIds:T,sort:R,setSort:z}}function ki({id:e,status:n,variant:r="header",className:s,children:u,ariaLabel:c}){const f=r==="surface"?q2(n):P2(n),h=Vm(n),p=["status-item",r==="surface"?"status-item--surface":"status-item--header",h,s??""].filter(Boolean).join(" ");return o.jsx("div",{id:e,className:p,style:f,"aria-label":c,"data-status":n,children:u})}function ol(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}function dl({value:e,className:n=""}){if(!e)return null;const r=`Last updated ${ol(e)}`;return o.jsx("time",{dateTime:e,title:r,"aria-label":r,className:`text-[11px] text-[var(--text-subtle)] ${n}`.trim(),children:r})}const x1=x.createContext(null);function op({id:e,children:n}){const r=YT({id:e}),s={transform:Gl.Transform.toString(r.transform),transition:r.transition};return o.jsx(x1.Provider,{value:r,children:o.jsx("div",{ref:r.setNodeRef,style:s,className:r.isDragging?"ap-sortable--dragging":"",children:n})})}function cp(){const e=x.useContext(x1);return e?o.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...e.listeners,...e.attributes,children:o.jsx(Bj,{className:"h-4 w-4"})}):null}function v1({phaseId:e,phaseTitle:n,count:r,className:s=""}){if(r<1)return null;const u=`${r} linked requirement${r===1?"":"s"} for phase ${n}`;return o.jsxs(Ve,{to:`/requirements#phase-${e}`,"aria-label":u,title:u,className:`inline-flex min-h-7 items-center gap-1 rounded-md border border-[var(--border)] bg-[var(--surface-elevated)] px-1.5 text-xs font-semibold text-[var(--text-muted)] transition hover:border-[var(--accent)] hover:text-[var(--accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] ${s}`,children:[o.jsx(Jo,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{"aria-hidden":"true",children:r})]})}const up="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function tC(){return o.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"})}function Wy({status:e,doneTasks:n,totalTasks:r,recentlyChanged:s,className:u}){const c=n!=null&&r!=null;return o.jsxs("div",{className:u,children:[s?o.jsx(tC,{}):null,c?o.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",n,"/",r||0,")"]}):null,o.jsx("span",{className:"shrink-0",children:o.jsx(ar,{status:e})})]})}function aC({entry:e,expanded:n,recentlyChanged:r,onToggle:s,isPhaseExpanded:u,onTogglePhase:c,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:h,highlightedTaskIds:p,resumeRequiredIds:g=new Set}){const{feature:y,totalTasks:v,doneTasks:E,allPhases:S,hasActiveTask:w}=e;return o.jsxs("div",{className:`surface-card min-w-0 rounded-[10px] px-3 py-3 transition-colors sm:px-4 ${r?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[o.jsxs(ki,{status:e.display.displayStatus,variant:"header",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${r?"bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]":""}`,children:[o.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[o.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),s()},onPointerDown:j=>j.stopPropagation(),className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":n?`Collapse feature ${y.name}`:`Expand feature ${y.name}`,"aria-expanded":n,children:o.jsx(u0,{className:`h-4 w-4 transition ${n?"rotate-90":"rotate-0"}`})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(cp,{}),o.jsx(rr,{featureNum:y.number,featureId:y.id}),o.jsx(sr,{id:cl({featureNum:y.number}),children:o.jsx("span",{className:"sr-only",children:"Copy feature path"})}),y.shortId?o.jsx(ul,{shortId:y.shortId}):null,w?o.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),o.jsx(Xu,{status:e.display.displayStatus,breakdown:e.display.breakdown,doneTasks:E,totalTasks:v,recentlyChanged:r,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),o.jsx(Ve,{to:`/features/${y.id}`,className:`entity-link--feature ${up} underline-offset-4 hover:underline`,children:y.name}),o.jsx(dl,{value:y.updatedAt,className:"mt-1 block"})]})]}),o.jsx(Xu,{status:e.display.displayStatus,breakdown:e.display.breakdown,doneTasks:E,totalTasks:v,recentlyChanged:r,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),n&&S.length>0?o.jsx("div",{className:"mt-2 ml-1.5 grid grid-cols-1 gap-2 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:j0(e.display.displayStatus)},children:o.jsx(rp,{items:S.map(j=>j.phase.id),strategy:np,children:S.map(j=>o.jsx(op,{id:j.phase.id,children:o.jsx(nC,{feature:y,phaseEntry:j,expanded:u(j.phase.id),recentlyChanged:f(j.phase.id),onToggle:()=>c(j.phase.id),isTaskRecentlyChanged:h,highlightedTaskIds:p,resumeRequiredIds:g})},j.phase.id))})}):null]})}function nC({feature:e,phaseEntry:n,expanded:r,recentlyChanged:s,onToggle:u,isTaskRecentlyChanged:c,highlightedTaskIds:f,resumeRequiredIds:h=new Set}){var S;const{phase:p,totalTasks:g,doneTasks:y,allTasks:v,hasActiveTask:E}=n;return o.jsxs("div",{className:`work-tree-row grid min-w-0 grid-cols-1 gap-2 rounded-[10px] p-3 transition-colors ${s?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[o.jsxs(ki,{status:n.display.displayStatus,variant:"header",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${s?"bg-[color:color-mix(in_srgb,var(--accent)_8%,transparent)]":""}`,children:[o.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[o.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),u()},onPointerDown:w=>w.stopPropagation(),className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":r?`Collapse phase ${p.title}`:`Expand phase ${p.title}`,"aria-expanded":r,children:o.jsx(u0,{className:`h-4 w-4 transition ${r?"rotate-90":"rotate-0"}`})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(cp,{}),o.jsx(rr,{featureNum:e==null?void 0:e.number,phaseNum:p.number,featureId:e.id,phaseId:p.id}),o.jsx(sr,{id:cl({featureNum:e==null?void 0:e.number,phaseNum:p.number}),children:o.jsx("span",{className:"sr-only",children:"Copy phase path"})}),p.shortId?o.jsx(ul,{shortId:p.shortId}):null,p.handoff?o.jsx(Fm,{phaseId:p.id,updatedAt:p.handoffUpdatedAt}):null,o.jsx(v1,{phaseId:p.id,phaseTitle:p.title,count:((S=p.linkedRequirements)==null?void 0:S.length)??0}),E?o.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),o.jsx(Xu,{status:n.display.displayStatus,breakdown:n.display.breakdown,doneTasks:y,totalTasks:g,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),o.jsx(Ve,{to:`/features/${e.id}/phases/${p.id}`,className:`entity-link--phase ${up} underline-offset-4 hover:underline`,children:p.title}),o.jsx(dl,{value:p.updatedAt,className:"mt-1 block"})]})]}),o.jsx(Xu,{status:n.display.displayStatus,breakdown:n.display.breakdown,doneTasks:y,totalTasks:g,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),r?v.length>0?o.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:j0(n.display.displayStatus)},children:o.jsx(rp,{items:v.map(w=>w.id),strategy:np,children:v.map(w=>o.jsx(op,{id:w.id,children:o.jsx(rC,{feature:e,phase:p,task:w,recentlyChanged:c(w.id),highlighted:f==null?void 0:f.has(w.id),resumeRequiredIds:h})},w.id))})}):o.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function rC({feature:e,phase:n,task:r,recentlyChanged:s,highlighted:u,resumeRequiredIds:c=new Set}){return o.jsxs(ki,{id:`task-row-${r.number}`,status:r.status,variant:"surface",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${s?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""} ${u?"ap-search-hit":""}`,children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(cp,{}),o.jsx(rr,{featureNum:e==null?void 0:e.number,phaseNum:n.number,taskNum:r.number,featureId:e.id,phaseId:n.id,taskId:r.id}),o.jsx(sr,{id:cl({featureNum:e==null?void 0:e.number,phaseNum:n.number,taskNum:r.number}),children:o.jsx("span",{className:"sr-only",children:"Copy task path"})}),r.shortId?o.jsx(ul,{shortId:r.shortId}):null,o.jsx(nc,{priority:r.priority}),r.status==="in-progress"?o.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,c!=null&&c.has(r.id)?o.jsx("span",{title:"Paused and ready for resume — resume this task before starting new work.","aria-label":"Resume required",className:"inline-flex items-center text-[var(--accent)]",children:o.jsx(m0,{className:"h-3.5 w-3.5"})}):null]}),o.jsx(Wy,{status:r.status,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),o.jsx(Ve,{to:`/features/${e.id}/phases/${n.id}/tasks/${r.id}`,className:`entity-link--task ${up} underline-offset-4 hover:underline`,children:r.title}),o.jsx(dl,{value:r.updatedAt,className:"mt-1 block"})]}),o.jsx(Wy,{status:r.status,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]})}var O=(function(e){return e.FIELD_NAME="FIELD_NAME",e.COLON="COLON",e.VALUE="VALUE",e.QUOTED_VALUE="QUOTED_VALUE",e.AND="AND",e.OR="OR",e.NOT="NOT",e.COMPARISON_OP="COMPARISON_OP",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.SAVED_SEARCH="SAVED_SEARCH",e.HISTORY_REF="HISTORY_REF",e.PREFIX_OP="PREFIX_OP",e.WILDCARD="WILDCARD",e.REGEX="REGEX",e.RANGE="RANGE",e.TILDE="TILDE",e.BOOST="BOOST",e.WHITESPACE="WHITESPACE",e.UNKNOWN="UNKNOWN",e})({}),cn=(function(e){return e[e.EXPECT_TERM=0]="EXPECT_TERM",e[e.EXPECT_VALUE=1]="EXPECT_VALUE",e})(cn||{}),gi=class{constructor(e,n){pa(this,"input");pa(this,"pos");pa(this,"state");pa(this,"tokens");pa(this,"options");this.input=e,this.pos=0,this.state=cn.EXPECT_TERM,this.tokens=[],this.options=n||{}}tokenize(){for(this.tokens=[],this.pos=0,this.state=cn.EXPECT_TERM;this.pos<this.input.length;)this.state===cn.EXPECT_VALUE?this.readValue():this.readTerm();return this.tokens}peek(){return this.input[this.pos]}peekAt(e){return this.input[this.pos+e]}advance(){return this.input[this.pos++]}isWhitespace(e){return e===" "||e===" "||e===`
313
- `||e==="\r"}isAlpha(e){return/[a-zA-Z_]/.test(e)}isAlphaNumeric(e){return/[a-zA-Z0-9_.\-]/.test(e)}readWhitespace(){const e=this.pos;for(;this.pos<this.input.length&&this.isWhitespace(this.peek());)this.advance();this.tokens.push({type:O.WHITESPACE,value:this.input.slice(e,this.pos),start:e,end:this.pos})}readQuotedString(){const e=this.pos,n=this.advance();for(;this.pos<this.input.length;){const r=this.advance();if(r==="\\"&&this.pos<this.input.length)this.advance();else if(r===n)break}this.tokens.push({type:O.QUOTED_VALUE,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.tryReadModifier(),this.state=cn.EXPECT_TERM}readTerm(){const e=this.peek();if(this.isWhitespace(e)){this.readWhitespace();return}if(e==='"'){this.readQuotedString();return}if(e==="("){this.tokens.push({type:O.LPAREN,value:"(",start:this.pos,end:this.pos+1}),this.advance();return}if(e===")"){this.tokens.push({type:O.RPAREN,value:")",start:this.pos,end:this.pos+1}),this.advance();return}if(e==="~"||e==="^"){const r=this.pos,s=e==="~"?O.TILDE:O.BOOST;for(this.advance();this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:s,value:this.input.slice(r,this.pos),start:r,end:this.pos});return}if(e==="["||e==="{"){this.readRangeValue();return}if(e==="#"&&this.options.savedSearches){this.readSavedSearch();return}if(e==="!"&&this.options.historySearch){this.readHistoryRef();return}if(e==="-"||e==="+"){const r=this.peekAt(1);if(r&&(this.isAlpha(r)||r==='"'||r==="("||r==="#"||r==="!"||r==="["||r==="{")||!r||r===")"||r===" "||r===" "||r===`
314
- `||r==="\r"){this.tokens.push({type:O.PREFIX_OP,value:e,start:this.pos,end:this.pos+1}),this.advance();return}}if(e==="&"&&this.peekAt(1)==="&"){this.tokens.push({type:O.AND,value:"&&",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if(e==="|"&&this.peekAt(1)==="|"){this.tokens.push({type:O.OR,value:"||",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if((e===">"||e==="<")&&this.state===cn.EXPECT_TERM){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:O.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos}),this.state=cn.EXPECT_VALUE;return}if(e==="/"){this.readRegex();return}const n=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!=="("&&this.peek()!==")"&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^"&&!(this.peek()==="&"&&this.peekAt(1)==="&")&&!(this.peek()==="|"&&this.peekAt(1)==="|");){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(this.peek()===":"){this.pos>n&&this.tokens.push({type:O.FIELD_NAME,value:this.input.slice(n,this.pos),start:n,end:this.pos}),this.tokens.push({type:O.COLON,value:":",start:this.pos,end:this.pos+1}),this.advance(),this.state=cn.EXPECT_VALUE;return}this.advance()}if(this.pos>n){const r=this.input.slice(n,this.pos),s=r.toUpperCase();s==="AND"?this.tokens.push({type:O.AND,value:r,start:n,end:this.pos}):s==="OR"?this.tokens.push({type:O.OR,value:r,start:n,end:this.pos}):s==="NOT"?this.tokens.push({type:O.NOT,value:r,start:n,end:this.pos}):r.includes("*")||r.includes("?")?this.tokens.push({type:O.WILDCARD,value:r,start:n,end:this.pos}):this.tokens.push({type:O.VALUE,value:r,start:n,end:this.pos}),this.tryReadModifier()}}readValue(){const e=this.peek();if(this.isWhitespace(e)){this.readWhitespace(),this.state=cn.EXPECT_TERM;return}if(e==='"'){this.readQuotedString(),this.state=cn.EXPECT_TERM;return}if(e==="("||e===")"){this.state=cn.EXPECT_TERM,this.readTerm();return}if(e===">"||e==="<"){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:O.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos});return}if(e==="["||e==="{"){this.readRangeValue();return}if(e==="/"){this.readRegex(),this.state=cn.EXPECT_TERM;return}const n=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!==")"&&this.peek()!=="("&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^";){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}this.advance()}if(this.pos>n){const r=this.input.slice(n,this.pos);r.includes("*")||r.includes("?")?this.tokens.push({type:O.WILDCARD,value:r,start:n,end:this.pos}):this.tokens.push({type:O.VALUE,value:r,start:n,end:this.pos}),this.tryReadModifier()}this.state=cn.EXPECT_TERM}readRangeValue(){const e=this.pos;for(this.advance();this.pos<this.input.length&&this.peek()!=="]"&&this.peek()!=="}";)this.advance();this.pos<this.input.length&&(this.peek()==="]"||this.peek()==="}")&&this.advance(),this.tokens.push({type:O.RANGE,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.state=cn.EXPECT_TERM}tryReadModifier(){for(;this.pos<this.input.length&&(this.peek()==="~"||this.peek()==="^");){const e=this.pos,n=this.advance()==="~"?O.TILDE:O.BOOST;for(;this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:n,value:this.input.slice(e,this.pos),start:e,end:this.pos})}}readRegex(){const e=this.pos;for(this.advance();this.pos<this.input.length;){const n=this.peek();if(n==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(n==="/"){this.advance(),this.tokens.push({type:O.REGEX,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.tryReadModifier(),this.state=cn.EXPECT_TERM;return}this.advance()}this.tokens.push({type:O.VALUE,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.state=cn.EXPECT_TERM}readSavedSearch(){const e=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:O.SAVED_SEARCH,value:this.input.slice(e,this.pos),start:e,end:this.pos})}readHistoryRef(){const e=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:O.HISTORY_REF,value:this.input.slice(e,this.pos),start:e,end:this.pos})}},ws=class{constructor(e){pa(this,"tokens");pa(this,"pos");pa(this,"nonWsTokens");pa(this,"errors",[]);this.tokens=e,this.nonWsTokens=e.filter(n=>n.type!==O.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(e){if(e.type!==O.QUOTED_VALUE)return!1;const n=e.value;if(n.length<2)return!0;const r=n[0];return n[n.length-1]!==r}stripQuotes(e){const n=e.value;return this.isUnclosedQuote(e)?n.slice(1):n.slice(1,-1)}checkUnclosedQuote(e){this.isUnclosedQuote(e)&&this.errors.push({type:"Error",value:e.value[0],message:"Missing closing quote",start:e.start,end:e.start+1})}parse(){if(this.nonWsTokens.length===0)return null;let e=this.parseOr();for(;this.peek();){const n=this.peek();if(n.type===O.RPAREN)this.advance(),this.errors.push({type:"Error",value:n.value,message:"Unexpected closing parenthesis",start:n.start,end:n.end});else{const r=this.parseOr();e={type:"BooleanExpr",operator:"AND",left:e,right:r,implicit:!0,start:e.start,end:r.end}}}return e}peek(){return this.nonWsTokens[this.pos]}advance(){return this.nonWsTokens[this.pos++]}match(e){var n;if(((n=this.peek())==null?void 0:n.type)===e)return this.advance()}parseOr(){var n;let e=this.parseAnd();for(;((n=this.peek())==null?void 0:n.type)===O.OR;){const r=this.advance(),s=this.parseAnd();if(s.type==="Error"&&s.value===""){this.errors.push({type:"Error",value:r.value,message:"Missing search term after OR",start:r.start,end:r.end});break}e={type:"BooleanExpr",operator:"OR",left:e,right:s,sourceOperator:r.value,start:e.start,end:s.end}}return e}parseAnd(){let e=this.parseNot();for(;;){const n=this.peek();if(!n)break;if(n.type===O.AND){const r=this.advance(),s=this.parseNot();if(s.type==="Error"&&s.value===""){this.errors.push({type:"Error",value:r.value,message:"Missing search term after AND",start:r.start,end:r.end});break}e={type:"BooleanExpr",operator:"AND",left:e,right:s,sourceOperator:r.value,start:e.start,end:s.end}}else{if(n.type===O.OR||n.type===O.RPAREN)break;{const r=this.parseNot();e={type:"BooleanExpr",operator:"AND",left:e,right:r,implicit:!0,start:e.start,end:r.end}}}}return e}parseNot(){var e;if(((e=this.peek())==null?void 0:e.type)===O.NOT){const n=this.advance(),r=this.parsePrimary();return r.type==="Error"&&r.value===""?(this.errors.push({type:"Error",value:n.value,message:"Missing search term after NOT",start:n.start,end:n.end}),r):{type:"Not",expression:r,sourceOperator:n.value,start:n.start,end:r.end}}return this.parsePrimary()}applyGroupBoost(e){var n;if(((n=this.peek())==null?void 0:n.type)===O.BOOST){const r=this.advance(),s=r.value.slice(1),u=parseFloat(s);e.boost=isNaN(u)?1:u,e.end=r.end}return e}applyModifiers(e){var n,r;if(e.type!=="BareTerm"&&e.type!=="FieldValue")return e;if(((n=this.peek())==null?void 0:n.type)===O.TILDE){const s=this.advance(),u=s.value.slice(1),c=parseInt(u,10);e.quoted?e.proximity=isNaN(c)?0:c:e.fuzzy=isNaN(c)?0:c,e.end=s.end}if(((r=this.peek())==null?void 0:r.type)===O.BOOST){const s=this.advance(),u=s.value.slice(1),c=parseFloat(u);e.boost=isNaN(c)?1:c,e.end=s.end}return e}parseRangeBound(e,n){const r=e.length-e.trimStart().length,s=e.trim();return s.startsWith('"')&&s.endsWith('"')&&s.length>=2?{value:s.slice(1,-1),quoted:!0,valueStart:n+r,valueEnd:n+r+s.length}:s.startsWith('"')?{value:s.slice(1),quoted:!0,valueStart:n+r,valueEnd:n+r+s.length}:{value:s,quoted:!1,valueStart:n+r,valueEnd:n+r+s.length}}parseRange(e){const n=e.value,r=n[0],s=r==="[",u=n[n.length-1],c=u==="]"||u==="}",f=u==="]";c||this.errors.push({type:"Error",value:r,message:"Unclosed range expression",start:e.start,end:e.start+1});const h=c?n.slice(1,-1):n.slice(1),p=h.match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/),g=e.start+1;if(!p){this.errors.push({type:"Error",value:n,message:"Range expression missing TO keyword",start:e.start,end:e.end});const S=this.parseRangeBound(h,g);return{type:"Range",lower:S.value,upper:"",lowerInclusive:s,upperInclusive:c?f:!0,lowerQuoted:S.quoted,upperQuoted:!1,lowerStart:S.valueStart,lowerEnd:S.valueEnd,upperStart:e.end,upperEnd:e.end,start:e.start,end:e.end}}const y=this.parseRangeBound(p[1],g),v=g+p[1].length+(h.length-p[1].length-p[2].length),E=this.parseRangeBound(p[2],v);return{type:"Range",lower:y.value,upper:E.value,lowerInclusive:s,upperInclusive:c?f:!0,lowerQuoted:y.quoted,upperQuoted:E.quoted,lowerStart:y.valueStart,lowerEnd:y.valueEnd,upperStart:E.valueStart,upperEnd:E.valueEnd,start:e.start,end:e.end}}parsePrimary(){var r,s,u;const e=this.peek();if(!e)return{type:"Error",value:"",message:"Unexpected end of input",start:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0,end:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0};if(e.type===O.AND){const c=this.advance();return this.errors.push({type:"Error",value:c.value,message:"Unexpected AND",start:c.start,end:c.end}),this.parsePrimary()}if(e.type===O.OR){const c=this.advance();return this.errors.push({type:"Error",value:c.value,message:"Unexpected OR",start:c.start,end:c.end}),this.parsePrimary()}if(e.type===O.PREFIX_OP){const c=this.advance(),f=this.parsePrimary();return c.value==="-"?{type:"Not",expression:f,sourceOperator:c.value,start:c.start,end:f.end}:{...f,start:c.start}}if(e.type===O.LPAREN){const c=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const g=this.match(O.RPAREN);g||this.errors.push({type:"Error",value:c.value,message:"Unclosed parenthesis",start:c.start,end:c.end});const y={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:c.end,end:c.end},start:c.start,end:g?g.end:c.end};return this.applyGroupBoost(y)}const f=this.parseOr(),h=this.match(O.RPAREN);h||this.errors.push({type:"Error",value:c.value,message:"Missing closing parenthesis",start:c.start,end:c.end});const p={type:"Group",expression:f,start:c.start,end:h?h.end:f.end};return this.applyGroupBoost(p)}if(e.type===O.SAVED_SEARCH){const c=this.advance();return{type:"SavedSearch",name:c.value.slice(1),start:c.start,end:c.end}}if(e.type===O.HISTORY_REF){const c=this.advance();return{type:"HistoryRef",ref:c.value.slice(1),start:c.start,end:c.end}}if(e.type===O.FIELD_NAME){const c=this.advance(),f=this.match(O.COLON);if(f){let h=":";const p=this.match(O.COMPARISON_OP);if(p&&(h=p.value),((r=this.peek())==null?void 0:r.type)===O.LPAREN){const y=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const w=this.match(O.RPAREN);w||this.errors.push({type:"Error",value:y.value,message:"Unclosed parenthesis",start:y.start,end:y.end});const j={type:"FieldGroup",field:c.value,expression:{type:"BareTerm",value:"",quoted:!1,start:y.end,end:y.end},start:c.start,end:w?w.end:y.end};return this.applyGroupBoost(j)}const v=this.parseOr(),E=this.match(O.RPAREN);E||this.errors.push({type:"Error",value:y.value,message:"Missing closing parenthesis",start:y.start,end:y.end});const S={type:"FieldGroup",field:c.value,expression:v,start:c.start,end:E?E.end:v.end};return this.applyGroupBoost(S)}if(((s=this.peek())==null?void 0:s.type)===O.RANGE){const y=this.advance(),v=this.parseRange(y);return v.field=c.value,v.start=c.start,v}if(((u=this.peek())==null?void 0:u.type)===O.REGEX){const y=this.advance();return{type:"Regex",pattern:y.value.slice(1,-1),start:c.start,end:y.end}}const g=this.peek();if(g&&(g.type===O.VALUE||g.type===O.QUOTED_VALUE||g.type===O.WILDCARD)){const y=this.advance(),v=y.type===O.QUOTED_VALUE;v&&this.checkUnclosedQuote(y);const E=v?this.stripQuotes(y):y.value;return this.applyModifiers({type:"FieldValue",field:c.value,operator:h,value:E,quoted:v,start:c.start,end:y.end})}return{type:"FieldValue",field:c.value,operator:h,value:"",quoted:!1,start:c.start,end:p?p.end:f.end}}return{type:"BareTerm",value:c.value,quoted:!1,start:c.start,end:c.end}}if(e.type===O.COMPARISON_OP){const c=this.advance(),f=this.peek();if(f&&(f.type===O.VALUE||f.type===O.QUOTED_VALUE)){const h=this.advance();return{type:"BareTerm",value:c.value+h.value,quoted:!1,start:c.start,end:h.end}}return{type:"Error",value:c.value,message:"Comparison operator without value",start:c.start,end:c.end}}if(e.type===O.QUOTED_VALUE){const c=this.advance();return this.checkUnclosedQuote(c),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(c),quoted:!0,start:c.start,end:c.end})}if(e.type===O.WILDCARD){const c=this.advance();return this.applyModifiers({type:"BareTerm",value:c.value,quoted:!1,start:c.start,end:c.end})}if(e.type===O.RANGE){const c=this.advance();return this.parseRange(c)}if(e.type===O.REGEX){const c=this.advance();return{type:"Regex",pattern:c.value.slice(1,-1),start:c.start,end:c.end}}if(e.type===O.VALUE){const c=this.advance();return this.applyModifiers({type:"BareTerm",value:c.value,quoted:!1,start:c.start,end:c.end})}if(e.type===O.RPAREN){const c=this.advance();return this.errors.push({type:"Error",value:c.value,message:"Unexpected closing parenthesis",start:c.start,end:c.end}),{type:"Error",value:c.value,message:"Unexpected closing parenthesis",start:c.start,end:c.end}}const n=this.advance();return{type:"Error",value:n.value,message:`Unexpected token: ${n.value}`,start:n.start,end:n.end}}static getCursorContext(e,n){let r,s;for(const c of e)if(c.type!==O.WHITESPACE){if(n>=c.start&&n<=c.end){r=c;break}c.end<=n&&(s=c)}const u=c=>{let f=0;for(let h=c;h>=0;h--){const p=e[h];if(p.type!==O.WHITESPACE){if(p.type===O.RPAREN){f++;continue}if(p.type===O.LPAREN){if(f>0){f--;continue}for(let g=h-1;g>=0;g--)if(e[g].type!==O.WHITESPACE){if(e[g].type===O.COLON){for(let y=g-1;y>=0;y--)if(e[y].type!==O.WHITESPACE){if(e[y].type===O.FIELD_NAME)return e[y].value;break}}break}}}}return""};if((r==null?void 0:r.type)===O.COLON){let c="";const f=e.indexOf(r);for(let h=f-1;h>=0;h--){if(e[h].type===O.FIELD_NAME){c=e[h].value;break}if(e[h].type!==O.WHITESPACE)break}if(!c&&n===r.start)return{type:"FIELD_NAME",partial:"",token:r};if(n===r.end){for(let h=f+1;h<e.length;h++)if(e[h].type!==O.WHITESPACE){if(e[h].type===O.VALUE||e[h].type===O.QUOTED_VALUE||e[h].type===O.WILDCARD||e[h].type===O.RANGE)return{type:"FIELD_VALUE",partial:e[h].type===O.QUOTED_VALUE?e[h].value.slice(1,e[h].value.endsWith('"')||e[h].value.endsWith("'")?-1:void 0):e[h].value,fieldName:c,token:e[h]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:c,token:void 0}}if((r==null?void 0:r.type)===O.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===O.HISTORY_REF)return{type:"HISTORY_REF",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===O.RANGE){const c=e.indexOf(r);let f="";for(let h=c-1;h>=0;h--){if(e[h].type===O.FIELD_NAME){f=e[h].value;break}if(!(e[h].type===O.WHITESPACE||e[h].type===O.COLON))break}return{type:"RANGE",partial:"",fieldName:f,token:r}}if((s==null?void 0:s.type)===O.COLON||(s==null?void 0:s.type)===O.COMPARISON_OP){const c=e.indexOf(s);let f="";for(let h=c-1;h>=0;h--){if(e[h].type===O.FIELD_NAME){f=e[h].value;break}if(!(e[h].type===O.WHITESPACE||e[h].type===O.COLON||e[h].type===O.COMPARISON_OP))break}return r&&(r.type===O.VALUE||r.type===O.QUOTED_VALUE||r.type===O.WILDCARD)?{type:"FIELD_VALUE",partial:r.type===O.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:f,token:r}:{type:"FIELD_VALUE",partial:"",fieldName:f,token:s}}if((r==null?void 0:r.type)===O.VALUE||(r==null?void 0:r.type)===O.QUOTED_VALUE||(r==null?void 0:r.type)===O.WILDCARD){const c=e.indexOf(r);for(let f=c-1;f>=0;f--)if(e[f].type!==O.WHITESPACE){if(e[f].type===O.COLON||e[f].type===O.COMPARISON_OP){let h="";for(let p=f-1;p>=0;p--){if(e[p].type===O.FIELD_NAME){h=e[p].value;break}if(!(e[p].type===O.WHITESPACE||e[p].type===O.COLON||e[p].type===O.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:r.type===O.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:h,token:r}}break}}if((r==null?void 0:r.type)===O.QUOTED_VALUE)return{type:"FIELD_NAME",partial:r.value,token:r};if((r==null?void 0:r.type)===O.FIELD_NAME||(r==null?void 0:r.type)===O.VALUE){const c=u(e.indexOf(r));return c?{type:"FIELD_VALUE",partial:r.value,fieldName:c,token:r}:{type:"FIELD_NAME",partial:r.value,token:r}}if((s==null?void 0:s.type)===O.PREFIX_OP){const c=u(e.indexOf(s));return c?{type:"FIELD_VALUE",partial:"",fieldName:c,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(s&&(s.type===O.AND||s.type===O.OR||s.type===O.NOT)){const c=u(e.indexOf(s));return c?{type:"FIELD_VALUE",partial:"",fieldName:c,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(e.length===0||e.every(c=>c.type===O.WHITESPACE))return{type:"EMPTY",partial:""};if((r==null?void 0:r.type)===O.LPAREN||(s==null?void 0:s.type)===O.LPAREN){const c=(r==null?void 0:r.type)===O.LPAREN?r:s,f=u(e.indexOf(c));return f?{type:"FIELD_VALUE",partial:"",fieldName:f,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if((r==null?void 0:r.type)===O.TILDE||(r==null?void 0:r.type)===O.BOOST)return{type:"OPERATOR",partial:""};if(s&&(s.type===O.VALUE||s.type===O.QUOTED_VALUE||s.type===O.RPAREN||s.type===O.RANGE||s.type===O.TILDE||s.type===O.BOOST)){const c=u(e.indexOf(s));return c?{type:"FIELD_VALUE",partial:"",fieldName:c,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function bm(e,n){if(n<e.start||n>e.end)return null;if(e.type==="BooleanExpr"){const r=bm(e.left,n);if(r)return r;const s=bm(e.right,n);return s||null}return e}function lC(e,n,r){if(!e)return null;const s=bm(e,r);if(!s)return null;let u=s.start,c=s.end;const f=n.slice(c).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(f)return c+=f[0].length,{start:u,end:c};const h=n.slice(0,u).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return h&&h.index!==void 0&&h.index>0&&(u-=h[0].length),{start:u,end:c}}var sC={fieldName:"#0550ae",fieldValue:"#1a7f37",operator:"#cf222e",booleanOp:"#8250df",quoted:"#0a3069",paren:"#656d76",savedSearch:"#bf8700",historyRef:"#6639ba",wildcard:"#953800",error:"#cf222e",background:"#ffffff",text:"#1f2328",placeholder:"#656d76",cursor:"#1f2328",dropdownSelected:"#0969da",dropdownHover:"#f6f8fa",regexDelimiter:"#cf222e",regexCharClass:"#0550ae",regexGroup:"#656d76",regexEscape:"#953800",regexQuantifier:"#8250df",regexAnchor:"#cf222e",regexAlternation:"#8250df",regexText:"#0a3069",matchedParenBg:"#fff3cd",warning:"#d4a72c",valueTypes:{}},iC={fontFamily:"'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace",fontSize:"14px",lineHeight:"1.5",inputMinHeight:"40px",inputPadding:"8px 12px",inputBorderWidth:"2px",inputBorderColor:"#d0d7de",inputBorderRadius:"8px",inputFocusBorderColor:"#0969da",inputFocusShadow:"0 0 0 3px rgba(9, 105, 218, 0.3)",dropdownBorderColor:"#d0d7de",dropdownBorderRadius:"8px",dropdownShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",dropdownMaxHeight:"300px",dropdownMinWidth:"200px",dropdownMaxWidth:"400px",dropdownZIndex:99999,dropdownItemPadding:"6px 12px",dropdownItemFontSize:"13px",dropdownItemContentGap:"8px",typeBadgeBg:"#eef1f5",typeBadgeSelectedBg:"rgba(255,255,255,0.2)",typeBadgeColor:"#656d76",typeBadgeSelectedColor:"#ffffff"},oC=["AND","OR","NOT"];function Jy(e){return e.replace(/\r\n/g,`
315
- `).replace(/\r/g,`
316
- `).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036\u00AB\u00BB]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/[\u00A0\u202F\u2007]/g," ").replace(/[\uFF01-\uFF5E]/g,n=>String.fromCharCode(n.charCodeAt(0)-65248))}var eb={"(":")","[":"]",'"':'"',"'":"'"};function cC(e,n,r,s,u){const c=e.slice(0,n),f=e.slice(n,r),h=e.slice(r);return{newValue:c+s+f+u+h,newCursorPos:r+2,newSelStart:n+1,newSelEnd:r+1}}function uC(e){if(!e.textContent)return"";const n=[];function r(s){var u;if(s.nodeType===Node.TEXT_NODE)n.push(s.textContent||"");else if(s.nodeName==="BR")(u=s.hasAttribute)!=null&&u.call(s,"data-sentinel")||n.push(`
317
- `);else for(let c=0;c<s.childNodes.length;c++)r(s.childNodes[c])}return r(e),n.join("")}function tb(e,n,r){let s=-1,u=-1;for(let c=0;c<e.length;c++){const f=e[c];n>=f.start&&n<=f.end&&(s=c),u===-1&&r>=f.start&&r<=f.end&&(u=c)}return[s,u]}function dC(e,n,r){if(e){let s=e.end;if(e.type===O.FIELD_NAME&&r){const u=r.indexOf(e);if(u>=0){for(let c=u+1;c<r.length;c++)if(r[c].type!==O.WHITESPACE){r[c].type===O.COLON&&(s=r[c].end);break}}}return{start:e.start,end:s}}return{start:n,end:n}}var Zh=class y1{constructor(n,r=[],s=[],u=10,c={}){pa(this,"fields");pa(this,"fieldMap");pa(this,"savedSearches");pa(this,"searchHistory");pa(this,"maxSuggestions");pa(this,"options");pa(this,"defaultFieldName");pa(this,"defaultFieldShowFieldSuggs",!1);this.fields=n,this.fieldMap=new Map(n.map(f=>[f.name,f]));for(const f of n)if(f.aliases)for(const h of f.aliases)this.fieldMap.set(h,f);this.savedSearches=r,this.searchHistory=s,this.maxSuggestions=u,this.options={showSavedSearchHint:c.showSavedSearchHint??!1,showHistoryHint:c.showHistoryHint??!1}}resolveField(n){return this.fieldMap.get(n)}updateSavedSearches(n){this.savedSearches=n}updateSearchHistory(n){this.searchHistory=n}setDefaultField(n){this.defaultFieldName=n==null?void 0:n.name,this.defaultFieldShowFieldSuggs=(n==null?void 0:n.showFieldSuggestions)??!1}getSuggestions(n,r){let s=ws.getCursorContext(n,r);const u=dC(s.token,r,n);if(this.defaultFieldName&&(s.type==="FIELD_NAME"||s.type==="EMPTY")){s={...s,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const c=this.resolveField(this.defaultFieldName);if((c==null?void 0:c.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:c.name,context:s};const f=this.getValueSuggestions(c,s.partial,u.start,u.end);if(this.defaultFieldShowFieldSuggs){const h=this.getFieldSuggestions(s.partial,u.start,u.end);return{suggestions:[...f,...h],showDatePicker:!1,context:s}}return{suggestions:f,showDatePicker:!1,context:s}}switch(s.type){case"FIELD_NAME":case"EMPTY":{const c=this.getFieldSuggestions(s.partial,u.start,u.end),f=!s.partial&&c.length>0?this.getSpecialHints(u.start,u.end):[];return{suggestions:this.sortByPriority([...c,...f]),showDatePicker:!1,context:s}}case"FIELD_VALUE":{const c=s.fieldName?this.resolveField(s.fieldName):void 0;return(c==null?void 0:c.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:c.name,context:s}:{suggestions:this.getValueSuggestions(c,s.partial,u.start,u.end),showDatePicker:!1,context:s}}case"OPERATOR":{const c=this.getOperatorSuggestions(s.partial,u.start,u.end),f=this.getFieldSuggestions("",u.start,u.end),h=this.getSpecialHints(u.start,u.end);return{suggestions:this.sortByPriority([...c,...f,...h]),showDatePicker:!1,context:s}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(s.partial,u.start,u.end),showDatePicker:!1,context:s};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(s.partial,u.start,u.end),showDatePicker:!1,context:s};case"RANGE":{const c=s.fieldName?this.resolveField(s.fieldName):void 0;return(c==null?void 0:c.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:c.name,context:s}:{suggestions:[],showDatePicker:!1,context:s}}default:return{suggestions:[],showDatePicker:!1,context:s}}}getFieldSuggestions(n,r,s){const u=n.toLowerCase();return this.fields.filter(c=>!c.hide).map(c=>{const f=c.name.toLowerCase(),h=(c.label||"").toLowerCase(),p=(c.aliases||[]).map(y=>y.toLowerCase());let g=0;return f.startsWith(u)?g=4:h.startsWith(u)||p.some(y=>y.startsWith(u))?g=3:f.includes(u)?g=2:(h.includes(u)||p.some(y=>y.includes(u)))&&(g=1),{field:c,score:g}}).filter(c=>c.score>0).sort((c,f)=>f.score-c.score).slice(0,this.maxSuggestions).map(c=>({text:c.field.name+":",label:c.field.label||c.field.name,description:c.field.description,type:c.field.type,replaceStart:r,replaceEnd:s,matchPartial:n,priority:10}))}getValueSuggestions(n,r,s,u){if(!n)return[];if(n.type==="boolean")return["true","false"].filter(c=>c.startsWith(r.toLowerCase())).map(c=>({text:c,label:c,type:"boolean",replaceStart:s,replaceEnd:u,matchPartial:r}));if(n.placeholder!==!1){const c=n.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[n.type];if(c)return[{text:"",label:c,type:"hint",replaceStart:s,replaceEnd:u}]}return[]}getOperatorSuggestions(n,r,s){const u=n.toLowerCase();return oC.filter(c=>c.toLowerCase().startsWith(u)).map(c=>({text:c+" ",label:c,description:c==="AND"?"Both conditions must match":c==="OR"?"Either condition must match":"Negate the following condition",type:"operator",replaceStart:r,replaceEnd:s,matchPartial:n,priority:30}))}sortByPriority(n){return n.sort((r,s)=>(s.priority??0)-(r.priority??0))}getSpecialHints(n,r){const s=[],u=this.savedSearches.length>0||this.options.hasSavedSearchProvider,c=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&u&&s.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:n,replaceEnd:r,priority:20}),this.options.showHistoryHint&&c&&s.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:n,replaceEnd:r,priority:20}),s}getSavedSearchSuggestions(n,r,s){return this.savedSearches.slice(0,this.maxSuggestions).map(u=>({text:u.query,label:u.label||u.query,description:u.description,type:"savedSearch",replaceStart:r,replaceEnd:s,matchPartial:n,sourceData:u}))}getHistorySuggestions(n,r,s){return this.searchHistory.slice(0,this.maxSuggestions).map(u=>({text:y1.wrapHistoryQuery(u.query),label:u.label||u.query,description:u.description,type:"history",replaceStart:r,replaceEnd:s,matchPartial:n,sourceData:u}))}static wrapHistoryQuery(n){try{const r=new ws(new gi(n).tokenize()).parse();if(r&&r.type==="BooleanExpr")return"("+n+")"}catch{}return n}};function Cu(e){if(e==="")return null;const n=Number(e);return isNaN(n)?`"${e}" is not a valid number`:null}var fC=[/^\d{4}-\d{2}-\d{2}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^now$/i,/^now[+-]\d+[dhms]$/i];function hC(e){for(const n of fC)if(n.test(e))return!0;return!isNaN(Date.parse(e))}function Wh(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function mC(e){if(/^now$/i.test(e))return new Date;const n=e.match(/^now([+-])(\d+)([dhms])$/i);if(n){const u=new Date,c=n[1]==="+"?1:-1,f=parseInt(n[2],10);switch(n[3].toLowerCase()){case"d":u.setDate(u.getDate()+c*f);break;case"h":u.setHours(u.getHours()+c*f);break;case"m":u.setMinutes(u.getMinutes()+c*f);break;case"s":u.setSeconds(u.getSeconds()+c*f);break}return u}const r=e.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/);if(r)return new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10));const s=new Date(e);return isNaN(s.getTime())?null:s}function ab(e,n){return new Date(e,n+1,0).getDate()}function pC(e,n){return new Date(e,n,1).getDay()}function Ro(e,n){return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}function nb(e,n,r){if(!n||!r)return!1;const s=e.getTime(),u=n.getTime(),c=r.getTime();return s>=Math.min(u,c)&&s<=Math.max(u,c)}var gC=["January","February","March","April","May","June","July","August","September","October","November","December"];function xC(e){return gC[e]}function Au(e,n){if(e==="")return null;const r=e.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(r){const s=Jh(r[1].trim(),n);if(s)return`Range start: ${s}`;const u=Jh(r[2].trim(),n);return u?`Range end: ${u}`:null}return Jh(e,n)}function Jh(e,n){return/^now(\/[dhms])?$/i.test(e)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(e)||n&&n(e)!==null||hC(e)?null:`"${e}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function Du(e){return e==null?null:typeof e=="string"?{message:e,severity:"error"}:e}var Ou={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function Mu(e){if(e.length<=1)return e;const n=[...e].sort((s,u)=>{const c=Ou[s.type??"SYNTAX_ERROR"],f=Ou[u.type??"SYNTAX_ERROR"];return c!==f?c-f:s.start-u.start}),r=[];for(const s of n)r.some(u=>Ou[u.type??"SYNTAX_ERROR"]<Ou[s.type??"SYNTAX_ERROR"]&&u.start<=s.start&&u.end>=s.end)||r.push(s);return r}var rb=class{constructor(e){pa(this,"fields");this.fields=new Map(e.map(n=>[n.name,n]));for(const n of e)if(n.aliases)for(const r of n.aliases)this.fields.set(r,n)}validate(e,n,r,s){if(!e)return[];const u=[],c=s?this.fields.get(s):void 0;return this.walkNode(e,u,n,r,c),this.checkAmbiguousPrecedence(e,u),u}walkNode(e,n,r,s,u){switch(e.type){case"BareTerm":if(e.fuzzy!==void 0&&e.fuzzy>2&&n.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${e.fuzzy})`,start:e.start,end:e.end,type:"SYNTAX_ERROR"}),e.proximity!==void 0&&e.proximity<0&&n.push({message:`Proximity value must be non-negative (got ${e.proximity})`,start:e.start,end:e.end,type:"SYNTAX_ERROR"}),e.boost!==void 0&&e.boost<=0&&n.push({message:`Boost value must be positive (got ${e.boost})`,start:e.start,end:e.end,type:"SYNTAX_ERROR"}),u&&e.value!==""){let c=null;switch(u.type){case"number":c=Cu(e.value);break;case"date":c=Au(e.value,s);break;case"boolean":e.value!=="true"&&e.value!=="false"&&(c=`Expected "true" or "false", got "${e.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(e.value)&&!e.value.includes("*")&&(c=`"${e.value}" is not a valid IP address`);break}c&&n.push({message:c,start:e.start,end:e.end,field:u.name,type:"INVALID_VALUE"})}if(r&&e.value!==""){const c=Du(r({value:e.value,position:"bare_term",quoted:e.quoted,fieldName:u==null?void 0:u.name,fieldConfig:u}));c&&n.push({message:c.message,start:e.start,end:e.end,severity:c.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(e,n),e.field&&e.field!=="*"){const c=this.fields.get(e.field);c?this.validateRangeBounds(c,e,n,r,s):n.push({message:`Unknown field: "${e.field}"`,start:e.start,end:e.start+e.field.length,field:e.field,type:"UNKNOWN_FIELD"})}break;case"FieldValue":{if(e.field==="*")return;if(e.value===""){const h=e.operator===":"?":":e.operator;n.push({message:`Missing value after "${e.field}${h}"`,start:e.start,end:e.end,field:e.field,type:"SYNTAX_ERROR"});return}const c=this.fields.get(e.field);if(!c){n.push({message:`Unknown field: "${e.field}"`,start:e.start,end:e.start+e.field.length,field:e.field,type:"UNKNOWN_FIELD"});return}e.fuzzy!==void 0&&e.fuzzy>2&&n.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${e.fuzzy})`,start:e.start,end:e.end,field:e.field,type:"SYNTAX_ERROR"}),e.boost!==void 0&&e.boost<=0&&n.push({message:`Boost value must be positive (got ${e.boost})`,start:e.start,end:e.end,field:e.field,type:"SYNTAX_ERROR"});let f=null;switch(c.type){case"number":f=Cu(e.value);break;case"date":f=Au(e.value,s);break;case"boolean":e.value!=="true"&&e.value!=="false"&&(f=`Expected "true" or "false", got "${e.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(e.value)&&!e.value.includes("*")&&(f=`"${e.value}" is not a valid IP address`);break}if(e.operator!==":"&&c.type!=="number"&&c.type!=="date"&&(f=`Comparison operator "${e.operator}" is not valid for ${c.type} fields`),!f&&r){const h=Du(r({value:e.value,position:"field_value",fieldName:c.name,fieldConfig:c,quoted:e.quoted,operator:e.operator!==":"?e.operator:void 0}));if(h){const p=e.end-e.value.length;n.push({message:h.message,start:p,end:e.end,field:e.field,severity:h.severity,type:"CUSTOM"})}}if(f){const h=e.end-e.value.length,p=e.operator!==":"&&c.type!=="number"&&c.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";n.push({message:f,start:h,end:e.end,field:e.field,type:p})}break}case"FieldGroup":if(e.field==="*")this.walkNode(e.expression,n,r,s,u);else{const c=this.fields.get(e.field);c?this.walkFieldGroup(e.expression,c,n,r,s):n.push({message:`Unknown field: "${e.field}"`,start:e.start,end:e.start+e.field.length,field:e.field,type:"UNKNOWN_FIELD"})}e.boost!==void 0&&e.boost<=0&&n.push({message:`Boost value must be positive (got ${e.boost})`,start:e.start,end:e.end,type:"SYNTAX_ERROR"});break;case"BooleanExpr":this.walkNode(e.left,n,r,s,u),this.walkNode(e.right,n,r,s,u);break;case"Group":this.walkNode(e.expression,n,r,s,u),e.boost!==void 0&&e.boost<=0&&n.push({message:`Boost value must be positive (got ${e.boost})`,start:e.start,end:e.end,type:"SYNTAX_ERROR"});break;case"Not":this.walkNode(e.expression,n,r,s,u);break;case"Error":n.push({message:e.message,start:e.start,end:e.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(e,n,r,s,u){switch(e.type){case"BareTerm":if(e.value==="")return;this.validateFieldValue(n,e.value,e.quoted,":",e.start,e.end,r,s,u);break;case"FieldValue":this.walkNode(e,r,s,u);break;case"Range":this.validateRangeBounds(n,e,r,s,u);break;case"BooleanExpr":this.walkFieldGroup(e.left,n,r,s,u),this.walkFieldGroup(e.right,n,r,s,u);break;case"Group":this.walkFieldGroup(e.expression,n,r,s,u);break;case"Not":this.walkFieldGroup(e.expression,n,r,s,u);break;default:this.walkNode(e,r,s,u);break}}validateFieldValue(e,n,r,s,u,c,f,h,p){let g=null;switch(e.type){case"number":g=Cu(n);break;case"date":g=Au(n,p);break;case"boolean":n!=="true"&&n!=="false"&&(g=`Expected "true" or "false", got "${n}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(n)&&!n.includes("*")&&(g=`"${n}" is not a valid IP address`);break}if(s!==":"&&e.type!=="number"&&e.type!=="date"&&(g=`Comparison operator "${s}" is not valid for ${e.type} fields`),!g&&h){const y=Du(h({value:n,position:"field_group_term",fieldName:e.name,fieldConfig:e,quoted:r,operator:s!==":"?s:void 0}));y&&f.push({message:y.message,start:u,end:c,field:e.name,severity:y.severity,type:"CUSTOM"})}if(g){const y=s!==":"&&e.type!=="number"&&e.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";f.push({message:g,start:u,end:c,field:e.name,type:y})}}validateEmptyRangeBounds(e,n){e.lower!=="*"&&e.lower.trim()===""&&n.push({message:"Missing lower bound in range",start:e.start,end:e.start+1,field:e.field,type:"SYNTAX_ERROR"}),e.upper!=="*"&&e.upper.trim()===""&&n.push({message:"Missing upper bound in range",start:e.end-1,end:e.end,field:e.field,type:"SYNTAX_ERROR"})}validateRangeBounds(e,n,r,s,u){const c=[];n.lower!=="*"&&n.lower.trim()!==""&&c.push({value:n.lower,label:"Range start",start:n.lowerStart,end:n.lowerEnd,position:"range_start",inclusive:n.lowerInclusive}),n.upper!=="*"&&n.upper.trim()!==""&&c.push({value:n.upper,label:"Range end",start:n.upperStart,end:n.upperEnd,position:"range_end",inclusive:n.upperInclusive});for(const f of c){let h=null;switch(e.type){case"number":h=Cu(f.value),h&&(h=`${f.label}: ${h}`);break;case"date":h=Au(f.value,u),h&&(h=`${f.label}: ${h}`);break;case"boolean":h="Range queries are not supported for boolean fields";break}if(!h&&s){const p=Du(s({value:f.value,position:f.position,fieldName:e.name,fieldConfig:e,quoted:!1,inclusive:f.inclusive}));p&&r.push({message:p.message,start:f.start,end:f.end,field:e.name,severity:p.severity,type:"CUSTOM"})}if(h){const p=e.type==="boolean"?"SYNTAX_ERROR":"INVALID_VALUE";r.push({message:h,start:f.start,end:f.end,field:e.name,type:p})}}}checkAmbiguousPrecedence(e,n){const r=new Set;this.findAndFlagAmbiguity(e,n,r)}findAndFlagAmbiguity(e,n,r){if(e.type==="BooleanExpr"&&!r.has(e)){const s=new Set,u=[];this.collectBoolOps(e,s,u),s.size>1&&(n.push({message:"Ambiguous precedence: mix of AND and OR without parentheses. Add parentheses to clarify.",start:e.start,end:e.end,severity:"warning",type:"AMBIGUOUS_PRECEDENCE"}),u.forEach(c=>r.add(c))),this.collectLeaves(e).forEach(c=>this.findAndFlagAmbiguity(c,n,r))}else e.type==="Group"||e.type==="FieldGroup"?this.findAndFlagAmbiguity(e.expression,n,r):e.type==="Not"?this.findAndFlagAmbiguity(e.expression,n,r):e.type==="BooleanExpr"&&this.collectLeaves(e).forEach(s=>this.findAndFlagAmbiguity(s,n,r))}collectBoolOps(e,n,r){e.type==="BooleanExpr"&&(n.add(e.operator),r.push(e),this.collectBoolOps(e.left,n,r),this.collectBoolOps(e.right,n,r))}collectLeaves(e){return e.type!=="BooleanExpr"?[e]:[...this.collectLeaves(e.left),...this.collectLeaves(e.right)]}};function Bn(...e){return e.filter(Boolean).join(" ")}function oc(e){return{...sC,...e}}function cc(e){return{...iC,...e}}function vC(e,n){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...n}}function yC(e,n){return{flex:1,minHeight:n.inputMinHeight,padding:n.inputPadding,borderWidth:n.inputBorderWidth,borderStyle:"solid",borderColor:n.inputBorderColor,borderRadius:n.inputBorderRadius,outline:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,lineHeight:n.lineHeight,backgroundColor:e.background,color:e.text,caretColor:e.cursor,whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",overflow:"auto",cursor:"text"}}function bC(e){return{borderColor:e.inputFocusBorderColor,boxShadow:e.inputFocusShadow}}function wC(e,n){const r=n.inputPadding.split(/\s+/),s=r[0]||"8px";return{position:"absolute",top:s,left:r.length>=4?r[3]:r.length>=2?r[1]:s,right:r.length>=4||r.length>=2?r[1]:s,color:e.placeholder,pointerEvents:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,lineHeight:n.lineHeight,userSelect:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}function b1(e,n){return{position:"absolute",zIndex:n.dropdownZIndex,backgroundColor:e.background,border:`1px solid ${n.dropdownBorderColor}`,borderRadius:n.dropdownBorderRadius,boxShadow:n.dropdownShadow,maxHeight:n.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:n.dropdownMinWidth,maxWidth:n.dropdownMaxWidth,padding:"4px 0"}}function lb(e,n,r){return{padding:r.dropdownItemPadding,cursor:"pointer",fontSize:r.dropdownItemFontSize,fontFamily:r.fontFamily,backgroundColor:e?n.dropdownSelected:"transparent",color:e?"#ffffff":n.text,display:"flex",alignItems:"center",gap:r.dropdownItemContentGap,lineHeight:"1.4"}}function ii(e){return{flex:1,fontWeight:500}}function em(e){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function SC(e,n){return{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:e?n.typeBadgeSelectedBg:n.typeBadgeBg,color:e?n.typeBadgeSelectedColor:n.typeBadgeColor,flexShrink:0}}function EC(e,n){return{container:{padding:"12px",backgroundColor:e.background,minWidth:"280px",fontFamily:n.fontFamily},header:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},navButton:{backgroundColor:"transparent",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:e.text,borderRadius:"4px"},monthLabel:{fontWeight:600,fontSize:n.fontSize,color:e.text},weekDays:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},weekDay:{textAlign:"center",fontSize:"11px",color:e.placeholder,padding:"4px",fontWeight:600},days:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},day:{textAlign:"center",padding:"6px",cursor:"pointer",fontSize:n.dropdownItemFontSize,borderRadius:"4px",color:e.text,border:"none",backgroundColor:"transparent"},dayHover:{backgroundColor:e.dropdownHover},daySelected:{backgroundColor:e.dropdownSelected,color:"#ffffff"},dayInRange:{backgroundColor:"rgba(9, 105, 218, 0.1)"},dayOtherMonth:{opacity:.45},dayToday:{fontWeight:700,textDecoration:"underline"},rangeToggle:{display:"flex",gap:"4px",marginBottom:"8px",padding:"2px",backgroundColor:n.typeBadgeBg,borderRadius:"6px"},rangeToggleButton:{flex:1,padding:"4px 8px",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:500,backgroundColor:"transparent",color:e.text},rangeToggleButtonActive:{backgroundColor:e.background,boxShadow:"0 1px 2px rgba(0,0,0,0.1)"},quickOptions:{borderTop:`1px solid ${n.dropdownBorderColor}`,marginTop:"8px",paddingTop:"8px"},quickOption:{display:"block",width:"100%",textAlign:"left",padding:"4px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"12px",color:e.dropdownSelected,borderRadius:"4px"}}}var NC={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function jC(e){const n=[];let r=0,s="";function u(){s&&(n.push({type:"text",text:s}),s="")}e.startsWith("/")&&(n.push({type:"delimiter",text:"/"}),r=1);const c=e.lastIndexOf("/"),f=c>0?c:e.length;for(;r<f;){const h=e[r];if(h==="\\"&&r+1<f){u(),n.push({type:"escape",text:e.slice(r,r+2)}),r+=2;continue}if(h==="["){u();let p=r+1;for(p<f&&e[p]==="^"&&p++,p<f&&e[p]==="]"&&p++;p<f&&e[p]!=="]";)e[p]==="\\"&&p+1<f&&p++,p++;p<f&&p++,n.push({type:"charClass",text:e.slice(r,p)}),r=p;continue}if(h==="("){u();let p="(";if(r+1<f&&e[r+1]==="?"){let g=r+2;for(;g<f&&g<r+4&&/[:<>=!]/.test(e[g]);)g++;p=e.slice(r,g)}n.push({type:"groupOpen",text:p}),r+=p.length;continue}if(h===")"){u(),n.push({type:"groupClose",text:")"}),r++;continue}if(h==="+"||h==="*"||h==="?"){u();let p=h;r+1<f&&e[r+1]==="?"&&(p+="?"),n.push({type:"quantifier",text:p}),r+=p.length;continue}if(h==="{"){u();let p=r+1;for(;p<f&&e[p]!=="}";)p++;p<f&&p++,n.push({type:"quantifier",text:e.slice(r,p)}),r=p;continue}if(h==="^"||h==="$"){u(),n.push({type:"anchor",text:h}),r++;continue}if(h==="|"){u(),n.push({type:"alternation",text:"|"}),r++;continue}s+=h,r++}return u(),c>0&&c<e.length&&n.push({type:"delimiter",text:"/"}),n}function RC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function kC(e,n,r){const s=jC(e.value).map(u=>{const c=n[NC[u.type]]||n.regexText,f=u.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${u.type}" style="color:${c};font-weight:${f}">${RC(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--regex${r?" "+r:""}`}" data-token-start="${e.start}" data-token-end="${e.end}">${s}</span>`}var TC={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function CC(e){const n=[];let r=0;r<e.length&&(e[r]==="["||e[r]==="{")&&(n.push({type:"bracket",text:e[r]}),r++);const s=e.length-1,u=s>=0&&(e[s]==="]"||e[s]==="}"),c=u?s:e.length;for(;r<c;){const f=e[r];if(f===" "||f===" "){let p=r;for(;p<c&&(e[p]===" "||e[p]===" ");)p++;n.push({type:"whitespace",text:e.slice(r,p)}),r=p;continue}if((f==="T"||f==="t")&&r+1<c&&(e[r+1]==="O"||e[r+1]==="o")){const p=r===0||e[r-1]===" "||e[r-1]===" "||e[r-1]==="["||e[r-1]==="{",g=r+2>=c||e[r+2]===" "||e[r+2]===" ";if(p&&g){n.push({type:"toKeyword",text:e.slice(r,r+2)}),r+=2;continue}}if(f==='"'){let p=r+1;for(;p<c&&e[p]!=='"';)e[p]==="\\"&&p+1<c&&p++,p++;p<c&&p++,n.push({type:"quotedValue",text:e.slice(r,p)}),r=p;continue}if(f==="*"){n.push({type:"wildcard",text:"*"}),r++;continue}let h=r;for(;h<c&&e[h]!==" "&&e[h]!==" "&&e[h]!=='"';)h++;if(h>r){const p=e.slice(r,h);n.push({type:"bareValue",text:p}),r=h}else n.push({type:"bareValue",text:f}),r++}return u&&n.push({type:"bracket",text:e[s]}),n}function sb(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function AC(e,n,r){const s=CC(e.value).map(u=>{if(u.type==="whitespace")return sb(u.text);const c=n[TC[u.type]]||n.fieldValue,f=u.type==="toKeyword"||u.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${u.type}" style="color:${c};font-weight:${f}">${sb(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--range${r?" "+r:""}`}" data-token-start="${e.start}" data-token-end="${e.end}">${s}</span>`}function w1(e,n){if(n<0)return null;const r=e.filter(c=>c.type===O.LPAREN||c.type===O.RPAREN);if(r.length===0)return null;const s=r.find(c=>c.end===n);if(s){const c=ib(r,s);if(c)return c}const u=r.find(c=>c.start===n);if(u){const c=ib(r,u);if(c)return c}return null}function ib(e,n){if(n.type===O.LPAREN){const r=e.indexOf(n);let s=0;for(let u=r;u<e.length;u++)if(e[u].type===O.LPAREN?s++:e[u].type===O.RPAREN&&s--,s===0)return{openStart:n.start,closeStart:e[u].start}}else{const r=e.indexOf(n);let s=0;for(let u=r;u>=0;u--)if(e[u].type===O.RPAREN?s++:e[u].type===O.LPAREN&&s--,s===0)return{openStart:e[u].start,closeStart:n.start}}return null}var DC={[O.FIELD_NAME]:"field-name",[O.COLON]:"colon",[O.VALUE]:"value",[O.QUOTED_VALUE]:"quoted-value",[O.AND]:"and",[O.OR]:"or",[O.NOT]:"not",[O.COMPARISON_OP]:"comparison-op",[O.LPAREN]:"lparen",[O.RPAREN]:"rparen",[O.SAVED_SEARCH]:"saved-search",[O.HISTORY_REF]:"history-ref",[O.PREFIX_OP]:"prefix-op",[O.WILDCARD]:"wildcard",[O.REGEX]:"regex",[O.RANGE]:"range",[O.TILDE]:"tilde",[O.BOOST]:"boost",[O.WHITESPACE]:"whitespace",[O.UNKNOWN]:"unknown"},OC={[O.FIELD_NAME]:"fieldName",[O.COLON]:"operator",[O.VALUE]:"fieldValue",[O.QUOTED_VALUE]:"quoted",[O.AND]:"booleanOp",[O.OR]:"booleanOp",[O.NOT]:"booleanOp",[O.COMPARISON_OP]:"operator",[O.LPAREN]:"paren",[O.RPAREN]:"paren",[O.SAVED_SEARCH]:"savedSearch",[O.HISTORY_REF]:"historyRef",[O.PREFIX_OP]:"operator",[O.WILDCARD]:"wildcard",[O.REGEX]:"quoted",[O.RANGE]:"fieldValue",[O.TILDE]:"operator",[O.BOOST]:"operator",[O.WHITESPACE]:"text",[O.UNKNOWN]:"error"};function oi(e,n,r){const s=oc(n);if(e.length===0)return"";const u=(r==null?void 0:r.cursorOffset)!==void 0?w1(e,r.cursorOffset):null,c=n==null?void 0:n.valueTypes,f=r==null?void 0:r.fieldTypeMap;let h;if(c&&f){h=new Array(e.length);let g,y=!1;const v=[];for(let E=0;E<e.length;E++){const S=e[E];S.type===O.FIELD_NAME?(g=S.value,y=!1):S.type===O.COLON&&g?y=!0:S.type===O.WHITESPACE||(S.type===O.LPAREN?(y&&g?v.push(f.get(g.toLowerCase())):v.push(void 0),g=void 0,y=!1):S.type===O.RPAREN?(v.pop(),g=void 0,y=!1):S.type===O.VALUE||S.type===O.QUOTED_VALUE||S.type===O.RANGE||S.type===O.REGEX||S.type===O.WILDCARD?(y&&g?h[E]=f.get(g.toLowerCase()):v.length>0&&(h[E]=v[v.length-1]),g=void 0,y=!1):(S.type===O.AND||S.type===O.OR||(S.type,O.NOT),g=void 0,y=!1))}}let p=e.map((g,y)=>{let v=s[OC[g.type]||"text"]||s.text;if(c&&h){const j=h[y];j&&c[j]&&(v=c[j])}const E=MC(g.value);if(g.type===O.WHITESPACE)return E.replace(/\n/g,"<br>");if(g.type===O.REGEX)return kC(g,s,r==null?void 0:r.tokenClassName);if(g.type===O.RANGE)return AC(g,s,r==null?void 0:r.tokenClassName);let S="normal";(g.type===O.AND||g.type===O.OR||g.type===O.NOT)&&(S="600"),g.type===O.FIELD_NAME&&(S="500");let w="";return u&&(g.type===O.LPAREN||g.type===O.RPAREN)&&(g.start===u.openStart||g.start===u.closeStart)&&(S="700",w=`background-color:${s.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${DC[g.type]}${r!=null&&r.tokenClassName?" "+r.tokenClassName:""}`}" style="color:${v};font-weight:${S};${w}" data-token-start="${g.start}" data-token-end="${g.end}">${E}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function MC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}if(typeof document<"u"){const e="elastic-input-keyframes";if(!document.getElementById(e)){const n=document.createElement("style");n.id=e,n.textContent="@keyframes elastic-input-spin { to { transform: rotate(360deg); } }",document.head.appendChild(n)}}function ob(e,n,r){if(!n||n.length===0)return e;const s=e.toLowerCase(),u=n.toLowerCase(),c=s.indexOf(u);if(c===-1)return e;const f=e.slice(0,c),h=e.slice(c,c+n.length),p=e.slice(c+n.length),g={fontWeight:700,textDecoration:"underline",textDecorationColor:r?"rgba(255,255,255,0.6)":"#0969da",textUnderlineOffset:"2px"};return x.createElement(x.Fragment,null,f,x.createElement("span",{className:"ei-highlight-match",style:g},h),p)}function _C({suggestions:e,selectedIndex:n,onSelect:r,position:s,colors:u,styles:c,visible:f,fixedWidth:h,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:y,cursorContext:v,listRefCallback:E,renderType:S,classNames:w}){const j=x.useRef(null),R=x.useRef(null);x.useEffect(()=>{const M=document.createElement("div");return document.body.appendChild(M),j.current=M,()=>{document.body.removeChild(M),j.current=null}},[]);const z=y&&v?y(v):null,I=z!=null;if(x.useEffect(()=>{if(R.current){const M=I?n+1:n,T=R.current.children[M];T&&T.scrollIntoView({block:"nearest"})}},[n,I]),!j.current||!f||e.length===0||!s)return null;const $=oc(u),Q=cc(c),J={...b1($,Q),top:`${s.top}px`,left:`${s.left}px`,...h!=null?{width:`${h}px`,minWidth:"unset",maxWidth:"unset"}:{}},ne=x.createElement("div",{className:Bn("ei-dropdown",w==null?void 0:w.dropdown),style:J,ref:M=>{R.current=M,E==null||E(M)},onMouseDown:M=>M.preventDefault()},I&&x.createElement("div",{className:Bn("ei-dropdown-header",w==null?void 0:w.dropdownHeader),style:{padding:Q.dropdownItemPadding||"4px 10px",fontSize:"11px",color:$.placeholder,borderBottom:`1px solid ${$.dropdownHover}`,userSelect:"none"}},z),e.map((M,T)=>{const fe=T===n,pe=lb(fe,$,Q),we=(L,F,he)=>({key:T,className:Bn("ei-dropdown-item",L,fe&&"ei-dropdown-item--selected",w==null?void 0:w.dropdownItem),style:{...pe,...F},title:he,onClick:()=>r(M),onMouseEnter:P=>{P.currentTarget.style.backgroundColor=fe?$.dropdownSelected:$.dropdownHover},onMouseLeave:P=>{P.currentTarget.style.backgroundColor=fe?$.dropdownSelected:"transparent"}}),re=L=>{if(S===!1||!M.type||M.type==="hint")return null;const F=typeof S=="function"?S(M.type,{text:M.text,label:M.label,description:M.description,type:M.type}):M.type;return F!=null?x.createElement("span",{className:"ei-dropdown-item-type",style:{...SC(fe,Q),...L}},F):null},je={flexDirection:"column",alignItems:"flex-start"},Te={display:"flex",alignItems:"center",gap:Q.dropdownItemContentGap,width:"100%"};if(M.type==="hint"&&(M.text==="#"||M.text==="!"))return x.createElement("div",{...we("ei-dropdown-item--hint",{opacity:fe?1:.7}),onMouseEnter:L=>{L.currentTarget.style.backgroundColor=fe?$.dropdownSelected:$.dropdownHover,L.currentTarget.style.opacity="1"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=fe?$.dropdownSelected:"transparent",L.currentTarget.style.opacity=fe?"1":"0.7"}},x.createElement("span",{className:"ei-dropdown-item-label",style:ii()},M.label),M.description&&x.createElement("span",{className:"ei-dropdown-item-desc",style:em()},M.description));if(M.type==="error")return x.createElement("div",{key:T,className:Bn("ei-dropdown-item","ei-dropdown-item--error",w==null?void 0:w.dropdownItem),style:{...pe,cursor:"default",opacity:.8}},x.createElement("span",{className:"ei-dropdown-item-label",style:{...ii(),color:$.error}},M.label||"Error loading suggestions"));if(M.type==="noResults")return x.createElement("div",{key:T,className:Bn("ei-dropdown-item","ei-dropdown-item--no-results",w==null?void 0:w.dropdownItem),style:{...pe,cursor:"default",opacity:.7}},M.customContent);if(M.type==="loading")return x.createElement("div",{key:T,className:Bn("ei-dropdown-item","ei-dropdown-item--loading",w==null?void 0:w.dropdownItem),style:{...pe,cursor:"default",opacity:.6,justifyContent:"center"}},x.createElement("span",{className:"ei-dropdown-item-label",style:{...ii(),fontStyle:"italic"}},M.label||"Searching..."),x.createElement("span",{className:"ei-dropdown-spinner",style:{marginLeft:"6px",display:"inline-block",animation:"elastic-input-spin 1s linear infinite",width:"14px",height:"14px",border:"2px solid",borderColor:`${$.placeholder} transparent ${$.placeholder} transparent`,borderRadius:"50%"}}));if(M.type==="hint"){const L=lb(!1,$,Q);return x.createElement("div",{key:T,className:Bn("ei-dropdown-item","ei-dropdown-item--hint",w==null?void 0:w.dropdownItem),style:{...L,cursor:"default",opacity:M.customContent?1:.6}},M.customContent?M.customContent:x.createElement("span",{className:"ei-dropdown-item-label",style:ii()},M.label))}if(M.type==="history"&&p&&M.sourceData){const L=p(M.sourceData,fe);if(L!=null)return x.createElement("div",we("ei-dropdown-item--history",je),L)}if(M.type==="savedSearch"&&g&&M.sourceData){const L=g(M.sourceData,fe);if(L!=null)return x.createElement("div",we("ei-dropdown-item--saved-search"),L)}if((M.type==="history"||M.type==="savedSearch")&&M.description!=null){const L=M.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let F;const he=M.text.startsWith("(")&&M.text.endsWith(")")?M.text.slice(1,-1):M.text;return M.label!==he&&(F=M.text),x.createElement("div",we(L,je,F),x.createElement("span",{className:"ei-dropdown-item-label",style:{...ii(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},ob(M.label,M.matchPartial,fe)),x.createElement("span",{style:Te},x.createElement("span",{className:"ei-dropdown-item-desc",style:{...em(),flex:1}},M.description),re({marginLeft:"auto"})))}const ee=M.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return x.createElement("div",we(ee),x.createElement("span",{className:"ei-dropdown-item-label",style:ii()},ob(M.label,M.matchPartial,fe)),M.description&&x.createElement("span",{className:"ei-dropdown-item-desc",style:em()},M.description),re())}));return sl.createPortal(ne,j.current)}var LC=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tm(e){return Math.floor(e/10)*10}function zC({onSelect:e,colors:n,styles:r,initialMode:s,initialStart:u,initialEnd:c,presets:f,className:h}){const p=s==="range"&&c?c:u??new Date,[g,y]=x.useState(s??"single"),[v,E]=x.useState("days"),[S,w]=x.useState(p.getFullYear()),[j,R]=x.useState(p.getMonth()),[z,I]=x.useState(u??null),[$,Q]=x.useState(c??null),[J,ne]=x.useState(null),M=oc(n),T=EC(M,cc(r)),fe=()=>{v==="days"?j===0?(R(11),w(ce=>ce-1)):R(ce=>ce-1):w(v==="months"?ce=>ce-1:ce=>ce-10)},pe=()=>{v==="days"?j===11?(R(0),w(ce=>ce+1)):R(ce=>ce+1):w(v==="months"?ce=>ce+1:ce=>ce+10)},we=()=>{w(v==="days"?ce=>ce-1:v==="months"?ce=>ce-10:ce=>ce-100)},re=()=>{w(v==="days"?ce=>ce+1:v==="months"?ce=>ce+10:ce=>ce+100)},je=()=>{v==="days"?E("months"):v==="months"&&E("years")},Te=ce=>{R(ce),E("days")},ee=ce=>{w(ce),E("months")},L=ce=>{if(g==="single"){e(Wh(ce));return}if(!z||$)I(ce),Q(null),ne(null);else{const[qe,lt]=z<=ce?[z,ce]:[ce,z];I(qe),Q(lt),ne(null),e(`[${Wh(qe)} TO ${Wh(lt)}]`)}},F=z&&!$?J:$,he=ce=>{y(ce),I(null),Q(null),ne(null)},P=v==="days"?`${xC(j)} ${S}`:v==="months"?`${S}`:`${tm(S)}–${tm(S)+9}`,se=v!=="years",C=new Date,B=ab(S,j),K=pC(S,j),ue=["Su","Mo","Tu","We","Th","Fr","Sa"],ge=[],xe=(ce,qe,lt)=>{const Bt=Ro(ce,C),xa=z&&Ro(ce,z),kt=F&&Ro(ce,F),Lt=nb(ce,z,F),Kt=xa||kt,$a={...T.day,...lt?T.dayOtherMonth:{},...Bt?T.dayToday:{},...Lt?T.dayInRange:{},...Kt?T.daySelected:{}},Ba=g==="range"&&z&&!$;return x.createElement("button",{key:qe,className:"ei-datepicker-day",style:$a,onClick:()=>L(ce),onMouseEnter:aa=>{Ba?ne(ce):Kt||(aa.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:aa=>{!Ba&&!Kt&&(aa.currentTarget.style.backgroundColor=Lt?"rgba(9, 105, 218, 0.1)":"transparent")}},ce.getDate())};if(K>0){const ce=ab(S,j-1);for(let qe=K-1;qe>=0;qe--){const lt=ce-qe,Bt=new Date(S,j-1,lt);ge.push(xe(Bt,`prev${lt}`,!0))}}for(let ce=1;ce<=B;ce++){const qe=new Date(S,j,ce);ge.push(xe(qe,String(ce),!1))}const Re=ge.length%7;if(Re>0){const ce=7-Re;for(let qe=1;qe<=ce;qe++){const lt=new Date(S,j+1,qe);ge.push(xe(lt,`next${qe}`,!0))}}const He={...T.day,padding:"10px 4px",fontSize:"13px"},$e={...He,...T.dayToday},Qe=f??[{label:"Today",value:"[now/d TO now]",type:"range"},{label:"Yesterday",value:"[now-1d/d TO now/d]",type:"range"},{label:"Last 7 days",value:"[now-7d TO now]",type:"range"},{label:"Last 30 days",value:"[now-30d TO now]",type:"range"},{label:"Last 90 days",value:"[now-90d TO now]",type:"range"},{label:"Last 1 year",value:"[now-365d TO now]",type:"range"}],ia={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},$t=ce=>{ce.currentTarget.style.backgroundColor="#eef1f5"},mt=ce=>{ce.currentTarget.style.backgroundColor="transparent"};return x.createElement("div",{className:Bn("ei-datepicker",h),style:T.container,onMouseDown:ce=>ce.preventDefault(),onMouseLeave:()=>ne(null)},x.createElement("div",{className:"ei-datepicker-toggle",style:T.rangeToggle},["single","range"].map(ce=>x.createElement("button",{key:ce,style:{...T.rangeToggleButton,...g===ce?T.rangeToggleButtonActive:{}},onClick:()=>he(ce)},ce.charAt(0).toUpperCase()+ce.slice(1)))),x.createElement("div",{className:"ei-datepicker-header",style:T.header},x.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},x.createElement("button",{style:T.navButton,onClick:we,onMouseEnter:$t,onMouseLeave:mt},"«"),x.createElement("button",{style:T.navButton,onClick:fe,onMouseEnter:$t,onMouseLeave:mt},"‹")),x.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:se?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:se?je:void 0,onMouseEnter:ce=>{se&&(ce.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:ce=>{ce.currentTarget.style.backgroundColor="transparent"}},P),x.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},x.createElement("button",{style:T.navButton,onClick:pe,onMouseEnter:$t,onMouseLeave:mt},"›"),x.createElement("button",{style:T.navButton,onClick:re,onMouseEnter:$t,onMouseLeave:mt},"»"))),v==="days"&&x.createElement(x.Fragment,null,x.createElement("div",{style:T.weekDays},ue.map(ce=>x.createElement("div",{key:ce,style:T.weekDay},ce))),x.createElement("div",{className:"ei-datepicker-days",style:T.days},ge)),v==="months"&&x.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},LC.map((ce,qe)=>{const lt=new Date(S,qe,1),Bt=nb(lt,z,F),xa=z&&Ro(new Date(z.getFullYear(),z.getMonth(),1),lt)||F&&Ro(new Date(F.getFullYear(),F.getMonth(),1),lt),kt=qe===C.getMonth()&&S===C.getFullYear(),Lt=g==="range"&&z&&!$;return x.createElement("button",{key:ce,style:{...kt?$e:He,...Bt?T.dayInRange:{},...xa?T.daySelected:{}},onClick:()=>Te(qe),onMouseEnter:Kt=>{Lt?ne(lt):xa||(Kt.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:Kt=>{!Lt&&!xa&&(Kt.currentTarget.style.backgroundColor=Bt?"rgba(9, 105, 218, 0.1)":"transparent")}},ce)})),v==="years"&&x.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(ce,qe)=>{const lt=tm(S)-1+qe,Bt=qe===0||qe===11,xa=lt===C.getFullYear(),kt=new Date(lt,0,1),Lt=z&&F&&lt>=Math.min(z.getFullYear(),F.getFullYear())&&lt<=Math.max(z.getFullYear(),F.getFullYear()),Kt=z&&z.getFullYear()===lt||F&&F.getFullYear()===lt,$a=g==="range"&&z&&!$;return x.createElement("button",{key:lt,style:{...xa?$e:He,...Bt?T.dayOtherMonth:{},...Lt?T.dayInRange:{},...Kt?T.daySelected:{}},onClick:()=>ee(lt),onMouseEnter:Ba=>{$a?ne(kt):Kt||(Ba.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:Ba=>{!$a&&!Kt&&(Ba.currentTarget.style.backgroundColor=Lt?"rgba(9, 105, 218, 0.1)":"transparent")}},lt)})),(()=>{const ce=Qe.filter(qe=>!qe.type||qe.type===g);return ce.length>0&&x.createElement("div",{className:"ei-datepicker-presets",style:{...T.quickOptions,...ia}},ce.map(qe=>x.createElement("button",{key:`${qe.type??"both"}-${qe.value}`,style:T.quickOption,onClick:()=>e(qe.value)},qe.label)))})())}var UC=30,$C=150;function cb(e,n){let r=0;const s=u=>{if(u.nodeType===Node.TEXT_NODE){const c=(u.textContent||"").length;return r+c>=n?{node:u,offset:n-r}:(r+=c,null)}if(u.nodeName==="BR"){if(r+1>=n){const c=u.parentNode;if(c)return{node:c,offset:Array.from(c.childNodes).indexOf(u)+1}}return r+=1,null}for(let c=0;c<u.childNodes.length;c++){const f=s(u.childNodes[c]);if(f)return f}return null};return s(e)}function BC(e,n,r){const s=cb(e,n),u=cb(e,r);if(!s||!u)return[];const c=document.createRange();c.setStart(s.node,s.offset),c.setEnd(u.node,u.offset);const f=e.getBoundingClientRect(),h=c.getClientRects();if(h.length===0)return[];const p=[];for(let g=0;g<h.length;g++){const y=h[g];y.width<1||p.push({left:y.left-f.left,top:y.top-f.top,width:Math.max(y.width,6),height:y.height})}return p}function HC(e,n,r){if(!n||e.length===0)return[];const s=[];let u=0;for(const c of e){if(u>=UC)break;if(r>=c.start&&r<=c.end)continue;const f=BC(n,c.start,c.end);for(const h of f)s.push({left:h.left,top:h.top,width:h.width,height:h.height,error:c});u++}return s}var ub=28,db=4;function IC(e){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath d='M0 2 Q2 0 4 2 Q6 4 8 2' stroke='${e.replace("#","%23")}' fill='none' stroke-width='0.8'/%3E%3C/svg%3E")`}function qC({errors:e,editorRef:n,cursorOffset:r,colors:s,styles:u,containerRef:c,classNames:f}){const[h,p]=x.useState(null),[g,y]=x.useState({x:0,clientY:0}),[v,E]=x.useState([]),S=x.useRef([]),w=x.useRef(null),j=x.useRef(null);if(x.useEffect(()=>{if(j.current&&clearTimeout(j.current),e.length===0){E([]),S.current=[],p(null);return}return j.current=setTimeout(()=>{const $=HC(e,n,r);E($),S.current=$},$C),()=>{j.current&&clearTimeout(j.current)}},[e,n,r]),x.useEffect(()=>{const $=c;if(!$||!n)return;const Q=M=>{const T=n.getBoundingClientRect(),fe=M.clientX-T.left,pe=M.clientY-T.top;let we=-1;for(let re=0;re<S.current.length;re++){const je=S.current[re];if(fe>=je.left&&fe<=je.left+je.width&&pe>=je.top&&pe<=je.top+je.height+6){we=re;break}}we>=0?(p(we),y({x:fe,clientY:M.clientY})):p(null)},J=()=>{p(null)},ne=new AbortController;return $.addEventListener("mousemove",Q,{signal:ne.signal}),$.addEventListener("mouseleave",J,{signal:ne.signal}),()=>ne.abort()},[c,n]),x.useEffect(()=>{const $=w.current;if(!$||h==null)return;const Q=$.getBoundingClientRect();if(Q.right>window.innerWidth-8){const J=Q.right-window.innerWidth+8;$.style.transform=`translateX(-${J}px)`}else $.style.transform=""}),v.length===0)return null;const R=oc(s),z=cc(u),I=h!=null?v[h]:null;return x.createElement(x.Fragment,null,v.map(($,Q)=>{const J=$.error.severity==="warning",ne=IC(J?R.warning:R.error),M=$.top+$.height-2;return x.createElement("div",{key:`wave-${Q}`,className:Bn("ei-squiggly",J?"ei-squiggly--warning":"ei-squiggly--error",f==null?void 0:f.squiggly),style:{position:"absolute",left:`${$.left}px`,top:`${M}px`,width:`${$.width}px`,height:"4px",zIndex:1,backgroundImage:ne,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),I!=null&&(()=>{const $=I.error.severity==="warning"?R.warning:R.error,Q=n==null?void 0:n.getBoundingClientRect(),J=((Q==null?void 0:Q.left)??0)+g.x,ne=((Q==null?void 0:Q.top)??0)+I.top+I.height+2,M=((Q==null?void 0:Q.top)??0)+I.top,T=window.innerHeight-g.clientY<ub+20?M-ub-db:ne+db;return sl.createPortal(x.createElement("div",{ref:w,className:Bn("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${T}px`,left:`${J}px`,zIndex:z.dropdownZIndex,backgroundColor:R.background,color:$,border:`1px solid ${$}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:z.fontFamily,lineHeight:"1.4",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"90vw"}},I.error.message),document.body)})())}function Yo(e,n,r){let s=0,u=!1;function c(f){var h;if(u)return!0;if(f===n){if(f.nodeType===Node.TEXT_NODE)s+=r;else for(let p=0;p<r&&p<f.childNodes.length;p++)if(c(f.childNodes[p]))return!0;return u=!0,!0}if(f.nodeType===Node.TEXT_NODE)return s+=(f.textContent||"").length,!1;if(f.nodeName==="BR")return(h=f.hasAttribute)!=null&&h.call(f,"data-sentinel")||(s+=1),!1;for(let p=0;p<f.childNodes.length;p++)if(c(f.childNodes[p]))return!0;return!1}return c(e),s}function $l(e){const n=window.getSelection();if(!n||n.rangeCount===0)return 0;const r=n.getRangeAt(0);return Yo(e,r.startContainer,r.startOffset)}function kr(e){const n=window.getSelection();if(!n||n.rangeCount===0)return{start:0,end:0};const r=n.getRangeAt(0);return{start:Yo(e,r.startContainer,r.startOffset),end:Yo(e,r.endContainer,r.endOffset)}}function ll(e,n){const r=window.getSelection();if(!r)return;const s=wm(e,n);if(!s)return;const u=document.createRange();u.setStart(s.node,s.offset),u.collapse(!0),r.removeAllRanges(),r.addRange(u)}function rl(e,n,r){if(n===r){ll(e,n);return}const s=window.getSelection();if(!s)return;const u=wm(e,n),c=wm(e,r);if(!u||!c)return;const f=document.createRange();f.setStart(u.node,u.offset),f.setEnd(c.node,c.offset),s.removeAllRanges(),s.addRange(f)}function wm(e,n){let r=0;function s(f){var h;if(f.nodeType===Node.TEXT_NODE){const p=(f.textContent||"").length;return r+p>=n?{node:f,offset:n-r}:(r+=p,null)}if(f.nodeName==="BR"){if((h=f.hasAttribute)!=null&&h.call(f,"data-sentinel"))return null;if(r+1>=n){const p=f.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(f)+1}}return r+=1,null}for(let p=0;p<f.childNodes.length;p++){const g=s(f.childNodes[p]);if(g)return g}return null}const u=s(e);if(u)return u;const c=S1(e);return c?{node:c,offset:(c.textContent||"").length}:{node:e,offset:0}}function S1(e){if(e.nodeType===Node.TEXT_NODE)return e;for(let n=e.childNodes.length-1;n>=0;n--){const r=S1(e.childNodes[n]);if(r)return r}return null}function PC(e){const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0);r.deleteContents();const s=document.createTextNode(e);r.insertNode(s),r.setStartAfter(s),r.collapse(!0),n.removeAllRanges(),n.addRange(r)}function FC(){const e=window.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0);n.deleteContents();const r=document.createElement("br");n.insertNode(r),n.setStartAfter(r),n.collapse(!0),e.removeAllRanges(),e.addRange(n)}function _u(e){var h;const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0);let s=r.getBoundingClientRect();if(s.width===0&&s.height===0){const p=document.createElement("span");p.textContent="​",r.insertNode(p),s=p.getBoundingClientRect(),(h=p.parentNode)==null||h.removeChild(p),n.removeAllRanges(),n.addRange(r)}const u=e.getBoundingClientRect(),c=s.top-u.top+e.scrollTop,f=s.bottom-u.top+e.scrollTop;f>e.scrollTop+e.clientHeight?e.scrollTop=f-e.clientHeight:c<e.scrollTop&&(e.scrollTop=c)}function am(){var s,u;const e=window.getSelection();if(!e||e.rangeCount===0)return null;const n=e.getRangeAt(0),r=n.getBoundingClientRect();if(r.width===0&&r.height===0||n.collapsed&&n.startContainer.nodeType===Node.ELEMENT_NODE&&n.startOffset>0&&((s=n.startContainer.childNodes[n.startOffset-1])==null?void 0:s.nodeName)==="BR"){const c=document.createElement("span");c.textContent="​",n.insertNode(c);const f=c.getBoundingClientRect();return(u=c.parentNode)==null||u.removeChild(c),e.removeAllRanges(),e.addRange(n),f}return r}function fb(e,n){return Math.min(e,n)}function nm(e,n,r){const s=window.innerHeight,u=window.innerWidth;let c=e.bottom+window.scrollY+4,f=e.left+window.scrollX;return e.bottom+n+4>s&&(c=e.top+window.scrollY-n-4),f+r>u&&(f=u-r-8),f<8&&(f=8),{top:c,left:f}}var VC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD]);function YC(e,n,r){for(const s of e)if(n>=s.start&&n<=s.end&&VC.has(s.type))return n===s.start&&r===s.end?null:{start:s.start,end:s.end};return null}var GC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD,O.FIELD_NAME,O.RANGE,O.SAVED_SEARCH,O.HISTORY_REF,O.REGEX]);function XC(e,n,r){const s=[];for(const u of n)if(r>=u.start&&r<=u.end&&GC.has(u.type)){s.push({start:u.start,end:u.end});break}return e&&Iu(e,r,s),QC(s)}function Iu(e,n,r){if(n<e.start||n>e.end)return!1;let s=!1;switch(e.type){case"BooleanExpr":s=Iu(e.left,n,r)||s,s=Iu(e.right,n,r)||s;break;case"Group":case"Not":case"FieldGroup":s=Iu(e.expression,n,r)||s;break}return r.push({start:e.start,end:e.end}),!0}function QC(e){e.sort((r,s)=>r.end-r.start-(s.end-s.start)||r.start-s.start);const n=[];for(const r of e){const s=n[n.length-1];s&&s.start===r.start&&s.end===r.end||n.push(r)}return n}var KC=60,ZC=" ";function WC(e,n){const r=(n==null?void 0:n.maxLineLength)??KC,s=(n==null?void 0:n.indent)??ZC,u={whitespace:n==null?void 0:n.whitespaceOperator,and:n==null?void 0:n.andOperator,or:n==null?void 0:n.orOperator,not:n==null?void 0:n.notOperator};let c;return typeof e=="string"?c=new ws(new gi(e,{savedSearches:!0,historySearch:!0}).tokenize()).parse():c=e,c?Pu(c,0,r,s,u):""}function JC(e,n){return e.implicit?n.whitespace??"":e.operator==="AND"?n.and??e.sourceOperator??"AND":n.or??e.sourceOperator??"OR"}function E1(e,n){const r=n.not??e.sourceOperator??"NOT";return{op:r,sep:/^[a-zA-Z]/.test(r)?" ":""}}function Cr(e,n){switch(e.type){case"FieldValue":{const r=e.quoted?`"${e.value}"`:e.value,s=e.operator===":"?":":`:${e.operator}`;let u=`${e.field}${s}${r}`;return e.fuzzy!=null&&(u+=`~${e.fuzzy}`),e.proximity!=null&&(u+=`~${e.proximity}`),e.boost!=null&&(u+=`^${e.boost}`),u}case"BareTerm":{let r=e.quoted?`"${e.value}"`:e.value;return e.fuzzy!=null&&(r+=`~${e.fuzzy}`),e.proximity!=null&&(r+=`~${e.proximity}`),e.boost!=null&&(r+=`^${e.boost}`),r}case"Range":{const r=e.lowerInclusive?"[":"{",s=e.upperInclusive?"]":"}",u=`${r}${e.lowerQuoted?`"${e.lower}"`:e.lower} TO ${e.upperQuoted?`"${e.upper}"`:e.upper}${s}`;return e.field?`${e.field}:${u}`:u}case"Regex":return`/${e.pattern}/`;case"SavedSearch":return`#${e.name}`;case"HistoryRef":return`!${e.ref}`;case"Not":{const{op:r,sep:s}=E1(e,n);return`${r}${s}${Cr(e.expression,n)}`}case"Group":{let r=`(${Cr(e.expression,n)})`;return e.boost!=null&&(r+=`^${e.boost}`),r}case"FieldGroup":{let r=`${e.field}:(${Cr(e.expression,n)})`;return e.boost!=null&&(r+=`^${e.boost}`),r}case"BooleanExpr":{const r=JC(e,n),s=r?` ${r} `:" ";return`${Cr(e.left,n)}${s}${Cr(e.right,n)}`}case"Error":return e.value}}function eA(e){const n=e.operator,r=!!e.implicit,s=[],u=c=>{c.type==="BooleanExpr"&&c.operator===n&&!!c.implicit===r?(u(c.left),u(c.right)):s.push(c)};return u(e),{operator:n,implicit:r,sourceOperator:e.sourceOperator,operands:s}}function qu(e){return e.type==="Group"||e.type==="FieldGroup"?!0:e.type==="BooleanExpr"?qu(e.left)||qu(e.right):e.type==="Not"?qu(e.expression):!1}var tA={and:"AND",or:"OR",not:"NOT"};function aA(e,n){return!!(Cr(e,tA).length>n||qu(e))}function Pu(e,n,r,s,u){const c=s.repeat(n);switch(e.type){case"BooleanExpr":{const{operator:f,implicit:h,sourceOperator:p,operands:g}=eA(e),y=h?u.whitespace??"":f==="AND"?u.and??p??"AND":u.or??p??"OR",v=y?` ${y} `:" ",E=g.map(S=>Cr(S,u)).join(v);return E.length<=r?E:g.map((S,w)=>{const j=Pu(S,n,r,s,u);return w===0?j:y?`${c}${y} ${j}`:`${c}${j}`}).join(`
318
- `)}case"Group":{if(!aA(e.expression,r)){let h=`(${Cr(e.expression,u)})`;return e.boost!=null&&(h+=`^${e.boost}`),h}let f=`(
319
- ${nA(Pu(e.expression,n+1,r,s,u),n+1,s)}
320
- ${c})`;return e.boost!=null&&(f+=`^${e.boost}`),f}case"FieldGroup":{let f=`${e.field}:(${Cr(e.expression,u)})`;return e.boost!=null&&(f+=`^${e.boost}`),f}case"Not":{const{op:f,sep:h}=E1(e,u);return`${f}${h}${Pu(e.expression,n,r,s,u)}`}default:return Cr(e,u)}}function nA(e,n,r){const s=r.repeat(n);return e.split(`
321
- `).map(u=>u.startsWith(s)?u:s+u).join(`
322
- `)}function rA(e){return e?Bo(e):[]}function hb(e){return e.type==="BooleanExpr"}function Bo(e){switch(e.type){case"BooleanExpr":return Sm(e);case"Group":{const n=[],r=e.expression;return hb(r)?(n.push({start:e.start,end:e.end}),n.push(...Bo(r)),n.push({start:e.start,end:e.end})):n.push({start:e.start,end:e.end}),n}case"FieldGroup":{const n=[];n.push({start:e.start,end:e.end});const r=e.expression;return hb(r)&&n.push(...Bo(r)),n}case"Not":{const n=[];return n.push({start:e.start,end:e.end}),n.push(...Bo(e.expression)),n}case"FieldValue":case"BareTerm":case"SavedSearch":case"HistoryRef":case"Regex":case"Range":case"Error":return[{start:e.start,end:e.end}]}}function Sm(e){return e.type==="BooleanExpr"?[...Sm(e.left),...Sm(e.right)]:Bo(e)}function lA(e,n,r,s){if(e.length===0)return null;if(n>=0&&n<e.length){const u=s==="forward"?n+1:n-1;return u>=0&&u<e.length?{stop:e[u],index:u}:null}if(s==="forward"){for(let u=0;u<e.length;u++)if(e[u].start>=r)return{stop:e[u],index:u};return{stop:e[e.length-1],index:e.length-1}}else{for(let u=e.length-1;u>=0;u--)if(e[u].end<=r)return{stop:e[u],index:u};return{stop:e[0],index:0}}}var sA=class{constructor(e=100){pa(this,"stack",[]);pa(this,"index",-1);pa(this,"maxSize");this.maxSize=e}push(e){if(this.index>=0&&this.stack[this.index].value===e.value){this.stack[this.index].cursorPos=e.cursorPos;return}this.stack=this.stack.slice(0,this.index+1),this.stack.push(e),this.stack.length>this.maxSize&&this.stack.shift(),this.index=this.stack.length-1}replaceCurrent(e){this.index>=0?this.stack[this.index]=e:this.push(e)}undo(){return this.index<=0?null:(this.index--,this.stack[this.index])}redo(){return this.index>=this.stack.length-1?null:(this.index++,this.stack[this.index])}canUndo(){return this.index>0}canRedo(){return this.index<this.stack.length-1}current(){return this.index>=0?this.stack[this.index]:null}clear(){this.stack=[],this.index=-1}get length(){return this.stack.length}};function iA(e,n){const r=s=>(n==null?void 0:n(s))??mC(s);if(e.type==="RANGE"&&e.token){const s=e.token.value,u=(s.endsWith("]")||s.endsWith("}")?s.slice(1,-1):s.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(u)return{mode:"range",start:r(u[1].trim()),end:r(u[2].trim())}}if(e.type==="FIELD_VALUE"&&e.partial){const s=r(e.partial);if(s)return{mode:"single",start:s,end:null}}return null}function oA(e,n){var r,s,u,c;return((e==null?void 0:e.mode)??"single")!==((n==null?void 0:n.mode)??"single")||(((r=e==null?void 0:e.start)==null?void 0:r.getTime())??0)!==(((s=n==null?void 0:n.start)==null?void 0:s.getTime())??0)?!0:(((u=e==null?void 0:e.end)==null?void 0:u.getTime())??0)!==(((c=n==null?void 0:n.end)==null?void 0:c.getTime())??0)}function cA({position:e,colors:n,onSelect:r,colorConfig:s,styleConfig:u,datePickerInit:c,fixedWidth:f,datePresets:h,datePickerClassName:p}){const g=x.useRef(null),[y,v]=x.useState(!1);if(x.useEffect(()=>{const w=document.createElement("div");return document.body.appendChild(w),g.current=w,v(!0),()=>{document.body.removeChild(w),g.current=null}},[]),!y||!g.current)return null;const E=cc(u),S={position:"absolute",zIndex:E.dropdownZIndex,...b1(n,E),top:`${e.top}px`,left:`${e.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return sl.createPortal(x.createElement("div",{className:"ei-datepicker-portal",style:S,onMouseDown:w=>w.preventDefault()},x.createElement(zC,{onSelect:r,colors:s,styles:u,initialMode:c==null?void 0:c.mode,initialStart:c==null?void 0:c.start,initialEnd:c==null?void 0:c.end,presets:h,className:p})),g.current)}function uA(e){const{fields:n,onSearch:r,onChange:s,onValidationChange:u,value:c,defaultValue:f,savedSearches:h,searchHistory:p,fetchSuggestions:g,colors:y,styles:v,placeholder:E,className:S,classNames:w,style:j,dropdown:R,features:z,inputRef:I,datePresets:$,onKeyDown:Q,onFocus:J,onBlur:ne,onTab:M,validateValue:T,parseDate:fe,plainModeLength:pe,interceptPaste:we,defaultField:re,trailingSpaceOnAccept:je=!0,collapseOnBlur:Te=!1}=e,ee=typeof re=="string"?{name:re,showFieldSuggestions:!1}:re?{showFieldSuggestions:!1,...re}:void 0,L=ee==null?void 0:ee.name,F=(R==null?void 0:R.open)??(R==null?void 0:R.mode)??"always",he=typeof F=="function",P=he?null:F,se=(R==null?void 0:R.alignToInput)??!1,C=R==null?void 0:R.maxSuggestions,B=C||10,K=R==null?void 0:R.suggestDebounceMs,ue=parseInt((v==null?void 0:v.dropdownMaxHeight)||"300",10)||300,ge=(z==null?void 0:z.savedSearches)??!!h,xe=(z==null?void 0:z.historySearch)??!!p,Re=(R==null?void 0:R.showSavedSearchHint)??ge,He=(R==null?void 0:R.showHistoryHint)??xe,$e=(R==null?void 0:R.showOperators)!==!1,Qe=(he||P!=="input")&&(R==null?void 0:R.onNavigation)!==!1,ia=(R==null?void 0:R.navigationDelay)??0,$t=(R==null?void 0:R.loadingDelay)??0,mt=R==null?void 0:R.renderFieldHint,ce=R==null?void 0:R.renderHistoryItem,qe=R==null?void 0:R.renderSavedSearchItem,lt=R==null?void 0:R.renderHeader,Bt=R==null?void 0:R.renderNoResults,xa=R==null?void 0:R.renderType,kt=(R==null?void 0:R.autoSelect)??!1,Lt=(R==null?void 0:R.homeEndKeys)??!1,Kt=(z==null?void 0:z.multiline)!==!1,$a=(z==null?void 0:z.smartSelectAll)??!1,Ba=(z==null?void 0:z.expandSelection)??!1,aa=(z==null?void 0:z.wildcardWrap)??!1,fn=(z==null?void 0:z.clauseNavigation)??!1,hn=z==null?void 0:z.formatQuery,en=!!hn,Ha=typeof hn=="object"?hn:void 0,me=x.useMemo(()=>({savedSearches:ge,historySearch:xe}),[ge,xe]),Ce=Array.isArray(n)?n:[],[Ae,Xe]=x.useState(Ce);x.useEffect(()=>{if(Array.isArray(n)){Xe(n);return}let k=!1;return n().then(G=>{k||Xe(G)}),()=>{k=!0}},[n]);const Pe=x.useMemo(()=>{const k=new Map;for(const G of Ae)if(k.set(G.name.toLowerCase(),G.type),G.aliases)for(const Ee of G.aliases)k.set(Ee.toLowerCase(),G.type);return k},[Ae]),te=x.useRef(null),[Tt,Zt]=x.useState(null),Fa=x.useCallback(k=>{te.current=k,Zt(k)},[]),va=x.useRef(null),qn=x.useRef(null),_e=x.useRef(c||f||""),vt=x.useRef(null),yt=x.useRef(!1),St=x.useRef(!1),Ht=x.useRef(new sA),Ct=x.useRef(null),na=x.useRef(new Set),Wt=x.useRef(null),It=x.useRef(null),pt=x.useRef(null),et=x.useRef(null),Sa=x.useRef(!1),Da=x.useRef(null),A=x.useRef(null),_=x.useRef(null),q=x.useRef("input"),W=x.useRef(null),ie=x.useRef(-1),ke=x.useRef(()=>{}),ye=x.useRef(new Zh(Ce,[],[],C||10,{showSavedSearchHint:Re,showHistoryHint:He,hasSavedSearchProvider:typeof h=="function",hasHistoryProvider:typeof p=="function"}));ye.current.setDefaultField(ee);const De=x.useRef(new rb(Ce)),Ne=x.useRef(T);Ne.current=T;const[Le,Ue]=x.useState([]),[Ke,Oe]=x.useState(null),[Je,Fe]=x.useState([]),[qt,tt]=x.useState(-1),[ft,ut]=x.useState(!1),[ht,Jt]=x.useState(!1),[Va,Ea]=x.useState(null),[Oa,Ma]=x.useState([]),[Ya,xn]=x.useState(!1),[hl,tn]=x.useState(!_e.current),[xr,Ze]=x.useState(pe!=null&&_e.current.length>=pe),[Nt,ea]=x.useState(0),[an,_a]=x.useState(0),[_r,jt]=x.useState(""),[Cn,Ga]=x.useState(null),[Zl,Ti]=x.useState(null),At=x.useRef({tokens:Le,ast:Ke,suggestions:Je,selectedSuggestionIndex:qt,showDropdown:ft,showDatePicker:ht,cursorOffset:Nt,selectionEnd:an,autocompleteContext:_r,validationErrors:Oa,cursorContext:Cn});At.current={tokens:Le,ast:Ke,suggestions:Je,selectedSuggestionIndex:qt,showDropdown:ft,showDatePicker:ht,cursorOffset:Nt,selectionEnd:an,autocompleteContext:_r,validationErrors:Oa,cursorContext:Cn};const vr=x.useCallback((k,G)=>{if(se&&va.current){const be=va.current.getBoundingClientRect();return{top:be.bottom+window.scrollY+4,left:be.left+window.scrollX}}const Ee=am();return Ee?nm(Ee,k,G):null},[se]),uc=x.useCallback(()=>{if(!(!se||!va.current))return va.current.getBoundingClientRect().width},[se]),ir=x.useCallback((k,G,Ee="dropdown")=>{const be=Ee==="datePicker"?k:fb(k,ue);if(se&&Ee!=="datePicker"){ut(!0),Ea(vr(be,G));return}const Ge=requestAnimationFrame(()=>{na.current.delete(Ge),Ee==="datePicker"?Jt(!0):ut(!0);const de=am();Ea(de?nm(de,be,G):null)});na.current.add(Ge)},[se,vr,ue]),ml=80,Cd=60,ks=x.useCallback((k,G)=>{if(!te.current)return;const Ee=oi(k,y,{cursorOffset:G,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Pe});te.current.innerHTML=Ee,document.activeElement===te.current&&ll(te.current,G)},[y]),vn=x.useCallback((k,G)=>{const Ee=pe!=null&&k.length>=pe;if(Ze(Ee),Ee){if(Ue([]),Oe(null),Ma([]),tn(k.length===0),Fe([]),At.current.tokens=[],ut(!1),Jt(!1),te.current){const Se=$l(te.current);te.current.querySelector("span")&&(te.current.textContent=k,ll(te.current,Se)),ea(Se),_a(Se)}s&&s(k,null),u&&u([]);return}const be=new gi(k,me).tokenize(),Ge=new ws(be),de=Ge.parse(),ve=Mu([...Ge.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...De.current.validate(de,Ne.current,fe,L)]);if(te.current){const Se=$l(te.current);G&&be.length>ml?(It.current&&clearTimeout(It.current),It.current=setTimeout(()=>{It.current=null,te.current&&ks(be,$l(te.current))},Cd)):(It.current&&(clearTimeout(It.current),It.current=null),ks(be,Se)),Ue(be),Oe(de),Ma(ve),tn(k.length===0),ea(Se),_a(Se),At.current.tokens=be,G&&ke.current(be,Se)}else Ue(be),Oe(de),Ma(ve),tn(k.length===0),At.current.tokens=be;s&&s(k,de),u&&u(ve)},[y,s,u,ks,pe]),Wl=x.useCallback((k,G)=>{if(!mt||G.type!=="FIELD_VALUE"||!G.fieldName)return k;const Ee=ye.current.resolveField(G.fieldName);if(!Ee)return k;const be=mt(Ee,G.partial);return be==null?k:k.some(Ge=>Ge.type==="hint")?k.map(Ge=>Ge.type==="hint"?{...Ge,customContent:be}:Ge):[{text:"",label:"",type:"hint",customContent:be,replaceStart:G.start??0,replaceEnd:G.end??0},...k]},[mt]),Ts=x.useCallback(k=>{if(!Bt)return!1;const G=Bt({cursorContext:k,partial:k.partial});return G==null?!1:(Fe([{text:"",label:"",type:"noResults",customContent:G,replaceStart:0,replaceEnd:0}]),tt(-1),Jt(!1),ir(32,300),!0)},[Bt]),yn=x.useCallback((k,G,Ee)=>{var Se,We,st;const be=ye.current.getSuggestions(k,G);$e||(be.suggestions=be.suggestions.filter(Be=>Be.type!=="operator"));const Ge=be.context.type;if(Ga(be.context),he){if(F({trigger:q.current,context:be.context,suggestions:be.suggestions,isOpen:At.current.showDropdown||At.current.showDatePicker,value:_e.current,selectionStart:G,selectionEnd:Ee??G})===!1){ut(!1),Jt(!1),Fe([]);return}}else{if(P==="never"){ut(!1),Jt(!1),Fe([]);return}if(P==="manual"){if(_.current&&_.current!==Ge){_.current=null,ut(!1),Jt(!1),Fe([]);return}if(!_.current){ut(!1),Jt(!1),Fe([]);return}}if(P==="input"&&q.current!=="input"&&q.current!=="ctrlSpace"){ut(!1),Jt(!1),Fe([]);return}if(P==="always"&&k.some(Be=>(Be.type===O.AND||Be.type===O.OR||Be.type===O.NOT||Be.type===O.TILDE||Be.type===O.BOOST)&&G>=Be.start&&G<=Be.end)){ut(!1),Jt(!1),Fe([]);return}}const de=be.context.fieldName?ye.current.resolveField(be.context.fieldName):void 0,ve=!!(g&&be.context.type==="FIELD_VALUE"&&be.context.fieldName&&(de==null?void 0:de.type)!=="boolean"&&(de==null?void 0:de.suggestions)!==!1)||typeof h=="function"&&be.context.type==="SAVED_SEARCH"||typeof p=="function"&&be.context.type==="HISTORY_REF";if(be.showDatePicker){Sa.current=!1,(Se=Wt.current)==null||Se.abort(),vt.current&&clearTimeout(vt.current),et.current&&(clearTimeout(et.current),et.current=null);const Be=iA(be.context,fe),Na=Da.current;Da.current=Be,Ti(Be);const zt=be.context.token;zt&&(zt.type==="COLON"||zt.type==="COMPARISON_OP")?A.current={start:zt.end,end:zt.end}:zt?A.current={start:zt.start,end:zt.end}:A.current={start:G,end:G},At.current.showDatePicker&&oA(Na,Be)&&Jt(!1),Fe([]),se||ut(!1),jt(Ge),ir(350,300,"datePicker");return}if(ve){const Be=be.context.token,Na=Be?Be.start:G,zt=Be?Be.end:G,ln=()=>{et.current=null,Fe([{text:"",label:"Searching...",type:"loading",replaceStart:Na,replaceEnd:zt}]),se||ut(!1),Jt(!1),tt(-1),ir(32,300)};et.current&&clearTimeout(et.current),$t>0?et.current=setTimeout(ln,$t):ln(),jt(Ge)}else{Sa.current=!1,(We=Wt.current)==null||We.abort(),vt.current&&clearTimeout(vt.current),et.current&&(clearTimeout(et.current),et.current=null);const Be=Wl(be.suggestions,be.context);Be.length>0?(Fe(Be),se||ut(!1),Jt(!1),tt(be.context.partial||kt?0:-1),jt(Ge),ir(Be.length*32,300)):(jt(Ge),Ts(be.context)||(ut(!1),Jt(!1),Fe([])))}if(ve){const Be=be.context.partial,Na=K||200;Sa.current=!0,vt.current&&clearTimeout(vt.current),(st=Wt.current)==null||st.abort();const zt=new AbortController;Wt.current=zt,vt.current=setTimeout(async()=>{const ln=be.context.token,sn=ln?ln.start:G,bn=ln?ln.end:G;try{let ja;if(be.context.type==="SAVED_SEARCH"&&typeof h=="function"){const da=await h(Be);if(zt.signal.aborted)return;ja=da.map(Ut=>({text:Ut.query,label:Ut.label||Ut.query,description:Ut.description,type:"savedSearch",replaceStart:sn,replaceEnd:bn,matchPartial:Be,sourceData:Ut}))}else if(be.context.type==="HISTORY_REF"&&typeof p=="function"){const da=await p(Be);if(zt.signal.aborted)return;ja=da.map(Ut=>({text:Zh.wrapHistoryQuery(Ut.query),label:Ut.label||Ut.query,description:Ut.description,type:"history",replaceStart:sn,replaceEnd:bn,matchPartial:Be,sourceData:Ut}))}else{const da=be.context.fieldName,Ut=ye.current.resolveField(da),as=await g(Ut?Ut.name:da,Be);if(zt.signal.aborted)return;ja=as.map(wr=>({text:wr.text,label:wr.label||wr.text,description:wr.description,type:wr.type,replaceStart:sn,replaceEnd:bn,matchPartial:Be}))}if(et.current&&(clearTimeout(et.current),et.current=null),ja=ja.slice(0,B),ja.length>0){if(ee!=null&&ee.showFieldSuggestions){const da=ye.current.getFieldSuggestions(Be,sn,bn);ja=[...ja,...da].slice(0,B)}Fe(ja),tt(Be||kt?0:-1),ir(ja.length*32,300)}else{const da=ye.current.getSuggestions(At.current.tokens,At.current.cursorOffset);if(!(Be&&Ts(da.context))){const Ut=Wl(da.suggestions.filter(as=>as.type==="hint"),da.context);Ut.length>0?(Fe(Ut),tt(da.context.partial||kt?0:-1),ir(Ut.length*32,300)):Ts(da.context)||(ut(!1),Fe([]))}}}catch(ja){et.current&&(clearTimeout(et.current),et.current=null),zt.signal.aborted||(Fe([{text:"",label:ja instanceof Error?ja.message:"Error loading suggestions",type:"error",replaceStart:sn,replaceEnd:bn}]),tt(-1),ir(32,300),Sa.current=!1)}},Na)}},[g,h,p,K,Wl,vr,ir,se,F,he,P,$e,B,$t,kt,Ts]);ke.current=yn;const ra=x.useCallback(()=>{var k;ut(!1),Jt(!1),Ti(null),Da.current=null,A.current=null,Fe([]),tt(-1),Sa.current=!1,(k=Wt.current)==null||k.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),pt.current&&(clearTimeout(pt.current),pt.current=null),_.current=null},[]),nn=x.useCallback((k,G,Ee)=>{if(pt.current&&(clearTimeout(pt.current),pt.current=null),!Qe){(At.current.showDropdown||At.current.showDatePicker)&&ra();return}q.current="navigation",ia>0?pt.current=setTimeout(()=>{pt.current=null,yn(k,G,Ee)},ia):yn(k,G,Ee)},[Qe,ia,yn,ra]),An=x.useCallback((k,G,Ee)=>{_e.current=k,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Ht.current.push({value:k,cursorPos:G});const be=new gi(k,me).tokenize(),Ge=new ws(be),de=Ge.parse(),ve=Mu([...Ge.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...De.current.validate(de,Ne.current,fe,L)]);if(te.current){const Se=oi(be,y,{cursorOffset:G,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Pe});te.current.innerHTML=Se,ll(te.current,G)}if(Ue(be),Oe(de),Ma(ve),tn(k.length===0),ea(G),_a(G),ut(!1),Jt(!1),s&&s(k,de),u&&u(ve),Ee){const Se=requestAnimationFrame(()=>{na.current.delete(Se),Ee(be,de)});na.current.add(Se)}},[y,s,u]),Lr=x.useCallback((k,G="Enter",Ee,be)=>{if(!k)return;const Ge=At.current,de=Ge.autocompleteContext,ve=de==="FIELD_VALUE"||de==="SAVED_SEARCH"||de==="HISTORY_REF";if(ve&&(q.current="navigation"),k.type==="hint"&&(k.text==="#"||k.text==="!")){const da=k.text,Ut=k.replaceStart,as=Math.max(k.replaceEnd,Ge.selectionEnd),wr=_e.current.slice(0,Ut),Dd=_e.current.slice(as),mc=wr+da+Dd,pc=wr.length+da.length;An(mc,pc,(Od,Md)=>{Ee?Ee(mc,Md):yn(Od,pc)});return}if(k.type==="hint")return;const Se=Ge.autocompleteContext==="FIELD_VALUE",We=Math.min(k.replaceStart,Ge.cursorOffset),st=Math.max(k.replaceEnd,Ge.selectionEnd),Be=_e.current.slice(0,We),Na=_e.current.slice(st);let zt="",ln=Na;ve&&je&&(Na.length===0?zt=" ":/^[ \t\r\n]+$/.test(Na)&&!Na.startsWith("\\ ")&&(zt=" ",ln=""));const sn=Be+k.text+zt+ln,bn=Be.length+k.text.length+zt.length,ja=G==="Enter"&&Se;An(sn,bn,(da,Ut)=>{Ee?Ee(sn,Ut):ja?r&&r(sn,Ut,be):yn(da,bn)})},[An,yn,r,je]);x.useEffect(()=>{Array.isArray(h)&&ye.current.updateSavedSearches(h),Array.isArray(p)&&ye.current.updateSearchHistory(p)},[h,p]),x.useEffect(()=>{ye.current=new Zh(Ae,[],[],C||10,{showSavedSearchHint:Re,showHistoryHint:He,hasSavedSearchProvider:typeof h=="function",hasHistoryProvider:typeof p=="function"}),ye.current.setDefaultField(ee),De.current=new rb(Ae),Array.isArray(h)&&ye.current.updateSavedSearches(h),Array.isArray(p)&&ye.current.updateSearchHistory(p),_e.current&&vn(_e.current,!1)},[Ae,C,Re,He]),x.useEffect(()=>{I&&I({getValue:()=>_e.current,setValue:k=>{_e.current=k,vn(k,!1)},focus:()=>{var k;return(k=te.current)==null?void 0:k.focus()},blur:()=>{var k;return(k=te.current)==null?void 0:k.blur()},getAST:()=>At.current.ast,getValidationErrors:()=>At.current.validationErrors,setSelection:(k,G)=>{te.current&&(te.current.focus(),rl(te.current,k,G),ea(k),_a(G))}})},[I,vn]),x.useEffect(()=>{const k=_e.current;Ht.current.push({value:k,cursorPos:k.length}),k&&vn(k,!1)},[]),x.useEffect(()=>{c!==void 0&&c!==_e.current&&(_e.current=c,vn(c,!1))},[c,vn]),x.useEffect(()=>()=>{var k;vt.current&&clearTimeout(vt.current),It.current&&clearTimeout(It.current),pt.current&&clearTimeout(pt.current),et.current&&clearTimeout(et.current),na.current.forEach(G=>cancelAnimationFrame(G)),na.current.clear(),(k=Wt.current)==null||k.abort()},[]),x.useEffect(()=>{if(he){const k=At.current;k.cursorContext&&F({trigger:"modeChange",context:k.cursorContext,suggestions:k.suggestions,isOpen:k.showDropdown||k.showDatePicker,value:_e.current,selectionStart:k.cursorOffset,selectionEnd:k.selectionEnd})===!1&&(ut(!1),Jt(!1),Fe([]))}else P==="never"&&(ut(!1),Jt(!1),Fe([]));_.current=null},[F]);const yr=x.useRef(!1);x.useLayoutEffect(()=>{if(yr.current){yr.current=!1;return}const k=qn.current;if(!k||!Va)return;const G=k.getBoundingClientRect(),Ee=window.innerWidth;if(G.right>Ee-8){const be=G.right-Ee+8;yr.current=!0,Ea(Ge=>Ge&&{...Ge,left:Math.max(8,Ge.left-be)})}},[Va,ft,ht,Je]),x.useEffect(()=>{const k=()=>{const G=At.current;if(!(!G.showDropdown&&!G.showDatePicker))if(G.showDropdown&&se&&va.current){const Ee=va.current.getBoundingClientRect();Ea({top:Ee.bottom+window.scrollY+4,left:Ee.left+window.scrollX})}else{const Ee=am();Ee&&Ea(nm(Ee,G.showDatePicker?350:fb(G.suggestions.length*32,ue),300))}};return window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[se,ue]),x.useEffect(()=>{const k=te.current;if(!k)return;const G=()=>{(At.current.showDropdown||At.current.showDatePicker)&&ra()};return k.addEventListener("scroll",G),()=>k.removeEventListener("scroll",G)},[ra]);const zr=x.useRef(null),Ci=x.useRef(y);x.useEffect(()=>{if(!te.current)return;const k=At.current.tokens;if(k.length===0||Ya&&an!==Nt)return;const G=Ya?Nt:-1,Ee=y!==Ci.current;Ci.current=y;const be=w1(k,G),Ge=be?`${be.openStart},${be.closeStart}`:null;if(Ge===zr.current&&!Ee)return;zr.current=Ge;const de=Ya?$l(te.current):-1,ve=oi(k,y,{cursorOffset:G,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Pe});te.current.innerHTML=ve,Ya&&de>=0&&ll(te.current,de)},[Nt,an,Ya,y]);const br=Te&&!Ya,Ai=x.useRef(br);x.useEffect(()=>{if(!te.current)return;const k=Ai.current;if(Ai.current=br,k!==br)if(br)te.current.innerHTML=te.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const G=At.current.tokens;if(G.length>0){const Ee=Ya?$l(te.current):-1,be=oi(G,y,{cursorOffset:Ee,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Pe});te.current.innerHTML=be,Ya&&Ee>=0&&ll(te.current,Ee)}}},[br,y]);const Pn=x.useCallback(()=>{if(yt.current||!te.current)return;W.current=null,ie.current=-1,pt.current&&(clearTimeout(pt.current),pt.current=null);let k=uC(te.current);if(k===_e.current)return;let G=$l(te.current);const Ee=Jy(k);Ee!==k&&(k=Ee,G=Math.min(G,k.length)),_e.current=k;const be=Ht.current,Ge=be.current();if(Ge&&Math.abs(k.length-Ge.value.length)<=2&&Ct.current?be.replaceCurrent({value:k,cursorPos:G}):be.push({value:k,cursorPos:G}),Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{Ct.current=null},300),q.current="input",!he&&P==="input"){const de=G>0?k[G-1]:"";if(!de||de.trim()===""){vn(k,!1),ra(),te.current&&_u(te.current);return}}vn(k,!0),te.current&&_u(te.current)},[vn,he,P,ra]),or=x.useCallback(()=>{yt.current=!0},[]),Di=x.useCallback(()=>{yt.current=!1,Pn()},[Pn]),Ur=x.useCallback(k=>{if(!k)return;_e.current=k.value;const G=new gi(k.value,me).tokenize(),Ee=new ws(G),be=Ee.parse(),Ge=Mu([...Ee.getErrors().map(ve=>({message:ve.message,start:ve.start,end:ve.end,type:"SYNTAX_ERROR"})),...De.current.validate(be,Ne.current,fe,L)]),de=k.selStart!=null&&k.selStart!==k.cursorPos;if(te.current){const ve=oi(G,y,{cursorOffset:k.cursorPos,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Pe});te.current.innerHTML=ve,de?rl(te.current,k.selStart,k.cursorPos):ll(te.current,k.cursorPos)}Ue(G),Oe(be),Ma(Ge),tn(k.value.length===0),ea(de?k.selStart:k.cursorPos),_a(k.cursorPos),ra(),s&&s(k.value,be),u&&u(Ge)},[y,s,u,ra]),Fn=x.useCallback(()=>{const k=qn.current;if(!k)return 10;const G=k.clientHeight,Ee=k.querySelectorAll(".ei-dropdown-item")[0];if(!Ee)return 10;const be=Ee.offsetHeight;return be<=0?10:Math.max(1,Math.floor(G/be))},[]),Oi=x.useCallback(k=>{var be,Ge;if(Q&&Q(k),k.defaultPrevented)return;const G=At.current,Ee=k.nativeEvent.code;if(en&&Ee==="KeyF"&&k.altKey&&k.shiftKey&&!k.ctrlKey&&!k.metaKey){k.preventDefault();const de=WC(_e.current,Ha);de!==_e.current&&An(de,de.length);return}if(te.current&&te.current.childNodes.length>40){const de=window.getSelection();if(de!=null&&!de.isCollapsed){const ve=kr(te.current);if(ve.end-ve.start>20){const Se=k.key==="Backspace"||k.key==="Delete"||k.key==="x"&&(k.ctrlKey||k.metaKey),We=!k.ctrlKey&&!k.metaKey&&!k.altKey&&k.key.length===1;(Se||We)&&(te.current.textContent=_e.current,rl(te.current,ve.start,ve.end))}}}{let de=null,ve=null;if(eb[k.key])de=k.key,ve=eb[k.key];else if(aa&&k.key==="*"&&te.current){const Se=kr(te.current);if(Se.start!==Se.end){const[We,st]=tb(G.tokens,Se.start,Se.end);if(We>=0&&We===st){const Be=G.tokens[We];(Be.type===O.VALUE||Be.type===O.WILDCARD)&&(de="*",ve="*")}}}if(de&&ve&&te.current){const Se=kr(te.current);if(Se.start!==Se.end){k.preventDefault();const{newValue:We,newSelStart:st,newSelEnd:Be}=cC(_e.current,Se.start,Se.end,de,ve),Na=Ht.current,zt=Na.current();zt&&zt.value===_e.current&&(zt.selStart=Se.start,zt.cursorPos=Se.end),_e.current=We,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Na.push({value:We,cursorPos:Be,selStart:st});const ln=new gi(We,me).tokenize(),sn=new ws(ln),bn=sn.parse(),ja=Mu([...sn.getErrors().map(Ut=>({message:Ut.message,start:Ut.start,end:Ut.end,type:"SYNTAX_ERROR"})),...De.current.validate(bn,Ne.current,fe,L)]),da=oi(ln,y,{cursorOffset:Be,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Pe});te.current.innerHTML=da,rl(te.current,st,Be),Ue(ln),Oe(bn),Ma(ja),tn(!1),ea(st),_a(Be),ra(),s&&s(We,bn),u&&u(ja);return}}}if(k.key==="z"&&(k.ctrlKey||k.metaKey)&&!k.shiftKey){k.preventDefault(),Ur(Ht.current.undo());return}if(k.key==="y"&&(k.ctrlKey||k.metaKey)||k.key==="z"&&(k.ctrlKey||k.metaKey)&&k.shiftKey){k.preventDefault(),Ur(Ht.current.redo());return}if(k.key==="a"&&(k.ctrlKey||k.metaKey)&&$a&&te.current){const de=kr(te.current),ve=YC(G.tokens,de.start,de.end);if(ve){k.preventDefault(),rl(te.current,ve.start,ve.end),ea(ve.start),_a(ve.end);return}}if(Ba&&k.altKey&&k.shiftKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&te.current){const de=Ee==="ArrowRight";let ve=W.current;if(!ve){const We=kr(te.current),st=XC(G.ast,G.tokens,We.start);if(st.length===0)return;ve={ranges:st,level:-1},W.current=ve}const Se=de?Math.min(ve.level+1,ve.ranges.length-1):Math.max(ve.level-1,-1);if(Se===ve.level)return;if(ve.level=Se,Se<0){const We=kr(te.current);ll(te.current,We.start),W.current=null}else{k.preventDefault();const We=ve.ranges[Se];rl(te.current,We.start,We.end),ea(We.start),_a(We.end)}return}if(W.current=null,fn&&k.ctrlKey&&k.altKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&te.current){k.preventDefault();const de=Ee==="ArrowRight"?"forward":"backward",ve=rA(G.ast),Se=kr(te.current),We=de==="forward"?Se.end:Se.start,st=lA(ve,ie.current,We,de);st&&(ie.current=st.index,rl(te.current,st.stop.start,st.stop.end),ea(st.stop.start),_a(st.stop.end));return}if(ie.current=-1,k.key===" "&&(k.ctrlKey||k.metaKey)){k.preventDefault(),q.current="ctrlSpace",!he&&P==="manual"&&(_.current=ye.current.getSuggestions(G.tokens,G.cursorOffset).context.type),yn(G.tokens,G.cursorOffset);return}if(k.key==="Enter"&&(k.ctrlKey||k.metaKey)){k.preventDefault(),ra(),r&&r(_e.current,G.ast,k);return}if(k.key==="Enter"&&k.shiftKey&&Kt){k.preventDefault(),FC();const de=te.current?$l(te.current):_e.current.length+1,ve=_e.current,Se=ve.slice(0,de-1)+`
323
- `+ve.slice(de-1);_e.current=Se,W.current=null,pt.current&&(clearTimeout(pt.current),pt.current=null),q.current="input",Ht.current.push({value:Se,cursorPos:de}),vn(Se,!0),te.current&&_u(te.current);return}if((k.key==="Backspace"||k.key==="Delete")&&te.current&&!te.current.textContent){const de=_e.current;if(!de)return;const{start:ve,end:Se}=kr(te.current);let We,st;if(ve!==Se)We=de.slice(0,ve)+de.slice(Se),st=ve;else if(k.key==="Backspace"&&ve>0)We=de.slice(0,ve-1)+de.slice(ve),st=ve-1;else if(k.key==="Delete"&&ve<de.length)We=de.slice(0,ve)+de.slice(ve+1),st=ve;else return;k.preventDefault(),_e.current=We,W.current=null,pt.current&&(clearTimeout(pt.current),pt.current=null),q.current="input",Ht.current.push({value:We,cursorPos:st}),ll(te.current,st),vn(We,!0),te.current&&_u(te.current);return}if(St.current=!1,G.showDropdown&&G.suggestions.length>0)switch(k.key){case"ArrowDown":k.preventDefault(),St.current=!0,tt(de=>de>=G.suggestions.length-1?0:de+1);return;case"ArrowUp":k.preventDefault(),St.current=!0,tt(de=>de<=0?G.suggestions.length-1:de-1);return;case"PageDown":{k.preventDefault(),St.current=!0;const de=Fn();tt(ve=>Math.min(ve+de,G.suggestions.length-1));return}case"PageUp":{k.preventDefault(),St.current=!0;const de=Fn();tt(ve=>Math.max(ve-de,0));return}case"Home":if(Lt&&G.selectedSuggestionIndex>=0){k.preventDefault(),St.current=!0,tt(0);return}break;case"End":if(Lt&&G.selectedSuggestionIndex>=0){k.preventDefault(),St.current=!0,tt(G.suggestions.length-1);return}break;case"Enter":if(G.selectedSuggestionIndex>=0){const de=G.suggestions[G.selectedSuggestionIndex];if(de.type==="loading"||de.type==="error"){k.preventDefault(),ra(),r&&r(_e.current,G.ast,k);return}if(de.type==="hint"&&de.text!=="#"&&de.text!=="!"){k.preventDefault(),ra();const ve=_e.current,Se=G.cursorOffset;if(Se<=ve.length&&ve[Se]!==" "){const We=ve.slice(0,Se),st=ve.slice(Se),Be=We+" "+st;An(Be,Se+1,()=>{r&&r(Be,G.ast,k)})}else r&&r(ve,G.ast,k);return}k.preventDefault(),Lr(de,"Enter",void 0,k);return}k.preventDefault(),ra(),r&&r(_e.current,G.ast,k);return;case"Tab":if(M){k.preventDefault();const de=G.selectedSuggestionIndex>=0?G.suggestions[G.selectedSuggestionIndex]:null,ve=de&&de.type!=="loading"&&de.type!=="error"&&!(de.type==="hint"&&de.text!=="#"&&de.text!=="!")?de:null,Se=M({suggestion:ve,cursorContext:G.cursorContext||{type:"EMPTY",partial:""},query:_e.current});Se.accept&&ve?Lr(ve,"Tab",(We,st)=>{var Be;Se.submit&&r&&r(We,st,k),Se.blur&&((Be=te.current)==null||Be.blur())},k):(ra(),Se.submit&&r&&r(_e.current,G.ast,k),Se.blur&&((be=te.current)==null||be.blur()));return}if(G.selectedSuggestionIndex>=0){const de=G.suggestions[G.selectedSuggestionIndex];if(de.type==="hint"&&de.text!=="#"&&de.text!=="!"){k.preventDefault(),ra();const ve=_e.current,Se=G.cursorOffset;if(Se<=ve.length&&ve[Se]!==" "){const We=ve.slice(0,Se),st=ve.slice(Se),Be=We+" "+st,Na=Se+1;An(Be,Na,zt=>{yn(zt,Na)})}return}k.preventDefault(),Lr(de,"Tab",void 0,k);return}break;case"Escape":k.preventDefault(),ra();return}if(k.key==="Tab"&&M){k.preventDefault();const de=M({suggestion:null,cursorContext:G.cursorContext||{type:"EMPTY",partial:""},query:_e.current});de.submit&&r&&r(_e.current,G.ast,k),de.blur&&((Ge=te.current)==null||Ge.blur());return}if(G.showDatePicker&&k.key==="Escape"){k.preventDefault(),ra();return}if(k.key==="Enter"&&!G.showDropdown&&!G.showDatePicker){k.preventDefault(),r&&r(_e.current,G.ast,k);return}},[r,ra,Lr,An,Ur,Kt,he,P,yn,Q,M,$a,Ba,fn,Lt,Fn,en]),Cs=x.useCallback(k=>{if(St.current){St.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(k.key)){if(!te.current)return;const G=kr(te.current);ea(G.start),_a(G.end),nn(At.current.tokens,G.start,G.end)}},[nn]),dc=x.useCallback(()=>{xn(!0),J==null||J();const k=requestAnimationFrame(()=>{if(na.current.delete(k),te.current){const G=At.current.tokens,Ee=G.length>0?$l(te.current):0;ea(Ee),_a(Ee),nn(G,Ee)}});na.current.add(k)},[Pn,nn,J]),As=x.useCallback(()=>{var k;xn(!1),ut(!1),Jt(!1),Fe([]),Sa.current=!1,(k=Wt.current)==null||k.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),et.current&&(clearTimeout(et.current),et.current=null),ea(-1),ne==null||ne()},[ne]),$r=x.useRef(!1),fc=x.useCallback(k=>{if(!te.current||k.detail!==2&&k.detail!==3)return;if(k.detail===3){if(!At.current.ast)return;const Se=document.caretRangeFromPoint(k.clientX,k.clientY);if(!Se)return;const We=Yo(te.current,Se.startContainer,Se.startOffset),st=lC(At.current.ast,_e.current,We);if(!st||st.start>=st.end)return;k.preventDefault(),$r.current=!0,rl(te.current,st.start,st.end);return}k.preventDefault(),$r.current=!0;const G=document.caretRangeFromPoint(k.clientX,k.clientY);if(!G)return;const Ee=Yo(te.current,G.startContainer,G.startOffset),be=_e.current,Ge=Se=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(Se);let de=Ee;for(;de>0&&Ge(be[de-1]);)de--;let ve=Ee;for(;ve<be.length&&Ge(be[ve]);)ve++;de<ve&&rl(te.current,de,ve)},[]),rn=x.useCallback(k=>{$r.current&&(k.preventDefault(),$r.current=!1)},[]),Br=x.useCallback(()=>{if(!te.current)return;const k=kr(te.current);if(ea(k.start),_a(k.end),k.start!==k.end){const[G,Ee]=tb(At.current.tokens,k.start,k.end);if(G!==Ee){ra();return}}nn(At.current.tokens,k.start,k.end)},[nn,ra]),Hr=x.useCallback(k=>{Ct.current&&(clearTimeout(Ct.current),Ct.current=null),PC(k),Pn()},[Pn]),Jl=x.useCallback(k=>{k.preventDefault();const G=Jy(k.clipboardData.getData("text/plain"));if(we){const Ee=we(G,k);Ee!=null&&typeof(Ee==null?void 0:Ee.then)=="function"?Ee.then(be=>{be!=null&&Hr(be)}).catch(()=>{}):Ee!=null&&Hr(Ee)}else Hr(G)},[we,Hr]),Ad=x.useCallback(k=>{q.current="navigation";const G=At.current,Ee=A.current,be=Ee?Ee.start:G.cursorOffset,Ge=Ee?Ee.end:G.cursorOffset,de=_e.current.slice(0,be),ve=_e.current.slice(Ge);let Se="",We=ve;je&&k.length>0&&(ve.length===0?Se=" ":/^[ \t\r\n]+$/.test(ve)&&!ve.startsWith("\\ ")&&(Se=" ",We=""));const st=de+k+Se+We,Be=de.length+k.length+Se.length;An(st,Be,Na=>{te.current&&te.current.focus(),yn(Na,Be)})},[An,yn,je]),pl=oc(y),es=cc(v),ts=vC(pl,j),Ir={...yC(pl,es),...Ya?bC(es):{}};br&&(Ir.whiteSpace="nowrap",Ir.overflow="hidden",Ir.textOverflow="ellipsis");const hc=wC(pl,es);return x.createElement("div",{ref:va,style:ts,className:Bn("ei-container",S,w==null?void 0:w.container)},x.createElement("div",{ref:Fa,contentEditable:!0,suppressContentEditableWarning:!0,className:Bn("ei-editor",w==null?void 0:w.editor),style:Ir,onInput:Pn,onKeyDown:Oi,onKeyUp:Cs,onMouseDown:fc,onMouseUp:rn,onFocus:dc,onBlur:As,onClick:Br,onPaste:Jl,onCompositionStart:or,onCompositionEnd:Di,spellCheck:!1}),hl&&!Ya?x.createElement("div",{className:Bn("ei-placeholder",w==null?void 0:w.placeholder),style:hc},E):null,x.createElement(qC,{errors:Oa,editorRef:Tt,cursorOffset:Nt,colors:y,styles:v,containerRef:va.current,classNames:w?{squiggly:w.squiggly,tooltip:w.tooltip}:void 0}),x.createElement(_C,{suggestions:Je,selectedIndex:qt,onSelect:k=>Lr(k,"Tab"),position:Va,colors:y,styles:v,visible:ft,fixedWidth:uc(),renderHistoryItem:ce,renderSavedSearchItem:qe,renderDropdownHeader:lt,cursorContext:Cn,listRefCallback:k=>{qn.current=k},renderType:xa,classNames:w?{dropdown:w.dropdown,dropdownHeader:w.dropdownHeader,dropdownItem:w.dropdownItem}:void 0}),ht&&Va?x.createElement(cA,{position:Va,colors:pl,onSelect:Ad,colorConfig:y,styleConfig:v,datePickerInit:Zl,fixedWidth:void 0,datePresets:$,datePickerClassName:w==null?void 0:w.datePicker}):null)}const dA=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function mb(e){var u;const n=window.getSelection();if(!n||n.rangeCount===0)return((u=e.textContent)==null?void 0:u.length)??0;const r=n.getRangeAt(0),s=r.cloneRange();return s.selectNodeContents(e),s.setEnd(r.endContainer,r.endOffset),s.toString().length}function fA(e){return n=>{if(!(n.ctrlKey&&!n.metaKey&&!n.altKey))return;const r=n.key.toLowerCase(),s=n.currentTarget,u=s.isContentEditable?s:s.querySelector("[contenteditable='true'], [contenteditable]")??s,c=e.current;if(r==="h"&&c){n.preventDefault();const h=c.getValue();let p=mb(u);(p<0||p>h.length)&&(p=h.length),p>0&&(c.setValue(h.slice(0,p-1)+h.slice(p)),c.setSelection(p-1,p-1));return}if(r==="u"&&c){n.preventDefault();const h=c.getValue();let p=mb(u);if((p<0||p>h.length)&&(p=h.length),p===0)return;let g=p;for(;g>0&&/\s/.test(h[g-1]??"");)g--;if(g===p)for(;g>0&&!/\s/.test(h[g-1]??"");)g--;g<p&&(c.setValue(h.slice(0,g)+h.slice(p)),c.setSelection(g,g));return}const f=r==="j"?"ArrowDown":r==="k"?"ArrowUp":null;f&&(n.preventDefault(),u.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function rm(e){return String(e>0?e:0).padStart(3,"0")}function hA({features:e,phases:n,query:r,onQuery:s}){const u=x.useRef(null),c=fA(u),f=x.useMemo(()=>[{name:"feature",label:"Feature",type:"number",description:"Feature number, e.g. 1 (F001)"},{name:"phase",label:"Phase",type:"number",description:"Phase number, e.g. 2 (P002)"},{name:"task",label:"Task",type:"number",description:"Task number, e.g. 10 (T010). Comma-list supported."},{name:"id",label:"Short ID",type:"string",description:"Global 5-char short id, e.g. UUXD1"},{name:"status",label:"Status",type:"string",description:"Task status"},{name:"feature-status",label:"Feature status",type:"string",description:"Status of the feature"},{name:"phase-status",label:"Phase status",type:"string",description:"Status of the phase"},{name:"title",label:"Title",type:"string",description:"Substring match on title"}],[]),h=x.useMemo(()=>{const v=[...new Set(e.map(R=>R.number))].sort((R,z)=>R-z),E=[...new Set(n.map(R=>R.number))].sort((R,z)=>R-z),S=[...new Set(n.flatMap(R=>R.tasks.map(z=>z.number)))].sort((R,z)=>R-z),w=[...new Set([...e.map(R=>R.shortId),...n.flatMap(R=>[R.shortId,...R.tasks.map(z=>z.shortId)])].filter(Boolean))],j=[...new Set(n.flatMap(R=>R.tasks.map(z=>z.title)))];return{featureNums:v,phaseNums:E,taskNums:S,shortIds:w,titles:j}},[e,n]),p=x.useCallback(async(v,E)=>{const S=E.toLowerCase();return v==="feature"?h.featureNums.filter(w=>String(w).startsWith(E)).slice(0,20).map(w=>({text:String(w),label:`F${rm(w)}`})):v==="phase"?h.phaseNums.filter(w=>String(w).startsWith(E)).slice(0,20).map(w=>({text:String(w),label:`P${rm(w)}`})):v==="task"?h.taskNums.filter(w=>String(w).startsWith(E)).slice(0,20).map(w=>({text:String(w),label:`T${rm(w)}`})):v==="id"?h.shortIds.filter(w=>w.toLowerCase().startsWith(S)).slice(0,20).map(w=>({text:w,label:w})):v==="status"||v==="feature-status"||v==="phase-status"?dA.filter(w=>w.startsWith(S)).map(w=>({text:w,label:w})):v==="title"?h.titles.filter(w=>w.toLowerCase().includes(S)).slice(0,20).map(w=>({text:w,label:w.length>44?w.slice(0,44)+"…":w})):[]},[h]),g=x.useCallback(v=>s(v),[s]),y=x.useCallback(v=>{u.current=v},[]);return o.jsx("div",{className:"search-bar",children:o.jsx(uA,{fields:f,value:r,onChange:g,onSearch:g,fetchSuggestions:p,onKeyDown:c,inputRef:y,placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function pb(){const e=new URL(window.location.href);e.searchParams.has("locate")&&(e.searchParams.delete("locate"),window.history.replaceState(window.history.state,"",`${e.pathname}${e.search}${e.hash}`))}function mA(e,n){if(Object.keys(n).length===0)return e;const r=c=>{const f=n[c];return f?new Map(f.map((h,p)=>[h,p])):null},s=r("__features__");return(s?[...e].sort((c,f)=>(s.get(c.feature.id)??1/0)-(s.get(f.feature.id)??1/0)):e).map(c=>{const f=r(`phase-scope:${c.feature.id}`),h=f?[...c.allPhases].sort((p,g)=>(f.get(p.phase.id)??1/0)-(f.get(g.phase.id)??1/0)):c.allPhases;return{...c,allPhases:h.map(p=>{const g=r(`task-scope:${p.phase.id}`),y=g?[...p.allTasks].sort((v,E)=>(g.get(v.id)??1/0)-(g.get(E.id)??1/0)):p.allTasks;return{...p,allTasks:y}})}})}function ci({active:e=!1,disabled:n=!1,onClick:r,children:s}){return o.jsx("button",{type:"button",disabled:n,onClick:r,className:`inline-flex h-7 min-h-7 shrink-0 items-center justify-center whitespace-nowrap rounded-[9px] border px-2 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] sm:h-8 sm:min-h-8 sm:rounded-[10px] sm:px-2.5 ${e?"border-transparent bg-[var(--accent)] text-white":"border-[var(--border)] bg-[var(--surface-card)] text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"} ${n?"cursor-not-allowed opacity-60":""}`,children:s})}function pA({features:e,phases:n,activeTasks:r,projectStorageScope:s,resumeRequiredIds:u=new Set,analyticsFilter:c=null,onClearAnalyticsFilter:f}){const h=eC({features:e,phases:n,projectStorageScope:s}),p=x.useMemo(()=>c?h.displayedWorkTree.map(P=>({...P,allPhases:P.allPhases.map(se=>({...se,allTasks:se.allTasks.filter(C=>c.taskIds.has(C.id))})).filter(se=>se.allTasks.length>0)})).filter(P=>P.allPhases.length>0):h.displayedWorkTree,[c,h.displayedWorkTree]),g=x.useMemo(()=>new Set(p.map(P=>P.feature.id)),[p]),y=x.useMemo(()=>new Set(p.flatMap(P=>P.allPhases.map(se=>se.phase.id))),[p]),v=x.useMemo(()=>p.reduce((P,se)=>P+se.allPhases.reduce((C,B)=>C+B.allTasks.length,0),0),[p]),[E,S]=x.useState({});x.useEffect(()=>{S({})},[p]);const w=x.useMemo(()=>mA(p,E),[p,E]),[j,R]=x.useState(!1),[z,I]=x.useState(null),[$,Q]=x.useState(null),J=P=>Q(String(P.active.id)),[ne,M]=x.useState(0);x.useEffect(()=>{const P=document.querySelector("header");if(!P)return;const se=()=>M(P.offsetHeight);se();const C=new ResizeObserver(se);return C.observe(P),window.addEventListener("resize",se),()=>{C.disconnect(),window.removeEventListener("resize",se)}},[]),x.useEffect(()=>{const P=window.setTimeout(()=>{const se=document.querySelector(".ap-search-sticky"),C=document.querySelector("header");if(!se||!C)return;const B=se.getBoundingClientRect();if(B.top<0){const K=B.top+window.scrollY-C.offsetHeight;window.scrollTo({top:Math.max(0,K),behavior:"smooth"})}},60);return()=>window.clearTimeout(P)},[h.searchQuery,h.hideDone,h.hidePlanned,h.onlyActiveBranches]);const T=gk(pk(tp,{activationConstraint:{distance:5}})),fe=async P=>{const{active:se,over:C}=P;if(Q(null),!C||se.id===C.id)return;const B=String(se.id),K=String(C.id),ue=w.map(ge=>ge.feature.id);if(ue.includes(B)&&ue.includes(K)){const ge=$o(ue,ue.indexOf(B),ue.indexOf(K)),xe=ge.indexOf(B),Re=xe>0?ge[xe-1]??null:null,He=xe<ge.length-1?ge[xe+1]??null:null;S($e=>({...$e,__features__:ge})),await Ih("feature",B,Re,He).catch(()=>{});return}for(const ge of w){const xe=ge.allPhases.map(Re=>Re.phase.id);if(xe.includes(B)&&xe.includes(K)){const Re=$o(xe,xe.indexOf(B),xe.indexOf(K)),He=Re.indexOf(B),$e=He>0?Re[He-1]??null:null,Qe=He<Re.length-1?Re[He+1]??null:null;S(ia=>({...ia,[`phase-scope:${ge.feature.id}`]:Re})),await Ih("phase",B,$e,Qe).catch(()=>{});return}}for(const ge of w)for(const xe of ge.allPhases){const Re=xe.allTasks.map(He=>He.id);if(Re.includes(B)&&Re.includes(K)){const He=$o(Re,Re.indexOf(B),Re.indexOf(K)),$e=He.indexOf(B),Qe=$e>0?He[$e-1]??null:null,ia=$e<He.length-1?He[$e+1]??null:null;S($t=>({...$t,[`task-scope:${xe.phase.id}`]:He})),await Ih("task",B,Qe,ia).catch(()=>{});return}}},pe=P=>c?y.has(P):h.expandedPhaseIds.includes(P),we=P=>h.recentPhaseIds.includes(P),re=P=>h.recentTaskIds.includes(P),[je]=Wo(),[Te,ee]=x.useState(null),L=je.get("locate"),F=L?parseInt(L.replace(/^T/i,""),10):null;x.useEffect(()=>{if(F==null||Number.isNaN(F))return;const P=n.flatMap(K=>K.tasks.map(ue=>({t:ue,p:K}))).find(({t:K})=>K.number===F);if(!P){if(n.length===0)return;pb();return}const{t:se,p:C}=P;if(h.onlyActiveBranches&&h.setOnlyActiveBranches(!1),h.hideDone&&h.setHideDone(!1),h.searchQuery&&h.setSearchQuery(""),h.setTreeOpenMode("smart"),C.featureId){const K=C.featureId;h.expandedFeatureIds.includes(K)||h.setExpandedFeatureIds(ue=>ue.includes(K)?ue:[...ue,K])}h.expandedPhaseIds.includes(C.id)||h.setExpandedPhaseIds(K=>K.includes(C.id)?K:[...K,C.id]);const B=document.getElementById(`task-row-${F}`);if(B){const K=document.querySelector("header"),ue=document.querySelector(".ap-search-sticky"),ge=((K==null?void 0:K.offsetHeight)??0)+((ue==null?void 0:ue.offsetHeight)??0)+12,xe=B.getBoundingClientRect().top+window.scrollY-ge;window.scrollTo({top:Math.max(0,xe),behavior:"smooth"}),ee(se.id);const Re=window.setTimeout(()=>ee(null),2500);return pb(),()=>window.clearTimeout(Re)}},[F,n,h.expandedFeatureIds,h.expandedPhaseIds,h.onlyActiveBranches,h.hideDone,h.searchQuery,h.treeOpenMode]);const he=()=>{if(!$)return null;for(const P of w){if(P.feature.id===$)return o.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(rr,{featureNum:P.feature.number}),o.jsx(ar,{status:P.feature.status})]}),o.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:P.feature.name})]});for(const se of P.allPhases){if(se.phase.id===$)return o.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(rr,{featureNum:P.feature.number,phaseNum:se.phase.number}),o.jsx(ar,{status:se.phase.status})]}),o.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:se.phase.title})]});for(const C of se.allTasks)if(C.id===$)return o.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(rr,{featureNum:P.feature.number,phaseNum:se.phase.number,taskNum:C.number}),o.jsx(ar,{status:C.status})]}),o.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:C.title})]})}}return null};return o.jsxs(Vt,{className:"grid gap-4",children:[o.jsx("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]})}),c?o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-xl border border-[var(--accent)] bg-[var(--accent-soft)] px-3 py-2","data-analytics-work-tree-filter":!0,role:"status",children:[o.jsxs("p",{className:"text-sm text-[var(--text)]",children:[o.jsx("span",{className:"font-bold",children:"Analytics filter:"})," ",c.label,". Showing ",v," of ",c.taskIds.size," selected ",c.taskIds.size===1?"task":"tasks"," after current Work Tree filters."]}),f?o.jsx("button",{type:"button",onClick:f,className:"rounded-lg px-2 py-1 text-xs font-bold text-[var(--accent)] underline decoration-dotted underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",children:"Clear analytics filter"}):null]}):null,o.jsxs("div",{className:"ap-search-sticky z-20 grid gap-2",style:{top:ne},children:[o.jsx(hA,{features:e,phases:n,query:h.searchQuery,onQuery:h.setSearchQuery}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(lp,{sort:h.sort,onChange:h.setSort}),o.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5 overflow-x-auto rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1.5 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5 sm:gap-2 sm:rounded-[14px] sm:px-3 sm:py-2",children:[o.jsx(ci,{active:h.isAllExpanded,onClick:()=>h.isAllExpanded?h.collapseAll():h.expandAll(),children:h.isAllExpanded?"Collapse all":"Expand all"}),o.jsx(ci,{active:h.hideDone,onClick:()=>h.setHideDone(P=>!P),children:"Hide done"}),o.jsx(ci,{active:h.hidePlanned,onClick:()=>h.setHidePlanned(P=>!P),children:"Hide planned"}),o.jsx(ci,{active:h.onlyActiveBranches,onClick:()=>h.setOnlyActiveBranches(P=>!P),children:"Only active"}),o.jsx(ci,{onClick:h.resetFilters,children:"Reset"}),o.jsx(ci,{disabled:j,onClick:async()=>{R(!0),I(null);try{const P=await z2(),se=P.migrated,C=P.integrity.duplicatePhaseIds.length,B=P.integrity.danglingPhaseIds.length;I(`Repair done: renamed ${se.renamed}, repaired ${se.repaired} refs, inferred ${se.inferred}, archived ${P.handoffs.archived} stale handoff(s). Integrity: ${C} duplicate, ${B} dangling.`)}catch(P){I(`Repair failed: ${P instanceof Error?P.message:String(P)}`)}finally{R(!1)}},children:j?"Repairing…":"Repair"})]})]}),h.searchActive?o.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:[h.matchedTaskIds.size," match",h.matchedTaskIds.size===1?"":"es"," — clear the box to reset."]}):null,z?o.jsx("span",{className:"text-xs text-[var(--text-muted)] sm:truncate",children:z}):null]}),o.jsx("div",{className:"grid gap-3",children:w.length>0?o.jsxs(gT,{sensors:T,collisionDetection:Sk,onDragStart:J,onDragEnd:fe,children:[o.jsx(rp,{items:w.map(P=>P.feature.id),strategy:np,children:w.map(P=>o.jsx(op,{id:P.feature.id,children:o.jsx(aC,{entry:P,expanded:c?g.has(P.feature.id):h.expandedFeatureIds.includes(P.feature.id),recentlyChanged:h.recentFeatureIds.includes(P.feature.id),onToggle:()=>h.toggleExpandedFeature(P.feature.id),isPhaseExpanded:pe,onTogglePhase:h.toggleExpandedPhase,isPhaseRecentlyChanged:we,isTaskRecentlyChanged:re,highlightedTaskIds:(()=>{const se=h.searchActive?h.matchedTaskIds:void 0;if(!Te)return se;const C=new Set(se??[]);return C.add(Te),C})(),resumeRequiredIds:u})},P.feature.id))}),o.jsx(LT,{dropAnimation:{duration:150,easing:"ease"},children:he()})]}):c?o.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No selected analytics tasks match the current Work Tree filters."}):r.length>0?r.map(P=>{const se=P.featureId?`/features/${P.featureId}/phases/${P.phaseId}/tasks/${P.id}`:"/features";return o.jsxs(Ve,{to:se,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[P.status==="in-progress"?o.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,o.jsxs("span",{className:"truncate",children:["T",DR(P.number)," — ",P.title]})]}),o.jsx(ar,{status:P.status})]}),o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:P.phaseId})]},P.id)}):o.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function gA({tasks:e}){return e.length?o.jsxs("section",{"aria-labelledby":"resume-required-heading",className:"grid grid-cols-1 gap-3",children:[o.jsxs("h2",{id:"resume-required-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--accent)]",children:["Resume required (",e.length,")"]}),o.jsx("div",{className:"grid gap-2",children:e.map(n=>o.jsx(T0,{task:n},n.id))})]}):null}function xA(){const{features:e,phases:n,activeTasks:r}=Mr(),{project:s,taskFocus:u}=js("root"),c=x.useMemo(()=>new Set((u.pendingResume??[]).map(E=>E.id)),[u.pendingResume]),[f,h]=x.useState(null),p=x.useMemo(()=>new Set((f==null?void 0:f.taskIds)??[]),[f]),g=Or(),y=()=>g("/project/edit");Aa("edit",y);const v=s.projectRoot||s.planRoot||s.name||"default";return o.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[o.jsxs(Vt,{className:"grid grid-cols-1 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsx("h2",{className:"min-w-0 text-lg font-bold text-[var(--text)]",children:"Project Goal"}),o.jsxs(ot,{type:"button",shortcut:"edit",onClick:y,className:"shrink-0",children:[o.jsx(Yl,{className:"h-4 w-4"}),"Edit project"]})]}),s.goal?o.jsx(ga,{text:s.goal,className:"max-w-4xl"}):o.jsx("p",{className:"max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),o.jsx(xR,{project:s}),o.jsx(_R,{features:e,phases:n}),o.jsx(ek,{phases:n,activeDrilldown:f,onDrilldown:h,onClearDrilldown:()=>h(null)}),o.jsx(gA,{tasks:u.pendingResume}),o.jsx(pA,{features:e,phases:n,activeTasks:r,projectStorageScope:v,resumeRequiredIds:c,analyticsFilter:f?{label:f.label,taskIds:p}:null,onClearAnalyticsFilter:()=>h(null)}),o.jsx(bR,{features:e,phases:n}),o.jsx(SR,{features:e,phases:n})]})}async function vA(){const[e,n]=await Promise.all([v0(),xd()]);return{features:e,phases:n}}function Go(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function rd(e){const n=[];return e.active&&n.push(`${e.active} active`),e.planned&&n.push(`${e.planned} planned`),e.done&&n.push(`${e.done} done`),e.blocked&&n.push(`${e.blocked} blocked`),e.canceled&&n.push(`${e.canceled} canceled`),n.join(" · ")}function yA(e){const n=Go();for(const r of e){if(r.status==="in-progress"||r.status==="discovery"){n.active+=1;continue}if(r.status==="planned"||r.status==="draft"){n.planned+=1;continue}if(r.status==="done"){n.done+=1;continue}if(r.status==="blocked"){n.blocked+=1;continue}r.status==="canceled"&&(n.canceled+=1)}return n}function N1(e){const n=Go();for(const r of e){if(r.status==="in-progress"){n.active+=1;continue}if(r.status==="planned"){n.planned+=1;continue}if(r.status==="done"){n.done+=1;continue}if(r.status==="blocked"){n.blocked+=1;continue}r.status==="canceled"&&(n.canceled+=1)}return n}function bA(e){const n=Go();for(const r of e){if(r.status==="in-progress"){n.active+=1;continue}if(r.status==="planned"){n.planned+=1;continue}if(r.status==="done"){n.done+=1;continue}if(r.status==="blocked"){n.blocked+=1;continue}r.status==="canceled"&&(n.canceled+=1)}return n}function wA({feature:e,phases:n,phasesCount:r,tasksCount:s,phaseSummary:u,taskSummary:c,activity:f}){var z;const h=Vl(),p=Vl(),y=((z=h.formData)==null?void 0:z.get("status"))??e.status,v=h.state!=="idle",E=p.state!=="idle",S=rd(u),w=rd(c),j=z0(n??[]),R=e.description||(f?`${f.doneTasks}/${s} done · ${f.remainingTasks} left${f.blockedTasks?` · ${f.blockedTasks} blocked`:""}`:"");return o.jsxs(ki,{variant:"surface",status:j.displayStatus,className:"px-4 py-2",children:[o.jsxs("div",{className:"grid gap-2 xl:grid-cols-[minmax(0,1fr)_minmax(0,132px)_minmax(0,152px)_124px_44px_44px] xl:items-center",children:[o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(rr,{featureNum:e.number,featureId:e.id}),o.jsx(sr,{id:cl({featureNum:e.number}),children:o.jsx("span",{className:"sr-only",children:"Copy feature path"})}),e.shortId?o.jsx(ul,{shortId:e.shortId}):null,o.jsx(nc,{priority:e.priority}),o.jsx("span",{className:"shrink-0",children:o.jsx(ac,{status:j.displayStatus,breakdown:j.breakdown})})]}),o.jsx(Ve,{to:`/features/${e.id}`,className:"entity-link--feature min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:e.name})]}),o.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[o.jsx(Ve,{to:`/features/${e.id}/edit`,"aria-label":`Edit feature ${e.name}`,children:o.jsx(ot,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-3.5 w-3.5"})})}),o.jsx(p.Form,{method:"post",action:`/features/${e.id}/delete`,onSubmit:I=>{window.confirm(`Delete feature “${e.name}”? This cannot be undone.`)||I.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",disabled:E||v,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${e.name}`,children:o.jsx(Es,{className:"h-4 w-4"})})})]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[o.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r," phases"]}),S?o.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[o.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[s," tasks"]}),w?o.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),o.jsx(h.Form,{method:"post",action:`/features/${e.id}/status`,className:"w-full xl:w-auto",children:o.jsxs("div",{className:"relative",children:[o.jsx("select",{name:"status",value:y,disabled:v||E,"aria-busy":v,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:I=>h.submit(I.currentTarget.form),children:Rd.map(I=>o.jsx("option",{value:I.value,children:I.label},I.value))}),o.jsx(Rs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),o.jsx(Ve,{to:`/features/${e.id}/edit`,"aria-label":`Edit feature ${e.name}`,className:"hidden xl:block",children:o.jsx(ot,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-3.5 w-3.5"})})}),o.jsx(p.Form,{method:"post",action:`/features/${e.id}/delete`,className:"hidden xl:block",onSubmit:I=>{window.confirm(`Delete feature “${e.name}”? This cannot be undone.`)||I.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",disabled:E||v,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${e.name}`,children:o.jsx(Es,{className:"h-4 w-4"})})})]}),o.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:o.jsx(dl,{value:e.updatedAt})}),R?o.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:R}):null]})}const SA={feature:{label:"Feature",Icon:Yu},phase:{label:"Phase",Icon:Uj},task:{label:"Task",Icon:Jo},requirement:{label:"Requirement",Icon:p0}};function j1({kind:e,label:n}){const{Icon:r,label:s}=SA[e];return o.jsxs("span",{className:`entity-badge entity-badge--${e}`,children:[o.jsx(r,{className:"h-3.5 w-3.5"}),o.jsx("span",{children:n??s})]})}function Wa({className:e="",...n}){return o.jsx("input",{className:`field-control ${e}`,...n})}function fl({className:e="",...n}){return o.jsx("select",{className:`field-control ${e}`,...n})}function R1({query:e,status:n,statusOptions:r,placeholder:s,clearTo:u,resultsLabel:c}){const f=Um(),h=((r==null?void 0:r.length)??0)>0;return o.jsxs(Pa,{method:"get",className:`surface-card grid gap-3 p-3 md:items-end sm:p-4 ${h?"md:grid-cols-[minmax(0,1fr)_200px_auto_auto]":"md:grid-cols-[minmax(0,1fr)_auto_auto]"}`,children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),o.jsx(Wa,{id:"list-filter-query",name:"q",defaultValue:e,placeholder:s,className:"min-h-9 py-2 sm:min-h-11 sm:py-2.5",onChange:p=>f(p.currentTarget.form)})]}),h?o.jsxs("div",{children:[o.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),o.jsxs("div",{className:"relative",children:[o.jsxs(fl,{id:"list-filter-status",name:"status",defaultValue:n,className:"min-h-9 appearance-none py-2 sm:min-h-11 sm:py-2.5 pr-8",children:[o.jsx("option",{value:"",children:"All statuses"}),r==null?void 0:r.map(p=>o.jsx("option",{value:p.value,children:p.label},p.value))]}),o.jsx(Rs,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}):null,o.jsx(ot,{type:"submit",variant:"secondary",children:"Apply filters"}),o.jsx(Ve,{to:u,className:"inline-flex min-h-9 items-center justify-center rounded-[12px] px-3 text-sm font-semibold text-[var(--text-muted)] transition hover:bg-[var(--accent-soft)] hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px]",children:"Clear"}),o.jsx("div",{className:`text-sm text-[var(--text-muted)] ${h?"md:col-span-4":"md:col-span-3"}`,children:c})]})}function k1(e,n,r){return n.status&&e.status!==n.status?!1:n.onlyActive?r.includes(e.status):!(n.hideDone&&e.status==="done"||n.hidePlanned&&e.status==="planned")}function Td(e,n){const r=e.trim().toLowerCase();return r?n.some(s=>s==null?void 0:s.toLowerCase().includes(r)):!0}function EA(e){const n=new Map;for(const f of e)f.featureId&&n.set(f.featureId,[...n.get(f.featureId)??[],f]);const r=new Map,s=new Map,u=new Map,c=new Map;for(const[f,h]of n)r.set(f,h.length),s.set(f,h.reduce((p,g)=>p+g.tasks.length,0)),u.set(f,yA(h)),c.set(f,N1(h.flatMap(p=>p.tasks)));return{phasesByFeature:n,phasesCountByFeature:r,tasksCountByFeature:s,phaseSummaryByFeature:u,taskSummaryByFeature:c}}function NA(){var S,w;const{features:e,phases:n}=Mr(),{phasesByFeature:r,phasesCountByFeature:s,tasksCountByFeature:u,phaseSummaryByFeature:c,taskSummaryByFeature:f}=EA(n),h=Or(),[p]=Wo(),g=((S=p.get("q"))==null?void 0:S.trim())??"",y=((w=p.get("status"))==null?void 0:w.trim())??"",v=x.useCallback(()=>h("new"),[h]);Aa("create",v);const E=x.useMemo(()=>e.filter(j=>(!y||j.status===y)&&Td(g,[j.name,j.id,j.description])),[e,g,y]);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Vt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{children:[o.jsx(j1,{kind:"feature",label:"Features"}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter by name or status, then inspect child phases and tasks directly from the rows."})]}),o.jsx(Ve,{to:"new",children:o.jsx(ot,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),o.jsx(R1,{query:g,status:y,statusOptions:Rd,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:E.length===e.length?`${e.length} features`:`${E.length} of ${e.length} features`}),o.jsx("div",{className:"grid gap-3",children:e.length===0?o.jsxs(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",o.jsx(Ve,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):E.length>0?E.map(j=>o.jsx(wA,{feature:j,phases:r.get(j.id),phasesCount:s.get(j.id)??0,tasksCount:u.get(j.id)??0,phaseSummary:c.get(j.id)??Go(),taskSummary:f.get(j.id)??Go()},j.id)):o.jsx(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),o.jsx(Ei,{})]})}async function jA(){const[e,n]=await Promise.all([qm(),xd()]);return{requirements:e,phases:n}}function ko(...e){return e.filter(Boolean).join(" ")}function RA(){return o.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] shadow-sm transition group-open:rotate-180 group-hover:border-[var(--accent)] group-hover:text-[var(--accent)]",children:o.jsx(Rs,{className:"h-5 w-5"})})}function dn({title:e,subtitle:n,leading:r,actions:s,defaultOpen:u=!0,count:c,className:f,summaryClassName:h,contentClassName:p,titleClassName:g,subtitleClassName:y,children:v}){return o.jsxs("details",{className:ko("group mt-4 overflow-hidden rounded-[10px] border border-[var(--border)]",f),open:u,children:[o.jsxs("summary",{className:ko("flex min-w-0 list-none cursor-pointer items-start justify-between gap-3 bg-[var(--surface-elevated)] p-4 text-left text-[var(--text)] transition-colors select-none hover:bg-[var(--surface-strong)] [&::-webkit-details-marker]:hidden",h),children:[o.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[r?o.jsx("div",{className:"shrink-0 pt-0.5",children:r}):null,o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:ko("flex flex-wrap items-center gap-2 text-sm font-semibold",g),children:[e,c!==void 0?o.jsxs("span",{className:"text-[var(--text-subtle)]",children:["(",c,")"]}):null]}),n?o.jsx("div",{className:ko("mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",y),children:n}):null]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s,o.jsx(RA,{})]})]}),o.jsx("div",{className:ko("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:v})]})}function kA(e,n){const r=new Set(n.map(c=>c.id)),s=n.map(c=>({phase:c,requirements:e.filter(f=>f.linkedPhaseIds.includes(c.id))})).filter(c=>c.requirements.length>0).sort((c,f)=>c.phase.priority-f.phase.priority||c.phase.number-f.phase.number),u=e.filter(c=>!c.linkedPhaseIds.some(f=>r.has(f)));return{phaseGroups:s,unlinkedRequirements:u}}function gb(e){return`P${String(e.number??0).padStart(3,"0")}`}function xb({requirement:e}){return o.jsx(Vt,{className:"overflow-hidden p-0",children:o.jsx(dn,{defaultOpen:!1,title:o.jsx("h2",{className:"min-w-0 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:e.title}),count:e.linkedPhaseIds.length,subtitle:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[e.linkedPhaseIds.length," linked phase",e.linkedPhaseIds.length===1?"":"s"]}),e.linkedPhaseIds.length>0&&e.macroTasks.length>0?o.jsx("span",{className:"mx-2 text-[var(--text-subtle)]",children:"•"}):null,e.macroTasks.length>0?o.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[e.macroTasks.length," macro task",e.macroTasks.length===1?"":"s"]}):null]}),contentClassName:"grid gap-4",summaryClassName:"hover:bg-[var(--surface-elevated)]/65",children:o.jsxs("div",{className:"flex min-w-0 flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[o.jsx("div",{className:"min-w-0",children:e.description?o.jsx("p",{className:"min-w-0 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:e.description}):null}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[o.jsx(Ve,{to:`${e.id}/edit`,children:o.jsx(ot,{type:"button",variant:"secondary",children:"Edit"})}),o.jsx(Pa,{method:"post",action:`/requirements/${e.id}/delete`,onSubmit:n=>{window.confirm(`Delete requirement "${e.title}"?`)||n.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",children:"Delete"})})]})]})})})}function TA(){var y;const{requirements:e,phases:n}=Mr(),r=Or(),[s]=Wo(),u=((y=s.get("q"))==null?void 0:y.trim())??"",c=x.useCallback(()=>r("new"),[r]);Aa("create",c);const f=x.useMemo(()=>new Map(n.map(v=>[v.id,v])),[n]),h=x.useMemo(()=>e.filter(v=>{const E=v.linkedPhaseIds.map(S=>{const w=f.get(S);return w?`${gb(w)} ${w.title} ${w.summary}`:S});return Td(u,[v.title,v.description,v.id,...E])}),[e,f,u]),{phaseGroups:p,unlinkedRequirements:g}=x.useMemo(()=>kA(h,n),[h,n]);return x.useEffect(()=>{const v=window.location.hash.slice(1);v&&requestAnimationFrame(()=>{var E;return(E=document.getElementById(v))==null?void 0:E.scrollIntoView({block:"start"})})},[p]),o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Vt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{children:[o.jsx(j1,{kind:"requirement",label:"Requirements"}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Track top-level outcomes independently from features, grouped below by the phases that deliver them."})]}),o.jsx(Ve,{to:"new",children:o.jsx(ot,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),o.jsx(R1,{query:u,placeholder:"Search requirement title, description, id, or linked phase",clearTo:"/requirements",resultsLabel:h.length===e.length?`${e.length} requirements`:`${h.length} of ${e.length} requirements`}),o.jsx("div",{className:"grid gap-6",children:e.length===0?o.jsxs(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",o.jsx(Ve,{to:"/requirements/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first requirement"})]}):h.length>0?o.jsxs(o.Fragment,{children:[p.map(({phase:v,requirements:E})=>{const S=v.featureId?`/features/${v.featureId}/phases/${v.id}`:"/features";return o.jsxs("section",{id:`phase-${v.id}`,className:"scroll-mt-28","aria-labelledby":`phase-${v.id}-heading`,children:[o.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Linked phase"}),o.jsxs(Ve,{id:`phase-${v.id}-heading`,to:S,className:"min-w-0 break-words text-base font-black text-[var(--text)] underline-offset-4 hover:text-[var(--accent)] hover:underline [overflow-wrap:anywhere]",children:[gb(v)," — ",v.title]})]}),o.jsxs("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:[E.length," requirement",E.length===1?"":"s"]})]}),o.jsx("div",{className:"grid gap-3",children:E.map(w=>o.jsx(xb,{requirement:w},w.id))})]},v.id)}),g.length>0?o.jsxs("section",{id:"unlinked-requirements",className:"scroll-mt-28","aria-labelledby":"unlinked-requirements-heading",children:[o.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Unlinked"}),o.jsx("h2",{id:"unlinked-requirements-heading",className:"text-base font-black text-[var(--text)]",children:"Requirements without a valid phase"})]}),o.jsx("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:g.length})]}),o.jsx("div",{className:"grid gap-3",children:g.map(v=>o.jsx(xb,{requirement:v},v.id))})]}):null]}):o.jsx(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),o.jsx(Ei,{})]})}async function CA(){return{ideas:await b2()}}async function AA({request:e}){const n=await e.formData(),r=String(n.get("intent")??""),s=String(n.get("id")??""),u=String(n.get("title")??"").trim(),c=String(n.get("description")??"").trim();if(r==="create"){if(!u)throw new Response("Idea title is required.",{status:400});await w2({title:u,description:c})}else if(r==="update"){if(!s||!u)throw new Response("Idea id and title are required.",{status:400});await S2({id:s,title:u,description:c})}else if(r==="delete"){if(!s)throw new Response("Idea id is required.",{status:400});await E2(s)}else throw new Response("Unknown Ideas action.",{status:400});return{ok:!0}}function DA({idea:e,onClose:n}){return o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",role:"presentation",onMouseDown:r=>{r.target===r.currentTarget&&n()},children:o.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"idea-editor-title",className:"surface-card w-full max-w-xl rounded-2xl border border-[var(--border)] p-5 shadow-2xl",children:[o.jsx("h2",{id:"idea-editor-title",className:"text-lg font-bold",children:e?"Edit idea":"Add idea"}),o.jsxs(Pa,{method:"post",className:"mt-4 space-y-4",onSubmit:n,children:[o.jsx("input",{type:"hidden",name:"intent",value:e?"update":"create"}),e?o.jsx("input",{type:"hidden",name:"id",value:e.id}):null,o.jsxs("label",{className:"block text-sm font-semibold",children:["Title",o.jsx("input",{autoFocus:!0,required:!0,name:"title",defaultValue:(e==null?void 0:e.title)??"",className:"mt-1 h-10 w-full rounded-xl border border-[var(--border-strong)] bg-[var(--surface)] px-3 text-[var(--text)]"})]}),o.jsxs("label",{className:"block text-sm font-semibold",children:["Description",o.jsx("textarea",{name:"description",defaultValue:(e==null?void 0:e.description)??"",rows:6,className:"mt-1 w-full resize-y rounded-xl border border-[var(--border-strong)] bg-[var(--surface)] p-3 text-[var(--text)]"})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:n,className:"rounded-xl border border-[var(--border-strong)] px-4 py-2 text-sm font-semibold",children:"Cancel"}),o.jsx("button",{type:"submit",className:"rounded-xl bg-[var(--accent)] px-4 py-2 text-sm font-semibold text-white",children:e?"Save idea":"Add idea"})]})]})]})})}function OA({idea:e}){const n=Vl();return o.jsxs(n.Form,{method:"post",onSubmit:r=>{window.confirm(`Delete ${`I${String(e.number).padStart(3,"0")}`} — ${e.title}?`)||r.preventDefault()},children:[o.jsx("input",{type:"hidden",name:"intent",value:"delete"}),o.jsx("input",{type:"hidden",name:"id",value:e.id}),o.jsx("button",{type:"submit","aria-label":`Delete ${e.title}`,className:"inline-flex h-9 w-9 items-center justify-center rounded-xl border border-rose-500/30 text-rose-600 hover:bg-rose-500/10",children:o.jsx(Es,{className:"h-4 w-4"})})]})}function MA(){const{ideas:e}=Mr(),[n,r]=x.useState(null);return o.jsxs("main",{className:"page-container py-6 sm:py-8",children:[o.jsxs("header",{className:"flex items-center justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-black",children:[o.jsx(f0,{className:"h-6 w-6 text-[var(--accent)]"})," Ideas Inbox"]}),o.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:"Capture ideas without changing planner work status. Agents handle guided promotion separately."})]}),o.jsxs("button",{type:"button",onClick:()=>r("new"),className:"inline-flex shrink-0 items-center gap-2 rounded-xl bg-[var(--accent)] px-3 py-2 text-sm font-semibold text-white",children:[o.jsx(a2,{className:"h-4 w-4"})," Add idea"]})]}),e.length===0?o.jsx("section",{className:"surface-card mt-6 rounded-2xl border border-dashed border-[var(--border-strong)] p-8 text-center text-[var(--text-muted)]",children:"No ideas yet. Add one without affecting feature, phase, or task rollups."}):o.jsx("section",{"aria-label":"Ideas",className:"mt-6 grid gap-3",children:e.map(s=>o.jsx("article",{className:"surface-card min-w-0 rounded-2xl border border-[var(--border)] p-4",children:o.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"rounded-lg bg-[var(--accent-soft)] px-2 py-1 font-mono text-xs font-bold text-[var(--accent)]",children:["I",String(s.number).padStart(3,"0")]}),o.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:s.shortId}),s.promotion?s.targetHref?o.jsxs(Ve,{to:s.targetHref,className:"rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-2 py-1 text-xs font-semibold text-emerald-700 hover:underline dark:text-emerald-400",children:["Promoted to ",s.promotion.targetRef]}):o.jsxs("span",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-2 py-1 text-xs font-semibold text-emerald-700 dark:text-emerald-400",children:["Promoted to ",s.promotion.targetRef]}):null]}),o.jsx("h2",{className:"mt-2 break-words text-base font-bold",children:s.title}),s.description?o.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-sm text-[var(--text-muted)]",children:s.description}):null]}),o.jsxs("div",{className:"flex shrink-0 gap-2",children:[o.jsx("button",{type:"button",onClick:()=>r(s),"aria-label":`Edit ${s.title}`,className:"inline-flex h-9 w-9 items-center justify-center rounded-xl border border-[var(--border-strong)] text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-4 w-4"})}),o.jsx(OA,{idea:s})]})]})},s.id))}),n?o.jsx(DA,{...n==="new"?{}:{idea:n},onClose:()=>r(null)}):null]})}async function _A({params:e}){const n=e.featureId;if(!n)throw new Response("featureId required",{status:400});const[r,s]=await Promise.all([tc(n),xd(n)]);return{feature:r,phases:s}}function LA({featureId:e,feature:n,phase:r}){var v,E;const s=Vl(),u=Vl(),f=((v=s.formData)==null?void 0:v.get("status"))??r.status,h=s.state!=="idle",p=u.state!=="idle",g=rd(N1(r.tasks)),y=U0(r.tasks);return o.jsxs(ki,{variant:"surface",status:y.displayStatus,className:"px-4 py-2",children:[o.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(rr,{featureNum:n.number,phaseNum:r.number,featureId:n.id,phaseId:r.id}),o.jsx(sr,{id:cl({featureNum:n.number,phaseNum:r.number}),children:o.jsx("span",{className:"sr-only",children:"Copy phase path"})}),r.shortId?o.jsx(ul,{shortId:r.shortId}):null,o.jsx(nc,{priority:r.priority}),r.handoff?o.jsx(Fm,{phaseId:r.id,updatedAt:r.handoffUpdatedAt}):null,o.jsx(v1,{phaseId:r.id,phaseTitle:r.title,count:((E=r.linkedRequirements)==null?void 0:E.length)??0}),o.jsx("span",{className:"shrink-0",children:o.jsx(ac,{status:y.displayStatus,breakdown:y.breakdown})})]}),o.jsx(Ve,{to:`/features/${e}/phases/${r.id}`,className:"entity-link--phase min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:r.title})]}),o.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[o.jsx(Ve,{to:`/features/${e}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,children:o.jsx(ot,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-3.5 w-3.5"})})}),o.jsx(u.Form,{method:"post",action:`/features/${e}/phases/${r.id}/delete`,onSubmit:S=>{window.confirm(`Delete phase “${r.title}”? This cannot be undone.`)||S.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",disabled:p||h,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${r.title}`,children:o.jsx(Es,{className:"h-4 w-4"})})})]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[o.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r.tasks.length," tasks"]}),g?o.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),o.jsx(s.Form,{method:"post",action:`/features/${e}/phases/${r.id}/status`,className:"w-full lg:w-auto",children:o.jsxs("div",{className:"relative",children:[o.jsx("select",{name:"status",value:f,disabled:h||p,"aria-busy":h,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:S=>s.submit(S.currentTarget.form),children:kd.map(S=>o.jsx("option",{value:S.value,children:S.label},S.value))}),o.jsx(Rs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),o.jsx(Ve,{to:`/features/${e}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,className:"hidden lg:block",children:o.jsx(ot,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-3.5 w-3.5"})})}),o.jsx(u.Form,{method:"post",action:`/features/${e}/phases/${r.id}/delete`,className:"hidden lg:block",onSubmit:S=>{window.confirm(`Delete phase “${r.title}”? This cannot be undone.`)||S.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",disabled:p||h,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${r.title}`,children:o.jsx(Es,{className:"h-4 w-4"})})})]}),o.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:o.jsx(dl,{value:r.updatedAt})}),r.summary?o.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:r.summary}):null]})}function dp({items:e,className:n="",stacked:r=!1}){return r?o.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${n}`,children:e.map((s,u)=>{const c=u===e.length-1,f=s.to&&!c?o.jsx(Ve,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline break-words min-w-0",children:s.label}):o.jsx("span",{className:`break-words min-w-0 ${c?"text-[var(--text)] font-semibold":"text-[var(--text-muted)]"}`,children:s.label});return o.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[s.kind?o.jsxs("span",{className:"shrink-0 text-[var(--text-subtle)] font-medium",children:[s.kind,":"]}):null,o.jsx("span",{className:"min-w-0",children:f})]},`${s.label}-${u}`)})}):o.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${n}`,children:e.map((s,u)=>{const c=u===e.length-1,f=s.to&&!c?o.jsx(Ve,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline",children:s.label}):o.jsx("span",{className:c?"text-[var(--text)]":"text-[var(--text-muted)]",children:s.label});return o.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[u>0?o.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,o.jsx("span",{className:"min-w-0 break-words",children:f})]},`${s.label}-${u}`)})})}function fp({featureNum:e,phaseNum:n,taskNum:r,featureId:s,phaseId:u,taskId:c,shortId:f,children:h}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(rr,{featureNum:e,phaseNum:n,taskNum:r,featureId:s,phaseId:u,taskId:c}),o.jsx(sr,{id:cl({featureNum:e,phaseNum:n,taskNum:r}),children:o.jsx("span",{className:"sr-only",children:"Copy path"})}),f?o.jsx(ul,{shortId:f}):null,h]})}const zA=250;function Lu(e){return`inline-flex h-9 min-h-9 shrink-0 items-center justify-center whitespace-nowrap rounded-[9px] border px-2 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] sm:h-9 sm:min-h-9 sm:rounded-[10px] sm:px-2.5 ${e?"border-transparent bg-[var(--accent)] text-white":"border-[var(--border)] bg-[var(--surface-card)] text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`}function T1({entityKind:e,statusOptions:n,value:r,onChange:s,sortSlot:u}){const[c,f]=x.useState(r.query),h=x.useRef(null),p=x.useRef(r);p.current=r,x.useEffect(()=>{f(r.query)},[r.query]),x.useEffect(()=>()=>{h.current!==null&&window.clearTimeout(h.current)},[]);const g=j=>{h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{s({...p.current,query:j})},zA)},y=j=>{f(j),g(j)},v=j=>{s({...p.current,[j]:!p.current[j]})},E=j=>{s({...p.current,status:j})},S=()=>{h.current!==null&&window.clearTimeout(h.current),f(""),s({query:"",status:"",hideDone:!1,hidePlanned:!1,onlyActive:!1})},w=((n==null?void 0:n.length)??0)>0;return o.jsxs("div",{className:"surface-card flex flex-col gap-3 p-3 sm:p-4",children:[o.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[o.jsxs("div",{className:"min-w-[180px] flex-1",children:[o.jsx("label",{htmlFor:"detail-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Search"}),o.jsx(Wa,{id:"detail-filter-query",value:c,onChange:j=>y(j.target.value),placeholder:e==="task"?"Search task title, number, or shortId":"Search phase title, number, or shortId",className:"h-9 py-2"})]}),u]}),o.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[w?o.jsxs("div",{children:[o.jsx("label",{htmlFor:"detail-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),o.jsx("div",{className:"flex items-center rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1.5 sm:rounded-[14px] sm:px-3 sm:py-2",children:o.jsxs(fl,{id:"detail-filter-status",value:r.status,onChange:j=>E(j.target.value),className:"h-9 appearance-none border-0 bg-transparent py-0 pr-8",children:[o.jsx("option",{value:"",children:"All statuses"}),n==null?void 0:n.map(j=>o.jsx("option",{value:j.value,children:j.label},j.value))]})})]}):null,o.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5 overflow-x-auto rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1.5 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5 sm:gap-2 sm:rounded-[14px] sm:px-3 sm:py-2",children:[o.jsx("button",{type:"button",onClick:()=>v("hideDone"),className:Lu(r.hideDone),children:"Hide Done"}),o.jsx("button",{type:"button",onClick:()=>v("hidePlanned"),className:Lu(r.hidePlanned),children:"Hide Planned"}),o.jsx("button",{type:"button",onClick:()=>v("onlyActive"),className:Lu(r.onlyActive),children:"Only active"}),o.jsx("button",{type:"button",onClick:S,className:Lu(!1),children:"Clear"})]})]})]})}function hp({decisions:e}){return e.length===0?null:o.jsxs("details",{className:"group mt-4",children:[o.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:o.jsxs("span",{children:["Accepted decisions (",e.length,")"]})}),o.jsx("div",{className:"mt-2 grid gap-3",children:e.map(n=>o.jsxs("div",{className:"surface-card px-4 py-3",children:[o.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:n.title}),n.decision?o.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),o.jsx(ga,{text:n.decision,className:"mt-1"})]}):null,n.rationale?o.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),o.jsx(ga,{text:n.rationale,className:"mt-1"})]}):null,n.implementationNotes?o.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),o.jsx(ga,{text:n.implementationNotes,className:"mt-1"})]}):null]},n.id))})]})}const UA={draft:Sj,discovery:s2,planned:Jo,"in-progress":d0,done:$m,blocked:h0,waiting:Bm,deferred:u2,canceled:c0,rejected:Nj};function lm(e){return e.split(/[-\s]+/).filter(Boolean).map(n=>n==="and"?"and":n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function vb(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}const $A=new Set(["canceled","rejected"]);function mp({statusLog:e,currentStatus:n,backbone:r,createdAt:s,updatedAt:u,startedAt:c,completedAt:f}){const h=[];if(e.length===0){const w=r.indexOf(n);if(w>=0)for(let j=0;j<=w;j++)h.push(r[j]);else h.push(n)}else{const w=e[0];w&&h.push(w.fromStatus);for(const j of e)h[h.length-1]!==j.toStatus&&h.push(j.toStatus)}h[h.length-1]!==n&&h.push(n);const p=new Set(h),g=n==="done"||$A.has(n),y=w=>{var R,z;if(e.length>0){if(w===((R=e[0])==null?void 0:R.fromStatus))return((z=e[0])==null?void 0:z.date)??"";for(const I of e)if(I.toStatus===w)return I.date;return""}const j=r[0];return w===j?s??"":w==="in-progress"?c??u??"":w==="done"?f??u??"":""},v=[...h];if(!g){const w=r.indexOf(n);if(w>=0&&w+1<r.length){const j=r[w+1];p.has(j)||v.push(j)}}const E=e.length===0?v.filter((w,j)=>j===0||w===n||!!y(w)):v,S=w=>p.has(w)?w===n&&!g?"current":"completed":"pending";return o.jsx("ol",{className:"status-stepper",role:"list","aria-label":"Status progress",children:E.map((w,j)=>{const R=S(w),z=UA[w]??md,I=p.has(w),$=y(w),Q=$?`${lm(w)} — ${vb($)}`:lm(w),J=j===0?null:I?"traveled":"pending";return o.jsxs("li",{className:`status-step status-step--${R}`,role:"listitem","aria-current":R==="current"?"step":void 0,style:{"--step-color":`var(--color-status-${w})`},children:[J?o.jsx("span",{className:`status-connector status-connector--${J}`,"aria-hidden":"true"}):null,o.jsx("span",{className:"status-node",title:Q,children:o.jsx(z,{className:"status-node-icon"})}),o.jsx("span",{className:"status-step-label",children:lm(w)}),$?o.jsx("span",{className:"status-step-date",children:vb($)}):null]},`${w}-${j}`)})})}function yb(e){return e.split(/[-\s]+/).filter(Boolean).map(n=>n==="and"?"and":n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function BA(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}function HA(e,n,r,s,u){if(e.length>0)return e.map(h=>({date:h.date,fromStatus:h.fromStatus,toStatus:h.toStatus,motivation:h.description.trim(),inferred:!1}));const c=r.indexOf(n);if(c<0)return[];const f=[];for(let h=1;h<=c;h++){const p=r[h-1],g=r[h],y=g==="in-progress"?s??"":g==="done"?u??"":"";f.push({date:y,fromStatus:p,toStatus:g,motivation:"",inferred:!0})}return f}function pp({statusLog:e,currentStatus:n,backbone:r,startedAt:s,completedAt:u}){const c=HA(e??[],n??"",r??[],s,u);return o.jsx(dn,{title:"Status history",count:c.length,defaultOpen:c.length>0,contentClassName:"grid gap-2.5",children:c.length===0?o.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[40rem] border-collapse text-left text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-[var(--border)] text-xs text-[var(--text-subtle)]",children:[o.jsx("th",{scope:"col",className:"px-2 pb-2 font-medium",children:"Date"}),o.jsx("th",{scope:"col",className:"px-2 pb-2 font-medium",children:"From"}),o.jsx("th",{scope:"col",className:"px-2 pb-2 font-medium",children:"To"}),o.jsx("th",{scope:"col",className:"px-2 pb-2 font-medium",children:"Motivation"})]})}),o.jsx("tbody",{children:c.map((f,h)=>o.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[o.jsx("td",{className:"px-2 py-2 align-top text-xs font-mono text-[var(--text-subtle)] whitespace-nowrap",children:BA(f.date)}),o.jsx("td",{className:"px-2 py-2 align-top font-semibold text-[var(--text-muted)] whitespace-nowrap",children:yb(f.fromStatus)}),o.jsx("td",{className:"px-2 py-2 align-top font-semibold text-[var(--text)] whitespace-nowrap",children:yb(f.toStatus)}),o.jsx("td",{className:"px-2 py-2 align-top text-[var(--text-muted)] whitespace-pre-wrap [overflow-wrap:anywhere]",children:f.motivation||"—"})]},h))})]})})})}function IA(e){return e.reduce((n,r)=>n+r.tasks.length,0)}function qA(e){let n=0,r=0,s=0,u=0;for(const c of e)for(const f of c.tasks)f.status==="in-progress"&&(n+=1),f.status==="done"&&(r+=1),f.status==="blocked"&&(s+=1),["done","canceled"].includes(f.status)||(u+=1);return{inProgress:n,done:r,blocked:s,remaining:u}}function PA(e){return e.find(n=>["in-progress","discovery","planned","draft"].includes(n.status))}function FA(){var J,ne;const{feature:e,phases:n}=Mr(),r=e.acceptedDecisions??[],s=IA(n),u=qA(n),c=PA(n),f=z0(n),[h,p]=Wo(),g=((J=h.get("sort"))==null?void 0:J.trim())??"priority",y=((ne=h.get("dir"))==null?void 0:ne.trim())??"asc",[v,E]=x.useState(()=>{var M,T;return{query:((M=h.get("q"))==null?void 0:M.trim())??"",status:((T=h.get("status"))==null?void 0:T.trim())??"",hideDone:h.get("hideDone")==="1",hidePlanned:h.get("hidePlanned")==="1",onlyActive:h.get("onlyActive")==="1"}});x.useEffect(()=>{const M=new URL(window.location.href),T=(fe,pe,we="1")=>{pe?M.searchParams.set(fe,we):M.searchParams.delete(fe)};T("q",v.query.trim()!=="",v.query.trim()),T("status",v.status!=="",v.status),T("hideDone",v.hideDone),T("hidePlanned",v.hidePlanned),T("onlyActive",v.onlyActive),window.history.replaceState(window.history.state,"",`${M.pathname}${M.search}${M.hash}`)},[v]);const S={key:g==="priority"||g==="number"||g==="createdAt"||g==="updatedAt"||g==="title"||g==="shortId"||g==="status"||g==="startedAt"||g==="completedAt"?g:"priority",direction:y==="desc"?"desc":"asc"},w=x.useMemo(()=>[...n].sort((M,T)=>Mo(M,T,S.key,S.direction)),[n,S]),j=x.useMemo(()=>w.filter(M=>k1(M,v,["in-progress","discovery"])&&Td(v.query,[M.title,String(M.number),M.shortId])),[w,v]),R=Or(),z=x.useRef(null),I=x.useCallback(()=>R("edit"),[R]),$=x.useCallback(()=>R("phases/new"),[R]),Q=x.useCallback(()=>{var M;(M=z.current)==null||M.requestSubmit()},[]);return Aa("edit",I),Aa("create",$),Aa("delete",Q),o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ve,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(hd,{className:"h-4 w-4"})," Back to features"]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx(dp,{stacked:!0,items:[{label:e.name,kind:"Feature"}]}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:o.jsx(fp,{featureNum:e.number,featureId:e.id,shortId:e.shortId,children:o.jsx(ac,{status:f.displayStatus,breakdown:f.breakdown})})}),o.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:e.name}),e.description?o.jsx(dn,{title:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Description"}),o.jsx(dl,{value:e.descriptionUpdatedAt})]}),children:o.jsx(ga,{text:e.description,className:"plan-description max-w-4xl"})}):null,o.jsx("div",{className:"mt-4",children:o.jsx(mp,{statusLog:e.statusLog??[],currentStatus:e.status,backbone:["planned","in-progress","done"],createdAt:e.createdAt,updatedAt:e.updatedAt})}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[o.jsx(Ve,{to:"edit",children:o.jsx(ot,{type:"button",shortcut:"edit",children:"Edit feature"})}),o.jsx(Pa,{ref:z,method:"post",action:`/features/${e.id}/delete`,className:"inline-flex",onSubmit:M=>{window.confirm(`Delete feature "${e.name}"?`)||M.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),o.jsxs(Vt,{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),o.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(c==null?void 0:c.title)||"No active phase"})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),o.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:n.length})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),o.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:s})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),o.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(c==null?void 0:c.title)||"No active phase"})]})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]})]}),o.jsx(Ym,{items:[{label:"Entity last updated",value:ol(e.updatedAt),visible:!!e.updatedAt},{label:"Priority",value:bd(e.priority),visible:e.priority>0},{label:"Timeline",value:vR(e.startDate,e.endDate),visible:!!(e.startDate||e.endDate)}]}),e.workDone||e.workRemaining?o.jsx(dn,{title:"Planning notes",defaultOpen:!1,children:o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.workDone?o.jsxs("div",{children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done"}),o.jsx(ga,{text:e.workDone,className:"mt-2"})]}):null,e.workRemaining?o.jsxs("div",{children:[o.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining"}),o.jsx(ga,{text:e.workRemaining,className:"mt-2"})]}):null]})}):null,r.length>0?o.jsx(hp,{decisions:r}):null,o.jsx(pp,{statusLog:e.statusLog??[],currentStatus:e.status,backbone:["planned","in-progress","done"]})]}),o.jsxs(Vt,{className:"grid gap-5",children:[o.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Phases (",n.length,")"]}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this feature's phases."})]}),o.jsx(Ve,{to:"phases/new",children:o.jsx(ot,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),o.jsx(T1,{entityKind:"phase",statusOptions:kd,value:v,onChange:E,sortSlot:o.jsx(lp,{sort:S,onChange:M=>p(T=>(T.set("sort",M.key),T.set("dir",M.direction),T))})}),o.jsx("div",{className:"grid gap-3",children:n.length===0?o.jsxs(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",o.jsx(Ve,{to:`/features/${e.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):j.length>0?j.map(M=>o.jsx(LA,{featureId:e.id,feature:e,phase:M},M.id)):o.jsx(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),o.jsx(Ei,{})]})}async function VA({params:e}){const{featureId:n,phaseId:r}=e;if(!n||!r)throw new Response("featureId and phaseId required",{status:400});const[s,u,c]=await Promise.all([tc(n),vd(r),qm()]),f=c.filter(h=>h.linkedPhaseIds.includes(r));return{feature:s,phase:{...u,linkedRequirements:f}}}function YA({featureId:e,featureNum:n,phaseId:r,phaseNum:s,task:u}){var S;const c=Vl(),f=Vl(),p=((S=c.formData)==null?void 0:S.get("status"))??u.status,g=c.state!=="idle",y=f.state!=="idle",v=rd(bA(u.subtasks)),E=R0(p);return o.jsxs(ki,{variant:"surface",status:E,className:"px-4 py-2",children:[o.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(rr,{featureNum:n,phaseNum:s,taskNum:u.number,featureId:e,phaseId:r,taskId:u.id}),o.jsx(sr,{id:cl({featureNum:n,phaseNum:s,taskNum:u.number}),children:o.jsx("span",{className:"sr-only",children:"Copy task path"})}),u.shortId?o.jsx(ul,{shortId:u.shortId}):null,o.jsx("span",{className:"shrink-0",children:o.jsx(ar,{status:p})})]}),o.jsx(Ve,{to:`/features/${e}/phases/${r}/tasks/${u.id}`,className:"entity-link--task min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:u.title})]}),o.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[o.jsx(Ve,{to:`/features/${e}/phases/${r}/tasks/${u.id}/edit`,"aria-label":`Edit task ${u.title}`,children:o.jsx(ot,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-3.5 w-3.5"})})}),o.jsx(f.Form,{method:"post",action:`/features/${e}/phases/${r}/tasks/${u.id}/delete`,onSubmit:w=>{window.confirm(`Delete task “${u.title}”? This cannot be undone.`)||w.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",disabled:y||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${u.title}`,children:o.jsx(Es,{className:"h-4 w-4"})})})]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[o.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[u.subtasks.length," subtasks · ",u.checklist.length," checklist"]}),v?o.jsx("div",{className:"mt-0.5 break-words",children:v}):o.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),o.jsx(c.Form,{method:"post",action:`/features/${e}/phases/${r}/tasks/${u.id}/status`,className:"w-full lg:w-auto",children:o.jsxs("div",{className:"relative",children:[o.jsx("select",{name:"status",value:p,disabled:g||y||!!u.pauseSnapshot,"aria-busy":g,title:u.pauseSnapshot?"Resume checkpointed work through task_start so its checkpoint is preserved.":void 0,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:w=>c.submit(w.currentTarget.form),children:nd.map(w=>o.jsx("option",{value:w.value,children:w.label},w.value))}),o.jsx(Rs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),o.jsx(Ve,{to:`/features/${e}/phases/${r}/tasks/${u.id}/edit`,"aria-label":`Edit task ${u.title}`,className:"hidden lg:block",children:o.jsx(ot,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:o.jsx(Yl,{className:"h-3.5 w-3.5"})})}),o.jsx(f.Form,{method:"post",action:`/features/${e}/phases/${r}/tasks/${u.id}/delete`,className:"hidden lg:block",onSubmit:w=>{window.confirm(`Delete task “${u.title}”? This cannot be undone.`)||w.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",disabled:y||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${u.title}`,children:o.jsx(Es,{className:"h-4 w-4"})})})]}),o.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[o.jsx(dl,{value:u.updatedAt}),u.startedAt?o.jsxs("span",{children:["Started ",ol(u.startedAt)]}):null,u.completedAt?o.jsxs("span",{children:["Completed ",ol(u.completedAt)]}):null]}),u.description?o.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:u.description}):null]})}function GA(e){let n=0,r=0,s=0,u=0;for(const c of e.tasks)c.status==="in-progress"&&(n+=1),c.status==="done"&&(r+=1),c.status==="blocked"&&(s+=1),["done","canceled"].includes(c.status)||(u+=1);return{inProgress:n,done:r,blocked:s,remaining:u}}function XA(){var pe,we;const{feature:e,phase:n}=Mr(),r=n.decisions??[],s=n.acceptedDecisions??[],u=n.linkedRequirements??[],c=GA(n),f=U0(n.tasks),[h,p]=Wo(),g=((pe=h.get("sort"))==null?void 0:pe.trim())??"priority",y=((we=h.get("dir"))==null?void 0:we.trim())??"asc",[v,E]=x.useState(()=>{var re,je;return{query:((re=h.get("q"))==null?void 0:re.trim())??"",status:((je=h.get("status"))==null?void 0:je.trim())??"",hideDone:h.get("hideDone")==="1",hidePlanned:h.get("hidePlanned")==="1",onlyActive:h.get("onlyActive")==="1"}});x.useEffect(()=>{const re=new URL(window.location.href),je=(Te,ee,L="1")=>{ee?re.searchParams.set(Te,L):re.searchParams.delete(Te)};je("q",v.query.trim()!=="",v.query.trim()),je("status",v.status!=="",v.status),je("hideDone",v.hideDone),je("hidePlanned",v.hidePlanned),je("onlyActive",v.onlyActive),window.history.replaceState(window.history.state,"",`${re.pathname}${re.search}${re.hash}`)},[v]);const S={key:g==="priority"||g==="number"||g==="createdAt"||g==="updatedAt"||g==="title"||g==="shortId"||g==="status"||g==="startedAt"||g==="completedAt"?g:"priority",direction:y==="desc"?"desc":"asc"},w=x.useMemo(()=>[...n.tasks].sort((re,je)=>Mo(re,je,S.key,S.direction)),[n.tasks,S]),j=x.useMemo(()=>w.filter(re=>k1(re,v,["in-progress"])&&Td(v.query,[re.title,String(re.number),re.shortId])),[w,v]),R=Or(),z=x.useRef(null),[I,$]=x.useState(n.handoff??""),[Q,J]=x.useState(!1),ne=x.useCallback(()=>R("edit"),[R]),M=x.useCallback(()=>R("tasks/new"),[R]),T=x.useCallback(()=>{var re;(re=z.current)==null||re.requestSubmit()},[]),fe=x.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){J(!0);try{await w0(n.id),$("")}catch{}finally{J(!1)}}},[n.id]);return Aa("edit",ne),Aa("create",M),Aa("delete",T),o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ve,{to:`/features/${e.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(hd,{className:"h-4 w-4"})," Back to feature"]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx(dp,{stacked:!0,items:[{label:e.name,to:`/features/${e.id}`,kind:"Feature"},{label:n.title,kind:"Phase"}]}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:o.jsxs(fp,{featureNum:e.number,phaseNum:n.number,featureId:e.id,phaseId:n.id,shortId:n.shortId,children:[I?o.jsx(Fm,{phaseId:n.id,updatedAt:n.handoffUpdatedAt}):null,o.jsx(ac,{status:f.displayStatus,breakdown:f.breakdown})]})}),o.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:n.title}),n.summary?o.jsx(ga,{text:n.summary,className:"mt-3 max-w-4xl"}):null,o.jsx(mp,{statusLog:n.statusLog??[],currentStatus:n.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:n.createdAt,updatedAt:n.updatedAt}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[o.jsx(Ve,{to:"edit",children:o.jsx(ot,{type:"button",shortcut:"edit",children:"Edit phase"})}),o.jsx(Pa,{ref:z,method:"post",action:`/features/${e.id}/phases/${n.id}/delete`,className:"inline-flex",onSubmit:re=>{window.confirm(`Delete phase "${n.title}"?`)||re.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),o.jsxs(Vt,{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),o.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:n.tasks.length})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.inProgress})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.remaining})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.done})]})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.blocked})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:n.goals.length})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:n.dependencies.length})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),o.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:n.completionCriteria.length})]})]}),o.jsx(Ym,{items:[{label:"Entity last updated",value:ol(n.updatedAt),visible:!!n.updatedAt},{label:"Priority",value:bd(n.priority),visible:n.priority>0},{label:"Linked requirements",value:u.length,visible:u.length>0,valueClassName:"text-2xl font-black"},{label:"Risks",value:n.risks.length,visible:n.risks.length>0,valueClassName:"text-2xl font-black"},{label:"Open questions",value:n.openQuestions.length,visible:n.openQuestions.length>0,valueClassName:"text-2xl font-black"}]}),n.notes?o.jsx(dn,{title:"Notes",defaultOpen:!1,children:o.jsx(ga,{text:n.notes,className:"plan-description"})}):null,o.jsx(dn,{title:"Linked requirements",count:u.length,defaultOpen:!1,children:u.length>0?o.jsx("div",{className:"grid gap-3",children:u.map(re=>o.jsx("div",{className:"min-w-0 rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:o.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ar,{status:re.status}),re.macroTasks.length>0?o.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[re.macroTasks.length," macro task",re.macroTasks.length===1?"":"s"]}):null]}),o.jsx("h3",{className:"mt-2 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:re.title}),re.description?o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:re.description}):null]}),o.jsx(Ve,{to:`/requirements#phase-${n.id}`,className:"text-sm font-semibold text-[var(--accent)] hover:underline sm:shrink-0",children:"Open phase requirements →"})]})},re.id))}):o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No linked requirements yet."})}),n.description?o.jsx(dn,{title:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Description"}),o.jsx(dl,{value:n.descriptionUpdatedAt})]}),children:o.jsx(ga,{text:n.description,className:"plan-description"})}):null,r.length>0?o.jsx(dn,{title:"Decisions",count:r.length,defaultOpen:!1,children:o.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:r.map((re,je)=>o.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:o.jsx(ga,{text:re})},je))})}):null,s.length>0?o.jsx(hp,{decisions:s}):null,o.jsx(pp,{statusLog:n.statusLog??[],currentStatus:n.status,backbone:["draft","discovery","planned","in-progress","done"]})]}),I?o.jsx(Vt,{className:"grid gap-4",children:o.jsx(dn,{title:"Handoff",actions:o.jsx("button",{type:"button",onClick:fe,disabled:Q,className:"rounded-lg border border-[var(--border)] px-3 py-1.5 text-sm text-[var(--text-muted)] hover:bg-[var(--surface-card)] disabled:opacity-60",children:Q?"Clearing…":"Clear handoff"}),children:o.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:o.jsx(ga,{text:I,className:"formatted-text max-w-none"})})})}):null,o.jsxs(Vt,{className:"grid gap-5",children:[o.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Tasks (",n.tasks.length,")"]}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this phase's tasks."})]}),o.jsx(Ve,{to:"tasks/new",children:o.jsx(ot,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})})]}),o.jsx(T1,{entityKind:"task",statusOptions:sp,value:v,onChange:E,sortSlot:o.jsx(lp,{sort:S,onChange:re=>p(je=>(je.set("sort",re.key),je.set("dir",re.direction),je))})}),o.jsx("div",{className:"grid gap-3",children:n.tasks.length===0?o.jsxs(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",o.jsx(Ve,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):j.length>0?j.map(re=>o.jsx(YA,{featureId:e.id,featureNum:e.number,phaseId:n.id,phaseNum:n.number,task:re},re.id)):o.jsx(Vt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),o.jsx(Ei,{})]})}async function QA({params:e}){const{featureId:n,phaseId:r,taskId:s}=e;if(!n||!r||!s)throw new Response("featureId, phaseId and taskId required",{status:400});const[u,c,f,h]=await Promise.all([tc(n),vd(r),yd(s),Im()]),p=f.status!=="done"&&f.status!=="canceled"&&f.status!=="rejected"&&(!!f.pauseSnapshot||h.workDeviations.some(g=>g.resumeTaskId===f.id&&(g.state==="resume-required"||g.state==="resolved")));return{feature:u,phase:c,task:f,pendingResume:p}}function KA({snapshot:e,pendingResume:n=!1}){const r=x.useId(),s=n?m0:Bm;return o.jsxs("section",{"aria-labelledby":r,"aria-live":n?"polite":void 0,className:`rounded-[14px] border px-4 py-3 ${n?"border-[var(--accent)] bg-[var(--accent-soft)]":"border-[var(--border)] bg-[var(--surface-elevated)]"}`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(s,{className:"h-4 w-4 shrink-0 text-[var(--accent)]","aria-hidden":"true"}),o.jsx("h3",{id:r,className:"text-sm font-bold text-[var(--text)]",children:"Resume checkpoint"}),o.jsx("span",{className:"ml-auto text-[10px] font-semibold uppercase tracking-[0.14em] text-[var(--text-subtle)]",children:ol(e.pausedAt)})]}),o.jsxs("dl",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Checkpoint reason"}),o.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:e.reason})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Work checkpoint"}),o.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:e.whatWasBeingDone})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Resume from"}),o.jsx("dd",{className:"mt-1 font-mono text-xs text-[var(--text)] [overflow-wrap:anywhere]",children:e.resumeLocation})]}),o.jsxs("div",{children:[o.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"How to resume"}),o.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:e.howToResume})]})]})]})}function ZA({featureId:e,phaseId:n,taskId:r,item:s}){const u=Vl(),c=u.formData?u.formData.get("checked")==="true":s.checked,f=u.state!=="idle";return o.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[o.jsx("input",{type:"checkbox",checked:c,onChange:()=>u.submit({checked:s.checked?"false":"true"},{method:"post",action:`/features/${e}/phases/${n}/tasks/${r}/checklist/${s.id}/toggle`}),disabled:f,className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]","aria-label":`Toggle checklist item ${s.title}`}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"checklist-num",children:s.number})," ",o.jsx("span",{className:`text-sm ${c?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:s.title})]})]})}function WA(){var E,S;const{feature:e,phase:n,task:r,pendingResume:s}=Mr(),u=r.status==="planned"||r.status==="waiting",c=r.decisions??[],f=r.acceptedDecisions??[],h=r.checklist??[],p=Or(),g=x.useRef(null),y=x.useCallback(()=>p("edit"),[p]),v=x.useCallback(()=>{var w;(w=g.current)==null||w.requestSubmit()},[]);return Aa("edit",y),Aa("delete",v),o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ve,{to:`/features/${e.id}/phases/${n.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(hd,{className:"h-4 w-4"})," Back to phase"]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx(dp,{stacked:!0,items:[{label:e.name,to:`/features/${e.id}`,kind:"Feature"},{label:n.title,to:`/features/${e.id}/phases/${n.id}`,kind:"Phase"},{label:r.title,kind:"Task"}]}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:o.jsx(fp,{featureNum:e.number,phaseNum:n.number,taskNum:r.number,featureId:e.id,phaseId:n.id,taskId:r.id,shortId:r.shortId,children:o.jsx(ar,{status:r.status})})}),o.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:r.title}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[u?o.jsx(Pa,{method:"post",action:`/features/${e.id}/phases/${n.id}/tasks/${r.id}/start`,className:"inline-flex",children:o.jsx(ot,{type:"submit",variant:"primary",children:r.pauseSnapshot||s?"Resume task":"Start task"})}):null,o.jsx(Ve,{to:"edit",children:o.jsx(ot,{type:"button",shortcut:"edit",children:"Edit task"})}),o.jsx(Pa,{ref:g,method:"post",action:`/features/${e.id}/phases/${n.id}/tasks/${r.id}/delete`,className:"inline-flex",onSubmit:w=>{window.confirm(`Delete task "${r.title}"?`)||w.preventDefault()},children:o.jsx(ot,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),o.jsx(mp,{statusLog:r.statusLog??[],currentStatus:r.status,backbone:["planned","in-progress","done"],createdAt:r.createdAt,updatedAt:r.updatedAt,startedAt:r.startedAt,completedAt:r.completedAt}),r.pauseSnapshot?o.jsx(KA,{snapshot:r.pauseSnapshot,pendingResume:s}):null,o.jsxs(Vt,{className:"grid gap-4",children:[r.description?o.jsx(dn,{title:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Description"}),o.jsx(dl,{value:r.descriptionUpdatedAt})]}),children:o.jsx(ga,{text:r.description,className:"plan-description"})}):null,r.notes?o.jsx(dn,{title:"Notes",defaultOpen:!1,children:o.jsx(ga,{text:r.notes})}):null,o.jsx(pp,{statusLog:r.statusLog??[],currentStatus:r.status,backbone:["planned","in-progress","done"],startedAt:r.startedAt,completedAt:r.completedAt}),c.length>0?o.jsx(dn,{title:"Decisions",count:c.length,defaultOpen:!1,children:o.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:c.map((w,j)=>o.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:o.jsx(ga,{text:w})},j))})}):null,f.length>0?o.jsx(hp,{decisions:f}):null,o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),o.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:h.length})]}),o.jsxs(za,{children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),o.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((E=r.subtasks)==null?void 0:E.length)??0})]})]}),o.jsx(Ym,{items:[{label:"Entity last updated",value:ol(r.updatedAt),visible:!!r.updatedAt},{label:"Priority",value:bd(r.priority),visible:r.priority>0},{label:"Short name",value:r.shortName,visible:!!r.shortName},{label:"Started",value:ol(r.startedAt),visible:!!r.startedAt},{label:"Completed",value:ol(r.completedAt),visible:!!r.completedAt},{label:"Phase",value:n.title}]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsx("div",{children:o.jsxs("h3",{className:"text-sm font-bold text-[var(--text)]",children:["Steps (",h.length,")"]})}),h.length?o.jsx("div",{className:"grid gap-2",children:h.map(w=>o.jsx(ZA,{featureId:e.id,phaseId:n.id,taskId:r.id,item:w},w.id))}):o.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(S=r.subtasks)!=null&&S.length?o.jsx(dn,{title:"Subtasks",count:r.subtasks.length,defaultOpen:!1,contentClassName:"grid gap-2",children:r.subtasks.map(w=>o.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:w.title}),o.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:w.id})]}),o.jsx(ar,{status:w.status})]},w.id))}):null]}),o.jsx(Ei,{})]})}const JA=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Ql({title:e,description:n,children:r}){const s=Or(),u=x.useRef(null),c=x.useRef(null);return x.useEffect(()=>{var g;const f=u.current;if(!f)return;const h=document.activeElement;(g=c.current)==null||g.focus();const p=y=>{if(y.key==="Escape"){y.preventDefault(),s(-1);return}if(y.key!=="Tab")return;const v=Array.from(f.querySelectorAll(JA)).filter(j=>j.offsetParent!==null);if(v.length===0){y.preventDefault(),f.focus();return}const E=v[0],S=v[v.length-1],w=document.activeElement;y.shiftKey?(w===E||!f.contains(w))&&(y.preventDefault(),S.focus()):w===S&&(y.preventDefault(),E.focus())};return window.addEventListener("keydown",p),()=>{var y;window.removeEventListener("keydown",p),(y=h==null?void 0:h.focus)==null||y.call(h)}},[s]),o.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[o.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(-1),"aria-hidden":"true",tabIndex:-1}),o.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:o.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":e,tabIndex:-1,className:"surface-panel flex max-h-[calc(100vh-2rem)] w-full max-w-2xl flex-col overflow-hidden p-6 outline-none md:max-h-[calc(100vh-3rem)] md:p-8",children:[o.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:e}),n?o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:n}):null]}),o.jsx("button",{ref:c,type:"button",onClick:()=>s(-1),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] text-[var(--text-muted)] transition hover:text-[var(--text)]","aria-label":"Close modal",children:o.jsx(g0,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:r})]})})]})}function Kl({className:e="",children:n,...r}){return o.jsx("div",{className:`sticky bottom-0 mt-2 flex justify-end gap-3 border-t border-[var(--border)] bg-[var(--surface)] px-1 pt-4 pb-1 backdrop-blur-xl ${e}`,...r,children:n})}function nt({label:e,children:n}){return o.jsxs("label",{className:"grid gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:e}),n]})}function ca(e){return o.jsx("textarea",{className:"field-control field-textarea",...e})}function eD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Aa("submit",s,{allowInEditable:!0}),o.jsx(Ql,{title:"Create feature",description:"Top-level container for phases and tasks.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Feature name",children:o.jsx(Wa,{name:"name",placeholder:"Products page implementation",required:!0})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",placeholder:"Short context for the feature"})}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create feature"})})]})})}function tD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var f;return(f=r.current)==null?void 0:f.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const c=js("feature-detail").feature;return o.jsx(Ql,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Name",children:o.jsx(Wa,{name:"name",defaultValue:c.name,required:!0})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",defaultValue:c.description})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(nt,{label:"Start date",children:o.jsx(Wa,{type:"date",name:"startDate",defaultValue:c.startDate})}),o.jsx(nt,{label:"End date",children:o.jsx(Wa,{type:"date",name:"endDate",defaultValue:c.endDate})})]}),o.jsx(nt,{label:"Status",children:o.jsx(fl,{name:"status",defaultValue:c.status,children:Rd.map(f=>o.jsx("option",{value:f.value,children:f.label},f.value))})}),o.jsx(nt,{label:"Priority",children:o.jsx(Wa,{type:"number",name:"priority",defaultValue:c.priority??0,min:0})}),o.jsx(dn,{title:"Planning notes",subtitle:"Optional agent-maintained notes for progress tracking.",defaultOpen:!1,className:"mt-0",children:o.jsxs("div",{className:"grid gap-4",children:[o.jsx(nt,{label:"Work done",children:o.jsx(ca,{name:"workDone",defaultValue:c.workDone})}),o.jsx(nt,{label:"Work remaining",children:o.jsx(ca,{name:"workRemaining",defaultValue:c.workRemaining})})]})}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save feature"})})]})})}function aD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Aa("submit",s,{allowInEditable:!0}),o.jsx(Ql,{title:"Create phase",description:"A phase belongs to the current feature.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Phase title",children:o.jsx(Wa,{name:"title",placeholder:"API creation",required:!0})}),o.jsx(nt,{label:"Summary",children:o.jsx(ca,{name:"summary",placeholder:"Brief phase summary"})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",placeholder:"Initial implementation notes"})}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create phase"})})]})})}function ui(e){return e.join(`
324
- `)}function nD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var f;return(f=r.current)==null?void 0:f.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const c=js("phase-detail").phase;return o.jsx(Ql,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Title",children:o.jsx(Wa,{name:"title",defaultValue:c.title,required:!0})}),o.jsx(nt,{label:"Status",children:o.jsx(fl,{name:"status",defaultValue:c.status,children:kd.map(f=>o.jsx("option",{value:f.value,children:f.label},f.value))})}),o.jsx(nt,{label:"Priority",children:o.jsx(Wa,{type:"number",name:"priority",defaultValue:c.priority??0,min:0})}),o.jsx(nt,{label:"Summary",children:o.jsx(ca,{name:"summary",defaultValue:c.summary})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",defaultValue:c.description})}),o.jsx(nt,{label:"Goals (one per line)",children:o.jsx(ca,{name:"goals",defaultValue:ui(c.goals)})}),o.jsx(nt,{label:"Non-goals (one per line)",children:o.jsx(ca,{name:"nonGoals",defaultValue:ui(c.nonGoals)})}),o.jsx(nt,{label:"Dependencies (one per line)",children:o.jsx(ca,{name:"dependencies",defaultValue:ui(c.dependencies)})}),o.jsx(nt,{label:"Risks (one per line)",children:o.jsx(ca,{name:"risks",defaultValue:ui(c.risks)})}),o.jsx(nt,{label:"Open questions (one per line)",children:o.jsx(ca,{name:"openQuestions",defaultValue:ui(c.openQuestions)})}),o.jsx(nt,{label:"Completion criteria (one per line)",children:o.jsx(ca,{name:"completionCriteria",defaultValue:ui(c.completionCriteria)})}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save phase"})})]})})}function rD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Aa("submit",s,{allowInEditable:!0}),o.jsx(Ql,{title:"Create task",description:"A task belongs to the current phase.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Task title",children:o.jsx(Wa,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",placeholder:"Initial task context"})}),o.jsx(nt,{label:"Checklist (one per line)",children:o.jsx(ca,{name:"checklist",placeholder:`Step one
325
- Step two
326
- Step three`})}),o.jsx(nt,{label:"Status",children:o.jsx(fl,{name:"status",defaultValue:"planned",children:nd.map(u=>o.jsx("option",{value:u.value,children:u.label},u.value))})}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create task"})})]})})}function lD(e){return e.map(n=>n.title).join(`
327
- `)}function sD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var h;return(h=r.current)==null?void 0:h.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const c=js("task-detail").task,f=c.status==="in-progress"?nd:nd.filter(h=>h.value!=="in-progress");return o.jsx(Ql,{title:"Edit task",description:"Update execution details and checklist items.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Title",children:o.jsx(Wa,{name:"title",defaultValue:c.title,required:!0})}),o.jsx(nt,{label:"Status",children:o.jsx(fl,{name:"status",defaultValue:c.status,disabled:!!c.pauseSnapshot,title:c.pauseSnapshot?"Resume checkpointed work through task_start so its checkpoint is preserved.":void 0,children:f.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))})}),o.jsx(nt,{label:"Priority",children:o.jsx(Wa,{type:"number",name:"priority",defaultValue:c.priority??0,min:0})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",defaultValue:c.description})}),o.jsx(nt,{label:"Checklist (one per line)",children:o.jsx(ca,{name:"checklist",defaultValue:lD(c.checklist)})}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save task"})})]})})}function iD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var c;return(c=r.current)==null?void 0:c.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const{project:u}=js("root");return o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ve,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(hd,{className:"h-4 w-4"})," Back to dashboard"]}),o.jsxs(Vt,{className:"grid gap-5",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project context"}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Update human-authored overview and Project Guidelines content. Freshness and agent read attestations remain planner-managed."})]}),o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Project name",children:o.jsx(Wa,{name:"name",defaultValue:u.name,placeholder:"Project name",required:!0})}),o.jsx(nt,{label:"Short description",children:o.jsx(ca,{name:"description",defaultValue:u.description,placeholder:"Summarize the project in a few lines for the dashboard overview"})}),o.jsx(nt,{label:"Project goal",children:o.jsx(ca,{name:"goal",defaultValue:u.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),o.jsx(nt,{label:"Project Guidelines",children:o.jsx(ca,{name:"projectGuidelines",defaultValue:u.projectGuidelines.content,placeholder:"Coding standards, formatting, styling, and verification rules agents must follow"})}),o.jsxs("div",{className:"flex justify-end gap-3",children:[o.jsx(Ve,{to:"/",children:o.jsx(ot,{type:"button",variant:"ghost",children:"Cancel"})}),o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save project context"})]})]})]})]})}function oD(e){return`P${String(e.number??0).padStart(3,"0")}`}function C1({phases:e,selectedIds:n=[]}){const r=new Set(n);return o.jsx(nt,{label:"Linked phases",children:e.length===0?o.jsx("div",{className:"rounded-[14px] border border-dashed border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"No phases available yet. Create phases first if you want to link this requirement to delivery work."}):o.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-[var(--border)] bg-[var(--surface-elevated)] p-3",children:[o.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Select the phases that directly implement or track this requirement."}),o.jsx("div",{className:"grid gap-2 max-h-[32dvh] overflow-y-auto pr-1",children:e.map(s=>o.jsxs("label",{className:"flex items-start gap-3 rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[o.jsx("input",{type:"checkbox",name:"linkedPhaseIds",value:s.id,defaultChecked:r.has(s.id),className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]"}),o.jsxs("span",{className:"min-w-0",children:[o.jsxs("span",{className:"block font-semibold",children:[oD(s)," — ",s.title]}),s.summary?o.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-muted)]",children:s.summary}):null]})]},s.id))})]})})}function cD(e,n){return{...e,key:e.id??`new-${n}`}}function uD(e){return{key:`new-${e}`,title:"",description:"",status:"planned"}}function A1({initialTasks:e}){const[n,r]=x.useState(()=>e.map(cD)),s=n.map(({key:p,...g})=>g);function u(p,g){r(y=>y.map((v,E)=>E===p?{...v,...g}:v))}function c(p,g){r(y=>{const v=p+g;if(v<0||v>=y.length)return y;const E=[...y];return[E[p],E[v]]=[E[v],E[p]],E})}function f(p){r(g=>g.filter((y,v)=>v!==p))}function h(){r(p=>[...p,uD(p.length)])}return o.jsxs("fieldset",{className:"grid gap-3 rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-4",children:[o.jsx("legend",{className:"px-1 text-sm font-semibold text-[var(--text-muted)]",children:"Macro tasks"}),o.jsx("input",{type:"hidden",name:"macroTasks",value:JSON.stringify(s)}),o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Define the nested outcomes this requirement owns. Their identifiers and timestamps are assigned by the planner."}),n.length===0?o.jsx("p",{className:"text-sm text-[var(--text-subtle)]",children:"No macro tasks yet."}):null,o.jsx("div",{className:"grid gap-4",children:n.map((p,g)=>o.jsxs("fieldset",{className:"grid gap-3 rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] p-3",children:[o.jsxs("legend",{className:"px-1 text-sm font-semibold text-[var(--text)]",children:["Macro task ",g+1]}),o.jsxs("label",{className:"grid gap-2 text-sm font-semibold text-[var(--text-muted)]",children:[o.jsx("span",{children:"Title"}),o.jsx(Wa,{"aria-label":`Macro task ${g+1} title`,value:p.title,onChange:y=>u(g,{title:y.target.value}),required:!0})]}),o.jsxs("label",{className:"grid gap-2 text-sm font-semibold text-[var(--text-muted)]",children:[o.jsx("span",{children:"Description"}),o.jsx(ca,{"aria-label":`Macro task ${g+1} description`,value:p.description,onChange:y=>u(g,{description:y.target.value})})]}),o.jsxs("label",{className:"grid gap-2 text-sm font-semibold text-[var(--text-muted)]",children:[o.jsx("span",{children:"Status"}),o.jsx(fl,{"aria-label":`Macro task ${g+1} status`,value:p.status,onChange:y=>u(g,{status:y.target.value}),children:ip.map(y=>o.jsx("option",{value:y.value,children:y.label},y.value))})]}),o.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[o.jsx(ot,{type:"button",variant:"ghost",onClick:()=>c(g,-1),disabled:g===0,"aria-label":`Move macro task ${g+1} up`,children:"Move up"}),o.jsx(ot,{type:"button",variant:"ghost",onClick:()=>c(g,1),disabled:g===n.length-1,"aria-label":`Move macro task ${g+1} down`,children:"Move down"}),o.jsx(ot,{type:"button",variant:"danger",onClick:()=>f(g),"aria-label":`Remove macro task ${g+1}`,children:"Remove"})]})]},p.key))}),o.jsx("div",{children:o.jsx(ot,{type:"button",onClick:h,children:"Add macro task"})})]})}function dD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var c;return(c=r.current)==null?void 0:c.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const{phases:u}=js("requirements");return o.jsx(Ql,{title:"Create requirement",description:"Capture a top-level outcome that phases can implement and track.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Requirement title",children:o.jsx(Wa,{name:"title",placeholder:"Self-hosted Claude Code plugin marketplace distribution",required:!0})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",placeholder:"Describe the user/business outcome this requirement represents"})}),o.jsx(nt,{label:"Status",children:o.jsx(fl,{name:"status",defaultValue:"planned",children:ip.map(c=>o.jsx("option",{value:c.value,children:c.label},c.value))})}),o.jsx(A1,{initialTasks:[]}),o.jsx(C1,{phases:u}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create requirement"})})]})})}function fD(){const n=gr().state!=="idle",r=x.useRef(null),s=x.useCallback(()=>{var p;return(p=r.current)==null?void 0:p.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const{requirementId:u}=FE(),{phases:c,requirements:f}=js("requirements"),h=f.find(p=>p.id===u);return h?o.jsx(Ql,{title:"Edit requirement",description:"Update status, scope notes, and linked delivery phases.",children:o.jsxs(Pa,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(nt,{label:"Requirement title",children:o.jsx(Wa,{name:"title",defaultValue:h.title,required:!0})}),o.jsx(nt,{label:"Description",children:o.jsx(ca,{name:"description",defaultValue:h.description})}),o.jsx(nt,{label:"Status",children:o.jsx(fl,{name:"status",defaultValue:h.status,children:ip.map(p=>o.jsx("option",{value:p.value,children:p.label},p.value))})}),o.jsx(A1,{initialTasks:h.macroTasks}),o.jsx(C1,{phases:c,selectedIds:h.linkedPhaseIds}),o.jsx(Kl,{children:o.jsx(ot,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save requirement"})})]})}):null}function Ja(e,n){const r=e.get(n);if(typeof r!="string"||r.trim()==="")throw new Response(`Missing field: ${n}`,{status:400});return r.trim()}function wa(e,n){const r=e.get(n);return typeof r=="string"?r.trim():""}function gp(e,n){const r=e.get(n);if(typeof r!="string")return 0;const s=r.trim();if(s==="")return 0;const u=Number(s);return Number.isFinite(u)?u:0}function ql(e,n){return wa(e,n).split(`
328
- `).map(r=>r.trim()).filter(Boolean)}function D1(e){const n=wa(e,"macroTasks");if(!n)return[];let r;try{r=JSON.parse(n)}catch{throw new Response("Macro tasks must be valid form data.",{status:400})}if(!Array.isArray(r))throw new Response("Macro tasks must be a list.",{status:400});return r.map((s,u)=>{if(!s||typeof s!="object")throw new Response(`Macro task ${u+1} is invalid.`,{status:400});const c=s,f=typeof c.title=="string"?c.title.trim():"",h=typeof c.status=="string"?c.status.trim():"";if(!f)throw new Response(`Macro task ${u+1} requires a title.`,{status:400});if(!h)throw new Response(`Macro task ${u+1} requires a status.`,{status:400});const p=typeof c.id=="string"&&c.id.trim()?c.id.trim():void 0;return{...p?{id:p}:{},title:f,description:typeof c.description=="string"?c.description.trim():"",status:h}})}function Qt(e,n){const r=e[n];if(!r)throw new Response(`Missing route param: ${n}`,{status:400});return r}async function hD({request:e}){const n=await e.formData();return await v2({name:Ja(n,"name"),description:wa(n,"description")}),kn("/features")}async function mD({request:e,params:n}){const r=Qt(n,"featureId"),s=await tc(r),u=await e.formData();return await y0({...s,name:Ja(u,"name"),description:wa(u,"description"),startDate:wa(u,"startDate"),endDate:wa(u,"endDate"),status:Ja(u,"status"),priority:gp(u,"priority"),workDone:wa(u,"workDone"),workRemaining:wa(u,"workRemaining")}),kn(`/features/${r}`)}async function pD({params:e}){return await y2(Qt(e,"featureId")),kn("/features")}async function gD({request:e,params:n}){const r=Qt(n,"featureId"),s=await tc(r),u=await e.formData();return await y0({...s,status:Ja(u,"status")}),null}async function xD({request:e,params:n}){const r=Qt(n,"featureId"),s=await e.formData();return await k2({featureId:r,title:Ja(s,"title"),summary:wa(s,"summary"),description:wa(s,"description")}),kn(`/features/${r}`)}async function vD({request:e,params:n}){const r=Qt(n,"featureId"),s=Qt(n,"phaseId"),u=await vd(s),c=await e.formData();return await b0({...u,title:Ja(c,"title"),status:Ja(c,"status"),priority:gp(c,"priority"),summary:wa(c,"summary"),description:wa(c,"description"),goals:ql(c,"goals"),nonGoals:ql(c,"nonGoals"),dependencies:ql(c,"dependencies"),risks:ql(c,"risks"),openQuestions:ql(c,"openQuestions"),completionCriteria:ql(c,"completionCriteria")}),kn(`/features/${r}/phases/${s}`)}async function yD({params:e}){const n=Qt(e,"featureId"),r=Qt(e,"phaseId");return await T2(r),kn(`/features/${n}`)}async function bD({request:e,params:n}){const r=Qt(n,"phaseId"),s=await vd(r),u=await e.formData();return await b0({...s,status:Ja(u,"status")}),null}async function wD({request:e,params:n}){const r=Qt(n,"featureId"),s=Qt(n,"phaseId"),u=await e.formData(),c=ql(u,"checklist");return await C2(s,{title:Ja(u,"title"),description:wa(u,"description"),status:wa(u,"status")||"planned",...c.length?{checklist:c}:{}}),kn(`/features/${r}/phases/${s}`)}function SD(e,n){const r=new Map(e.map(u=>[u.id,u])),s=new Map(e.map(u=>[u.title.trim().toLowerCase(),u]));return n.map((u,c)=>{var p;const f=u.trim().toLowerCase(),h=r.get(((p=e[c])==null?void 0:p.id)??"")??s.get(f);return h?{...h,number:c+1,title:u.trim()}:{id:`check-${c+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:c+1,title:u.trim(),checked:!1}})}async function ED({request:e,params:n}){const r=Qt(n,"featureId"),s=Qt(n,"phaseId"),u=Qt(n,"taskId"),c=await yd(u),f=await e.formData(),h=Ja(f,"status");if(h==="in-progress"&&c.status!=="in-progress")throw new Response("Use Start task or Resume task to enter in-progress.",{status:400});return await Pm({...c,phaseId:s,title:Ja(f,"title"),status:h,priority:gp(f,"priority"),description:wa(f,"description"),checklist:SD(c.checklist,ql(f,"checklist"))}),kn(`/features/${r}/phases/${s}/tasks/${u}`)}async function ND({params:e}){const n=Qt(e,"featureId"),r=Qt(e,"phaseId"),s=Qt(e,"taskId");return await D2(s),kn(`/features/${n}/phases/${r}`)}async function jD({request:e,params:n}){const r=Qt(n,"phaseId"),s=Qt(n,"taskId"),u=await yd(s),c=await e.formData();return await Pm({...u,phaseId:r,status:Ja(c,"status")}),null}async function RD({params:e}){const n=Qt(e,"featureId"),r=Qt(e,"phaseId"),s=Qt(e,"taskId");return await A2(s),kn(`/features/${n}/phases/${r}/tasks/${s}`)}async function kD({request:e}){const n=await Im(),r=await e.formData();return await g2({...n,name:wa(r,"name")||n.name,description:wa(r,"description"),goal:wa(r,"goal"),projectGuidelines:{...n.projectGuidelines,content:wa(r,"projectGuidelines")}}),kn("/")}async function TD({request:e}){const n=await e.formData();return await N2({title:Ja(n,"title"),description:wa(n,"description"),status:Ja(n,"status"),macroTasks:D1(n),linkedPhaseIds:n.getAll("linkedPhaseIds").filter(r=>typeof r=="string").map(r=>r.trim()).filter(Boolean)}),kn("/requirements")}async function CD({request:e,params:n}){const r=Qt(n,"requirementId"),s=(await qm()).find(c=>c.id===r);if(!s)throw new Response(`Requirement not found: ${r}`,{status:404});const u=await e.formData();return await j2({...s,title:Ja(u,"title"),description:wa(u,"description"),status:Ja(u,"status"),macroTasks:u.has("macroTasks")?D1(u):s.macroTasks,linkedPhaseIds:u.getAll("linkedPhaseIds").filter(c=>typeof c=="string").map(c=>c.trim()).filter(Boolean)}),kn("/requirements")}async function AD({params:e}){return await R2(Qt(e,"requirementId")),kn("/requirements")}function DD(e){if(!e)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}async function OD(){return{handoffs:await mm()}}function MD(){const{handoffs:e}=Mr(),[n,r]=x.useState(e),[s,u]=x.useState(null),[c,f]=x.useState(""),h=In();async function p(g){if(!(s||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){u(g.phaseId),f("");try{await w0(g.phaseId),r(v=>v.filter(E=>E.phaseId!==g.phaseId)),mm().then(r).catch(()=>{})}catch(v){const E=v instanceof Response?await v.text().catch(()=>""):v instanceof Error?v.message:String(v);f(E||`Failed to clear handoff for ${g.compositeRef}.`)}finally{u(null)}}}return x.useEffect(()=>{const g=y=>{const v=y.detail;((v==null?void 0:v.type)==="handoffUpdated"||(v==null?void 0:v.type)==="handoffCleared")&&mm().then(r).catch(()=>{})};return window.addEventListener("agent-plan:ws-event",g),()=>window.removeEventListener("agent-plan:ws-event",g)},[]),x.useEffect(()=>{if(!h.hash)return;const g=h.hash.slice(1),y=document.getElementById(g);y&&y.scrollIntoView({behavior:"smooth",block:"start"})},[h.hash,n]),n.length===0?o.jsxs(Vt,{className:"grid gap-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[o.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),o.jsx(Ve,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Pending entity-scoped handoffs on non-completed phases."})]}),c?o.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:c}):null,o.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[o.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),o.jsx(Ve,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),o.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Pending entity-scoped handoffs on non-completed phases. ",n.length," pending."]})]}),c?o.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:c}):null,n.map(g=>o.jsx("section",{id:g.phaseId,className:"scroll-mt-20",children:o.jsx(Vt,{className:"overflow-hidden p-0",children:o.jsx(dn,{defaultOpen:!1,title:o.jsxs(o.Fragment,{children:[o.jsx(sr,{id:g.compositeRef,children:g.compositeRef}),o.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",DD(g.updatedAt)]})]}),subtitle:g.firstLine||"Empty handoff content.",summaryClassName:"hover:bg-[var(--surface-hover)]/60 focus-visible:bg-[var(--surface-hover)]/60",actions:o.jsxs(o.Fragment,{children:[o.jsx(ot,{type:"button",variant:"danger",className:"min-h-8 px-2.5 py-1 text-xs sm:min-h-9",disabled:s===g.phaseId,onClick:y=>{y.preventDefault(),y.stopPropagation(),p(g)},children:s===g.phaseId?"Clearing…":"Clear"}),o.jsx(Ve,{to:g.featureId?`/features/${g.featureId}/phases/${g.phaseId}`:"/features",className:"text-xs text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",onClick:y=>y.stopPropagation(),children:g.featureId?"Open phase →":"Browse features →"})]}),contentClassName:"px-5 py-5",children:g.firstLine?o.jsx(ga,{text:g.content,className:"formatted-text max-w-none"}):o.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"Empty handoff content."})})})},g.phaseId))]})}function _D(e){if(!e)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}async function LD(){return{archived:await _2()}}function zD(){const{archived:e}=Mr();return e.length===0?o.jsxs(Vt,{className:"grid gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),o.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Completed, superseded, and manually cleared handoffs."})]}),o.jsx(Ve,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),o.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No archived handoffs."})]}):o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),o.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:[e.length," archived entries. These are history, not pending resume context."]})]}),o.jsx(Ve,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),e.map(n=>o.jsx(Vt,{className:"overflow-hidden p-0",children:o.jsxs(dn,{defaultOpen:!1,title:o.jsxs(o.Fragment,{children:[o.jsx(sr,{id:n.compositeRef,children:n.compositeRef}),o.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Archived ",_D(n.archivedAt)]})]}),subtitle:n.firstLine||"Empty archived handoff.",contentClassName:"px-5 py-5",children:[o.jsxs("div",{className:"mb-3 flex flex-wrap gap-2 text-xs text-[var(--text-muted)]",children:[o.jsxs("span",{children:["Reason: ",n.reason||"unknown"]}),o.jsxs("span",{className:"break-all",children:["File: ",n.file]})]}),o.jsx(ga,{text:n.content||"(archive file unavailable)",className:"formatted-text max-w-none"})]})},`${n.phaseId}:${n.file}`))]})}async function UD({request:e,params:n}){Qt(n,"featureId");const r=Qt(n,"phaseId"),s=Qt(n,"taskId"),u=Qt(n,"itemId"),c=await e.formData(),f=Ja(c,"checked")==="true",h=await yd(s);return await Pm({...h,phaseId:r,checklist:h.checklist.map(p=>p.id===u?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:s,itemId:u,checked:f})}const $D=UN([{id:"root",path:"/",loader:uR,element:o.jsx(dR,{}),errorElement:o.jsx(fR,{}),children:[{index:!0,loader:hR,element:o.jsx(xA,{})},{path:"features",id:"features",loader:vA,element:o.jsx(NA,{}),children:[{path:"new",element:o.jsx(eD,{}),action:hD}]},{path:"features/:featureId",id:"feature-detail",loader:_A,element:o.jsx(FA,{}),children:[{path:"edit",element:o.jsx(tD,{}),action:mD},{path:"phases/new",element:o.jsx(aD,{}),action:xD}]},{path:"requirements",id:"requirements",loader:jA,element:o.jsx(TA,{}),children:[{path:"new",element:o.jsx(dD,{}),action:TD},{path:":requirementId/edit",element:o.jsx(fD,{}),action:CD}]},{path:"ideas",id:"ideas",loader:CA,action:AA,element:o.jsx(MA,{})},{path:"project/edit",element:o.jsx(iD,{}),action:kD},{path:"handoff",loader:OD,element:o.jsx(MD,{})},{path:"handoff/archive",loader:LD,element:o.jsx(zD,{})},{path:"features/:featureId/delete",action:pD},{path:"requirements/:requirementId/delete",action:AD},{path:"features/:featureId/status",action:gD},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:VA,element:o.jsx(XA,{}),children:[{path:"edit",element:o.jsx(nD,{}),action:vD},{path:"tasks/new",element:o.jsx(rD,{}),action:wD}]},{path:"features/:featureId/phases/:phaseId/delete",action:yD},{path:"features/:featureId/phases/:phaseId/status",action:bD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:QA,element:o.jsx(WA,{}),children:[{path:"edit",element:o.jsx(sD,{}),action:ED}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:ND},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/start",action:RD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:jD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:UD}]}]),O1=document.getElementById("root");if(!O1)throw new Error("#root not found");jS.createRoot(O1).render(o.jsx(x.StrictMode,{children:o.jsx(GN,{router:$D})}));