@agent-plan/pi-adapter 0.2.28 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +469 -551
- package/package.json +3 -3
- package/web-ui-dist/assets/index-CmsfDpZ0.js +334 -0
- package/web-ui-dist/assets/index-DKmMhG5Y.css +1 -0
- package/web-ui-dist/index.html +2 -2
- package/web-ui-dist/assets/index-DBJc9tGn.css +0 -1
- package/web-ui-dist/assets/index-NRDThOAB.js +0 -329
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
var xS=Object.defineProperty;var yS=(e,a,r)=>a in e?xS(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r;var xn=(e,a,r)=>yS(e,typeof a!="symbol"?a+"":a,r);function bS(e,a){for(var r=0;r<a.length;r++){const s=a[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 a=document.createElement("link").relList;if(a&&a.supports&&a.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 d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).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 wS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ah={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 Gx;function SS(){if(Gx)return xo;Gx=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(s,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+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:d,ref:u!==void 0?u:null,props:c}}return xo.Fragment=a,xo.jsx=r,xo.jsxs=r,xo}var Xx;function ES(){return Xx||(Xx=1,Ah.exports=SS()),Ah.exports}var o=ES(),Dh={exports:{}},rt={};/**
|
|
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 Qx;function NS(){if(Qx)return rt;Qx=1;var e=Symbol.for("react.transitional.element"),a=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"),d=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"),x=Symbol.for("react.activity"),E=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=E&&A[E]||A["@@iterator"],typeof A=="function"?A:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,R={};function L(A,C,G){this.props=A,this.context=C,this.refs=R,this.updater=G||w}L.prototype.isReactComponent={},L.prototype.setState=function(A,C){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,C,"setState")},L.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function B(){}B.prototype=L.prototype;function I(A,C,G){this.props=A,this.context=C,this.refs=R,this.updater=G||w}var F=I.prototype=new B;F.constructor=I,j(F,L.prototype),F.isPureReactComponent=!0;var W=Array.isArray;function ne(){}var _={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function de(A,C,G){var ae=G.ref;return{$$typeof:e,type:A,key:C,ref:ae!==void 0?ae:null,props:G}}function ge(A,C){return de(A.type,C,A.props)}function be(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function re(A){var C={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(G){return C[G]})}var je=/\/+/g;function Te(A,C){return typeof A=="object"&&A!==null&&A.key!=null?re(""+A.key):C.toString(36)}function J(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ne,ne):(A.status="pending",A.then(function(C){A.status==="pending"&&(A.status="fulfilled",A.value=C)},function(C){A.status==="pending"&&(A.status="rejected",A.reason=C)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function $(A,C,G,ae,he){var fe=typeof A;(fe==="undefined"||fe==="boolean")&&(A=null);var Re=!1;if(A===null)Re=!0;else switch(fe){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(A.$$typeof){case e:case a:Re=!0;break;case y:return Re=A._init,$(Re(A._payload),C,G,ae,he)}}if(Re)return he=he(A),Re=ae===""?"."+Te(A,0):ae,W(he)?(G="",Re!=null&&(G=Re.replace(je,"$&/")+"/"),$(he,C,G,"",function($e){return $e})):he!=null&&(be(he)&&(he=ge(he,G+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(je,"$&/")+"/")+Re)),C.push(he)),1;Re=0;var qe=ae===""?".":ae+":";if(W(A))for(var Le=0;Le<A.length;Le++)ae=A[Le],fe=qe+Te(ae,Le),Re+=$(ae,C,G,fe,he);else if(Le=S(A),typeof Le=="function")for(A=Le.call(A),Le=0;!(ae=A.next()).done;)ae=ae.value,fe=qe+Te(ae,Le++),Re+=$(ae,C,G,fe,he);else if(fe==="object"){if(typeof A.then=="function")return $(J(A),C,G,ae,he);throw C=String(A),Error("Objects are not valid as a React child (found: "+(C==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":C)+"). If you meant to render a collection of children, use an array instead.")}return Re}function P(A,C,G){if(A==null)return A;var ae=[],he=0;return $(A,ae,"","",function(fe){return C.call(G,fe,he++)}),ae}function ce(A){if(A._status===-1){var C=A._result;C=C(),C.then(function(G){(A._status===0||A._status===-1)&&(A._status=1,A._result=G)},function(G){(A._status===0||A._status===-1)&&(A._status=2,A._result=G)}),A._status===-1&&(A._status=0,A._result=C)}if(A._status===1)return A._result.default;throw A._result}var me=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var C=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(C))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},Se={map:P,forEach:function(A,C,G){P(A,function(){C.apply(this,arguments)},G)},count:function(A){var C=0;return P(A,function(){C++}),C},toArray:function(A){return P(A,function(C){return C})||[]},only:function(A){if(!be(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return rt.Activity=x,rt.Children=Se,rt.Component=L,rt.Fragment=r,rt.Profiler=u,rt.PureComponent=I,rt.StrictMode=s,rt.Suspense=p,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,rt.__COMPILER_RUNTIME={__proto__:null,c:function(A){return _.H.useMemoCache(A)}},rt.cache=function(A){return function(){return A.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(A,C,G){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var ae=j({},A.props),he=A.key;if(C!=null)for(fe in C.key!==void 0&&(he=""+C.key),C)!T.call(C,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&C.ref===void 0||(ae[fe]=C[fe]);var fe=arguments.length-2;if(fe===1)ae.children=G;else if(1<fe){for(var Re=Array(fe),qe=0;qe<fe;qe++)Re[qe]=arguments[qe+2];ae.children=Re}return de(A.type,he,ae)},rt.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},rt.createElement=function(A,C,G){var ae,he={},fe=null;if(C!=null)for(ae in C.key!==void 0&&(fe=""+C.key),C)T.call(C,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(he[ae]=C[ae]);var Re=arguments.length-2;if(Re===1)he.children=G;else if(1<Re){for(var qe=Array(Re),Le=0;Le<Re;Le++)qe[Le]=arguments[Le+2];he.children=qe}if(A&&A.defaultProps)for(ae in Re=A.defaultProps,Re)he[ae]===void 0&&(he[ae]=Re[ae]);return de(A,fe,he)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(A){return{$$typeof:h,render:A}},rt.isValidElement=be,rt.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:ce}},rt.memo=function(A,C){return{$$typeof:g,type:A,compare:C===void 0?null:C}},rt.startTransition=function(A){var C=_.T,G={};_.T=G;try{var ae=A(),he=_.S;he!==null&&he(G,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(ne,me)}catch(fe){me(fe)}finally{C!==null&&G.types!==null&&(C.types=G.types),_.T=C}},rt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},rt.use=function(A){return _.H.use(A)},rt.useActionState=function(A,C,G){return _.H.useActionState(A,C,G)},rt.useCallback=function(A,C){return _.H.useCallback(A,C)},rt.useContext=function(A){return _.H.useContext(A)},rt.useDebugValue=function(){},rt.useDeferredValue=function(A,C){return _.H.useDeferredValue(A,C)},rt.useEffect=function(A,C){return _.H.useEffect(A,C)},rt.useEffectEvent=function(A){return _.H.useEffectEvent(A)},rt.useId=function(){return _.H.useId()},rt.useImperativeHandle=function(A,C,G){return _.H.useImperativeHandle(A,C,G)},rt.useInsertionEffect=function(A,C){return _.H.useInsertionEffect(A,C)},rt.useLayoutEffect=function(A,C){return _.H.useLayoutEffect(A,C)},rt.useMemo=function(A,C){return _.H.useMemo(A,C)},rt.useOptimistic=function(A,C){return _.H.useOptimistic(A,C)},rt.useReducer=function(A,C,G){return _.H.useReducer(A,C,G)},rt.useRef=function(A){return _.H.useRef(A)},rt.useState=function(A){return _.H.useState(A)},rt.useSyncExternalStore=function(A,C,G){return _.H.useSyncExternalStore(A,C,G)},rt.useTransition=function(){return _.H.useTransition()},rt.version="19.2.7",rt}var Kx;function Rm(){return Kx||(Kx=1,Dh.exports=NS()),Dh.exports}var v=Rm();const hn=wS(v),jS=bS({__proto__:null,default:hn},[v]);var Ch={exports:{}},yo={},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 Zx;function RS(){return Zx||(Zx=1,(function(e){function a($,P){var ce=$.length;$.push(P);e:for(;0<ce;){var me=ce-1>>>1,Se=$[me];if(0<u(Se,P))$[me]=P,$[ce]=Se,ce=me;else break e}}function r($){return $.length===0?null:$[0]}function s($){if($.length===0)return null;var P=$[0],ce=$.pop();if(ce!==P){$[0]=ce;e:for(var me=0,Se=$.length,A=Se>>>1;me<A;){var C=2*(me+1)-1,G=$[C],ae=C+1,he=$[ae];if(0>u(G,ce))ae<Se&&0>u(he,G)?($[me]=he,$[ae]=ce,me=ae):($[me]=G,$[C]=ce,me=C);else if(ae<Se&&0>u(he,ce))$[me]=he,$[ae]=ce,me=ae;else break e}}return P}function u($,P){var ce=$.sortIndex-P.sortIndex;return ce!==0?ce:$.id-P.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 d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var p=[],g=[],y=1,x=null,E=3,S=!1,w=!1,j=!1,R=!1,L=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function F($){for(var P=r(g);P!==null;){if(P.callback===null)s(g);else if(P.startTime<=$)s(g),P.sortIndex=P.expirationTime,a(p,P);else break;P=r(g)}}function W($){if(j=!1,F($),!w)if(r(p)!==null)w=!0,ne||(ne=!0,re());else{var P=r(g);P!==null&&J(W,P.startTime-$)}}var ne=!1,_=-1,T=5,de=-1;function ge(){return R?!0:!(e.unstable_now()-de<T)}function be(){if(R=!1,ne){var $=e.unstable_now();de=$;var P=!0;try{e:{w=!1,j&&(j=!1,B(_),_=-1),S=!0;var ce=E;try{t:{for(F($),x=r(p);x!==null&&!(x.expirationTime>$&&ge());){var me=x.callback;if(typeof me=="function"){x.callback=null,E=x.priorityLevel;var Se=me(x.expirationTime<=$);if($=e.unstable_now(),typeof Se=="function"){x.callback=Se,F($),P=!0;break t}x===r(p)&&s(p),F($)}else s(p);x=r(p)}if(x!==null)P=!0;else{var A=r(g);A!==null&&J(W,A.startTime-$),P=!1}}break e}finally{x=null,E=ce,S=!1}P=void 0}}finally{P?re():ne=!1}}}var re;if(typeof I=="function")re=function(){I(be)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Te=je.port2;je.port1.onmessage=be,re=function(){Te.postMessage(null)}}else re=function(){L(be,0)};function J($,P){_=L(function(){$(e.unstable_now())},P)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return E},e.unstable_next=function($){switch(E){case 1:case 2:case 3:var P=3;break;default:P=E}var ce=E;E=P;try{return $()}finally{E=ce}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function($,P){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ce=E;E=$;try{return P()}finally{E=ce}},e.unstable_scheduleCallback=function($,P,ce){var me=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?me+ce:me):ce=me,$){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=ce+Se,$={id:y++,callback:P,priorityLevel:$,startTime:ce,expirationTime:Se,sortIndex:-1},ce>me?($.sortIndex=ce,a(g,$),r(p)===null&&$===r(g)&&(j?(B(_),_=-1):j=!0,J(W,ce-me))):($.sortIndex=Se,a(p,$),w||S||(w=!0,ne||(ne=!0,re()))),$},e.unstable_shouldYield=ge,e.unstable_wrapCallback=function($){var P=E;return function(){var ce=E;E=P;try{return $.apply(this,arguments)}finally{E=ce}}}})(Mh)),Mh}var Wx;function kS(){return Wx||(Wx=1,Oh.exports=RS()),Oh.exports}var _h={exports:{}},ca={};/**
|
|
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 Jx;function TS(){if(Jx)return ca;Jx=1;var e=Rm();function a(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(a(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 x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:p,containerInfo:g,implementation:y}}var d=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 ca.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,ca.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(a(299));return c(p,g,null,y)},ca.flushSync=function(p){var g=d.T,y=s.p;try{if(d.T=null,s.p=2,p)return p()}finally{d.T=g,s.p=y,s.d.f()}},ca.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))},ca.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},ca.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,x=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:x,integrity:E,fetchPriority:S}):y==="script"&&s.d.X(p,{crossOrigin:x,integrity:E,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ca.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)},ca.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,x=h(y,g.crossOrigin);s.d.L(p,y,{crossOrigin:x,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})}},ca.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)},ca.requestFormReset=function(p){s.d.r(p)},ca.unstable_batchedUpdates=function(p,g){return p(g)},ca.useFormState=function(p,g,y){return d.H.useFormState(p,g,y)},ca.useFormStatus=function(){return d.H.useHostTransitionStatus()},ca.version="19.2.7",ca}var ey;function Rb(){if(ey)return _h.exports;ey=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(a){console.error(a)}}return e(),_h.exports=TS(),_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 ty;function AS(){if(ty)return yo;ty=1;var e=kS(),a=Rm(),r=Rb();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" 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 n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(s(188))}function g(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(s(188));return n!==t?null:t}for(var l=t,i=n;;){var f=l.return;if(f===null)break;var m=f.alternate;if(m===null){if(i=f.return,i!==null){l=i;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return p(f),t;if(m===i)return p(f),n;m=m.sibling}throw Error(s(188))}if(l.return!==i.return)l=f,i=m;else{for(var b=!1,N=f.child;N;){if(N===l){b=!0,l=f,i=m;break}if(N===i){b=!0,i=f,l=m;break}N=N.sibling}if(!b){for(N=m.child;N;){if(N===l){b=!0,l=m,i=f;break}if(N===i){b=!0,i=m,l=f;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:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var x=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"),L=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),I=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function re(t){return t===null||typeof t!="object"?null:(t=be&&t[be]||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 L:return"Profiler";case R:return"StrictMode";case W:return"Suspense";case ne:return"SuspenseList";case de:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case I:return t.displayName||"Context";case B:return(t._context.displayName||"Context")+".Consumer";case F:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case _:return n=t.displayName||null,n!==null?n:Te(t.type)||"Memo";case T:n=t._payload,t=t._init;try{return Te(t(n))}catch{}}return null}var J=Array.isArray,$=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},me=[],Se=-1;function A(t){return{current:t}}function C(t){0>Se||(t.current=me[Se],me[Se]=null,Se--)}function G(t,n){Se++,me[Se]=t.current,t.current=n}var ae=A(null),he=A(null),fe=A(null),Re=A(null);function qe(t,n){switch(G(fe,n),G(he,t),G(ae,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?gx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=gx(n),t=vx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}C(ae),G(ae,t)}function Le(){C(ae),C(he),C(fe)}function $e(t){t.memoizedState!==null&&G(Re,t);var n=ae.current,l=vx(n,t.type);n!==l&&(G(he,t),G(ae,l))}function jt(t){he.current===t&&(C(ae),C(he)),Re.current===t&&(C(Re),mo._currentValue=ce)}var bt,dt;function se(t){if(bt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);bt=n&&n[1]||"",dt=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+bt+t+dt}var Ie=!1;function st(t,n){if(!t||Ie)return"";Ie=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){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(K){var Q=K}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(K){Q=K}t.call(oe.prototype)}}else{try{throw Error()}catch(K){Q=K}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(K){if(K&&Q&&typeof K.stack=="string")return[K.stack,Q.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),b=m[0],N=m[1];if(b&&N){var O=b.split(`
|
|
44
|
+
`),Y=N.split(`
|
|
45
|
+
`);for(f=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(i===O.length||f===Y.length)for(i=O.length-1,f=Y.length-1;1<=i&&0<=f&&O[i]!==Y[f];)f--;for(;1<=i&&0<=f;i--,f--)if(O[i]!==Y[f]){if(i!==1||f!==1)do if(i--,f--,0>f||O[i]!==Y[f]){var te=`
|
|
46
|
+
`+O[i].replace(" at new "," at ");return t.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",t.displayName)),te}while(1<=i&&0<=f);break}}}finally{Ie=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?se(l):""}function Pt(t,n){switch(t.tag){case 26:case 27:case 5:return se(t.type);case 16:return se("Lazy");case 13:return t.child!==n&&n!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return st(t.type,!1);case 11:return st(t.type.render,!1);case 1:return st(t.type,!0);case 31:return se("Activity");default:return""}}function yn(t){try{var n="",l=null;do n+=Pt(t,l),l=t,t=t.return;while(t);return n}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var Ct=Object.prototype.hasOwnProperty,It=e.unstable_scheduleCallback,Jt=e.unstable_cancelCallback,Pn=e.unstable_shouldYield,Fn=e.unstable_requestPaint,ln=e.unstable_now,fa=e.unstable_getCurrentPriorityLevel,ha=e.unstable_ImmediatePriority,na=e.unstable_UserBlockingPriority,Vn=e.unstable_NormalPriority,pe=e.unstable_LowPriority,Ae=e.unstable_IdlePriority,De=e.log,Ke=e.unstable_setDisableYieldValue,Fe=null,ee=null;function Ot(t){if(typeof De=="function"&&Ke(t),ee&&typeof ee.setStrictMode=="function")try{ee.setStrictMode(Fe,t)}catch{}}var en=Math.clz32?Math.clz32:Ha,Xn=Math.log,bn=Math.LN2;function Ha(t){return t>>>=0,t===0?32:31-(Xn(t)/bn|0)|0}var _e=256,wt=262144,St=4194304;function Rt(t){var n=t&42;if(n!==0)return n;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 Ft(t,n,l){var i=t.pendingLanes;if(i===0)return 0;var f=0,m=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var N=i&134217727;return N!==0?(i=N&~m,i!==0?f=Rt(i):(b&=N,b!==0?f=Rt(b):l||(l=N&~t,l!==0&&(f=Rt(l))))):(N=i&~m,N!==0?f=Rt(N):b!==0?f=Rt(b):l||(l=i&~t,l!==0&&(f=Rt(l)))),f===0?0:n!==0&&n!==f&&(n&m)===0&&(m=f&-f,l=n&-n,m>=l||m===32&&(l&4194048)!==0)?n:f}function Mt(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function sn(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 tn(){var t=St;return St<<=1,(St&62914560)===0&&(St=4194304),t}function Vt(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function gt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function nt(t,n,l,i,f,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,O=t.expirationTimes,Y=t.hiddenUpdates;for(l=b&~l;0<l;){var te=31-en(l),oe=1<<te;N[te]=0,O[te]=-1;var Q=Y[te];if(Q!==null)for(Y[te]=null,te=0;te<Q.length;te++){var K=Q[te];K!==null&&(K.lane&=-536870913)}l&=~oe}i!==0&&Nn(t,i,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(b&~n))}function Nn(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var i=31-en(n);t.entangledLanes|=n,t.entanglements[i]=t.entanglements[i]|1073741824|l&261930}function Ln(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var i=31-en(l),f=1<<i;f&n|t[i]&n&&(t[i]|=n),l&=~f}}function D(t,n){var l=n&-n;return l=(l&42)!==0?1:z(l),(l&(t.suspendedLanes|n))!==0?0:l}function z(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 Z(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:Ix(t.type))}function ie(t,n){var l=P.p;try{return P.p=t,n()}finally{P.p=l}}var ke=Math.random().toString(36).slice(2),xe="__reactFiber$"+ke,Ce="__reactProps$"+ke,Ne="__reactContainer$"+ke,ze="__reactEvents$"+ke,Be="__reactListeners$"+ke,We="__reactHandles$"+ke,Oe="__reactResources$"+ke,tt="__reactMarker$"+ke;function Ve(t){delete t[xe],delete t[Ce],delete t[ze],delete t[Be],delete t[We]}function Yt(t){var n=t[xe];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Ne]||l[xe]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Nx(t);t!==null;){if(l=t[xe])return l;t=Nx(t)}return n}t=l,l=t.parentNode}return null}function at(t){if(t=t[xe]||t[Ne]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function mt(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function ft(t){var n=t[Oe];return n||(n=t[Oe]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function pt(t){t[tt]=!0}var nn=new Set,Qn={};function jn(t,n){zn(t,n),zn(t+"Capture",n)}function zn(t,n){for(Qn[t]=n,t=0;t<n.length;t++)nn.add(n[t])}var $n=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]*$"),Kn={},xa={};function fl(t){return Ct.call(xa,t)?!0:Ct.call(Kn,t)?!1:$n.test(t)?xa[t]=!0:(Kn[t]=!0,!1)}function aa(t,n,l){if(fl(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function vr(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function Je(t,n,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(n,l,""+i)}}function Tt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function an(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ra(t,n,l){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,m=i.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Un(t){if(!t._valueTracker){var n=an(t)?"checked":"value";t._valueTracker=ra(t,n,""+t[n])}}function _r(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),i="";return t&&(i=an(t)?t.checked?"true":"false":t.value),t=i,t!==l?(n.setValue(t),!0):!1}function At(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 Aa=/[\n"\\]/g;function Zn(t){return t.replace(Aa,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Zl(t,n,l,i,f,m,b,N){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),n!=null?b==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Tt(n)):t.value!==""+Tt(n)&&(t.value=""+Tt(n)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),n!=null?_t(t,b,Tt(n)):l!=null?_t(t,b,Tt(l)):i!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.name=""+Tt(N):t.removeAttribute("name")}function Ai(t,n,l,i,f,m,b,N){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),n!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){Un(t);return}l=l!=null?""+Tt(l):"",n=n!=null?""+Tt(n):l,N||n===t.value||(t.value=n),t.defaultValue=n}i=i??f,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),Un(t)}function _t(t,n,l){n==="number"&&At(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function xr(t,n,l,i){if(t=t.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=n.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&i&&(t[l].defaultSelected=!0)}else{for(l=""+Tt(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,i&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function dc(t,n,l){if(n!=null&&(n=""+Tt(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+Tt(l):""}function lr(t,n,l,i){if(n==null){if(i!=null){if(l!=null)throw Error(s(92));if(J(i)){if(1<i.length)throw Error(s(93));i=i[0]}l=i}l==null&&(l=""),n=l}l=Tt(n),t.defaultValue=l,i=t.textContent,i===l&&i!==""&&i!==null&&(t.value=i),Un(t)}function hl(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var Ad=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 As(t,n,l){var i=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":i?t.setProperty(n,l):typeof l!="number"||l===0||Ad.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function ya(t,n,l){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var f in n)i=n[f],n.hasOwnProperty(f)&&l[f]!==i&&As(t,f,i)}else for(var m in n)n.hasOwnProperty(m)&&As(t,m,n[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 Ds=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"]]),ba=/^[\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 on(t){return ba.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function la(){}var Da=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 Di(t){var n=at(t);if(n&&(t=n.stateNode)){var l=t[Ce]||null;e:switch(t=n.stateNode,n.type){case"input":if(Zl(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var i=l[n];if(i!==t&&i.form===t.form){var f=i[Ce]||null;if(!f)throw Error(s(90));Zl(i,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)i=l[n],i.form===t.form&&_r(i)}break e;case"textarea":dc(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&xr(t,!!l.multiple,n,!1)}}}var br=!1;function Ci(t,n,l){if(br)return t(n,l);br=!0;try{var i=t(n);return i}finally{if(br=!1,(yr!==null||zr!==null)&&(Wc(),yr&&(n=yr,t=zr,zr=yr=null,Di(n),t)))for(n=0;n<t.length;n++)Di(t[n])}}function qa(t,n){var l=t.stateNode;if(l===null)return null;var i=l[Ce]||null;if(i===null)return null;l=i[n];e:switch(n){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,n,typeof l));return l}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oi=!1;if(sr)try{var $r={};Object.defineProperty($r,"passive",{get:function(){Oi=!0}}),window.addEventListener("test",$r,$r),window.removeEventListener("test",$r,$r)}catch{Oi=!1}var Pa=null,Mi=null,Cs=null;function fc(){if(Cs)return Cs;var t,n=Mi,l=n.length,i,f="value"in Pa?Pa.value:Pa.textContent,m=f.length;for(t=0;t<l&&n[t]===f[t];t++);var b=l-t;for(i=1;i<=b&&n[l-i]===f[m-i];i++);return Cs=f.slice(t,1<i?1-i:void 0)}function Os(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Ur(){return!0}function hc(){return!1}function sa(t){function n(l,i,f,m,b){this._reactName=l,this._targetInst=f,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)?Ur:hc,this.isPropagationStopped=hc,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ur)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ur)},persist:function(){},isPersistent:Ur}),n}var Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ir=sa(Br),Jl=x({},Br,{view:0,detail:0}),Dd=sa(Jl),ml,es,ts,Hr=x({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oa,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"?(ml=t.screenX-ts.screenX,es=t.screenY-ts.screenY):es=ml=0,ts=t),ml)},movementY:function(t){return"movementY"in t?t.movementY:es}}),mc=sa(Hr),k=x({},Hr,{dataTransfer:0}),X=sa(k),Ee=x({},Jl,{relatedTarget:0}),ye=sa(Ee),Xe=x({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),ue=sa(Xe),ve=x({},Br,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),we=sa(ve),et=x({},Br,{data:0}),it=sa(et),He={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Rn={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"},Ht={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ia(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Ht[t])?!!n[t]:!1}function oa(){return ia}var wa=x({},Jl,{key:function(t){if(t.key){var n=He[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Os(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Rn[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oa,charCode:function(t){return t.type==="keypress"?Os(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Os(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kn=sa(wa),mn=x({},Hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qt=sa(mn),ns=x({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oa}),wr=sa(ns),Cd=x({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),pc=sa(Cd),gc=x({},Hr,{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=sa(gc),Md=x({},Br,{newState:0,oldState:0}),Bw=sa(Md),Iw=[9,13,27,32],_d=sr&&"CompositionEvent"in window,_i=null;sr&&"documentMode"in document&&(_i=document.documentMode);var Hw=sr&&"TextEvent"in window&&!_i,Sp=sr&&(!_d||_i&&8<_i&&11>=_i),Ep=" ",Np=!1;function jp(t,n){switch(t){case"keyup":return Iw.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ms=!1;function qw(t,n){switch(t){case"compositionend":return Rp(n);case"keypress":return n.which!==32?null:(Np=!0,Ep);case"textInput":return t=n.data,t===Ep&&Np?null:t;default:return null}}function Pw(t,n){if(Ms)return t==="compositionend"||!_d&&jp(t,n)?(t=fc(),Cs=Mi=Pa=null,Ms=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Sp&&n.locale!=="ko"?null:n.data;default:return null}}var Fw={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 kp(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Fw[t.type]:n==="textarea"}function Tp(t,n,l,i){yr?zr?zr.push(i):zr=[i]:yr=i,n=lu(n,"onChange"),0<n.length&&(l=new Ir("onChange","change",null,l,i),t.push({event:l,listeners:n}))}var Li=null,zi=null;function Vw(t){ux(t,0)}function vc(t){var n=mt(t);if(_r(n))return t}function Ap(t,n){if(t==="change")return n}var Dp=!1;if(sr){var Ld;if(sr){var zd="oninput"in document;if(!zd){var Cp=document.createElement("div");Cp.setAttribute("oninput","return;"),zd=typeof Cp.oninput=="function"}Ld=zd}else Ld=!1;Dp=Ld&&(!document.documentMode||9<document.documentMode)}function Op(){Li&&(Li.detachEvent("onpropertychange",Mp),zi=Li=null)}function Mp(t){if(t.propertyName==="value"&&vc(zi)){var n=[];Tp(n,zi,t,Lr(t)),Ci(Vw,n)}}function Yw(t,n,l){t==="focusin"?(Op(),Li=n,zi=l,Li.attachEvent("onpropertychange",Mp)):t==="focusout"&&Op()}function Gw(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return vc(zi)}function Xw(t,n){if(t==="click")return vc(n)}function Qw(t,n){if(t==="input"||t==="change")return vc(n)}function Kw(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ca=typeof Object.is=="function"?Object.is:Kw;function $i(t,n){if(Ca(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),i=Object.keys(n);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var f=l[i];if(!Ct.call(n,f)||!Ca(t[f],n[f]))return!1}return!0}function _p(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Lp(t,n){var l=_p(t);t=0;for(var i;l;){if(l.nodeType===3){if(i=t+l.textContent.length,t<=n&&i>=n)return{node:l,offset:n-t};t=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=_p(l)}}function zp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?zp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function $p(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=At(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=At(t.document)}return n}function $d(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Zw=sr&&"documentMode"in document&&11>=document.documentMode,_s=null,Ud=null,Ui=null,Bd=!1;function Up(t,n,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Bd||_s==null||_s!==At(i)||(i=_s,"selectionStart"in i&&$d(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&&$i(Ui,i)||(Ui=i,i=lu(Ud,"onSelect"),0<i.length&&(n=new Ir("onSelect","select",null,n,l),t.push({event:n,listeners:i}),n.target=_s)))}function as(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Ls={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},Id={},Bp={};sr&&(Bp=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function rs(t){if(Id[t])return Id[t];if(!Ls[t])return t;var n=Ls[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Bp)return Id[t]=n[l];return t}var Ip=rs("animationend"),Hp=rs("animationiteration"),qp=rs("animationstart"),Ww=rs("transitionrun"),Jw=rs("transitionstart"),e1=rs("transitioncancel"),Pp=rs("transitionend"),Fp=new Map,Hd="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(" ");Hd.push("scrollEnd");function ir(t,n){Fp.set(t,n),jn(n,[t])}var xc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Fa=[],zs=0,qd=0;function yc(){for(var t=zs,n=qd=zs=0;n<t;){var l=Fa[n];Fa[n++]=null;var i=Fa[n];Fa[n++]=null;var f=Fa[n];Fa[n++]=null;var m=Fa[n];if(Fa[n++]=null,i!==null&&f!==null){var b=i.pending;b===null?f.next=f:(f.next=b.next,b.next=f),i.pending=f}m!==0&&Vp(l,f,m)}}function bc(t,n,l,i){Fa[zs++]=t,Fa[zs++]=n,Fa[zs++]=l,Fa[zs++]=i,qd|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Pd(t,n,l,i){return bc(t,n,l,i),wc(t)}function ls(t,n){return bc(t,null,null,n),wc(t)}function Vp(t,n,l){t.lanes|=l;var i=t.alternate;i!==null&&(i.lanes|=l);for(var f=!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||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&n!==null&&(f=31-en(l),t=m.hiddenUpdates,i=t[f],i===null?t[f]=[n]:i.push(n),n.lane=l|536870912),m):null}function wc(t){if(50<so)throw so=0,Jf=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var $s={};function t1(t,n,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=n,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 Oa(t,n,l,i){return new t1(t,n,l,i)}function Fd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qr(t,n){var l=t.alternate;return l===null?(l=Oa(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,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,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Yp(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,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,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Sc(t,n,l,i,f,m){var b=0;if(i=t,typeof t=="function")Fd(t)&&(b=1);else if(typeof t=="string")b=sS(t,l,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case de:return t=Oa(31,l,n,f),t.elementType=de,t.lanes=m,t;case j:return ss(l.children,f,m,n);case R:b=8,f|=24;break;case L:return t=Oa(12,l,n,f|2),t.elementType=L,t.lanes=m,t;case W:return t=Oa(13,l,n,f),t.elementType=W,t.lanes=m,t;case ne:return t=Oa(19,l,n,f),t.elementType=ne,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case I:b=10;break e;case B:b=9;break e;case F:b=11;break e;case _: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 n=Oa(b,l,n,f),n.elementType=t,n.type=i,n.lanes=m,n}function ss(t,n,l,i){return t=Oa(7,t,i,n),t.lanes=l,t}function Vd(t,n,l){return t=Oa(6,t,null,n),t.lanes=l,t}function Gp(t){var n=Oa(18,null,null,0);return n.stateNode=t,n}function Yd(t,n,l){return n=Oa(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Xp=new WeakMap;function Va(t,n){if(typeof t=="object"&&t!==null){var l=Xp.get(t);return l!==void 0?l:(n={value:t,source:n,stack:yn(n)},Xp.set(t,n),n)}return{value:t,source:n,stack:yn(n)}}var Us=[],Bs=0,Ec=null,Bi=0,Ya=[],Ga=0,pl=null,Sr=1,Er="";function Pr(t,n){Us[Bs++]=Bi,Us[Bs++]=Ec,Ec=t,Bi=n}function Qp(t,n,l){Ya[Ga++]=Sr,Ya[Ga++]=Er,Ya[Ga++]=pl,pl=t;var i=Sr;t=Er;var f=32-en(i)-1;i&=~(1<<f),l+=1;var m=32-en(n)+f;if(30<m){var b=f-f%5;m=(i&(1<<b)-1).toString(32),i>>=b,f-=b,Sr=1<<32-en(n)+f|l<<f|i,Er=m+t}else Sr=1<<m|l<<f|i,Er=t}function Gd(t){t.return!==null&&(Pr(t,1),Qp(t,1,0))}function Xd(t){for(;t===Ec;)Ec=Us[--Bs],Us[Bs]=null,Bi=Us[--Bs],Us[Bs]=null;for(;t===pl;)pl=Ya[--Ga],Ya[Ga]=null,Er=Ya[--Ga],Ya[Ga]=null,Sr=Ya[--Ga],Ya[Ga]=null}function Kp(t,n){Ya[Ga++]=Sr,Ya[Ga++]=Er,Ya[Ga++]=pl,Sr=n.id,Er=n.overflow,pl=t}var Wn=null,cn=null,kt=!1,gl=null,Xa=!1,Qd=Error(s(519));function vl(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ii(Va(n,t)),Qd}function Zp(t){var n=t.stateNode,l=t.type,i=t.memoizedProps;switch(n[xe]=t,n[Ce]=i,l){case"dialog":xt("cancel",n),xt("close",n);break;case"iframe":case"object":case"embed":xt("load",n);break;case"video":case"audio":for(l=0;l<oo.length;l++)xt(oo[l],n);break;case"source":xt("error",n);break;case"img":case"image":case"link":xt("error",n),xt("load",n);break;case"details":xt("toggle",n);break;case"input":xt("invalid",n),Ai(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":xt("invalid",n);break;case"textarea":xt("invalid",n),lr(n,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||i.suppressHydrationWarning===!0||mx(n.textContent,l)?(i.popover!=null&&(xt("beforetoggle",n),xt("toggle",n)),i.onScroll!=null&&xt("scroll",n),i.onScrollEnd!=null&&xt("scrollend",n),i.onClick!=null&&(n.onclick=la),n=!0):n=!1,n||vl(t,!0)}function Wp(t){for(Wn=t.return;Wn;)switch(Wn.tag){case 5:case 31:case 13:Xa=!1;return;case 27:case 3:Xa=!0;return;default:Wn=Wn.return}}function Is(t){if(t!==Wn)return!1;if(!kt)return Wp(t),kt=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||mh(t.type,t.memoizedProps)),l=!l),l&&cn&&vl(t),Wp(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));cn=Ex(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));cn=Ex(t)}else n===27?(n=cn,Cl(t.type)?(t=yh,yh=null,cn=t):cn=n):cn=Wn?Ka(t.stateNode.nextSibling):null;return!0}function is(){cn=Wn=null,kt=!1}function Kd(){var t=gl;return t!==null&&(ja===null?ja=t:ja.push.apply(ja,t),gl=null),t}function Ii(t){gl===null?gl=[t]:gl.push(t)}var Zd=A(null),os=null,Fr=null;function xl(t,n,l){G(Zd,n._currentValue),n._currentValue=l}function Vr(t){t._currentValue=Zd.current,C(Zd)}function Wd(t,n,l){for(;t!==null;){var i=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),t===l)break;t=t.return}}function Jd(t,n,l,i){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var N=m;m=f;for(var O=0;O<n.length;O++)if(N.context===n[O]){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(f.tag===18){if(b=f.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=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===t){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Hs(t,n,l,i){t=null;for(var f=n,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var N=f.type;Ca(f.pendingProps.value,b.value)||(t!==null?t.push(N):t=[N])}}else if(f===Re.current){if(b=f.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(mo):t=[mo])}f=f.return}t!==null&&Jd(n,t,l,i),n.flags|=262144}function Nc(t){for(t=t.firstContext;t!==null;){if(!Ca(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 Jn(t){return Jp(os,t)}function jc(t,n){return os===null&&cs(t),Jp(t,n)}function Jp(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Fr===null){if(t===null)throw Error(s(308));Fr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Fr=Fr.next=n;return l}var n1=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,i){t.push(i)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},a1=e.unstable_scheduleCallback,r1=e.unstable_NormalPriority,Tn={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ef(){return{controller:new n1,data:new Map,refCount:0}}function Hi(t){t.refCount--,t.refCount===0&&a1(r1,function(){t.controller.abort()})}var qi=null,tf=0,qs=0,Ps=null;function l1(t,n){if(qi===null){var l=qi=[];tf=0,qs=lh(),Ps={status:"pending",value:void 0,then:function(i){l.push(i)}}}return tf++,n.then(eg,eg),n}function eg(){if(--tf===0&&qi!==null){Ps!==null&&(Ps.status="fulfilled");var t=qi;qi=null,qs=0,Ps=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function s1(t,n){var l=[],i={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){i.status="fulfilled",i.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(i.status="rejected",i.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),i}var tg=$.S;$.S=function(t,n){Uv=ln(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&l1(t,n),tg!==null&&tg(t,n)};var us=A(null);function nf(){var t=us.current;return t!==null?t:rn.pooledCache}function Rc(t,n){n===null?G(us,us.current):G(us,n.pool)}function ng(){var t=nf();return t===null?null:{parent:Tn._currentValue,pool:t}}var Fs=Error(s(460)),af=Error(s(474)),kc=Error(s(542)),Tc={then:function(){}};function ag(t){return t=t.status,t==="fulfilled"||t==="rejected"}function rg(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(la,la),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,sg(t),t;default:if(typeof n.status=="string")n.then(la,la);else{if(t=rn,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(i){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=i}},function(i){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,sg(t),t}throw fs=n,Fs}}function ds(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(fs=l,Fs):l}}var fs=null;function lg(){if(fs===null)throw Error(s(459));var t=fs;return fs=null,t}function sg(t){if(t===Fs||t===kc)throw Error(s(483))}var Vs=null,Pi=0;function Ac(t){var n=Pi;return Pi+=1,Vs===null&&(Vs=[]),rg(Vs,t,n)}function Fi(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Dc(t,n){throw n.$$typeof===E?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function ig(t){function n(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;)n(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 f(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=f(U,V),U.return=H,U)}function O(H,U,V,le){var Pe=V.type;return Pe===j?te(H,U,V.props.children,le,V.key):U!==null&&(U.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===T&&ds(Pe)===U.type)?(U=f(U,V.props),Fi(U,V),U.return=H,U):(U=Sc(V.type,V.key,V.props,null,H.mode,le),Fi(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=f(U,V.children||[]),U.return=H,U)}function te(H,U,V,le,Pe){return U===null||U.tag!==7?(U=ss(V,H.mode,le,Pe),U.return=H,U):(U=f(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=Sc(U.type,U.key,U.props,null,H.mode,V),Fi(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(J(U)||re(U))return U=ss(U,H.mode,V,null),U.return=H,U;if(typeof U.then=="function")return oe(H,Ac(U),V);if(U.$$typeof===I)return oe(H,jc(H,U),V);Dc(H,U)}return null}function Q(H,U,V,le){var Pe=U!==null?U.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Pe!==null?null:N(H,U,""+V,le);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===Pe?O(H,U,V,le):null;case w:return V.key===Pe?Y(H,U,V,le):null;case T:return V=ds(V),Q(H,U,V,le)}if(J(V)||re(V))return Pe!==null?null:te(H,U,V,le,null);if(typeof V.then=="function")return Q(H,U,Ac(V),le);if(V.$$typeof===I)return Q(H,U,jc(H,V),le);Dc(H,V)}return null}function K(H,U,V,le,Pe){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(V)||null,N(U,H,""+le,Pe);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case S:return H=H.get(le.key===null?V:le.key)||null,O(U,H,le,Pe);case w:return H=H.get(le.key===null?V:le.key)||null,Y(U,H,le,Pe);case T:return le=ds(le),K(H,U,V,le,Pe)}if(J(le)||re(le))return H=H.get(V)||null,te(U,H,le,Pe,null);if(typeof le.then=="function")return K(H,U,V,Ac(le),Pe);if(le.$$typeof===I)return K(H,U,V,jc(U,le),Pe);Dc(U,le)}return null}function Me(H,U,V,le){for(var Pe=null,Lt=null,Ue=U,ht=U=0,Nt=null;Ue!==null&&ht<V.length;ht++){Ue.index>ht?(Nt=Ue,Ue=null):Nt=Ue.sibling;var zt=Q(H,Ue,V[ht],le);if(zt===null){Ue===null&&(Ue=Nt);break}t&&Ue&&zt.alternate===null&&n(H,Ue),U=m(zt,U,ht),Lt===null?Pe=zt:Lt.sibling=zt,Lt=zt,Ue=Nt}if(ht===V.length)return l(H,Ue),kt&&Pr(H,ht),Pe;if(Ue===null){for(;ht<V.length;ht++)Ue=oe(H,V[ht],le),Ue!==null&&(U=m(Ue,U,ht),Lt===null?Pe=Ue:Lt.sibling=Ue,Lt=Ue);return kt&&Pr(H,ht),Pe}for(Ue=i(Ue);ht<V.length;ht++)Nt=K(Ue,H,ht,V[ht],le),Nt!==null&&(t&&Nt.alternate!==null&&Ue.delete(Nt.key===null?ht:Nt.key),U=m(Nt,U,ht),Lt===null?Pe=Nt:Lt.sibling=Nt,Lt=Nt);return t&&Ue.forEach(function(zl){return n(H,zl)}),kt&&Pr(H,ht),Pe}function Ge(H,U,V,le){if(V==null)throw Error(s(151));for(var Pe=null,Lt=null,Ue=U,ht=U=0,Nt=null,zt=V.next();Ue!==null&&!zt.done;ht++,zt=V.next()){Ue.index>ht?(Nt=Ue,Ue=null):Nt=Ue.sibling;var zl=Q(H,Ue,zt.value,le);if(zl===null){Ue===null&&(Ue=Nt);break}t&&Ue&&zl.alternate===null&&n(H,Ue),U=m(zl,U,ht),Lt===null?Pe=zl:Lt.sibling=zl,Lt=zl,Ue=Nt}if(zt.done)return l(H,Ue),kt&&Pr(H,ht),Pe;if(Ue===null){for(;!zt.done;ht++,zt=V.next())zt=oe(H,zt.value,le),zt!==null&&(U=m(zt,U,ht),Lt===null?Pe=zt:Lt.sibling=zt,Lt=zt);return kt&&Pr(H,ht),Pe}for(Ue=i(Ue);!zt.done;ht++,zt=V.next())zt=K(Ue,H,ht,zt.value,le),zt!==null&&(t&&zt.alternate!==null&&Ue.delete(zt.key===null?ht:zt.key),U=m(zt,U,ht),Lt===null?Pe=zt:Lt.sibling=zt,Lt=zt);return t&&Ue.forEach(function(vS){return n(H,vS)}),kt&&Pr(H,ht),Pe}function Zt(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 Pe=V.key;U!==null;){if(U.key===Pe){if(Pe=V.type,Pe===j){if(U.tag===7){l(H,U.sibling),le=f(U,V.props.children),le.return=H,H=le;break e}}else if(U.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===T&&ds(Pe)===U.type){l(H,U.sibling),le=f(U,V.props),Fi(le,V),le.return=H,H=le;break e}l(H,U);break}else n(H,U);U=U.sibling}V.type===j?(le=ss(V.props.children,H.mode,le,V.key),le.return=H,H=le):(le=Sc(V.type,V.key,V.props,null,H.mode,le),Fi(le,V),le.return=H,H=le)}return b(H);case w:e:{for(Pe=V.key;U!==null;){if(U.key===Pe)if(U.tag===4&&U.stateNode.containerInfo===V.containerInfo&&U.stateNode.implementation===V.implementation){l(H,U.sibling),le=f(U,V.children||[]),le.return=H,H=le;break e}else{l(H,U);break}else n(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),Zt(H,U,V,le)}if(J(V))return Me(H,U,V,le);if(re(V)){if(Pe=re(V),typeof Pe!="function")throw Error(s(150));return V=Pe.call(V),Ge(H,U,V,le)}if(typeof V.then=="function")return Zt(H,U,Ac(V),le);if(V.$$typeof===I)return Zt(H,U,jc(H,V),le);Dc(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=f(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{Pi=0;var Pe=Zt(H,U,V,le);return Vs=null,Pe}catch(Ue){if(Ue===Fs||Ue===kc)throw Ue;var Lt=Oa(29,Ue,null,H.mode);return Lt.lanes=le,Lt.return=H,Lt}finally{}}}var hs=ig(!0),og=ig(!1),yl=!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,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function bl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function wl(t,n,l){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Ut&2)!==0){var f=i.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),i.pending=n,n=wc(t),Vp(t,null,l),n}return bc(t,i,n,l),wc(t)}function Vi(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var i=n.lanes;i&=t.pendingLanes,l|=i,n.lanes=l,Ln(t,l)}}function sf(t,n){var l=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var f=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?f=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?f=m=n:m=m.next=n}else f=m=n;l={baseState:i.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var of=!1;function Yi(){if(of){var t=Ps;if(t!==null)throw t}}function Gi(t,n,l,i){of=!1;var f=t.updateQueue;yl=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,N=f.shared.pending;if(N!==null){f.shared.pending=null;var O=N,Y=O.next;O.next=null,b===null?m=Y:b.next=Y,b=O;var te=t.alternate;te!==null&&(te=te.updateQueue,N=te.lastBaseUpdate,N!==b&&(N===null?te.firstBaseUpdate=Y:N.next=Y,te.lastBaseUpdate=O))}if(m!==null){var oe=f.baseState;b=0,te=Y=O=null,N=m;do{var Q=N.lane&-536870913,K=Q!==N.lane;if(K?(Et&Q)===Q:(i&Q)===Q){Q!==0&&Q===qs&&(of=!0),te!==null&&(te=te.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Me=t,Ge=N;Q=n;var Zt=l;switch(Ge.tag){case 1:if(Me=Ge.payload,typeof Me=="function"){oe=Me.call(Zt,oe,Q);break e}oe=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ge.payload,Q=typeof Me=="function"?Me.call(Zt,oe,Q):Me,Q==null)break e;oe=x({},oe,Q);break e;case 2:yl=!0}}Q=N.callback,Q!==null&&(t.flags|=64,K&&(t.flags|=8192),K=f.callbacks,K===null?f.callbacks=[Q]:K.push(Q))}else K={lane:Q,tag:N.tag,payload:N.payload,callback:N.callback,next:null},te===null?(Y=te=K,O=oe):te=te.next=K,b|=Q;if(N=N.next,N===null){if(N=f.shared.pending,N===null)break;K=N,N=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);te===null&&(O=oe),f.baseState=O,f.firstBaseUpdate=Y,f.lastBaseUpdate=te,m===null&&(f.shared.lanes=0),Rl|=b,t.lanes=b,t.memoizedState=oe}}function cg(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function ug(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)cg(l[t],n)}var Ys=A(null),Cc=A(0);function dg(t,n){t=el,G(Cc,t),G(Ys,n),el=t|n.baseLanes}function cf(){G(Cc,el),G(Ys,Ys.current)}function uf(){el=Cc.current,C(Ys),C(Cc)}var Ma=A(null),Qa=null;function Sl(t){var n=t.alternate;G(wn,wn.current&1),G(Ma,t),Qa===null&&(n===null||Ys.current!==null||n.memoizedState!==null)&&(Qa=t)}function df(t){G(wn,wn.current),G(Ma,t),Qa===null&&(Qa=t)}function fg(t){t.tag===22?(G(wn,wn.current),G(Ma,t),Qa===null&&(Qa=t)):El()}function El(){G(wn,wn.current),G(Ma,Ma.current)}function _a(t){C(Ma),Qa===t&&(Qa=null),C(wn)}var wn=A(0);function Oc(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vh(l)||xh(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Yr=0,ct=null,Qt=null,An=null,Mc=!1,Gs=!1,ms=!1,_c=0,Xi=0,Xs=null,i1=0;function gn(){throw Error(s(321))}function ff(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!Ca(t[l],n[l]))return!1;return!0}function hf(t,n,l,i,f,m){return Yr=m,ct=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=t===null||t.memoizedState===null?Qg:Tf,ms=!1,m=l(i,f),ms=!1,Gs&&(m=mg(n,l,i,f)),hg(t),m}function hg(t){$.H=Zi;var n=Qt!==null&&Qt.next!==null;if(Yr=0,An=Qt=ct=null,Mc=!1,Xi=0,Xs=null,n)throw Error(s(300));t===null||Dn||(t=t.dependencies,t!==null&&Nc(t)&&(Dn=!0))}function mg(t,n,l,i){ct=t;var f=0;do{if(Gs&&(Xs=null),Xi=0,Gs=!1,25<=f)throw Error(s(301));if(f+=1,An=Qt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}$.H=Kg,m=n(l,i)}while(Gs);return m}function o1(){var t=$.H,n=t.useState()[0];return n=typeof n.then=="function"?Qi(n):n,t=t.useState()[0],(Qt!==null?Qt.memoizedState:null)!==t&&(ct.flags|=1024),n}function mf(){var t=_c!==0;return _c=0,t}function pf(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function gf(t){if(Mc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Mc=!1}Yr=0,An=Qt=ct=null,Gs=!1,Xi=_c=0,Xs=null}function ma(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?ct.memoizedState=An=t:An=An.next=t,An}function Sn(){if(Qt===null){var t=ct.alternate;t=t!==null?t.memoizedState:null}else t=Qt.next;var n=An===null?ct.memoizedState:An.next;if(n!==null)An=n,Qt=t;else{if(t===null)throw ct.alternate===null?Error(s(467)):Error(s(310));Qt=t,t={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},An===null?ct.memoizedState=An=t:An=An.next=t}return An}function Lc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qi(t){var n=Xi;return Xi+=1,Xs===null&&(Xs=[]),t=rg(Xs,t,n),n=ct,(An===null?n.memoizedState:An.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?Qg:Tf),t}function zc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Qi(t);if(t.$$typeof===I)return Jn(t)}throw Error(s(438,String(t)))}function vf(t){var n=null,l=ct.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var i=ct.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Lc(),ct.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),i=0;i<t;i++)l[i]=ge;return n.index++,l}function Gr(t,n){return typeof n=="function"?n(t):n}function $c(t){var n=Sn();return xf(n,Qt,t)}function xf(t,n,l){var i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=l;var f=t.baseQueue,m=i.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}n.baseQueue=f=m,i.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{n=f.next;var N=b=null,O=null,Y=n,te=!1;do{var oe=Y.lane&-536870913;if(oe!==Y.lane?(Et&oe)===oe:(Yr&oe)===oe){var Q=Y.revertLane;if(Q===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),oe===qs&&(te=!0);else if((Yr&Q)===Q){Y=Y.next,Q===qs&&(te=!0);continue}else oe={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},O===null?(N=O=oe,b=m):O=O.next=oe,ct.lanes|=Q,Rl|=Q;oe=Y.action,ms&&l(m,oe),m=Y.hasEagerState?Y.eagerState:l(m,oe)}else Q={lane:oe,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},O===null?(N=O=Q,b=m):O=O.next=Q,ct.lanes|=oe,Rl|=oe;Y=Y.next}while(Y!==null&&Y!==n);if(O===null?b=m:O.next=N,!Ca(m,t.memoizedState)&&(Dn=!0,te&&(l=Ps,l!==null)))throw l;t.memoizedState=m,t.baseState=b,t.baseQueue=O,i.lastRenderedState=m}return f===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function yf(t){var n=Sn(),l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=t;var i=l.dispatch,f=l.pending,m=n.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do m=t(m,b.action),b=b.next;while(b!==f);Ca(m,n.memoizedState)||(Dn=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),l.lastRenderedState=m}return[m,i]}function pg(t,n,l){var i=ct,f=Sn(),m=kt;if(m){if(l===void 0)throw Error(s(407));l=l()}else l=n();var b=!Ca((Qt||f).memoizedState,l);if(b&&(f.memoizedState=l,Dn=!0),f=f.queue,Sf(xg.bind(null,i,f,t),[t]),f.getSnapshot!==n||b||An!==null&&An.memoizedState.tag&1){if(i.flags|=2048,Qs(9,{destroy:void 0},vg.bind(null,i,f,l,n),null),rn===null)throw Error(s(349));m||(Yr&127)!==0||gg(i,n,l)}return l}function gg(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=ct.updateQueue,n===null?(n=Lc(),ct.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function vg(t,n,l,i){n.value=l,n.getSnapshot=i,yg(n)&&bg(t)}function xg(t,n,l){return l(function(){yg(n)&&bg(t)})}function yg(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!Ca(t,l)}catch{return!0}}function bg(t){var n=ls(t,2);n!==null&&Ra(n,t,2)}function bf(t){var n=ma();if(typeof t=="function"){var l=t;if(t=l(),ms){Ot(!0);try{l()}finally{Ot(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:t},n}function wg(t,n,l,i){return t.baseState=l,xf(t,Qt,typeof i=="function"?i:Gr)}function c1(t,n,l,i,f){if(Ic(t))throw Error(s(485));if(t=n.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};$.T!==null?l(!0):m.isTransition=!1,i(m),l=n.pending,l===null?(m.next=n.pending=m,Sg(n,m)):(m.next=l.next,n.pending=l.next=m)}}function Sg(t,n){var l=n.action,i=n.payload,f=t.state;if(n.isTransition){var m=$.T,b={};$.T=b;try{var N=l(f,i),O=$.S;O!==null&&O(b,N),Eg(t,n,N)}catch(Y){wf(t,n,Y)}finally{m!==null&&b.types!==null&&(m.types=b.types),$.T=m}}else try{m=l(f,i),Eg(t,n,m)}catch(Y){wf(t,n,Y)}}function Eg(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){Ng(t,n,i)},function(i){return wf(t,n,i)}):Ng(t,n,l)}function Ng(t,n,l){n.status="fulfilled",n.value=l,jg(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Sg(t,l)))}function wf(t,n,l){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=l,jg(n),n=n.next;while(n!==i)}t.action=null}function jg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Rg(t,n){return n}function kg(t,n){if(kt){var l=rn.formState;if(l!==null){e:{var i=ct;if(kt){if(cn){t:{for(var f=cn,m=Xa;f.nodeType!==8;){if(!m){f=null;break t}if(f=Ka(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){cn=Ka(f.nextSibling),i=f.data==="F!";break e}}vl(i)}i=!1}i&&(n=l[0])}}return l=ma(),l.memoizedState=l.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rg,lastRenderedState:n},l.queue=i,l=Yg.bind(null,ct,i),i.dispatch=l,i=bf(!1),m=kf.bind(null,ct,!1,i.queue),i=ma(),f={state:n,dispatch:null,action:t,pending:null},i.queue=f,l=c1.bind(null,ct,f,m,l),f.dispatch=l,i.memoizedState=t,[n,l,!1]}function Tg(t){var n=Sn();return Ag(n,Qt,t)}function Ag(t,n,l){if(n=xf(t,n,Rg)[0],t=$c(Gr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=Qi(n)}catch(b){throw b===Fs?kc:b}else i=n;n=Sn();var f=n.queue,m=f.dispatch;return l!==n.memoizedState&&(ct.flags|=2048,Qs(9,{destroy:void 0},u1.bind(null,f,l),null)),[i,m,t]}function u1(t,n){t.action=n}function Dg(t){var n=Sn(),l=Qt;if(l!==null)return Ag(n,l,t);Sn(),n=n.memoizedState,l=Sn();var i=l.queue.dispatch;return l.memoizedState=t,[n,i,!1]}function Qs(t,n,l,i){return t={tag:t,create:l,deps:i,inst:n,next:null},n=ct.updateQueue,n===null&&(n=Lc(),ct.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(i=l.next,l.next=t,t.next=i,n.lastEffect=t),t}function Cg(){return Sn().memoizedState}function Uc(t,n,l,i){var f=ma();ct.flags|=t,f.memoizedState=Qs(1|n,{destroy:void 0},l,i===void 0?null:i)}function Bc(t,n,l,i){var f=Sn();i=i===void 0?null:i;var m=f.memoizedState.inst;Qt!==null&&i!==null&&ff(i,Qt.memoizedState.deps)?f.memoizedState=Qs(n,m,l,i):(ct.flags|=t,f.memoizedState=Qs(1|n,m,l,i))}function Og(t,n){Uc(8390656,8,t,n)}function Sf(t,n){Bc(2048,8,t,n)}function d1(t){ct.flags|=4;var n=ct.updateQueue;if(n===null)n=Lc(),ct.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function Mg(t){var n=Sn().memoizedState;return d1({ref:n,nextImpl:t}),function(){if((Ut&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function _g(t,n){return Bc(4,2,t,n)}function Lg(t,n){return Bc(4,4,t,n)}function zg(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function $g(t,n,l){l=l!=null?l.concat([t]):null,Bc(4,4,zg.bind(null,n,t),l)}function Ef(){}function Ug(t,n){var l=Sn();n=n===void 0?null:n;var i=l.memoizedState;return n!==null&&ff(n,i[1])?i[0]:(l.memoizedState=[t,n],t)}function Bg(t,n){var l=Sn();n=n===void 0?null:n;var i=l.memoizedState;if(n!==null&&ff(n,i[1]))return i[0];if(i=t(),ms){Ot(!0);try{t()}finally{Ot(!1)}}return l.memoizedState=[i,n],i}function Nf(t,n,l){return l===void 0||(Yr&1073741824)!==0&&(Et&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=Iv(),ct.lanes|=t,Rl|=t,l)}function Ig(t,n,l,i){return Ca(l,n)?l:Ys.current!==null?(t=Nf(t,l,i),Ca(t,n)||(Dn=!0),t):(Yr&42)===0||(Yr&1073741824)!==0&&(Et&261930)===0?(Dn=!0,t.memoizedState=l):(t=Iv(),ct.lanes|=t,Rl|=t,n)}function Hg(t,n,l,i,f){var m=P.p;P.p=m!==0&&8>m?m:8;var b=$.T,N={};$.T=N,kf(t,!1,n,l);try{var O=f(),Y=$.S;if(Y!==null&&Y(N,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var te=s1(O,i);Ki(t,n,te,$a(t))}else Ki(t,n,i,$a(t))}catch(oe){Ki(t,n,{then:function(){},status:"rejected",reason:oe},$a())}finally{P.p=m,b!==null&&N.types!==null&&(b.types=N.types),$.T=b}}function f1(){}function jf(t,n,l,i){if(t.tag!==5)throw Error(s(476));var f=qg(t).queue;Hg(t,f,n,ce,l===null?f1:function(){return Pg(t),l(i)})}function qg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:ce},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Pg(t){var n=qg(t);n.next===null&&(n=t.alternate.memoizedState),Ki(t,n.next.queue,{},$a())}function Rf(){return Jn(mo)}function Fg(){return Sn().memoizedState}function Vg(){return Sn().memoizedState}function h1(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=$a();t=bl(l);var i=wl(n,t,l);i!==null&&(Ra(i,n,l),Vi(i,n,l)),n={cache:ef()},t.payload=n;return}n=n.return}}function m1(t,n,l){var i=$a();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ic(t)?Gg(n,l):(l=Pd(t,n,l,i),l!==null&&(Ra(l,t,i),Xg(l,n,i)))}function Yg(t,n,l){var i=$a();Ki(t,n,l,i)}function Ki(t,n,l,i){var f={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ic(t))Gg(n,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var b=n.lastRenderedState,N=m(b,l);if(f.hasEagerState=!0,f.eagerState=N,Ca(N,b))return bc(t,n,f,0),rn===null&&yc(),!1}catch{}finally{}if(l=Pd(t,n,f,i),l!==null)return Ra(l,t,i),Xg(l,n,i),!0}return!1}function kf(t,n,l,i){if(i={lane:2,revertLane:lh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ic(t)){if(n)throw Error(s(479))}else n=Pd(t,l,i,2),n!==null&&Ra(n,t,2)}function Ic(t){var n=t.alternate;return t===ct||n!==null&&n===ct}function Gg(t,n){Gs=Mc=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function Xg(t,n,l){if((l&4194048)!==0){var i=n.lanes;i&=t.pendingLanes,l|=i,n.lanes=l,Ln(t,l)}}var Zi={readContext:Jn,use:zc,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useLayoutEffect:gn,useInsertionEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useSyncExternalStore:gn,useId:gn,useHostTransitionStatus:gn,useFormState:gn,useActionState:gn,useOptimistic:gn,useMemoCache:gn,useCacheRefresh:gn};Zi.useEffectEvent=gn;var Qg={readContext:Jn,use:zc,useCallback:function(t,n){return ma().memoizedState=[t,n===void 0?null:n],t},useContext:Jn,useEffect:Og,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Uc(4194308,4,zg.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Uc(4194308,4,t,n)},useInsertionEffect:function(t,n){Uc(4,2,t,n)},useMemo:function(t,n){var l=ma();n=n===void 0?null:n;var i=t();if(ms){Ot(!0);try{t()}finally{Ot(!1)}}return l.memoizedState=[i,n],i},useReducer:function(t,n,l){var i=ma();if(l!==void 0){var f=l(n);if(ms){Ot(!0);try{l(n)}finally{Ot(!1)}}}else f=n;return i.memoizedState=i.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},i.queue=t,t=t.dispatch=m1.bind(null,ct,t),[i.memoizedState,t]},useRef:function(t){var n=ma();return t={current:t},n.memoizedState=t},useState:function(t){t=bf(t);var n=t.queue,l=Yg.bind(null,ct,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Ef,useDeferredValue:function(t,n){var l=ma();return Nf(l,t,n)},useTransition:function(){var t=bf(!1);return t=Hg.bind(null,ct,t.queue,!0,!1),ma().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var i=ct,f=ma();if(kt){if(l===void 0)throw Error(s(407));l=l()}else{if(l=n(),rn===null)throw Error(s(349));(Et&127)!==0||gg(i,n,l)}f.memoizedState=l;var m={value:l,getSnapshot:n};return f.queue=m,Og(xg.bind(null,i,m,t),[t]),i.flags|=2048,Qs(9,{destroy:void 0},vg.bind(null,i,m,l,n),null),l},useId:function(){var t=ma(),n=rn.identifierPrefix;if(kt){var l=Er,i=Sr;l=(i&~(1<<32-en(i)-1)).toString(32)+l,n="_"+n+"R_"+l,l=_c++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=i1++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Rf,useFormState:kg,useActionState:kg,useOptimistic:function(t){var n=ma();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=kf.bind(null,ct,!0,l),l.dispatch=n,[t,n]},useMemoCache:vf,useCacheRefresh:function(){return ma().memoizedState=h1.bind(null,ct)},useEffectEvent:function(t){var n=ma(),l={impl:t};return n.memoizedState=l,function(){if((Ut&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Tf={readContext:Jn,use:zc,useCallback:Ug,useContext:Jn,useEffect:Sf,useImperativeHandle:$g,useInsertionEffect:_g,useLayoutEffect:Lg,useMemo:Bg,useReducer:$c,useRef:Cg,useState:function(){return $c(Gr)},useDebugValue:Ef,useDeferredValue:function(t,n){var l=Sn();return Ig(l,Qt.memoizedState,t,n)},useTransition:function(){var t=$c(Gr)[0],n=Sn().memoizedState;return[typeof t=="boolean"?t:Qi(t),n]},useSyncExternalStore:pg,useId:Fg,useHostTransitionStatus:Rf,useFormState:Tg,useActionState:Tg,useOptimistic:function(t,n){var l=Sn();return wg(l,Qt,t,n)},useMemoCache:vf,useCacheRefresh:Vg};Tf.useEffectEvent=Mg;var Kg={readContext:Jn,use:zc,useCallback:Ug,useContext:Jn,useEffect:Sf,useImperativeHandle:$g,useInsertionEffect:_g,useLayoutEffect:Lg,useMemo:Bg,useReducer:yf,useRef:Cg,useState:function(){return yf(Gr)},useDebugValue:Ef,useDeferredValue:function(t,n){var l=Sn();return Qt===null?Nf(l,t,n):Ig(l,Qt.memoizedState,t,n)},useTransition:function(){var t=yf(Gr)[0],n=Sn().memoizedState;return[typeof t=="boolean"?t:Qi(t),n]},useSyncExternalStore:pg,useId:Fg,useHostTransitionStatus:Rf,useFormState:Dg,useActionState:Dg,useOptimistic:function(t,n){var l=Sn();return Qt!==null?wg(l,Qt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:vf,useCacheRefresh:Vg};Kg.useEffectEvent=Mg;function Af(t,n,l,i){n=t.memoizedState,l=l(i,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Df={enqueueSetState:function(t,n,l){t=t._reactInternals;var i=$a(),f=bl(i);f.payload=n,l!=null&&(f.callback=l),n=wl(t,f,i),n!==null&&(Ra(n,t,i),Vi(n,t,i))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var i=$a(),f=bl(i);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=wl(t,f,i),n!==null&&(Ra(n,t,i),Vi(n,t,i))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=$a(),i=bl(l);i.tag=2,n!=null&&(i.callback=n),n=wl(t,i,l),n!==null&&(Ra(n,t,l),Vi(n,t,l))}};function Zg(t,n,l,i,f,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,m,b):n.prototype&&n.prototype.isPureReactComponent?!$i(l,i)||!$i(f,m):!0}function Wg(t,n,l,i){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,i),n.state!==t&&Df.enqueueReplaceState(n,n.state,null)}function ps(t,n){var l=n;if("ref"in n){l={};for(var i in n)i!=="ref"&&(l[i]=n[i])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Jg(t){xc(t)}function ev(t){console.error(t)}function tv(t){xc(t)}function Hc(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function nv(t,n,l){try{var i=t.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Cf(t,n,l){return l=bl(l),l.tag=3,l.payload={element:null},l.callback=function(){Hc(t,n)},l}function av(t){return t=bl(t),t.tag=3,t}function rv(t,n,l,i){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=i.value;t.payload=function(){return f(m)},t.callback=function(){nv(n,l,i)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){nv(n,l,i),typeof f!="function"&&(kl===null?kl=new Set([this]):kl.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function p1(t,n,l,i,f){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=l.alternate,n!==null&&Hs(n,l,f,!0),l=Ma.current,l!==null){switch(l.tag){case 31:case 13:return Qa===null?Jc():l.alternate===null&&vn===0&&(vn=3),l.flags&=-257,l.flags|=65536,l.lanes=f,i===Tc?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([i]):n.add(i),nh(t,i,f)),!1;case 22:return l.flags|=65536,i===Tc?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([i]):l.add(i)),nh(t,i,f)),!1}throw Error(s(435,l.tag))}return nh(t,i,f),Jc(),!1}if(kt)return n=Ma.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,i!==Qd&&(t=Error(s(422),{cause:i}),Ii(Va(t,l)))):(i!==Qd&&(n=Error(s(423),{cause:i}),Ii(Va(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,i=Va(i,l),f=Cf(t.stateNode,i,f),sf(t,f),vn!==4&&(vn=2)),!1;var m=Error(s(520),{cause:i});if(m=Va(m,l),lo===null?lo=[m]:lo.push(m),vn!==4&&(vn=2),n===null)return!0;i=Va(i,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Cf(l.stateNode,i,t),sf(l,t),!1;case 1:if(n=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(kl===null||!kl.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=av(f),rv(f,t,l,i),sf(l,f),!1}l=l.return}while(l!==null);return!1}var Of=Error(s(461)),Dn=!1;function ea(t,n,l,i){n.child=t===null?og(n,null,l,i):hs(n,t.child,l,i)}function lv(t,n,l,i,f){l=l.render;var m=n.ref;if("ref"in i){var b={};for(var N in i)N!=="ref"&&(b[N]=i[N])}else b=i;return cs(n),i=hf(t,n,l,b,m,f),N=mf(),t!==null&&!Dn?(pf(t,n,f),Xr(t,n,f)):(kt&&N&&Gd(n),n.flags|=1,ea(t,n,i,f),n.child)}function sv(t,n,l,i,f){if(t===null){var m=l.type;return typeof m=="function"&&!Fd(m)&&m.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=m,iv(t,n,m,i,f)):(t=Sc(l.type,null,i,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,!If(t,f)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:$i,l(b,i)&&t.ref===n.ref)return Xr(t,n,f)}return n.flags|=1,t=qr(m,i),t.ref=n.ref,t.return=n,n.child=t}function iv(t,n,l,i,f){if(t!==null){var m=t.memoizedProps;if($i(m,i)&&t.ref===n.ref)if(Dn=!1,n.pendingProps=i=m,If(t,f))(t.flags&131072)!==0&&(Dn=!0);else return n.lanes=t.lanes,Xr(t,n,f)}return Mf(t,n,l,i,f)}function ov(t,n,l,i){var f=i.children,m=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((n.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,t!==null){for(i=n.child=t.child,f=0;i!==null;)f=f|i.lanes|i.childLanes,i=i.sibling;i=f&~m}else i=0,n.child=null;return cv(t,n,m,l,i)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Rc(n,m!==null?m.cachePool:null),m!==null?dg(n,m):cf(),fg(n);else return i=n.lanes=536870912,cv(t,n,m!==null?m.baseLanes|l:l,l,i)}else m!==null?(Rc(n,m.cachePool),dg(n,m),El(),n.memoizedState=null):(t!==null&&Rc(n,null),cf(),El());return ea(t,n,f,l),n.child}function Wi(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function cv(t,n,l,i,f){var m=nf();return m=m===null?null:{parent:Tn._currentValue,pool:m},n.memoizedState={baseLanes:l,cachePool:m},t!==null&&Rc(n,null),cf(),fg(n),t!==null&&Hs(t,n,i,!0),n.childLanes=f,null}function qc(t,n){return n=Fc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function uv(t,n,l){return hs(n,t.child,null,l),t=qc(n,n.pendingProps),t.flags|=2,_a(n),n.memoizedState=null,t}function g1(t,n,l){var i=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(kt){if(i.mode==="hidden")return t=qc(n,i),n.lanes=536870912,Wi(null,t);if(df(n),(t=cn)?(t=Sx(t,Xa),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:pl!==null?{id:Sr,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},l=Gp(t),l.return=n,n.child=l,Wn=n,cn=null)):t=null,t===null)throw vl(n);return n.lanes=536870912,null}return qc(n,i)}var m=t.memoizedState;if(m!==null){var b=m.dehydrated;if(df(n),f)if(n.flags&256)n.flags&=-257,n=uv(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(Dn||Hs(t,n,l,!1),f=(l&t.childLanes)!==0,Dn||f){if(i=rn,i!==null&&(b=D(i,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,ls(t,b),Ra(i,t,b),Of;Jc(),n=uv(t,n,l)}else t=m.treeContext,cn=Ka(b.nextSibling),Wn=n,kt=!0,gl=null,Xa=!1,t!==null&&Kp(n,t),n=qc(n,i),n.flags|=4096;return n}return t=qr(t.child,{mode:i.mode,children:i.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Pc(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function Mf(t,n,l,i,f){return cs(n),l=hf(t,n,l,i,void 0,f),i=mf(),t!==null&&!Dn?(pf(t,n,f),Xr(t,n,f)):(kt&&i&&Gd(n),n.flags|=1,ea(t,n,l,f),n.child)}function dv(t,n,l,i,f,m){return cs(n),n.updateQueue=null,l=mg(n,i,l,f),hg(t),i=mf(),t!==null&&!Dn?(pf(t,n,m),Xr(t,n,m)):(kt&&i&&Gd(n),n.flags|=1,ea(t,n,l,m),n.child)}function fv(t,n,l,i,f){if(cs(n),n.stateNode===null){var m=$s,b=l.contextType;typeof b=="object"&&b!==null&&(m=Jn(b)),m=new l(i,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Df,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=i,m.state=n.memoizedState,m.refs={},rf(n),b=l.contextType,m.context=typeof b=="object"&&b!==null?Jn(b):$s,m.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Af(n,l,b,i),m.state=n.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&&Df.enqueueReplaceState(m,m.state,null),Gi(n,i,m,f),Yi(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(t===null){m=n.stateNode;var N=n.memoizedProps,O=ps(l,N);m.props=O;var Y=m.context,te=l.contextType;b=$s,typeof te=="object"&&te!==null&&(b=Jn(te));var oe=l.getDerivedStateFromProps;te=typeof oe=="function"||typeof m.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,te||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(N||Y!==b)&&Wg(n,m,i,b),yl=!1;var Q=n.memoizedState;m.state=Q,Gi(n,i,m,f),Yi(),Y=n.memoizedState,N||Q!==Y||yl?(typeof oe=="function"&&(Af(n,l,oe,i),Y=n.memoizedState),(O=yl||Zg(n,l,O,i,Q,Y,b))?(te||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"&&(n.flags|=4194308)):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=Y),m.props=i,m.state=Y,m.context=b,i=O):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{m=n.stateNode,lf(t,n),b=n.memoizedProps,te=ps(l,b),m.props=te,oe=n.pendingProps,Q=m.context,Y=l.contextType,O=$s,typeof Y=="object"&&Y!==null&&(O=Jn(Y)),N=l.getDerivedStateFromProps,(Y=typeof N=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==oe||Q!==O)&&Wg(n,m,i,O),yl=!1,Q=n.memoizedState,m.state=Q,Gi(n,i,m,f),Yi();var K=n.memoizedState;b!==oe||Q!==K||yl||t!==null&&t.dependencies!==null&&Nc(t.dependencies)?(typeof N=="function"&&(Af(n,l,N,i),K=n.memoizedState),(te=yl||Zg(n,l,te,i,Q,K,O)||t!==null&&t.dependencies!==null&&Nc(t.dependencies))?(Y||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,K,O),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,K,O)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=K),m.props=i,m.state=K,m.context=O,i=te):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),i=!1)}return m=i,Pc(t,n),i=(n.flags&128)!==0,m||i?(m=n.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,t!==null&&i?(n.child=hs(n,t.child,null,f),n.child=hs(n,null,l,f)):ea(t,n,l,f),n.memoizedState=m.state,t=n.child):t=Xr(t,n,f),t}function hv(t,n,l,i){return is(),n.flags|=256,ea(t,n,l,i),n.child}var _f={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lf(t){return{baseLanes:t,cachePool:ng()}}function zf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=za),t}function mv(t,n,l){var i=n.pendingProps,f=!1,m=(n.flags&128)!==0,b;if((b=m)||(b=t!==null&&t.memoizedState===null?!1:(wn.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,t===null){if(kt){if(f?Sl(n):El(),(t=cn)?(t=Sx(t,Xa),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:pl!==null?{id:Sr,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},l=Gp(t),l.return=n,n.child=l,Wn=n,cn=null)):t=null,t===null)throw vl(n);return xh(t)?n.lanes=32:n.lanes=536870912,null}var N=i.children;return i=i.fallback,f?(El(),f=n.mode,N=Fc({mode:"hidden",children:N},f),i=ss(i,f,l,null),N.return=n,i.return=n,N.sibling=i,n.child=N,i=n.child,i.memoizedState=Lf(l),i.childLanes=zf(t,b,l),n.memoizedState=_f,Wi(null,i)):(Sl(n),$f(n,N))}var O=t.memoizedState;if(O!==null&&(N=O.dehydrated,N!==null)){if(m)n.flags&256?(Sl(n),n.flags&=-257,n=Uf(t,n,l)):n.memoizedState!==null?(El(),n.child=t.child,n.flags|=128,n=null):(El(),N=i.fallback,f=n.mode,i=Fc({mode:"visible",children:i.children},f),N=ss(N,f,l,null),N.flags|=2,i.return=n,N.return=n,i.sibling=N,n.child=i,hs(n,t.child,null,l),i=n.child,i.memoizedState=Lf(l),i.childLanes=zf(t,b,l),n.memoizedState=_f,n=Wi(null,i));else if(Sl(n),xh(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var Y=b.dgst;b=Y,i=Error(s(419)),i.stack="",i.digest=b,Ii({value:i,source:null,stack:null}),n=Uf(t,n,l)}else if(Dn||Hs(t,n,l,!1),b=(l&t.childLanes)!==0,Dn||b){if(b=rn,b!==null&&(i=D(b,l),i!==0&&i!==O.retryLane))throw O.retryLane=i,ls(t,i),Ra(b,t,i),Of;vh(N)||Jc(),n=Uf(t,n,l)}else vh(N)?(n.flags|=192,n.child=t.child,n=null):(t=O.treeContext,cn=Ka(N.nextSibling),Wn=n,kt=!0,gl=null,Xa=!1,t!==null&&Kp(n,t),n=$f(n,i.children),n.flags|=4096);return n}return f?(El(),N=i.fallback,f=n.mode,O=t.child,Y=O.sibling,i=qr(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,Y!==null?N=qr(Y,N):(N=ss(N,f,l,null),N.flags|=2),N.return=n,i.return=n,i.sibling=N,n.child=i,Wi(null,i),i=n.child,N=t.child.memoizedState,N===null?N=Lf(l):(f=N.cachePool,f!==null?(O=Tn._currentValue,f=f.parent!==O?{parent:O,pool:O}:f):f=ng(),N={baseLanes:N.baseLanes|l,cachePool:f}),i.memoizedState=N,i.childLanes=zf(t,b,l),n.memoizedState=_f,Wi(t.child,i)):(Sl(n),l=t.child,t=l.sibling,l=qr(l,{mode:"visible",children:i.children}),l.return=n,l.sibling=null,t!==null&&(b=n.deletions,b===null?(n.deletions=[t],n.flags|=16):b.push(t)),n.child=l,n.memoizedState=null,l)}function $f(t,n){return n=Fc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Fc(t,n){return t=Oa(22,t,null,n),t.lanes=0,t}function Uf(t,n,l){return hs(n,t.child,null,l),t=$f(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function pv(t,n,l){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n),Wd(t.return,n,l)}function Bf(t,n,l,i,f,m){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:f,treeForkCount:m}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=l,b.tailMode=f,b.treeForkCount=m)}function gv(t,n,l){var i=n.pendingProps,f=i.revealOrder,m=i.tail;i=i.children;var b=wn.current,N=(b&2)!==0;if(N?(b=b&1|2,n.flags|=128):b&=1,G(wn,b),ea(t,n,i,l),i=kt?Bi:0,!N&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&pv(t,l,n);else if(t.tag===19)pv(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)t=l.alternate,t!==null&&Oc(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Bf(n,!1,f,l,m,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Oc(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}Bf(n,!0,l,null,m,i);break;case"together":Bf(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Xr(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),Rl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(Hs(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,l=qr(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=qr(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function If(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Nc(t)))}function v1(t,n,l){switch(n.tag){case 3:qe(n,n.stateNode.containerInfo),xl(n,Tn,t.memoizedState.cache),is();break;case 27:case 5:$e(n);break;case 4:qe(n,n.stateNode.containerInfo);break;case 10:xl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,df(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(Sl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?mv(t,n,l):(Sl(n),t=Xr(t,n,l),t!==null?t.sibling:null);Sl(n);break;case 19:var f=(t.flags&128)!==0;if(i=(l&n.childLanes)!==0,i||(Hs(t,n,l,!1),i=(l&n.childLanes)!==0),f){if(i)return gv(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),G(wn,wn.current),i)break;return null;case 22:return n.lanes=0,ov(t,n,l,n.pendingProps);case 24:xl(n,Tn,t.memoizedState.cache)}return Xr(t,n,l)}function vv(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Dn=!0;else{if(!If(t,l)&&(n.flags&128)===0)return Dn=!1,v1(t,n,l);Dn=(t.flags&131072)!==0}else Dn=!1,kt&&(n.flags&1048576)!==0&&Qp(n,Bi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(t=ds(n.elementType),n.type=t,typeof t=="function")Fd(t)?(i=ps(t,i),n.tag=1,n=fv(null,n,t,i,l)):(n.tag=0,n=Mf(null,n,t,i,l));else{if(t!=null){var f=t.$$typeof;if(f===F){n.tag=11,n=lv(null,n,t,i,l);break e}else if(f===_){n.tag=14,n=sv(null,n,t,i,l);break e}}throw n=Te(t)||t,Error(s(306,n,""))}}return n;case 0:return Mf(t,n,n.type,n.pendingProps,l);case 1:return i=n.type,f=ps(i,n.pendingProps),fv(t,n,i,f,l);case 3:e:{if(qe(n,n.stateNode.containerInfo),t===null)throw Error(s(387));i=n.pendingProps;var m=n.memoizedState;f=m.element,lf(t,n),Gi(n,i,null,l);var b=n.memoizedState;if(i=b.cache,xl(n,Tn,i),i!==m.cache&&Jd(n,[Tn],l,!0),Yi(),i=b.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=hv(t,n,i,l);break e}else if(i!==f){f=Va(Error(s(424)),n),Ii(f),n=hv(t,n,i,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(cn=Ka(t.firstChild),Wn=n,kt=!0,gl=null,Xa=!0,l=og(n,null,i,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(is(),i===f){n=Xr(t,n,l);break e}ea(t,n,i,l)}n=n.child}return n;case 26:return Pc(t,n),t===null?(l=Tx(n.type,null,n.pendingProps,null))?n.memoizedState=l:kt||(l=n.type,t=n.pendingProps,i=su(fe.current).createElement(l),i[xe]=n,i[Ce]=t,ta(i,l,t),pt(i),n.stateNode=i):n.memoizedState=Tx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return $e(n),t===null&&kt&&(i=n.stateNode=jx(n.type,n.pendingProps,fe.current),Wn=n,Xa=!0,f=cn,Cl(n.type)?(yh=f,cn=Ka(i.firstChild)):cn=f),ea(t,n,n.pendingProps.children,l),Pc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&kt&&((f=i=cn)&&(i=G1(i,n.type,n.pendingProps,Xa),i!==null?(n.stateNode=i,Wn=n,cn=Ka(i.firstChild),Xa=!1,f=!0):f=!1),f||vl(n)),$e(n),f=n.type,m=n.pendingProps,b=t!==null?t.memoizedProps:null,i=m.children,mh(f,m)?i=null:b!==null&&mh(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=hf(t,n,o1,null,null,l),mo._currentValue=f),Pc(t,n),ea(t,n,i,l),n.child;case 6:return t===null&&kt&&((t=l=cn)&&(l=X1(l,n.pendingProps,Xa),l!==null?(n.stateNode=l,Wn=n,cn=null,t=!0):t=!1),t||vl(n)),null;case 13:return mv(t,n,l);case 4:return qe(n,n.stateNode.containerInfo),i=n.pendingProps,t===null?n.child=hs(n,null,i,l):ea(t,n,i,l),n.child;case 11:return lv(t,n,n.type,n.pendingProps,l);case 7:return ea(t,n,n.pendingProps,l),n.child;case 8:return ea(t,n,n.pendingProps.children,l),n.child;case 12:return ea(t,n,n.pendingProps.children,l),n.child;case 10:return i=n.pendingProps,xl(n,n.type,i.value),ea(t,n,i.children,l),n.child;case 9:return f=n.type._context,i=n.pendingProps.children,cs(n),f=Jn(f),i=i(f),n.flags|=1,ea(t,n,i,l),n.child;case 14:return sv(t,n,n.type,n.pendingProps,l);case 15:return iv(t,n,n.type,n.pendingProps,l);case 19:return gv(t,n,l);case 31:return g1(t,n,l);case 22:return ov(t,n,l,n.pendingProps);case 24:return cs(n),i=Jn(Tn),t===null?(f=nf(),f===null&&(f=rn,m=ef(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),n.memoizedState={parent:i,cache:f},rf(n),xl(n,Tn,f)):((t.lanes&l)!==0&&(lf(t,n),Gi(n,null,null,l),Yi()),f=t.memoizedState,m=n.memoizedState,f.parent!==i?(f={parent:i,cache:i},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),xl(n,Tn,i)):(i=m.cache,xl(n,Tn,i),i!==f.cache&&Jd(n,[Tn],l,!0))),ea(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Qr(t){t.flags|=4}function Hf(t,n,l,i,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(Fv())t.flags|=8192;else throw fs=Tc,af}else t.flags&=-16777217}function xv(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Mx(n))if(Fv())t.flags|=8192;else throw fs=Tc,af}function Vc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?tn():536870912,t.lanes|=n,Js|=n)}function Ji(t,n){if(!kt)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.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?n||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function un(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,i=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,i|=f.subtreeFlags&65011712,i|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,i|=f.subtreeFlags,i|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=i,t.childLanes=l,n}function x1(t,n,l){var i=n.pendingProps;switch(Xd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(n),null;case 1:return un(n),null;case 3:return l=n.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Vr(Tn),Le(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Is(n)?Qr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kd())),un(n),null;case 26:var f=n.type,m=n.memoizedState;return t===null?(Qr(n),m!==null?(un(n),xv(n,m)):(un(n),Hf(n,f,null,i,l))):m?m!==t.memoizedState?(Qr(n),un(n),xv(n,m)):(un(n),n.flags&=-16777217):(t=t.memoizedProps,t!==i&&Qr(n),un(n),Hf(n,f,t,i,l)),null;case 27:if(jt(n),l=fe.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==i&&Qr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return un(n),null}t=ae.current,Is(n)?Zp(n):(t=jx(f,i,l),n.stateNode=t,Qr(n))}return un(n),null;case 5:if(jt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==i&&Qr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return un(n),null}if(m=ae.current,Is(n))Zp(n);else{var b=su(fe.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);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(f,{is:i.is}):b.createElement(f)}}m[xe]=n,m[Ce]=i;e:for(b=n.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===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=m;e:switch(ta(m,f,i),f){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Qr(n)}}return un(n),Hf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==i&&Qr(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(s(166));if(t=fe.current,Is(n)){if(t=n.stateNode,l=n.memoizedProps,i=null,f=Wn,f!==null)switch(f.tag){case 27:case 5:i=f.memoizedProps}t[xe]=n,t=!!(t.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||mx(t.nodeValue,l)),t||vl(n,!0)}else t=su(t).createTextNode(i),t[xe]=n,n.stateNode=t}return un(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(i=Is(n),l!==null){if(t===null){if(!i)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[xe]=n}else is(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;un(n),t=!1}else l=Kd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(_a(n),n):(_a(n),null);if((n.flags&128)!==0)throw Error(s(558))}return un(n),null;case 13:if(i=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Is(n),i!==null&&i.dehydrated!==null){if(t===null){if(!f)throw Error(s(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[xe]=n}else is(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;un(n),f=!1}else f=Kd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(_a(n),n):(_a(n),null)}return _a(n),(n.flags&128)!==0?(n.lanes=l,n):(l=i!==null,t=t!==null&&t.memoizedState!==null,l&&(i=n.child,f=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(f=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==f&&(i.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Vc(n,n.updateQueue),un(n),null);case 4:return Le(),t===null&&ch(n.stateNode.containerInfo),un(n),null;case 10:return Vr(n.type),un(n),null;case 19:if(C(wn),i=n.memoizedState,i===null)return un(n),null;if(f=(n.flags&128)!==0,m=i.rendering,m===null)if(f)Ji(i,!1);else{if(vn!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=Oc(t),m!==null){for(n.flags|=128,Ji(i,!1),t=m.updateQueue,n.updateQueue=t,Vc(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Yp(l,t),l=l.sibling;return G(wn,wn.current&1|2),kt&&Pr(n,i.treeForkCount),n.child}t=t.sibling}i.tail!==null&&ln()>Kc&&(n.flags|=128,f=!0,Ji(i,!1),n.lanes=4194304)}else{if(!f)if(t=Oc(m),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Vc(n,t),Ji(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!kt)return un(n),null}else 2*ln()-i.renderingStartTime>Kc&&l!==536870912&&(n.flags|=128,f=!0,Ji(i,!1),n.lanes=4194304);i.isBackwards?(m.sibling=n.child,n.child=m):(t=i.last,t!==null?t.sibling=m:n.child=m,i.last=m)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ln(),t.sibling=null,l=wn.current,G(wn,f?l&1|2:l&1),kt&&Pr(n,i.treeForkCount),t):(un(n),null);case 22:case 23:return _a(n),uf(),i=n.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(l&536870912)!==0&&(n.flags&128)===0&&(un(n),n.subtreeFlags&6&&(n.flags|=8192)):un(n),l=n.updateQueue,l!==null&&Vc(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==l&&(n.flags|=2048),t!==null&&C(us),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Vr(Tn),un(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function y1(t,n){switch(Xd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Vr(Tn),Le(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return jt(n),null;case 31:if(n.memoizedState!==null){if(_a(n),n.alternate===null)throw Error(s(340));is()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(_a(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));is()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return C(wn),null;case 4:return Le(),null;case 10:return Vr(n.type),null;case 22:case 23:return _a(n),uf(),t!==null&&C(us),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Vr(Tn),null;case 25:return null;default:return null}}function yv(t,n){switch(Xd(n),n.tag){case 3:Vr(Tn),Le();break;case 26:case 27:case 5:jt(n);break;case 4:Le();break;case 31:n.memoizedState!==null&&_a(n);break;case 13:_a(n);break;case 19:C(wn);break;case 10:Vr(n.type);break;case 22:case 23:_a(n),uf(),t!==null&&C(us);break;case 24:Vr(Tn)}}function eo(t,n){try{var l=n.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var f=i.next;l=f;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!==f)}}catch(N){Xt(n,n.return,N)}}function Nl(t,n,l){try{var i=n.updateQueue,f=i!==null?i.lastEffect:null;if(f!==null){var m=f.next;i=m;do{if((i.tag&t)===t){var b=i.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,f=n;var O=l,Y=N;try{Y()}catch(te){Xt(f,O,te)}}}i=i.next}while(i!==m)}}catch(te){Xt(n,n.return,te)}}function bv(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{ug(n,l)}catch(i){Xt(t,t.return,i)}}}function wv(t,n,l){l.props=ps(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(i){Xt(t,n,i)}}function to(t,n){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(f){Xt(t,n,f)}}function Nr(t,n){var l=t.ref,i=t.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(f){Xt(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){Xt(t,n,f)}else l.current=null}function Sv(t){var n=t.type,l=t.memoizedProps,i=t.stateNode;try{e:switch(n){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(f){Xt(t,t.return,f)}}function qf(t,n,l){try{var i=t.stateNode;H1(i,t.type,l,n),i[Ce]=n}catch(f){Xt(t,t.return,f)}}function Ev(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Cl(t.type)||t.tag===4}function Pf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ev(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&&Cl(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,n,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=la));else if(i!==4&&(i===27&&Cl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(Ff(t,n,l),t=t.sibling;t!==null;)Ff(t,n,l),t=t.sibling}function Yc(t,n,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(i!==4&&(i===27&&Cl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Yc(t,n,l),t=t.sibling;t!==null;)Yc(t,n,l),t=t.sibling}function Nv(t){var n=t.stateNode,l=t.memoizedProps;try{for(var i=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);ta(n,i,l),n[xe]=t,n[Ce]=l}catch(m){Xt(t,t.return,m)}}var Kr=!1,Cn=!1,Vf=!1,jv=typeof WeakSet=="function"?WeakSet:Set,Yn=null;function b1(t,n){if(t=t.containerInfo,fh=hu,t=$p(t),$d(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 f=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,N=-1,O=-1,Y=0,te=0,oe=t,Q=null;t:for(;;){for(var K;oe!==l||f!==0&&oe.nodeType!==3||(N=b+f),oe!==m||i!==0&&oe.nodeType!==3||(O=b+i),oe.nodeType===3&&(b+=oe.nodeValue.length),(K=oe.firstChild)!==null;)Q=oe,oe=K;for(;;){if(oe===t)break t;if(Q===l&&++Y===f&&(N=b),Q===m&&++te===i&&(O=b),(K=oe.nextSibling)!==null)break;oe=Q,Q=oe.parentNode}oe=K}l=N===-1||O===-1?null:{start:N,end:O}}else l=null}l=l||{start:0,end:0}}else l=null;for(hh={focusedElem:t,selectionRange:l},hu=!1,Yn=n;Yn!==null;)if(n=Yn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Yn=t;else for(;Yn!==null;){switch(n=Yn,m=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,l=n,f=m.memoizedProps,m=m.memoizedState,i=l.stateNode;try{var Me=ps(l.type,f);t=i.getSnapshotBeforeUpdate(Me,m),i.__reactInternalSnapshotBeforeUpdate=t}catch(Ge){Xt(l,l.return,Ge)}}break;case 3:if((t&1024)!==0){if(t=n.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=n.sibling,t!==null){t.return=n.return,Yn=t;break}Yn=n.return}}function Rv(t,n,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:Wr(t,l),i&4&&eo(5,l);break;case 1:if(Wr(t,l),i&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(b){Xt(l,l.return,b)}else{var f=ps(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(b){Xt(l,l.return,b)}}i&64&&bv(l),i&512&&to(l,l.return);break;case 3:if(Wr(t,l),i&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{ug(t,n)}catch(b){Xt(l,l.return,b)}}break;case 27:n===null&&i&4&&Nv(l);case 26:case 5:Wr(t,l),n===null&&i&4&&Sv(l),i&512&&to(l,l.return);break;case 12:Wr(t,l);break;case 31:Wr(t,l),i&4&&Av(t,l);break;case 13:Wr(t,l),i&4&&Dv(t,l),i&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=A1.bind(null,l),Q1(t,l))));break;case 22:if(i=l.memoizedState!==null||Kr,!i){n=n!==null&&n.memoizedState!==null||Cn,f=Kr;var m=Cn;Kr=i,(Cn=n)&&!m?Jr(t,l,(l.subtreeFlags&8772)!==0):Wr(t,l),Kr=f,Cn=m}break;case 30:break;default:Wr(t,l)}}function kv(t){var n=t.alternate;n!==null&&(t.alternate=null,kv(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Ve(n)),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 fn=null,Sa=!1;function Zr(t,n,l){for(l=l.child;l!==null;)Tv(t,n,l),l=l.sibling}function Tv(t,n,l){if(ee&&typeof ee.onCommitFiberUnmount=="function")try{ee.onCommitFiberUnmount(Fe,l)}catch{}switch(l.tag){case 26:Cn||Nr(l,n),Zr(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Cn||Nr(l,n);var i=fn,f=Sa;Cl(l.type)&&(fn=l.stateNode,Sa=!1),Zr(t,n,l),uo(l.stateNode),fn=i,Sa=f;break;case 5:Cn||Nr(l,n);case 6:if(i=fn,f=Sa,fn=null,Zr(t,n,l),fn=i,Sa=f,fn!==null)if(Sa)try{(fn.nodeType===9?fn.body:fn.nodeName==="HTML"?fn.ownerDocument.body:fn).removeChild(l.stateNode)}catch(m){Xt(l,n,m)}else try{fn.removeChild(l.stateNode)}catch(m){Xt(l,n,m)}break;case 18:fn!==null&&(Sa?(t=fn,bx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),ii(t)):bx(fn,l.stateNode));break;case 4:i=fn,f=Sa,fn=l.stateNode.containerInfo,Sa=!0,Zr(t,n,l),fn=i,Sa=f;break;case 0:case 11:case 14:case 15:Nl(2,l,n),Cn||Nl(4,l,n),Zr(t,n,l);break;case 1:Cn||(Nr(l,n),i=l.stateNode,typeof i.componentWillUnmount=="function"&&wv(l,n,i)),Zr(t,n,l);break;case 21:Zr(t,n,l);break;case 22:Cn=(i=Cn)||l.memoizedState!==null,Zr(t,n,l),Cn=i;break;default:Zr(t,n,l)}}function Av(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ii(t)}catch(l){Xt(n,n.return,l)}}}function Dv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ii(t)}catch(l){Xt(n,n.return,l)}}function w1(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new jv),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new jv),n;default:throw Error(s(435,t.tag))}}function Gc(t,n){var l=w1(t);n.forEach(function(i){if(!l.has(i)){l.add(i);var f=D1.bind(null,t,i);i.then(f,f)}})}function Ea(t,n){var l=n.deletions;if(l!==null)for(var i=0;i<l.length;i++){var f=l[i],m=t,b=n,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(Cl(N.type)){fn=N.stateNode,Sa=!1;break e}break;case 5:fn=N.stateNode,Sa=!1;break e;case 3:case 4:fn=N.stateNode.containerInfo,Sa=!0;break e}N=N.return}if(fn===null)throw Error(s(160));Tv(m,b,f),fn=null,Sa=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Cv(n,t),n=n.sibling}var or=null;function Cv(t,n){var l=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Ea(n,t),Na(t),i&4&&(Nl(3,t,t.return),eo(3,t),Nl(5,t,t.return));break;case 1:Ea(n,t),Na(t),i&512&&(Cn||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 f=or;if(Ea(n,t),Na(t),i&512&&(Cn||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,f=f.ownerDocument||f;t:switch(i){case"title":m=f.getElementsByTagName("title")[0],(!m||m[tt]||m[xe]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(i),f.head.insertBefore(m,f.querySelector("head > title"))),ta(m,i,l),m[xe]=t,pt(m),i=m;break e;case"link":var b=Cx("link","href",f).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=f.createElement(i),ta(m,i,l),f.head.appendChild(m);break;case"meta":if(b=Cx("meta","content",f).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=f.createElement(i),ta(m,i,l),f.head.appendChild(m);break;default:throw Error(s(468,i))}m[xe]=t,pt(m),i=m}t.stateNode=i}else Ox(f,t.type,t.stateNode);else t.stateNode=Dx(f,i,t.memoizedProps);else m!==i?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,i===null?Ox(f,t.type,t.stateNode):Dx(f,i,t.memoizedProps)):i===null&&t.stateNode!==null&&qf(t,t.memoizedProps,l.memoizedProps)}break;case 27:Ea(n,t),Na(t),i&512&&(Cn||l===null||Nr(l,l.return)),l!==null&&i&4&&qf(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Ea(n,t),Na(t),i&512&&(Cn||l===null||Nr(l,l.return)),t.flags&32){f=t.stateNode;try{hl(f,"")}catch(Me){Xt(t,t.return,Me)}}i&4&&t.stateNode!=null&&(f=t.memoizedProps,qf(t,f,l!==null?l.memoizedProps:f)),i&1024&&(Vf=!0);break;case 6:if(Ea(n,t),Na(t),i&4){if(t.stateNode===null)throw Error(s(162));i=t.memoizedProps,l=t.stateNode;try{l.nodeValue=i}catch(Me){Xt(t,t.return,Me)}}break;case 3:if(cu=null,f=or,or=iu(n.containerInfo),Ea(n,t),or=f,Na(t),i&4&&l!==null&&l.memoizedState.isDehydrated)try{ii(n.containerInfo)}catch(Me){Xt(t,t.return,Me)}Vf&&(Vf=!1,Ov(t));break;case 4:i=or,or=iu(t.stateNode.containerInfo),Ea(n,t),Na(t),or=i;break;case 12:Ea(n,t),Na(t);break;case 31:Ea(n,t),Na(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Gc(t,i)));break;case 13:Ea(n,t),Na(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Qc=ln()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Gc(t,i)));break;case 22:f=t.memoizedState!==null;var O=l!==null&&l.memoizedState!==null,Y=Kr,te=Cn;if(Kr=Y||f,Cn=te||O,Ea(n,t),Cn=te,Kr=Y,Na(t),i&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||O||Kr||Cn||gs(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){O=l=n;try{if(m=O.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=O.stateNode;var oe=O.memoizedProps.style,Q=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;N.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Me){Xt(O,O.return,Me)}}}else if(n.tag===6){if(l===null){O=n;try{O.stateNode.nodeValue=f?"":O.memoizedProps}catch(Me){Xt(O,O.return,Me)}}}else if(n.tag===18){if(l===null){O=n;try{var K=O.stateNode;f?wx(K,!0):wx(O.stateNode,!1)}catch(Me){Xt(O,O.return,Me)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=t.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,Gc(t,l))));break;case 19:Ea(n,t),Na(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Gc(t,i)));break;case 30:break;case 21:break;default:Ea(n,t),Na(t)}}function Na(t){var n=t.flags;if(n&2){try{for(var l,i=t.return;i!==null;){if(Ev(i)){l=i;break}i=i.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var f=l.stateNode,m=Pf(t);Yc(t,m,f);break;case 5:var b=l.stateNode;l.flags&32&&(hl(b,""),l.flags&=-33);var N=Pf(t);Yc(t,N,b);break;case 3:case 4:var O=l.stateNode.containerInfo,Y=Pf(t);Ff(t,Y,O);break;default:throw Error(s(161))}}catch(te){Xt(t,t.return,te)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Ov(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Ov(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Wr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Rv(t,n.alternate,n),n=n.sibling}function gs(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Nl(4,n,n.return),gs(n);break;case 1:Nr(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&wv(n,n.return,l),gs(n);break;case 27:uo(n.stateNode);case 26:case 5:Nr(n,n.return),gs(n);break;case 22:n.memoizedState===null&&gs(n);break;case 30:gs(n);break;default:gs(n)}t=t.sibling}}function Jr(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,f=t,m=n,b=m.flags;switch(m.tag){case 0:case 11:case 15:Jr(f,m,l),eo(4,m);break;case 1:if(Jr(f,m,l),i=m,f=i.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){Xt(i,i.return,Y)}if(i=m,f=i.updateQueue,f!==null){var N=i.stateNode;try{var O=f.shared.hiddenCallbacks;if(O!==null)for(f.shared.hiddenCallbacks=null,f=0;f<O.length;f++)cg(O[f],N)}catch(Y){Xt(i,i.return,Y)}}l&&b&64&&bv(m),to(m,m.return);break;case 27:Nv(m);case 26:case 5:Jr(f,m,l),l&&i===null&&b&4&&Sv(m),to(m,m.return);break;case 12:Jr(f,m,l);break;case 31:Jr(f,m,l),l&&b&4&&Av(f,m);break;case 13:Jr(f,m,l),l&&b&4&&Dv(f,m);break;case 22:m.memoizedState===null&&Jr(f,m,l),to(m,m.return);break;case 30:break;default:Jr(f,m,l)}n=n.sibling}}function Yf(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Hi(l))}function Gf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Hi(t))}function cr(t,n,l,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Mv(t,n,l,i),n=n.sibling}function Mv(t,n,l,i){var f=n.flags;switch(n.tag){case 0:case 11:case 15:cr(t,n,l,i),f&2048&&eo(9,n);break;case 1:cr(t,n,l,i);break;case 3:cr(t,n,l,i),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Hi(t)));break;case 12:if(f&2048){cr(t,n,l,i),t=n.stateNode;try{var m=n.memoizedProps,b=m.id,N=m.onPostCommit;typeof N=="function"&&N(b,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(O){Xt(n,n.return,O)}}else cr(t,n,l,i);break;case 31:cr(t,n,l,i);break;case 13:cr(t,n,l,i);break;case 23:break;case 22:m=n.stateNode,b=n.alternate,n.memoizedState!==null?m._visibility&2?cr(t,n,l,i):no(t,n):m._visibility&2?cr(t,n,l,i):(m._visibility|=2,Ks(t,n,l,i,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Yf(b,n);break;case 24:cr(t,n,l,i),f&2048&&Gf(n.alternate,n);break;default:cr(t,n,l,i)}}function Ks(t,n,l,i,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=t,b=n,N=l,O=i,Y=b.flags;switch(b.tag){case 0:case 11:case 15:Ks(m,b,N,O,f),eo(8,b);break;case 23:break;case 22:var te=b.stateNode;b.memoizedState!==null?te._visibility&2?Ks(m,b,N,O,f):no(m,b):(te._visibility|=2,Ks(m,b,N,O,f)),f&&Y&2048&&Yf(b.alternate,b);break;case 24:Ks(m,b,N,O,f),f&&Y&2048&&Gf(b.alternate,b);break;default:Ks(m,b,N,O,f)}n=n.sibling}}function no(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,i=n,f=i.flags;switch(i.tag){case 22:no(l,i),f&2048&&Yf(i.alternate,i);break;case 24:no(l,i),f&2048&&Gf(i.alternate,i);break;default:no(l,i)}n=n.sibling}}var ao=8192;function Zs(t,n,l){if(t.subtreeFlags&ao)for(t=t.child;t!==null;)_v(t,n,l),t=t.sibling}function _v(t,n,l){switch(t.tag){case 26:Zs(t,n,l),t.flags&ao&&t.memoizedState!==null&&iS(l,or,t.memoizedState,t.memoizedProps);break;case 5:Zs(t,n,l);break;case 3:case 4:var i=or;or=iu(t.stateNode.containerInfo),Zs(t,n,l),or=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=ao,ao=16777216,Zs(t,n,l),ao=i):Zs(t,n,l));break;default:Zs(t,n,l)}}function Lv(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function ro(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var i=n[l];Yn=i,$v(i,t)}Lv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zv(t),t=t.sibling}function zv(t){switch(t.tag){case 0:case 11:case 15:ro(t),t.flags&2048&&Nl(9,t,t.return);break;case 3:ro(t);break;case 12:ro(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Xc(t)):ro(t);break;default:ro(t)}}function Xc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var i=n[l];Yn=i,$v(i,t)}Lv(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Nl(8,n,n.return),Xc(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Xc(n));break;default:Xc(n)}t=t.sibling}}function $v(t,n){for(;Yn!==null;){var l=Yn;switch(l.tag){case 0:case 11:case 15:Nl(8,l,n);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,Yn=i;else e:for(l=t;Yn!==null;){i=Yn;var f=i.sibling,m=i.return;if(kv(i),i===l){Yn=null;break e}if(f!==null){f.return=m,Yn=f;break e}Yn=m}}}var S1={getCacheForType:function(t){var n=Jn(Tn),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Jn(Tn).controller.signal}},E1=typeof WeakMap=="function"?WeakMap:Map,Ut=0,rn=null,vt=null,Et=0,Gt=0,La=null,jl=!1,Ws=!1,Xf=!1,el=0,vn=0,Rl=0,vs=0,Qf=0,za=0,Js=0,lo=null,ja=null,Kf=!1,Qc=0,Uv=0,Kc=1/0,Zc=null,kl=null,Bn=0,Tl=null,ei=null,tl=0,Zf=0,Wf=null,Bv=null,so=0,Jf=null;function $a(){return(Ut&2)!==0&&Et!==0?Et&-Et:$.T!==null?lh():Z()}function Iv(){if(za===0)if((Et&536870912)===0||kt){var t=wt;wt<<=1,(wt&3932160)===0&&(wt=262144),za=t}else za=536870912;return t=Ma.current,t!==null&&(t.flags|=32),za}function Ra(t,n,l){(t===rn&&(Gt===2||Gt===9)||t.cancelPendingCommit!==null)&&(ti(t,0),Al(t,Et,za,!1)),gt(t,l),((Ut&2)===0||t!==rn)&&(t===rn&&((Ut&2)===0&&(vs|=l),vn===4&&Al(t,Et,za,!1)),jr(t))}function Hv(t,n,l){if((Ut&6)!==0)throw Error(s(327));var i=!l&&(n&127)===0&&(n&t.expiredLanes)===0||Mt(t,n),f=i?R1(t,n):th(t,n,!0),m=i;do{if(f===0){Ws&&!i&&Al(t,n,0,!1);break}else{if(l=t.current.alternate,m&&!N1(l)){f=th(t,n,!1),m=!1;continue}if(f===2){if(m=n,t.errorRecoveryDisabledLanes&m)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var N=t;f=lo;var O=N.current.memoizedState.isDehydrated;if(O&&(ti(N,b).flags|=256),b=th(N,b,!1),b!==2){if(Xf&&!O){N.errorRecoveryDisabledLanes|=m,vs|=m,f=4;break e}m=ja,ja=f,m!==null&&(ja===null?ja=m:ja.push.apply(ja,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){ti(t,0),Al(t,n,0,!0);break}e:{switch(i=t,m=f,m){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:Al(i,n,za,!jl);break e;case 2:ja=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(f=Qc+300-ln(),10<f)){if(Al(i,n,za,!jl),Ft(i,0,!0)!==0)break e;tl=n,i.timeoutHandle=xx(qv.bind(null,i,l,ja,Zc,Kf,n,za,vs,Js,jl,m,"Throttled",-0,0),f);break e}qv(i,l,ja,Zc,Kf,n,za,vs,Js,jl,m,null,-0,0)}}break}while(!0);jr(t)}function qv(t,n,l,i,f,m,b,N,O,Y,te,oe,Q,K){if(t.timeoutHandle=-1,oe=n.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},_v(n,m,oe);var Me=(m&62914560)===m?Qc-ln():(m&4194048)===m?Uv-ln():0;if(Me=oS(oe,Me),Me!==null){tl=m,t.cancelPendingCommit=Me(Kv.bind(null,t,n,m,l,i,f,b,N,O,te,oe,null,Q,K)),Al(t,m,b,!Y);return}}Kv(t,n,m,l,i,f,b,N,O)}function N1(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var f=l[i],m=f.getSnapshot;f=f.value;try{if(!Ca(m(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Al(t,n,l,i){n&=~Qf,n&=~vs,t.suspendedLanes|=n,t.pingedLanes&=~n,i&&(t.warmLanes|=n),i=t.expirationTimes;for(var f=n;0<f;){var m=31-en(f),b=1<<m;i[m]=-1,f&=~b}l!==0&&Nn(t,l,n)}function Wc(){return(Ut&6)===0?(io(0),!1):!0}function eh(){if(vt!==null){if(Gt===0)var t=vt.return;else t=vt,Fr=os=null,gf(t),Vs=null,Pi=0,t=vt;for(;t!==null;)yv(t.alternate,t),t=t.return;vt=null}}function ti(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,F1(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),tl=0,eh(),rn=t,vt=l=qr(t.current,null),Et=n,Gt=0,La=null,jl=!1,Ws=Mt(t,n),Xf=!1,Js=za=Qf=vs=Rl=vn=0,ja=lo=null,Kf=!1,(n&8)!==0&&(n|=n&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=n;0<i;){var f=31-en(i),m=1<<f;n|=t[f],i&=~m}return el=n,yc(),l}function Pv(t,n){ct=null,$.H=Zi,n===Fs||n===kc?(n=lg(),Gt=3):n===af?(n=lg(),Gt=4):Gt=n===Of?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,La=n,vt===null&&(vn=1,Hc(t,Va(n,t.current)))}function Fv(){var t=Ma.current;return t===null?!0:(Et&4194048)===Et?Qa===null:(Et&62914560)===Et||(Et&536870912)!==0?t===Qa:!1}function Vv(){var t=$.H;return $.H=Zi,t===null?Zi:t}function Yv(){var t=$.A;return $.A=S1,t}function Jc(){vn=4,jl||(Et&4194048)!==Et&&Ma.current!==null||(Ws=!0),(Rl&134217727)===0&&(vs&134217727)===0||rn===null||Al(rn,Et,za,!1)}function th(t,n,l){var i=Ut;Ut|=2;var f=Vv(),m=Yv();(rn!==t||Et!==n)&&(Zc=null,ti(t,n)),n=!1;var b=vn;e:do try{if(Gt!==0&&vt!==null){var N=vt,O=La;switch(Gt){case 8:eh(),b=6;break e;case 3:case 2:case 9:case 6:Ma.current===null&&(n=!0);var Y=Gt;if(Gt=0,La=null,ni(t,N,O,Y),l&&Ws){b=0;break e}break;default:Y=Gt,Gt=0,La=null,ni(t,N,O,Y)}}j1(),b=vn;break}catch(te){Pv(t,te)}while(!0);return n&&t.shellSuspendCounter++,Fr=os=null,Ut=i,$.H=f,$.A=m,vt===null&&(rn=null,Et=0,yc()),b}function j1(){for(;vt!==null;)Gv(vt)}function R1(t,n){var l=Ut;Ut|=2;var i=Vv(),f=Yv();rn!==t||Et!==n?(Zc=null,Kc=ln()+500,ti(t,n)):Ws=Mt(t,n);e:do try{if(Gt!==0&&vt!==null){n=vt;var m=La;t:switch(Gt){case 1:Gt=0,La=null,ni(t,n,m,1);break;case 2:case 9:if(ag(m)){Gt=0,La=null,Xv(n);break}n=function(){Gt!==2&&Gt!==9||rn!==t||(Gt=7),jr(t)},m.then(n,n);break e;case 3:Gt=7;break e;case 4:Gt=5;break e;case 7:ag(m)?(Gt=0,La=null,Xv(n)):(Gt=0,La=null,ni(t,n,m,7));break;case 5:var b=null;switch(vt.tag){case 26:b=vt.memoizedState;case 5:case 27:var N=vt;if(b?Mx(b):N.stateNode.complete){Gt=0,La=null;var O=N.sibling;if(O!==null)vt=O;else{var Y=N.return;Y!==null?(vt=Y,eu(Y)):vt=null}break t}}Gt=0,La=null,ni(t,n,m,5);break;case 6:Gt=0,La=null,ni(t,n,m,6);break;case 8:eh(),vn=6;break e;default:throw Error(s(462))}}k1();break}catch(te){Pv(t,te)}while(!0);return Fr=os=null,$.H=i,$.A=f,Ut=l,vt!==null?0:(rn=null,Et=0,yc(),vn)}function k1(){for(;vt!==null&&!Pn();)Gv(vt)}function Gv(t){var n=vv(t.alternate,t,el);t.memoizedProps=t.pendingProps,n===null?eu(t):vt=n}function Xv(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=dv(l,n,n.pendingProps,n.type,void 0,Et);break;case 11:n=dv(l,n,n.pendingProps,n.type.render,n.ref,Et);break;case 5:gf(n);default:yv(l,n),n=vt=Yp(n,el),n=vv(l,n,el)}t.memoizedProps=t.pendingProps,n===null?eu(t):vt=n}function ni(t,n,l,i){Fr=os=null,gf(n),Vs=null,Pi=0;var f=n.return;try{if(p1(t,f,n,l,Et)){vn=1,Hc(t,Va(l,t.current)),vt=null;return}}catch(m){if(f!==null)throw vt=f,m;vn=1,Hc(t,Va(l,t.current)),vt=null;return}n.flags&32768?(kt||i===1?t=!0:Ws||(Et&536870912)!==0?t=!1:(jl=t=!0,(i===2||i===9||i===3||i===6)&&(i=Ma.current,i!==null&&i.tag===13&&(i.flags|=16384))),Qv(n,t)):eu(n)}function eu(t){var n=t;do{if((n.flags&32768)!==0){Qv(n,jl);return}t=n.return;var l=x1(n.alternate,n,el);if(l!==null){vt=l;return}if(n=n.sibling,n!==null){vt=n;return}vt=n=t}while(n!==null);vn===0&&(vn=5)}function Qv(t,n){do{var l=y1(t.alternate,t);if(l!==null){l.flags&=32767,vt=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){vt=t;return}vt=t=l}while(t!==null);vn=6,vt=null}function Kv(t,n,l,i,f,m,b,N,O){t.cancelPendingCommit=null;do tu();while(Bn!==0);if((Ut&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));if(m=n.lanes|n.childLanes,m|=qd,nt(t,l,m,b,N,O),t===rn&&(vt=rn=null,Et=0),ei=n,Tl=t,tl=l,Zf=m,Wf=f,Bv=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,C1(Vn,function(){return tx(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=$.T,$.T=null,f=P.p,P.p=2,b=Ut,Ut|=4;try{b1(t,n,l)}finally{Ut=b,P.p=f,$.T=i}}Bn=1,Zv(),Wv(),Jv()}}function Zv(){if(Bn===1){Bn=0;var t=Tl,n=ei,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=$.T,$.T=null;var i=P.p;P.p=2;var f=Ut;Ut|=4;try{Cv(n,t);var m=hh,b=$p(t.containerInfo),N=m.focusedElem,O=m.selectionRange;if(b!==N&&N&&N.ownerDocument&&zp(N.ownerDocument.documentElement,N)){if(O!==null&&$d(N)){var Y=O.start,te=O.end;if(te===void 0&&(te=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(te,N.value.length);else{var oe=N.ownerDocument||document,Q=oe&&oe.defaultView||window;if(Q.getSelection){var K=Q.getSelection(),Me=N.textContent.length,Ge=Math.min(O.start,Me),Zt=O.end===void 0?Ge:Math.min(O.end,Me);!K.extend&&Ge>Zt&&(b=Zt,Zt=Ge,Ge=b);var H=Lp(N,Ge),U=Lp(N,Zt);if(H&&U&&(K.rangeCount!==1||K.anchorNode!==H.node||K.anchorOffset!==H.offset||K.focusNode!==U.node||K.focusOffset!==U.offset)){var V=oe.createRange();V.setStart(H.node,H.offset),K.removeAllRanges(),Ge>Zt?(K.addRange(V),K.extend(U.node,U.offset)):(V.setEnd(U.node,U.offset),K.addRange(V))}}}}for(oe=[],K=N;K=K.parentNode;)K.nodeType===1&&oe.push({element:K,left:K.scrollLeft,top:K.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}}hu=!!fh,hh=fh=null}finally{Ut=f,P.p=i,$.T=l}}t.current=n,Bn=2}}function Wv(){if(Bn===2){Bn=0;var t=Tl,n=ei,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=$.T,$.T=null;var i=P.p;P.p=2;var f=Ut;Ut|=4;try{Rv(t,n.alternate,n)}finally{Ut=f,P.p=i,$.T=l}}Bn=3}}function Jv(){if(Bn===4||Bn===3){Bn=0,Fn();var t=Tl,n=ei,l=tl,i=Bv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Bn=5:(Bn=0,ei=Tl=null,ex(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(kl=null),q(l),n=n.stateNode,ee&&typeof ee.onCommitFiberRoot=="function")try{ee.onCommitFiberRoot(Fe,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=$.T,f=P.p,P.p=2,$.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{$.T=n,P.p=f}}(tl&3)!==0&&tu(),jr(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===Jf?so++:(so=0,Jf=t):so=0,io(0)}}function ex(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Hi(n)))}function tu(){return Zv(),Wv(),Jv(),tx()}function tx(){if(Bn!==5)return!1;var t=Tl,n=Zf;Zf=0;var l=q(tl),i=$.T,f=P.p;try{P.p=32>l?32:l,$.T=null,l=Wf,Wf=null;var m=Tl,b=tl;if(Bn=0,ei=Tl=null,tl=0,(Ut&6)!==0)throw Error(s(331));var N=Ut;if(Ut|=4,zv(m.current),Mv(m,m.current,b,l),Ut=N,io(0,!1),ee&&typeof ee.onPostCommitFiberRoot=="function")try{ee.onPostCommitFiberRoot(Fe,m)}catch{}return!0}finally{P.p=f,$.T=i,ex(t,n)}}function nx(t,n,l){n=Va(l,n),n=Cf(t.stateNode,n,2),t=wl(t,n,2),t!==null&&(gt(t,2),jr(t))}function Xt(t,n,l){if(t.tag===3)nx(t,t,l);else for(;n!==null;){if(n.tag===3){nx(n,t,l);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(kl===null||!kl.has(i))){t=Va(l,t),l=av(2),i=wl(n,l,2),i!==null&&(rv(l,i,n,t),gt(i,2),jr(i));break}}n=n.return}}function nh(t,n,l){var i=t.pingCache;if(i===null){i=t.pingCache=new E1;var f=new Set;i.set(n,f)}else f=i.get(n),f===void 0&&(f=new Set,i.set(n,f));f.has(l)||(Xf=!0,f.add(l),t=T1.bind(null,t,n,l),n.then(t,t))}function T1(t,n,l){var i=t.pingCache;i!==null&&i.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,rn===t&&(Et&l)===l&&(vn===4||vn===3&&(Et&62914560)===Et&&300>ln()-Qc?(Ut&2)===0&&ti(t,0):Qf|=l,Js===Et&&(Js=0)),jr(t)}function ax(t,n){n===0&&(n=tn()),t=ls(t,n),t!==null&&(gt(t,n),jr(t))}function A1(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),ax(t,l)}function D1(t,n){var l=0;switch(t.tag){case 31:case 13:var i=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(n),ax(t,l)}function C1(t,n){return It(t,n)}var nu=null,ai=null,ah=!1,au=!1,rh=!1,Dl=0;function jr(t){t!==ai&&t.next===null&&(ai===null?nu=ai=t:ai=ai.next=t),au=!0,ah||(ah=!0,M1())}function io(t,n){if(!rh&&au){rh=!0;do for(var l=!1,i=nu;i!==null;){if(t!==0){var f=i.pendingLanes;if(f===0)var m=0;else{var b=i.suspendedLanes,N=i.pingedLanes;m=(1<<31-en(42|t)+1)-1,m&=f&~(b&~N),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,ix(i,m))}else m=Et,m=Ft(i,i===rn?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Mt(i,m)||(l=!0,ix(i,m));i=i.next}while(l);rh=!1}}function O1(){rx()}function rx(){au=ah=!1;var t=0;Dl!==0&&P1()&&(t=Dl);for(var n=ln(),l=null,i=nu;i!==null;){var f=i.next,m=lx(i,n);m===0?(i.next=null,l===null?nu=f:l.next=f,f===null&&(ai=l)):(l=i,(t!==0||(m&3)!==0)&&(au=!0)),i=f}Bn!==0&&Bn!==5||io(t),Dl!==0&&(Dl=0)}function lx(t,n){for(var l=t.suspendedLanes,i=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var b=31-en(m),N=1<<b,O=f[b];O===-1?((N&l)===0||(N&i)!==0)&&(f[b]=sn(N,n)):O<=n&&(t.expiredLanes|=N),m&=~N}if(n=rn,l=Et,l=Ft(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,l===0||t===n&&(Gt===2||Gt===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Jt(i),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Mt(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(i!==null&&Jt(i),q(l)){case 2:case 8:l=na;break;case 32:l=Vn;break;case 268435456:l=Ae;break;default:l=Vn}return i=sx.bind(null,t),l=It(l,i),t.callbackPriority=n,t.callbackNode=l,n}return i!==null&&i!==null&&Jt(i),t.callbackPriority=2,t.callbackNode=null,2}function sx(t,n){if(Bn!==0&&Bn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(tu()&&t.callbackNode!==l)return null;var i=Et;return i=Ft(t,t===rn?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(Hv(t,i,n),lx(t,ln()),t.callbackNode!=null&&t.callbackNode===l?sx.bind(null,t):null)}function ix(t,n){if(tu())return null;Hv(t,n,!0)}function M1(){V1(function(){(Ut&6)!==0?It(ha,O1):rx()})}function lh(){if(Dl===0){var t=qs;t===0&&(t=_e,_e<<=1,(_e&261888)===0&&(_e=256)),Dl=t}return Dl}function ox(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:on(""+t)}function cx(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function _1(t,n,l,i,f){if(n==="submit"&&l&&l.stateNode===f){var m=ox((f[Ce]||null).action),b=i.submitter;b&&(n=(n=b[Ce]||null)?ox(n.formAction):b.getAttribute("formAction"),n!==null&&(m=n,b=null));var N=new Ir("action","action",null,i,f);t.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Dl!==0){var O=b?cx(f,b):new FormData(f);jf(l,{pending:!0,data:O,method:f.method,action:m},null,O)}}else typeof m=="function"&&(N.preventDefault(),O=b?cx(f,b):new FormData(f),jf(l,{pending:!0,data:O,method:f.method,action:m},m,O))},currentTarget:f}]})}}for(var sh=0;sh<Hd.length;sh++){var ih=Hd[sh],L1=ih.toLowerCase(),z1=ih[0].toUpperCase()+ih.slice(1);ir(L1,"on"+z1)}ir(Ip,"onAnimationEnd"),ir(Hp,"onAnimationIteration"),ir(qp,"onAnimationStart"),ir("dblclick","onDoubleClick"),ir("focusin","onFocus"),ir("focusout","onBlur"),ir(Ww,"onTransitionRun"),ir(Jw,"onTransitionStart"),ir(e1,"onTransitionCancel"),ir(Pp,"onTransitionEnd"),zn("onMouseEnter",["mouseout","mouseover"]),zn("onMouseLeave",["mouseout","mouseover"]),zn("onPointerEnter",["pointerout","pointerover"]),zn("onPointerLeave",["pointerout","pointerover"]),jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jn("onBeforeInput",["compositionend","keypress","textInput","paste"]),jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oo="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(" "),$1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oo));function ux(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var i=t[l],f=i.event;i=i.listeners;e:{var m=void 0;if(n)for(var b=i.length-1;0<=b;b--){var N=i[b],O=N.instance,Y=N.currentTarget;if(N=N.listener,O!==m&&f.isPropagationStopped())break e;m=N,f.currentTarget=Y;try{m(f)}catch(te){xc(te)}f.currentTarget=null,m=O}else for(b=0;b<i.length;b++){if(N=i[b],O=N.instance,Y=N.currentTarget,N=N.listener,O!==m&&f.isPropagationStopped())break e;m=N,f.currentTarget=Y;try{m(f)}catch(te){xc(te)}f.currentTarget=null,m=O}}}}function xt(t,n){var l=n[ze];l===void 0&&(l=n[ze]=new Set);var i=t+"__bubble";l.has(i)||(dx(n,t,2,!1),l.add(i))}function oh(t,n,l){var i=0;n&&(i|=4),dx(l,t,i,n)}var ru="_reactListening"+Math.random().toString(36).slice(2);function ch(t){if(!t[ru]){t[ru]=!0,nn.forEach(function(l){l!=="selectionchange"&&($1.has(l)||oh(l,!1,t),oh(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ru]||(n[ru]=!0,oh("selectionchange",!1,n))}}function dx(t,n,l,i){switch(Ix(n)){case 2:var f=dS;break;case 8:f=fS;break;default:f=Nh}l=f.bind(null,n,l,t),f=void 0,!Oi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),i?f!==void 0?t.addEventListener(n,l,{capture:!0,passive:f}):t.addEventListener(n,l,!0):f!==void 0?t.addEventListener(n,l,{passive:f}):t.addEventListener(n,l,!1)}function uh(t,n,l,i,f){var m=i;if((n&1)===0&&(n&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===f)break;if(b===4)for(b=i.return;b!==null;){var O=b.tag;if((O===3||O===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;N!==null;){if(b=Yt(N),b===null)return;if(O=b.tag,O===5||O===6||O===26||O===27){i=m=b;continue e}N=N.parentNode}}i=i.return}Ci(function(){var Y=m,te=Lr(l),oe=[];e:{var Q=Fp.get(t);if(Q!==void 0){var K=Ir,Me=t;switch(t){case"keypress":if(Os(l)===0)break e;case"keydown":case"keyup":K=kn;break;case"focusin":Me="focus",K=ye;break;case"focusout":Me="blur",K=ye;break;case"beforeblur":case"afterblur":K=ye;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":K=mc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=X;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=wr;break;case Ip:case Hp:case qp:K=ue;break;case Pp:K=pc;break;case"scroll":case"scrollend":K=Dd;break;case"wheel":K=Od;break;case"copy":case"cut":case"paste":K=we;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=qt;break;case"toggle":case"beforetoggle":K=Bw}var Ge=(n&4)!==0,Zt=!Ge&&(t==="scroll"||t==="scrollend"),H=Ge?Q!==null?Q+"Capture":null:Q;Ge=[];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=qa(U,H),le!=null&&Ge.push(co(U,le,V))),Zt)break;U=U.return}0<Ge.length&&(Q=new K(Q,Me,null,l,te),oe.push({event:Q,listeners:Ge}))}}if((n&7)===0){e:{if(Q=t==="mouseover"||t==="pointerover",K=t==="mouseout"||t==="pointerout",Q&&l!==Da&&(Me=l.relatedTarget||l.fromElement)&&(Yt(Me)||Me[Ne]))break e;if((K||Q)&&(Q=te.window===te?te:(Q=te.ownerDocument)?Q.defaultView||Q.parentWindow:window,K?(Me=l.relatedTarget||l.toElement,K=Y,Me=Me?Yt(Me):null,Me!==null&&(Zt=c(Me),Ge=Me.tag,Me!==Zt||Ge!==5&&Ge!==27&&Ge!==6)&&(Me=null)):(K=null,Me=Y),K!==Me)){if(Ge=mc,le="onMouseLeave",H="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Ge=qt,le="onPointerLeave",H="onPointerEnter",U="pointer"),Zt=K==null?Q:mt(K),V=Me==null?Q:mt(Me),Q=new Ge(le,U+"leave",K,l,te),Q.target=Zt,Q.relatedTarget=V,le=null,Yt(te)===Y&&(Ge=new Ge(H,U+"enter",Me,l,te),Ge.target=V,Ge.relatedTarget=Zt,le=Ge),Zt=le,K&&Me)t:{for(Ge=U1,H=K,U=Me,V=0,le=H;le;le=Ge(le))V++;le=0;for(var Pe=U;Pe;Pe=Ge(Pe))le++;for(;0<V-le;)H=Ge(H),V--;for(;0<le-V;)U=Ge(U),le--;for(;V--;){if(H===U||U!==null&&H===U.alternate){Ge=H;break t}H=Ge(H),U=Ge(U)}Ge=null}else Ge=null;K!==null&&fx(oe,Q,K,Ge,!1),Me!==null&&Zt!==null&&fx(oe,Zt,Me,Ge,!0)}}e:{if(Q=Y?mt(Y):window,K=Q.nodeName&&Q.nodeName.toLowerCase(),K==="select"||K==="input"&&Q.type==="file")var Lt=Ap;else if(kp(Q))if(Dp)Lt=Qw;else{Lt=Gw;var Ue=Yw}else K=Q.nodeName,!K||K.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?Y&&Wl(Y.elementType)&&(Lt=Ap):Lt=Xw;if(Lt&&(Lt=Lt(t,Y))){Tp(oe,Lt,l,te);break e}Ue&&Ue(t,Q,Y),t==="focusout"&&Y&&Q.type==="number"&&Y.memoizedProps.value!=null&&_t(Q,"number",Q.value)}switch(Ue=Y?mt(Y):window,t){case"focusin":(kp(Ue)||Ue.contentEditable==="true")&&(_s=Ue,Ud=Y,Ui=null);break;case"focusout":Ui=Ud=_s=null;break;case"mousedown":Bd=!0;break;case"contextmenu":case"mouseup":case"dragend":Bd=!1,Up(oe,l,te);break;case"selectionchange":if(Zw)break;case"keydown":case"keyup":Up(oe,l,te)}var ht;if(_d)e:{switch(t){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else Ms?jp(t,l)&&(Nt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Nt="onCompositionStart");Nt&&(Sp&&l.locale!=="ko"&&(Ms||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Ms&&(ht=fc()):(Pa=te,Mi="value"in Pa?Pa.value:Pa.textContent,Ms=!0)),Ue=lu(Y,Nt),0<Ue.length&&(Nt=new it(Nt,t,null,l,te),oe.push({event:Nt,listeners:Ue}),ht?Nt.data=ht:(ht=Rp(l),ht!==null&&(Nt.data=ht)))),(ht=Hw?qw(t,l):Pw(t,l))&&(Nt=lu(Y,"onBeforeInput"),0<Nt.length&&(Ue=new it("onBeforeInput","beforeinput",null,l,te),oe.push({event:Ue,listeners:Nt}),Ue.data=ht)),_1(oe,t,Y,l,te)}ux(oe,n)})}function co(t,n,l){return{instance:t,listener:n,currentTarget:l}}function lu(t,n){for(var l=n+"Capture",i=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=qa(t,l),f!=null&&i.unshift(co(t,f,m)),f=qa(t,n),f!=null&&i.push(co(t,f,m))),t.tag===3)return i;t=t.return}return[]}function U1(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function fx(t,n,l,i,f){for(var m=n._reactName,b=[];l!==null&&l!==i;){var N=l,O=N.alternate,Y=N.stateNode;if(N=N.tag,O!==null&&O===i)break;N!==5&&N!==26&&N!==27||Y===null||(O=Y,f?(Y=qa(l,m),Y!=null&&b.unshift(co(l,Y,O))):f||(Y=qa(l,m),Y!=null&&b.push(co(l,Y,O)))),l=l.return}b.length!==0&&t.push({event:n,listeners:b})}var B1=/\r\n?/g,I1=/\u0000|\uFFFD/g;function hx(t){return(typeof t=="string"?t:""+t).replace(B1,`
|
|
49
|
+
`).replace(I1,"")}function mx(t,n){return n=hx(n),hx(t)===n}function Kt(t,n,l,i,f,m){switch(l){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||hl(t,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&hl(t,""+i);break;case"className":vr(t,"class",i);break;case"tabIndex":vr(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":vr(t,l,i);break;case"style":ya(t,i,m);break;case"data":if(n!=="object"){vr(t,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=on(""+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"?(n!=="input"&&Kt(t,n,"name",f.name,f,null),Kt(t,n,"formEncType",f.formEncType,f,null),Kt(t,n,"formMethod",f.formMethod,f,null),Kt(t,n,"formTarget",f.formTarget,f,null)):(Kt(t,n,"encType",f.encType,f,null),Kt(t,n,"method",f.method,f,null),Kt(t,n,"target",f.target,f,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=on(""+i),t.setAttribute(l,i);break;case"onClick":i!=null&&(t.onclick=la);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(f.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=on(""+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),aa(t,"popover",i);break;case"xlinkActuate":Je(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Je(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Je(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Je(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Je(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Je(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Je(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Je(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Je(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":aa(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=Ds.get(l)||l,aa(t,l,i))}}function dh(t,n,l,i,f,m){switch(l){case"style":ya(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(f.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"children":typeof i=="string"?hl(t,i):(typeof i=="number"||typeof i=="bigint")&&hl(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=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qn.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),m=t[Ce]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(n,m,f),typeof i=="function")){typeof m!="function"&&m!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,i,f);break e}l in t?t[l]=i:i===!0?t.setAttribute(l,""):aa(t,l,i)}}}function ta(t,n,l){switch(n){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,f=!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":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Kt(t,n,m,b,l,null)}}f&&Kt(t,n,"srcSet",l.srcSet,l,null),i&&Kt(t,n,"src",l.src,l,null);return;case"input":xt("invalid",t);var N=m=b=f=null,O=null,Y=null;for(i in l)if(l.hasOwnProperty(i)){var te=l[i];if(te!=null)switch(i){case"name":f=te;break;case"type":b=te;break;case"checked":O=te;break;case"defaultChecked":Y=te;break;case"value":m=te;break;case"defaultValue":N=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,n));break;default:Kt(t,n,i,te,l,null)}}Ai(t,m,N,O,Y,b,f,!1);return;case"select":xt("invalid",t),i=b=m=null;for(f in l)if(l.hasOwnProperty(f)&&(N=l[f],N!=null))switch(f){case"value":m=N;break;case"defaultValue":b=N;break;case"multiple":i=N;default:Kt(t,n,f,N,l,null)}n=m,l=b,t.multiple=!!i,n!=null?xr(t,!!i,n,!1):l!=null&&xr(t,!!i,l,!0);return;case"textarea":xt("invalid",t),m=f=i=null;for(b in l)if(l.hasOwnProperty(b)&&(N=l[b],N!=null))switch(b){case"value":i=N;break;case"defaultValue":f=N;break;case"children":m=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(s(91));break;default:Kt(t,n,b,N,l,null)}lr(t,i,f,m);return;case"option":for(O in l)if(l.hasOwnProperty(O)&&(i=l[O],i!=null))switch(O){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Kt(t,n,O,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<oo.length;i++)xt(oo[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,n));default:Kt(t,n,Y,i,l,null)}return;default:if(Wl(n)){for(te in l)l.hasOwnProperty(te)&&(i=l[te],i!==void 0&&dh(t,n,te,i,l,void 0));return}}for(N in l)l.hasOwnProperty(N)&&(i=l[N],i!=null&&Kt(t,n,N,i,l,null))}function H1(t,n,l,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,N=null,O=null,Y=null,te=null;for(K in l){var oe=l[K];if(l.hasOwnProperty(K)&&oe!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":O=oe;default:i.hasOwnProperty(K)||Kt(t,n,K,null,i,oe)}}for(var Q in i){var K=i[Q];if(oe=l[Q],i.hasOwnProperty(Q)&&(K!=null||oe!=null))switch(Q){case"type":m=K;break;case"name":f=K;break;case"checked":Y=K;break;case"defaultChecked":te=K;break;case"value":b=K;break;case"defaultValue":N=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,n));break;default:K!==oe&&Kt(t,n,Q,K,i,oe)}}Zl(t,b,N,O,Y,te,m,f);return;case"select":K=b=N=Q=null;for(m in l)if(O=l[m],l.hasOwnProperty(m)&&O!=null)switch(m){case"value":break;case"multiple":K=O;default:i.hasOwnProperty(m)||Kt(t,n,m,null,i,O)}for(f in i)if(m=i[f],O=l[f],i.hasOwnProperty(f)&&(m!=null||O!=null))switch(f){case"value":Q=m;break;case"defaultValue":N=m;break;case"multiple":b=m;default:m!==O&&Kt(t,n,f,m,i,O)}n=N,l=b,i=K,Q!=null?xr(t,!!l,Q,!1):!!i!=!!l&&(n!=null?xr(t,!!l,n,!0):xr(t,!!l,l?[]:"",!1));return;case"textarea":K=Q=null;for(N in l)if(f=l[N],l.hasOwnProperty(N)&&f!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Kt(t,n,N,null,i,f)}for(b in i)if(f=i[b],m=l[b],i.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":Q=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==m&&Kt(t,n,b,f,i,m)}dc(t,Q,K);return;case"option":for(var Me in l)if(Q=l[Me],l.hasOwnProperty(Me)&&Q!=null&&!i.hasOwnProperty(Me))switch(Me){case"selected":t.selected=!1;break;default:Kt(t,n,Me,null,i,Q)}for(O in i)if(Q=i[O],K=l[O],i.hasOwnProperty(O)&&Q!==K&&(Q!=null||K!=null))switch(O){case"selected":t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:Kt(t,n,O,Q,i,K)}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 Ge in l)Q=l[Ge],l.hasOwnProperty(Ge)&&Q!=null&&!i.hasOwnProperty(Ge)&&Kt(t,n,Ge,null,i,Q);for(Y in i)if(Q=i[Y],K=l[Y],i.hasOwnProperty(Y)&&Q!==K&&(Q!=null||K!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,n));break;default:Kt(t,n,Y,Q,i,K)}return;default:if(Wl(n)){for(var Zt in l)Q=l[Zt],l.hasOwnProperty(Zt)&&Q!==void 0&&!i.hasOwnProperty(Zt)&&dh(t,n,Zt,void 0,i,Q);for(te in i)Q=i[te],K=l[te],!i.hasOwnProperty(te)||Q===K||Q===void 0&&K===void 0||dh(t,n,te,Q,i,K);return}}for(var H in l)Q=l[H],l.hasOwnProperty(H)&&Q!=null&&!i.hasOwnProperty(H)&&Kt(t,n,H,null,i,Q);for(oe in i)Q=i[oe],K=l[oe],!i.hasOwnProperty(oe)||Q===K||Q==null&&K==null||Kt(t,n,oe,Q,i,K)}function px(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q1(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var f=l[i],m=f.transferSize,b=f.initiatorType,N=f.duration;if(m&&N&&px(b)){for(b=0,N=f.responseEnd,i+=1;i<l.length;i++){var O=l[i],Y=O.startTime;if(Y>N)break;var te=O.transferSize,oe=O.initiatorType;te&&px(oe)&&(O=O.responseEnd,b+=te*(O<N?1:(N-Y)/(O-Y)))}if(--i,n+=8*(m+b)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var fh=null,hh=null;function su(t){return t.nodeType===9?t:t.ownerDocument}function gx(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 vx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function mh(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var ph=null;function P1(){var t=window.event;return t&&t.type==="popstate"?t===ph?!1:(ph=t,!0):(ph=null,!1)}var xx=typeof setTimeout=="function"?setTimeout:void 0,F1=typeof clearTimeout=="function"?clearTimeout:void 0,yx=typeof Promise=="function"?Promise:void 0,V1=typeof queueMicrotask=="function"?queueMicrotask:typeof yx<"u"?function(t){return yx.resolve(null).then(t).catch(Y1)}:xx;function Y1(t){setTimeout(function(){throw t})}function Cl(t){return t==="head"}function bx(t,n){var l=n,i=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(i===0){t.removeChild(f),ii(n);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")uo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,uo(l);for(var m=l.firstChild;m;){var b=m.nextSibling,N=m.nodeName;m[tt]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&uo(t.ownerDocument.body);l=f}while(l);ii(n)}function wx(t,n){var l=t;t=0;do{var i=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(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 n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":gh(l),Ve(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function G1(t,n,l,i){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[tt])switch(n){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!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Ka(t.nextSibling),t===null)break}return null}function X1(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Ka(t.nextSibling),t===null))return null;return t}function Sx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Ka(t.nextSibling),t===null))return null;return t}function vh(t){return t.data==="$?"||t.data==="$~"}function xh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Q1(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var i=function(){n(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Ka(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var yh=null;function Ex(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return Ka(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Nx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function jx(t,n,l){switch(n=su(l),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function uo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ve(t)}var Za=new Map,Rx=new Set;function iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var nl=P.d;P.d={f:K1,r:Z1,D:W1,C:J1,L:eS,m:tS,X:aS,S:nS,M:rS};function K1(){var t=nl.f(),n=Wc();return t||n}function Z1(t){var n=at(t);n!==null&&n.tag===5&&n.type==="form"?Pg(n):nl.r(t)}var ri=typeof document>"u"?null:document;function kx(t,n,l){var i=ri;if(i&&typeof n=="string"&&n){var f=Zn(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Rx.has(f)||(Rx.add(f),t={rel:t,crossOrigin:l,href:n},i.querySelector(f)===null&&(n=i.createElement("link"),ta(n,"link",t),pt(n),i.head.appendChild(n)))}}function W1(t){nl.D(t),kx("dns-prefetch",t,null)}function J1(t,n){nl.C(t,n),kx("preconnect",t,n)}function eS(t,n,l){nl.L(t,n,l);var i=ri;if(i&&t&&n){var f='link[rel="preload"][as="'+Zn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Zn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Zn(l.imageSizes)+'"]')):f+='[href="'+Zn(t)+'"]';var m=f;switch(n){case"style":m=li(t);break;case"script":m=si(t)}Za.has(m)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),Za.set(m,t),i.querySelector(f)!==null||n==="style"&&i.querySelector(fo(m))||n==="script"&&i.querySelector(ho(m))||(n=i.createElement("link"),ta(n,"link",t),pt(n),i.head.appendChild(n)))}}function tS(t,n){nl.m(t,n);var l=ri;if(l&&t){var i=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Zn(i)+'"][href="'+Zn(t)+'"]',m=f;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=si(t)}if(!Za.has(m)&&(t=x({rel:"modulepreload",href:t},n),Za.set(m,t),l.querySelector(f)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ho(m)))return}i=l.createElement("link"),ta(i,"link",t),pt(i),l.head.appendChild(i)}}}function nS(t,n,l){nl.S(t,n,l);var i=ri;if(i&&t){var f=ft(i).hoistableStyles,m=li(t);n=n||"default";var b=f.get(m);if(!b){var N={loading:0,preload:null};if(b=i.querySelector(fo(m)))N.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=Za.get(m))&&bh(t,l);var O=b=i.createElement("link");pt(O),ta(O,"link",t),O._p=new Promise(function(Y,te){O.onload=Y,O.onerror=te}),O.addEventListener("load",function(){N.loading|=1}),O.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ou(b,n,i)}b={type:"stylesheet",instance:b,count:1,state:N},f.set(m,b)}}}function aS(t,n){nl.X(t,n);var l=ri;if(l&&t){var i=ft(l).hoistableScripts,f=si(t),m=i.get(f);m||(m=l.querySelector(ho(f)),m||(t=x({src:t,async:!0},n),(n=Za.get(f))&&wh(t,n),m=l.createElement("script"),pt(m),ta(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(f,m))}}function rS(t,n){nl.M(t,n);var l=ri;if(l&&t){var i=ft(l).hoistableScripts,f=si(t),m=i.get(f);m||(m=l.querySelector(ho(f)),m||(t=x({src:t,async:!0,type:"module"},n),(n=Za.get(f))&&wh(t,n),m=l.createElement("script"),pt(m),ta(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(f,m))}}function Tx(t,n,l,i){var f=(f=fe.current)?iu(f):null;if(!f)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=li(l.href),l=ft(f).hoistableStyles,i=l.get(n),i||(i={type:"style",instance:null,count:0,state:null},l.set(n,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=li(l.href);var m=ft(f).hoistableStyles,b=m.get(t);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,b),(m=f.querySelector(fo(t)))&&!m._p&&(b.instance=m,b.state.loading=5),Za.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},Za.set(t,l),m||lS(f,t,l,b.state))),n&&i===null)throw Error(s(528,""));return b}if(n&&i!==null)throw Error(s(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=si(l),l=ft(f).hoistableScripts,i=l.get(n),i||(i={type:"script",instance:null,count:0,state:null},l.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function li(t){return'href="'+Zn(t)+'"'}function fo(t){return'link[rel="stylesheet"]['+t+"]"}function Ax(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function lS(t,n,l,i){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=t.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),ta(n,"link",l),pt(n),t.head.appendChild(n))}function si(t){return'[src="'+Zn(t)+'"]'}function ho(t){return"script[async]"+t}function Dx(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var i=t.querySelector('style[data-href~="'+Zn(l.href)+'"]');if(i)return n.instance=i,pt(i),i;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),pt(i),ta(i,"style",f),ou(i,l.precedence,t),n.instance=i;case"stylesheet":f=li(l.href);var m=t.querySelector(fo(f));if(m)return n.state.loading|=4,n.instance=m,pt(m),m;i=Ax(l),(f=Za.get(f))&&bh(i,f),m=(t.ownerDocument||t).createElement("link"),pt(m);var b=m;return b._p=new Promise(function(N,O){b.onload=N,b.onerror=O}),ta(m,"link",i),n.state.loading|=4,ou(m,l.precedence,t),n.instance=m;case"script":return m=si(l.src),(f=t.querySelector(ho(m)))?(n.instance=f,pt(f),f):(i=l,(f=Za.get(m))&&(i=x({},l),wh(i,f)),t=t.ownerDocument||t,f=t.createElement("script"),pt(f),ta(f,"link",i),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,ou(i,l.precedence,t));return n.instance}function ou(t,n,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=i.length?i[i.length-1]:null,m=f,b=0;b<i.length;b++){var N=i[b];if(N.dataset.precedence===n)m=N;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function bh(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function wh(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var cu=null;function Cx(t,n,l){if(cu===null){var i=new Map,f=cu=new Map;f.set(l,i)}else f=cu,i=f.get(l),i||(i=new Map,f.set(l,i));if(i.has(t))return i;for(i.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var m=l[f];if(!(m[tt]||m[xe]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(n)||"";b=t+b;var N=i.get(b);N?N.push(m):i.set(b,[m])}}return i}function Ox(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function sS(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Mx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function iS(t,n,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 f=li(i.href),m=n.querySelector(fo(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=uu.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=m,pt(m);return}m=n.ownerDocument||n,i=Ax(i),(f=Za.get(f))&&bh(i,f),m=m.createElement("link"),pt(m);var b=m;b._p=new Promise(function(N,O){b.onload=N,b.onerror=O}),ta(m,"link",i),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=uu.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Sh=0;function oS(t,n){return t.stylesheets&&t.count===0&&fu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var i=setTimeout(function(){if(t.stylesheets&&fu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+n);0<t.imgBytes&&Sh===0&&(Sh=62500*q1());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&fu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Sh?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(f)}}:null}function uu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var du=null;function fu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,du=new Map,n.forEach(cS,t),du=null,uu.call(t))}function cS(t,n){if(!(n.state.loading&4)){var l=du.get(t);if(l)var i=l.get(null);else{l=new Map,du.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),i=b)}i&&l.set(null,i)}f=n.instance,b=f.getAttribute("data-precedence"),m=l.get(b)||i,m===i&&l.set(null,f),l.set(b,f),this.count++,i=uu.bind(this),f.addEventListener("load",i),f.addEventListener("error",i),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var mo={$$typeof:I,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function uS(t,n,l,i,f,m,b,N,O){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=Vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.hiddenUpdates=Vt(null),this.identifierPrefix=i,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function _x(t,n,l,i,f,m,b,N,O,Y,te,oe){return t=new uS(t,n,l,b,O,Y,te,oe,N),n=1,m===!0&&(n|=24),m=Oa(3,null,null,n),t.current=m,m.stateNode=t,n=ef(),n.refCount++,t.pooledCache=n,n.refCount++,m.memoizedState={element:i,isDehydrated:l,cache:n},rf(m),t}function Lx(t){return t?(t=$s,t):$s}function zx(t,n,l,i,f,m){f=Lx(f),i.context===null?i.context=f:i.pendingContext=f,i=bl(n),i.payload={element:l},m=m===void 0?null:m,m!==null&&(i.callback=m),l=wl(t,i,n),l!==null&&(Ra(l,t,n),Vi(l,t,n))}function $x(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Eh(t,n){$x(t,n),(t=t.alternate)&&$x(t,n)}function Ux(t){if(t.tag===13||t.tag===31){var n=ls(t,67108864);n!==null&&Ra(n,t,67108864),Eh(t,67108864)}}function Bx(t){if(t.tag===13||t.tag===31){var n=$a();n=z(n);var l=ls(t,n);l!==null&&Ra(l,t,n),Eh(t,n)}}var hu=!0;function dS(t,n,l,i){var f=$.T;$.T=null;var m=P.p;try{P.p=2,Nh(t,n,l,i)}finally{P.p=m,$.T=f}}function fS(t,n,l,i){var f=$.T;$.T=null;var m=P.p;try{P.p=8,Nh(t,n,l,i)}finally{P.p=m,$.T=f}}function Nh(t,n,l,i){if(hu){var f=jh(i);if(f===null)uh(t,n,i,mu,l),Hx(t,i);else if(mS(f,t,n,l,i))i.stopPropagation();else if(Hx(t,i),n&4&&-1<hS.indexOf(t)){for(;f!==null;){var m=at(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Rt(m.pendingLanes);if(b!==0){var N=m;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var O=1<<31-en(b);N.entanglements[1]|=O,b&=~O}jr(m),(Ut&6)===0&&(Kc=ln()+500,io(0))}}break;case 31:case 13:N=ls(m,2),N!==null&&Ra(N,m,2),Wc(),Eh(m,2)}if(m=jh(i),m===null&&uh(t,n,i,mu,l),m===f)break;f=m}f!==null&&i.stopPropagation()}else uh(t,n,i,null,l)}}function jh(t){return t=Lr(t),Rh(t)}var mu=null;function Rh(t){if(mu=null,t=Yt(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=h(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return mu=t,null}function Ix(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(fa()){case ha:return 2;case na:return 8;case Vn:case pe:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var kh=!1,Ol=null,Ml=null,_l=null,po=new Map,go=new Map,Ll=[],hS="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 Hx(t,n){switch(t){case"focusin":case"focusout":Ol=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":_l=null;break;case"pointerover":case"pointerout":po.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":go.delete(n.pointerId)}}function vo(t,n,l,i,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:l,eventSystemFlags:i,nativeEvent:m,targetContainers:[f]},n!==null&&(n=at(n),n!==null&&Ux(n)),t):(t.eventSystemFlags|=i,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function mS(t,n,l,i,f){switch(n){case"focusin":return Ol=vo(Ol,t,n,l,i,f),!0;case"dragenter":return Ml=vo(Ml,t,n,l,i,f),!0;case"mouseover":return _l=vo(_l,t,n,l,i,f),!0;case"pointerover":var m=f.pointerId;return po.set(m,vo(po.get(m)||null,t,n,l,i,f)),!0;case"gotpointercapture":return m=f.pointerId,go.set(m,vo(go.get(m)||null,t,n,l,i,f)),!0}return!1}function qx(t){var n=Yt(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,ie(t.priority,function(){Bx(l)});return}}else if(n===31){if(n=h(l),n!==null){t.blockedOn=n,ie(t.priority,function(){Bx(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function pu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=jh(t.nativeEvent);if(l===null){l=t.nativeEvent;var i=new l.constructor(l.type,l);Da=i,l.target.dispatchEvent(i),Da=null}else return n=at(l),n!==null&&Ux(n),t.blockedOn=l,!1;n.shift()}return!0}function Px(t,n,l){pu(t)&&l.delete(n)}function pS(){kh=!1,Ol!==null&&pu(Ol)&&(Ol=null),Ml!==null&&pu(Ml)&&(Ml=null),_l!==null&&pu(_l)&&(_l=null),po.forEach(Px),go.forEach(Px)}function gu(t,n){t.blockedOn===n&&(t.blockedOn=null,kh||(kh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pS)))}var vu=null;function Fx(t){vu!==t&&(vu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vu===t&&(vu=null);for(var n=0;n<t.length;n+=3){var l=t[n],i=t[n+1],f=t[n+2];if(typeof i!="function"){if(Rh(i||l)===null)continue;break}var m=at(l);m!==null&&(t.splice(n,3),n-=3,jf(m,{pending:!0,data:f,method:l.method,action:i},i,f))}}))}function ii(t){function n(O){return gu(O,t)}Ol!==null&&gu(Ol,t),Ml!==null&&gu(Ml,t),_l!==null&&gu(_l,t),po.forEach(n),go.forEach(n);for(var l=0;l<Ll.length;l++){var i=Ll[l];i.blockedOn===t&&(i.blockedOn=null)}for(;0<Ll.length&&(l=Ll[0],l.blockedOn===null);)qx(l),l.blockedOn===null&&Ll.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var f=l[i],m=l[i+1],b=f[Ce]||null;if(typeof m=="function")b||Fx(l);else if(b){var N=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Ce]||null)N=b.formAction;else if(Rh(f)!==null)continue}else N=b.action;typeof N=="function"?l[i+1]=N:(l.splice(i,3),i-=3),Fx(l)}}}function Vx(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=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,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Th(t){this._internalRoot=t}xu.prototype.render=Th.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var l=n.current,i=$a();zx(l,i,t,n,null,null)},xu.prototype.unmount=Th.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;zx(t.current,2,null,t,null,null),Wc(),n[Ne]=null}};function xu(t){this._internalRoot=t}xu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Z();t={blockedOn:null,target:t,priority:n};for(var l=0;l<Ll.length&&n!==0&&n<Ll[l].priority;l++);Ll.splice(l,0,t),l===0&&qx(t)}};var Yx=a.version;if(Yx!=="19.2.7")throw Error(s(527,Yx,"19.2.7"));P.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=g(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var gS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yu.isDisabled&&yu.supportsFiber)try{Fe=yu.inject(gS),ee=yu}catch{}}return yo.createRoot=function(t,n){if(!u(t))throw Error(s(299));var l=!1,i="",f=Jg,m=ev,b=tv;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=_x(t,1,!1,null,null,l,i,null,f,m,b,Vx),t[Ne]=n.current,ch(t),new Th(n)},yo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(s(299));var i=!1,f="",m=Jg,b=ev,N=tv,O=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(f=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&&(O=l.formState)),n=_x(t,1,!0,n,l??null,i,f,O,m,b,N,Vx),n.context=Lx(null),l=n.current,i=$a(),i=z(i),f=bl(i),f.callback=null,wl(l,f,i),l=i,n.current.lanes=l,gt(n,l),jr(n),t[Ne]=n.current,ch(t),new xu(n)},yo.version="19.2.7",yo}var ny;function DS(){if(ny)return Ch.exports;ny=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(a){console.error(a)}}return e(),Ch.exports=AS(),Ch.exports}var CS=DS();/**
|
|
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 kb=e=>{throw TypeError(e)},Tb=(e,a,r)=>a.has(e)||kb("Cannot "+r),Wa=(e,a,r)=>(Tb(e,a,"read from private field"),r?r.call(e):a.get(e)),Ao=(e,a,r)=>a.has(e)?kb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,r),Rr=(e,a,r,s)=>(Tb(e,a,"write to private field"),a.set(e,r),r),ld=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,km=/^[\\/]{2}/;function Ab(e,a){return a+e.replace(/\\/g,"/")}var ay="popstate";function ry(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function OS(e={}){function a(s,u){var g;let c=(g=u.state)==null?void 0:g.masked,{pathname:d,search:h,hash:p}=c||s.location;return Ho("",{pathname:d,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:Cr(u)}return _S(a,r,null,e)}function lt(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function pn(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function MS(){return Math.random().toString(36).substring(2,10)}function ly(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ho(e,a,r=null,s,u){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?Or(a):a,state:r,key:a&&a.key||s||MS(),mask:u}}function Cr({pathname:e="/",search:a="",hash:r=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Or(e){let a={};if(e){let r=e.indexOf("#");r>=0&&(a.hash=e.substring(r),e=e.substring(0,r));let s=e.indexOf("?");s>=0&&(a.search=e.substring(s),e=e.substring(0,s)),e&&(a.pathname=e)}return a}function _S(e,a,r,s={}){let{window:u=document.defaultView,v5Compat:c=!1}=s,d=u.history,h="POP",p=null,g=y();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function y(){return(d.state||{idx:null}).idx}function x(){h="POP";let R=y(),L=R==null?null:R-g;g=R,p&&p({action:h,location:j.location,delta:L})}function E(R,L){h="PUSH";let B=ry(R)?R:Ho(j.location,R,L);g=y()+1;let I=ly(B,g),F=j.createHref(B.mask||B);try{d.pushState(I,"",F)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;u.location.assign(F)}c&&p&&p({action:h,location:j.location,delta:1})}function S(R,L){h="REPLACE";let B=ry(R)?R:Ho(j.location,R,L);g=y();let I=ly(B,g),F=j.createHref(B.mask||B);d.replaceState(I,"",F),c&&p&&p({action:h,location:j.location,delta:0})}function w(R){return Db(u,R)}let j={get action(){return h},get location(){return e(u,d)},listen(R){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(ay,x),p=R,()=>{u.removeEventListener(ay,x),p=null}},createHref(R){return a(u,R)},createURL:w,encodeLocation(R){let L=w(R);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:E,replace:S,go(R){return d.go(R)}};return j}function Db(e,a,r=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),lt(s,"No window.location.(origin|href) available to create URL");let u=typeof a=="string"?a:Cr(a);return u=u.replace(/ $/,"%20"),!r&&km.test(u)&&(u=s+u),new URL(u,s)}var Do,sy=class{constructor(e){if(Ao(this,Do,new Map),e)for(let[a,r]of e)this.set(a,r)}get(e){if(Wa(this,Do).has(e))return Wa(this,Do).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Wa(this,Do).set(e,a)}};Do=new WeakMap;var LS=new Set(["lazy","caseSensitive","path","id","index","children"]);function zS(e){return LS.has(e)}var $S=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function US(e){return $S.has(e)}function BS(e){return e.index===!0}function qo(e,a,r=[],s={},u=!1){return e.map((c,d)=>{let h=[...r,String(d)],p=typeof c.id=="string"?c.id:h.join("-");if(lt(c.index!==!0||!c.children,"Cannot specify children on an index route"),lt(u||!s[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),BS(c)){let g={...c,id:p};return s[p]=iy(g,a(g)),g}else{let g={...c,id:p,children:void 0};return s[p]=iy(g,a(g)),c.children&&(g.children=qo(c.children,a,h,s,u)),g}})}function iy(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function Cb(e,a,r="/"){return dr(e,a,r,!1)}function dr(e,a,r,s,u){let c=typeof a=="string"?Or(a):a,d=Ia(c.pathname||"/",r);if(d==null)return null;let h=u??$u(e),p=null,g=KS(d);for(let y=0;p==null&&y<h.length;++y)p=QS(h[y],g,s);return p}function Ob(e,a){let{route:r,pathname:s,params:u}=e;return{id:r.id,pathname:s,params:u,data:a[r.id],loaderData:a[r.id],handle:r.handle}}function $u(e){let a=Mb(e);return IS(a),a}function Mb(e,a=[],r=[],s="",u=!1){let c=(d,h,p=u,g)=>{let y={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:h,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&p)return;lt(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 x=tr([s,y.relativePath]),E=r.concat(y);d.children&&d.children.length>0&&(lt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Mb(d.children,a,E,x,p)),!(d.path==null&&!d.index)&&a.push({path:x,score:GS(x,d.index),routesMeta:E.map((S,w)=>{let[j,R]=zb(S.relativePath,S.caseSensitive,w===E.length-1);return{...S,matcher:j,compiledParams:R}})})};return e.forEach((d,h)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,h);else for(let g of _b(d.path))c(d,h,!0,g)}),a}function _b(e){let a=e.split("/");if(a.length===0)return[];let[r,...s]=a,u=r.endsWith("?"),c=r.replace(/\?$/,"");if(s.length===0)return u?[c,""]:[c];let d=_b(s.join("/")),h=[];return h.push(...d.map(p=>p===""?c:[c,p].join("/"))),u&&h.push(...d),h.map(p=>e.startsWith("/")&&p===""?"/":p)}function IS(e){e.sort((a,r)=>a.score!==r.score?r.score-a.score:XS(a.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var HS=/^:[\w-]+$/,qS=3,PS=2,FS=1,VS=10,YS=-2,oy=e=>e==="*";function GS(e,a){let r=e.split("/"),s=r.length;return r.some(oy)&&(s+=YS),a&&(s+=PS),r.filter(u=>!oy(u)).reduce((u,c)=>u+(HS.test(c)?qS:c===""?FS:VS),s)}function XS(e,a){return e.length===a.length&&e.slice(0,-1).every((s,u)=>s===a[u])?e[e.length-1]-a[a.length-1]:0}function QS(e,a,r=!1){let{routesMeta:s}=e,u={},c="/",d=[];for(let h=0;h<s.length;++h){let p=s[h],g=h===s.length-1,y=c==="/"?a:a.slice(c.length)||"/",x={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},E=p.matcher&&p.compiledParams?Lb(x,y,p.matcher,p.compiledParams):Vu(x,y),S=p.route;if(!E&&g&&r&&!s[s.length-1].route.index&&(E=Vu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!E)return null;Object.assign(u,E.params),d.push({params:u,pathname:tr([c,E.pathname]),pathnameBase:JS(tr([c,E.pathnameBase])),route:S}),E.pathnameBase!=="/"&&(c=tr([c,E.pathnameBase]))}return d}function Vu(e,a){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=zb(e.path,e.caseSensitive,e.end);return Lb(e,a,r,s)}function Lb(e,a,r,s){let u=a.match(r);if(!u)return null;let c=u[0],d=c.replace(/(.)\/+$/,"$1"),h=u.slice(1);return{params:s.reduce((g,{paramName:y,isOptional:x},E)=>{if(y==="*"){let w=h[E]||"";d=c.slice(0,c.length-w.length).replace(/(.)\/+$/,"$1")}const S=h[E];return x&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:c,pathnameBase:d,pattern:e}}function zb(e,a=!1,r=!0){pn(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,(d,h,p,g,y)=>{if(s.push({paramName:h,isOptional:p!=null}),p){let x=y.charAt(g+d.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),u+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?u+="\\/*$":e!==""&&e!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),s]}function KS(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return pn(!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 (${a}).`),e}}function Ia(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}function ZS({basename:e,pathname:a}){return a==="/"?e:tr([e,a])}var Tm=e=>ld.test(e);function WS(e,a="/"){let{pathname:r,search:s="",hash:u=""}=typeof e=="string"?Or(e):e,c;return r?(r=Dm(r),r.startsWith("/")?c=cy(r.substring(1),"/"):c=cy(r,a)):c=a,{pathname:c,search:eE(s),hash:tE(u)}}function cy(e,a){let r=Yu(a).split("/");return e.split("/").forEach(u=>{u===".."?r.length>1&&r.pop():u!=="."&&r.push(u)}),r.length>1?r.join("/"):"/"}function Lh(e,a,r,s){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` 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 $b(e){return e.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function Am(e){let a=$b(e);return a.map((r,s)=>s===a.length-1?r.pathname:r.pathnameBase)}function sd(e,a,r,s=!1){let u;typeof e=="string"?u=Or(e):(u={...e},lt(!u.pathname||!u.pathname.includes("?"),Lh("?","pathname","search",u)),lt(!u.pathname||!u.pathname.includes("#"),Lh("#","pathname","hash",u)),lt(!u.search||!u.search.includes("#"),Lh("#","search","hash",u)));let c=e===""||u.pathname==="",d=c?"/":u.pathname,h;if(d==null)h=r;else{let x=a.length-1;if(!s&&d.startsWith("..")){let E=d.split("/");for(;E[0]==="..";)E.shift(),x-=1;u.pathname=E.join("/")}h=x>=0?a[x]:"/"}let p=WS(u,h),g=d&&d!=="/"&&d.endsWith("/"),y=(c||d===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(g||y)&&(p.pathname+="/"),p}var Dm=e=>e.replace(/[\\/]{2,}/g,"/"),tr=e=>Dm(e.join("/")),Yu=e=>e.replace(/\/+$/,""),JS=e=>Yu(e).replace(/^\/*/,"/"),eE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,En=(e,a=302)=>{let r=a;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})},nE=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ko=class{constructor(e,a,r,s=!1){this.status=e,this.statusText=a||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function wi(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Zo(e){let a=e.map(r=>r.route.path).filter(Boolean);return tr(a)||"/"}var Ub=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bb(e,a){let r=e;if(typeof r!="string"||!ld.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,u=!1;if(Ub)try{let c=new URL(window.location.href),d=km.test(r)?new URL(Ab(r,c.protocol)):new URL(r),h=Ia(d.pathname,a);d.origin===c.origin&&h!=null?r=h+d.search+d.hash:u=!0}catch{pn(!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 ql=Symbol("Uninstrumented");function aE(e,a){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(u=>u({id:a.id,index:a.index,path:a.path,instrument(c){let d=Object.keys(r);for(let h of d)c[h]&&r[h].push(c[h])}}));let s={};if(typeof a.lazy=="function"&&r.lazy.length>0){let u=pi(r.lazy,a.lazy,()=>{});u&&(s.lazy=u)}if(typeof a.lazy=="object"){let u=a.lazy;["middleware","loader","action"].forEach(c=>{let d=u[c],h=r[`lazy.${c}`];if(typeof d=="function"&&h.length>0){let p=pi(h,d,()=>{});p&&(s.lazy=Object.assign(s.lazy||{},{[c]:p}))}})}return["loader","action"].forEach(u=>{let c=a[u];if(typeof c=="function"&&r[u].length>0){let d=c[ql]??c,h=pi(r[u],d,(...p)=>uy(p[0]));h&&(u==="loader"&&d.hydrate===!0&&(h.hydrate=!0),h[ql]=d,s[u]=h)}}),a.middleware&&a.middleware.length>0&&r.middleware.length>0&&(s.middleware=a.middleware.map(u=>{let c=u[ql]??u,d=pi(r.middleware,c,(...h)=>uy(h[0]));return d?(d[ql]=c,d):u})),s}function rE(e,a){let r={navigate:[],fetch:[]};if(a.forEach(s=>s({instrument(u){let c=Object.keys(u);for(let d of c)u[d]&&r[d].push(u[d])}})),r.navigate.length>0){let s=e.navigate[ql]??e.navigate,u=pi(r.navigate,s,(...c)=>{let[d,h]=c;return{to:typeof d=="number"||typeof d=="string"?d:d?Cr(d):".",...dy(e,h??{})}});u&&(u[ql]=s,e.navigate=u)}if(r.fetch.length>0){let s=e.fetch[ql]??e.fetch,u=pi(r.fetch,s,(...c)=>{let[d,,h,p]=c;return{href:h??".",fetcherKey:d,...dy(e,p??{})}});u&&(u[ql]=s,e.fetch=u)}return e}function pi(e,a,r){return e.length===0?null:async(...s)=>{let u=await Ib(e,r(...s),()=>a(...s),e.length-1);if(u.type==="error")throw u.value;return u.value}}async function Ib(e,a,r,s){let u=e[s],c;if(u){let d,h=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=Ib(e,a,r,s-1),c=await d,lt(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,a)}catch(p){console.error("An instrumentation function threw an error:",p)}d||await h(),await d}else try{c={type:"success",value:await r()}}catch(d){c={type:"error",value:d}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function uy(e){let{request:a,context:r,params:s,pattern:u}=e;return{request:lE(a),params:{...s},pattern:u,context:sE(r)}}function dy(e,a){return{currentUrl:Cr(e.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function lE(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function sE(e){if(oE(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var iE=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oE(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===iE}var Hb=["POST","PUT","PATCH","DELETE"],cE=new Set(Hb),uE=["GET",...Hb],dE=new Set(uE),qb=new Set([301,302,303,307,308]),fE=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},Pb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hE=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Fb="remix-router-transitions",Vb=Symbol("ResetLoaderData"),bs,fi,Ul,hi,mE=class{constructor(e){Ao(this,bs),Ao(this,fi),Ao(this,Ul),Ao(this,hi),Rr(this,bs,e),Rr(this,fi,$u(e))}get stableRoutes(){return Wa(this,bs)}get activeRoutes(){return Wa(this,Ul)??Wa(this,bs)}get branches(){return Wa(this,hi)??Wa(this,fi)}get hasHMRRoutes(){return Wa(this,Ul)!=null}setRoutes(e){Rr(this,bs,e),Rr(this,fi,$u(e))}setHmrRoutes(e){Rr(this,Ul,e),Rr(this,hi,$u(e))}commitHmrRoutes(){Wa(this,Ul)&&(Rr(this,bs,Wa(this,Ul)),Rr(this,fi,Wa(this,hi)),Rr(this,Ul,void 0),Rr(this,hi,void 0))}};bs=new WeakMap;fi=new WeakMap;Ul=new WeakMap;hi=new WeakMap;function pE(e){const a=e.window?e.window:typeof window<"u"?window:void 0,r=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";lt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],u=e.mapRouteProperties||hE,c=u;if(e.instrumentations){let D=e.instrumentations;c=z=>({...u(z),...aE(D.map(q=>q.route).filter(Boolean),z)})}let d={},h=new mE(qo(e.routes,c,void 0,d)),p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=e.dataStrategy||bE,y={...e.future},x=null,E=new Set,S=null,w=null,j=null,R=null,L=e.hydrationData!=null,B=dr(h.activeRoutes,e.history.location,p,!1,h.branches),I=!1,F=null,W,ne;if(B==null&&!e.patchRoutesOnNavigation){let D=Ja(404,{pathname:e.history.location.pathname}),{matches:z,route:q}=bu(h.activeRoutes);W=!0,ne=!W,B=z,F={[q.id]:D}}else if(B&&!e.hydrationData&&Vt(B,h.activeRoutes,e.history.location.pathname).active&&(B=null),B)if(B.some(D=>D.route.lazy))W=!1,ne=!W;else if(!B.some(D=>Cm(D.route)))W=!0,ne=!W;else{let D=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,q=B;if(z){let Z=B.findIndex(ie=>z[ie.route.id]!==void 0);q=q.slice(0,Z+1)}ne=!1,W=!0,q.forEach(Z=>{let ie=Yb(Z.route,D,z);ne=ne||ie.renderFallback,W=W&&!ie.shouldLoad})}else{W=!1,ne=!W,B=[];let D=Vt(null,h.activeRoutes,e.history.location.pathname);D.active&&D.matches&&(I=!0,B=D.matches)}let _,T={historyAction:e.history.action,location:e.history.location,matches:B,initialized:W,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||F,fetchers:new Map,blockers:new Map},de="POP",ge=null,be=!1,re,je=!1,Te=new Map,J=null,$=!1,P=!1,ce=new Set,me=new Map,Se=0,A=-1,C=new Map,G=new Set,ae=new Map,he=new Map,fe=new Set,Re=new Map,qe,Le=null;function $e(){if(x=e.history.listen(({action:D,location:z,delta:q})=>{if(qe){qe(),qe=void 0;return}pn(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 Z=St({currentLocation:T.location,nextLocation:z,historyAction:D});if(Z&&q!=null){let ie=new Promise(ke=>{qe=ke});e.history.go(q*-1),wt(Z,{state:"blocked",location:z,proceed(){wt(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),ie.then(()=>e.history.go(q))},reset(){let ke=new Map(T.blockers);ke.set(Z,bo),dt({blockers:ke})}}),ge==null||ge.resolve(),ge=null;return}return Pt(D,z)}),r){BE(a,Te);let D=()=>IE(a,Te);a.addEventListener("pagehide",D),J=()=>a.removeEventListener("pagehide",D)}return T.initialized||Pt("POP",T.location,{initialHydration:!0}),_}function jt(){x&&x(),J&&J(),E.clear(),re&&re.abort(),T.fetchers.forEach((D,z)=>Fe(T.fetchers,z)),T.blockers.forEach((D,z)=>_e(z))}function bt(D){if(E.add(D),S){let{newErrors:z}=S;S=null,D(T,{deletedFetchers:[],newErrors:z,viewTransitionOpts:void 0,flushSync:!1})}return()=>E.delete(D)}function dt(D,z={}){D.matches&&(D.matches=D.matches.map(ie=>{let ke=d[ie.route.id],xe=ie.route;return xe.element!==ke.element||xe.errorElement!==ke.errorElement||xe.hydrateFallbackElement!==ke.hydrateFallbackElement?{...ie,route:ke}:ie})),T={...T,...D};let q=[],Z=[];T.fetchers.forEach((ie,ke)=>{ie.state==="idle"&&(fe.has(ke)?q.push(ke):Z.push(ke))}),fe.forEach(ie=>{!T.fetchers.has(ie)&&!me.has(ie)&&q.push(ie)}),E.size===0&&(S={newErrors:D.errors??null}),[...E].forEach(ie=>ie(T,{deletedFetchers:q,newErrors:D.errors??null,viewTransitionOpts:z.viewTransitionOpts,flushSync:z.flushSync===!0})),q.forEach(ie=>Fe(T.fetchers,ie)),Z.forEach(ie=>T.fetchers.delete(ie))}function se(D,z,{flushSync:q}={}){var Be,We;let Z=T.actionData!=null&&T.navigation.formMethod!=null&&da(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Be=D.state)==null?void 0:Be._isRedirect)!==!0,ie;z.actionData?Object.keys(z.actionData).length>0?ie=z.actionData:ie=null:Z?ie=T.actionData:ie=null;let ke=z.loaderData?wy(T.loaderData,z.loaderData,z.matches||[],z.errors):T.loaderData,xe=T.blockers;xe.size>0&&(xe=new Map(xe),xe.forEach((Oe,tt)=>xe.set(tt,bo)));let Ce=$?!1:tn(D,z.matches||T.matches),Ne=be===!0||T.navigation.formMethod!=null&&da(T.navigation.formMethod)&&((We=D.state)==null?void 0:We._isRedirect)!==!0;h.commitHmrRoutes(),$||de==="POP"||(de==="PUSH"?e.history.push(D,D.state):de==="REPLACE"&&e.history.replace(D,D.state));let ze;if(de==="POP"){let Oe=Te.get(T.location.pathname);Oe&&Oe.has(D.pathname)?ze={currentLocation:T.location,nextLocation:D}:Te.has(D.pathname)&&(ze={currentLocation:D,nextLocation:T.location})}else if(je){let Oe=Te.get(T.location.pathname);Oe?Oe.add(D.pathname):(Oe=new Set([D.pathname]),Te.set(T.location.pathname,Oe)),ze={currentLocation:T.location,nextLocation:D}}dt({...z,actionData:ie,loaderData:ke,historyAction:de,location:D,initialized:!0,renderFallback:!1,navigation:zh,revalidation:"idle",restoreScrollPosition:Ce,preventScrollReset:Ne,blockers:xe},{viewTransitionOpts:ze,flushSync:q===!0}),de="POP",be=!1,je=!1,$=!1,P=!1,ge==null||ge.resolve(),ge=null,Le==null||Le.resolve(),Le=null}async function Ie(D,z){if(ge==null||ge.resolve(),ge=null,typeof D=="number"){ge||(ge=jy());let Ve=ge.promise;return e.history.go(D),Ve}let q=om(T.location,T.matches,p,D,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:Z,submission:ie,error:ke}=fy(!1,q,z),xe;z!=null&&z.mask&&(xe={pathname:"",search:"",hash:"",...typeof z.mask=="string"?Or(z.mask):{...T.location.mask,...z.mask}});let Ce=T.location,Ne=Ho(Ce,Z,z&&z.state,void 0,xe);Ne={...Ne,...e.history.encodeLocation(Ne)};let ze=z&&z.replace!=null?z.replace:void 0,Be="PUSH";ze===!0?Be="REPLACE":ze===!1||ie!=null&&da(ie.formMethod)&&ie.formAction===T.location.pathname+T.location.search&&(Be="REPLACE");let We=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Oe=(z&&z.flushSync)===!0,tt=St({currentLocation:Ce,nextLocation:Ne,historyAction:Be});if(tt){wt(tt,{state:"blocked",location:Ne,proceed(){wt(tt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ne}),Ie(D,z)},reset(){let Ve=new Map(T.blockers);Ve.set(tt,bo),dt({blockers:Ve})}});return}await Pt(Be,Ne,{submission:ie,pendingError:ke,preventScrollReset:We,replace:z&&z.replace,enableViewTransition:z&&z.viewTransition,flushSync:Oe,callSiteDefaultShouldRevalidate:z&&z.defaultShouldRevalidate})}function st(){Le||(Le=jy()),Vn(),dt({revalidation:"loading"});let D=Le.promise;return T.navigation.state==="submitting"?D:T.navigation.state==="idle"?(Pt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),D):(Pt(de||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:je===!0}),D)}async function Pt(D,z,q){re&&re.abort(),re=null,de=D,$=(q&&q.startUninterruptedRevalidation)===!0,sn(T.location,T.matches),be=(q&&q.preventScrollReset)===!0,je=(q&&q.enableViewTransition)===!0;let Z=h.activeRoutes,ie=q!=null&&q.initialHydration&&T.matches&&T.matches.length>0&&!I?T.matches:dr(Z,z,p,!1,h.branches),ke=(q&&q.flushSync)===!0;if(ie&&T.initialized&&!P&&AE(T.location,z)&&!(q&&q.submission&&da(q.submission.formMethod))){se(z,{matches:ie},{flushSync:ke});return}let xe=Vt(ie,Z,z.pathname);if(xe.active&&xe.matches&&(ie=xe.matches),!ie){let{error:at,notFoundMatches:mt,route:ft}=Rt(z.pathname);se(z,{matches:mt,loaderData:{},errors:{[ft.id]:at}},{flushSync:ke});return}let Ce=q&&q.overrideNavigation?{...q.overrideNavigation,matches:ie,historyAction:D}:void 0;re=new AbortController;let Ne=mi(e.history,z,re.signal,q&&q.submission),ze=e.getContext?await e.getContext():new sy,Be;if(q&&q.pendingError)Be=[Hl(ie).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&da(q.submission.formMethod)){let at=await yn(Ne,z,q.submission,ie,D,ze,xe.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:ke});if(at.shortCircuited)return;if(at.pendingActionResult){let[mt,ft]=at.pendingActionResult;if(Ua(ft)&&wi(ft.error)&&ft.error.status===404){re=null,se(z,{matches:at.matches,loaderData:{},errors:{[mt]:ft.error}});return}}ie=at.matches||ie,Be=at.pendingActionResult,Ce=$h(z,ie,D,q.submission),ke=!1,xe.active=!1,Ne=mi(e.history,Ne.url,Ne.signal)}let{shortCircuited:We,matches:Oe,loaderData:tt,errors:Ve,workingFetchers:Yt}=await Ct(Ne,z,ie,D,ze,xe.active,Ce,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,ke,Be,q&&q.callSiteDefaultShouldRevalidate);We||(re=null,se(z,{matches:Oe||ie,...Sy(Be),loaderData:tt,errors:Ve,...Yt?{fetchers:Yt}:{}}))}async function yn(D,z,q,Z,ie,ke,xe,Ce,Ne={}){Vn();let ze=$E(z,Z,ie,q);if(dt({navigation:ze},{flushSync:Ne.flushSync===!0}),xe){let Oe=await gt(Z,z.pathname,D.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:Ve,route:Yt}=bu(h.activeRoutes);return{matches:Ve,pendingActionResult:[Yt.id,{type:"error",error:Oe.error}]}}let tt=Hl(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,pendingActionResult:[tt,{type:"error",error:Oe.error}]}}else if(Oe.matches)Z=Oe.matches;else{let{notFoundMatches:tt,error:Ve,route:Yt}=Rt(z.pathname);return{matches:tt,pendingActionResult:[Yt.id,{type:"error",error:Ve}]}}}let Be,We=Uu(Z,z);if(!We.route.action&&!We.route.lazy)Be={type:"error",error:Ja(405,{method:D.method,pathname:z.pathname,routeId:We.route.id})};else{let Oe=xi(c,d,D,z,Z,We,Ce?[]:s,ke),tt=await ha(D,z,Oe,ke,null);if(Be=tt[We.route.id],!Be){for(let Ve of Z)if(tt[Ve.route.id]){Be=tt[Ve.route.id];break}}if(D.signal.aborted)return{shortCircuited:!0}}if(ws(Be)){let Oe;return Ne&&Ne.replace!=null?Oe=Ne.replace:Oe=xy(Be.response.headers.get("Location"),new URL(D.url),p,e.history)===T.location.pathname+T.location.search,await fa(D,Be,!0,{submission:q,replace:Oe}),{shortCircuited:!0}}if(Ua(Be)){let Oe=Hl(Z,We.route.id);return(Ne&&Ne.replace)!==!0&&(de="PUSH"),{matches:Z,pendingActionResult:[Oe.route.id,Be,We.route.id]}}return{matches:Z,pendingActionResult:[We.route.id,Be]}}async function Ct(D,z,q,Z,ie,ke,xe,Ce,Ne,ze,Be,We,Oe,tt){let Ve=xe||$h(z,q,Z,Ce),Yt=Ce||Ne||Ny(Ve),at=!$&&!Be;if(ke){if(at){let Tt=It(Oe);dt({navigation:Ve,...Tt!==void 0?{actionData:Tt}:{}},{flushSync:We})}let Je=await gt(q,z.pathname,D.signal);if(Je.type==="aborted")return{shortCircuited:!0};if(Je.type==="error"){if(Je.partialMatches.length===0){let{matches:an,route:ra}=bu(h.activeRoutes);return{matches:an,loaderData:{},errors:{[ra.id]:Je.error}}}let Tt=Hl(Je.partialMatches).route.id;return{matches:Je.partialMatches,loaderData:{},errors:{[Tt]:Je.error}}}else if(Je.matches)q=Je.matches;else{let{error:Tt,notFoundMatches:an,route:ra}=Rt(z.pathname);return{matches:an,loaderData:{},errors:{[ra.id]:Tt}}}}let mt=h.activeRoutes,{dsMatches:ft,revalidatingFetchers:pt}=hy(D,ie,c,d,e.history,T,q,Yt,z,Be?[]:s,Be===!0,P,ce,fe,ae,G,mt,p,e.patchRoutesOnNavigation!=null,h.branches,Oe,tt);if(A=++Se,!e.dataStrategy&&!ft.some(Je=>Je.shouldLoad)&&!ft.some(Je=>Je.route.middleware&&Je.route.middleware.length>0)&&pt.length===0){let Je=new Map(T.fetchers),Tt=Xn(Je);return se(z,{matches:q,loaderData:{},errors:Oe&&Ua(Oe[1])?{[Oe[0]]:Oe[1].error}:null,...Sy(Oe),...Tt?{fetchers:Je}:{}},{flushSync:We}),{shortCircuited:!0}}if(at){let Je={};if(!ke){Je.navigation=Ve;let Tt=It(Oe);Tt!==void 0&&(Je.actionData=Tt)}pt.length>0&&(Je.fetchers=Jt(pt)),dt(Je,{flushSync:We})}pt.forEach(Je=>{Ot(Je.key),Je.controller&&me.set(Je.key,Je.controller)});let nn=()=>pt.forEach(Je=>Ot(Je.key));re&&re.signal.addEventListener("abort",nn);let{loaderResults:Qn,fetcherResults:jn}=await na(ft,pt,D,z,ie);if(D.signal.aborted)return{shortCircuited:!0};re&&re.signal.removeEventListener("abort",nn),pt.forEach(Je=>me.delete(Je.key));let zn=wu(Qn);if(zn)return await fa(D,zn.result,!0,{replace:ze}),{shortCircuited:!0};if(zn=wu(jn),zn)return G.add(zn.key),await fa(D,zn.result,!0,{replace:ze}),{shortCircuited:!0};let $n=new Map(T.fetchers),{loaderData:Kn,errors:xa}=by(T,q,Qn,Oe,pt,jn,$n);Be&&T.errors&&(xa={...T.errors,...xa});let fl=Xn($n),aa=bn(A,$n),vr=fl||aa||pt.length>0;return{matches:q,loaderData:Kn,errors:xa,...vr?{workingFetchers:$n}:{}}}function It(D){if(D&&!Ua(D[1]))return{[D[0]]:D[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Jt(D){let z=new Map(T.fetchers);return D.forEach(q=>{let Z=z.get(q.key),ie=wo(void 0,Z?Z.data:void 0);z.set(q.key,ie)}),z}async function Pn(D,z,q,Z){Ot(D);let ie=(Z&&Z.flushSync)===!0,ke=h.activeRoutes,xe=om(T.location,T.matches,p,q,z,Z==null?void 0:Z.relative),Ce=dr(ke,xe,p,!1,h.branches),Ne=Vt(Ce,ke,xe);if(Ne.active&&Ne.matches&&(Ce=Ne.matches),!Ce){Ae(D,z,Ja(404,{pathname:xe}),{flushSync:ie});return}let{path:ze,submission:Be,error:We}=fy(!0,xe,Z);if(We){Ae(D,z,We,{flushSync:ie});return}let Oe=e.getContext?await e.getContext():new sy,tt=(Z&&Z.preventScrollReset)===!0;if(Be&&da(Be.formMethod)){await Fn(D,z,ze,Ce,Oe,Ne.active,ie,tt,Be,Z&&Z.defaultShouldRevalidate);return}ae.set(D,{routeId:z,path:ze}),await ln(D,z,ze,Ce,Oe,Ne.active,ie,tt,Be)}async function Fn(D,z,q,Z,ie,ke,xe,Ce,Ne,ze){Vn(),ae.delete(D);let Be=T.fetchers.get(D);pe(D,UE(Ne,Be),{flushSync:xe});let We=new AbortController,Oe=mi(e.history,q,We.signal,Ne);if(ke){let At=await gt(Z,new URL(Oe.url).pathname,Oe.signal,D);if(At.type==="aborted")return;if(At.type==="error"){Ae(D,z,At.error,{flushSync:xe});return}else if(At.matches)Z=At.matches;else{Ae(D,z,Ja(404,{pathname:q}),{flushSync:xe});return}}let tt=Uu(Z,q);if(!tt.route.action&&!tt.route.lazy){let At=Ja(405,{method:Ne.formMethod,pathname:q,routeId:z});Ae(D,z,At,{flushSync:xe});return}me.set(D,We);let Ve=Se,Yt=xi(c,d,Oe,q,Z,tt,s,ie),at=await ha(Oe,q,Yt,ie,D),mt=at[tt.route.id];if(!mt){for(let At of Yt)if(at[At.route.id]){mt=at[At.route.id];break}}if(Oe.signal.aborted){me.get(D)===We&&me.delete(D);return}if(fe.has(D)){if(ws(mt)||Ua(mt)){pe(D,Tr(void 0));return}}else{if(ws(mt))if(me.delete(D),A>Ve){pe(D,Tr(void 0));return}else return G.add(D),pe(D,wo(Ne)),fa(Oe,mt,!1,{fetcherSubmission:Ne,preventScrollReset:Ce});if(Ua(mt)){Ae(D,z,mt.error);return}}let ft=T.navigation.location||T.location,pt=mi(e.history,ft,We.signal),nn=h.activeRoutes,Qn=T.navigation.state!=="idle"?dr(nn,T.navigation.location,p,!1,h.branches):T.matches;lt(Qn,"Didn't find any matches after fetcher action");let jn=++Se;C.set(D,jn);let{dsMatches:zn,revalidatingFetchers:$n}=hy(pt,ie,c,d,e.history,T,Qn,Ne,ft,s,!1,P,ce,fe,ae,G,nn,p,e.patchRoutesOnNavigation!=null,h.branches,[tt.route.id,mt],ze),Kn=wo(Ne,mt.data),xa=new Map(T.fetchers);xa.set(D,Kn),$n.filter(At=>At.key!==D).forEach(At=>{let Aa=At.key,Zn=xa.get(Aa),Zl=wo(void 0,Zn?Zn.data:void 0);xa.set(Aa,Zl),Ot(Aa),At.controller&&me.set(Aa,At.controller)}),dt({fetchers:xa});let fl=()=>$n.forEach(At=>Ot(At.key));We.signal.addEventListener("abort",fl);let{loaderResults:aa,fetcherResults:vr}=await na(zn,$n,pt,ft,ie);if(We.signal.aborted)return;We.signal.removeEventListener("abort",fl),C.delete(D),me.delete(D),$n.forEach(At=>me.delete(At.key));let Je=T.fetchers.has(D),Tt=At=>{if(!Je)return At;let Aa=new Map(At.fetchers);return Aa.set(D,Tr(mt.data)),{...At,fetchers:Aa}},an=wu(aa);if(an)return T=Tt(T),fa(pt,an.result,!1,{preventScrollReset:Ce});if(an=wu(vr),an)return G.add(an.key),T=Tt(T),fa(pt,an.result,!1,{preventScrollReset:Ce});let ra=new Map(T.fetchers);Je&&ra.set(D,Tr(mt.data));let{loaderData:Un,errors:_r}=by(T,Qn,aa,void 0,$n,vr,ra);bn(jn,ra),T.navigation.state==="loading"&&jn>A?(lt(de,"Expected pending action"),re&&re.abort(),se(T.navigation.location,{matches:Qn,loaderData:Un,errors:_r,fetchers:ra})):(dt({errors:_r,loaderData:wy(T.loaderData,Un,Qn,_r),fetchers:ra}),P=!1)}async function ln(D,z,q,Z,ie,ke,xe,Ce,Ne){let ze=T.fetchers.get(D);pe(D,wo(Ne,ze?ze.data:void 0),{flushSync:xe});let Be=new AbortController,We=mi(e.history,q,Be.signal);if(ke){let mt=await gt(Z,new URL(We.url).pathname,We.signal,D);if(mt.type==="aborted")return;if(mt.type==="error"){Ae(D,z,mt.error,{flushSync:xe});return}else if(mt.matches)Z=mt.matches;else{Ae(D,z,Ja(404,{pathname:q}),{flushSync:xe});return}}let Oe=Uu(Z,q);me.set(D,Be);let tt=Se,Ve=xi(c,d,We,q,Z,Oe,s,ie),Yt=await ha(We,q,Ve,ie,D),at=Yt[Oe.route.id];if(!at){for(let mt of Z)if(Yt[mt.route.id]){at=Yt[mt.route.id];break}}if(me.get(D)===Be&&me.delete(D),!We.signal.aborted){if(fe.has(D)){pe(D,Tr(void 0));return}if(ws(at))if(A>tt){pe(D,Tr(void 0));return}else{G.add(D),await fa(We,at,!1,{preventScrollReset:Ce});return}if(Ua(at)){Ae(D,z,at.error);return}pe(D,Tr(at.data))}}async function fa(D,z,q,{submission:Z,fetcherSubmission:ie,preventScrollReset:ke,replace:xe}={}){q||(ge==null||ge.resolve(),ge=null),z.response.headers.has("X-Remix-Revalidate")&&(P=!0);let Ce=z.response.headers.get("Location");lt(Ce,"Expected a Location header on the redirect Response"),Ce=xy(Ce,new URL(D.url),p,e.history);let Ne=Ho(T.location,Ce,{_isRedirect:!0});if(r){let Ve=!1;if(z.response.headers.has("X-Remix-Reload-Document"))Ve=!0;else if(Tm(Ce)){const Yt=Db(a,Ce,!0);Ve=Yt.origin!==a.location.origin||Ia(Yt.pathname,p)==null}if(Ve){xe?a.location.replace(Ce):a.location.assign(Ce);return}}re=null;let ze=xe===!0||z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Be,formAction:We,formEncType:Oe}=T.navigation;!Z&&!ie&&Be&&We&&Oe&&(Z=Ny(T.navigation));let tt=Z||ie;if(fE.has(z.response.status)&&tt&&da(tt.formMethod))await Pt(ze,Ne,{submission:{...tt,formAction:Ce},preventScrollReset:ke||be,enableViewTransition:q?je:void 0});else{let Ve=$h(Ne,[],ze,Z);await Pt(ze,Ne,{overrideNavigation:Ve,fetcherSubmission:ie,preventScrollReset:ke||be,enableViewTransition:q?je:void 0})}}async function ha(D,z,q,Z,ie){var Ce;let ke,xe={};try{ke=await SE(g,D,z,q,ie,Z,!1)}catch(Ne){return q.filter(ze=>ze.shouldLoad).forEach(ze=>{xe[ze.route.id]={type:"error",error:Ne}}),xe}if(D.signal.aborted)return xe;if(!da(D.method))for(let Ne of q){if(((Ce=ke[Ne.route.id])==null?void 0:Ce.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,ze]of Object.entries(ke))if(ME(ze)){let Be=ze.result;xe[Ne]={type:"redirect",response:RE(Be,D,Ne,q,p)}}else xe[Ne]=await jE(ze);return xe}async function na(D,z,q,Z,ie){let ke=ha(q,Z,D,ie,null),xe=Promise.all(z.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let We=(await ha(ze.request,ze.path,ze.matches,ie,ze.key))[ze.match.route.id];return{[ze.key]:We}}else return Promise.resolve({[ze.key]:{type:"error",error:Ja(404,{pathname:ze.path})}})})),Ce=await ke,Ne=(await xe).reduce((ze,Be)=>Object.assign(ze,Be),{});return{loaderResults:Ce,fetcherResults:Ne}}function Vn(){P=!0,ae.forEach((D,z)=>{me.has(z)&&ce.add(z),Ot(z)})}function pe(D,z,q={}){let Z=new Map(T.fetchers);Z.set(D,z),dt({fetchers:Z},{flushSync:(q&&q.flushSync)===!0})}function Ae(D,z,q,Z={}){let ie=Hl(T.matches,z),ke=new Map(T.fetchers);Fe(ke,D),dt({errors:{[ie.route.id]:q},fetchers:ke},{flushSync:(Z&&Z.flushSync)===!0})}function De(D){return he.set(D,(he.get(D)||0)+1),fe.has(D)&&fe.delete(D),T.fetchers.get(D)||Pb}function Ke(D,z){Ot(D,z==null?void 0:z.reason),pe(D,Tr(null))}function Fe(D,z){let q=T.fetchers.get(z);me.has(z)&&!(q&&q.state==="loading"&&C.has(z))&&Ot(z),ae.delete(z),C.delete(z),G.delete(z),fe.delete(z),ce.delete(z),D.delete(z)}function ee(D){let z=(he.get(D)||0)-1;z<=0?(he.delete(D),fe.add(D)):he.set(D,z),dt({fetchers:new Map(T.fetchers)})}function Ot(D,z){let q=me.get(D);q&&(q.abort(z),me.delete(D))}function en(D,z){for(let q of D){let Z=z.get(q);lt(Z,`Expected fetcher: ${q}`);let ie=Tr(Z.data);z.set(q,ie)}}function Xn(D){let z=[],q=!1;for(let Z of G){let ie=D.get(Z);lt(ie,`Expected fetcher: ${Z}`),ie.state==="loading"&&(G.delete(Z),z.push(Z),q=!0)}return en(z,D),q}function bn(D,z){let q=[];for(let[Z,ie]of C)if(ie<D){let ke=z.get(Z);lt(ke,`Expected fetcher: ${Z}`),ke.state==="loading"&&(Ot(Z),C.delete(Z),q.push(Z))}return en(q,z),q.length>0}function Ha(D,z){let q=T.blockers.get(D)||bo;return Re.get(D)!==z&&Re.set(D,z),q}function _e(D){T.blockers.delete(D),Re.delete(D)}function wt(D,z){let q=T.blockers.get(D)||bo;lt(q.state==="unblocked"&&z.state==="blocked"||q.state==="blocked"&&z.state==="blocked"||q.state==="blocked"&&z.state==="proceeding"||q.state==="blocked"&&z.state==="unblocked"||q.state==="proceeding"&&z.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${z.state}`);let Z=new Map(T.blockers);Z.set(D,z),dt({blockers:Z})}function St({currentLocation:D,nextLocation:z,historyAction:q}){if(Re.size===0)return;Re.size>1&&pn(!1,"A router only supports one blocker at a time");let Z=Array.from(Re.entries()),[ie,ke]=Z[Z.length-1],xe=T.blockers.get(ie);if(!(xe&&xe.state==="proceeding")&&ke({currentLocation:D,nextLocation:z,historyAction:q}))return ie}function Rt(D){let z=Ja(404,{pathname:D}),q=h.activeRoutes,{matches:Z,route:ie}=bu(q);return{notFoundMatches:Z,route:ie,error:z}}function Ft(D,z,q){if(w=D,R=z,j=q||null,!L&&T.navigation===zh){L=!0;let Z=tn(T.location,T.matches);Z!=null&&dt({restoreScrollPosition:Z})}return()=>{w=null,R=null,j=null}}function Mt(D,z){return j&&j(D,z.map(Z=>Ob(Z,T.loaderData)))||D.key}function sn(D,z){if(w&&R){let q=Mt(D,z);w[q]=R()}}function tn(D,z){if(w){let q=Mt(D,z),Z=w[q];if(typeof Z=="number")return Z}return null}function Vt(D,z,q){if(e.patchRoutesOnNavigation){let Z=h.branches;if(D){if(Object.keys(D[0].params).length>0)return{active:!0,matches:dr(z,q,p,!0,Z)}}else return{active:!0,matches:dr(z,q,p,!0,Z)||[]}}return{active:!1,matches:null}}async function gt(D,z,q,Z){if(!e.patchRoutesOnNavigation)return{type:"success",matches:D};let ie=D;for(;;){let ke=d;try{await e.patchRoutesOnNavigation({signal:q,path:z,matches:ie,fetcherKey:Z,patch:(ze,Be)=>{q.aborted||my(ze,Be,h,ke,c,!1)}})}catch(ze){return{type:"error",error:ze,partialMatches:ie}}if(q.aborted)return{type:"aborted"};let xe=h.branches,Ce=dr(h.activeRoutes,z,p,!1,xe),Ne=null;if(Ce){if(Object.keys(Ce[0].params).length===0)return{type:"success",matches:Ce};if(Ne=dr(h.activeRoutes,z,p,!0,xe),!(Ne&&ie.length<Ne.length&&nt(ie,Ne.slice(0,ie.length))))return{type:"success",matches:Ce}}if(Ne||(Ne=dr(h.activeRoutes,z,p,!0,xe)),!Ne||nt(ie,Ne))return{type:"success",matches:null};ie=Ne}}function nt(D,z){return D.length===z.length&&D.every((q,Z)=>q.route.id===z[Z].route.id)}function Nn(D){d={},h.setHmrRoutes(qo(D,c,void 0,d))}function Ln(D,z,q=!1){my(D,z,h,d,c,q),h.hasHMRRoutes||dt({})}return _={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 d},get window(){return a},initialize:$e,subscribe:bt,enableScrollRestoration:Ft,navigate:Ie,fetch:Pn,revalidate:st,createHref:D=>e.history.createHref(D),encodeLocation:D=>e.history.encodeLocation(D),getFetcher:De,resetFetcher:Ke,deleteFetcher:ee,dispose:jt,getBlocker:Ha,deleteBlocker:_e,patchRoutes:Ln,_internalFetchControllers:me,_internalSetRoutes:Nn,_internalSetStateDoNotUseOrYouWillBreakYourApp(D){dt(D)}},e.instrumentations&&(_=rE(_,e.instrumentations.map(D=>D.router).filter(Boolean))),_}function gE(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function om(e,a,r,s,u,c){let d,h;if(u){d=[];for(let g of a)if(d.push(g),g.route.id===u){h=g;break}}else d=a,h=a[a.length-1];let p=sd(s||".",Am(d),Ia(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=Mm(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),x=y.getAll("index");y.delete("index"),x.filter(S=>S).forEach(S=>y.append("index",S));let E=y.toString();p.search=E?`?${E}`:""}}return r!=="/"&&(p.pathname=ZS({basename:r,pathname:p.pathname})),Cr(p)}function fy(e,a,r){if(!r||!gE(r))return{path:a};if(r.formMethod&&!zE(r.formMethod))return{path:a,error:Ja(405,{method:r.formMethod})};let s=()=>({path:a,error:Ja(400,{type:"invalid-body"})}),c=(r.formMethod||"get").toUpperCase(),d=Jb(a);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!da(c))return s();let x=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:a,submission:{formMethod:c,formAction:d,formEncType:r.formEncType,formData:void 0,json:void 0,text:x}}}else if(r.formEncType==="application/json"){if(!da(c))return s();try{let x=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:a,submission:{formMethod:c,formAction:d,formEncType:r.formEncType,formData:void 0,json:x,text:void 0}}}catch{return s()}}}lt(typeof FormData=="function","FormData is not available in this environment");let h,p;if(r.formData)h=dm(r.formData),p=r.formData;else if(r.body instanceof FormData)h=dm(r.body),p=r.body;else if(r.body instanceof URLSearchParams)h=r.body,p=yy(h);else if(r.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(r.body),p=yy(h)}catch{return s()}let g={formMethod:c,formAction:d,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(da(g.formMethod))return{path:a,submission:g};let y=Or(a);return e&&y.search&&Mm(y.search)&&h.append("index",""),y.search=`?${h}`,{path:Cr(y),submission:g}}function hy(e,a,r,s,u,c,d,h,p,g,y,x,E,S,w,j,R,L,B,I,F,W){var $;let ne=F?Ua(F[1])?F[1].error:F[1].data:void 0,_=u.createURL(c.location),T=u.createURL(p),de;if(y&&c.errors){let P=Object.keys(c.errors)[0];de=d.findIndex(ce=>ce.route.id===P)}else if(F&&Ua(F[1])){let P=F[0];de=d.findIndex(ce=>ce.route.id===P)-1}let ge=F?F[1].statusCode:void 0,be=ge&&ge>=400,re={currentUrl:_,currentParams:(($=c.matches[0])==null?void 0:$.params)||{},nextUrl:T,nextParams:d[0].params,...h,actionResult:ne,actionStatus:ge},je=Zo(d),Te=d.map((P,ce)=>{let{route:me}=P,Se=null;if(de!=null&&ce>de)Se=!1;else if(me.lazy)Se=!0;else if(!Cm(me))Se=!1;else if(y){let{shouldLoad:ae}=Yb(me,c.loaderData,c.errors);Se=ae}else vE(c.loaderData,c.matches[ce],P)&&(Se=!0);if(Se!==null)return cm(r,s,e,p,je,P,g,a,Se);let A=!1;typeof W=="boolean"?A=W:be?A=!1:(x||_.pathname+_.search===T.pathname+T.search||_.search!==T.search||xE(c.matches[ce],P))&&(A=!0);let C={...re,defaultShouldRevalidate:A},G=Mo(P,C);return cm(r,s,e,p,je,P,g,a,G,C,W)}),J=[];return w.forEach((P,ce)=>{if(y||!d.some(fe=>fe.route.id===P.routeId)||S.has(ce))return;let me=c.fetchers.get(ce),Se=me&&me.state!=="idle"&&me.data===void 0,A=dr(R,P.path,L??"/",!1,I);if(!A){if(B&&Se)return;J.push({key:ce,routeId:P.routeId,path:P.path,matches:null,match:null,request:null,controller:null});return}if(j.has(ce))return;let C=Uu(A,P.path),G=new AbortController,ae=mi(u,P.path,G.signal),he=null;if(E.has(ce))E.delete(ce),he=xi(r,s,ae,P.path,A,C,g,a);else if(Se)x&&(he=xi(r,s,ae,P.path,A,C,g,a));else{let fe;typeof W=="boolean"?fe=W:be?fe=!1:fe=x;let Re={...re,defaultShouldRevalidate:fe};Mo(C,Re)&&(he=xi(r,s,ae,P.path,A,C,g,a,Re))}he&&J.push({key:ce,routeId:P.routeId,path:P.path,matches:he,match:C,request:ae,controller:G})}),{dsMatches:Te,revalidatingFetchers:J}}function Cm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Yb(e,a,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Cm(e))return{shouldLoad:!1,renderFallback:!1};let s=a!=null&&e.id in a,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 vE(e,a,r){let s=!a||r.route.id!==a.route.id,u=!e.hasOwnProperty(r.route.id);return s||u}function xE(e,a){let r=e.route.path;return e.pathname!==a.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==a.params["*"]}function Mo(e,a){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(a);if(typeof r=="boolean")return r}return a.defaultShouldRevalidate}function my(e,a,r,s,u,c){let d;if(e){let g=s[e];lt(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),d=g.children}else d=r.activeRoutes;let h=[],p=[];if(a.forEach(g=>{let y=d.find(x=>Gb(g,x));y?p.push({existingRoute:y,newRoute:g}):h.push(g)}),h.length>0){let g=qo(h,u,[e||"_","patch",String((d==null?void 0:d.length)||"0")],s);d.push(...g)}if(c&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:y,newRoute:x}=p[g],E=y,[S]=qo([x],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 Gb(e,a){var r;return"id"in e&&"id"in a&&e.id===a.id?!0:e.index===a.index&&e.path===a.path&&e.caseSensitive===a.caseSensitive?(!e.children||e.children.length===0)&&(!a.children||a.children.length===0)?!0:((r=e.children)==null?void 0:r.every((s,u)=>{var c;return(c=a.children)==null?void 0:c.some(d=>Gb(s,d))}))??!1:!1}var py=new WeakMap,Xb=({key:e,route:a,manifest:r,mapRouteProperties:s})=>{let u=r[a.id];if(lt(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let c=u.lazy[e];if(!c)return;let d=py.get(u);d||(d={},py.set(u,d));let h=d[e];if(h)return h;let p=(async()=>{let g=zS(e),x=u[e]!==void 0&&e!=="hasErrorBoundary";if(g)pn(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),d[e]=Promise.resolve();else if(x)pn(!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 d[e]=p,p},gy=new WeakMap;function yE(e,a,r,s,u){let c=r[e.id];if(lt(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=gy.get(c);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let x=(async()=>{lt(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=US(w),B=c[w]!==void 0&&w!=="hasErrorBoundary";R?pn(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):B?pn(!B,`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 gy.set(c,x),x.catch(()=>{}),{lazyRoutePromise:x,lazyHandlerPromise:x}}let d=Object.keys(e.lazy),h=[],p;for(let y of d){if(u&&u.includes(y))continue;let x=Xb({key:y,route:e,manifest:r,mapRouteProperties:s});x&&(h.push(x),y===a&&(p=x))}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 vy(e){let a=e.matches.filter(u=>u.shouldLoad),r={};return(await Promise.all(a.map(u=>u.resolve()))).forEach((u,c)=>{r[a[c].route.id]=u}),r}async function bE(e){return e.matches.some(a=>a.route.middleware)?Qb(e,()=>vy(e)):vy(e)}function Qb(e,a){return wE(e,a,s=>{if(LE(s))throw s;return s},CE,r);function r(s,u,c){if(c)return Promise.resolve(Object.assign(c.value,{[u]:{type:"error",result:s}}));{let{matches:d}=e,h=Math.min(Math.max(d.findIndex(g=>g.route.id===u),0),Math.max(d.findIndex(g=>g.shouldCallHandler()),0)),p=Hl(d,d[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function wE(e,a,r,s,u){let{matches:c,...d}=e,h=c.flatMap(g=>g.route.middleware?g.route.middleware.map(y=>[g.route.id,y]):[]);return await Kb(d,h,a,r,s,u)}async function Kb(e,a,r,s,u,c,d=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=a[d];if(!p)return await r();let[g,y]=p,x,E=async()=>{if(x)throw new Error("You may only call `next()` once per middleware");try{return x={value:await Kb(e,a,r,s,u,c,d+1)},x.value}catch(S){return x={value:await c(S,g,x)},x.value}};try{let S=await y(e,E),w=S!=null?s(S):void 0;return u(w)?w:x?w??x.value:(x={value:await E()},x.value)}catch(S){return await c(S,g,x)}}function Zb(e,a,r,s,u){let c=Xb({key:"middleware",route:s.route,manifest:a,mapRouteProperties:e}),d=yE(s.route,da(r.method)?"action":"loader",a,e,u);return{middleware:c,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function cm(e,a,r,s,u,c,d,h,p,g=null,y){let x=!1,E=Zb(e,a,r,c,d);return{...c,_lazyPromises:E,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return x=!0,g?typeof y=="boolean"?Mo(c,{...g,defaultShouldRevalidate:y}):typeof S=="boolean"?Mo(c,{...g,defaultShouldRevalidate:S}):Mo(c,g):p},resolve(S){let{lazy:w,loader:j,middleware:R}=c.route,L=x||p||S&&!da(r.method)&&(w||j),B=R&&R.length>0&&!j&&!w;return L&&(da(r.method)||!B)?EE({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,a,r,s,u,c,d,h,p=null){return u.map(g=>g.route.id!==c.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Zb(e,a,r,g,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:cm(e,a,r,s,Zo(u),g,d,h,!0,p))}async function SE(e,a,r,s,u,c,d){s.some(y=>{var x;return(x=y._lazyPromises)==null?void 0:x.middleware})&&await Promise.all(s.map(y=>{var x;return(x=y._lazyPromises)==null?void 0:x.middleware}));let h={request:a,url:Wb(a,r),pattern:Zo(s),params:s[0].params,context:c,matches:s},g=await e({...h,fetcherKey:u,runClientMiddleware:y=>{let x=h;return Qb(x,()=>y({...x,fetcherKey:u,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(y=>{var x,E;return[(x=y._lazyPromises)==null?void 0:x.handler,(E=y._lazyPromises)==null?void 0:E.route]}))}catch{}return g}async function EE({request:e,path:a,pattern:r,match:s,lazyHandlerPromise:u,lazyRoutePromise:c,handlerOverride:d,scopedContext:h}){let p,g,y=da(e.method),x=y?"action":"loader",E=S=>{let w,j=new Promise((B,I)=>w=I);g=()=>w(),e.signal.addEventListener("abort",g);let R=B=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${x}" [routeId: ${s.route.id}]`)):S({request:e,url:Wb(e,a),pattern:r,params:s.params,context:h},...B!==void 0?[B]:[]),L=(async()=>{try{return{type:"data",result:await(d?d(I=>R(I)):R())}}catch(B){return{type:"error",result:B}}})();return Promise.race([L,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(x==="action"){let j=new URL(e.url),R=j.pathname+j.search;throw Ja(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 Ja(404,{pathname:j})}}catch(S){return{type:"error",result:S}}finally{g&&e.signal.removeEventListener("abort",g)}return p}async function NE(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function jE(e){var s,u,c,d,h;let{result:a,type:r}=e;if(Om(a)){let p;try{p=await NE(a)}catch(g){return{type:"error",error:g}}return r==="error"?{type:"error",error:new Ko(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return r==="error"?Ey(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:(s=a.init)==null?void 0:s.status,headers:(u=a.init)!=null&&u.headers?new Headers(a.init.headers):void 0}:{type:"error",error:DE(a),statusCode:wi(a)?a.status:void 0,headers:(c=a.init)!=null&&c.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:wi(a)?a.status:void 0}:Ey(a)?{type:"data",data:a.data,statusCode:(d=a.init)==null?void 0:d.status,headers:(h=a.init)!=null&&h.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function RE(e,a,r,s,u){let c=e.headers.get("Location");if(lt(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!Tm(c)){let d=s.slice(0,s.findIndex(h=>h.route.id===r)+1);c=om(new URL(a.url),d,u,c),e.headers.set("Location",c)}return e}var kE=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function um(e){try{return kE.includes(new URL(e).protocol)}catch{return!1}}function xy(e,a,r,s){if(Tm(e)){let u=e,c=km.test(u)?new URL(Ab(u,a.protocol)):new URL(u);if(um(c.toString()))throw new Error("Invalid redirect location");let d=Ia(c.pathname,r)!=null;if(c.origin===a.origin&&d)return Dm(c.pathname)+c.search+c.hash}try{let u=s.createURL(e);if(um(u.toString()))throw new Error("Invalid redirect location")}catch{}return e}function mi(e,a,r,s){let u=e.createURL(Jb(a)).toString(),c={signal:r};if(s&&da(s.formMethod)){let{formMethod:d,formEncType:h}=s;c.method=d.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=dm(s.formData):c.body=s.formData}return new Request(u,c)}function Wb(e,a){let r=new URL(e.url),s=typeof a=="string"?Or(a):a;if(r.pathname=s.pathname||"/",s.search){let u=new URLSearchParams(s.search),c=u.getAll("index");u.delete("index");for(let d of c.filter(Boolean))u.append("index",d);r.search=u.size?`?${u.toString()}`:""}else r.search="";return r.hash=s.hash||"",r}function dm(e){let a=new URLSearchParams;for(let[r,s]of e.entries())a.append(r,typeof s=="string"?s:s.name);return a}function yy(e){let a=new FormData;for(let[r,s]of e.entries())a.append(r,s);return a}function TE(e,a,r,s=!1,u=!1){let c={},d=null,h,p=!1,g={},y=r&&Ua(r[1])?r[1].error:void 0;return e.forEach(x=>{if(!(x.route.id in a))return;let E=x.route.id,S=a[E];if(lt(!ws(S),"Cannot handle redirect results in processLoaderData"),Ua(S)){let w=S.error;if(y!==void 0&&(w=y,y=void 0),d=d||{},u)d[E]=w;else{let j=Hl(e,E);d[j.route.id]==null&&(d[j.route.id]=w)}s||(c[E]=Vb),p||(p=!0,h=wi(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&&(d={[r[0]]:y},r[2]&&(c[r[2]]=void 0)),{loaderData:c,errors:d,statusCode:h||200,loaderHeaders:g}}function by(e,a,r,s,u,c,d){let{loaderData:h,errors:p}=TE(a,r,s);return u.filter(g=>!g.matches||g.matches.some(y=>y.shouldLoad)).forEach(g=>{let{key:y,match:x,controller:E}=g;if(E&&E.signal.aborted)return;let S=c[y];if(lt(S,"Did not find corresponding fetcher result"),Ua(S)){let w=Hl(e.matches,x==null?void 0:x.route.id);p&&p[w.route.id]||(p={...p,[w.route.id]:S.error}),d.delete(y)}else if(ws(S))lt(!1,"Unhandled fetcher revalidation redirect");else{let w=Tr(S.data);d.set(y,w)}}),{loaderData:h,errors:p}}function wy(e,a,r,s){let u=Object.entries(a).filter(([,c])=>c!==Vb).reduce((c,[d,h])=>(c[d]=h,c),{});for(let c of r){let d=c.route.id;if(!a.hasOwnProperty(d)&&e.hasOwnProperty(d)&&c.route.loader&&(u[d]=e[d]),s&&s.hasOwnProperty(d))break}return u}function Sy(e){return e?Ua(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Hl(e,a){return(a?e.slice(0,e.findIndex(s=>s.route.id===a)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function bu(e){let a=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Ja(e,{pathname:a,routeId:r,method:s,type:u,message:c}={}){let d="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(d="Bad Request",s&&a&&r?h=`You made a ${s} request to "${a}" 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?(d="Forbidden",h=`Route "${r}" does not match URL "${a}"`):e===404?(d="Not Found",h=`No route matches URL "${a}"`):e===405&&(d="Method Not Allowed",s&&a&&r?h=`You made a ${s.toUpperCase()} request to "${a}" 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 Ko(e||500,d,new Error(h),!0)}function wu(e){let a=Object.entries(e);for(let r=a.length-1;r>=0;r--){let[s,u]=a[r];if(ws(u))return{key:s,result:u}}}function Jb(e){let a=typeof e=="string"?Or(e):e;return Cr({...a,hash:""})}function AE(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function DE(e){var a,r;return new Ko(((a=e.init)==null?void 0:a.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function CE(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,r])=>typeof a=="string"&&OE(r))}function OE(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function ME(e){return Om(e.result)&&qb.has(e.result.status)}function Ua(e){return e.type==="error"}function ws(e){return(e&&e.type)==="redirect"}function Ey(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Om(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function _E(e){return qb.has(e)}function LE(e){return Om(e)&&_E(e.status)&&e.headers.has("Location")}function zE(e){return dE.has(e.toUpperCase())}function da(e){return cE.has(e.toUpperCase())}function Mm(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Uu(e,a){let r=typeof a=="string"?Or(a).search:a.search;if(e[e.length-1].route.index&&Mm(r||""))return e[e.length-1];let s=$b(e);return s[s.length-1]}function Ny(e){let{formMethod:a,formAction:r,formEncType:s,text:u,formData:c,json:d}=e;if(!(!a||!r||!s)){if(u!=null)return{formMethod:a,formAction:r,formEncType:s,formData:void 0,json:void 0,text:u};if(c!=null)return{formMethod:a,formAction:r,formEncType:s,formData:c,json:void 0,text:void 0};if(d!==void 0)return{formMethod:a,formAction:r,formEncType:s,formData:void 0,json:d,text:void 0}}}function $h(e,a,r,s){return s?{state:"loading",location:e,matches:a,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:a,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function $E(e,a,r,s){return{state:"submitting",location:e,matches:a,historyAction:r,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function wo(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function UE(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.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 BE(e,a){try{let r=e.sessionStorage.getItem(Fb);if(r){let s=JSON.parse(r);for(let[u,c]of Object.entries(s||{}))c&&Array.isArray(c)&&a.set(u,new Set(c||[]))}}catch{}}function IE(e,a){if(a.size>0){let r={};for(let[s,u]of a)r[s]=[...u];try{e.sessionStorage.setItem(Fb,JSON.stringify(r))}catch(s){pn(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function jy(){let e,a,r=new Promise((s,u)=>{e=async c=>{s(c);try{await r}catch{}},a=async c=>{u(c);try{await r}catch{}}});return{promise:r,resolve:e,reject:a}}var js=v.createContext(null);js.displayName="DataRouter";var Ei=v.createContext(null);Ei.displayName="DataRouterState";var e0=v.createContext(!1);function t0(){return v.useContext(e0)}var _m=v.createContext({isTransitioning:!1});_m.displayName="ViewTransition";var Lm=v.createContext(new Map);Lm.displayName="Fetchers";var HE=v.createContext(null);HE.displayName="Await";var Ta=v.createContext(null);Ta.displayName="Navigation";var id=v.createContext(null);id.displayName="Location";var ar=v.createContext({outlet:null,matches:[],isDataRoute:!1});ar.displayName="Route";var zm=v.createContext(null);zm.displayName="RouteError";var n0="REACT_ROUTER_ERROR",qE="REDIRECT",PE="ROUTE_ERROR_RESPONSE";function FE(e){if(e.startsWith(`${n0}:${qE}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function VE(e){if(e.startsWith(`${n0}:${PE}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Ko(a.status,a.statusText,a.data)}catch{}}function YE(e,{relative:a}={}){lt(Wo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=v.useContext(Ta),{hash:u,pathname:c,search:d}=Jo(e,{relative:a}),h=c;return r!=="/"&&(h=c==="/"?r:tr([r,c])),s.createHref({pathname:h,search:d,hash:u})}function Wo(){return v.useContext(id)!=null}function ga(){return lt(Wo(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(id).location}var a0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function r0(e){v.useContext(Ta).static||v.useLayoutEffect(e)}function Mr(){let{isDataRoute:e}=v.useContext(ar);return e?iN():GE()}function GE(){lt(Wo(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(js),{basename:a,navigator:r}=v.useContext(Ta),{matches:s}=v.useContext(ar),{pathname:u}=ga(),c=JSON.stringify(Am(s)),d=v.useRef(!1);return r0(()=>{d.current=!0}),v.useCallback((p,g={})=>{if(pn(d.current,a0),!d.current)return;if(typeof p=="number"){r.go(p);return}let y=sd(p,JSON.parse(c),u,g.relative==="path");e==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:tr([a,y.pathname])),(g.replace?r.replace:r.push)(y,g.state,g)},[a,r,c,u,e])}var XE=v.createContext(null);function QE(e){let a=v.useContext(ar).outlet;return v.useMemo(()=>a&&v.createElement(XE.Provider,{value:e},a),[a,e])}function KE(){let{matches:e}=v.useContext(ar),a=e[e.length-1];return(a==null?void 0:a.params)??{}}function Jo(e,{relative:a}={}){let{matches:r}=v.useContext(ar),{pathname:s}=ga(),u=JSON.stringify(Am(r));return v.useMemo(()=>sd(e,JSON.parse(u),s,a==="path"),[e,u,s,a])}function ZE(e,a,r){lt(Wo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Ta),{matches:u}=v.useContext(ar),c=u[u.length-1],d=c?c.params:{},h=c?c.pathname:"/",p=c?c.pathnameBase:"/",g=c&&c.route;{let R=g&&g.path||"";c0(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=ga(),x;x=y;let E=x.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})):Cb(e,{pathname:S});return pn(g||w!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),pn(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 "${x.pathname}${x.search}${x.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.`),nN(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},d,R.params),pathname:tr([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:tr([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),u,r)}function WE(){let e=o0(),a=wi(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},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:c},"ErrorBoundary")," or"," ",v.createElement("code",{style:c},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},a),r?v.createElement("pre",{style:u},r):null,d)}var JE=v.createElement(WE,null),l0=class extends v.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,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):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=VE(e.digest);r&&(e=r)}let a=e!==void 0?v.createElement(ar.Provider,{value:this.props.routeContext},v.createElement(zm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(eN,{error:e},a):a}};l0.contextType=e0;var Uh=new WeakMap;function eN({children:e,error:a}){let{basename:r}=v.useContext(Ta);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=FE(a.digest);if(s){let u=Uh.get(a);if(u)throw u;let c=Bb(s.location,r),d=c.absoluteURL||c.to;if(um(d))throw new Error("Invalid redirect location");if(Ub&&!Uh.get(a))if(c.isExternal||s.reloadDocument)window.location.href=d;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw Uh.set(a,h),h}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function tN({routeContext:e,match:a,children:r}){let s=v.useContext(js);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(ar.Provider,{value:e},r)}function nN(e,a=[],r){let s=r==null?void 0:r.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(a.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(x=>x.route.id&&(c==null?void 0:c[x.route.id])!==void 0);lt(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 d=!1,h=-1;if(r&&s){d=s.renderFallback;for(let y=0;y<u.length;y++){let x=u[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=y),x.route.id){let{loaderData:E,errors:S}=s,w=x.route.loader&&!E.hasOwnProperty(x.route.id)&&(!S||S[x.route.id]===void 0);if(x.route.lazy||w){r.isStatic&&(d=!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,x)=>{var E,S;p(y,{location:s.location,params:((S=(E=s.matches)==null?void 0:E[0])==null?void 0:S.params)??{},pattern:Zo(s.matches),errorInfo:x})}:void 0;return u.reduceRight((y,x,E)=>{let S,w=!1,j=null,R=null;s&&(S=c&&x.route.id?c[x.route.id]:void 0,j=x.route.errorElement||JE,d&&(h<0&&E===0?(c0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):h===E&&(w=!0,R=x.route.hydrateFallbackElement||null)));let L=a.concat(u.slice(0,E+1)),B=()=>{let I;return S?I=j:w?I=R:x.route.Component?I=v.createElement(x.route.Component,null):x.route.element?I=x.route.element:I=y,v.createElement(tN,{match:x,routeContext:{outlet:y,matches:L,isDataRoute:s!=null},children:I})};return s&&(x.route.ErrorBoundary||x.route.errorElement||E===0)?v.createElement(l0,{location:s.location,revalidation:s.revalidation,component:j,error:S,children:B(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:g}):B()},null)}function $m(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s0(e){let a=v.useContext(js);return lt(a,$m(e)),a}function Rs(e){let a=v.useContext(Ei);return lt(a,$m(e)),a}function aN(e){let a=v.useContext(ar);return lt(a,$m(e)),a}function ec(e){let a=aN(e),r=a.matches[a.matches.length-1];return lt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function rN(){return ec("useRouteId")}function pr(){let e=Rs("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:r,...s}=e.navigation;return s},[e.navigation])}function lN(){let e=s0("useRevalidator"),a=Rs("useRevalidator"),r=v.useCallback(async()=>{await e.router.revalidate()},[e.router]);return v.useMemo(()=>({revalidate:r,state:a.revalidation}),[r,a.revalidation])}function i0(){let{matches:e,loaderData:a}=Rs("useMatches");return v.useMemo(()=>e.map(r=>Ob(r,a)),[e,a])}function gr(){let e=Rs("useLoaderData"),a=ec("useLoaderData");return e.loaderData[a]}function ks(e){return Rs("useRouteLoaderData").loaderData[e]}function sN(){let e=Rs("useActionData"),a=ec("useLoaderData");return e.actionData?e.actionData[a]:void 0}function o0(){var s;let e=v.useContext(zm),a=Rs("useRouteError"),r=ec("useRouteError");return e!==void 0?e:(s=a.errors)==null?void 0:s[r]}function iN(){let{router:e}=s0("useNavigate"),a=ec("useNavigate"),r=v.useRef(!1);return r0(()=>{r.current=!0}),v.useCallback(async(u,c={})=>{pn(r.current,a0),r.current&&(typeof u=="number"?await e.navigate(u):await e.navigate(u,{fromRouteId:a,...c}))},[e,a])}var Ry={};function c0(e,a,r){!a&&!Ry[e]&&(Ry[e]=!0,pn(!1,r))}var ky={};function Ty(e,a){!e&&!ky[a]&&(ky[a]=!0,console.warn(a))}var oN="useOptimistic",Ay=jS[oN],cN=()=>{};function uN(e){return Ay?Ay(e):[e,cN]}function dN(e){let a={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&pn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&pn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&pn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),a}var fN=["HydrateFallback","hydrateFallbackElement"],hN=class{constructor(){this.status="pending",this.promise=new Promise((e,a)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",a(r))}})}};function mN({router:e,flushSync:a,onError:r,useTransitions:s}){s=t0()||s;let[c,d]=v.useState(e.state),[h,p]=uN(c),[g,y]=v.useState(),[x,E]=v.useState({isTransitioning:!1}),[S,w]=v.useState(),[j,R]=v.useState(),[L,B]=v.useState(),I=v.useRef(new Map),F=v.useCallback((T,{deletedFetchers:de,newErrors:ge,flushSync:be,viewTransitionOpts:re})=>{ge&&r&&Object.values(ge).forEach(Te=>{var J;return r(Te,{location:T.location,params:((J=T.matches[0])==null?void 0:J.params)??{},pattern:Zo(T.matches)})}),T.fetchers.forEach((Te,J)=>{Te.data!==void 0&&I.current.set(J,Te.data)}),de.forEach(Te=>I.current.delete(Te)),Ty(be===!1||a!=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(Ty(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){a&&be?a(()=>d(T)):s===!1?d(T):v.startTransition(()=>{s===!0&&p(Te=>Dy(Te,T)),d(T)});return}if(a&&be){a(()=>{j&&(S==null||S.resolve(),j.skipTransition()),E({isTransitioning:!0,flushSync:!0,currentLocation:re.currentLocation,nextLocation:re.nextLocation})});let Te=e.window.document.startViewTransition(()=>{a(()=>d(T))});Te.finished.finally(()=>{a(()=>{w(void 0),R(void 0),y(void 0),E({isTransitioning:!1})})}),a(()=>R(Te));return}j?(S==null||S.resolve(),j.skipTransition(),B({state:T,currentLocation:re.currentLocation,nextLocation:re.nextLocation})):(y(T),E({isTransitioning:!0,flushSync:!1,currentLocation:re.currentLocation,nextLocation:re.nextLocation}))},[e.window,a,j,S,s,p,r]);v.useLayoutEffect(()=>e.subscribe(F),[e,F]),v.useEffect(()=>{x.isTransitioning&&!x.flushSync&&w(new hN)},[x]),v.useEffect(()=>{if(S&&g&&e.window){let T=g,de=S.promise,ge=e.window.document.startViewTransition(async()=>{s===!1?d(T):v.startTransition(()=>{s===!0&&p(be=>Dy(be,T)),d(T)}),await de});ge.finished.finally(()=>{w(void 0),R(void 0),y(void 0),E({isTransitioning:!1})}),R(ge)}},[g,S,e.window,s,p]),v.useEffect(()=>{S&&g&&h.location.key===g.location.key&&S.resolve()},[S,j,h.location,g]),v.useEffect(()=>{!x.isTransitioning&&L&&(y(L.state),E({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),B(void 0))},[x.isTransitioning,L]);let W=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,de,ge)=>e.navigate(T,{state:de,preventScrollReset:ge==null?void 0:ge.preventScrollReset}),replace:(T,de,ge)=>e.navigate(T,{replace:!0,state:de,preventScrollReset:ge==null?void 0:ge.preventScrollReset})}),[e]),ne=e.basename||"/",_=v.useMemo(()=>({router:e,navigator:W,static:!1,basename:ne,onError:r}),[e,W,ne,r]);return v.createElement(v.Fragment,null,v.createElement(js.Provider,{value:_},v.createElement(Ei.Provider,{value:h},v.createElement(Lm.Provider,{value:I.current},v.createElement(_m.Provider,{value:x},v.createElement(vN,{basename:ne,location:h.location,navigationType:h.historyAction,navigator:W,useTransitions:s},v.createElement(pN,{routes:e.routes,manifest:e.manifest,future:e.future,state:h,isStatic:!1,onError:r})))))),null)}function Dy(e,a){return{...e,navigation:a.navigation.state!=="idle"?a.navigation:e.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:e.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:e.actionData,fetchers:a.fetchers}}var pN=v.memo(gN);function gN({routes:e,manifest:a,future:r,state:s,isStatic:u,onError:c}){return ZE(e,void 0,{manifest:a,state:s,isStatic:u,onError:c})}function Ni(e){return QE(e.context)}function vN({basename:e="/",children:a=null,location:r,navigationType:s="POP",navigator:u,static:c=!1,useTransitions:d}){lt(!Wo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:h,navigator:u,static:c,useTransitions:d,future:{}}),[h,u,c,d]);typeof r=="string"&&(r=Or(r));let{pathname:g="/",search:y="",hash:x="",state:E=null,key:S="default",mask:w}=r,j=v.useMemo(()=>{let R=Ia(g,h);return R==null?null:{location:{pathname:R,search:y,hash:x,state:E,key:S,mask:w},navigationType:s}},[h,g,y,x,E,S,s,w]);return pn(j!=null,`<Router basename="${h}"> is not able to match the URL "${g}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:v.createElement(Ta.Provider,{value:p},v.createElement(id.Provider,{children:a,value:j}))}var Bu="get",Iu="application/x-www-form-urlencoded";function od(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function xN(e){return od(e)&&e.tagName.toLowerCase()==="button"}function yN(e){return od(e)&&e.tagName.toLowerCase()==="form"}function bN(e){return od(e)&&e.tagName.toLowerCase()==="input"}function wN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function SN(e,a){return e.button===0&&(!a||a==="_self")&&!wN(e)}function fm(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,r)=>{let s=e[r];return a.concat(Array.isArray(s)?s.map(u=>[r,u]):[[r,s]])},[]))}function EN(e,a){let r=fm(e);return a&&a.forEach((s,u)=>{r.has(u)||a.getAll(u).forEach(c=>{r.append(u,c)})}),r}var Su=null;function NN(){if(Su===null)try{new FormData(document.createElement("form"),0),Su=!1}catch{Su=!0}return Su}var jN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bh(e){return e!=null&&!jN.has(e)?(pn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function RN(e,a){let r,s,u,c,d;if(yN(e)){let h=e.getAttribute("action");s=h?Ia(h,a):null,r=e.getAttribute("method")||Bu,u=Bh(e.getAttribute("enctype"))||Iu,c=new FormData(e)}else if(xN(e)||bN(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?Ia(p,a):null,r=e.getAttribute("formmethod")||h.getAttribute("method")||Bu,u=Bh(e.getAttribute("formenctype"))||Bh(h.getAttribute("enctype"))||Iu,c=new FormData(h,e),!NN()){let{name:g,type:y,value:x}=e;if(y==="image"){let E=g?`${g}.`:"";c.append(`${E}x`,"0"),c.append(`${E}y`,"0")}else g&&c.append(g,x)}}else{if(od(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Bu,s=null,u=Iu,d=e}return c&&u==="text/plain"&&(d=c,c=void 0),{action:s,method:r.toLowerCase(),encType:u,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var kN={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},TN=/[&><\u2028\u2029]/g;function Cy(e){return e.replace(TN,a=>kN[a])}function Um(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function u0(e,a,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}`:a&&Ia(u.pathname,a)==="/"?u.pathname=`${Yu(a)}/_root.${s}`:u.pathname=`${Yu(u.pathname)}.${s}`,u}async function AN(e,a){if(e.id in a)return a[e.id];try{let r=await import(e.module);return a[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 DN(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 CN(e,a,r){let s=await Promise.all(e.map(async u=>{let c=a.routes[u.route.id];if(c){let d=await AN(c,r);return d.links?d.links():[]}return[]}));return LN(s.flat(1).filter(DN).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Oy(e,a,r,s,u,c){let d=(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"?a.filter((p,g)=>d(p,g)||h(p,g)):c==="data"?a.filter((p,g)=>{var x;let y=s.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(d(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:((x=r[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function ON(e,a,{includeHydrateFallback:r}={}){return MN(e.map(s=>{let u=a.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 MN(e){return[...new Set(e)]}function _N(e){let a={},r=Object.keys(e).sort();for(let s of r)a[s]=e[s];return a}function LN(e,a){let r=new Set;return new Set(a),e.reduce((s,u)=>{let c=JSON.stringify(_N(u));return r.has(c)||(r.add(c),s.push({key:c,link:u})),s},[])}function Bm(){let e=v.useContext(js);return Um(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function zN(){let e=v.useContext(Ei);return Um(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cd=v.createContext(void 0);cd.displayName="FrameworkContext";function ud(){let e=v.useContext(cd);return Um(e,"You must render this element inside a <HydratedRouter> element"),e}function $N(e,a){let r=v.useContext(cd),[s,u]=v.useState(!1),[c,d]=v.useState(!1),{onFocus:h,onBlur:p,onMouseEnter:g,onMouseLeave:y,onTouchStart:x}=a,E=v.useRef(null);v.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let j=L=>{L.forEach(B=>{d(B.isIntersecting)})},R=new IntersectionObserver(j,{threshold:.5});return E.current&&R.observe(E.current),()=>{R.disconnect()}}},[e]),v.useEffect(()=>{if(s){let j=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(j)}}},[s]);let S=()=>{u(!0)},w=()=>{u(!1),d(!1)};return r?e!=="intent"?[c,E,{}]:[c,E,{onFocus:So(h,S),onBlur:So(p,w),onMouseEnter:So(g,S),onMouseLeave:So(y,w),onTouchStart:So(x,S)}]:[!1,E,{}]}function So(e,a){return r=>{e&&e(r),r.defaultPrevented||a(r)}}function UN({page:e,...a}){let r=t0(),{nonce:s}=ud(),{router:u}=Bm(),c=v.useMemo(()=>Cb(u.routes,e,u.basename),[u.routes,e,u.basename]);return c?(a.nonce==null&&s&&(a={...a,nonce:s}),r?v.createElement(IN,{page:e,matches:c,...a}):v.createElement(HN,{page:e,matches:c,...a})):null}function BN(e){let{manifest:a,routeModules:r}=ud(),[s,u]=v.useState([]);return v.useEffect(()=>{let c=!1;return CN(e,a,r).then(d=>{c||u(d)}),()=>{c=!0}},[e,a,r]),s}function IN({page:e,matches:a,...r}){let s=ga(),{future:u}=ud(),{basename:c}=Bm(),d=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let h=u0(e,c,u.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let y of a)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,a]);return v.createElement(v.Fragment,null,d.map(h=>v.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...r})))}function HN({page:e,matches:a,...r}){let s=ga(),{future:u,manifest:c,routeModules:d}=ud(),{basename:h}=Bm(),{loaderData:p,matches:g}=zN(),y=v.useMemo(()=>Oy(e,a,g,c,s,"data"),[e,a,g,c,s]),x=v.useMemo(()=>Oy(e,a,g,c,s,"assets"),[e,a,g,c,s]),E=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let j=new Set,R=!1;if(a.forEach(B=>{var F;let I=c.routes[B.route.id];!I||!I.hasLoader||(!y.some(W=>W.route.id===B.route.id)&&B.route.id in p&&((F=d[B.route.id])!=null&&F.shouldRevalidate)||I.hasClientLoader?R=!0:j.add(B.route.id))}),j.size===0)return[];let L=u0(e,h,u.v8_trailingSlashAwareDataRequests,"data");return R&&j.size>0&&L.searchParams.set("_routes",a.filter(B=>j.has(B.route.id)).map(B=>B.route.id).join(",")),[L.pathname+L.search]},[h,u.v8_trailingSlashAwareDataRequests,p,s,c,y,a,e,d]),S=v.useMemo(()=>ON(x,c),[x,c]),w=BN(x);return v.createElement(v.Fragment,null,E.map(j=>v.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...r})),S.map(j=>v.createElement("link",{key:j,rel:"modulepreload",href:j,...r})),w.map(({key:j,link:R})=>v.createElement("link",{key:j,nonce:r.nonce,...R,crossOrigin:R.crossOrigin??r.crossOrigin})))}function qN(...e){return a=>{e.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var PN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PN&&(window.__reactRouterVersion="7.18.0")}catch{}function FN(e,a){return pE({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:OS({window:a==null?void 0:a.window}),hydrationData:VN(),routes:e,mapRouteProperties:dN,hydrationRouteProperties:fN,dataStrategy:a==null?void 0:a.dataStrategy,patchRoutesOnNavigation:a==null?void 0:a.patchRoutesOnNavigation,window:a==null?void 0:a.window,instrumentations:a==null?void 0:a.instrumentations}).initialize()}function VN(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:YN(e.errors)}),e}function YN(e){if(!e)return null;let a=Object.entries(e),r={};for(let[s,u]of a)if(u&&u.__type==="RouteErrorResponse")r[s]=new Ko(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(typeof u.__subType=="string"&&nE.includes(u.__subType)){let c=window[u.__subType];if(typeof c=="function")try{let d=new c(u.message);d.stack="",r[s]=d}catch{}}if(r[s]==null){let c=new Error(u.message);c.stack="",r[s]=c}}else r[s]=u;return r}var Ye=v.forwardRef(function({onClick:a,discover:r="render",prefetch:s="none",relative:u,reloadDocument:c,replace:d,mask:h,state:p,target:g,to:y,preventScrollReset:x,viewTransition:E,defaultShouldRevalidate:S,...w},j){let{basename:R,navigator:L,useTransitions:B}=v.useContext(Ta),I=typeof y=="string"&&ld.test(y),F=Bb(y,R);y=F.to;let W=YE(y,{relative:u}),ne=ga(),_=null;if(h){let J=sd(h,[],ne.mask?ne.mask.pathname:"/",!0);R!=="/"&&(J.pathname=J.pathname==="/"?R:tr([R,J.pathname])),_=L.createHref(J)}let[T,de,ge]=$N(s,w),be=GN(y,{replace:d,mask:h,state:p,target:g,preventScrollReset:x,relative:u,viewTransition:E,defaultShouldRevalidate:S,useTransitions:B});function re(J){a&&a(J),J.defaultPrevented||be(J)}let je=!(F.isExternal||c),Te=v.createElement("a",{...w,...ge,href:(je?_:void 0)||F.absoluteURL||W,onClick:je?re:a,ref:qN(j,de),target:g,"data-discover":!I&&r==="render"?"true":void 0});return T&&!I?v.createElement(v.Fragment,null,Te,v.createElement(UN,{page:W})):Te});Ye.displayName="Link";var hm=v.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:s="",end:u=!1,style:c,to:d,viewTransition:h,children:p,...g},y){let x=Jo(d,{relative:g.relative}),E=ga(),S=v.useContext(Ei),{navigator:w,basename:j}=v.useContext(Ta),R=S!=null&&JN(x)&&h===!0,L=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,B=E.pathname,I=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(B=B.toLowerCase(),I=I?I.toLowerCase():null,L=L.toLowerCase()),I&&j&&(I=Ia(I,j)||I);const F=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let W=B===L||!u&&B.startsWith(L)&&B.charAt(F)==="/",ne=I!=null&&(I===L||!u&&I.startsWith(L)&&I.charAt(L.length)==="/"),_={isActive:W,isPending:ne,isTransitioning:R},T=W?a:void 0,de;typeof s=="function"?de=s(_):de=[s,W?"active":null,ne?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let ge=typeof c=="function"?c(_):c;return v.createElement(Ye,{...g,"aria-current":T,className:de,ref:y,style:ge,to:d,viewTransition:h},typeof p=="function"?p(_):p)});hm.displayName="NavLink";var dn=v.forwardRef(({discover:e="render",fetcherKey:a,navigate:r,reloadDocument:s,replace:u,state:c,method:d=Bu,action:h,onSubmit:p,relative:g,preventScrollReset:y,viewTransition:x,defaultShouldRevalidate:E,...S},w)=>{let{useTransitions:j}=v.useContext(Ta),R=Im(),L=KN(h,{relative:g}),B=d.toLowerCase()==="get"?"get":"post",I=typeof h=="string"&&ld.test(h),F=W=>{if(p&&p(W),W.defaultPrevented)return;W.preventDefault();let ne=W.nativeEvent.submitter,_=(ne==null?void 0:ne.getAttribute("formmethod"))||d,T=()=>R(ne||W.currentTarget,{fetcherKey:a,method:_,navigate:r,replace:u,state:c,relative:g,preventScrollReset:y,viewTransition:x,defaultShouldRevalidate:E});j&&r!==!1?v.startTransition(()=>T()):T()};return v.createElement("form",{ref:w,method:B,action:L,onSubmit:s?p:F,...S,"data-discover":!I&&e==="render"?"true":void 0})});dn.displayName="Form";function d0({getKey:e,storageKey:a,...r}){let s=v.useContext(cd),{basename:u}=v.useContext(Ta),c=ga(),d=i0();ZN({getKey:e,storageKey:a});let h=v.useMemo(()=>{if(!s||!e)return null;let g=pm(c,d,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 x=Math.random().toString(32).slice(2);window.history.replaceState({key:x},"")}try{let E=JSON.parse(sessionStorage.getItem(g)||"{}")[y||window.history.state.key];typeof E=="number"&&window.scrollTo(0,E)}catch(x){console.error(x),sessionStorage.removeItem(g)}}).toString();return r.nonce==null&&(s!=null&&s.nonce)&&(r.nonce=s.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p})(${Cy(JSON.stringify(a||mm))}, ${Cy(JSON.stringify(h))})`}})}d0.displayName="ScrollRestoration";function f0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dd(e){let a=v.useContext(js);return lt(a,f0(e)),a}function h0(e){let a=v.useContext(Ei);return lt(a,f0(e)),a}function GN(e,{target:a,replace:r,mask:s,state:u,preventScrollReset:c,relative:d,viewTransition:h,defaultShouldRevalidate:p,useTransitions:g}={}){let y=Mr(),x=ga(),E=Jo(e,{relative:d});return v.useCallback(S=>{if(SN(S,a)){S.preventDefault();let w=r!==void 0?r:Cr(x)===Cr(E),j=()=>y(e,{replace:w,mask:s,state:u,preventScrollReset:c,relative:d,viewTransition:h,defaultShouldRevalidate:p});g?v.startTransition(()=>j()):j()}},[x,y,E,r,s,u,a,e,c,d,h,p,g])}function tc(e){pn(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 a=v.useRef(fm(e)),r=v.useRef(!1),s=ga(),u=v.useMemo(()=>EN(s.search,r.current?null:a.current),[s.search]),c=Mr(),d=v.useCallback((h,p)=>{const g=fm(typeof h=="function"?h(new URLSearchParams(u)):h);r.current=!0,c("?"+g,p)},[c,u]);return[u,d]}var XN=0,QN=()=>`__${String(++XN)}__`;function Im(){let{router:e}=dd("useSubmit"),{basename:a}=v.useContext(Ta),r=rN(),s=e.fetch,u=e.navigate;return v.useCallback(async(c,d={})=>{let{action:h,method:p,encType:g,formData:y,body:x}=RN(c,a);if(d.navigate===!1){let E=d.fetcherKey||QN();await s(E,r,d.action||h,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:x,formMethod:d.method||p,formEncType:d.encType||g,flushSync:d.flushSync})}else await u(d.action||h,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:x,formMethod:d.method||p,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:r,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,u,a,r])}function KN(e,{relative:a}={}){let{basename:r}=v.useContext(Ta),s=v.useContext(ar);lt(s,"useFormAction must be used inside a RouteContext");let[u]=s.matches.slice(-1),c={...Jo(e||".",{relative:a})},d=ga();if(e==null){c.search=d.search;let h=new URLSearchParams(c.search),p=h.getAll("index");if(p.some(y=>y==="")){h.delete("index"),p.filter(x=>x).forEach(x=>h.append("index",x));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:tr([r,c.pathname])),Cr(c)}function Pl({key:e}={}){var W;let{router:a}=dd("useFetcher"),r=h0("useFetcher"),s=v.useContext(Lm),u=v.useContext(ar),c=(W=u.matches[u.matches.length-1])==null?void 0:W.route.id;lt(s,"useFetcher must be used inside a FetchersContext"),lt(u,"useFetcher must be used inside a RouteContext"),lt(c!=null,'useFetcher can only be used on routes that contain a unique "id"');let d=v.useId(),[h,p]=v.useState(e||d);e&&e!==h&&p(e);let{deleteFetcher:g,getFetcher:y,resetFetcher:x,fetch:E}=a;v.useEffect(()=>(y(h),()=>g(h)),[g,y,h]);let S=v.useCallback(async(ne,_)=>{lt(c,"No routeId available for fetcher.load()"),await E(h,c,ne,_)},[h,c,E]),w=Im(),j=v.useCallback(async(ne,_)=>{await w(ne,{..._,navigate:!1,fetcherKey:h})},[h,w]),R=v.useCallback(ne=>x(h,ne),[x,h]),L=v.useMemo(()=>{let ne=v.forwardRef((_,T)=>v.createElement(dn,{..._,navigate:!1,fetcherKey:h,ref:T}));return ne.displayName="fetcher.Form",ne},[h]),B=r.fetchers.get(h)||Pb,I=s.get(h);return v.useMemo(()=>({Form:L,submit:j,load:S,reset:R,...B,data:I}),[L,j,S,R,B,I])}var mm="react-router-scroll-positions",Eu={};function pm(e,a,r,s){let u=null;return s&&(r!=="/"?u=s({...e,pathname:Ia(e.pathname,r)||e.pathname},a):u=s(e,a)),u==null&&(u=e.key),u}function ZN({getKey:e,storageKey:a}={}){let{router:r}=dd("useScrollRestoration"),{restoreScrollPosition:s,preventScrollReset:u}=h0("useScrollRestoration"),{basename:c}=v.useContext(Ta),d=ga(),h=i0(),p=pr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),WN(v.useCallback(()=>{if(p.state==="idle"){let g=pm(d,h,c,e);Eu[g]=window.scrollY}try{sessionStorage.setItem(a||mm,JSON.stringify(Eu))}catch(g){pn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${g}).`)}window.history.scrollRestoration="auto"},[p.state,e,c,d,h,a])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let g=sessionStorage.getItem(a||mm);g&&(Eu=JSON.parse(g))}catch{}},[a]),v.useLayoutEffect(()=>{let g=r==null?void 0:r.enableScrollRestoration(Eu,()=>window.scrollY,e?(y,x)=>pm(y,x,c,e):void 0);return()=>g&&g()},[r,c,e]),v.useLayoutEffect(()=>{if(s!==!1){if(typeof s=="number"){window.scrollTo(0,s);return}try{if(d.hash){let g=document.getElementById(decodeURIComponent(d.hash.slice(1)));if(g){g.scrollIntoView();return}}}catch{pn(!1,`"${d.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}u!==!0&&window.scrollTo(0,0)}},[d,s,u]))}function WN(e,a){let{capture:r}={};v.useEffect(()=>{let s=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,s),()=>{window.removeEventListener("pagehide",e,s)}},[e,r])}function JN(e,{relative:a}={}){let r=v.useContext(_m);lt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=dd("useViewTransitionState"),u=Jo(e,{relative:a});if(!r.isTransitioning)return!1;let c=Ia(r.currentLocation.pathname,s)||r.currentLocation.pathname,d=Ia(r.nextLocation.pathname,s)||r.nextLocation.pathname;return Vu(u.pathname,d)!=null||Vu(u.pathname,c)!=null}var sl=Rb();function ej(e){return v.createElement(mN,{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 m0=(...e)=>e.filter((a,r,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===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 tj=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 nj=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,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 My=e=>{const a=nj(e);return a.charAt(0).toUpperCase()+a.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 Ih={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 aj=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},rj=v.createContext({}),lj=()=>v.useContext(rj),sj=v.forwardRef(({color:e,size:a,strokeWidth:r,absoluteStrokeWidth:s,className:u="",children:c,iconNode:d,...h},p)=>{const{size:g=24,strokeWidth:y=2,absoluteStrokeWidth:x=!1,color:E="currentColor",className:S=""}=lj()??{},w=s??x?Number(r??y)*24/Number(a??g):r??y;return v.createElement("svg",{ref:p,...Ih,width:a??g??Ih.width,height:a??g??Ih.height,stroke:e??E,strokeWidth:w,className:m0("lucide",S,u),...!c&&!aj(h)&&{"aria-hidden":"true"},...h},[...d.map(([j,R])=>v.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 ot=(e,a)=>{const r=v.forwardRef(({className:s,...u},c)=>v.createElement(sj,{ref:c,iconNode:a,className:m0(`lucide-${tj(My(e))}`,`lucide-${e}`,s),...u}));return r.displayName=My(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 ij=[["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"}]],oj=ot("activity",ij);/**
|
|
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 cj=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],uj=ot("arrow-down-right",cj);/**
|
|
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 dj=[["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"}]],fj=ot("arrow-down-wide-narrow",dj);/**
|
|
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 hj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],fd=ot("arrow-left",hj);/**
|
|
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 mj=[["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"}]],pj=ot("arrow-up-narrow-wide",mj);/**
|
|
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 gj=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],vj=ot("arrow-up-right",gj);/**
|
|
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 xj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],p0=ot("ban",xj);/**
|
|
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 yj=[["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"}]],bj=ot("chart-column",yj);/**
|
|
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 wj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Sj=ot("check",wj);/**
|
|
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 Ej=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ts=ot("chevron-down",Ej);/**
|
|
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 Nj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],g0=ot("chevron-right",Nj);/**
|
|
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 jj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Rj=ot("circle-check-big",jj);/**
|
|
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 kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Hm=ot("circle-check",kj);/**
|
|
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 Tj=[["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"}]],Aj=ot("circle-dashed",Tj);/**
|
|
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 Dj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Cj=ot("circle-minus",Dj);/**
|
|
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 Oj=[["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"}]],qm=ot("circle-pause",Oj);/**
|
|
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 Mj=[["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"}]],v0=ot("circle-play",Mj);/**
|
|
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 _j=[["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"}]],Lj=ot("circle-x",_j);/**
|
|
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 zj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],hd=ot("circle",zj);/**
|
|
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 $j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Uj=ot("clock",$j);/**
|
|
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 Bj=[["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"}]],Ij=ot("copy",Bj);/**
|
|
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 Hj=[["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"}]],qj=ot("download",Hj);/**
|
|
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 Pj=[["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"}]],x0=ot("git-branch",Pj);/**
|
|
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 Fj=[["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"}]],Vj=ot("grip-vertical",Fj);/**
|
|
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 Yj=[["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"}]],Po=ot("layers",Yj);/**
|
|
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 Gj=[["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"}]],y0=ot("lightbulb",Gj);/**
|
|
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 Xj=[["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"}]],nc=ot("list-todo",Xj);/**
|
|
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 Qj=[["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"}]],Kj=ot("locate-fixed",Qj);/**
|
|
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 Zj=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Wj=ot("menu",Zj);/**
|
|
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 Jj=[["path",{d:"M5 12h14",key:"1ays0h"}]],eR=ot("minus",Jj);/**
|
|
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 tR=[["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"}]],nR=ot("moon",tR);/**
|
|
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 aR=[["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"}]],b0=ot("octagon-alert",aR);/**
|
|
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 rR=[["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"}]],Fl=ot("pencil",rR);/**
|
|
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 lR=[["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"}]],sR=ot("play",lR);/**
|
|
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 iR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oR=ot("plus",iR);/**
|
|
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 cR=[["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"}]],w0=ot("rotate-ccw",cR);/**
|
|
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 uR=[["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"}]],S0=ot("scroll-text",uR);/**
|
|
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 dR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fR=ot("search",dR);/**
|
|
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 hR=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],mR=ot("square-check-big",hR);/**
|
|
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 pR=[["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"}]],gR=ot("sun",pR);/**
|
|
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 vR=[["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"}]],xR=ot("timer-reset",vR);/**
|
|
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 yR=[["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"}]],Ns=ot("trash-2",yR);/**
|
|
307
|
+
* @license lucide-react v1.21.0 - ISC
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the ISC license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const bR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],E0=ot("x",bR),wR="/api",SR=120,ER=40;function Gl(e){return{...e,number:e.number??0,descriptionRef:e.descriptionRef??"",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 Hh(e){return e?{...e,pauseSnapshot:e.pauseSnapshot??null,pendingResume:!!e.pendingResume,deviationId:e.deviationId??""}:null}function md(e){return{...e,discussedAt:e.discussedAt??"",contextReady:e.contextReady??!1,contextReadyReason:e.contextReadyReason??"",descriptionRef:e.descriptionRef??"",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(Gl),linkedRequirements:e.linkedRequirements??[],handoff:e.handoff??"",handoffUpdatedAt:e.handoffUpdatedAt??"",descriptionUpdatedAt:e.descriptionUpdatedAt??""}}function pd(e){return{...e,number:e.number??0,discussedAt:e.discussedAt??"",contextReady:e.contextReady??!1,contextReadyReason:e.contextReadyReason??"",descriptionRef:e.descriptionRef??"",acceptedDecisions:e.acceptedDecisions??[],phaseIds:e.phaseIds??[],descriptionUpdatedAt:e.descriptionUpdatedAt??""}}function N0(e){var a,r,s,u,c,d;return{...e,descriptionRef:e.descriptionRef??"",projectGuidelines:{content:((a=e.projectGuidelines)==null?void 0:a.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??"",agentPlanVersion:e.agentPlanVersion??"",workflowRules:{beforePhaseStart:((u=e.workflowRules)==null?void 0:u.beforePhaseStart)??[],beforeTaskStart:((c=e.workflowRules)==null?void 0:c.beforeTaskStart)??[],afterPhaseComplete:((d=e.workflowRules)==null?void 0:d.afterPhaseComplete)??[]}}}function Pm(e){return{...e,description:e.description??"",macroTasks:e.macroTasks??[],linkedPhaseIds:e.linkedPhaseIds??[]}}async function _y(e,a){const r={"Content-Type":"application/json","X-Planner-Source":"web-ui",...a==null?void 0:a.headers};try{return await fetch(`${wR}${e}`,{...a,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 ut(e,a){let r=await _y(e,a),s=0;for(;r.status===503&&s<ER;)await new Promise(u=>setTimeout(u,SR)),s+=1,r=await _y(e,a);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 Fm(){return N0(await ut("/project"))}async function NR(e){const{descriptionRef:a,...r}=e,s={...r,...a?{descriptionRef:a}:{}};return N0(await ut("/project",{method:"PUT",body:JSON.stringify(s)}))}async function jR(e){return(await ut("/accepted-decisions",{method:"POST",body:JSON.stringify(e)})).acceptedDecision}async function RR(e){const{id:a,...r}=e;return(await ut(`/accepted-decisions/${a}`,{method:"PUT",body:JSON.stringify(r)})).acceptedDecision}async function kR(e){return ut(`/accepted-decisions/${e.id}`,{method:"DELETE",body:JSON.stringify({targetType:e.targetType,targetRef:e.targetRef,confirmed:!0})})}async function TR(){return ut("/ui-config")}async function AR(e){return ut(`/docs/view?path=${encodeURIComponent(e)}`)}async function DR(e,a){return ut("/docs/save",{method:"PUT",body:JSON.stringify({path:e,content:a,confirmed:!0})})}async function Vm(){return(await ut("/features")).map(pd)}async function ac(e){return pd(await ut(`/features/${e}`))}async function CR(e){return pd(await ut("/features",{method:"POST",body:JSON.stringify(e)}))}async function j0(e){const{updatedAt:a,...r}=e;return pd(await ut(`/features/${e.id}`,{method:"PUT",body:JSON.stringify({...r,expectedUpdatedAt:a})}))}async function OR(e){return ut(`/features/${e}`,{method:"DELETE"})}async function MR(){return(await ut("/ideas")).ideas}async function _R(e){return ut("/ideas",{method:"POST",body:JSON.stringify(e)})}async function LR(e){return ut(`/ideas/${e.id}`,{method:"PUT",body:JSON.stringify(e)})}async function zR(e){return ut(`/ideas/${e}`,{method:"DELETE"})}async function Ym(){return(await ut("/requirements")).requirements.map(Pm)}async function $R(e){return Pm(await ut("/requirements",{method:"POST",body:JSON.stringify(e)}))}async function UR(e){const{updatedAt:a,...r}=e;return Pm(await ut(`/requirements/${e.id}`,{method:"PUT",body:JSON.stringify({...r,expectedUpdatedAt:a})}))}async function BR(e){return ut(`/requirements/${e}`,{method:"DELETE"})}async function gd(e){const a=e?`?featureId=${encodeURIComponent(e)}`:"";return(await ut(`/phases${a}`)).map(md)}async function vd(e){return md(await ut(`/phases/${e}`))}async function IR(e){return md(await ut("/phases",{method:"POST",body:JSON.stringify(e)}))}async function R0(e){const{updatedAt:a,...r}=e;return md(await ut(`/phases/${e.id}`,{method:"PUT",body:JSON.stringify({...r,expectedUpdatedAt:a})}))}async function HR(e){return ut(`/phases/${e}`,{method:"DELETE"})}async function qR(e,a){return Gl(await ut(`/phases/${e}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function xd(e){return Gl(await ut(`/tasks/${e}`))}async function Gm(e){const{updatedAt:a,...r}=e;return Gl(await ut(`/tasks/${e.id}`,{method:"PUT",body:JSON.stringify({...r,expectedUpdatedAt:a})}))}async function PR(e){return Gl(await ut(`/tasks/${e}/start`,{method:"POST"}))}async function FR(e){const a=await ut(`/tasks/${e}/reopen`,{method:"POST",body:JSON.stringify({confirmed:!0})});return Gl(a.task)}async function VR(e,a,r){const s=await ut(`/tasks/${e}/subtasks`,{method:"POST",body:JSON.stringify({phaseId:a,...r})});return Gl(s.task)}async function YR(e,a,r){const s=await ut(`/tasks/${e}/dependencies`,{method:"POST",body:JSON.stringify({phaseId:a,dependsOnId:r})});return Gl(s.task)}async function GR(e){return ut(`/tasks/${e}`,{method:"DELETE"})}async function XR(){return ut("/tasks/active")}async function QR(){const e=await ut("/tasks/focus");return{active:(e.active??[]).map(a=>Hh(a)),pendingResume:(e.pendingResume??[]).map(a=>Hh(a)),nextWork:Hh(e.nextWork),nextWorkReason:e.nextWorkReason??""}}async function gm(){return(await ut("/handoffs")).handoffs??[]}async function KR(){return(await ut("/handoffs/archive")).archived??[]}async function k0(e){return ut(`/phases/${e}/handoff`,{method:"DELETE"})}async function ZR(e=!1){return ut(`/export?full=${e?"true":"false"}`)}async function WR(){return ut("/repair",{method:"POST"})}async function qh(e,a,r,s){return ut("/reorder",{method:"POST",body:JSON.stringify({kind:e,movedId:a,beforeId:r,afterId:s})})}function JR(){const[e,a]=v.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 v.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),window.localStorage.setItem("plan-ui-theme",e)},[e]),{theme:e,toggleTheme:()=>a(r=>r==="dark"?"light":"dark")}}function e2({liveStatus:e}){const a=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 ${a.className}`,children:[o.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${a.dotClassName}`}),o.jsx("span",{className:"truncate",children:a.label})]})}function t2({projectName:e,projectRoot:a,planRoot:r,agentPlanVersion:s,liveStatus:u}){const{theme:c,toggleTheme:d}=JR(),[h,p]=v.useState(!1),[g,y]=v.useState(null),[x,E]=v.useState(!1),S=[{to:"/ideas",label:"Ideas",icon:y0},{to:"/features",label:"Features",icon:Po},{to:"/requirements",label:"Requirements",icon:nc},{to:"/handoff",label:"Handoff",icon:S0}];async function w(j){y(j?"full":"summary");try{const L=await ZR(j),B=new Blob([L.markdown],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(B),F=document.createElement("a");F.href=I,F.download=j?"EXPORT-full.md":L.filePath||"EXPORT.md",document.body.appendChild(F),F.click(),F.remove(),URL.revokeObjectURL(I),p(!1)}catch(L){window.alert(`Export failed: ${L instanceof Error?L.message:String(L)}`)}finally{y(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(Ye,{to:"/",title:a??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(Po,{className:"h-4 w-4"})}),o.jsxs("span",{className:"min-w-0 truncate",children:[o.jsx("span",{className:"block truncate text-sm font-black tracking-tight sm:text-base",children:e??"Agent Plan"}),o.jsx("span",{className:"block truncate text-[9px] font-medium tracking-wide text-[var(--text-subtle)] sm:text-[10px]","data-testid":"agent-plan-version",children:s?`v${s}`:"Version unavailable"})]})]}),o.jsx("nav",{className:"ml-1 hidden items-center gap-1 md:flex",children:S.map(j=>o.jsxs(hm,{to:j.to,"aria-label":j.label,className:({isActive:R})=>`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 ${R?"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(j.icon,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),o.jsx("span",{children:j.label})]},j.to))}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5 sm:gap-2",children:[o.jsx(e2,{liveStatus:u}),o.jsx("button",{type:"button",onClick:d,"aria-label":c==="dark"?"Switch to light theme":"Switch to dark theme",title:c==="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:c==="dark"?o.jsx(gR,{className:"h-4 w-4"}):o.jsx(nR,{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":x,onClick:()=>E(j=>!j),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:x?o.jsx(E0,{className:"h-4 w-4"}):o.jsx(Wj,{className:"h-4 w-4"})}),x?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-[150]","aria-hidden":"true",onClick:()=>E(!1)}),o.jsxs("div",{role:"menu",onKeyDown:j=>{j.key==="Escape"&&E(!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:[S.map(j=>o.jsxs(hm,{to:j.to,"aria-label":j.label,onClick:()=>E(!1),className:({isActive:R})=>`flex items-center gap-2 rounded-[10px] px-3 py-2 text-sm font-semibold transition ${R?"bg-[var(--accent-soft)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[var(--accent-soft)]"}`,children:[o.jsx(j.icon,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{children:j.label})]},j.to)),o.jsx("div",{className:"my-1 h-px bg-[var(--border)]"}),o.jsxs("button",{type:"button",role:"menuitem",disabled:g!==null,onClick:()=>{E(!1),w(!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",g==="summary"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),o.jsxs("button",{type:"button",role:"menuitem",disabled:g!==null,onClick:()=>{E(!1),w(!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",g==="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":h,"aria-label":"Export",onClick:()=>p(j=>!j),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(qj,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),o.jsx("span",{children:"Export"}),o.jsx(Ts,{className:`h-3.5 w-3.5 shrink-0 transition-transform sm:h-4 sm:w-4 ${h?"rotate-180":""}`})]}),h?o.jsxs("div",{role:"menu",onKeyDown:j=>{var I;const R=Array.from(j.currentTarget.querySelectorAll("[role=menuitem]")).filter(F=>!F.hasAttribute("disabled"));if(R.length===0)return;const L=R.indexOf(document.activeElement);let B=L;if(j.key==="ArrowDown")B=L===-1?0:(L+1)%R.length;else if(j.key==="ArrowUp")B=L===-1?R.length-1:(L-1+R.length)%R.length;else if(j.key==="Home")B=0;else if(j.key==="End")B=R.length-1;else return;j.preventDefault(),(I=R[B])==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:g!==null,onClick:()=>void w(!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",g==="summary"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),o.jsxs("button",{type:"button",role:"menuitem",disabled:g!==null,onClick:()=>void w(!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",g==="full"?o.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]})]})]})})}function Ph(e,a,r){e.split(`
|
|
312
|
+
`).forEach((u,c)=>{c>0&&a.push(o.jsx("br",{},`${r}-br-${c}`)),u&&a.push(u)})}const Ly=/\.planner\/docs\/[A-Za-z0-9][A-Za-z0-9_\-./]*\.md/g;function n2(e){return`/docs/view?path=${encodeURIComponent(e)}`}function zy(e,a){const r=[],s=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\))|(\*\*([^*]+)\*\*)|`([^`]+)`|\*([^*]+)\*/g;let u=0,c=null,d=0;for(;(c=s.exec(e))!==null;)c.index>u&&Ph(e.slice(u,c.index),r,`${a}-${d}`),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]},`${a}-link-${d}`)):c[5]?r.push(o.jsx("strong",{className:"font-semibold text-[var(--text)]",children:c[5]},`${a}-strong-${d}`)):c[6]?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[6]},`${a}-code-${d}`)):c[7]?r.push(o.jsx("em",{className:"italic",children:c[7]},`${a}-em-${d}`)):c[1]&&Ph(c[1],r,`${a}-raw-${d}`),u=s.lastIndex,d+=1;return u<e.length&&Ph(e.slice(u),r,`${a}-tail`),r}function Eo(e,a){const r=[];Ly.lastIndex=0;let s=0,u=null,c=0;for(;(u=Ly.exec(e))!==null;){u.index>s&&r.push(...zy(e.slice(s,u.index),`${a}-md-${c}`));const d=u[0];r.push(o.jsx("a",{href:n2(d),target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline","aria-label":`Open planner document ${d} in a new tab`,children:d},`${a}-doc-${c}`)),s=u.index+d.length,c+=1}return s<e.length&&r.push(...zy(e.slice(s),`${a}-md-tail`)),r}function a2(e,a){var u;const r=e.split(`
|
|
313
|
+
`);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-${a}`)}const s=e.match(/^(#{1,6})\s+(.+)$/);if(s&&s[2]){const c=((u=s[1])==null?void 0:u.length)??1,d=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:Eo(d,`h-${a}`)},`h-${a}`)}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,d)=>o.jsx("div",{children:Eo(c.replace(/^\s*>\s?/,""),`bq-${a}-${d}`)},`bq-${a}-${d}`))},`bq-${a}`):/^\s*([-*_])\1{2,}\s*$/.test(e.trim())?o.jsx("hr",{className:"border-[var(--border)]"},`hr-${a}`):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,d)=>o.jsx("li",{className:"list-disc",children:Eo(c.replace(/^\s*[-*]\s+/,""),`ul-${a}-${d}`)},`ul-${a}-${d}`))},`ul-${a}`):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,d)=>o.jsx("li",{children:Eo(c.replace(/^\s*\d+\.\s+/,""),`ol-${a}-${d}`)},`ol-${a}-${d}`))},`ol-${a}`):o.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:Eo(e,`p-${a}`)},`p-${a}`)}function Mn({text:e,className:a=""}){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 ${a}`,children:r.map((s,u)=>a2(s,u))})}function il(e){return String(e&&e>0?e:0).padStart(3,"0")}function cl({featureNum:e,phaseNum:a,taskNum:r}){const s=[];return e!==void 0&&s.push(`F${il(e)}`),a!==void 0&&s.push(`P${il(a)}`),r!==void 0&&s.push(`T${il(r)}`),s.join("/")}async function r2(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{const a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.top="-1000px",a.style.opacity="0",document.body.appendChild(a),a.focus(),a.select();const r=document.execCommand("copy");return a.remove(),r}catch{return!1}}function T0({type:e,phaseNum:a,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"?a===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(a)]}),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 nr({featureNum:e,phaseNum:a,taskNum:r,featureId:s,phaseId:u,taskId:c,featureName:d,phaseName:h,taskTitle:p}){const g=d?{title:d}:{},y=h?{title:h}:{},x=p?{title:p}:{},E=s?({children:j})=>o.jsx(Ye,{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(Ye,{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(Ye,{to:`/features/${s}/phases/${u}/tasks/${c}`,...x,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",...x,children:j});return o.jsxs("span",{className:"entity-path-badge",children:[e!==void 0?o.jsxs(E,{children:["F",il(e)]}):null,a!==void 0?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),o.jsxs(S,{children:["P",il(a)]})]}):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 rr({id:e,children:a}){const[r,s]=v.useState(!1);return o.jsxs("button",{type:"button",onClick:async u=>{u.preventDefault(),u.stopPropagation(),await r2(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:[a,o.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:r?o.jsx(Sj,{className:"h-3 w-3 text-emerald-500"}):o.jsx(Ij,{className:"h-3 w-3"})})]})}function ul({shortId:e}){return o.jsx(rr,{id:e,children:o.jsx("span",{className:"short-id-badge",children:e})})}function A0({featureNum:e,phaseNum:a,taskNum:r,featureId:s,phaseId:u,taskId:c,shortId:d,featureName:h,phaseName:p,taskTitle:g}){return o.jsxs(o.Fragment,{children:[o.jsx(nr,{featureNum:e,phaseNum:a,taskNum:r,featureId:s,phaseId:u,taskId:c,featureName:h,phaseName:p,taskTitle:g}),o.jsx(rr,{id:cl({featureNum:e,phaseNum:a,taskNum:r}),children:o.jsx("span",{className:"sr-only",children:"Copy path"})}),d?o.jsx(ul,{shortId:d}):null]})}function Xm({phaseId:e,updatedAt:a}){const r=`Phase handoff pending${a?` · updated ${new Date(a).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 vm={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 vm[e]??vm.planned}function Gu(e,a,r){switch(a){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 l2(e){const a=Xl(e);return{backgroundColor:Gu(a,"bg"),borderStyle:a.borderStyle,borderColor:Gu(a,"border"),borderWidth:"1px"}}function s2(e){const a=Xl(e);return{backgroundColor:Gu(a,"bg"),borderStyle:a.borderStyle,borderColor:Gu(a,"border"),borderWidth:"1px"}}function Qm(e){const{pattern:a}=Xl(e);return a?a==="dashed"?`status-pattern-dashed status-pattern-dashed-${e}`:`status-pattern-${a}`:""}function D0(e){return`status-${e}`}function C0(e,a=30){return`color-mix(in srgb, var(${Xl(e).colorVar}) ${a}%, transparent)`}function O0(e){return e in vm?e:"planned"}function i2(e,a){const s=[Xl(e).label],u=[["done",a.done],["in-progress",a.inProgress],["planned",a.planned],["waiting",a.waiting],["blocked",a.blocked],["deferred",a.deferred],["canceled",a.canceled],["rejected",a.rejected]];for(const[c,d]of u)d>0&&s.push(`${d} ${c}`);return s.join(" · ")}const M0={circle:hd,"play-start":sR,play:v0,clock:Uj,stop:b0,pause:qm,check:Hm,"check-mixed":Rj,ban:p0,x:Lj};function o2({status:e,className:a=""}){const r=Xl(e),s=M0[r.icon]??hd;return o.jsx(s,{className:`h-4 w-4 shrink-0 ${a}`.trim(),"aria-hidden":"true"})}function fr({status:e}){const a=O0(e),r=Xl(a);return o.jsxs("span",{className:`status-chip ${D0(a)} ${Qm(a)}`,title:r.description,"aria-label":r.description,children:[o.jsx(o2,{status:a,className:"h-3.5 w-3.5"}),o.jsx("span",{children:r.label})]})}function rc({status:e,breakdown:a,size:r="md",children:s}){const u=Xl(e),c=M0[u.icon]??hd,d=Qm(e),h=a?i2(e,a):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 ${D0(e)} ${d} ${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:a,doneTasks:r,totalTasks:s,recentlyChanged:u,className:c}){const d=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,d?o.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",r,"/",s||0,")"]}):null,o.jsx(rc,{status:e,breakdown:a})]})}function xm({task:e,variant:a="active"}){const r=Mr(),s=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)] ${a==="next"?"border-dashed border-[var(--accent)] bg-[var(--accent)]/5":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(nr,{featureNum:e.featureNumber,phaseNum:e.phaseNumber,taskNum:e.number,featureId:e.featureId,phaseId:e.phaseId,taskId:e.id}),o.jsx(rr,{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,a==="next"?o.jsx("span",{className:"shrink-0 rounded-full border border-[var(--accent)]/50 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-[0.16em] text-[var(--accent)]",children:"Next"}):null,o.jsx("span",{className:"shrink-0",children:o.jsx(fr,{status:e.status})}),o.jsx(Ye,{to:s,className:"min-w-0 flex-1 truncate font-medium hover:text-[var(--accent)]",children:e.title})]}),o.jsx("button",{type:"button",onClick:u=>{u.preventDefault(),u.stopPropagation(),r(`/?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(Kj,{className:"h-4 w-4"})})]})})}function c2({taskFocus:e}){const a=v.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 a.active.length===0&&!e.nextWork?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:a.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 (",a.active.length,")"]}),a.active.map(r=>o.jsx(xm,{task:r},r.id))]}):e.nextWork?o.jsxs("section",{"aria-labelledby":"next-work-heading",className:"grid gap-1.5",children:[o.jsx("h2",{id:"next-work-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Next work"}),o.jsx(xm,{task:e.nextWork,variant:"next"}),e.nextWorkReason?o.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:e.nextWorkReason}):null]}):null})})}function u2({project:e,taskFocus:a,serverInfo:r}){const s=pr(),[u,c]=v.useState("connecting");return v.useEffect(()=>{const d=h=>{var g;const p=(g=h.detail)==null?void 0:g.status;p&&c(p)};return window.addEventListener("agent-plan:ws-status",d),()=>window.removeEventListener("agent-plan:ws-status",d)},[]),o.jsxs("div",{className:"page-shell",children:[o.jsxs("header",{className:"sticky top-0 z-30 overflow-visible",children:[o.jsx(t2,{projectName:e==null?void 0:e.name,projectRoot:e==null?void 0:e.projectRoot,planRoot:e==null?void 0:e.planRoot,agentPlanVersion:(e==null?void 0:e.agentPlanVersion)??"",liveStatus:u}),o.jsx(c2,{taskFocus:a})]}),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(Ye,{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(Mn,{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(Ni,{})]})]})}const ka=32,_0=4,d2=Math.PI*1.2;function L0(){if(typeof document>"u")return"#7b68ee";const e=document.createElement("div");e.style.color="var(--accent, #7b68ee)",document.body.appendChild(e);const a=getComputedStyle(e).color||"#7b68ee";return e.remove(),a}function f2(){const e=document.createElement("canvas");e.width=ka,e.height=ka;const a=e.getContext("2d");if(!a)return"";const r=L0();return a.beginPath(),a.arc(ka/2,ka/2,ka/2-_0,0,Math.PI*2),a.fillStyle=r,a.fill(),a.fillStyle="#ffffff",a.font="bold 16px system-ui, sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText("A",ka/2,ka/2+1),e.toDataURL("image/png")}function h2(e,a){const r=e.getContext("2d");if(!r)return"";const s=L0();r.clearRect(0,0,ka,ka);const u=ka/2,c=ka/2,d=ka/2-_0;return r.beginPath(),r.arc(u,c,d,0,Math.PI*2),r.fillStyle=s,r.globalAlpha=.85,r.fill(),r.globalAlpha=1,r.beginPath(),r.arc(u,c,d-3,a,a+d2),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 m2(){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 p2(e){const a=v.useRef(null),r=v.useRef(null),s=v.useRef(null),u=v.useRef(0);v.useEffect(()=>{if(a.current||(a.current=m2()),s.current||(s.current=f2()),!r.current){const h=document.createElement("canvas");h.width=ka,h.height=ka,r.current=h}const c=a.current;if(!e){c.href=s.current;return}const d=window.setInterval(()=>{document.hidden||(u.current+=Math.PI/10,c.href=h2(r.current,u.current))},100);return()=>{window.clearInterval(d),c.href=s.current}},[e])}const Co={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},z0=v.createContext(Co);function $0(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function g2(e){return typeof e!="string"}function v2(e){return{create:(e==null?void 0:e.create)??Co.create,edit:(e==null?void 0:e.edit)??Co.edit,delete:(e==null?void 0:e.delete)??Co.delete,submit:(e==null?void 0:e.submit)??Co.submit}}function x2(e){const a=[],r=$0();e.primary&&a.push(r?"⌘":"Ctrl"),e.meta&&a.push(r?"⌘":"Meta"),e.ctrl&&a.push(r?"⌃":"Ctrl"),e.shift&&a.push(r?"⇧":"Shift"),e.alt&&a.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 a.push(s),r?a.join(""):a.join("+")}function y2(e){return e instanceof HTMLElement?!!e.closest("input, textarea, select, [contenteditable='true']"):!1}function b2(e,a){const r=a.key.length===1?a.key.toLowerCase():a.key,s=e.key.length===1?e.key.toLowerCase():e.key,u=$0(),c=a.meta??(a.primary?u:!1),d=a.ctrl??(a.primary?!u:!1);return s===r&&!!c===e.metaKey&&!!d===e.ctrlKey&&!!a.shift===e.shiftKey&&!!a.alt===e.altKey}function w2({shortcuts:e,children:a}){return v.createElement(z0.Provider,{value:v2(e)},a)}function U0(e){const a=v.useContext(z0);if(e)return g2(e)?e:a[e]}function _n(e,a,r){const s=U0(e);v.useEffect(()=>{if(!s||(r==null?void 0:r.enabled)===!1)return;const u=c=>{!(r!=null&&r.allowInEditable)&&y2(c.target)||b2(c,s)&&(c.preventDefault(),a())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[a,r==null?void 0:r.allowInEditable,r==null?void 0:r.enabled,s])}const S2=1500,E2=80,N2=12e3,j2=5e3;function R2(){const{revalidate:e}=lN(),a=v.useRef(null),r=v.useRef(null),s=v.useRef(null),u=v.useRef(null),c=v.useRef(null);return v.useEffect(()=>{let d=!0;const h=F=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:F}}))},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)},x=()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},E=()=>{g(),s.current=window.setTimeout(()=>{e()},E2)},S=()=>{!d||r.current!==null||(h("reconnecting"),r.current=window.setTimeout(()=>{r.current=null,R()},S2))},w=()=>{x(),y();const F=a.current;if(a.current=null,F&&(F.readyState===WebSocket.OPEN||F.readyState===WebSocket.CONNECTING))try{F.close()}catch{}},j=()=>{x(),y(),u.current=window.setInterval(()=>{const F=a.current;if(!(!F||F.readyState!==WebSocket.OPEN)){try{F.send(JSON.stringify({type:"ping"}))}catch{w(),S();return}y(),c.current=window.setTimeout(()=>{w(),S()},j2)}},N2)},R=()=>{if(!d)return;const F=a.current;if(F&&(F.readyState===WebSocket.OPEN||F.readyState===WebSocket.CONNECTING))return;h(r.current!==null?"reconnecting":"connecting"),p();const W=window.location.protocol==="https:"?"wss":"ws",ne=new WebSocket(`${W}://${window.location.host}/ws`);a.current=ne,ne.onopen=()=>{p(),h("live"),j()},ne.onmessage=_=>{y();try{const T=JSON.parse(_.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=()=>{x(),y(),a.current===ne&&(a.current=null),d&&S()},ne.onerror=()=>{try{ne.close()}catch{}}},L=()=>{const F=a.current;(!F||F.readyState===WebSocket.CLOSED||F.readyState===WebSocket.CLOSING)&&R()},B=()=>{document.visibilityState==="visible"&&L()},I=()=>{L()};return h("connecting"),R(),window.addEventListener("online",I),document.addEventListener("visibilitychange",B),()=>{d=!1,h("disconnected"),window.removeEventListener("online",I),document.removeEventListener("visibilitychange",B),p(),g(),x(),y(),w()}},[e]),null}async function k2(){const[e,a,r]=await Promise.all([Fm(),TR(),QR()]);return{project:e,uiConfig:a,taskFocus:r}}function T2(){const{project:e,uiConfig:a,taskFocus:r}=gr();return v.useEffect(()=>{var d,h;const s=(d=e==null?void 0:e.name)==null?void 0:d.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]),p2(r.active.length>0),o.jsxs(w2,{shortcuts:a.shortcuts,children:[o.jsx(R2,{}),o.jsx(d0,{getKey:s=>s.pathname}),o.jsx(u2,{project:e,taskFocus:r,serverInfo:a.server})]})}function A2(e,a){if(typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string")return e.message;if(typeof e=="string"){try{const r=JSON.parse(e);if(typeof r.message=="string")return r.message}catch{return e}return e}return a}function D2(){const e=o0(),a=wi(e),r=a&&e.status===503,s=a&&e.status===423,u=a?r?"Planner web UI disconnected":s?"Planner write already in progress":`Request failed (${e.status})`:"Planner web UI unavailable",c=a?A2(e.data,e.statusText):e instanceof Error?e.message:"The planner web UI could not reach its local server.";return v.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:u}),o.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(c)}),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"})]})]}):s?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Another Pi, MCP, CLI, development, or planner-server process is currently mutating this planner root."}),o.jsx("p",{children:"Read-only pages remain available. Wait for that write to finish, then retry without starting another planner server."})]}):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 C2(){const[e,a,r]=await Promise.all([Vm(),gd(),XR()]);return{features:e,phases:a,activeTasks:r}}function O2({shortcut:e}){const a=U0(e);return a?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:x2(a)}):null}const M2={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 Ze({variant:e="secondary",className:a="",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 ${M2[e]} ${a}`,...u,children:[o.jsx("span",{className:"inline-flex items-center gap-1.5 sm:gap-2",children:r}),s?o.jsx(O2,{shortcut:s}):null]})}function $t({className:e="",children:a,...r}){return o.jsx("div",{className:`surface-card p-6 ${e}`,...r,children:a})}function No(...e){return e.filter(Boolean).join(" ")}function _2(){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(Ts,{className:"h-5 w-5"})})}function Hn({title:e,subtitle:a,leading:r,actions:s,defaultOpen:u=!1,count:c,className:d,summaryClassName:h,contentClassName:p,titleClassName:g,subtitleClassName:y,children:x}){return o.jsxs("details",{className:No("group mt-4 overflow-hidden rounded-[10px] border border-[var(--border)]",d),open:u,children:[o.jsxs("summary",{className:No("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:No("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]}),a?o.jsx("div",{className:No("mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",y),children:a}):null]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s,o.jsx(_2,{})]})]}),o.jsx("div",{className:No("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:x})]})}function ym({targetType:e,targetRef:a,returnTo:r}){return o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"hidden",name:"targetType",value:e}),a?o.jsx("input",{type:"hidden",name:"targetRef",value:a}):null,o.jsx("input",{type:"hidden",name:"returnTo",value:r})]})}function B0({decision:e}){return o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("label",{className:"grid gap-1 text-sm font-medium text-[var(--text)]",children:["Title",o.jsx("input",{name:"title",required:!0,defaultValue:(e==null?void 0:e.title)??"",className:"field-control"})]}),o.jsxs("label",{className:"grid gap-1 text-sm font-medium text-[var(--text)]",children:["Decision",o.jsx("textarea",{name:"decision",defaultValue:(e==null?void 0:e.decision)??"",className:"field-control field-textarea min-h-20"})]}),o.jsxs("label",{className:"grid gap-1 text-sm font-medium text-[var(--text)]",children:["Rationale",o.jsx("textarea",{name:"rationale",defaultValue:(e==null?void 0:e.rationale)??"",className:"field-control field-textarea min-h-20"})]}),o.jsxs("label",{className:"grid gap-1 text-sm font-medium text-[var(--text)]",children:["Implementation notes",o.jsx("textarea",{name:"implementationNotes",defaultValue:(e==null?void 0:e.implementationNotes)??"",className:"field-control field-textarea min-h-20"})]})]})}function L2({targetType:e,targetRef:a,returnTo:r}){return o.jsxs("details",{className:"surface-card px-4 py-3",children:[o.jsx("summary",{className:"cursor-pointer select-none text-sm font-semibold text-[var(--text)]",children:"Add accepted decision"}),o.jsxs(dn,{method:"post",action:"/accepted-decisions",className:"mt-3 grid gap-3",children:[o.jsx(ym,{targetType:e,targetRef:a,returnTo:r}),o.jsx("input",{type:"hidden",name:"intent",value:"create"}),o.jsx(B0,{}),o.jsx(Ze,{type:"submit",variant:"primary",className:"justify-self-start",children:"Add decision"})]})]})}function z2({entry:e,targetType:a,targetRef:r,returnTo:s}){return o.jsxs("details",{className:"mt-3 rounded-[12px] border border-[var(--border)] bg-[var(--surface-elevated)] px-3 py-2",children:[o.jsx("summary",{className:"cursor-pointer select-none text-sm font-semibold text-[var(--text)]",children:"Manage decision"}),o.jsxs("div",{className:"mt-3 grid gap-3",children:[o.jsxs(dn,{method:"post",action:"/accepted-decisions",className:"grid gap-3",children:[o.jsx(ym,{targetType:a,targetRef:r,returnTo:s}),o.jsx("input",{type:"hidden",name:"intent",value:"update"}),o.jsx("input",{type:"hidden",name:"decisionId",value:e.id}),o.jsx(B0,{decision:e}),o.jsx(Ze,{type:"submit",variant:"secondary",className:"justify-self-start",children:"Save decision"})]}),o.jsxs(dn,{method:"post",action:"/accepted-decisions",onSubmit:u=>{window.confirm(`Delete accepted decision “${e.title}”? This cannot be undone.`)||u.preventDefault()},children:[o.jsx(ym,{targetType:a,targetRef:r,returnTo:s}),o.jsx("input",{type:"hidden",name:"intent",value:"delete"}),o.jsx("input",{type:"hidden",name:"decisionId",value:e.id}),o.jsx(Ze,{type:"submit",variant:"danger",children:"Delete decision"})]})]})]})}function yd({decisions:e,targetType:a,targetRef:r}){const s=ga(),u=`${s.pathname}${s.search}${s.hash}`,c=!!a;return e.length===0&&!c?null:o.jsxs(Hn,{title:`Accepted decisions (${e.length})`,contentClassName:"grid gap-3",children:[c&&a?o.jsx(L2,{targetType:a,targetRef:r,returnTo:u}):null,e.map(d=>o.jsxs("div",{className:"surface-card px-4 py-3",children:[o.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:d.title}),d.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(Mn,{text:d.decision,className:"mt-1"})]}):null,d.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(Mn,{text:d.rationale,className:"mt-1"})]}):null,d.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(Mn,{text:d.implementationNotes,className:"mt-1"})]}):null,c&&a?o.jsx(z2,{entry:d,targetType:a,targetRef:r,returnTo:u}):null]},d.id))]},s.key)}function Nu({title:e,items:a}){return a.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:a.map(r=>o.jsx("li",{className:"list-disc",children:r},r))})]})}function $2({project:e}){const a=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||a.length>0||e.acceptedDecisions.length>0||s>0?o.jsx($t,{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(Nu,{title:"In scope",items:e.scope}),o.jsx(Nu,{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(Nu,{title:"Technologies",items:e.technologies}),o.jsx(Nu,{title:"Tools",items:e.tools})]}):null,a?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(Mn,{text:a})})]}):null,o.jsx(yd,{decisions:e.acceptedDecisions,targetType:"project"}),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 U2(...e){return e.filter(Boolean).join(" ")}function B2(e){return e&&e>0?`P${e}`:""}function bd({priority:e,className:a}){const r=B2(e);if(!r)return null;const s=`Priority ${e}`;return o.jsx("span",{className:U2("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)]",a),"aria-label":s,title:s,children:r})}function I2(e){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}function H2({features:e,phases:a}){const r=v.useMemo(()=>{const s=new Map(e.map(u=>[u.id,u.name]));return a.flatMap(u=>u.tasks.filter(c=>c.status==="done").map(c=>({task:c,phase:u,feature:e.find(d=>d.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,a]);return o.jsxs($t,{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:d,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(A0,{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(bd,{priority:s.priority}),o.jsx("span",{className:"ml-auto shrink-0",children:o.jsx(fr,{status:s.status})})]}),o.jsx(Ye,{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(T0,{type:"phase",featureNum:c==null?void 0:c.number}),o.jsxs("span",{className:"min-w-0 truncate",children:[d," · ",u.title]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",I2(h)]})]},s.id)):o.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const $y=1440*60*1e3;function q2(e){const a=Date.now()-new Date(e).getTime();if(a<0)return"just now";const r=Math.floor(a/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 P2({features:e,phases:a}){const[,r]=v.useState(0),s=Date.now(),u=v.useMemo(()=>{const c=new Map(e.map(d=>[d.id,d.name]));return a.flatMap(d=>d.tasks.map(h=>({task:h,phase:d,feature:e.find(p=>p.id===d.featureId),featureName:d.featureId?c.get(d.featureId)??d.featureId:"Unlinked feature",createdAt:h.createdAt}))).filter(d=>{const h=new Date(d.createdAt).getTime();return Number.isFinite(h)&&s-h<$y&&s-h>=0&&d.task.status==="planned"&&!d.task.startedAt}).sort((d,h)=>h.createdAt.localeCompare(d.createdAt)).slice(0,10)},[e,a,s]);return v.useEffect(()=>{if(u.length===0)return;const c=u.reduce((h,p)=>{const g=new Date(p.createdAt).getTime()+$y-Date.now();return Math.min(h,g)},1/0);if(!Number.isFinite(c)||c<=0)return;const d=window.setTimeout(()=>r(h=>h+1),c+50);return()=>window.clearTimeout(d)},[u]),u.length===0?null:o.jsxs($t,{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:d,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(A0,{featureNum:h==null?void 0:h.number,phaseNum:d.number,taskNum:c.number,featureId:h==null?void 0:h.id,phaseId:d.id,taskId:c.id,shortId:c.shortId,featureName:h==null?void 0:h.name,phaseName:d.title,taskTitle:c.title}),o.jsx(bd,{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(fr,{status:c.status})})]}),o.jsx(Ye,{to:d.featureId?`/features/${d.featureId}/phases/${d.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(T0,{type:"phase",featureNum:h==null?void 0:h.number}),o.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",d.title]})]}),o.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",q2(g)]})]},c.id))})]})}const F2=new Set(["in-progress"]),V2=new Set(["planned","waiting","blocked","deferred"]),Y2=new Set(["done","canceled","rejected"]);function I0(e){return e==="discovery"?"in-progress":e==="draft"?"planned":e}function G2(e){const a={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":a.planned++;break;case"in-progress":a.inProgress++;break;case"waiting":a.waiting++;break;case"blocked":a.blocked++;break;case"deferred":a.deferred++;break;case"done":a.done++;break;case"canceled":a.canceled++;break;case"rejected":a.rejected++;break}return a}function X2(){return{planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function H0(e){const a=e,r=G2(a),s=a.length;if(s===0)return{displayStatus:"planned",breakdown:X2(),hasStarted:!1,totalChildren:0,meaningfulChildren:0};const u=a.filter(g=>g!=="canceled"&&g!=="rejected"),c=u.length,d=u.some(g=>g!=="planned");if(u.some(g=>F2.has(g)))return{displayStatus:"in-progress",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c};if(a.every(g=>Y2.has(g)))return a.every(g=>g==="done")?{displayStatus:"done",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:a.every(g=>g==="canceled")?{displayStatus:"canceled",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:a.every(g=>g==="rejected")?{displayStatus:"rejected",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:{displayStatus:"closed",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c};const h=u.filter(g=>V2.has(g));return h.length>0&&h.every(g=>g==="waiting")?{displayStatus:"waiting",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:h.length>0&&h.every(g=>g==="blocked")?{displayStatus:"blocked",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:h.length>0&&h.every(g=>g==="deferred")?{displayStatus:"deferred",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:h.length>0&&h.every(g=>g==="planned")&&!d?{displayStatus:"planned",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}:{displayStatus:"started",breakdown:r,hasStarted:d,totalChildren:s,meaningfulChildren:c}}function Km(e){const a=e.map(r=>I0(r.status));return H0(a)}function Zm(e){const a=e.map(r=>I0(r.status));return H0(a)}function q0(e){return Zm(e)}function P0(e){return Km(e)}const Oo={key:"priority",direction:"asc"},Q2=4200;function K2(e){return e.reduce((a,r)=>a+r.tasks.length,0)}function Z2(e){return e.reduce((a,r)=>a+r.tasks.filter(s=>s.status==="done").length,0)}function W2(e){return String(e&&e>0?e:0).padStart(3,"0")}const J2={draft:0,discovery:1,planned:2,waiting:3,blocked:4,deferred:5,"in-progress":7,done:8,canceled:9,rejected:10};function Uy(e,a){if(a==="title")return"name"in e?e.name:e.title;if(a==="status")return J2[e.status]??99;if(a==="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(a==="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(a==="shortId")return e.shortId??"";if(a==="priority"||a==="number")return e[a]??0;if(a==="createdAt"||a==="updatedAt"){const r=e[a];return r?new Date(r).getTime():0}return 0}function _o(e,a,r,s){const u=Uy(e,r),c=Uy(a,r);let d;return typeof u=="number"&&typeof c=="number"?d=u-c:d=String(u).localeCompare(String(c)),d===0&&(d=(e.priority??0)-(a.priority??0)||e.number-a.number||e.createdAt.localeCompare(a.createdAt)),s==="desc"?-d:d}function ek(e,a,r=Oo){const s=new Map;for(const u of a){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)??[],d=c.reduce((y,x)=>y+x.tasks.length,0),h=c.reduce((y,x)=>y+x.tasks.filter(E=>E.status==="done").length,0),p=c.map(y=>{const x=[...y.tasks].sort((S,w)=>_o(S,w,r.key,r.direction)),E=x.some(S=>S.status==="in-progress");return{phase:y,totalTasks:y.tasks.length,doneTasks:y.tasks.filter(S=>S.status==="done").length,allTasks:x,hasActiveTask:E,display:Km(x)}}),g=p.some(({phase:y,allTasks:x})=>y.status==="in-progress"||y.status==="discovery"||x.some(E=>E.status==="in-progress"));return{feature:u,totalTasks:d,doneTasks:h,allPhases:p.sort((y,x)=>_o(y.phase,x.phase,r.key,r.direction)),hasActiveTask:p.some(y=>y.hasActiveTask),isActive:g,display:Zm(p.map(y=>y.phase))}}).sort((u,c)=>_o(u.feature,c.feature,r.key,r.direction))}function ju({title:e,value:a,valueSuffix:r,subtitle:s,icon:u,valueClassName:c,iconClassName:d}){return o.jsxs($t,{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:a}),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)] ${d??"text-[var(--accent)]"}`,children:u})]})}function By(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 tk({features:e,phases:a}){const r=new Map;for(const x of a)x.featureId&&r.set(x.featureId,[...r.get(x.featureId)??[],x]);const s=e.filter(x=>{const E=r.get(x.id)??[];return Zm(E).displayStatus==="done"}).length,u=Math.max(e.length-s,0),c=a.filter(x=>Km(x.tasks).displayStatus==="done").length,d=Math.max(a.length-c,0),h=K2(a),p=Z2(a),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(ju,{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(Po,{className:"h-4 w-4"})}),o.jsx(ju,{title:"Phases",value:String(a.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:[d," left"]})]}),icon:o.jsx(bj,{className:"h-4 w-4"})}),o.jsx(ju,{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(nc,{className:"h-4 w-4"})}),o.jsx(ju,{title:"Completion",value:`${y}%`,subtitle:"Task completion rate",valueClassName:By(y),iconClassName:By(y),icon:o.jsx(Hm,{className:"h-4 w-4"})})]})}const nk=["done","canceled","rejected"],ak=["planned","in-progress","blocked","waiting","deferred"],rk=1440*60*1e3,lk=10;function Lo(e){return nk.includes(e)}function Qu(e){return ak.includes(e)}const F0=[{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 sk(e){const a=[];for(const r of e)r.tasks&&a.push(...r.tasks);return a}function Bl(e){if(!e)return null;const a=Date.parse(e);return Number.isNaN(a)?null:new Date(a).toISOString().slice(0,lk)}function gi(e){return Date.parse(`${e}T00:00:00.000Z`)}function V0(e,a){const r=Date.parse(e.date),s=Date.parse(a.date);return r!==s&&!Number.isNaN(r)&&!Number.isNaN(s)?r-s:e.id<a.id?-1:e.id>a.id?1:0}function ik(e,a){const r=Bl(e.createdAt),s=gi(a),u=[...e.statusLog??[]].sort(V0);let c=null;for(const d of u){const h=Lo(d.fromStatus);if(!Lo(d.toStatus)&&h){const g=Bl(d.date);g&&gi(g)<=s&&(c=g)}}return c??r}function Ru(e,a){return a>0?e/a:0}function ok(){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 ck(){return F0.map(e=>({...e,count:0,taskIds:[]}))}function Iy(e,a){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:a,addRatePerActiveDay:Ru(r,a),closeRatePerActiveDay:Ru(s,a),reopenRatePerActiveDay:Ru(u,a),closureRatio:Ru(s,r)}}function Y0(e){return{currentOpen:e.filter(a=>Qu(a.status)).length,currentTotal:e.length,currentDone:e.filter(a=>a.status==="done").length,currentCanceled:e.filter(a=>a.status==="canceled").length,currentRejected:e.filter(a=>a.status==="rejected").length}}function uk(e,a,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:ck(),summary:{...s,...Y0(a)},allTime:s,currentOpenIds:a.filter(u=>Qu(u.status)).map(u=>u.id).sort(),windowAddedIds:[],windowClosedIds:[],windowReopenedIds:[],limitations:r}}function dk(e,a={}){const r=a.windowDays??21,s=ok(),u=new Set(s.notes),c=J=>{u.add(J),s.legacyHistoryFallbackUsed=!0},d=[];for(const J of e){const $=Bl(J.createdAt);$&&d.push({day:$,kind:"added",taskId:J.id});const P=[...J.statusLog??[]].sort(V0);let ce=null;for(const Se of P){const A=Lo(Se.fromStatus),C=Lo(Se.toStatus),G=Bl(Se.date);G&&(C&&!A?d.push({day:G,kind:"closed",taskId:J.id}):!C&&A&&d.push({day:G,kind:"reopened",taskId:J.id}),ce=C)}const me=Lo(J.status);if(me&&ce!==!0){const Se=Bl(J.completedAt)??Bl(J.updatedAt)??$;Se&&d.push({day:Se,kind:"closed",taskId:J.id}),c("A terminal task's history does not record a closure; a close was inferred from completedAt/updatedAt/createdAt.")}else if(!me&&ce===!0){const Se=Bl(J.updatedAt)??$;Se&&d.push({day:Se,kind:"reopened",taskId:J.id}),c("A task whose history ends in a terminal status is currently open; a reopen was inferred from updatedAt/createdAt.")}}if(d.length===0)return s.notes=[...u],uk(r,e,s);const h=d.map(J=>J.day).reduce((J,$)=>$>J?$:J),p=a.asOf&&Bl(a.asOf)||h,g=gi(p),y=d.filter(J=>gi(J.day)<=g),x=[...new Set(y.map(J=>J.day))].sort(),E=new Map;for(const J of y){const $=E.get(J.day)??{added:0,closed:0,reopened:0,addedIds:new Set,closedIds:new Set,reopenedIds:new Set};J.kind==="added"?($.added+=1,$.addedIds.add(J.taskId)):J.kind==="closed"?($.closed+=1,$.closedIds.add(J.taskId)):($.reopened+=1,$.reopenedIds.add(J.taskId)),E.set(J.day,$)}const S=[];let w=0,j=0,R=0;for(const J of x){const $=E.get(J)??{added:0,closed:0,reopened:0,addedIds:new Set,closedIds:new Set,reopenedIds:new Set};w+=$.added,j+=$.closed,R+=$.reopened;const P=j-R,ce=w+R-j;S.push({date:J,added:$.added,closed:$.closed,reopened:$.reopened,netBacklog:ce,cumulativeScope:w,cumulativeCompletion:P,addedTaskIds:[...$.addedIds].sort(),closedTaskIds:[...$.closedIds].sort(),reopenedTaskIds:[...$.reopenedIds].sort()})}const L=S.slice(Math.max(0,S.length-r)),B=new Set(L.map(J=>J.date)),I=y.filter(J=>B.has(J.day)),F=L[0],W=L[L.length-1],ne=F&&W?{start:F.date,end:W.date}:null,_=F0.map(J=>({...J,count:0,taskIds:new Set}));for(const J of e){if(!Qu(J.status))continue;const $=ik(J,p);if(!$||gi($)>g)continue;const P=Math.max(0,Math.floor((g-gi($))/rk)),ce=_.find(me=>P>=me.minDays&&(me.maxDays===null||P<=me.maxDays));ce&&(ce.count+=1,ce.taskIds.add(J.id))}const T=_.map(J=>({...J,taskIds:[...J.taskIds].sort()})),de={...Iy(I,L.length),...Y0(e)},ge=Iy(y,x.length),be=e.filter(J=>Qu(J.status)).map(J=>J.id).sort(),re=[...new Set(I.filter(J=>J.kind==="added").map(J=>J.taskId))].sort(),je=[...new Set(I.filter(J=>J.kind==="closed").map(J=>J.taskId))].sort(),Te=[...new Set(I.filter(J=>J.kind==="reopened").map(J=>J.taskId))].sort();return r>x.length&&u.add(`Requested ${r}-active-day window exceeds the ${x.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:L,cumulativePoints:S,agingBuckets:T,summary:de,allTime:ge,currentOpenIds:be,windowAddedIds:re,windowClosedIds:je,windowReopenedIds:Te,limitations:s}}const Es=184,Si=16,Ku=16,Wm=30,pa=34;function G0(e){return 420}function X0(e,a,r){const s=r-pa-Ku;return a<=1?pa+s/2:pa+e/(a-1)*s}function Fo(e,a){const r=Es-Si-Wm;return Si+r-e/Math.max(a,1)*r}function Q0(e){return e<=3?new Set(Array.from({length:e},(a,r)=>r)):new Set([0,Math.floor((e-1)/2),e-1])}function K0(e){return e.slice(5)}function Vo({title:e,description:a,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:a}),o.jsx("div",{className:"mt-3",children:r})]})}function al(e,a,r){return`${a} ${a===1?"task":"tasks"} ${e} on ${r}`}function fk({points:e,onSelect:a}){if(e.length===0)return o.jsx(Vo,{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=G0(e.length),s=Math.max(1,...e.flatMap(p=>[p.added,p.closed])),u=Es-Wm,c=(r-pa-Ku)/Math.max(e.length,1),d=Math.max(1.5,Math.min(10,c*.28)),h=Q0(e.length);return o.jsxs(Vo,{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} ${Es}`,"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:pa,y1:Si,x2:pa,y2:u,stroke:"var(--border-strong)"}),o.jsx("line",{x1:pa,y1:u,x2:r-Ku,y2:u,stroke:"var(--border-strong)"}),o.jsx("text",{x:pa-6,y:Si+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:s}),o.jsx("text",{x:pa-6,y:u+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:"0"}),e.map((p,g)=>{const y=pa+(g+.5)*c,x=Fo(p.added,s),E=Fo(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}`}),a&&p.addedTaskIds.length>0?o.jsx("g",{role:"button",tabIndex:0,"aria-label":`Filter Work Tree to ${al("added",p.addedTaskIds.length,p.date)}`,className:"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>a({key:`added:${p.date}`,label:al("added",p.addedTaskIds.length,p.date),taskIds:p.addedTaskIds}),onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),a({key:`added:${p.date}`,label:al("added",p.addedTaskIds.length,p.date),taskIds:p.addedTaskIds}))},children:o.jsx("rect",{x:y-d-1,y:x,width:d,height:Math.max(2,u-x),rx:"1.5",fill:"var(--accent)"})}):o.jsx("rect",{x:y-d-1,y:x,width:d,height:Math.max(0,u-x),rx:"1.5",fill:"var(--accent)"}),a&&p.closedTaskIds.length>0?o.jsx("g",{role:"button",tabIndex:0,"aria-label":`Filter Work Tree to ${al("closed",p.closedTaskIds.length,p.date)}`,className:"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onClick:()=>a({key:`closed:${p.date}`,label:al("closed",p.closedTaskIds.length,p.date),taskIds:p.closedTaskIds}),onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),a({key:`closed:${p.date}`,label:al("closed",p.closedTaskIds.length,p.date),taskIds:p.closedTaskIds}))},children:o.jsx("rect",{x:y+1,y:E,width:d,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:d,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:Es-9,textAnchor:"middle",className:"fill-[var(--text-subtle)] text-[10px]",children:K0(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:a&&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:()=>a({key:`added:${p.date}`,label:al("added",p.addedTaskIds.length,p.date),taskIds:p.addedTaskIds}),children:p.added}):p.added}),o.jsx("td",{className:"px-2 py-1",children:a&&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:()=>a({key:`closed:${p.date}`,label:al("closed",p.closedTaskIds.length,p.date),taskIds:p.closedTaskIds}),children:p.closed}):p.closed}),o.jsx("td",{className:"px-2 py-1",children:a&&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:()=>a({key:`reopened:${p.date}`,label:al("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 Hy(e,a,r,s){return e.map((u,c)=>`${c===0?"M":"L"} ${X0(c,e.length,a).toFixed(2)} ${Fo(Math.max(0,r(u)),s).toFixed(2)}`).join(" ")}function hk({points:e}){if(e.length===0)return o.jsx(Vo,{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 a=G0(e.length),r=Math.max(1,...e.flatMap(h=>[h.cumulativeScope,h.cumulativeCompletion])),s=Es-Wm,u=Q0(e.length),c=Hy(e,a,h=>h.cumulativeScope,r),d=Hy(e,a,h=>h.cumulativeCompletion,r);return o.jsxs(Vo,{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 ${a} ${Es}`,"data-coordinate-width":a,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:pa,y1:Si,x2:pa,y2:s,stroke:"var(--border-strong)"}),o.jsx("line",{x1:pa,y1:s,x2:a-Ku,y2:s,stroke:"var(--border-strong)"}),o.jsx("text",{x:pa-6,y:Si+4,textAnchor:"end",className:"fill-[var(--text-subtle)] text-[10px]",children:r}),o.jsx("text",{x:pa-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,fill:"none",stroke:"var(--color-status-done)",strokeWidth:"2.5",strokeDasharray:"6 4"}),e.map((h,p)=>{const g=X0(p,e.length,a);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:Fo(h.cumulativeScope,r),r:"2.5",fill:"var(--accent)"}),o.jsx("rect",{x:g-2.5,y:Fo(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:Es-9,textAnchor:"middle",className:"fill-[var(--text-subtle)] text-[10px]",children:K0(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 mk({analytics:e,onSelect:a}){const r=Math.max(1,...e.agingBuckets.map(u=>u.count)),s=e.agingBuckets.reduce((u,c)=>u+c.count,0);return o.jsxs(Vo,{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:a&&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:()=>a({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 pk({analytics:e,onSelect:a}){const r=a?{onSelect:a}:{};return o.jsxs("div",{className:"grid min-w-0 max-w-full overflow-hidden gap-3 xl:grid-cols-2",children:[o.jsx(fk,{points:e.dailyPoints,...r}),o.jsx(hk,{points:e.dailyPoints}),o.jsx("div",{className:"min-w-0 xl:col-span-2",children:o.jsx(mk,{analytics:e,...r})})]})}const gk=[7,21,60];function vk(e){return e>0?`+${e}`:String(e)}function ku(e){return e.toFixed(1)}function xk(e){return`${(e*100).toFixed(0)}%`}function yk(e){const{netBacklog:a,activeDays:r}=e.summary;if(r===0)return"No task-flow activity is recorded for this period.";if(a>0)return`Backlog grew by ${a} ${a===1?"task":"tasks"} across the selected active days.`;if(a<0){const s=Math.abs(a);return`Backlog shrank by ${s} ${s===1?"task":"tasks"} across the selected active days.`}return"Backlog stayed level across the selected active days."}function bk({value:e}){return e>0?o.jsx(vj,{className:"h-4 w-4","aria-hidden":"true"}):e<0?o.jsx(uj,{className:"h-4 w-4","aria-hidden":"true"}):o.jsx(eR,{className:"h-4 w-4","aria-hidden":"true"})}function xs({label:e,value:a,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:a}):a}),r?o.jsx("p",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:r}):null]})}function wk({phases:e,asOf:a,activeDrilldown:r,onDrilldown:s,onClearDrilldown:u}){const[c,d]=v.useState(21),h=v.useMemo(()=>sk(e),[e]),p=a??new Date().toISOString().slice(0,10),g=v.useMemo(()=>dk(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)]",x=g.limitations.notes.join(" "),E=(S,w,j)=>s&&j.length>0?()=>s({key:S,label:w,taskIds:j}):null;return o.jsx($t,{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(oj,{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:yk(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:gk.map(S=>o.jsxs("button",{type:"button","aria-label":`${S} active days`,"aria-pressed":c===S,onClick:()=>d(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(xs,{label:"Added",value:String(g.summary.addedTotal),detail:`${ku(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(xs,{label:"Closed",value:String(g.summary.closedTotal),detail:`${ku(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(xs,{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(bk,{value:g.summary.netBacklog}),vk(g.summary.netBacklog)]})]}),o.jsx(xs,{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(xs,{label:"Add rate",value:ku(g.summary.addRatePerActiveDay),detail:"per active day",onSelect:null,selected:!1}),o.jsx(xs,{label:"Close rate",value:ku(g.summary.closeRatePerActiveDay),detail:"per active day",onSelect:null,selected:!1}),o.jsx(xs,{label:"Closure ratio",value:xk(g.summary.closureRatio),detail:"closed / added",onSelect:null,selected:!1})]}),o.jsx(pk,{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:x,children:"Current planner files exclude deleted tasks; legacy gaps are inferred from available timestamps."})]})})}function Sk(){for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return v.useMemo(()=>s=>{a.forEach(u=>u(s))},a)}const wd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ji(e){const a=Object.prototype.toString.call(e);return a==="[object Window]"||a==="[object global]"}function Jm(e){return"nodeType"in e}function va(e){var a,r;return e?ji(e)?e:Jm(e)&&(a=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?a:window:window}function ep(e){const{Document:a}=va(e);return e instanceof a}function lc(e){return ji(e)?!1:e instanceof va(e).HTMLElement}function Z0(e){return e instanceof va(e).SVGElement}function Ri(e){return e?ji(e)?e.document:Jm(e)?ep(e)?e:lc(e)||Z0(e)?e.ownerDocument:document:document:document}const hr=wd?v.useLayoutEffect:v.useEffect;function Sd(e){const a=v.useRef(e);return hr(()=>{a.current=e}),v.useCallback(function(){for(var r=arguments.length,s=new Array(r),u=0;u<r;u++)s[u]=arguments[u];return a.current==null?void 0:a.current(...s)},[])}function Ek(){const e=v.useRef(null),a=v.useCallback((s,u)=>{e.current=setInterval(s,u)},[]),r=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[a,r]}function Yo(e,a){a===void 0&&(a=[e]);const r=v.useRef(e);return hr(()=>{r.current!==e&&(r.current=e)},a),r}function sc(e,a){const r=v.useRef();return v.useMemo(()=>{const s=e(r.current);return r.current=s,s},[...a])}function Zu(e){const a=Sd(e),r=v.useRef(null),s=v.useCallback(u=>{u!==r.current&&(a==null||a(u,r.current)),r.current=u},[]);return[r,s]}function Wu(e){const a=v.useRef();return v.useEffect(()=>{a.current=e},[e]),a.current}let Fh={};function ic(e,a){return v.useMemo(()=>{if(a)return a;const r=Fh[e]==null?0:Fh[e]+1;return Fh[e]=r,e+"-"+r},[e,a])}function W0(e){return function(a){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,d)=>{const h=Object.entries(d);for(const[p,g]of h){const y=c[p];y!=null&&(c[p]=y+e*g)}return c},{...a})}}const yi=W0(1),Ju=W0(-1);function Nk(e){return"clientX"in e&&"clientY"in e}function Ed(e){if(!e)return!1;const{KeyboardEvent:a}=va(e.target);return a&&e instanceof a}function jk(e){if(!e)return!1;const{TouchEvent:a}=va(e.target);return a&&e instanceof a}function ed(e){if(jk(e)){if(e.touches&&e.touches.length){const{clientX:a,clientY:r}=e.touches[0];return{x:a,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:a,clientY:r}=e.changedTouches[0];return{x:a,y:r}}}return Nk(e)?{x:e.clientX,y:e.clientY}:null}const Vl=Object.freeze({Translate:{toString(e){if(!e)return;const{x:a,y:r}=e;return"translate3d("+(a?Math.round(a):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:a,scaleY:r}=e;return"scaleX("+a+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Vl.Translate.toString(e),Vl.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:a,duration:r,easing:s}=e;return a+" "+r+"ms "+s}}}),qy="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Rk(e){return e.matches(qy)?e:e.querySelector(qy)}const kk={display:"none"};function Tk(e){let{id:a,value:r}=e;return hn.createElement("div",{id:a,style:kk},r)}function Ak(e){let{id:a,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 hn.createElement("div",{id:a,style:u,role:"status","aria-live":s,"aria-atomic":!0},r)}function Dk(){const[e,a]=v.useState("");return{announce:v.useCallback(s=>{s!=null&&a(s)},[]),announcement:e}}const J0=v.createContext(null);function Ck(e){const a=v.useContext(J0);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(e)},[e,a])}function Ok(){const[e]=v.useState(()=>new Set),a=v.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[v.useCallback(s=>{let{type:u,event:c}=s;e.forEach(d=>{var h;return(h=d[u])==null?void 0:h.call(d,c)})},[e]),a]}const Mk={draggable:`
|
|
314
|
+
To pick up a draggable item, press the space bar.
|
|
315
|
+
While dragging, use the arrow keys to move the item.
|
|
316
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
317
|
+
`},_k={onDragStart(e){let{active:a}=e;return"Picked up draggable item "+a.id+"."},onDragOver(e){let{active:a,over:r}=e;return r?"Draggable item "+a.id+" was moved over droppable area "+r.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(e){let{active:a,over:r}=e;return r?"Draggable item "+a.id+" was dropped over droppable area "+r.id:"Draggable item "+a.id+" was dropped."},onDragCancel(e){let{active:a}=e;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function Lk(e){let{announcements:a=_k,container:r,hiddenTextDescribedById:s,screenReaderInstructions:u=Mk}=e;const{announce:c,announcement:d}=Dk(),h=ic("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),Ck(v.useMemo(()=>({onDragStart(x){let{active:E}=x;c(a.onDragStart({active:E}))},onDragMove(x){let{active:E,over:S}=x;a.onDragMove&&c(a.onDragMove({active:E,over:S}))},onDragOver(x){let{active:E,over:S}=x;c(a.onDragOver({active:E,over:S}))},onDragEnd(x){let{active:E,over:S}=x;c(a.onDragEnd({active:E,over:S}))},onDragCancel(x){let{active:E,over:S}=x;c(a.onDragCancel({active:E,over:S}))}}),[c,a])),!p)return null;const y=hn.createElement(hn.Fragment,null,hn.createElement(Tk,{id:s,value:u.draggable}),hn.createElement(Ak,{id:h,announcement:d}));return r?sl.createPortal(y,r):y}var In;(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"})(In||(In={}));function td(){}function zk(e,a){return v.useMemo(()=>({sensor:e,options:a??{}}),[e,a])}function $k(){for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return v.useMemo(()=>[...a].filter(s=>s!=null),[...a])}const mr=Object.freeze({x:0,y:0});function Uk(e,a){return Math.sqrt(Math.pow(e.x-a.x,2)+Math.pow(e.y-a.y,2))}function Bk(e,a){const r=ed(e);if(!r)return"0 0";const s={x:(r.x-a.left)/a.width*100,y:(r.y-a.top)/a.height*100};return s.x+"% "+s.y+"%"}function Ik(e,a){let{data:{value:r}}=e,{data:{value:s}}=a;return r-s}function Hk(e,a){let{data:{value:r}}=e,{data:{value:s}}=a;return s-r}function qk(e,a){if(!e||e.length===0)return null;const[r]=e;return r[a]}function Py(e,a,r){return a===void 0&&(a=e.left),r===void 0&&(r=e.top),{x:a+e.width*.5,y:r+e.height*.5}}const Pk=e=>{let{collisionRect:a,droppableRects:r,droppableContainers:s}=e;const u=Py(a,a.left,a.top),c=[];for(const d of s){const{id:h}=d,p=r.get(h);if(p){const g=Uk(Py(p),u);c.push({id:h,data:{droppableContainer:d,value:g}})}}return c.sort(Ik)};function Fk(e,a){const r=Math.max(a.top,e.top),s=Math.max(a.left,e.left),u=Math.min(a.left+a.width,e.left+e.width),c=Math.min(a.top+a.height,e.top+e.height),d=u-s,h=c-r;if(s<u&&r<c){const p=a.width*a.height,g=e.width*e.height,y=d*h,x=y/(p+g-y);return Number(x.toFixed(4))}return 0}const Vk=e=>{let{collisionRect:a,droppableRects:r,droppableContainers:s}=e;const u=[];for(const c of s){const{id:d}=c,h=r.get(d);if(h){const p=Fk(h,a);p>0&&u.push({id:d,data:{droppableContainer:c,value:p}})}}return u.sort(Hk)};function Yk(e,a,r){return{...e,scaleX:a&&r?a.width/r.width:1,scaleY:a&&r?a.height/r.height:1}}function ew(e,a){return e&&a?{x:e.left-a.left,y:e.top-a.top}:mr}function Gk(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((d,h)=>({...d,top:d.top+e*h.y,bottom:d.bottom+e*h.y,left:d.left+e*h.x,right:d.right+e*h.x}),{...r})}}const Xk=Gk(1);function tw(e){if(e.startsWith("matrix3d(")){const a=e.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(e.startsWith("matrix(")){const a=e.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function Qk(e,a,r){const s=tw(a);if(!s)return e;const{scaleX:u,scaleY:c,x:d,y:h}=s,p=e.left-d-(1-u)*parseFloat(r),g=e.top-h-(1-c)*parseFloat(r.slice(r.indexOf(" ")+1)),y=u?e.width/u:e.width,x=c?e.height/c:e.height;return{width:y,height:x,top:g,right:p+y,bottom:g+x,left:p}}const Kk={ignoreTransform:!1};function ki(e,a){a===void 0&&(a=Kk);let r=e.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:y}=va(e).getComputedStyle(e);g&&(r=Qk(r,g,y))}const{top:s,left:u,width:c,height:d,bottom:h,right:p}=r;return{top:s,left:u,width:c,height:d,bottom:h,right:p}}function Fy(e){return ki(e,{ignoreTransform:!0})}function Zk(e){const a=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:a,bottom:r,width:a,height:r}}function Wk(e,a){return a===void 0&&(a=va(e).getComputedStyle(e)),a.position==="fixed"}function Jk(e,a){a===void 0&&(a=va(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const c=a[u];return typeof c=="string"?r.test(c):!1})}function tp(e,a){const r=[];function s(u){if(a!=null&&r.length>=a||!u)return r;if(ep(u)&&u.scrollingElement!=null&&!r.includes(u.scrollingElement))return r.push(u.scrollingElement),r;if(!lc(u)||Z0(u)||r.includes(u))return r;const c=va(e).getComputedStyle(u);return u!==e&&Jk(u,c)&&r.push(u),Wk(u,c)?r:s(u.parentNode)}return e?s(e):r}function nw(e){const[a]=tp(e,1);return a??null}function Vh(e){return!wd||!e?null:ji(e)?e:Jm(e)?ep(e)||e===Ri(e).scrollingElement?window:lc(e)?e:null:null}function aw(e){return ji(e)?e.scrollX:e.scrollLeft}function rw(e){return ji(e)?e.scrollY:e.scrollTop}function bm(e){return{x:aw(e),y:rw(e)}}var Gn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Gn||(Gn={}));function lw(e){return!wd||!e?!1:e===document.scrollingElement}function sw(e){const a={x:0,y:0},r=lw(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<=a.y,c=e.scrollLeft<=a.x,d=e.scrollTop>=s.y,h=e.scrollLeft>=s.x;return{isTop:u,isLeft:c,isBottom:d,isRight:h,maxScroll:s,minScroll:a}}const eT={x:.2,y:.2};function tT(e,a,r,s,u){let{top:c,left:d,right:h,bottom:p}=r;s===void 0&&(s=10),u===void 0&&(u=eT);const{isTop:g,isBottom:y,isLeft:x,isRight:E}=sw(e),S={x:0,y:0},w={x:0,y:0},j={height:a.height*u.y,width:a.width*u.x};return!g&&c<=a.top+j.height?(S.y=Gn.Backward,w.y=s*Math.abs((a.top+j.height-c)/j.height)):!y&&p>=a.bottom-j.height&&(S.y=Gn.Forward,w.y=s*Math.abs((a.bottom-j.height-p)/j.height)),!E&&h>=a.right-j.width?(S.x=Gn.Forward,w.x=s*Math.abs((a.right-j.width-h)/j.width)):!x&&d<=a.left+j.width&&(S.x=Gn.Backward,w.x=s*Math.abs((a.left+j.width-d)/j.width)),{direction:S,speed:w}}function nT(e){if(e===document.scrollingElement){const{innerWidth:c,innerHeight:d}=window;return{top:0,left:0,right:c,bottom:d,width:c,height:d}}const{top:a,left:r,right:s,bottom:u}=e.getBoundingClientRect();return{top:a,left:r,right:s,bottom:u,width:e.clientWidth,height:e.clientHeight}}function iw(e){return e.reduce((a,r)=>yi(a,bm(r)),mr)}function aT(e){return e.reduce((a,r)=>a+aw(r),0)}function rT(e){return e.reduce((a,r)=>a+rw(r),0)}function ow(e,a){if(a===void 0&&(a=ki),!e)return;const{top:r,left:s,bottom:u,right:c}=a(e);nw(e)&&(u<=0||c<=0||r>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const lT=[["x",["left","right"],aT],["y",["top","bottom"],rT]];class np{constructor(a,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=tp(r),u=iw(s);this.rect={...a},this.width=a.width,this.height=a.height;for(const[c,d,h]of lT)for(const p of d)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 zo{constructor(a){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=a}add(a,r,s){var u;(u=this.target)==null||u.addEventListener(a,r,s),this.listeners.push([a,r,s])}}function sT(e){const{EventTarget:a}=va(e);return e instanceof a?e:Ri(e)}function Yh(e,a){const r=Math.abs(e.x),s=Math.abs(e.y);return typeof a=="number"?Math.sqrt(r**2+s**2)>a:"x"in a&&"y"in a?r>a.x&&s>a.y:"x"in a?r>a.x:"y"in a?s>a.y:!1}var er;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(er||(er={}));function Vy(e){e.preventDefault()}function iT(e){e.stopPropagation()}var Bt;(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"})(Bt||(Bt={}));const cw={start:[Bt.Space,Bt.Enter],cancel:[Bt.Esc],end:[Bt.Space,Bt.Enter,Bt.Tab]},oT=(e,a)=>{let{currentCoordinates:r}=a;switch(e.code){case Bt.Right:return{...r,x:r.x+25};case Bt.Left:return{...r,x:r.x-25};case Bt.Down:return{...r,y:r.y+25};case Bt.Up:return{...r,y:r.y-25}}};class uw{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:r}}=a;this.props=a,this.listeners=new zo(Ri(r)),this.windowListeners=new zo(va(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(er.Resize,this.handleCancel),this.windowListeners.add(er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:r}=this.props,s=a.node.current;s&&ow(s),r(mr)}handleKeyDown(a){if(Ed(a)){const{active:r,context:s,options:u}=this.props,{keyboardCodes:c=cw,coordinateGetter:d=oT,scrollBehavior:h="smooth"}=u,{code:p}=a;if(c.end.includes(p)){this.handleEnd(a);return}if(c.cancel.includes(p)){this.handleCancel(a);return}const{collisionRect:g}=s.current,y=g?{x:g.left,y:g.top}:mr;this.referenceCoordinates||(this.referenceCoordinates=y);const x=d(a,{active:r,context:s.current,currentCoordinates:y});if(x){const E=Ju(x,y),S={x:0,y:0},{scrollableAncestors:w}=s.current;for(const j of w){const R=a.code,{isTop:L,isRight:B,isLeft:I,isBottom:F,maxScroll:W,minScroll:ne}=sw(j),_=nT(j),T={x:Math.min(R===Bt.Right?_.right-_.width/2:_.right,Math.max(R===Bt.Right?_.left:_.left+_.width/2,x.x)),y:Math.min(R===Bt.Down?_.bottom-_.height/2:_.bottom,Math.max(R===Bt.Down?_.top:_.top+_.height/2,x.y))},de=R===Bt.Right&&!B||R===Bt.Left&&!I,ge=R===Bt.Down&&!F||R===Bt.Up&&!L;if(de&&T.x!==x.x){const be=j.scrollLeft+E.x,re=R===Bt.Right&&be<=W.x||R===Bt.Left&&be>=ne.x;if(re&&!E.y){j.scrollTo({left:be,behavior:h});return}re?S.x=j.scrollLeft-be:S.x=R===Bt.Right?j.scrollLeft-W.x:j.scrollLeft-ne.x,S.x&&j.scrollBy({left:-S.x,behavior:h});break}else if(ge&&T.y!==x.y){const be=j.scrollTop+E.y,re=R===Bt.Down&&be<=W.y||R===Bt.Up&&be>=ne.y;if(re&&!E.x){j.scrollTo({top:be,behavior:h});return}re?S.y=j.scrollTop-be:S.y=R===Bt.Down?j.scrollTop-W.y:j.scrollTop-ne.y,S.y&&j.scrollBy({top:-S.y,behavior:h});break}}this.handleMove(a,yi(Ju(x,this.referenceCoordinates),S))}}}handleMove(a,r){const{onMove:s}=this.props;a.preventDefault(),s(r)}handleEnd(a){const{onEnd:r}=this.props;a.preventDefault(),this.detach(),r()}handleCancel(a){const{onCancel:r}=this.props;a.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}uw.activators=[{eventName:"onKeyDown",handler:(e,a,r)=>{let{keyboardCodes:s=cw,onActivation:u}=a,{active:c}=r;const{code:d}=e.nativeEvent;if(s.start.includes(d)){const h=c.activatorNode.current;return h&&e.target!==h?!1:(e.preventDefault(),u==null||u({event:e.nativeEvent}),!0)}return!1}}];function Yy(e){return!!(e&&"distance"in e)}function Gy(e){return!!(e&&"delay"in e)}class ap{constructor(a,r,s){var u;s===void 0&&(s=sT(a.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=a,this.events=r;const{event:c}=a,{target:d}=c;this.props=a,this.events=r,this.document=Ri(d),this.documentListeners=new zo(this.document),this.listeners=new zo(s),this.windowListeners=new zo(va(d)),this.initialCoordinates=(u=ed(c))!=null?u:mr,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:a,props:{options:{activationConstraint:r,bypassActivationConstraint:s}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(er.Resize,this.handleCancel),this.windowListeners.add(er.DragStart,Vy),this.windowListeners.add(er.VisibilityChange,this.handleCancel),this.windowListeners.add(er.ContextMenu,Vy),this.documentListeners.add(er.Keydown,this.handleKeydown),r){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Gy(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Yy(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(a,r){const{active:s,onPending:u}=this.props;u(s,a,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:a}=this,{onStart:r}=this.props;a&&(this.activated=!0,this.documentListeners.add(er.Click,iT,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(er.SelectionChange,this.removeTextSelection),r(a))}handleMove(a){var r;const{activated:s,initialCoordinates:u,props:c}=this,{onMove:d,options:{activationConstraint:h}}=c;if(!u)return;const p=(r=ed(a))!=null?r:mr,g=Ju(u,p);if(!s&&h){if(Yy(h)){if(h.tolerance!=null&&Yh(g,h.tolerance))return this.handleCancel();if(Yh(g,h.distance))return this.handleStart()}if(Gy(h)&&Yh(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}a.cancelable&&a.preventDefault(),d(p)}handleEnd(){const{onAbort:a,onEnd:r}=this.props;this.detach(),this.activated||a(this.props.active),r()}handleCancel(){const{onAbort:a,onCancel:r}=this.props;this.detach(),this.activated||a(this.props.active),r()}handleKeydown(a){a.code===Bt.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const cT={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rp extends ap{constructor(a){const{event:r}=a,s=Ri(r.target);super(a,cT,s)}}rp.activators=[{eventName:"onPointerDown",handler:(e,a)=>{let{nativeEvent:r}=e,{onActivation:s}=a;return!r.isPrimary||r.button!==0?!1:(s==null||s({event:r}),!0)}}];const uT={move:{name:"mousemove"},end:{name:"mouseup"}};var wm;(function(e){e[e.RightClick=2]="RightClick"})(wm||(wm={}));class dT extends ap{constructor(a){super(a,uT,Ri(a.event.target))}}dT.activators=[{eventName:"onMouseDown",handler:(e,a)=>{let{nativeEvent:r}=e,{onActivation:s}=a;return r.button===wm.RightClick?!1:(s==null||s({event:r}),!0)}}];const Gh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class fT extends ap{constructor(a){super(a,Gh)}static setup(){return window.addEventListener(Gh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Gh.move.name,a)};function a(){}}}fT.activators=[{eventName:"onTouchStart",handler:(e,a)=>{let{nativeEvent:r}=e,{onActivation:s}=a;const{touches:u}=r;return u.length>1?!1:(s==null||s({event:r}),!0)}}];var $o;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($o||($o={}));var nd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nd||(nd={}));function hT(e){let{acceleration:a,activator:r=$o.Pointer,canScroll:s,draggingRect:u,enabled:c,interval:d=5,order:h=nd.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:y,delta:x,threshold:E}=e;const S=pT({delta:x,disabled:!c}),[w,j]=Ek(),R=v.useRef({x:0,y:0}),L=v.useRef({x:0,y:0}),B=v.useMemo(()=>{switch(r){case $o.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case $o.DraggableRect:return u}},[r,u,p]),I=v.useRef(null),F=v.useCallback(()=>{const ne=I.current;if(!ne)return;const _=R.current.x*L.current.x,T=R.current.y*L.current.y;ne.scrollBy(_,T)},[]),W=v.useMemo(()=>h===nd.TreeOrder?[...g].reverse():g,[h,g]);v.useEffect(()=>{if(!c||!g.length||!B){j();return}for(const ne of W){if((s==null?void 0:s(ne))===!1)continue;const _=g.indexOf(ne),T=y[_];if(!T)continue;const{direction:de,speed:ge}=tT(ne,T,B,a,E);for(const be of["x","y"])S[be][de[be]]||(ge[be]=0,de[be]=0);if(ge.x>0||ge.y>0){j(),I.current=ne,w(F,d),R.current=ge,L.current=de;return}}R.current={x:0,y:0},L.current={x:0,y:0},j()},[a,F,s,j,c,d,JSON.stringify(B),JSON.stringify(S),w,g,W,y,JSON.stringify(E)])}const mT={x:{[Gn.Backward]:!1,[Gn.Forward]:!1},y:{[Gn.Backward]:!1,[Gn.Forward]:!1}};function pT(e){let{delta:a,disabled:r}=e;const s=Wu(a);return sc(u=>{if(r||!s||!u)return mT;const c={x:Math.sign(a.x-s.x),y:Math.sign(a.y-s.y)};return{x:{[Gn.Backward]:u.x[Gn.Backward]||c.x===-1,[Gn.Forward]:u.x[Gn.Forward]||c.x===1},y:{[Gn.Backward]:u.y[Gn.Backward]||c.y===-1,[Gn.Forward]:u.y[Gn.Forward]||c.y===1}}},[r,a,s])}function gT(e,a){const r=a!=null?e.get(a):void 0,s=r?r.node.current:null;return sc(u=>{var c;return a==null?null:(c=s??u)!=null?c:null},[s,a])}function vT(e,a){return v.useMemo(()=>e.reduce((r,s)=>{const{sensor:u}=s,c=u.activators.map(d=>({eventName:d.eventName,handler:a(d.handler,s)}));return[...r,...c]},[]),[e,a])}var Go;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Go||(Go={}));var Sm;(function(e){e.Optimized="optimized"})(Sm||(Sm={}));const Xy=new Map;function xT(e,a){let{dragging:r,dependencies:s,config:u}=a;const[c,d]=v.useState(null),{frequency:h,measure:p,strategy:g}=u,y=v.useRef(e),x=R(),E=Yo(x),S=v.useCallback(function(L){L===void 0&&(L=[]),!E.current&&d(B=>B===null?L:B.concat(L.filter(I=>!B.includes(I))))},[E]),w=v.useRef(null),j=sc(L=>{if(x&&!r)return Xy;if(!L||L===Xy||y.current!==e||c!=null){const B=new Map;for(let I of e){if(!I)continue;if(c&&c.length>0&&!c.includes(I.id)&&I.rect.current){B.set(I.id,I.rect.current);continue}const F=I.node.current,W=F?new np(p(F),F):null;I.rect.current=W,W&&B.set(I.id,W)}return B}return L},[e,c,r,x,p]);return v.useEffect(()=>{y.current=e},[e]),v.useEffect(()=>{x||S()},[r,x]),v.useEffect(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),v.useEffect(()=>{x||typeof h!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},h))},[h,x,S,...s]),{droppableRects:j,measureDroppableContainers:S,measuringScheduled:c!=null};function R(){switch(g){case Go.Always:return!1;case Go.BeforeDragging:return r;default:return!r}}}function lp(e,a){return sc(r=>e?r||(typeof a=="function"?a(e):e):null,[a,e])}function yT(e,a){return lp(e,a)}function bT(e){let{callback:a,disabled:r}=e;const s=Sd(a),u=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(s)},[s,r]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function Nd(e){let{callback:a,disabled:r}=e;const s=Sd(a),u=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(s)},[r]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function wT(e){return new np(ki(e),e)}function Qy(e,a,r){a===void 0&&(a=wT);const[s,u]=v.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=a(e);return JSON.stringify(p)===JSON.stringify(y)?p:y})}const d=bT({callback(p){if(e)for(const g of p){const{type:y,target:x}=g;if(y==="childList"&&x instanceof HTMLElement&&x.contains(e)){c();break}}}}),h=Nd({callback:c});return hr(()=>{c(),e?(h==null||h.observe(e),d==null||d.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),d==null||d.disconnect())},[e]),s}function ST(e){const a=lp(e);return ew(e,a)}const Ky=[];function ET(e){const a=v.useRef(e),r=sc(s=>e?s&&s!==Ky&&e&&a.current&&e.parentNode===a.current.parentNode?s:tp(e):Ky,[e]);return v.useEffect(()=>{a.current=e},[e]),r}function NT(e){const[a,r]=v.useState(null),s=v.useRef(e),u=v.useCallback(c=>{const d=Vh(c.target);d&&r(h=>h?(h.set(d,bm(d)),new Map(h)):null)},[]);return v.useEffect(()=>{const c=s.current;if(e!==c){d(c);const h=e.map(p=>{const g=Vh(p);return g?(g.addEventListener("scroll",u,{passive:!0}),[g,bm(g)]):null}).filter(p=>p!=null);r(h.length?new Map(h):null),s.current=e}return()=>{d(e),d(c)};function d(h){h.forEach(p=>{const g=Vh(p);g==null||g.removeEventListener("scroll",u)})}},[u,e]),v.useMemo(()=>e.length?a?Array.from(a.values()).reduce((c,d)=>yi(c,d),mr):iw(e):mr,[e,a])}function Zy(e,a){a===void 0&&(a=[]);const r=v.useRef(null);return v.useEffect(()=>{r.current=null},a),v.useEffect(()=>{const s=e!==mr;s&&!r.current&&(r.current=e),!s&&r.current&&(r.current=null)},[e]),r.current?Ju(e,r.current):mr}function jT(e){v.useEffect(()=>{if(!wd)return;const a=e.map(r=>{let{sensor:s}=r;return s.setup==null?void 0:s.setup()});return()=>{for(const r of a)r==null||r()}},e.map(a=>{let{sensor:r}=a;return r}))}function RT(e,a){return v.useMemo(()=>e.reduce((r,s)=>{let{eventName:u,handler:c}=s;return r[u]=d=>{c(d,a)},r},{}),[e,a])}function dw(e){return v.useMemo(()=>e?Zk(e):null,[e])}const Wy=[];function kT(e,a){a===void 0&&(a=ki);const[r]=e,s=dw(r?va(r):null),[u,c]=v.useState(Wy);function d(){c(()=>e.length?e.map(p=>lw(p)?s:new np(a(p),p)):Wy)}const h=Nd({callback:d});return hr(()=>{h==null||h.disconnect(),d(),e.forEach(p=>h==null?void 0:h.observe(p))},[e]),u}function fw(e){if(!e)return null;if(e.children.length>1)return e;const a=e.children[0];return lc(a)?a:e}function TT(e){let{measure:a}=e;const[r,s]=v.useState(null),u=v.useCallback(g=>{for(const{target:y}of g)if(lc(y)){s(x=>{const E=a(y);return x?{...x,width:E.width,height:E.height}:E});break}},[a]),c=Nd({callback:u}),d=v.useCallback(g=>{const y=fw(g);c==null||c.disconnect(),y&&(c==null||c.observe(y)),s(y?a(y):null)},[a,c]),[h,p]=Zu(d);return v.useMemo(()=>({nodeRef:h,rect:r,setRef:p}),[r,h,p])}const AT=[{sensor:rp,options:{}},{sensor:uw,options:{}}],DT={current:{}},Hu={draggable:{measure:Fy},droppable:{measure:Fy,strategy:Go.WhileDragging,frequency:Sm.Optimized},dragOverlay:{measure:ki}};class Uo extends Map{get(a){var r;return a!=null&&(r=super.get(a))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:r}=a;return!r})}getNodeFor(a){var r,s;return(r=(s=this.get(a))==null?void 0:s.node.current)!=null?r:void 0}}const CT={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},hw={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:td,draggableNodes:new Map,over:null,measureDroppableContainers:td},oc=v.createContext(hw),mw=v.createContext(CT);function OT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Uo}}}function MT(e,a){switch(a.type){case In.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case In.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:a.coordinates.x-e.draggable.initialCoordinates.x,y:a.coordinates.y-e.draggable.initialCoordinates.y}}};case In.DragEnd:case In.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case In.RegisterDroppable:{const{element:r}=a,{id:s}=r,u=new Uo(e.droppable.containers);return u.set(s,r),{...e,droppable:{...e.droppable,containers:u}}}case In.SetDroppableDisabled:{const{id:r,key:s,disabled:u}=a,c=e.droppable.containers.get(r);if(!c||s!==c.key)return e;const d=new Uo(e.droppable.containers);return d.set(r,{...c,disabled:u}),{...e,droppable:{...e.droppable,containers:d}}}case In.UnregisterDroppable:{const{id:r,key:s}=a,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 _T(e){let{disabled:a}=e;const{active:r,activatorEvent:s,draggableNodes:u}=v.useContext(oc),c=Wu(s),d=Wu(r==null?void 0:r.id);return v.useEffect(()=>{if(!a&&!s&&c&&d!=null){if(!Ed(c)||document.activeElement===c.target)return;const h=u.get(d);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 x=Rk(y);if(x){x.focus();break}}})}},[s,a,u,d,c]),null}function pw(e,a){let{transform:r,...s}=a;return e!=null&&e.length?e.reduce((u,c)=>c({transform:u,...s}),r):r}function LT(e){return v.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 zT(e){let{activeNode:a,measure:r,initialRect:s,config:u=!0}=e;const c=v.useRef(!1),{x:d,y:h}=typeof u=="boolean"?{x:u,y:u}:u;hr(()=>{if(!d&&!h||!a){c.current=!1;return}if(c.current||!s)return;const g=a==null?void 0:a.node.current;if(!g||g.isConnected===!1)return;const y=r(g),x=ew(y,s);if(d||(x.x=0),h||(x.y=0),c.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const E=nw(g);E&&E.scrollBy({top:x.y,left:x.x})}},[a,d,h,s,r])}const jd=v.createContext({...mr,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 $T=v.memo(function(a){var r,s,u,c;let{id:d,accessibility:h,autoScroll:p=!0,children:g,sensors:y=AT,collisionDetection:x=Vk,measuring:E,modifiers:S,...w}=a;const j=v.useReducer(MT,void 0,OT),[R,L]=j,[B,I]=Ok(),[F,W]=v.useState(Il.Uninitialized),ne=F===Il.Initialized,{draggable:{active:_,nodes:T,translate:de},droppable:{containers:ge}}=R,be=_!=null?T.get(_):null,re=v.useRef({initial:null,translated:null}),je=v.useMemo(()=>{var St;return _!=null?{id:_,data:(St=be==null?void 0:be.data)!=null?St:DT,rect:re}:null},[_,be]),Te=v.useRef(null),[J,$]=v.useState(null),[P,ce]=v.useState(null),me=Yo(w,Object.values(w)),Se=ic("DndDescribedBy",d),A=v.useMemo(()=>ge.getEnabled(),[ge]),C=LT(E),{droppableRects:G,measureDroppableContainers:ae,measuringScheduled:he}=xT(A,{dragging:ne,dependencies:[de.x,de.y],config:C.droppable}),fe=gT(T,_),Re=v.useMemo(()=>P?ed(P):null,[P]),qe=wt(),Le=yT(fe,C.draggable.measure);zT({activeNode:_!=null?T.get(_):null,config:qe.layoutShiftCompensation,initialRect:Le,measure:C.draggable.measure});const $e=Qy(fe,C.draggable.measure,Le),jt=Qy(fe?fe.parentElement:null),bt=v.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:ge,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),dt=ge.getNodeFor((r=bt.current.over)==null?void 0:r.id),se=TT({measure:C.dragOverlay.measure}),Ie=(s=se.nodeRef.current)!=null?s:fe,st=ne?(u=se.rect)!=null?u:$e:null,Pt=!!(se.nodeRef.current&&se.rect),yn=ST(Pt?null:$e),Ct=dw(Ie?va(Ie):null),It=ET(ne?dt??fe:null),Jt=kT(It),Pn=pw(S,{transform:{x:de.x-yn.x,y:de.y-yn.y,scaleX:1,scaleY:1},activatorEvent:P,active:je,activeNodeRect:$e,containerNodeRect:jt,draggingNodeRect:st,over:bt.current.over,overlayNodeRect:se.rect,scrollableAncestors:It,scrollableAncestorRects:Jt,windowRect:Ct}),Fn=Re?yi(Re,de):null,ln=NT(It),fa=Zy(ln),ha=Zy(ln,[$e]),na=yi(Pn,fa),Vn=st?Xk(st,Pn):null,pe=je&&Vn?x({active:je,collisionRect:Vn,droppableRects:G,droppableContainers:A,pointerCoordinates:Fn}):null,Ae=qk(pe,"id"),[De,Ke]=v.useState(null),Fe=Pt?Pn:yi(Pn,ha),ee=Yk(Fe,(c=De==null?void 0:De.rect)!=null?c:null,$e),Ot=v.useRef(null),en=v.useCallback((St,Rt)=>{let{sensor:Ft,options:Mt}=Rt;if(Te.current==null)return;const sn=T.get(Te.current);if(!sn)return;const tn=St.nativeEvent,Vt=new Ft({active:Te.current,activeNode:sn,event:tn,options:Mt,context:bt,onAbort(nt){if(!T.get(nt))return;const{onDragAbort:Ln}=me.current,D={id:nt};Ln==null||Ln(D),B({type:"onDragAbort",event:D})},onPending(nt,Nn,Ln,D){if(!T.get(nt))return;const{onDragPending:q}=me.current,Z={id:nt,constraint:Nn,initialCoordinates:Ln,offset:D};q==null||q(Z),B({type:"onDragPending",event:Z})},onStart(nt){const Nn=Te.current;if(Nn==null)return;const Ln=T.get(Nn);if(!Ln)return;const{onDragStart:D}=me.current,z={activatorEvent:tn,active:{id:Nn,data:Ln.data,rect:re}};sl.unstable_batchedUpdates(()=>{D==null||D(z),W(Il.Initializing),L({type:In.DragStart,initialCoordinates:nt,active:Nn}),B({type:"onDragStart",event:z}),$(Ot.current),ce(tn)})},onMove(nt){L({type:In.DragMove,coordinates:nt})},onEnd:gt(In.DragEnd),onCancel:gt(In.DragCancel)});Ot.current=Vt;function gt(nt){return async function(){const{active:Ln,collisions:D,over:z,scrollAdjustedTranslate:q}=bt.current;let Z=null;if(Ln&&q){const{cancelDrop:ie}=me.current;Z={activatorEvent:tn,active:Ln,collisions:D,delta:q,over:z},nt===In.DragEnd&&typeof ie=="function"&&await Promise.resolve(ie(Z))&&(nt=In.DragCancel)}Te.current=null,sl.unstable_batchedUpdates(()=>{L({type:nt}),W(Il.Uninitialized),Ke(null),$(null),ce(null),Ot.current=null;const ie=nt===In.DragEnd?"onDragEnd":"onDragCancel";if(Z){const ke=me.current[ie];ke==null||ke(Z),B({type:ie,event:Z})}})}}},[T]),Xn=v.useCallback((St,Rt)=>(Ft,Mt)=>{const sn=Ft.nativeEvent,tn=T.get(Mt);if(Te.current!==null||!tn||sn.dndKit||sn.defaultPrevented)return;const Vt={active:tn};St(Ft,Rt.options,Vt)===!0&&(sn.dndKit={capturedBy:Rt.sensor},Te.current=Mt,en(Ft,Rt))},[T,en]),bn=vT(y,Xn);jT(y),hr(()=>{$e&&F===Il.Initializing&&W(Il.Initialized)},[$e,F]),v.useEffect(()=>{const{onDragMove:St}=me.current,{active:Rt,activatorEvent:Ft,collisions:Mt,over:sn}=bt.current;if(!Rt||!Ft)return;const tn={active:Rt,activatorEvent:Ft,collisions:Mt,delta:{x:na.x,y:na.y},over:sn};sl.unstable_batchedUpdates(()=>{St==null||St(tn),B({type:"onDragMove",event:tn})})},[na.x,na.y]),v.useEffect(()=>{const{active:St,activatorEvent:Rt,collisions:Ft,droppableContainers:Mt,scrollAdjustedTranslate:sn}=bt.current;if(!St||Te.current==null||!Rt||!sn)return;const{onDragOver:tn}=me.current,Vt=Mt.get(Ae),gt=Vt&&Vt.rect.current?{id:Vt.id,rect:Vt.rect.current,data:Vt.data,disabled:Vt.disabled}:null,nt={active:St,activatorEvent:Rt,collisions:Ft,delta:{x:sn.x,y:sn.y},over:gt};sl.unstable_batchedUpdates(()=>{Ke(gt),tn==null||tn(nt),B({type:"onDragOver",event:nt})})},[Ae]),hr(()=>{bt.current={activatorEvent:P,active:je,activeNode:fe,collisionRect:Vn,collisions:pe,droppableRects:G,draggableNodes:T,draggingNode:Ie,draggingNodeRect:st,droppableContainers:ge,over:De,scrollableAncestors:It,scrollAdjustedTranslate:na},re.current={initial:st,translated:Vn}},[je,fe,pe,Vn,T,Ie,st,G,ge,De,It,na]),hT({...qe,delta:de,draggingRect:Vn,pointerCoordinates:Fn,scrollableAncestors:It,scrollableAncestorRects:Jt});const Ha=v.useMemo(()=>({active:je,activeNode:fe,activeNodeRect:$e,activatorEvent:P,collisions:pe,containerNodeRect:jt,dragOverlay:se,draggableNodes:T,droppableContainers:ge,droppableRects:G,over:De,measureDroppableContainers:ae,scrollableAncestors:It,scrollableAncestorRects:Jt,measuringConfiguration:C,measuringScheduled:he,windowRect:Ct}),[je,fe,$e,P,pe,jt,se,T,ge,G,De,ae,It,Jt,C,he,Ct]),_e=v.useMemo(()=>({activatorEvent:P,activators:bn,active:je,activeNodeRect:$e,ariaDescribedById:{draggable:Se},dispatch:L,draggableNodes:T,over:De,measureDroppableContainers:ae}),[P,bn,je,$e,L,Se,T,De,ae]);return hn.createElement(J0.Provider,{value:I},hn.createElement(oc.Provider,{value:_e},hn.createElement(mw.Provider,{value:Ha},hn.createElement(jd.Provider,{value:ee},g)),hn.createElement(_T,{disabled:(h==null?void 0:h.restoreFocus)===!1})),hn.createElement(Lk,{...h,hiddenTextDescribedById:Se}));function wt(){const St=(J==null?void 0:J.autoScrollEnabled)===!1,Rt=typeof p=="object"?p.enabled===!1:p===!1,Ft=ne&&!St&&!Rt;return typeof p=="object"?{...p,enabled:Ft}:{enabled:Ft}}}),UT=v.createContext(null),Jy="button",BT="Draggable";function IT(e){let{id:a,data:r,disabled:s=!1,attributes:u}=e;const c=ic(BT),{activators:d,activatorEvent:h,active:p,activeNodeRect:g,ariaDescribedById:y,draggableNodes:x,over:E}=v.useContext(oc),{role:S=Jy,roleDescription:w="draggable",tabIndex:j=0}=u??{},R=(p==null?void 0:p.id)===a,L=v.useContext(R?jd:UT),[B,I]=Zu(),[F,W]=Zu(),ne=RT(d,a),_=Yo(r);hr(()=>(x.set(a,{id:a,key:c,node:B,activatorNode:F,data:_}),()=>{const de=x.get(a);de&&de.key===c&&x.delete(a)}),[x,a]);const T=v.useMemo(()=>({role:S,tabIndex:j,"aria-disabled":s,"aria-pressed":R&&S===Jy?!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:B,over:E,setNodeRef:I,setActivatorNodeRef:W,transform:L}}function gw(){return v.useContext(mw)}const HT="Droppable",qT={timeout:25};function PT(e){let{data:a,disabled:r=!1,id:s,resizeObserverConfig:u}=e;const c=ic(HT),{active:d,dispatch:h,over:p,measureDroppableContainers:g}=v.useContext(oc),y=v.useRef({disabled:r}),x=v.useRef(!1),E=v.useRef(null),S=v.useRef(null),{disabled:w,updateMeasurementsFor:j,timeout:R}={...qT,...u},L=Yo(j??s),B=v.useCallback(()=>{if(!x.current){x.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),S.current=null},R)},[R]),I=Nd({callback:B,disabled:w||!d}),F=v.useCallback((T,de)=>{I&&(de&&(I.unobserve(de),x.current=!1),T&&I.observe(T))},[I]),[W,ne]=Zu(F),_=Yo(a);return v.useEffect(()=>{!I||!W.current||(I.disconnect(),x.current=!1,I.observe(W.current))},[W,I]),v.useEffect(()=>(h({type:In.RegisterDroppable,element:{id:s,key:c,disabled:r,node:W,rect:E,data:_}}),()=>h({type:In.UnregisterDroppable,key:c,id:s})),[s]),v.useEffect(()=>{r!==y.current.disabled&&(h({type:In.SetDroppableDisabled,id:s,key:c,disabled:r}),y.current.disabled=r)},[s,c,r,h]),{active:d,rect:E,isOver:(p==null?void 0:p.id)===s,node:W,over:p,setNodeRef:ne}}function FT(e){let{animation:a,children:r}=e;const[s,u]=v.useState(null),[c,d]=v.useState(null),h=Wu(r);return!r&&!s&&h&&u(h),hr(()=>{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(a(g,c)).then(()=>{u(null)})},[a,s,c]),hn.createElement(hn.Fragment,null,r,s?v.cloneElement(s,{ref:d}):null)}const VT={x:0,y:0,scaleX:1,scaleY:1};function YT(e){let{children:a}=e;return hn.createElement(oc.Provider,{value:hw},hn.createElement(jd.Provider,{value:VT},a))}const GT={position:"fixed",touchAction:"none"},XT=e=>Ed(e)?"transform 250ms ease":void 0,QT=v.forwardRef((e,a)=>{let{as:r,activatorEvent:s,adjustScale:u,children:c,className:d,rect:h,style:p,transform:g,transition:y=XT}=e;if(!h)return null;const x=u?g:{...g,scaleX:1,scaleY:1},E={...GT,width:h.width,height:h.height,top:h.top,left:h.left,transform:Vl.Transform.toString(x),transformOrigin:u&&s?Bk(s,h):void 0,transition:typeof y=="function"?y(s):y,...p};return hn.createElement(r,{className:d,style:E,ref:a},c)}),KT=e=>a=>{let{active:r,dragOverlay:s}=a;const u={},{styles:c,className:d}=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 d!=null&&d.active&&r.node.classList.add(d.active),d!=null&&d.dragOverlay&&s.node.classList.add(d.dragOverlay),function(){for(const[p,g]of Object.entries(u))r.node.style.setProperty(p,g);d!=null&&d.active&&r.node.classList.remove(d.active)}},ZT=e=>{let{transform:{initial:a,final:r}}=e;return[{transform:Vl.Transform.toString(a)},{transform:Vl.Transform.toString(r)}]},WT={duration:250,easing:"ease",keyframes:ZT,sideEffects:KT({styles:{active:{opacity:"0"}}})};function JT(e){let{config:a,draggableNodes:r,droppableContainers:s,measuringConfiguration:u}=e;return Sd((c,d)=>{if(a===null)return;const h=r.get(c);if(!h)return;const p=h.node.current;if(!p)return;const g=fw(d);if(!g)return;const{transform:y}=va(d).getComputedStyle(d),x=tw(y);if(!x)return;const E=typeof a=="function"?a:eA(a);return ow(p,u.draggable.measure),E({active:{id:c,data:h.data,node:p,rect:u.draggable.measure(p)},draggableNodes:r,dragOverlay:{node:d,rect:u.dragOverlay.measure(g)},droppableContainers:s,measuringConfiguration:u,transform:x})})}function eA(e){const{duration:a,easing:r,sideEffects:s,keyframes:u}={...WT,...e};return c=>{let{active:d,dragOverlay:h,transform:p,...g}=c;if(!a)return;const y={x:h.rect.left-d.rect.left,y:h.rect.top-d.rect.top},x={scaleX:p.scaleX!==1?d.rect.width*p.scaleX/h.rect.width:1,scaleY:p.scaleY!==1?d.rect.height*p.scaleY/h.rect.height:1},E={x:p.x-y.x,y:p.y-y.y,...x},S=u({...g,active:d,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:d,dragOverlay:h,...g}),L=h.node.animate(S,{duration:a,easing:r,fill:"forwards"});return new Promise(B=>{L.onfinish=()=>{R==null||R(),B()}})}}let eb=0;function tA(e){return v.useMemo(()=>{if(e!=null)return eb++,eb},[e])}const nA=hn.memo(e=>{let{adjustScale:a=!1,children:r,dropAnimation:s,style:u,transition:c,modifiers:d,wrapperElement:h="div",className:p,zIndex:g=999}=e;const{activatorEvent:y,active:x,activeNodeRect:E,containerNodeRect:S,draggableNodes:w,droppableContainers:j,dragOverlay:R,over:L,measuringConfiguration:B,scrollableAncestors:I,scrollableAncestorRects:F,windowRect:W}=gw(),ne=v.useContext(jd),_=tA(x==null?void 0:x.id),T=pw(d,{activatorEvent:y,active:x,activeNodeRect:E,containerNodeRect:S,draggingNodeRect:R.rect,over:L,overlayNodeRect:R.rect,scrollableAncestors:I,scrollableAncestorRects:F,transform:ne,windowRect:W}),de=lp(E),ge=JT({config:s,draggableNodes:w,droppableContainers:j,measuringConfiguration:B}),be=de?R.setRef:void 0;return hn.createElement(YT,null,hn.createElement(FT,{animation:ge},x&&_?hn.createElement(QT,{key:_,id:x.id,ref:be,as:h,activatorEvent:y,adjustScale:a,className:p,transition:c,rect:de,style:{zIndex:g,...u},transform:T},r):null))});function Bo(e,a,r){const s=e.slice();return s.splice(r<0?s.length+r:r,0,s.splice(a,1)[0]),s}function aA(e,a){return e.reduce((r,s,u)=>{const c=a.get(s);return c&&(r[u]=c),r},Array(e.length))}function Tu(e){return e!==null&&e>=0}function rA(e,a){if(e===a)return!0;if(e.length!==a.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==a[r])return!1;return!0}function lA(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const vw=e=>{let{rects:a,activeIndex:r,overIndex:s,index:u}=e;const c=Bo(a,s,r),d=a[u],h=c[u];return!h||!d?null:{x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height}},Au={scaleX:1,scaleY:1},sp=e=>{var a;let{activeIndex:r,activeNodeRect:s,index:u,rects:c,overIndex:d}=e;const h=(a=c[r])!=null?a:s;if(!h)return null;if(u===r){const g=c[d];return g?{x:0,y:r<d?g.top+g.height-(h.top+h.height):g.top-h.top,...Au}:null}const p=sA(c,u,r);return u>r&&u<=d?{x:0,y:-h.height-p,...Au}:u<r&&u>=d?{x:0,y:h.height+p,...Au}:{x:0,y:0,...Au}};function sA(e,a,r){const s=e[a],u=e[a-1],c=e[a+1];return s?r<a?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 xw="Sortable",yw=hn.createContext({activeIndex:-1,containerId:xw,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vw,disabled:{draggable:!1,droppable:!1}});function ip(e){let{children:a,id:r,items:s,strategy:u=vw,disabled:c=!1}=e;const{active:d,dragOverlay:h,droppableRects:p,over:g,measureDroppableContainers:y}=gw(),x=ic(xw,r),E=h.rect!==null,S=v.useMemo(()=>s.map(ne=>typeof ne=="object"&&"id"in ne?ne.id:ne),[s]),w=d!=null,j=d?S.indexOf(d.id):-1,R=g?S.indexOf(g.id):-1,L=v.useRef(S),B=!rA(S,L.current),I=R!==-1&&j===-1||B,F=lA(c);hr(()=>{B&&w&&y(S)},[B,S,w,y]),v.useEffect(()=>{L.current=S},[S]);const W=v.useMemo(()=>({activeIndex:j,containerId:x,disabled:F,disableTransforms:I,items:S,overIndex:R,useDragOverlay:E,sortedRects:aA(S,p),strategy:u}),[j,x,F.draggable,F.droppable,I,S,R,p,E,u]);return hn.createElement(yw.Provider,{value:W},a)}const iA=e=>{let{id:a,items:r,activeIndex:s,overIndex:u}=e;return Bo(r,s,u).indexOf(a)},oA=e=>{let{containerId:a,isSorting:r,wasDragging:s,index:u,items:c,newIndex:d,previousItems:h,previousContainerId:p,transition:g}=e;return!g||!s||h!==c&&u===d?!1:r?!0:d!==u&&a===p},cA={duration:200,easing:"ease"},bw="transform",uA=Vl.Transition.toString({property:bw,duration:0,easing:"linear"}),dA={roleDescription:"sortable"};function fA(e){let{disabled:a,index:r,node:s,rect:u}=e;const[c,d]=v.useState(null),h=v.useRef(r);return hr(()=>{if(!a&&r!==h.current&&s.current){const p=u.current;if(p){const g=ki(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)&&d(y)}}r!==h.current&&(h.current=r)},[a,r,s,u]),v.useEffect(()=>{c&&d(null)},[c]),c}function hA(e){let{animateLayoutChanges:a=oA,attributes:r,disabled:s,data:u,getNewIndex:c=iA,id:d,strategy:h,resizeObserverConfig:p,transition:g=cA}=e;const{items:y,containerId:x,activeIndex:E,disabled:S,disableTransforms:w,sortedRects:j,overIndex:R,useDragOverlay:L,strategy:B}=v.useContext(yw),I=mA(s,S),F=y.indexOf(d),W=v.useMemo(()=>({sortable:{containerId:x,index:F,items:y},...u}),[x,u,F,y]),ne=v.useMemo(()=>y.slice(y.indexOf(d)),[y,d]),{rect:_,node:T,isOver:de,setNodeRef:ge}=PT({id:d,data:W,disabled:I.droppable,resizeObserverConfig:{updateMeasurementsFor:ne,...p}}),{active:be,activatorEvent:re,activeNodeRect:je,attributes:Te,setNodeRef:J,listeners:$,isDragging:P,over:ce,setActivatorNodeRef:me,transform:Se}=IT({id:d,data:W,attributes:{...dA,...r},disabled:I.draggable}),A=Sk(ge,J),C=!!be,G=C&&!w&&Tu(E)&&Tu(R),ae=!L&&P,he=ae&&G?Se:null,Re=G?he??(h??B)({rects:j,activeNodeRect:je,activeIndex:E,overIndex:R,index:F}):null,qe=Tu(E)&&Tu(R)?c({id:d,items:y,activeIndex:E,overIndex:R}):F,Le=be==null?void 0:be.id,$e=v.useRef({activeId:Le,items:y,newIndex:qe,containerId:x}),jt=y!==$e.current.items,bt=a({active:be,containerId:x,isDragging:P,isSorting:C,id:d,index:F,items:y,newIndex:$e.current.newIndex,previousItems:$e.current.items,previousContainerId:$e.current.containerId,transition:g,wasDragging:$e.current.activeId!=null}),dt=fA({disabled:!bt,index:F,node:T,rect:_});return v.useEffect(()=>{C&&$e.current.newIndex!==qe&&($e.current.newIndex=qe),x!==$e.current.containerId&&($e.current.containerId=x),y!==$e.current.items&&($e.current.items=y)},[C,qe,x,y]),v.useEffect(()=>{if(Le===$e.current.activeId)return;if(Le!=null&&$e.current.activeId==null){$e.current.activeId=Le;return}const Ie=setTimeout(()=>{$e.current.activeId=Le},50);return()=>clearTimeout(Ie)},[Le]),{active:be,activeIndex:E,attributes:Te,data:W,rect:_,index:F,newIndex:qe,items:y,isOver:de,isSorting:C,isDragging:P,listeners:$,node:T,overIndex:R,over:ce,setNodeRef:A,setActivatorNodeRef:me,setDroppableNodeRef:ge,setDraggableNodeRef:J,transform:dt??Re,transition:se()};function se(){if(dt||jt&&$e.current.newIndex===F)return uA;if(!(ae&&!Ed(re)||!g)&&(C||bt))return Vl.Transition.toString({...g,property:bw})}}function mA(e,a){var r,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:a.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:a.droppable}}Bt.Down,Bt.Right,Bt.Up,Bt.Left;const pA=[{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 op({sort:e,onChange:a,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=>a({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:pA.map(s=>o.jsx("option",{value:s.value,children:s.label},s.value))}),o.jsx(Ts,{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:()=>a({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(pj,{className:"h-3.5 w-3.5","aria-hidden":"true"}):o.jsx(fj,{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"}],cp=[{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"}],ad=cp,gA=[{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"}],jo=Rd.map(e=>e.value),Ro=kd.map(e=>e.value),ko=cp.map(e=>e.value);function Xh(e,a,r){if(e.includes(a)){const s=e.filter(u=>u!==a);return s.length===0?[...r]:s}return[...e,a]}function oi(e,a){return a.includes(e)}function ur(e,a){return`agent-plan:dashboard:${e}:${a}`}function Qh(e,a,r){if(typeof window>"u")return a;try{const s=window.localStorage.getItem(e);if(!s)return a;const u=JSON.parse(s);if(!Array.isArray(u))return a;const c=`${e}-schema`,d=r.slice().sort().join(",");if(window.localStorage.getItem(c)!==d)return window.localStorage.setItem(c,d),a;const p=u.filter(g=>typeof g=="string"&&r.includes(g));return p.length>0?p:a}catch{return a}}function Kh(e,a,r){typeof window>"u"||(window.localStorage.setItem(e,JSON.stringify(a)),window.localStorage.setItem(`${e}-schema`,r.slice().sort().join(",")))}function Zh(e,a){if(typeof window>"u")return a;const r=window.localStorage.getItem(e);return r===null?a:r==="true"}const tb={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},nb=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function ww(e){return e.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function vA(e){return new Set(ww(e).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function ab(e){const a=e.toUpperCase();return a==="AND"||a==="OR"}function bi(e,a){const r=e??new Set;for(const s of vA(a))r.add(s);return r}function xA(e,a){const r=e??new Set;for(const s of ww(a).map(u=>u.toUpperCase()))r.add(s);return r}function yA(e,a){const r=a.match(/^([fpt])(\d+)$/i);if(!r)return!1;const s=Number(r[2]);if(!Number.isFinite(s)||s<=0)return!1;const u=r[1].toLowerCase();return u==="f"?e.featureNumbers=bi(e.featureNumbers,String(s)):u==="p"?e.phaseNumbers=bi(e.phaseNumbers,String(s)):e.taskNumbers=bi(e.taskNumbers,String(s)),!0}function bA(e){const a=e.trim();if(!a)return{...tb};const r={...tb},s=[],u=[];let c=0;for(;c<a.length;){const h=a[c];if(h==='"'){const p=a.indexOf('"',c+1);if(p===-1){u.push(a.slice(c+1));break}u.push(a.slice(c+1,p)),c=p+1}else if(h===" ")c+=1;else{let p=c;for(;p<a.length&&a[p]!==" ";)p+=1;u.push(a.slice(c,p)),c=p}}let d=0;for(;d<u.length;){const h=u[d];if(ab(h)){d+=1;continue}const p=h.match(nb);if(p){const g=(p[1]??"").toLowerCase();let y=p[2]??"";if(y.trim()===""&&d+1<u.length){let x=d+1;for(;x<u.length&&ab(u[x]);)x+=1;x<u.length&&!u[x].match(nb)&&(y=u[x],d=x)}if(g==="feature"){const x=bi(r.featureNumbers,y);x.size&&(r.featureNumbers=x)}else if(g==="phase"){const x=bi(r.phaseNumbers,y);x.size&&(r.phaseNumbers=x)}else if(g==="task"){const x=bi(r.taskNumbers,y);x.size&&(r.taskNumbers=x)}else if(g==="id"){const x=xA(r.shortIds,y);x.size&&(r.shortIds=x)}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 yA(r,h)||s.push(h.toLowerCase());d+=1}return s.length>0&&!r.text&&(r.text=s.join(" ")),r}function wA(e){return!!(e.featureNumbers||e.phaseNumbers||e.taskNumbers||e.shortIds||e.status||e.featureStatus||e.phaseStatus||e.text)}function Sw(e){const a=r=>String(r).padStart(3,"0");return[e.task.title,e.task.shortName??"",e.task.shortId??"",String(e.task.number),`T${a(e.task.number)}`,e.task.description??"",e.task.notes??"",e.phase.title,e.phase.slug??"",e.phase.shortId??"",String(e.phase.number),`P${a(e.phase.number)}`,e.phase.description??"",e.phase.summary??"",e.phase.notes??"",e.feature.name,e.feature.shortId??"",String(e.feature.number),`F${a(e.feature.number)}`,e.feature.description??""].join(" ").toLowerCase()}function SA(e,a,r){if(e.featureNumbers&&!e.featureNumbers.has(a.feature.number)||e.phaseNumbers&&!e.phaseNumbers.has(a.phase.number)||e.taskNumbers&&!e.taskNumbers.has(a.task.number)||e.shortIds&&!(e.shortIds.has(a.task.shortId??"")||e.shortIds.has(a.phase.shortId??"")||e.shortIds.has(a.feature.shortId??""))||e.status&&a.task.status!==e.status||e.featureStatus&&a.feature.status!==e.featureStatus||e.phaseStatus&&a.phase.status!==e.phaseStatus)return!1;if(e.text){const s=e.text;if(!(r??Sw(a)).includes(s))return!1}return!0}function EA({features:e,phases:a,projectStorageScope:r}){const s=ur(r,"show-all-features"),u=ur(r,"tree-open-mode"),c=ur(r,"expanded-features"),d=ur(r,"expanded-phases"),h=ur(r,"feature-status-filters"),p=ur(r,"phase-status-filters"),g=ur(r,"task-status-filters"),y=ur(r,"hide-done"),x=ur(r,"hide-planned"),E=ur(r,"only-active-branches"),S=ur(r,"work-tree-sort"),[w,j]=v.useState(""),[R,L]=v.useState(()=>{if(typeof window>"u")return Oo;try{const pe=window.localStorage.getItem(S);if(!pe)return Oo;const Ae=JSON.parse(pe);if(Ae.key&&Ae.direction)return{key:Ae.key,direction:Ae.direction}}catch{}return Oo}),B=v.useMemo(()=>ek(e,a,R),[e,a,R]),I=v.useMemo(()=>bA(w),[w]),F=wA(I),W=v.useMemo(()=>{if(!F||!I.text)return null;const pe=new Map;for(const Ae of B)for(const De of Ae.allPhases)for(const Ke of De.allTasks)pe.set(Ke.id,Sw({feature:Ae.feature,phase:De.phase,task:Ke}));return pe},[F,I.text,B]),{matchedTaskIds:ne,matchedFeatureIds:_,matchedPhaseIds:T}=v.useMemo(()=>{const pe=new Set,Ae=new Set,De=new Set;if(!F)return{matchedTaskIds:pe,matchedFeatureIds:Ae,matchedPhaseIds:De};for(const Ke of B)for(const Fe of Ke.allPhases)for(const ee of Fe.allTasks)SA(I,{feature:Ke.feature,phase:Fe.phase,task:ee},W==null?void 0:W.get(ee.id))&&(pe.add(ee.id),Ae.add(Ke.feature.id),De.add(Fe.phase.id));return{matchedTaskIds:pe,matchedFeatureIds:Ae,matchedPhaseIds:De}},[F,I,B,W]),[de,ge]=v.useState(()=>{if(typeof window>"u")return!0;const pe=window.localStorage.getItem(s);return pe===null?!0:pe==="true"}),[be,re]=v.useState(()=>{if(typeof window>"u")return"all";const pe=window.localStorage.getItem(u);return pe==="smart"||pe==="none"||pe==="all"?pe:"all"}),[je,Te]=v.useState(()=>{if(typeof window>"u")return[];try{const pe=window.localStorage.getItem(c);return pe?JSON.parse(pe):[]}catch{return[]}}),[J,$]=v.useState(()=>{if(typeof window>"u")return[];try{const pe=window.localStorage.getItem(d);return pe?JSON.parse(pe):[]}catch{return[]}}),[P,ce]=v.useState(()=>Qh(h,jo,jo)),[me,Se]=v.useState(()=>Qh(p,Ro,Ro)),[A,C]=v.useState(()=>Qh(g,ko,ko)),[G,ae]=v.useState(()=>Zh(y,!1)),[he,fe]=v.useState(()=>Zh(x,!1)),[Re,qe]=v.useState(()=>Zh(E,!1)),[Le,$e]=v.useState([]),[jt,bt]=v.useState([]),[dt,se]=v.useState([]),Ie=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(s,String(de))},[de,s]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,be)},[be,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(c,JSON.stringify(je))},[je,c]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(d,JSON.stringify(J))},[J,d]),v.useEffect(()=>{typeof window>"u"||Kh(h,P,jo)},[P,h]),v.useEffect(()=>{typeof window>"u"||Kh(p,me,Ro)},[me,p]),v.useEffect(()=>{typeof window>"u"||Kh(g,A,ko)},[A,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y,String(G))},[G,y]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(he))},[he,x]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(E,String(Re))},[Re,E]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(S,JSON.stringify(R))},[R,S]),v.useEffect(()=>()=>{Object.values(Ie.current).forEach(pe=>window.clearTimeout(pe)),Ie.current={}},[]);const st=v.useMemo(()=>{let pe=[...P];return G&&(pe=pe.filter(Ae=>Ae!=="done")),he&&(pe=pe.filter(Ae=>Ae!=="planned")),pe},[P,G,he]),Pt=v.useMemo(()=>{let pe=[...me];return G&&(pe=pe.filter(Ae=>Ae!=="done")),he&&(pe=pe.filter(Ae=>Ae!=="planned"&&Ae!=="draft")),pe},[me,G,he]),yn=v.useMemo(()=>{let pe=[...A];return G&&(pe=pe.filter(Ae=>Ae!=="done")),he&&(pe=pe.filter(Ae=>Ae!=="planned")),pe},[A,G,he]),Ct=v.useMemo(()=>{if(F)return B.filter(De=>oi(De.feature.status,st)).map(De=>({...De,allPhases:De.allPhases.filter(Ke=>oi(Ke.phase.status,Pt)).map(Ke=>({...Ke,allTasks:Ke.allTasks.filter(Fe=>ne.has(Fe.id)&&oi(Fe.status,yn))})).filter(Ke=>Ke.allTasks.length>0)})).filter(De=>De.allPhases.length>0);const pe=!de||Re;return(de?B:B.filter(De=>De.isActive)).filter(({feature:De})=>oi(De.status,st)).map(De=>({...De,allPhases:De.allPhases.filter(({phase:Ke,hasActiveTask:Fe})=>oi(Ke.status,Pt)?pe?Ke.status==="in-progress"||Ke.status==="discovery"||Fe:!0:!1).map(Ke=>({...Ke,allTasks:Ke.allTasks.filter(Fe=>!!oi(Fe.status,yn))})).filter(Ke=>Ke.allTasks.length>0||de||!pe)})).filter(({hasActiveTask:De,allPhases:Ke})=>pe?De||Ke.some(Fe=>Fe.hasActiveTask):Ke.length>0||de)},[F,ne,B,st,Pt,yn,Re,de]);v.useEffect(()=>{if(be==="none"){Te([]),$([]);return}if(be==="all"){Te(Ct.filter(({feature:De})=>De.status!=="done").map(({feature:De})=>De.id)),$(Ct.flatMap(({allPhases:De})=>De.map(({phase:Ke})=>Ke.id)));return}const pe=new Set(Ct.map(({feature:De})=>De.id)),Ae=new Set(Ct.flatMap(({allPhases:De})=>De.map(({phase:Ke})=>Ke.id)));Te(De=>De.filter(Ke=>pe.has(Ke))),$(De=>De.filter(Ke=>Ae.has(Ke)))},[Ct,be]),v.useEffect(()=>{F&&(re("smart"),Te(Array.from(_)),$(Array.from(T)))},[F,_,T]);const It=pe=>{re("smart"),Te(Ae=>Ae.includes(pe)?Ae.filter(De=>De!==pe):[...Ae,pe])},Jt=pe=>{re("smart"),$(Ae=>Ae.includes(pe)?Ae.filter(De=>De!==pe):[...Ae,pe])},Pn=()=>{re("smart"),Te(Ct.map(({feature:pe})=>pe.id)),$(Ct.flatMap(({allPhases:pe})=>pe.map(({phase:Ae})=>Ae.id)))},Fn=()=>{re("smart"),Te([]),$([])},ln=v.useMemo(()=>{const pe=new Set(Ct.map(({feature:Fe})=>Fe.id)),Ae=new Set(Ct.flatMap(({allPhases:Fe})=>Fe.map(({phase:ee})=>ee.id)));if(pe.size===0)return!1;const De=Array.from(pe).every(Fe=>je.includes(Fe)),Ke=Array.from(Ae).every(Fe=>J.includes(Fe));return De&&Ke},[Ct,je,J]);return v.useEffect(()=>{const pe=(De,Ke)=>{const Fe=Ke.filter(ee=>!!ee);for(const ee of Fe){const Ot=`${De}:${ee}`,en=De==="feature"?$e:De==="phase"?bt:se;en(Xn=>Xn.includes(ee)?Xn:[...Xn,ee]),Ie.current[Ot]!==void 0&&window.clearTimeout(Ie.current[Ot]),Ie.current[Ot]=window.setTimeout(()=>{en(Xn=>Xn.filter(bn=>bn!==ee)),delete Ie.current[Ot]},Q2)}},Ae=De=>{var ee,Ot,en,Xn,bn,Ha;const Fe=De.detail;if(Fe!=null&&Fe.type){if(Fe.type==="features-updated"){const _e=((ee=Fe.data)==null?void 0:ee.featureId)??((Ot=Fe.data)==null?void 0:Ot.id);pe("feature",[_e]),_e&&(re("smart"),Te(wt=>wt.includes(_e)?wt:[...wt,_e]));return}if(Fe.type==="phases-updated"){const _e=(en=Fe.data)==null?void 0:en.featureId,wt=((Xn=Fe.data)==null?void 0:Xn.phaseId)??((bn=Fe.data)==null?void 0:bn.id);pe("phase",[wt]),pe("feature",[_e]),pe("task",[(Ha=Fe.data)==null?void 0:Ha.taskId]),re("smart"),_e&&Te(St=>St.includes(_e)?St:[...St,_e]),wt&&$(St=>St.includes(wt)?St:[...St,wt])}}};return window.addEventListener("agent-plan:ws-event",Ae),()=>{window.removeEventListener("agent-plan:ws-event",Ae)}},[]),{workTree:B,displayedWorkTree:Ct,treeOpenMode:be,setTreeOpenMode:re,expandAll:Pn,collapseAll:Fn,isAllExpanded:ln,expandedFeatureIds:je,expandedPhaseIds:J,setExpandedFeatureIds:Te,setExpandedPhaseIds:$,toggleExpandedFeature:It,toggleExpandedPhase:Jt,recentFeatureIds:Le,recentPhaseIds:jt,recentTaskIds:dt,setRecentTaskIds:se,showAllFeatures:de,setShowAllFeatures:ge,featureStatusFilters:P,phaseStatusFilters:me,taskStatusFilters:A,hideDone:G,setHideDone:ae,hidePlanned:he,setHidePlanned:fe,onlyActiveBranches:Re,setOnlyActiveBranches:qe,resetFilters:()=>{j(""),ge(!0),ae(!1),fe(!1),ce(jo),Se(Ro),C(ko),qe(!1),L(Oo),re("all")},toggleFeatureStatusFilter:pe=>ce(Ae=>Xh(Ae,pe,jo)),togglePhaseStatusFilter:pe=>Se(Ae=>Xh(Ae,pe,Ro)),toggleTaskStatusFilter:pe=>C(Ae=>Xh(Ae,pe,ko)),searchQuery:w,setSearchQuery:j,searchActive:F,matchedTaskIds:ne,matchedFeatureIds:_,matchedPhaseIds:T,sort:R,setSort:L}}function up(e){const a=new URL(window.location.href),r=`${a.pathname}${a.search}${a.hash}`;e(a.searchParams);const s=`${a.pathname}${a.search}${a.hash}`;s!==r&&window.history.replaceState(window.history.state,"",s)}function Ti({id:e,status:a,variant:r="header",className:s,children:u,ariaLabel:c}){const d=r==="surface"?l2(a):s2(a),h=Qm(a),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:d,"aria-label":c,"data-status":a,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:a=""}){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)] ${a}`.trim(),children:r})}const Ew=v.createContext(null);function dp({id:e,children:a}){const r=hA({id:e}),s={transform:Vl.Transform.toString(r.transform),transition:r.transition};return o.jsx(Ew.Provider,{value:r,children:o.jsx("div",{ref:r.setNodeRef,style:s,className:r.isDragging?"ap-sortable--dragging":"",children:a})})}function fp(){const e=v.useContext(Ew);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(Vj,{className:"h-4 w-4"})}):null}function Nw({phaseId:e,phaseTitle:a,count:r,className:s=""}){if(r<1)return null;const u=`${r} linked requirement${r===1?"":"s"} for phase ${a}`;return o.jsxs(Ye,{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(nc,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{"aria-hidden":"true",children:r})]})}const hp="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function NA(){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 mp({priority:e}){if(e==null)return null;const a=`P${e}`;return o.jsx("span",{className:"inline-flex shrink-0 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)]","aria-label":`Priority ${e}`,title:`Priority ${e}`,children:a})}function rb({status:e,doneTasks:a,totalTasks:r,recentlyChanged:s,className:u}){const c=a!=null&&r!=null;return o.jsxs("div",{className:u,children:[s?o.jsx(NA,{}):null,c?o.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",r||0,")"]}):null,o.jsx("span",{className:"shrink-0",children:o.jsx(fr,{status:e})})]})}function jA({entry:e,expanded:a,recentlyChanged:r,onToggle:s,isPhaseExpanded:u,onTogglePhase:c,isPhaseRecentlyChanged:d,isTaskRecentlyChanged:h,highlightedTaskIds:p,resumeRequiredIds:g=new Set}){const{feature:y,totalTasks:x,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(Ti,{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":a?`Collapse feature ${y.name}`:`Expand feature ${y.name}`,"aria-expanded":a,children:o.jsx(g0,{className:`h-4 w-4 transition ${a?"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(fp,{}),o.jsx(nr,{featureNum:y.number,featureId:y.id}),o.jsx(rr,{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,o.jsx(mp,{priority:y.priority}),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:x,recentlyChanged:r,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),o.jsx(Ye,{to:`/features/${y.id}`,className:`entity-link--feature ${hp} 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:x,recentlyChanged:r,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&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:C0(e.display.displayStatus)},children:o.jsx(ip,{items:S.map(j=>j.phase.id),strategy:sp,children:S.map(j=>o.jsx(dp,{id:j.phase.id,children:o.jsx(RA,{feature:y,phaseEntry:j,expanded:u(j.phase.id),recentlyChanged:d(j.phase.id),onToggle:()=>c(j.phase.id),isTaskRecentlyChanged:h,highlightedTaskIds:p,resumeRequiredIds:g})},j.phase.id))})}):null]})}function RA({feature:e,phaseEntry:a,expanded:r,recentlyChanged:s,onToggle:u,isTaskRecentlyChanged:c,highlightedTaskIds:d,resumeRequiredIds:h=new Set}){var S;const{phase:p,totalTasks:g,doneTasks:y,allTasks:x,hasActiveTask:E}=a;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(Ti,{status:a.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(g0,{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(fp,{}),o.jsx(nr,{featureNum:e==null?void 0:e.number,phaseNum:p.number,featureId:e.id,phaseId:p.id}),o.jsx(rr,{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,o.jsx(mp,{priority:p.priority}),p.handoff?o.jsx(Xm,{phaseId:p.id,updatedAt:p.handoffUpdatedAt}):null,o.jsx(Nw,{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:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:y,totalTasks:g,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),o.jsx(Ye,{to:`/features/${e.id}/phases/${p.id}`,className:`entity-link--phase ${hp} underline-offset-4 hover:underline`,children:p.title}),o.jsx(dl,{value:p.updatedAt,className:"mt-1 block"})]})]}),o.jsx(Xu,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:y,totalTasks:g,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),r?x.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:C0(a.display.displayStatus)},children:o.jsx(ip,{items:x.map(w=>w.id),strategy:sp,children:x.map(w=>o.jsx(dp,{id:w.id,children:o.jsx(kA,{feature:e,phase:p,task:w,recentlyChanged:c(w.id),highlighted:d==null?void 0:d.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 kA({feature:e,phase:a,task:r,recentlyChanged:s,highlighted:u,resumeRequiredIds:c=new Set}){return o.jsxs(Ti,{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(fp,{}),o.jsx(nr,{featureNum:e==null?void 0:e.number,phaseNum:a.number,taskNum:r.number,featureId:e.id,phaseId:a.id,taskId:r.id}),o.jsx(rr,{id:cl({featureNum:e==null?void 0:e.number,phaseNum:a.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(mp,{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(w0,{className:"h-3.5 w-3.5"})}):null]}),o.jsx(rb,{status:r.status,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),o.jsx(Ye,{to:`/features/${e.id}/phases/${a.id}/tasks/${r.id}`,className:`entity-link--task ${hp} underline-offset-4 hover:underline`,children:r.title}),o.jsx(dl,{value:r.updatedAt,className:"mt-1 block"})]}),o.jsx(rb,{status:r.status,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]})}var M=(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})({}),ua=(function(e){return e[e.EXPECT_TERM=0]="EXPECT_TERM",e[e.EXPECT_VALUE=1]="EXPECT_VALUE",e})(ua||{}),vi=class{constructor(e,a){xn(this,"input");xn(this,"pos");xn(this,"state");xn(this,"tokens");xn(this,"options");this.input=e,this.pos=0,this.state=ua.EXPECT_TERM,this.tokens=[],this.options=a||{}}tokenize(){for(this.tokens=[],this.pos=0,this.state=ua.EXPECT_TERM;this.pos<this.input.length;)this.state===ua.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===`
|
|
318
|
+
`||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:M.WHITESPACE,value:this.input.slice(e,this.pos),start:e,end:this.pos})}readQuotedString(){const e=this.pos,a=this.advance();for(;this.pos<this.input.length;){const r=this.advance();if(r==="\\"&&this.pos<this.input.length)this.advance();else if(r===a)break}this.tokens.push({type:M.QUOTED_VALUE,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.tryReadModifier(),this.state=ua.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:M.LPAREN,value:"(",start:this.pos,end:this.pos+1}),this.advance();return}if(e===")"){this.tokens.push({type:M.RPAREN,value:")",start:this.pos,end:this.pos+1}),this.advance();return}if(e==="~"||e==="^"){const r=this.pos,s=e==="~"?M.TILDE:M.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===`
|
|
319
|
+
`||r==="\r"){this.tokens.push({type:M.PREFIX_OP,value:e,start:this.pos,end:this.pos+1}),this.advance();return}}if(e==="&"&&this.peekAt(1)==="&"){this.tokens.push({type:M.AND,value:"&&",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if(e==="|"&&this.peekAt(1)==="|"){this.tokens.push({type:M.OR,value:"||",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if((e===">"||e==="<")&&this.state===ua.EXPECT_TERM){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:M.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos}),this.state=ua.EXPECT_VALUE;return}if(e==="/"){this.readRegex();return}const a=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>a&&this.tokens.push({type:M.FIELD_NAME,value:this.input.slice(a,this.pos),start:a,end:this.pos}),this.tokens.push({type:M.COLON,value:":",start:this.pos,end:this.pos+1}),this.advance(),this.state=ua.EXPECT_VALUE;return}this.advance()}if(this.pos>a){const r=this.input.slice(a,this.pos),s=r.toUpperCase();s==="AND"?this.tokens.push({type:M.AND,value:r,start:a,end:this.pos}):s==="OR"?this.tokens.push({type:M.OR,value:r,start:a,end:this.pos}):s==="NOT"?this.tokens.push({type:M.NOT,value:r,start:a,end:this.pos}):r.includes("*")||r.includes("?")?this.tokens.push({type:M.WILDCARD,value:r,start:a,end:this.pos}):this.tokens.push({type:M.VALUE,value:r,start:a,end:this.pos}),this.tryReadModifier()}}readValue(){const e=this.peek();if(this.isWhitespace(e)){this.readWhitespace(),this.state=ua.EXPECT_TERM;return}if(e==='"'){this.readQuotedString(),this.state=ua.EXPECT_TERM;return}if(e==="("||e===")"){this.state=ua.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:M.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=ua.EXPECT_TERM;return}const a=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>a){const r=this.input.slice(a,this.pos);r.includes("*")||r.includes("?")?this.tokens.push({type:M.WILDCARD,value:r,start:a,end:this.pos}):this.tokens.push({type:M.VALUE,value:r,start:a,end:this.pos}),this.tryReadModifier()}this.state=ua.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:M.RANGE,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.state=ua.EXPECT_TERM}tryReadModifier(){for(;this.pos<this.input.length&&(this.peek()==="~"||this.peek()==="^");){const e=this.pos,a=this.advance()==="~"?M.TILDE:M.BOOST;for(;this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:a,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 a=this.peek();if(a==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(a==="/"){this.advance(),this.tokens.push({type:M.REGEX,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.tryReadModifier(),this.state=ua.EXPECT_TERM;return}this.advance()}this.tokens.push({type:M.VALUE,value:this.input.slice(e,this.pos),start:e,end:this.pos}),this.state=ua.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:M.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:M.HISTORY_REF,value:this.input.slice(e,this.pos),start:e,end:this.pos})}},Ss=class{constructor(e){xn(this,"tokens");xn(this,"pos");xn(this,"nonWsTokens");xn(this,"errors",[]);this.tokens=e,this.nonWsTokens=e.filter(a=>a.type!==M.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(e){if(e.type!==M.QUOTED_VALUE)return!1;const a=e.value;if(a.length<2)return!0;const r=a[0];return a[a.length-1]!==r}stripQuotes(e){const a=e.value;return this.isUnclosedQuote(e)?a.slice(1):a.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 a=this.peek();if(a.type===M.RPAREN)this.advance(),this.errors.push({type:"Error",value:a.value,message:"Unexpected closing parenthesis",start:a.start,end:a.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 a;if(((a=this.peek())==null?void 0:a.type)===e)return this.advance()}parseOr(){var a;let e=this.parseAnd();for(;((a=this.peek())==null?void 0:a.type)===M.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 a=this.peek();if(!a)break;if(a.type===M.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(a.type===M.OR||a.type===M.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)===M.NOT){const a=this.advance(),r=this.parsePrimary();return r.type==="Error"&&r.value===""?(this.errors.push({type:"Error",value:a.value,message:"Missing search term after NOT",start:a.start,end:a.end}),r):{type:"Not",expression:r,sourceOperator:a.value,start:a.start,end:r.end}}return this.parsePrimary()}applyGroupBoost(e){var a;if(((a=this.peek())==null?void 0:a.type)===M.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 a,r;if(e.type!=="BareTerm"&&e.type!=="FieldValue")return e;if(((a=this.peek())==null?void 0:a.type)===M.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)===M.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,a){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:a+r,valueEnd:a+r+s.length}:s.startsWith('"')?{value:s.slice(1),quoted:!0,valueStart:a+r,valueEnd:a+r+s.length}:{value:s,quoted:!1,valueStart:a+r,valueEnd:a+r+s.length}}parseRange(e){const a=e.value,r=a[0],s=r==="[",u=a[a.length-1],c=u==="]"||u==="}",d=u==="]";c||this.errors.push({type:"Error",value:r,message:"Unclosed range expression",start:e.start,end:e.start+1});const h=c?a.slice(1,-1):a.slice(1),p=h.match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/),g=e.start+1;if(!p){this.errors.push({type:"Error",value:a,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?d:!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),x=g+p[1].length+(h.length-p[1].length-p[2].length),E=this.parseRangeBound(p[2],x);return{type:"Range",lower:y.value,upper:E.value,lowerInclusive:s,upperInclusive:c?d:!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===M.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===M.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===M.PREFIX_OP){const c=this.advance(),d=this.parsePrimary();return c.value==="-"?{type:"Not",expression:d,sourceOperator:c.value,start:c.start,end:d.end}:{...d,start:c.start}}if(e.type===M.LPAREN){const c=this.advance();if(!this.peek()||this.peek().type===M.RPAREN){const g=this.match(M.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 d=this.parseOr(),h=this.match(M.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:d,start:c.start,end:h?h.end:d.end};return this.applyGroupBoost(p)}if(e.type===M.SAVED_SEARCH){const c=this.advance();return{type:"SavedSearch",name:c.value.slice(1),start:c.start,end:c.end}}if(e.type===M.HISTORY_REF){const c=this.advance();return{type:"HistoryRef",ref:c.value.slice(1),start:c.start,end:c.end}}if(e.type===M.FIELD_NAME){const c=this.advance(),d=this.match(M.COLON);if(d){let h=":";const p=this.match(M.COMPARISON_OP);if(p&&(h=p.value),((r=this.peek())==null?void 0:r.type)===M.LPAREN){const y=this.advance();if(!this.peek()||this.peek().type===M.RPAREN){const w=this.match(M.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 x=this.parseOr(),E=this.match(M.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:x,start:c.start,end:E?E.end:x.end};return this.applyGroupBoost(S)}if(((s=this.peek())==null?void 0:s.type)===M.RANGE){const y=this.advance(),x=this.parseRange(y);return x.field=c.value,x.start=c.start,x}if(((u=this.peek())==null?void 0:u.type)===M.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===M.VALUE||g.type===M.QUOTED_VALUE||g.type===M.WILDCARD)){const y=this.advance(),x=y.type===M.QUOTED_VALUE;x&&this.checkUnclosedQuote(y);const E=x?this.stripQuotes(y):y.value;return this.applyModifiers({type:"FieldValue",field:c.value,operator:h,value:E,quoted:x,start:c.start,end:y.end})}return{type:"FieldValue",field:c.value,operator:h,value:"",quoted:!1,start:c.start,end:p?p.end:d.end}}return{type:"BareTerm",value:c.value,quoted:!1,start:c.start,end:c.end}}if(e.type===M.COMPARISON_OP){const c=this.advance(),d=this.peek();if(d&&(d.type===M.VALUE||d.type===M.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===M.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===M.WILDCARD){const c=this.advance();return this.applyModifiers({type:"BareTerm",value:c.value,quoted:!1,start:c.start,end:c.end})}if(e.type===M.RANGE){const c=this.advance();return this.parseRange(c)}if(e.type===M.REGEX){const c=this.advance();return{type:"Regex",pattern:c.value.slice(1,-1),start:c.start,end:c.end}}if(e.type===M.VALUE){const c=this.advance();return this.applyModifiers({type:"BareTerm",value:c.value,quoted:!1,start:c.start,end:c.end})}if(e.type===M.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 a=this.advance();return{type:"Error",value:a.value,message:`Unexpected token: ${a.value}`,start:a.start,end:a.end}}static getCursorContext(e,a){let r,s;for(const c of e)if(c.type!==M.WHITESPACE){if(a>=c.start&&a<=c.end){r=c;break}c.end<=a&&(s=c)}const u=c=>{let d=0;for(let h=c;h>=0;h--){const p=e[h];if(p.type!==M.WHITESPACE){if(p.type===M.RPAREN){d++;continue}if(p.type===M.LPAREN){if(d>0){d--;continue}for(let g=h-1;g>=0;g--)if(e[g].type!==M.WHITESPACE){if(e[g].type===M.COLON){for(let y=g-1;y>=0;y--)if(e[y].type!==M.WHITESPACE){if(e[y].type===M.FIELD_NAME)return e[y].value;break}}break}}}}return""};if((r==null?void 0:r.type)===M.COLON){let c="";const d=e.indexOf(r);for(let h=d-1;h>=0;h--){if(e[h].type===M.FIELD_NAME){c=e[h].value;break}if(e[h].type!==M.WHITESPACE)break}if(!c&&a===r.start)return{type:"FIELD_NAME",partial:"",token:r};if(a===r.end){for(let h=d+1;h<e.length;h++)if(e[h].type!==M.WHITESPACE){if(e[h].type===M.VALUE||e[h].type===M.QUOTED_VALUE||e[h].type===M.WILDCARD||e[h].type===M.RANGE)return{type:"FIELD_VALUE",partial:e[h].type===M.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)===M.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===M.HISTORY_REF)return{type:"HISTORY_REF",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===M.RANGE){const c=e.indexOf(r);let d="";for(let h=c-1;h>=0;h--){if(e[h].type===M.FIELD_NAME){d=e[h].value;break}if(!(e[h].type===M.WHITESPACE||e[h].type===M.COLON))break}return{type:"RANGE",partial:"",fieldName:d,token:r}}if((s==null?void 0:s.type)===M.COLON||(s==null?void 0:s.type)===M.COMPARISON_OP){const c=e.indexOf(s);let d="";for(let h=c-1;h>=0;h--){if(e[h].type===M.FIELD_NAME){d=e[h].value;break}if(!(e[h].type===M.WHITESPACE||e[h].type===M.COLON||e[h].type===M.COMPARISON_OP))break}return r&&(r.type===M.VALUE||r.type===M.QUOTED_VALUE||r.type===M.WILDCARD)?{type:"FIELD_VALUE",partial:r.type===M.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:d,token:r}:{type:"FIELD_VALUE",partial:"",fieldName:d,token:s}}if((r==null?void 0:r.type)===M.VALUE||(r==null?void 0:r.type)===M.QUOTED_VALUE||(r==null?void 0:r.type)===M.WILDCARD){const c=e.indexOf(r);for(let d=c-1;d>=0;d--)if(e[d].type!==M.WHITESPACE){if(e[d].type===M.COLON||e[d].type===M.COMPARISON_OP){let h="";for(let p=d-1;p>=0;p--){if(e[p].type===M.FIELD_NAME){h=e[p].value;break}if(!(e[p].type===M.WHITESPACE||e[p].type===M.COLON||e[p].type===M.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:r.type===M.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)===M.QUOTED_VALUE)return{type:"FIELD_NAME",partial:r.value,token:r};if((r==null?void 0:r.type)===M.FIELD_NAME||(r==null?void 0:r.type)===M.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)===M.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===M.AND||s.type===M.OR||s.type===M.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===M.WHITESPACE))return{type:"EMPTY",partial:""};if((r==null?void 0:r.type)===M.LPAREN||(s==null?void 0:s.type)===M.LPAREN){const c=(r==null?void 0:r.type)===M.LPAREN?r:s,d=u(e.indexOf(c));return d?{type:"FIELD_VALUE",partial:"",fieldName:d,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if((r==null?void 0:r.type)===M.TILDE||(r==null?void 0:r.type)===M.BOOST)return{type:"OPERATOR",partial:""};if(s&&(s.type===M.VALUE||s.type===M.QUOTED_VALUE||s.type===M.RPAREN||s.type===M.RANGE||s.type===M.TILDE||s.type===M.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 Em(e,a){if(a<e.start||a>e.end)return null;if(e.type==="BooleanExpr"){const r=Em(e.left,a);if(r)return r;const s=Em(e.right,a);return s||null}return e}function TA(e,a,r){if(!e)return null;const s=Em(e,r);if(!s)return null;let u=s.start,c=s.end;const d=a.slice(c).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(d)return c+=d[0].length,{start:u,end:c};const h=a.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 AA={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:{}},DA={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"},CA=["AND","OR","NOT"];function lb(e){return e.replace(/\r\n/g,`
|
|
320
|
+
`).replace(/\r/g,`
|
|
321
|
+
`).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,a=>String.fromCharCode(a.charCodeAt(0)-65248))}var sb={"(":")","[":"]",'"':'"',"'":"'"};function OA(e,a,r,s,u){const c=e.slice(0,a),d=e.slice(a,r),h=e.slice(r);return{newValue:c+s+d+u+h,newCursorPos:r+2,newSelStart:a+1,newSelEnd:r+1}}function MA(e){if(!e.textContent)return"";const a=[];function r(s){var u;if(s.nodeType===Node.TEXT_NODE)a.push(s.textContent||"");else if(s.nodeName==="BR")(u=s.hasAttribute)!=null&&u.call(s,"data-sentinel")||a.push(`
|
|
322
|
+
`);else for(let c=0;c<s.childNodes.length;c++)r(s.childNodes[c])}return r(e),a.join("")}function ib(e,a,r){let s=-1,u=-1;for(let c=0;c<e.length;c++){const d=e[c];a>=d.start&&a<=d.end&&(s=c),u===-1&&r>=d.start&&r<=d.end&&(u=c)}return[s,u]}function _A(e,a,r){if(e){let s=e.end;if(e.type===M.FIELD_NAME&&r){const u=r.indexOf(e);if(u>=0){for(let c=u+1;c<r.length;c++)if(r[c].type!==M.WHITESPACE){r[c].type===M.COLON&&(s=r[c].end);break}}}return{start:e.start,end:s}}return{start:a,end:a}}var Wh=class jw{constructor(a,r=[],s=[],u=10,c={}){xn(this,"fields");xn(this,"fieldMap");xn(this,"savedSearches");xn(this,"searchHistory");xn(this,"maxSuggestions");xn(this,"options");xn(this,"defaultFieldName");xn(this,"defaultFieldShowFieldSuggs",!1);this.fields=a,this.fieldMap=new Map(a.map(d=>[d.name,d]));for(const d of a)if(d.aliases)for(const h of d.aliases)this.fieldMap.set(h,d);this.savedSearches=r,this.searchHistory=s,this.maxSuggestions=u,this.options={showSavedSearchHint:c.showSavedSearchHint??!1,showHistoryHint:c.showHistoryHint??!1}}resolveField(a){return this.fieldMap.get(a)}updateSavedSearches(a){this.savedSearches=a}updateSearchHistory(a){this.searchHistory=a}setDefaultField(a){this.defaultFieldName=a==null?void 0:a.name,this.defaultFieldShowFieldSuggs=(a==null?void 0:a.showFieldSuggestions)??!1}getSuggestions(a,r){let s=Ss.getCursorContext(a,r);const u=_A(s.token,r,a);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 d=this.getValueSuggestions(c,s.partial,u.start,u.end);if(this.defaultFieldShowFieldSuggs){const h=this.getFieldSuggestions(s.partial,u.start,u.end);return{suggestions:[...d,...h],showDatePicker:!1,context:s}}return{suggestions:d,showDatePicker:!1,context:s}}switch(s.type){case"FIELD_NAME":case"EMPTY":{const c=this.getFieldSuggestions(s.partial,u.start,u.end),d=!s.partial&&c.length>0?this.getSpecialHints(u.start,u.end):[];return{suggestions:this.sortByPriority([...c,...d]),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),d=this.getFieldSuggestions("",u.start,u.end),h=this.getSpecialHints(u.start,u.end);return{suggestions:this.sortByPriority([...c,...d,...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(a,r,s){const u=a.toLowerCase();return this.fields.filter(c=>!c.hide).map(c=>{const d=c.name.toLowerCase(),h=(c.label||"").toLowerCase(),p=(c.aliases||[]).map(y=>y.toLowerCase());let g=0;return d.startsWith(u)?g=4:h.startsWith(u)||p.some(y=>y.startsWith(u))?g=3:d.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,d)=>d.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:a,priority:10}))}getValueSuggestions(a,r,s,u){if(!a)return[];if(a.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(a.placeholder!==!1){const c=a.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[a.type];if(c)return[{text:"",label:c,type:"hint",replaceStart:s,replaceEnd:u}]}return[]}getOperatorSuggestions(a,r,s){const u=a.toLowerCase();return CA.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:a,priority:30}))}sortByPriority(a){return a.sort((r,s)=>(s.priority??0)-(r.priority??0))}getSpecialHints(a,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:a,replaceEnd:r,priority:20}),this.options.showHistoryHint&&c&&s.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:a,replaceEnd:r,priority:20}),s}getSavedSearchSuggestions(a,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:a,sourceData:u}))}getHistorySuggestions(a,r,s){return this.searchHistory.slice(0,this.maxSuggestions).map(u=>({text:jw.wrapHistoryQuery(u.query),label:u.label||u.query,description:u.description,type:"history",replaceStart:r,replaceEnd:s,matchPartial:a,sourceData:u}))}static wrapHistoryQuery(a){try{const r=new Ss(new vi(a).tokenize()).parse();if(r&&r.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function Du(e){if(e==="")return null;const a=Number(e);return isNaN(a)?`"${e}" is not a valid number`:null}var LA=[/^\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 zA(e){for(const a of LA)if(a.test(e))return!0;return!isNaN(Date.parse(e))}function Jh(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function $A(e){if(/^now$/i.test(e))return new Date;const a=e.match(/^now([+-])(\d+)([dhms])$/i);if(a){const u=new Date,c=a[1]==="+"?1:-1,d=parseInt(a[2],10);switch(a[3].toLowerCase()){case"d":u.setDate(u.getDate()+c*d);break;case"h":u.setHours(u.getHours()+c*d);break;case"m":u.setMinutes(u.getMinutes()+c*d);break;case"s":u.setSeconds(u.getSeconds()+c*d);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 ob(e,a){return new Date(e,a+1,0).getDate()}function UA(e,a){return new Date(e,a,1).getDay()}function To(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function cb(e,a,r){if(!a||!r)return!1;const s=e.getTime(),u=a.getTime(),c=r.getTime();return s>=Math.min(u,c)&&s<=Math.max(u,c)}var BA=["January","February","March","April","May","June","July","August","September","October","November","December"];function IA(e){return BA[e]}function Cu(e,a){if(e==="")return null;const r=e.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(r){const s=em(r[1].trim(),a);if(s)return`Range start: ${s}`;const u=em(r[2].trim(),a);return u?`Range end: ${u}`:null}return em(e,a)}function em(e,a){return/^now(\/[dhms])?$/i.test(e)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(e)||a&&a(e)!==null||zA(e)?null:`"${e}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function Ou(e){return e==null?null:typeof e=="string"?{message:e,severity:"error"}:e}var Mu={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function _u(e){if(e.length<=1)return e;const a=[...e].sort((s,u)=>{const c=Mu[s.type??"SYNTAX_ERROR"],d=Mu[u.type??"SYNTAX_ERROR"];return c!==d?c-d:s.start-u.start}),r=[];for(const s of a)r.some(u=>Mu[u.type??"SYNTAX_ERROR"]<Mu[s.type??"SYNTAX_ERROR"]&&u.start<=s.start&&u.end>=s.end)||r.push(s);return r}var ub=class{constructor(e){xn(this,"fields");this.fields=new Map(e.map(a=>[a.name,a]));for(const a of e)if(a.aliases)for(const r of a.aliases)this.fields.set(r,a)}validate(e,a,r,s){if(!e)return[];const u=[],c=s?this.fields.get(s):void 0;return this.walkNode(e,u,a,r,c),this.checkAmbiguousPrecedence(e,u),u}walkNode(e,a,r,s,u){switch(e.type){case"BareTerm":if(e.fuzzy!==void 0&&e.fuzzy>2&&a.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&&a.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&&a.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=Du(e.value);break;case"date":c=Cu(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&&a.push({message:c,start:e.start,end:e.end,field:u.name,type:"INVALID_VALUE"})}if(r&&e.value!==""){const c=Ou(r({value:e.value,position:"bare_term",quoted:e.quoted,fieldName:u==null?void 0:u.name,fieldConfig:u}));c&&a.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,a),e.field&&e.field!=="*"){const c=this.fields.get(e.field);c?this.validateRangeBounds(c,e,a,r,s):a.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;a.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){a.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&&a.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&&a.push({message:`Boost value must be positive (got ${e.boost})`,start:e.start,end:e.end,field:e.field,type:"SYNTAX_ERROR"});let d=null;switch(c.type){case"number":d=Du(e.value);break;case"date":d=Cu(e.value,s);break;case"boolean":e.value!=="true"&&e.value!=="false"&&(d=`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("*")&&(d=`"${e.value}" is not a valid IP address`);break}if(e.operator!==":"&&c.type!=="number"&&c.type!=="date"&&(d=`Comparison operator "${e.operator}" is not valid for ${c.type} fields`),!d&&r){const h=Ou(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;a.push({message:h.message,start:p,end:e.end,field:e.field,severity:h.severity,type:"CUSTOM"})}}if(d){const h=e.end-e.value.length,p=e.operator!==":"&&c.type!=="number"&&c.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";a.push({message:d,start:h,end:e.end,field:e.field,type:p})}break}case"FieldGroup":if(e.field==="*")this.walkNode(e.expression,a,r,s,u);else{const c=this.fields.get(e.field);c?this.walkFieldGroup(e.expression,c,a,r,s):a.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&&a.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,a,r,s,u),this.walkNode(e.right,a,r,s,u);break;case"Group":this.walkNode(e.expression,a,r,s,u),e.boost!==void 0&&e.boost<=0&&a.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,a,r,s,u);break;case"Error":a.push({message:e.message,start:e.start,end:e.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(e,a,r,s,u){switch(e.type){case"BareTerm":if(e.value==="")return;this.validateFieldValue(a,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(a,e,r,s,u);break;case"BooleanExpr":this.walkFieldGroup(e.left,a,r,s,u),this.walkFieldGroup(e.right,a,r,s,u);break;case"Group":this.walkFieldGroup(e.expression,a,r,s,u);break;case"Not":this.walkFieldGroup(e.expression,a,r,s,u);break;default:this.walkNode(e,r,s,u);break}}validateFieldValue(e,a,r,s,u,c,d,h,p){let g=null;switch(e.type){case"number":g=Du(a);break;case"date":g=Cu(a,p);break;case"boolean":a!=="true"&&a!=="false"&&(g=`Expected "true" or "false", got "${a}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(a)&&!a.includes("*")&&(g=`"${a}" 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=Ou(h({value:a,position:"field_group_term",fieldName:e.name,fieldConfig:e,quoted:r,operator:s!==":"?s:void 0}));y&&d.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";d.push({message:g,start:u,end:c,field:e.name,type:y})}}validateEmptyRangeBounds(e,a){e.lower!=="*"&&e.lower.trim()===""&&a.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()===""&&a.push({message:"Missing upper bound in range",start:e.end-1,end:e.end,field:e.field,type:"SYNTAX_ERROR"})}validateRangeBounds(e,a,r,s,u){const c=[];a.lower!=="*"&&a.lower.trim()!==""&&c.push({value:a.lower,label:"Range start",start:a.lowerStart,end:a.lowerEnd,position:"range_start",inclusive:a.lowerInclusive}),a.upper!=="*"&&a.upper.trim()!==""&&c.push({value:a.upper,label:"Range end",start:a.upperStart,end:a.upperEnd,position:"range_end",inclusive:a.upperInclusive});for(const d of c){let h=null;switch(e.type){case"number":h=Du(d.value),h&&(h=`${d.label}: ${h}`);break;case"date":h=Cu(d.value,u),h&&(h=`${d.label}: ${h}`);break;case"boolean":h="Range queries are not supported for boolean fields";break}if(!h&&s){const p=Ou(s({value:d.value,position:d.position,fieldName:e.name,fieldConfig:e,quoted:!1,inclusive:d.inclusive}));p&&r.push({message:p.message,start:d.start,end:d.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:d.start,end:d.end,field:e.name,type:p})}}}checkAmbiguousPrecedence(e,a){const r=new Set;this.findAndFlagAmbiguity(e,a,r)}findAndFlagAmbiguity(e,a,r){if(e.type==="BooleanExpr"&&!r.has(e)){const s=new Set,u=[];this.collectBoolOps(e,s,u),s.size>1&&(a.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,a,r))}else e.type==="Group"||e.type==="FieldGroup"?this.findAndFlagAmbiguity(e.expression,a,r):e.type==="Not"?this.findAndFlagAmbiguity(e.expression,a,r):e.type==="BooleanExpr"&&this.collectLeaves(e).forEach(s=>this.findAndFlagAmbiguity(s,a,r))}collectBoolOps(e,a,r){e.type==="BooleanExpr"&&(a.add(e.operator),r.push(e),this.collectBoolOps(e.left,a,r),this.collectBoolOps(e.right,a,r))}collectLeaves(e){return e.type!=="BooleanExpr"?[e]:[...this.collectLeaves(e.left),...this.collectLeaves(e.right)]}};function Ba(...e){return e.filter(Boolean).join(" ")}function cc(e){return{...AA,...e}}function uc(e){return{...DA,...e}}function HA(e,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function qA(e,a){return{flex:1,minHeight:a.inputMinHeight,padding:a.inputPadding,borderWidth:a.inputBorderWidth,borderStyle:"solid",borderColor:a.inputBorderColor,borderRadius:a.inputBorderRadius,outline:"none",fontSize:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,backgroundColor:e.background,color:e.text,caretColor:e.cursor,whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",overflow:"auto",cursor:"text"}}function PA(e){return{borderColor:e.inputFocusBorderColor,boxShadow:e.inputFocusShadow}}function FA(e,a){const r=a.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:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,userSelect:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}function Rw(e,a){return{position:"absolute",zIndex:a.dropdownZIndex,backgroundColor:e.background,border:`1px solid ${a.dropdownBorderColor}`,borderRadius:a.dropdownBorderRadius,boxShadow:a.dropdownShadow,maxHeight:a.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:a.dropdownMinWidth,maxWidth:a.dropdownMaxWidth,padding:"4px 0"}}function db(e,a,r){return{padding:r.dropdownItemPadding,cursor:"pointer",fontSize:r.dropdownItemFontSize,fontFamily:r.fontFamily,backgroundColor:e?a.dropdownSelected:"transparent",color:e?"#ffffff":a.text,display:"flex",alignItems:"center",gap:r.dropdownItemContentGap,lineHeight:"1.4"}}function ci(e){return{flex:1,fontWeight:500}}function tm(e){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function VA(e,a){return{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:e?a.typeBadgeSelectedBg:a.typeBadgeBg,color:e?a.typeBadgeSelectedColor:a.typeBadgeColor,flexShrink:0}}function YA(e,a){return{container:{padding:"12px",backgroundColor:e.background,minWidth:"280px",fontFamily:a.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:a.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:a.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:a.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 ${a.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 GA={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function XA(e){const a=[];let r=0,s="";function u(){s&&(a.push({type:"text",text:s}),s="")}e.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),r=1);const c=e.lastIndexOf("/"),d=c>0?c:e.length;for(;r<d;){const h=e[r];if(h==="\\"&&r+1<d){u(),a.push({type:"escape",text:e.slice(r,r+2)}),r+=2;continue}if(h==="["){u();let p=r+1;for(p<d&&e[p]==="^"&&p++,p<d&&e[p]==="]"&&p++;p<d&&e[p]!=="]";)e[p]==="\\"&&p+1<d&&p++,p++;p<d&&p++,a.push({type:"charClass",text:e.slice(r,p)}),r=p;continue}if(h==="("){u();let p="(";if(r+1<d&&e[r+1]==="?"){let g=r+2;for(;g<d&&g<r+4&&/[:<>=!]/.test(e[g]);)g++;p=e.slice(r,g)}a.push({type:"groupOpen",text:p}),r+=p.length;continue}if(h===")"){u(),a.push({type:"groupClose",text:")"}),r++;continue}if(h==="+"||h==="*"||h==="?"){u();let p=h;r+1<d&&e[r+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),r+=p.length;continue}if(h==="{"){u();let p=r+1;for(;p<d&&e[p]!=="}";)p++;p<d&&p++,a.push({type:"quantifier",text:e.slice(r,p)}),r=p;continue}if(h==="^"||h==="$"){u(),a.push({type:"anchor",text:h}),r++;continue}if(h==="|"){u(),a.push({type:"alternation",text:"|"}),r++;continue}s+=h,r++}return u(),c>0&&c<e.length&&a.push({type:"delimiter",text:"/"}),a}function QA(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function KA(e,a,r){const s=XA(e.value).map(u=>{const c=a[GA[u.type]]||a.regexText,d=u.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${u.type}" style="color:${c};font-weight:${d}">${QA(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 ZA={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function WA(e){const a=[];let r=0;r<e.length&&(e[r]==="["||e[r]==="{")&&(a.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 d=e[r];if(d===" "||d===" "){let p=r;for(;p<c&&(e[p]===" "||e[p]===" ");)p++;a.push({type:"whitespace",text:e.slice(r,p)}),r=p;continue}if((d==="T"||d==="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){a.push({type:"toKeyword",text:e.slice(r,r+2)}),r+=2;continue}}if(d==='"'){let p=r+1;for(;p<c&&e[p]!=='"';)e[p]==="\\"&&p+1<c&&p++,p++;p<c&&p++,a.push({type:"quotedValue",text:e.slice(r,p)}),r=p;continue}if(d==="*"){a.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);a.push({type:"bareValue",text:p}),r=h}else a.push({type:"bareValue",text:d}),r++}return u&&a.push({type:"bracket",text:e[s]}),a}function fb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function JA(e,a,r){const s=WA(e.value).map(u=>{if(u.type==="whitespace")return fb(u.text);const c=a[ZA[u.type]]||a.fieldValue,d=u.type==="toKeyword"||u.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${u.type}" style="color:${c};font-weight:${d}">${fb(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 kw(e,a){if(a<0)return null;const r=e.filter(c=>c.type===M.LPAREN||c.type===M.RPAREN);if(r.length===0)return null;const s=r.find(c=>c.end===a);if(s){const c=hb(r,s);if(c)return c}const u=r.find(c=>c.start===a);if(u){const c=hb(r,u);if(c)return c}return null}function hb(e,a){if(a.type===M.LPAREN){const r=e.indexOf(a);let s=0;for(let u=r;u<e.length;u++)if(e[u].type===M.LPAREN?s++:e[u].type===M.RPAREN&&s--,s===0)return{openStart:a.start,closeStart:e[u].start}}else{const r=e.indexOf(a);let s=0;for(let u=r;u>=0;u--)if(e[u].type===M.RPAREN?s++:e[u].type===M.LPAREN&&s--,s===0)return{openStart:e[u].start,closeStart:a.start}}return null}var eD={[M.FIELD_NAME]:"field-name",[M.COLON]:"colon",[M.VALUE]:"value",[M.QUOTED_VALUE]:"quoted-value",[M.AND]:"and",[M.OR]:"or",[M.NOT]:"not",[M.COMPARISON_OP]:"comparison-op",[M.LPAREN]:"lparen",[M.RPAREN]:"rparen",[M.SAVED_SEARCH]:"saved-search",[M.HISTORY_REF]:"history-ref",[M.PREFIX_OP]:"prefix-op",[M.WILDCARD]:"wildcard",[M.REGEX]:"regex",[M.RANGE]:"range",[M.TILDE]:"tilde",[M.BOOST]:"boost",[M.WHITESPACE]:"whitespace",[M.UNKNOWN]:"unknown"},tD={[M.FIELD_NAME]:"fieldName",[M.COLON]:"operator",[M.VALUE]:"fieldValue",[M.QUOTED_VALUE]:"quoted",[M.AND]:"booleanOp",[M.OR]:"booleanOp",[M.NOT]:"booleanOp",[M.COMPARISON_OP]:"operator",[M.LPAREN]:"paren",[M.RPAREN]:"paren",[M.SAVED_SEARCH]:"savedSearch",[M.HISTORY_REF]:"historyRef",[M.PREFIX_OP]:"operator",[M.WILDCARD]:"wildcard",[M.REGEX]:"quoted",[M.RANGE]:"fieldValue",[M.TILDE]:"operator",[M.BOOST]:"operator",[M.WHITESPACE]:"text",[M.UNKNOWN]:"error"};function ui(e,a,r){const s=cc(a);if(e.length===0)return"";const u=(r==null?void 0:r.cursorOffset)!==void 0?kw(e,r.cursorOffset):null,c=a==null?void 0:a.valueTypes,d=r==null?void 0:r.fieldTypeMap;let h;if(c&&d){h=new Array(e.length);let g,y=!1;const x=[];for(let E=0;E<e.length;E++){const S=e[E];S.type===M.FIELD_NAME?(g=S.value,y=!1):S.type===M.COLON&&g?y=!0:S.type===M.WHITESPACE||(S.type===M.LPAREN?(y&&g?x.push(d.get(g.toLowerCase())):x.push(void 0),g=void 0,y=!1):S.type===M.RPAREN?(x.pop(),g=void 0,y=!1):S.type===M.VALUE||S.type===M.QUOTED_VALUE||S.type===M.RANGE||S.type===M.REGEX||S.type===M.WILDCARD?(y&&g?h[E]=d.get(g.toLowerCase()):x.length>0&&(h[E]=x[x.length-1]),g=void 0,y=!1):(S.type===M.AND||S.type===M.OR||(S.type,M.NOT),g=void 0,y=!1))}}let p=e.map((g,y)=>{let x=s[tD[g.type]||"text"]||s.text;if(c&&h){const j=h[y];j&&c[j]&&(x=c[j])}const E=nD(g.value);if(g.type===M.WHITESPACE)return E.replace(/\n/g,"<br>");if(g.type===M.REGEX)return KA(g,s,r==null?void 0:r.tokenClassName);if(g.type===M.RANGE)return JA(g,s,r==null?void 0:r.tokenClassName);let S="normal";(g.type===M.AND||g.type===M.OR||g.type===M.NOT)&&(S="600"),g.type===M.FIELD_NAME&&(S="500");let w="";return u&&(g.type===M.LPAREN||g.type===M.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--${eD[g.type]}${r!=null&&r.tokenClassName?" "+r.tokenClassName:""}`}" style="color:${x};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 nD(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}if(typeof document<"u"){const e="elastic-input-keyframes";if(!document.getElementById(e)){const a=document.createElement("style");a.id=e,a.textContent="@keyframes elastic-input-spin { to { transform: rotate(360deg); } }",document.head.appendChild(a)}}function mb(e,a,r){if(!a||a.length===0)return e;const s=e.toLowerCase(),u=a.toLowerCase(),c=s.indexOf(u);if(c===-1)return e;const d=e.slice(0,c),h=e.slice(c,c+a.length),p=e.slice(c+a.length),g={fontWeight:700,textDecoration:"underline",textDecorationColor:r?"rgba(255,255,255,0.6)":"#0969da",textUnderlineOffset:"2px"};return v.createElement(v.Fragment,null,d,v.createElement("span",{className:"ei-highlight-match",style:g},h),p)}function aD({suggestions:e,selectedIndex:a,onSelect:r,position:s,colors:u,styles:c,visible:d,fixedWidth:h,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:y,cursorContext:x,listRefCallback:E,renderType:S,classNames:w}){const j=v.useRef(null),R=v.useRef(null);v.useEffect(()=>{const _=document.createElement("div");return document.body.appendChild(_),j.current=_,()=>{document.body.removeChild(_),j.current=null}},[]);const L=y&&x?y(x):null,B=L!=null;if(v.useEffect(()=>{if(R.current){const _=B?a+1:a,T=R.current.children[_];T&&T.scrollIntoView({block:"nearest"})}},[a,B]),!j.current||!d||e.length===0||!s)return null;const I=cc(u),F=uc(c),W={...Rw(I,F),top:`${s.top}px`,left:`${s.left}px`,...h!=null?{width:`${h}px`,minWidth:"unset",maxWidth:"unset"}:{}},ne=v.createElement("div",{className:Ba("ei-dropdown",w==null?void 0:w.dropdown),style:W,ref:_=>{R.current=_,E==null||E(_)},onMouseDown:_=>_.preventDefault()},B&&v.createElement("div",{className:Ba("ei-dropdown-header",w==null?void 0:w.dropdownHeader),style:{padding:F.dropdownItemPadding||"4px 10px",fontSize:"11px",color:I.placeholder,borderBottom:`1px solid ${I.dropdownHover}`,userSelect:"none"}},L),e.map((_,T)=>{const de=T===a,ge=db(de,I,F),be=($,P,ce)=>({key:T,className:Ba("ei-dropdown-item",$,de&&"ei-dropdown-item--selected",w==null?void 0:w.dropdownItem),style:{...ge,...P},title:ce,onClick:()=>r(_),onMouseEnter:me=>{me.currentTarget.style.backgroundColor=de?I.dropdownSelected:I.dropdownHover},onMouseLeave:me=>{me.currentTarget.style.backgroundColor=de?I.dropdownSelected:"transparent"}}),re=$=>{if(S===!1||!_.type||_.type==="hint")return null;const P=typeof S=="function"?S(_.type,{text:_.text,label:_.label,description:_.description,type:_.type}):_.type;return P!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...VA(de,F),...$}},P):null},je={flexDirection:"column",alignItems:"flex-start"},Te={display:"flex",alignItems:"center",gap:F.dropdownItemContentGap,width:"100%"};if(_.type==="hint"&&(_.text==="#"||_.text==="!"))return v.createElement("div",{...be("ei-dropdown-item--hint",{opacity:de?1:.7}),onMouseEnter:$=>{$.currentTarget.style.backgroundColor=de?I.dropdownSelected:I.dropdownHover,$.currentTarget.style.opacity="1"},onMouseLeave:$=>{$.currentTarget.style.backgroundColor=de?I.dropdownSelected:"transparent",$.currentTarget.style.opacity=de?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:ci()},_.label),_.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:tm()},_.description));if(_.type==="error")return v.createElement("div",{key:T,className:Ba("ei-dropdown-item","ei-dropdown-item--error",w==null?void 0:w.dropdownItem),style:{...ge,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ci(),color:I.error}},_.label||"Error loading suggestions"));if(_.type==="noResults")return v.createElement("div",{key:T,className:Ba("ei-dropdown-item","ei-dropdown-item--no-results",w==null?void 0:w.dropdownItem),style:{...ge,cursor:"default",opacity:.7}},_.customContent);if(_.type==="loading")return v.createElement("div",{key:T,className:Ba("ei-dropdown-item","ei-dropdown-item--loading",w==null?void 0:w.dropdownItem),style:{...ge,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ci(),fontStyle:"italic"}},_.label||"Searching..."),v.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:`${I.placeholder} transparent ${I.placeholder} transparent`,borderRadius:"50%"}}));if(_.type==="hint"){const $=db(!1,I,F);return v.createElement("div",{key:T,className:Ba("ei-dropdown-item","ei-dropdown-item--hint",w==null?void 0:w.dropdownItem),style:{...$,cursor:"default",opacity:_.customContent?1:.6}},_.customContent?_.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:ci()},_.label))}if(_.type==="history"&&p&&_.sourceData){const $=p(_.sourceData,de);if($!=null)return v.createElement("div",be("ei-dropdown-item--history",je),$)}if(_.type==="savedSearch"&&g&&_.sourceData){const $=g(_.sourceData,de);if($!=null)return v.createElement("div",be("ei-dropdown-item--saved-search"),$)}if((_.type==="history"||_.type==="savedSearch")&&_.description!=null){const $=_.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let P;const ce=_.text.startsWith("(")&&_.text.endsWith(")")?_.text.slice(1,-1):_.text;return _.label!==ce&&(P=_.text),v.createElement("div",be($,je,P),v.createElement("span",{className:"ei-dropdown-item-label",style:{...ci(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},mb(_.label,_.matchPartial,de)),v.createElement("span",{style:Te},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...tm(),flex:1}},_.description),re({marginLeft:"auto"})))}const J=_.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",be(J),v.createElement("span",{className:"ei-dropdown-item-label",style:ci()},mb(_.label,_.matchPartial,de)),_.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:tm()},_.description),re())}));return sl.createPortal(ne,j.current)}var rD=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function nm(e){return Math.floor(e/10)*10}function lD({onSelect:e,colors:a,styles:r,initialMode:s,initialStart:u,initialEnd:c,presets:d,className:h}){const p=s==="range"&&c?c:u??new Date,[g,y]=v.useState(s??"single"),[x,E]=v.useState("days"),[S,w]=v.useState(p.getFullYear()),[j,R]=v.useState(p.getMonth()),[L,B]=v.useState(u??null),[I,F]=v.useState(c??null),[W,ne]=v.useState(null),_=cc(a),T=YA(_,uc(r)),de=()=>{x==="days"?j===0?(R(11),w(se=>se-1)):R(se=>se-1):w(x==="months"?se=>se-1:se=>se-10)},ge=()=>{x==="days"?j===11?(R(0),w(se=>se+1)):R(se=>se+1):w(x==="months"?se=>se+1:se=>se+10)},be=()=>{w(x==="days"?se=>se-1:x==="months"?se=>se-10:se=>se-100)},re=()=>{w(x==="days"?se=>se+1:x==="months"?se=>se+10:se=>se+100)},je=()=>{x==="days"?E("months"):x==="months"&&E("years")},Te=se=>{R(se),E("days")},J=se=>{w(se),E("months")},$=se=>{if(g==="single"){e(Jh(se));return}if(!L||I)B(se),F(null),ne(null);else{const[Ie,st]=L<=se?[L,se]:[se,L];B(Ie),F(st),ne(null),e(`[${Jh(Ie)} TO ${Jh(st)}]`)}},P=L&&!I?W:I,ce=se=>{y(se),B(null),F(null),ne(null)},me=x==="days"?`${IA(j)} ${S}`:x==="months"?`${S}`:`${nm(S)}–${nm(S)+9}`,Se=x!=="years",A=new Date,C=ob(S,j),G=UA(S,j),ae=["Su","Mo","Tu","We","Th","Fr","Sa"],he=[],fe=(se,Ie,st)=>{const Pt=To(se,A),yn=L&&To(se,L),Ct=P&&To(se,P),It=cb(se,L,P),Jt=yn||Ct,Pn={...T.day,...st?T.dayOtherMonth:{},...Pt?T.dayToday:{},...It?T.dayInRange:{},...Jt?T.daySelected:{}},Fn=g==="range"&&L&&!I;return v.createElement("button",{key:Ie,className:"ei-datepicker-day",style:Pn,onClick:()=>$(se),onMouseEnter:ln=>{Fn?ne(se):Jt||(ln.currentTarget.style.backgroundColor=_.dropdownHover)},onMouseLeave:ln=>{!Fn&&!Jt&&(ln.currentTarget.style.backgroundColor=It?"rgba(9, 105, 218, 0.1)":"transparent")}},se.getDate())};if(G>0){const se=ob(S,j-1);for(let Ie=G-1;Ie>=0;Ie--){const st=se-Ie,Pt=new Date(S,j-1,st);he.push(fe(Pt,`prev${st}`,!0))}}for(let se=1;se<=C;se++){const Ie=new Date(S,j,se);he.push(fe(Ie,String(se),!1))}const Re=he.length%7;if(Re>0){const se=7-Re;for(let Ie=1;Ie<=se;Ie++){const st=new Date(S,j+1,Ie);he.push(fe(st,`next${Ie}`,!0))}}const qe={...T.day,padding:"10px 4px",fontSize:"13px"},Le={...qe,...T.dayToday},$e=d??[{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"}],jt={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},bt=se=>{se.currentTarget.style.backgroundColor="#eef1f5"},dt=se=>{se.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:Ba("ei-datepicker",h),style:T.container,onMouseDown:se=>se.preventDefault(),onMouseLeave:()=>ne(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:T.rangeToggle},["single","range"].map(se=>v.createElement("button",{key:se,style:{...T.rangeToggleButton,...g===se?T.rangeToggleButtonActive:{}},onClick:()=>ce(se)},se.charAt(0).toUpperCase()+se.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:T.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:be,onMouseEnter:bt,onMouseLeave:dt},"«"),v.createElement("button",{style:T.navButton,onClick:de,onMouseEnter:bt,onMouseLeave:dt},"‹")),v.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:Se?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:Se?je:void 0,onMouseEnter:se=>{Se&&(se.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:se=>{se.currentTarget.style.backgroundColor="transparent"}},me),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:ge,onMouseEnter:bt,onMouseLeave:dt},"›"),v.createElement("button",{style:T.navButton,onClick:re,onMouseEnter:bt,onMouseLeave:dt},"»"))),x==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:T.weekDays},ae.map(se=>v.createElement("div",{key:se,style:T.weekDay},se))),v.createElement("div",{className:"ei-datepicker-days",style:T.days},he)),x==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},rD.map((se,Ie)=>{const st=new Date(S,Ie,1),Pt=cb(st,L,P),yn=L&&To(new Date(L.getFullYear(),L.getMonth(),1),st)||P&&To(new Date(P.getFullYear(),P.getMonth(),1),st),Ct=Ie===A.getMonth()&&S===A.getFullYear(),It=g==="range"&&L&&!I;return v.createElement("button",{key:se,style:{...Ct?Le:qe,...Pt?T.dayInRange:{},...yn?T.daySelected:{}},onClick:()=>Te(Ie),onMouseEnter:Jt=>{It?ne(st):yn||(Jt.currentTarget.style.backgroundColor=_.dropdownHover)},onMouseLeave:Jt=>{!It&&!yn&&(Jt.currentTarget.style.backgroundColor=Pt?"rgba(9, 105, 218, 0.1)":"transparent")}},se)})),x==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(se,Ie)=>{const st=nm(S)-1+Ie,Pt=Ie===0||Ie===11,yn=st===A.getFullYear(),Ct=new Date(st,0,1),It=L&&P&&st>=Math.min(L.getFullYear(),P.getFullYear())&&st<=Math.max(L.getFullYear(),P.getFullYear()),Jt=L&&L.getFullYear()===st||P&&P.getFullYear()===st,Pn=g==="range"&&L&&!I;return v.createElement("button",{key:st,style:{...yn?Le:qe,...Pt?T.dayOtherMonth:{},...It?T.dayInRange:{},...Jt?T.daySelected:{}},onClick:()=>J(st),onMouseEnter:Fn=>{Pn?ne(Ct):Jt||(Fn.currentTarget.style.backgroundColor=_.dropdownHover)},onMouseLeave:Fn=>{!Pn&&!Jt&&(Fn.currentTarget.style.backgroundColor=It?"rgba(9, 105, 218, 0.1)":"transparent")}},st)})),(()=>{const se=$e.filter(Ie=>!Ie.type||Ie.type===g);return se.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...T.quickOptions,...jt}},se.map(Ie=>v.createElement("button",{key:`${Ie.type??"both"}-${Ie.value}`,style:T.quickOption,onClick:()=>e(Ie.value)},Ie.label)))})())}var sD=30,iD=150;function pb(e,a){let r=0;const s=u=>{if(u.nodeType===Node.TEXT_NODE){const c=(u.textContent||"").length;return r+c>=a?{node:u,offset:a-r}:(r+=c,null)}if(u.nodeName==="BR"){if(r+1>=a){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 d=s(u.childNodes[c]);if(d)return d}return null};return s(e)}function oD(e,a,r){const s=pb(e,a),u=pb(e,r);if(!s||!u)return[];const c=document.createRange();c.setStart(s.node,s.offset),c.setEnd(u.node,u.offset);const d=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-d.left,top:y.top-d.top,width:Math.max(y.width,6),height:y.height})}return p}function cD(e,a,r){if(!a||e.length===0)return[];const s=[];let u=0;for(const c of e){if(u>=sD)break;if(r>=c.start&&r<=c.end)continue;const d=oD(a,c.start,c.end);for(const h of d)s.push({left:h.left,top:h.top,width:h.width,height:h.height,error:c});u++}return s}var gb=28,vb=4;function uD(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 dD({errors:e,editorRef:a,cursorOffset:r,colors:s,styles:u,containerRef:c,classNames:d}){const[h,p]=v.useState(null),[g,y]=v.useState({x:0,clientY:0}),[x,E]=v.useState([]),S=v.useRef([]),w=v.useRef(null),j=v.useRef(null);if(v.useEffect(()=>{if(j.current&&clearTimeout(j.current),e.length===0){E([]),S.current=[],p(null);return}return j.current=setTimeout(()=>{const I=cD(e,a,r);E(I),S.current=I},iD),()=>{j.current&&clearTimeout(j.current)}},[e,a,r]),v.useEffect(()=>{const I=c;if(!I||!a)return;const F=_=>{const T=a.getBoundingClientRect(),de=_.clientX-T.left,ge=_.clientY-T.top;let be=-1;for(let re=0;re<S.current.length;re++){const je=S.current[re];if(de>=je.left&&de<=je.left+je.width&&ge>=je.top&&ge<=je.top+je.height+6){be=re;break}}be>=0?(p(be),y({x:de,clientY:_.clientY})):p(null)},W=()=>{p(null)},ne=new AbortController;return I.addEventListener("mousemove",F,{signal:ne.signal}),I.addEventListener("mouseleave",W,{signal:ne.signal}),()=>ne.abort()},[c,a]),v.useEffect(()=>{const I=w.current;if(!I||h==null)return;const F=I.getBoundingClientRect();if(F.right>window.innerWidth-8){const W=F.right-window.innerWidth+8;I.style.transform=`translateX(-${W}px)`}else I.style.transform=""}),x.length===0)return null;const R=cc(s),L=uc(u),B=h!=null?x[h]:null;return v.createElement(v.Fragment,null,x.map((I,F)=>{const W=I.error.severity==="warning",ne=uD(W?R.warning:R.error),_=I.top+I.height-2;return v.createElement("div",{key:`wave-${F}`,className:Ba("ei-squiggly",W?"ei-squiggly--warning":"ei-squiggly--error",d==null?void 0:d.squiggly),style:{position:"absolute",left:`${I.left}px`,top:`${_}px`,width:`${I.width}px`,height:"4px",zIndex:1,backgroundImage:ne,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),B!=null&&(()=>{const I=B.error.severity==="warning"?R.warning:R.error,F=a==null?void 0:a.getBoundingClientRect(),W=((F==null?void 0:F.left)??0)+g.x,ne=((F==null?void 0:F.top)??0)+B.top+B.height+2,_=((F==null?void 0:F.top)??0)+B.top,T=window.innerHeight-g.clientY<gb+20?_-gb-vb:ne+vb;return sl.createPortal(v.createElement("div",{ref:w,className:Ba("ei-tooltip",d==null?void 0:d.tooltip),style:{position:"fixed",top:`${T}px`,left:`${W}px`,zIndex:L.dropdownZIndex,backgroundColor:R.background,color:I,border:`1px solid ${I}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:L.fontFamily,lineHeight:"1.4",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"90vw"}},B.error.message),document.body)})())}function Xo(e,a,r){let s=0,u=!1;function c(d){var h;if(u)return!0;if(d===a){if(d.nodeType===Node.TEXT_NODE)s+=r;else for(let p=0;p<r&&p<d.childNodes.length;p++)if(c(d.childNodes[p]))return!0;return u=!0,!0}if(d.nodeType===Node.TEXT_NODE)return s+=(d.textContent||"").length,!1;if(d.nodeName==="BR")return(h=d.hasAttribute)!=null&&h.call(d,"data-sentinel")||(s+=1),!1;for(let p=0;p<d.childNodes.length;p++)if(c(d.childNodes[p]))return!0;return!1}return c(e),s}function $l(e){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const r=a.getRangeAt(0);return Xo(e,r.startContainer,r.startOffset)}function kr(e){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const r=a.getRangeAt(0);return{start:Xo(e,r.startContainer,r.startOffset),end:Xo(e,r.endContainer,r.endOffset)}}function ll(e,a){const r=window.getSelection();if(!r)return;const s=Nm(e,a);if(!s)return;const u=document.createRange();u.setStart(s.node,s.offset),u.collapse(!0),r.removeAllRanges(),r.addRange(u)}function rl(e,a,r){if(a===r){ll(e,a);return}const s=window.getSelection();if(!s)return;const u=Nm(e,a),c=Nm(e,r);if(!u||!c)return;const d=document.createRange();d.setStart(u.node,u.offset),d.setEnd(c.node,c.offset),s.removeAllRanges(),s.addRange(d)}function Nm(e,a){let r=0;function s(d){var h;if(d.nodeType===Node.TEXT_NODE){const p=(d.textContent||"").length;return r+p>=a?{node:d,offset:a-r}:(r+=p,null)}if(d.nodeName==="BR"){if((h=d.hasAttribute)!=null&&h.call(d,"data-sentinel"))return null;if(r+1>=a){const p=d.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(d)+1}}return r+=1,null}for(let p=0;p<d.childNodes.length;p++){const g=s(d.childNodes[p]);if(g)return g}return null}const u=s(e);if(u)return u;const c=Tw(e);return c?{node:c,offset:(c.textContent||"").length}:{node:e,offset:0}}function Tw(e){if(e.nodeType===Node.TEXT_NODE)return e;for(let a=e.childNodes.length-1;a>=0;a--){const r=Tw(e.childNodes[a]);if(r)return r}return null}function fD(e){const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);r.deleteContents();const s=document.createTextNode(e);r.insertNode(s),r.setStartAfter(s),r.collapse(!0),a.removeAllRanges(),a.addRange(r)}function hD(){const e=window.getSelection();if(!e||e.rangeCount===0)return;const a=e.getRangeAt(0);a.deleteContents();const r=document.createElement("br");a.insertNode(r),a.setStartAfter(r),a.collapse(!0),e.removeAllRanges(),e.addRange(a)}function Lu(e){var h;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.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),a.removeAllRanges(),a.addRange(r)}const u=e.getBoundingClientRect(),c=s.top-u.top+e.scrollTop,d=s.bottom-u.top+e.scrollTop;d>e.scrollTop+e.clientHeight?e.scrollTop=d-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 a=e.getRangeAt(0),r=a.getBoundingClientRect();if(r.width===0&&r.height===0||a.collapsed&&a.startContainer.nodeType===Node.ELEMENT_NODE&&a.startOffset>0&&((s=a.startContainer.childNodes[a.startOffset-1])==null?void 0:s.nodeName)==="BR"){const c=document.createElement("span");c.textContent="",a.insertNode(c);const d=c.getBoundingClientRect();return(u=c.parentNode)==null||u.removeChild(c),e.removeAllRanges(),e.addRange(a),d}return r}function xb(e,a){return Math.min(e,a)}function rm(e,a,r){const s=window.innerHeight,u=window.innerWidth;let c=e.bottom+window.scrollY+4,d=e.left+window.scrollX;return e.bottom+a+4>s&&(c=e.top+window.scrollY-a-4),d+r>u&&(d=u-r-8),d<8&&(d=8),{top:c,left:d}}var mD=new Set([M.VALUE,M.QUOTED_VALUE,M.WILDCARD]);function pD(e,a,r){for(const s of e)if(a>=s.start&&a<=s.end&&mD.has(s.type))return a===s.start&&r===s.end?null:{start:s.start,end:s.end};return null}var gD=new Set([M.VALUE,M.QUOTED_VALUE,M.WILDCARD,M.FIELD_NAME,M.RANGE,M.SAVED_SEARCH,M.HISTORY_REF,M.REGEX]);function vD(e,a,r){const s=[];for(const u of a)if(r>=u.start&&r<=u.end&&gD.has(u.type)){s.push({start:u.start,end:u.end});break}return e&&qu(e,r,s),xD(s)}function qu(e,a,r){if(a<e.start||a>e.end)return!1;let s=!1;switch(e.type){case"BooleanExpr":s=qu(e.left,a,r)||s,s=qu(e.right,a,r)||s;break;case"Group":case"Not":case"FieldGroup":s=qu(e.expression,a,r)||s;break}return r.push({start:e.start,end:e.end}),!0}function xD(e){e.sort((r,s)=>r.end-r.start-(s.end-s.start)||r.start-s.start);const a=[];for(const r of e){const s=a[a.length-1];s&&s.start===r.start&&s.end===r.end||a.push(r)}return a}var yD=60,bD=" ";function wD(e,a){const r=(a==null?void 0:a.maxLineLength)??yD,s=(a==null?void 0:a.indent)??bD,u={whitespace:a==null?void 0:a.whitespaceOperator,and:a==null?void 0:a.andOperator,or:a==null?void 0:a.orOperator,not:a==null?void 0:a.notOperator};let c;return typeof e=="string"?c=new Ss(new vi(e,{savedSearches:!0,historySearch:!0}).tokenize()).parse():c=e,c?Fu(c,0,r,s,u):""}function SD(e,a){return e.implicit?a.whitespace??"":e.operator==="AND"?a.and??e.sourceOperator??"AND":a.or??e.sourceOperator??"OR"}function Aw(e,a){const r=a.not??e.sourceOperator??"NOT";return{op:r,sep:/^[a-zA-Z]/.test(r)?" ":""}}function Dr(e,a){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}=Aw(e,a);return`${r}${s}${Dr(e.expression,a)}`}case"Group":{let r=`(${Dr(e.expression,a)})`;return e.boost!=null&&(r+=`^${e.boost}`),r}case"FieldGroup":{let r=`${e.field}:(${Dr(e.expression,a)})`;return e.boost!=null&&(r+=`^${e.boost}`),r}case"BooleanExpr":{const r=SD(e,a),s=r?` ${r} `:" ";return`${Dr(e.left,a)}${s}${Dr(e.right,a)}`}case"Error":return e.value}}function ED(e){const a=e.operator,r=!!e.implicit,s=[],u=c=>{c.type==="BooleanExpr"&&c.operator===a&&!!c.implicit===r?(u(c.left),u(c.right)):s.push(c)};return u(e),{operator:a,implicit:r,sourceOperator:e.sourceOperator,operands:s}}function Pu(e){return e.type==="Group"||e.type==="FieldGroup"?!0:e.type==="BooleanExpr"?Pu(e.left)||Pu(e.right):e.type==="Not"?Pu(e.expression):!1}var ND={and:"AND",or:"OR",not:"NOT"};function jD(e,a){return!!(Dr(e,ND).length>a||Pu(e))}function Fu(e,a,r,s,u){const c=s.repeat(a);switch(e.type){case"BooleanExpr":{const{operator:d,implicit:h,sourceOperator:p,operands:g}=ED(e),y=h?u.whitespace??"":d==="AND"?u.and??p??"AND":u.or??p??"OR",x=y?` ${y} `:" ",E=g.map(S=>Dr(S,u)).join(x);return E.length<=r?E:g.map((S,w)=>{const j=Fu(S,a,r,s,u);return w===0?j:y?`${c}${y} ${j}`:`${c}${j}`}).join(`
|
|
323
|
+
`)}case"Group":{if(!jD(e.expression,r)){let h=`(${Dr(e.expression,u)})`;return e.boost!=null&&(h+=`^${e.boost}`),h}let d=`(
|
|
324
|
+
${RD(Fu(e.expression,a+1,r,s,u),a+1,s)}
|
|
325
|
+
${c})`;return e.boost!=null&&(d+=`^${e.boost}`),d}case"FieldGroup":{let d=`${e.field}:(${Dr(e.expression,u)})`;return e.boost!=null&&(d+=`^${e.boost}`),d}case"Not":{const{op:d,sep:h}=Aw(e,u);return`${d}${h}${Fu(e.expression,a,r,s,u)}`}default:return Dr(e,u)}}function RD(e,a,r){const s=r.repeat(a);return e.split(`
|
|
326
|
+
`).map(u=>u.startsWith(s)?u:s+u).join(`
|
|
327
|
+
`)}function kD(e){return e?Io(e):[]}function yb(e){return e.type==="BooleanExpr"}function Io(e){switch(e.type){case"BooleanExpr":return jm(e);case"Group":{const a=[],r=e.expression;return yb(r)?(a.push({start:e.start,end:e.end}),a.push(...Io(r)),a.push({start:e.start,end:e.end})):a.push({start:e.start,end:e.end}),a}case"FieldGroup":{const a=[];a.push({start:e.start,end:e.end});const r=e.expression;return yb(r)&&a.push(...Io(r)),a}case"Not":{const a=[];return a.push({start:e.start,end:e.end}),a.push(...Io(e.expression)),a}case"FieldValue":case"BareTerm":case"SavedSearch":case"HistoryRef":case"Regex":case"Range":case"Error":return[{start:e.start,end:e.end}]}}function jm(e){return e.type==="BooleanExpr"?[...jm(e.left),...jm(e.right)]:Io(e)}function TD(e,a,r,s){if(e.length===0)return null;if(a>=0&&a<e.length){const u=s==="forward"?a+1:a-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 AD=class{constructor(e=100){xn(this,"stack",[]);xn(this,"index",-1);xn(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 DD(e,a){const r=s=>(a==null?void 0:a(s))??$A(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 CD(e,a){var r,s,u,c;return((e==null?void 0:e.mode)??"single")!==((a==null?void 0:a.mode)??"single")||(((r=e==null?void 0:e.start)==null?void 0:r.getTime())??0)!==(((s=a==null?void 0:a.start)==null?void 0:s.getTime())??0)?!0:(((u=e==null?void 0:e.end)==null?void 0:u.getTime())??0)!==(((c=a==null?void 0:a.end)==null?void 0:c.getTime())??0)}function OD({position:e,colors:a,onSelect:r,colorConfig:s,styleConfig:u,datePickerInit:c,fixedWidth:d,datePresets:h,datePickerClassName:p}){const g=v.useRef(null),[y,x]=v.useState(!1);if(v.useEffect(()=>{const w=document.createElement("div");return document.body.appendChild(w),g.current=w,x(!0),()=>{document.body.removeChild(w),g.current=null}},[]),!y||!g.current)return null;const E=uc(u),S={position:"absolute",zIndex:E.dropdownZIndex,...Rw(a,E),top:`${e.top}px`,left:`${e.left}px`,maxHeight:"none",overflowY:"visible",...d!=null?{width:`${d}px`,minWidth:"unset",maxWidth:"unset"}:{}};return sl.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:S,onMouseDown:w=>w.preventDefault()},v.createElement(lD,{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 MD(e){const{fields:a,onSearch:r,onChange:s,onValidationChange:u,value:c,defaultValue:d,savedSearches:h,searchHistory:p,fetchSuggestions:g,colors:y,styles:x,placeholder:E,className:S,classNames:w,style:j,dropdown:R,features:L,inputRef:B,datePresets:I,onKeyDown:F,onFocus:W,onBlur:ne,onTab:_,validateValue:T,parseDate:de,plainModeLength:ge,interceptPaste:be,defaultField:re,trailingSpaceOnAccept:je=!0,collapseOnBlur:Te=!1}=e,J=typeof re=="string"?{name:re,showFieldSuggestions:!1}:re?{showFieldSuggestions:!1,...re}:void 0,$=J==null?void 0:J.name,P=(R==null?void 0:R.open)??(R==null?void 0:R.mode)??"always",ce=typeof P=="function",me=ce?null:P,Se=(R==null?void 0:R.alignToInput)??!1,A=R==null?void 0:R.maxSuggestions,C=A||10,G=R==null?void 0:R.suggestDebounceMs,ae=parseInt((x==null?void 0:x.dropdownMaxHeight)||"300",10)||300,he=(L==null?void 0:L.savedSearches)??!!h,fe=(L==null?void 0:L.historySearch)??!!p,Re=(R==null?void 0:R.showSavedSearchHint)??he,qe=(R==null?void 0:R.showHistoryHint)??fe,Le=(R==null?void 0:R.showOperators)!==!1,$e=(ce||me!=="input")&&(R==null?void 0:R.onNavigation)!==!1,jt=(R==null?void 0:R.navigationDelay)??0,bt=(R==null?void 0:R.loadingDelay)??0,dt=R==null?void 0:R.renderFieldHint,se=R==null?void 0:R.renderHistoryItem,Ie=R==null?void 0:R.renderSavedSearchItem,st=R==null?void 0:R.renderHeader,Pt=R==null?void 0:R.renderNoResults,yn=R==null?void 0:R.renderType,Ct=(R==null?void 0:R.autoSelect)??!1,It=(R==null?void 0:R.homeEndKeys)??!1,Jt=(L==null?void 0:L.multiline)!==!1,Pn=(L==null?void 0:L.smartSelectAll)??!1,Fn=(L==null?void 0:L.expandSelection)??!1,ln=(L==null?void 0:L.wildcardWrap)??!1,fa=(L==null?void 0:L.clauseNavigation)??!1,ha=L==null?void 0:L.formatQuery,na=!!ha,Vn=typeof ha=="object"?ha:void 0,pe=v.useMemo(()=>({savedSearches:he,historySearch:fe}),[he,fe]),Ae=Array.isArray(a)?a:[],[De,Ke]=v.useState(Ae);v.useEffect(()=>{if(Array.isArray(a)){Ke(a);return}let k=!1;return a().then(X=>{k||Ke(X)}),()=>{k=!0}},[a]);const Fe=v.useMemo(()=>{const k=new Map;for(const X of De)if(k.set(X.name.toLowerCase(),X.type),X.aliases)for(const Ee of X.aliases)k.set(Ee.toLowerCase(),X.type);return k},[De]),ee=v.useRef(null),[Ot,en]=v.useState(null),Xn=v.useCallback(k=>{ee.current=k,en(k)},[]),bn=v.useRef(null),Ha=v.useRef(null),_e=v.useRef(c||d||""),wt=v.useRef(null),St=v.useRef(!1),Rt=v.useRef(!1),Ft=v.useRef(new AD),Mt=v.useRef(null),sn=v.useRef(new Set),tn=v.useRef(null),Vt=v.useRef(null),gt=v.useRef(null),nt=v.useRef(null),Nn=v.useRef(!1),Ln=v.useRef(null),D=v.useRef(null),z=v.useRef(null),q=v.useRef("input"),Z=v.useRef(null),ie=v.useRef(-1),ke=v.useRef(()=>{}),xe=v.useRef(new Wh(Ae,[],[],A||10,{showSavedSearchHint:Re,showHistoryHint:qe,hasSavedSearchProvider:typeof h=="function",hasHistoryProvider:typeof p=="function"}));xe.current.setDefaultField(J);const Ce=v.useRef(new ub(Ae)),Ne=v.useRef(T);Ne.current=T;const[ze,Be]=v.useState([]),[We,Oe]=v.useState(null),[tt,Ve]=v.useState([]),[Yt,at]=v.useState(-1),[mt,ft]=v.useState(!1),[pt,nn]=v.useState(!1),[Qn,jn]=v.useState(null),[zn,$n]=v.useState([]),[Kn,xa]=v.useState(!1),[fl,aa]=v.useState(!_e.current),[vr,Je]=v.useState(ge!=null&&_e.current.length>=ge),[Tt,an]=v.useState(0),[ra,Un]=v.useState(0),[_r,At]=v.useState(""),[Aa,Zn]=v.useState(null),[Zl,Ai]=v.useState(null),_t=v.useRef({tokens:ze,ast:We,suggestions:tt,selectedSuggestionIndex:Yt,showDropdown:mt,showDatePicker:pt,cursorOffset:Tt,selectionEnd:ra,autocompleteContext:_r,validationErrors:zn,cursorContext:Aa});_t.current={tokens:ze,ast:We,suggestions:tt,selectedSuggestionIndex:Yt,showDropdown:mt,showDatePicker:pt,cursorOffset:Tt,selectionEnd:ra,autocompleteContext:_r,validationErrors:zn,cursorContext:Aa};const xr=v.useCallback((k,X)=>{if(Se&&bn.current){const ye=bn.current.getBoundingClientRect();return{top:ye.bottom+window.scrollY+4,left:ye.left+window.scrollX}}const Ee=am();return Ee?rm(Ee,k,X):null},[Se]),dc=v.useCallback(()=>{if(!(!Se||!bn.current))return bn.current.getBoundingClientRect().width},[Se]),lr=v.useCallback((k,X,Ee="dropdown")=>{const ye=Ee==="datePicker"?k:xb(k,ae);if(Se&&Ee!=="datePicker"){ft(!0),jn(xr(ye,X));return}const Xe=requestAnimationFrame(()=>{sn.current.delete(Xe),Ee==="datePicker"?nn(!0):ft(!0);const ue=am();jn(ue?rm(ue,ye,X):null)});sn.current.add(Xe)},[Se,xr,ae]),hl=80,Ad=60,As=v.useCallback((k,X)=>{if(!ee.current)return;const Ee=ui(k,y,{cursorOffset:X,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Fe});ee.current.innerHTML=Ee,document.activeElement===ee.current&&ll(ee.current,X)},[y]),ya=v.useCallback((k,X)=>{const Ee=ge!=null&&k.length>=ge;if(Je(Ee),Ee){if(Be([]),Oe(null),$n([]),aa(k.length===0),Ve([]),_t.current.tokens=[],ft(!1),nn(!1),ee.current){const we=$l(ee.current);ee.current.querySelector("span")&&(ee.current.textContent=k,ll(ee.current,we)),an(we),Un(we)}s&&s(k,null),u&&u([]);return}const ye=new vi(k,pe).tokenize(),Xe=new Ss(ye),ue=Xe.parse(),ve=_u([...Xe.getErrors().map(we=>({message:we.message,start:we.start,end:we.end,type:"SYNTAX_ERROR"})),...Ce.current.validate(ue,Ne.current,de,$)]);if(ee.current){const we=$l(ee.current);X&&ye.length>hl?(Vt.current&&clearTimeout(Vt.current),Vt.current=setTimeout(()=>{Vt.current=null,ee.current&&As(ye,$l(ee.current))},Ad)):(Vt.current&&(clearTimeout(Vt.current),Vt.current=null),As(ye,we)),Be(ye),Oe(ue),$n(ve),aa(k.length===0),an(we),Un(we),_t.current.tokens=ye,X&&ke.current(ye,we)}else Be(ye),Oe(ue),$n(ve),aa(k.length===0),_t.current.tokens=ye;s&&s(k,ue),u&&u(ve)},[y,s,u,As,ge]),Wl=v.useCallback((k,X)=>{if(!dt||X.type!=="FIELD_VALUE"||!X.fieldName)return k;const Ee=xe.current.resolveField(X.fieldName);if(!Ee)return k;const ye=dt(Ee,X.partial);return ye==null?k:k.some(Xe=>Xe.type==="hint")?k.map(Xe=>Xe.type==="hint"?{...Xe,customContent:ye}:Xe):[{text:"",label:"",type:"hint",customContent:ye,replaceStart:X.start??0,replaceEnd:X.end??0},...k]},[dt]),Ds=v.useCallback(k=>{if(!Pt)return!1;const X=Pt({cursorContext:k,partial:k.partial});return X==null?!1:(Ve([{text:"",label:"",type:"noResults",customContent:X,replaceStart:0,replaceEnd:0}]),at(-1),nn(!1),lr(32,300),!0)},[Pt]),ba=v.useCallback((k,X,Ee)=>{var we,et,it;const ye=xe.current.getSuggestions(k,X);Le||(ye.suggestions=ye.suggestions.filter(He=>He.type!=="operator"));const Xe=ye.context.type;if(Zn(ye.context),ce){if(P({trigger:q.current,context:ye.context,suggestions:ye.suggestions,isOpen:_t.current.showDropdown||_t.current.showDatePicker,value:_e.current,selectionStart:X,selectionEnd:Ee??X})===!1){ft(!1),nn(!1),Ve([]);return}}else{if(me==="never"){ft(!1),nn(!1),Ve([]);return}if(me==="manual"){if(z.current&&z.current!==Xe){z.current=null,ft(!1),nn(!1),Ve([]);return}if(!z.current){ft(!1),nn(!1),Ve([]);return}}if(me==="input"&&q.current!=="input"&&q.current!=="ctrlSpace"){ft(!1),nn(!1),Ve([]);return}if(me==="always"&&k.some(He=>(He.type===M.AND||He.type===M.OR||He.type===M.NOT||He.type===M.TILDE||He.type===M.BOOST)&&X>=He.start&&X<=He.end)){ft(!1),nn(!1),Ve([]);return}}const ue=ye.context.fieldName?xe.current.resolveField(ye.context.fieldName):void 0,ve=!!(g&&ye.context.type==="FIELD_VALUE"&&ye.context.fieldName&&(ue==null?void 0:ue.type)!=="boolean"&&(ue==null?void 0:ue.suggestions)!==!1)||typeof h=="function"&&ye.context.type==="SAVED_SEARCH"||typeof p=="function"&&ye.context.type==="HISTORY_REF";if(ye.showDatePicker){Nn.current=!1,(we=tn.current)==null||we.abort(),wt.current&&clearTimeout(wt.current),nt.current&&(clearTimeout(nt.current),nt.current=null);const He=DD(ye.context,de),Rn=Ln.current;Ln.current=He,Ai(He);const Ht=ye.context.token;Ht&&(Ht.type==="COLON"||Ht.type==="COMPARISON_OP")?D.current={start:Ht.end,end:Ht.end}:Ht?D.current={start:Ht.start,end:Ht.end}:D.current={start:X,end:X},_t.current.showDatePicker&&CD(Rn,He)&&nn(!1),Ve([]),Se||ft(!1),At(Xe),lr(350,300,"datePicker");return}if(ve){const He=ye.context.token,Rn=He?He.start:X,Ht=He?He.end:X,ia=()=>{nt.current=null,Ve([{text:"",label:"Searching...",type:"loading",replaceStart:Rn,replaceEnd:Ht}]),Se||ft(!1),nn(!1),at(-1),lr(32,300)};nt.current&&clearTimeout(nt.current),bt>0?nt.current=setTimeout(ia,bt):ia(),At(Xe)}else{Nn.current=!1,(et=tn.current)==null||et.abort(),wt.current&&clearTimeout(wt.current),nt.current&&(clearTimeout(nt.current),nt.current=null);const He=Wl(ye.suggestions,ye.context);He.length>0?(Ve(He),Se||ft(!1),nn(!1),at(ye.context.partial||Ct?0:-1),At(Xe),lr(He.length*32,300)):(At(Xe),Ds(ye.context)||(ft(!1),nn(!1),Ve([])))}if(ve){const He=ye.context.partial,Rn=G||200;Nn.current=!0,wt.current&&clearTimeout(wt.current),(it=tn.current)==null||it.abort();const Ht=new AbortController;tn.current=Ht,wt.current=setTimeout(async()=>{const ia=ye.context.token,oa=ia?ia.start:X,wa=ia?ia.end:X;try{let kn;if(ye.context.type==="SAVED_SEARCH"&&typeof h=="function"){const mn=await h(He);if(Ht.signal.aborted)return;kn=mn.map(qt=>({text:qt.query,label:qt.label||qt.query,description:qt.description,type:"savedSearch",replaceStart:oa,replaceEnd:wa,matchPartial:He,sourceData:qt}))}else if(ye.context.type==="HISTORY_REF"&&typeof p=="function"){const mn=await p(He);if(Ht.signal.aborted)return;kn=mn.map(qt=>({text:Wh.wrapHistoryQuery(qt.query),label:qt.label||qt.query,description:qt.description,type:"history",replaceStart:oa,replaceEnd:wa,matchPartial:He,sourceData:qt}))}else{const mn=ye.context.fieldName,qt=xe.current.resolveField(mn),ns=await g(qt?qt.name:mn,He);if(Ht.signal.aborted)return;kn=ns.map(wr=>({text:wr.text,label:wr.label||wr.text,description:wr.description,type:wr.type,replaceStart:oa,replaceEnd:wa,matchPartial:He}))}if(nt.current&&(clearTimeout(nt.current),nt.current=null),kn=kn.slice(0,C),kn.length>0){if(J!=null&&J.showFieldSuggestions){const mn=xe.current.getFieldSuggestions(He,oa,wa);kn=[...kn,...mn].slice(0,C)}Ve(kn),at(He||Ct?0:-1),lr(kn.length*32,300)}else{const mn=xe.current.getSuggestions(_t.current.tokens,_t.current.cursorOffset);if(!(He&&Ds(mn.context))){const qt=Wl(mn.suggestions.filter(ns=>ns.type==="hint"),mn.context);qt.length>0?(Ve(qt),at(mn.context.partial||Ct?0:-1),lr(qt.length*32,300)):Ds(mn.context)||(ft(!1),Ve([]))}}}catch(kn){nt.current&&(clearTimeout(nt.current),nt.current=null),Ht.signal.aborted||(Ve([{text:"",label:kn instanceof Error?kn.message:"Error loading suggestions",type:"error",replaceStart:oa,replaceEnd:wa}]),at(-1),lr(32,300),Nn.current=!1)}},Rn)}},[g,h,p,G,Wl,xr,lr,Se,P,ce,me,Le,C,bt,Ct,Ds]);ke.current=ba;const on=v.useCallback(()=>{var k;ft(!1),nn(!1),Ai(null),Ln.current=null,D.current=null,Ve([]),at(-1),Nn.current=!1,(k=tn.current)==null||k.abort(),wt.current&&(clearTimeout(wt.current),wt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null),z.current=null},[]),la=v.useCallback((k,X,Ee)=>{if(gt.current&&(clearTimeout(gt.current),gt.current=null),!$e){(_t.current.showDropdown||_t.current.showDatePicker)&&on();return}q.current="navigation",jt>0?gt.current=setTimeout(()=>{gt.current=null,ba(k,X,Ee)},jt):ba(k,X,Ee)},[$e,jt,ba,on]),Da=v.useCallback((k,X,Ee)=>{_e.current=k,Mt.current&&(clearTimeout(Mt.current),Mt.current=null),Ft.current.push({value:k,cursorPos:X});const ye=new vi(k,pe).tokenize(),Xe=new Ss(ye),ue=Xe.parse(),ve=_u([...Xe.getErrors().map(we=>({message:we.message,start:we.start,end:we.end,type:"SYNTAX_ERROR"})),...Ce.current.validate(ue,Ne.current,de,$)]);if(ee.current){const we=ui(ye,y,{cursorOffset:X,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Fe});ee.current.innerHTML=we,ll(ee.current,X)}if(Be(ye),Oe(ue),$n(ve),aa(k.length===0),an(X),Un(X),ft(!1),nn(!1),s&&s(k,ue),u&&u(ve),Ee){const we=requestAnimationFrame(()=>{sn.current.delete(we),Ee(ye,ue)});sn.current.add(we)}},[y,s,u]),Lr=v.useCallback((k,X="Enter",Ee,ye)=>{if(!k)return;const Xe=_t.current,ue=Xe.autocompleteContext,ve=ue==="FIELD_VALUE"||ue==="SAVED_SEARCH"||ue==="HISTORY_REF";if(ve&&(q.current="navigation"),k.type==="hint"&&(k.text==="#"||k.text==="!")){const mn=k.text,qt=k.replaceStart,ns=Math.max(k.replaceEnd,Xe.selectionEnd),wr=_e.current.slice(0,qt),Cd=_e.current.slice(ns),pc=wr+mn+Cd,gc=wr.length+mn.length;Da(pc,gc,(Od,Md)=>{Ee?Ee(pc,Md):ba(Od,gc)});return}if(k.type==="hint")return;const we=Xe.autocompleteContext==="FIELD_VALUE",et=Math.min(k.replaceStart,Xe.cursorOffset),it=Math.max(k.replaceEnd,Xe.selectionEnd),He=_e.current.slice(0,et),Rn=_e.current.slice(it);let Ht="",ia=Rn;ve&&je&&(Rn.length===0?Ht=" ":/^[ \t\r\n]+$/.test(Rn)&&!Rn.startsWith("\\ ")&&(Ht=" ",ia=""));const oa=He+k.text+Ht+ia,wa=He.length+k.text.length+Ht.length,kn=X==="Enter"&&we;Da(oa,wa,(mn,qt)=>{Ee?Ee(oa,qt):kn?r&&r(oa,qt,ye):ba(mn,wa)})},[Da,ba,r,je]);v.useEffect(()=>{Array.isArray(h)&&xe.current.updateSavedSearches(h),Array.isArray(p)&&xe.current.updateSearchHistory(p)},[h,p]),v.useEffect(()=>{xe.current=new Wh(De,[],[],A||10,{showSavedSearchHint:Re,showHistoryHint:qe,hasSavedSearchProvider:typeof h=="function",hasHistoryProvider:typeof p=="function"}),xe.current.setDefaultField(J),Ce.current=new ub(De),Array.isArray(h)&&xe.current.updateSavedSearches(h),Array.isArray(p)&&xe.current.updateSearchHistory(p),_e.current&&ya(_e.current,!1)},[De,A,Re,qe]),v.useEffect(()=>{B&&B({getValue:()=>_e.current,setValue:k=>{_e.current=k,ya(k,!1)},focus:()=>{var k;return(k=ee.current)==null?void 0:k.focus()},blur:()=>{var k;return(k=ee.current)==null?void 0:k.blur()},getAST:()=>_t.current.ast,getValidationErrors:()=>_t.current.validationErrors,setSelection:(k,X)=>{ee.current&&(ee.current.focus(),rl(ee.current,k,X),an(k),Un(X))}})},[B,ya]),v.useEffect(()=>{const k=_e.current;Ft.current.push({value:k,cursorPos:k.length}),k&&ya(k,!1)},[]),v.useEffect(()=>{c!==void 0&&c!==_e.current&&(_e.current=c,ya(c,!1))},[c,ya]),v.useEffect(()=>()=>{var k;wt.current&&clearTimeout(wt.current),Vt.current&&clearTimeout(Vt.current),gt.current&&clearTimeout(gt.current),nt.current&&clearTimeout(nt.current),sn.current.forEach(X=>cancelAnimationFrame(X)),sn.current.clear(),(k=tn.current)==null||k.abort()},[]),v.useEffect(()=>{if(ce){const k=_t.current;k.cursorContext&&P({trigger:"modeChange",context:k.cursorContext,suggestions:k.suggestions,isOpen:k.showDropdown||k.showDatePicker,value:_e.current,selectionStart:k.cursorOffset,selectionEnd:k.selectionEnd})===!1&&(ft(!1),nn(!1),Ve([]))}else me==="never"&&(ft(!1),nn(!1),Ve([]));z.current=null},[P]);const yr=v.useRef(!1);v.useLayoutEffect(()=>{if(yr.current){yr.current=!1;return}const k=Ha.current;if(!k||!Qn)return;const X=k.getBoundingClientRect(),Ee=window.innerWidth;if(X.right>Ee-8){const ye=X.right-Ee+8;yr.current=!0,jn(Xe=>Xe&&{...Xe,left:Math.max(8,Xe.left-ye)})}},[Qn,mt,pt,tt]),v.useEffect(()=>{const k=()=>{const X=_t.current;if(!(!X.showDropdown&&!X.showDatePicker))if(X.showDropdown&&Se&&bn.current){const Ee=bn.current.getBoundingClientRect();jn({top:Ee.bottom+window.scrollY+4,left:Ee.left+window.scrollX})}else{const Ee=am();Ee&&jn(rm(Ee,X.showDatePicker?350:xb(X.suggestions.length*32,ae),300))}};return window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[Se,ae]),v.useEffect(()=>{const k=ee.current;if(!k)return;const X=()=>{(_t.current.showDropdown||_t.current.showDatePicker)&&on()};return k.addEventListener("scroll",X),()=>k.removeEventListener("scroll",X)},[on]);const zr=v.useRef(null),Di=v.useRef(y);v.useEffect(()=>{if(!ee.current)return;const k=_t.current.tokens;if(k.length===0||Kn&&ra!==Tt)return;const X=Kn?Tt:-1,Ee=y!==Di.current;Di.current=y;const ye=kw(k,X),Xe=ye?`${ye.openStart},${ye.closeStart}`:null;if(Xe===zr.current&&!Ee)return;zr.current=Xe;const ue=Kn?$l(ee.current):-1,ve=ui(k,y,{cursorOffset:X,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Fe});ee.current.innerHTML=ve,Kn&&ue>=0&&ll(ee.current,ue)},[Tt,ra,Kn,y]);const br=Te&&!Kn,Ci=v.useRef(br);v.useEffect(()=>{if(!ee.current)return;const k=Ci.current;if(Ci.current=br,k!==br)if(br)ee.current.innerHTML=ee.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const X=_t.current.tokens;if(X.length>0){const Ee=Kn?$l(ee.current):-1,ye=ui(X,y,{cursorOffset:Ee,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Fe});ee.current.innerHTML=ye,Kn&&Ee>=0&&ll(ee.current,Ee)}}},[br,y]);const qa=v.useCallback(()=>{if(St.current||!ee.current)return;Z.current=null,ie.current=-1,gt.current&&(clearTimeout(gt.current),gt.current=null);let k=MA(ee.current);if(k===_e.current)return;let X=$l(ee.current);const Ee=lb(k);Ee!==k&&(k=Ee,X=Math.min(X,k.length)),_e.current=k;const ye=Ft.current,Xe=ye.current();if(Xe&&Math.abs(k.length-Xe.value.length)<=2&&Mt.current?ye.replaceCurrent({value:k,cursorPos:X}):ye.push({value:k,cursorPos:X}),Mt.current&&clearTimeout(Mt.current),Mt.current=setTimeout(()=>{Mt.current=null},300),q.current="input",!ce&&me==="input"){const ue=X>0?k[X-1]:"";if(!ue||ue.trim()===""){ya(k,!1),on(),ee.current&&Lu(ee.current);return}}ya(k,!0),ee.current&&Lu(ee.current)},[ya,ce,me,on]),sr=v.useCallback(()=>{St.current=!0},[]),Oi=v.useCallback(()=>{St.current=!1,qa()},[qa]),$r=v.useCallback(k=>{if(!k)return;_e.current=k.value;const X=new vi(k.value,pe).tokenize(),Ee=new Ss(X),ye=Ee.parse(),Xe=_u([...Ee.getErrors().map(ve=>({message:ve.message,start:ve.start,end:ve.end,type:"SYNTAX_ERROR"})),...Ce.current.validate(ye,Ne.current,de,$)]),ue=k.selStart!=null&&k.selStart!==k.cursorPos;if(ee.current){const ve=ui(X,y,{cursorOffset:k.cursorPos,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Fe});ee.current.innerHTML=ve,ue?rl(ee.current,k.selStart,k.cursorPos):ll(ee.current,k.cursorPos)}Be(X),Oe(ye),$n(Xe),aa(k.value.length===0),an(ue?k.selStart:k.cursorPos),Un(k.cursorPos),on(),s&&s(k.value,ye),u&&u(Xe)},[y,s,u,on]),Pa=v.useCallback(()=>{const k=Ha.current;if(!k)return 10;const X=k.clientHeight,Ee=k.querySelectorAll(".ei-dropdown-item")[0];if(!Ee)return 10;const ye=Ee.offsetHeight;return ye<=0?10:Math.max(1,Math.floor(X/ye))},[]),Mi=v.useCallback(k=>{var ye,Xe;if(F&&F(k),k.defaultPrevented)return;const X=_t.current,Ee=k.nativeEvent.code;if(na&&Ee==="KeyF"&&k.altKey&&k.shiftKey&&!k.ctrlKey&&!k.metaKey){k.preventDefault();const ue=wD(_e.current,Vn);ue!==_e.current&&Da(ue,ue.length);return}if(ee.current&&ee.current.childNodes.length>40){const ue=window.getSelection();if(ue!=null&&!ue.isCollapsed){const ve=kr(ee.current);if(ve.end-ve.start>20){const we=k.key==="Backspace"||k.key==="Delete"||k.key==="x"&&(k.ctrlKey||k.metaKey),et=!k.ctrlKey&&!k.metaKey&&!k.altKey&&k.key.length===1;(we||et)&&(ee.current.textContent=_e.current,rl(ee.current,ve.start,ve.end))}}}{let ue=null,ve=null;if(sb[k.key])ue=k.key,ve=sb[k.key];else if(ln&&k.key==="*"&&ee.current){const we=kr(ee.current);if(we.start!==we.end){const[et,it]=ib(X.tokens,we.start,we.end);if(et>=0&&et===it){const He=X.tokens[et];(He.type===M.VALUE||He.type===M.WILDCARD)&&(ue="*",ve="*")}}}if(ue&&ve&&ee.current){const we=kr(ee.current);if(we.start!==we.end){k.preventDefault();const{newValue:et,newSelStart:it,newSelEnd:He}=OA(_e.current,we.start,we.end,ue,ve),Rn=Ft.current,Ht=Rn.current();Ht&&Ht.value===_e.current&&(Ht.selStart=we.start,Ht.cursorPos=we.end),_e.current=et,Mt.current&&(clearTimeout(Mt.current),Mt.current=null),Rn.push({value:et,cursorPos:He,selStart:it});const ia=new vi(et,pe).tokenize(),oa=new Ss(ia),wa=oa.parse(),kn=_u([...oa.getErrors().map(qt=>({message:qt.message,start:qt.start,end:qt.end,type:"SYNTAX_ERROR"})),...Ce.current.validate(wa,Ne.current,de,$)]),mn=ui(ia,y,{cursorOffset:He,tokenClassName:w==null?void 0:w.token,fieldTypeMap:Fe});ee.current.innerHTML=mn,rl(ee.current,it,He),Be(ia),Oe(wa),$n(kn),aa(!1),an(it),Un(He),on(),s&&s(et,wa),u&&u(kn);return}}}if(k.key==="z"&&(k.ctrlKey||k.metaKey)&&!k.shiftKey){k.preventDefault(),$r(Ft.current.undo());return}if(k.key==="y"&&(k.ctrlKey||k.metaKey)||k.key==="z"&&(k.ctrlKey||k.metaKey)&&k.shiftKey){k.preventDefault(),$r(Ft.current.redo());return}if(k.key==="a"&&(k.ctrlKey||k.metaKey)&&Pn&&ee.current){const ue=kr(ee.current),ve=pD(X.tokens,ue.start,ue.end);if(ve){k.preventDefault(),rl(ee.current,ve.start,ve.end),an(ve.start),Un(ve.end);return}}if(Fn&&k.altKey&&k.shiftKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&ee.current){const ue=Ee==="ArrowRight";let ve=Z.current;if(!ve){const et=kr(ee.current),it=vD(X.ast,X.tokens,et.start);if(it.length===0)return;ve={ranges:it,level:-1},Z.current=ve}const we=ue?Math.min(ve.level+1,ve.ranges.length-1):Math.max(ve.level-1,-1);if(we===ve.level)return;if(ve.level=we,we<0){const et=kr(ee.current);ll(ee.current,et.start),Z.current=null}else{k.preventDefault();const et=ve.ranges[we];rl(ee.current,et.start,et.end),an(et.start),Un(et.end)}return}if(Z.current=null,fa&&k.ctrlKey&&k.altKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&ee.current){k.preventDefault();const ue=Ee==="ArrowRight"?"forward":"backward",ve=kD(X.ast),we=kr(ee.current),et=ue==="forward"?we.end:we.start,it=TD(ve,ie.current,et,ue);it&&(ie.current=it.index,rl(ee.current,it.stop.start,it.stop.end),an(it.stop.start),Un(it.stop.end));return}if(ie.current=-1,k.key===" "&&(k.ctrlKey||k.metaKey)){k.preventDefault(),q.current="ctrlSpace",!ce&&me==="manual"&&(z.current=xe.current.getSuggestions(X.tokens,X.cursorOffset).context.type),ba(X.tokens,X.cursorOffset);return}if(k.key==="Enter"&&(k.ctrlKey||k.metaKey)){k.preventDefault(),on(),r&&r(_e.current,X.ast,k);return}if(k.key==="Enter"&&k.shiftKey&&Jt){k.preventDefault(),hD();const ue=ee.current?$l(ee.current):_e.current.length+1,ve=_e.current,we=ve.slice(0,ue-1)+`
|
|
328
|
+
`+ve.slice(ue-1);_e.current=we,Z.current=null,gt.current&&(clearTimeout(gt.current),gt.current=null),q.current="input",Ft.current.push({value:we,cursorPos:ue}),ya(we,!0),ee.current&&Lu(ee.current);return}if((k.key==="Backspace"||k.key==="Delete")&&ee.current&&!ee.current.textContent){const ue=_e.current;if(!ue)return;const{start:ve,end:we}=kr(ee.current);let et,it;if(ve!==we)et=ue.slice(0,ve)+ue.slice(we),it=ve;else if(k.key==="Backspace"&&ve>0)et=ue.slice(0,ve-1)+ue.slice(ve),it=ve-1;else if(k.key==="Delete"&&ve<ue.length)et=ue.slice(0,ve)+ue.slice(ve+1),it=ve;else return;k.preventDefault(),_e.current=et,Z.current=null,gt.current&&(clearTimeout(gt.current),gt.current=null),q.current="input",Ft.current.push({value:et,cursorPos:it}),ll(ee.current,it),ya(et,!0),ee.current&&Lu(ee.current);return}if(Rt.current=!1,X.showDropdown&&X.suggestions.length>0)switch(k.key){case"ArrowDown":k.preventDefault(),Rt.current=!0,at(ue=>ue>=X.suggestions.length-1?0:ue+1);return;case"ArrowUp":k.preventDefault(),Rt.current=!0,at(ue=>ue<=0?X.suggestions.length-1:ue-1);return;case"PageDown":{k.preventDefault(),Rt.current=!0;const ue=Pa();at(ve=>Math.min(ve+ue,X.suggestions.length-1));return}case"PageUp":{k.preventDefault(),Rt.current=!0;const ue=Pa();at(ve=>Math.max(ve-ue,0));return}case"Home":if(It&&X.selectedSuggestionIndex>=0){k.preventDefault(),Rt.current=!0,at(0);return}break;case"End":if(It&&X.selectedSuggestionIndex>=0){k.preventDefault(),Rt.current=!0,at(X.suggestions.length-1);return}break;case"Enter":if(X.selectedSuggestionIndex>=0){const ue=X.suggestions[X.selectedSuggestionIndex];if(ue.type==="loading"||ue.type==="error"){k.preventDefault(),on(),r&&r(_e.current,X.ast,k);return}if(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!"){k.preventDefault(),on();const ve=_e.current,we=X.cursorOffset;if(we<=ve.length&&ve[we]!==" "){const et=ve.slice(0,we),it=ve.slice(we),He=et+" "+it;Da(He,we+1,()=>{r&&r(He,X.ast,k)})}else r&&r(ve,X.ast,k);return}k.preventDefault(),Lr(ue,"Enter",void 0,k);return}k.preventDefault(),on(),r&&r(_e.current,X.ast,k);return;case"Tab":if(_){k.preventDefault();const ue=X.selectedSuggestionIndex>=0?X.suggestions[X.selectedSuggestionIndex]:null,ve=ue&&ue.type!=="loading"&&ue.type!=="error"&&!(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!")?ue:null,we=_({suggestion:ve,cursorContext:X.cursorContext||{type:"EMPTY",partial:""},query:_e.current});we.accept&&ve?Lr(ve,"Tab",(et,it)=>{var He;we.submit&&r&&r(et,it,k),we.blur&&((He=ee.current)==null||He.blur())},k):(on(),we.submit&&r&&r(_e.current,X.ast,k),we.blur&&((ye=ee.current)==null||ye.blur()));return}if(X.selectedSuggestionIndex>=0){const ue=X.suggestions[X.selectedSuggestionIndex];if(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!"){k.preventDefault(),on();const ve=_e.current,we=X.cursorOffset;if(we<=ve.length&&ve[we]!==" "){const et=ve.slice(0,we),it=ve.slice(we),He=et+" "+it,Rn=we+1;Da(He,Rn,Ht=>{ba(Ht,Rn)})}return}k.preventDefault(),Lr(ue,"Tab",void 0,k);return}break;case"Escape":k.preventDefault(),on();return}if(k.key==="Tab"&&_){k.preventDefault();const ue=_({suggestion:null,cursorContext:X.cursorContext||{type:"EMPTY",partial:""},query:_e.current});ue.submit&&r&&r(_e.current,X.ast,k),ue.blur&&((Xe=ee.current)==null||Xe.blur());return}if(X.showDatePicker&&k.key==="Escape"){k.preventDefault(),on();return}if(k.key==="Enter"&&!X.showDropdown&&!X.showDatePicker){k.preventDefault(),r&&r(_e.current,X.ast,k);return}},[r,on,Lr,Da,$r,Jt,ce,me,ba,F,_,Pn,Fn,fa,It,Pa,na]),Cs=v.useCallback(k=>{if(Rt.current){Rt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(k.key)){if(!ee.current)return;const X=kr(ee.current);an(X.start),Un(X.end),la(_t.current.tokens,X.start,X.end)}},[la]),fc=v.useCallback(()=>{xa(!0),W==null||W();const k=requestAnimationFrame(()=>{if(sn.current.delete(k),ee.current){const X=_t.current.tokens,Ee=X.length>0?$l(ee.current):0;an(Ee),Un(Ee),la(X,Ee)}});sn.current.add(k)},[qa,la,W]),Os=v.useCallback(()=>{var k;xa(!1),ft(!1),nn(!1),Ve([]),Nn.current=!1,(k=tn.current)==null||k.abort(),wt.current&&(clearTimeout(wt.current),wt.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null),an(-1),ne==null||ne()},[ne]),Ur=v.useRef(!1),hc=v.useCallback(k=>{if(!ee.current||k.detail!==2&&k.detail!==3)return;if(k.detail===3){if(!_t.current.ast)return;const we=document.caretRangeFromPoint(k.clientX,k.clientY);if(!we)return;const et=Xo(ee.current,we.startContainer,we.startOffset),it=TA(_t.current.ast,_e.current,et);if(!it||it.start>=it.end)return;k.preventDefault(),Ur.current=!0,rl(ee.current,it.start,it.end);return}k.preventDefault(),Ur.current=!0;const X=document.caretRangeFromPoint(k.clientX,k.clientY);if(!X)return;const Ee=Xo(ee.current,X.startContainer,X.startOffset),ye=_e.current,Xe=we=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(we);let ue=Ee;for(;ue>0&&Xe(ye[ue-1]);)ue--;let ve=Ee;for(;ve<ye.length&&Xe(ye[ve]);)ve++;ue<ve&&rl(ee.current,ue,ve)},[]),sa=v.useCallback(k=>{Ur.current&&(k.preventDefault(),Ur.current=!1)},[]),Br=v.useCallback(()=>{if(!ee.current)return;const k=kr(ee.current);if(an(k.start),Un(k.end),k.start!==k.end){const[X,Ee]=ib(_t.current.tokens,k.start,k.end);if(X!==Ee){on();return}}la(_t.current.tokens,k.start,k.end)},[la,on]),Ir=v.useCallback(k=>{Mt.current&&(clearTimeout(Mt.current),Mt.current=null),fD(k),qa()},[qa]),Jl=v.useCallback(k=>{k.preventDefault();const X=lb(k.clipboardData.getData("text/plain"));if(be){const Ee=be(X,k);Ee!=null&&typeof(Ee==null?void 0:Ee.then)=="function"?Ee.then(ye=>{ye!=null&&Ir(ye)}).catch(()=>{}):Ee!=null&&Ir(Ee)}else Ir(X)},[be,Ir]),Dd=v.useCallback(k=>{q.current="navigation";const X=_t.current,Ee=D.current,ye=Ee?Ee.start:X.cursorOffset,Xe=Ee?Ee.end:X.cursorOffset,ue=_e.current.slice(0,ye),ve=_e.current.slice(Xe);let we="",et=ve;je&&k.length>0&&(ve.length===0?we=" ":/^[ \t\r\n]+$/.test(ve)&&!ve.startsWith("\\ ")&&(we=" ",et=""));const it=ue+k+we+et,He=ue.length+k.length+we.length;Da(it,He,Rn=>{ee.current&&ee.current.focus(),ba(Rn,He)})},[Da,ba,je]),ml=cc(y),es=uc(x),ts=HA(ml,j),Hr={...qA(ml,es),...Kn?PA(es):{}};br&&(Hr.whiteSpace="nowrap",Hr.overflow="hidden",Hr.textOverflow="ellipsis");const mc=FA(ml,es);return v.createElement("div",{ref:bn,style:ts,className:Ba("ei-container",S,w==null?void 0:w.container)},v.createElement("div",{ref:Xn,contentEditable:!0,suppressContentEditableWarning:!0,className:Ba("ei-editor",w==null?void 0:w.editor),style:Hr,onInput:qa,onKeyDown:Mi,onKeyUp:Cs,onMouseDown:hc,onMouseUp:sa,onFocus:fc,onBlur:Os,onClick:Br,onPaste:Jl,onCompositionStart:sr,onCompositionEnd:Oi,spellCheck:!1}),fl&&!Kn?v.createElement("div",{className:Ba("ei-placeholder",w==null?void 0:w.placeholder),style:mc},E):null,v.createElement(dD,{errors:zn,editorRef:Ot,cursorOffset:Tt,colors:y,styles:x,containerRef:bn.current,classNames:w?{squiggly:w.squiggly,tooltip:w.tooltip}:void 0}),v.createElement(aD,{suggestions:tt,selectedIndex:Yt,onSelect:k=>Lr(k,"Tab"),position:Qn,colors:y,styles:x,visible:mt,fixedWidth:dc(),renderHistoryItem:se,renderSavedSearchItem:Ie,renderDropdownHeader:st,cursorContext:Aa,listRefCallback:k=>{Ha.current=k},renderType:yn,classNames:w?{dropdown:w.dropdown,dropdownHeader:w.dropdownHeader,dropdownItem:w.dropdownItem}:void 0}),pt&&Qn?v.createElement(OD,{position:Qn,colors:ml,onSelect:Dd,colorConfig:y,styleConfig:x,datePickerInit:Zl,fixedWidth:void 0,datePresets:I,datePickerClassName:w==null?void 0:w.datePicker}):null)}const _D=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function bb(e){var u;const a=window.getSelection();if(!a||a.rangeCount===0)return((u=e.textContent)==null?void 0:u.length)??0;const r=a.getRangeAt(0),s=r.cloneRange();return s.selectNodeContents(e),s.setEnd(r.endContainer,r.endOffset),s.toString().length}function LD(e){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const r=a.key.toLowerCase(),s=a.currentTarget,u=s.isContentEditable?s:s.querySelector("[contenteditable='true'], [contenteditable]")??s,c=e.current;if(r==="h"&&c){a.preventDefault();const h=c.getValue();let p=bb(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){a.preventDefault();const h=c.getValue();let p=bb(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 d=r==="j"?"ArrowDown":r==="k"?"ArrowUp":null;d&&(a.preventDefault(),u.dispatchEvent(new KeyboardEvent("keydown",{key:d,bubbles:!0,cancelable:!0})))}}function lm(e){return String(e>0?e:0).padStart(3,"0")}function zD({features:e,phases:a,query:r,onQuery:s}){const u=v.useRef(null),c=LD(u),d=v.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=v.useMemo(()=>{const x=[...new Set(e.map(R=>R.number))].sort((R,L)=>R-L),E=[...new Set(a.map(R=>R.number))].sort((R,L)=>R-L),S=[...new Set(a.flatMap(R=>R.tasks.map(L=>L.number)))].sort((R,L)=>R-L),w=[...new Set([...e.map(R=>R.shortId),...a.flatMap(R=>[R.shortId,...R.tasks.map(L=>L.shortId)])].filter(Boolean))],j=[...new Set(a.flatMap(R=>R.tasks.map(L=>L.title)))];return{featureNums:x,phaseNums:E,taskNums:S,shortIds:w,titles:j}},[e,a]),p=v.useCallback(async(x,E)=>{const S=E.toLowerCase();return x==="feature"?h.featureNums.filter(w=>String(w).startsWith(E)).slice(0,20).map(w=>({text:String(w),label:`F${lm(w)}`})):x==="phase"?h.phaseNums.filter(w=>String(w).startsWith(E)).slice(0,20).map(w=>({text:String(w),label:`P${lm(w)}`})):x==="task"?h.taskNums.filter(w=>String(w).startsWith(E)).slice(0,20).map(w=>({text:String(w),label:`T${lm(w)}`})):x==="id"?h.shortIds.filter(w=>w.toLowerCase().startsWith(S)).slice(0,20).map(w=>({text:w,label:w})):x==="status"||x==="feature-status"||x==="phase-status"?_D.filter(w=>w.startsWith(S)).map(w=>({text:w,label:w})):x==="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=v.useCallback(x=>s(x),[s]),y=v.useCallback(x=>{u.current=x},[]);return o.jsx("div",{className:"search-bar",children:o.jsx(MD,{fields:d,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 wb(){up(e=>{e.delete("locate")})}function $D(e,a){if(Object.keys(a).length===0)return e;const r=c=>{const d=a[c];return d?new Map(d.map((h,p)=>[h,p])):null},s=r("__features__");return(s?[...e].sort((c,d)=>(s.get(c.feature.id)??1/0)-(s.get(d.feature.id)??1/0)):e).map(c=>{const d=r(`phase-scope:${c.feature.id}`),h=d?[...c.allPhases].sort((p,g)=>(d.get(p.phase.id)??1/0)-(d.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((x,E)=>(g.get(x.id)??1/0)-(g.get(E.id)??1/0)):p.allTasks;return{...p,allTasks:y}})}})}function di({active:e=!1,disabled:a=!1,onClick:r,children:s}){return o.jsx("button",{type:"button",disabled:a,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)]"} ${a?"cursor-not-allowed opacity-60":""}`,children:s})}function UD({features:e,phases:a,activeTasks:r,projectStorageScope:s,resumeRequiredIds:u=new Set,analyticsFilter:c=null,onClearAnalyticsFilter:d}){const h=EA({features:e,phases:a,projectStorageScope:s}),p=v.useMemo(()=>c?h.displayedWorkTree.map(C=>({...C,allPhases:C.allPhases.map(G=>({...G,allTasks:G.allTasks.filter(ae=>c.taskIds.has(ae.id))})).filter(G=>G.allTasks.length>0)})).filter(C=>C.allPhases.length>0):h.displayedWorkTree,[c,h.displayedWorkTree]),g=v.useMemo(()=>new Set(p.map(C=>C.feature.id)),[p]),y=v.useMemo(()=>new Set(p.flatMap(C=>C.allPhases.map(G=>G.phase.id))),[p]),x=v.useMemo(()=>p.reduce((C,G)=>C+G.allPhases.reduce((ae,he)=>ae+he.allTasks.length,0),0),[p]),[E,S]=v.useState({});v.useEffect(()=>{S({})},[p]);const w=v.useMemo(()=>$D(p,E),[p,E]),[j,R]=v.useState(!1),[L,B]=v.useState(null),[I,F]=v.useState(null),W=C=>F(String(C.active.id)),[ne,_]=v.useState(0);v.useEffect(()=>{const C=document.querySelector("header");if(!C)return;const G=()=>_(C.offsetHeight);G();const ae=new ResizeObserver(G);return ae.observe(C),window.addEventListener("resize",G),()=>{ae.disconnect(),window.removeEventListener("resize",G)}},[]),v.useEffect(()=>{const C=window.setTimeout(()=>{const G=document.querySelector(".ap-search-sticky"),ae=document.querySelector("header");if(!G||!ae)return;const he=G.getBoundingClientRect();if(he.top<0){const fe=he.top+window.scrollY-ae.offsetHeight;window.scrollTo({top:Math.max(0,fe),behavior:"smooth"})}},60);return()=>window.clearTimeout(C)},[h.searchQuery,h.hideDone,h.hidePlanned,h.onlyActiveBranches]);const T=$k(zk(rp,{activationConstraint:{distance:5}})),de=async C=>{const{active:G,over:ae}=C;if(F(null),!ae||G.id===ae.id)return;const he=String(G.id),fe=String(ae.id),Re=w.map(qe=>qe.feature.id);if(Re.includes(he)&&Re.includes(fe)){const qe=Bo(Re,Re.indexOf(he),Re.indexOf(fe)),Le=qe.indexOf(he),$e=Le>0?qe[Le-1]??null:null,jt=Le<qe.length-1?qe[Le+1]??null:null;S(bt=>({...bt,__features__:qe})),await qh("feature",he,$e,jt).catch(()=>{});return}for(const qe of w){const Le=qe.allPhases.map($e=>$e.phase.id);if(Le.includes(he)&&Le.includes(fe)){const $e=Bo(Le,Le.indexOf(he),Le.indexOf(fe)),jt=$e.indexOf(he),bt=jt>0?$e[jt-1]??null:null,dt=jt<$e.length-1?$e[jt+1]??null:null;S(se=>({...se,[`phase-scope:${qe.feature.id}`]:$e})),await qh("phase",he,bt,dt).catch(()=>{});return}}for(const qe of w)for(const Le of qe.allPhases){const $e=Le.allTasks.map(jt=>jt.id);if($e.includes(he)&&$e.includes(fe)){const jt=Bo($e,$e.indexOf(he),$e.indexOf(fe)),bt=jt.indexOf(he),dt=bt>0?jt[bt-1]??null:null,se=bt<jt.length-1?jt[bt+1]??null:null;S(Ie=>({...Ie,[`task-scope:${Le.phase.id}`]:jt})),await qh("task",he,dt,se).catch(()=>{});return}}},ge=C=>c?y.has(C):h.expandedPhaseIds.includes(C),be=C=>h.recentPhaseIds.includes(C),re=C=>h.recentTaskIds.includes(C),[je]=tc(),Te=ga(),[J,$]=v.useState(null),P=je.get("locate"),ce=P?parseInt(P.replace(/^T/i,""),10):null,me=v.useRef(null),Se=ce==null?null:`${Te.key}:${ce}`;v.useEffect(()=>{if(ce==null||Number.isNaN(ce)||Se!=null&&me.current===Se)return;const C=a.flatMap(fe=>fe.tasks.map(Re=>({t:Re,p:fe}))).find(({t:fe})=>fe.number===ce);if(!C){if(a.length===0)return;me.current=Se,wb();return}const{t:G,p:ae}=C;if(h.onlyActiveBranches&&h.setOnlyActiveBranches(!1),h.hideDone&&h.setHideDone(!1),h.searchQuery&&h.setSearchQuery(""),h.setTreeOpenMode("smart"),ae.featureId){const fe=ae.featureId;h.expandedFeatureIds.includes(fe)||h.setExpandedFeatureIds(Re=>Re.includes(fe)?Re:[...Re,fe])}h.expandedPhaseIds.includes(ae.id)||h.setExpandedPhaseIds(fe=>fe.includes(ae.id)?fe:[...fe,ae.id]);const he=document.getElementById(`task-row-${ce}`);if(he){const fe=document.querySelector("header"),Re=document.querySelector(".ap-search-sticky"),qe=((fe==null?void 0:fe.offsetHeight)??0)+((Re==null?void 0:Re.offsetHeight)??0)+12,Le=he.getBoundingClientRect().top+window.scrollY-qe;window.scrollTo({top:Math.max(0,Le),behavior:"smooth"}),$(G.id);const $e=window.setTimeout(()=>$(null),2500);return me.current=Se,wb(),()=>window.clearTimeout($e)}},[ce,Se,a,h.expandedFeatureIds,h.expandedPhaseIds,h.onlyActiveBranches,h.hideDone,h.searchQuery,h.treeOpenMode]);const A=()=>{if(!I)return null;for(const C of w){if(C.feature.id===I)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(nr,{featureNum:C.feature.number}),o.jsx(fr,{status:C.feature.status})]}),o.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:C.feature.name})]});for(const G of C.allPhases){if(G.phase.id===I)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(nr,{featureNum:C.feature.number,phaseNum:G.phase.number}),o.jsx(fr,{status:G.phase.status})]}),o.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:G.phase.title})]});for(const ae of G.allTasks)if(ae.id===I)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(nr,{featureNum:C.feature.number,phaseNum:G.phase.number,taskNum:ae.number}),o.jsx(fr,{status:ae.status})]}),o.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ae.title})]})}}return null};return o.jsxs($t,{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 ",x," of ",c.taskIds.size," selected ",c.taskIds.size===1?"task":"tasks"," after current Work Tree filters."]}),d?o.jsx("button",{type:"button",onClick:d,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(zD,{features:e,phases:a,query:h.searchQuery,onQuery:h.setSearchQuery}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(op,{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(di,{active:h.isAllExpanded,onClick:()=>h.isAllExpanded?h.collapseAll():h.expandAll(),children:h.isAllExpanded?"Collapse all":"Expand all"}),o.jsx(di,{active:h.hideDone,onClick:()=>h.setHideDone(C=>!C),children:"Hide done"}),o.jsx(di,{active:h.hidePlanned,onClick:()=>h.setHidePlanned(C=>!C),children:"Hide planned"}),o.jsx(di,{active:h.onlyActiveBranches,onClick:()=>h.setOnlyActiveBranches(C=>!C),children:"Only active"}),o.jsx(di,{onClick:h.resetFilters,children:"Reset"}),o.jsx(di,{disabled:j,onClick:async()=>{R(!0),B(null);try{const C=await WR(),G=C.migrated,ae=C.integrity.duplicatePhaseIds.length,he=C.integrity.danglingPhaseIds.length;B(`Repair done: renamed ${G.renamed}, repaired ${G.repaired} refs, inferred ${G.inferred}, archived ${C.handoffs.archived} stale handoff(s). Integrity: ${ae} duplicate, ${he} dangling.`)}catch(C){B(`Repair failed: ${C instanceof Error?C.message:String(C)}`)}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,L?o.jsx("span",{className:"text-xs text-[var(--text-muted)] sm:truncate",children:L}):null]}),o.jsx("div",{className:"grid gap-3",children:w.length>0?o.jsxs($T,{sensors:T,collisionDetection:Pk,onDragStart:W,onDragEnd:de,children:[o.jsx(ip,{items:w.map(C=>C.feature.id),strategy:sp,children:w.map(C=>o.jsx(dp,{id:C.feature.id,children:o.jsx(jA,{entry:C,expanded:c?g.has(C.feature.id):h.expandedFeatureIds.includes(C.feature.id),recentlyChanged:h.recentFeatureIds.includes(C.feature.id),onToggle:()=>h.toggleExpandedFeature(C.feature.id),isPhaseExpanded:ge,onTogglePhase:h.toggleExpandedPhase,isPhaseRecentlyChanged:be,isTaskRecentlyChanged:re,highlightedTaskIds:(()=>{const G=h.searchActive?h.matchedTaskIds:void 0;if(!J)return G;const ae=new Set(G??[]);return ae.add(J),ae})(),resumeRequiredIds:u})},C.feature.id))}),o.jsx(nA,{dropAnimation:{duration:150,easing:"ease"},children:A()})]}):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(C=>{const G=C.featureId?`/features/${C.featureId}/phases/${C.phaseId}/tasks/${C.id}`:"/features";return o.jsxs(Ye,{to:G,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:[C.status==="in-progress"?o.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,o.jsxs("span",{className:"truncate",children:["T",W2(C.number)," — ",C.title]})]}),o.jsx(fr,{status:C.status})]}),o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:C.phaseId})]},C.id)}):o.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function BD({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(a=>o.jsx(xm,{task:a},a.id))})]}):null}function ID(){const{features:e,phases:a,activeTasks:r}=gr(),{project:s,taskFocus:u}=ks("root"),c=v.useMemo(()=>new Set((u.pendingResume??[]).map(E=>E.id)),[u.pendingResume]),[d,h]=v.useState(null),p=v.useMemo(()=>new Set((d==null?void 0:d.taskIds)??[]),[d]),g=Mr(),y=()=>g("/project/edit");_n("edit",y);const x=s.projectRoot||s.planRoot||s.name||"default";return o.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[o.jsxs($t,{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(Ze,{type:"button",shortcut:"edit",onClick:y,className:"shrink-0",children:[o.jsx(Fl,{className:"h-4 w-4"}),"Edit project"]})]}),s.goal?o.jsx(Mn,{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($2,{project:s}),o.jsx(tk,{features:e,phases:a}),o.jsx(wk,{phases:a,activeDrilldown:d,onDrilldown:h,onClearDrilldown:()=>h(null)}),o.jsx(BD,{tasks:u.pendingResume}),o.jsx(UD,{features:e,phases:a,activeTasks:r,projectStorageScope:x,resumeRequiredIds:c,analyticsFilter:d?{label:d.label,taskIds:p}:null,onClearAnalyticsFilter:()=>h(null)}),o.jsx(H2,{features:e,phases:a}),o.jsx(P2,{features:e,phases:a})]})}async function HD(){const[e,a]=await Promise.all([Vm(),gd()]);return{features:e,phases:a}}function Qo(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function rd(e){const a=[];return e.active&&a.push(`${e.active} active`),e.planned&&a.push(`${e.planned} planned`),e.done&&a.push(`${e.done} done`),e.blocked&&a.push(`${e.blocked} blocked`),e.canceled&&a.push(`${e.canceled} canceled`),a.join(" · ")}function qD(e){const a=Qo();for(const r of e){if(r.status==="in-progress"||r.status==="discovery"){a.active+=1;continue}if(r.status==="planned"||r.status==="draft"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function Dw(e){const a=Qo();for(const r of e){if(r.status==="in-progress"){a.active+=1;continue}if(r.status==="planned"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function PD(e){const a=Qo();for(const r of e){if(r.status==="in-progress"){a.active+=1;continue}if(r.status==="planned"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function FD({feature:e,phases:a,phasesCount:r,tasksCount:s,phaseSummary:u,taskSummary:c,activity:d}){var L;const h=Pl(),p=Pl(),y=((L=h.formData)==null?void 0:L.get("status"))??e.status,x=h.state!=="idle",E=p.state!=="idle",S=rd(u),w=rd(c),j=q0(a??[]),R=e.description||(d?`${d.doneTasks}/${s} done · ${d.remainingTasks} left${d.blockedTasks?` · ${d.blockedTasks} blocked`:""}`:"");return o.jsxs(Ti,{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(nr,{featureNum:e.number,featureId:e.id}),o.jsx(rr,{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(bd,{priority:e.priority}),o.jsx("span",{className:"shrink-0",children:o.jsx(rc,{status:j.displayStatus,breakdown:j.breakdown})})]}),o.jsx(Ye,{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(Ye,{to:`/features/${e.id}/edit`,"aria-label":`Edit feature ${e.name}`,children:o.jsx(Ze,{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(Fl,{className:"h-3.5 w-3.5"})})}),o.jsx(p.Form,{method:"post",action:`/features/${e.id}/delete`,onSubmit:B=>{window.confirm(`Delete feature “${e.name}”? This cannot be undone.`)||B.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"danger",disabled:E||x,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${e.name}`,children:o.jsx(Ns,{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:!0,"aria-disabled":"true",title:"Feature status is derived from child phases and tasks.",className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",children:Rd.map(B=>o.jsx("option",{value:B.value,children:B.label},B.value))}),o.jsx(Ts,{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(Ye,{to:`/features/${e.id}/edit`,"aria-label":`Edit feature ${e.name}`,className:"hidden xl:block",children:o.jsx(Ze,{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(Fl,{className:"h-3.5 w-3.5"})})}),o.jsx(p.Form,{method:"post",action:`/features/${e.id}/delete`,className:"hidden xl:block",onSubmit:B=>{window.confirm(`Delete feature “${e.name}”? This cannot be undone.`)||B.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"danger",disabled:E||x,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${e.name}`,children:o.jsx(Ns,{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 VD={feature:{label:"Feature",Icon:Po},phase:{label:"Phase",Icon:x0},task:{label:"Task",Icon:nc},requirement:{label:"Requirement",Icon:S0}};function Cw({kind:e,label:a}){const{Icon:r,label:s}=VD[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:a??s})]})}function On({className:e="",...a}){return o.jsx("input",{className:`field-control ${e}`,...a})}function Yl({className:e="",...a}){return o.jsx("select",{className:`field-control ${e}`,...a})}function Ow({query:e,status:a,statusOptions:r,placeholder:s,clearTo:u,resultsLabel:c}){const d=Im(),h=((r==null?void 0:r.length)??0)>0;return o.jsxs(dn,{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(On,{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=>d(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(Yl,{id:"list-filter-status",name:"status",defaultValue:a,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(Ts,{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(Ze,{type:"submit",variant:"secondary",children:"Apply filters"}),o.jsx(Ye,{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 Mw(e,a,r){return a.status&&e.status!==a.status?!1:a.onlyActive?r.includes(e.status):!(a.hideDone&&e.status==="done"||a.hidePlanned&&e.status==="planned")}function Td(e,a){const r=e.trim().toLowerCase();return r?a.some(s=>s==null?void 0:s.toLowerCase().includes(r)):!0}function YD(e){const a=new Map;for(const d of e)d.featureId&&a.set(d.featureId,[...a.get(d.featureId)??[],d]);const r=new Map,s=new Map,u=new Map,c=new Map;for(const[d,h]of a)r.set(d,h.length),s.set(d,h.reduce((p,g)=>p+g.tasks.length,0)),u.set(d,qD(h)),c.set(d,Dw(h.flatMap(p=>p.tasks)));return{phasesByFeature:a,phasesCountByFeature:r,tasksCountByFeature:s,phaseSummaryByFeature:u,taskSummaryByFeature:c}}function GD(){var S,w;const{features:e,phases:a}=gr(),{phasesByFeature:r,phasesCountByFeature:s,tasksCountByFeature:u,phaseSummaryByFeature:c,taskSummaryByFeature:d}=YD(a),h=Mr(),[p]=tc(),g=((S=p.get("q"))==null?void 0:S.trim())??"",y=((w=p.get("status"))==null?void 0:w.trim())??"",x=v.useCallback(()=>h("new"),[h]);_n("create",x);const E=v.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($t,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{children:[o.jsx(Cw,{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(Ye,{to:"new",children:o.jsx(Ze,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),o.jsx(Ow,{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($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",o.jsx(Ye,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):E.length>0?E.map(j=>o.jsx(FD,{feature:j,phases:r.get(j.id),phasesCount:s.get(j.id)??0,tasksCount:u.get(j.id)??0,phaseSummary:c.get(j.id)??Qo(),taskSummary:d.get(j.id)??Qo()},j.id)):o.jsx($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),o.jsx(Ni,{})]})}async function XD(){const[e,a]=await Promise.all([Ym(),gd()]);return{requirements:e,phases:a}}function QD(e,a){const r=new Set(a.map(c=>c.id)),s=a.map(c=>({phase:c,requirements:e.filter(d=>d.linkedPhaseIds.includes(c.id))})).filter(c=>c.requirements.length>0).sort((c,d)=>c.phase.priority-d.phase.priority||c.phase.number-d.phase.number),u=e.filter(c=>!c.linkedPhaseIds.some(d=>r.has(d)));return{phaseGroups:s,unlinkedRequirements:u}}function Sb(e){return`P${String(e.number??0).padStart(3,"0")}`}function Eb({requirement:e}){return o.jsx($t,{className:"overflow-hidden p-0",children:o.jsx(Hn,{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(Ye,{to:`${e.id}/edit`,children:o.jsx(Ze,{type:"button",variant:"secondary",children:"Edit"})}),o.jsx(dn,{method:"post",action:`/requirements/${e.id}/delete`,onSubmit:a=>{window.confirm(`Delete requirement "${e.title}"?`)||a.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"danger",children:"Delete"})})]})]})})})}function KD(){var y;const{requirements:e,phases:a}=gr(),r=Mr(),[s]=tc(),u=((y=s.get("q"))==null?void 0:y.trim())??"",c=v.useCallback(()=>r("new"),[r]);_n("create",c);const d=v.useMemo(()=>new Map(a.map(x=>[x.id,x])),[a]),h=v.useMemo(()=>e.filter(x=>{const E=x.linkedPhaseIds.map(S=>{const w=d.get(S);return w?`${Sb(w)} ${w.title} ${w.summary}`:S});return Td(u,[x.title,x.description,x.id,...E])}),[e,d,u]),{phaseGroups:p,unlinkedRequirements:g}=v.useMemo(()=>QD(h,a),[h,a]);return v.useEffect(()=>{const x=window.location.hash.slice(1);x&&requestAnimationFrame(()=>{var E;return(E=document.getElementById(x))==null?void 0:E.scrollIntoView({block:"start"})})},[p]),o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-8",children:[o.jsxs($t,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{children:[o.jsx(Cw,{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(Ye,{to:"new",children:o.jsx(Ze,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),o.jsx(Ow,{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($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",o.jsx(Ye,{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:x,requirements:E})=>{const S=x.featureId?`/features/${x.featureId}/phases/${x.id}`:"/features";return o.jsxs("section",{id:`phase-${x.id}`,className:"scroll-mt-28","aria-labelledby":`phase-${x.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(Ye,{id:`phase-${x.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:[Sb(x)," — ",x.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(Eb,{requirement:w},w.id))})]},x.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(x=>o.jsx(Eb,{requirement:x},x.id))})]}):null]}):o.jsx($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),o.jsx(Ni,{})]})}async function ZD(){return{ideas:await MR()}}async function WD({request:e}){const a=await e.formData(),r=String(a.get("intent")??""),s=String(a.get("id")??""),u=String(a.get("title")??"").trim(),c=String(a.get("description")??"").trim();if(r==="create"){if(!u)throw new Response("Idea title is required.",{status:400});await _R({title:u,description:c})}else if(r==="update"){if(!s||!u)throw new Response("Idea id and title are required.",{status:400});await LR({id:s,title:u,description:c})}else if(r==="delete"){if(!s)throw new Response("Idea id is required.",{status:400});await zR(s)}else throw new Response("Unknown Ideas action.",{status:400});return{ok:!0}}function JD({idea:e,onClose:a}){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&&a()},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(dn,{method:"post",className:"mt-4 space-y-4",onSubmit:a,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:a,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 eC({idea:e}){const a=Pl();return o.jsxs(a.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(Ns,{className:"h-4 w-4"})})]})}function tC(){const{ideas:e}=gr(),[a,r]=v.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(y0,{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(oR,{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:"min-w-0",children:o.jsx(Hn,{defaultOpen:!1,className:"surface-card mt-0 rounded-2xl",summaryClassName:"hover:bg-[var(--surface-hover)]/60 focus-visible:bg-[var(--surface-hover)]/60",title:o.jsxs(o.Fragment,{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 font-normal text-[var(--text-muted)]",children:s.shortId}),s.promotion?s.targetHref?o.jsxs(Ye,{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:"break-words text-base font-bold",children:s.title})]}),actions:o.jsxs("div",{className:"flex gap-2",onClick:u=>u.stopPropagation(),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(Fl,{className:"h-4 w-4"})}),o.jsx(eC,{idea:s})]}),children:s.description?o.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-[var(--text-muted)]",children:s.description}):o.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"No description provided."})})},s.id))}),a?o.jsx(JD,{...a==="new"?{}:{idea:a},onClose:()=>r(null)}):null]})}async function nC({params:e}){const a=e.featureId;if(!a)throw new Response("featureId required",{status:400});const[r,s]=await Promise.all([ac(a),gd(a)]);return{feature:r,phases:s}}function aC({featureId:e,feature:a,phase:r}){var x,E;const s=Pl(),u=Pl(),d=((x=s.formData)==null?void 0:x.get("status"))??r.status,h=s.state!=="idle",p=u.state!=="idle",g=rd(Dw(r.tasks)),y=P0(r.tasks);return o.jsxs(Ti,{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(nr,{featureNum:a.number,phaseNum:r.number,featureId:a.id,phaseId:r.id}),o.jsx(rr,{id:cl({featureNum:a.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(bd,{priority:r.priority}),r.handoff?o.jsx(Xm,{phaseId:r.id,updatedAt:r.handoffUpdatedAt}):null,o.jsx(Nw,{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(rc,{status:y.displayStatus,breakdown:y.breakdown})})]}),o.jsx(Ye,{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(Ye,{to:`/features/${e}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,children:o.jsx(Ze,{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(Fl,{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(Ze,{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(Ns,{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:d,disabled:!0,"aria-disabled":"true",title:"Phase status is derived from child tasks.",className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",children:kd.map(S=>o.jsx("option",{value:S.value,children:S.label},S.value))}),o.jsx(Ts,{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(Ye,{to:`/features/${e}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,className:"hidden lg:block",children:o.jsx(Ze,{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(Fl,{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(Ze,{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(Ns,{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 pp({items:e,className:a="",stacked:r=!1}){return r?o.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${a}`,children:e.map((s,u)=>{const c=u===e.length-1,d=s.to&&!c?o.jsx(Ye,{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:d})]},`${s.label}-${u}`)})}):o.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:e.map((s,u)=>{const c=u===e.length-1,d=s.to&&!c?o.jsx(Ye,{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:d})]},`${s.label}-${u}`)})})}function gp({featureNum:e,phaseNum:a,taskNum:r,featureId:s,phaseId:u,taskId:c,shortId:d,children:h}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2","data-testid":"detail-entity-bar",children:[o.jsx(nr,{featureNum:e,phaseNum:a,taskNum:r,featureId:s,phaseId:u,taskId:c}),o.jsx(rr,{id:cl({featureNum:e,phaseNum:a,taskNum:r}),children:o.jsx("span",{className:"sr-only",children:"Copy path"})}),d?o.jsx(ul,{shortId:d}):null,h]})}function rC(...e){return e.filter(Boolean).join(" ")}function vp({items:e,label:a="Entity summary"}){const r=e.filter(s=>s.visible!==!1);return r.length===0?null:o.jsx("div",{className:"detail-metrics-row","aria-label":a,children:r.map(s=>o.jsxs("div",{className:rC("detail-metric",s.wide&&"detail-metric--wide"),children:[o.jsx("span",{className:"detail-metric-label",children:s.label}),o.jsx("span",{className:"detail-metric-value",children:s.value})]},s.label))})}const lC={feature:{label:"Feature",icon:Po},phase:{label:"Phase",icon:x0},task:{label:"Task",icon:mR}};function xp({kind:e,title:a,reference:r,subtitle:s}){const u=v.useId(),{label:c,icon:d}=lC[e];return v.useEffect(()=>{const h=document.title;return document.title=`${c} ${r} · ${a}`,()=>{document.title=h}},[c,r,a]),o.jsxs("section",{className:`entity-detail-identity entity-detail-identity--${e}`,"aria-labelledby":u,children:[o.jsxs("p",{className:"entity-detail-kind","data-entity-kind":e,children:[o.jsx(d,{className:"h-5 w-5","aria-hidden":"true"}),o.jsx("span",{children:c})]}),o.jsx("h1",{id:u,className:"entity-detail-title",children:a}),s?o.jsx("p",{className:"entity-detail-subtitle",children:s}):null]})}const sC=250;function zu(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 _w({entityKind:e,statusOptions:a,value:r,onChange:s,sortSlot:u}){const[c,d]=v.useState(r.query),h=v.useRef(null),p=v.useRef(r);p.current=r,v.useEffect(()=>{d(r.query)},[r.query]),v.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})},sC)},y=j=>{d(j),g(j)},x=j=>{s({...p.current,[j]:!p.current[j]})},E=j=>{s({...p.current,status:j})},S=()=>{h.current!==null&&window.clearTimeout(h.current),d(""),s({query:"",status:"",hideDone:!1,hidePlanned:!1,onlyActive:!1})},w=((a==null?void 0:a.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(On,{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(Yl,{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"}),a==null?void 0:a.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:()=>x("hideDone"),className:zu(r.hideDone),children:"Hide Done"}),o.jsx("button",{type:"button",onClick:()=>x("hidePlanned"),className:zu(r.hidePlanned),children:"Hide Planned"}),o.jsx("button",{type:"button",onClick:()=>x("onlyActive"),className:zu(r.onlyActive),children:"Only active"}),o.jsx("button",{type:"button",onClick:S,className:zu(!1),children:"Clear"})]})]})]})}const iC={draft:Aj,discovery:fR,planned:nc,"in-progress":v0,done:Hm,blocked:b0,waiting:qm,deferred:xR,canceled:p0,rejected:Cj};function sm(e){return e.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Nb(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}const oC=new Set(["canceled","rejected"]);function yp({statusLog:e,currentStatus:a,backbone:r,createdAt:s,updatedAt:u,startedAt:c,completedAt:d}){const h=[];if(e.length===0){const w=r.indexOf(a);if(w>=0)for(let j=0;j<=w;j++)h.push(r[j]);else h.push(a)}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]!==a&&h.push(a);const p=new Set(h),g=a==="done"||oC.has(a),y=w=>{var R,L;if(e.length>0){if(w===((R=e[0])==null?void 0:R.fromStatus))return((L=e[0])==null?void 0:L.date)??"";for(const B of e)if(B.toStatus===w)return B.date;return""}const j=r[0];return w===j?s??"":w==="in-progress"?c??u??"":w==="done"?d??u??"":""},x=[...h];if(!g){const w=r.indexOf(a);if(w>=0&&w+1<r.length){const j=r[w+1];p.has(j)||x.push(j)}}const E=e.length===0?x.filter((w,j)=>j===0||w===a||!!y(w)):x,S=w=>p.has(w)?w===a&&!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),L=iC[w]??hd,B=p.has(w),I=y(w),F=I?`${sm(w)} — ${Nb(I)}`:sm(w),W=j===0?null:B?"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:[W?o.jsx("span",{className:`status-connector status-connector--${W}`,"aria-hidden":"true"}):null,o.jsx("span",{className:"status-node",title:F,children:o.jsx(L,{className:"status-node-icon"})}),o.jsx("span",{className:"status-step-label",children:sm(w)}),I?o.jsx("span",{className:"status-step-date",children:Nb(I)}):null]},`${w}-${j}`)})})}function jb(e){return e.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function cC(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}function uC(e,a,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(a);if(c<0)return[];const d=[];for(let h=1;h<=c;h++){const p=r[h-1],g=r[h],y=g==="in-progress"?s??"":g==="done"?u??"":"";d.push({date:y,fromStatus:p,toStatus:g,motivation:"",inferred:!0})}return d}function bp({statusLog:e,currentStatus:a,backbone:r,startedAt:s,completedAt:u}){const c=uC(e??[],a??"",r??[],s,u);return o.jsx(Hn,{title:"Status history",count:c.length,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((d,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:cC(d.date)}),o.jsx("td",{className:"px-2 py-2 align-top font-semibold text-[var(--text-muted)] whitespace-nowrap",children:jb(d.fromStatus)}),o.jsx("td",{className:"px-2 py-2 align-top font-semibold text-[var(--text)] whitespace-nowrap",children:jb(d.toStatus)}),o.jsx("td",{className:"px-2 py-2 align-top text-[var(--text-muted)] whitespace-pre-wrap [overflow-wrap:anywhere]",children:d.motivation||"—"})]},h))})]})})})}function dC(e){return e.reduce((a,r)=>a+r.tasks.length,0)}function fC(e){let a=0,r=0,s=0,u=0;for(const c of e)for(const d of c.tasks)d.status==="in-progress"&&(a+=1),d.status==="done"&&(r+=1),d.status==="blocked"&&(s+=1),["done","canceled"].includes(d.status)||(u+=1);return{inProgress:a,done:r,blocked:s,remaining:u}}function hC(e){return e.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function mC(){var W,ne;const{feature:e,phases:a}=gr(),r=e.acceptedDecisions??[],s=dC(a),u=fC(a),c=hC(a),d=q0(a),[h,p]=tc(),g=((W=h.get("sort"))==null?void 0:W.trim())??"priority",y=((ne=h.get("dir"))==null?void 0:ne.trim())??"asc",[x,E]=v.useState(()=>{var _,T;return{query:((_=h.get("q"))==null?void 0:_.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"}});v.useEffect(()=>{up(_=>{const T=(de,ge,be="1")=>{ge?_.set(de,be):_.delete(de)};T("q",x.query.trim()!=="",x.query.trim()),T("status",x.status!=="",x.status),T("hideDone",x.hideDone),T("hidePlanned",x.hidePlanned),T("onlyActive",x.onlyActive)})},[x]);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=v.useMemo(()=>[...a].sort((_,T)=>_o(_,T,S.key,S.direction)),[a,S]),j=v.useMemo(()=>w.filter(_=>Mw(_,x,["in-progress","discovery"])&&Td(x.query,[_.title,String(_.number),_.shortId])),[w,x]),R=Mr(),L=v.useRef(null),B=v.useCallback(()=>R("edit"),[R]),I=v.useCallback(()=>R("phases/new"),[R]),F=v.useCallback(()=>{var _;(_=L.current)==null||_.requestSubmit()},[]);return _n("edit",B),_n("create",I),_n("delete",F),o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ye,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(fd,{className:"h-4 w-4"})," Back to features"]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx(pp,{stacked:!0,items:[{label:e.name,kind:"Feature"}]}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:o.jsx(gp,{featureNum:e.number,featureId:e.id,shortId:e.shortId,children:o.jsx(rc,{status:d.displayStatus,breakdown:d.breakdown})})}),o.jsx(xp,{kind:"feature",title:e.name,reference:`F${String(e.number).padStart(3,"0")}`}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[o.jsx(Ye,{to:"edit",children:o.jsx(Ze,{type:"button",shortcut:"edit",children:"Edit feature"})}),o.jsx(dn,{ref:L,method:"post",action:`/features/${e.id}/delete`,className:"inline-flex",onSubmit:_=>{window.confirm(`Delete feature "${e.name}"?`)||_.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]}),e.description?o.jsx("div",{className:"mt-4",children:o.jsx(Hn,{title:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Description"}),o.jsx(dl,{value:e.descriptionUpdatedAt})]}),children:o.jsx(Mn,{text:e.description,className:"plan-description max-w-4xl"})})}):null,o.jsx("div",{className:"mt-4",children:o.jsx(yp,{statusLog:e.statusLog??[],currentStatus:e.status,backbone:["planned","in-progress","done"],createdAt:e.createdAt,updatedAt:e.updatedAt})})]}),o.jsxs($t,{className:"grid gap-3",children:[o.jsx(bp,{statusLog:e.statusLog??[],currentStatus:e.status,backbone:["planned","in-progress","done"]}),o.jsx(yd,{decisions:r,targetType:"feature",targetRef:e.id})]}),o.jsxs($t,{className:"grid gap-4",children:[o.jsx(vp,{label:"Feature metrics",items:[{label:"Current phase",value:(c==null?void 0:c.title)||"No active phase",wide:!0},{label:"Phases",value:a.length},{label:"Tasks",value:s},{label:"Active",value:u.inProgress},{label:"Remaining",value:u.remaining},{label:"Done",value:u.done},{label:"Blocked",value:u.blocked},{label:"Priority",value:`P${e.priority}`},{label:"Updated",value:ol(e.updatedAt),visible:!!e.updatedAt},{label:"Timeline",value:`${e.startDate||"Not set"} → ${e.endDate||"Not set"}`,visible:!!(e.startDate||e.endDate),wide:!0}]}),e.workDone||e.workRemaining?o.jsx(Hn,{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(Mn,{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(Mn,{text:e.workRemaining,className:"mt-2"})]}):null]})}):null]}),o.jsxs($t,{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 (",a.length,")"]}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this feature's phases."})]}),o.jsx(Ye,{to:"phases/new",children:o.jsx(Ze,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),o.jsx(_w,{entityKind:"phase",statusOptions:kd,value:x,onChange:E,sortSlot:o.jsx(op,{sort:S,onChange:_=>p(T=>(T.set("sort",_.key),T.set("dir",_.direction),T))})}),o.jsx("div",{className:"grid gap-3",children:a.length===0?o.jsxs($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",o.jsx(Ye,{to:`/features/${e.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):j.length>0?j.map(_=>o.jsx(aC,{featureId:e.id,feature:e,phase:_},_.id)):o.jsx($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),o.jsx(Ni,{})]})}async function pC({params:e}){const{featureId:a,phaseId:r}=e;if(!a||!r)throw new Response("featureId and phaseId required",{status:400});const[s,u,c,d]=await Promise.all([ac(a),Vm(),vd(r),Ym()]),h=d.filter(p=>p.linkedPhaseIds.includes(r));return{feature:s,features:u,phase:{...c,linkedRequirements:h}}}function gC({featureId:e,featureNum:a,phaseId:r,phaseNum:s,task:u}){var S;const c=Pl(),d=Pl(),p=((S=c.formData)==null?void 0:S.get("status"))??u.status,g=c.state!=="idle",y=d.state!=="idle",x=rd(PD(u.subtasks)),E=O0(p);return o.jsxs(Ti,{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(nr,{featureNum:a,phaseNum:s,taskNum:u.number,featureId:e,phaseId:r,taskId:u.id}),o.jsx(rr,{id:cl({featureNum:a,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(fr,{status:p})})]}),o.jsx(Ye,{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(Ye,{to:`/features/${e}/phases/${r}/tasks/${u.id}/edit`,"aria-label":`Edit task ${u.title}`,children:o.jsx(Ze,{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(Fl,{className:"h-3.5 w-3.5"})})}),o.jsx(d.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(Ze,{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(Ns,{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"]}),x?o.jsx("div",{className:"mt-0.5 break-words",children:x}):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:ad.map(w=>o.jsx("option",{value:w.value,children:w.label},w.value))}),o.jsx(Ts,{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(Ye,{to:`/features/${e}/phases/${r}/tasks/${u.id}/edit`,"aria-label":`Edit task ${u.title}`,className:"hidden lg:block",children:o.jsx(Ze,{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(Fl,{className:"h-3.5 w-3.5"})})}),o.jsx(d.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(Ze,{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(Ns,{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 vC(e){let a=0,r=0,s=0,u=0;for(const c of e.tasks)c.status==="in-progress"&&(a+=1),c.status==="done"&&(r+=1),c.status==="blocked"&&(s+=1),["done","canceled"].includes(c.status)||(u+=1);return{inProgress:a,done:r,blocked:s,remaining:u}}function xC(){var ge,be;const{feature:e,phase:a}=gr(),r=a.decisions??[],s=a.acceptedDecisions??[],u=a.linkedRequirements??[],c=vC(a),d=P0(a.tasks),[h,p]=tc(),g=((ge=h.get("sort"))==null?void 0:ge.trim())??"priority",y=((be=h.get("dir"))==null?void 0:be.trim())??"asc",[x,E]=v.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"}});v.useEffect(()=>{up(re=>{const je=(Te,J,$="1")=>{J?re.set(Te,$):re.delete(Te)};je("q",x.query.trim()!=="",x.query.trim()),je("status",x.status!=="",x.status),je("hideDone",x.hideDone),je("hidePlanned",x.hidePlanned),je("onlyActive",x.onlyActive)})},[x]);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=v.useMemo(()=>[...a.tasks].sort((re,je)=>_o(re,je,S.key,S.direction)),[a.tasks,S]),j=v.useMemo(()=>w.filter(re=>Mw(re,x,["in-progress"])&&Td(x.query,[re.title,String(re.number),re.shortId])),[w,x]),R=Mr(),L=v.useRef(null),[B,I]=v.useState(a.handoff??""),[F,W]=v.useState(!1),ne=v.useCallback(()=>R("edit"),[R]),_=v.useCallback(()=>R("tasks/new"),[R]),T=v.useCallback(()=>{var re;(re=L.current)==null||re.requestSubmit()},[]),de=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){W(!0);try{await k0(a.id),I("")}catch{}finally{W(!1)}}},[a.id]);return _n("edit",ne),_n("create",_),_n("delete",T),o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ye,{to:`/features/${e.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(fd,{className:"h-4 w-4"})," Back to feature"]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx(pp,{stacked:!0,items:[{label:e.name,to:`/features/${e.id}`,kind:"Feature"},{label:a.title,kind:"Phase"}]}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:o.jsxs(gp,{featureNum:e.number,phaseNum:a.number,featureId:e.id,phaseId:a.id,shortId:a.shortId,children:[B?o.jsx(Xm,{phaseId:a.id,updatedAt:a.handoffUpdatedAt}):null,o.jsx(rc,{status:d.displayStatus,breakdown:d.breakdown})]})}),o.jsx(xp,{kind:"phase",title:a.title,reference:`P${String(a.number).padStart(3,"0")}`,subtitle:a.summary}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[o.jsx(Ye,{to:"edit",children:o.jsx(Ze,{type:"button",shortcut:"edit",children:"Edit phase"})}),o.jsx(dn,{ref:L,method:"post",action:`/features/${e.id}/phases/${a.id}/delete`,className:"inline-flex",onSubmit:re=>{window.confirm(`Delete phase "${a.title}"?`)||re.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]}),a.description?o.jsx("div",{className:"mt-4",children:o.jsx(Hn,{title:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Description"}),o.jsx(dl,{value:a.descriptionUpdatedAt})]}),children:o.jsx(Mn,{text:a.description,className:"plan-description"})})}):null,o.jsx("div",{className:"mt-4",children:o.jsx(yp,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:a.createdAt,updatedAt:a.updatedAt})})]}),o.jsxs($t,{className:"grid gap-3",children:[o.jsx(bp,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"]}),o.jsx(yd,{decisions:s,targetType:"phase",targetRef:a.id})]}),o.jsxs($t,{className:"grid gap-4",children:[o.jsx(vp,{label:"Phase metrics",items:[{label:"Tasks",value:a.tasks.length},{label:"Active",value:c.inProgress},{label:"Remaining",value:c.remaining},{label:"Done",value:c.done},{label:"Blocked",value:c.blocked},{label:"Goals",value:a.goals.length},{label:"Dependencies",value:a.dependencies.length},{label:"Criteria",value:a.completionCriteria.length},{label:"Requirements",value:u.length},{label:"Risks",value:a.risks.length},{label:"Questions",value:a.openQuestions.length},{label:"Priority",value:`P${a.priority}`},{label:"Updated",value:ol(a.updatedAt),visible:!!a.updatedAt}]}),a.notes?o.jsx(Hn,{title:"Notes",defaultOpen:!1,children:o.jsx(Mn,{text:a.notes,className:"plan-description"})}):null,o.jsx(Hn,{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:[re.macroTasks.length>0?o.jsx("div",{className:"flex flex-wrap items-center gap-2",children: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(Ye,{to:`/requirements#phase-${a.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."})}),r.length>0?o.jsx(Hn,{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(Mn,{text:re})},je))})}):null]}),B?o.jsx($t,{className:"grid gap-4",children:o.jsx(Hn,{title:"Handoff",actions:o.jsx("button",{type:"button",onClick:de,disabled:F,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:F?"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(Mn,{text:B,className:"formatted-text max-w-none"})})})}):null,o.jsxs($t,{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 (",a.tasks.length,")"]}),o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this phase's tasks."})]}),o.jsx(Ye,{to:"tasks/new",children:o.jsx(Ze,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})})]}),o.jsx(_w,{entityKind:"task",statusOptions:cp,value:x,onChange:E,sortSlot:o.jsx(op,{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:a.tasks.length===0?o.jsxs($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",o.jsx(Ye,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):j.length>0?j.map(re=>o.jsx(gC,{featureId:e.id,featureNum:e.number,phaseId:a.id,phaseNum:a.number,task:re},re.id)):o.jsx($t,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),o.jsx(Ni,{})]})}async function yC({params:e}){const{featureId:a,phaseId:r,taskId:s}=e;if(!a||!r||!s)throw new Response("featureId, phaseId and taskId required",{status:400});const[u,c,d,h]=await Promise.all([ac(a),vd(r),xd(s),Fm()]),p=d.status!=="done"&&d.status!=="canceled"&&d.status!=="rejected"&&(!!d.pauseSnapshot||h.workDeviations.some(g=>g.resumeTaskId===d.id&&(g.state==="resume-required"||g.state==="resolved")));return{feature:u,phase:c,task:d,pendingResume:p}}function bC({snapshot:e,pendingResume:a=!1}){const r=v.useId(),s=a?w0:qm;return o.jsxs("section",{"aria-labelledby":r,"aria-live":a?"polite":void 0,className:`rounded-[14px] border px-4 py-3 ${a?"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 wC({featureId:e,phaseId:a,taskId:r,item:s}){const u=Pl(),c=u.formData?u.formData.get("checked")==="true":s.checked,d=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/${a}/tasks/${r}/checklist/${s.id}/toggle`}),disabled:d,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 SC(){var E,S,w,j,R,L;const{feature:e,phase:a,task:r,pendingResume:s}=gr(),u=r.status==="planned"||r.status==="waiting",c=r.decisions??[],d=r.acceptedDecisions??[],h=r.checklist??[],p=Mr(),g=v.useRef(null),y=v.useCallback(()=>p("edit"),[p]),x=v.useCallback(()=>{var B;(B=g.current)==null||B.requestSubmit()},[]);return _n("edit",y),_n("delete",x),o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ye,{to:`/features/${e.id}/phases/${a.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(fd,{className:"h-4 w-4"})," Back to phase"]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx(pp,{stacked:!0,items:[{label:e.name,to:`/features/${e.id}`,kind:"Feature"},{label:a.title,to:`/features/${e.id}/phases/${a.id}`,kind:"Phase"},{label:r.title,kind:"Task"}]}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:o.jsx(gp,{featureNum:e.number,phaseNum:a.number,taskNum:r.number,featureId:e.id,phaseId:a.id,taskId:r.id,shortId:r.shortId,children:o.jsx(fr,{status:r.status})})}),o.jsx(xp,{kind:"task",title:r.title,reference:`T${String(r.number).padStart(3,"0")}`}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[u?o.jsx(dn,{method:"post",action:`/features/${e.id}/phases/${a.id}/tasks/${r.id}/start`,className:"inline-flex",children:o.jsx(Ze,{type:"submit",variant:"primary",children:r.pauseSnapshot||s?"Resume task":"Start task"})}):null,r.status==="done"?o.jsx(dn,{method:"post",action:`/features/${e.id}/phases/${a.id}/tasks/${r.id}/reopen`,className:"inline-flex",onSubmit:B=>{window.confirm(`Reopen task “${r.title}”? Its completion history will be retained.`)||B.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"primary",children:"Reopen task"})}):null,o.jsx(Ye,{to:"edit",children:o.jsx(Ze,{type:"button",shortcut:"edit",children:"Edit task"})}),o.jsx(dn,{ref:g,method:"post",action:`/features/${e.id}/phases/${a.id}/tasks/${r.id}/delete`,className:"inline-flex",onSubmit:B=>{window.confirm(`Delete task "${r.title}"?`)||B.preventDefault()},children:o.jsx(Ze,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]}),r.description?o.jsx("div",{className:"mt-4",children:o.jsx(Hn,{title:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Description"}),o.jsx(dl,{value:r.descriptionUpdatedAt})]}),children:o.jsx(Mn,{text:r.description,className:"plan-description"})})}):null,o.jsx("div",{className:"mt-4",children:o.jsx(yp,{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(bC,{snapshot:r.pauseSnapshot,pendingResume:s}):null,o.jsxs($t,{className:"grid gap-3",children:[o.jsx(bp,{statusLog:r.statusLog??[],currentStatus:r.status,backbone:["planned","in-progress","done"],startedAt:r.startedAt,completedAt:r.completedAt}),o.jsx(yd,{decisions:d,targetType:"task",targetRef:r.id})]}),o.jsxs($t,{className:"grid gap-4",children:[o.jsx(vp,{label:"Task metrics",items:[{label:"Steps",value:h.length},{label:"Subtasks",value:((E=r.subtasks)==null?void 0:E.length)??0},{label:"Dependencies",value:((S=r.dependsOn)==null?void 0:S.length)??0},{label:"Priority",value:`P${r.priority}`},{label:"Short name",value:r.shortName,visible:!!r.shortName,wide:!0},{label:"Started",value:ol(r.startedAt),visible:!!r.startedAt,wide:!0},{label:"Completed",value:ol(r.completedAt),visible:!!r.completedAt,wide:!0},{label:"Updated",value:ol(r.updatedAt),visible:!!r.updatedAt,wide:!0}]}),r.notes?o.jsx(Hn,{title:"Notes",defaultOpen:!1,children:o.jsx(Mn,{text:r.notes})}):null,c.length>0?o.jsx(Hn,{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((B,I)=>o.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:o.jsx(Mn,{text:B})},I))})}):null,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(B=>o.jsx(wC,{featureId:e.id,phaseId:a.id,taskId:r.id,item:B},B.id))}):o.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),o.jsxs(Hn,{title:"Dependencies",count:((w=r.dependsOn)==null?void 0:w.length)??0,defaultOpen:!1,contentClassName:"grid gap-2",children:[(j=r.dependsOn)==null?void 0:j.map(B=>o.jsx("p",{className:"surface-card px-4 py-3 text-sm font-mono text-[var(--text)]",children:B},B)),o.jsxs(dn,{method:"post",action:"dependencies/add",className:"flex gap-2 rounded-xl border border-dashed border-[var(--border-strong)] p-3",children:[o.jsx("input",{name:"dependsOn",required:!0,placeholder:"Task ref or ID","aria-label":"Dependency task",className:"h-9 min-w-0 flex-1 rounded-lg border border-[var(--border-strong)] bg-[var(--surface)] px-3 text-sm text-[var(--text)]"}),o.jsx(Ze,{type:"submit",className:"h-9",children:"Add dependency"})]})]}),o.jsxs(Hn,{title:"Subtasks",count:((R=r.subtasks)==null?void 0:R.length)??0,defaultOpen:!1,contentClassName:"grid gap-2",children:[(L=r.subtasks)==null?void 0:L.map(B=>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:B.title}),o.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:B.description||B.id})]}),o.jsx(fr,{status:B.status})]},B.id)),o.jsxs(dn,{method:"post",action:"subtasks/new",className:"grid gap-2 rounded-xl border border-dashed border-[var(--border-strong)] p-3 sm:grid-cols-[1fr_1fr_auto]",children:[o.jsx("input",{name:"title",required:!0,placeholder:"New subtask title","aria-label":"New subtask title",className:"h-9 rounded-lg border border-[var(--border-strong)] bg-[var(--surface)] px-3 text-sm text-[var(--text)]"}),o.jsx("input",{name:"description",placeholder:"Description (optional)","aria-label":"New subtask description",className:"h-9 rounded-lg border border-[var(--border-strong)] bg-[var(--surface)] px-3 text-sm text-[var(--text)]"}),o.jsx(Ze,{type:"submit",className:"h-9",children:"Add subtask"})]})]})]}),o.jsx(Ni,{})]})}const EC=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Ql({title:e,description:a,children:r}){const s=Mr(),u=v.useRef(null),c=v.useRef(null);return v.useEffect(()=>{var g;const d=u.current;if(!d)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 x=Array.from(d.querySelectorAll(EC)).filter(j=>j.offsetParent!==null);if(x.length===0){y.preventDefault(),d.focus();return}const E=x[0],S=x[x.length-1],w=document.activeElement;y.shiftKey?(w===E||!d.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}),a?o.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:a}):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(E0,{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:a,...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:a})}function Qe({label:e,children:a}){return o.jsxs("label",{className:"grid gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:e}),a]})}function Wt(e){return o.jsx("textarea",{className:"field-control field-textarea",...e})}function NC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return _n("submit",s,{allowInEditable:!0}),o.jsx(Ql,{title:"Create feature",description:"Top-level container for phases and tasks.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Feature name",children:o.jsx(On,{name:"name",placeholder:"Products page implementation",required:!0})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",placeholder:"Short context for the feature"})}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function jC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var d;return(d=r.current)==null?void 0:d.requestSubmit()},[]);_n("submit",s,{allowInEditable:!0});const c=ks("feature-detail").feature;return o.jsx(Ql,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Name",children:o.jsx(On,{name:"name",defaultValue:c.name,required:!0})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",defaultValue:c.description})}),o.jsx(Qe,{label:"Description reference",children:o.jsx(On,{name:"descriptionRef",defaultValue:c.descriptionRef??"",placeholder:".planner/docs/features/feature-details.md"})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(Qe,{label:"Start date",children:o.jsx(On,{type:"date",name:"startDate",defaultValue:c.startDate})}),o.jsx(Qe,{label:"End date",children:o.jsx(On,{type:"date",name:"endDate",defaultValue:c.endDate})})]}),o.jsx(Qe,{label:"Status",children:o.jsx(Yl,{name:"status",defaultValue:c.status,disabled:!0,title:"Feature status is derived from child phases and tasks.",children:Rd.map(d=>o.jsx("option",{value:d.value,children:d.label},d.value))})}),o.jsx(Qe,{label:"Priority",children:o.jsx(On,{type:"number",name:"priority",defaultValue:c.priority??0,min:0})}),o.jsx(Hn,{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(Qe,{label:"Work done",children:o.jsx(Wt,{name:"workDone",defaultValue:c.workDone})}),o.jsx(Qe,{label:"Work remaining",children:o.jsx(Wt,{name:"workRemaining",defaultValue:c.workRemaining})})]})}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function RC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return _n("submit",s,{allowInEditable:!0}),o.jsx(Ql,{title:"Create phase",description:"A phase belongs to the current feature.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Phase title",children:o.jsx(On,{name:"title",placeholder:"API creation",required:!0})}),o.jsx(Qe,{label:"Summary",children:o.jsx(Wt,{name:"summary",placeholder:"Brief phase summary"})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",placeholder:"Initial implementation notes"})}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function ys(e){return e.join(`
|
|
329
|
+
`)}function kC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var d;return(d=r.current)==null?void 0:d.requestSubmit()},[]);_n("submit",s,{allowInEditable:!0});const u=ks("phase-detail"),c=u.phase;return o.jsx(Ql,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Title",children:o.jsx(On,{name:"title",defaultValue:c.title,required:!0})}),o.jsx(Qe,{label:"Status",children:o.jsx(Yl,{name:"status",defaultValue:c.status,disabled:!0,title:"Phase status is derived from child tasks.",children:kd.map(d=>o.jsx("option",{value:d.value,children:d.label},d.value))})}),o.jsx(Qe,{label:"Feature",children:o.jsx(Yl,{name:"featureId",defaultValue:c.featureId??u.feature.id,required:!0,children:u.features.map(d=>o.jsxs("option",{value:d.id,children:["F",String(d.number).padStart(3,"0")," — ",d.name]},d.id))})}),o.jsx(Qe,{label:"Priority",children:o.jsx(On,{type:"number",name:"priority",defaultValue:c.priority??0,min:0})}),o.jsx(Qe,{label:"Summary",children:o.jsx(Wt,{name:"summary",defaultValue:c.summary})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",defaultValue:c.description})}),o.jsx(Qe,{label:"Description reference",children:o.jsx(On,{name:"descriptionRef",defaultValue:c.descriptionRef??"",placeholder:".planner/docs/phases/phase-details.md"})}),o.jsx(Qe,{label:"Goals (one per line)",children:o.jsx(Wt,{name:"goals",defaultValue:ys(c.goals)})}),o.jsx(Qe,{label:"Non-goals (one per line)",children:o.jsx(Wt,{name:"nonGoals",defaultValue:ys(c.nonGoals)})}),o.jsx(Qe,{label:"Dependencies (one per line)",children:o.jsx(Wt,{name:"dependencies",defaultValue:ys(c.dependencies)})}),o.jsx(Qe,{label:"Risks (one per line)",children:o.jsx(Wt,{name:"risks",defaultValue:ys(c.risks)})}),o.jsx(Qe,{label:"Open questions (one per line)",children:o.jsx(Wt,{name:"openQuestions",defaultValue:ys(c.openQuestions)})}),o.jsx(Qe,{label:"Decisions (one per line)",children:o.jsx(Wt,{name:"decisions",defaultValue:ys(c.decisions)})}),o.jsx(Qe,{label:"Completion criteria (one per line)",children:o.jsx(Wt,{name:"completionCriteria",defaultValue:ys(c.completionCriteria)})}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function TC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return _n("submit",s,{allowInEditable:!0}),o.jsx(Ql,{title:"Create task",description:"A task belongs to the current phase.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Task title",children:o.jsx(On,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",placeholder:"Initial task context"})}),o.jsx(Qe,{label:"Checklist (one per line)",children:o.jsx(Wt,{name:"checklist",placeholder:`Step one
|
|
330
|
+
Step two
|
|
331
|
+
Step three`})}),o.jsx(Qe,{label:"Status",children:o.jsx(Yl,{name:"status",defaultValue:"planned",children:ad.map(u=>o.jsx("option",{value:u.value,children:u.label},u.value))})}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function AC(e){return e.map(a=>a.title).join(`
|
|
332
|
+
`)}function DC(e){return e.join(`
|
|
333
|
+
`)}function CC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var h;return(h=r.current)==null?void 0:h.requestSubmit()},[]);_n("submit",s,{allowInEditable:!0});const c=ks("task-detail").task,d=c.status==="in-progress"?ad:ad.filter(h=>h.value!=="in-progress");return o.jsx(Ql,{title:"Edit task",description:"Update execution details and checklist items.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Title",children:o.jsx(On,{name:"title",defaultValue:c.title,required:!0})}),o.jsx(Qe,{label:"Status",children:o.jsx(Yl,{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:d.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))})}),o.jsx(Qe,{label:"Priority",children:o.jsx(On,{type:"number",name:"priority",defaultValue:c.priority??0,min:0})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",defaultValue:c.description})}),o.jsx(Qe,{label:"Description reference",children:o.jsx(On,{name:"descriptionRef",defaultValue:c.descriptionRef??"",placeholder:".planner/docs/tasks/task-details.md"})}),o.jsx(Qe,{label:"Implementation notes",children:o.jsx(Wt,{name:"notes",defaultValue:c.notes})}),o.jsx(Qe,{label:"Decisions (one per line)",children:o.jsx(Wt,{name:"decisions",defaultValue:DC(c.decisions)})}),o.jsx(Qe,{label:"Status change motivation",children:o.jsx(Wt,{name:"motivation",placeholder:"Required for blocked, canceled, rejected, deferred, waiting, or reopening to planned."})}),o.jsx(Qe,{label:"Checklist (one per line)",children:o.jsx(Wt,{name:"checklist",defaultValue:AC(c.checklist)})}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function OC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var c;return(c=r.current)==null?void 0:c.requestSubmit()},[]);_n("submit",s,{allowInEditable:!0});const{project:u}=ks("root");return o.jsxs("div",{className:"grid gap-8",children:[o.jsxs(Ye,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[o.jsx(fd,{className:"h-4 w-4"})," Back to dashboard"]}),o.jsxs($t,{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(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Project name",children:o.jsx(On,{name:"name",defaultValue:u.name,placeholder:"Project name",required:!0})}),o.jsx(Qe,{label:"Short description",children:o.jsx(Wt,{name:"description",defaultValue:u.description,placeholder:"Summarize the project in a few lines for the dashboard overview"})}),o.jsx(Qe,{label:"Project goal",children:o.jsx(Wt,{name:"goal",defaultValue:u.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),o.jsx(Qe,{label:"Project Guidelines",children:o.jsx(Wt,{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(Ye,{to:"/",children:o.jsx(Ze,{type:"button",variant:"ghost",children:"Cancel"})}),o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save project context"})]})]})]})]})}function MC(e){return`P${String(e.number??0).padStart(3,"0")}`}function Lw({phases:e,selectedIds:a=[]}){const r=new Set(a);return o.jsx(Qe,{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:[MC(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 _C(e,a){return{...e,key:e.id??`new-${a}`}}function LC(e){return{key:`new-${e}`,title:"",description:"",status:"planned"}}function zw({initialTasks:e}){const[a,r]=v.useState(()=>e.map(_C)),s=a.map(({key:p,...g})=>g);function u(p,g){r(y=>y.map((x,E)=>E===p?{...x,...g}:x))}function c(p,g){r(y=>{const x=p+g;if(x<0||x>=y.length)return y;const E=[...y];return[E[p],E[x]]=[E[x],E[p]],E})}function d(p){r(g=>g.filter((y,x)=>x!==p))}function h(){r(p=>[...p,LC(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."}),a.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:a.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(On,{"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(Wt,{"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(Yl,{"aria-label":`Macro task ${g+1} status`,value:p.status,onChange:y=>u(g,{status:y.target.value}),children:gA.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(Ze,{type:"button",variant:"ghost",onClick:()=>c(g,-1),disabled:g===0,"aria-label":`Move macro task ${g+1} up`,children:"Move up"}),o.jsx(Ze,{type:"button",variant:"ghost",onClick:()=>c(g,1),disabled:g===a.length-1,"aria-label":`Move macro task ${g+1} down`,children:"Move down"}),o.jsx(Ze,{type:"button",variant:"danger",onClick:()=>d(g),"aria-label":`Remove macro task ${g+1}`,children:"Remove"})]})]},p.key))}),o.jsx("div",{children:o.jsx(Ze,{type:"button",onClick:h,children:"Add macro task"})})]})}function zC(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var c;return(c=r.current)==null?void 0:c.requestSubmit()},[]);_n("submit",s,{allowInEditable:!0});const{phases:u}=ks("requirements");return o.jsx(Ql,{title:"Create requirement",description:"Capture a user, business, or system outcome. Coding standards and process rules belong in Project Guidelines.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Requirement title",children:o.jsx(On,{name:"title",placeholder:"Self-hosted Claude Code plugin marketplace distribution",required:!0})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",placeholder:"Describe the user/business outcome this requirement represents"})}),o.jsx(zw,{initialTasks:[]}),o.jsx(Lw,{phases:u}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create requirement"})})]})})}function $C(){const a=pr().state!=="idle",r=v.useRef(null),s=v.useCallback(()=>{var p;return(p=r.current)==null?void 0:p.requestSubmit()},[]);_n("submit",s,{allowInEditable:!0});const{requirementId:u}=KE(),{phases:c,requirements:d}=ks("requirements"),h=d.find(p=>p.id===u);return h?o.jsx(Ql,{title:"Edit requirement",description:"Update the product outcome and linked delivery phases. Coding standards and process rules belong in Project Guidelines.",children:o.jsxs(dn,{ref:r,method:"post",className:"grid gap-4",children:[o.jsx(Qe,{label:"Requirement title",children:o.jsx(On,{name:"title",defaultValue:h.title,required:!0})}),o.jsx(Qe,{label:"Description",children:o.jsx(Wt,{name:"description",defaultValue:h.description})}),o.jsx(zw,{initialTasks:h.macroTasks}),o.jsx(Lw,{phases:c,selectedIds:h.linkedPhaseIds}),o.jsx(Kl,{children:o.jsx(Ze,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save requirement"})})]})}):null}function qn(e,a){const r=e.get(a);if(typeof r!="string"||r.trim()==="")throw new Response(`Missing field: ${a}`,{status:400});return r.trim()}function Dt(e,a){const r=e.get(a);return typeof r=="string"?r.trim():""}function wp(e,a){const r=e.get(a);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 Ar(e,a){return Dt(e,a).split(`
|
|
334
|
+
`).map(r=>r.trim()).filter(Boolean)}function $w(e){const a=Dt(e,"macroTasks");if(!a)return[];let r;try{r=JSON.parse(a)}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,d=typeof c.title=="string"?c.title.trim():"",h=typeof c.status=="string"?c.status.trim():"";if(!d)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:d,description:typeof c.description=="string"?c.description.trim():"",status:h}})}function yt(e,a){const r=e[a];if(!r)throw new Response(`Missing route param: ${a}`,{status:400});return r}async function UC({request:e}){const a=await e.formData();return await CR({name:qn(a,"name"),description:Dt(a,"description")}),En("/features")}async function BC({request:e,params:a}){const r=yt(a,"featureId"),s=await ac(r),u=await e.formData();return await j0({id:s.id,updatedAt:s.updatedAt,name:qn(u,"name"),description:Dt(u,"description"),descriptionRef:Dt(u,"descriptionRef"),startDate:Dt(u,"startDate"),endDate:Dt(u,"endDate"),priority:wp(u,"priority"),workDone:Dt(u,"workDone"),workRemaining:Dt(u,"workRemaining")}),En(`/features/${r}`)}async function IC({params:e}){return await OR(yt(e,"featureId")),En("/features")}async function HC({request:e,params:a}){const r=yt(a,"featureId"),s=await ac(r),u=await e.formData();return await j0({id:s.id,updatedAt:s.updatedAt,status:qn(u,"status")}),null}async function qC({request:e,params:a}){const r=yt(a,"featureId"),s=await e.formData();return await IR({featureId:r,title:qn(s,"title"),summary:Dt(s,"summary"),description:Dt(s,"description")}),En(`/features/${r}`)}async function PC({request:e,params:a}){const r=yt(a,"featureId"),s=yt(a,"phaseId"),u=await vd(s),c=await e.formData(),d=await R0({id:u.id,updatedAt:u.updatedAt,title:qn(c,"title"),priority:wp(c,"priority"),summary:Dt(c,"summary"),description:Dt(c,"description"),descriptionRef:Dt(c,"descriptionRef"),featureId:qn(c,"featureId"),goals:Ar(c,"goals"),nonGoals:Ar(c,"nonGoals"),dependencies:Ar(c,"dependencies"),risks:Ar(c,"risks"),openQuestions:Ar(c,"openQuestions"),decisions:Ar(c,"decisions"),completionCriteria:Ar(c,"completionCriteria")});return En(`/features/${d.featureId??r}/phases/${s}`)}async function FC({params:e}){const a=yt(e,"featureId"),r=yt(e,"phaseId");return await HR(r),En(`/features/${a}`)}async function VC({request:e,params:a}){const r=yt(a,"phaseId"),s=await vd(r),u=await e.formData();return await R0({...s,status:qn(u,"status")}),null}async function YC({request:e,params:a}){const r=yt(a,"featureId"),s=yt(a,"phaseId"),u=await e.formData(),c=Ar(u,"checklist");return await qR(s,{title:qn(u,"title"),description:Dt(u,"description"),status:Dt(u,"status")||"planned",...c.length?{checklist:c}:{}}),En(`/features/${r}/phases/${s}`)}function GC(e,a){const r=new Map(e.map(u=>[u.id,u])),s=new Map(e.map(u=>[u.title.trim().toLowerCase(),u]));return a.map((u,c)=>{var p;const d=u.trim().toLowerCase(),h=r.get(((p=e[c])==null?void 0:p.id)??"")??s.get(d);return h?{...h,number:c+1,title:u.trim()}:{id:`check-${c+1}-${d.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:c+1,title:u.trim(),checked:!1}})}async function XC({request:e,params:a}){const r=yt(a,"featureId"),s=yt(a,"phaseId"),u=yt(a,"taskId"),c=await xd(u),d=await e.formData(),h=qn(d,"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 Gm({id:c.id,updatedAt:c.updatedAt,phaseId:s,title:qn(d,"title"),status:h,priority:wp(d,"priority"),description:Dt(d,"description"),descriptionRef:Dt(d,"descriptionRef"),notes:Dt(d,"notes"),decisions:Ar(d,"decisions"),motivation:Dt(d,"motivation"),checklist:GC(c.checklist,Ar(d,"checklist"))}),En(`/features/${r}/phases/${s}/tasks/${u}`)}async function QC({params:e}){const a=yt(e,"featureId"),r=yt(e,"phaseId"),s=yt(e,"taskId");return await GR(s),En(`/features/${a}/phases/${r}`)}async function KC({request:e,params:a}){const r=yt(a,"phaseId"),s=yt(a,"taskId"),u=await xd(s),c=await e.formData();return await Gm({id:u.id,phaseId:r,updatedAt:u.updatedAt,status:qn(c,"status")}),null}async function ZC({params:e}){const a=yt(e,"featureId"),r=yt(e,"phaseId"),s=yt(e,"taskId");return await PR(s),En(`/features/${a}/phases/${r}/tasks/${s}`)}async function WC({params:e}){const a=yt(e,"featureId"),r=yt(e,"phaseId"),s=yt(e,"taskId");return await FR(s),En(`/features/${a}/phases/${r}/tasks/${s}`)}async function JC({request:e,params:a}){const r=yt(a,"featureId"),s=yt(a,"phaseId"),u=yt(a,"taskId"),c=await e.formData();return await VR(u,s,{title:String(c.get("title")??""),description:String(c.get("description")??"")}),En(`/features/${r}/phases/${s}/tasks/${u}`)}async function eO({request:e,params:a}){const r=yt(a,"featureId"),s=yt(a,"phaseId"),u=yt(a,"taskId"),c=await e.formData();return await YR(u,s,String(c.get("dependsOn")??"")),En(`/features/${r}/phases/${s}/tasks/${u}`)}async function tO({request:e}){const a=await Fm(),r=await e.formData();return await NR({name:Dt(r,"name")||a.name,description:Dt(r,"description"),goal:Dt(r,"goal"),projectGuidelines:{content:Dt(r,"projectGuidelines")},expectedGuidelinesUpdatedAt:a.projectGuidelines.updatedAt}),En("/")}async function nO({request:e}){const a=await e.formData();return await $R({title:qn(a,"title"),description:Dt(a,"description"),macroTasks:$w(a),linkedPhaseIds:a.getAll("linkedPhaseIds").filter(r=>typeof r=="string").map(r=>r.trim()).filter(Boolean)}),En("/requirements")}async function aO({request:e,params:a}){const r=yt(a,"requirementId"),s=(await Ym()).find(c=>c.id===r);if(!s)throw new Response(`Requirement not found: ${r}`,{status:404});const u=await e.formData();return await UR({id:s.id,updatedAt:s.updatedAt,title:qn(u,"title"),description:Dt(u,"description"),macroTasks:u.has("macroTasks")?$w(u):s.macroTasks,linkedPhaseIds:u.getAll("linkedPhaseIds").filter(c=>typeof c=="string").map(c=>c.trim()).filter(Boolean)}),En("/requirements")}async function rO({params:e}){return await BR(yt(e,"requirementId")),En("/requirements")}function lO(e){const a=qn(e,"targetType");if(a==="project"||a==="feature"||a==="phase"||a==="task")return a;throw new Response(`Unsupported accepted decision target: ${a}`,{status:400})}function im(e){const a=Dt(e,"returnTo");return a!=null&&a.startsWith("/")?a:"/"}async function sO({request:e}){const a=await e.formData(),r=qn(a,"intent"),s={targetType:lO(a),targetRef:Dt(a,"targetRef")};if(r==="create")return await jR({...s,title:qn(a,"title"),decision:Dt(a,"decision")??"",rationale:Dt(a,"rationale")??"",implementationNotes:Dt(a,"implementationNotes")??""}),En(im(a));const u=qn(a,"decisionId");if(r==="update")return await RR({...s,id:u,title:qn(a,"title"),decision:Dt(a,"decision")??"",rationale:Dt(a,"rationale")??"",implementationNotes:Dt(a,"implementationNotes")??""}),En(im(a));if(r==="delete")return await kR({...s,id:u}),En(im(a));throw new Response(`Unsupported accepted decision action: ${r}`,{status:400})}function iO(e){if(!e)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}async function oO(){return{handoffs:await gm()}}function cO(){const{handoffs:e}=gr(),[a,r]=v.useState(e),[s,u]=v.useState(null),[c,d]=v.useState(""),h=ga();async function p(g){if(!(s||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){u(g.phaseId),d("");try{await k0(g.phaseId),r(x=>x.filter(E=>E.phaseId!==g.phaseId)),gm().then(r).catch(()=>{})}catch(x){const E=x instanceof Response?await x.text().catch(()=>""):x instanceof Error?x.message:String(x);d(E||`Failed to clear handoff for ${g.compositeRef}.`)}finally{u(null)}}}return v.useEffect(()=>{const g=y=>{const x=y.detail;((x==null?void 0:x.type)==="handoffUpdated"||(x==null?void 0:x.type)==="handoffCleared")&&gm().then(r).catch(()=>{})};return window.addEventListener("agent-plan:ws-event",g),()=>window.removeEventListener("agent-plan:ws-event",g)},[]),v.useEffect(()=>{if(!h.hash)return;const g=h.hash.slice(1),y=document.getElementById(g);y&&y.scrollIntoView({behavior:"smooth",block:"start"})},[h.hash,a]),a.length===0?o.jsxs($t,{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(Ye,{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."}),o.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Handoff preflight supplies the required title and reason before drafting; timestamps and metadata are generated by the planner."})]}),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(Ye,{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. ",a.length," pending."]}),o.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Handoff preflight supplies the required title and reason before drafting; timestamps and metadata are generated by the planner."})]}),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,a.map(g=>o.jsx("section",{id:g.phaseId,className:"scroll-mt-20",children:o.jsx($t,{className:"overflow-hidden p-0",children:o.jsx(Hn,{defaultOpen:!1,title:o.jsxs(o.Fragment,{children:[o.jsx(rr,{id:g.compositeRef,children:g.compositeRef}),o.jsx("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:g.resumeReady?"Resume-ready":"Verification required"}),o.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",iO(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(Ze,{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(Ye,{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(Mn,{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 uO(e){if(!e)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}catch{return e}}async function dO(){return{archived:await KR()}}function fO(){const{archived:e}=gr();return e.length===0?o.jsxs($t,{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(Ye,{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(Ye,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),e.map(a=>o.jsx($t,{className:"overflow-hidden p-0",children:o.jsxs(Hn,{defaultOpen:!1,title:o.jsxs(o.Fragment,{children:[o.jsx(rr,{id:a.compositeRef,children:a.compositeRef}),o.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Archived ",uO(a.archivedAt)]})]}),subtitle:a.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: ",a.reason||"unknown"]}),o.jsxs("span",{className:"break-all",children:["File: ",a.file]})]}),o.jsx(Mn,{text:a.content||"(archive file unavailable)",className:"formatted-text max-w-none"})]})},`${a.phaseId}:${a.file}`))]})}async function hO({request:e}){const r=new URL(e.url).searchParams.get("path")??"";if(!/^\.planner\/docs\/.+\.md$/i.test(r)||r.includes("/../"))throw new Response("Document path must be a Markdown file under .planner/docs/",{status:400});return{doc:await AR(r)}}async function mO({request:e}){const a=await e.formData(),r=String(a.get("path")??""),s=String(a.get("content")??"");if(!(a.get("confirmed")==="true"))return{error:"Saving requires explicit confirmation.",path:r};if(!s.trim())return{error:"Document content must be non-empty Markdown.",path:r};try{await DR(r,s)}catch(c){return{error:c instanceof Error?c.message:String(c),path:r}}return En(`/docs/view?path=${encodeURIComponent(r)}`)}function pO(){const{doc:e}=gr(),a=sN(),[r,s]=v.useState(!1),[u,c]=v.useState(e.content);return o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Ye,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Handoffs"}),o.jsx("h1",{className:"text-base font-bold text-[var(--text)]",children:"Planner document"}),o.jsx("code",{className:"rounded border border-[var(--border)] px-2 py-0.5 font-mono text-xs",children:e.path}),o.jsx("button",{type:"button",className:"rounded border border-[var(--border)] px-2 py-1 text-sm",onClick:()=>{c(e.content),s(d=>!d)},children:r?"Preview":"Edit"})]}),a!=null&&a.error?o.jsx("p",{role:"alert",className:"text-sm text-red-600",children:a.error}):null,r?o.jsxs(dn,{method:"put",className:"grid gap-3",children:[o.jsx("input",{type:"hidden",name:"path",value:e.path}),o.jsxs("label",{className:"grid gap-2 text-sm",children:[o.jsx("span",{className:"font-semibold",children:"Markdown source (dependency-free textarea baseline)"}),o.jsx("textarea",{name:"content",value:u,onChange:d=>c(d.target.value),rows:24,className:"rounded-lg border border-[var(--border)] p-3 font-mono text-sm"})]}),o.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[o.jsx("input",{type:"checkbox",name:"confirmed",value:"true",required:!0}),o.jsx("span",{children:"I confirm overwriting this planner-owned document."})]}),o.jsx("div",{children:o.jsx("button",{type:"submit",className:"rounded bg-[var(--accent)] px-3 py-1.5 text-sm font-semibold text-white",children:"Save document"})}),o.jsxs("div",{className:"rounded-lg border border-[var(--border)] p-4",children:[o.jsx("h2",{className:"mb-2 text-sm font-bold",children:"Live preview"}),o.jsx(Mn,{text:u})]})]}):o.jsx("div",{className:"rounded-lg border border-[var(--border)] p-4",children:o.jsx(Mn,{text:e.content})})]})}async function gO({request:e,params:a}){yt(a,"featureId");const r=yt(a,"phaseId"),s=yt(a,"taskId"),u=yt(a,"itemId"),c=await e.formData(),d=qn(c,"checked")==="true",h=await xd(s);return await Gm({...h,phaseId:r,checklist:h.checklist.map(p=>p.id===u?{...p,checked:d}:p)}),Response.json({ok:!0,taskId:s,itemId:u,checked:d})}const vO=FN([{id:"root",path:"/",loader:k2,element:o.jsx(T2,{}),errorElement:o.jsx(D2,{}),children:[{index:!0,loader:C2,element:o.jsx(ID,{})},{path:"features",id:"features",loader:HD,element:o.jsx(GD,{}),children:[{path:"new",element:o.jsx(NC,{}),action:UC}]},{path:"features/:featureId",id:"feature-detail",loader:nC,element:o.jsx(mC,{}),children:[{path:"edit",element:o.jsx(jC,{}),action:BC},{path:"phases/new",element:o.jsx(RC,{}),action:qC}]},{path:"requirements",id:"requirements",loader:XD,element:o.jsx(KD,{}),children:[{path:"new",element:o.jsx(zC,{}),action:nO},{path:":requirementId/edit",element:o.jsx($C,{}),action:aO}]},{path:"ideas",id:"ideas",loader:ZD,action:WD,element:o.jsx(tC,{})},{path:"project/edit",element:o.jsx(OC,{}),action:tO},{path:"accepted-decisions",action:sO},{path:"handoff",loader:oO,element:o.jsx(cO,{})},{path:"handoff/archive",loader:dO,element:o.jsx(fO,{})},{path:"docs/view",loader:hO,action:mO,element:o.jsx(pO,{})},{path:"features/:featureId/delete",action:IC},{path:"requirements/:requirementId/delete",action:rO},{path:"features/:featureId/status",action:HC},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:pC,element:o.jsx(xC,{}),children:[{path:"edit",element:o.jsx(kC,{}),action:PC},{path:"tasks/new",element:o.jsx(TC,{}),action:YC}]},{path:"features/:featureId/phases/:phaseId/delete",action:FC},{path:"features/:featureId/phases/:phaseId/status",action:VC},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:yC,element:o.jsx(SC,{}),children:[{path:"edit",element:o.jsx(CC,{}),action:XC},{path:"subtasks/new",action:JC},{path:"dependencies/add",action:eO}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:QC},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/start",action:ZC},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/reopen",action:WC},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:KC},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:gO}]}]),Uw=document.getElementById("root");if(!Uw)throw new Error("#root not found");CS.createRoot(Uw).render(o.jsx(v.StrictMode,{children:o.jsx(ej,{router:vO})}));
|