@software-dlc/cli 0.172.0 → 0.176.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.
@@ -0,0 +1,352 @@
1
+ function M1(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const l=Object.getOwnPropertyDescriptor(a,r);l&&Object.defineProperty(e,r,l.get?l:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Ix(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vx={exports:{}},zc={};/**
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 O1=Symbol.for("react.transitional.element"),D1=Symbol.for("react.fragment");function Yx(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:O1,type:e,key:a,ref:t!==void 0?t:null,props:n}}zc.Fragment=D1;zc.jsx=Yx;zc.jsxs=Yx;Vx.exports=zc;var s=Vx.exports,Px={exports:{}},ve={};/**
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 lh=Symbol.for("react.transitional.element"),z1=Symbol.for("react.portal"),$1=Symbol.for("react.fragment"),L1=Symbol.for("react.strict_mode"),U1=Symbol.for("react.profiler"),H1=Symbol.for("react.consumer"),B1=Symbol.for("react.context"),q1=Symbol.for("react.forward_ref"),G1=Symbol.for("react.suspense"),I1=Symbol.for("react.memo"),Xx=Symbol.for("react.lazy"),hp=Symbol.iterator;function V1(e){return e===null||typeof e!="object"?null:(e=hp&&e[hp]||e["@@iterator"],typeof e=="function"?e:null)}var Kx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qx=Object.assign,Zx={};function Gr(e,t,n){this.props=e,this.context=t,this.refs=Zx,this.updater=n||Kx}Gr.prototype.isReactComponent={};Gr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Gr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Fx(){}Fx.prototype=Gr.prototype;function ih(e,t,n){this.props=e,this.context=t,this.refs=Zx,this.updater=n||Kx}var oh=ih.prototype=new Fx;oh.constructor=ih;Qx(oh,Gr.prototype);oh.isPureReactComponent=!0;var mp=Array.isArray,Ge={H:null,A:null,T:null,S:null,V:null},Wx=Object.prototype.hasOwnProperty;function ch(e,t,n,a,r,l){return n=l.ref,{$$typeof:lh,type:e,key:t,ref:n!==void 0?n:null,props:l}}function Y1(e,t){return ch(e.type,t,void 0,void 0,void 0,e.props)}function uh(e){return typeof e=="object"&&e!==null&&e.$$typeof===lh}function P1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var pp=/\/+/g;function Du(e,t){return typeof e=="object"&&e!==null&&e.key!=null?P1(""+e.key):t.toString(36)}function gp(){}function X1(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(gp,gp):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function er(e,t,n,a,r){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(l){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case lh:case z1:i=!0;break;case Xx:return i=e._init,er(i(e._payload),t,n,a,r)}}if(i)return r=r(e),i=a===""?"."+Du(e,0):a,mp(r)?(n="",i!=null&&(n=i.replace(pp,"$&/")+"/"),er(r,t,n,"",function(d){return d})):r!=null&&(uh(r)&&(r=Y1(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(pp,"$&/")+"/")+i)),t.push(r)),1;i=0;var o=a===""?".":a+":";if(mp(e))for(var c=0;c<e.length;c++)a=e[c],l=o+Du(a,c),i+=er(a,t,n,l,r);else if(c=V1(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,l=o+Du(a,c++),i+=er(a,t,n,l,r);else if(l==="object"){if(typeof e.then=="function")return er(X1(e),t,n,a,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Qi(e,t,n){if(e==null)return e;var a=[],r=0;return er(e,a,"","",function(l){return t.call(n,l,r++)}),a}function K1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xp=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Q1(){}ve.Children={map:Qi,forEach:function(e,t,n){Qi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Qi(e,function(){t++}),t},toArray:function(e){return Qi(e,function(t){return t})||[]},only:function(e){if(!uh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ve.Component=Gr;ve.Fragment=$1;ve.Profiler=U1;ve.PureComponent=ih;ve.StrictMode=L1;ve.Suspense=G1;ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ge;ve.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ge.H.useMemoCache(e)}};ve.cache=function(e){return function(){return e.apply(null,arguments)}};ve.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=Qx({},e.props),r=e.key,l=void 0;if(t!=null)for(i in t.ref!==void 0&&(l=void 0),t.key!==void 0&&(r=""+t.key),t)!Wx.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(a[i]=t[i]);var i=arguments.length-2;if(i===1)a.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];a.children=o}return ch(e.type,r,void 0,void 0,l,a)};ve.createContext=function(e){return e={$$typeof:B1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:H1,_context:e},e};ve.createElement=function(e,t,n){var a,r={},l=null;if(t!=null)for(a in t.key!==void 0&&(l=""+t.key),t)Wx.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(r[a]=t[a]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];r.children=o}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)r[a]===void 0&&(r[a]=i[a]);return ch(e,l,void 0,void 0,null,r)};ve.createRef=function(){return{current:null}};ve.forwardRef=function(e){return{$$typeof:q1,render:e}};ve.isValidElement=uh;ve.lazy=function(e){return{$$typeof:Xx,_payload:{_status:-1,_result:e},_init:K1}};ve.memo=function(e,t){return{$$typeof:I1,type:e,compare:t===void 0?null:t}};ve.startTransition=function(e){var t=Ge.T,n={};Ge.T=n;try{var a=e(),r=Ge.S;r!==null&&r(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(Q1,xp)}catch(l){xp(l)}finally{Ge.T=t}};ve.unstable_useCacheRefresh=function(){return Ge.H.useCacheRefresh()};ve.use=function(e){return Ge.H.use(e)};ve.useActionState=function(e,t,n){return Ge.H.useActionState(e,t,n)};ve.useCallback=function(e,t){return Ge.H.useCallback(e,t)};ve.useContext=function(e){return Ge.H.useContext(e)};ve.useDebugValue=function(){};ve.useDeferredValue=function(e,t){return Ge.H.useDeferredValue(e,t)};ve.useEffect=function(e,t,n){var a=Ge.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return a.useEffect(e,t)};ve.useId=function(){return Ge.H.useId()};ve.useImperativeHandle=function(e,t,n){return Ge.H.useImperativeHandle(e,t,n)};ve.useInsertionEffect=function(e,t){return Ge.H.useInsertionEffect(e,t)};ve.useLayoutEffect=function(e,t){return Ge.H.useLayoutEffect(e,t)};ve.useMemo=function(e,t){return Ge.H.useMemo(e,t)};ve.useOptimistic=function(e,t){return Ge.H.useOptimistic(e,t)};ve.useReducer=function(e,t,n){return Ge.H.useReducer(e,t,n)};ve.useRef=function(e){return Ge.H.useRef(e)};ve.useState=function(e){return Ge.H.useState(e)};ve.useSyncExternalStore=function(e,t,n){return Ge.H.useSyncExternalStore(e,t,n)};ve.useTransition=function(){return Ge.H.useTransition()};ve.version="19.1.0";Px.exports=ve;var u=Px.exports;const Aa=Ix(u),Jx=M1({__proto__:null,default:Aa},[u]);var ev={exports:{}},$c={},tv={exports:{}},nv={};/**
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
+ */(function(e){function t(E,B){var T=E.length;E.push(B);e:for(;0<T;){var L=T-1>>>1,K=E[L];if(0<r(K,B))E[L]=B,E[T]=K,T=L;else break e}}function n(E){return E.length===0?null:E[0]}function a(E){if(E.length===0)return null;var B=E[0],T=E.pop();if(T!==B){E[0]=T;e:for(var L=0,K=E.length,$=K>>>1;L<$;){var Y=2*(L+1)-1,ne=E[Y],P=Y+1,ye=E[P];if(0>r(ne,T))P<K&&0>r(ye,ne)?(E[L]=ye,E[P]=T,L=P):(E[L]=ne,E[Y]=T,L=Y);else if(P<K&&0>r(ye,T))E[L]=ye,E[P]=T,L=P;else break e}}return B}function r(E,B){var T=E.sortIndex-B.sortIndex;return T!==0?T:E.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],f=1,h=null,m=3,x=!1,j=!1,y=!1,b=!1,g=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function w(E){for(var B=n(d);B!==null;){if(B.callback===null)a(d);else if(B.startTime<=E)a(d),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(d)}}function _(E){if(y=!1,w(E),!j)if(n(c)!==null)j=!0,S||(S=!0,U());else{var B=n(d);B!==null&&G(_,B.startTime-E)}}var S=!1,N=-1,k=5,R=-1;function M(){return b?!0:!(e.unstable_now()-R<k)}function z(){if(b=!1,S){var E=e.unstable_now();R=E;var B=!0;try{e:{j=!1,y&&(y=!1,p(N),N=-1),x=!0;var T=m;try{t:{for(w(E),h=n(c);h!==null&&!(h.expirationTime>E&&M());){var L=h.callback;if(typeof L=="function"){h.callback=null,m=h.priorityLevel;var K=L(h.expirationTime<=E);if(E=e.unstable_now(),typeof K=="function"){h.callback=K,w(E),B=!0;break t}h===n(c)&&a(c),w(E)}else a(c);h=n(c)}if(h!==null)B=!0;else{var $=n(d);$!==null&&G(_,$.startTime-E),B=!1}}break e}finally{h=null,m=T,x=!1}B=void 0}}finally{B?U():S=!1}}}var U;if(typeof v=="function")U=function(){v(z)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,D=C.port2;C.port1.onmessage=z,U=function(){D.postMessage(null)}}else U=function(){g(z,0)};function G(E,B){N=g(function(){E(e.unstable_now())},B)}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(E){E.callback=null},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(E){switch(m){case 1:case 2:case 3:var B=3;break;default:B=m}var T=m;m=B;try{return E()}finally{m=T}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(E,B){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var T=m;m=E;try{return B()}finally{m=T}},e.unstable_scheduleCallback=function(E,B,T){var L=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?L+T:L):T=L,E){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=T+K,E={id:f++,callback:B,priorityLevel:E,startTime:T,expirationTime:K,sortIndex:-1},T>L?(E.sortIndex=T,t(d,E),n(c)===null&&E===n(d)&&(y?(p(N),N=-1):y=!0,G(_,T-L))):(E.sortIndex=K,t(c,E),j||x||(j=!0,S||(S=!0,U()))),E},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(E){var B=m;return function(){var T=m;m=B;try{return E.apply(this,arguments)}finally{m=T}}}})(nv);tv.exports=nv;var Z1=tv.exports,av={exports:{}},zt={};/**
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 F1=u;function sv(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ca(){}var Dt={d:{f:Ca,r:function(){throw Error(sv(522))},D:Ca,C:Ca,L:Ca,m:Ca,X:Ca,S:Ca,M:Ca},p:0,findDOMNode:null},W1=Symbol.for("react.portal");function J1(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W1,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var El=F1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Lc(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;zt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(sv(299));return J1(e,t,null,n)};zt.flushSync=function(e){var t=El.T,n=Dt.p;try{if(El.T=null,Dt.p=2,e)return e()}finally{El.T=t,Dt.p=n,Dt.d.f()}};zt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Dt.d.C(e,t))};zt.prefetchDNS=function(e){typeof e=="string"&&Dt.d.D(e)};zt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=Lc(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,l=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Dt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:r,fetchPriority:l}):n==="script"&&Dt.d.X(e,{crossOrigin:a,integrity:r,fetchPriority:l,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};zt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Lc(t.as,t.crossOrigin);Dt.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Dt.d.M(e)};zt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=Lc(n,t.crossOrigin);Dt.d.L(e,n,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};zt.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Lc(t.as,t.crossOrigin);Dt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Dt.d.m(e)};zt.requestFormReset=function(e){Dt.d.r(e)};zt.unstable_batchedUpdates=function(e,t){return e(t)};zt.useFormState=function(e,t,n){return El.H.useFormState(e,t,n)};zt.useFormStatus=function(){return El.H.useHostTransitionStatus()};zt.version="19.1.0";function rv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rv)}catch(e){console.error(e)}}rv(),av.exports=zt;var Ir=av.exports;const eN=Ix(Ir);/**
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 ft=Z1,lv=u,tN=Ir;function H(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function iv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function fi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ov(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function vp(e){if(fi(e)!==e)throw Error(H(188))}function nN(e){var t=e.alternate;if(!t){if(t=fi(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var l=r.alternate;if(l===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===l.child){for(l=r.child;l;){if(l===n)return vp(r),e;if(l===a)return vp(r),t;l=l.sibling}throw Error(H(188))}if(n.return!==a.return)n=r,a=l;else{for(var i=!1,o=r.child;o;){if(o===n){i=!0,n=r,a=l;break}if(o===a){i=!0,a=r,n=l;break}o=o.sibling}if(!i){for(o=l.child;o;){if(o===n){i=!0,n=l,a=r;break}if(o===a){i=!0,a=l,n=r;break}o=o.sibling}if(!i)throw Error(H(189))}}if(n.alternate!==a)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function cv(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=cv(e),t!==null)return t;e=e.sibling}return null}var Be=Object.assign,aN=Symbol.for("react.element"),Zi=Symbol.for("react.transitional.element"),yl=Symbol.for("react.portal"),sr=Symbol.for("react.fragment"),uv=Symbol.for("react.strict_mode"),Ud=Symbol.for("react.profiler"),sN=Symbol.for("react.provider"),dv=Symbol.for("react.consumer"),sa=Symbol.for("react.context"),dh=Symbol.for("react.forward_ref"),Hd=Symbol.for("react.suspense"),Bd=Symbol.for("react.suspense_list"),fh=Symbol.for("react.memo"),Da=Symbol.for("react.lazy"),qd=Symbol.for("react.activity"),rN=Symbol.for("react.memo_cache_sentinel"),yp=Symbol.iterator;function ol(e){return e===null||typeof e!="object"?null:(e=yp&&e[yp]||e["@@iterator"],typeof e=="function"?e:null)}var lN=Symbol.for("react.client.reference");function Gd(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===lN?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case sr:return"Fragment";case Ud:return"Profiler";case uv:return"StrictMode";case Hd:return"Suspense";case Bd:return"SuspenseList";case qd:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case yl:return"Portal";case sa:return(e.displayName||"Context")+".Provider";case dv:return(e._context.displayName||"Context")+".Consumer";case dh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fh:return t=e.displayName||null,t!==null?t:Gd(e.type)||"Memo";case Da:t=e._payload,e=e._init;try{return Gd(e(t))}catch{}}return null}var bl=Array.isArray,le=lv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee=tN.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bs={pending:!1,data:null,method:null,action:null},Id=[],rr=-1;function Vn(e){return{current:e}}function vt(e){0>rr||(e.current=Id[rr],Id[rr]=null,rr--)}function Ie(e,t){rr++,Id[rr]=e.current,e.current=t}var zn=Vn(null),Yl=Vn(null),Ya=Vn(null),Io=Vn(null);function Vo(e,t){switch(Ie(Ya,t),Ie(Yl,e),Ie(zn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ng(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ng(t),e=Tb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}vt(zn),Ie(zn,e)}function Tr(){vt(zn),vt(Yl),vt(Ya)}function Vd(e){e.memoizedState!==null&&Ie(Io,e);var t=zn.current,n=Tb(t,e.type);t!==n&&(Ie(Yl,e),Ie(zn,n))}function Yo(e){Yl.current===e&&(vt(zn),vt(Yl)),Io.current===e&&(vt(Io),ti._currentValue=bs)}var Yd=Object.prototype.hasOwnProperty,hh=ft.unstable_scheduleCallback,zu=ft.unstable_cancelCallback,iN=ft.unstable_shouldYield,oN=ft.unstable_requestPaint,$n=ft.unstable_now,cN=ft.unstable_getCurrentPriorityLevel,fv=ft.unstable_ImmediatePriority,hv=ft.unstable_UserBlockingPriority,Po=ft.unstable_NormalPriority,uN=ft.unstable_LowPriority,mv=ft.unstable_IdlePriority,dN=ft.log,fN=ft.unstable_setDisableYieldValue,hi=null,Qt=null;function Ba(e){if(typeof dN=="function"&&fN(e),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(hi,e)}catch{}}var Zt=Math.clz32?Math.clz32:pN,hN=Math.log,mN=Math.LN2;function pN(e){return e>>>=0,e===0?32:31-(hN(e)/mN|0)|0}var Fi=256,Wi=4194304;function ps(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Uc(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=a&134217727;return o!==0?(a=o&~l,a!==0?r=ps(a):(i&=o,i!==0?r=ps(i):n||(n=o&~e,n!==0&&(r=ps(n))))):(o=a&~l,o!==0?r=ps(o):i!==0?r=ps(i):n||(n=a&~e,n!==0&&(r=ps(n)))),r===0?0:t!==0&&t!==r&&!(t&l)&&(l=r&-r,n=t&-t,l>=n||l===32&&(n&4194048)!==0)?t:r}function mi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gN(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pv(){var e=Fi;return Fi<<=1,!(Fi&4194048)&&(Fi=256),e}function gv(){var e=Wi;return Wi<<=1,!(Wi&62914560)&&(Wi=4194304),e}function $u(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xN(e,t,n,a,r,l){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=i&~n;0<n;){var f=31-Zt(n),h=1<<f;o[f]=0,c[f]=-1;var m=d[f];if(m!==null)for(d[f]=null,f=0;f<m.length;f++){var x=m[f];x!==null&&(x.lane&=-536870913)}n&=~h}a!==0&&xv(e,a,0),l!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=l&~(i&~t))}function xv(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Zt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&4194090}function vv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Zt(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function mh(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ph(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yv(){var e=Ee.p;return e!==0?e:(e=window.event,e===void 0?32:Ub(e.type))}function vN(e,t){var n=Ee.p;try{return Ee.p=e,t()}finally{Ee.p=n}}var ls=Math.random().toString(36).slice(2),Et="__reactFiber$"+ls,qt="__reactProps$"+ls,Vr="__reactContainer$"+ls,Pd="__reactEvents$"+ls,yN="__reactListeners$"+ls,bN="__reactHandles$"+ls,bp="__reactResources$"+ls,gi="__reactMarker$"+ls;function gh(e){delete e[Et],delete e[qt],delete e[Pd],delete e[yN],delete e[bN]}function lr(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vr]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cg(e);e!==null;){if(n=e[Et])return n;e=Cg(e)}return t}e=n,n=e.parentNode}return null}function Yr(e){if(e=e[Et]||e[Vr]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function jl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(H(33))}function gr(e){var t=e[bp];return t||(t=e[bp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[gi]=!0}var bv=new Set,jv={};function Ls(e,t){Er(e,t),Er(e+"Capture",t)}function Er(e,t){for(jv[e]=t,e=0;e<t.length;e++)bv.add(t[e])}var jN=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]*$"),jp={},wp={};function wN(e){return Yd.call(wp,e)?!0:Yd.call(jp,e)?!1:jN.test(e)?wp[e]=!0:(jp[e]=!0,!1)}function So(e,t,n){if(wN(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Ji(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Wn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}var Lu,_p;function tr(e){if(Lu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lu=t&&t[1]||"",_p=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Lu+e+_p}var Uu=!1;function Hu(e,t){if(!e||Uu)return"";Uu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(x){var m=x}Reflect.construct(e,[],h)}else{try{h.call()}catch(x){m=x}e.call(h.prototype)}}else{try{throw Error()}catch(x){m=x}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(x){if(x&&m&&typeof x.stack=="string")return[x.stack,m.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=a.DetermineComponentFrameRoot(),i=l[0],o=l[1];if(i&&o){var c=i.split(`
44
+ `),d=o.split(`
45
+ `);for(r=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;r<d.length&&!d[r].includes("DetermineComponentFrameRoot");)r++;if(a===c.length||r===d.length)for(a=c.length-1,r=d.length-1;1<=a&&0<=r&&c[a]!==d[r];)r--;for(;1<=a&&0<=r;a--,r--)if(c[a]!==d[r]){if(a!==1||r!==1)do if(a--,r--,0>r||c[a]!==d[r]){var f=`
46
+ `+c[a].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=a&&0<=r);break}}}finally{Uu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?tr(n):""}function _N(e){switch(e.tag){case 26:case 27:case 5:return tr(e.type);case 16:return tr("Lazy");case 13:return tr("Suspense");case 19:return tr("SuspenseList");case 0:case 15:return Hu(e.type,!1);case 11:return Hu(e.type.render,!1);case 1:return Hu(e.type,!0);case 31:return tr("Activity");default:return""}}function Np(e){try{var t="";do t+=_N(e),e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}function rn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function NN(e){var t=wv(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xo(e){e._valueTracker||(e._valueTracker=NN(e))}function _v(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=wv(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Ko(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var SN=/[\n"\\]/g;function cn(e){return e.replace(SN,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xd(e,t,n,a,r,l,i,o){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+rn(t)):e.value!==""+rn(t)&&(e.value=""+rn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?Kd(e,i,rn(t)):n!=null?Kd(e,i,rn(n)):a!=null&&e.removeAttribute("value"),r==null&&l!=null&&(e.defaultChecked=!!l),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+rn(o):e.removeAttribute("name")}function Nv(e,t,n,a,r,l,i,o){if(l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.type=l),t!=null||n!=null){if(!(l!=="submit"&&l!=="reset"||t!=null))return;n=n!=null?""+rn(n):"",t=t!=null?""+rn(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=o?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i)}function Kd(e,t,n){t==="number"&&Ko(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function xr(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+rn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Sv(e,t,n){if(t!=null&&(t=""+rn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+rn(n):""}function kv(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(H(92));if(bl(a)){if(1<a.length)throw Error(H(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=rn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a)}function Rr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kN=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 Sp(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||kN.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Cv(e,t,n){if(t!=null&&typeof t!="object")throw Error(H(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&Sp(e,r,a)}else for(var l in t)t.hasOwnProperty(l)&&Sp(e,l,t[l])}function xh(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var CN=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"]]),TN=/^[\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 ko(e){return TN.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Qd=null;function vh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ir=null,vr=null;function kp(e){var t=Yr(e);if(t&&(e=t.stateNode)){var n=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Xd(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+cn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[qt]||null;if(!r)throw Error(H(90));Xd(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&_v(a)}break e;case"textarea":Sv(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&xr(e,!!n.multiple,t,!1)}}}var Bu=!1;function Tv(e,t,n){if(Bu)return e(t,n);Bu=!0;try{var a=e(t);return a}finally{if(Bu=!1,(ir!==null||vr!==null)&&(Kc(),ir&&(t=ir,e=vr,vr=ir=null,kp(t),e)))for(t=0;t<e.length;t++)kp(e[t])}}function Pl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[qt]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zd=!1;if(ha)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){Zd=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{Zd=!1}var qa=null,yh=null,Co=null;function Ev(){if(Co)return Co;var e,t=yh,n=t.length,a,r="value"in qa?qa.value:qa.textContent,l=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===r[l-a];a++);return Co=r.slice(e,1<a?1-a:void 0)}function To(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function eo(){return!0}function Cp(){return!1}function Gt(e){function t(n,a,r,l,i){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=l,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?eo:Cp,this.isPropagationStopped=Cp,this}return Be(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=eo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=eo)},persist:function(){},isPersistent:eo}),t}var Us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hc=Gt(Us),xi=Be({},Us,{view:0,detail:0}),EN=Gt(xi),qu,Gu,ul,Bc=Be({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ul&&(ul&&e.type==="mousemove"?(qu=e.screenX-ul.screenX,Gu=e.screenY-ul.screenY):Gu=qu=0,ul=e),qu)},movementY:function(e){return"movementY"in e?e.movementY:Gu}}),Tp=Gt(Bc),RN=Be({},Bc,{dataTransfer:0}),AN=Gt(RN),MN=Be({},xi,{relatedTarget:0}),Iu=Gt(MN),ON=Be({},Us,{animationName:0,elapsedTime:0,pseudoElement:0}),DN=Gt(ON),zN=Be({},Us,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$N=Gt(zN),LN=Be({},Us,{data:0}),Ep=Gt(LN),UN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HN={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"},BN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BN[e])?!!t[e]:!1}function bh(){return qN}var GN=Be({},xi,{key:function(e){if(e.key){var t=UN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=To(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?HN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bh,charCode:function(e){return e.type==="keypress"?To(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?To(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),IN=Gt(GN),VN=Be({},Bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rp=Gt(VN),YN=Be({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bh}),PN=Gt(YN),XN=Be({},Us,{propertyName:0,elapsedTime:0,pseudoElement:0}),KN=Gt(XN),QN=Be({},Bc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ZN=Gt(QN),FN=Be({},Us,{newState:0,oldState:0}),WN=Gt(FN),JN=[9,13,27,32],jh=ha&&"CompositionEvent"in window,Rl=null;ha&&"documentMode"in document&&(Rl=document.documentMode);var eS=ha&&"TextEvent"in window&&!Rl,Rv=ha&&(!jh||Rl&&8<Rl&&11>=Rl),Ap=" ",Mp=!1;function Av(e,t){switch(e){case"keyup":return JN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function tS(e,t){switch(e){case"compositionend":return Mv(t);case"keypress":return t.which!==32?null:(Mp=!0,Ap);case"textInput":return e=t.data,e===Ap&&Mp?null:e;default:return null}}function nS(e,t){if(or)return e==="compositionend"||!jh&&Av(e,t)?(e=Ev(),Co=yh=qa=null,or=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Rv&&t.locale!=="ko"?null:t.data;default:return null}}var aS={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 Op(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!aS[e.type]:t==="textarea"}function Ov(e,t,n,a){ir?vr?vr.push(a):vr=[a]:ir=a,t=fc(t,"onChange"),0<t.length&&(n=new Hc("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Al=null,Xl=null;function sS(e){Sb(e,0)}function qc(e){var t=jl(e);if(_v(t))return e}function Dp(e,t){if(e==="change")return t}var Dv=!1;if(ha){var Vu;if(ha){var Yu="oninput"in document;if(!Yu){var zp=document.createElement("div");zp.setAttribute("oninput","return;"),Yu=typeof zp.oninput=="function"}Vu=Yu}else Vu=!1;Dv=Vu&&(!document.documentMode||9<document.documentMode)}function $p(){Al&&(Al.detachEvent("onpropertychange",zv),Xl=Al=null)}function zv(e){if(e.propertyName==="value"&&qc(Xl)){var t=[];Ov(t,Xl,e,vh(e)),Tv(sS,t)}}function rS(e,t,n){e==="focusin"?($p(),Al=t,Xl=n,Al.attachEvent("onpropertychange",zv)):e==="focusout"&&$p()}function lS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qc(Xl)}function iS(e,t){if(e==="click")return qc(t)}function oS(e,t){if(e==="input"||e==="change")return qc(t)}function cS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is=="function"?Object.is:cS;function Kl(e,t){if(tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Yd.call(t,r)||!tn(e[r],t[r]))return!1}return!0}function Lp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Up(e,t){var n=Lp(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Lp(n)}}function $v(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$v(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lv(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ko(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ko(e.document)}return t}function wh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var uS=ha&&"documentMode"in document&&11>=document.documentMode,cr=null,Fd=null,Ml=null,Wd=!1;function Hp(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wd||cr==null||cr!==Ko(a)||(a=cr,"selectionStart"in a&&wh(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ml&&Kl(Ml,a)||(Ml=a,a=fc(Fd,"onSelect"),0<a.length&&(t=new Hc("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=cr)))}function hs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ur={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionrun:hs("Transition","TransitionRun"),transitionstart:hs("Transition","TransitionStart"),transitioncancel:hs("Transition","TransitionCancel"),transitionend:hs("Transition","TransitionEnd")},Pu={},Uv={};ha&&(Uv=document.createElement("div").style,"AnimationEvent"in window||(delete ur.animationend.animation,delete ur.animationiteration.animation,delete ur.animationstart.animation),"TransitionEvent"in window||delete ur.transitionend.transition);function Hs(e){if(Pu[e])return Pu[e];if(!ur[e])return e;var t=ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Uv)return Pu[e]=t[n];return e}var Hv=Hs("animationend"),Bv=Hs("animationiteration"),qv=Hs("animationstart"),dS=Hs("transitionrun"),fS=Hs("transitionstart"),hS=Hs("transitioncancel"),Gv=Hs("transitionend"),Iv=new Map,Jd="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(" ");Jd.push("scrollEnd");function Tn(e,t){Iv.set(e,t),Ls(t,[e])}var Bp=new WeakMap;function un(e,t){if(typeof e=="object"&&e!==null){var n=Bp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Np(t)},Bp.set(e,t),t)}return{value:e,source:t,stack:Np(t)}}var sn=[],dr=0,_h=0;function Gc(){for(var e=dr,t=_h=dr=0;t<e;){var n=sn[t];sn[t++]=null;var a=sn[t];sn[t++]=null;var r=sn[t];sn[t++]=null;var l=sn[t];if(sn[t++]=null,a!==null&&r!==null){var i=a.pending;i===null?r.next=r:(r.next=i.next,i.next=r),a.pending=r}l!==0&&Vv(n,r,l)}}function Ic(e,t,n,a){sn[dr++]=e,sn[dr++]=t,sn[dr++]=n,sn[dr++]=a,_h|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Nh(e,t,n,a){return Ic(e,t,n,a),Qo(e)}function Pr(e,t){return Ic(e,null,null,t),Qo(e)}function Vv(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,l=e.return;l!==null;)l.childLanes|=n,a=l.alternate,a!==null&&(a.childLanes|=n),l.tag===22&&(e=l.stateNode,e===null||e._visibility&1||(r=!0)),e=l,l=l.return;return e.tag===3?(l=e.stateNode,r&&t!==null&&(r=31-Zt(n),e=l.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),l):null}function Qo(e){if(50<Gl)throw Gl=0,jf=null,Error(H(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fr={};function mS(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,t,n,a){return new mS(e,t,n,a)}function Sh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function da(e,t){var n=e.alternate;return n===null?(n=Kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Yv(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Eo(e,t,n,a,r,l){var i=0;if(a=e,typeof e=="function")Sh(e)&&(i=1);else if(typeof e=="string")i=gk(e,n,zn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case qd:return e=Kt(31,n,t,r),e.elementType=qd,e.lanes=l,e;case sr:return js(n.children,r,l,t);case uv:i=8,r|=24;break;case Ud:return e=Kt(12,n,t,r|2),e.elementType=Ud,e.lanes=l,e;case Hd:return e=Kt(13,n,t,r),e.elementType=Hd,e.lanes=l,e;case Bd:return e=Kt(19,n,t,r),e.elementType=Bd,e.lanes=l,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case sN:case sa:i=10;break e;case dv:i=9;break e;case dh:i=11;break e;case fh:i=14;break e;case Da:i=16,a=null;break e}i=29,n=Error(H(130,e===null?"null":typeof e,"")),a=null}return t=Kt(i,n,t,r),t.elementType=e,t.type=a,t.lanes=l,t}function js(e,t,n,a){return e=Kt(7,e,a,t),e.lanes=n,e}function Xu(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function Ku(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hr=[],mr=0,Zo=null,Fo=0,ln=[],on=0,ws=null,ra=1,la="";function gs(e,t){hr[mr++]=Fo,hr[mr++]=Zo,Zo=e,Fo=t}function Pv(e,t,n){ln[on++]=ra,ln[on++]=la,ln[on++]=ws,ws=e;var a=ra;e=la;var r=32-Zt(a)-1;a&=~(1<<r),n+=1;var l=32-Zt(t)+r;if(30<l){var i=r-r%5;l=(a&(1<<i)-1).toString(32),a>>=i,r-=i,ra=1<<32-Zt(t)+r|n<<r|a,la=l+e}else ra=1<<l|n<<r|a,la=e}function kh(e){e.return!==null&&(gs(e,1),Pv(e,1,0))}function Ch(e){for(;e===Zo;)Zo=hr[--mr],hr[mr]=null,Fo=hr[--mr],hr[mr]=null;for(;e===ws;)ws=ln[--on],ln[on]=null,la=ln[--on],ln[on]=null,ra=ln[--on],ln[on]=null}var Ot=null,Qe=null,Te=!1,_s=null,An=!1,ef=Error(H(519));function Cs(e){var t=Error(H(418,""));throw Ql(un(t,e)),ef}function qp(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Et]=e,t[qt]=a,n){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(n=0;n<Wl.length;n++)_e(Wl[n],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),Nv(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Xo(t);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),kv(t,a.value,a.defaultValue,a.children),Xo(t)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Cb(t.textContent,n)?(a.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),a.onScroll!=null&&_e("scroll",t),a.onScrollEnd!=null&&_e("scrollend",t),a.onClick!=null&&(t.onclick=Fc),t=!0):t=!1,t||Cs(e)}function Gp(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Ot=Ot.return}}function dl(e){if(e!==Ot)return!1;if(!Te)return Gp(e),Te=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Cf(e.type,e.memoizedProps)),n=!n),n&&Qe&&Cs(e),Gp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Qe=wn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Qe=null}}else t===27?(t=Qe,is(e.type)?(e=Rf,Rf=null,Qe=e):Qe=t):Qe=Ot?wn(e.stateNode.nextSibling):null;return!0}function vi(){Qe=Ot=null,Te=!1}function Ip(){var e=_s;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),_s=null),e}function Ql(e){_s===null?_s=[e]:_s.push(e)}var tf=Vn(null),Bs=null,ia=null;function $a(e,t,n){Ie(tf,t._currentValue),t._currentValue=n}function fa(e){e._currentValue=tf.current,vt(tf)}function nf(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function af(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var l=r.dependencies;if(l!==null){var i=r.child;l=l.firstContext;e:for(;l!==null;){var o=l;l=r;for(var c=0;c<t.length;c++)if(o.context===t[c]){l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),nf(l.return,n,e),a||(i=null);break e}l=o.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(H(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),nf(i,n,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function yi(e,t,n,a){e=null;for(var r=t,l=!1;r!==null;){if(!l){if(r.flags&524288)l=!0;else if(r.flags&262144)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(H(387));if(i=i.memoizedProps,i!==null){var o=r.type;tn(r.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(r===Io.current){if(i=r.alternate,i===null)throw Error(H(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(ti):e=[ti])}r=r.return}e!==null&&af(t,e,n,a),t.flags|=262144}function Wo(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ts(e){Bs=e,ia=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return Xv(Bs,e)}function to(e,t){return Bs===null&&Ts(e),Xv(e,t)}function Xv(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ia===null){if(e===null)throw Error(H(308));ia=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ia=ia.next=t;return n}var pS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},gS=ft.unstable_scheduleCallback,xS=ft.unstable_NormalPriority,ut={$$typeof:sa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Th(){return{controller:new pS,data:new Map,refCount:0}}function bi(e){e.refCount--,e.refCount===0&&gS(xS,function(){e.controller.abort()})}var Ol=null,sf=0,Ar=0,yr=null;function vS(e,t){if(Ol===null){var n=Ol=[];sf=0,Ar=Fh(),yr={status:"pending",value:void 0,then:function(a){n.push(a)}}}return sf++,t.then(Vp,Vp),t}function Vp(){if(--sf===0&&Ol!==null){yr!==null&&(yr.status="fulfilled");var e=Ol;Ol=null,Ar=0,yr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function yS(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var Yp=le.S;le.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&vS(e,t),Yp!==null&&Yp(e,t)};var Ns=Vn(null);function Eh(){var e=Ns.current;return e!==null?e:He.pooledCache}function Ro(e,t){t===null?Ie(Ns,Ns.current):Ie(Ns,t.pool)}function Kv(){var e=Eh();return e===null?null:{parent:ut._currentValue,pool:e}}var ji=Error(H(460)),Qv=Error(H(474)),Vc=Error(H(542)),rf={then:function(){}};function Pp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function no(){}function Zv(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(no,no),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kp(e),e;default:if(typeof t.status=="string")t.then(no,no);else{if(e=He,e!==null&&100<e.shellSuspendCounter)throw Error(H(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kp(e),e}throw Dl=t,ji}}var Dl=null;function Xp(){if(Dl===null)throw Error(H(459));var e=Dl;return Dl=null,e}function Kp(e){if(e===ji||e===Vc)throw Error(H(483))}var za=!1;function Rh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,Me&2){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=Qo(e),Vv(e,null,n),t}return Ic(e,a,t,n),Qo(e)}function zl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,vv(e,n)}}function Qu(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};l===null?r=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?r=l=t:l=l.next=t}else r=l=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:l,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var of=!1;function $l(){if(of){var e=yr;if(e!==null)throw e}}function Ll(e,t,n,a){of=!1;var r=e.updateQueue;za=!1;var l=r.firstBaseUpdate,i=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?l=d:i.next=d,i=c;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==i&&(o===null?f.firstBaseUpdate=d:o.next=d,f.lastBaseUpdate=c))}if(l!==null){var h=r.baseState;i=0,f=d=c=null,o=l;do{var m=o.lane&-536870913,x=m!==o.lane;if(x?(ke&m)===m:(a&m)===m){m!==0&&m===Ar&&(of=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var j=e,y=o;m=t;var b=n;switch(y.tag){case 1:if(j=y.payload,typeof j=="function"){h=j.call(b,h,m);break e}h=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=y.payload,m=typeof j=="function"?j.call(b,h,m):j,m==null)break e;h=Be({},h,m);break e;case 2:za=!0}}m=o.callback,m!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[m]:x.push(m))}else x={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=x,c=h):f=f.next=x,i|=m;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;x=o,o=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);f===null&&(c=h),r.baseState=c,r.firstBaseUpdate=d,r.lastBaseUpdate=f,l===null&&(r.shared.lanes=0),ns|=i,e.lanes=i,e.memoizedState=h}}function Fv(e,t){if(typeof e!="function")throw Error(H(191,e));e.call(t)}function Wv(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Fv(n[e],t)}var Mr=Vn(null),Jo=Vn(0);function Qp(e,t){e=ga,Ie(Jo,e),Ie(Mr,t),ga=e|t.baseLanes}function cf(){Ie(Jo,ga),Ie(Mr,Mr.current)}function Ah(){ga=Jo.current,vt(Mr),vt(Jo)}var es=0,we=null,$e=null,st=null,ec=!1,br=!1,Es=!1,tc=0,Zl=0,jr=null,bS=0;function Je(){throw Error(H(321))}function Mh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!tn(e[n],t[n]))return!1;return!0}function Oh(e,t,n,a,r,l){return es=l,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,le.H=e===null||e.memoizedState===null?Ey:Ry,Es=!1,l=n(a,r),Es=!1,br&&(l=ey(t,n,a,r)),Jv(e),l}function Jv(e){le.H=nc;var t=$e!==null&&$e.next!==null;if(es=0,st=$e=we=null,ec=!1,Zl=0,jr=null,t)throw Error(H(300));e===null||xt||(e=e.dependencies,e!==null&&Wo(e)&&(xt=!0))}function ey(e,t,n,a){we=e;var r=0;do{if(br&&(jr=null),Zl=0,br=!1,25<=r)throw Error(H(301));if(r+=1,st=$e=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}le.H=CS,l=t(n,a)}while(br);return l}function jS(){var e=le.H,t=e.useState()[0];return t=typeof t.then=="function"?wi(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(we.flags|=1024),t}function Dh(){var e=tc!==0;return tc=0,e}function zh(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $h(e){if(ec){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ec=!1}es=0,st=$e=we=null,br=!1,Zl=tc=0,jr=null}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?we.memoizedState=st=e:st=st.next=e,st}function rt(){if($e===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=st===null?we.memoizedState:st.next;if(t!==null)st=t,$e=e;else{if(e===null)throw we.alternate===null?Error(H(467)):Error(H(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},st===null?we.memoizedState=st=e:st=st.next=e}return st}function Lh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wi(e){var t=Zl;return Zl+=1,jr===null&&(jr=[]),e=Zv(jr,e,t),t=we,(st===null?t.memoizedState:st.next)===null&&(t=t.alternate,le.H=t===null||t.memoizedState===null?Ey:Ry),e}function Yc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wi(e);if(e.$$typeof===sa)return Rt(e)}throw Error(H(438,String(e)))}function Uh(e){var t=null,n=we.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=we.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Lh(),we.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=rN;return t.index++,n}function ma(e,t){return typeof t=="function"?t(e):t}function Ao(e){var t=rt();return Hh(t,$e,e)}function Hh(e,t,n){var a=e.queue;if(a===null)throw Error(H(311));a.lastRenderedReducer=n;var r=e.baseQueue,l=a.pending;if(l!==null){if(r!==null){var i=r.next;r.next=l.next,l.next=i}t.baseQueue=r=l,a.pending=null}if(l=e.baseState,r===null)e.memoizedState=l;else{t=r.next;var o=i=null,c=null,d=t,f=!1;do{var h=d.lane&-536870913;if(h!==d.lane?(ke&h)===h:(es&h)===h){var m=d.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),h===Ar&&(f=!0);else if((es&m)===m){d=d.next,m===Ar&&(f=!0);continue}else h={lane:0,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=h,i=l):c=c.next=h,we.lanes|=m,ns|=m;h=d.action,Es&&n(l,h),l=d.hasEagerState?d.eagerState:n(l,h)}else m={lane:h,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=m,i=l):c=c.next=m,we.lanes|=h,ns|=h;d=d.next}while(d!==null&&d!==t);if(c===null?i=l:c.next=o,!tn(l,e.memoizedState)&&(xt=!0,f&&(n=yr,n!==null)))throw n;e.memoizedState=l,e.baseState=i,e.baseQueue=c,a.lastRenderedState=l}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Zu(e){var t=rt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,l=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do l=e(l,i.action),i=i.next;while(i!==r);tn(l,t.memoizedState)||(xt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,a]}function ty(e,t,n){var a=we,r=rt(),l=Te;if(l){if(n===void 0)throw Error(H(407));n=n()}else n=t();var i=!tn(($e||r).memoizedState,n);i&&(r.memoizedState=n,xt=!0),r=r.queue;var o=sy.bind(null,a,r,e);if(_i(2048,8,o,[e]),r.getSnapshot!==t||i||st!==null&&st.memoizedState.tag&1){if(a.flags|=2048,Or(9,Pc(),ay.bind(null,a,r,n,t),null),He===null)throw Error(H(349));l||es&124||ny(a,t,n)}return n}function ny(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=we.updateQueue,t===null?(t=Lh(),we.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ay(e,t,n,a){t.value=n,t.getSnapshot=a,ry(t)&&ly(e)}function sy(e,t,n){return n(function(){ry(t)&&ly(e)})}function ry(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tn(e,n)}catch{return!0}}function ly(e){var t=Pr(e,2);t!==null&&Wt(t,e,2)}function uf(e){var t=Ut();if(typeof e=="function"){var n=e;if(e=n(),Es){Ba(!0);try{n()}finally{Ba(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:e},t}function iy(e,t,n,a){return e.baseState=n,Hh(e,$e,typeof a=="function"?a:ma)}function wS(e,t,n,a,r){if(Xc(e))throw Error(H(485));if(e=t.action,e!==null){var l={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){l.listeners.push(i)}};le.T!==null?n(!0):l.isTransition=!1,a(l),n=t.pending,n===null?(l.next=t.pending=l,oy(t,l)):(l.next=n.next,t.pending=n.next=l)}}function oy(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var l=le.T,i={};le.T=i;try{var o=n(r,a),c=le.S;c!==null&&c(i,o),Zp(e,t,o)}catch(d){df(e,t,d)}finally{le.T=l}}else try{l=n(r,a),Zp(e,t,l)}catch(d){df(e,t,d)}}function Zp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Fp(e,t,a)},function(a){return df(e,t,a)}):Fp(e,t,n)}function Fp(e,t,n){t.status="fulfilled",t.value=n,cy(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,oy(e,n)))}function df(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,cy(t),t=t.next;while(t!==a)}e.action=null}function cy(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function uy(e,t){return t}function Wp(e,t){if(Te){var n=He.formState;if(n!==null){e:{var a=we;if(Te){if(Qe){t:{for(var r=Qe,l=An;r.nodeType!==8;){if(!l){r=null;break t}if(r=wn(r.nextSibling),r===null){r=null;break t}}l=r.data,r=l==="F!"||l==="F"?r:null}if(r){Qe=wn(r.nextSibling),a=r.data==="F!";break e}}Cs(a)}a=!1}a&&(t=n[0])}}return n=Ut(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uy,lastRenderedState:t},n.queue=a,n=ky.bind(null,we,a),a.dispatch=n,a=uf(!1),l=Ih.bind(null,we,!1,a.queue),a=Ut(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=wS.bind(null,we,r,l,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function Jp(e){var t=rt();return dy(t,$e,e)}function dy(e,t,n){if(t=Hh(e,t,uy)[0],e=Ao(ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=wi(t)}catch(i){throw i===ji?Vc:i}else a=t;t=rt();var r=t.queue,l=r.dispatch;return n!==t.memoizedState&&(we.flags|=2048,Or(9,Pc(),_S.bind(null,r,n),null)),[a,l,e]}function _S(e,t){e.action=t}function eg(e){var t=rt(),n=$e;if(n!==null)return dy(t,n,e);rt(),t=t.memoizedState,n=rt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Or(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=we.updateQueue,t===null&&(t=Lh(),we.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Pc(){return{destroy:void 0,resource:void 0}}function fy(){return rt().memoizedState}function Mo(e,t,n,a){var r=Ut();a=a===void 0?null:a,we.flags|=e,r.memoizedState=Or(1|t,Pc(),n,a)}function _i(e,t,n,a){var r=rt();a=a===void 0?null:a;var l=r.memoizedState.inst;$e!==null&&a!==null&&Mh(a,$e.memoizedState.deps)?r.memoizedState=Or(t,l,n,a):(we.flags|=e,r.memoizedState=Or(1|t,l,n,a))}function tg(e,t){Mo(8390656,8,e,t)}function hy(e,t){_i(2048,8,e,t)}function my(e,t){return _i(4,2,e,t)}function py(e,t){return _i(4,4,e,t)}function gy(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xy(e,t,n){n=n!=null?n.concat([e]):null,_i(4,4,gy.bind(null,t,e),n)}function Bh(){}function vy(e,t){var n=rt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Mh(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function yy(e,t){var n=rt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Mh(t,a[1]))return a[0];if(a=e(),Es){Ba(!0);try{e()}finally{Ba(!1)}}return n.memoizedState=[a,t],a}function qh(e,t,n){return n===void 0||es&1073741824?e.memoizedState=t:(e.memoizedState=n,e=cb(),we.lanes|=e,ns|=e,n)}function by(e,t,n,a){return tn(n,t)?n:Mr.current!==null?(e=qh(e,n,a),tn(e,t)||(xt=!0),e):es&42?(e=cb(),we.lanes|=e,ns|=e,t):(xt=!0,e.memoizedState=n)}function jy(e,t,n,a,r){var l=Ee.p;Ee.p=l!==0&&8>l?l:8;var i=le.T,o={};le.T=o,Ih(e,!1,t,n);try{var c=r(),d=le.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=yS(c,a);Ul(e,t,f,Ft(e))}else Ul(e,t,a,Ft(e))}catch(h){Ul(e,t,{then:function(){},status:"rejected",reason:h},Ft())}finally{Ee.p=l,le.T=i}}function NS(){}function ff(e,t,n,a){if(e.tag!==5)throw Error(H(476));var r=wy(e).queue;jy(e,r,t,bs,n===null?NS:function(){return _y(e),n(a)})}function wy(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:bs,baseState:bs,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:bs},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _y(e){var t=wy(e).next.queue;Ul(e,t,{},Ft())}function Gh(){return Rt(ti)}function Ny(){return rt().memoizedState}function Sy(){return rt().memoizedState}function SS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ft();e=Pa(n);var a=Xa(t,e,n);a!==null&&(Wt(a,t,n),zl(a,t,n)),t={cache:Th()},e.payload=t;return}t=t.return}}function kS(e,t,n){var a=Ft();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Xc(e)?Cy(t,n):(n=Nh(e,t,n,a),n!==null&&(Wt(n,e,a),Ty(n,t,a)))}function ky(e,t,n){var a=Ft();Ul(e,t,n,a)}function Ul(e,t,n,a){var r={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xc(e))Cy(t,r);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,o=l(i,n);if(r.hasEagerState=!0,r.eagerState=o,tn(o,i))return Ic(e,t,r,0),He===null&&Gc(),!1}catch{}finally{}if(n=Nh(e,t,r,a),n!==null)return Wt(n,e,a),Ty(n,t,a),!0}return!1}function Ih(e,t,n,a){if(a={lane:2,revertLane:Fh(),action:a,hasEagerState:!1,eagerState:null,next:null},Xc(e)){if(t)throw Error(H(479))}else t=Nh(e,n,a,2),t!==null&&Wt(t,e,2)}function Xc(e){var t=e.alternate;return e===we||t!==null&&t===we}function Cy(e,t){br=ec=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ty(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,vv(e,n)}}var nc={readContext:Rt,use:Yc,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je},Ey={readContext:Rt,use:Yc,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:tg,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Mo(4194308,4,gy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mo(4194308,4,e,t)},useInsertionEffect:function(e,t){Mo(4,2,e,t)},useMemo:function(e,t){var n=Ut();t=t===void 0?null:t;var a=e();if(Es){Ba(!0);try{e()}finally{Ba(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Ut();if(n!==void 0){var r=n(t);if(Es){Ba(!0);try{n(t)}finally{Ba(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=kS.bind(null,we,e),[a.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:function(e){e=uf(e);var t=e.queue,n=ky.bind(null,we,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bh,useDeferredValue:function(e,t){var n=Ut();return qh(n,e,t)},useTransition:function(){var e=uf(!1);return e=jy.bind(null,we,e.queue,!0,!1),Ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=we,r=Ut();if(Te){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),He===null)throw Error(H(349));ke&124||ny(a,t,n)}r.memoizedState=n;var l={value:n,getSnapshot:t};return r.queue=l,tg(sy.bind(null,a,l,e),[e]),a.flags|=2048,Or(9,Pc(),ay.bind(null,a,l,n,t),null),n},useId:function(){var e=Ut(),t=He.identifierPrefix;if(Te){var n=la,a=ra;n=(a&~(1<<32-Zt(a)-1)).toString(32)+n,t="«"+t+"R"+n,n=tc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=bS++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Gh,useFormState:Wp,useActionState:Wp,useOptimistic:function(e){var t=Ut();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ih.bind(null,we,!0,n),n.dispatch=t,[e,t]},useMemoCache:Uh,useCacheRefresh:function(){return Ut().memoizedState=SS.bind(null,we)}},Ry={readContext:Rt,use:Yc,useCallback:vy,useContext:Rt,useEffect:hy,useImperativeHandle:xy,useInsertionEffect:my,useLayoutEffect:py,useMemo:yy,useReducer:Ao,useRef:fy,useState:function(){return Ao(ma)},useDebugValue:Bh,useDeferredValue:function(e,t){var n=rt();return by(n,$e.memoizedState,e,t)},useTransition:function(){var e=Ao(ma)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:wi(e),t]},useSyncExternalStore:ty,useId:Ny,useHostTransitionStatus:Gh,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,t){var n=rt();return iy(n,$e,e,t)},useMemoCache:Uh,useCacheRefresh:Sy},CS={readContext:Rt,use:Yc,useCallback:vy,useContext:Rt,useEffect:hy,useImperativeHandle:xy,useInsertionEffect:my,useLayoutEffect:py,useMemo:yy,useReducer:Zu,useRef:fy,useState:function(){return Zu(ma)},useDebugValue:Bh,useDeferredValue:function(e,t){var n=rt();return $e===null?qh(n,e,t):by(n,$e.memoizedState,e,t)},useTransition:function(){var e=Zu(ma)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:wi(e),t]},useSyncExternalStore:ty,useId:Ny,useHostTransitionStatus:Gh,useFormState:eg,useActionState:eg,useOptimistic:function(e,t){var n=rt();return $e!==null?iy(n,$e,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Uh,useCacheRefresh:Sy},wr=null,Fl=0;function ao(e){var t=Fl;return Fl+=1,wr===null&&(wr=[]),Zv(wr,e,t)}function fl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function so(e,t){throw t.$$typeof===aN?Error(H(525)):(e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ng(e){var t=e._init;return t(e._payload)}function Ay(e){function t(g,p){if(e){var v=g.deletions;v===null?(g.deletions=[p],g.flags|=16):v.push(p)}}function n(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function a(g){for(var p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function r(g,p){return g=da(g,p),g.index=0,g.sibling=null,g}function l(g,p,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<p?(g.flags|=67108866,p):v):(g.flags|=67108866,p)):(g.flags|=1048576,p)}function i(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,p,v,w){return p===null||p.tag!==6?(p=Xu(v,g.mode,w),p.return=g,p):(p=r(p,v),p.return=g,p)}function c(g,p,v,w){var _=v.type;return _===sr?f(g,p,v.props.children,w,v.key):p!==null&&(p.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Da&&ng(_)===p.type)?(p=r(p,v.props),fl(p,v),p.return=g,p):(p=Eo(v.type,v.key,v.props,null,g.mode,w),fl(p,v),p.return=g,p)}function d(g,p,v,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=Ku(v,g.mode,w),p.return=g,p):(p=r(p,v.children||[]),p.return=g,p)}function f(g,p,v,w,_){return p===null||p.tag!==7?(p=js(v,g.mode,w,_),p.return=g,p):(p=r(p,v),p.return=g,p)}function h(g,p,v){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Xu(""+p,g.mode,v),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Zi:return v=Eo(p.type,p.key,p.props,null,g.mode,v),fl(v,p),v.return=g,v;case yl:return p=Ku(p,g.mode,v),p.return=g,p;case Da:var w=p._init;return p=w(p._payload),h(g,p,v)}if(bl(p)||ol(p))return p=js(p,g.mode,v,null),p.return=g,p;if(typeof p.then=="function")return h(g,ao(p),v);if(p.$$typeof===sa)return h(g,to(g,p),v);so(g,p)}return null}function m(g,p,v,w){var _=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:o(g,p,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Zi:return v.key===_?c(g,p,v,w):null;case yl:return v.key===_?d(g,p,v,w):null;case Da:return _=v._init,v=_(v._payload),m(g,p,v,w)}if(bl(v)||ol(v))return _!==null?null:f(g,p,v,w,null);if(typeof v.then=="function")return m(g,p,ao(v),w);if(v.$$typeof===sa)return m(g,p,to(g,v),w);so(g,v)}return null}function x(g,p,v,w,_){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return g=g.get(v)||null,o(p,g,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Zi:return g=g.get(w.key===null?v:w.key)||null,c(p,g,w,_);case yl:return g=g.get(w.key===null?v:w.key)||null,d(p,g,w,_);case Da:var S=w._init;return w=S(w._payload),x(g,p,v,w,_)}if(bl(w)||ol(w))return g=g.get(v)||null,f(p,g,w,_,null);if(typeof w.then=="function")return x(g,p,v,ao(w),_);if(w.$$typeof===sa)return x(g,p,v,to(p,w),_);so(p,w)}return null}function j(g,p,v,w){for(var _=null,S=null,N=p,k=p=0,R=null;N!==null&&k<v.length;k++){N.index>k?(R=N,N=null):R=N.sibling;var M=m(g,N,v[k],w);if(M===null){N===null&&(N=R);break}e&&N&&M.alternate===null&&t(g,N),p=l(M,p,k),S===null?_=M:S.sibling=M,S=M,N=R}if(k===v.length)return n(g,N),Te&&gs(g,k),_;if(N===null){for(;k<v.length;k++)N=h(g,v[k],w),N!==null&&(p=l(N,p,k),S===null?_=N:S.sibling=N,S=N);return Te&&gs(g,k),_}for(N=a(N);k<v.length;k++)R=x(N,g,k,v[k],w),R!==null&&(e&&R.alternate!==null&&N.delete(R.key===null?k:R.key),p=l(R,p,k),S===null?_=R:S.sibling=R,S=R);return e&&N.forEach(function(z){return t(g,z)}),Te&&gs(g,k),_}function y(g,p,v,w){if(v==null)throw Error(H(151));for(var _=null,S=null,N=p,k=p=0,R=null,M=v.next();N!==null&&!M.done;k++,M=v.next()){N.index>k?(R=N,N=null):R=N.sibling;var z=m(g,N,M.value,w);if(z===null){N===null&&(N=R);break}e&&N&&z.alternate===null&&t(g,N),p=l(z,p,k),S===null?_=z:S.sibling=z,S=z,N=R}if(M.done)return n(g,N),Te&&gs(g,k),_;if(N===null){for(;!M.done;k++,M=v.next())M=h(g,M.value,w),M!==null&&(p=l(M,p,k),S===null?_=M:S.sibling=M,S=M);return Te&&gs(g,k),_}for(N=a(N);!M.done;k++,M=v.next())M=x(N,g,k,M.value,w),M!==null&&(e&&M.alternate!==null&&N.delete(M.key===null?k:M.key),p=l(M,p,k),S===null?_=M:S.sibling=M,S=M);return e&&N.forEach(function(U){return t(g,U)}),Te&&gs(g,k),_}function b(g,p,v,w){if(typeof v=="object"&&v!==null&&v.type===sr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Zi:e:{for(var _=v.key;p!==null;){if(p.key===_){if(_=v.type,_===sr){if(p.tag===7){n(g,p.sibling),w=r(p,v.props.children),w.return=g,g=w;break e}}else if(p.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Da&&ng(_)===p.type){n(g,p.sibling),w=r(p,v.props),fl(w,v),w.return=g,g=w;break e}n(g,p);break}else t(g,p);p=p.sibling}v.type===sr?(w=js(v.props.children,g.mode,w,v.key),w.return=g,g=w):(w=Eo(v.type,v.key,v.props,null,g.mode,w),fl(w,v),w.return=g,g=w)}return i(g);case yl:e:{for(_=v.key;p!==null;){if(p.key===_)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(g,p.sibling),w=r(p,v.children||[]),w.return=g,g=w;break e}else{n(g,p);break}else t(g,p);p=p.sibling}w=Ku(v,g.mode,w),w.return=g,g=w}return i(g);case Da:return _=v._init,v=_(v._payload),b(g,p,v,w)}if(bl(v))return j(g,p,v,w);if(ol(v)){if(_=ol(v),typeof _!="function")throw Error(H(150));return v=_.call(v),y(g,p,v,w)}if(typeof v.then=="function")return b(g,p,ao(v),w);if(v.$$typeof===sa)return b(g,p,to(g,v),w);so(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,p!==null&&p.tag===6?(n(g,p.sibling),w=r(p,v),w.return=g,g=w):(n(g,p),w=Xu(v,g.mode,w),w.return=g,g=w),i(g)):n(g,p)}return function(g,p,v,w){try{Fl=0;var _=b(g,p,v,w);return wr=null,_}catch(N){if(N===ji||N===Vc)throw N;var S=Kt(29,N,null,g.mode);return S.lanes=w,S.return=g,S}finally{}}}var Dr=Ay(!0),My=Ay(!1),pn=Vn(null),Ln=null;function La(e){var t=e.alternate;Ie(dt,dt.current&1),Ie(pn,e),Ln===null&&(t===null||Mr.current!==null||t.memoizedState!==null)&&(Ln=e)}function Oy(e){if(e.tag===22){if(Ie(dt,dt.current),Ie(pn,e),Ln===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Ln=e)}}else Ua()}function Ua(){Ie(dt,dt.current),Ie(pn,pn.current)}function oa(e){vt(pn),Ln===e&&(Ln=null),vt(dt)}var dt=Vn(0);function ac(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Ef(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Fu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:Be({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hf={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Ft(),r=Pa(a);r.payload=t,n!=null&&(r.callback=n),t=Xa(e,r,a),t!==null&&(Wt(t,e,a),zl(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Ft(),r=Pa(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Xa(e,r,a),t!==null&&(Wt(t,e,a),zl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ft(),a=Pa(n);a.tag=2,t!=null&&(a.callback=t),t=Xa(e,a,n),t!==null&&(Wt(t,e,n),zl(t,e,n))}};function ag(e,t,n,a,r,l,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,l,i):t.prototype&&t.prototype.isPureReactComponent?!Kl(n,a)||!Kl(r,l):!0}function sg(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&hf.enqueueReplaceState(t,t.state,null)}function Rs(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=Be({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var sc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Dy(e){sc(e)}function zy(e){console.error(e)}function $y(e){sc(e)}function rc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function rg(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function mf(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){rc(e,t)},n}function Ly(e){return e=Pa(e),e.tag=3,e}function Uy(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var l=a.value;e.payload=function(){return r(l)},e.callback=function(){rg(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){rg(t,n,a),typeof r!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var o=a.stack;this.componentDidCatch(a.value,{componentStack:o!==null?o:""})})}function TS(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&yi(t,n,r,!0),n=pn.current,n!==null){switch(n.tag){case 13:return Ln===null?wf():n.alternate===null&&Fe===0&&(Fe=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===rf?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),od(e,a,r)),!1;case 22:return n.flags|=65536,a===rf?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),od(e,a,r)),!1}throw Error(H(435,n.tag))}return od(e,a,r),wf(),!1}if(Te)return t=pn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==ef&&(e=Error(H(422),{cause:a}),Ql(un(e,n)))):(a!==ef&&(t=Error(H(423),{cause:a}),Ql(un(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=un(a,n),r=mf(e.stateNode,a,r),Qu(e,r),Fe!==4&&(Fe=2)),!1;var l=Error(H(520),{cause:a});if(l=un(l,n),ql===null?ql=[l]:ql.push(l),Fe!==4&&(Fe=2),t===null)return!0;a=un(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=mf(n.stateNode,a,e),Qu(n,e),!1;case 1:if(t=n.type,l=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(Ka===null||!Ka.has(l))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Ly(r),Uy(r,e,n,a),Qu(n,r),!1}n=n.return}while(n!==null);return!1}var Hy=Error(H(461)),xt=!1;function jt(e,t,n,a){t.child=e===null?My(t,null,n,a):Dr(t,e.child,n,a)}function lg(e,t,n,a,r){n=n.render;var l=t.ref;if("ref"in a){var i={};for(var o in a)o!=="ref"&&(i[o]=a[o])}else i=a;return Ts(t),a=Oh(e,t,n,i,l,r),o=Dh(),e!==null&&!xt?(zh(e,t,r),pa(e,t,r)):(Te&&o&&kh(t),t.flags|=1,jt(e,t,a,r),t.child)}function ig(e,t,n,a,r){if(e===null){var l=n.type;return typeof l=="function"&&!Sh(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,By(e,t,l,a,r)):(e=Eo(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!Vh(e,r)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:Kl,n(i,a)&&e.ref===t.ref)return pa(e,t,r)}return t.flags|=1,e=da(l,a),e.ref=t.ref,e.return=t,t.child=e}function By(e,t,n,a,r){if(e!==null){var l=e.memoizedProps;if(Kl(l,a)&&e.ref===t.ref)if(xt=!1,t.pendingProps=a=l,Vh(e,r))e.flags&131072&&(xt=!0);else return t.lanes=e.lanes,pa(e,t,r)}return pf(e,t,n,a,r)}function qy(e,t,n){var a=t.pendingProps,r=a.children,l=e!==null?e.memoizedState:null;if(a.mode==="hidden"){if(t.flags&128){if(a=l!==null?l.baseLanes|n:n,e!==null){for(r=t.child=e.child,l=0;r!==null;)l=l|r.lanes|r.childLanes,r=r.sibling;t.childLanes=l&~a}else t.childLanes=0,t.child=null;return og(e,t,a,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ro(t,l!==null?l.cachePool:null),l!==null?Qp(t,l):cf(),Oy(t);else return t.lanes=t.childLanes=536870912,og(e,t,l!==null?l.baseLanes|n:n,n)}else l!==null?(Ro(t,l.cachePool),Qp(t,l),Ua(),t.memoizedState=null):(e!==null&&Ro(t,null),cf(),Ua());return jt(e,t,r,n),t.child}function og(e,t,n,a){var r=Eh();return r=r===null?null:{parent:ut._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Ro(t,null),cf(),Oy(t),e!==null&&yi(e,t,a,!0),null}function Oo(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(H(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pf(e,t,n,a,r){return Ts(t),n=Oh(e,t,n,a,void 0,r),a=Dh(),e!==null&&!xt?(zh(e,t,r),pa(e,t,r)):(Te&&a&&kh(t),t.flags|=1,jt(e,t,n,r),t.child)}function cg(e,t,n,a,r,l){return Ts(t),t.updateQueue=null,n=ey(t,a,n,r),Jv(e),a=Dh(),e!==null&&!xt?(zh(e,t,l),pa(e,t,l)):(Te&&a&&kh(t),t.flags|=1,jt(e,t,n,l),t.child)}function ug(e,t,n,a,r){if(Ts(t),t.stateNode===null){var l=fr,i=n.contextType;typeof i=="object"&&i!==null&&(l=Rt(i)),l=new n(a,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=hf,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=a,l.state=t.memoizedState,l.refs={},Rh(t),i=n.contextType,l.context=typeof i=="object"&&i!==null?Rt(i):fr,l.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Fu(t,n,i,a),l.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(i=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),i!==l.state&&hf.enqueueReplaceState(l,l.state,null),Ll(t,a,l,r),$l(),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){l=t.stateNode;var o=t.memoizedProps,c=Rs(n,o);l.props=c;var d=l.context,f=n.contextType;i=fr,typeof f=="object"&&f!==null&&(i=Rt(f));var h=n.getDerivedStateFromProps;f=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o||d!==i)&&sg(t,l,a,i),za=!1;var m=t.memoizedState;l.state=m,Ll(t,a,l,r),$l(),d=t.memoizedState,o||m!==d||za?(typeof h=="function"&&(Fu(t,n,h,a),d=t.memoizedState),(c=za||ag(t,n,c,a,m,d,i))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=d),l.props=a,l.state=d,l.context=i,a=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{l=t.stateNode,lf(e,t),i=t.memoizedProps,f=Rs(n,i),l.props=f,h=t.pendingProps,m=l.context,d=n.contextType,c=fr,typeof d=="object"&&d!==null&&(c=Rt(d)),o=n.getDerivedStateFromProps,(d=typeof o=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==h||m!==c)&&sg(t,l,a,c),za=!1,m=t.memoizedState,l.state=m,Ll(t,a,l,r),$l();var x=t.memoizedState;i!==h||m!==x||za||e!==null&&e.dependencies!==null&&Wo(e.dependencies)?(typeof o=="function"&&(Fu(t,n,o,a),x=t.memoizedState),(f=za||ag(t,n,f,a,m,x,c)||e!==null&&e.dependencies!==null&&Wo(e.dependencies))?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(a,x,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(a,x,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=x),l.props=a,l.state=x,l.context=c,a=f):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),a=!1)}return l=a,Oo(e,t),a=(t.flags&128)!==0,l||a?(l=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:l.render(),t.flags|=1,e!==null&&a?(t.child=Dr(t,e.child,null,r),t.child=Dr(t,null,n,r)):jt(e,t,n,r),t.memoizedState=l.state,e=t.child):e=pa(e,t,r),e}function dg(e,t,n,a){return vi(),t.flags|=256,jt(e,t,n,a),t.child}var Wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ju(e){return{baseLanes:e,cachePool:Kv()}}function ed(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=dn),e}function Gy(e,t,n){var a=t.pendingProps,r=!1,l=(t.flags&128)!==0,i;if((i=l)||(i=e!==null&&e.memoizedState===null?!1:(dt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(r?La(t):Ua(),Te){var o=Qe,c;if(c=o){e:{for(c=o,o=An;c.nodeType!==8;){if(!o){o=null;break e}if(c=wn(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:ws!==null?{id:ra,overflow:la}:null,retryLane:536870912,hydrationErrors:null},c=Kt(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,Ot=t,Qe=null,c=!0):c=!1}c||Cs(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return Ef(o)?t.lanes=32:t.lanes=536870912,null;oa(t)}return o=a.children,a=a.fallback,r?(Ua(),r=t.mode,o=lc({mode:"hidden",children:o},r),a=js(a,r,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,r=t.child,r.memoizedState=Ju(n),r.childLanes=ed(e,i,n),t.memoizedState=Wu,a):(La(t),gf(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(l)t.flags&256?(La(t),t.flags&=-257,t=td(e,t,n)):t.memoizedState!==null?(Ua(),t.child=e.child,t.flags|=128,t=null):(Ua(),r=a.fallback,o=t.mode,a=lc({mode:"visible",children:a.children},o),r=js(r,o,n,null),r.flags|=2,a.return=t,r.return=t,a.sibling=r,t.child=a,Dr(t,e.child,null,n),a=t.child,a.memoizedState=Ju(n),a.childLanes=ed(e,i,n),t.memoizedState=Wu,t=r);else if(La(t),Ef(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(H(419)),a.stack="",a.digest=i,Ql({value:a,source:null,stack:null}),t=td(e,t,n)}else if(xt||yi(e,t,n,!1),i=(n&e.childLanes)!==0,xt||i){if(i=He,i!==null&&(a=n&-n,a=a&42?1:mh(a),a=a&(i.suspendedLanes|n)?0:a,a!==0&&a!==c.retryLane))throw c.retryLane=a,Pr(e,a),Wt(i,e,a),Hy;o.data==="$?"||wf(),t=td(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Qe=wn(o.nextSibling),Ot=t,Te=!0,_s=null,An=!1,e!==null&&(ln[on++]=ra,ln[on++]=la,ln[on++]=ws,ra=e.id,la=e.overflow,ws=t),t=gf(t,a.children),t.flags|=4096);return t}return r?(Ua(),r=a.fallback,o=t.mode,c=e.child,d=c.sibling,a=da(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?r=da(d,r):(r=js(r,o,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,a=r,r=t.child,o=e.child.memoizedState,o===null?o=Ju(n):(c=o.cachePool,c!==null?(d=ut._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=Kv(),o={baseLanes:o.baseLanes|n,cachePool:c}),r.memoizedState=o,r.childLanes=ed(e,i,n),t.memoizedState=Wu,a):(La(t),n=e.child,e=n.sibling,n=da(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function gf(e,t){return t=lc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function lc(e,t){return e=Kt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function td(e,t,n){return Dr(t,e.child,null,n),e=gf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fg(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),nf(e.return,t,n)}function nd(e,t,n,a,r){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=a,l.tail=n,l.tailMode=r)}function Iy(e,t,n){var a=t.pendingProps,r=a.revealOrder,l=a.tail;if(jt(e,t,a.children,n),a=dt.current,a&2)a=a&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fg(e,n,t);else if(e.tag===19)fg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}switch(Ie(dt,a),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ac(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),nd(t,!1,r,n,l);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ac(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}nd(t,!0,n,null,l);break;case"together":nd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ns|=t.lanes,!(n&t.childLanes))if(e!==null){if(yi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=da(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=da(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Vh(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Wo(e)))}function ES(e,t,n){switch(t.tag){case 3:Vo(t,t.stateNode.containerInfo),$a(t,ut,e.memoizedState.cache),vi();break;case 27:case 5:Vd(t);break;case 4:Vo(t,t.stateNode.containerInfo);break;case 10:$a(t,t.type,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(La(t),t.flags|=128,null):n&t.child.childLanes?Gy(e,t,n):(La(t),e=pa(e,t,n),e!==null?e.sibling:null);La(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(yi(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return Iy(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ie(dt,dt.current),a)break;return null;case 22:case 23:return t.lanes=0,qy(e,t,n);case 24:$a(t,ut,e.memoizedState.cache)}return pa(e,t,n)}function Vy(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!Vh(e,n)&&!(t.flags&128))return xt=!1,ES(e,t,n);xt=!!(e.flags&131072)}else xt=!1,Te&&t.flags&1048576&&Pv(t,Fo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var a=t.elementType,r=a._init;if(a=r(a._payload),t.type=a,typeof a=="function")Sh(a)?(e=Rs(a,e),t.tag=1,t=ug(null,t,a,e,n)):(t.tag=0,t=pf(null,t,a,e,n));else{if(a!=null){if(r=a.$$typeof,r===dh){t.tag=11,t=lg(null,t,a,e,n);break e}else if(r===fh){t.tag=14,t=ig(null,t,a,e,n);break e}}throw t=Gd(a)||a,Error(H(306,t,""))}}return t;case 0:return pf(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=Rs(a,t.pendingProps),ug(e,t,a,r,n);case 3:e:{if(Vo(t,t.stateNode.containerInfo),e===null)throw Error(H(387));a=t.pendingProps;var l=t.memoizedState;r=l.element,lf(e,t),Ll(t,a,null,n);var i=t.memoizedState;if(a=i.cache,$a(t,ut,a),a!==l.cache&&af(t,[ut],n,!0),$l(),a=i.element,l.isDehydrated)if(l={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){t=dg(e,t,a,n);break e}else if(a!==r){r=un(Error(H(424)),t),Ql(r),t=dg(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qe=wn(e.firstChild),Ot=t,Te=!0,_s=null,An=!0,n=My(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(vi(),a===r){t=pa(e,t,n);break e}jt(e,t,a,n)}t=t.child}return t;case 26:return Oo(e,t),e===null?(n=Eg(t.type,null,t.pendingProps,null))?t.memoizedState=n:Te||(n=t.type,e=t.pendingProps,a=hc(Ya.current).createElement(n),a[Et]=t,a[qt]=e,_t(a,n,e),gt(a),t.stateNode=a):t.memoizedState=Eg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Vd(t),e===null&&Te&&(a=t.stateNode=Rb(t.type,t.pendingProps,Ya.current),Ot=t,An=!0,r=Qe,is(t.type)?(Rf=r,Qe=wn(a.firstChild)):Qe=r),jt(e,t,t.pendingProps.children,n),Oo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((r=a=Qe)&&(a=ak(a,t.type,t.pendingProps,An),a!==null?(t.stateNode=a,Ot=t,Qe=wn(a.firstChild),An=!1,r=!0):r=!1),r||Cs(t)),Vd(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,a=l.children,Cf(r,l)?a=null:i!==null&&Cf(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=Oh(e,t,jS,null,null,n),ti._currentValue=r),Oo(e,t),jt(e,t,a,n),t.child;case 6:return e===null&&Te&&((e=n=Qe)&&(n=sk(n,t.pendingProps,An),n!==null?(t.stateNode=n,Ot=t,Qe=null,e=!0):e=!1),e||Cs(t)),null;case 13:return Gy(e,t,n);case 4:return Vo(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Dr(t,null,a,n):jt(e,t,a,n),t.child;case 11:return lg(e,t,t.type,t.pendingProps,n);case 7:return jt(e,t,t.pendingProps,n),t.child;case 8:return jt(e,t,t.pendingProps.children,n),t.child;case 12:return jt(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,$a(t,t.type,a.value),jt(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,Ts(t),r=Rt(r),a=a(r),t.flags|=1,jt(e,t,a,n),t.child;case 14:return ig(e,t,t.type,t.pendingProps,n);case 15:return By(e,t,t.type,t.pendingProps,n);case 19:return Iy(e,t,n);case 31:return a=t.pendingProps,n=t.mode,a={mode:a.mode,children:a.children},e===null?(n=lc(a,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=da(e.child,a),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return qy(e,t,n);case 24:return Ts(t),a=Rt(ut),e===null?(r=Eh(),r===null&&(r=He,l=Th(),r.pooledCache=l,l.refCount++,l!==null&&(r.pooledCacheLanes|=n),r=l),t.memoizedState={parent:a,cache:r},Rh(t),$a(t,ut,r)):(e.lanes&n&&(lf(e,t),Ll(t,null,null,n),$l()),r=e.memoizedState,l=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),$a(t,ut,a)):(a=l.cache,$a(t,ut,a),a!==r.cache&&af(t,[ut],n,!0))),jt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(H(156,t.tag))}function Jn(e){e.flags|=4}function hg(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ob(t)){if(t=pn.current,t!==null&&((ke&4194048)===ke?Ln!==null:(ke&62914560)!==ke&&!(ke&536870912)||t!==Ln))throw Dl=rf,Qv;e.flags|=8192}}function ro(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?gv():536870912,e.lanes|=t,zr|=t)}function hl(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&65011712,a|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function RS(e,t,n){var a=t.pendingProps;switch(Ch(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),fa(ut),Tr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(dl(t)?Jn(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ip())),Xe(t),null;case 26:return n=t.memoizedState,e===null?(Jn(t),n!==null?(Xe(t),hg(t,n)):(Xe(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Jn(t),Xe(t),hg(t,n)):(Xe(t),t.flags&=-16777217):(e.memoizedProps!==a&&Jn(t),Xe(t),t.flags&=-16777217),null;case 27:Yo(t),n=Ya.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Jn(t);else{if(!a){if(t.stateNode===null)throw Error(H(166));return Xe(t),null}e=zn.current,dl(t)?qp(t):(e=Rb(r,a,n),t.stateNode=e,Jn(t))}return Xe(t),null;case 5:if(Yo(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Jn(t);else{if(!a){if(t.stateNode===null)throw Error(H(166));return Xe(t),null}if(e=zn.current,dl(t))qp(t);else{switch(r=hc(Ya.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof a.is=="string"?r.createElement("select",{is:a.is}):r.createElement("select"),a.multiple?e.multiple=!0:a.size&&(e.size=a.size);break;default:e=typeof a.is=="string"?r.createElement(n,{is:a.is}):r.createElement(n)}}e[Et]=t,e[qt]=a;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(_t(e,n,a),n){case"button":case"input":case"select":case"textarea":e=!!a.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Jn(t)}}return Xe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Jn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(H(166));if(e=Ya.current,dl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=Ot,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Cb(e.nodeValue,n)),e||Cs(t)}else e=hc(e).createTextNode(a),e[Et]=t,t.stateNode=e}return Xe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=dl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(H(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(H(317));r[Et]=t}else vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xe(t),r=!1}else r=Ip(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(oa(t),t):(oa(t),null)}if(oa(t),t.flags&128)return t.lanes=n,t;if(n=a!==null,e=e!==null&&e.memoizedState!==null,n){a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool);var l=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==r&&(a.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),ro(t,t.updateQueue),Xe(t),null;case 4:return Tr(),e===null&&Wh(t.stateNode.containerInfo),Xe(t),null;case 10:return fa(t.type),Xe(t),null;case 19:if(vt(dt),r=t.memoizedState,r===null)return Xe(t),null;if(a=(t.flags&128)!==0,l=r.rendering,l===null)if(a)hl(r,!1);else{if(Fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=ac(e),l!==null){for(t.flags|=128,hl(r,!1),e=l.updateQueue,t.updateQueue=e,ro(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Yv(n,e),n=n.sibling;return Ie(dt,dt.current&1|2),t.child}e=e.sibling}r.tail!==null&&$n()>oc&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}else{if(!a)if(e=ac(l),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ro(t,e),hl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!l.alternate&&!Te)return Xe(t),null}else 2*$n()-r.renderingStartTime>oc&&n!==536870912&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304);r.isBackwards?(l.sibling=t.child,t.child=l):(e=r.last,e!==null?e.sibling=l:t.child=l,r.last=l)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=$n(),t.sibling=null,e=dt.current,Ie(dt,a?e&1|2:e&1),t):(Xe(t),null);case 22:case 23:return oa(t),Ah(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),n=t.updateQueue,n!==null&&ro(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&vt(Ns),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fa(ut),Xe(t),null;case 25:return null;case 30:return null}throw Error(H(156,t.tag))}function AS(e,t){switch(Ch(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(ut),Tr(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Yo(t),null;case 13:if(oa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vt(dt),null;case 4:return Tr(),null;case 10:return fa(t.type),null;case 22:case 23:return oa(t),Ah(),e!==null&&vt(Ns),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fa(ut),null;case 25:return null;default:return null}}function Yy(e,t){switch(Ch(t),t.tag){case 3:fa(ut),Tr();break;case 26:case 27:case 5:Yo(t);break;case 4:Tr();break;case 13:oa(t);break;case 19:vt(dt);break;case 10:fa(t.type);break;case 22:case 23:oa(t),Ah(),e!==null&&vt(Ns);break;case 24:fa(ut)}}function Ni(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var l=n.create,i=n.inst;a=l(),i.destroy=a}n=n.next}while(n!==r)}}catch(o){Le(t,t.return,o)}}function ts(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var l=r.next;a=l;do{if((a.tag&e)===e){var i=a.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,r=t;var c=n,d=o;try{d()}catch(f){Le(r,c,f)}}}a=a.next}while(a!==l)}}catch(f){Le(t,t.return,f)}}function Py(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wv(t,n)}catch(a){Le(e,e.return,a)}}}function Xy(e,t,n){n.props=Rs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Le(e,t,a)}}function Hl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){Le(e,t,r)}}function On(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){Le(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Le(e,t,r)}else n.current=null}function Ky(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){Le(e,e.return,r)}}function ad(e,t,n){try{var a=e.stateNode;WS(a,e.type,n,t),a[qt]=t}catch(r){Le(e,e.return,r)}}function Qy(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&is(e.type)||e.tag===4}function sd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&is(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xf(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fc));else if(a!==4&&(a===27&&is(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(xf(e,t,n),e=e.sibling;e!==null;)xf(e,t,n),e=e.sibling}function ic(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&is(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}function Zy(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);_t(t,a,n),t[Et]=e,t[qt]=n}catch(l){Le(e,e.return,l)}}var aa=!1,et=!1,rd=!1,mg=typeof WeakSet=="function"?WeakSet:Set,pt=null;function MS(e,t){if(e=e.containerInfo,Sf=xc,e=Lv(e),wh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,l=a.focusNode;a=a.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,f=0,h=e,m=null;t:for(;;){for(var x;h!==n||r!==0&&h.nodeType!==3||(o=i+r),h!==l||a!==0&&h.nodeType!==3||(c=i+a),h.nodeType===3&&(i+=h.nodeValue.length),(x=h.firstChild)!==null;)m=h,h=x;for(;;){if(h===e)break t;if(m===n&&++d===r&&(o=i),m===l&&++f===a&&(c=i),(x=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=x}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(kf={focusedElem:e,selectionRange:n},xc=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,l=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&l!==null){e=void 0,n=t,r=l.memoizedProps,l=l.memoizedState,a=n.stateNode;try{var j=Rs(n.type,r,n.elementType===n.type);e=a.getSnapshotBeforeUpdate(j,l),a.__reactInternalSnapshotBeforeUpdate=e}catch(y){Le(n,n.return,y)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Tf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Tf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(H(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function Fy(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Ta(e,n),a&4&&Ni(5,n);break;case 1:if(Ta(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Le(n,n.return,i)}else{var r=Rs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Le(n,n.return,i)}}a&64&&Py(n),a&512&&Hl(n,n.return);break;case 3:if(Ta(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wv(e,t)}catch(i){Le(n,n.return,i)}}break;case 27:t===null&&a&4&&Zy(n);case 26:case 5:Ta(e,n),t===null&&a&4&&Ky(n),a&512&&Hl(n,n.return);break;case 12:Ta(e,n);break;case 13:Ta(e,n),a&4&&eb(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qS.bind(null,n),rk(e,n))));break;case 22:if(a=n.memoizedState!==null||aa,!a){t=t!==null&&t.memoizedState!==null||et,r=aa;var l=et;aa=a,(et=t)&&!l?Ma(e,n,(n.subtreeFlags&8772)!==0):Ta(e,n),aa=r,et=l}break;case 30:break;default:Ta(e,n)}}function Wy(e){var t=e.alternate;t!==null&&(e.alternate=null,Wy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&gh(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qe=null,Ht=!1;function ea(e,t,n){for(n=n.child;n!==null;)Jy(e,t,n),n=n.sibling}function Jy(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(hi,n)}catch{}switch(n.tag){case 26:et||On(n,t),ea(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:et||On(n,t);var a=qe,r=Ht;is(n.type)&&(qe=n.stateNode,Ht=!1),ea(e,t,n),Il(n.stateNode),qe=a,Ht=r;break;case 5:et||On(n,t);case 6:if(a=qe,r=Ht,qe=null,ea(e,t,n),qe=a,Ht=r,qe!==null)if(Ht)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(l){Le(n,t,l)}else try{qe.removeChild(n.stateNode)}catch(l){Le(n,t,l)}break;case 18:qe!==null&&(Ht?(e=qe,kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),si(e)):kg(qe,n.stateNode));break;case 4:a=qe,r=Ht,qe=n.stateNode.containerInfo,Ht=!0,ea(e,t,n),qe=a,Ht=r;break;case 0:case 11:case 14:case 15:et||ts(2,n,t),et||ts(4,n,t),ea(e,t,n);break;case 1:et||(On(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Xy(n,t,a)),ea(e,t,n);break;case 21:ea(e,t,n);break;case 22:et=(a=et)||n.memoizedState!==null,ea(e,t,n),et=a;break;default:ea(e,t,n)}}function eb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{si(e)}catch(n){Le(t,t.return,n)}}function OS(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mg),t;default:throw Error(H(435,e.tag))}}function ld(e,t){var n=OS(e);t.forEach(function(a){var r=GS.bind(null,e,a);n.has(a)||(n.add(a),a.then(r,r))})}function Vt(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a],l=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 27:if(is(o.type)){qe=o.stateNode,Ht=!1;break e}break;case 5:qe=o.stateNode,Ht=!1;break e;case 3:case 4:qe=o.stateNode.containerInfo,Ht=!0;break e}o=o.return}if(qe===null)throw Error(H(160));Jy(l,i,r),qe=null,Ht=!1,l=r.alternate,l!==null&&(l.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)tb(t,e),t=t.sibling}var bn=null;function tb(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Yt(e),a&4&&(ts(3,e,e.return),Ni(3,e),ts(5,e,e.return));break;case 1:Vt(t,e),Yt(e),a&512&&(et||n===null||On(n,n.return)),a&64&&aa&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var r=bn;if(Vt(t,e),Yt(e),a&512&&(et||n===null||On(n,n.return)),a&4){var l=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(a){case"title":l=r.getElementsByTagName("title")[0],(!l||l[gi]||l[Et]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=r.createElement(a),r.head.insertBefore(l,r.querySelector("head > title"))),_t(l,a,n),l[Et]=e,gt(l),a=l;break e;case"link":var i=Ag("link","href",r).get(a+(n.href||""));if(i){for(var o=0;o<i.length;o++)if(l=i[o],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(o,1);break t}}l=r.createElement(a),_t(l,a,n),r.head.appendChild(l);break;case"meta":if(i=Ag("meta","content",r).get(a+(n.content||""))){for(o=0;o<i.length;o++)if(l=i[o],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(o,1);break t}}l=r.createElement(a),_t(l,a,n),r.head.appendChild(l);break;default:throw Error(H(468,a))}l[Et]=e,gt(l),a=l}e.stateNode=a}else Mg(r,e.type,e.stateNode);else e.stateNode=Rg(r,a,e.memoizedProps);else l!==a?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,a===null?Mg(r,e.type,e.stateNode):Rg(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&ad(e,e.memoizedProps,n.memoizedProps)}break;case 27:Vt(t,e),Yt(e),a&512&&(et||n===null||On(n,n.return)),n!==null&&a&4&&ad(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Vt(t,e),Yt(e),a&512&&(et||n===null||On(n,n.return)),e.flags&32){r=e.stateNode;try{Rr(r,"")}catch(x){Le(e,e.return,x)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,ad(e,r,n!==null?n.memoizedProps:r)),a&1024&&(rd=!0);break;case 6:if(Vt(t,e),Yt(e),a&4){if(e.stateNode===null)throw Error(H(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(x){Le(e,e.return,x)}}break;case 3:if($o=null,r=bn,bn=mc(t.containerInfo),Vt(t,e),bn=r,Yt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{si(t.containerInfo)}catch(x){Le(e,e.return,x)}rd&&(rd=!1,nb(e));break;case 4:a=bn,bn=mc(e.stateNode.containerInfo),Vt(t,e),Yt(e),bn=a;break;case 12:Vt(t,e),Yt(e);break;case 13:Vt(t,e),Yt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Qh=$n()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ld(e,a)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=aa,f=et;if(aa=d||r,et=f||c,Vt(t,e),et=f,aa=d,Yt(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||aa||et||xs(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(l=c.stateNode,r)i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{o=c.stateNode;var h=c.memoizedProps.style,m=h!=null&&h.hasOwnProperty("display")?h.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(x){Le(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){Le(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,ld(e,n))));break;case 19:Vt(t,e),Yt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ld(e,a)));break;case 30:break;case 21:break;default:Vt(t,e),Yt(e)}}function Yt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Qy(a)){n=a;break}a=a.return}if(n==null)throw Error(H(160));switch(n.tag){case 27:var r=n.stateNode,l=sd(e);ic(e,l,r);break;case 5:var i=n.stateNode;n.flags&32&&(Rr(i,""),n.flags&=-33);var o=sd(e);ic(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=sd(e);xf(e,d,c);break;default:throw Error(H(161))}}catch(f){Le(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;nb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ta(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fy(e,t.alternate,t),t=t.sibling}function xs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ts(4,t,t.return),xs(t);break;case 1:On(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Xy(t,t.return,n),xs(t);break;case 27:Il(t.stateNode);case 26:case 5:On(t,t.return),xs(t);break;case 22:t.memoizedState===null&&xs(t);break;case 30:xs(t);break;default:xs(t)}e=e.sibling}}function Ma(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,r=e,l=t,i=l.flags;switch(l.tag){case 0:case 11:case 15:Ma(r,l,n),Ni(4,l);break;case 1:if(Ma(r,l,n),a=l,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){Le(a,a.return,d)}if(a=l,r=a.updateQueue,r!==null){var o=a.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)Fv(c[r],o)}catch(d){Le(a,a.return,d)}}n&&i&64&&Py(l),Hl(l,l.return);break;case 27:Zy(l);case 26:case 5:Ma(r,l,n),n&&a===null&&i&4&&Ky(l),Hl(l,l.return);break;case 12:Ma(r,l,n);break;case 13:Ma(r,l,n),n&&i&4&&eb(r,l);break;case 22:l.memoizedState===null&&Ma(r,l,n),Hl(l,l.return);break;case 30:break;default:Ma(r,l,n)}t=t.sibling}}function Yh(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&bi(n))}function Ph(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bi(e))}function Rn(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ab(e,t,n,a),t=t.sibling}function ab(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Rn(e,t,n,a),r&2048&&Ni(9,t);break;case 1:Rn(e,t,n,a);break;case 3:Rn(e,t,n,a),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bi(e)));break;case 12:if(r&2048){Rn(e,t,n,a),e=t.stateNode;try{var l=t.memoizedProps,i=l.id,o=l.onPostCommit;typeof o=="function"&&o(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Le(t,t.return,c)}}else Rn(e,t,n,a);break;case 13:Rn(e,t,n,a);break;case 23:break;case 22:l=t.stateNode,i=t.alternate,t.memoizedState!==null?l._visibility&2?Rn(e,t,n,a):Bl(e,t):l._visibility&2?Rn(e,t,n,a):(l._visibility|=2,nr(e,t,n,a,(t.subtreeFlags&10256)!==0)),r&2048&&Yh(i,t);break;case 24:Rn(e,t,n,a),r&2048&&Ph(t.alternate,t);break;default:Rn(e,t,n,a)}}function nr(e,t,n,a,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var l=e,i=t,o=n,c=a,d=i.flags;switch(i.tag){case 0:case 11:case 15:nr(l,i,o,c,r),Ni(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?nr(l,i,o,c,r):Bl(l,i):(f._visibility|=2,nr(l,i,o,c,r)),r&&d&2048&&Yh(i.alternate,i);break;case 24:nr(l,i,o,c,r),r&&d&2048&&Ph(i.alternate,i);break;default:nr(l,i,o,c,r)}t=t.sibling}}function Bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:Bl(n,a),r&2048&&Yh(a.alternate,a);break;case 24:Bl(n,a),r&2048&&Ph(a.alternate,a);break;default:Bl(n,a)}t=t.sibling}}var wl=8192;function Ys(e){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)sb(e),e=e.sibling}function sb(e){switch(e.tag){case 26:Ys(e),e.flags&wl&&e.memoizedState!==null&&vk(bn,e.memoizedState,e.memoizedProps);break;case 5:Ys(e);break;case 3:case 4:var t=bn;bn=mc(e.stateNode.containerInfo),Ys(e),bn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=wl,wl=16777216,Ys(e),wl=t):Ys(e));break;default:Ys(e)}}function rb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];pt=a,ib(a,e)}rb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lb(e),e=e.sibling}function lb(e){switch(e.tag){case 0:case 11:case 15:ml(e),e.flags&2048&&ts(9,e,e.return);break;case 3:ml(e);break;case 12:ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Do(e)):ml(e);break;default:ml(e)}}function Do(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];pt=a,ib(a,e)}rb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ts(8,t,t.return),Do(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Do(t));break;default:Do(t)}e=e.sibling}}function ib(e,t){for(;pt!==null;){var n=pt;switch(n.tag){case 0:case 11:case 15:ts(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:bi(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,pt=a;else e:for(n=e;pt!==null;){a=pt;var r=a.sibling,l=a.return;if(Wy(a),a===n){pt=null;break e}if(r!==null){r.return=l,pt=r;break e}pt=l}}}var DS={getCacheForType:function(e){var t=Rt(ut),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},zS=typeof WeakMap=="function"?WeakMap:Map,Me=0,He=null,Ne=null,ke=0,Ae=0,Pt=null,Ga=!1,Xr=!1,Xh=!1,ga=0,Fe=0,ns=0,Ss=0,Kh=0,dn=0,zr=0,ql=null,Bt=null,vf=!1,Qh=0,oc=1/0,cc=null,Ka=null,wt=0,Qa=null,$r=null,_r=0,yf=0,bf=null,ob=null,Gl=0,jf=null;function Ft(){if(Me&2&&ke!==0)return ke&-ke;if(le.T!==null){var e=Ar;return e!==0?e:Fh()}return yv()}function cb(){dn===0&&(dn=!(ke&536870912)||Te?pv():536870912);var e=pn.current;return e!==null&&(e.flags|=32),dn}function Wt(e,t,n){(e===He&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(Lr(e,0),Ia(e,ke,dn,!1)),pi(e,n),(!(Me&2)||e!==He)&&(e===He&&(!(Me&2)&&(Ss|=n),Fe===4&&Ia(e,ke,dn,!1)),Yn(e))}function ub(e,t,n){if(Me&6)throw Error(H(327));var a=!n&&(t&124)===0&&(t&e.expiredLanes)===0||mi(e,t),r=a?US(e,t):id(e,t,!0),l=a;do{if(r===0){Xr&&!a&&Ia(e,t,0,!1);break}else{if(n=e.current.alternate,l&&!$S(n)){r=id(e,t,!1),l=!1;continue}if(r===2){if(l=t,e.errorRecoveryDisabledLanes&l)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var o=e;r=ql;var c=o.current.memoizedState.isDehydrated;if(c&&(Lr(o,i).flags|=256),i=id(o,i,!1),i!==2){if(Xh&&!c){o.errorRecoveryDisabledLanes|=l,Ss|=l,r=4;break e}l=Bt,Bt=r,l!==null&&(Bt===null?Bt=l:Bt.push.apply(Bt,l))}r=i}if(l=!1,r!==2)continue}}if(r===1){Lr(e,0),Ia(e,t,0,!0);break}e:{switch(a=e,l=r,l){case 0:case 1:throw Error(H(345));case 4:if((t&4194048)!==t)break;case 6:Ia(a,t,dn,!Ga);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(H(329))}if((t&62914560)===t&&(r=Qh+300-$n(),10<r)){if(Ia(a,t,dn,!Ga),Uc(a,0,!0)!==0)break e;a.timeoutHandle=Eb(pg.bind(null,a,n,Bt,cc,vf,t,dn,Ss,zr,Ga,l,2,-0,0),r);break e}pg(a,n,Bt,cc,vf,t,dn,Ss,zr,Ga,l,0,-0,0)}}break}while(!0);Yn(e)}function pg(e,t,n,a,r,l,i,o,c,d,f,h,m,x){if(e.timeoutHandle=-1,h=t.subtreeFlags,(h&8192||(h&16785408)===16785408)&&(ei={stylesheets:null,count:0,unsuspend:xk},sb(t),h=yk(),h!==null)){e.cancelPendingCommit=h(xg.bind(null,e,t,l,n,a,r,i,o,c,f,1,m,x)),Ia(e,l,i,!d);return}xg(e,t,l,n,a,r,i,o,c)}function $S(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],l=r.getSnapshot;r=r.value;try{if(!tn(l(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ia(e,t,n,a){t&=~Kh,t&=~Ss,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var l=31-Zt(r),i=1<<l;a[l]=-1,r&=~i}n!==0&&xv(e,n,t)}function Kc(){return Me&6?!0:(Si(0),!1)}function Zh(){if(Ne!==null){if(Ae===0)var e=Ne.return;else e=Ne,ia=Bs=null,$h(e),wr=null,Fl=0,e=Ne;for(;e!==null;)Yy(e.alternate,e),e=e.return;Ne=null}}function Lr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ek(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Zh(),He=e,Ne=n=da(e.current,null),ke=t,Ae=0,Pt=null,Ga=!1,Xr=mi(e,t),Xh=!1,zr=dn=Kh=Ss=ns=Fe=0,Bt=ql=null,vf=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-Zt(a),l=1<<r;t|=e[r],a&=~l}return ga=t,Gc(),n}function db(e,t){we=null,le.H=nc,t===ji||t===Vc?(t=Xp(),Ae=3):t===Qv?(t=Xp(),Ae=4):Ae=t===Hy?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pt=t,Ne===null&&(Fe=1,rc(e,un(t,e.current)))}function fb(){var e=le.H;return le.H=nc,e===null?nc:e}function hb(){var e=le.A;return le.A=DS,e}function wf(){Fe=4,Ga||(ke&4194048)!==ke&&pn.current!==null||(Xr=!0),!(ns&134217727)&&!(Ss&134217727)||He===null||Ia(He,ke,dn,!1)}function id(e,t,n){var a=Me;Me|=2;var r=fb(),l=hb();(He!==e||ke!==t)&&(cc=null,Lr(e,t)),t=!1;var i=Fe;e:do try{if(Ae!==0&&Ne!==null){var o=Ne,c=Pt;switch(Ae){case 8:Zh(),i=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(t=!0);var d=Ae;if(Ae=0,Pt=null,pr(e,o,c,d),n&&Xr){i=0;break e}break;default:d=Ae,Ae=0,Pt=null,pr(e,o,c,d)}}LS(),i=Fe;break}catch(f){db(e,f)}while(!0);return t&&e.shellSuspendCounter++,ia=Bs=null,Me=a,le.H=r,le.A=l,Ne===null&&(He=null,ke=0,Gc()),i}function LS(){for(;Ne!==null;)mb(Ne)}function US(e,t){var n=Me;Me|=2;var a=fb(),r=hb();He!==e||ke!==t?(cc=null,oc=$n()+500,Lr(e,t)):Xr=mi(e,t);e:do try{if(Ae!==0&&Ne!==null){t=Ne;var l=Pt;t:switch(Ae){case 1:Ae=0,Pt=null,pr(e,t,l,1);break;case 2:case 9:if(Pp(l)){Ae=0,Pt=null,gg(t);break}t=function(){Ae!==2&&Ae!==9||He!==e||(Ae=7),Yn(e)},l.then(t,t);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:Pp(l)?(Ae=0,Pt=null,gg(t)):(Ae=0,Pt=null,pr(e,t,l,7));break;case 5:var i=null;switch(Ne.tag){case 26:i=Ne.memoizedState;case 5:case 27:var o=Ne;if(!i||Ob(i)){Ae=0,Pt=null;var c=o.sibling;if(c!==null)Ne=c;else{var d=o.return;d!==null?(Ne=d,Qc(d)):Ne=null}break t}}Ae=0,Pt=null,pr(e,t,l,5);break;case 6:Ae=0,Pt=null,pr(e,t,l,6);break;case 8:Zh(),Fe=6;break e;default:throw Error(H(462))}}HS();break}catch(f){db(e,f)}while(!0);return ia=Bs=null,le.H=a,le.A=r,Me=n,Ne!==null?0:(He=null,ke=0,Gc(),Fe)}function HS(){for(;Ne!==null&&!iN();)mb(Ne)}function mb(e){var t=Vy(e.alternate,e,ga);e.memoizedProps=e.pendingProps,t===null?Qc(e):Ne=t}function gg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=cg(n,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=cg(n,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:$h(t);default:Yy(n,t),t=Ne=Yv(t,ga),t=Vy(n,t,ga)}e.memoizedProps=e.pendingProps,t===null?Qc(e):Ne=t}function pr(e,t,n,a){ia=Bs=null,$h(t),wr=null,Fl=0;var r=t.return;try{if(TS(e,r,t,n,ke)){Fe=1,rc(e,un(n,e.current)),Ne=null;return}}catch(l){if(r!==null)throw Ne=r,l;Fe=1,rc(e,un(n,e.current)),Ne=null;return}t.flags&32768?(Te||a===1?e=!0:Xr||ke&536870912?e=!1:(Ga=e=!0,(a===2||a===9||a===3||a===6)&&(a=pn.current,a!==null&&a.tag===13&&(a.flags|=16384))),pb(t,e)):Qc(t)}function Qc(e){var t=e;do{if(t.flags&32768){pb(t,Ga);return}e=t.return;var n=RS(t.alternate,t,ga);if(n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);Fe===0&&(Fe=5)}function pb(e,t){do{var n=AS(e.alternate,e);if(n!==null){n.flags&=32767,Ne=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=n}while(e!==null);Fe=6,Ne=null}function xg(e,t,n,a,r,l,i,o,c){e.cancelPendingCommit=null;do Zc();while(wt!==0);if(Me&6)throw Error(H(327));if(t!==null){if(t===e.current)throw Error(H(177));if(l=t.lanes|t.childLanes,l|=_h,xN(e,n,l,i,o,c),e===He&&(Ne=He=null,ke=0),$r=t,Qa=e,_r=n,yf=l,bf=r,ob=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,IS(Po,function(){return bb(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=le.T,le.T=null,r=Ee.p,Ee.p=2,i=Me,Me|=4;try{MS(e,t,n)}finally{Me=i,Ee.p=r,le.T=a}}wt=1,gb(),xb(),vb()}}function gb(){if(wt===1){wt=0;var e=Qa,t=$r,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=le.T,le.T=null;var a=Ee.p;Ee.p=2;var r=Me;Me|=4;try{tb(t,e);var l=kf,i=Lv(e.containerInfo),o=l.focusedElem,c=l.selectionRange;if(i!==o&&o&&o.ownerDocument&&$v(o.ownerDocument.documentElement,o)){if(c!==null&&wh(o)){var d=c.start,f=c.end;if(f===void 0&&(f=d),"selectionStart"in o)o.selectionStart=d,o.selectionEnd=Math.min(f,o.value.length);else{var h=o.ownerDocument||document,m=h&&h.defaultView||window;if(m.getSelection){var x=m.getSelection(),j=o.textContent.length,y=Math.min(c.start,j),b=c.end===void 0?y:Math.min(c.end,j);!x.extend&&y>b&&(i=b,b=y,y=i);var g=Up(o,y),p=Up(o,b);if(g&&p&&(x.rangeCount!==1||x.anchorNode!==g.node||x.anchorOffset!==g.offset||x.focusNode!==p.node||x.focusOffset!==p.offset)){var v=h.createRange();v.setStart(g.node,g.offset),x.removeAllRanges(),y>b?(x.addRange(v),x.extend(p.node,p.offset)):(v.setEnd(p.node,p.offset),x.addRange(v))}}}}for(h=[],x=o;x=x.parentNode;)x.nodeType===1&&h.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<h.length;o++){var w=h[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}xc=!!Sf,kf=Sf=null}finally{Me=r,Ee.p=a,le.T=n}}e.current=t,wt=2}}function xb(){if(wt===2){wt=0;var e=Qa,t=$r,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=le.T,le.T=null;var a=Ee.p;Ee.p=2;var r=Me;Me|=4;try{Fy(e,t.alternate,t)}finally{Me=r,Ee.p=a,le.T=n}}wt=3}}function vb(){if(wt===4||wt===3){wt=0,oN();var e=Qa,t=$r,n=_r,a=ob;t.subtreeFlags&10256||t.flags&10256?wt=5:(wt=0,$r=Qa=null,yb(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Ka=null),ph(n),t=t.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(hi,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=le.T,r=Ee.p,Ee.p=2,le.T=null;try{for(var l=e.onRecoverableError,i=0;i<a.length;i++){var o=a[i];l(o.value,{componentStack:o.stack})}}finally{le.T=t,Ee.p=r}}_r&3&&Zc(),Yn(e),r=e.pendingLanes,n&4194090&&r&42?e===jf?Gl++:(Gl=0,jf=e):Gl=0,Si(0)}}function yb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bi(t)))}function Zc(e){return gb(),xb(),vb(),bb()}function bb(){if(wt!==5)return!1;var e=Qa,t=yf;yf=0;var n=ph(_r),a=le.T,r=Ee.p;try{Ee.p=32>n?32:n,le.T=null,n=bf,bf=null;var l=Qa,i=_r;if(wt=0,$r=Qa=null,_r=0,Me&6)throw Error(H(331));var o=Me;if(Me|=4,lb(l.current),ab(l,l.current,i,n),Me=o,Si(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(hi,l)}catch{}return!0}finally{Ee.p=r,le.T=a,yb(e,t)}}function vg(e,t,n){t=un(n,t),t=mf(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(pi(e,2),Yn(e))}function Le(e,t,n){if(e.tag===3)vg(e,e,n);else for(;t!==null;){if(t.tag===3){vg(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ka===null||!Ka.has(a))){e=un(n,e),n=Ly(2),a=Xa(t,n,2),a!==null&&(Uy(n,a,t,e),pi(a,2),Yn(a));break}}t=t.return}}function od(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new zS;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(Xh=!0,r.add(n),e=BS.bind(null,e,t,n),t.then(e,e))}function BS(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,He===e&&(ke&n)===n&&(Fe===4||Fe===3&&(ke&62914560)===ke&&300>$n()-Qh?!(Me&2)&&Lr(e,0):Kh|=n,zr===ke&&(zr=0)),Yn(e)}function jb(e,t){t===0&&(t=gv()),e=Pr(e,t),e!==null&&(pi(e,t),Yn(e))}function qS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jb(e,n)}function GS(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(H(314))}a!==null&&a.delete(t),jb(e,n)}function IS(e,t){return hh(e,t)}var uc=null,ar=null,_f=!1,dc=!1,cd=!1,ks=0;function Yn(e){e!==ar&&e.next===null&&(ar===null?uc=ar=e:ar=ar.next=e),dc=!0,_f||(_f=!0,YS())}function Si(e,t){if(!cd&&dc){cd=!0;do for(var n=!1,a=uc;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var l=0;else{var i=a.suspendedLanes,o=a.pingedLanes;l=(1<<31-Zt(42|e)+1)-1,l&=r&~(i&~o),l=l&201326741?l&201326741|1:l?l|2:0}l!==0&&(n=!0,yg(a,l))}else l=ke,l=Uc(a,a===He?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(l&3)||mi(a,l)||(n=!0,yg(a,l));a=a.next}while(n);cd=!1}}function VS(){wb()}function wb(){dc=_f=!1;var e=0;ks!==0&&(JS()&&(e=ks),ks=0);for(var t=$n(),n=null,a=uc;a!==null;){var r=a.next,l=_b(a,t);l===0?(a.next=null,n===null?uc=r:n.next=r,r===null&&(ar=n)):(n=a,(e!==0||l&3)&&(dc=!0)),a=r}Si(e)}function _b(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var i=31-Zt(l),o=1<<i,c=r[i];c===-1?(!(o&n)||o&a)&&(r[i]=gN(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}if(t=He,n=ke,n=Uc(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&zu(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||mi(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&zu(a),ph(n)){case 2:case 8:n=hv;break;case 32:n=Po;break;case 268435456:n=mv;break;default:n=Po}return a=Nb.bind(null,e),n=hh(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&zu(a),e.callbackPriority=2,e.callbackNode=null,2}function Nb(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zc()&&e.callbackNode!==n)return null;var a=ke;return a=Uc(e,e===He?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(ub(e,a,t),_b(e,$n()),e.callbackNode!=null&&e.callbackNode===n?Nb.bind(null,e):null)}function yg(e,t){if(Zc())return null;ub(e,t,!0)}function YS(){tk(function(){Me&6?hh(fv,VS):wb()})}function Fh(){return ks===0&&(ks=pv()),ks}function bg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ko(""+e)}function jg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function PS(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var l=bg((r[qt]||null).action),i=a.submitter;i&&(t=(t=i[qt]||null)?bg(t.formAction):i.getAttribute("formAction"),t!==null&&(l=t,i=null));var o=new Hc("action","action",null,a,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ks!==0){var c=i?jg(r,i):new FormData(r);ff(n,{pending:!0,data:c,method:r.method,action:l},null,c)}}else typeof l=="function"&&(o.preventDefault(),c=i?jg(r,i):new FormData(r),ff(n,{pending:!0,data:c,method:r.method,action:l},l,c))},currentTarget:r}]})}}for(var ud=0;ud<Jd.length;ud++){var dd=Jd[ud],XS=dd.toLowerCase(),KS=dd[0].toUpperCase()+dd.slice(1);Tn(XS,"on"+KS)}Tn(Hv,"onAnimationEnd");Tn(Bv,"onAnimationIteration");Tn(qv,"onAnimationStart");Tn("dblclick","onDoubleClick");Tn("focusin","onFocus");Tn("focusout","onBlur");Tn(dS,"onTransitionRun");Tn(fS,"onTransitionStart");Tn(hS,"onTransitionCancel");Tn(Gv,"onTransitionEnd");Er("onMouseEnter",["mouseout","mouseover"]);Er("onMouseLeave",["mouseout","mouseover"]);Er("onPointerEnter",["pointerout","pointerover"]);Er("onPointerLeave",["pointerout","pointerover"]);Ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ls("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),QS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function Sb(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var l=void 0;if(t)for(var i=a.length-1;0<=i;i--){var o=a[i],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==l&&r.isPropagationStopped())break e;l=o,r.currentTarget=d;try{l(r)}catch(f){sc(f)}r.currentTarget=null,l=c}else for(i=0;i<a.length;i++){if(o=a[i],c=o.instance,d=o.currentTarget,o=o.listener,c!==l&&r.isPropagationStopped())break e;l=o,r.currentTarget=d;try{l(r)}catch(f){sc(f)}r.currentTarget=null,l=c}}}}function _e(e,t){var n=t[Pd];n===void 0&&(n=t[Pd]=new Set);var a=e+"__bubble";n.has(a)||(kb(t,e,2,!1),n.add(a))}function fd(e,t,n){var a=0;t&&(a|=4),kb(n,e,a,t)}var lo="_reactListening"+Math.random().toString(36).slice(2);function Wh(e){if(!e[lo]){e[lo]=!0,bv.forEach(function(n){n!=="selectionchange"&&(QS.has(n)||fd(n,!1,e),fd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lo]||(t[lo]=!0,fd("selectionchange",!1,t))}}function kb(e,t,n,a){switch(Ub(t)){case 2:var r=wk;break;case 8:r=_k;break;default:r=nm}n=r.bind(null,t,n,e),r=void 0,!Zd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function hd(e,t,n,a,r){var l=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var o=a.stateNode.containerInfo;if(o===r)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;o!==null;){if(i=lr(o),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=l=i;continue e}o=o.parentNode}}a=a.return}Tv(function(){var d=l,f=vh(n),h=[];e:{var m=Iv.get(e);if(m!==void 0){var x=Hc,j=e;switch(e){case"keypress":if(To(n)===0)break e;case"keydown":case"keyup":x=IN;break;case"focusin":j="focus",x=Iu;break;case"focusout":j="blur",x=Iu;break;case"beforeblur":case"afterblur":x=Iu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=AN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=PN;break;case Hv:case Bv:case qv:x=DN;break;case Gv:x=KN;break;case"scroll":case"scrollend":x=EN;break;case"wheel":x=ZN;break;case"copy":case"cut":case"paste":x=$N;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Rp;break;case"toggle":case"beforetoggle":x=WN}var y=(t&4)!==0,b=!y&&(e==="scroll"||e==="scrollend"),g=y?m!==null?m+"Capture":null:m;y=[];for(var p=d,v;p!==null;){var w=p;if(v=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||v===null||g===null||(w=Pl(p,g),w!=null&&y.push(Jl(p,w,v))),b)break;p=p.return}0<y.length&&(m=new x(m,j,null,n,f),h.push({event:m,listeners:y}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",m&&n!==Qd&&(j=n.relatedTarget||n.fromElement)&&(lr(j)||j[Vr]))break e;if((x||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,x?(j=n.relatedTarget||n.toElement,x=d,j=j?lr(j):null,j!==null&&(b=fi(j),y=j.tag,j!==b||y!==5&&y!==27&&y!==6)&&(j=null)):(x=null,j=d),x!==j)){if(y=Tp,w="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(y=Rp,w="onPointerLeave",g="onPointerEnter",p="pointer"),b=x==null?m:jl(x),v=j==null?m:jl(j),m=new y(w,p+"leave",x,n,f),m.target=b,m.relatedTarget=v,w=null,lr(f)===d&&(y=new y(g,p+"enter",j,n,f),y.target=v,y.relatedTarget=b,w=y),b=w,x&&j)t:{for(y=x,g=j,p=0,v=y;v;v=Ps(v))p++;for(v=0,w=g;w;w=Ps(w))v++;for(;0<p-v;)y=Ps(y),p--;for(;0<v-p;)g=Ps(g),v--;for(;p--;){if(y===g||g!==null&&y===g.alternate)break t;y=Ps(y),g=Ps(g)}y=null}else y=null;x!==null&&wg(h,m,x,y,!1),j!==null&&b!==null&&wg(h,b,j,y,!0)}}e:{if(m=d?jl(d):window,x=m.nodeName&&m.nodeName.toLowerCase(),x==="select"||x==="input"&&m.type==="file")var _=Dp;else if(Op(m))if(Dv)_=oS;else{_=lS;var S=rS}else x=m.nodeName,!x||x.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?d&&xh(d.elementType)&&(_=Dp):_=iS;if(_&&(_=_(e,d))){Ov(h,_,n,f);break e}S&&S(e,m,d),e==="focusout"&&d&&m.type==="number"&&d.memoizedProps.value!=null&&Kd(m,"number",m.value)}switch(S=d?jl(d):window,e){case"focusin":(Op(S)||S.contentEditable==="true")&&(cr=S,Fd=d,Ml=null);break;case"focusout":Ml=Fd=cr=null;break;case"mousedown":Wd=!0;break;case"contextmenu":case"mouseup":case"dragend":Wd=!1,Hp(h,n,f);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":Hp(h,n,f)}var N;if(jh)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else or?Av(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(Rv&&n.locale!=="ko"&&(or||k!=="onCompositionStart"?k==="onCompositionEnd"&&or&&(N=Ev()):(qa=f,yh="value"in qa?qa.value:qa.textContent,or=!0)),S=fc(d,k),0<S.length&&(k=new Ep(k,e,null,n,f),h.push({event:k,listeners:S}),N?k.data=N:(N=Mv(n),N!==null&&(k.data=N)))),(N=eS?tS(e,n):nS(e,n))&&(k=fc(d,"onBeforeInput"),0<k.length&&(S=new Ep("onBeforeInput","beforeinput",null,n,f),h.push({event:S,listeners:k}),S.data=N)),PS(h,e,d,n,f)}Sb(h,t)})}function Jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fc(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,l=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||l===null||(r=Pl(e,n),r!=null&&a.unshift(Jl(e,r,l)),r=Pl(e,t),r!=null&&a.push(Jl(e,r,l))),e.tag===3)return a;e=e.return}return[]}function Ps(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function wg(e,t,n,a,r){for(var l=t._reactName,i=[];n!==null&&n!==a;){var o=n,c=o.alternate,d=o.stateNode;if(o=o.tag,c!==null&&c===a)break;o!==5&&o!==26&&o!==27||d===null||(c=d,r?(d=Pl(n,l),d!=null&&i.unshift(Jl(n,d,c))):r||(d=Pl(n,l),d!=null&&i.push(Jl(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var ZS=/\r\n?/g,FS=/\u0000|\uFFFD/g;function _g(e){return(typeof e=="string"?e:""+e).replace(ZS,`
49
+ `).replace(FS,"")}function Cb(e,t){return t=_g(t),_g(e)===t}function Fc(){}function ze(e,t,n,a,r,l){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Rr(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Rr(e,""+a);break;case"className":Ji(e,"class",a);break;case"tabIndex":Ji(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ji(e,n,a);break;case"style":Cv(e,a,l);break;case"data":if(t!=="object"){Ji(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=ko(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 l=="function"&&(n==="formAction"?(t!=="input"&&ze(e,t,"name",r.name,r,null),ze(e,t,"formEncType",r.formEncType,r,null),ze(e,t,"formMethod",r.formMethod,r,null),ze(e,t,"formTarget",r.formTarget,r,null)):(ze(e,t,"encType",r.encType,r,null),ze(e,t,"method",r.method,r,null),ze(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=ko(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Fc);break;case"onScroll":a!=null&&_e("scroll",e);break;case"onScrollEnd":a!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(H(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(H(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=ko(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":_e("beforetoggle",e),_e("toggle",e),So(e,"popover",a);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":So(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=CN.get(n)||n,So(e,n,a))}}function Nf(e,t,n,a,r,l){switch(n){case"style":Cv(e,a,l);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(H(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(H(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Rr(e,a):(typeof a=="number"||typeof a=="bigint")&&Rr(e,""+a);break;case"onScroll":a!=null&&_e("scroll",e);break;case"onScrollEnd":a!=null&&_e("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Fc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jv.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),l=e[qt]||null,l=l!=null?l[n]:null,typeof l=="function"&&e.removeEventListener(t,l,r),typeof a=="function")){typeof l!="function"&&l!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,r);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):So(e,n,a)}}}function _t(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var a=!1,r=!1,l;for(l in n)if(n.hasOwnProperty(l)){var i=n[l];if(i!=null)switch(l){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(H(137,t));default:ze(e,t,l,i,n,null)}}r&&ze(e,t,"srcSet",n.srcSet,n,null),a&&ze(e,t,"src",n.src,n,null);return;case"input":_e("invalid",e);var o=l=i=r=null,c=null,d=null;for(a in n)if(n.hasOwnProperty(a)){var f=n[a];if(f!=null)switch(a){case"name":r=f;break;case"type":i=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":l=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(H(137,t));break;default:ze(e,t,a,f,n,null)}}Nv(e,l,o,c,d,i,r,!1),Xo(e);return;case"select":_e("invalid",e),a=i=l=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":l=o;break;case"defaultValue":i=o;break;case"multiple":a=o;default:ze(e,t,r,o,n,null)}t=l,n=i,e.multiple=!!a,t!=null?xr(e,!!a,t,!1):n!=null&&xr(e,!!a,n,!0);return;case"textarea":_e("invalid",e),l=r=a=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":a=o;break;case"defaultValue":r=o;break;case"children":l=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(H(91));break;default:ze(e,t,i,o,n,null)}kv(e,a,r,l),Xo(e);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(a=n[c],a!=null))switch(c){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:ze(e,t,c,a,n,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(a=0;a<Wl.length;a++)_e(Wl[a],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(d in n)if(n.hasOwnProperty(d)&&(a=n[d],a!=null))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(H(137,t));default:ze(e,t,d,a,n,null)}return;default:if(xh(t)){for(f in n)n.hasOwnProperty(f)&&(a=n[f],a!==void 0&&Nf(e,t,f,a,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(a=n[o],a!=null&&ze(e,t,o,a,n,null))}function WS(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,l=null,i=null,o=null,c=null,d=null,f=null;for(x in n){var h=n[x];if(n.hasOwnProperty(x)&&h!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=h;default:a.hasOwnProperty(x)||ze(e,t,x,null,a,h)}}for(var m in a){var x=a[m];if(h=n[m],a.hasOwnProperty(m)&&(x!=null||h!=null))switch(m){case"type":l=x;break;case"name":r=x;break;case"checked":d=x;break;case"defaultChecked":f=x;break;case"value":i=x;break;case"defaultValue":o=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(H(137,t));break;default:x!==h&&ze(e,t,m,x,a,h)}}Xd(e,i,o,c,d,f,l,r);return;case"select":x=i=o=m=null;for(l in n)if(c=n[l],n.hasOwnProperty(l)&&c!=null)switch(l){case"value":break;case"multiple":x=c;default:a.hasOwnProperty(l)||ze(e,t,l,null,a,c)}for(r in a)if(l=a[r],c=n[r],a.hasOwnProperty(r)&&(l!=null||c!=null))switch(r){case"value":m=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:l!==c&&ze(e,t,r,l,a,c)}t=o,n=i,a=x,m!=null?xr(e,!!n,m,!1):!!a!=!!n&&(t!=null?xr(e,!!n,t,!0):xr(e,!!n,n?[]:"",!1));return;case"textarea":x=m=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!a.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:ze(e,t,o,null,a,r)}for(i in a)if(r=a[i],l=n[i],a.hasOwnProperty(i)&&(r!=null||l!=null))switch(i){case"value":m=r;break;case"defaultValue":x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(H(91));break;default:r!==l&&ze(e,t,i,r,a,l)}Sv(e,m,x);return;case"option":for(var j in n)if(m=n[j],n.hasOwnProperty(j)&&m!=null&&!a.hasOwnProperty(j))switch(j){case"selected":e.selected=!1;break;default:ze(e,t,j,null,a,m)}for(c in a)if(m=a[c],x=n[c],a.hasOwnProperty(c)&&m!==x&&(m!=null||x!=null))switch(c){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:ze(e,t,c,m,a,x)}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 y in n)m=n[y],n.hasOwnProperty(y)&&m!=null&&!a.hasOwnProperty(y)&&ze(e,t,y,null,a,m);for(d in a)if(m=a[d],x=n[d],a.hasOwnProperty(d)&&m!==x&&(m!=null||x!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(H(137,t));break;default:ze(e,t,d,m,a,x)}return;default:if(xh(t)){for(var b in n)m=n[b],n.hasOwnProperty(b)&&m!==void 0&&!a.hasOwnProperty(b)&&Nf(e,t,b,void 0,a,m);for(f in a)m=a[f],x=n[f],!a.hasOwnProperty(f)||m===x||m===void 0&&x===void 0||Nf(e,t,f,m,a,x);return}}for(var g in n)m=n[g],n.hasOwnProperty(g)&&m!=null&&!a.hasOwnProperty(g)&&ze(e,t,g,null,a,m);for(h in a)m=a[h],x=n[h],!a.hasOwnProperty(h)||m===x||m==null&&x==null||ze(e,t,h,m,a,x)}var Sf=null,kf=null;function hc(e){return e.nodeType===9?e:e.ownerDocument}function Ng(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Tb(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Cf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var md=null;function JS(){var e=window.event;return e&&e.type==="popstate"?e===md?!1:(md=e,!0):(md=null,!1)}var Eb=typeof setTimeout=="function"?setTimeout:void 0,ek=typeof clearTimeout=="function"?clearTimeout:void 0,Sg=typeof Promise=="function"?Promise:void 0,tk=typeof queueMicrotask=="function"?queueMicrotask:typeof Sg<"u"?function(e){return Sg.resolve(null).then(e).catch(nk)}:Eb;function nk(e){setTimeout(function(){throw e})}function is(e){return e==="head"}function kg(e,t){var n=t,a=0,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(0<a&&8>a){n=a;var i=e.ownerDocument;if(n&1&&Il(i.documentElement),n&2&&Il(i.body),n&4)for(n=i.head,Il(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[gi]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}if(r===0){e.removeChild(l),si(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:a=n.charCodeAt(0)-48;else a=0;n=l}while(n);si(t)}function Tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Tf(n),gh(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ak(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[gi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(l=e.getAttribute("rel"),l==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(l!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(l=e.getAttribute("src"),(l!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&l&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var l=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===l)return e}else return e;if(e=wn(e.nextSibling),e===null)break}return null}function sk(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=wn(e.nextSibling),e===null))return null;return e}function Ef(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function rk(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function wn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Rf=null;function Cg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function Rb(e,t,n){switch(t=hc(n),e){case"html":if(e=t.documentElement,!e)throw Error(H(452));return e;case"head":if(e=t.head,!e)throw Error(H(453));return e;case"body":if(e=t.body,!e)throw Error(H(454));return e;default:throw Error(H(451))}}function Il(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gh(e)}var gn=new Map,Tg=new Set;function mc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ya=Ee.d;Ee.d={f:lk,r:ik,D:ok,C:ck,L:uk,m:dk,X:hk,S:fk,M:mk};function lk(){var e=ya.f(),t=Kc();return e||t}function ik(e){var t=Yr(e);t!==null&&t.tag===5&&t.type==="form"?_y(t):ya.r(e)}var Kr=typeof document>"u"?null:document;function Ab(e,t,n){var a=Kr;if(a&&typeof t=="string"&&t){var r=cn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Tg.has(r)||(Tg.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),_t(t,"link",e),gt(t),a.head.appendChild(t)))}}function ok(e){ya.D(e),Ab("dns-prefetch",e,null)}function ck(e,t){ya.C(e,t),Ab("preconnect",e,t)}function uk(e,t,n){ya.L(e,t,n);var a=Kr;if(a&&e&&t){var r='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+cn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+cn(n.imageSizes)+'"]')):r+='[href="'+cn(e)+'"]';var l=r;switch(t){case"style":l=Ur(e);break;case"script":l=Qr(e)}gn.has(l)||(e=Be({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),gn.set(l,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(ki(l))||t==="script"&&a.querySelector(Ci(l))||(t=a.createElement("link"),_t(t,"link",e),gt(t),a.head.appendChild(t)))}}function dk(e,t){ya.m(e,t);var n=Kr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+cn(a)+'"][href="'+cn(e)+'"]',l=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=Qr(e)}if(!gn.has(l)&&(e=Be({rel:"modulepreload",href:e},t),gn.set(l,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ci(l)))return}a=n.createElement("link"),_t(a,"link",e),gt(a),n.head.appendChild(a)}}}function fk(e,t,n){ya.S(e,t,n);var a=Kr;if(a&&e){var r=gr(a).hoistableStyles,l=Ur(e);t=t||"default";var i=r.get(l);if(!i){var o={loading:0,preload:null};if(i=a.querySelector(ki(l)))o.loading=5;else{e=Be({rel:"stylesheet",href:e,"data-precedence":t},n),(n=gn.get(l))&&Jh(e,n);var c=i=a.createElement("link");gt(c),_t(c,"link",e),c._p=new Promise(function(d,f){c.onload=d,c.onerror=f}),c.addEventListener("load",function(){o.loading|=1}),c.addEventListener("error",function(){o.loading|=2}),o.loading|=4,zo(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:o},r.set(l,i)}}}function hk(e,t){ya.X(e,t);var n=Kr;if(n&&e){var a=gr(n).hoistableScripts,r=Qr(e),l=a.get(r);l||(l=n.querySelector(Ci(r)),l||(e=Be({src:e,async:!0},t),(t=gn.get(r))&&em(e,t),l=n.createElement("script"),gt(l),_t(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function mk(e,t){ya.M(e,t);var n=Kr;if(n&&e){var a=gr(n).hoistableScripts,r=Qr(e),l=a.get(r);l||(l=n.querySelector(Ci(r)),l||(e=Be({src:e,async:!0,type:"module"},t),(t=gn.get(r))&&em(e,t),l=n.createElement("script"),gt(l),_t(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function Eg(e,t,n,a){var r=(r=Ya.current)?mc(r):null;if(!r)throw Error(H(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ur(n.href),n=gr(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ur(n.href);var l=gr(r).hoistableStyles,i=l.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},l.set(e,i),(l=r.querySelector(ki(e)))&&!l._p&&(i.instance=l,i.state.loading=5),gn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gn.set(e,n),l||pk(r,e,n,i.state))),t&&a===null)throw Error(H(528,""));return i}if(t&&a!==null)throw Error(H(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qr(n),n=gr(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(H(444,e))}}function Ur(e){return'href="'+cn(e)+'"'}function ki(e){return'link[rel="stylesheet"]['+e+"]"}function Mb(e){return Be({},e,{"data-precedence":e.precedence,precedence:null})}function pk(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),_t(t,"link",n),gt(t),e.head.appendChild(t))}function Qr(e){return'[src="'+cn(e)+'"]'}function Ci(e){return"script[async]"+e}function Rg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+cn(n.href)+'"]');if(a)return t.instance=a,gt(a),a;var r=Be({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),gt(a),_t(a,"style",r),zo(a,n.precedence,e),t.instance=a;case"stylesheet":r=Ur(n.href);var l=e.querySelector(ki(r));if(l)return t.state.loading|=4,t.instance=l,gt(l),l;a=Mb(n),(r=gn.get(r))&&Jh(a,r),l=(e.ownerDocument||e).createElement("link"),gt(l);var i=l;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),_t(l,"link",a),t.state.loading|=4,zo(l,n.precedence,e),t.instance=l;case"script":return l=Qr(n.src),(r=e.querySelector(Ci(l)))?(t.instance=r,gt(r),r):(a=n,(r=gn.get(l))&&(a=Be({},n),em(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),gt(r),_t(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(H(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,zo(a,n.precedence,e));return t.instance}function zo(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,l=r,i=0;i<a.length;i++){var o=a[i];if(o.dataset.precedence===t)l=o;else if(l!==r)break}l?l.parentNode.insertBefore(e,l.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function em(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $o=null;function Ag(e,t,n){if($o===null){var a=new Map,r=$o=new Map;r.set(n,a)}else r=$o,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var l=n[r];if(!(l[gi]||l[Et]||e==="link"&&l.getAttribute("rel")==="stylesheet")&&l.namespaceURI!=="http://www.w3.org/2000/svg"){var i=l.getAttribute(t)||"";i=e+i;var o=a.get(i);o?o.push(l):a.set(i,[l])}}return a}function Mg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function gk(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ob(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var ei=null;function xk(){}function vk(e,t,n){if(ei===null)throw Error(H(475));var a=ei;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=Ur(n.href),l=e.querySelector(ki(r));if(l){e=l._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=pc.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=l,gt(l);return}l=e.ownerDocument||e,n=Mb(n),(r=gn.get(r))&&Jh(n,r),l=l.createElement("link"),gt(l);var i=l;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),_t(l,"link",n),t.instance=l}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(a.count++,t=pc.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function yk(){if(ei===null)throw Error(H(475));var e=ei;return e.stylesheets&&e.count===0&&Af(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Af(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function pc(){if(this.count--,this.count===0){if(this.stylesheets)Af(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gc=null;function Af(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gc=new Map,t.forEach(bk,e),gc=null,pc.call(e))}function bk(e,t){if(!(t.state.loading&4)){var n=gc.get(e);if(n)var a=n.get(null);else{n=new Map,gc.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),l=0;l<r.length;l++){var i=r[l];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}r=t.instance,i=r.getAttribute("data-precedence"),l=n.get(i)||a,l===a&&n.set(null,r),n.set(i,r),this.count++,a=pc.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),l?l.parentNode.insertBefore(r,l.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var ti={$$typeof:sa,Provider:null,Consumer:null,_currentValue:bs,_currentValue2:bs,_threadCount:0};function jk(e,t,n,a,r,l,i,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$u(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$u(0),this.hiddenUpdates=$u(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=l,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Db(e,t,n,a,r,l,i,o,c,d,f,h){return e=new jk(e,t,n,i,o,c,d,h),t=1,l===!0&&(t|=24),l=Kt(3,null,null,t),e.current=l,l.stateNode=e,t=Th(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:a,isDehydrated:n,cache:t},Rh(l),e}function zb(e){return e?(e=fr,e):fr}function $b(e,t,n,a,r,l){r=zb(r),a.context===null?a.context=r:a.pendingContext=r,a=Pa(t),a.payload={element:n},l=l===void 0?null:l,l!==null&&(a.callback=l),n=Xa(e,a,t),n!==null&&(Wt(n,e,t),zl(n,e,t))}function Og(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tm(e,t){Og(e,t),(e=e.alternate)&&Og(e,t)}function Lb(e){if(e.tag===13){var t=Pr(e,67108864);t!==null&&Wt(t,e,67108864),tm(e,67108864)}}var xc=!0;function wk(e,t,n,a){var r=le.T;le.T=null;var l=Ee.p;try{Ee.p=2,nm(e,t,n,a)}finally{Ee.p=l,le.T=r}}function _k(e,t,n,a){var r=le.T;le.T=null;var l=Ee.p;try{Ee.p=8,nm(e,t,n,a)}finally{Ee.p=l,le.T=r}}function nm(e,t,n,a){if(xc){var r=Mf(a);if(r===null)hd(e,t,a,vc,n),Dg(e,a);else if(Sk(r,e,t,n,a))a.stopPropagation();else if(Dg(e,a),t&4&&-1<Nk.indexOf(e)){for(;r!==null;){var l=Yr(r);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var i=ps(l.pendingLanes);if(i!==0){var o=l;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-Zt(i);o.entanglements[1]|=c,i&=~c}Yn(l),!(Me&6)&&(oc=$n()+500,Si(0))}}break;case 13:o=Pr(l,2),o!==null&&Wt(o,l,2),Kc(),tm(l,2)}if(l=Mf(a),l===null&&hd(e,t,a,vc,n),l===r)break;r=l}r!==null&&a.stopPropagation()}else hd(e,t,a,null,n)}}function Mf(e){return e=vh(e),am(e)}var vc=null;function am(e){if(vc=null,e=lr(e),e!==null){var t=fi(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=ov(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vc=e,null}function Ub(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(cN()){case fv:return 2;case hv:return 8;case Po:case uN:return 32;case mv:return 268435456;default:return 32}default:return 32}}var Of=!1,Za=null,Fa=null,Wa=null,ni=new Map,ai=new Map,Ha=[],Nk="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 Dg(e,t){switch(e){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ai.delete(t.pointerId)}}function pl(e,t,n,a,r,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:l,targetContainers:[r]},t!==null&&(t=Yr(t),t!==null&&Lb(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Sk(e,t,n,a,r){switch(t){case"focusin":return Za=pl(Za,e,t,n,a,r),!0;case"dragenter":return Fa=pl(Fa,e,t,n,a,r),!0;case"mouseover":return Wa=pl(Wa,e,t,n,a,r),!0;case"pointerover":var l=r.pointerId;return ni.set(l,pl(ni.get(l)||null,e,t,n,a,r)),!0;case"gotpointercapture":return l=r.pointerId,ai.set(l,pl(ai.get(l)||null,e,t,n,a,r)),!0}return!1}function Hb(e){var t=lr(e.target);if(t!==null){var n=fi(t);if(n!==null){if(t=n.tag,t===13){if(t=ov(n),t!==null){e.blockedOn=t,vN(e.priority,function(){if(n.tag===13){var a=Ft();a=mh(a);var r=Pr(n,a);r!==null&&Wt(r,n,a),tm(n,a)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mf(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Qd=a,n.target.dispatchEvent(a),Qd=null}else return t=Yr(n),t!==null&&Lb(t),e.blockedOn=n,!1;t.shift()}return!0}function zg(e,t,n){Lo(e)&&n.delete(t)}function kk(){Of=!1,Za!==null&&Lo(Za)&&(Za=null),Fa!==null&&Lo(Fa)&&(Fa=null),Wa!==null&&Lo(Wa)&&(Wa=null),ni.forEach(zg),ai.forEach(zg)}function io(e,t){e.blockedOn===t&&(e.blockedOn=null,Of||(Of=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,kk)))}var oo=null;function $g(e){oo!==e&&(oo=e,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,function(){oo===e&&(oo=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(am(a||n)===null)continue;break}var l=Yr(n);l!==null&&(e.splice(t,3),t-=3,ff(l,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function si(e){function t(c){return io(c,e)}Za!==null&&io(Za,e),Fa!==null&&io(Fa,e),Wa!==null&&io(Wa,e),ni.forEach(t),ai.forEach(t);for(var n=0;n<Ha.length;n++){var a=Ha[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ha.length&&(n=Ha[0],n.blockedOn===null);)Hb(n),n.blockedOn===null&&Ha.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],l=n[a+1],i=r[qt]||null;if(typeof l=="function")i||$g(n);else if(i){var o=null;if(l&&l.hasAttribute("formAction")){if(r=l,i=l[qt]||null)o=i.formAction;else if(am(r)!==null)continue}else o=i.action;typeof o=="function"?n[a+1]=o:(n.splice(a,3),a-=3),$g(n)}}}function sm(e){this._internalRoot=e}Wc.prototype.render=sm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));var n=t.current,a=Ft();$b(n,a,e,t,null,null)};Wc.prototype.unmount=sm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$b(e.current,2,null,e,null,null),Kc(),t[Vr]=null}};function Wc(e){this._internalRoot=e}Wc.prototype.unstable_scheduleHydration=function(e){if(e){var t=yv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ha.length&&t!==0&&t<Ha[n].priority;n++);Ha.splice(n,0,e),n===0&&Hb(e)}};var Lg=lv.version;if(Lg!=="19.1.0")throw Error(H(527,Lg,"19.1.0"));Ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=nN(t),e=e!==null?cv(e):null,e=e===null?null:e.stateNode,e};var Ck={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:le,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var co=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!co.isDisabled&&co.supportsFiber)try{hi=co.inject(Ck),Qt=co}catch{}}$c.createRoot=function(e,t){if(!iv(e))throw Error(H(299));var n=!1,a="",r=Dy,l=zy,i=$y,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(l=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=Db(e,1,!1,null,null,n,a,r,l,i,o,null),e[Vr]=t.current,Wh(e),new sm(t)};$c.hydrateRoot=function(e,t,n){if(!iv(e))throw Error(H(299));var a=!1,r="",l=Dy,i=zy,o=$y,c=null,d=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(l=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(d=n.formState)),t=Db(e,1,!0,t,n??null,a,r,l,i,o,c,d),t.context=zb(null),n=t.current,a=Ft(),a=mh(a),r=Pa(a),r.callback=null,Xa(n,r,a),n=a,t.current.lanes=n,pi(t,n),Yn(t),e[Vr]=t.current,Wh(e),new Wc(t)};$c.version="19.1.0";function Bb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bb)}catch(e){console.error(e)}}Bb(),ev.exports=$c;var Tk=ev.exports;const qb=u.createContext(null);function Gb({data:e,router:t,identity:n,notify:a,children:r}){return s.jsx(qb.Provider,{value:{data:e,router:t,identity:n,notify:a},children:r})}function Jc(){const e=u.useContext(qb);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const Ek={success:()=>{},error:()=>{}},os=()=>Jc().data,kt=()=>Jc().router,eu=()=>Jc().identity,Ti=()=>Jc().notify??Ek;function Rk(){const{probe:e}=os(),{href:t,Link:n}=kt(),a=eu(),[r,l]=u.useState(null),[i,o]=u.useState(!1);return u.useEffect(()=>{let c=!0;if(!e){o(!0);return}return e.source().then(d=>c&&l(d.label),()=>c&&o(!0)),()=>{c=!1}},[e]),s.jsxs("section",{"data-testid":"app-ui-probe",className:"m-6 flex max-w-xl flex-col gap-2 rounded-lg border border-border bg-card p-6 text-card-foreground",children:[s.jsx("h1",{className:"text-xl font-semibold",children:"Shared app UI"}),s.jsx("p",{"data-testid":"app-ui-probe-source",className:"text-sm text-muted-foreground",children:i?"Data source unavailable":r??"Loading…"}),s.jsxs("p",{"data-testid":"app-ui-probe-identity",className:"text-sm",children:[a.label," · ",a.can("tasks.write")?"can edit tasks":"read only"]}),s.jsx(n,{href:t("/tasks"),className:"rounded-sm text-sm text-primary underline outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:"Tasks"})]})}/**
50
+ * @license lucide-react v0.511.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Ak=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),Ug=e=>{const t=Mk(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ib=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),Ok=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
55
+ * @license lucide-react v0.511.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */var Dk={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"};/**
60
+ * @license lucide-react v0.511.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const zk=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:l,iconNode:i,...o},c)=>u.createElement("svg",{ref:c,...Dk,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ib("lucide",r),...!l&&!Ok(o)&&{"aria-hidden":"true"},...o},[...i.map(([d,f])=>u.createElement(d,f)),...Array.isArray(l)?l:[l]]));/**
65
+ * @license lucide-react v0.511.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const ce=(e,t)=>{const n=u.forwardRef(({className:a,...r},l)=>u.createElement(zk,{ref:l,iconNode:t,className:Ib(`lucide-${Ak(Ug(e))}`,`lucide-${e}`,a),...r}));return n.displayName=Ug(e),n};/**
70
+ * @license lucide-react v0.511.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const $k=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],Lk=ce("archive-restore",$k);/**
75
+ * @license lucide-react v0.511.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const Uk=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Hg=ce("archive",Uk);/**
80
+ * @license lucide-react v0.511.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const Hk=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Bk=ce("arrow-down",Hk);/**
85
+ * @license lucide-react v0.511.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const qk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Vb=ce("arrow-left",qk);/**
90
+ * @license lucide-react v0.511.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const Gk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ik=ce("arrow-up",Gk);/**
95
+ * @license lucide-react v0.511.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const Vk=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],rm=ce("bot",Vk);/**
100
+ * @license lucide-react v0.511.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Yk=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Pk=ce("briefcase",Yk);/**
105
+ * @license lucide-react v0.511.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const Xk=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],Kk=ce("building-2",Xk);/**
110
+ * @license lucide-react v0.511.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Qk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zr=ce("check",Qk);/**
115
+ * @license lucide-react v0.511.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const Zk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Fk=ce("chevron-down",Zk);/**
120
+ * @license lucide-react v0.511.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const Wk=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yb=ce("chevron-right",Wk);/**
125
+ * @license lucide-react v0.511.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const Jk=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],e2=ce("chevron-up",Jk);/**
130
+ * @license lucide-react v0.511.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const t2=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Pb=ce("chevrons-up-down",t2);/**
135
+ * @license lucide-react v0.511.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const n2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],tt=ce("circle-alert",n2);/**
140
+ * @license lucide-react v0.511.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const a2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Xb=ce("circle-check",a2);/**
145
+ * @license lucide-react v0.511.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const s2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],r2=ce("circle",s2);/**
150
+ * @license lucide-react v0.511.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const l2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],i2=ce("clock",l2);/**
155
+ * @license lucide-react v0.511.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const o2=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lm=ce("ellipsis",o2);/**
160
+ * @license lucide-react v0.511.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const c2=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],im=ce("eye",c2);/**
165
+ * @license lucide-react v0.511.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const u2=[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],Kb=ce("folder-git-2",u2);/**
170
+ * @license lucide-react v0.511.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const d2=[["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M14 13h3",key:"1dgedf"}],["path",{d:"M7 13h3",key:"1pygq7"}]],f2=ce("folder-git",d2);/**
175
+ * @license lucide-react v0.511.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const h2=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],m2=ce("git-fork",h2);/**
180
+ * @license lucide-react v0.511.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const p2=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],g2=ce("hard-drive",p2);/**
185
+ * @license lucide-react v0.511.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const x2=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],v2=ce("house",x2);/**
190
+ * @license lucide-react v0.511.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const y2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bn=ce("info",y2);/**
195
+ * @license lucide-react v0.511.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const b2=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],j2=ce("laptop",b2);/**
200
+ * @license lucide-react v0.511.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const w2=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Qb=ce("list-checks",w2);/**
205
+ * @license lucide-react v0.511.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const _2=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],Zb=ce("list-ordered",_2);/**
210
+ * @license lucide-react v0.511.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const N2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],S2=ce("loader-circle",N2);/**
215
+ * @license lucide-react v0.511.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const k2=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],C2=ce("message-circle",k2);/**
220
+ * @license lucide-react v0.511.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const T2=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],E2=ce("messages-square",T2);/**
225
+ * @license lucide-react v0.511.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const R2=[["path",{d:"M5 12h14",key:"1ays0h"}]],A2=ce("minus",R2);/**
230
+ * @license lucide-react v0.511.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const M2=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],O2=ce("network",M2);/**
235
+ * @license lucide-react v0.511.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const D2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],z2=ce("panel-left",D2);/**
240
+ * @license lucide-react v0.511.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const $2=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Fb=ce("pause",$2);/**
245
+ * @license lucide-react v0.511.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const L2=[["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"}]],Wb=ce("pencil",L2);/**
250
+ * @license lucide-react v0.511.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const U2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yc=ce("plus",U2);/**
255
+ * @license lucide-react v0.511.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const H2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],om=ce("refresh-cw",H2);/**
260
+ * @license lucide-react v0.511.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const B2=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Jb=ce("search-x",B2);/**
265
+ * @license lucide-react v0.511.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const q2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],G2=ce("send",q2);/**
270
+ * @license lucide-react v0.511.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const I2=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],V2=ce("snowflake",I2);/**
275
+ * @license lucide-react v0.511.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const Y2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Hr=ce("triangle-alert",Y2);/**
280
+ * @license lucide-react v0.511.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const P2=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],X2=ce("user-check",P2);/**
285
+ * @license lucide-react v0.511.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const K2=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Q2=ce("user-cog",K2);/**
290
+ * @license lucide-react v0.511.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const Z2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],cm=ce("user",Z2);/**
295
+ * @license lucide-react v0.511.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const F2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ej=ce("x",F2);/**
300
+ * @license lucide-react v0.511.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const W2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],J2=ce("wrench",W2);function tj(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=tj(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function nj(){for(var e,t,n=0,a="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=tj(e))&&(a&&(a+=" "),a+=t);return a}const Bg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qg=nj,Ei=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return qg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:l}=t,i=Object.keys(r).map(d=>{const f=n==null?void 0:n[d],h=l==null?void 0:l[d];if(f===null)return null;const m=Bg(f)||Bg(h);return r[d][m]}),o=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,f)=>{let{class:h,className:m,...x}=f;return Object.entries(x).every(j=>{let[y,b]=j;return Array.isArray(b)?b.includes({...l,...o}[y]):{...l,...o}[y]===b})?[...d,h,m]:d},[]);return qg(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},um="-",eC=e=>{const t=nC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{const o=i.split(um);return o[0]===""&&o.length!==1&&o.shift(),aj(o,t)||tC(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},aj=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),r=a?aj(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;const l=e.join(um);return(i=t.validators.find(({validator:o})=>o(l)))==null?void 0:i.classGroupId},Gg=/^\[(.+)\]$/,tC=e=>{if(Gg.test(e)){const t=Gg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},nC=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const r in n)Df(n[r],a,r,t);return a},Df=(e,t,n,a)=>{e.forEach(r=>{if(typeof r=="string"){const l=r===""?t:Ig(t,r);l.classGroupId=n;return}if(typeof r=="function"){if(aC(r)){Df(r(a),t,n,a);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([l,i])=>{Df(i,Ig(t,l),n,a)})})},Ig=(e,t)=>{let n=e;return t.split(um).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},aC=e=>e.isThemeGetter,sC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const r=(l,i)=>{n.set(l,i),t++,t>e&&(t=0,a=n,n=new Map)};return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=a.get(l))!==void 0)return r(l,i),i},set(l,i){n.has(l)?n.set(l,i):r(l,i)}}},zf="!",$f=":",rC=$f.length,lC=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=r=>{const l=[];let i=0,o=0,c=0,d;for(let j=0;j<r.length;j++){let y=r[j];if(i===0&&o===0){if(y===$f){l.push(r.slice(c,j)),c=j+rC;continue}if(y==="/"){d=j;continue}}y==="["?i++:y==="]"?i--:y==="("?o++:y===")"&&o--}const f=l.length===0?r:r.substring(c),h=iC(f),m=h!==f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:x}};if(t){const r=t+$f,l=a;a=i=>i.startsWith(r)?l(i.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const r=a;a=l=>n({className:l,parseClassName:r})}return a},iC=e=>e.endsWith(zf)?e.substring(0,e.length-1):e.startsWith(zf)?e.substring(1):e,oC=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const r=[];let l=[];return a.forEach(i=>{i[0]==="["||t[i]?(r.push(...l.sort(),i),l=[]):l.push(i)}),r.push(...l.sort()),r}},cC=e=>({cache:sC(e.cacheSize),parseClassName:lC(e),sortModifiers:oC(e),...eC(e)}),uC=/\s+/,dC=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:l}=t,i=[],o=e.trim().split(uC);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:h,modifiers:m,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:y}=n(f);if(h){c=f+(c.length>0?" "+c:c);continue}let b=!!y,g=a(b?j.substring(0,y):j);if(!g){if(!b){c=f+(c.length>0?" "+c:c);continue}if(g=a(j),!g){c=f+(c.length>0?" "+c:c);continue}b=!1}const p=l(m).join(":"),v=x?p+zf:p,w=v+g;if(i.includes(w))continue;i.push(w);const _=r(g,b);for(let S=0;S<_.length;++S){const N=_[S];i.push(v+N)}c=f+(c.length>0?" "+c:c)}return c};function fC(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=sj(t))&&(a&&(a+=" "),a+=n);return a}const sj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=sj(e[a]))&&(n&&(n+=" "),n+=t);return n};function hC(e,...t){let n,a,r,l=i;function i(c){const d=t.reduce((f,h)=>h(f),e());return n=cC(d),a=n.cache.get,r=n.cache.set,l=o,o(c)}function o(c){const d=a(c);if(d)return d;const f=dC(c,n);return r(c,f),f}return function(){return l(fC.apply(null,arguments))}}const ct=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},rj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mC=/^\d+\/\d+$/,pC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xs=e=>mC.test(e),be=e=>!!e&&!Number.isNaN(Number(e)),Ea=e=>!!e&&Number.isInteger(Number(e)),pd=e=>e.endsWith("%")&&be(e.slice(0,-1)),ta=e=>pC.test(e),bC=()=>!0,jC=e=>gC.test(e)&&!xC.test(e),ij=()=>!1,wC=e=>vC.test(e),_C=e=>yC.test(e),NC=e=>!W(e)&&!J(e),SC=e=>Fr(e,uj,ij),W=e=>rj.test(e),ms=e=>Fr(e,dj,jC),gd=e=>Fr(e,RC,be),Vg=e=>Fr(e,oj,ij),kC=e=>Fr(e,cj,_C),uo=e=>Fr(e,fj,wC),J=e=>lj.test(e),gl=e=>Wr(e,dj),CC=e=>Wr(e,AC),Yg=e=>Wr(e,oj),TC=e=>Wr(e,uj),EC=e=>Wr(e,cj),fo=e=>Wr(e,fj,!0),Fr=(e,t,n)=>{const a=rj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Wr=(e,t,n=!1)=>{const a=lj.exec(e);return a?a[1]?t(a[1]):n:!1},oj=e=>e==="position"||e==="percentage",cj=e=>e==="image"||e==="url",uj=e=>e==="length"||e==="size"||e==="bg-size",dj=e=>e==="length",RC=e=>e==="number",AC=e=>e==="family-name",fj=e=>e==="shadow",MC=()=>{const e=ct("color"),t=ct("font"),n=ct("text"),a=ct("font-weight"),r=ct("tracking"),l=ct("leading"),i=ct("breakpoint"),o=ct("container"),c=ct("spacing"),d=ct("radius"),f=ct("shadow"),h=ct("inset-shadow"),m=ct("text-shadow"),x=ct("drop-shadow"),j=ct("blur"),y=ct("perspective"),b=ct("aspect"),g=ct("ease"),p=ct("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...w(),J,W],S=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],k=()=>[J,W,c],R=()=>[Xs,"full","auto",...k()],M=()=>[Ea,"none","subgrid",J,W],z=()=>["auto",{span:["full",Ea,J,W]},Ea,J,W],U=()=>[Ea,"auto",J,W],C=()=>["auto","min","max","fr",J,W],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...k()],B=()=>[Xs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],T=()=>[e,J,W],L=()=>[...w(),Yg,Vg,{position:[J,W]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",TC,SC,{size:[J,W]}],Y=()=>[pd,gl,ms],ne=()=>["","none","full",d,J,W],P=()=>["",be,gl,ms],ye=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[be,pd,Yg,Vg],ee=()=>["","none",j,J,W],ue=()=>["none",be,J,W],me=()=>["none",be,J,W],ge=()=>[be,J,W],he=()=>[Xs,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ta],breakpoint:[ta],color:[bC],container:[ta],"drop-shadow":[ta],ease:["in","out","in-out"],font:[NC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ta],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ta],shadow:[ta],spacing:["px",be],text:[ta],"text-shadow":[ta],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xs,W,J,b]}],container:["container"],columns:[{columns:[be,W,J,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Ea,"auto",J,W]}],basis:[{basis:[Xs,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[be,Xs,"auto","initial","none",W]}],grow:[{grow:["",be,J,W]}],shrink:[{shrink:["",be,J,W]}],order:[{order:[Ea,"first","last","none",J,W]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[o,"screen",...B()]}],"min-w":[{"min-w":[o,"screen","none",...B()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,gl,ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,J,gd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pd,W]}],"font-family":[{font:[CC,W,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,J,W]}],"line-clamp":[{"line-clamp":[be,"none",J,gd]}],leading:[{leading:[l,...k()]}],"list-image":[{"list-image":["none",J,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",J,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[be,"from-font","auto",J,ms]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[be,"auto",J,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ea,J,W],radial:["",J,W],conic:[Ea,J,W]},EC,kC]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[be,J,W]}],"outline-w":[{outline:["",be,gl,ms]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",f,fo,uo]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",h,fo,uo]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[be,ms]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",m,fo,uo]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[be,J,W]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[be]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[J,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[be]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",J,W]}],filter:[{filter:["","none",J,W]}],blur:[{blur:ee()}],brightness:[{brightness:[be,J,W]}],contrast:[{contrast:[be,J,W]}],"drop-shadow":[{"drop-shadow":["","none",x,fo,uo]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",be,J,W]}],"hue-rotate":[{"hue-rotate":[be,J,W]}],invert:[{invert:["",be,J,W]}],saturate:[{saturate:[be,J,W]}],sepia:[{sepia:["",be,J,W]}],"backdrop-filter":[{"backdrop-filter":["","none",J,W]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[be,J,W]}],"backdrop-contrast":[{"backdrop-contrast":[be,J,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",be,J,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[be,J,W]}],"backdrop-invert":[{"backdrop-invert":["",be,J,W]}],"backdrop-opacity":[{"backdrop-opacity":[be,J,W]}],"backdrop-saturate":[{"backdrop-saturate":[be,J,W]}],"backdrop-sepia":[{"backdrop-sepia":["",be,J,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",J,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[be,"initial",J,W]}],ease:[{ease:["linear","initial",g,J,W]}],delay:[{delay:[be,J,W]}],animate:[{animate:["none",p,J,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,J,W]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[J,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",J,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",J,W]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[be,gl,ms,gd]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},OC=hC(MC);function F(...e){return OC(nj(e))}const DC=Ei("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground *:data-[slot=alert-description]:text-muted-foreground",info:"border-info/40 bg-info/10 text-info",success:"border-success/40 bg-success/10 text-success",warning:"border-warning/40 bg-warning/10 text-warning",destructive:"border-destructive/40 bg-destructive/10 text-destructive"}},defaultVariants:{variant:"default"}});function de({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:F(DC({variant:t}),e),...n})}function je({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:F("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function oe({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:F("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Pg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tu(...e){return t=>{let n=!1;const a=e.map(r=>{const l=Pg(r,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let r=0;r<a.length;r++){const l=a[r];typeof l=="function"?l():Pg(e[r],null)}}}}function Re(...e){return u.useCallback(tu(...e),e)}function zC(e,t){const n=u.createContext(t),a=l=>{const{children:i,...o}=l,c=u.useMemo(()=>o,Object.values(o));return s.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function r(l){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[a,r]}function Pn(e,t=[]){let n=[];function a(l,i){const o=u.createContext(i),c=n.length;n=[...n,i];const d=h=>{var g;const{scope:m,children:x,...j}=h,y=((g=m==null?void 0:m[e])==null?void 0:g[c])||o,b=u.useMemo(()=>j,Object.values(j));return s.jsx(y.Provider,{value:b,children:x})};d.displayName=l+"Provider";function f(h,m){var y;const x=((y=m==null?void 0:m[e])==null?void 0:y[c])||o,j=u.useContext(x);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${l}\``)}return[d,f]}const r=()=>{const l=n.map(i=>u.createContext(i));return function(o){const c=(o==null?void 0:o[e])||l;return u.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return r.scopeName=e,[a,$C(r,...t)]}function $C(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(l){const i=a.reduce((o,{useScope:c,scopeName:d})=>{const h=c(l)[`__scope${d}`];return{...o,...h}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var At=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},LC=Jx[" useId ".trim().toString()]||(()=>{}),UC=0;function _n(e){const[t,n]=u.useState(LC());return At(()=>{n(a=>a??String(UC++))},[e]),t?`radix-${t}`:""}var HC=Jx[" useInsertionEffect ".trim().toString()]||At;function as({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,l,i]=BC({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:r;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const h=f.current;h!==o&&console.warn(`${a} is changing from ${h?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=o},[o,a])}const d=u.useCallback(f=>{var h;if(o){const m=qC(f)?f(e):f;m!==e&&((h=i.current)==null||h.call(i,m))}else l(f)},[o,e,l,i]);return[c,d]}function BC({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),r=u.useRef(n),l=u.useRef(t);return HC(()=>{l.current=t},[t]),u.useEffect(()=>{var i;r.current!==n&&((i=l.current)==null||i.call(l,n),r.current=n)},[n,r]),[n,a,l]}function qC(e){return typeof e=="function"}function As(e){const t=IC(e),n=u.forwardRef((a,r)=>{const{children:l,...i}=a,o=u.Children.toArray(l),c=o.find(YC);if(c){const d=c.props.children,f=o.map(h=>h===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:h);return s.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return s.jsx(t,{...i,ref:r,children:l})});return n.displayName=`${e}.Slot`,n}var GC=As("Slot");function IC(e){const t=u.forwardRef((n,a)=>{const{children:r,...l}=n;if(u.isValidElement(r)){const i=XC(r),o=PC(l,r.props);return r.type!==u.Fragment&&(o.ref=a?tu(a,i):i),u.cloneElement(r,o)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hj=Symbol("radix.slottable");function VC(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=hj,t}function YC(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hj}function PC(e,t){const n={...t};for(const a in t){const r=e[a],l=t[a];/^on[A-Z]/.test(a)?r&&l?n[a]=(...o)=>{const c=l(...o);return r(...o),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...l}:a==="className"&&(n[a]=[r,l].filter(Boolean).join(" "))}return{...e,...n}}function XC(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pe=KC.reduce((e,t)=>{const n=As(`Primitive.${t}`),a=u.forwardRef((r,l)=>{const{asChild:i,...o}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...o,ref:l})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function mj(e,t){e&&Ir.flushSync(()=>e.dispatchEvent(t))}function qn(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function QC(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e);u.useEffect(()=>{const a=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var ZC="DismissableLayer",Lf="dismissableLayer.update",FC="dismissableLayer.pointerDownOutside",WC="dismissableLayer.focusOutside",Xg,pj=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ri=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:l,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(pj),[f,h]=u.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=u.useState({}),j=Re(t,N=>h(N)),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(b),p=f?y.indexOf(f):-1,v=d.layersWithOutsidePointerEventsDisabled.size>0,w=p>=g,_=tT(N=>{const k=N.target,R=[...d.branches].some(M=>M.contains(k));!w||R||(r==null||r(N),i==null||i(N),N.defaultPrevented||o==null||o())},m),S=nT(N=>{const k=N.target;[...d.branches].some(M=>M.contains(k))||(l==null||l(N),i==null||i(N),N.defaultPrevented||o==null||o())},m);return QC(N=>{p===d.layers.size-1&&(a==null||a(N),!N.defaultPrevented&&o&&(N.preventDefault(),o()))},m),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Xg=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Kg(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Xg)}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Kg())},[f,d]),u.useEffect(()=>{const N=()=>x({});return document.addEventListener(Lf,N),()=>document.removeEventListener(Lf,N)},[]),s.jsx(pe.div,{...c,ref:j,style:{pointerEvents:v?w?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,_.onPointerDownCapture)})});Ri.displayName=ZC;var JC="DismissableLayerBranch",eT=u.forwardRef((e,t)=>{const n=u.useContext(pj),a=u.useRef(null),r=Re(t,a);return u.useEffect(()=>{const l=a.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),s.jsx(pe.div,{...e,ref:r})});eT.displayName=JC;function tT(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),a=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const l=o=>{if(o.target&&!a.current){let c=function(){gj(FC,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",l),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function nT(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),a=u.useRef(!1);return u.useEffect(()=>{const r=l=>{l.target&&!a.current&&gj(WC,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Kg(){const e=new CustomEvent(Lf);document.dispatchEvent(e)}function gj(e,t,n,{discrete:a}){const r=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),a?mj(r,l):r.dispatchEvent(l)}var xd="focusScope.autoFocusOnMount",vd="focusScope.autoFocusOnUnmount",Qg={bubbles:!1,cancelable:!0},aT="FocusScope",nu=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:l,...i}=e,[o,c]=u.useState(null),d=qn(r),f=qn(l),h=u.useRef(null),m=Re(t,y=>c(y)),x=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let y=function(v){if(x.paused||!o)return;const w=v.target;o.contains(w)?h.current=w:Oa(h.current,{select:!0})},b=function(v){if(x.paused||!o)return;const w=v.relatedTarget;w!==null&&(o.contains(w)||Oa(h.current,{select:!0}))},g=function(v){if(document.activeElement===document.body)for(const _ of v)_.removedNodes.length>0&&Oa(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const p=new MutationObserver(g);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),p.disconnect()}}},[a,o,x.paused]),u.useEffect(()=>{if(o){Fg.add(x);const y=document.activeElement;if(!o.contains(y)){const g=new CustomEvent(xd,Qg);o.addEventListener(xd,d),o.dispatchEvent(g),g.defaultPrevented||(sT(cT(xj(o)),{select:!0}),document.activeElement===y&&Oa(o))}return()=>{o.removeEventListener(xd,d),setTimeout(()=>{const g=new CustomEvent(vd,Qg);o.addEventListener(vd,f),o.dispatchEvent(g),g.defaultPrevented||Oa(y??document.body,{select:!0}),o.removeEventListener(vd,f),Fg.remove(x)},0)}}},[o,d,f,x]);const j=u.useCallback(y=>{if(!n&&!a||x.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(b&&g){const p=y.currentTarget,[v,w]=rT(p);v&&w?!y.shiftKey&&g===w?(y.preventDefault(),n&&Oa(v,{select:!0})):y.shiftKey&&g===v&&(y.preventDefault(),n&&Oa(w,{select:!0})):g===p&&y.preventDefault()}},[n,a,x.paused]);return s.jsx(pe.div,{tabIndex:-1,...i,ref:m,onKeyDown:j})});nu.displayName=aT;function sT(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Oa(a,{select:t}),document.activeElement!==n)return}function rT(e){const t=xj(e),n=Zg(t,e),a=Zg(t.reverse(),e);return[n,a]}function xj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zg(e,t){for(const n of e)if(!lT(n,{upTo:t}))return n}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function iT(e){return e instanceof HTMLInputElement&&"select"in e}function Oa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&iT(e)&&t&&e.select()}}var Fg=oT();function oT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Wg(e,t),e.unshift(t)},remove(t){var n;e=Wg(e,t),(n=e[0])==null||n.resume()}}}function Wg(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function cT(e){return e.filter(t=>t.tagName!=="A")}var uT="Portal",Ai=u.forwardRef((e,t)=>{var o;const{container:n,...a}=e,[r,l]=u.useState(!1);At(()=>l(!0),[]);const i=n||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?eN.createPortal(s.jsx(pe.div,{...a,ref:t}),i):null});Ai.displayName=uT;function dT(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var vn=e=>{const{present:t,children:n}=e,a=fT(t),r=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),l=Re(a.ref,hT(r));return typeof n=="function"||a.isPresent?u.cloneElement(r,{ref:l}):null};vn.displayName="Presence";function fT(e){const[t,n]=u.useState(),a=u.useRef(null),r=u.useRef(e),l=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=dT(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=ho(a.current);l.current=o==="mounted"?d:"none"},[o]),At(()=>{const d=a.current,f=r.current;if(f!==e){const m=l.current,x=ho(d);e?c("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&m!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),At(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=x=>{const y=ho(a.current).includes(x.animationName);if(x.target===t&&y&&(c("ANIMATION_END"),!r.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=x=>{x.target===t&&(l.current=ho(a.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:u.useCallback(d=>{a.current=d?getComputedStyle(d):null,n(d)},[])}}function ho(e){return(e==null?void 0:e.animationName)||"none"}function hT(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yd=0;function dm(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jg()),document.body.insertAdjacentElement("beforeend",e[1]??Jg()),yd++,()=>{yd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yd--}},[])}function Jg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Mn=function(){return Mn=Object.assign||function(t){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Mn.apply(this,arguments)};function vj(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n}function mT(e,t,n){if(n||arguments.length===2)for(var a=0,r=t.length,l;a<r;a++)(l||!(a in t))&&(l||(l=Array.prototype.slice.call(t,0,a)),l[a]=t[a]);return e.concat(l||Array.prototype.slice.call(t))}var Uo="right-scroll-bar-position",Ho="width-before-scroll-bar",pT="with-scroll-bars-hidden",gT="--removed-body-scroll-bar-size";function bd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xT(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var r=n.value;r!==a&&(n.value=a,n.callback(a,r))}}}})[0];return n.callback=t,n.facade}var vT=typeof window<"u"?u.useLayoutEffect:u.useEffect,ex=new WeakMap;function yT(e,t){var n=xT(null,function(a){return e.forEach(function(r){return bd(r,a)})});return vT(function(){var a=ex.get(n);if(a){var r=new Set(a),l=new Set(e),i=n.current;r.forEach(function(o){l.has(o)||bd(o,null)}),l.forEach(function(o){r.has(o)||bd(o,i)})}ex.set(n,e)},[e]),n}function bT(e){return e}function jT(e,t){t===void 0&&(t=bT);var n=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var i=t(l,a);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(l){for(a=!0;n.length;){var i=n;n=[],i.forEach(l)}n={push:function(o){return l(o)},filter:function(){return n}}},assignMedium:function(l){a=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(l),i=n}var c=function(){var f=i;i=[],f.forEach(l)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return r}function wT(e){e===void 0&&(e={});var t=jT(null);return t.options=Mn({async:!0,ssr:!1},e),t}var yj=function(e){var t=e.sideCar,n=vj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return u.createElement(a,Mn({},n))};yj.isSideCarExport=!0;function _T(e,t){return e.useMedium(t),yj}var bj=wT(),jd=function(){},au=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:jd,onWheelCapture:jd,onTouchMoveCapture:jd}),r=a[0],l=a[1],i=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,x=e.noRelative,j=e.noIsolation,y=e.inert,b=e.allowPinchZoom,g=e.as,p=g===void 0?"div":g,v=e.gapMode,w=vj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,S=yT([n,t]),N=Mn(Mn({},w),r);return u.createElement(u.Fragment,null,f&&u.createElement(_,{sideCar:bj,removeScrollBar:d,shards:h,noRelative:x,noIsolation:j,inert:y,setCallbacks:l,allowPinchZoom:!!b,lockRef:n,gapMode:v}),i?u.cloneElement(u.Children.only(o),Mn(Mn({},N),{ref:S})):u.createElement(p,Mn({},N,{className:c,ref:S}),o))});au.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};au.classNames={fullWidth:Ho,zeroRight:Uo};var NT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ST(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=NT();return t&&e.setAttribute("nonce",t),e}function kT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function CT(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var TT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ST())&&(kT(t,n),CT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ET=function(){var e=TT();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jj=function(){var e=ET(),t=function(n){var a=n.styles,r=n.dynamic;return e(a,r),null};return t},RT={left:0,top:0,right:0,gap:0},wd=function(e){return parseInt(e||"",10)||0},AT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[wd(n),wd(a),wd(r)]},MT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RT;var t=AT(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},OT=jj(),Nr="data-scroll-locked",DT=function(e,t,n,a){var r=e.left,l=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
305
+ .`.concat(pT,` {
306
+ overflow: hidden `).concat(a,`;
307
+ padding-right: `).concat(o,"px ").concat(a,`;
308
+ }
309
+ body[`).concat(Nr,`] {
310
+ overflow: hidden `).concat(a,`;
311
+ overscroll-behavior: contain;
312
+ `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
313
+ padding-left: `.concat(r,`px;
314
+ padding-top: `).concat(l,`px;
315
+ padding-right: `).concat(i,`px;
316
+ margin-left:0;
317
+ margin-top:0;
318
+ margin-right: `).concat(o,"px ").concat(a,`;
319
+ `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
320
+ }
321
+
322
+ .`).concat(Uo,` {
323
+ right: `).concat(o,"px ").concat(a,`;
324
+ }
325
+
326
+ .`).concat(Ho,` {
327
+ margin-right: `).concat(o,"px ").concat(a,`;
328
+ }
329
+
330
+ .`).concat(Uo," .").concat(Uo,` {
331
+ right: 0 `).concat(a,`;
332
+ }
333
+
334
+ .`).concat(Ho," .").concat(Ho,` {
335
+ margin-right: 0 `).concat(a,`;
336
+ }
337
+
338
+ body[`).concat(Nr,`] {
339
+ `).concat(gT,": ").concat(o,`px;
340
+ }
341
+ `)},tx=function(){var e=parseInt(document.body.getAttribute(Nr)||"0",10);return isFinite(e)?e:0},zT=function(){u.useEffect(function(){return document.body.setAttribute(Nr,(tx()+1).toString()),function(){var e=tx()-1;e<=0?document.body.removeAttribute(Nr):document.body.setAttribute(Nr,e.toString())}},[])},$T=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;zT();var l=u.useMemo(function(){return MT(r)},[r]);return u.createElement(OT,{styles:DT(l,!t,r,n?"":"!important")})},Uf=!1;if(typeof window<"u")try{var mo=Object.defineProperty({},"passive",{get:function(){return Uf=!0,!0}});window.addEventListener("test",mo,mo),window.removeEventListener("test",mo,mo)}catch{Uf=!1}var Ks=Uf?{passive:!1}:!1,LT=function(e){return e.tagName==="TEXTAREA"},wj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!LT(e)&&n[t]==="visible")},UT=function(e){return wj(e,"overflowY")},HT=function(e){return wj(e,"overflowX")},nx=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=_j(e,a);if(r){var l=Nj(e,a),i=l[1],o=l[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},BT=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},qT=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},_j=function(e,t){return e==="v"?UT(t):HT(t)},Nj=function(e,t){return e==="v"?BT(t):qT(t)},GT=function(e,t){return e==="h"&&t==="rtl"?-1:1},IT=function(e,t,n,a,r){var l=GT(e,window.getComputedStyle(t).direction),i=l*a,o=n.target,c=t.contains(o),d=!1,f=i>0,h=0,m=0;do{if(!o)break;var x=Nj(e,o),j=x[0],y=x[1],b=x[2],g=y-b-l*j;(j||g)&&_j(e,o)&&(h+=g,m+=j);var p=o.parentNode;o=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},po=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ax=function(e){return[e.deltaX,e.deltaY]},sx=function(e){return e&&"current"in e?e.current:e},VT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YT=function(e){return`
342
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
343
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
344
+ `)},PT=0,Qs=[];function XT(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),r=u.useState(PT++)[0],l=u.useState(jj)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var y=mT([e.lockRef.current],(e.shards||[]).map(sx),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var g=po(y),p=n.current,v="deltaX"in y?y.deltaX:p[0]-g[0],w="deltaY"in y?y.deltaY:p[1]-g[1],_,S=y.target,N=Math.abs(v)>Math.abs(w)?"h":"v";if("touches"in y&&N==="h"&&S.type==="range")return!1;var k=nx(N,S);if(!k)return!0;if(k?_=N:(_=N==="v"?"h":"v",k=nx(N,S)),!k)return!1;if(!a.current&&"changedTouches"in y&&(v||w)&&(a.current=_),!_)return!0;var R=a.current||_;return IT(R,b,y,R==="h"?v:w)},[]),c=u.useCallback(function(y){var b=y;if(!(!Qs.length||Qs[Qs.length-1]!==l)){var g="deltaY"in b?ax(b):po(b),p=t.current.filter(function(_){return _.name===b.type&&(_.target===b.target||b.target===_.shadowParent)&&VT(_.delta,g)})[0];if(p&&p.should){b.cancelable&&b.preventDefault();return}if(!p){var v=(i.current.shards||[]).map(sx).filter(Boolean).filter(function(_){return _.contains(b.target)}),w=v.length>0?o(b,v[0]):!i.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),d=u.useCallback(function(y,b,g,p){var v={name:y,delta:b,target:g,should:p,shadowParent:KT(g)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(w){return w!==v})},1)},[]),f=u.useCallback(function(y){n.current=po(y),a.current=void 0},[]),h=u.useCallback(function(y){d(y.type,ax(y),y.target,o(y,e.lockRef.current))},[]),m=u.useCallback(function(y){d(y.type,po(y),y.target,o(y,e.lockRef.current))},[]);u.useEffect(function(){return Qs.push(l),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Ks),document.addEventListener("touchmove",c,Ks),document.addEventListener("touchstart",f,Ks),function(){Qs=Qs.filter(function(y){return y!==l}),document.removeEventListener("wheel",c,Ks),document.removeEventListener("touchmove",c,Ks),document.removeEventListener("touchstart",f,Ks)}},[]);var x=e.removeScrollBar,j=e.inert;return u.createElement(u.Fragment,null,j?u.createElement(l,{styles:YT(r)}):null,x?u.createElement($T,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function KT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QT=_T(bj,XT);var su=u.forwardRef(function(e,t){return u.createElement(au,Mn({},e,{ref:t,sideCar:QT}))});su.classNames=au.classNames;var ZT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zs=new WeakMap,go=new WeakMap,xo={},_d=0,Sj=function(e){return e&&(e.host||Sj(e.parentNode))},FT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=Sj(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},WT=function(e,t,n,a){var r=FT(t,Array.isArray(e)?e:[e]);xo[n]||(xo[n]=new WeakMap);var l=xo[n],i=[],o=new Set,c=new Set(r),d=function(h){!h||o.has(h)||(o.add(h),d(h.parentNode))};r.forEach(d);var f=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(o.has(m))f(m);else try{var x=m.getAttribute(a),j=x!==null&&x!=="false",y=(Zs.get(m)||0)+1,b=(l.get(m)||0)+1;Zs.set(m,y),l.set(m,b),i.push(m),y===1&&j&&go.set(m,!0),b===1&&m.setAttribute(n,"true"),j||m.setAttribute(a,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return f(t),o.clear(),_d++,function(){i.forEach(function(h){var m=Zs.get(h)-1,x=l.get(h)-1;Zs.set(h,m),l.set(h,x),m||(go.has(h)||h.removeAttribute(a),go.delete(h)),x||h.removeAttribute(n)}),_d--,_d||(Zs=new WeakMap,Zs=new WeakMap,go=new WeakMap,xo={})}},fm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=ZT(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),WT(a,r,n,"aria-hidden")):function(){return null}},ru="Dialog",[kj]=Pn(ru),[JT,En]=kj(ru),Cj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:r,onOpenChange:l,modal:i=!0}=e,o=u.useRef(null),c=u.useRef(null),[d,f]=as({prop:a,defaultProp:r??!1,onChange:l,caller:ru});return s.jsx(JT,{scope:t,triggerRef:o,contentRef:c,contentId:_n(),titleId:_n(),descriptionId:_n(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};Cj.displayName=ru;var Tj="DialogTrigger",eE=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=En(Tj,n),l=Re(t,r.triggerRef);return s.jsx(pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":pm(r.open),...a,ref:l,onClick:Z(e.onClick,r.onOpenToggle)})});eE.displayName=Tj;var hm="DialogPortal",[tE,Ej]=kj(hm,{forceMount:void 0}),Rj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,l=En(hm,t);return s.jsx(tE,{scope:t,forceMount:n,children:u.Children.map(a,i=>s.jsx(vn,{present:n||l.open,children:s.jsx(Ai,{asChild:!0,container:r,children:i})}))})};Rj.displayName=hm;var bc="DialogOverlay",Aj=u.forwardRef((e,t)=>{const n=Ej(bc,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=En(bc,e.__scopeDialog);return l.modal?s.jsx(vn,{present:a||l.open,children:s.jsx(aE,{...r,ref:t})}):null});Aj.displayName=bc;var nE=As("DialogOverlay.RemoveScroll"),aE=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=En(bc,n);return s.jsx(su,{as:nE,allowPinchZoom:!0,shards:[r.contentRef],children:s.jsx(pe.div,{"data-state":pm(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ms="DialogContent",Mj=u.forwardRef((e,t)=>{const n=Ej(Ms,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=En(Ms,e.__scopeDialog);return s.jsx(vn,{present:a||l.open,children:l.modal?s.jsx(sE,{...r,ref:t}):s.jsx(rE,{...r,ref:t})})});Mj.displayName=Ms;var sE=u.forwardRef((e,t)=>{const n=En(Ms,e.__scopeDialog),a=u.useRef(null),r=Re(t,n.contentRef,a);return u.useEffect(()=>{const l=a.current;if(l)return fm(l)},[]),s.jsx(Oj,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&l.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,l=>l.preventDefault())})}),rE=u.forwardRef((e,t)=>{const n=En(Ms,e.__scopeDialog),a=u.useRef(!1),r=u.useRef(!1);return s.jsx(Oj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(a.current||(o=n.triggerRef.current)==null||o.focus(),l.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:l=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&r.current&&l.preventDefault()}})}),Oj=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:l,...i}=e,o=En(Ms,n),c=u.useRef(null),d=Re(t,c);return dm(),s.jsxs(s.Fragment,{children:[s.jsx(nu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:l,children:s.jsx(Ri,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":pm(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(lE,{titleId:o.titleId}),s.jsx(oE,{contentRef:c,descriptionId:o.descriptionId})]})]})}),mm="DialogTitle",Dj=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=En(mm,n);return s.jsx(pe.h2,{id:r.titleId,...a,ref:t})});Dj.displayName=mm;var zj="DialogDescription",$j=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=En(zj,n);return s.jsx(pe.p,{id:r.descriptionId,...a,ref:t})});$j.displayName=zj;var Lj="DialogClose",Uj=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=En(Lj,n);return s.jsx(pe.button,{type:"button",...a,ref:t,onClick:Z(e.onClick,()=>r.onOpenChange(!1))})});Uj.displayName=Lj;function pm(e){return e?"open":"closed"}var Hj="DialogTitleWarning",[_z,Bj]=zC(Hj,{contentName:Ms,titleName:mm,docsSlug:"dialog"}),lE=({titleId:e})=>{const t=Bj(Hj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
345
+
346
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
347
+
348
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},iE="DialogDescriptionWarning",oE=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bj(iE).contentName}}.`;return u.useEffect(()=>{var l;const r=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},qj=Cj,Gj=Rj,Ij=Aj,Vj=Mj,Yj=Dj,Pj=$j,gm=Uj;function xm({className:e,...t}){return s.jsx(S2,{role:"status","aria-label":"Loading",className:F("size-4 animate-spin",e),...t})}const Bo="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",vm=Ei("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",warning:"bg-warning text-warning-foreground hover:bg-warning/90",success:"bg-success text-success-foreground hover:bg-success/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",text:"underline-offset-2 hover:underline"},size:{"inline-sm":"p-1 text-sm",inline:"p-1 text-base",default:"h-9 px-4 py-2 text-sm",sm:"h-8 px-3 text-sm",control:"h-7 px-2 text-xs",lg:"h-10 px-6 text-base",icon:"size-9 text-sm","sm-icon":"size-8 text-sm","control-icon":"size-7 text-xs","xs-icon":"size-6 text-xs"}},defaultVariants:{variant:"default",size:"default"}}),I=u.forwardRef(({className:e,disabled:t,variant:n,size:a,asChild:r=!1,loading:l,children:i,...o},c)=>{const d=r?GC:"button",f=a==="icon"||a==="sm-icon"||a==="control-icon"||a==="xs-icon",h=s.jsx(xm,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:F(!f&&"mr-2")}),m=r?i:l&&f?h:s.jsxs(s.Fragment,{children:[l?h:null,i]});return s.jsx(d,{className:F(vm({variant:n,size:a,className:e})),ref:c,disabled:t||l,...o,children:m})});I.displayName="Button";const Xj=u.createContext(null);function cE({container:e,children:t}){return s.jsx(Xj.Provider,{value:e,children:t})}function Mi(){return u.useContext(Xj)??void 0}function uE(e){return s.jsx(qj,{"data-slot":"alert-dialog",...e})}function dE({className:e,...t}){return s.jsx(Ij,{"data-slot":"alert-dialog-overlay",className:F("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function fE({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:a,...r}){return s.jsxs(Gj,{container:Mi(),children:[s.jsx(dE,{}),s.jsx(Vj,{"data-slot":"alert-dialog-content",role:"alertdialog",className:F("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),onOpenAutoFocus:l=>{if(t==null||t(l),l.defaultPrevented)return;const i=l.currentTarget,o=i instanceof HTMLElement?i.querySelector('[data-slot="alert-dialog-cancel"]'):null;o&&(l.preventDefault(),o.focus())},onPointerDownOutside:l=>{n==null||n(l),l.preventDefault()},onInteractOutside:l=>{a==null||a(l),l.preventDefault()},...r})]})}function hE({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:F("flex flex-col gap-2 text-center sm:text-left",e),...t})}function mE({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:F("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function pE({className:e,...t}){return s.jsx(Yj,{"data-slot":"alert-dialog-title",className:F("text-lg font-semibold",e),...t})}function gE({className:e,...t}){return s.jsx(Pj,{"data-slot":"alert-dialog-description",className:F("text-muted-foreground text-sm",e),...t})}function xE({className:e,variant:t,...n}){return s.jsx(gm,{"data-slot":"alert-dialog-action",className:F(vm({variant:t}),e),...n})}function vE({className:e,...t}){return s.jsx(gm,{"data-slot":"alert-dialog-cancel",className:F(vm({variant:"outline"}),e),...t})}function yE(){if(typeof document>"u")return null;const e=document.activeElement;if(!(e instanceof HTMLElement)||e===document.body)return null;const t=e.closest('[role="menu"]');if(t!=null&&t.id){const n=document.querySelector(`[aria-controls="${CSS.escape(t.id)}"]`);if(n)return n}return e}function bE(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function Jr(){const[e,t]=u.useState(null),n=u.useRef(null),a=u.useRef(null),r=u.useCallback(o=>{var c;(c=n.current)==null||c.resolve(o),n.current=null,t(null)},[]),l=u.useCallback(o=>new Promise(c=>{var f;(f=n.current)==null||f.resolve(!1),a.current=yE();const d={...o,resolve:c};n.current=d,t(d)}),[]);u.useEffect(()=>()=>{var o;return(o=n.current)==null?void 0:o.resolve(!1)},[]);const i=s.jsx(uE,{open:e!==null,onOpenChange:o=>{o||r(!1)},children:s.jsxs(fE,{onCloseAutoFocus:o=>bE(o,a.current),children:[s.jsxs(hE,{children:[s.jsx(pE,{children:e==null?void 0:e.title}),s.jsx(gE,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),s.jsxs(mE,{children:[s.jsx(vE,{children:"Cancel"}),s.jsx(xE,{variant:e!=null&&e.destructive?"destructive":"default",onClick:()=>r(!0),children:e==null?void 0:e.action_label})]})]})});return{confirm:l,confirm_dialog:i}}const na="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",jE=Ei("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${na} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${na} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${na} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${na} text-foreground`,success:`${na} border-success/40 bg-success/10 text-success`,warning:`${na} border-warning/40 bg-warning/10 text-warning`,info:`${na} border-info/40 bg-info/10 text-info`,error:`${na} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${na} border-border bg-muted text-muted-foreground`,count:"h-5 min-w-5 justify-center border-transparent bg-primary px-1 text-2xs font-medium tabular-nums text-primary-foreground"},size:{default:"",dense:"px-1.5 py-0.5 text-2xs font-medium"}},defaultVariants:{variant:"default",size:"default"}});function Ve({className:e,variant:t,size:n,...a}){return s.jsx("div",{className:F(jE({variant:t,size:n}),e),...a})}function Kj(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Qj(e){const[t,n]=u.useState(void 0);return At(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const l=r[0];let i,o;if("borderBoxSize"in l){const c=l.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,o=d.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var lu="Checkbox",[wE]=Pn(lu),[_E,ym]=wE(lu);function NE(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:r,disabled:l,form:i,name:o,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[m,x]=as({prop:n,defaultProp:r??!1,onChange:c,caller:lu}),[j,y]=u.useState(null),[b,g]=u.useState(null),p=u.useRef(!1),v=j?!!i||!!j.closest("form"):!0,w={checked:m,disabled:l,setChecked:x,control:j,setControl:y,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:p,required:d,defaultChecked:Ja(r)?!1:r,isFormControl:v,bubbleInput:b,setBubbleInput:g};return s.jsx(_E,{scope:t,...w,children:SE(h)?h(w):a})}var Zj="CheckboxTrigger",Fj=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},r)=>{const{control:l,value:i,disabled:o,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:x,bubbleInput:j}=ym(Zj,e),y=Re(r,f),b=u.useRef(c);return u.useEffect(()=>{const g=l==null?void 0:l.form;if(g){const p=()=>h(b.current);return g.addEventListener("reset",p),()=>g.removeEventListener("reset",p)}},[l,h]),s.jsx(pe.button,{type:"button",role:"checkbox","aria-checked":Ja(c)?"mixed":c,"aria-required":d,"data-state":n0(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:y,onKeyDown:Z(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:Z(n,g=>{h(p=>Ja(p)?!0:!p),j&&x&&(m.current=g.isPropagationStopped(),m.current||g.stopPropagation())})})});Fj.displayName=Zj;var bm=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:r,defaultChecked:l,required:i,disabled:o,value:c,onCheckedChange:d,form:f,...h}=e;return s.jsx(NE,{__scopeCheckbox:n,checked:r,defaultChecked:l,disabled:o,required:i,onCheckedChange:d,name:a,form:f,value:c,internal_do_not_use_render:({isFormControl:m})=>s.jsxs(s.Fragment,{children:[s.jsx(Fj,{...h,ref:t,__scopeCheckbox:n}),m&&s.jsx(t0,{__scopeCheckbox:n})]})})});bm.displayName=lu;var Wj="CheckboxIndicator",Jj=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...r}=e,l=ym(Wj,n);return s.jsx(vn,{present:a||Ja(l.checked)||l.checked===!0,children:s.jsx(pe.span,{"data-state":n0(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Jj.displayName=Wj;var e0="CheckboxBubbleInput",t0=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:r,checked:l,defaultChecked:i,required:o,disabled:c,name:d,value:f,form:h,bubbleInput:m,setBubbleInput:x}=ym(e0,e),j=Re(n,x),y=Kj(l),b=Qj(a);u.useEffect(()=>{const p=m;if(!p)return;const v=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(v,"checked").set,S=!r.current;if(y!==l&&_){const N=new Event("click",{bubbles:S});p.indeterminate=Ja(l),_.call(p,Ja(l)?!1:l),p.dispatchEvent(N)}},[m,y,l,r]);const g=u.useRef(Ja(l)?!1:l);return s.jsx(pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??g.current,required:o,disabled:c,name:d,value:f,form:h,...t,tabIndex:-1,ref:j,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});t0.displayName=e0;function SE(e){return typeof e=="function"}function Ja(e){return e==="indeterminate"}function n0(e){return Ja(e)?"indeterminate":e?"checked":"unchecked"}const el=u.forwardRef(({className:e,...t},n)=>s.jsx(bm,{ref:n,className:F("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=indeterminate]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:text-primary-foreground",e),...t,children:s.jsx(Jj,{className:F("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?s.jsx(A2,{className:"size-4","aria-hidden":"true"}):s.jsx(Zr,{className:"size-4","aria-hidden":"true"})})}));el.displayName=bm.displayName;const kE=Ei("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",{variants:{size:{sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl","2xl":"sm:max-w-6xl",full:"sm:max-w-[calc(100%-2rem)]"}},defaultVariants:{size:"md"}});function Oi({...e}){return s.jsx(qj,{"data-slot":"dialog",...e})}function CE({...e}){const t=Mi();return s.jsx(Gj,{"data-slot":"dialog-portal",container:t,...e})}function TE({className:e,...t}){return s.jsx(Ij,{"data-slot":"dialog-overlay",className:F("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Di({className:e,children:t,showCloseButton:n=!0,size:a,...r}){return s.jsxs(CE,{"data-slot":"dialog-portal",children:[s.jsx(TE,{}),s.jsxs(Vj,{"data-slot":"dialog-content",className:F(kE({size:a}),e),...r,children:[t,n&&s.jsxs(gm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-muted-foreground hover:text-foreground absolute top-4 right-4 rounded-xs transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(ej,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function zi({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:F("flex flex-col gap-2 text-center sm:text-left",e),...t})}function $i({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:F("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Li({className:e,...t}){return s.jsx(Yj,{"data-slot":"dialog-title",className:F("text-lg leading-none font-semibold",e),...t})}function Ui({className:e,...t}){return s.jsx(Pj,{"data-slot":"dialog-description",className:F("text-muted-foreground text-sm",e),...t})}function jm(e){const t=e+"CollectionProvider",[n,a]=Pn(t),[r,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=y=>{const{scope:b,children:g}=y,p=Aa.useRef(null),v=Aa.useRef(new Map).current;return s.jsx(r,{scope:b,itemMap:v,collectionRef:p,children:g})};i.displayName=t;const o=e+"CollectionSlot",c=As(o),d=Aa.forwardRef((y,b)=>{const{scope:g,children:p}=y,v=l(o,g),w=Re(b,v.collectionRef);return s.jsx(c,{ref:w,children:p})});d.displayName=o;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=As(f),x=Aa.forwardRef((y,b)=>{const{scope:g,children:p,...v}=y,w=Aa.useRef(null),_=Re(b,w),S=l(f,g);return Aa.useEffect(()=>(S.itemMap.set(w,{ref:w,...v}),()=>void S.itemMap.delete(w))),s.jsx(m,{[h]:"",ref:_,children:p})});x.displayName=f;function j(y){const b=l(e+"CollectionConsumer",y);return Aa.useCallback(()=>{const p=b.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((S,N)=>v.indexOf(S.ref.current)-v.indexOf(N.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:d,ItemSlot:x},j,a]}var EE=u.createContext(void 0);function iu(e){const t=u.useContext(EE);return e||t||"ltr"}const RE=["top","right","bottom","left"],ss=Math.min,Xt=Math.max,jc=Math.round,vo=Math.floor,Un=e=>({x:e,y:e}),AE={left:"right",right:"left",bottom:"top",top:"bottom"},ME={start:"end",end:"start"};function Hf(e,t,n){return Xt(e,ss(t,n))}function xa(e,t){return typeof e=="function"?e(t):e}function va(e){return e.split("-")[0]}function tl(e){return e.split("-")[1]}function wm(e){return e==="x"?"y":"x"}function _m(e){return e==="y"?"height":"width"}function Dn(e){return["top","bottom"].includes(va(e))?"y":"x"}function Nm(e){return wm(Dn(e))}function OE(e,t,n){n===void 0&&(n=!1);const a=tl(e),r=Nm(e),l=_m(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=wc(i)),[i,wc(i)]}function DE(e){const t=wc(e);return[Bf(e),t,Bf(t)]}function Bf(e){return e.replace(/start|end/g,t=>ME[t])}function zE(e,t,n){const a=["left","right"],r=["right","left"],l=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:a:t?a:r;case"left":case"right":return t?l:i;default:return[]}}function $E(e,t,n,a){const r=tl(e);let l=zE(va(e),n==="start",a);return r&&(l=l.map(i=>i+"-"+r),t&&(l=l.concat(l.map(Bf)))),l}function wc(e){return e.replace(/left|right|bottom|top/g,t=>AE[t])}function LE(e){return{top:0,right:0,bottom:0,left:0,...e}}function a0(e){return typeof e!="number"?LE(e):{top:e,right:e,bottom:e,left:e}}function _c(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function rx(e,t,n){let{reference:a,floating:r}=e;const l=Dn(t),i=Nm(t),o=_m(i),c=va(t),d=l==="y",f=a.x+a.width/2-r.width/2,h=a.y+a.height/2-r.height/2,m=a[o]/2-r[o]/2;let x;switch(c){case"top":x={x:f,y:a.y-r.height};break;case"bottom":x={x:f,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:h};break;case"left":x={x:a.x-r.width,y:h};break;default:x={x:a.x,y:a.y}}switch(tl(t)){case"start":x[i]-=m*(n&&d?-1:1);break;case"end":x[i]+=m*(n&&d?-1:1);break}return x}const UE=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:l=[],platform:i}=n,o=l.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:h}=rx(d,a,c),m=a,x={},j=0;for(let y=0;y<o.length;y++){const{name:b,fn:g}=o[y],{x:p,y:v,data:w,reset:_}=await g({x:f,y:h,initialPlacement:a,placement:m,strategy:r,middlewareData:x,rects:d,platform:i,elements:{reference:e,floating:t}});f=p??f,h=v??h,x={...x,[b]:{...x[b],...w}},_&&j<=50&&(j++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(d=_.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):_.rects),{x:f,y:h}=rx(d,m,c)),y=-1)}return{x:f,y:h,placement:m,strategy:r,middlewareData:x}};async function ri(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:l,rects:i,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:x=0}=xa(t,e),j=a0(x),b=o[m?h==="floating"?"reference":"floating":h],g=_c(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(b)))==null||n?b:b.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),p=h==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(l.getOffsetParent==null?void 0:l.getOffsetParent(o.floating)),w=await(l.isElement==null?void 0:l.isElement(v))?await(l.getScale==null?void 0:l.getScale(v))||{x:1,y:1}:{x:1,y:1},_=_c(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:v,strategy:c}):p);return{top:(g.top-_.top+j.top)/w.y,bottom:(_.bottom-g.bottom+j.bottom)/w.y,left:(g.left-_.left+j.left)/w.x,right:(_.right-g.right+j.right)/w.x}}const HE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:l,platform:i,elements:o,middlewareData:c}=t,{element:d,padding:f=0}=xa(e,t)||{};if(d==null)return{};const h=a0(f),m={x:n,y:a},x=Nm(r),j=_m(x),y=await i.getDimensions(d),b=x==="y",g=b?"top":"left",p=b?"bottom":"right",v=b?"clientHeight":"clientWidth",w=l.reference[j]+l.reference[x]-m[x]-l.floating[j],_=m[x]-l.reference[x],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let N=S?S[v]:0;(!N||!await(i.isElement==null?void 0:i.isElement(S)))&&(N=o.floating[v]||l.floating[j]);const k=w/2-_/2,R=N/2-y[j]/2-1,M=ss(h[g],R),z=ss(h[p],R),U=M,C=N-y[j]-z,D=N/2-y[j]/2+k,G=Hf(U,D,C),E=!c.arrow&&tl(r)!=null&&D!==G&&l.reference[j]/2-(D<U?M:z)-y[j]/2<0,B=E?D<U?D-U:D-C:0;return{[x]:m[x]+B,data:{[x]:G,centerOffset:D-G-B,...E&&{alignmentOffset:B}},reset:E}}}),BE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:l,rects:i,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:y=!0,...b}=xa(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=va(r),p=Dn(o),v=va(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=m||(v||!y?[wc(o)]:DE(o)),S=j!=="none";!m&&S&&_.push(...$E(o,y,j,w));const N=[o,..._],k=await ri(t,b),R=[];let M=((a=l.flip)==null?void 0:a.overflows)||[];if(f&&R.push(k[g]),h){const D=OE(r,i,w);R.push(k[D[0]],k[D[1]])}if(M=[...M,{placement:r,overflows:R}],!R.every(D=>D<=0)){var z,U;const D=(((z=l.flip)==null?void 0:z.index)||0)+1,G=N[D];if(G&&(!(h==="alignment"?p!==Dn(G):!1)||M.every(T=>T.overflows[0]>0&&Dn(T.placement)===p)))return{data:{index:D,overflows:M},reset:{placement:G}};let E=(U=M.filter(B=>B.overflows[0]<=0).sort((B,T)=>B.overflows[1]-T.overflows[1])[0])==null?void 0:U.placement;if(!E)switch(x){case"bestFit":{var C;const B=(C=M.filter(T=>{if(S){const L=Dn(T.placement);return L===p||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,K)=>L+K,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:C[0];B&&(E=B);break}case"initialPlacement":E=o;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function lx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ix(e){return RE.some(t=>e[t]>=0)}const qE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...r}=xa(e,t);switch(a){case"referenceHidden":{const l=await ri(t,{...r,elementContext:"reference"}),i=lx(l,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ix(i)}}}case"escaped":{const l=await ri(t,{...r,altBoundary:!0}),i=lx(l,n.floating);return{data:{escapedOffsets:i,escaped:ix(i)}}}default:return{}}}}};async function GE(e,t){const{placement:n,platform:a,elements:r}=e,l=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=va(n),o=tl(n),c=Dn(n)==="y",d=["left","top"].includes(i)?-1:1,f=l&&c?-1:1,h=xa(t,e);let{mainAxis:m,crossAxis:x,alignmentAxis:j}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof j=="number"&&(x=o==="end"?j*-1:j),c?{x:x*f,y:m*d}:{x:m*d,y:x*f}}const IE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:l,placement:i,middlewareData:o}=t,c=await GE(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(a=o.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:l+c.y,data:{...c,placement:i}}}}},VE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r}=t,{mainAxis:l=!0,crossAxis:i=!1,limiter:o={fn:b=>{let{x:g,y:p}=b;return{x:g,y:p}}},...c}=xa(e,t),d={x:n,y:a},f=await ri(t,c),h=Dn(va(r)),m=wm(h);let x=d[m],j=d[h];if(l){const b=m==="y"?"top":"left",g=m==="y"?"bottom":"right",p=x+f[b],v=x-f[g];x=Hf(p,x,v)}if(i){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",p=j+f[b],v=j-f[g];j=Hf(p,j,v)}const y=o.fn({...t,[m]:x,[h]:j});return{...y,data:{x:y.x-n,y:y.y-a,enabled:{[m]:l,[h]:i}}}}}},YE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:l,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=xa(e,t),f={x:n,y:a},h=Dn(r),m=wm(h);let x=f[m],j=f[h];const y=xa(o,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const v=m==="y"?"height":"width",w=l.reference[m]-l.floating[v]+b.mainAxis,_=l.reference[m]+l.reference[v]-b.mainAxis;x<w?x=w:x>_&&(x=_)}if(d){var g,p;const v=m==="y"?"width":"height",w=["top","left"].includes(va(r)),_=l.reference[h]-l.floating[v]+(w&&((g=i.offset)==null?void 0:g[h])||0)+(w?0:b.crossAxis),S=l.reference[h]+l.reference[v]+(w?0:((p=i.offset)==null?void 0:p[h])||0)-(w?b.crossAxis:0);j<_?j=_:j>S&&(j=S)}return{[m]:x,[h]:j}}}},PE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:l,platform:i,elements:o}=t,{apply:c=()=>{},...d}=xa(e,t),f=await ri(t,d),h=va(r),m=tl(r),x=Dn(r)==="y",{width:j,height:y}=l.floating;let b,g;h==="top"||h==="bottom"?(b=h,g=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=h,b=m==="end"?"top":"bottom");const p=y-f.top-f.bottom,v=j-f.left-f.right,w=ss(y-f[b],p),_=ss(j-f[g],v),S=!t.middlewareData.shift;let N=w,k=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=v),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(N=p),S&&!m){const M=Xt(f.left,0),z=Xt(f.right,0),U=Xt(f.top,0),C=Xt(f.bottom,0);x?k=j-2*(M!==0||z!==0?M+z:Xt(f.left,f.right)):N=y-2*(U!==0||C!==0?U+C:Xt(f.top,f.bottom))}await c({...t,availableWidth:k,availableHeight:N});const R=await i.getDimensions(o.floating);return j!==R.width||y!==R.height?{reset:{rects:!0}}:{}}}};function ou(){return typeof window<"u"}function nl(e){return s0(e)?(e.nodeName||"").toLowerCase():"#document"}function Jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xn(e){var t;return(t=(s0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s0(e){return ou()?e instanceof Node||e instanceof Jt(e).Node:!1}function kn(e){return ou()?e instanceof Element||e instanceof Jt(e).Element:!1}function Gn(e){return ou()?e instanceof HTMLElement||e instanceof Jt(e).HTMLElement:!1}function ox(e){return!ou()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jt(e).ShadowRoot}function Hi(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function XE(e){return["table","td","th"].includes(nl(e))}function cu(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Sm(e){const t=km(),n=kn(e)?Cn(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function KE(e){let t=rs(e);for(;Gn(t)&&!Br(t);){if(Sm(t))return t;if(cu(t))return null;t=rs(t)}return null}function km(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Br(e){return["html","body","#document"].includes(nl(e))}function Cn(e){return Jt(e).getComputedStyle(e)}function uu(e){return kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rs(e){if(nl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ox(e)&&e.host||Xn(e);return ox(t)?t.host:t}function r0(e){const t=rs(e);return Br(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gn(t)&&Hi(t)?t:r0(t)}function li(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=r0(e),l=r===((a=e.ownerDocument)==null?void 0:a.body),i=Jt(r);if(l){const o=qf(i);return t.concat(i,i.visualViewport||[],Hi(r)?r:[],o&&n?li(o):[])}return t.concat(r,li(r,[],n))}function qf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l0(e){const t=Cn(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Gn(e),l=r?e.offsetWidth:n,i=r?e.offsetHeight:a,o=jc(n)!==l||jc(a)!==i;return o&&(n=l,a=i),{width:n,height:a,$:o}}function Cm(e){return kn(e)?e:e.contextElement}function Sr(e){const t=Cm(e);if(!Gn(t))return Un(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:l}=l0(t);let i=(l?jc(n.width):n.width)/a,o=(l?jc(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const QE=Un(0);function i0(e){const t=Jt(e);return!km()||!t.visualViewport?QE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jt(e)?!1:t}function Os(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),l=Cm(e);let i=Un(1);t&&(a?kn(a)&&(i=Sr(a)):i=Sr(e));const o=ZE(l,n,a)?i0(l):Un(0);let c=(r.left+o.x)/i.x,d=(r.top+o.y)/i.y,f=r.width/i.x,h=r.height/i.y;if(l){const m=Jt(l),x=a&&kn(a)?Jt(a):a;let j=m,y=qf(j);for(;y&&a&&x!==j;){const b=Sr(y),g=y.getBoundingClientRect(),p=Cn(y),v=g.left+(y.clientLeft+parseFloat(p.paddingLeft))*b.x,w=g.top+(y.clientTop+parseFloat(p.paddingTop))*b.y;c*=b.x,d*=b.y,f*=b.x,h*=b.y,c+=v,d+=w,j=Jt(y),y=qf(j)}}return _c({width:f,height:h,x:c,y:d})}function Tm(e,t){const n=uu(e).scrollLeft;return t?t.left+n:Os(Xn(e)).left+n}function o0(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-(n?0:Tm(e,a)),l=a.top+t.scrollTop;return{x:r,y:l}}function FE(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const l=r==="fixed",i=Xn(a),o=t?cu(t.floating):!1;if(a===i||o&&l)return n;let c={scrollLeft:0,scrollTop:0},d=Un(1);const f=Un(0),h=Gn(a);if((h||!h&&!l)&&((nl(a)!=="body"||Hi(i))&&(c=uu(a)),Gn(a))){const x=Os(a);d=Sr(a),f.x=x.x+a.clientLeft,f.y=x.y+a.clientTop}const m=i&&!h&&!l?o0(i,c,!0):Un(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function WE(e){return Array.from(e.getClientRects())}function JE(e){const t=Xn(e),n=uu(e),a=e.ownerDocument.body,r=Xt(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=Xt(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+Tm(e);const o=-n.scrollTop;return Cn(a).direction==="rtl"&&(i+=Xt(t.clientWidth,a.clientWidth)-r),{width:r,height:l,x:i,y:o}}function eR(e,t){const n=Jt(e),a=Xn(e),r=n.visualViewport;let l=a.clientWidth,i=a.clientHeight,o=0,c=0;if(r){l=r.width,i=r.height;const d=km();(!d||d&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:l,height:i,x:o,y:c}}function tR(e,t){const n=Os(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,l=Gn(e)?Sr(e):Un(1),i=e.clientWidth*l.x,o=e.clientHeight*l.y,c=r*l.x,d=a*l.y;return{width:i,height:o,x:c,y:d}}function cx(e,t,n){let a;if(t==="viewport")a=eR(e,n);else if(t==="document")a=JE(Xn(e));else if(kn(t))a=tR(t,n);else{const r=i0(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return _c(a)}function c0(e,t){const n=rs(e);return n===t||!kn(n)||Br(n)?!1:Cn(n).position==="fixed"||c0(n,t)}function nR(e,t){const n=t.get(e);if(n)return n;let a=li(e,[],!1).filter(o=>kn(o)&&nl(o)!=="body"),r=null;const l=Cn(e).position==="fixed";let i=l?rs(e):e;for(;kn(i)&&!Br(i);){const o=Cn(i),c=Sm(i);!c&&o.position==="fixed"&&(r=null),(l?!c&&!r:!c&&o.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Hi(i)&&!c&&c0(e,i))?a=a.filter(f=>f!==i):r=o,i=rs(i)}return t.set(e,a),a}function aR(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[...n==="clippingAncestors"?cu(t)?[]:nR(t,this._c):[].concat(n),a],o=i[0],c=i.reduce((d,f)=>{const h=cx(t,f,r);return d.top=Xt(h.top,d.top),d.right=ss(h.right,d.right),d.bottom=ss(h.bottom,d.bottom),d.left=Xt(h.left,d.left),d},cx(t,o,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function sR(e){const{width:t,height:n}=l0(e);return{width:t,height:n}}function rR(e,t,n){const a=Gn(t),r=Xn(t),l=n==="fixed",i=Os(e,!0,l,t);let o={scrollLeft:0,scrollTop:0};const c=Un(0);function d(){c.x=Tm(r)}if(a||!a&&!l)if((nl(t)!=="body"||Hi(r))&&(o=uu(t)),a){const x=Os(t,!0,l,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&d();l&&!a&&r&&d();const f=r&&!a&&!l?o0(r,o):Un(0),h=i.left+o.scrollLeft-c.x-f.x,m=i.top+o.scrollTop-c.y-f.y;return{x:h,y:m,width:i.width,height:i.height}}function Nd(e){return Cn(e).position==="static"}function ux(e,t){if(!Gn(e)||Cn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xn(e)===n&&(n=n.ownerDocument.body),n}function u0(e,t){const n=Jt(e);if(cu(e))return n;if(!Gn(e)){let r=rs(e);for(;r&&!Br(r);){if(kn(r)&&!Nd(r))return r;r=rs(r)}return n}let a=ux(e,t);for(;a&&XE(a)&&Nd(a);)a=ux(a,t);return a&&Br(a)&&Nd(a)&&!Sm(a)?n:a||KE(e)||n}const lR=async function(e){const t=this.getOffsetParent||u0,n=this.getDimensions,a=await n(e.floating);return{reference:rR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function iR(e){return Cn(e).direction==="rtl"}const oR={convertOffsetParentRelativeRectToViewportRelativeRect:FE,getDocumentElement:Xn,getClippingRect:aR,getOffsetParent:u0,getElementRects:lR,getClientRects:WE,getDimensions:sR,getScale:Sr,isElement:kn,isRTL:iR};function d0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cR(e,t){let n=null,a;const r=Xn(e);function l(){var o;clearTimeout(a),(o=n)==null||o.disconnect(),n=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),l();const d=e.getBoundingClientRect(),{left:f,top:h,width:m,height:x}=d;if(o||t(),!m||!x)return;const j=vo(h),y=vo(r.clientWidth-(f+m)),b=vo(r.clientHeight-(h+x)),g=vo(f),v={rootMargin:-j+"px "+-y+"px "+-b+"px "+-g+"px",threshold:Xt(0,ss(1,c))||1};let w=!0;function _(S){const N=S[0].intersectionRatio;if(N!==c){if(!w)return i();N?i(!1,N):a=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!d0(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(_,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(_,v)}n.observe(e)}return i(!0),l}function uR(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=Cm(e),f=r||l?[...d?li(d):[],...li(t)]:[];f.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const h=d&&o?cR(d,n):null;let m=-1,x=null;i&&(x=new ResizeObserver(g=>{let[p]=g;p&&p.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=x)==null||v.observe(t)})),n()}),d&&!c&&x.observe(d),x.observe(t));let j,y=c?Os(e):null;c&&b();function b(){const g=Os(e);y&&!d0(y,g)&&n(),y=g,j=requestAnimationFrame(b)}return n(),()=>{var g;f.forEach(p=>{r&&p.removeEventListener("scroll",n),l&&p.removeEventListener("resize",n)}),h==null||h(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(j)}}const dR=IE,fR=VE,hR=BE,mR=PE,pR=qE,dx=HE,gR=YE,xR=(e,t,n)=>{const a=new Map,r={platform:oR,...n},l={...r.platform,_c:a};return UE(e,t,{...r,platform:l})};var vR=typeof document<"u",yR=function(){},qo=vR?u.useLayoutEffect:yR;function Nc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Nc(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;a--!==0;){const l=r[a];if(!(l==="_owner"&&e.$$typeof)&&!Nc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function f0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fx(e,t){const n=f0(e);return Math.round(t*n)/n}function Sd(e){const t=u.useRef(e);return qo(()=>{t.current=e}),t}function bR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:r,elements:{reference:l,floating:i}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[f,h]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,x]=u.useState(a);Nc(m,a)||x(a);const[j,y]=u.useState(null),[b,g]=u.useState(null),p=u.useCallback(T=>{T!==S.current&&(S.current=T,y(T))},[]),v=u.useCallback(T=>{T!==N.current&&(N.current=T,g(T))},[]),w=l||j,_=i||b,S=u.useRef(null),N=u.useRef(null),k=u.useRef(f),R=c!=null,M=Sd(c),z=Sd(r),U=Sd(d),C=u.useCallback(()=>{if(!S.current||!N.current)return;const T={placement:t,strategy:n,middleware:m};z.current&&(T.platform=z.current),xR(S.current,N.current,T).then(L=>{const K={...L,isPositioned:U.current!==!1};D.current&&!Nc(k.current,K)&&(k.current=K,Ir.flushSync(()=>{h(K)}))})},[m,t,n,z,U]);qo(()=>{d===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,h(T=>({...T,isPositioned:!1})))},[d]);const D=u.useRef(!1);qo(()=>(D.current=!0,()=>{D.current=!1}),[]),qo(()=>{if(w&&(S.current=w),_&&(N.current=_),w&&_){if(M.current)return M.current(w,_,C);C()}},[w,_,C,M,R]);const G=u.useMemo(()=>({reference:S,floating:N,setReference:p,setFloating:v}),[p,v]),E=u.useMemo(()=>({reference:w,floating:_}),[w,_]),B=u.useMemo(()=>{const T={position:n,left:0,top:0};if(!E.floating)return T;const L=fx(E.floating,f.x),K=fx(E.floating,f.y);return o?{...T,transform:"translate("+L+"px, "+K+"px)",...f0(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:K}},[n,o,E.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:C,refs:G,elements:E,floatingStyles:B}),[f,C,G,E,B])}const jR=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:r}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?dx({element:a.current,padding:r}).fn(n):{}:a?dx({element:a,padding:r}).fn(n):{}}}},wR=(e,t)=>({...dR(e),options:[e,t]}),_R=(e,t)=>({...fR(e),options:[e,t]}),NR=(e,t)=>({...gR(e),options:[e,t]}),SR=(e,t)=>({...hR(e),options:[e,t]}),kR=(e,t)=>({...mR(e),options:[e,t]}),CR=(e,t)=>({...pR(e),options:[e,t]}),TR=(e,t)=>({...jR(e),options:[e,t]});var ER="Arrow",h0=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...l}=e;return s.jsx(pe.svg,{...l,ref:t,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});h0.displayName=ER;var RR=h0,Em="Popper",[m0,al]=Pn(Em),[AR,p0]=m0(Em),g0=e=>{const{__scopePopper:t,children:n}=e,[a,r]=u.useState(null);return s.jsx(AR,{scope:t,anchor:a,onAnchorChange:r,children:n})};g0.displayName=Em;var x0="PopperAnchor",v0=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...r}=e,l=p0(x0,n),i=u.useRef(null),o=Re(t,i);return u.useEffect(()=>{l.onAnchorChange((a==null?void 0:a.current)||i.current)}),a?null:s.jsx(pe.div,{...r,ref:o})});v0.displayName=x0;var Rm="PopperContent",[MR,OR]=m0(Rm),y0=u.forwardRef((e,t)=>{var q,ee,ue,me,ge,he;const{__scopePopper:n,side:a="bottom",sideOffset:r=0,align:l="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:x="optimized",onPlaced:j,...y}=e,b=p0(Rm,n),[g,p]=u.useState(null),v=Re(t,se=>p(se)),[w,_]=u.useState(null),S=Qj(w),N=(S==null?void 0:S.width)??0,k=(S==null?void 0:S.height)??0,R=a+(l!=="center"?"-"+l:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},z=Array.isArray(d)?d:[d],U=z.length>0,C={padding:M,boundary:z.filter(zR),altBoundary:U},{refs:D,floatingStyles:G,placement:E,isPositioned:B,middlewareData:T}=bR({strategy:"fixed",placement:R,whileElementsMounted:(...se)=>uR(...se,{animationFrame:x==="always"}),elements:{reference:b.anchor},middleware:[wR({mainAxis:r+k,alignmentAxis:i}),c&&_R({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?NR():void 0,...C}),c&&SR({...C}),kR({...C,apply:({elements:se,rects:ae,availableWidth:Ke,availableHeight:ie})=>{const{width:nt,height:ot}=ae.reference,at=se.floating.style;at.setProperty("--radix-popper-available-width",`${Ke}px`),at.setProperty("--radix-popper-available-height",`${ie}px`),at.setProperty("--radix-popper-anchor-width",`${nt}px`),at.setProperty("--radix-popper-anchor-height",`${ot}px`)}}),w&&TR({element:w,padding:o}),$R({arrowWidth:N,arrowHeight:k}),m&&CR({strategy:"referenceHidden",...C})]}),[L,K]=w0(E),$=qn(j);At(()=>{B&&($==null||$())},[B,$]);const Y=(q=T.arrow)==null?void 0:q.x,ne=(ee=T.arrow)==null?void 0:ee.y,P=((ue=T.arrow)==null?void 0:ue.centerOffset)!==0,[ye,te]=u.useState();return At(()=>{g&&te(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:B?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(me=T.transformOrigin)==null?void 0:me.x,(ge=T.transformOrigin)==null?void 0:ge.y].join(" "),...((he=T.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(MR,{scope:n,placedSide:L,onArrowChange:_,arrowX:Y,arrowY:ne,shouldHideArrow:P,children:s.jsx(pe.div,{"data-side":L,"data-align":K,...y,ref:v,style:{...y.style,animation:B?void 0:"none"}})})})});y0.displayName=Rm;var b0="PopperArrow",DR={top:"bottom",right:"left",bottom:"top",left:"right"},j0=u.forwardRef(function(t,n){const{__scopePopper:a,...r}=t,l=OR(b0,a),i=DR[l.placedSide];return s.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:s.jsx(RR,{...r,ref:n,style:{...r.style,display:"block"}})})});j0.displayName=b0;function zR(e){return e!==null}var $R=e=>({name:"transformOrigin",options:e,fn(t){var b,g,p;const{placement:n,rects:a,middlewareData:r}=t,i=((b=r.arrow)==null?void 0:b.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=w0(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((g=r.arrow)==null?void 0:g.x)??0)+o/2,x=(((p=r.arrow)==null?void 0:p.y)??0)+c/2;let j="",y="";return d==="bottom"?(j=i?h:`${m}px`,y=`${-c}px`):d==="top"?(j=i?h:`${m}px`,y=`${a.floating.height+c}px`):d==="right"?(j=`${-c}px`,y=i?h:`${x}px`):d==="left"&&(j=`${a.floating.width+c}px`,y=i?h:`${x}px`),{data:{x:j,y}}}});function w0(e){const[t,n="center"]=e.split("-");return[t,n]}var Am=g0,Mm=v0,Om=y0,Dm=j0,kd="rovingFocusGroup.onEntryFocus",LR={bubbles:!1,cancelable:!0},Bi="RovingFocusGroup",[Gf,_0,UR]=jm(Bi),[HR,du]=Pn(Bi,[UR]),[BR,qR]=HR(Bi),N0=u.forwardRef((e,t)=>s.jsx(Gf.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Gf.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(GR,{...e,ref:t})})}));N0.displayName=Bi;var GR=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:r=!1,dir:l,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=u.useRef(null),x=Re(t,m),j=iu(l),[y,b]=as({prop:i,defaultProp:o??null,onChange:c,caller:Bi}),[g,p]=u.useState(!1),v=qn(d),w=_0(n),_=u.useRef(!1),[S,N]=u.useState(0);return u.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(kd,v),()=>k.removeEventListener(kd,v)},[v]),s.jsx(BR,{scope:n,orientation:a,dir:j,loop:r,currentTabStopId:y,onItemFocus:u.useCallback(k=>b(k),[b]),onItemShiftTab:u.useCallback(()=>p(!0),[]),onFocusableItemAdd:u.useCallback(()=>N(k=>k+1),[]),onFocusableItemRemove:u.useCallback(()=>N(k=>k-1),[]),children:s.jsx(pe.div,{tabIndex:g||S===0?-1:0,"data-orientation":a,...h,ref:x,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{_.current=!0}),onFocus:Z(e.onFocus,k=>{const R=!_.current;if(k.target===k.currentTarget&&R&&!g){const M=new CustomEvent(kd,LR);if(k.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=w().filter(E=>E.focusable),U=z.find(E=>E.active),C=z.find(E=>E.id===y),G=[U,C,...z].filter(Boolean).map(E=>E.ref.current);C0(G,f)}}_.current=!1}),onBlur:Z(e.onBlur,()=>p(!1))})})}),S0="RovingFocusGroupItem",k0=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:l,children:i,...o}=e,c=_n(),d=l||c,f=qR(S0,n),h=f.currentTabStopId===d,m=_0(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:y}=f;return u.useEffect(()=>{if(a)return x(),()=>j()},[a,x,j]),s.jsx(Gf.ItemSlot,{scope:n,id:d,focusable:a,active:r,children:s.jsx(pe.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:Z(e.onMouseDown,b=>{a?f.onItemFocus(d):b.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Z(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=YR(b,f.orientation,f.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let v=m().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const w=v.indexOf(b.currentTarget);v=f.loop?PR(v,w+1):v.slice(w+1)}setTimeout(()=>C0(v))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:y!=null}):i})})});k0.displayName=S0;var IR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YR(e,t,n){const a=VR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return IR[a]}function C0(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function PR(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var T0=N0,E0=k0,If=["Enter"," "],XR=["ArrowDown","PageUp","Home"],R0=["ArrowUp","PageDown","End"],KR=[...XR,...R0],QR={ltr:[...If,"ArrowRight"],rtl:[...If,"ArrowLeft"]},ZR={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qi="Menu",[ii,FR,WR]=jm(qi),[qs,A0]=Pn(qi,[WR,al,du]),fu=al(),M0=du(),[JR,Gs]=qs(qi),[eA,Gi]=qs(qi),O0=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:r,onOpenChange:l,modal:i=!0}=e,o=fu(t),[c,d]=u.useState(null),f=u.useRef(!1),h=qn(l),m=iu(r);return u.useEffect(()=>{const x=()=>{f.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>f.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Am,{...o,children:s.jsx(JR,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:s.jsx(eA,{scope:t,onClose:u.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:a})})})};O0.displayName=qi;var tA="MenuAnchor",zm=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=fu(n);return s.jsx(Mm,{...r,...a,ref:t})});zm.displayName=tA;var $m="MenuPortal",[nA,D0]=qs($m,{forceMount:void 0}),z0=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:r}=e,l=Gs($m,t);return s.jsx(nA,{scope:t,forceMount:n,children:s.jsx(vn,{present:n||l.open,children:s.jsx(Ai,{asChild:!0,container:r,children:a})})})};z0.displayName=$m;var fn="MenuContent",[aA,Lm]=qs(fn),$0=u.forwardRef((e,t)=>{const n=D0(fn,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=Gs(fn,e.__scopeMenu),i=Gi(fn,e.__scopeMenu);return s.jsx(ii.Provider,{scope:e.__scopeMenu,children:s.jsx(vn,{present:a||l.open,children:s.jsx(ii.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(sA,{...r,ref:t}):s.jsx(rA,{...r,ref:t})})})})}),sA=u.forwardRef((e,t)=>{const n=Gs(fn,e.__scopeMenu),a=u.useRef(null),r=Re(t,a);return u.useEffect(()=>{const l=a.current;if(l)return fm(l)},[]),s.jsx(Um,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rA=u.forwardRef((e,t)=>{const n=Gs(fn,e.__scopeMenu);return s.jsx(Um,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lA=As("MenuContent.ScrollLock"),Um=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:l,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:x,disableOutsideScroll:j,...y}=e,b=Gs(fn,n),g=Gi(fn,n),p=fu(n),v=M0(n),w=FR(n),[_,S]=u.useState(null),N=u.useRef(null),k=Re(t,N,b.onContentChange),R=u.useRef(0),M=u.useRef(""),z=u.useRef(0),U=u.useRef(null),C=u.useRef("right"),D=u.useRef(0),G=j?su:u.Fragment,E=j?{as:lA,allowPinchZoom:!0}:void 0,B=L=>{var q,ee;const K=M.current+L,$=w().filter(ue=>!ue.disabled),Y=document.activeElement,ne=(q=$.find(ue=>ue.ref.current===Y))==null?void 0:q.textValue,P=$.map(ue=>ue.textValue),ye=vA(P,K,ne),te=(ee=$.find(ue=>ue.textValue===ye))==null?void 0:ee.ref.current;(function ue(me){M.current=me,window.clearTimeout(R.current),me!==""&&(R.current=window.setTimeout(()=>ue(""),1e3))})(K),te&&setTimeout(()=>te.focus())};u.useEffect(()=>()=>window.clearTimeout(R.current),[]),dm();const T=u.useCallback(L=>{var $,Y;return C.current===(($=U.current)==null?void 0:$.side)&&bA(L,(Y=U.current)==null?void 0:Y.area)},[]);return s.jsx(aA,{scope:n,searchRef:M,onItemEnter:u.useCallback(L=>{T(L)&&L.preventDefault()},[T]),onItemLeave:u.useCallback(L=>{var K;T(L)||((K=N.current)==null||K.focus(),S(null))},[T]),onTriggerLeave:u.useCallback(L=>{T(L)&&L.preventDefault()},[T]),pointerGraceTimerRef:z,onPointerGraceIntentChange:u.useCallback(L=>{U.current=L},[]),children:s.jsx(G,{...E,children:s.jsx(nu,{asChild:!0,trapped:r,onMountAutoFocus:Z(l,L=>{var K;L.preventDefault(),(K=N.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:x,children:s.jsx(T0,{asChild:!0,...v,dir:g.dir,orientation:"vertical",loop:a,currentTabStopId:_,onCurrentTabStopIdChange:S,onEntryFocus:Z(c,L=>{g.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Om,{role:"menu","aria-orientation":"vertical","data-state":W0(b.open),"data-radix-menu-content":"",dir:g.dir,...p,...y,ref:k,style:{outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,L=>{const $=L.target.closest("[data-radix-menu-content]")===L.currentTarget,Y=L.ctrlKey||L.altKey||L.metaKey,ne=L.key.length===1;$&&(L.key==="Tab"&&L.preventDefault(),!Y&&ne&&B(L.key));const P=N.current;if(L.target!==P||!KR.includes(L.key))return;L.preventDefault();const te=w().filter(q=>!q.disabled).map(q=>q.ref.current);R0.includes(L.key)&&te.reverse(),gA(te)}),onBlur:Z(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:Z(e.onPointerMove,oi(L=>{const K=L.target,$=D.current!==L.clientX;if(L.currentTarget.contains(K)&&$){const Y=L.clientX>D.current?"right":"left";C.current=Y,D.current=L.clientX}}))})})})})})})});$0.displayName=fn;var iA="MenuGroup",Hm=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(pe.div,{role:"group",...a,ref:t})});Hm.displayName=iA;var oA="MenuLabel",L0=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(pe.div,{...a,ref:t})});L0.displayName=oA;var Sc="MenuItem",hx="menu.itemSelect",hu=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...r}=e,l=u.useRef(null),i=Gi(Sc,e.__scopeMenu),o=Lm(Sc,e.__scopeMenu),c=Re(t,l),d=u.useRef(!1),f=()=>{const h=l.current;if(!n&&h){const m=new CustomEvent(hx,{bubbles:!0,cancelable:!0});h.addEventListener(hx,x=>a==null?void 0:a(x),{once:!0}),mj(h,m),m.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(U0,{...r,ref:c,disabled:n,onClick:Z(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:Z(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Z(e.onKeyDown,h=>{const m=o.searchRef.current!=="";n||m&&h.key===" "||If.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});hu.displayName=Sc;var U0=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...l}=e,i=Lm(Sc,n),o=M0(n),c=u.useRef(null),d=Re(t,c),[f,h]=u.useState(!1),[m,x]=u.useState("");return u.useEffect(()=>{const j=c.current;j&&x((j.textContent??"").trim())},[l.children]),s.jsx(ii.ItemSlot,{scope:n,disabled:a,textValue:r??m,children:s.jsx(E0,{asChild:!0,...o,focusable:!a,children:s.jsx(pe.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:d,onPointerMove:Z(e.onPointerMove,oi(j=>{a?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,oi(j=>i.onItemLeave(j))),onFocus:Z(e.onFocus,()=>h(!0)),onBlur:Z(e.onBlur,()=>h(!1))})})})}),cA="MenuCheckboxItem",H0=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...r}=e;return s.jsx(V0,{scope:e.__scopeMenu,checked:n,children:s.jsx(hu,{role:"menuitemcheckbox","aria-checked":kc(n)?"mixed":n,...r,ref:t,"data-state":qm(n),onSelect:Z(r.onSelect,()=>a==null?void 0:a(kc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});H0.displayName=cA;var B0="MenuRadioGroup",[uA,dA]=qs(B0,{value:void 0,onValueChange:()=>{}}),q0=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...r}=e,l=qn(a);return s.jsx(uA,{scope:e.__scopeMenu,value:n,onValueChange:l,children:s.jsx(Hm,{...r,ref:t})})});q0.displayName=B0;var G0="MenuRadioItem",I0=u.forwardRef((e,t)=>{const{value:n,...a}=e,r=dA(G0,e.__scopeMenu),l=n===r.value;return s.jsx(V0,{scope:e.__scopeMenu,checked:l,children:s.jsx(hu,{role:"menuitemradio","aria-checked":l,...a,ref:t,"data-state":qm(l),onSelect:Z(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});I0.displayName=G0;var Bm="MenuItemIndicator",[V0,fA]=qs(Bm,{checked:!1}),Y0=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...r}=e,l=fA(Bm,n);return s.jsx(vn,{present:a||kc(l.checked)||l.checked===!0,children:s.jsx(pe.span,{...r,ref:t,"data-state":qm(l.checked)})})});Y0.displayName=Bm;var hA="MenuSeparator",P0=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(pe.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});P0.displayName=hA;var mA="MenuArrow",X0=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=fu(n);return s.jsx(Dm,{...r,...a,ref:t})});X0.displayName=mA;var pA="MenuSub",[Nz,K0]=qs(pA),_l="MenuSubTrigger",Q0=u.forwardRef((e,t)=>{const n=Gs(_l,e.__scopeMenu),a=Gi(_l,e.__scopeMenu),r=K0(_l,e.__scopeMenu),l=Lm(_l,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=l,d={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const h=o.current;return()=>{window.clearTimeout(h),c(null)}},[o,c]),s.jsx(zm,{asChild:!0,...d,children:s.jsx(U0,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":W0(n.open),...e,ref:tu(t,r.onTriggerChange),onClick:h=>{var m;(m=e.onClick)==null||m.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(e.onPointerMove,oi(h=>{l.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(l.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Z(e.onPointerLeave,oi(h=>{var x,j;f();const m=(x=n.content)==null?void 0:x.getBoundingClientRect();if(m){const y=(j=n.content)==null?void 0:j.dataset.side,b=y==="right",g=b?-5:5,p=m[b?"left":"right"],v=m[b?"right":"left"];l.onPointerGraceIntentChange({area:[{x:h.clientX+g,y:h.clientY},{x:p,y:m.top},{x:v,y:m.top},{x:v,y:m.bottom},{x:p,y:m.bottom}],side:y}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(h),h.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Z(e.onKeyDown,h=>{var x;const m=l.searchRef.current!=="";e.disabled||m&&h.key===" "||QR[a.dir].includes(h.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),h.preventDefault())})})})});Q0.displayName=_l;var Z0="MenuSubContent",F0=u.forwardRef((e,t)=>{const n=D0(fn,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=Gs(fn,e.__scopeMenu),i=Gi(fn,e.__scopeMenu),o=K0(Z0,e.__scopeMenu),c=u.useRef(null),d=Re(t,c);return s.jsx(ii.Provider,{scope:e.__scopeMenu,children:s.jsx(vn,{present:a||l.open,children:s.jsx(ii.Slot,{scope:e.__scopeMenu,children:s.jsx(Um,{id:o.contentId,"aria-labelledby":o.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;i.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Z(e.onFocusOutside,f=>{f.target!==o.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Z(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:Z(e.onKeyDown,f=>{var x;const h=f.currentTarget.contains(f.target),m=ZR[i.dir].includes(f.key);h&&m&&(l.onOpenChange(!1),(x=o.trigger)==null||x.focus(),f.preventDefault())})})})})})});F0.displayName=Z0;function W0(e){return e?"open":"closed"}function kc(e){return e==="indeterminate"}function qm(e){return kc(e)?"indeterminate":e?"checked":"unchecked"}function gA(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xA(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function vA(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let i=xA(e,Math.max(l,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function yA(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,i=t.length-1;l<t.length;i=l++){const o=t[l],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(r=!r)}return r}function bA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yA(n,t)}function oi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jA=O0,wA=zm,_A=z0,NA=$0,SA=Hm,kA=L0,CA=hu,TA=H0,EA=q0,RA=I0,AA=Y0,MA=P0,OA=X0,DA=Q0,zA=F0,mu="DropdownMenu",[$A]=Pn(mu,[A0]),$t=A0(),[LA,J0]=$A(mu),ew=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:r,defaultOpen:l,onOpenChange:i,modal:o=!0}=e,c=$t(t),d=u.useRef(null),[f,h]=as({prop:r,defaultProp:l??!1,onChange:i,caller:mu});return s.jsx(LA,{scope:t,triggerId:_n(),triggerRef:d,contentId:_n(),open:f,onOpenChange:h,onOpenToggle:u.useCallback(()=>h(m=>!m),[h]),modal:o,children:s.jsx(jA,{...c,open:f,onOpenChange:h,dir:a,modal:o,children:n})})};ew.displayName=mu;var tw="DropdownMenuTrigger",nw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=e,l=J0(tw,n),i=$t(n);return s.jsx(wA,{asChild:!0,...i,children:s.jsx(pe.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:tu(t,l.triggerRef),onPointerDown:Z(e.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(l.onOpenToggle(),l.open||o.preventDefault())}),onKeyDown:Z(e.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&l.onOpenToggle(),o.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});nw.displayName=tw;var UA="DropdownMenuPortal",aw=e=>{const{__scopeDropdownMenu:t,...n}=e,a=$t(t);return s.jsx(_A,{...a,...n})};aw.displayName=UA;var sw="DropdownMenuContent",rw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=J0(sw,n),l=$t(n),i=u.useRef(!1);return s.jsx(NA,{id:r.contentId,"aria-labelledby":r.triggerId,...l,...a,ref:t,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:Z(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rw.displayName=sw;var HA="DropdownMenuGroup",BA=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(SA,{...r,...a,ref:t})});BA.displayName=HA;var qA="DropdownMenuLabel",lw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(kA,{...r,...a,ref:t})});lw.displayName=qA;var GA="DropdownMenuItem",iw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(CA,{...r,...a,ref:t})});iw.displayName=GA;var IA="DropdownMenuCheckboxItem",ow=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(TA,{...r,...a,ref:t})});ow.displayName=IA;var VA="DropdownMenuRadioGroup",YA=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(EA,{...r,...a,ref:t})});YA.displayName=VA;var PA="DropdownMenuRadioItem",cw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(RA,{...r,...a,ref:t})});cw.displayName=PA;var XA="DropdownMenuItemIndicator",uw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(AA,{...r,...a,ref:t})});uw.displayName=XA;var KA="DropdownMenuSeparator",dw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(MA,{...r,...a,ref:t})});dw.displayName=KA;var QA="DropdownMenuArrow",ZA=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(OA,{...r,...a,ref:t})});ZA.displayName=QA;var FA="DropdownMenuSubTrigger",fw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(DA,{...r,...a,ref:t})});fw.displayName=FA;var WA="DropdownMenuSubContent",hw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=$t(n);return s.jsx(zA,{...r,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hw.displayName=WA;var JA=ew,eM=nw,tM=aw,mw=rw,pw=lw,gw=iw,xw=ow,vw=cw,yw=uw,bw=dw,jw=fw,ww=hw;const pu=JA,gu=eM,nM=u.forwardRef(({className:e,inset:t,children:n,...a},r)=>s.jsxs(jw,{ref:r,className:F("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[n,s.jsx(Yb,{className:"ml-auto"})]}));nM.displayName=jw.displayName;const aM=u.forwardRef(({className:e,...t},n)=>s.jsx(ww,{ref:n,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));aM.displayName=ww.displayName;const Ii=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(tM,{container:Mi(),children:s.jsx(mw,{ref:a,sideOffset:t,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ii.displayName=mw.displayName;const Ds=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(gw,{ref:a,className:F("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Ds.displayName=gw.displayName;const sM=u.forwardRef(({className:e,children:t,checked:n,...a},r)=>s.jsxs(xw,{ref:r,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(yw,{children:s.jsx(Zr,{className:"h-4 w-4"})})}),t]}));sM.displayName=xw.displayName;const rM=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(vw,{ref:a,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(yw,{children:s.jsx(r2,{className:"h-2 w-2 fill-current"})})}),t]}));rM.displayName=vw.displayName;const lM=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(pw,{ref:a,className:F("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));lM.displayName=pw.displayName;const iM=u.forwardRef(({className:e,...t},n)=>s.jsx(bw,{ref:n,className:F("-mx-1 my-1 h-px bg-muted",e),...t}));iM.displayName=bw.displayName;const oM={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},xn=u.forwardRef(({className:e,type:t,inputSize:n="default",...a},r)=>s.jsx("input",{type:t,className:F("flex w-full rounded-md border border-input bg-transparent shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-disabled-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 read-only:cursor-default read-only:bg-muted read-only:text-muted-foreground read-only:border-dashed",oM[n],e),ref:r,...a}));xn.displayName="Input";var cM="Label",_w=u.forwardRef((e,t)=>s.jsx(pe.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));_w.displayName=cM;var Nw=_w;const uM=Ei("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ze=u.forwardRef(({className:e,...t},n)=>s.jsx(Nw,{ref:n,className:F(uM(),e),...t}));Ze.displayName=Nw.displayName;function xu({title:e,description:t,backHref:n,backLabel:a,className:r,link:l}){return s.jsx("div",{className:F("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:s.jsxs("section",{className:"border-border bg-card mx-auto max-w-xl rounded-xl border p-6",children:[s.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),s.jsx(I,{asChild:!0,variant:"outline",size:"sm",className:"mt-4",children:s.jsx(l,{href:n,children:a})})]})})}function Kn({title:e,description:t,actions:n,className:a,children:r,...l}){return s.jsxs("header",{"data-slot":"page-header",className:F("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",a),...l,children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("h1",{className:"text-foreground text-2xl font-semibold tracking-tight",children:e}),t?s.jsx("p",{className:"text-muted-foreground text-sm",children:t}):null,r]}),n?s.jsx("div",{"data-slot":"page-header-actions",className:"flex shrink-0 items-center gap-2",children:n}):null]})}function St({as:e="div",className:t,...n}){return s.jsx(e,{className:F("rounded-lg border",t),...n})}function mx(e,[t,n]){return Math.min(n,Math.max(t,e))}var Sw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dM="VisuallyHidden",kw=u.forwardRef((e,t)=>s.jsx(pe.span,{...e,ref:t,style:{...Sw,...e.style}}));kw.displayName=dM;var fM=kw,hM=[" ","Enter","ArrowUp","ArrowDown"],mM=[" ","Enter"],zs="Select",[vu,yu,pM]=jm(zs),[sl]=Pn(zs,[pM,al]),bu=al(),[gM,cs]=sl(zs),[xM,vM]=sl(zs),Cw=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:r,onOpenChange:l,value:i,defaultValue:o,onValueChange:c,dir:d,name:f,autoComplete:h,disabled:m,required:x,form:j}=e,y=bu(t),[b,g]=u.useState(null),[p,v]=u.useState(null),[w,_]=u.useState(!1),S=iu(d),[N,k]=as({prop:a,defaultProp:r??!1,onChange:l,caller:zs}),[R,M]=as({prop:i,defaultProp:o,onChange:c,caller:zs}),z=u.useRef(null),U=b?j||!!b.closest("form"):!0,[C,D]=u.useState(new Set),G=Array.from(C).map(E=>E.props.value).join(";");return s.jsx(Am,{...y,children:s.jsxs(gM,{required:x,scope:t,trigger:b,onTriggerChange:g,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:_,contentId:_n(),value:R,onValueChange:M,open:N,onOpenChange:k,dir:S,triggerPointerDownPosRef:z,disabled:m,children:[s.jsx(vu.Provider,{scope:t,children:s.jsx(xM,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(E=>{D(B=>new Set(B).add(E))},[]),onNativeOptionRemove:u.useCallback(E=>{D(B=>{const T=new Set(B);return T.delete(E),T})},[]),children:n})}),U?s.jsxs(Fw,{"aria-hidden":!0,required:x,tabIndex:-1,name:f,autoComplete:h,value:R,onChange:E=>M(E.target.value),disabled:m,form:j,children:[R===void 0?s.jsx("option",{value:""}):null,Array.from(C)]},G):null]})})};Cw.displayName=zs;var Tw="SelectTrigger",Ew=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...r}=e,l=bu(n),i=cs(Tw,n),o=i.disabled||a,c=Re(t,i.onTriggerChange),d=yu(n),f=u.useRef("touch"),[h,m,x]=Jw(y=>{const b=d().filter(v=>!v.disabled),g=b.find(v=>v.value===i.value),p=e_(b,y,g);p!==void 0&&i.onValueChange(p.value)}),j=y=>{o||(i.onOpenChange(!0),x()),y&&(i.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return s.jsx(Mm,{asChild:!0,...l,children:s.jsx(pe.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Ww(i.value)?"":void 0,...r,ref:c,onClick:Z(r.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&j(y)}),onPointerDown:Z(r.onPointerDown,y=>{f.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(j(y),y.preventDefault())}),onKeyDown:Z(r.onKeyDown,y=>{const b=h.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(b&&y.key===" ")&&hM.includes(y.key)&&(j(),y.preventDefault())})})})});Ew.displayName=Tw;var Rw="SelectValue",Aw=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,children:l,placeholder:i="",...o}=e,c=cs(Rw,n),{onValueNodeHasChildrenChange:d}=c,f=l!==void 0,h=Re(t,c.onValueNodeChange);return At(()=>{d(f)},[d,f]),s.jsx(pe.span,{...o,ref:h,style:{pointerEvents:"none"},children:Ww(c.value)?s.jsx(s.Fragment,{children:i}):l})});Aw.displayName=Rw;var yM="SelectIcon",Mw=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...r}=e;return s.jsx(pe.span,{"aria-hidden":!0,...r,ref:t,children:a||"▼"})});Mw.displayName=yM;var bM="SelectPortal",Ow=e=>s.jsx(Ai,{asChild:!0,...e});Ow.displayName=bM;var $s="SelectContent",Dw=u.forwardRef((e,t)=>{const n=cs($s,e.__scopeSelect),[a,r]=u.useState();if(At(()=>{r(new DocumentFragment)},[]),!n.open){const l=a;return l?Ir.createPortal(s.jsx(zw,{scope:e.__scopeSelect,children:s.jsx(vu.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),l):null}return s.jsx($w,{...e,ref:t})});Dw.displayName=$s;var yn=10,[zw,us]=sl($s),jM="SelectContentImpl",wM=As("SelectContent.RemoveScroll"),$w=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:l,onPointerDownOutside:i,side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:x,sticky:j,hideWhenDetached:y,avoidCollisions:b,...g}=e,p=cs($s,n),[v,w]=u.useState(null),[_,S]=u.useState(null),N=Re(t,q=>w(q)),[k,R]=u.useState(null),[M,z]=u.useState(null),U=yu(n),[C,D]=u.useState(!1),G=u.useRef(!1);u.useEffect(()=>{if(v)return fm(v)},[v]),dm();const E=u.useCallback(q=>{const[ee,...ue]=U().map(he=>he.ref.current),[me]=ue.slice(-1),ge=document.activeElement;for(const he of q)if(he===ge||(he==null||he.scrollIntoView({block:"nearest"}),he===ee&&_&&(_.scrollTop=0),he===me&&_&&(_.scrollTop=_.scrollHeight),he==null||he.focus(),document.activeElement!==ge))return},[U,_]),B=u.useCallback(()=>E([k,v]),[E,k,v]);u.useEffect(()=>{C&&B()},[C,B]);const{onOpenChange:T,triggerPointerDownPosRef:L}=p;u.useEffect(()=>{if(v){let q={x:0,y:0};const ee=me=>{var ge,he;q={x:Math.abs(Math.round(me.pageX)-(((ge=L.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(me.pageY)-(((he=L.current)==null?void 0:he.y)??0))}},ue=me=>{q.x<=10&&q.y<=10?me.preventDefault():v.contains(me.target)||T(!1),document.removeEventListener("pointermove",ee),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",ue,{capture:!0})}}},[v,T,L]),u.useEffect(()=>{const q=()=>T(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[T]);const[K,$]=Jw(q=>{const ee=U().filter(ge=>!ge.disabled),ue=ee.find(ge=>ge.ref.current===document.activeElement),me=e_(ee,q,ue);me&&setTimeout(()=>me.ref.current.focus())}),Y=u.useCallback((q,ee,ue)=>{const me=!G.current&&!ue;(p.value!==void 0&&p.value===ee||me)&&(R(q),me&&(G.current=!0))},[p.value]),ne=u.useCallback(()=>v==null?void 0:v.focus(),[v]),P=u.useCallback((q,ee,ue)=>{const me=!G.current&&!ue;(p.value!==void 0&&p.value===ee||me)&&z(q)},[p.value]),ye=a==="popper"?Vf:Lw,te=ye===Vf?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:x,sticky:j,hideWhenDetached:y,avoidCollisions:b}:{};return s.jsx(zw,{scope:n,content:v,viewport:_,onViewportChange:S,itemRefCallback:Y,selectedItem:k,onItemLeave:ne,itemTextRefCallback:P,focusSelectedItem:B,selectedItemText:M,position:a,isPositioned:C,searchRef:K,children:s.jsx(su,{as:wM,allowPinchZoom:!0,children:s.jsx(nu,{asChild:!0,trapped:p.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Z(r,q=>{var ee;(ee=p.trigger)==null||ee.focus({preventScroll:!0}),q.preventDefault()}),children:s.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:s.jsx(ye,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:q=>q.preventDefault(),...g,...te,onPlaced:()=>D(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Z(g.onKeyDown,q=>{const ee=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ee&&q.key.length===1&&$(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let me=U().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(q.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ge=q.target,he=me.indexOf(ge);me=me.slice(he+1)}setTimeout(()=>E(me)),q.preventDefault()}})})})})})})});$w.displayName=jM;var _M="SelectItemAlignedPosition",Lw=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...r}=e,l=cs($s,n),i=us($s,n),[o,c]=u.useState(null),[d,f]=u.useState(null),h=Re(t,N=>f(N)),m=yu(n),x=u.useRef(!1),j=u.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:g,focusSelectedItem:p}=i,v=u.useCallback(()=>{if(l.trigger&&l.valueNode&&o&&d&&y&&b&&g){const N=l.trigger.getBoundingClientRect(),k=d.getBoundingClientRect(),R=l.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(l.dir!=="rtl"){const ge=M.left-k.left,he=R.left-ge,se=N.left-he,ae=N.width+se,Ke=Math.max(ae,k.width),ie=window.innerWidth-yn,nt=mx(he,[yn,Math.max(yn,ie-Ke)]);o.style.minWidth=ae+"px",o.style.left=nt+"px"}else{const ge=k.right-M.right,he=window.innerWidth-R.right-ge,se=window.innerWidth-N.right-he,ae=N.width+se,Ke=Math.max(ae,k.width),ie=window.innerWidth-yn,nt=mx(he,[yn,Math.max(yn,ie-Ke)]);o.style.minWidth=ae+"px",o.style.right=nt+"px"}const z=m(),U=window.innerHeight-yn*2,C=y.scrollHeight,D=window.getComputedStyle(d),G=parseInt(D.borderTopWidth,10),E=parseInt(D.paddingTop,10),B=parseInt(D.borderBottomWidth,10),T=parseInt(D.paddingBottom,10),L=G+E+C+T+B,K=Math.min(b.offsetHeight*5,L),$=window.getComputedStyle(y),Y=parseInt($.paddingTop,10),ne=parseInt($.paddingBottom,10),P=N.top+N.height/2-yn,ye=U-P,te=b.offsetHeight/2,q=b.offsetTop+te,ee=G+E+q,ue=L-ee;if(ee<=P){const ge=z.length>0&&b===z[z.length-1].ref.current;o.style.bottom="0px";const he=d.clientHeight-y.offsetTop-y.offsetHeight,se=Math.max(ye,te+(ge?ne:0)+he+B),ae=ee+se;o.style.height=ae+"px"}else{const ge=z.length>0&&b===z[0].ref.current;o.style.top="0px";const se=Math.max(P,G+y.offsetTop+(ge?Y:0)+te)+ue;o.style.height=se+"px",y.scrollTop=ee-P+y.offsetTop}o.style.margin=`${yn}px 0`,o.style.minHeight=K+"px",o.style.maxHeight=U+"px",a==null||a(),requestAnimationFrame(()=>x.current=!0)}},[m,l.trigger,l.valueNode,o,d,y,b,g,l.dir,a]);At(()=>v(),[v]);const[w,_]=u.useState();At(()=>{d&&_(window.getComputedStyle(d).zIndex)},[d]);const S=u.useCallback(N=>{N&&j.current===!0&&(v(),p==null||p(),j.current=!1)},[v,p]);return s.jsx(SM,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:x,onScrollButtonChange:S,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:s.jsx(pe.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Lw.displayName=_M;var NM="SelectPopperPosition",Vf=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=yn,...l}=e,i=bu(n);return s.jsx(Om,{...i,...l,ref:t,align:a,collisionPadding:r,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vf.displayName=NM;var[SM,Gm]=sl($s,{}),Yf="SelectViewport",Uw=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...r}=e,l=us(Yf,n),i=Gm(Yf,n),o=Re(t,l.onViewportChange),c=u.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(vu.Slot,{scope:n,children:s.jsx(pe.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:Z(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const x=Math.abs(c.current-f.scrollTop);if(x>0){const j=window.innerHeight-yn*2,y=parseFloat(h.style.minHeight),b=parseFloat(h.style.height),g=Math.max(y,b);if(g<j){const p=g+x,v=Math.min(j,p),w=p-v;h.style.height=v+"px",h.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,h.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});Uw.displayName=Yf;var Hw="SelectGroup",[kM,CM]=sl(Hw),TM=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=_n();return s.jsx(kM,{scope:n,id:r,children:s.jsx(pe.div,{role:"group","aria-labelledby":r,...a,ref:t})})});TM.displayName=Hw;var Bw="SelectLabel",qw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=CM(Bw,n);return s.jsx(pe.div,{id:r.id,...a,ref:t})});qw.displayName=Bw;var Cc="SelectItem",[EM,Gw]=sl(Cc),Iw=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:l,...i}=e,o=cs(Cc,n),c=us(Cc,n),d=o.value===a,[f,h]=u.useState(l??""),[m,x]=u.useState(!1),j=Re(t,p=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,p,a,r)}),y=_n(),b=u.useRef("touch"),g=()=>{r||(o.onValueChange(a),o.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(EM,{scope:n,value:a,disabled:r,textId:y,isSelected:d,onItemTextChange:u.useCallback(p=>{h(v=>v||((p==null?void 0:p.textContent)??"").trim())},[]),children:s.jsx(vu.ItemSlot,{scope:n,value:a,disabled:r,textValue:f,children:s.jsx(pe.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:j,onFocus:Z(i.onFocus,()=>x(!0)),onBlur:Z(i.onBlur,()=>x(!1)),onClick:Z(i.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:Z(i.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:Z(i.onPointerDown,p=>{b.current=p.pointerType}),onPointerMove:Z(i.onPointerMove,p=>{var v;b.current=p.pointerType,r?(v=c.onItemLeave)==null||v.call(c):b.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(i.onPointerLeave,p=>{var v;p.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:Z(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(mM.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});Iw.displayName=Cc;var Nl="SelectItemText",Vw=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,...l}=e,i=cs(Nl,n),o=us(Nl,n),c=Gw(Nl,n),d=vM(Nl,n),[f,h]=u.useState(null),m=Re(t,g=>h(g),c.onItemTextChange,g=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,g,c.value,c.disabled)}),x=f==null?void 0:f.textContent,j=u.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=d;return At(()=>(y(j),()=>b(j)),[y,b,j]),s.jsxs(s.Fragment,{children:[s.jsx(pe.span,{id:c.textId,...l,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ir.createPortal(l.children,i.valueNode):null]})});Vw.displayName=Nl;var Yw="SelectItemIndicator",Pw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return Gw(Yw,n).isSelected?s.jsx(pe.span,{"aria-hidden":!0,...a,ref:t}):null});Pw.displayName=Yw;var Pf="SelectScrollUpButton",Xw=u.forwardRef((e,t)=>{const n=us(Pf,e.__scopeSelect),a=Gm(Pf,e.__scopeSelect),[r,l]=u.useState(!1),i=Re(t,a.onScrollButtonChange);return At(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollTop>0;l(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),r?s.jsx(Qw,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});Xw.displayName=Pf;var Xf="SelectScrollDownButton",Kw=u.forwardRef((e,t)=>{const n=us(Xf,e.__scopeSelect),a=Gm(Xf,e.__scopeSelect),[r,l]=u.useState(!1),i=Re(t,a.onScrollButtonChange);return At(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;l(f)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),r?s.jsx(Qw,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});Kw.displayName=Xf;var Qw=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=e,l=us("SelectScrollButton",n),i=u.useRef(null),o=yu(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),At(()=>{var f;const d=o().find(h=>h.ref.current===document.activeElement);(f=d==null?void 0:d.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),s.jsx(pe.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:Z(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:Z(r.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:Z(r.onPointerLeave,()=>{c()})})}),RM="SelectSeparator",Zw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return s.jsx(pe.div,{"aria-hidden":!0,...a,ref:t})});Zw.displayName=RM;var Kf="SelectArrow",AM=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=bu(n),l=cs(Kf,n),i=us(Kf,n);return l.open&&i.position==="popper"?s.jsx(Dm,{...r,...a,ref:t}):null});AM.displayName=Kf;var MM="SelectBubbleInput",Fw=u.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const r=u.useRef(null),l=Re(a,r),i=Kj(t);return u.useEffect(()=>{const o=r.current;if(!o)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const h=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(h)}},[i,t]),s.jsx(pe.select,{...n,style:{...Sw,...n.style},ref:l,defaultValue:t})});Fw.displayName=MM;function Ww(e){return e===""||e===void 0}function Jw(e){const t=qn(e),n=u.useRef(""),a=u.useRef(0),r=u.useCallback(i=>{const o=n.current+i;t(o),function c(d){n.current=d,window.clearTimeout(a.current),d!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,l]}function e_(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let i=OM(e,Math.max(l,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function OM(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var DM=Cw,t_=Ew,zM=Aw,$M=Mw,LM=Ow,n_=Dw,UM=Uw,a_=qw,s_=Iw,HM=Vw,BM=Pw,r_=Xw,l_=Kw,i_=Zw;const qM={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},Nn=DM,Sn=zM,hn=u.forwardRef(({className:e,children:t,triggerSize:n="default",...a},r)=>s.jsxs(t_,{ref:r,className:F("flex w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent shadow-sm ring-offset-background data-[placeholder]:text-disabled-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",qM[n],e),...a,children:[t,s.jsx($M,{asChild:!0,children:s.jsx(Pb,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));hn.displayName=t_.displayName;const o_=u.forwardRef(({className:e,...t},n)=>s.jsx(r_,{ref:n,className:F("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(e2,{className:"size-4","aria-hidden":"true"})}));o_.displayName=r_.displayName;const c_=u.forwardRef(({className:e,...t},n)=>s.jsx(l_,{ref:n,className:F("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Fk,{className:"size-4","aria-hidden":"true"})}));c_.displayName=l_.displayName;const mn=u.forwardRef(({className:e,children:t,position:n="popper",...a},r)=>s.jsx(LM,{container:Mi(),children:s.jsxs(n_,{ref:r,className:F("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[s.jsx(o_,{}),s.jsx(UM,{className:F("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(c_,{})]})}));mn.displayName=n_.displayName;const GM=u.forwardRef(({className:e,...t},n)=>s.jsx(a_,{ref:n,className:F("px-2 py-1.5 text-sm font-semibold",e),...t}));GM.displayName=a_.displayName;const We=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(s_,{ref:a,className:F("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(BM,{children:s.jsx(Zr,{className:"size-4","aria-hidden":"true"})})}),s.jsx(HM,{children:t})]}));We.displayName=s_.displayName;const IM=u.forwardRef(({className:e,...t},n)=>s.jsx(i_,{ref:n,className:F("-mx-1 my-1 h-px bg-muted",e),...t}));IM.displayName=i_.displayName;function Nt({className:e,...t}){return s.jsx("div",{className:F("animate-pulse rounded-md bg-primary/10",e),...t})}const lt=u.forwardRef(({className:e,containerClassName:t,containerRef:n,containerTabIndex:a,containerAriaLabel:r,...l},i)=>s.jsx("div",{ref:n,tabIndex:a,"aria-label":r,className:F("relative w-full overflow-auto",t),children:s.jsx("table",{ref:i,className:F("w-full caption-bottom text-sm",e),...l})}));lt.displayName="Table";const yt=u.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:F("[&_tr]:border-b",e),...t}));yt.displayName="TableHeader";const it=u.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:F("[&_tr:last-child]:border-0",e),...t}));it.displayName="TableBody";const VM=u.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:F("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));VM.displayName="TableFooter";const xe=u.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:F("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));xe.displayName="TableRow";const X=u.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:F("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));X.displayName="TableHead";const V=u.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:F("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));V.displayName="TableCell";const YM=u.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:F("text-muted-foreground mt-4 text-sm",e),...t}));YM.displayName="TableCaption";var ju="Tabs",[PM]=Pn(ju,[du]),u_=du(),[XM,Im]=PM(ju),d_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=iu(o),[h,m]=as({prop:a,onChange:r,defaultProp:l??"",caller:ju});return s.jsx(XM,{scope:n,baseId:_n(),value:h,onValueChange:m,orientation:i,dir:f,activationMode:c,children:s.jsx(pe.div,{dir:f,"data-orientation":i,...d,ref:t})})});d_.displayName=ju;var f_="TabsList",h_=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...r}=e,l=Im(f_,n),i=u_(n);return s.jsx(T0,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:a,children:s.jsx(pe.div,{role:"tablist","aria-orientation":l.orientation,...r,ref:t})})});h_.displayName=f_;var m_="TabsTrigger",p_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...l}=e,i=Im(m_,n),o=u_(n),c=v_(i.baseId,a),d=y_(i.baseId,a),f=a===i.value;return s.jsx(E0,{asChild:!0,...o,focusable:!r,active:f,children:s.jsx(pe.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...l,ref:t,onMouseDown:Z(e.onMouseDown,h=>{!r&&h.button===0&&h.ctrlKey===!1?i.onValueChange(a):h.preventDefault()}),onKeyDown:Z(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(a)}),onFocus:Z(e.onFocus,()=>{const h=i.activationMode!=="manual";!f&&!r&&h&&i.onValueChange(a)})})})});p_.displayName=m_;var g_="TabsContent",x_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:r,children:l,...i}=e,o=Im(g_,n),c=v_(o.baseId,a),d=y_(o.baseId,a),f=a===o.value,h=u.useRef(f);return u.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),s.jsx(vn,{present:r||f,children:({present:m})=>s.jsx(pe.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&l})})});x_.displayName=g_;function v_(e,t){return`${e}-trigger-${t}`}function y_(e,t){return`${e}-content-${t}`}var KM=d_,b_=h_,j_=p_,w_=x_;const QM=KM,__=u.forwardRef(({className:e,...t},n)=>s.jsx(b_,{ref:n,className:F("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));__.displayName=b_.displayName;const Qf=u.forwardRef(({className:e,...t},n)=>s.jsx(j_,{ref:n,className:F("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Qf.displayName=j_.displayName;const ZM=u.forwardRef(({className:e,...t},n)=>s.jsx(w_,{ref:n,className:F("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ZM.displayName=w_.displayName;const ds=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:F("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-disabled-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 read-only:cursor-default read-only:bg-muted read-only:text-muted-foreground read-only:border-dashed",e),ref:n,...t}));ds.displayName="Textarea";var[wu]=Pn("Tooltip",[al]),_u=al(),N_="TooltipProvider",FM=700,Zf="tooltip.open",[WM,Vm]=wu(N_),S_=e=>{const{__scopeTooltip:t,delayDuration:n=FM,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:l}=e,i=u.useRef(!0),o=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(WM,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:o,onPointerInTransitChange:u.useCallback(d=>{o.current=d},[]),disableHoverableContent:r,children:l})};S_.displayName=N_;var ci="Tooltip",[JM,Vi]=wu(ci),k_=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:l,disableHoverableContent:i,delayDuration:o}=e,c=Vm(ci,e.__scopeTooltip),d=_u(t),[f,h]=u.useState(null),m=_n(),x=u.useRef(0),j=i??c.disableHoverableContent,y=o??c.delayDuration,b=u.useRef(!1),[g,p]=as({prop:a,defaultProp:r??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zf))):c.onClose(),l==null||l(N)},caller:ci}),v=u.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),w=u.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b.current=!1,p(!0)},[p]),_=u.useCallback(()=>{window.clearTimeout(x.current),x.current=0,p(!1)},[p]),S=u.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{b.current=!0,p(!0),x.current=0},y)},[y,p]);return u.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),s.jsx(Am,{...d,children:s.jsx(JM,{scope:t,contentId:m,open:g,stateAttribute:v,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?S():w()},[c.isOpenDelayedRef,S,w]),onTriggerLeave:u.useCallback(()=>{j?_():(window.clearTimeout(x.current),x.current=0)},[_,j]),onOpen:w,onClose:_,disableHoverableContent:j,children:n})})};k_.displayName=ci;var Ff="TooltipTrigger",C_=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=Vi(Ff,n),l=Vm(Ff,n),i=_u(n),o=u.useRef(null),c=Re(t,o,r.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),h=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(Mm,{asChild:!0,...i,children:s.jsx(pe.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:c,onPointerMove:Z(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!l.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Z(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:Z(e.onBlur,r.onClose),onClick:Z(e.onClick,r.onClose)})})});C_.displayName=Ff;var Ym="TooltipPortal",[eO,tO]=wu(Ym,{forceMount:void 0}),T_=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,l=Vi(Ym,t);return s.jsx(eO,{scope:t,forceMount:n,children:s.jsx(vn,{present:n||l.open,children:s.jsx(Ai,{asChild:!0,container:r,children:a})})})};T_.displayName=Ym;var qr="TooltipContent",E_=u.forwardRef((e,t)=>{const n=tO(qr,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...l}=e,i=Vi(qr,e.__scopeTooltip);return s.jsx(vn,{present:a||i.open,children:i.disableHoverableContent?s.jsx(R_,{side:r,...l,ref:t}):s.jsx(nO,{side:r,...l,ref:t})})}),nO=u.forwardRef((e,t)=>{const n=Vi(qr,e.__scopeTooltip),a=Vm(qr,e.__scopeTooltip),r=u.useRef(null),l=Re(t,r),[i,o]=u.useState(null),{trigger:c,onClose:d}=n,f=r.current,{onPointerInTransitChange:h}=a,m=u.useCallback(()=>{o(null),h(!1)},[h]),x=u.useCallback((j,y)=>{const b=j.currentTarget,g={x:j.clientX,y:j.clientY},p=iO(g,b.getBoundingClientRect()),v=oO(g,p),w=cO(y.getBoundingClientRect()),_=dO([...v,...w]);o(_),h(!0)},[h]);return u.useEffect(()=>()=>m(),[m]),u.useEffect(()=>{if(c&&f){const j=b=>x(b,f),y=b=>x(b,c);return c.addEventListener("pointerleave",j),f.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",j),f.removeEventListener("pointerleave",y)}}},[c,f,x,m]),u.useEffect(()=>{if(i){const j=y=>{const b=y.target,g={x:y.clientX,y:y.clientY},p=(c==null?void 0:c.contains(b))||(f==null?void 0:f.contains(b)),v=!uO(g,i);p?m():v&&(m(),d())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[c,f,i,d,m]),s.jsx(R_,{...e,ref:l})}),[aO,sO]=wu(ci,{isInside:!1}),rO=VC("TooltipContent"),R_=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:l,onPointerDownOutside:i,...o}=e,c=Vi(qr,n),d=_u(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Zf,f),()=>document.removeEventListener(Zf,f)),[f]),u.useEffect(()=>{if(c.trigger){const h=m=>{const x=m.target;x!=null&&x.contains(c.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,f]),s.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Om,{"data-state":c.stateAttribute,...d,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(rO,{children:a}),s.jsx(aO,{scope:n,isInside:!0,children:s.jsx(fM,{id:c.contentId,role:"tooltip",children:r||a})})]})})});E_.displayName=qr;var A_="TooltipArrow",lO=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=_u(n);return sO(A_,n).isInside?null:s.jsx(Dm,{...r,...a,ref:t})});lO.displayName=A_;function iO(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,a,r,l)){case l:return"left";case r:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function oO(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function cO(e){const{top:t,right:n,bottom:a,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:a},{x:r,y:a}]}function uO(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,i=t.length-1;l<t.length;i=l++){const o=t[l],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(r=!r)}return r}function dO(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),fO(t)}function fO(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const r=e[a];for(;t.length>=2;){const l=t[t.length-1],i=t[t.length-2];if((l.x-i.x)*(r.y-i.y)>=(l.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const r=e[a];for(;n.length>=2;){const l=n[n.length-1],i=n[n.length-2];if((l.x-i.x)*(r.y-i.y)>=(l.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var hO=S_,mO=k_,pO=C_,gO=T_,M_=E_;const xO=hO,vO=mO,yO=pO,O_=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>{const r=Mi(),l=s.jsx(M_,{ref:a,sideOffset:t,className:F("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n});return r?s.jsx(gO,{container:r,children:l}):l});O_.displayName=M_.displayName;const px=["none","read","comment","write","manage","admin"];function Tc(e,t){return px.indexOf(e??"none")>=px.indexOf(t)}function Pm(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function Cd(e,t){const n=Pm(e);return e==="sdlc_login"&&t?`${n} on ${D_(t)}`:n}const bO=String.fromCodePoint(8296),jO=String.fromCodePoint(8297);function D_(e){return`${bO}${e}${jO}`}const ui={blocked:{label:"Blocked",tone:"warning"},waiting_for_user:{label:"Waiting for a member",tone:"warning"},waiting_for_external:{label:"Waiting outside",tone:"warning"},paused:{label:"Paused",tone:"neutral"}},wO={backlog:"neutral",planned:"neutral",in_progress:"info",completed:"success",canceled:"neutral"};function z_(e){return e.name==="Blocked"?"warning":wO[e.category]}const gx=1800;function In(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Vl(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Xm(e){return`${Hn(e)}, ${Vl(e)}`}function xl(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function Hn(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function $_(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function _O(e){if(e.open_holds===0)return null;if(e.released_holds===e.open_holds)return{label:`${e.released_holds} ready to resolve`,tone:"neutral"};const t=e.open_holds-e.released_holds;return{label:e.released_holds>0?`${t} open · ${e.released_holds} ready`:`${t} open`,tone:"warning"}}function NO(e){return{"task.created":"Created the task","task.title_changed":"Changed the title","task.description_changed":"Changed the description","task.status_changed":"Changed the status","task.priority_changed":"Changed the priority","task.primary_changed":"Changed the primary","task.custom_fields_changed":"Changed a field","task.archived":"Archived the task","task.restored":"Restored the task","task.reordered":"Moved the task","task.reparented":"Moved the task under another","task.contributor_added":"Added a contributor","task.contributor_removed":"Removed a contributor","task.checklist_item_added":"Added a checklist item","task.checklist_item_edited":"Edited a checklist item","task.checklist_item_toggled":"Checked off a checklist item","task.checklist_item_moved":"Moved a checklist item","task.checklist_item_archived":"Removed a checklist item","task.hold_opened":"Opened a hold","task.hold_released":"Released a hold","task.hold_resolved":"Resolved a hold","task.claimed":"Claimed the task","task.claim_released":"Released a claim","task.claim_completed":"Finished a claim","task.claim_expired":"Ended a lapsed claim","task.relation_added":"Linked a task","task.relation_archived":"Unlinked a task","task.project_linked":"Linked a project","task.project_unlinked":"Unlinked a project"}[e.event_type]??"Changed the task"}const Ra="not_set";function SO({open:e,commands:t,list_id:n,list_revision:a,default_status_id:r,statuses:l,priorities:i,members:o,on_close:c,on_created:d}){var U;const f=Ti(),[h,m]=u.useState(""),[x,j]=u.useState(""),[y,b]=u.useState(r??((U=l[0])==null?void 0:U.id)??""),[g,p]=u.useState(Ra),[v,w]=u.useState(Ra),[_,S]=u.useState(!1),[N,k]=u.useState(null),[R,M]=u.useState(!1);u.useEffect(()=>{var C;e&&(m(""),j(""),b(r??((C=l[0])==null?void 0:C.id)??""),p(Ra),w(Ra),S(!1),k(null))},[e,r,l]);const z=async C=>{if(C.preventDefault(),!h.trim()){S(!0);return}M(!0),k(null);try{const D=await t.run("create_task",{list_id:n,expected_list_revision:a,title:h.trim(),description:x.trim()||null,status_id:y||null,priority_id:g===Ra?null:g,primary_user_id:v===Ra?null:v});if(!D.ok){k(D.refusal.message);return}f.success("Task created."),await d()}finally{M(!1)}};return s.jsx(Oi,{open:e,onOpenChange:C=>C?null:c(),children:s.jsx(Di,{children:s.jsxs("form",{onSubmit:C=>void z(C),noValidate:!0,children:[s.jsxs(zi,{children:[s.jsx(Li,{children:"New task"}),s.jsx(Ui,{children:"Add a task to this List."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[N&&s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(oe,{children:N})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"new-task-title",children:"Title"}),s.jsx(xn,{id:"new-task-title",placeholder:"What needs doing",value:h,required:!0,"aria-invalid":_,"aria-describedby":_?"new-task-title-error":void 0,onChange:C=>{m(C.target.value),S(!1)}}),_&&s.jsx("p",{id:"new-task-title-error",className:"text-destructive text-xs",children:"Give the task a title."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"new-task-description",children:"Description (optional)"}),s.jsx(ds,{id:"new-task-description",rows:4,value:x,onChange:C=>j(C.target.value)})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"new-task-status",children:"Status"}),s.jsxs(Nn,{value:y,onValueChange:b,children:[s.jsx(hn,{id:"new-task-status",children:s.jsx(Sn,{})}),s.jsx(mn,{children:l.map(C=>s.jsx(We,{value:C.id,children:C.name},C.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"new-task-priority",children:"Priority"}),s.jsxs(Nn,{value:g,onValueChange:p,children:[s.jsx(hn,{id:"new-task-priority",children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:Ra,children:"Not set"}),i.map(C=>s.jsx(We,{value:C.id,children:C.name},C.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"new-task-primary",children:"Primary"}),s.jsxs(Nn,{value:v,onValueChange:w,children:[s.jsx(hn,{id:"new-task-primary",children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:Ra,children:"Not set"}),o.map(C=>s.jsx(We,{value:C.user_id,children:C.label},C.user_id))]})]})]})]})]}),s.jsxs($i,{className:"mt-6",children:[s.jsx(I,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),s.jsx(I,{type:"submit",disabled:R,children:R?"Creating…":"Create task"})]})]})})})}const kO="Your organization's work, in queue order. Claim a task to show you are working on it.",Sl="any",L_="none",CO=1,TO=250,EO="The sdlc engine here is too old for this page",U_="Update the main checkout, then restart sdlc viewer.";function Km(){const e=os().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function RO({org:e}){var j;const t=Km(),{href:n,Link:a}=kt(),[r,l]=u.useState({state:"loading"}),[i,o]=u.useState([]),[c,d]=u.useState(null),f=u.useRef(0),h=u.useCallback(async y=>{const b=f.current+=1;y&&l({state:"loading"});const g=await t.availability({fresh:y});b===f.current&&l(g)},[t.availability]);u.useEffect(()=>{h(!1)},[h]);const m=u.useCallback(()=>void h(!0),[h]);if(u.useEffect(()=>{let y=!0;return t.members().then(b=>{y&&b.ok&&o(b.data)}),()=>{y=!1}},[t.members]),u.useEffect(()=>{if(!t.access)return;let y=!0;return t.access().then(b=>{y&&b.ok&&d(b.data)}),()=>{y=!1}},[t.access]),r.state==="off"&&((j=r.refusal)==null?void 0:j.reason)!=="engine_missing")return s.jsx(xu,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:n(`/org/${e}`),backLabel:"Back to the organization",link:a});const x=(c==null?void 0:c.read_only_reason)??kO;return s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:r.state==="active"?s.jsx(MO,{active:r,org:e,members:i,description:x,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:m}):s.jsxs(s.Fragment,{children:[s.jsx(Kn,{title:"Tasks",description:x}),r.state==="loading"&&s.jsx(H_,{}),(r.state==="error"||r.state==="off")&&s.jsx(B_,{refusal:r.refusal,on_retry:m}),r.state==="available"&&s.jsx(AO,{on_done:m})]})})}function H_(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading tasks",children:Array.from({length:6},(e,t)=>s.jsx(Nt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function B_({refusal:e,on_retry:t}){return(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(de,{variant:"destructive",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:EO}),s.jsx(oe,{children:U_})]}):(e==null?void 0:e.reason)==="engine_missing"?s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Tasks need the sdlc engine"}),s.jsx(oe,{children:e.message})]}):s.jsxs(de,{variant:"destructive",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Tasks could not be loaded"}),s.jsxs(oe,{children:[s.jsx("p",{children:e!=null&&e.reason?e.message:"Check your connection and try again."}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function AO({on_done:e}){const{commands:t}=Km(),n=Ti(),[a,r]=u.useState(!1),l=t==null?void 0:t.activate,i=async()=>{if(!l)return;r(!0);const o=await l();if(r(!1),!o.ok){n.error(o.refusal.message);return}n.success("Tasks are on."),e()};return s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Tasks are not on for this organization"}),s.jsxs(oe,{children:[s.jsx("p",{children:"Turning them on creates one List with the default workflow. Members then see tasks as their access allows. It needs two-factor sign-in."}),l?s.jsx(I,{type:"button",size:"sm",className:"mt-2",disabled:a,onClick:()=>void i(),children:"Turn on Tasks"}):null]})]})}const Td=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function MO({active:e,org:t,members:n,description:a,read_only_reason:r,reload_configuration:l}){var fp;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=Km(),{href:f,Link:h}=kt(),{self_id:m}=eu(),x=Ti(),{list:j,workspace:y}=e,b=j.offers,g=b!==void 0,p=u.useMemo(()=>{var O;return((O=y.workflows.find(De=>De.id===j.workflow_id))==null?void 0:O.statuses)??[]},[y,j]),v=y.priorities,w=!!i&&Tc(j.permission,"write"),_=w&&Tc(j.permission,"manage"),S=u.useMemo(()=>new Map(n.map(O=>[O.user_id,O])),[n]),N=O=>{var De;return O?O===m?"You":((De=S.get(O))==null?void 0:De.label)??"A member":""},[k,R]=u.useState("active"),[M,z]=u.useState(!1),[U,C]=u.useState(""),[D,G]=u.useState("");u.useEffect(()=>{const O=setTimeout(()=>G(U),TO);return()=>clearTimeout(O)},[U]);const[E,B]=u.useState(null),[T,L]=u.useState(Sl),[K,$]=u.useState(!1),[Y,ne]=u.useState(!1),[P,ye]=u.useState(null),[te,q]=u.useState([]),[ee,ue]=u.useState(null),[me,ge]=u.useState(0),[he,se]=u.useState(!1),[ae,Ke]=u.useState(null),[ie,nt]=u.useState(null),[ot,at]=u.useState(!1),[bt,re]=u.useState(null),[It,ba]=u.useState({}),[nn,ja]=u.useState(""),{confirm:Zn,confirm_dialog:ll}=Jr(),an=u.useRef(null),fs=u.useRef(null),Q=u.useRef(null),Ce=u.useRef(null),[Se,Is]=u.useState(void 0),wa=!!(D.trim()||E||T!==Sl||K||Y),_a=u.useRef(0),Mt=u.useCallback(async(O,De=!1)=>{const Ue=O?_a.current:_a.current+=1,Ye={state:k,assigned_to_me:M||void 0,cursor:O,search:D.trim()||void 0,group:E??void 0,owner:T===Sl?void 0:T===L_?"":T,urgent:K||void 0,over_estimate:Y||void 0},Ct=Lt=>o(j.id,{...Ye,cursor:Lt});let mt=await Ct(O),Pe=!!O;if(!mt.ok&&mt.refusal.code==="cursor_stale"&&(mt=await Ct(),Pe=!1),Ue!==_a.current)return;if(!mt.ok){ue(mt.refusal),ge(Lt=>Lt+1);return}const Tt=mt.data;ue(null),ge(0),!(De&&Td(Tt,Q.current))&&(Q.current=Tt,ye(Tt),Tt.facets&&Is(Tt.facets),q(Lt=>Pe?[...Lt,...Tt.tasks]:Tt.tasks))},[o,j.id,k,M,D,E,T,K,Y]),Na=u.useCallback(async()=>{const O=await c();if(nt(Ue=>O.ok?null:Td(Ue,O.refusal)?Ue:O.refusal),!O.ok&&g)return;const De=O.ok?O.data:null;Td(De,Ce.current)||(Ce.current=De,Ke(De))},[c,g]);u.useEffect(()=>{Q.current=null,ye(null)},[k,M]),u.useEffect(()=>{Mt()},[Mt]),u.useEffect(()=>{Na()},[Na]);const Fn=u.useCallback(async()=>{await Promise.all([Mt(),Na()])},[Mt,Na]),Sa=b==null?void 0:b.refresh_ms;u.useEffect(()=>{if(!Sa)return;const O=setInterval(()=>{Mt(void 0,!0),Na()},Sa);return()=>clearInterval(O)},[Sa,Mt,Na]);const il=u.useCallback(async(O,De,Ue)=>{if(!i)return;const Ye=await i.run(O,De);Ye.ok?Ue&&x.success(Ue):(x.error(Ye.refusal.message),Ye.refusal.code==="revision_conflict"&&l()),await Fn()},[i,x,Fn,l]),Vs=p.find(O=>O.category==="completed"),A=async(O,De,Ue)=>{const Ye=De+Ue,Ct=te[Ye];if(!Ct||!P||!i)return;const mt=async(Pe,Tt)=>{const Lt=await i.run(Pe,Tt);if(!Lt.ok)throw Lt.refusal;return Lt.data};try{let Pe=P.list.order_revision,Tt=O.revision;if(Ct.queue_rank===null){const Lt=te.findIndex(ka=>ka.queue_rank===null);for(const ka of te.slice(Lt,Ye+1)){const Ki=await mt("reorder",{task_id:ka.id,expected_revision:ka.revision,expected_order_revision:Pe,placement:"end"});Pe=Ki.list.order_revision,ka.id===O.id&&(Tt=Ki.task.revision)}}await mt("reorder",{task_id:O.id,expected_revision:Tt,expected_order_revision:Pe,placement:Ue<0?"before":"after",anchor_task_id:Ct.id})}catch(Pe){x.error(Pe.message)}await Fn()},fe=O=>{Vs&&il("update_task",{task_id:O.id,expected_revision:O.revision,changes:{status_id:Vs.id}},`${O.title} completed.`)},Oe=async O=>{if(!P||!await Zn({title:"Archive this task?",description:"It leaves the queue and becomes read-only. Its claim, holds and history stay, and a manager can restore it.",action_label:"Archive task",destructive:!0}))return;const[Ue,Ye]=await Promise.all([o(j.id,{limit:1}),d(y.id)]);if(!Ue.ok||!Ye.ok){x.error(Ue.ok?Ye.ok?"":Ye.refusal.message:Ue.refusal.message);return}await il("archive_task",{task_id:O.id,expected_revision:O.revision,expected_order_revision:Ue.data.list.order_revision,expected_hierarchy_revision:Ye.data},`${O.title} archived.`)},ht=async O=>{await il("release_hold",{hold_id:O},"Hold released.")},up=async(O,De,Ue,Ye)=>{var Lt;if(!(i!=null&&i.complete)||!await Zn({title:`Mark ${De} done?`,description:Ue.reason?`“${Ue.reason}”
349
+
350
+ It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;re(O);const mt=await i.complete(Ue);if(re(null),!mt.ok){ba(ka=>({...ka,[O]:mt.refusal.message}));return}ba(({[O]:ka,...Ki})=>Ki),ja(`${De} marked done.`),await Fn();const Pe=fs.current;(Lt=(Ye?(Pe==null?void 0:Pe.querySelector(`[data-done-key="${CSS.escape(Ye)}"]`))??(Pe==null?void 0:Pe.querySelector(`[data-title-key="${CSS.escape(Ye)}"] a`)):null)??an.current)==null||Lt.focus()},dp=()=>{var O;C(""),G(""),B(null),L(Sl),$(!1),ne(!1),(O=an.current)==null||O.focus()},N1=new Map(p.map(O=>[O.id,O])),S1=new Map(v.map(O=>[O.id,O])),Ru=new Map(te.map(O=>[O.id,O.title])),Au=w&&k==="active",k1=te.some(O=>O.local_done),Mu=Au||k1,Ou=!g||v.length>0,C1=!M&&!wa,T1=5+(Ou?1:0)+(Mu?1:0),E1=ee!==null&&(ee.reason==="store_locked"||ee.reason==="engine_failed")&&me<=CO,Xi=(ae==null?void 0:ae.holds)??[],R1=te.map(O=>O.id),A1=Xi.map(O=>O.id);return s.jsxs("div",{ref:fs,className:"contents",children:[s.jsx(Kn,{title:"Tasks",description:a,actions:w?s.jsxs(I,{type:"button",onClick:()=>at(!0),children:[s.jsx(yc,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),g&&(P!=null&&P.open)?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[P.open," open"]}):null,Sa?s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:ee?`Not reading · trying again every ${Math.round(Sa/1e3)}s`:P?`Live · refreshes every ${Math.round(Sa/1e3)}s`:"Connecting…"}):null,g?s.jsx("p",{className:"sr-only",role:"status",children:nn}):null,(g||Xi.length>0)&&s.jsxs(St,{as:"section","aria-labelledby":"waiting-title",className:"mt-4 p-4","data-testid":"tasks-waiting",children:[s.jsx("h2",{id:"waiting-title",className:"text-lg font-semibold",children:"Waiting on you"}),Xi.length>0?s.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:Xi.map((O,De)=>{var mt,Pe;const Ue=ui[O.hold_type],Ye=O.target.kind==="task"?`Because you claim ${Ru.get(O.target.task_id)??"the task it waits on"} · `:"",Ct=O.local_done;return s.jsxs("li",{id:`waiting-${O.id}`,"data-title-key":O.id,className:"flex flex-wrap items-center gap-3 py-2",children:[O.task?s.jsx(h,{className:"text-primary min-w-40 flex-1 hover:underline",href:f(`/org/${t}/tasks/${O.task.id}`),children:O.task.title}):s.jsx("span",{className:"min-w-40 flex-1",children:O.reason}),s.jsx(Ve,{variant:Ue.tone,children:O.local_label??Ue.label}),s.jsxs("div",{className:"min-w-48 flex-2",children:[O.task?s.jsx("div",{className:"text-sm",children:O.reason}):null,s.jsxs("div",{className:"text-muted-foreground text-xs",children:[Ye,"From ",N(O.opened_by)," · ",Hn(O.opened_at)]}),(mt=O.local_threads)!=null&&mt.length?s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Answer it in"," ",s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/threads`),children:"Threads"}),": ",O.local_threads.join(" · ")]}):null,It[O.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:It[O.id]}):null]}),Ct&&(i!=null&&i.complete)?s.jsx(I,{type:"button",variant:"outline",size:"sm","data-done-key":O.id,"aria-label":`Mark ${((Pe=O.task)==null?void 0:Pe.title)??O.reason} done`,loading:bt===O.id,onClick:()=>{var Tt;return void up(O.id,((Tt=O.task)==null?void 0:Tt.title)??O.reason,Ct,A1[De+1]??null)},children:"Done"}):null,g?null:s.jsx(I,{type:"button",variant:"outline",size:"sm",onClick:()=>void ht(O.id),children:"Release"})]},O.id)})}):ae?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,g&&ie?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:ie.reason==="view_outdated"?`Waiting on you is not read here. ${U_}`:"Waiting on you could not be read. It is read again with the list."}):null,s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:g?"This checkout only. Teammates' agents are not listed here.":"Release a hold when you have done your part. Whoever can edit the task then resolves it."})]}),!w&&!r&&s.jsxs(de,{variant:"info",className:"mt-4",children:[s.jsx(im,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"You can view these tasks"}),s.jsx(oe,{children:"Ask an organization admin for write access to change them."})]}),s.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4",children:[(b==null?void 0:b.archived)!==!1?s.jsx(QM,{value:k,onValueChange:O=>R(O),children:s.jsxs(__,{"aria-label":"Which tasks",children:[s.jsx(Qf,{value:"active",children:"Active"}),s.jsx(Qf,{value:"archived",children:"Archived"})]})}):null,(b==null?void 0:b.assigned_to_me)!==!1?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(el,{id:"tasks-mine",checked:M,onCheckedChange:O=>z(O===!0)}),s.jsx(Ze,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,b!=null&&b.search?s.jsx(xn,{ref:an,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:U,onChange:O=>C(O.target.value)}):null,Se!=null&&Se.owners?s.jsx(DO,{owners:Se.owners,no_owner:Se.no_owner,value:T,on_change:L}):null]}),(fp=Se==null?void 0:Se.groups)!=null&&fp.length?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[Se.groups.map(O=>s.jsxs(I,{type:"button",variant:"outline",size:"sm",className:Bo,"aria-pressed":E===O.id,onClick:()=>B(De=>De===O.id?null:O.id),children:[O.label," ",O.count]},O.id)),Se.marks?s.jsxs(s.Fragment,{children:[s.jsxs(I,{type:"button",variant:"outline",size:"sm",className:Bo,"aria-pressed":K,onClick:()=>$(O=>!O),children:["Urgent ",Se.marks.urgent]}),s.jsxs(I,{type:"button",variant:"outline",size:"sm",className:Bo,"aria-pressed":Y,onClick:()=>ne(O=>!O),children:["Over estimate ",Se.marks.over_estimate]})]}):null]}):null,wa&&(P==null?void 0:P.matched)!==void 0&&P.total!==void 0?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[P.matched," of ",P.total," match ·"," ",s.jsx(I,{type:"button",variant:"link",size:"inline-sm",onClick:dp,children:"Clear"})]}):null,E1?s.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):ee?s.jsx(B_,{refusal:ee,on_retry:()=>void Mt()}):null,!P&&!ee&&s.jsx(H_,{}),P&&te.length===0&&wa?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Jb,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No tasks match"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing open matches these filters."}),s.jsx(I,{type:"button",variant:"outline",onClick:dp,children:"Clear filters"})]}):P&&te.length===0&&k==="active"&&!M&&g?s.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):P&&te.length===0&&k==="active"&&!M?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Qb,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No tasks yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Create the first task, or ask an agent to create one with the SDLC MCP tools."}),w&&s.jsxs(I,{type:"button",onClick:()=>at(!0),children:[s.jsx(yc,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):P?s.jsxs(s.Fragment,{children:[s.jsx(St,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Tasks",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Title"}),s.jsx(X,{children:"Status"}),Ou?s.jsx(X,{className:"hidden md:table-cell",children:"Priority"}):null,s.jsx(X,{className:"hidden md:table-cell",children:"Primary"}),s.jsx(X,{className:"hidden md:table-cell",children:"Holds"}),s.jsx(X,{children:"Claimed by"}),Mu?s.jsx(X,{className:"text-right",children:"Actions"}):null]})}),s.jsxs(it,{children:[te.map((O,De)=>{var mt,Pe;const Ue=N1.get(O.status_id),Ye=_O(O),Ct=O.local_done;return s.jsxs(xe,{"data-testid":"tasks-row",children:[s.jsxs(V,{"data-title-key":O.id,children:[O.no_page?s.jsx("span",{children:O.title}):s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/tasks/${O.id}`),children:O.title}),O.parent_task_id&&Ru.get(O.parent_task_id)?s.jsx("div",{className:"text-muted-foreground text-xs",children:Ru.get(O.parent_task_id)}):null,g?s.jsx(OO,{row:O}):null,It[O.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:It[O.id]}):null]}),s.jsx(V,{children:Ue?s.jsx(Ve,{variant:z_(Ue),children:Ue.name}):null}),Ou?s.jsx(V,{className:"hidden md:table-cell",children:O.priority_id?((mt=S1.get(O.priority_id))==null?void 0:mt.name)??"":s.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,s.jsx(V,{className:"hidden md:table-cell",children:O.owner_title?O.owner_title:O.primary_user_id?N(O.primary_user_id):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),s.jsx(V,{className:"hidden md:table-cell",children:Ye?s.jsx(Ve,{variant:Ye.tone,children:Ye.label}):s.jsx("span",{className:"text-muted-foreground",children:"None"})}),s.jsx(V,{"data-testid":"tasks-claim",children:s.jsx(zO,{row:O,holder:N((Pe=O.claim)==null?void 0:Pe.user_id)})}),Mu?s.jsx(V,{className:"text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[Ct&&"hold"in Ct?s.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${Ct.hold}`,children:"In Waiting on you"}):Ct&&(i!=null&&i.complete)?s.jsx(I,{type:"button",variant:"outline",size:"sm","data-done-key":O.id,"aria-label":`Mark ${O.title} done`,loading:bt===O.id,onClick:()=>void up(O.id,O.title,Ct,R1[De+1]??null),children:"Done"}):null,Au&&C1?s.jsxs(s.Fragment,{children:[s.jsx(I,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${O.title} up`,disabled:De===0,onClick:()=>void A(O,De,-1),children:s.jsx(Ik,{className:"size-4","aria-hidden":"true"})}),s.jsx(I,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${O.title} down`,disabled:De===te.length-1,onClick:()=>void A(O,De,1),children:s.jsx(Bk,{className:"size-4","aria-hidden":"true"})})]}):null,Au?s.jsxs(pu,{children:[s.jsx(gu,{asChild:!0,children:s.jsx(I,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${O.title}`,children:s.jsx(lm,{className:"size-4","aria-hidden":"true"})})}),s.jsxs(Ii,{align:"end",children:[Vs&&O.status_id!==Vs.id?s.jsx(Ds,{onSelect:()=>fe(O),children:"Complete"}):null,_?s.jsx(Ds,{className:"text-destructive focus:text-destructive",onSelect:()=>void Oe(O),children:"Archive"}):null]})]}):null]})}):null]},O.id)}),te.length===0&&s.jsx(xe,{children:s.jsx(V,{colSpan:T1,className:"text-muted-foreground h-24 text-center",children:k==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),P.next_cursor?s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:he,onClick:async()=>{se(!0),await Mt(P.next_cursor??void 0),se(!1)},children:"Load more"}):null]}):null,w&&i&&s.jsx(SO,{open:ot,commands:i,list_id:j.id,list_revision:(P==null?void 0:P.list.revision)??j.revision,default_status_id:j.default_status_id,statuses:p,priorities:v,members:n,on_close:()=>at(!1),on_created:async()=>{at(!1),await Fn()}}),ll]})}function OO({row:e}){var n;const t=[e.local_after,e.local_detail].filter(Boolean).join(" · ");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-muted-foreground font-mono text-xs",children:[e.id,e.match?` · matched in ${e.match}`:""]}),t?s.jsx("div",{className:"text-muted-foreground text-xs",children:t}):null,(n=e.local_marks)!=null&&n.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.local_marks.map(a=>s.jsx(Ve,{variant:a.tone??"neutral",children:a.label},a.label))}):null]})}function DO({owners:e,no_owner:t,value:n,on_change:a}){return s.jsxs(Nn,{value:n,onValueChange:a,children:[s.jsx(hn,{className:"w-56","aria-label":"Owner",children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:Sl,children:"Any owner"}),e.map(r=>s.jsxs(We,{value:r.id,children:[r.label," (",r.count,")"]},r.id)),t!==void 0?s.jsxs(We,{value:L_,children:["No owner (",t,")"]}):null]})]})}function zO({row:e,holder:t}){const n=e.claim;if(!n)return s.jsx("span",{className:"text-muted-foreground",children:"Nobody"});if(n.lapsed){const a=new Date(n.lease_expires_at)<=new Date;return s.jsxs("div",{children:[s.jsxs("div",{className:"text-warning",children:["Lapsed · ",t]}),s.jsx("div",{className:"text-muted-foreground text-xs",children:a?`Ran out at ${In(n.lease_expires_at)}`:"Can no longer edit it"})]})}return s.jsxs("div",{className:"max-w-64",children:[s.jsxs("div",{children:[t,n.via?` · ${Pm(n.via)}`:""]}),s.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?D_(n.via_device):void 0,children:["Until ",In(n.lease_expires_at),n.via==="sdlc_login"&&n.via_device?s.jsxs(s.Fragment,{children:[" · ",s.jsx("bdi",{children:n.via_device})]}):null]})]})}const $O={waiting_for_user:{label:"Waiting for",help:"The member who must act. They see this hold under Waiting on you."},blocked:{label:"Blocked by",help:"The task that must finish first."},waiting_for_external:{label:"Waiting for",help:"Who or what outside the organization."},paused:null};function LO({open:e,members:t,tasks:n,holds_my_web_claim:a,on_close:r,on_submit:l}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,x]=u.useState(!1),[j,y]=u.useState({}),[b,g]=u.useState(null),[p,v]=u.useState(!1);u.useEffect(()=>{e&&(o("waiting_for_user"),d(""),h(""),x(!1),y({}),g(null))},[e]);const w=$O[i],_=async S=>{S.preventDefault();const N={target:w!==null&&!c.trim(),reason:!f.trim()};if(y(N),N.target||N.reason)return;v(!0);const k={hold_type:i,reason:f.trim(),release_claim:m};i==="waiting_for_user"&&(k.target_user_id=c),i==="blocked"&&(k.target_task_id=c),i==="waiting_for_external"&&(k.target_label=c.trim());const R=await l(k);v(!1),g(R)};return s.jsx(Oi,{open:e,onOpenChange:S=>S?null:r(),children:s.jsx(Di,{children:s.jsxs("form",{onSubmit:S=>void _(S),noValidate:!0,children:[s.jsxs(zi,{children:[s.jsx(Li,{children:"Add hold"}),s.jsx(Ui,{children:"Say what this task is waiting for."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[b&&s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(oe,{children:b})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"hold-type",children:"Type"}),s.jsxs(Nn,{value:i,onValueChange:S=>{o(S),d(""),y({})},children:[s.jsx(hn,{id:"hold-type",children:s.jsx(Sn,{})}),s.jsx(mn,{children:Object.keys(ui).map(S=>s.jsx(We,{value:S,children:ui[S].label},S))})]})]}),w?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"hold-target",children:w.label}),i==="waiting_for_external"?s.jsx(xn,{id:"hold-target",value:c,"aria-invalid":j.target,onChange:S=>d(S.target.value)}):s.jsxs(Nn,{value:c,onValueChange:d,children:[s.jsx(hn,{id:"hold-target","aria-invalid":j.target,children:s.jsx(Sn,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),s.jsx(mn,{children:i==="blocked"?n.map(S=>s.jsx(We,{value:S.id,children:S.title},S.id)):t.map(S=>s.jsx(We,{value:S.user_id,children:S.label},S.user_id))})]}),s.jsx("p",{className:j.target?"text-destructive text-xs":"text-muted-foreground text-xs",children:j.target?"Choose what it waits for.":w.help})]}):s.jsx("p",{className:"text-muted-foreground text-xs",children:"You resume it yourself."}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"hold-reason",children:"Reason"}),s.jsx(ds,{id:"hold-reason",rows:3,placeholder:"What the task is waiting for",value:f,"aria-invalid":j.reason,onChange:S=>h(S.target.value)}),j.reason&&s.jsx("p",{className:"text-destructive text-xs",children:"Give a reason."})]}),a&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(el,{id:"hold-release-claim",checked:m,onCheckedChange:S=>x(S===!0)}),s.jsx(Ze,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),s.jsxs($i,{className:"mt-6",children:[s.jsx(I,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),s.jsx(I,{type:"submit",disabled:p,children:p?"Adding…":"Add hold"})]})]})})})}function Yi(){const e=os().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function Qm(){return s.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[s.jsx(Nt,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>s.jsx(Nt,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function Ec({back:e,description:t}){const{href:n,Link:a}=kt();return s.jsx(xu,{title:"Task not found",description:t??"It may have been removed, or you may not have access to it.",backHref:n(e),backLabel:"Back to tasks",link:a})}const Fs="not_set",UO=10*60*1e3,xx=20;function HO(){const{members:e}=Yi(),[t,n]=u.useState([]);u.useEffect(()=>{let l=!0;return e().then(i=>{l&&i.ok&&n(i.data)}),()=>{l=!1}},[e]);const a=u.useMemo(()=>new Map(t.map(l=>[l.user_id,l])),[t]),r=u.useCallback((l,i)=>{var o;return l?l===i?"You":((o=a.get(l))==null?void 0:o.label)??"A member":""},[a]);return{members:t,name:r}}function BO({active:e,task_id:t,back:n}){const a=Yi(),{task:r,activity:l,listTasks:i,hierarchyRevision:o,commands:c}=a,{href:d,Link:f}=kt(),h=Ti(),{self_id:m}=eu(),{members:x,name:j}=HO(),{workspace:y}=e,{confirm:b,confirm_dialog:g}=Jr(),[p,v]=u.useState(null),[w,_]=u.useState(!1),[S,N]=u.useState(!1),[k,R]=u.useState(null),[M,z]=u.useState([]),[U,C]=u.useState(xx),[D,G]=u.useState([]),[E,B]=u.useState(!1),[T,L]=u.useState(null),[K,$]=u.useState(null),[Y,ne]=u.useState(""),[P,ye]=u.useState(null),te=u.useCallback(async()=>{if(!r)return;const A=await r(t);A.ok?(v(A.data),N(!1)):A.refusal.status===404||A.refusal.status===400?_(!0):N(!0)},[r,t]),q=u.useRef(0),ee=u.useCallback(async()=>{if(!l)return;const A=q.current+=1;let fe=[],Oe;for(;;){const ht=await l(t,Oe);if(A!==q.current||!ht.ok)return;if(fe=[...fe,...ht.data.events].slice(-1e3),!ht.data.more||!ht.data.next_cursor)break;Oe=ht.data.next_cursor}A===q.current&&z(fe.reverse())},[l,t]);u.useEffect(()=>{te(),ee()},[te,ee]);const ue=p?y.lists.find(A=>A.id===p.task.list_id):void 0,me=u.useMemo(()=>{var A;return((A=y.workflows.find(fe=>fe.id===(p==null?void 0:p.task.workflow_id)))==null?void 0:A.statuses)??[]},[y,p==null?void 0:p.task.workflow_id]);u.useEffect(()=>{if(!p)return;let A=!0;return i(p.task.list_id,{limit:100}).then(fe=>{A&&G(fe.ok?fe.data.tasks.filter(Oe=>Oe.id!==p.task.id).map(Oe=>({id:Oe.id,title:Oe.title})):[])}),()=>{A=!1}},[i,p==null?void 0:p.task.list_id,p==null?void 0:p.task.id,p]);const ge=u.useCallback(async()=>{await Promise.all([te(),ee()])},[te,ee]),he=u.useCallback((A,fe)=>c?c.run(A,fe):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),se=u.useCallback(async(A,fe,Oe)=>{const ht=await he(A,fe);return ht.ok?(Oe&&h.success(Oe),await ge(),ht.data):(ht.refusal.code==="revision_conflict"?R({tone:"warning",title:"This task changed while you were editing",body:"We reloaded it. Check the change, then save again."}):ht.refusal.code==="claim_held"?(await te(),R({tone:"destructive",title:"Someone else claimed this task first",body:"Their claim is shown below. You can take it over if it lapses."})):h.error(ht.refusal.message),await ge(),null)},[he,h,ge,te]),ae=(p==null?void 0:p.claim)??null,Ke=ae!==null&&ae.id===P&&!ae.lapsed&&!ae.via?ae.id:null;if(u.useEffect(()=>{if(!Ke)return;const A=window.setInterval(()=>{he("renew_claim",{claim_id:Ke,lease_seconds:gx}).then(()=>te())},UO);return()=>window.clearInterval(A)},[Ke,he,te]),w)return s.jsx(Ec,{back:n});if(S&&!p)return s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"This task could not be loaded"}),s.jsxs(oe,{children:[s.jsx("p",{children:"Check your connection and try again."}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void te(),children:"Retry"})]})]});if(!p)return s.jsx(Qm,{});const{task:ie}=p,nt=ie.archived_at!==null,ot=Tc(p.permission,"write")&&!nt,at=Tc(p.permission,"manage"),bt=me.find(A=>A.id===ie.status_id),re=me.find(A=>A.category==="completed"),It=y.priorities.find(A=>A.id===ie.priority_id),ba=p.contributors.map(A=>A.user_id),nn=ae!==null&&ae.user_id===m,ja=ae!==null&&!ae.lapsed,Zn=p.checklist.filter(A=>A.is_complete).length,ll=async()=>{const[A,fe]=await Promise.all([i(ie.list_id,{limit:1}),o(y.id)]);return A.ok?fe.ok?{ok:!0,data:{task_id:ie.id,expected_revision:ie.revision,expected_order_revision:A.data.list.order_revision,expected_hierarchy_revision:fe.data}}:fe:A},an=(A,fe)=>se("update_task",{task_id:ie.id,expected_revision:ie.revision,changes:A},fe),fs=A=>b(A.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${Cd(A.via,A.via_device)}. Its next renewal will be refused, and it will stop holding the task.`,action_label:"Release claim",destructive:!0}:{title:"Release your agent's claim?",description:"Your agent is still working on this task. Its next renewal will be refused, and it will stop holding the task.",action_label:"Release claim",destructive:!0}),Q=async()=>{if(!re)return;if(ja&&(!nn||ae.via)){const fe=ae.via==="api_key"?`${nn?"Your":`${j(ae.user_id)}'s`} agent is still working on it.`:ae.via==="sdlc_login"?`${nn?"You are":`${j(ae.user_id)} is`} still working on it via ${Cd(ae.via,ae.via_device)}.`:`${j(ae.user_id)} is still working on it.`;if(!await b({title:"Complete this task?",description:fe,action_label:"Mark complete"}))return}await an({status_id:re.id},"Task completed.")!==null&&ae&&nn&&ja&&await se("end_claim",{claim_id:ae.id,outcome:"completed"})},Ce=async(A,fe)=>{const Oe=await ll();if(!Oe.ok){h.error(Oe.refusal.message);return}await se(A,Oe.data,fe)},Se=async()=>{await b({title:"Archive this task?",description:"It leaves the queue and becomes read-only. Its claim, holds and history stay, and a manager can restore it.",action_label:"Archive task",destructive:!0})&&await Ce("archive_task","Task archived.")},Is=async()=>{await Ce("restore_task","Task restored.")},wa=async()=>{var ht;const A=ae,fe=await se("claim_task",{task_id:ie.id,lease_seconds:gx}),Oe=(ht=fe==null?void 0:fe.claim)==null?void 0:ht.id;Oe&&!(A&&A.id===Oe&&A.via)&&ye(Oe)},_a=async()=>{ae&&(ae.via&&!await fs(ae)||(await se("end_claim",{claim_id:ae.id,outcome:"released"},"Claim released."),ye(null)))},Mt=async()=>{ae&&await se("end_claim",{claim_id:ae.id,outcome:"expired"},"Claim cleared.")},Na=async A=>{A.hold_type==="paused"&&m&&(A={...A,target_user_id:m});const fe=await he("open_hold",{task_id:ie.id,hold_type:A.hold_type,reason:A.reason,...A.target_user_id?{target_user_id:A.target_user_id}:{},...A.target_task_id?{target_task_id:A.target_task_id}:{},...A.target_label?{target_label:A.target_label}:{}});return fe.ok?(B(!1),h.success("Hold added."),A.release_claim&&ae&&nn&&!ae.via&&(await se("end_claim",{claim_id:ae.id,outcome:"released"}),ye(null)),await ge(),null):fe.refusal.message},Fn=A=>se("checklist",{task_id:ie.id,expected_revision:ie.revision,...A}),Sa=async A=>{for(const fe of A.filter(Oe=>!ba.includes(Oe)))await se("set_contributor",{task_id:ie.id,expected_revision:ie.revision,user_id:fe,action:"add"});for(const fe of p.contributors.filter(Oe=>!A.includes(Oe.user_id)))await se("set_contributor",{task_id:ie.id,expected_revision:ie.revision,user_id:fe.user_id,action:"remove",expected_contributor_revision:fe.revision})},il=A=>{var Oe;if(A.target.kind==="user")return j(A.target.user_id,m);if(A.target.kind==="external")return A.target.label;if(A.target.hidden||!A.target.task_id)return"A task you cannot see";const fe=A.target.task_id;return s.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${fe}`),children:((Oe=D.find(ht=>ht.id===fe))==null?void 0:Oe.title)??"Another task"})},Vs=A=>A.target.kind==="user"&&A.target.user_id===m&&!A.released_at?s.jsx(I,{type:"button",variant:"outline",size:"sm",onClick:()=>void se("release_hold",{hold_id:A.id},"Hold released."),children:"Release"}):ot?s.jsx(I,{type:"button",variant:"outline",size:"sm",onClick:()=>void se("resolve_hold",{hold_id:A.id},"Hold resolved."),children:"Resolve"}):null;return s.jsxs(s.Fragment,{children:[s.jsx(Kn,{title:ie.title,description:`Created ${Hn(ie.created_at)} by ${j(ie.created_by,m)}`,actions:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ot&&s.jsxs(s.Fragment,{children:[s.jsxs(I,{type:"button",variant:"outline",onClick:()=>L(ie.title),children:[s.jsx(Wb,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),re&&ie.status_id!==re.id&&s.jsxs(I,{type:"button",variant:"outline",onClick:()=>void Q(),children:[s.jsx(Zr,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),at&&!nt&&s.jsxs(I,{type:"button",variant:"outline",onClick:()=>void Se(),children:[s.jsx(Hg,{className:"mr-2 size-4","aria-hidden":"true"}),"Archive"]})]}),children:T!==null?s.jsxs("form",{className:"flex flex-wrap items-center gap-2 pt-1",onSubmit:async A=>{A.preventDefault(),T.trim()&&await an({title:T.trim()})!==null&&L(null)},children:[s.jsx(Ze,{htmlFor:"task-title",className:"sr-only",children:"Title"}),s.jsx(xn,{id:"task-title",className:"max-w-xl",value:T,onChange:A=>L(A.target.value)}),s.jsx(I,{type:"submit",size:"sm",children:"Save"}),s.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:()=>L(null),children:"Cancel"})]}):null}),k&&s.jsxs(de,{variant:k.tone,className:"mt-4","data-testid":"task-notice",children:[k.tone==="warning"?s.jsx(om,{className:"size-4","aria-hidden":"true"}):s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:k.title}),s.jsx(oe,{children:k.body})]}),nt?s.jsxs(de,{variant:"info",className:"mt-4",children:[s.jsx(Hg,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"This task is archived"}),s.jsx(oe,{children:at?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"It is out of the queue and cannot be claimed. Restore it to work on it again."}),s.jsxs(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void Is(),children:[s.jsx(Lk,{className:"mr-2 size-4","aria-hidden":"true"}),"Restore"]})]}):s.jsx("p",{children:"It is out of the queue and cannot be claimed. A manager can restore it."})})]}):ot?null:s.jsxs(de,{variant:"info",className:"mt-4",children:[s.jsx(im,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"You can view this task"}),s.jsx(oe,{children:"Ask an organization admin for write access to change it."})]}),ot?s.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"task-status",children:"Status"}),s.jsxs(Nn,{value:ie.status_id,onValueChange:A=>void an({status_id:A}),children:[s.jsx(hn,{id:"task-status",children:s.jsx(Sn,{})}),s.jsx(mn,{children:me.map(A=>s.jsx(We,{value:A.id,children:A.name},A.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"task-priority",children:"Priority"}),s.jsxs(Nn,{value:ie.priority_id??Fs,onValueChange:A=>void an({priority_id:A===Fs?null:A}),children:[s.jsx(hn,{id:"task-priority",children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:Fs,children:"Not set"}),y.priorities.map(A=>s.jsx(We,{value:A.id,children:A.name},A.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"task-primary",children:"Primary"}),s.jsxs(Nn,{value:ie.primary_user_id??Fs,onValueChange:A=>void an({primary_user_id:A===Fs?null:A}),children:[s.jsx(hn,{id:"task-primary",children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:Fs,children:"Not set"}),x.map(A=>s.jsx(We,{value:A.user_id,children:A.label},A.user_id))]})]})]}),s.jsx(qO,{members:x,selected:ba,on_change:A=>void Sa(A)})]}):s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(yo,{label:"Status",value:(bt==null?void 0:bt.name)??""}),s.jsx(yo,{label:"Priority",value:(It==null?void 0:It.name)??"Not set"}),s.jsx(yo,{label:"Primary",value:ie.primary_user_id?j(ie.primary_user_id,m):"Not set"}),s.jsx(yo,{label:"Contributors",value:ba.map(A=>j(A,m)).join(", ")||"None"})]}),!nt&&s.jsx(GO,{claim:ae,mine:nn,holder:ae?j(ae.user_id):"",own:ae!==null&&ae.id===P,can_write:ot,on_claim:()=>void wa(),on_release:()=>void _a(),on_clear:()=>void Mt()}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-description-title",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h2",{id:"task-description-title",className:"text-lg font-semibold",children:"Description"}),ot&&K===null&&s.jsx(I,{type:"button",variant:"ghost",size:"sm",onClick:()=>$(ie.description??""),children:"Edit description"})]}),K!==null?s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async A=>{A.preventDefault(),await an({description:K})!==null&&$(null)},children:[s.jsx(Ze,{htmlFor:"task-description",className:"sr-only",children:"Description"}),s.jsx(ds,{id:"task-description",rows:5,value:K,onChange:A=>$(A.target.value)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(I,{type:"submit",size:"sm",children:"Save"}),s.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:()=>$(null),children:"Cancel"})]})]}):s.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:ie.description||s.jsx("span",{className:"text-muted-foreground",children:"No description."})})]}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-checklist-title",children:[s.jsxs("h2",{id:"task-checklist-title",className:"text-lg font-semibold",children:["Checklist",p.checklist.length>0?` · ${Zn} of ${p.checklist.length} done`:""]}),s.jsx("ul",{className:"mt-2 grid gap-1",children:p.checklist.map(A=>s.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[ot?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(el,{id:`check-${A.id}`,checked:A.is_complete,onCheckedChange:fe=>void Fn({action:"toggle",item_id:A.id,expected_item_revision:A.revision,is_complete:fe===!0})}),s.jsx(Ze,{htmlFor:`check-${A.id}`,className:"font-normal",children:A.label})]}):s.jsxs("span",{className:"text-sm",children:[A.is_complete?"Done: ":"To do: ",A.label]}),ot&&s.jsxs(pu,{children:[s.jsx(gu,{asChild:!0,children:s.jsx(I,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${A.label}`,children:s.jsx(lm,{className:"size-4","aria-hidden":"true"})})}),s.jsx(Ii,{align:"end",children:s.jsx(Ds,{className:"text-destructive focus:text-destructive",onSelect:()=>void Fn({action:"archive",item_id:A.id,expected_item_revision:A.revision}),children:"Remove"})})]})]},A.id))}),p.checklist.length===0&&!ot&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),ot&&s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async A=>{A.preventDefault(),Y.trim()&&await Fn({action:"add",label:Y.trim()})!==null&&ne("")},children:[s.jsx(Ze,{htmlFor:"task-new-item",children:"Add an item"}),s.jsx(xn,{id:"task-new-item",placeholder:"Add an item and press Enter",value:Y,onChange:A=>ne(A.target.value)})]})]}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-holds-title",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h2",{id:"task-holds-title",className:"text-lg font-semibold",children:"Holds"}),ot&&s.jsxs(I,{type:"button",variant:"outline",size:"sm",onClick:()=>B(!0),children:[s.jsx(Fb,{className:"mr-2 size-4","aria-hidden":"true"}),"Add hold"]})]}),s.jsx("div",{className:"mt-2 shrink-0 overflow-x-auto rounded-lg border",children:s.jsxs(lt,{containerAriaLabel:"Holds",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Type"}),s.jsx(X,{children:"Reason"}),s.jsx(X,{children:"Waiting on"}),s.jsx(X,{className:"text-right",children:"Actions"})]})}),s.jsxs(it,{children:[p.holds.map(A=>{const fe=ui[A.hold_type];return s.jsxs(xe,{"data-testid":"task-hold",children:[s.jsx(V,{children:s.jsx(Ve,{variant:fe.tone,children:fe.label})}),s.jsxs(V,{children:[s.jsx("div",{children:A.reason}),s.jsx("div",{className:"text-muted-foreground text-xs",children:A.released_at?`Released by ${j(A.released_by,m)} · ${Hn(A.released_at)} · Ready to resolve`:`Opened by ${j(A.opened_by,m)} · ${Hn(A.opened_at)} · Open`})]}),s.jsx(V,{children:il(A)}),s.jsx(V,{className:"text-right",children:Vs(A)})]},A.id)}),p.holds.length===0&&s.jsx(xe,{children:s.jsx(V,{colSpan:4,className:"text-muted-foreground h-16 text-center",children:"Nothing is holding this task."})})]})]})}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"A hold does not change the task's status. The person it waits on releases it; whoever can edit the task resolves it."})]}),s.jsxs("section",{className:"mt-6 pb-8","aria-labelledby":"task-activity-title",children:[s.jsx("h2",{id:"task-activity-title",className:"text-lg font-semibold",children:"Activity"}),s.jsxs("ul",{className:"mt-2 divide-y rounded-lg border",children:[M.slice(0,U).map(A=>s.jsxs("li",{className:"grid grid-cols-[1fr_auto] gap-x-4 px-3 py-2 text-sm sm:grid-cols-[2fr_1fr_10rem]","data-testid":"task-activity",children:[s.jsx("span",{children:NO(A)}),s.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[s.jsx("span",{children:A.actor_id?j(A.actor_id,m):"The system"}),A.via?s.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${Cd(A.via,A.via_device)}`,children:["via ",Pm(A.via),s.jsx(q_,{via:A.via,device:A.via_device})]}):null]}),s.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:$_(A.created_at)})]},A.id)),M.length===0&&s.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),M.length>U&&s.jsx(I,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>C(A=>A+xx),children:"Load more"})]}),ot&&ue&&s.jsx(LO,{open:E,members:x,tasks:D,holds_my_web_claim:nn&&ja&&!(ae!=null&&ae.via),on_close:()=>B(!1),on_submit:Na}),g]})}function yo({label:e,value:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),s.jsx("dd",{className:"text-sm",children:t})]})}function qO({members:e,selected:t,on_change:n}){return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:"task-contributors",children:"Contributors"}),s.jsxs(pu,{children:[s.jsx(gu,{asChild:!0,children:s.jsxs(I,{id:"task-contributors",type:"button",variant:"outline",className:"justify-between font-normal",children:[t.length===0?s.jsx("span",{className:"text-muted-foreground",children:"Add a contributor"}):s.jsx("span",{className:"truncate",children:e.filter(a=>t.includes(a.user_id)).map(a=>a.label).join(", ")}),s.jsx(Pb,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),s.jsx(Ii,{align:"start",children:e.map(a=>{const r=t.includes(a.user_id);return s.jsxs(Ds,{onSelect:()=>n(r?t.filter(l=>l!==a.user_id):[...t,a.user_id]),children:[r?s.jsx(Zr,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx("span",{className:"mr-2 size-4"}),a.label]},a.user_id)})})]})]})}function q_({via:e,device:t}){return e!=="sdlc_login"||!t?null:s.jsxs(s.Fragment,{children:[" on ",s.jsx("bdi",{children:t})]})}function GO({claim:e,mine:t,holder:n,own:a,can_write:r,on_claim:l,on_release:i,on_clear:o}){let c=s.jsx(cm,{className:"size-4","aria-hidden":"true"}),d="Nobody is working on this",f=r?"Claim it to show others you are.":"",h=r?s.jsx(I,{type:"button",size:"sm",onClick:l,children:"Claim"}):null;if(e&&e.lapsed){const m=new Date(e.lease_expires_at)<=new Date;c=s.jsx(i2,{className:"size-4","aria-hidden":"true"}),d=m?`${t?"Your":`${n}'s`} claim lapsed at ${In(e.lease_expires_at)}`:`${t?"Your":`${n}'s`} claim lapsed`,f=m?"Its time ran out.":`${n} can no longer edit this task.`,r&&(f+=" Take it over to work on it yourself, or clear it so anyone can claim it."),h=r?s.jsxs(s.Fragment,{children:[s.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:o,children:"Clear claim"}),s.jsx(I,{type:"button",size:"sm",onClick:l,children:"Take over"})]}):null}else if(e){const m=In(e.lease_expires_at);c=e.via==="api_key"?s.jsx(rm,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?s.jsx(j2,{className:"size-4","aria-hidden":"true"}):s.jsx(X2,{className:"size-4","aria-hidden":"true"});const x=s.jsxs(s.Fragment,{children:["Claimed via sdlc login",s.jsx(q_,{via:e.via,device:e.via_device}),"."]});t&&e.via==="api_key"?(d=`Your agent is working on this until ${m}`,f="Claimed through one of your API keys. This page does not renew it. Releasing it, or Mark complete, ends the agent's claim after asking."):t&&e.via==="sdlc_login"?(d=`You are working on this until ${m}`,f=s.jsxs(s.Fragment,{children:[x," This page does not renew it. Releasing it, or Mark complete, ends that claim after asking."]})):e.via==="sdlc_login"?(d=`${n} is working on this until ${m}`,f=x):t?(d=`You are working on this until ${m}`,f=a?"Claimed on the web, and renewed while this page is open. Marking the task complete ends your claim.":"Claimed on the web. Marking the task complete ends your claim."):e.via==="api_key"?(d=`${n}'s agent is working on this until ${m}`,f="Claimed through an API key."):(d=`${n} is working on this until ${m}`,f=r?"Claimed on the web. You can take it over if the claim lapses.":"Claimed on the web."),h=t?s.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:i,children:"Release claim"}):null}return s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3 rounded-lg border p-3","data-testid":"task-claim",children:[c,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-sm font-medium",children:d}),f?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:f}):null]}),h?s.jsx("div",{className:"flex items-center gap-2",children:h}):null]})}const IO=10,G_=5,VO=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,YO="The sdlc engine here is too old for this page",PO="Update the main checkout, then restart sdlc viewer.",I_="Not available",XO={added:"Added",changed:"Changed",removed:"Removed"},KO={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"};function QO(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;return n&&VO.test(n)?{label:n,path:`/org/${e}/tasks/${n}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const ZO=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function FO({org:e,task_id:t,from:n}){var fs;const a=Yi(),{href:r,Link:l}=kt(),{confirm:i,confirm_dialog:o}=Jr(),c=QO(e,n),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState([]),[x,j]=u.useState([]),[y,b]=u.useState(null),[g,p]=u.useState(null),[v,w]=u.useState({state:"loading"}),[_,S]=u.useState({state:"loading"}),[N,k]=u.useState(null),[R,M]=u.useState(null),[z,U]=u.useState(!1),C=u.useRef(null),D=u.useRef(null),G=u.useRef(null),E=u.useRef(null),B=u.useRef(null),T=u.useRef(!1),L=u.useRef(0),K=u.useRef(0),$=u.useCallback(async()=>{if(!a.taskSections)return;w({state:"loading"});const Q=await a.taskSections(t);w(Q.ok?{state:"ok",data:Q.data}:{state:"failed",refusal:Q.refusal})},[a.taskSections,t]),Y=u.useCallback(async()=>{if(!a.taskRelated)return;S({state:"loading"});const Q=await a.taskRelated(t);S(Q.ok?{state:"ok",data:Q.data}:{state:"failed",refusal:Q.refusal})},[a.taskRelated,t]),ne=u.useCallback(async()=>{var wa,_a;const Q=K.current+=1;p(null),$(),Y();const[Ce,Se]=await Promise.all([a.availability(),a.task?a.task(t):Promise.resolve(null)]);if(Q!==K.current)return;Ce.state==="active"&&m(((wa=Ce.workspace.workflows.find(Mt=>Mt.id===Ce.list.workflow_id))==null?void 0:wa.statuses)??[]);const Is=Ce.state==="off"&&((_a=Ce.refusal)==null?void 0:_a.reason)==="engine_missing"?Ce.refusal:null;if(!Se||!Se.ok&&Se.refusal.reason==="engine_missing"||Is){f({state:"engine_missing",refusal:Is??(Se&&!Se.ok?Se.refusal:{status:0,message:""})});return}if(Se.ok){L.current=0,b(null),M(null),f({state:"ok",detail:Se.data,at:new Date().toISOString()});return}if(Se.refusal.status===404||Se.refusal.reason==="not_found"){f({state:"missing"});return}if(L.current+=1,L.current===1&&ZO(Se.refusal)){p(Se.refusal.retry_after??IO);return}b(Se.refusal),f(Mt=>Mt.state==="loading"?{state:"loading"}:Mt)},[a,t,$,Y]);u.useEffect(()=>{ne()},[ne]),u.useEffect(()=>{if(g===null)return;const Q=setTimeout(()=>void ne(),g*1e3);return()=>clearTimeout(Q)},[g,ne]),u.useEffect(()=>{let Q=!0;return a.members().then(Ce=>{Q&&Ce.ok&&j(Ce.data)}),()=>{Q=!1}},[a.members]),u.useEffect(()=>{var Ce;if(T.current||d.state!=="ok")return;T.current=!0;const Q=(Ce=C.current)==null?void 0:Ce.querySelector("h1");Q&&(Q.tabIndex=-1,Q.focus())},[d.state]),u.useEffect(()=>{var Q;N&&((Q=G.current)==null||Q.focus())},[N]),u.useEffect(()=>{if(R===null)return;const Q=setTimeout(()=>{var Ce;return(Ce=D.current)==null?void 0:Ce.focus()},0);return()=>clearTimeout(Q)},[R]);const P=u.useMemo(()=>new Map(x.map(Q=>[Q.user_id,Q.label])),[x]),ye=Q=>Q?P.get(Q)??Q:"",te=()=>{k(null),ne()},q=u.useRef(null),ee=Q=>(q.current=Q,Q==="graph"?$():Y());if(u.useEffect(()=>{var Se;const Q=q.current;if(Q===null||(Q==="graph"?v:_).state==="loading")return;q.current=null;const Ce=(Q==="graph"?E:B).current??((Se=C.current)==null?void 0:Se.querySelector("h1"));Ce==null||Ce.focus()},[v,_]),d.state==="missing")return s.jsx(bo,{children:s.jsx(Ec,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const ue=s.jsx(I,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(l,{href:r(c.path),children:[s.jsx(Vb,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return s.jsx(bo,{children:s.jsxs("div",{ref:C,className:"contents",children:[s.jsx(vx,{back:ue,id:null,title:t}),s.jsxs(de,{variant:"info",className:"mt-4",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Tasks need the sdlc engine"}),s.jsx(oe,{children:d.refusal.message})]})]})});const me=y?s.jsxs(de,{variant:"destructive",className:"mt-4",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Could not read this task"}),s.jsxs(oe,{children:[s.jsxs("p",{children:[y.message,y.since?` Since ${Vl(y.since)}.`:"",d.state==="ok"?` This page was read at ${Vl(d.at)}.`:""," See the sdlc viewer terminal for more."]}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:te,children:"Retry"})]})]}):null,ge=g!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(xm,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",g," seconds."]}):null,he=s.jsx("div",{role:"status","aria-live":"polite",children:ge});if(d.state==="loading")return s.jsxs(bo,{children:[he,me,!y&&g===null?s.jsx(Qm,{}):null]});const{detail:se,at:ae}=d,{task:Ke}=se,ie=h.find(Q=>Q.id===Ke.status_id),nt=se.local_done&&"task"in se.local_done?se.local_done:null,ot=se.local_waits??[],at=nt?ot[0]??null:null,bt=at?ye(at.opened_by):se.owner_title??ye(se.thread),re=v.state==="ok"?v.data:null,It=(re==null?void 0:re.lifecycle)==="finished",ba=It&&(re==null?void 0:re.outcome)==="cancelled",nn=It&&(re==null?void 0:re.outcome)==="complete",ja=!!Ke.created_at,Zn=se.acceptance??[],ll=async()=>{var Se;if(!nt||!((Se=a.commands)!=null&&Se.complete)||!await i({title:`Mark ${Ke.title} done?`,description:at?`This answers ${bt}'s ask, “${at.reason}”, closes that wait, and tells ${bt} to check and continue.`:`This tells ${bt||"its thread"} to check and continue.`,action_label:"Mark done"}))return;U(!0);const Ce=await a.commands.complete(nt);if(U(!1),!Ce.ok){M(Ce.refusal.message);return}await ne(),k({title:Ke.title,asker:bt||"Its thread"})},an=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[nt&&!N?s.jsxs(s.Fragment,{children:[s.jsxs(I,{ref:D,type:"button",variant:"outline",disabled:z,"aria-disabled":R!==null?!0:void 0,"aria-describedby":R!==null?"task-done-why":void 0,onClick:()=>{R===null&&ll()},children:[s.jsx(Zr,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),R!==null?s.jsx("span",{id:"task-done-why",className:"text-muted-foreground text-xs",children:"Read again first"}):null]}):null,s.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",Vl(ae)]}),s.jsxs(I,{type:"button",variant:"ghost",size:"sm",onClick:te,children:[s.jsx(om,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsxs(bo,{children:[s.jsxs("div",{ref:C,className:"contents",children:[s.jsx(vx,{back:ue,id:Ke.id,badge:ie?s.jsx(Ve,{variant:z_(ie),children:ie.name}):null,title:Ke.title,created:ja?`Created ${Hn(Ke.created_at)}${bt||se.owner_title?` by ${se.owner_title??bt}`:""}`:null,actions:an}),he,me,N?s.jsx("div",{ref:G,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:s.jsxs(de,{variant:"success",className:"mt-4",children:[s.jsx(Xb,{className:"size-4","aria-hidden":"true"}),s.jsxs(je,{children:["Marked ",N.title," done"]}),s.jsxs(oe,{children:[N.asker," is told to check and continue."]})]})}):null,R!==null?s.jsxs(de,{variant:"destructive",className:"mt-4",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Done was not recorded"}),s.jsxs(oe,{children:[R," Read again to see the task as it is now."]})]}):null,at&&!N?s.jsxs(de,{variant:"warning",className:"mt-4",children:[s.jsx(Hr,{className:"size-4","aria-hidden":"true"}),s.jsxs(je,{children:[bt," asks: ",at.reason]}),s.jsxs(oe,{children:["Waiting on you since ",Xm(at.opened_at),". Done answers it and tells ",bt," to check and continue."]})]}):null,se.view_outdated?s.jsxs(de,{variant:"warning",className:"mt-4",children:[s.jsx(Hr,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:YO}),s.jsxs(oe,{children:[PO," Until then this page cannot read the claim and holds."]})]}):null,s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(ys,{label:"Owner thread",value:se.owner_title??(ye(se.thread)||"None")}),s.jsx(ys,{label:"Release",value:se.release??"None"}),s.jsx(ys,{label:"Session",value:v.state==="loading"?"Loading…":v.state==="failed"?"Not available":re!=null&&re.session?s.jsxs(s.Fragment,{children:[re.session.provider," ",s.jsx("span",{className:"font-mono break-all",children:re.session.id})]}):"None"}),s.jsx(ys,{label:"Now",value:se.local_detail??(ie==null?void 0:ie.name)??""})]}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),s.jsx(WO,{detail:se,holder:ye((fs=se.claim)==null?void 0:fs.user_id),finished_at:It?(re==null?void 0:re.finished_at)??null:null,read_at:ae}),s.jsxs(de,{variant:"info",className:"mt-4",children:[s.jsx(im,{className:"text-info size-4","aria-hidden":"true"}),nt?s.jsxs(s.Fragment,{children:[s.jsx(je,{children:"Done is the one change this page makes"}),s.jsx(oe,{children:"Everything else about this task changes through its thread."})]}):s.jsxs(s.Fragment,{children:[s.jsx(je,{children:"This page only reads tasks"}),s.jsx(oe,{children:"A task changes through the agent thread working on it."})]})]}),ja?re!=null&&re.record?s.jsxs("p",{className:"mt-4 text-sm",children:["Record ",s.jsx("span",{className:"font-mono break-all",children:re.record})]}):null:s.jsx("p",{className:"mt-4 text-sm",children:"No task record yet. This page shows what the threads and plans in this checkout say about it."}),nt?s.jsx(en,{id:"task-done-needs",title:"What Done needs",children:Zn.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["The task's acceptance; ",bt||"its thread"," checks these after Done."]}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:Zn.map(Q=>s.jsx("li",{children:Q},Q))})]}):s.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",bt||"its thread"," what Done needs before marking it."]})}):Zn.length>0?s.jsxs(en,{id:"task-acceptance",title:"Acceptance",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:nn?"All met: the task finished complete":ba&&(re!=null&&re.finished_at)?`Cancelled ${Hn(re.finished_at)}`:"Met when the task finishes complete"}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:Zn.map(Q=>s.jsx("li",{children:nn?`Met: ${Q}`:Q},Q))})]}):null,s.jsx(JO,{detail:se,waits:ot,given:nt!==null,threadName:ye,threadsLink:s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/threads`),children:"Threads"})}),v.state==="loading"?s.jsxs("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading the task's sections",children:[s.jsx(Nt,{className:"h-8 w-full"}),s.jsx(Nt,{className:"h-8 w-full"}),s.jsx(Nt,{className:"h-8 w-2/3"})]}):null,re?s.jsx(en,{id:"task-stands",title:"Where it stands",children:s.jsxs("p",{className:"text-sm",children:[(ie==null?void 0:ie.name)??Ke.status_id,se.local_detail?` · ${se.local_detail}`:""]})}):null,re!=null&&re.time?s.jsx(eD,{time:re.time}):null,s.jsx(tD,{sections:v,heading_ref:E,on_retry:()=>void ee("graph"),taskLink:Q=>s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks/${Q}?from=task:${Ke.id}`),children:Q})}),re!=null&&re.files?s.jsx(nD,{files:re.files,finished:It}):null,re!=null&&re.proof?s.jsx(aD,{proof:re.proof,finished_at:re.finished_at,who:se.owner_title??null}):null,re&&re.history.length>0?s.jsx(sD,{history:re.history}):null,s.jsx(rD,{related:_,heading_ref:B,on_retry:()=>void ee("related"),link:Q=>{if(Q.kind==="thread")return Q.label;const Ce=Q.kind==="task"?`/org/${e}/tasks/${Q.id}?from=task:${Ke.id}`:Q.kind==="issue"?`/classic/#issue=${encodeURIComponent(Q.id)}`:Q.kind==="release"?`/classic/#${Q.planned?"planned":"release"}=${encodeURIComponent(Q.id)}`:null;return Ce?s.jsx(l,{className:"text-primary hover:underline",href:r(Ce),children:Q.label}):Q.label}})]}),o]})}function bo({children:e}){return s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 pb-8 sm:px-6 lg:px-8",children:e})}function vx({back:e,id:t,badge:n,title:a,created:r,actions:l}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("div",{children:e}),t?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[s.jsx("span",{className:"font-mono",children:t}),n]}):null,s.jsx(Kn,{title:a,description:r??void 0,actions:l})]})}function ys({label:e,value:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),s.jsx("dd",{className:"text-sm break-words",children:t})]})}function en({id:e,title:t,aside:n,heading_ref:a,children:r}){return s.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[s.jsx("h2",{id:`${e}-title`,ref:a,tabIndex:a?-1:void 0,className:"text-lg font-semibold outline-none",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),s.jsx("div",{className:"mt-2",children:r})]})}function WO({detail:e,holder:t,finished_at:n,read_at:a}){const r=e.claim,[,l]=u.useReducer(f=>f+1,0),i=r&&!e.view_outdated?new Date(r.lease_expires_at).getTime():null;u.useEffect(()=>{if(i===null||!Number.isFinite(i))return;const f=i-Date.now();if(f<=0)return;const h=setTimeout(l,Math.min(f+50,2147483647));return()=>clearTimeout(h)},[i]);let o=s.jsx(cm,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${I_}`;else if(r){const f=new Date(r.lease_expires_at)<=new Date(Math.max(Date.now(),new Date(a).getTime()));o=s.jsx(rm,{className:"size-4","aria-hidden":"true"}),c=`${t} is working on this until ${Vl(r.lease_expires_at)}${f||r.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=s.jsx(Xb,{className:"size-4","aria-hidden":"true"}),d=`Finished ${Hn(n)}. Its claim ended when it finished.`);return s.jsxs(St,{className:"mt-4 flex flex-wrap items-center gap-3 p-3","data-testid":"task-claim",children:[o,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-sm font-medium",children:c}),d?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:d}):null]})]})}function JO({detail:e,waits:t,given:n,threadName:a,threadsLink:r}){if(e.view_outdated)return s.jsx(en,{id:"task-holds",title:"Holds",children:s.jsx("p",{className:"text-sm",children:I_})});if(e.holds.length===0)return null;const l=new Map(t.map(i=>[i.id,i]));return s.jsxs(en,{id:"task-holds",title:`Holds · ${e.holds.length} open`,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"A hold does not change the task's status."}),s.jsx(St,{className:"mt-2 overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Holds",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Type"}),s.jsx(X,{children:"Reason"}),s.jsx(X,{children:"Waiting on"}),s.jsx(X,{children:"Opened"})]})}),s.jsx(it,{children:e.holds.map(i=>{var f;const o=l.get(i.id),c=ui[i.hold_type],d=n?"Done above answers it":o!=null&&o.local_done?"In Waiting on you":(f=o==null?void 0:o.local_threads)!=null&&f.length?s.jsxs(s.Fragment,{children:["Answer it in ",r,": ",o.local_threads.join(" · ")]}):null;return s.jsxs(xe,{"data-testid":"task-hold",children:[s.jsx(V,{children:s.jsx(Ve,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),s.jsxs(V,{children:[s.jsx("div",{children:i.reason}),s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Opened by ",a(i.opened_by)]})]}),s.jsxs(V,{children:[s.jsx("div",{children:i.target.kind==="user"?"You":i.target.kind==="external"?i.target.label:"Another task"}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null]}),s.jsx(V,{children:Xm(i.opened_at)})]},i.id)})})]})})]})}function eD({time:e}){return s.jsx(en,{id:"task-time",title:"Time",children:s.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(ys,{label:"Estimate",value:e.estimate?`${xl(e.estimate.low)}–${xl(e.estimate.high)}`:e.unknown_reason??"None"}),s.jsx(ys,{label:"Time taken",value:e.elapsed!==null?`${xl(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?s.jsx(ys,{label:"Reforecast",value:s.jsxs("span",{className:"text-muted-foreground",children:[xl(e.forecast.low),"–",xl(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function V_({what:e,again:t,refusal:n,on_retry:a}){return s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsxs(je,{children:["Could not read ",e]}),s.jsxs(oe,{children:[s.jsx("p",{children:n.message}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:t})]})]})}function tD({sections:e,heading_ref:t,on_retry:n,taskLink:a}){const[r,l]=u.useState(!1);if(e.state==="loading")return null;const i=e.state==="failed"?e.refusal:e.data.graph.ok?null:e.data.graph.refusal;if(i)return s.jsx(en,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsx(V_,{what:"graph changes",again:"Read graph changes again",refusal:i,on_retry:n})});const o=e.state==="ok"&&e.data.graph.ok?e.data.graph.data:null;if(!o)return null;if(o.exempt)return s.jsx(en,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsxs("p",{className:"text-sm",children:["This task changes no modeled design. Its plan says why: ",o.exempt,"."]})});if(o.changes.length===0)return null;const c=r?o.changes:o.changes.slice(0,G_),d=o.changes.length-c.length;return s.jsxs(en,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[s.jsx(St,{className:"overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Graph changes",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Change"}),s.jsx(X,{children:"Kind of change"}),s.jsx(X,{children:"Also in"}),s.jsx(X,{children:"In the plan"})]})}),s.jsx(it,{children:c.map(f=>s.jsxs(xe,{children:[s.jsxs(V,{children:[s.jsx("div",{children:f.label}),s.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),s.jsx(V,{children:XO[f.change]}),s.jsx(V,{children:f.also_in.length===0?"No other task":f.also_in.map((h,m)=>s.jsxs(u.Fragment,{children:[m>0?", ":null,a(h.id)]},h.id))}),s.jsx(V,{children:f.planned?"Yes":s.jsx(Ve,{variant:"warning",children:"No longer planned"})})]},`${f.id}:${f.planned}`))})]})}),d>0?s.jsxs("p",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[d," more changes in this task's plan slice.",s.jsxs(I,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),children:["Show all ",o.changes.length]})]}):null]})}function nD({files:e,finished:t}){const[n,a]=u.useState(!1),r=n?e.paths:e.paths.slice(0,G_);return s.jsxs(en,{id:"task-files",title:"Files",children:[r.length>0?s.jsx("ul",{className:"grid gap-1 text-sm",children:r.map(l=>s.jsx("li",{children:s.jsx("span",{className:"font-mono break-all",children:l})},l))}):null,e.paths.length>r.length?s.jsxs(I,{type:"button",variant:"ghost",size:"sm",className:"mt-1",onClick:()=>a(!0),children:["Show all ",e.paths.length]}):null,e.landed?s.jsxs("p",{className:"mt-2 text-sm",children:["Landed ",s.jsx("span",{className:"font-mono",children:e.landed.sha.slice(0,10)})," · ",e.landed.files," files",t?"":" · becomes the proof when the task finishes"]}):null]})}function aD({proof:e,finished_at:t,who:n}){return s.jsxs(en,{id:"task-proof",title:"Evidence and proof",children:[e.evidence?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.evidence}):null,e.no_code?s.jsxs("p",{className:"mt-2 text-sm",children:["No code: ",e.no_code]}):e.commit?s.jsxs("p",{className:"mt-2 text-sm",children:["Proof ",s.jsx("span",{className:"font-mono",children:e.commit.slice(0,10)})," ·"," ",e.on_main?"on main":"not yet on main"]}):null,t?s.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Finished ",Hn(t),n?` by ${n}`:""]}):null]})}function sD({history:e}){return s.jsxs(en,{id:"task-history",title:"History",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),s.jsx(St,{className:"mt-2 overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"History",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"What"}),s.jsx(X,{children:"Who"}),s.jsx(X,{children:"When"})]})}),s.jsx(it,{children:e.map((t,n)=>s.jsxs(xe,{children:[s.jsx(V,{children:t.what}),s.jsx(V,{children:t.who??"Its thread"}),s.jsx(V,{children:Xm(t.at)})]},`${t.at}:${n}`))})]})})]})}function rD({related:e,heading_ref:t,on_retry:n,link:a}){return e.state==="ok"&&e.data.length===0?null:s.jsx(en,{id:"task-related",title:"Related",heading_ref:t,children:e.state==="loading"?s.jsxs("div",{className:"grid gap-2",role:"status","aria-label":"Loading related work",children:[s.jsx(Nt,{className:"h-8 w-full"}),s.jsx(Nt,{className:"h-8 w-full"}),s.jsx(Nt,{className:"h-8 w-2/3"})]}):e.state==="failed"?s.jsx(V_,{what:"related work",again:"Read related work again",refusal:e.refusal,on_retry:n}):s.jsx(St,{className:"overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Related",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Kind"}),s.jsx(X,{children:"Item"}),s.jsx(X,{children:"How it relates"})]})}),s.jsx(it,{children:e.data.map(r=>s.jsxs(xe,{children:[s.jsx(V,{children:KO[r.kind]}),s.jsx(V,{children:a(r)}),s.jsx(V,{children:r.relation})]},`${r.kind}:${r.planned?"planned:":""}${r.id}`))})]})})})}function lD({org:e,task_id:t,from:n}){const a=Yi(),r=`/org/${e}/tasks`;return a.taskSections?s.jsx(FO,{org:e,task_id:t,from:n??null}):s.jsx(iD,{task_id:t,back:r})}function iD({task_id:e,back:t}){const{availability:n}=Yi(),[a,r]=u.useState({state:"loading"});return u.useEffect(()=>{let l=!0;return n().then(i=>{l&&r(i)}),()=>{l=!1}},[n]),a.state==="off"?s.jsx(Ec,{back:t}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:a.state==="active"?s.jsx(BO,{active:a,task_id:e,back:t}):a.state==="error"?s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"This task could not be loaded"}),s.jsx(oe,{children:"Check your connection and try again."})]}):a.state==="available"?s.jsx(Ec,{back:t}):s.jsx(Qm,{})})}function Rc(e,t){u.useEffect(()=>{const n=setInterval(()=>{document.visibilityState==="visible"&&e()},t),a=()=>{document.visibilityState==="visible"&&e()};return document.addEventListener("visibilitychange",a),()=>{clearInterval(n),document.removeEventListener("visibilitychange",a)}},[e,t])}const Y_={integration:"Integration",deploy:"Deploy",publish:"Publish",accept:"Accept",custom:"Custom"},oD={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},cD={self_service:"Self-service: each entry takes its own turn",managed:"Managed: a manager batches entries that allow it",manager_only:"Manager only: the manager runs every turn"},uD={in_batch:{label:"In the batch",tone:"info"},done:{label:"Done",tone:"success"},failed:{label:"Failed",tone:"error"},released:{label:"Released",tone:"neutral"},left:{label:"Left",tone:"neutral"},gone:{label:"Ended",tone:"neutral"},skipped:{label:"Skipped",tone:"neutral"},lapsed:{label:"Lapsed",tone:"warning"}};function dD(e){return uD[e??"in_batch"]}function fD(e){const t=e.turn==="next",n=t?"Next":"Waiting",a=e.batching==="managed"||e.batching==="released"?` · ${e.batching}`:"";return{label:`${n}${a}`,tone:t?"info":"neutral"}}const P_=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function hD(e,t,n,a=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${jn(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:a&&e.hold?{label:P_(n),tone:"info"}:{label:"Running",tone:"info"}}function jn(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ws(e){const t=Math.round(e/60);if(t<60)return`${t} min`;const n=Math.floor(t/60),a=t%60;return a?`${n} h ${a} min`:`${n} h`}function mD(e){var n;const t=e.binding;return(t==null?void 0:t.kind)==="repository_branch"?`${t.repository} · ${t.branch}`:(t==null?void 0:t.kind)==="label"?t.label:((n=e.layer)==null?void 0:n.kind)==="release"&&e.layer.promotes_to?`Promotes to ${e.layer.promotes_to}`:null}function pD(e,t){switch(e.kind){case"any_thread":return"Any thread in this checkout";case"task_writers":return"Anyone who can edit the entry's task";case"any_joiner":return"Anyone who may join";case"managers":return"Whoever may manage";case"admins":return"Workspace admins";case"none":return"Nobody";case"listed":{const n=e.users.map(t),a=e.teams.length;return a&&n.push(a===1?"1 team":`${a} teams`),n.length?n.join(", "):"Nobody"}}}function gD(e,t){var o,c;const{policy:n,management:a}=e,r=(o=e.layer)==null?void 0:o.kind,l=d=>pD(d,t),i=[["Mode",cD[a.mode]],["Who can join",l(a.joiners)]];return r==="implement"&&i.push(["Managers",l(a.managers)],["Manager lease",Ws(a.manager_lease_seconds)],["Batches",n.batch.enabled?`Up to ${n.batch.max_members} entries`:"Off"]),((c=e.layer)==null?void 0:c.kind)==="release"&&(e.layer.promotes_to&&i.push(["Promotes to",e.layer.promotes_to]),i.push(["Carries waiting entries",n.ride?"Yes: a done turn carries entries already contained in it":"No"],["Freeze",n.freeze.enabled?`Up to ${Ws(n.freeze.max_seconds)}, ${Ws(n.freeze.default_seconds)} by default`+(e.layer.freezers?` · ${l(e.layer.freezers)}`:""):"Off"],["Fix forward",n.fix_forward?"Yes: a failed turn keeps its turn until fixed":"No"],["Stalled turns",a.stall_takers.kind==="none"?"Nobody takes one":`${l(a.stall_takers)} may take one after ${Ws(n.stall_seconds)}`])),i.push(["Reorder",l(a.reorderers)]),n.max_turns>1&&i.push(["Turns at once",`Up to ${n.max_turns} independent turns`]),i.push(["Turn lease",Ws(n.lease_seconds)],["Time to start",`${Ws(n.start_grace_seconds)} after the turn comes`]),n.entry_limit!==null&&i.push(["Waiting entries",`Up to ${n.entry_limit}`]),n.footprint!=="off"&&i.push(["Footprint",n.footprint==="required"?"Required":"Optional"]),i}const X_="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",K_="A task you cannot see",xD="A former member",vD="A member";function Q_(){const e=os().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function yD({org:e,open:t,path:n}){var h;const a=Q_(),{href:r,Link:l}=kt(),i=a.availability,[o,c]=u.useState({state:"loading"}),d=u.useCallback(async m=>{i&&(m&&c({state:"loading"}),c(await i({fresh:m})))},[i]);u.useEffect(()=>{d(!1)},[d]);const f=!i||o.state==="active";return o.state==="off"&&((h=o.refusal)==null?void 0:h.reason)!=="engine_missing"?s.jsx(xu,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:r(`/org/${e}`),backLabel:"Back to the organization",link:l}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:f?s.jsx(jD,{org:e,open:t??null,path:n??`/org/${e}/tasks/queues`}):s.jsxs(s.Fragment,{children:[s.jsx(Kn,{title:"Queues",description:a.description??X_}),o.state==="loading"&&s.jsx(Z_,{}),(o.state==="error"||o.state==="off")&&s.jsx(Wf,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Tasks are not on for this organization"}),s.jsxs(oe,{children:["Queues hold turns for tasks, so they show once Tasks are on."," ",s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks`),children:"Go to Tasks"})]})]})]})})}function Z_(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading queues",children:Array.from({length:3},(e,t)=>s.jsx(Nt,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function Wf({refusal:e,on_retry:t}){return(e==null?void 0:e.reason)==="store_locked"?s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"The local stores are busy"}),s.jsxs(oe,{children:[s.jsx("p",{children:e.message}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]}):(e==null?void 0:e.reason)==="engine_missing"||(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(de,{variant:e.reason==="engine_missing"?"info":"destructive",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:e.reason==="engine_missing"?"Queues need the sdlc engine":"The sdlc engine here is too old for this page"}),s.jsx(oe,{children:e.message})]}):s.jsxs(de,{variant:"destructive",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Queues could not be loaded"}),s.jsxs(oe,{children:[s.jsx("p",{children:"The read did not answer. Try again in a moment."}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}const Ed=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function bD(e,t,n,a){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${jn(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${jn(e)} · refreshes every ${n}s${a?` · ${a}`:""}`}function jD({org:e,open:t,path:n}){var ye;const{listQueues:a,queue:r,members:l,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:h=!1}=Q_(),{self_id:m}=eu(),[x,j]=u.useState(null),[y,b]=u.useState(null),[g,p]=u.useState(null),[v,w]=u.useState(null),[_,S]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let te=!0;return l().then(q=>{te&&S(ee=>q.ok?{state:"answered",members:q.data}:{state:"failed",members:ee.members})}),()=>{te=!1}},[l]);const N=u.useMemo(()=>new Map(_.members.map(te=>[te.user_id,te])),[_.members]),k=_.state==="answered"?xD:vD,R=u.useCallback((te,q)=>{var ee;return(q==null?void 0:q.title)??(h?(q==null?void 0:q.id)??te:te===m?"You":((ee=N.get(te))==null?void 0:ee.label)??k)},[N,k,m,h]),M=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[z,U]=u.useState(null),[C,D]=u.useState(!1),G=u.useCallback((te,q)=>{M.current[te]={last:q,fresh:!0};const{list:ee,detail:ue}=M.current;D(ee.last==="failed"||ue.last==="failed"),ee.fresh&&ue.fresh&&ee.last==="ok"&&ue.last==="ok"&&U(Date.now()/1e3)},[]),E=t??((ye=x==null?void 0:x.queues[0])==null?void 0:ye.id)??null,B=u.useRef(E);u.useEffect(()=>{B.current=E},[E]);const T=u.useRef(0),L=u.useCallback(async()=>{var ee;const te=T.current+=1;M.current.list.fresh=!1;const q=await a();if(te===T.current)if(q.ok){if(j(q.data),b(null),!t){const ue=((ee=q.data.queues[0])==null?void 0:ee.id)??null;ue===null?M.current.detail={last:"ok",fresh:!0}:ue!==B.current&&(M.current.detail.fresh=!1)}G("list","ok")}else b(q.refusal),G("list","failed")},[a,t,G]),K=u.useRef(0),$=u.useCallback(async()=>{const te=K.current+=1;if(!E)return;M.current.detail.fresh=!1;const q=await r(E);te===K.current&&(q.ok?(p(q.data),w(null),G("detail","ok")):(w(q.refusal),Ed(q.refusal)&&p(null),G("detail",Ed(q.refusal)?"ok":"failed")))},[E,r,G]);u.useEffect(()=>{L()},[L]),u.useEffect(()=>{p(null),w(null),$()},[$]);const Y=u.useCallback(()=>{L(),$()},[L,$]);Rc(Y,i);const ne=Math.round(i/1e3),P=v!==null&&Ed(v);return s.jsxs(s.Fragment,{children:[s.jsxs(Kn,{title:"Queues",description:c??X_,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:bD(z,C,ne,d)}),s.jsx("span",{className:"sr-only",role:"status",children:C?"Not reading":z===null?"Connecting":"Live"})]}),!x&&!y&&s.jsx(Z_,{}),!x&&y&&s.jsx(Wf,{refusal:y,on_retry:Y}),x&&x.queues.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Zb,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No queues yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Queues are created through the sdlc CLI, the MCP tools or the API. Once one exists, its turns and waiting work show here."})]}):x?s.jsxs(s.Fragment,{children:[s.jsx(_D,{path:n,queues:x.queues,open_id:E,name:R,held:h}),P?s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"This queue is no longer available"}),s.jsx(oe,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):g&&g.queue.id===E?s.jsx(ND,{org:e,detail:g,name:R,settings_note:o,subject_label:f,thread_subjects:h}):v?s.jsx(Wf,{refusal:v,on_retry:()=>void $()}):s.jsx(Nt,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function Jf({org:e,subject:t,link:n}){const{href:a,Link:r}=kt();return!t||t.hidden?s.jsx("span",{className:"text-muted-foreground",children:K_}):t.kind==="task"&&n?s.jsx(r,{className:"text-primary hover:underline",href:a(`/org/${e}/tasks/${t.id}`),children:t.title??t.id}):s.jsx("span",{children:t.title??t.id})}function wD(e,t,n){const a=e.freeze?`frozen until ${jn(e.freeze.lease_until)}`:null;if(e.batch)return{primary:`Batch of ${e.batch.size} · ${t(e.batch.holder,e.batch.holder_subject)}`,secondary:[`Opened ${jn(e.batch.opened_at)}`,a].filter(Boolean).join(" · "),warn:!1};if(e.turn){const r=e.turn.subject,l=r.hidden?K_:r.title??r.id,i=(e.running_count??1)>1?`${e.running_count} turns · `:"",o=e.turn.landing?" landing":"",c=n&&!!e.turn.hold,d=[c?P_(e.name,e.turn.note):null,e.turn.fixing_since!==void 0?"Fixing forward":null,a].filter(Boolean);return c&&e.turn.fixing_since===void 0&&!a?{primary:`${i}${l}${o}`,secondary:Rd(d.join(" · ")),warn:!1}:{primary:`${i}${l}${o}`,secondary:d.length?Rd(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:a?Rd(a):null,warn:!!a}}const Rd=e=>e.charAt(0).toUpperCase()+e.slice(1);function _D({path:e,queues:t,open_id:n,name:a,held:r}){const{href:l,Link:i}=kt();return s.jsx(St,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Queues",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Queue"}),s.jsx(X,{className:"hidden md:table-cell",children:"Step"}),s.jsx(X,{children:"Running turn"}),s.jsx(X,{className:"hidden text-right md:table-cell",children:"Waiting"})]})}),s.jsx(it,{children:t.map(o=>{var m;const c=o.id===n,d=mD(o),f=wD(o,a,r),h=o.waiting-(((m=o.batch)==null?void 0:m.remaining)??0);return s.jsxs(xe,{"data-testid":"queues-row",className:F(c&&"bg-accent"),children:[s.jsxs(V,{children:[s.jsx(i,{className:"text-primary hover:underline",href:l(`${e}?queue=${encodeURIComponent(o.id)}`),"aria-current":c?"page":void 0,children:o.name}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null,s.jsxs("div",{className:"text-muted-foreground text-xs md:hidden",children:[h," waiting"]})]}),s.jsx(V,{className:"hidden md:table-cell",children:s.jsx(Ve,{variant:"neutral",children:Y_[o.policy.step]})}),s.jsxs(V,{children:[s.jsx("div",{className:F(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?s.jsx("div",{className:F("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),s.jsx(V,{className:"hidden text-right md:table-cell",children:h})]},o.id)})})]})})}function jo({id:e,title:t,side:n,children:a}){return s.jsxs("section",{"aria-labelledby":e,className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{id:e,className:"text-sm font-semibold",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]}),a]})}function yx({org:e,entries:t,landing:n,queue_name:a,subject_label:r,held:l,label:i}){return s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(lt,{containerAriaLabel:i,children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:r}),s.jsx(X,{children:"State"})]})}),s.jsx(it,{children:t.map(o=>{const c=hD(o,n,a,l);return s.jsxs(xe,{"data-testid":"queues-running",children:[s.jsxs(V,{children:[s.jsx(Jf,{org:e,subject:o.subject,link:!l}),l&&o.hold&&o.note&&!o.subject.hidden?s.jsx("div",{className:"text-muted-foreground text-xs",children:o.note}):null]}),s.jsx(V,{children:s.jsx(Ve,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function ND({org:e,detail:t,name:n,settings_note:a,subject_label:r,thread_subjects:l}){var w;const{queue:i,state:o}=t,c=_=>n(_),d=new Map(o.entries.map(_=>[_.ref,_.subject])),f=o.entries.filter(_=>_.turn==="running"),h=o.entries.filter(_=>_.turn!=="running"&&_.batching!=="in_batch"),m=o.batch,x=Math.max(1,f.filter(_=>_.batching!=="in_batch").length),j=m&&i.policy.independent_turns?f.filter(_=>_.batching!=="in_batch"&&_.ref!==m.holder):[],y=o.manager,b=o.freeze,g=((w=i.layer)==null?void 0:w.kind)==="release"?i.layer.stall_hold:void 0,p=g?{who:n(g.by),why:g.reason,until:g.until}:y!=null&&y.hold?{who:n(y.holder,y.holder_subject),why:y.hold.why,until:y.hold.until}:null,v=!m&&f.length===0&&h.length===0;return s.jsxs(St,{as:"section","aria-labelledby":"queue-title",className:"mt-6 flex shrink-0 flex-col gap-4 p-4","data-testid":"queues-detail",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{id:"queue-title",className:"text-lg font-semibold",children:i.name}),s.jsx(Ve,{variant:"neutral",children:Y_[i.policy.step]}),s.jsx(Ve,{variant:"neutral",children:oD[i.management.mode]})]}),i.purpose?s.jsx("p",{className:"text-muted-foreground text-sm",children:i.purpose}):null]}),y?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm","data-testid":"queues-manager",children:[s.jsx(Q2,{className:"text-muted-foreground size-4","aria-hidden":"true"}),s.jsx("span",{className:"text-muted-foreground",children:"Manager"}),s.jsx("span",{className:"font-medium",children:n(y.holder,y.holder_subject)}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Lease until ",jn(y.lease_until),y.serving_until!==void 0?" · serving now":""]})]}):null,b?s.jsxs(de,{variant:"warning",children:[s.jsx(V2,{className:"size-4","aria-hidden":"true"}),s.jsxs(je,{children:["Frozen until ",jn(b.lease_until)]}),s.jsxs(oe,{children:[n(b.holder,b.holder_subject)," froze this queue at ",jn(b.since),b.label?`: ${b.label}`:"",". Only ",n(b.holder,b.holder_subject),"'s entries start until it thaws."]})]}):null,p?s.jsxs(de,{variant:"info",children:[s.jsx(Fb,{className:"size-4","aria-hidden":"true"}),s.jsxs(je,{children:["Stall hold until ",jn(p.until)]}),s.jsxs(oe,{children:[p.who,p.why?`: ${p.why}`:"",". The first entry is not treated as stalled while it lasts."]})]}):null,v?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running, and nothing waits in this queue."}):s.jsxs(s.Fragment,{children:[m?s.jsxs(jo,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(m.holder,m.holder_subject)} at ${jn(m.opened_at)}`,children:[s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(lt,{containerAriaLabel:"Batch members",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Landing order"}),s.jsx(X,{children:r}),s.jsx(X,{children:"Outcome"})]})}),s.jsx(it,{children:m.members.map((_,S)=>{const N=dD(_.outcome);return s.jsxs(xe,{"data-testid":"queues-member",children:[s.jsx(V,{children:S+1}),s.jsx(V,{children:s.jsx(Jf,{org:e,subject:_.subject??d.get(_.ref)??(l?{kind:"thread",id:_.ref}:void 0),link:!l})}),s.jsx(V,{children:s.jsx(Ve,{variant:N.tone,children:N.label})})]},_.ref)})})]})}),j.length>0?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-muted-foreground text-xs font-medium",children:"Also running"}),s.jsx(yx,{org:e,entries:j,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Turns running beside the batch"})]}):null]}):s.jsx(jo,{id:"queue-running",title:f.length>1?"Running turns":"Running turn",children:f.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running."}):s.jsx(yx,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Running turns"})}),s.jsx(jo,{id:"queue-waiting",title:"Waiting",children:h.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing waits."}):s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(lt,{containerAriaLabel:"Waiting entries",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Position"}),s.jsx(X,{children:r}),s.jsx(X,{className:"hidden md:table-cell",children:"Joined"}),s.jsx(X,{children:"Turn"}),s.jsx(X,{className:"hidden md:table-cell",children:"Note"})]})}),s.jsx(it,{children:h.map((_,S)=>{const N=fD(_);return s.jsxs(xe,{"data-testid":"queues-waiting",children:[s.jsx(V,{children:m?x+S+1:_.position}),s.jsx(V,{children:s.jsx(Jf,{org:e,subject:_.subject,link:!l})}),s.jsx(V,{className:"hidden md:table-cell",children:jn(_.joined_at)}),s.jsx(V,{children:s.jsx(Ve,{variant:N.tone,children:N.label})}),s.jsx(V,{className:"hidden md:table-cell",children:_.subject.hidden?"":_.note??""})]},_.ref)})})]})})})]}),s.jsx(jo,{id:"queue-settings",title:"Settings",children:s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsx(lt,{containerAriaLabel:"Queue settings",children:s.jsx(it,{children:gD(i,c).map(([_,S])=>s.jsxs(xe,{children:[s.jsx(X,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:_}),s.jsx(V,{children:S})]},_))})})})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a})]})}const ca="__no_parent__";function F_(e,t){const n=new Set([t]);for(let a=!0;a;){a=!1;for(const r of e)r.parent&&n.has(r.parent)&&!n.has(r.key)&&(n.add(r.key),a=!0)}return n}const eh=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function ua({id:e,label:t,help:n,error:a,children:r}){const l=[n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ze,{htmlFor:e,children:t}),r(l),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function bx({id:e,label:t,help:n,checked:a,on_change:r}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(el,{id:e,className:"mt-0.5",checked:a,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:l=>r(l===!0)}),s.jsx(Ze,{htmlFor:e,className:"font-normal",children:t})]}),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground pl-6 text-xs",children:n}):null]})}function W_({id:e,legend:t,help:n,error:a,options:r,checked:l,on_change:i,empty:o}){const c=[n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("fieldset",{className:"m-0 grid min-w-0 gap-2 border-0 p-0","aria-describedby":c,"aria-invalid":a?!0:void 0,children:[s.jsx("legend",{className:"mb-2 text-sm leading-none font-medium",children:t}),r.length===0&&o?s.jsx("p",{className:"text-muted-foreground text-sm",children:o}):null,s.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:r.map((d,f)=>s.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[s.jsx(el,{id:`${e}-${f}`,className:"mt-0.5",checked:l.has(d.value),onCheckedChange:h=>{const m=new Set(l);h===!0?m.add(d.value):m.delete(d.value),i(m)}}),s.jsx(Ze,{htmlFor:`${e}-${f}`,className:"min-w-0 font-normal break-words",children:d.label})]},d.value))}),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function Zm({message:e}){return e?s.jsxs(de,{variant:"destructive",role:"alert",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(oe,{children:e})]}):null}function J_({id:e,value:t,on_change:n,none:a,options:r,described_by:l}){return s.jsxs(Nn,{value:t,onValueChange:n,children:[s.jsx(hn,{id:e,"aria-describedby":l,children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:ca,children:a}),r.map(i=>s.jsx(We,{value:i.key,children:i.label||i.key},i.key))]})]})}function Fm(e){const[t,n]=u.useState(!1),[a,r]=u.useState(null);return{saving:t,refusal:a,set_refusal:r,run:async i=>{n(!0),r(null);try{const o=await i();o?r(o):e()}finally{n(!1)}}}}const e1=e=>`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts and in sdlc org, and cannot change later.`;function SD({open:e,chart:t,team:n,save:a,on_close:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(""),[h,m]=u.useState(ca),[x,j]=u.useState({}),{saving:y,refusal:b,set_refusal:g,run:p}=Fm(r);u.useEffect(()=>{e&&(i(""),c((n==null?void 0:n.label)??""),f((n==null?void 0:n.description)??""),m((n==null?void 0:n.parent)??ca),j({}),g(null))},[e,n,g]);const v=n?F_(t.teams,n.key):new Set,w=[...t.teams].filter(S=>!v.has(S.key)).sort(eh),_=S=>{if(S.preventDefault(),!n){if(!l.trim()){j({key:"Give the team a key."});return}const R=o.trim()||l.trim();p(()=>a({action:"add",kind:"team",key:l.trim(),...o.trim()?{label:o.trim()}:{},...d.trim()?{description:d.trim()}:{},...h!==ca?{parent:h}:{}},`Team ${R} added.`));return}if(!o.trim()){j({label:"Give the team a label."});return}const N=h===ca?null:h,k={...o.trim()!==n.label.trim()?{label:o.trim()}:{},...d.trim()!==(n.description??"").trim()?{description:d.trim()}:{},...N!==n.parent?{parent:N}:{}};if(Object.keys(k).length===0){r();return}p(()=>a({action:"edit",kind:"team",key:n.key,...k},`Team ${o.trim()} saved.`))};return s.jsx(Oi,{open:e,onOpenChange:S=>S||y?null:r(),children:s.jsx(Di,{children:s.jsxs("form",{onSubmit:_,noValidate:!0,children:[s.jsxs(zi,{children:[s.jsx(Li,{children:n?`Edit team ${n.label||n.key}`:"Add team"}),s.jsx(Ui,{children:n?s.jsxs(s.Fragment,{children:["Its key, ",s.jsx("span",{className:"font-mono",children:n.key}),", names it in posts and in sdlc org and does not change."]}):"Add a team to this repository's local org."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Zm,{message:b}),n?null:s.jsx(ua,{id:"org-team-key",label:"Key",help:e1("team"),error:x.key,children:S=>s.jsx(xn,{id:"org-team-key",className:"font-mono",value:l,autoComplete:"off","aria-invalid":x.key?!0:void 0,"aria-describedby":S,onChange:N=>{i(N.target.value),j({})}})}),s.jsx(ua,{id:"org-team-label",label:n?"Label":"Label (optional)",help:n?void 0:"Shown on the chart; the key when left empty.",error:x.label,children:S=>s.jsx(xn,{id:"org-team-label",value:o,"aria-invalid":x.label?!0:void 0,"aria-describedby":S,onChange:N=>{c(N.target.value),j({})}})}),s.jsx(ua,{id:"org-team-description",label:"Description (optional)",children:()=>s.jsx(ds,{id:"org-team-description",rows:3,placeholder:"What the team does",value:d,onChange:S=>f(S.target.value)})}),s.jsx(ua,{id:"org-team-parent",label:"Parent team",help:"Where the team sits; its posts report up through the team above.",children:S=>s.jsx(J_,{id:"org-team-parent",value:h,on_change:m,none:"No parent (a root team)",options:w,described_by:S})})]}),s.jsxs($i,{className:"mt-6",children:[s.jsx(I,{type:"button",variant:"outline",disabled:y,onClick:r,children:"Cancel"}),s.jsx(I,{type:"submit",disabled:y,children:n?y?"Saving…":"Save":y?"Adding…":"Add team"})]})]})})})}const kD=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function CD({open:e,chart:t,job:n,save:a,on_close:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(""),[h,m]=u.useState(ca),[x,j]=u.useState(new Set),[y,b]=u.useState(!1),[g,p]=u.useState(!0),[v,w]=u.useState({}),{saving:_,refusal:S,set_refusal:N,run:k}=Fm(r);u.useEffect(()=>{e&&(i(""),c((n==null?void 0:n.label)??""),f((n==null?void 0:n.description)??""),m((n==null?void 0:n.parent)??ca),j(new Set((n==null?void 0:n.fills)??[])),b((n==null?void 0:n.requires_person)??!1),p((n==null?void 0:n.escalable)??!0),w({}),N(null))},[e,n,N]);const R=n?F_(t.job_functions,n.key):new Set,M=[...t.job_functions].filter(C=>!R.has(C.key)).sort(eh),z=[...t.slots].sort(eh).map(C=>({value:C.key,label:C.label||C.key})),U=C=>{if(C.preventDefault(),!n){if(!l.trim()){w({key:"Give the job function a key."});return}k(()=>a({action:"add",kind:"job_function",key:l.trim(),...o.trim()?{label:o.trim()}:{},...d.trim()?{description:d.trim()}:{},...h!==ca?{parent:h}:{},fills:[...x],requires_person:y,escalable:g},`Job function ${o.trim()||l.trim()} added.`));return}if(!o.trim()){w({label:"Give the job function a label."});return}const D=h===ca?null:h,G={...o.trim()!==n.label.trim()?{label:o.trim()}:{},...d.trim()!==(n.description??"").trim()?{description:d.trim()}:{},...D!==n.parent?{parent:D}:{},...kD(n.fills,x)?{}:{fills:[...x]},...y!==n.requires_person?{requires_person:y}:{},...g!==n.escalable?{escalable:g}:{}};if(Object.keys(G).length===0){r();return}k(()=>a({action:"edit",kind:"job_function",key:n.key,...G},`Job function ${o.trim()} saved.`))};return s.jsx(Oi,{open:e,onOpenChange:C=>C||_?null:r(),children:s.jsx(Di,{children:s.jsxs("form",{onSubmit:U,noValidate:!0,children:[s.jsxs(zi,{children:[s.jsx(Li,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),s.jsxs(Ui,{children:["Its job description: what it does, the slots it fills and who may hold its posts.",n?s.jsxs(s.Fragment,{children:[" ","Its key, ",s.jsx("span",{className:"font-mono",children:n.key}),", does not change."]}):null]})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Zm,{message:S}),n?null:s.jsx(ua,{id:"org-function-key",label:"Key",help:e1("job function"),error:v.key,children:C=>s.jsx(xn,{id:"org-function-key",className:"font-mono",value:l,autoComplete:"off","aria-invalid":v.key?!0:void 0,"aria-describedby":C,onChange:D=>{i(D.target.value),w({})}})}),s.jsx(ua,{id:"org-function-label",label:n?"Label":"Label (optional)",error:v.label,children:C=>s.jsx(xn,{id:"org-function-label",value:o,"aria-invalid":v.label?!0:void 0,"aria-describedby":C,onChange:D=>{c(D.target.value),w({})}})}),s.jsx(ua,{id:"org-function-description",label:"Job description (optional)",children:()=>s.jsx(ds,{id:"org-function-description",rows:3,placeholder:"What this job function does",value:d,onChange:C=>f(C.target.value)})}),s.jsx(ua,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:C=>s.jsx(J_,{id:"org-function-parent",value:h,on_change:m,none:"No parent (a root function)",options:M,described_by:C})}),s.jsx(W_,{id:"org-function-fills",legend:"Slots it fills",options:z,checked:x,on_change:j,empty:"This org has no slots yet; add them with sdlc org add slot."}),s.jsx(bx,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:y,on_change:b}),s.jsx(bx,{id:"org-function-escalable",label:"Escalable",help:"When no holder can decide, the decision goes up the reporting line. Off, it waits for a holder of this function.",checked:g,on_change:p})]}),s.jsxs($i,{className:"mt-6",children:[s.jsx(I,{type:"button",variant:"outline",disabled:_,onClick:r,children:"Cancel"}),s.jsx(I,{type:"submit",disabled:_,children:n?_?"Saving…":"Save":_?"Adding…":"Add job function"})]})]})})})}function TD({open:e,chart:t,binding:n,names:a,save:r,confirm:l,on_close:i}){var k;const[o,c]=u.useState(new Set),[d,f]=u.useState(""),[h,m]=u.useState({}),{saving:x,refusal:j,set_refusal:y,run:b}=Fm(i);if(u.useEffect(()=>{!e||!n||(c(new Set(n.posts.map(R=>R.post))),f(n.source==="override"?n.reason??"":""),m({}),y(null))},[e,n,y]),!n)return null;const g=a.slot(n.slot),p=(k=t.project)!=null&&k.team?t.teams.find(R=>{var M;return R.key===((M=t.project)==null?void 0:M.team)}):void 0,v=p?p.label||p.key:"the owning team",w=new Set(t.job_functions.filter(R=>R.fills.includes(n.slot)).map(R=>R.key)),_=[...t.posts].map(R=>R.post).sort(a.byPost).map(R=>({value:R,label:w.has(R.split("/")[1]??"")?`${a.post(R)} (fills ${g})`:a.post(R)})),S=R=>{R.preventDefault();const M={...o.size===0?{posts:"Choose at least one post."}:{},...d.trim()?{}:{reason:"Give the reason for the override."}};m(M),!(M.posts||M.reason)&&b(()=>r({action:"bind",slot:n.slot,posts:[...o],reason:d.trim()},`Override of ${g} saved.`))},N=async()=>{await l({title:`Clear the override of ${g}?`,description:"It goes back to the posts its job descriptions name, and its reason is not kept.",action_label:"Clear",destructive:!0})&&b(()=>r({action:"unbind",slot:n.slot},`Override of ${g} cleared.`))};return s.jsx(Oi,{open:e,onOpenChange:R=>R||x?null:i(),children:s.jsx(Di,{children:s.jsxs("form",{onSubmit:S,noValidate:!0,children:[s.jsxs(zi,{children:[s.jsxs(Li,{children:["Override ",g]}),s.jsxs(Ui,{children:["Bind ",g," in this project to the posts you choose instead of its job descriptions' posts. The override is reported with its reason, who set it and when."]})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Zm,{message:j}),s.jsx(W_,{id:"org-override-posts",legend:"Posts",help:"A post outside its job description is marked on the chart.",error:h.posts,options:_,checked:o,on_change:R=>{c(R),m(M=>({...M,posts:void 0}))}}),s.jsx(ua,{id:"org-override-reason",label:"Reason",error:h.reason,children:R=>s.jsx(ds,{id:"org-override-reason",rows:2,placeholder:"Why this slot needs other posts",value:d,"aria-invalid":h.reason?!0:void 0,"aria-describedby":R,onChange:M=>{f(M.target.value),m(z=>({...z,reason:void 0}))}})}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", who must hold the lead post of ",v," or of a team above it."]})]}),s.jsxs($i,{className:"mt-6",children:[n.source==="override"?s.jsx(I,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:x,onClick:()=>void N(),children:"Clear override"}):null,s.jsx(I,{type:"button",variant:"outline",disabled:x,onClick:i,children:"Cancel"}),s.jsx(I,{type:"submit",disabled:x,children:x?"Saving…":"Save override"})]})]})})})}function t1({label:e,on_edit:t,on_remove:n}){return s.jsxs(pu,{children:[s.jsx(gu,{asChild:!0,children:s.jsx(I,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`More actions for ${e}`,children:s.jsx(lm,{className:"size-3.5","aria-hidden":"true"})})}),s.jsxs(Ii,{align:"end",children:[s.jsx(Ds,{onSelect:t,children:"Edit"}),s.jsx(Ds,{className:"text-destructive focus:text-destructive",onSelect:n,children:"Remove"})]})]})}function ED({label:e,message:t,on_dismiss:n}){return s.jsxs(de,{variant:"destructive",role:"alert",className:"mb-3",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsxs(je,{children:[e," was not removed"]}),s.jsxs(oe,{children:[s.jsx("p",{children:t}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Dismiss"})]})]})}const RD="Who holds each post and who reports to whom in this repository's local org, worked out from its teams, job functions and posts.",AD="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",MD="scripts/agent-coordination/workflow.json",OD=4,Wm=e=>({paddingLeft:16+24*Math.min(e,OD)}),Ac={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function DD(){const e=os().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function zD(){const e=DD(),[t,n]=u.useState({state:"loading"}),[a,r]=u.useState(null),l=u.useRef(0),i=u.useRef(null),o=u.useCallback(h=>{const m=async x=>{const j=l.current+=1;i.current&&clearTimeout(i.current);const y=await e.chart();if(j!==l.current)return;if(y.ok){r({chart:y.data,at:new Date().toISOString()}),n({state:"read"});return}const{refusal:b}=y;if(b.reason==="no_local_org"){r(null),n({state:"none"});return}if(b.retry&&b.reason==="store_locked"&&x>0){const g=b.retry_after??10;n({state:"busy",retry_after:g}),i.current=setTimeout(()=>void m(x-1),g*1e3);return}n({state:"failed",refusal:b})};return m(h)},[e]);u.useEffect(()=>(o(1),()=>{l.current+=1,i.current&&clearTimeout(i.current)}),[o]);const c=()=>void o(1),d=t.state==="none"?null:a,f=LD(e.change,()=>void o(1),(d==null?void 0:d.chart)??$D);return s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(Kn,{title:"Org chart",description:RD}),t.state==="busy"&&!d?s.jsxs("p",{className:"text-muted-foreground mt-4 text-sm",role:"status",children:["Another sdlc command holds the repository store; reading again in ",t.retry_after," s."]}):null,(t.state==="loading"||t.state==="busy")&&!d?s.jsx(UD,{quiet:t.state==="busy"}):null,t.state==="none"?s.jsx(HD,{edit:(f==null?void 0:f.actions)??null}):null,t.state==="failed"?s.jsx(BD,{kept_at:(d==null?void 0:d.at)??null,on_retry:c}):null,d?s.jsx(qD,{chart:d.chart,edit:(f==null?void 0:f.actions)??null}):null,(f==null?void 0:f.dialogs)??null]})}const $D={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function LD(e,t,n){const a=Ti(),r=n1(n),{confirm:l,confirm_dialog:i}=Jr(),[o,c]=u.useState(null),[d,f]=u.useState({}),h=b=>f(g=>{if(!g[b])return g;const{[b]:p,...v}=g;return v});if(!e)return null;const m=async(b,g)=>{const p=await e(b);return p.ok?("kind"in b&&h(b.kind==="team"?"teams":"functions"),a.success(g),t(),null):p.refusal.message},x=async(b,g,p)=>{if(!await l({title:`Remove ${b==="team"?"team":"job function"} ${p}?`,description:"It leaves this repository's local org. If a post, a team or function under it, a holder, an override or the project still needs it, nothing is removed and you are told what needs it.",action_label:"Remove",destructive:!0}))return;const _=b==="team"?"teams":"functions",S=await e({action:"remove",kind:b,key:g});if(!S.ok){f(N=>({...N,[_]:{label:p,message:S.refusal.message}}));return}h(_),a.success(`${b==="team"?"Team":"Job function"} ${p} removed.`),t()},j=()=>c(null),y=(o==null?void 0:o.kind)==="override"&&n.project.team!==null?n.project.slots.find(b=>b.slot===o.slot)??null:null;return{actions:{team:b=>c({kind:"team",team:b}),job:b=>c({kind:"function",job:b}),override:b=>c({kind:"override",slot:b}),remove:(b,g,p)=>void x(b,g,p),refused:b=>{const g=d[b];return g?s.jsx(ED,{label:g.label,message:g.message,on_dismiss:()=>h(b)}):null}},dialogs:s.jsxs(s.Fragment,{children:[s.jsx(SD,{open:(o==null?void 0:o.kind)==="team",chart:n,team:(o==null?void 0:o.kind)==="team"?o.team:null,save:m,on_close:j}),s.jsx(CD,{open:(o==null?void 0:o.kind)==="function",chart:n,job:(o==null?void 0:o.kind)==="function"?o.job:null,save:m,on_close:j}),s.jsx(TD,{open:y!==null,chart:n,binding:y,names:r,save:m,confirm:l,on_close:j}),i]})}}function UD({quiet:e=!1}){return s.jsx("div",{className:"mt-6 grid gap-2",...e?{"aria-hidden":!0}:{role:"status","aria-label":"Loading the org chart"},children:Array.from({length:4},(t,n)=>s.jsx(Nt,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function kr({children:e}){return s.jsx("pre",{className:"bg-muted text-foreground m-0 overflow-x-auto rounded-md border px-3 py-2 font-mono text-sm",children:s.jsx("code",{children:e})})}function HD({edit:e}){return s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"This repository has no local org yet"}),s.jsxs(oe,{children:[s.jsx("p",{children:e?"Plan one from this checkout's workflow roles with sdlc org seed, or start one with a team. This page shows it as soon as it exists.":"Plan one from this checkout's workflow roles, or start one with a team. This page shows it as soon as it exists."}),s.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[s.jsx(kr,{children:"sdlc org seed"}),e?null:s.jsx(kr,{children:"sdlc org add team <key>"})]}),e?s.jsxs(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[s.jsx(yc,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function BD({kept_at:e,on_retry:t}){return s.jsxs(de,{variant:"destructive",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Could not read the local org"}),s.jsxs(oe,{children:[s.jsxs("p",{children:[e?`The chart read at ${In(e)} is kept below. `:"","Details are in the terminal running sdlc viewer."]}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function n1(e){return u.useMemo(()=>{const t=new Map(e.teams.map(h=>[h.key,h.label||h.key])),n=new Map(e.job_functions.map(h=>[h.key,h.label||h.key])),a=new Map(e.slots.map(h=>[h.key,h.label||h.key])),r=new Map(e.posts.map(h=>[h.post,h.holders])),l=h=>{const[m="",x=""]=h.split("/");return{team:t.get(m)??m,job:n.get(x)??x}},i=h=>{const{team:m,job:x}=l(h);return`${x} · ${m}`},o=h=>{if(h==="top")return"Top of the org";if(typeof h!="string")return`A vacant ${n.get(h.vacant)??h.vacant}`;const m=(r.get(h)??[]).map(x=>x.id);return m.length?`${i(h)} (${m.join(", ")})`:i(h)},c=new Map(e.teams.map(h=>[h.key,h.parent])),d=h=>{let m=0;for(let x=c.get(h);x&&m<e.teams.length;x=c.get(x))m+=1;return m};return{parts:l,post:i,manager:o,byPost:(h,m)=>{const[x="",j=""]=[h.split("/")[0],m.split("/")[0]],[y,b]=[l(h),l(m)];return d(x)-d(j)||y.team.localeCompare(b.team)||y.job.localeCompare(b.job)},slot:h=>a.get(h)??h,job:h=>n.get(h)??h,team:h=>t.get(h)??h}},[e])}function vs({id:e,title:t,description:n,actions:a,children:r}){return s.jsxs("section",{"aria-labelledby":e,className:"mt-8 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[s.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[s.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),s.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:n})]}),a?s.jsx("div",{className:"flex shrink-0 gap-2",children:a}):null]}),s.jsx("div",{className:"mt-3",children:r})]})}function jx({children:e,on_click:t}){return s.jsxs(I,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(yc,{className:"size-4","aria-hidden":"true"}),e]})}function qD({chart:e,edit:t}){const n=n1(e);return s.jsxs(s.Fragment,{children:[s.jsx(vs,{id:"org-chart-lines",title:"Reporting lines",description:"Each post reports to the post of its parent job function in the same team, or else in the nearest team above it that has one.",children:s.jsx(ID,{chart:e,names:n})}),s.jsx(vs,{id:"org-chart-members",title:"Members",description:"A member's primary manager comes from the post highest in the function tree; the others are dotted lines. Each agent answers to the nearest person in its reporting chain.",children:s.jsx(PD,{chart:e,names:n})}),t?s.jsxs(vs,{id:"org-chart-teams",title:"Teams",description:"Each team under its parent. A post is one of its job functions staffed in it.",actions:s.jsx(jx,{on_click:()=>t.team(null),children:"Add team"}),children:[t.refused("teams"),s.jsx(GD,{chart:e,edit:t})]}):null,s.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[s.jsxs(vs,{id:"org-chart-functions",title:"Function tree",description:"Each job function under its parent, with the slots it fills.",actions:t?s.jsx(jx,{on_click:()=>t.job(null),children:"Add job function"}):void 0,children:[t==null?void 0:t.refused("functions"),s.jsx(XD,{chart:e,names:n,edit:t})]}),s.jsxs(vs,{id:"org-chart-slots",title:"Slots",description:AD,children:[e.workflow?null:s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"This checkout has no workflow file, so no slot is marked as a gate:"}),s.jsx("p",{className:"font-mono text-xs",children:MD})]}),s.jsx(QD,{chart:e,names:n})]})]}),s.jsx(FD,{chart:e,names:n,edit:t})]})}function GD({chart:e,edit:t}){const n=Jm([...e.teams].sort((l,i)=>(l.label||l.key).localeCompare(i.label||i.key)),l=>l.key,l=>l.parent);if(n.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No teams yet."});const a=e.project.team,r=(l,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:l.map(({item:o,children:c})=>{const d=o.label||o.key;return s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Wm(i),"data-testid":"org-chart-team",children:[s.jsx("span",{className:"text-sm font-medium",children:d}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:o.key}),a===o.key?s.jsx(Ve,{variant:"neutral",children:"Owns this project"}):null,s.jsx(t1,{label:d,on_edit:()=>t.team(o),on_remove:()=>t.remove("team",o.key,d)})]})]}),c.length>0?r(c,i+1):null]},o.key)})});return s.jsx(St,{className:"overflow-hidden",children:r(n,0)})}function Jm(e,t,n){const a=new Set(e.map(t)),r=new Map(e.map(i=>[t(i),{item:i,children:[]}])),l=[];for(const i of e){const o=n(i),c=r.get(t(i));o&&a.has(o)&&o!==t(i)?r.get(o).children.push(c):l.push(c)}return l}function ID({chart:e,names:t}){const n=Jm([...e.posts].sort((l,i)=>t.byPost(l.post,i.post)),l=>l.post,l=>typeof l.reports_to=="string"&&l.reports_to!=="top"?l.reports_to:null);if(n.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No posts yet."});const a=new Map(e.members.map(l=>[`${l.kind}:${l.id}`,l])),r=(l,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:l.map(({item:o,children:c})=>{const{team:d}=t.parts(o.post),f=typeof o.reports_to=="object"?o.reports_to:null;return s.jsxs("li",{children:[s.jsxs("div",{className:"border-b py-2 pr-4",style:Wm(i),"data-testid":"org-chart-post",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Pk,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium",children:t.parts(o.post).job}),s.jsx("span",{className:"text-muted-foreground text-xs",children:f?`${d} · Reports to a vacant ${t.job(f.vacant)}`:d})]}),s.jsx("div",{className:"mt-1 grid min-w-0 gap-1 pl-6",children:o.holders.length===0?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{variant:Ac.vacant.tone,children:Ac.vacant.label}),s.jsx("span",{className:"text-muted-foreground text-xs",children:"No one holds this post."})]}):o.holders.map(h=>s.jsx(VD,{holder:h,post:o.post,member:a.get(`${h.kind}:${h.id}`),names:t},`${h.kind}:${h.id}`))})]}),c.length>0?r(c,i+1):null]},o.post)})});return s.jsx(St,{className:"overflow-hidden",children:r(n,0)})}function VD({holder:e,post:t,member:n,names:a}){const r=e.kind==="person"?cm:rm,l=n==null?void 0:n.posts.find(c=>c.post===t),i=n==null?void 0:n.posts.find(c=>c.primary);let o=null;return l!=null&&l.dotted&&i?o=`Dotted line: primary manager is ${a.manager(i.reports_to)}`:e.kind==="agent"&&n&&"accountable_person"in n&&(o=n.accountable_person?`Accountable person ${n.accountable_person.id}`:"No accountable person"),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(r,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium break-all",children:e.id}),s.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}),o?s.jsx("span",{className:"text-xs",children:o}):null]})}const YD=["sdlc org hold <team>/<function> --person <id>","sdlc org hold <team>/<function> --agent <id>"];function PD({chart:e,names:t}){if(e.members.length===0)return s.jsxs("div",{className:"grid max-w-2xl gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"No one holds a post yet. Give a post to a person or an agent:"}),YD.map(a=>s.jsx(kr,{children:a},a))]});const n=[...e.members].sort((a,r)=>a.kind===r.kind?a.id.localeCompare(r.id):a.kind==="person"?-1:1);return s.jsx(St,{className:"overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Members",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Member"}),s.jsx(X,{children:"Posts"}),s.jsx(X,{children:"Primary manager"}),s.jsx(X,{children:"Dotted lines"}),s.jsx(X,{children:"Accountable person"})]})}),s.jsx(it,{children:n.map(a=>{var i;const r=a.posts.find(o=>o.primary),l=a.posts.filter(o=>o.dotted);return s.jsxs(xe,{"data-testid":"org-chart-member",children:[s.jsxs(V,{children:[s.jsx("div",{className:"font-medium",children:a.id}),s.jsx("div",{className:"text-muted-foreground text-xs",children:a.kind==="person"?"Person":"Agent"})]}),s.jsx(V,{children:a.posts.map(o=>t.post(o.post)).join(", ")}),s.jsx(V,{children:r?t.manager(r.reports_to):"None"}),s.jsx(V,{children:l.length?l.map(o=>t.manager(o.reports_to)).join(", "):"None"}),s.jsx(V,{children:a.kind==="person"?"Not an agent":((i=a.accountable_person)==null?void 0:i.id)??"None"})]},`${a.kind}:${a.id}`)})})]})})}function XD({chart:e,names:t,edit:n}){const a=Jm([...e.job_functions].sort((l,i)=>(l.label||l.key).localeCompare(i.label||i.key)),l=>l.key,l=>l.parent);if(a.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No job functions yet."});const r=(l,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:l.map(({item:o,children:c})=>s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Wm(i),"data-testid":"org-chart-function",children:[s.jsx("span",{className:"text-sm font-medium",children:o.label||o.key}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:o.fills.length?`Fills ${o.fills.map(t.slot).join(", ")}`:"No slot"}),o.requires_person?s.jsx(Ve,{variant:"neutral",children:"Requires a person"}):null,n?s.jsx(t1,{label:o.label||o.key,on_edit:()=>n.job(o),on_remove:()=>n.remove("job_function",o.key,o.label||o.key)}):null]})]}),c.length>0?r(c,i+1):null]},o.key))});return s.jsx(St,{className:"overflow-hidden",children:r(a,0)})}function KD(e,t){return e.status==="uncovered"?"No job function fills this slot":e.status==="vacant"?`${e.posts.map(t.post).join(", ")} has no holder`:e.posts.map(n=>`${t.post(n.post)}: ${n.holders.map(a=>a.id).join(", ")}`).join("; ")}const Mc={covered:0,vacant:1,uncovered:2};function a1(e){return new Map(e.slots.filter(t=>t.gate).map(t=>{var n;return[t.key,(n=t.gates)!=null&&n.length?`Gate: ${t.gates.join(", ")}`:"Gate slot"]}))}function QD({chart:e,names:t}){const n=a1(e);return s.jsx(St,{className:"overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Slots",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Slot"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Resolves to"})]})}),s.jsxs(it,{children:[[...e.slot_resolution].sort((a,r)=>Mc[a.status]-Mc[r.status]||t.slot(a.slot).localeCompare(t.slot(r.slot))).map(a=>{const r=Ac[a.status];return s.jsxs(xe,{"data-testid":"org-chart-slot",children:[s.jsxs(V,{children:[s.jsx("div",{className:"font-medium",children:t.slot(a.slot)}),n.has(a.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:n.get(a.slot)}):null]}),s.jsx(V,{children:s.jsx(Ve,{variant:r.tone,children:r.label})}),s.jsxs(V,{children:[KD(a,t),a.status==="covered"&&a.needs_person?s.jsx("div",{className:"text-muted-foreground text-xs",children:"Needs a person"}):null]})]},a.slot)}),e.slot_resolution.length===0?s.jsx(xe,{children:s.jsx(V,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const ZD="Who fills each workflow slot for this repository's project: the posts of the owning team's job functions, else of the nearest team above, unless an override names other posts.",Ad=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function FD({chart:e,names:t,edit:n}){const{project:a}=e;if(a.team===null){const i=a.roots.map(t.team);return s.jsx(vs,{id:"org-chart-project",title:"This project",description:i.length?`This org has several root teams (${i.join(", ")}), so no team owns this repository's project yet and its slots are not bound. Name the owning team:`:"This org has no team yet, so no team owns this repository's project. Start one:",children:s.jsx("div",{className:"max-w-2xl",children:s.jsx(kr,{children:i.length?Ad[0]:"sdlc org add team <key>"})})})}const r=a1(e),l=[...a.slots].sort((i,o)=>Mc[i.status]-Mc[o.status]||t.slot(i.slot).localeCompare(t.slot(o.slot)));return s.jsxs(vs,{id:"org-chart-project",title:"This project",description:ZD,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Owning team"}),s.jsx("span",{className:"text-sm font-medium",children:t.team(a.team)})]}),s.jsx(St,{className:"mt-3 overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Slots in this project",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Slot"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Bound to"}),s.jsx(X,{children:"Source"}),n?s.jsx(X,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(it,{children:[l.map(i=>{const o=Ac[i.status];return s.jsxs(xe,{"data-testid":"org-chart-project-slot",children:[s.jsxs(V,{children:[s.jsx("div",{className:"font-medium",children:t.slot(i.slot)}),r.has(i.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:r.get(i.slot)}):null]}),s.jsx(V,{children:s.jsx(Ve,{variant:o.tone,children:o.label})}),s.jsx(V,{children:s.jsx(WD,{binding:i,names:t})}),s.jsx(V,{children:s.jsx(JD,{binding:i})}),n?s.jsx(V,{className:"text-right",children:s.jsx(I,{type:"button",variant:"ghost",size:"control-icon","aria-label":i.source==="override"?`Edit the override of ${t.slot(i.slot)}`:`Override ${t.slot(i.slot)}`,onClick:()=>n.override(i.slot),children:s.jsx(Wb,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),l.length===0?s.jsx(xe,{children:s.jsx(V,{colSpan:n?5:4,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})}),n?s.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Overrides made here are made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", as sdlc org makes them without --as: that person must hold the lead post of the owning team or of a team above it."]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team with sdlc org:"}),s.jsx(kr,{children:Ad[0]})]}):s.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team or a slot's binding with sdlc org; a lead post of the owning team or a team above it may:"}),Ad.map(i=>s.jsx(kr,{children:i},i))]})]})}function WD({binding:e,names:t}){const n=[];e.status==="covered"&&e.needs_person&&n.push("Needs a person");for(const r of e.posts)r.off_description&&n.push(`${t.post(r.post)} does not fill ${t.slot(e.slot)} in its job description`);e.stale_posts&&n.push(e.stale_posts===1?"One post this override names is no longer in the org":`${e.stale_posts} posts this override names are no longer in the org`);let a;return e.posts.length===0?a=e.source==="override"?"The override names no post the org still has":"No job function fills this slot":e.status==="vacant"?a=`${e.posts.map(r=>t.post(r.post)).join(", ")} has no holder`:a=e.posts.map(r=>r.holders.length?`${t.post(r.post)}: ${r.holders.map(l=>l.id).join(", ")}`:`${t.post(r.post)}: no holder`).join("; "),s.jsxs(s.Fragment,{children:[a,n.map(r=>s.jsx("div",{className:"text-muted-foreground text-xs",children:r},r))]})}function JD({binding:e}){var a;if(e.source==="baseline")return s.jsx(s.Fragment,{children:"From job descriptions"});const t=(a=e.set_by)==null?void 0:a.split(":").slice(1).join(":"),n=[e.reason,[t,e.set_at?Hn(e.set_at):null].filter(Boolean).join(", ")].filter(Boolean).join(" · ");return s.jsxs(s.Fragment,{children:["Override",n?s.jsx("div",{className:"text-muted-foreground text-xs",children:n}):null]})}const e4="Local only · this machine · not connected to SoftwareDLC",t4="Checking sync state…",n4="Sync state unknown",a4="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",th="Details are in the terminal running sdlc viewer.",s4="How to fix it is in the terminal running sdlc viewer.",Nu="Loading…",Oc="Not available";function r4(e){if(!e.source)return null;if(e.source.kind==="repository")return"Repository · in no folder";const t=e.source.repositories;return`Folder · ${t} ${t===1?"repository":"repositories"}`}function kl(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const l4={repository_registry:"this repository's registry",folder_registry:"the folder registry",issue_store:"the issue store",task_store:"the task store",workspace_store:"the local graph store"};function s1(e,t){const n=t?` this list was read at ${kl(t)}.`:"";if(e.reason==="store_locked"){const a=e.store?l4[e.store]:"a local store",r=e.since?` since ${kl(e.since)}`:"";return`Another sdlc command has held ${a}${r};${n||" nothing was read yet."} ${th}`}return e.status===0?`The viewer did not answer. Is sdlc viewer still running?${t?` This list was read at ${kl(t)}.`:""}`:`The read failed.${t?` This list was read at ${kl(t)}.`:""} ${th}`}const i4=e=>e.status===409,o4={not_a_home:"The repository this one's folder pointer names is not a folder's home.",folder_conflict:"This repository holds both a folder pointer and a folder's membership.",pointer_invalid:"This repository's folder pointer cannot be read, or names this repository as its own home.",membership_invalid:"The folder's records cannot be read.",folder_invalid:"This repository's folder records cannot be read."};function c4(e){const t=e.repository??"This repository";if(e.reason==="folder_member_unlisted"&&e.folder&&e.home&&e.member_path)return{kind:"unlisted",repository:t,folder:e.folder,home:e.home,member_path:e.member_path};if(e.reason==="member_moved"){const r=e.folder?`the folder ${e.folder}`:"its folder";return{kind:"moved_member",cause:`This repository, ${t}, is not where ${r} records it.`}}if(e.reason==="folder_moved")return{kind:"other",cause:e.folder?`The folder ${e.folder} has moved.`:"The folder has moved.",fix:!0};const n=e.reason?o4[e.reason]:void 0,a=n!==void 0&&e.reason!=="membership_invalid"&&e.reason!=="folder_invalid";return{kind:"other",cause:n??"This repository's folder cannot be read.",fix:a}}const wx=["tasks","issues","releases"],r1=u.createContext(null);function Qn(){const e=u.useContext(r1);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}const u4=10,d4=()=>new Date;function f4({shell:e,now:t=d4,children:n}){const[a,r]=u.useState(null),[l,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=u.useState(null),[x,j]=u.useState(!0),[y,b]=u.useState(!1),[g,p]=u.useState(void 0),[v,w]=u.useState(!1),[_,S]=u.useState(wx),N=u.useRef(!1),k=u.useRef(!1),R=u.useRef(null),M=u.useRef(!0),z=u.useCallback(async(C=!1)=>{R.current&&clearTimeout(R.current),R.current=null,b(!0);const[D,G]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!M.current)return;if(b(!1),j(!1),D.ok&&G.ok){if(N.current=!0,k.current=!1,m(null),f(t()),D.data.organizations.length===0){c("not_in_git"),r(null),i(null);return}c(null),r(D.data.organizations[0]),i(G.data.projects);return}const E=D.ok?G.ok?null:G.refusal:D.refusal;if(!E)return;if(i4(E)){k.current=!1,m(null),c(E),r(null),i(null);return}const B=N.current&&!k.current&&!C;k.current=!0;const T=E.retry_after??u4;m({refusal:E,shown:!B,retryInSeconds:B?T:null}),B&&(R.current=setTimeout(()=>void z(!0),T*1e3))},[e,t]);u.useEffect(()=>(M.current=!0,z(),e.about.about().then(C=>{M.current&&(C.ok?p(C.data):C.refusal.status===404?p(null):w(!0))}),Promise.all(wx.map(async C=>{var D;return[C,await((D=e[C])==null?void 0:D.access())]})).then(C=>{M.current&&S(C.filter(([,D])=>!(D!=null&&D.ok&&!D.data.can_view)).map(([D])=>D))}),()=>{M.current=!1,R.current&&clearTimeout(R.current)}),[e,z]);const U={loading:x,org:a,projects:l,none:o,readAt:d,failure:h,about:g,aboutFailed:v,domains:_,reading:y,refresh:()=>void z()};return s.jsx(r1.Provider,{value:U,children:n})}const h4={threads:"Threads",chat:"Chat",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},m4={tasks:"Tasks",issues:"Issues",releases:"Releases"};function nh(e,t){return e.kind==="home"?"Home":e.kind==="org"?h4[e.page]:e.kind==="project"?e.page?m4[e.page]:t??e.project:"Not found"}const p4="(max-width: 767px)";function g4(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(p4):null,[t,n]=u.useState((e==null?void 0:e.matches)??!1);return u.useEffect(()=>{if(!e)return;const a=()=>n(e.matches);return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[e]),t}function wo({className:e=""}){return s.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function _x({label:e,children:t}){return s.jsxs("span",{role:"status",className:"flex flex-col gap-1",children:[s.jsx("span",{className:"sr-only",children:e}),t]})}function Nx({item:e,collapsed:t}){const{Link:n}=kt(),a=e.icon,r=e.title??(t?e.label:void 0),l=s.jsx("span",{className:"block",children:s.jsxs(n,{href:e.href,className:"flex h-8 items-center gap-2 overflow-hidden rounded-md px-2 text-sm text-sidebar-foreground no-underline outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring "+(e.current?"bg-sidebar-accent font-medium text-sidebar-accent-foreground":""),"aria-current":e.current?"page":void 0,"aria-label":t?e.label:void 0,children:[s.jsx(a,{className:"size-4 shrink-0","aria-hidden":"true"}),!t&&s.jsx("span",{className:"truncate",children:e.label})]})});return s.jsx("li",{children:r?s.jsxs(vO,{children:[s.jsx(yO,{asChild:!0,children:l}),s.jsx(O_,{side:"right",children:r})]}):l})}const Sx="m-0 flex list-none flex-col gap-1 p-0";function kx({label:e,collapsed:t,children:n}){return s.jsxs("div",{className:"flex flex-col gap-1 p-2",role:"group","aria-label":e,children:[!t&&s.jsx("p",{className:"m-0 px-2 text-xs font-medium text-sidebar-foreground/70",children:e}),n]})}function Cx({page:e,collapsed:t,sheet:n=!1,hasChat:a}){var C;const{href:r}=kt(),{worktrees:l}=os(),i=Qn(),{org:o,projects:c,loading:d,none:f,about:h,aboutFailed:m,domains:x}=i,j=o?`/org/${o.slug}`:"",y=c==null?void 0:c.find(D=>D.current),b=((C=o==null?void 0:o.source)==null?void 0:C.kind)==="folder"&&y!==void 0,g=D=>b&&y?`${D} · ${y.name}`:D,p=g("Workspaces"),v=g("Tasks"),w=g("Queues"),_=D=>b?D:void 0,S=[{label:"Home",href:r(j||"/"),icon:v2,current:e.kind==="home"},{label:"Threads",href:r(`${j}/threads`),icon:E2,current:e.kind==="org"&&e.page==="threads"},...a?[{label:"Chat",href:r(`${j}/chat`),icon:C2,current:e.kind==="org"&&e.page==="chat"}]:[],...x.includes("tasks")?[{label:v,title:_(v),href:r(`${j}/tasks`),icon:Qb,current:e.kind==="org"&&e.page==="tasks"}]:[],{label:w,title:_(w),href:r(`${j}/queues`),icon:Zb,current:e.kind==="org"&&e.page==="queues"},...l?[{label:"Worktrees",href:r(`${j}/worktrees`),icon:Kb,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:p,title:_(p),href:r(`${j}/workspaces`),icon:m2,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:r(`${j}/chart`),icon:O2,current:e.kind==="org"&&e.page==="chart"}],N=d?null:f?"No organization":(o==null?void 0:o.name)??"Organization",k=o?r4(o):null,R=h==null?void 0:h.version,M=R?t?R:`sdlc ${R}`:m?Oc:Nu,z=m||(h==null?void 0:h.sync.state)==="unknown"?n4:h===void 0?t4:e4;let U;return d?U=s.jsx("div",{className:"px-2 py-1",children:s.jsxs(_x,{label:"Loading projects",children:[s.jsx(wo,{className:"h-4 w-32"}),s.jsx(wo,{className:"h-4 w-24"})]})}):c?U=s.jsx("ul",{className:Sx,children:c.map(D=>s.jsx(Nx,{collapsed:t,item:{label:D.name,title:D.name,href:r(`/proj/${encodeURIComponent(D.id)}`),icon:f2,current:e.kind==="project"&&e.project===D.id}},D.id))}):U=s.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:f?"No projects":Oc}),s.jsxs("div",{className:"flex h-full flex-col bg-sidebar text-sidebar-foreground",children:[s.jsxs("div",{className:`flex items-center gap-2 p-2 ${n?"pr-11":""}`,role:"group","aria-label":"Current organization",children:[s.jsx("div",{className:"flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:s.jsx(Kk,{className:"size-4","aria-hidden":"true"})}),!t&&s.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:N===null?s.jsxs(_x,{label:"Loading organization",children:[s.jsx(wo,{className:"h-4 w-28"}),s.jsx(wo,{className:"h-3 w-24"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-semibold",title:N,children:N}),k&&s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:k})]})})]}),s.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[s.jsx(kx,{label:"Organization",collapsed:t,children:s.jsx("ul",{className:Sx,children:S.map(D=>s.jsx(Nx,{item:D,collapsed:t},D.label))})}),!t&&s.jsx(kx,{label:"Projects",collapsed:t,children:U})]}),h!==null&&s.jsxs("div",{className:"flex flex-col gap-1 border-t border-sidebar-border p-2 text-xs text-sidebar-foreground/70",children:[s.jsx("p",{className:"m-0 truncate px-2",title:R?`sdlc ${R}`:void 0,children:M}),!t&&s.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[s.jsx(g2,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{children:z})]})]})]})}const x4="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function v4({page:e}){var c;const{href:t,Link:n}=kt(),{org:a,projects:r,loading:l,none:i}=Qn(),o=[];if(l)o.push({label:Nu});else if(i)o.push({label:"No organization"});else{const d=(a==null?void 0:a.name)??"Organization";if(o.push({label:d,href:e.kind==="home"?void 0:t(a?`/org/${a.slug}`:"/")}),e.kind==="project"){const f=((c=r==null?void 0:r.find(h=>h.id===e.project))==null?void 0:c.name)??e.project;o.push({label:f,href:e.page?t(`/proj/${encodeURIComponent(e.project)}`):void 0})}e.kind==="org"&&e.item!==void 0?(o.push({label:nh(e),href:a?t(`/org/${a.slug}/${e.page}`):void 0}),o.push({label:e.item})):e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:nh(e)})}return s.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0",children:s.jsx("ol",{className:"m-0 flex min-w-0 list-none items-center gap-1.5 p-0 text-sm text-muted-foreground",children:o.map((d,f)=>s.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[f>0&&s.jsx(Yb,{className:"size-3.5 shrink-0","aria-hidden":"true"}),d.href?s.jsx(n,{href:d.href,className:`truncate text-muted-foreground no-underline hover:text-foreground ${x4}`,children:d.label}):s.jsx("span",{className:"truncate font-normal text-foreground","aria-current":f===o.length-1?"page":void 0,children:d.label})]},`${f}-${d.label}`))})})}function y4({page:e,chat:t=!1,children:n}){var p;const a=g4(),[r,l]=u.useState(!0),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(null),{org:f,projects:h,loading:m,none:x}=Qn(),j=e.kind==="project"?(p=h==null?void 0:h.find(v=>v.id===e.project))==null?void 0:p.name:void 0;u.useEffect(()=>{const v=m?Nu:x?"No organization":(f==null?void 0:f.name)??"Organization";document.title=`${nh(e,j)} · ${v} · sdlc viewer`},[e,j,f,m,x]);const y=()=>{var v;o(!1),(v=c.current)==null||v.focus()};u.useEffect(()=>{a||o(!1)},[a]);const b=a&&i;u.useEffect(()=>{var _;const v=d.current;if(!b||!v)return;(_=v.querySelector("a, button"))==null||_.focus();const w=S=>{var z;if(S.key==="Escape"){o(!1),(z=c.current)==null||z.focus();return}if(S.key!=="Tab")return;const N=[...v.querySelectorAll("a[href], button:not([disabled])")];if(N.length===0)return;const k=N[0],R=N[N.length-1],M=v.contains(document.activeElement);S.shiftKey&&(document.activeElement===k||!M)?(S.preventDefault(),R.focus()):!S.shiftKey&&(document.activeElement===R||!M)&&(S.preventDefault(),k.focus())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[b]);const g=!a&&!r;return s.jsx(xO,{children:s.jsxs("div",{className:"flex h-svh min-h-0 overflow-hidden bg-background text-foreground",children:[!a&&s.jsx("aside",{"aria-label":"Sidebar",className:`shrink-0 border-r border-sidebar-border transition-[width] ${g?"w-12":"w-64"}`,children:s.jsx(Cx,{page:e,collapsed:g,hasChat:t})}),b&&s.jsxs("div",{className:"fixed inset-0 z-50 flex",children:[s.jsxs("aside",{ref:d,role:"dialog","aria-modal":"true","aria-label":"Sidebar",className:"relative w-72 max-w-[85vw] border-r border-sidebar-border",children:[s.jsx(Cx,{page:e,collapsed:!1,sheet:!0,hasChat:t}),s.jsx("button",{type:"button","aria-label":"Close the sidebar",className:"absolute top-3 right-3 inline-flex size-7 items-center justify-center rounded-md border-0 bg-transparent text-sidebar-foreground/70 outline-hidden hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring",onClick:y,children:s.jsx(ej,{className:"size-4","aria-hidden":"true"})})]}),s.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"flex-1 border-0 bg-black/80 outline-hidden",onClick:y})]}),s.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsxs("header",{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 transition-[height] ${g?"h-12":"h-16"}`,children:[s.jsx("button",{ref:c,type:"button",className:"-ml-1 inline-flex size-7 items-center justify-center rounded-md border-0 bg-transparent text-foreground outline-hidden hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Toggle Sidebar","aria-expanded":a?i:r,onClick:()=>a?o(v=>!v):l(v=>!v),children:s.jsx(z2,{className:"size-4","aria-hidden":"true"})}),s.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),s.jsx(v4,{page:e})]}),s.jsx("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto",children:n})]})]})})}const l1={working:{label:"Working",tone:"success"},waiting:{label:"Waiting for you",tone:"warning"},closed:{label:"Closed",tone:"neutral"},continued:{label:"Continued elsewhere",tone:"neutral"}},ep="m-0 text-2xl font-semibold tracking-tight",tp="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",np=`rounded-sm font-medium text-primary no-underline hover:underline ${tp}`;function Md({children:e}){return s.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-muted px-3 py-2 font-mono text-sm text-foreground",children:s.jsx("code",{children:e})})}function b4({why:e}){return e.kind==="not_in_git"?s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:"This directory is not a Git repository. Start sdlc viewer inside one:"}),s.jsx(Md,{children:"sdlc viewer"})]}):e.kind==="unlisted"?s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:`This repository, ${e.repository}, points to the folder ${e.folder}, but that folder no longer lists it.`}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To rejoin, leave the folder here:"}),s.jsx(Md,{children:"sdlc-agents folder leave"}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`then add it back from the folder's home repository, ${e.home}:`}),s.jsx(Md,{children:`sdlc-agents folder add ${e.member_path} --name ${e.repository}`}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To work in this repository alone, leaving is enough."})]}):s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:e.cause}),e.kind==="moved_member"&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"Move this repository back to where the folder records it."}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:e.kind==="other"&&!e.fix?th:s4})]})}const Tx=`inline-flex h-9 items-center justify-center whitespace-nowrap rounded-md border border-input bg-background px-3 font-[inherit] text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 ${tp}`;function j4(){return s.jsxs("div",{role:"status",className:"flex flex-col gap-2",children:[s.jsx("span",{className:"sr-only",children:"Loading projects"}),[0,1,2].map(e=>s.jsx("span",{"aria-hidden":"true",className:"block h-9 animate-pulse rounded-md bg-muted"},e))]})}function Pi(){const{href:e,Link:t}=kt(),{loading:n,projects:a,none:r,failure:l,readAt:i,refresh:o,reading:c}=Qn(),[d,f]=u.useState(""),h=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:ep,children:"Projects"}),!r&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:a4})]});if(r)return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,s.jsx(b4,{why:r==="not_in_git"?{kind:"not_in_git"}:c4(r)})]});const m=l!=null&&l.shown?l:null,x=(a??[]).filter(j=>j.name.toLowerCase().includes(d.trim().toLowerCase()));return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,m&&s.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-4",children:[s.jsx("p",{className:"m-0 text-sm font-medium text-destructive",children:"The projects could not be refreshed"}),s.jsx("p",{className:"m-0 text-sm",children:s1(m.refusal,i)}),s.jsx("div",{children:s.jsx("button",{type:"button",className:Tx,onClick:o,disabled:c,children:"Retry"})})]}),(a||n)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"search","aria-label":"Filter projects",placeholder:"Filter projects",value:d,onChange:j=>f(j.target.value),className:`h-9 w-full max-w-sm rounded-md border border-input bg-transparent px-3 font-[inherit] text-sm text-foreground placeholder:text-muted-foreground ${tp}`}),!m&&s.jsx("button",{type:"button",className:`${Tx} ml-auto`,onClick:o,disabled:c||n,children:"Refresh"})]}),l&&!l.shown&&i&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`Showing the list read at ${kl(i)}; reading again in ${l.retryInSeconds??10} seconds.`})]}),n?s.jsx(j4,{}):a&&s.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:s.jsxs("table",{className:"w-full border-collapse text-sm",children:[s.jsx("thead",{className:"border-b border-border text-left text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Name"}),s.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Location"}),s.jsx("th",{scope:"col",className:"h-10 px-3",children:s.jsx("span",{className:"sr-only",children:"Where this viewer runs"})})]})}),s.jsxs("tbody",{children:[x.map(j=>s.jsxs("tr",{className:"border-b border-border last:border-0",children:[s.jsx("td",{className:"px-3 py-2",children:s.jsx(t,{href:e(`/proj/${encodeURIComponent(j.id)}`),className:np,children:j.name})}),s.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:j.location??Oc}),s.jsx("td",{className:"px-3 py-2 text-right",children:j.current&&s.jsx("span",{className:"inline-flex items-center rounded-md border border-border px-2 py-0.5 text-xs font-medium",children:"This repository"})})]},j.id)),x.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:3,className:"px-3 py-6 text-center text-muted-foreground",children:"No projects found."})})]})]})})]})}function i1({title:e,children:t}){const{href:n,Link:a}=kt();return s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex max-w-xl flex-col gap-2 rounded-xl border border-border bg-card p-6 text-card-foreground",children:[s.jsx("h1",{className:ep,children:e}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:t}),s.jsx("div",{children:s.jsx(a,{href:n("/"),className:`text-sm ${np}`,children:"Back to the organization's Home"})})]})})}const w4={tasks:"Tasks",issues:"Issues",releases:"Releases"};function ah({project:e}){const{href:t,Link:n}=kt(),{org:a,projects:r,loading:l,domains:i}=Qn(),o=r==null?void 0:r.find(c=>c.id===e);return l?s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:Nu}):r?o?s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:ep,children:o.name}),s.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??Oc})]}),o.current?i.length>0?s.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0 text-sm",children:i.map(c=>s.jsx("li",{children:s.jsx(n,{href:t(c==="tasks"?`${a?`/org/${a.slug}`:""}/tasks`:`/proj/${encodeURIComponent(o.id)}/${c}`),className:np,children:w4[c]})},c))}):s.jsx("p",{className:"m-0 max-w-2xl text-sm text-muted-foreground",children:"Tasks, issues and Releases are read by the SoftwareDLC coordination engine, which this repository does not have."}):s.jsx("p",{className:"m-0 max-w-2xl text-sm text-muted-foreground",children:`This viewer reads ${o.name}'s tasks, issues and Releases only from its own checkout: open it with sdlc viewer there.`})]}):s.jsx(i1,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):s.jsx(Pi,{})}const ap=e=>e instanceof Error?e.message:String(e);async function sp(){try{const e=await fetch("api/threads",{cache:"no-store"});return e.status===404?{none:!0}:e.ok?{data:await e.json()}:{error:await e.text()||`HTTP ${e.status}`}}catch(e){return{error:ap(e)}}}async function _4(){var e;try{const t=await fetch("api/release-links?threads",{cache:"no-store"});if(!t.ok)return null;const n=await t.json(),a=(e=n==null?void 0:n.panel)==null?void 0:e.threads;if(!a||typeof a!="object"||Array.isArray(a))return null;const r={};for(const[l,i]of Object.entries(a)){const o=(Array.isArray(i)?i:[]).filter(c=>!!c&&typeof c.planned_release=="string"&&typeof c.name=="string"&&typeof c.level=="string");o.length&&(r[l]=o)}return r}catch{return null}}async function N4(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function S4(){try{const e=await fetch("api/sessions",{cache:"no-store"});if(!e.ok)return null;const t=await e.json();return!t||typeof t.idle_over!="number"||!Array.isArray(t.sessions)?null:{idle_over:t.idle_over,memory_mb:Number(t.memory_mb)||0,sessions:t.sessions}}catch{return null}}async function k4(){try{const e=await fetch("api/sessions-release",{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:"{}"});if(!e.ok)return{error:await e.text()||`HTTP ${e.status}`};const t=await e.json();return{done:{released:t.released??[],kept:t.kept??[]}}}catch(e){return{error:ap(e)}}}async function C4(e,t){try{const n=await fetch("api/pin",{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,on:t})});return n.ok?null:await n.text()||`HTTP ${n.status}`}catch(n){return ap(n)}}const T4={probe:{source:async()=>{const e=await sp();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},rp={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...a})=>s.jsx("a",{href:e,className:t,...a,children:n})},E4={label:"Local viewer",can:()=>!1};function R4(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),s.jsx("div",{className:"app-ui dark",children:s.jsx(Gb,{data:T4,router:rp,identity:E4,children:s.jsx(Rk,{})})})}const A4="This repository's local planning workspaces: which workspace each forked from, what this checkout's workspace may change, and the integrations and Handoffs between them. This page only reads them; sdlc workspace and sdlc integrate change them.",M4=3e4,O4="Reading the workspaces. On a plan workspace this can take a few minutes.",D4="The read failed. Details are in the terminal running sdlc viewer.",z4={active:{label:"Active",tone:"success"},closed:{label:"Closed",tone:"neutral"},clean:{label:"Clean",tone:"success"},dirty:{label:"Uncommitted changes",tone:"warning"},unreadable:{label:"Unreadable",tone:"error"},queued:{label:"Queued",tone:"info"},integrated:{label:"Integrated",tone:"success"},reconciled:{label:"Reconciled",tone:"success"},stale_head:{label:"Retrying",tone:"warning"},current:{label:"Current",tone:"neutral"},blocked_conflict:{label:"Blocked: conflict",tone:"warning"},blocked_validation:{label:"Blocked: validation error",tone:"warning"},ready:{label:"Ready",tone:"success"},applied:{label:"Applied",tone:"success"},stale_base:{label:"Stale base",tone:"warning"},applied_recovery_required:{label:"Needs recovery",tone:"warning"},unavailable:{label:"Unavailable",tone:"warning"},needs_attention:{label:"Needs attention",tone:"warning"}},$4=e=>z4[e]??{label:e,tone:"neutral"},Va=e=>e.slice(0,8),o1={human:"Human",ai:"AI"},sh=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function L4(){const e=os().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function U4(e){const t=L4(),[n,a]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(!1),f=u.useRef(null),h=u.useCallback(()=>{if(f.current)return f.current;const b=(async()=>{const g=await t.overview();g.ok?(a(g.data),l(null),o(!1)):(l(g.refusal),o(!0))})().finally(()=>{f.current=null});return f.current=b,b},[t]);u.useEffect(()=>{h()},[h]),Rc(()=>void h(),M4),u.useEffect(()=>{var b;d.current&&(n||r)&&(d.current=!1,(b=c.current)==null||b.focus())},[n,r]);const m=()=>{d.current=!0,h()},x=n===null&&r===null,j=n===null&&r!==null,y=n?H4(n,i):null;return s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(Kn,{title:"Workspaces",description:A4,actions:s.jsxs(s.Fragment,{children:[y?s.jsx("p",{className:"text-muted-foreground text-xs",children:y}):null,s.jsxs(I,{type:"button",variant:"outline",size:"sm","aria-disabled":x||void 0,"aria-describedby":x?"workspaces-reading":void 0,className:"gap-2",onClick:x?void 0:()=>void h(),children:[s.jsx(om,{className:"size-4","aria-hidden":"true"}),"Read again"]}),x?s.jsx("span",{id:"workspaces-reading",className:"sr-only",children:"Reading…"}):null,s.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n?c1(n,i):""})]})}),s.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[x?s.jsx(B4,{}):null,j&&r?s.jsx(q4,{refusal:r,on_retry:m}):null,n?s.jsx(G4,{overview:n}):null]})]})}function c1(e,t){var n,a;return t||((n=e.stale)==null?void 0:n.reason)==="failed"?"a newer read failed":((a=e.stale)==null?void 0:a.reason)==="running"?"a newer read is still running":""}function H4(e,t){const n=`Read at ${In(new Date(e.read_at).toISOString())}`,a=c1(e,t);return a?`${n} · ${a}`:n}function B4(){return s.jsxs("div",{className:"mt-6",children:[s.jsx("div",{className:"grid gap-2",role:"status","aria-label":"Loading workspaces",children:Array.from({length:6},(e,t)=>s.jsx(Nt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))}),s.jsx("p",{className:"text-muted-foreground mt-3 text-sm","aria-live":"polite",children:O4})]})}function q4({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?s1(e,null):D4;return s.jsxs(de,{variant:"destructive",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Could not read workspaces"}),s.jsxs(oe,{children:[s.jsx("p",{children:n}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function G4({overview:e}){const{counts:t}=e,n=[sh(t.workspaces,"workspace"),`${t.active} active`,`${t.queued} queued`,`${t.blocked} blocked`].join(" · ");return s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status","aria-live":"polite",children:n}),s.jsxs("div",{className:"mt-4 grid gap-4 lg:grid-cols-[1.4fr_1fr]",children:[s.jsx(_o,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:s.jsx(I4,{rows:e.workspaces})}),s.jsx(_o,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:s.jsx(V4,{authority:e.authority})})]}),s.jsx(_o,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?s.jsx(Ex,{children:"No integration or reconciliation attempts yet."}):s.jsx(P4,{rows:e.activity})}),s.jsx(_o,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?s.jsx(Ex,{children:"No Handoffs prepared yet."}):s.jsx(X4,{rows:e.handoffs})})]})}function _o({id:e,title:t,caption:n,className:a,children:r}){return s.jsxs("section",{"aria-labelledby":e,className:F("min-w-0",a),children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-baseline gap-x-2",children:[s.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),r]})}const Ex=({children:e})=>s.jsx("p",{className:"text-muted-foreground text-sm",children:e}),Dc=({children:e,tone:t})=>s.jsx("div",{className:F("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function di({status:e}){const t=$4(e);return s.jsx(Ve,{variant:t.tone,children:t.label})}function Su({label:e,children:t}){return s.jsx(St,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function I4({rows:e}){return s.jsx(Su,{label:"Workspaces",children:s.jsxs(lt,{containerClassName:"overflow-visible",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Workspace"}),s.jsx(X,{children:"Actor"}),s.jsx(X,{children:"Forked from"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Projection"})]})}),s.jsx(it,{children:e.map(t=>s.jsxs(xe,{"data-testid":"workspaces-row",children:[s.jsxs(V,{children:[s.jsx("div",{className:"font-mono font-medium",children:t.short_id}),s.jsx(Dc,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&s.jsx(Dc,{children:t.projection_error})]}),s.jsx(V,{children:o1[t.actor]}),s.jsx(V,{children:t.source_id?s.jsx("span",{className:"font-mono",children:Va(t.source_id)}):s.jsx("span",{className:"text-muted-foreground",children:"No source"})}),s.jsx(V,{children:s.jsx(di,{status:t.status})}),s.jsx(V,{children:s.jsx(di,{status:t.projection})})]},t.id))})]})})}function V4({authority:e}){const t=e.resolver,n=[["Workspace",s.jsx("span",{className:"font-mono",children:Va(e.workspace_id)},"id")],["Actor",o1[e.actor]],["Own head","Writes it"]];return e.source_head==="handoff_only"&&n.push(["Source head","Only through a Handoff"]),n.push(["Git refs","Read only"]),n.push(["Remotes",e.remotes>0?`${e.remotes} named ${e.remotes===1?"remote":"remotes"}`:s.jsx("span",{className:"text-muted-foreground",children:"None"},"none")]),n.push(["Push to remotes",e.push==="human_only"?"Only a person":"Not allowed"]),n.push(["Resolver",t.state==="not_configured"?s.jsx("span",{className:"text-muted-foreground",children:"Not configured"},"resolver"):s.jsx(di,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),s.jsx(Su,{label:"Authority and resolver",children:s.jsx(lt,{containerClassName:"overflow-visible",children:s.jsx(it,{children:n.map(([a,r])=>s.jsxs(xe,{children:[s.jsx(X,{scope:"row",className:"text-muted-foreground font-normal",children:a}),s.jsx(V,{children:r})]},a))})})})}function Y4(e){const t=[e.merge_attempts?sh(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?sh(e.resolver_attempts,"resolver attempt"):null].filter(Boolean);if(t.length)return t.join(" · ");const n=e.kind==="reconciliation"?"No resolver attempts":"No merge attempts yet";return s.jsx("span",{className:"text-muted-foreground",children:n})}function P4({rows:e}){return s.jsx(Su,{label:"Integration activity",children:s.jsxs(lt,{containerClassName:"overflow-visible",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"Change"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Attempts"}),s.jsx(X,{children:"Updated"})]})}),s.jsx(it,{children:e.map((t,n)=>s.jsxs(xe,{children:[s.jsxs(V,{children:[s.jsx("div",{className:"font-medium",children:t.kind==="integration"?`Integrate ${Va(t.child_id)} into ${Va(t.other_id)}`:`Reconcile ${Va(t.child_id)} from ${Va(t.other_id)}`}),s.jsx(Dc,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),s.jsx(V,{children:s.jsx(di,{status:t.status})}),s.jsx(V,{children:Y4(t)}),s.jsx(V,{children:$_(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function X4({rows:e}){return s.jsx(Su,{label:"Handoffs",children:s.jsxs(lt,{containerClassName:"overflow-visible",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{children:"From"}),s.jsx(X,{children:"To"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Pinned"})]})}),s.jsx(it,{children:e.map(t=>s.jsxs(xe,{children:[s.jsxs(V,{children:[s.jsx("div",{className:"font-mono font-medium",children:Va(t.child_id)}),t.error?s.jsx(Dc,{children:t.error}):null]}),s.jsx(V,{className:"font-mono",children:Va(t.source_id)}),s.jsx(V,{children:s.jsx(di,{status:t.status})}),s.jsx(V,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const Rx="This machine's worktrees of this repository.",K4="Merge sends one whose thread is at rest to the main queue.",Q4=3e4,Z4=3e3,F4=6e5,Od=[{id:"all",label:"All",empty:"worktree"},{id:"needs",label:"Needs landing",empty:"worktree needing landing"},{id:"orphan",label:"No thread to land it",empty:"worktree with no thread to land it"},{id:"queued",label:"In a queue",empty:"queued worktree"},{id:"landed",label:"Landed",empty:"landed worktree"},{id:"decide",label:"Yours to decide",empty:"worktree yours to decide"}],vl={not_landed:{label:"Not landed",tone:"neutral"},main:{label:"On main",tone:"success"},production:{label:"In production",tone:"success"},queued:{label:"Main queue",tone:"info"},needs_you:{label:"Needs you",tone:"warning"}},W4="no thread to land it",lp="its thread waits on you",u1="its thread is done",d1="its thread is retired",ip=e=>e.archivable&&e.cleanup==="user",J4=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",e3=e=>!e.merge.offered&&(e.merge.why===u1||e.merge.why.startsWith(d1)),op=e=>!e.merge.offered&&e.merge.why===W4||e3(e),Dd=(e,t)=>t==="all"?!0:t==="decide"?ip(e):(e.landed!==null?"landed":J4(e)?"queued":op(e)?"orphan":"needs")===t,t3=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!op(e);function Go(e){return e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${Math.round(e/1e6)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function f1(e){const t=e%100,n=t>=11&&t<=13?"th":{1:"st",2:"nd",3:"rd"}[e%10]??"th";return`${e}${n}`}function n3(e){if(e===null)return"No commits";if(e<1)return"Today";const t=Math.floor(e);return t===1?"1 day ago":`${t} days ago`}const zd=e=>In(new Date(e*1e3).toISOString()),Cl=e=>e.charAt(0).toUpperCase()+e.slice(1);function a3(e,t){var r;const n=t.phase?Cl(t.phase):"No phase",a=e.merge;if(!a.offered&&a.why.startsWith(d1)){const l=(r=/; (.+) continues it$/.exec(a.why))==null?void 0:r[1];return l?`Retired · continued by ${l}`:"Retired"}return t.phase==="done"||!a.offered&&a.why===u1?e.landed===null?"Done · without landing this":"Done":a.offered?`${n} · at rest`:a.why.startsWith("its thread is at work")?`${n} · at work`:a.why===lp?`${n} · waits on you`:a.why.startsWith("its session is not running")?`${n} · session not running`:n}function s3(){const e=os().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function r3({org:e}){var L,K;const t=s3(),[n,a]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(null),[c,d]=u.useState(!1),[f,h]=u.useState("all"),[m,x]=u.useState(""),[j,y]=u.useState({}),b=u.useRef({}),{confirm:g,confirm_dialog:p}=Jr(),v=u.useRef(!1),w=u.useCallback(async()=>{if(v.current)return;v.current=!0;const $=await t.list();v.current=!1,$.ok?(a($.data),l(null)):l($.refusal)},[t]),_=u.useCallback(async()=>{const $=await t.sizes();d(!$.ok),$.ok&&o($.data)},[t]);u.useEffect(()=>{w(),_()},[w,_]);const S=(n==null?void 0:n.rows.some($=>{var Y,ne;return((Y=$.write)==null?void 0:Y.state)==="waiting"||((ne=$.write)==null?void 0:ne.state)==="running"}))??!1;Rc(()=>void w(),S?Z4:Q4),Rc(()=>void _(),F4);const N=(n==null?void 0:n.rows)??[],k=$=>i==null?void 0:i.sizes[$.path],R=N.filter(ip),M=i?R.reduce(($,Y)=>$+(k(Y)??0),0):null,z=N.length===0?Rx:`${Rx} ${K4}${R.length?` ${R.length} ${R.length===1?"is":"are"} yours to decide${M!==null?`: removing them frees about ${Go(M)}`:""}.`:""}`,U=m.trim().toLowerCase(),C=$=>!U||[$.name,$.path,$.branch??"",...$.threads.map(Y=>Y.title??Y.thread)].some(Y=>Y.toLowerCase().includes(U)),D=N.filter($=>Dd($,f)&&C($)).sort(($,Y)=>{if(f==="decide")return(k(Y)??0)-(k($)??0);const ne=P=>t3(P)?P.merge.offered?0:1:2;return ne($)-ne(Y)||($.idle_days??1/0)-(Y.idle_days??1/0)}),G=async($,Y)=>{const ne=await($==="merge"?t.merge(Y.path):t.remove(Y.path));ne.ok?y(({[Y.path]:P,...ye})=>ye):y(P=>({...P,[Y.path]:ne.refusal.message})),await w()},E=async $=>{if(!$.merge.offered)return;const Y=$.threads.find(ee=>ee.thread===($.merge.offered&&$.merge.thread)),ne=(Y==null?void 0:Y.title)??$.merge.thread,P=Y!=null&&Y.holds.length?`has ${Y.holds.length} open hold(s) (${Y.holds.join(", ")})`:"has no open holds",ye=$.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${$.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",te=$.merge.caveat?`
351
+
352
+ Its session could not be read: ${$.merge.caveat}. A turn it does not start passes on.`:"";await g({title:`Send ${$.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${ne}, which ${P} and is told of the join. The queue checks the branch first, and ${ye}. Nothing reaches main before then.${te}`,action_label:"Join the main queue"})&&await G("merge",$)},B=async $=>{const Y=k($);await g({title:`Remove ${$.name}?`,description:`This deletes the folder ${$.path}${Y!==void 0?` and frees about ${Go(Y)}`:""}.${$.branch?` Its branch ${$.branch} stays, so its work can be checked out again,`:""} and its task records are saved first; a landed plan workspace in it is closed. It stays with you because ${$.cleanup_why[0]??"the Local systems manager leaves it to you"}. The worktree is checked again just before, and nothing is deleted if that check finds work in it.`,action_label:"Remove worktree",destructive:!0})&&(Y!==void 0&&(b.current[$.path]=Y),await G("remove",$))},T=async $=>{await t.dismiss($),await w()};return s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(Kn,{title:"Worktrees",description:z}),!n&&!r&&s.jsx(l3,{}),r?s.jsx(i3,{refusal:r,read_at:n==null?void 0:n.read_at,on_retry:()=>void w()}):null,n!=null&&n.stale?s.jsxs(de,{variant:"destructive",className:"mt-4",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Could not read worktrees"}),s.jsxs(oe,{children:[s.jsxs("p",{children:[n.stale.message," This list was read at ",In(new Date(n.read_at).toISOString()),"."]}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void w(),children:"Retry"})]})]}):null,n==null?void 0:n.removals.map($=>s.jsxs(de,{variant:"success",className:"mt-4",role:"status",children:[s.jsx(je,{children:b.current[$.path]!==void 0?`Removed ${$.name} and freed ${Go(b.current[$.path])}`:`Removed ${$.name}`}),s.jsxs(oe,{children:[s.jsx("p",{children:$.branch?`Its branch ${$.branch} stays, and its records were saved.`:"Its records were saved."}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void T({removal:$.path}),children:"Dismiss"})]})]},$.path)),n&&N.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Kb,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Only the main checkout"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"No other worktrees. Agents make theirs in .sdlc-worktrees beside the main checkout."})]}):n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[s.jsx(xn,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:m,onChange:$=>x($.target.value)}),s.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",In(new Date(n.read_at).toISOString())," · rereads every 30 s"]})]}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Worktree state",children:Od.map($=>s.jsxs(I,{type:"button",variant:"outline",size:"sm",className:Bo,"aria-pressed":f===$.id,onClick:()=>h($.id),children:[$.label," ",N.filter(Y=>Dd(Y,$.id)).length]},$.id))}),D.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Jb,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),U?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(L=Od.find($=>$.id===f))==null?void 0:L.empty," matches “",m,"”. Clear the search to see all"," ",N.filter($=>Dd($,f)).length,"."]}),s.jsx(I,{type:"button",variant:"outline",onClick:()=>x(""),children:"Clear search"})]}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(K=Od.find($=>$.id===f))==null?void 0:K.empty," right now."]})]}):s.jsx(St,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(lt,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[s.jsx(yt,{children:s.jsxs(xe,{children:[s.jsx(X,{className:"w-[24%]",children:"Worktree"}),s.jsx(X,{className:"w-[24%]",children:"Threads"}),s.jsx(X,{className:"w-[12%]",children:"Landed"}),s.jsx(X,{className:"w-[18%]",children:"Cleanup"}),s.jsx(X,{className:"hidden w-[10%] md:table-cell",children:"Last commit"}),s.jsx(X,{className:"w-[12%] text-right",children:"Actions"})]})}),s.jsx(it,{children:D.map($=>s.jsx(o3,{org:e,row:$,size:k($),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:j[$.path],on_merge:()=>void E($),on_remove:()=>void B($),on_dismiss:Y=>void T(Y),on_clear_sent:()=>y(({[$.path]:Y,...ne})=>ne)},$.path))})]})})]}):null,p]})}function l3(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading worktrees",children:Array.from({length:6},(e,t)=>s.jsx(Nt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function i3({refusal:e,read_at:t,on_retry:n}){return e.reason==="engine_missing"?s.jsxs(de,{variant:"info",className:"mt-6",children:[s.jsx(Bn,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Worktrees needs a SoftwareDLC checkout"}),s.jsx(oe,{children:"sdlc viewer reads worktrees with the view code of a SoftwareDLC checkout, and this repository has none. Set SDLC_VIEW_ROOT to one, then restart sdlc viewer."})]}):e.reason==="view_outdated"?s.jsxs(de,{variant:"warning",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"The main checkout's view code is too old for Worktrees"}),s.jsx(oe,{children:"Update the main checkout, then restart sdlc viewer."})]}):s.jsxs(de,{variant:"destructive",className:"mt-6",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"Could not read worktrees"}),s.jsxs(oe,{children:[s.jsxs("p",{children:[e.message,t?` This list was read at ${In(new Date(t).toISOString())}.`:""]}),s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function No({children:e,muted:t=!0}){return s.jsx("div",{className:F("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function o3({org:e,row:t,size:n,sizes:a,can_write:r,sent:l,on_merge:i,on_remove:o,on_dismiss:c,on_clear_sent:d}){const{href:f,Link:h}=kt(),m=e?`/org/${encodeURIComponent(e)}`:"",x=f(`${m}/threads`),j=f(`${m}/tasks`),y=vl[t.landed??"not_landed"],b=ip(t),g=t.write,p=(g==null?void 0:g.state)==="waiting"||(g==null?void 0:g.state)==="running",v=t.threads.find(z=>"thread"in t.merge&&z.thread===t.merge.thread)??t.threads[0],w=t.merge,_=!w.offered&&w.why===lp,S=r&&t.landed===null&&!t.queue&&!_&&!op(t),N=n!==void 0?Go(n):a==="measuring"?"Measuring size…":a==="failed"?"Size could not be read":null,k=b?{label:"Yours to decide",muted:!1,second:[N,t.cleanup_why[0]]}:t.archivable?{label:"The manager removes it",muted:!1,second:[N]}:{label:"Stays",muted:!0,second:[N,t.why[0]??null]},R=k.second.filter(Boolean).join(" · "),M=t.path.slice(0,t.path.length-t.name.length-1)||".";return s.jsxs(s.Fragment,{children:[s.jsxs(xe,{"data-testid":"worktrees-row",children:[s.jsxs(V,{children:[s.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),s.jsx(No,{children:t.branch??"Detached"}),M!==".sdlc-worktrees"?s.jsx(No,{children:`in ${M}`}):null]}),s.jsx(V,{children:v?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate",title:v.title??v.thread,children:v.title??v.thread}),s.jsx(No,{children:`${a3(t,v)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):s.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),s.jsx(V,{children:s.jsx(Ve,{variant:y.tone,children:y.label})}),s.jsxs(V,{children:[s.jsx("div",{className:F("truncate",k.muted&&"text-muted-foreground"),children:k.label}),R?s.jsx("div",{className:"hidden md:block",children:s.jsx(No,{children:R})}):null]}),s.jsx(V,{className:"hidden md:table-cell",children:n3(t.idle_days)}),s.jsx(V,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[p?s.jsx(I,{type:"button",variant:"outline",size:"sm",loading:!0,disabled:!0,children:(g==null?void 0:g.kind)==="merge"?g.state==="waiting"?"Waiting to join…":"Joining main…":(g==null?void 0:g.state)==="waiting"?"Waiting to remove…":"Removing…"}):t.queue?s.jsx(Ve,{variant:vl.queued.tone,children:`${vl.queued.label} · ${f1(t.queue.position)}`}):_?s.jsx(h,{href:j,"aria-label":`${t.name}: its thread waits on you, in Waiting on you`,children:s.jsx(Ve,{variant:vl.needs_you.tone,children:vl.needs_you.label})}):S?s.jsx(I,{type:"button",variant:"outline",size:"sm",title:w.offered?void 0:w.why,"aria-disabled":!w.offered||void 0,className:F(!w.offered&&"cursor-not-allowed opacity-50"),"aria-label":`Send ${t.name} to the main queue`,"aria-describedby":w.offered?void 0:`why-${t.name}`,onClick:w.offered?i:void 0,children:"Merge"}):null,b&&r&&!p?s.jsx(I,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),s.jsx(c3,{row:t,threads:x,tasks:j,merge_shown:S,sent:l,on_dismiss:c,on_clear_sent:d})]})}function c3({row:e,threads:t,tasks:n,merge_shown:a,sent:r,on_dismiss:l,on_clear_sent:i}){var j,y,b,g;const{Link:o}=kt(),c=(p="Open in Threads")=>s.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:p}),d=p=>s.jsx(I,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:p,children:"Dismiss"}),f=e.write,h=e.threads.find(p=>p.thread===("thread"in e.merge?e.merge.thread:void 0))??e.threads[0],m=(h==null?void 0:h.title)??"Its thread";let x=null;if(r)x=s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:"It was not sent"}),s.jsxs(oe,{children:[s.jsx("p",{children:r}),d(i)]})]});else if((f==null?void 0:f.state)==="waiting")x=s.jsxs("p",{className:"text-muted-foreground text-sm",role:"status",children:["Another worktree's write runs first; ",e.name," ",f.kind==="merge"?"joins":"is removed"," next."]});else if((f==null?void 0:f.state)==="running")x=s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:f.kind==="merge"?`Joining the main queue for ${e.name}. The queue checks its branch first; this can take a few minutes.`:`Removing ${e.name}. It is checked again first.`});else if((f==null?void 0:f.state)==="joined"){const p=((j=f.lands)==null?void 0:j.by)==="manager"?`the merge manager, ${f.lands.manager}, lands it`:"it lands it on its turn";x=s.jsxs(de,{variant:f.told?"success":"warning",role:"status",children:[s.jsx(je,{children:`${e.name} joined the main queue, ${f1(f.position)}`}),s.jsxs(oe,{children:[s.jsx("p",{children:f.told?`${m} was left a notice, and ${p}.`:"Its thread could not be told, so it does not know its turn is coming. Tell it from Threads; the join itself is unchanged."}),((y=e.queue)==null?void 0:y.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?s.jsx("p",{children:`It is first in the main queue. Its thread was left a notice but not woken: continue it in its session, or the turn passes on at ${zd(e.queue.passes_at)}.`}):null,s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),!f.told||((b=e.queue)==null?void 0:b.position)===1?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(f&&(f.state==="refused"||f.state==="failed")){const p=f.kind==="merge"?`The main queue refused ${e.name}`:`${e.name} was not removed`;x=s.jsxs(de,{variant:"destructive",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:p}),s.jsxs(oe,{children:[s.jsx("p",{children:`${Cl(f.message)}${f.kind==="merge"?" Nothing was queued.":" Nothing was deleted."}`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),f.kind==="merge"?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(e.last_turn){const p=e.last_turn;x=s.jsxs(de,{variant:"warning",children:[s.jsx(tt,{className:"size-4","aria-hidden":"true"}),s.jsx(je,{children:`${e.name}'s turn ${p.outcome==="failed"?"failed":"passed on"} at ${zd(p.left_at)}`}),s.jsxs(oe,{children:[s.jsx("p",{children:`${Cl(p.reason)}. Continue the thread in its session; Merge sends it again once it is at rest.`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({turn:{execution:p.execution,left_at:p.left_at}})),s.jsx("span",{className:"mt-2",children:c()})]})]})]})}else((g=e.queue)==null?void 0:g.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?x=s.jsxs("p",{className:"text-sm",role:"status",children:[`Its turn now: ${e.name} is first in the main queue. Continue its thread in its session, or the turn passes on at ${zd(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===lp?x=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:["Its thread waits on you. Merge comes back once you answer it. ",s.jsx(o,{className:"text-primary hover:underline",href:n,children:"In Waiting on you"})]}):!e.merge.offered&&e.merge.successor&&!e.queue&&e.landed===null?x=s.jsx("p",{className:"text-sm",children:c("Open its successor in Threads")}):a&&!e.merge.offered?x=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:[`${Cl(e.merge.why)}. `,e.merge.thread&&!e.merge.why.startsWith("its thread is at work")?c():null]}):e.merge.offered&&e.merge.caveat&&(x=s.jsx("p",{className:"text-muted-foreground text-sm",children:`${Cl(e.merge.caveat)}.`}));return x?s.jsx(xe,{className:"hover:bg-transparent",children:s.jsx(V,{colSpan:6,className:"pt-0",children:x})}):null}const u3=["reason","since","store","repository","folder","home","member_path"];function h1(e,t){const n={status:e,message:typeof(t==null?void 0:t.error)=="string"?t.error:"The read failed; see the sdlc viewer terminal."};(t==null?void 0:t.retry)===!0&&(n.retry=!0),typeof(t==null?void 0:t.retry_after)=="number"&&(n.retry_after=t.retry_after);for(const a of u3){const r=t==null?void 0:t[a];typeof r=="string"&&(n[a]=r)}return n}function rl({base:e="",fetcher:t=fetch}){return async(n,a={})=>{const r=new URLSearchParams;for(const[c,d]of Object.entries(a))d!==void 0&&r.set(c,String(d));const l=r.size>0?`?${r.toString()}`:"";let i;try{i=await t(`${e}api/app/${n}${l}`,{cache:"no-store"})}catch{return{ok:!1,refusal:{status:0,message:"The viewer did not answer. Is sdlc viewer still running?"}}}const o=await i.json().catch(()=>null);return i.ok?{ok:!0,data:o}:{ok:!1,refusal:h1(i.status,o)}}}function d3(e={}){const t=rl(e),n=r=>async()=>{const l=await t("access");return l.ok?{ok:!0,data:l.data[r]}:l},a=encodeURIComponent;return{tasks:{access:n("tasks"),configuration:()=>t("tasks/configuration"),listTasks:r=>t(`tasks/lists/${a(r)}/tasks`),task:r=>t(`tasks/tasks/${a(r)}`)},issues:{access:n("issues"),list:(r={})=>t("issues",r),issue:r=>t(`issues/${a(r)}`)},releases:{access:n("releases"),list:()=>t("releases"),release:r=>t(`releases/${a(r)}`),candidate:()=>t("releases/candidate")},organizations:{access:n("organizations"),list:()=>t("orgs")},projects:{access:n("projects"),list:()=>t("projects")},about:{about:()=>t("about")}}}function f3(e={}){const t=rl(e);return{listQueues:()=>t("queues"),queue:n=>t(`queues/${encodeURIComponent(n)}`),members:async()=>({ok:!0,data:[]}),refresh_ms:15e3,settings_note:"Local queue settings are the engine's built-in policies. Turns change through promote.",thread_subjects:!0,description:"Where this checkout's threads take turns: landing on main, deploying to staging, publishing and accepting the graph.",read_scope:"this checkout only",subject_label:"Thread"}}const Tl=e=>({ok:!1,refusal:{status:0,message:e}});function m1({base:e="",fetcher:t=fetch}){return async(n,a)=>{let r;try{r=await t(`${e}api/${n}`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch{return Tl("The viewer did not answer. Is sdlc viewer still running?")}const l=await r.json().catch(()=>null);return r.ok?{ok:!0,data:l}:{ok:!1,refusal:h1(r.status,l)}}}function h3(e={}){const t=rl(e),n=m1(e);return{chart:()=>t("org"),change:a=>n("org-change",a)}}function m3(e={}){const t=rl(e),n=o=>`tasks/tasks/${encodeURIComponent(o)}`,{base:a="",fetcher:r=fetch}=e;return{access:async()=>{const o=await t("access");return o.ok?{ok:!0,data:o.data.tasks}:o},availability:async()=>{const o=await t("tasks/configuration");if(!o.ok)return o.refusal.reason==="engine_missing"?{state:"off",refusal:o.refusal}:{state:"error",refusal:o.refusal};const c=o.data;if(c.state!=="active")return{state:"available"};const d=c.workspaces.find(h=>h.is_default)??c.workspaces[0],f=d==null?void 0:d.lists[0];return!d||!f?{state:"error"}:{state:"active",configuration:c,workspace:d,list:f}},listTasks:(o,c={})=>c.state==="archived"?Promise.resolve(Tl("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve(Tl("Assigned to you is a status group here.")):t(`tasks/lists/${encodeURIComponent(o)}/tasks`,{search:c.search,owner:c.owner===""?"none":c.owner,group:c.group,urgent:c.urgent?"true":void 0,over_estimate:c.over_estimate?"true":void 0}),members:()=>t("tasks/members"),waitingOnYou:()=>t("tasks/waiting-on-you"),task:o=>t(n(o)),taskSections:o=>t(`${n(o)}/sections`),taskRelated:o=>t(`${n(o)}/related`),hierarchyRevision:async()=>({ok:!0,data:0}),commands:{run:async()=>Tl("The local viewer changes tasks only with Done."),complete:async o=>{const c="task"in o?{task:o.task}:{hold:o.hold};let d;try{d=await r(`${a}api/task-done`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}catch{return Tl("The viewer did not answer. Is sdlc viewer still running?")}if(d.ok)return{ok:!0,data:null};const f=await d.text().catch(()=>"");return{ok:!1,refusal:{status:d.status,message:f||`It was not recorded (HTTP ${d.status}).`}}}}}}function p3(e={}){const t=rl(e),n=m1(e);return{list:()=>t("worktrees"),sizes:()=>t("worktree-sizes"),merge:a=>n("worktree-merge",{path:a}),remove:a=>n("worktree-remove",{path:a}),dismiss:a=>n("worktree-dismiss",a)}}function g3(e={}){const t=rl(e);return{overview:()=>t("workspaces")}}const x3=15e3,v3=10,Ax="idle-sessions-list",Mx="idle-sessions-heading",Ox="idle-sessions-confirm-text";function p1(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const y3=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,g1=e=>e===1?"1 session":`${e} sessions`;function b3(e){const t=e.released.length?`Closed ${g1(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function j3({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${y3(e.idle_hours)}`,p1(e.memory_mb)].filter(Boolean).join(" · ");return s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:e.title}),s.jsxs("p",{className:"caption",children:[s.jsxs("span",{className:"muted",children:[t,e.unfinished&&" ·"]}),e.unfinished&&s.jsx("span",{className:"idle-unfinished",children:" unfinished work"})]})]})}function w3(){const[e,t]=u.useState(null),[n,a]=u.useState(!1),[r,l]=u.useState(!1),[i,o]=u.useState(null),[c,d]=u.useState(null),[f,h]=u.useState(""),m=u.useRef(""),x=u.useRef(null),j=u.useRef(null),y=u.useRef(null),b=u.useRef(null),g=u.useRef(0),p=u.useRef(0),v=u.useCallback(async()=>{const C=++g.current,D=await S4();if(!D||C<p.current)return;p.current=C,h("");const G=JSON.stringify(D);G!==m.current&&(m.current=G,t(D))},[]);u.useEffect(()=>{const C=setTimeout(v,0),D=setInterval(v,x3);return()=>{clearTimeout(C),clearInterval(D)}},[v]),u.useEffect(()=>{var D;const C=b.current;C&&(b.current=null,(D={cancel:j,close:x,dismiss:y}[C].current)==null||D.focus())});const w=(e==null?void 0:e.sessions.length)??0;if(u.useEffect(()=>{r&&!w&&i===null&&l(!1)},[r,w,i]),!w&&!c&&!f&&i===null)return null;const _=()=>{i===null&&(l(!0),b.current="cancel")},S=()=>{i===null&&(l(!1),b.current="close")},N=async()=>{if(i!==null)return;o(w),d(null),h("");const C=await k4();p.current=g.current+1,await v(),o(null),l(!1),a(!1),"error"in C?(h(`The sessions were not closed: ${C.error.replace(/\.+$/,"")}.`),b.current="close"):(d(C.done),b.current="dismiss")},k=()=>{d(null),b.current="close"},R=C=>{C.key==="Escape"&&(C.preventDefault(),S())},M=i!==null?`Closing ${g1(i)}…`:c?b3(c):"",z=(e==null?void 0:e.sessions.slice(0,v3))??[],U=w-z.length;return s.jsxs("div",{className:"idle",role:"group",...w?{"aria-labelledby":Mx}:{"aria-label":"Idle sessions"},children:[f&&s.jsx("div",{className:"alert",role:"alert",children:f}),w>0&&e&&s.jsxs("div",{className:"idle-head",children:[s.jsxs("div",{className:"idle-title",children:[s.jsxs("h2",{className:"group",id:Mx,"aria-label":`Idle sessions, ${w}`,children:["Idle sessions",s.jsx("span",{className:"count",children:w})]}),s.jsxs("p",{className:"caption muted",children:["over ",e.idle_over," h · ",p1(e.memory_mb)]})]}),s.jsxs("div",{className:"tools",children:[s.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":Ax,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>a(C=>!C),children:n?"Hide":"Show"}),s.jsx("button",{type:"button",className:"pin",ref:x,"aria-expanded":r,"aria-label":"Close idle sessions…",onClick:_,children:"Close idle…"})]})]}),w>0&&s.jsxs("ul",{className:"idle-list",id:Ax,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[z.map(C=>s.jsx(j3,{row:C},C.session)),U>0&&s.jsx("li",{children:s.jsxs("p",{className:"caption muted",children:["…and ",U," more"]})})]}),r&&w>0&&s.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":Ox,onKeyDown:R,children:[s.jsxs("p",{id:Ox,children:[w===1?"Close this session?":`Close these ${w} sessions?`," Each transcript stays, so reopening a conversation resumes it, and a thread with unfinished work goes on with Continue on its card. A session that is busy or has background work running is kept."]}),s.jsxs("div",{className:"tools start",children:[s.jsx("button",{type:"button",className:"pin","aria-disabled":i!==null?!0:void 0,"aria-busy":i!==null?!0:void 0,onClick:N,children:i!==null?`Closing ${i}…`:`Close ${w}`}),s.jsx("button",{type:"button",className:"pin",ref:j,"aria-disabled":i!==null?!0:void 0,onClick:S,children:"Cancel"})]})]}),s.jsx("p",{className:"idle-status",role:"status",children:M}),c&&s.jsxs(s.Fragment,{children:[c.kept.length>0&&s.jsx("ul",{className:"idle-list","aria-label":"Kept sessions",children:c.kept.map(C=>s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:C.title}),s.jsx("p",{className:"caption muted",children:C.why})]},C.session))}),s.jsx("div",{className:"tools start",children:s.jsx("button",{type:"button",className:"pin",ref:y,"aria-label":"Dismiss the close result",onClick:k,children:"Dismiss"})})]})]})}const Dx={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function rh(e){return e&&Object.hasOwn(Dx,e)?Dx[e]:"grey"}const _3=1e4,N3=6e4,S3=2,zx="#thread-",k3="The threads view needs a SoftwareDLC checkout (tools/vscode-threads); this repository has none.",C3={working:"▶",prod:"↑",planned:"○"};function $x({label:e,count:t,hint:n}){const a=n?`hint-${e.toLowerCase().replace(/\W+/g,"-")}`:void 0;return s.jsxs(s.Fragment,{children:[s.jsxs("h2",{className:"group","aria-label":`${e}, ${t}`,"aria-describedby":a,children:[e,s.jsx("span",{className:"count",children:t})]}),n&&s.jsx("span",{className:"sr-only",id:a,children:n})]})}function $d({text:e,role:t}){return s.jsx("span",{className:`badge tone-${rh(t)}`,children:e})}function T3({serves:e}){const t=e.slice(0,S3),n=e.length-t.length;return s.jsxs("p",{className:"caption muted serves",children:[t.map((a,r)=>s.jsxs("span",{children:[r>0&&", ",s.jsxs("a",{href:`classic/#planned=${encodeURIComponent(a.planned_release)}`,"aria-label":`serves ${a.name}, ${a.level}: open it in Planned releases`,title:"Opens in the classic view",children:["serves ",a.name," (",a.level,")"]})]},a.planned_release)),n>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{"aria-hidden":"true",children:[", +",n," more"]}),s.jsxs("span",{className:"sr-only",children:[", and ",n," more planned releases"]})]})]})}function E3({onConnection:e}){const[t,n]=u.useState(null),[a,r]=u.useState(!1),[l,i]=u.useState(""),[o,c]=u.useState(!1),[d,f]=u.useState(null),[h,m]=u.useState(""),[x,j]=u.useState(null),y=u.useRef(""),b=u.useRef(""),g=u.useRef(null),p=u.useRef(null),v=u.useRef(null),w=z=>{var U;return z instanceof HTMLButtonElement&&z.classList.contains("pin")&&((U=g.current)!=null&&U.contains(z))?z.dataset.key??null:null},_=z=>{v.current=w(z.target)},S=()=>{setTimeout(()=>{w(document.activeElement)||(v.current=null)},0)},N=u.useCallback(async()=>{const z=await sp();if("none"in z){r(!0),i(""),e("live");return}if("error"in z){i(z.error),e("disconnected");return}r(!1),i(""),m(""),e("live");const U=JSON.stringify(z.data);U!==y.current&&(y.current=U,n(z.data))},[e]);u.useEffect(()=>{let z=!0;N4().then(D=>z&&c(D));const U=setTimeout(N,0),C=setInterval(N,_3);return()=>{z=!1,clearTimeout(U),clearInterval(C)}},[N]),u.useEffect(()=>{let z=!0;const U=()=>_4().then(D=>{z&&D&&j(G=>JSON.stringify(G)===JSON.stringify(D)?G:D)});U();const C=setInterval(U,N3);return()=>{z=!1,clearInterval(C)}},[]),u.useEffect(()=>{const z=()=>{var G,E,B;const U=window.location.hash;if(!U.startsWith(zx)||U===b.current)return;let C;try{C=decodeURIComponent(U.slice(zx.length))}catch{return}const D=document.getElementById(`thread-${C}`);!D||!((G=g.current)!=null&&G.contains(D))||(b.current=U,(E=D.querySelector(".thread-title"))==null||E.focus({preventScroll:!0}),(B=D.scrollIntoView)==null||B.call(D,{block:"center"}))};return z(),window.addEventListener("hashchange",z),()=>window.removeEventListener("hashchange",z)},[t]),u.useLayoutEffect(()=>{const z=v.current??p.current;if(!z||!g.current)return;const U=document.activeElement;if(U&&U!==document.body&&!g.current.contains(U)){v.current=null;return}const C=[...g.current.querySelectorAll("button.pin")].find(D=>D.dataset.key===z);C?U!==C&&C.focus({preventScroll:z!==p.current}):v.current=null});const k=async z=>{if(d)return;const U=!z.pinned;p.current=z.key,f(z.key);const C=await C4(z.key,U);f(null),C||n(D=>D&&{...D,threads:D.threads.map(G=>G.key===z.key?{...G,pinned:U}:G)}),await N(),m(C?`The pin was not saved: ${C}`:""),p.current===z.key&&(p.current=null)},R=(t==null?void 0:t.pinnedCount)??0,M=(t==null?void 0:t.threads)??[];return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"main-head",children:[s.jsx("h1",{children:"Threads"}),t&&!a&&s.jsx("p",{className:"muted",children:t.line})]}),s.jsxs("section",{className:"card threads","aria-label":"Threads",children:[s.jsx(w3,{}),l&&s.jsxs("div",{className:"alert",role:"alert",children:["Threads unavailable: ",l.replace(/\.+$/,""),". Retrying every 10 s."]}),h&&s.jsx("div",{className:"alert",role:"alert",children:h}),a?s.jsx("p",{className:"muted",children:k3}):s.jsxs("div",{className:"thread-list",ref:g,onFocus:_,onBlur:S,children:[M.map((z,U)=>s.jsxs("div",{children:[R>0&&U===0&&s.jsx($x,{label:"Pinned",count:R,hint:"Threads you pinned; they stay first in every order"}),R>0&&U===R&&s.jsx($x,{label:"Other threads",count:M.length-R}),s.jsx(R3,{row:x!=null&&x[z.key]?{...z,serves:x[z.key]}:z,pinnable:o&&typeof z.pinned=="boolean",pinning:d,onPin:()=>k(z)})]},z.key)),t&&!M.length&&s.jsx("p",{className:"muted empty",children:"No threads at work or waiting."}),t&&t.hidden>0&&s.jsxs("p",{className:"caption muted",children:[t.hidden," older thread(s) not shown; sdlc view --all lists them."]})]})]})]})}function R3({row:e,pinnable:t,pinning:n,onPin:a}){const r=[e.agent,e.phase,e.age,e.waitsOn?`waits on ${e.waitsOn}`:""].filter(Boolean).join(" · ");return s.jsxs("article",{className:"thread",id:`thread-${e.key}`,style:{marginLeft:Math.min(e.depth*22,110)},children:[s.jsxs("div",{className:"thread-head",children:[s.jsx("p",{className:"thread-title",tabIndex:-1,children:e.title}),s.jsxs("div",{className:"tools",children:[e.carried?s.jsxs(s.Fragment,{children:[s.jsx($d,{text:e.carried,role:"waiting"}),e.carriedBatch&&s.jsx($d,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):s.jsx($d,{text:e.status,role:e.role}),t&&s.jsx("button",{type:"button",className:e.pinned?"pin on":"pin","data-key":e.key,"aria-label":e.pinned?`Unpin ${e.title}`:`Pin ${e.title} to the top`,"aria-disabled":n?!0:void 0,"aria-busy":n===e.key?!0:void 0,onClick:()=>{n||a()},children:e.pinned?"Unpin":"Pin"})]})]}),s.jsx("p",{className:"caption muted",children:r}),e.serves&&e.serves.length>0&&s.jsx(T3,{serves:e.serves}),e.summary&&s.jsx("p",{className:"caption muted",children:e.summary}),e.carriedDetail&&s.jsx("p",{className:"line",children:e.carriedDetail}),e.step&&s.jsxs("p",{className:"caption muted",children:["step: ",e.step]}),e.lines.map((l,i)=>s.jsxs("p",{className:`line tone-${rh(l.role)}`,children:[s.jsxs("span",{"aria-hidden":"true",children:[C3[l.state]??"•"," "]}),l.state==="working"&&s.jsx("span",{className:"sr-only",children:"Working: "}),l.text]},`l${i}`)),e.holds.map((l,i)=>s.jsx("p",{className:`line tone-${rh(l.role)}`,children:l.text},`h${i}`)),e.plan&&s.jsx("p",{className:"caption muted",children:e.plan})]})}const A3=5e3;function M3(){const[e,t]=u.useState([]),n=u.useRef(0),a=u.useRef(new Map),r=u.useCallback(c=>{const d=a.current.get(c);d&&clearTimeout(d),a.current.delete(c),t(f=>f.filter(h=>h.id!==c))},[]),l=u.useCallback((c,d)=>{const f=n.current+=1;t(h=>[...h.filter(m=>m.tone!=="error").slice(-2),{id:f,tone:c,message:d}]),c==="success"&&a.current.set(f,setTimeout(()=>r(f),A3))},[r]);u.useEffect(()=>{const c=a.current;return()=>{for(const d of c.values())clearTimeout(d)}},[]);const i=u.useMemo(()=>({success:c=>l("success",c),error:c=>l("error",c)}),[l]),o=s.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"pointer-events-none fixed right-4 bottom-4 z-100 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-2",children:e.map(c=>s.jsxs("div",{"data-testid":"viewer-toast",className:"bg-popover text-popover-foreground pointer-events-auto flex w-80 max-w-full items-center gap-3 rounded-md border py-2 pr-2 pl-4 text-sm shadow-lg"+(c.tone==="error"?" border-destructive":""),children:[s.jsx("span",{className:"min-w-0 flex-1 break-words",children:c.message}),s.jsx(I,{type:"button",variant:"ghost",size:"control",className:"shrink-0",onClick:()=>r(c.id),children:"Dismiss"})]},c.id))});return{notify:i,toasts:o}}const O3=e=>e instanceof Error?e.message:String(e),ku=(e,t="")=>`api/chat/${encodeURIComponent(e)}${t}`;async function Cu(e,t){try{const n=await fetch(e,{cache:"no-store",...t}),a=await n.text();let r=null;try{r=a?JSON.parse(a):null}catch{r=null}if(n.ok&&r&&typeof r=="object")return{ok:r};const l=r&&typeof r=="object"?r:{};return{failed:{status:n.status,error:typeof l.error=="string"?l.error:a||`HTTP ${n.status}`,...typeof l.reason=="string"?{reason:l.reason}:{}}}}catch(n){return{failed:{status:0,error:O3(n)}}}}async function D3(){try{const e=await fetch(ku("claude:available"),{method:"HEAD",cache:"no-store"});return e.ok?!0:e.status===404?!1:null}catch{return null}}function Lx(e,t){return Cu(ku(e,t==null?"":`?before=${t}`))}function z3(e){return Cu(ku(e,"/state"))}const Ux=50;function $3(e){return Cu(`api/chat/states?threads=${e.map(encodeURIComponent).join(",")}`)}const x1=(e,t,n)=>Cu(ku(e,`/${t}`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n})}),L3=(e,t)=>x1(e,"send",t),U3=(e,t)=>x1(e,"reopen",t),v1=/^(claude|codex):[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,H3=5e3,B3=1e4,Hx=6e4,Cr=e=>e.startsWith("codex:")?"codex":"claude",y1={claude:"Claude",codex:"Codex"},q3={claude:"Claude Code",codex:"Codex"},Tu=e=>e.where??e.worktree??"";function G3(e){return e?e.repository?e.checkout&&e.checkout!==e.repository?`${e.repository} · worktree ${e.checkout}`:e.repository:Tu(e)||null:null}const I3=(e,t)=>[e.title,e.step,e.summary,t?Tu(t):"",(t==null?void 0:t.repository)??"",(t==null?void 0:t.checkout)??""].join(" ").toLowerCase(),V3=e=>e==null?"":new Date(e*1e3).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),cp=(e,t)=>`org/${encodeURIComponent(e)}/chat${t?`/${encodeURIComponent(t)}`:""}`,Bx=(e,t)=>`org/${encodeURIComponent(e)}/threads#thread-${encodeURIComponent(t)}`,Ld="text-primary underline-offset-4 hover:underline";function Y3(e){const t=(e.provider??Cr(e.thread))==="codex";if(e.state==="continued"||e.delivery==="none")return null;if(e.state==="working")return{line:t?"Working now · Codex reads your message at its next coordination checkpoint.":"Working now · it reads your message at its next step, as a note from you in its inbox.",button:"Send",reopen:!1,off:!1};if(e.state==="waiting")return{line:t?"Waiting at its prompt · Codex reads its inbox only at a coordination checkpoint, so your message waits until you next prompt it in its terminal.":"Waiting at its prompt · your message waits in its inbox until you next prompt it in its terminal. Chat cannot start its turn.",button:"Send to inbox",reopen:!1,off:!1};if(e.delivery==="reopen"){if(e.reopening_since)return{line:"Opening in Terminal · Send is off until its session starts.",button:"Reopen and send",reopen:!0,off:!0};const n=Tu(e);return{line:t?`Closed · Send reopens it in ${n} in a new Terminal window with codex resume, with your message as its first prompt.`:`Closed · Send reopens it in ${n} in a new Terminal window, with your message as its first prompt.`,button:"Reopen and send",reopen:!0,off:!1}}return e.reason==="no_terminal"?{line:"Closed · Chat reopens a session only on macOS, so your message waits in its inbox until you next open the thread.",button:"Send to inbox",reopen:!1,off:!1}:e.reason==="no_command"?{line:t?"Closed · there is no codex command on this machine to reopen it, so your message waits in its inbox until you next open the thread in the Codex app.":"Closed · there is no claude command on this machine to reopen it, so your message waits in its inbox until you next open the thread.",button:"Send to inbox",reopen:!1,off:!1}:{line:"Closed · a process may still be this session, so your message waits in its inbox until it next reads it.",button:"Send to inbox",reopen:!1,off:!1}}function P3(e,t,n=!0){const a=n?" Your message is still in the box.":"";if(e.reason==="terminal_denied")return`Not reopened: macOS did not let sdlc viewer open Terminal. Allow it under System Settings › Privacy & Security › Automation, then ${n?"Retry":"send again"}.${a}`;const r=e.error.replace(/[.\s]+$/,"");return t?`Not reopened: ${r}.${a}`:e.status>=500||e.status===0?`Not sent: the inbox could not be written.${a}`:`Not sent: ${r}.${a}`}const X3="This thread can't be reopened: its worktree is gone. Its transcript stays readable; start a new thread to go on.",K3="Chat cannot send to this thread: its provider keeps no inbox and cannot be resumed.";function Q3(e){var t,n;return e.note?e.inbox==="read"?"Sent from Chat · read":e.inbox==="passed"?`Sent from Chat · passed to ${((t=e.successor)==null?void 0:t.title)||((n=e.successor)==null?void 0:n.thread)||"its successor"}`:e.inbox==="expired"?"Expired, not read":"Sent from Chat · in its inbox, not read yet":null}function Z3(e){const t=new Map;return e.map((n,a)=>{if(n.kind==="message"&&n.note)return`note-${n.note}`;if(n.offset==null)return`${n.kind}-x-${a}`;const r=`${n.kind}-${n.offset}`,l=t.get(r)??0;return t.set(r,l+1),`${r}-${l}`})}function F3(e,t,n){if(n.before==null||n.aligned===!1)return null;const a=n.before;if(t==null||a>t)return null;const r=e.findIndex(o=>o.offset!=null&&o.offset>=a),l=new Set(n.rows.flatMap(o=>o.kind==="message"&&o.note?[o.note]:[]));return[...(r<0?e:e.slice(0,r)).filter(o=>!(o.kind==="message"&&o.note&&l.has(o.note))),...n.rows]}function W3(e,t){return t?e.map(n=>{if(n.kind!=="message"||!n.note||!t[n.note])return n;const a=t[n.note];if(n.inbox===a.inbox&&JSON.stringify(n.successor??null)===JSON.stringify(a.successor??null))return n;const{successor:r,...l}=n;return{...l,inbox:a.inbox,...a.successor?{successor:a.successor}:{}}}):e}function b1({label:e}){return s.jsx("span",{"aria-hidden":"true",className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-2xs font-medium text-muted-foreground",children:e})}function j1({state:e}){if(!e)return null;const{label:t,tone:n}=l1[e];return s.jsx(Ve,{variant:n,children:t})}function J3({row:e}){const[t,n]=u.useState(!1);return s.jsxs("div",{className:"rounded-md border border-border px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(J2,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 text-xs text-muted-foreground",children:e.summary}),s.jsx(I,{variant:"ghost",size:"sm","aria-expanded":t,"aria-label":`${t?"Hide":"Show"} the steps: ${e.summary}`,onClick:()=>n(a=>!a),children:t?"Hide":"Show"})]}),t&&s.jsx("ul",{className:"m-0 mt-2 flex list-none flex-col gap-1 p-0",children:e.lines.map((a,r)=>s.jsx("li",{className:`text-xs text-muted-foreground [overflow-wrap:anywhere] ${a.startsWith("Edited ")?"":"font-mono"}`,children:a},r))})]})}function ez({row:e,agent:t,onSendAgain:n}){const a=e.who==="user",r=Q3(e);return s.jsxs("div",{className:"flex gap-3",children:[s.jsx(b1,{label:a?"You":t.slice(0,2).toUpperCase()}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:a?"You":t}),s.jsx("span",{className:"text-xs text-muted-foreground",children:V3(e.at)})]}),s.jsx("p",{className:"m-0 whitespace-pre-wrap text-sm text-foreground [overflow-wrap:anywhere]",children:e.text}),e.cut&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Shows the first 32,000 characters of this message."}),r&&s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r,e.inbox==="expired"&&n&&s.jsx(I,{variant:"link",size:"inline-sm",onClick:()=>n(e.text),children:"Send again"})]})]})]})}function tz(){const[e,t]=u.useState({rows:null,error:"",none:!1}),n=u.useRef(""),a=u.useCallback(async(r=!0)=>{const l=await sp();if("none"in l)return t({rows:[],error:"",none:!0});if("error"in l)return r?a(!1):t(c=>({...c,error:l.error}));const i=l.data.threads.filter(c=>v1.test(c.key)),o=JSON.stringify(i);t(c=>o===n.current&&!c.error?c:(n.current=o,{rows:i,error:"",none:!1}))},[]);return u.useEffect(()=>{const r=setTimeout(a,0),l=setInterval(a,B3);return()=>{clearTimeout(r),clearInterval(l)}},[a]),{...e,retry:()=>void a()}}function nz(e){const[t,n]=u.useState({}),a=u.useRef(e);a.current=e;const r=u.useRef(new Set),l=u.useRef(!0),i=u.useCallback(async o=>{for(let c=0;c<o.length;c+=Ux){const d=o.slice(c,c+Ux);d.forEach(m=>r.current.add(m));const f=await $3(d);if(!l.current)return;if(!("ok"in f))continue;const h={};for(const[m,x]of Object.entries(f.ok))"state"in x&&(h[m]=x);n(m=>({...m,...h}))}},[]);return u.useEffect(()=>{l.current=!0;let o;const c=async()=>{await i(a.current),l.current&&(o=setTimeout(c,Hx))};return o=setTimeout(c,Hx),()=>{l.current=!1,clearTimeout(o)}},[i]),u.useEffect(()=>{const o=e.filter(c=>!r.current.has(c));o.length&&i(o)},[e,i]),t}function az({org:e,list:t,states:n,open:a}){const[r,l]=u.useState("all"),[i,o]=u.useState(""),c=u.useRef(null),d=u.useRef(null),f=i.trim(),h=u.useMemo(()=>{const m=f.toLowerCase();return w1(t.rows??[]).filter(x=>r==="all"||Cr(x.key)===r).filter(x=>!m||I3(x,n[x.key]).includes(m))},[t.rows,r,f,n]);return s.jsxs("div",{ref:d,role:"region","aria-label":"Chat threads",tabIndex:-1,className:"flex min-w-0 flex-col gap-3 outline-hidden",children:[s.jsxs(Nn,{value:r,onValueChange:m=>l(m),children:[s.jsx(hn,{"aria-label":"Show threads from",children:s.jsx(Sn,{})}),s.jsxs(mn,{children:[s.jsx(We,{value:"all",children:"All threads"}),s.jsx(We,{value:"claude",children:"Claude Code"}),s.jsx(We,{value:"codex",children:"Codex"})]})]}),s.jsx(xn,{ref:c,type:"search","aria-label":"Search threads",placeholder:"Search threads",value:i,onChange:m=>o(m.target.value)}),t.error&&s.jsxs(de,{variant:"destructive",children:[s.jsx(Hr,{"aria-hidden":"true"}),s.jsxs(oe,{className:"flex flex-col items-start gap-2",children:["The threads could not be read: ",t.error.replace(/[.\s]+$/,""),".",t.rows?" The list shows what it last read.":"",s.jsx(I,{variant:"outline",size:"sm",onClick:()=>{var m;(m=d.current)==null||m.focus(),t.retry()},children:"Retry"})]})]}),t.rows===null?t.error?null:s.jsxs("div",{role:"status",className:"flex flex-col gap-3",children:[s.jsx("span",{className:"sr-only",children:"Loading threads…"}),[0,1,2].map(m=>s.jsx(Nt,{className:"h-14 w-full"},m))]}):t.rows.length===0?s.jsxs("div",{className:"flex flex-col gap-1 py-6",children:[s.jsx("h2",{className:"m-0 text-base font-semibold text-foreground",children:t.none?"Chat needs the SoftwareDLC view engine":"No agent threads in this folder yet"}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:t.none?"Chat needs a SoftwareDLC checkout to read threads. Set SDLC_VIEW_ROOT to one and restart sdlc viewer.":"Start Claude Code or Codex in one of this folder's repositories and its thread appears here."})]}):h.length===0?s.jsxs("div",{className:"flex flex-col items-start gap-2 py-6",children:[s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:f?`No thread matches “${f}”. Clear the search or choose All threads.`:`No ${q3[r==="all"?"claude":r]} thread in this folder. Choose All threads.`}),s.jsx(I,{variant:"outline",size:"sm",onClick:()=>{var m;o(""),l("all"),(m=c.current)==null||m.focus()},children:"Clear search"})]}):s.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0","aria-label":"Threads",children:h.map(m=>{var g;const x=(g=n[m.key])==null?void 0:g.state,j=m.step||m.summary,y=m.key===a,b=`chat-row-${m.key}`;return s.jsx("li",{children:s.jsxs("a",{id:b,href:cp(e,m.key),"aria-current":y?"page":void 0,"aria-label":`${m.title||m.key}${x?`, ${l1[x].label}`:""}`,"aria-describedby":[j?`${b}-preview`:"",m.age?`${b}-age`:""].filter(Boolean).join(" ")||void 0,className:"flex gap-3 rounded-md px-3 py-2 text-left no-underline outline-hidden hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring "+(y?"bg-accent":""),children:[s.jsx(b1,{label:Cr(m.key)==="codex"?"CO":"CL"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"truncate text-sm font-semibold text-foreground",title:m.title||m.key,children:m.title||m.key}),j&&s.jsx("span",{id:`${b}-preview`,className:"truncate text-xs text-muted-foreground",title:j,children:j}),s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[y1[Cr(m.key)],s.jsx(j1,{state:x})]})]}),m.age&&s.jsx("span",{id:`${b}-age`,className:"shrink-0 text-xs text-muted-foreground",children:m.age})]})},m.key)})})]})}const w1=e=>[...e].sort((t,n)=>+!!n.pinned-+!!t.pinned);function sz(e,t){const[n,a]=u.useState(null),r=u.useRef(null);u.useLayoutEffect(()=>{const g=t.current;g&&r.current!==null&&(g.scrollTop=g.scrollHeight-r.current,r.current=null)},[n,t]);const[l,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=u.useState(!1),x=u.useRef(""),j=u.useCallback(async()=>{const[g,p]=await Promise.all([Lx(e),z3(e)]);if("ok"in p?(c(null),f(_=>JSON.stringify(_)===JSON.stringify(p.ok)?_:p.ok)):c(p.failed),"failed"in g)return i(g.failed);i(null);const v=JSON.stringify([g.ok.rows,g.ok.before,g.ok.notes??null]);if(v===x.current)return;x.current=v;const w=g.ok.end??null;a(_=>{const S=_&&F3(_.rows,_.end,g.ok);if(!_||!S)return{rows:g.ok.rows,before:g.ok.before,end:w};const N=S.length>g.ok.rows.length?_.before:g.ok.before;return{rows:W3(S,g.ok.notes),before:N,end:w}})},[e]);u.useEffect(()=>{const g=setTimeout(j,0),p=setInterval(j,H3);return()=>{clearTimeout(g),clearInterval(p)}},[j]);const y=async()=>{if(!n||n.before==null||h)return;const g=n.before;m(!0);const p=await Lx(e,g);if(m(!1),"failed"in p)return i(p.failed);const v=t.current?t.current.scrollHeight-t.current.scrollTop:null;a(w=>!w||w.before!==g?w:(r.current=v,{...w,rows:[...p.ok.rows,...w.rows],before:p.ok.before}))},b=n===null&&(l==null?void 0:l.status)===404&&(o==null?void 0:o.status)===404;return{transcript:n,readFailure:l,state:d,refresh:j,showEarlier:y,earlier:h,missing:b}}function rz({thread:e,title:t,state:n,again:a,onAgainDone:r,onSent:l,onRetried:i}){const[o,c]=u.useState(""),d=u.useRef(o);d.current=o;const[f,h]=u.useState(!1),[m,x]=u.useState(null),[j,y]=u.useState(!1),b=u.useRef(null),g=u.useRef(null),{confirm:p,confirm_dialog:v}=Jr(),w=Y3(n),_=`chat-delivery-${e}`,S=!w||w.off||f,N=n.state!=="closed"||n.reason==="maybe_running";u.useEffect(()=>{!n.reopening_since&&N&&y(!1)},[n.reopening_since,N]);const k=u.useRef(null),R=u.useRef(!1);u.useEffect(()=>{if(!j)return;if(n.reopening_since){R.current=!0;return}if(!R.current||N||n.delivery!=="reopen")return;R.current=!1,y(!1);const C=k.current;k.current=null;const D=!!C&&!d.current.trim();D&&C&&c(C),x({text:`Not reopened: its session did not start in Terminal.${D?" Your message is back in the box.":""}`,retry:!1})},[j,n.reopening_since,N,n.delivery]);const M=async(C=d.current,D=!0)=>{var E;if(!w||S||!C.trim())return!1;if(w.reopen){const B=(n.provider??Cr(e))==="codex",T=await p({title:`Reopen ${t}?`,description:`It opens in ${Tu(n)}, in a new Terminal window running ${B?"codex resume":"claude --resume"}, with your message as its first prompt.`,action_label:"Reopen"});if(setTimeout(()=>{var L;return(L=g.current)==null?void 0:L.focus()},0),!T)return!1}h(!0),x(null);const G=await(w.reopen?U3(e,C):L3(e,C));return h(!1),"failed"in G?(x({text:P3(G.failed,w.reopen,D),retry:D&&G.failed.reason==="terminal_denied"}),D&&((E=b.current)==null||E.focus()),l(),!1):(D&&d.current===C&&c(""),w.reopen&&(k.current=C,R.current=!1,y(!0)),l(),!0)},z=u.useRef(M);if(z.current=M,u.useEffect(()=>{if(!a||S)return;r();const C=d.current.trim()!==""&&d.current!==a.text;C||(c(a.text),d.current=a.text),z.current(a.text,!C)},[a,S,r]),!w)return null;const U=C=>{C.key==="Enter"&&!C.shiftKey&&!C.nativeEvent.isComposing&&(C.preventDefault(),M())};return s.jsxs("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[m&&s.jsxs(de,{variant:"destructive",children:[s.jsx(Hr,{"aria-hidden":"true"}),s.jsxs(oe,{className:"flex flex-col items-start gap-2",children:[m.text,m.retry&&s.jsx(I,{variant:"outline",size:"sm",onClick:()=>void M().then(C=>C&&i()),children:"Retry"})]})]}),(j||n.reopening_since)&&w.reopen&&s.jsxs(de,{variant:"info",role:"status",children:[s.jsx(Bn,{"aria-hidden":"true"}),s.jsx(oe,{children:"Opened a Terminal window with your message. Its replies appear here once it starts."})]}),s.jsx(ds,{ref:b,rows:3,"aria-label":`Message ${t}`,placeholder:`Message ${t}`,value:o,onChange:C=>c(C.target.value),onKeyDown:U}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("p",{id:_,className:"m-0 min-w-0 flex-1 text-xs text-muted-foreground [overflow-wrap:anywhere]",children:f&&w.reopen?"Opening in Terminal · if macOS asks whether sdlc viewer may control Terminal, allow it. Send is off until it answers.":w.line}),s.jsxs(I,{ref:g,size:"sm","aria-disabled":S||void 0,"aria-describedby":_,onClick:()=>void M(),loading:f,children:[s.jsx(G2,{"aria-hidden":"true"}),w.button]})]}),v]})}function lz(e,t){if(!e)return null;const n=e==="now"?"just now":`${e} ago`;return t==="waiting"?e==="now"?"idle since just now":`idle ${e}`:t==="closed"?`closed ${n}`:n}function qx({org:e,thread:t,row:n,onBack:a,onMissing:r,onState:l}){const i=u.useRef(null),{transcript:o,readFailure:c,state:d,refresh:f,showEarlier:h,earlier:m,missing:x}=sz(t,i);u.useEffect(()=>{d&&l(d)},[d,l]);const j=u.useRef(!0),[y,b]=u.useState(null),[g,p]=u.useState(""),v=u.useRef(void 0),w=(n==null?void 0:n.title)||(d==null?void 0:d.title)||t,_=y1[Cr(t)],S=(o==null?void 0:o.rows)??null,N=u.useMemo(()=>Z3(S??[]),[S]),k=u.useCallback(()=>b(null),[]);u.useEffect(()=>{x&&r()},[x,r]),u.useLayoutEffect(()=>{const C=i.current;C&&j.current&&(C.scrollTop=C.scrollHeight)},[S==null?void 0:S.length]),u.useEffect(()=>{if(!S)return;let C=-1;for(let E=S.length-1;E>=0;E--){const B=S[E];if(B.kind==="message"&&B.who==="agent"){C=E;break}}const D=C>=0?S[C]:null,G=D?N[C]:null;v.current!==void 0&&D&&G!==v.current&&p(`${_}: ${D.text.slice(0,300)}`),v.current=G},[S,N,_]);const R=[G3(d),lz(n==null?void 0:n.age,d==null?void 0:d.state)].filter(Boolean).join(" · "),M=(d==null?void 0:d.delivery)==="none"&&d.reason==="worktree_gone",z=!!(d&&d.state!=="continued"&&d.delivery!=="none"),U=c&&!x;return s.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3","aria-labelledby":"chat-thread-title",children:[s.jsx("div",{className:"@min-[720px]:hidden",children:s.jsxs(I,{variant:"ghost",size:"sm",onClick:a,children:[s.jsx(Vb,{"aria-hidden":"true"}),"Back to threads"]})}),s.jsxs("header",{className:"flex flex-wrap items-start gap-x-3 gap-y-1 border-b border-border pb-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("h2",{id:"chat-thread-title",className:"m-0 text-base font-semibold text-foreground [overflow-wrap:anywhere]",children:w}),R&&s.jsx("span",{className:"text-xs text-muted-foreground",children:R})]}),s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[_,s.jsx(j1,{state:d==null?void 0:d.state}),n&&s.jsx("a",{className:`text-sm ${Ld}`,href:Bx(e,t),children:"Open in Threads"})]})]}),U&&s.jsxs(de,{variant:"warning",children:[s.jsx(Hr,{"aria-hidden":"true"}),s.jsxs(oe,{className:"flex flex-col items-start gap-2",children:["This thread's transcript could not be read: ",c.error,".",n?" Its card on Threads still shows its status.":"",s.jsxs("span",{className:"flex items-center gap-3",children:[s.jsx(I,{variant:"outline",size:"sm",onClick:()=>{var C;(C=i.current)==null||C.focus(),f()},children:"Retry"}),n&&s.jsx("a",{className:`text-sm ${Ld}`,href:Bx(e,t),children:"Open in Threads"})]})]})]}),s.jsx("div",{"aria-live":"polite",className:"sr-only",children:g}),s.jsx("div",{ref:i,role:"region",tabIndex:-1,"aria-label":`Transcript of ${w}`,className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto outline-hidden",onScroll:C=>{const D=C.currentTarget;j.current=D.scrollHeight-D.scrollTop-D.clientHeight<24},children:x?s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"This thread's session is no longer on this machine, so there is nothing to show. Choose another thread."}):S===null&&!c?s.jsxs("div",{role:"status",className:"flex flex-col gap-3",children:[s.jsx("span",{className:"sr-only",children:"Loading the transcript…"}),s.jsx(Nt,{className:"h-16 w-full"}),s.jsx(Nt,{className:"h-16 w-3/4"})]}):S&&S.length===0?s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"No messages yet. This thread's session has started but has not written a turn."}):s.jsxs(s.Fragment,{children:[(o==null?void 0:o.before)!=null&&s.jsx("div",{className:"flex justify-center",children:s.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>void h(),"aria-busy":m||void 0,children:[m&&s.jsx(xm,{}),"Show earlier messages"]})}),S==null?void 0:S.map((C,D)=>C.kind==="steps"?s.jsx(J3,{row:C},N[D]):s.jsx(ez,{row:C,agent:_,onSendAgain:z?G=>b(E=>({text:G,n:((E==null?void 0:E.n)??0)+1})):void 0},N[D]))]})}),(d==null?void 0:d.state)==="continued"?s.jsx("div",{className:"flex flex-col gap-1 border-t border-border pt-3 text-sm text-muted-foreground",children:d.successor?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"m-0",children:"Taken over by another thread, which now owns its work. Message that thread instead."}),s.jsxs("a",{className:Ld,href:cp(e,d.successor.thread),children:["Open ",d.successor.title||d.successor.thread]})]}):s.jsx("p",{className:"m-0",children:"This thread was archived and takes no messages."})}):M?s.jsxs(de,{variant:"warning",children:[s.jsx(Hr,{"aria-hidden":"true"}),s.jsx(oe,{children:X3})]}):(d==null?void 0:d.delivery)==="none"?s.jsx("p",{className:"m-0 border-t border-border pt-3 text-sm text-muted-foreground",children:K3}):d?s.jsx(rz,{thread:t,title:w,state:d,again:y,onAgainDone:k,onSent:()=>void f(),onRetried:()=>setTimeout(()=>{var C;return(C=i.current)==null?void 0:C.focus()},0)}):null]})}const iz=[];function oz({org:e,thread:t,served:n=null}){var M,z,U;const a=tz(),r=n===!1?{...a,rows:iz,error:"",none:!0}:a,l=n===!1?null:t,[i,o]=u.useState(null),[c,d]=u.useState(l===null),[f,h]=u.useState(null),m=(M=r.rows)==null?void 0:M.find(C=>C.key===l),x=u.useMemo(()=>(r.rows??[]).map(C=>C.key),[r.rows]),j=nz(x),[y,b]=u.useState(null),g=r.rows?((z=w1(r.rows)[0])==null?void 0:z.key)??null:null;u.useEffect(()=>{y===null&&g!==null&&b(g)},[y,g]);const p=y??g,v=p?{key:p,row:(U=r.rows)==null?void 0:U.find(C=>C.key===p)}:null,w=l!==null&&(!v1.test(l)||f===l&&r.rows!==null&&!m),_=u.useCallback(()=>h(l),[l]),S=u.useCallback(()=>{},[]),N=l??(v==null?void 0:v.key)??null,k=u.useMemo(()=>N&&(i==null?void 0:i.thread)===N?{...j,[N]:i}:j,[j,N,i]),R=()=>{d(!0),setTimeout(()=>{var C;return l?(C=document.getElementById(`chat-row-${l}`))==null?void 0:C.focus():void 0},0)};return w?s.jsx(xu,{title:"Thread not found",description:"This folder has no Claude Code or Codex thread at this address.",backHref:cp(e),backLabel:"Back to Chat",link:rp.Link}):s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 p-6",children:[s.jsx(Kn,{title:"Chat",description:"The Claude Code and Codex threads working in this folder. Read what each agent did and said, and send it a message."}),s.jsx("div",{className:"@container flex min-h-0 flex-1",children:s.jsxs("div",{className:"flex min-h-0 w-full gap-6 rounded-lg border border-border p-4",children:[s.jsx("div",{className:`w-full @min-[720px]:block @min-[720px]:w-80 @min-[720px]:shrink-0 ${l&&!c?"hidden":""}`,children:s.jsx(az,{org:e,list:r,states:k,open:N})}),l?s.jsx("div",{className:`min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex ${c?"hidden":"flex"}`,children:s.jsx(qx,{org:e,thread:l,row:m,onBack:R,onMissing:_,onState:o},l)}):v?s.jsx("div",{className:"hidden min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex",children:s.jsx(qx,{org:e,thread:v.key,row:v.row,onBack:S,onMissing:S,onState:o},v.key)}):null]})})]})}const Js={issues:"classic/?section=issues",releases:"classic/#releases"},cz=/^#(issue=|release=|planned$|releases$)/,uz=/^#task=(.+)$/;function _1(e){return e.split("/").filter(Boolean).slice(1).join("/")}function dz(e,t=""){const n=e.split("/").filter(Boolean);if(n.length===0)return{page:{kind:"home"}};if(n.length===1){const[o]=n;return o==="threads"?{page:{kind:"org",page:"threads"},threads:!0}:o==="chat"?{page:{kind:"org",page:"chat"},chat:!0,thread:null}:o==="tasks"?{page:{kind:"org",page:"tasks"},tasks:!0}:o==="chart"?{page:{kind:"org",page:"chart"},chart:!0}:o==="worktrees"?{page:{kind:"org",page:"worktrees"},worktrees:!0}:o==="workspaces"?{page:{kind:"org",page:"workspaces"},workspaces:!0}:o==="queues"?{page:{kind:"org",page:"queues"},queues:!0}:Js[o]?{classic:Js[o]}:{page:{kind:"not_found"}}}const[a,r,l,i]=n;if(a==="org"&&l==="tasks"&&i==="queues"&&n.length===4)return{forward:`org/${r}/queues${t}`};if(a==="org"&&l==="chat"&&n.length===4){let o="",c="";try{o=decodeURIComponent(i),c=decodeURIComponent(r)}catch{return{page:{kind:"not_found"}}}return{page:{kind:"org",page:"chat"},org:c,chat:!0,thread:o}}if(a==="org"&&l==="tasks"&&n.length===4){const o=decodeURIComponent(i);return{page:{kind:"org",page:"tasks",item:o},org:decodeURIComponent(r),task:o}}if(a==="org"&&n.length<=3){const o=decodeURIComponent(r);if(l===void 0)return{page:{kind:"home"},org:o};if(l==="threads")return{page:{kind:"org",page:"threads"},org:o,threads:!0};if(l==="chat")return{page:{kind:"org",page:"chat"},org:o,chat:!0,thread:null};if(l==="tasks")return{page:{kind:"org",page:"tasks"},org:o,tasks:!0};if(l==="chart")return{page:{kind:"org",page:"chart"},org:o,chart:!0};if(l==="worktrees")return{page:{kind:"org",page:"worktrees"},org:o,worktrees:!0};if(l==="workspaces")return{page:{kind:"org",page:"workspaces"},org:o,workspaces:!0};if(l==="queues")return{page:{kind:"org",page:"queues"},org:o,queues:!0};if(Js[l])return{classic:Js[l]}}if(a==="proj"&&n.length<=3){const o=decodeURIComponent(r);if(l===void 0)return{page:{kind:"project",project:o}};if(l==="tasks")return{page:{kind:"project",project:o,page:"tasks"},tasks:!0};if(Js[l])return{classic:Js[l]}}return{page:{kind:"not_found"}}}const fz={label:"Local viewer",can:()=>!1},hz={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},Gx=()=>s.jsx(i1,{title:"Page not found",children:"There is no page at this address in this viewer."});function mz(){const[e,t]=u.useState("connecting");return s.jsxs("div",{className:"main viewer-panel",children:[s.jsxs("p",{className:"connection",role:"status",children:[s.jsx("span",{className:`dot ${e}`,"aria-hidden":"true"}),hz[e]]}),s.jsx(E3,{onConnection:t})]})}const Eu=()=>s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});function pz({route:e,navigate:t}){var f;const{org:n,projects:a,loading:r,none:l}=Qn(),i=e.page.kind==="project"?e.page.project:null,o=i!==null&&a!==null&&!((f=a.find(h=>h.id===i))!=null&&f.current),c=e.org===void 0&&!o&&!r&&n!==null?`org/${encodeURIComponent(n.slug)}/tasks`:null;if(u.useEffect(()=>{c&&t(c)},[c,t]),i!==null&&o)return s.jsx(ah,{project:i});if(c||e.org===void 0&&r)return s.jsx(Eu,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?s.jsx(ah,{project:i}):d===void 0&&l?s.jsx(Pi,{}):d===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):s.jsx(RO,{org:d})}function gz({route:e,navigate:t,served:n}){const{org:a,loading:r,none:l}=Qn(),i=e.org===void 0&&!r&&a!==null?`org/${encodeURIComponent(a.slug)}/chat`:null;if(u.useEffect(()=>{i&&t(i)},[i,t]),i||e.org===void 0&&r)return s.jsx(Eu,{});const o=(a==null?void 0:a.slug)??e.org;return o===void 0&&l?s.jsx(Pi,{}):o===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Chat opens once the organization reads."}):s.jsx(oz,{org:o,thread:e.thread,served:n})}function xz({route:e,navigate:t}){const{org:n,loading:a,none:r}=Qn(),l=e.org===void 0&&!a&&n!==null?`org/${encodeURIComponent(n.slug)}/queues${window.location.search}`:null;if(u.useEffect(()=>{l&&t(l)},[l,t]),l||e.org===void 0&&a)return s.jsx(Eu,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&r)return s.jsx(Pi,{});if(i===void 0)return s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Queues open once the organization reads."});const o=new URLSearchParams(window.location.search).get("queue");return s.jsx(yD,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function vz({route:e,navigate:t,chat:n}){const{org:a}=Qn();let r=e.page;const l=e.org!==void 0&&a!==null&&e.org!==a.slug;l&&(r={kind:"not_found"});let i;if(l)i=s.jsx(Gx,{});else if("threads"in e)i=s.jsx(mz,{});else if("chat"in e)i=s.jsx(gz,{route:e,navigate:t,served:n});else if("task"in e){const o=new URLSearchParams(window.location.search).get("from");i=s.jsx(lD,{org:encodeURIComponent(e.org),task_id:e.task,from:o})}else"tasks"in e?i=s.jsx(pz,{route:e,navigate:t}):"chart"in e?i=s.jsx(zD,{}):"worktrees"in e?i=s.jsx(r3,{org:(a==null?void 0:a.slug)??e.org}):"workspaces"in e?i=s.jsx(U4,{org:(a==null?void 0:a.slug)??e.org}):"queues"in e?i=s.jsx(xz,{route:e,navigate:t}):r.kind==="home"?i=s.jsx(Pi,{}):r.kind==="project"?i=s.jsx(ah,{project:r.project}):i=s.jsx(Gx,{});return s.jsx(y4,{page:r,chat:n===!0,children:i})}function yz({task:e,navigate:t}){const{org:n,loading:a,none:r,failure:l}=Qn(),i=n!==null?`org/${encodeURIComponent(n.slug)}/tasks/${encodeURIComponent(e)}`:!a&&(r!==null||l!=null&&l.shown)?`classic/#task=${encodeURIComponent(e)}`:null;return u.useEffect(()=>{i&&t(i)},[i,t]),s.jsx(Eu,{})}const bz=e=>window.location.replace(e);function jz(e){try{return decodeURIComponent(e)}catch{return null}}function wz({navigate:e=bz,data:t,chat:n=D3}){const a=dz(_1(window.location.pathname),window.location.search),[r,l]=u.useState(null),{notify:i,toasts:o}=M3(),[c,d]=u.useState(null);u.useEffect(()=>{let j=!0;return n().then(y=>j&&d(y)),()=>{j=!1}},[n]);const f=uz.exec(window.location.hash),h=f?jz(f[1]):null,m=cz.test(window.location.hash)||f!==null&&h===null?`classic/${window.location.hash}`:"classic"in a?a.classic:"forward"in a?a.forward:null;u.useEffect(()=>{m&&e(m)},[m,e]);const x=u.useMemo(()=>t??{probe:{source:async()=>({label:"Local workspace"})},shell:d3(),tasks:m3(),org:h3(),worktrees:p3(),workspaces:g3(),queues:f3()},[t]);return m||"classic"in a||"forward"in a||!x.shell?null:s.jsx("div",{className:"app-ui dark",ref:l,children:s.jsxs(cE,{container:r,children:[s.jsx(Gb,{data:x,router:rp,identity:fz,notify:i,children:s.jsx(f4,{shell:x.shell,children:h!==null?s.jsx(yz,{task:h,navigate:e}):s.jsx(vz,{route:a,navigate:e,chat:c})})}),o]})})}Tk.createRoot(document.getElementById("root")).render(s.jsx(u.StrictMode,{children:_1(window.location.pathname)==="app-ui-probe"?s.jsx(R4,{}):s.jsx(wz,{})}));