@software-dlc/cli 0.177.0 → 0.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cli-snapshot.d.ts +4 -4
- package/dist/local/app-contract-readers.d.ts +208 -1
- package/dist/local/app-contract-readers.d.ts.map +1 -1
- package/dist/local/app-contract-readers.js +394 -10
- package/dist/local/app-contract-readers.js.map +1 -1
- package/dist/local/app-shell-readers.d.ts.map +1 -1
- package/dist/local/app-shell-readers.js +18 -1
- package/dist/local/app-shell-readers.js.map +1 -1
- package/dist/local/health-schema.d.ts +1 -1
- package/dist/local/source-evidence/schema.d.ts +2 -2
- package/dist/local/task-context-observations.d.ts +8 -8
- package/dist/local/task-context-schema.d.ts +1 -1
- package/dist/local/workspace-viewer-server.d.ts.map +1 -1
- package/dist/local/workspace-viewer-server.js +4 -2
- package/dist/local/workspace-viewer-server.js.map +1 -1
- package/package.json +1 -1
- package/viewer/assets/index-BUvSmMTB.js +382 -0
- package/viewer/assets/index-DFle_KDz.css +1 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-Bzt2JRIb.js +0 -352
- package/viewer/assets/index-CH4QYLOL.css +0 -1
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
function y1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const l=Object.getOwnPropertyDescriptor(s,r);l&&Object.defineProperty(e,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function jv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wv={exports:{}},su={};/**
|
|
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 b1=Symbol.for("react.transitional.element"),j1=Symbol.for("react.fragment");function _v(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+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:b1,type:e,key:s,ref:t!==void 0?t:null,props:n}}su.Fragment=j1;su.jsx=_v;su.jsxs=_v;wv.exports=su;var a=wv.exports,Nv={exports:{}},we={};/**
|
|
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 Ah=Symbol.for("react.transitional.element"),w1=Symbol.for("react.portal"),_1=Symbol.for("react.fragment"),N1=Symbol.for("react.strict_mode"),k1=Symbol.for("react.profiler"),S1=Symbol.for("react.consumer"),C1=Symbol.for("react.context"),T1=Symbol.for("react.forward_ref"),E1=Symbol.for("react.suspense"),R1=Symbol.for("react.memo"),kv=Symbol.for("react.lazy"),qp=Symbol.iterator;function A1(e){return e===null||typeof e!="object"?null:(e=qp&&e[qp]||e["@@iterator"],typeof e=="function"?e:null)}var Sv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cv=Object.assign,Tv={};function ll(e,t,n){this.props=e,this.context=t,this.refs=Tv,this.updater=n||Sv}ll.prototype.isReactComponent={};ll.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")};ll.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ev(){}Ev.prototype=ll.prototype;function Mh(e,t,n){this.props=e,this.context=t,this.refs=Tv,this.updater=n||Sv}var Oh=Mh.prototype=new Ev;Oh.constructor=Mh;Cv(Oh,ll.prototype);Oh.isPureReactComponent=!0;var Gp=Array.isArray,Ze={H:null,A:null,T:null,S:null,V:null},Rv=Object.prototype.hasOwnProperty;function Dh(e,t,n,s,r,l){return n=l.ref,{$$typeof:Ah,type:e,key:t,ref:n!==void 0?n:null,props:l}}function M1(e,t){return Dh(e.type,t,void 0,void 0,void 0,e.props)}function zh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ah}function O1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Pp=/\/+/g;function nd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?O1(""+e.key):t.toString(36)}function Vp(){}function D1(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Vp,Vp):(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 xr(e,t,n,s,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 Ah:case w1:i=!0;break;case kv:return i=e._init,xr(i(e._payload),t,n,s,r)}}if(i)return r=r(e),i=s===""?"."+nd(e,0):s,Gp(r)?(n="",i!=null&&(n=i.replace(Pp,"$&/")+"/"),xr(r,t,n,"",function(d){return d})):r!=null&&(zh(r)&&(r=M1(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Pp,"$&/")+"/")+i)),t.push(r)),1;i=0;var o=s===""?".":s+":";if(Gp(e))for(var c=0;c<e.length;c++)s=e[c],l=o+nd(s,c),i+=xr(s,t,n,l,r);else if(c=A1(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,l=o+nd(s,c++),i+=xr(s,t,n,l,r);else if(l==="object"){if(typeof e.then=="function")return xr(D1(e),t,n,s,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 ho(e,t,n){if(e==null)return e;var s=[],r=0;return xr(e,s,"","",function(l){return t.call(n,l,r++)}),s}function z1(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 Yp=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 $1(){}we.Children={map:ho,forEach:function(e,t,n){ho(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ho(e,function(){t++}),t},toArray:function(e){return ho(e,function(t){return t})||[]},only:function(e){if(!zh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};we.Component=ll;we.Fragment=_1;we.Profiler=k1;we.PureComponent=Mh;we.StrictMode=N1;we.Suspense=E1;we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ze;we.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ze.H.useMemoCache(e)}};we.cache=function(e){return function(){return e.apply(null,arguments)}};we.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Cv({},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)!Rv.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(s[i]=t[i]);var i=arguments.length-2;if(i===1)s.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];s.children=o}return Dh(e.type,r,void 0,void 0,l,s)};we.createContext=function(e){return e={$$typeof:C1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:S1,_context:e},e};we.createElement=function(e,t,n){var s,r={},l=null;if(t!=null)for(s in t.key!==void 0&&(l=""+t.key),t)Rv.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);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(s in i=e.defaultProps,i)r[s]===void 0&&(r[s]=i[s]);return Dh(e,l,void 0,void 0,null,r)};we.createRef=function(){return{current:null}};we.forwardRef=function(e){return{$$typeof:T1,render:e}};we.isValidElement=zh;we.lazy=function(e){return{$$typeof:kv,_payload:{_status:-1,_result:e},_init:z1}};we.memo=function(e,t){return{$$typeof:R1,type:e,compare:t===void 0?null:t}};we.startTransition=function(e){var t=Ze.T,n={};Ze.T=n;try{var s=e(),r=Ze.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then($1,Yp)}catch(l){Yp(l)}finally{Ze.T=t}};we.unstable_useCacheRefresh=function(){return Ze.H.useCacheRefresh()};we.use=function(e){return Ze.H.use(e)};we.useActionState=function(e,t,n){return Ze.H.useActionState(e,t,n)};we.useCallback=function(e,t){return Ze.H.useCallback(e,t)};we.useContext=function(e){return Ze.H.useContext(e)};we.useDebugValue=function(){};we.useDeferredValue=function(e,t){return Ze.H.useDeferredValue(e,t)};we.useEffect=function(e,t,n){var s=Ze.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return s.useEffect(e,t)};we.useId=function(){return Ze.H.useId()};we.useImperativeHandle=function(e,t,n){return Ze.H.useImperativeHandle(e,t,n)};we.useInsertionEffect=function(e,t){return Ze.H.useInsertionEffect(e,t)};we.useLayoutEffect=function(e,t){return Ze.H.useLayoutEffect(e,t)};we.useMemo=function(e,t){return Ze.H.useMemo(e,t)};we.useOptimistic=function(e,t){return Ze.H.useOptimistic(e,t)};we.useReducer=function(e,t,n){return Ze.H.useReducer(e,t,n)};we.useRef=function(e){return Ze.H.useRef(e)};we.useState=function(e){return Ze.H.useState(e)};we.useSyncExternalStore=function(e,t,n){return Ze.H.useSyncExternalStore(e,t,n)};we.useTransition=function(){return Ze.H.useTransition()};we.version="19.1.0";Nv.exports=we;var u=Nv.exports;const Ps=jv(u),Av=y1({__proto__:null,default:Ps},[u]);var Mv={exports:{}},au={},Ov={exports:{}},Dv={};/**
|
|
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,H){var C=E.length;E.push(H);e:for(;0<C;){var B=C-1>>>1,Z=E[B];if(0<r(Z,H))E[B]=H,E[C]=Z,C=B;else break e}}function n(E){return E.length===0?null:E[0]}function s(E){if(E.length===0)return null;var H=E[0],C=E.pop();if(C!==H){E[0]=C;e:for(var B=0,Z=E.length,z=Z>>>1;B<z;){var K=2*(B+1)-1,ae=E[K],Q=K+1,F=E[Q];if(0>r(ae,C))Q<Z&&0>r(F,ae)?(E[B]=F,E[Q]=C,B=Q):(E[B]=ae,E[K]=C,B=K);else if(Q<Z&&0>r(F,C))E[B]=F,E[Q]=C,B=Q;else break e}}return H}function r(E,H){var C=E.sortIndex-H.sortIndex;return C!==0?C:E.id-H.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,g=!1,b=!1,y=!1,j=!1,x=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function w(E){for(var H=n(d);H!==null;){if(H.callback===null)s(d);else if(H.startTime<=E)s(d),H.sortIndex=H.expirationTime,t(c,H);else break;H=n(d)}}function N(E){if(y=!1,w(E),!b)if(n(c)!==null)b=!0,k||(k=!0,I());else{var H=n(d);H!==null&&Y(N,H.startTime-E)}}var k=!1,_=-1,S=5,R=-1;function M(){return j?!0:!(e.unstable_now()-R<S)}function L(){if(j=!1,k){var E=e.unstable_now();R=E;var H=!0;try{e:{b=!1,y&&(y=!1,p(_),_=-1),g=!0;var C=m;try{t:{for(w(E),h=n(c);h!==null&&!(h.expirationTime>E&&M());){var B=h.callback;if(typeof B=="function"){h.callback=null,m=h.priorityLevel;var Z=B(h.expirationTime<=E);if(E=e.unstable_now(),typeof Z=="function"){h.callback=Z,w(E),H=!0;break t}h===n(c)&&s(c),w(E)}else s(c);h=n(c)}if(h!==null)H=!0;else{var z=n(d);z!==null&&Y(N,z.startTime-E),H=!1}}break e}finally{h=null,m=C,g=!1}H=void 0}}finally{H?I():k=!1}}}var I;if(typeof v=="function")I=function(){v(L)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,O=T.port2;T.port1.onmessage=L,I=function(){O.postMessage(null)}}else I=function(){x(L,0)};function Y(E,H){_=x(function(){E(e.unstable_now())},H)}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"):S=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 H=3;break;default:H=m}var C=m;m=H;try{return E()}finally{m=C}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(E,H){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var C=m;m=E;try{return H()}finally{m=C}},e.unstable_scheduleCallback=function(E,H,C){var B=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?B+C:B):C=B,E){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=C+Z,E={id:f++,callback:H,priorityLevel:E,startTime:C,expirationTime:Z,sortIndex:-1},C>B?(E.sortIndex=C,t(d,E),n(c)===null&&E===n(d)&&(y?(p(_),_=-1):y=!0,Y(N,C-B))):(E.sortIndex=Z,t(c,E),b||g||(b=!0,k||(k=!0,I()))),E},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(E){var H=m;return function(){var C=m;m=H;try{return E.apply(this,arguments)}finally{m=C}}}})(Dv);Ov.exports=Dv;var L1=Ov.exports,zv={exports:{}},It={};/**
|
|
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 U1=u;function $v(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 Bs(){}var Bt={d:{f:Bs,r:function(){throw Error($v(522))},D:Bs,C:Bs,L:Bs,m:Bs,X:Bs,S:Bs,M:Bs},p:0,findDOMNode:null},H1=Symbol.for("react.portal");function B1(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H1,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var Zl=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function ru(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;It.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($v(299));return B1(e,t,null,n)};It.flushSync=function(e){var t=Zl.T,n=Bt.p;try{if(Zl.T=null,Bt.p=2,e)return e()}finally{Zl.T=t,Bt.p=n,Bt.d.f()}};It.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};It.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};It.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=ru(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,l=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:l}):n==="script"&&Bt.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:l,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};It.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=ru(t.as,t.crossOrigin);Bt.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&&Bt.d.M(e)};It.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=ru(n,t.crossOrigin);Bt.d.L(e,n,{crossOrigin:s,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})}};It.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=ru(t.as,t.crossOrigin);Bt.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 Bt.d.m(e)};It.requestFormReset=function(e){Bt.d.r(e)};It.unstable_batchedUpdates=function(e,t){return e(t)};It.useFormState=function(e,t,n){return Zl.H.useFormState(e,t,n)};It.useFormStatus=function(){return Zl.H.useHostTransitionStatus()};It.version="19.1.0";function Lv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lv)}catch(e){console.error(e)}}Lv(),zv.exports=It;var il=zv.exports;const I1=jv(il);/**
|
|
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 jt=L1,Uv=u,q1=il;function G(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 Hv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zi(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 Bv(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 Xp(e){if(zi(e)!==e)throw Error(G(188))}function G1(e){var t=e.alternate;if(!t){if(t=zi(e),t===null)throw Error(G(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var l=r.alternate;if(l===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===l.child){for(l=r.child;l;){if(l===n)return Xp(r),e;if(l===s)return Xp(r),t;l=l.sibling}throw Error(G(188))}if(n.return!==s.return)n=r,s=l;else{for(var i=!1,o=r.child;o;){if(o===n){i=!0,n=r,s=l;break}if(o===s){i=!0,s=r,n=l;break}o=o.sibling}if(!i){for(o=l.child;o;){if(o===n){i=!0,n=l,s=r;break}if(o===s){i=!0,s=l,n=r;break}o=o.sibling}if(!i)throw Error(G(189))}}if(n.alternate!==s)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?e:t}function Iv(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Iv(e),t!==null)return t;e=e.sibling}return null}var Ke=Object.assign,P1=Symbol.for("react.element"),mo=Symbol.for("react.transitional.element"),Il=Symbol.for("react.portal"),br=Symbol.for("react.fragment"),qv=Symbol.for("react.strict_mode"),uf=Symbol.for("react.profiler"),V1=Symbol.for("react.provider"),Gv=Symbol.for("react.consumer"),ds=Symbol.for("react.context"),$h=Symbol.for("react.forward_ref"),df=Symbol.for("react.suspense"),ff=Symbol.for("react.suspense_list"),Lh=Symbol.for("react.memo"),Xs=Symbol.for("react.lazy"),hf=Symbol.for("react.activity"),Y1=Symbol.for("react.memo_cache_sentinel"),Fp=Symbol.iterator;function El(e){return e===null||typeof e!="object"?null:(e=Fp&&e[Fp]||e["@@iterator"],typeof e=="function"?e:null)}var X1=Symbol.for("react.client.reference");function mf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X1?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case br:return"Fragment";case uf:return"Profiler";case qv:return"StrictMode";case df:return"Suspense";case ff:return"SuspenseList";case hf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Il:return"Portal";case ds:return(e.displayName||"Context")+".Provider";case Gv:return(e._context.displayName||"Context")+".Consumer";case $h:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Lh:return t=e.displayName||null,t!==null?t:mf(e.type)||"Memo";case Xs:t=e._payload,e=e._init;try{return mf(e(t))}catch{}}return null}var ql=Array.isArray,xe=Uv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=q1.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ma={pending:!1,data:null,method:null,action:null},pf=[],jr=-1;function Jn(e){return{current:e}}function Ct(e){0>jr||(e.current=pf[jr],pf[jr]=null,jr--)}function We(e,t){jr++,pf[jr]=e.current,e.current=t}var Yn=Jn(null),hi=Jn(null),ra=Jn(null),cc=Jn(null);function uc(e,t){switch(We(ra,t),We(hi,e),We(Yn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jx(t),e=lj(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ct(Yn),We(Yn,e)}function Yr(){Ct(Yn),Ct(hi),Ct(ra)}function xf(e){e.memoizedState!==null&&We(cc,e);var t=Yn.current,n=lj(t,e.type);t!==n&&(We(hi,e),We(Yn,n))}function dc(e){hi.current===e&&(Ct(Yn),Ct(hi)),cc.current===e&&(Ct(cc),_i._currentValue=Ma)}var gf=Object.prototype.hasOwnProperty,Uh=jt.unstable_scheduleCallback,sd=jt.unstable_cancelCallback,F1=jt.unstable_shouldYield,K1=jt.unstable_requestPaint,Xn=jt.unstable_now,Q1=jt.unstable_getCurrentPriorityLevel,Pv=jt.unstable_ImmediatePriority,Vv=jt.unstable_UserBlockingPriority,fc=jt.unstable_NormalPriority,Z1=jt.unstable_LowPriority,Yv=jt.unstable_IdlePriority,W1=jt.log,J1=jt.unstable_setDisableYieldValue,$i=null,sn=null;function Js(e){if(typeof W1=="function"&&J1(e),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode($i,e)}catch{}}var an=Math.clz32?Math.clz32:nk,ek=Math.log,tk=Math.LN2;function nk(e){return e>>>=0,e===0?32:31-(ek(e)/tk|0)|0}var po=256,xo=4194304;function Ta(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 lu(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=s&134217727;return o!==0?(s=o&~l,s!==0?r=Ta(s):(i&=o,i!==0?r=Ta(i):n||(n=o&~e,n!==0&&(r=Ta(n))))):(o=s&~l,o!==0?r=Ta(o):i!==0?r=Ta(i):n||(n=s&~e,n!==0&&(r=Ta(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 Li(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sk(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 Xv(){var e=po;return po<<=1,!(po&4194048)&&(po=256),e}function Fv(){var e=xo;return xo<<=1,!(xo&62914560)&&(xo=4194304),e}function ad(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ui(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ak(e,t,n,s,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-an(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 g=m[f];g!==null&&(g.lane&=-536870913)}n&=~h}s!==0&&Kv(e,s,0),l!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=l&~(i&~t))}function Kv(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-an(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&4194090}function Qv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-an(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function Hh(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 Bh(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Zv(){var e=ze.p;return e!==0?e:(e=window.event,e===void 0?32:xj(e.type))}function rk(e,t){var n=ze.p;try{return ze.p=e,t()}finally{ze.p=n}}var ja=Math.random().toString(36).slice(2),zt="__reactFiber$"+ja,Xt="__reactProps$"+ja,ol="__reactContainer$"+ja,vf="__reactEvents$"+ja,lk="__reactListeners$"+ja,ik="__reactHandles$"+ja,Kp="__reactResources$"+ja,Hi="__reactMarker$"+ja;function Ih(e){delete e[zt],delete e[Xt],delete e[vf],delete e[lk],delete e[ik]}function wr(e){var t=e[zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ol]||n[zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ng(e);e!==null;){if(n=e[zt])return n;e=ng(e)}return t}e=n,n=e.parentNode}return null}function cl(e){if(e=e[zt]||e[ol]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Gl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(G(33))}function Or(e){var t=e[Kp];return t||(t=e[Kp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Hi]=!0}var Wv=new Set,Jv={};function Qa(e,t){Xr(e,t),Xr(e+"Capture",t)}function Xr(e,t){for(Jv[e]=t,e=0;e<t.length;e++)Wv.add(t[e])}var ok=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]*$"),Qp={},Zp={};function ck(e){return gf.call(Zp,e)?!0:gf.call(Qp,e)?!1:ok.test(e)?Zp[e]=!0:(Qp[e]=!0,!1)}function Go(e,t,n){if(ck(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function go(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 rs(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}var rd,Wp;function gr(e){if(rd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);rd=t&&t[1]||"",Wp=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+rd+e+Wp}var ld=!1;function id(e,t){if(!e||ld)return"";ld=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={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(g){var m=g}Reflect.construct(e,[],h)}else{try{h.call()}catch(g){m=g}e.call(h.prototype)}}else{try{throw Error()}catch(g){m=g}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(g){if(g&&m&&typeof g.stack=="string")return[g.stack,m.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=s.DetermineComponentFrameRoot(),i=l[0],o=l[1];if(i&&o){var c=i.split(`
|
|
44
|
+
`),d=o.split(`
|
|
45
|
+
`);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<d.length&&!d[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===d.length)for(s=c.length-1,r=d.length-1;1<=s&&0<=r&&c[s]!==d[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==d[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==d[r]){var f=`
|
|
46
|
+
`+c[s].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=s&&0<=r);break}}}finally{ld=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?gr(n):""}function uk(e){switch(e.tag){case 26:case 27:case 5:return gr(e.type);case 16:return gr("Lazy");case 13:return gr("Suspense");case 19:return gr("SuspenseList");case 0:case 15:return id(e.type,!1);case 11:return id(e.type.render,!1);case 1:return id(e.type,!0);case 31:return gr("Activity");default:return""}}function Jp(e){try{var t="";do t+=uk(e),e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ey(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dk(e){var t=ey(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+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){s=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(i){s=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hc(e){e._valueTracker||(e._valueTracker=dk(e))}function ty(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=ey(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function mc(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 fk=/[\n"\\]/g;function gn(e){return e.replace(fk,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function yf(e,t,n,s,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=""+mn(t)):e.value!==""+mn(t)&&(e.value=""+mn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?bf(e,i,mn(t)):n!=null?bf(e,i,mn(n)):s!=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=""+mn(o):e.removeAttribute("name")}function ny(e,t,n,s,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?""+mn(n):"",t=t!=null?""+mn(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=o?e.checked:!!s,e.defaultChecked=!!s,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i)}function bf(e,t,n){t==="number"&&mc(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Dr(e,t,n,s){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&&s&&(e[n].defaultSelected=!0)}else{for(n=""+mn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function sy(e,t,n){if(t!=null&&(t=""+mn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+mn(n):""}function ay(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(G(92));if(ql(s)){if(1<s.length)throw Error(G(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=mn(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s)}function Fr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hk=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 ex(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||hk.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ry(e,t,n){if(t!=null&&typeof t!="object")throw Error(G(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&ex(e,r,s)}else for(var l in t)t.hasOwnProperty(l)&&ex(e,l,t[l])}function qh(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 mk=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"]]),pk=/^[\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 Po(e){return pk.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var jf=null;function Gh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _r=null,zr=null;function tx(e){var t=cl(e);if(t&&(e=t.stateNode)){var n=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(yf(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="'+gn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[Xt]||null;if(!r)throw Error(G(90));yf(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&ty(s)}break e;case"textarea":sy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Dr(e,!!n.multiple,t,!1)}}}var od=!1;function ly(e,t,n){if(od)return e(t,n);od=!0;try{var s=e(t);return s}finally{if(od=!1,(_r!==null||zr!==null)&&(xu(),_r&&(t=_r,e=zr,zr=_r=null,tx(t),e)))for(t=0;t<e.length;t++)tx(e[t])}}function mi(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Xt]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(G(231,t,typeof n));return n}var bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wf=!1;if(bs)try{var Rl={};Object.defineProperty(Rl,"passive",{get:function(){wf=!0}}),window.addEventListener("test",Rl,Rl),window.removeEventListener("test",Rl,Rl)}catch{wf=!1}var ea=null,Ph=null,Vo=null;function iy(){if(Vo)return Vo;var e,t=Ph,n=t.length,s,r="value"in ea?ea.value:ea.textContent,l=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(s=1;s<=i&&t[n-s]===r[l-s];s++);return Vo=r.slice(e,1<s?1-s:void 0)}function Yo(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 vo(){return!0}function nx(){return!1}function Ft(e){function t(n,s,r,l,i){this._reactName=n,this._targetInst=r,this.type=s,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)?vo:nx,this.isPropagationStopped=nx,this}return Ke(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=vo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vo)},persist:function(){},isPersistent:vo}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},iu=Ft(Za),Bi=Ke({},Za,{view:0,detail:0}),xk=Ft(Bi),cd,ud,Al,ou=Ke({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vh,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!==Al&&(Al&&e.type==="mousemove"?(cd=e.screenX-Al.screenX,ud=e.screenY-Al.screenY):ud=cd=0,Al=e),cd)},movementY:function(e){return"movementY"in e?e.movementY:ud}}),sx=Ft(ou),gk=Ke({},ou,{dataTransfer:0}),vk=Ft(gk),yk=Ke({},Bi,{relatedTarget:0}),dd=Ft(yk),bk=Ke({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),jk=Ft(bk),wk=Ke({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_k=Ft(wk),Nk=Ke({},Za,{data:0}),ax=Ft(Nk),kk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sk={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"},Ck={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ck[e])?!!t[e]:!1}function Vh(){return Tk}var Ek=Ke({},Bi,{key:function(e){if(e.key){var t=kk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vh,charCode:function(e){return e.type==="keypress"?Yo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rk=Ft(Ek),Ak=Ke({},ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rx=Ft(Ak),Mk=Ke({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vh}),Ok=Ft(Mk),Dk=Ke({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),zk=Ft(Dk),$k=Ke({},ou,{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}),Lk=Ft($k),Uk=Ke({},Za,{newState:0,oldState:0}),Hk=Ft(Uk),Bk=[9,13,27,32],Yh=bs&&"CompositionEvent"in window,Wl=null;bs&&"documentMode"in document&&(Wl=document.documentMode);var Ik=bs&&"TextEvent"in window&&!Wl,oy=bs&&(!Yh||Wl&&8<Wl&&11>=Wl),lx=" ",ix=!1;function cy(e,t){switch(e){case"keyup":return Bk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function qk(e,t){switch(e){case"compositionend":return uy(t);case"keypress":return t.which!==32?null:(ix=!0,lx);case"textInput":return e=t.data,e===lx&&ix?null:e;default:return null}}function Gk(e,t){if(Nr)return e==="compositionend"||!Yh&&cy(e,t)?(e=iy(),Vo=Ph=ea=null,Nr=!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 oy&&t.locale!=="ko"?null:t.data;default:return null}}var Pk={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 ox(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Pk[e.type]:t==="textarea"}function dy(e,t,n,s){_r?zr?zr.push(s):zr=[s]:_r=s,t=Mc(t,"onChange"),0<t.length&&(n=new iu("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Jl=null,pi=null;function Vk(e){sj(e,0)}function cu(e){var t=Gl(e);if(ty(t))return e}function cx(e,t){if(e==="change")return t}var fy=!1;if(bs){var fd;if(bs){var hd="oninput"in document;if(!hd){var ux=document.createElement("div");ux.setAttribute("oninput","return;"),hd=typeof ux.oninput=="function"}fd=hd}else fd=!1;fy=fd&&(!document.documentMode||9<document.documentMode)}function dx(){Jl&&(Jl.detachEvent("onpropertychange",hy),pi=Jl=null)}function hy(e){if(e.propertyName==="value"&&cu(pi)){var t=[];dy(t,pi,e,Gh(e)),ly(Vk,t)}}function Yk(e,t,n){e==="focusin"?(dx(),Jl=t,pi=n,Jl.attachEvent("onpropertychange",hy)):e==="focusout"&&dx()}function Xk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cu(pi)}function Fk(e,t){if(e==="click")return cu(t)}function Kk(e,t){if(e==="input"||e==="change")return cu(t)}function Qk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:Qk;function xi(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!gf.call(t,r)||!cn(e[r],t[r]))return!1}return!0}function fx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hx(e,t){var n=fx(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fx(n)}}function my(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?my(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function py(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mc(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=mc(e.document)}return t}function Xh(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 Zk=bs&&"documentMode"in document&&11>=document.documentMode,kr=null,_f=null,ei=null,Nf=!1;function mx(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nf||kr==null||kr!==mc(s)||(s=kr,"selectionStart"in s&&Xh(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ei&&xi(ei,s)||(ei=s,s=Mc(_f,"onSelect"),0<s.length&&(t=new iu("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=kr)))}function Sa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionrun:Sa("Transition","TransitionRun"),transitionstart:Sa("Transition","TransitionStart"),transitioncancel:Sa("Transition","TransitionCancel"),transitionend:Sa("Transition","TransitionEnd")},md={},xy={};bs&&(xy=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);function Wa(e){if(md[e])return md[e];if(!Sr[e])return e;var t=Sr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in xy)return md[e]=t[n];return e}var gy=Wa("animationend"),vy=Wa("animationiteration"),yy=Wa("animationstart"),Wk=Wa("transitionrun"),Jk=Wa("transitionstart"),eS=Wa("transitioncancel"),by=Wa("transitionend"),jy=new Map,kf="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(" ");kf.push("scrollEnd");function Ln(e,t){jy.set(e,t),Qa(t,[e])}var px=new WeakMap;function vn(e,t){if(typeof e=="object"&&e!==null){var n=px.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Jp(t)},px.set(e,t),t)}return{value:e,source:t,stack:Jp(t)}}var hn=[],Cr=0,Fh=0;function uu(){for(var e=Cr,t=Fh=Cr=0;t<e;){var n=hn[t];hn[t++]=null;var s=hn[t];hn[t++]=null;var r=hn[t];hn[t++]=null;var l=hn[t];if(hn[t++]=null,s!==null&&r!==null){var i=s.pending;i===null?r.next=r:(r.next=i.next,i.next=r),s.pending=r}l!==0&&wy(n,r,l)}}function du(e,t,n,s){hn[Cr++]=e,hn[Cr++]=t,hn[Cr++]=n,hn[Cr++]=s,Fh|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Kh(e,t,n,s){return du(e,t,n,s),pc(e)}function ul(e,t){return du(e,null,null,t),pc(e)}function wy(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,l=e.return;l!==null;)l.childLanes|=n,s=l.alternate,s!==null&&(s.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-an(n),e=l.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),l):null}function pc(e){if(50<ui)throw ui=0,Yf=null,Error(G(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Tr={};function tS(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,n,s){return new tS(e,t,n,s)}function Qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vs(e,t){var n=e.alternate;return n===null?(n=nn(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 _y(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 Xo(e,t,n,s,r,l){var i=0;if(s=e,typeof e=="function")Qh(e)&&(i=1);else if(typeof e=="string")i=s2(e,n,Yn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case hf:return e=nn(31,n,t,r),e.elementType=hf,e.lanes=l,e;case br:return Oa(n.children,r,l,t);case qv:i=8,r|=24;break;case uf:return e=nn(12,n,t,r|2),e.elementType=uf,e.lanes=l,e;case df:return e=nn(13,n,t,r),e.elementType=df,e.lanes=l,e;case ff:return e=nn(19,n,t,r),e.elementType=ff,e.lanes=l,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V1:case ds:i=10;break e;case Gv:i=9;break e;case $h:i=11;break e;case Lh:i=14;break e;case Xs:i=16,s=null;break e}i=29,n=Error(G(130,e===null?"null":typeof e,"")),s=null}return t=nn(i,n,t,r),t.elementType=e,t.type=s,t.lanes=l,t}function Oa(e,t,n,s){return e=nn(7,e,s,t),e.lanes=n,e}function pd(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function xd(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Er=[],Rr=0,xc=null,gc=0,pn=[],xn=0,Da=null,fs=1,hs="";function Ea(e,t){Er[Rr++]=gc,Er[Rr++]=xc,xc=e,gc=t}function Ny(e,t,n){pn[xn++]=fs,pn[xn++]=hs,pn[xn++]=Da,Da=e;var s=fs;e=hs;var r=32-an(s)-1;s&=~(1<<r),n+=1;var l=32-an(t)+r;if(30<l){var i=r-r%5;l=(s&(1<<i)-1).toString(32),s>>=i,r-=i,fs=1<<32-an(t)+r|n<<r|s,hs=l+e}else fs=1<<l|n<<r|s,hs=e}function Zh(e){e.return!==null&&(Ea(e,1),Ny(e,1,0))}function Wh(e){for(;e===xc;)xc=Er[--Rr],Er[Rr]=null,gc=Er[--Rr],Er[Rr]=null;for(;e===Da;)Da=pn[--xn],pn[xn]=null,hs=pn[--xn],pn[xn]=null,fs=pn[--xn],pn[xn]=null}var Ht=null,rt=null,De=!1,za=null,In=!1,Sf=Error(G(519));function Ha(e){var t=Error(G(418,""));throw gi(vn(t,e)),Sf}function xx(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[zt]=e,t[Xt]=s,n){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(n=0;n<bi.length;n++)Se(bi[n],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),ny(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),hc(t);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),ay(t,s.value,s.defaultValue,s.children),hc(t)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||rj(t.textContent,n)?(s.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),s.onScroll!=null&&Se("scroll",t),s.onScrollEnd!=null&&Se("scrollend",t),s.onClick!=null&&(t.onclick=yu),t=!0):t=!1,t||Ha(e)}function gx(e){for(Ht=e.return;Ht;)switch(Ht.tag){case 5:case 13:In=!1;return;case 27:case 3:In=!0;return;default:Ht=Ht.return}}function Ml(e){if(e!==Ht)return!1;if(!De)return gx(e),De=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Wf(e.type,e.memoizedProps)),n=!n),n&&rt&&Ha(e),gx(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){rt=Rn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}rt=null}}else t===27?(t=rt,wa(e.type)?(e=th,th=null,rt=e):rt=t):rt=Ht?Rn(e.stateNode.nextSibling):null;return!0}function Ii(){rt=Ht=null,De=!1}function vx(){var e=za;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),za=null),e}function gi(e){za===null?za=[e]:za.push(e)}var Cf=Jn(null),Ja=null,ms=null;function Ks(e,t,n){We(Cf,t._currentValue),t._currentValue=n}function ys(e){e._currentValue=Cf.current,Ct(Cf)}function Tf(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Ef(e,t,n,s){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),Tf(l.return,n,e),s||(i=null);break e}l=o.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(G(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Tf(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 qi(e,t,n,s){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(G(387));if(i=i.memoizedProps,i!==null){var o=r.type;cn(r.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(r===cc.current){if(i=r.alternate,i===null)throw Error(G(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(_i):e=[_i])}r=r.return}e!==null&&Ef(t,e,n,s),t.flags|=262144}function vc(e){for(e=e.firstContext;e!==null;){if(!cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ba(e){Ja=e,ms=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return ky(Ja,e)}function yo(e,t){return Ja===null&&Ba(e),ky(e,t)}function ky(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ms===null){if(e===null)throw Error(G(308));ms=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ms=ms.next=t;return n}var nS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},sS=jt.unstable_scheduleCallback,aS=jt.unstable_NormalPriority,gt={$$typeof:ds,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jh(){return{controller:new nS,data:new Map,refCount:0}}function Gi(e){e.refCount--,e.refCount===0&&sS(aS,function(){e.controller.abort()})}var ti=null,Rf=0,Kr=0,$r=null;function rS(e,t){if(ti===null){var n=ti=[];Rf=0,Kr=wm(),$r={status:"pending",value:void 0,then:function(s){n.push(s)}}}return Rf++,t.then(yx,yx),t}function yx(){if(--Rf===0&&ti!==null){$r!==null&&($r.status="fulfilled");var e=ti;ti=null,Kr=0,$r=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function lS(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var bx=xe.S;xe.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&rS(e,t),bx!==null&&bx(e,t)};var $a=Jn(null);function em(){var e=$a.current;return e!==null?e:Ve.pooledCache}function Fo(e,t){t===null?We($a,$a.current):We($a,t.pool)}function Sy(){var e=em();return e===null?null:{parent:gt._currentValue,pool:e}}var Pi=Error(G(460)),Cy=Error(G(474)),fu=Error(G(542)),Af={then:function(){}};function jx(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bo(){}function Ty(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bo,bo),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_x(e),e;default:if(typeof t.status=="string")t.then(bo,bo);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(G(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_x(e),e}throw ni=t,Pi}}var ni=null;function wx(){if(ni===null)throw Error(G(459));var e=ni;return ni=null,e}function _x(e){if(e===Pi||e===fu)throw Error(G(483))}var Fs=!1;function tm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mf(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 la(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ia(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Ue&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=pc(e),wy(e,null,n),t}return du(e,s,t,n),pc(e)}function si(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Qv(e,n)}}function gd(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){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:s.baseState,firstBaseUpdate:r,lastBaseUpdate:l,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Of=!1;function ai(){if(Of){var e=$r;if(e!==null)throw e}}function ri(e,t,n,s){Of=!1;var r=e.updateQueue;Fs=!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,g=m!==o.lane;if(g?(Ee&m)===m:(s&m)===m){m!==0&&m===Kr&&(Of=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var b=e,y=o;m=t;var j=n;switch(y.tag){case 1:if(b=y.payload,typeof b=="function"){h=b.call(j,h,m);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=y.payload,m=typeof b=="function"?b.call(j,h,m):b,m==null)break e;h=Ke({},h,m);break e;case 2:Fs=!0}}m=o.callback,m!==null&&(e.flags|=64,g&&(e.flags|=8192),g=r.callbacks,g===null?r.callbacks=[m]:g.push(m))}else g={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=g,c=h):f=f.next=g,i|=m;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;g=o,o=g.next,g.next=null,r.lastBaseUpdate=g,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),xa|=i,e.lanes=i,e.memoizedState=h}}function Ey(e,t){if(typeof e!="function")throw Error(G(191,e));e.call(t)}function Ry(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ey(n[e],t)}var Qr=Jn(null),yc=Jn(0);function Nx(e,t){e=_s,We(yc,e),We(Qr,t),_s=e|t.baseLanes}function Df(){We(yc,_s),We(Qr,Qr.current)}function nm(){_s=yc.current,Ct(Qr),Ct(yc)}var ma=0,Ne=null,qe=null,ut=null,bc=!1,Lr=!1,Ia=!1,jc=0,vi=0,Ur=null,iS=0;function it(){throw Error(G(321))}function sm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cn(e[n],t[n]))return!1;return!0}function am(e,t,n,s,r,l){return ma=l,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xe.H=e===null||e.memoizedState===null?ib:ob,Ia=!1,l=n(s,r),Ia=!1,Lr&&(l=My(t,n,s,r)),Ay(e),l}function Ay(e){xe.H=wc;var t=qe!==null&&qe.next!==null;if(ma=0,ut=qe=Ne=null,bc=!1,vi=0,Ur=null,t)throw Error(G(300));e===null||St||(e=e.dependencies,e!==null&&vc(e)&&(St=!0))}function My(e,t,n,s){Ne=e;var r=0;do{if(Lr&&(Ur=null),vi=0,Lr=!1,25<=r)throw Error(G(301));if(r+=1,ut=qe=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}xe.H=mS,l=t(n,s)}while(Lr);return l}function oS(){var e=xe.H,t=e.useState()[0];return t=typeof t.then=="function"?Vi(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(Ne.flags|=1024),t}function rm(){var e=jc!==0;return jc=0,e}function lm(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function im(e){if(bc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bc=!1}ma=0,ut=qe=Ne=null,Lr=!1,vi=jc=0,Ur=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ne.memoizedState=ut=e:ut=ut.next=e,ut}function ft(){if(qe===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=ut===null?Ne.memoizedState:ut.next;if(t!==null)ut=t,qe=e;else{if(e===null)throw Ne.alternate===null?Error(G(467)):Error(G(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},ut===null?Ne.memoizedState=ut=e:ut=ut.next=e}return ut}function om(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vi(e){var t=vi;return vi+=1,Ur===null&&(Ur=[]),e=Ty(Ur,e,t),t=Ne,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,xe.H=t===null||t.memoizedState===null?ib:ob),e}function hu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Vi(e);if(e.$$typeof===ds)return $t(e)}throw Error(G(438,String(e)))}function cm(e){var t=null,n=Ne.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Ne.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=om(),Ne.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=Y1;return t.index++,n}function js(e,t){return typeof t=="function"?t(e):t}function Ko(e){var t=ft();return um(t,qe,e)}function um(e,t,n){var s=e.queue;if(s===null)throw Error(G(311));s.lastRenderedReducer=n;var r=e.baseQueue,l=s.pending;if(l!==null){if(r!==null){var i=r.next;r.next=l.next,l.next=i}t.baseQueue=r=l,s.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?(Ee&h)===h:(ma&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===Kr&&(f=!0);else if((ma&m)===m){d=d.next,m===Kr&&(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,Ne.lanes|=m,xa|=m;h=d.action,Ia&&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,Ne.lanes|=h,xa|=h;d=d.next}while(d!==null&&d!==t);if(c===null?i=l:c.next=o,!cn(l,e.memoizedState)&&(St=!0,f&&(n=$r,n!==null)))throw n;e.memoizedState=l,e.baseState=i,e.baseQueue=c,s.lastRenderedState=l}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function vd(e){var t=ft(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var s=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);cn(l,t.memoizedState)||(St=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,s]}function Oy(e,t,n){var s=Ne,r=ft(),l=De;if(l){if(n===void 0)throw Error(G(407));n=n()}else n=t();var i=!cn((qe||r).memoizedState,n);i&&(r.memoizedState=n,St=!0),r=r.queue;var o=$y.bind(null,s,r,e);if(Yi(2048,8,o,[e]),r.getSnapshot!==t||i||ut!==null&&ut.memoizedState.tag&1){if(s.flags|=2048,Zr(9,mu(),zy.bind(null,s,r,n,t),null),Ve===null)throw Error(G(349));l||ma&124||Dy(s,t,n)}return n}function Dy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t=om(),Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zy(e,t,n,s){t.value=n,t.getSnapshot=s,Ly(t)&&Uy(e)}function $y(e,t,n){return n(function(){Ly(t)&&Uy(e)})}function Ly(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cn(e,n)}catch{return!0}}function Uy(e){var t=ul(e,2);t!==null&&ln(t,e,2)}function zf(e){var t=Pt();if(typeof e=="function"){var n=e;if(e=n(),Ia){Js(!0);try{n()}finally{Js(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:e},t}function Hy(e,t,n,s){return e.baseState=n,um(e,qe,typeof s=="function"?s:js)}function cS(e,t,n,s,r){if(pu(e))throw Error(G(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)}};xe.T!==null?n(!0):l.isTransition=!1,s(l),n=t.pending,n===null?(l.next=t.pending=l,By(t,l)):(l.next=n.next,t.pending=n.next=l)}}function By(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var l=xe.T,i={};xe.T=i;try{var o=n(r,s),c=xe.S;c!==null&&c(i,o),kx(e,t,o)}catch(d){$f(e,t,d)}finally{xe.T=l}}else try{l=n(r,s),kx(e,t,l)}catch(d){$f(e,t,d)}}function kx(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Sx(e,t,s)},function(s){return $f(e,t,s)}):Sx(e,t,n)}function Sx(e,t,n){t.status="fulfilled",t.value=n,Iy(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,By(e,n)))}function $f(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Iy(t),t=t.next;while(t!==s)}e.action=null}function Iy(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qy(e,t){return t}function Cx(e,t){if(De){var n=Ve.formState;if(n!==null){e:{var s=Ne;if(De){if(rt){t:{for(var r=rt,l=In;r.nodeType!==8;){if(!l){r=null;break t}if(r=Rn(r.nextSibling),r===null){r=null;break t}}l=r.data,r=l==="F!"||l==="F"?r:null}if(r){rt=Rn(r.nextSibling),s=r.data==="F!";break e}}Ha(s)}s=!1}s&&(t=n[0])}}return n=Pt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qy,lastRenderedState:t},n.queue=s,n=ab.bind(null,Ne,s),s.dispatch=n,s=zf(!1),l=mm.bind(null,Ne,!1,s.queue),s=Pt(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=cS.bind(null,Ne,r,l,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function Tx(e){var t=ft();return Gy(t,qe,e)}function Gy(e,t,n){if(t=um(e,t,qy)[0],e=Ko(js)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Vi(t)}catch(i){throw i===Pi?fu:i}else s=t;t=ft();var r=t.queue,l=r.dispatch;return n!==t.memoizedState&&(Ne.flags|=2048,Zr(9,mu(),uS.bind(null,r,n),null)),[s,l,e]}function uS(e,t){e.action=t}function Ex(e){var t=ft(),n=qe;if(n!==null)return Gy(t,n,e);ft(),t=t.memoizedState,n=ft();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Zr(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=om(),Ne.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function mu(){return{destroy:void 0,resource:void 0}}function Py(){return ft().memoizedState}function Qo(e,t,n,s){var r=Pt();s=s===void 0?null:s,Ne.flags|=e,r.memoizedState=Zr(1|t,mu(),n,s)}function Yi(e,t,n,s){var r=ft();s=s===void 0?null:s;var l=r.memoizedState.inst;qe!==null&&s!==null&&sm(s,qe.memoizedState.deps)?r.memoizedState=Zr(t,l,n,s):(Ne.flags|=e,r.memoizedState=Zr(1|t,l,n,s))}function Rx(e,t){Qo(8390656,8,e,t)}function Vy(e,t){Yi(2048,8,e,t)}function Yy(e,t){return Yi(4,2,e,t)}function Xy(e,t){return Yi(4,4,e,t)}function Fy(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 Ky(e,t,n){n=n!=null?n.concat([e]):null,Yi(4,4,Fy.bind(null,t,e),n)}function dm(){}function Qy(e,t){var n=ft();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&sm(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Zy(e,t){var n=ft();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&sm(t,s[1]))return s[0];if(s=e(),Ia){Js(!0);try{e()}finally{Js(!1)}}return n.memoizedState=[s,t],s}function fm(e,t,n){return n===void 0||ma&1073741824?e.memoizedState=t:(e.memoizedState=n,e=Ib(),Ne.lanes|=e,xa|=e,n)}function Wy(e,t,n,s){return cn(n,t)?n:Qr.current!==null?(e=fm(e,n,s),cn(e,t)||(St=!0),e):ma&42?(e=Ib(),Ne.lanes|=e,xa|=e,t):(St=!0,e.memoizedState=n)}function Jy(e,t,n,s,r){var l=ze.p;ze.p=l!==0&&8>l?l:8;var i=xe.T,o={};xe.T=o,mm(e,!1,t,n);try{var c=r(),d=xe.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=lS(c,s);li(e,t,f,rn(e))}else li(e,t,s,rn(e))}catch(h){li(e,t,{then:function(){},status:"rejected",reason:h},rn())}finally{ze.p=l,xe.T=i}}function dS(){}function Lf(e,t,n,s){if(e.tag!==5)throw Error(G(476));var r=eb(e).queue;Jy(e,r,t,Ma,n===null?dS:function(){return tb(e),n(s)})}function eb(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ma,baseState:Ma,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:Ma},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tb(e){var t=eb(e).next.queue;li(e,t,{},rn())}function hm(){return $t(_i)}function nb(){return ft().memoizedState}function sb(){return ft().memoizedState}function fS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=rn();e=la(n);var s=ia(t,e,n);s!==null&&(ln(s,t,n),si(s,t,n)),t={cache:Jh()},e.payload=t;return}t=t.return}}function hS(e,t,n){var s=rn();n={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},pu(e)?rb(t,n):(n=Kh(e,t,n,s),n!==null&&(ln(n,e,s),lb(n,t,s)))}function ab(e,t,n){var s=rn();li(e,t,n,s)}function li(e,t,n,s){var r={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(pu(e))rb(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,cn(o,i))return du(e,t,r,0),Ve===null&&uu(),!1}catch{}finally{}if(n=Kh(e,t,r,s),n!==null)return ln(n,e,s),lb(n,t,s),!0}return!1}function mm(e,t,n,s){if(s={lane:2,revertLane:wm(),action:s,hasEagerState:!1,eagerState:null,next:null},pu(e)){if(t)throw Error(G(479))}else t=Kh(e,n,s,2),t!==null&&ln(t,e,2)}function pu(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function rb(e,t){Lr=bc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lb(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Qv(e,n)}}var wc={readContext:$t,use:hu,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it},ib={readContext:$t,use:hu,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Rx,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Qo(4194308,4,Fy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4194308,4,e,t)},useInsertionEffect:function(e,t){Qo(4,2,e,t)},useMemo:function(e,t){var n=Pt();t=t===void 0?null:t;var s=e();if(Ia){Js(!0);try{e()}finally{Js(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Pt();if(n!==void 0){var r=n(t);if(Ia){Js(!0);try{n(t)}finally{Js(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=hS.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=zf(e);var t=e.queue,n=ab.bind(null,Ne,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:dm,useDeferredValue:function(e,t){var n=Pt();return fm(n,e,t)},useTransition:function(){var e=zf(!1);return e=Jy.bind(null,Ne,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Ne,r=Pt();if(De){if(n===void 0)throw Error(G(407));n=n()}else{if(n=t(),Ve===null)throw Error(G(349));Ee&124||Dy(s,t,n)}r.memoizedState=n;var l={value:n,getSnapshot:t};return r.queue=l,Rx($y.bind(null,s,l,e),[e]),s.flags|=2048,Zr(9,mu(),zy.bind(null,s,l,n,t),null),n},useId:function(){var e=Pt(),t=Ve.identifierPrefix;if(De){var n=hs,s=fs;n=(s&~(1<<32-an(s)-1)).toString(32)+n,t="«"+t+"R"+n,n=jc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=iS++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:hm,useFormState:Cx,useActionState:Cx,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=mm.bind(null,Ne,!0,n),n.dispatch=t,[e,t]},useMemoCache:cm,useCacheRefresh:function(){return Pt().memoizedState=fS.bind(null,Ne)}},ob={readContext:$t,use:hu,useCallback:Qy,useContext:$t,useEffect:Vy,useImperativeHandle:Ky,useInsertionEffect:Yy,useLayoutEffect:Xy,useMemo:Zy,useReducer:Ko,useRef:Py,useState:function(){return Ko(js)},useDebugValue:dm,useDeferredValue:function(e,t){var n=ft();return Wy(n,qe.memoizedState,e,t)},useTransition:function(){var e=Ko(js)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:Vi(e),t]},useSyncExternalStore:Oy,useId:nb,useHostTransitionStatus:hm,useFormState:Tx,useActionState:Tx,useOptimistic:function(e,t){var n=ft();return Hy(n,qe,e,t)},useMemoCache:cm,useCacheRefresh:sb},mS={readContext:$t,use:hu,useCallback:Qy,useContext:$t,useEffect:Vy,useImperativeHandle:Ky,useInsertionEffect:Yy,useLayoutEffect:Xy,useMemo:Zy,useReducer:vd,useRef:Py,useState:function(){return vd(js)},useDebugValue:dm,useDeferredValue:function(e,t){var n=ft();return qe===null?fm(n,e,t):Wy(n,qe.memoizedState,e,t)},useTransition:function(){var e=vd(js)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:Vi(e),t]},useSyncExternalStore:Oy,useId:nb,useHostTransitionStatus:hm,useFormState:Ex,useActionState:Ex,useOptimistic:function(e,t){var n=ft();return qe!==null?Hy(n,qe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:cm,useCacheRefresh:sb},Hr=null,yi=0;function jo(e){var t=yi;return yi+=1,Hr===null&&(Hr=[]),Ty(Hr,e,t)}function Ol(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wo(e,t){throw t.$$typeof===P1?Error(G(525)):(e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ax(e){var t=e._init;return t(e._payload)}function cb(e){function t(x,p){if(e){var v=x.deletions;v===null?(x.deletions=[p],x.flags|=16):v.push(p)}}function n(x,p){if(!e)return null;for(;p!==null;)t(x,p),p=p.sibling;return null}function s(x){for(var p=new Map;x!==null;)x.key!==null?p.set(x.key,x):p.set(x.index,x),x=x.sibling;return p}function r(x,p){return x=vs(x,p),x.index=0,x.sibling=null,x}function l(x,p,v){return x.index=v,e?(v=x.alternate,v!==null?(v=v.index,v<p?(x.flags|=67108866,p):v):(x.flags|=67108866,p)):(x.flags|=1048576,p)}function i(x){return e&&x.alternate===null&&(x.flags|=67108866),x}function o(x,p,v,w){return p===null||p.tag!==6?(p=pd(v,x.mode,w),p.return=x,p):(p=r(p,v),p.return=x,p)}function c(x,p,v,w){var N=v.type;return N===br?f(x,p,v.props.children,w,v.key):p!==null&&(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Xs&&Ax(N)===p.type)?(p=r(p,v.props),Ol(p,v),p.return=x,p):(p=Xo(v.type,v.key,v.props,null,x.mode,w),Ol(p,v),p.return=x,p)}function d(x,p,v,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=xd(v,x.mode,w),p.return=x,p):(p=r(p,v.children||[]),p.return=x,p)}function f(x,p,v,w,N){return p===null||p.tag!==7?(p=Oa(v,x.mode,w,N),p.return=x,p):(p=r(p,v),p.return=x,p)}function h(x,p,v){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=pd(""+p,x.mode,v),p.return=x,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case mo:return v=Xo(p.type,p.key,p.props,null,x.mode,v),Ol(v,p),v.return=x,v;case Il:return p=xd(p,x.mode,v),p.return=x,p;case Xs:var w=p._init;return p=w(p._payload),h(x,p,v)}if(ql(p)||El(p))return p=Oa(p,x.mode,v,null),p.return=x,p;if(typeof p.then=="function")return h(x,jo(p),v);if(p.$$typeof===ds)return h(x,yo(x,p),v);wo(x,p)}return null}function m(x,p,v,w){var N=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return N!==null?null:o(x,p,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case mo:return v.key===N?c(x,p,v,w):null;case Il:return v.key===N?d(x,p,v,w):null;case Xs:return N=v._init,v=N(v._payload),m(x,p,v,w)}if(ql(v)||El(v))return N!==null?null:f(x,p,v,w,null);if(typeof v.then=="function")return m(x,p,jo(v),w);if(v.$$typeof===ds)return m(x,p,yo(x,v),w);wo(x,v)}return null}function g(x,p,v,w,N){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return x=x.get(v)||null,o(p,x,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case mo:return x=x.get(w.key===null?v:w.key)||null,c(p,x,w,N);case Il:return x=x.get(w.key===null?v:w.key)||null,d(p,x,w,N);case Xs:var k=w._init;return w=k(w._payload),g(x,p,v,w,N)}if(ql(w)||El(w))return x=x.get(v)||null,f(p,x,w,N,null);if(typeof w.then=="function")return g(x,p,v,jo(w),N);if(w.$$typeof===ds)return g(x,p,v,yo(p,w),N);wo(p,w)}return null}function b(x,p,v,w){for(var N=null,k=null,_=p,S=p=0,R=null;_!==null&&S<v.length;S++){_.index>S?(R=_,_=null):R=_.sibling;var M=m(x,_,v[S],w);if(M===null){_===null&&(_=R);break}e&&_&&M.alternate===null&&t(x,_),p=l(M,p,S),k===null?N=M:k.sibling=M,k=M,_=R}if(S===v.length)return n(x,_),De&&Ea(x,S),N;if(_===null){for(;S<v.length;S++)_=h(x,v[S],w),_!==null&&(p=l(_,p,S),k===null?N=_:k.sibling=_,k=_);return De&&Ea(x,S),N}for(_=s(_);S<v.length;S++)R=g(_,x,S,v[S],w),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?S:R.key),p=l(R,p,S),k===null?N=R:k.sibling=R,k=R);return e&&_.forEach(function(L){return t(x,L)}),De&&Ea(x,S),N}function y(x,p,v,w){if(v==null)throw Error(G(151));for(var N=null,k=null,_=p,S=p=0,R=null,M=v.next();_!==null&&!M.done;S++,M=v.next()){_.index>S?(R=_,_=null):R=_.sibling;var L=m(x,_,M.value,w);if(L===null){_===null&&(_=R);break}e&&_&&L.alternate===null&&t(x,_),p=l(L,p,S),k===null?N=L:k.sibling=L,k=L,_=R}if(M.done)return n(x,_),De&&Ea(x,S),N;if(_===null){for(;!M.done;S++,M=v.next())M=h(x,M.value,w),M!==null&&(p=l(M,p,S),k===null?N=M:k.sibling=M,k=M);return De&&Ea(x,S),N}for(_=s(_);!M.done;S++,M=v.next())M=g(_,x,S,M.value,w),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?S:M.key),p=l(M,p,S),k===null?N=M:k.sibling=M,k=M);return e&&_.forEach(function(I){return t(x,I)}),De&&Ea(x,S),N}function j(x,p,v,w){if(typeof v=="object"&&v!==null&&v.type===br&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case mo:e:{for(var N=v.key;p!==null;){if(p.key===N){if(N=v.type,N===br){if(p.tag===7){n(x,p.sibling),w=r(p,v.props.children),w.return=x,x=w;break e}}else if(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Xs&&Ax(N)===p.type){n(x,p.sibling),w=r(p,v.props),Ol(w,v),w.return=x,x=w;break e}n(x,p);break}else t(x,p);p=p.sibling}v.type===br?(w=Oa(v.props.children,x.mode,w,v.key),w.return=x,x=w):(w=Xo(v.type,v.key,v.props,null,x.mode,w),Ol(w,v),w.return=x,x=w)}return i(x);case Il:e:{for(N=v.key;p!==null;){if(p.key===N)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(x,p.sibling),w=r(p,v.children||[]),w.return=x,x=w;break e}else{n(x,p);break}else t(x,p);p=p.sibling}w=xd(v,x.mode,w),w.return=x,x=w}return i(x);case Xs:return N=v._init,v=N(v._payload),j(x,p,v,w)}if(ql(v))return b(x,p,v,w);if(El(v)){if(N=El(v),typeof N!="function")throw Error(G(150));return v=N.call(v),y(x,p,v,w)}if(typeof v.then=="function")return j(x,p,jo(v),w);if(v.$$typeof===ds)return j(x,p,yo(x,v),w);wo(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,p!==null&&p.tag===6?(n(x,p.sibling),w=r(p,v),w.return=x,x=w):(n(x,p),w=pd(v,x.mode,w),w.return=x,x=w),i(x)):n(x,p)}return function(x,p,v,w){try{yi=0;var N=j(x,p,v,w);return Hr=null,N}catch(_){if(_===Pi||_===fu)throw _;var k=nn(29,_,null,x.mode);return k.lanes=w,k.return=x,k}finally{}}}var Wr=cb(!0),ub=cb(!1),jn=Jn(null),Fn=null;function Qs(e){var t=e.alternate;We(vt,vt.current&1),We(jn,e),Fn===null&&(t===null||Qr.current!==null||t.memoizedState!==null)&&(Fn=e)}function db(e){if(e.tag===22){if(We(vt,vt.current),We(jn,e),Fn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Fn=e)}}else Zs()}function Zs(){We(vt,vt.current),We(jn,jn.current)}function ps(e){Ct(jn),Fn===e&&(Fn=null),Ct(vt)}var vt=Jn(0);function _c(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==="$?"||eh(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 yd(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Uf={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=rn(),r=la(s);r.payload=t,n!=null&&(r.callback=n),t=ia(e,r,s),t!==null&&(ln(t,e,s),si(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=rn(),r=la(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=ia(e,r,s),t!==null&&(ln(t,e,s),si(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rn(),s=la(n);s.tag=2,t!=null&&(s.callback=t),t=ia(e,s,n),t!==null&&(ln(t,e,n),si(t,e,n))}};function Mx(e,t,n,s,r,l,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,l,i):t.prototype&&t.prototype.isPureReactComponent?!xi(n,s)||!xi(r,l):!0}function Ox(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Uf.enqueueReplaceState(t,t.state,null)}function qa(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=Ke({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var Nc=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 fb(e){Nc(e)}function hb(e){console.error(e)}function mb(e){Nc(e)}function kc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Dx(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Hf(e,t,n){return n=la(n),n.tag=3,n.payload={element:null},n.callback=function(){kc(e,t)},n}function pb(e){return e=la(e),e.tag=3,e}function xb(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var l=s.value;e.payload=function(){return r(l)},e.callback=function(){Dx(t,n,s)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Dx(t,n,s),typeof r!="function"&&(oa===null?oa=new Set([this]):oa.add(this));var o=s.stack;this.componentDidCatch(s.value,{componentStack:o!==null?o:""})})}function pS(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&qi(t,n,r,!0),n=jn.current,n!==null){switch(n.tag){case 13:return Fn===null?Xf():n.alternate===null&<===0&&(lt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===Af?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),Rd(e,s,r)),!1;case 22:return n.flags|=65536,s===Af?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),Rd(e,s,r)),!1}throw Error(G(435,n.tag))}return Rd(e,s,r),Xf(),!1}if(De)return t=jn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Sf&&(e=Error(G(422),{cause:s}),gi(vn(e,n)))):(s!==Sf&&(t=Error(G(423),{cause:s}),gi(vn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=vn(s,n),r=Hf(e.stateNode,s,r),gd(e,r),lt!==4&&(lt=2)),!1;var l=Error(G(520),{cause:s});if(l=vn(l,n),ci===null?ci=[l]:ci.push(l),lt!==4&&(lt=2),t===null)return!0;s=vn(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Hf(n.stateNode,s,e),gd(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"&&(oa===null||!oa.has(l))))return n.flags|=65536,r&=-r,n.lanes|=r,r=pb(r),xb(r,e,n,s),gd(n,r),!1}n=n.return}while(n!==null);return!1}var gb=Error(G(461)),St=!1;function Rt(e,t,n,s){t.child=e===null?ub(t,null,n,s):Wr(t,e.child,n,s)}function zx(e,t,n,s,r){n=n.render;var l=t.ref;if("ref"in s){var i={};for(var o in s)o!=="ref"&&(i[o]=s[o])}else i=s;return Ba(t),s=am(e,t,n,i,l,r),o=rm(),e!==null&&!St?(lm(e,t,r),ws(e,t,r)):(De&&o&&Zh(t),t.flags|=1,Rt(e,t,s,r),t.child)}function $x(e,t,n,s,r){if(e===null){var l=n.type;return typeof l=="function"&&!Qh(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,vb(e,t,l,s,r)):(e=Xo(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!pm(e,r)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:xi,n(i,s)&&e.ref===t.ref)return ws(e,t,r)}return t.flags|=1,e=vs(l,s),e.ref=t.ref,e.return=t,t.child=e}function vb(e,t,n,s,r){if(e!==null){var l=e.memoizedProps;if(xi(l,s)&&e.ref===t.ref)if(St=!1,t.pendingProps=s=l,pm(e,r))e.flags&131072&&(St=!0);else return t.lanes=e.lanes,ws(e,t,r)}return Bf(e,t,n,s,r)}function yb(e,t,n){var s=t.pendingProps,r=s.children,l=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if(t.flags&128){if(s=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&~s}else t.childLanes=0,t.child=null;return Lx(e,t,s,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fo(t,l!==null?l.cachePool:null),l!==null?Nx(t,l):Df(),db(t);else return t.lanes=t.childLanes=536870912,Lx(e,t,l!==null?l.baseLanes|n:n,n)}else l!==null?(Fo(t,l.cachePool),Nx(t,l),Zs(),t.memoizedState=null):(e!==null&&Fo(t,null),Df(),Zs());return Rt(e,t,r,n),t.child}function Lx(e,t,n,s){var r=em();return r=r===null?null:{parent:gt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Fo(t,null),Df(),db(t),e!==null&&qi(e,t,s,!0),null}function Zo(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(G(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bf(e,t,n,s,r){return Ba(t),n=am(e,t,n,s,void 0,r),s=rm(),e!==null&&!St?(lm(e,t,r),ws(e,t,r)):(De&&s&&Zh(t),t.flags|=1,Rt(e,t,n,r),t.child)}function Ux(e,t,n,s,r,l){return Ba(t),t.updateQueue=null,n=My(t,s,n,r),Ay(e),s=rm(),e!==null&&!St?(lm(e,t,l),ws(e,t,l)):(De&&s&&Zh(t),t.flags|=1,Rt(e,t,n,l),t.child)}function Hx(e,t,n,s,r){if(Ba(t),t.stateNode===null){var l=Tr,i=n.contextType;typeof i=="object"&&i!==null&&(l=$t(i)),l=new n(s,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Uf,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=s,l.state=t.memoizedState,l.refs={},tm(t),i=n.contextType,l.context=typeof i=="object"&&i!==null?$t(i):Tr,l.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(yd(t,n,i,s),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&&Uf.enqueueReplaceState(l,l.state,null),ri(t,s,l,r),ai(),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){l=t.stateNode;var o=t.memoizedProps,c=qa(n,o);l.props=c;var d=l.context,f=n.contextType;i=Tr,typeof f=="object"&&f!==null&&(i=$t(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)&&Ox(t,l,s,i),Fs=!1;var m=t.memoizedState;l.state=m,ri(t,s,l,r),ai(),d=t.memoizedState,o||m!==d||Fs?(typeof h=="function"&&(yd(t,n,h,s),d=t.memoizedState),(c=Fs||Mx(t,n,c,s,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=s,t.memoizedState=d),l.props=s,l.state=d,l.context=i,s=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{l=t.stateNode,Mf(e,t),i=t.memoizedProps,f=qa(n,i),l.props=f,h=t.pendingProps,m=l.context,d=n.contextType,c=Tr,typeof d=="object"&&d!==null&&(c=$t(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)&&Ox(t,l,s,c),Fs=!1,m=t.memoizedState,l.state=m,ri(t,s,l,r),ai();var g=t.memoizedState;i!==h||m!==g||Fs||e!==null&&e.dependencies!==null&&vc(e.dependencies)?(typeof o=="function"&&(yd(t,n,o,s),g=t.memoizedState),(f=Fs||Mx(t,n,f,s,m,g,c)||e!==null&&e.dependencies!==null&&vc(e.dependencies))?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(s,g,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(s,g,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=s,t.memoizedState=g),l.props=s,l.state=g,l.context=c,s=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),s=!1)}return l=s,Zo(e,t),s=(t.flags&128)!==0,l||s?(l=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:l.render(),t.flags|=1,e!==null&&s?(t.child=Wr(t,e.child,null,r),t.child=Wr(t,null,n,r)):Rt(e,t,n,r),t.memoizedState=l.state,e=t.child):e=ws(e,t,r),e}function Bx(e,t,n,s){return Ii(),t.flags|=256,Rt(e,t,n,s),t.child}var bd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jd(e){return{baseLanes:e,cachePool:Sy()}}function wd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=yn),e}function bb(e,t,n){var s=t.pendingProps,r=!1,l=(t.flags&128)!==0,i;if((i=l)||(i=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(r?Qs(t):Zs(),De){var o=rt,c;if(c=o){e:{for(c=o,o=In;c.nodeType!==8;){if(!o){o=null;break e}if(c=Rn(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:Da!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},c=nn(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,Ht=t,rt=null,c=!0):c=!1}c||Ha(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return eh(o)?t.lanes=32:t.lanes=536870912,null;ps(t)}return o=s.children,s=s.fallback,r?(Zs(),r=t.mode,o=Sc({mode:"hidden",children:o},r),s=Oa(s,r,n,null),o.return=t,s.return=t,o.sibling=s,t.child=o,r=t.child,r.memoizedState=jd(n),r.childLanes=wd(e,i,n),t.memoizedState=bd,s):(Qs(t),If(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(l)t.flags&256?(Qs(t),t.flags&=-257,t=_d(e,t,n)):t.memoizedState!==null?(Zs(),t.child=e.child,t.flags|=128,t=null):(Zs(),r=s.fallback,o=t.mode,s=Sc({mode:"visible",children:s.children},o),r=Oa(r,o,n,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,Wr(t,e.child,null,n),s=t.child,s.memoizedState=jd(n),s.childLanes=wd(e,i,n),t.memoizedState=bd,t=r);else if(Qs(t),eh(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,s=Error(G(419)),s.stack="",s.digest=i,gi({value:s,source:null,stack:null}),t=_d(e,t,n)}else if(St||qi(e,t,n,!1),i=(n&e.childLanes)!==0,St||i){if(i=Ve,i!==null&&(s=n&-n,s=s&42?1:Hh(s),s=s&(i.suspendedLanes|n)?0:s,s!==0&&s!==c.retryLane))throw c.retryLane=s,ul(e,s),ln(i,e,s),gb;o.data==="$?"||Xf(),t=_d(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,rt=Rn(o.nextSibling),Ht=t,De=!0,za=null,In=!1,e!==null&&(pn[xn++]=fs,pn[xn++]=hs,pn[xn++]=Da,fs=e.id,hs=e.overflow,Da=t),t=If(t,s.children),t.flags|=4096);return t}return r?(Zs(),r=s.fallback,o=t.mode,c=e.child,d=c.sibling,s=vs(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,d!==null?r=vs(d,r):(r=Oa(r,o,n,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,s=r,r=t.child,o=e.child.memoizedState,o===null?o=jd(n):(c=o.cachePool,c!==null?(d=gt._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=Sy(),o={baseLanes:o.baseLanes|n,cachePool:c}),r.memoizedState=o,r.childLanes=wd(e,i,n),t.memoizedState=bd,s):(Qs(t),n=e.child,e=n.sibling,n=vs(n,{mode:"visible",children:s.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 If(e,t){return t=Sc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=nn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function _d(e,t,n){return Wr(t,e.child,null,n),e=If(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ix(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Tf(e.return,t,n)}function Nd(e,t,n,s,r){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=s,l.tail=n,l.tailMode=r)}function jb(e,t,n){var s=t.pendingProps,r=s.revealOrder,l=s.tail;if(Rt(e,t,s.children,n),s=vt.current,s&2)s=s&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&&Ix(e,n,t);else if(e.tag===19)Ix(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}s&=1}switch(We(vt,s),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&_c(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&&_c(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 ws(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xa|=t.lanes,!(n&t.childLanes))if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,n=vs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pm(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&vc(e)))}function xS(e,t,n){switch(t.tag){case 3:uc(t,t.stateNode.containerInfo),Ks(t,gt,e.memoizedState.cache),Ii();break;case 27:case 5:xf(t);break;case 4:uc(t,t.stateNode.containerInfo);break;case 10:Ks(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Qs(t),t.flags|=128,null):n&t.child.childLanes?bb(e,t,n):(Qs(t),e=ws(e,t,n),e!==null?e.sibling:null);Qs(t);break;case 19:var r=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(qi(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return jb(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),We(vt,vt.current),s)break;return null;case 22:case 23:return t.lanes=0,yb(e,t,n);case 24:Ks(t,gt,e.memoizedState.cache)}return ws(e,t,n)}function wb(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!pm(e,n)&&!(t.flags&128))return St=!1,xS(e,t,n);St=!!(e.flags&131072)}else St=!1,De&&t.flags&1048576&&Ny(t,gc,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,r=s._init;if(s=r(s._payload),t.type=s,typeof s=="function")Qh(s)?(e=qa(s,e),t.tag=1,t=Hx(null,t,s,e,n)):(t.tag=0,t=Bf(null,t,s,e,n));else{if(s!=null){if(r=s.$$typeof,r===$h){t.tag=11,t=zx(null,t,s,e,n);break e}else if(r===Lh){t.tag=14,t=$x(null,t,s,e,n);break e}}throw t=mf(s)||s,Error(G(306,t,""))}}return t;case 0:return Bf(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=qa(s,t.pendingProps),Hx(e,t,s,r,n);case 3:e:{if(uc(t,t.stateNode.containerInfo),e===null)throw Error(G(387));s=t.pendingProps;var l=t.memoizedState;r=l.element,Mf(e,t),ri(t,s,null,n);var i=t.memoizedState;if(s=i.cache,Ks(t,gt,s),s!==l.cache&&Ef(t,[gt],n,!0),ai(),s=i.element,l.isDehydrated)if(l={element:s,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){t=Bx(e,t,s,n);break e}else if(s!==r){r=vn(Error(G(424)),t),gi(r),t=Bx(e,t,s,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(rt=Rn(e.firstChild),Ht=t,De=!0,za=null,In=!0,n=ub(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),s===r){t=ws(e,t,n);break e}Rt(e,t,s,n)}t=t.child}return t;case 26:return Zo(e,t),e===null?(n=ag(t.type,null,t.pendingProps,null))?t.memoizedState=n:De||(n=t.type,e=t.pendingProps,s=Oc(ra.current).createElement(n),s[zt]=t,s[Xt]=e,Mt(s,n,e),kt(s),t.stateNode=s):t.memoizedState=ag(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xf(t),e===null&&De&&(s=t.stateNode=oj(t.type,t.pendingProps,ra.current),Ht=t,In=!0,r=rt,wa(t.type)?(th=r,rt=Rn(s.firstChild)):rt=r),Rt(e,t,t.pendingProps.children,n),Zo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((r=s=rt)&&(s=PS(s,t.type,t.pendingProps,In),s!==null?(t.stateNode=s,Ht=t,rt=Rn(s.firstChild),In=!1,r=!0):r=!1),r||Ha(t)),xf(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,s=l.children,Wf(r,l)?s=null:i!==null&&Wf(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=am(e,t,oS,null,null,n),_i._currentValue=r),Zo(e,t),Rt(e,t,s,n),t.child;case 6:return e===null&&De&&((e=n=rt)&&(n=VS(n,t.pendingProps,In),n!==null?(t.stateNode=n,Ht=t,rt=null,e=!0):e=!1),e||Ha(t)),null;case 13:return bb(e,t,n);case 4:return uc(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Wr(t,null,s,n):Rt(e,t,s,n),t.child;case 11:return zx(e,t,t.type,t.pendingProps,n);case 7:return Rt(e,t,t.pendingProps,n),t.child;case 8:return Rt(e,t,t.pendingProps.children,n),t.child;case 12:return Rt(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Ks(t,t.type,s.value),Rt(e,t,s.children,n),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,Ba(t),r=$t(r),s=s(r),t.flags|=1,Rt(e,t,s,n),t.child;case 14:return $x(e,t,t.type,t.pendingProps,n);case 15:return vb(e,t,t.type,t.pendingProps,n);case 19:return jb(e,t,n);case 31:return s=t.pendingProps,n=t.mode,s={mode:s.mode,children:s.children},e===null?(n=Sc(s,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=vs(e.child,s),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return yb(e,t,n);case 24:return Ba(t),s=$t(gt),e===null?(r=em(),r===null&&(r=Ve,l=Jh(),r.pooledCache=l,l.refCount++,l!==null&&(r.pooledCacheLanes|=n),r=l),t.memoizedState={parent:s,cache:r},tm(t),Ks(t,gt,r)):(e.lanes&n&&(Mf(e,t),ri(t,null,null,n),ai()),r=e.memoizedState,l=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Ks(t,gt,s)):(s=l.cache,Ks(t,gt,s),s!==r.cache&&Ef(t,[gt],n,!0))),Rt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(G(156,t.tag))}function ls(e){e.flags|=4}function qx(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!dj(t)){if(t=jn.current,t!==null&&((Ee&4194048)===Ee?Fn!==null:(Ee&62914560)!==Ee&&!(Ee&536870912)||t!==Fn))throw ni=Af,Cy;e.flags|=8192}}function _o(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Fv():536870912,e.lanes|=t,Jr|=t)}function Dl(e,t){if(!De)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function gS(e,t,n){var s=t.pendingProps;switch(Wh(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return nt(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ys(gt),Yr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ml(t)?ls(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vx())),nt(t),null;case 26:return n=t.memoizedState,e===null?(ls(t),n!==null?(nt(t),qx(t,n)):(nt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(ls(t),nt(t),qx(t,n)):(nt(t),t.flags&=-16777217):(e.memoizedProps!==s&&ls(t),nt(t),t.flags&=-16777217),null;case 27:dc(t),n=ra.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ls(t);else{if(!s){if(t.stateNode===null)throw Error(G(166));return nt(t),null}e=Yn.current,Ml(t)?xx(t):(e=oj(r,s,n),t.stateNode=e,ls(t))}return nt(t),null;case 5:if(dc(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ls(t);else{if(!s){if(t.stateNode===null)throw Error(G(166));return nt(t),null}if(e=Yn.current,Ml(t))xx(t);else{switch(r=Oc(ra.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 s.is=="string"?r.createElement("select",{is:s.is}):r.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?r.createElement(n,{is:s.is}):r.createElement(n)}}e[zt]=t,e[Xt]=s;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(Mt(e,n,s),n){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&ls(t)}}return nt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ls(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(G(166));if(e=ra.current,Ml(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=Ht,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[zt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||rj(e.nodeValue,n)),e||Ha(t)}else e=Oc(e).createTextNode(s),e[zt]=t,t.stateNode=e}return nt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ml(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(G(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(G(317));r[zt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;nt(t),r=!1}else r=vx(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ps(t),t):(ps(t),null)}if(ps(t),t.flags&128)return t.lanes=n,t;if(n=s!==null,e=e!==null&&e.memoizedState!==null,n){s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool);var l=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==r&&(s.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),_o(t,t.updateQueue),nt(t),null;case 4:return Yr(),e===null&&_m(t.stateNode.containerInfo),nt(t),null;case 10:return ys(t.type),nt(t),null;case 19:if(Ct(vt),r=t.memoizedState,r===null)return nt(t),null;if(s=(t.flags&128)!==0,l=r.rendering,l===null)if(s)Dl(r,!1);else{if(lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=_c(e),l!==null){for(t.flags|=128,Dl(r,!1),e=l.updateQueue,t.updateQueue=e,_o(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_y(n,e),n=n.sibling;return We(vt,vt.current&1|2),t.child}e=e.sibling}r.tail!==null&&Xn()>Tc&&(t.flags|=128,s=!0,Dl(r,!1),t.lanes=4194304)}else{if(!s)if(e=_c(l),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,_o(t,e),Dl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!l.alternate&&!De)return nt(t),null}else 2*Xn()-r.renderingStartTime>Tc&&n!==536870912&&(t.flags|=128,s=!0,Dl(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=Xn(),t.sibling=null,e=vt.current,We(vt,s?e&1|2:e&1),t):(nt(t),null);case 22:case 23:return ps(t),nm(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),n=t.updateQueue,n!==null&&_o(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Ct($a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ys(gt),nt(t),null;case 25:return null;case 30:return null}throw Error(G(156,t.tag))}function vS(e,t){switch(Wh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ys(gt),Yr(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return dc(t),null;case 13:if(ps(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ct(vt),null;case 4:return Yr(),null;case 10:return ys(t.type),null;case 22:case 23:return ps(t),nm(),e!==null&&Ct($a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ys(gt),null;case 25:return null;default:return null}}function _b(e,t){switch(Wh(t),t.tag){case 3:ys(gt),Yr();break;case 26:case 27:case 5:dc(t);break;case 4:Yr();break;case 13:ps(t);break;case 19:Ct(vt);break;case 10:ys(t.type);break;case 22:case 23:ps(t),nm(),e!==null&&Ct($a);break;case 24:ys(gt)}}function Xi(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var l=n.create,i=n.inst;s=l(),i.destroy=s}n=n.next}while(n!==r)}}catch(o){Ge(t,t.return,o)}}function pa(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var l=r.next;s=l;do{if((s.tag&e)===e){var i=s.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,r=t;var c=n,d=o;try{d()}catch(f){Ge(r,c,f)}}}s=s.next}while(s!==l)}}catch(f){Ge(t,t.return,f)}}function Nb(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ry(t,n)}catch(s){Ge(e,e.return,s)}}}function kb(e,t,n){n.props=qa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Ge(e,t,s)}}function ii(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(r){Ge(e,t,r)}}function Gn(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){Ge(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){Ge(e,t,r)}else n.current=null}function Sb(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){Ge(e,e.return,r)}}function kd(e,t,n){try{var s=e.stateNode;HS(s,e.type,n,t),s[Xt]=t}catch(r){Ge(e,e.return,r)}}function Cb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wa(e.type)||e.tag===4}function Sd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cb(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&&wa(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 qf(e,t,n){var s=e.tag;if(s===5||s===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=yu));else if(s!==4&&(s===27&&wa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qf(e,t,n),e=e.sibling;e!==null;)qf(e,t,n),e=e.sibling}function Cc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&wa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}function Tb(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Mt(t,s,n),t[zt]=e,t[Xt]=n}catch(l){Ge(e,e.return,l)}}var us=!1,ot=!1,Cd=!1,Gx=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function yS(e,t){if(e=e.containerInfo,Qf=Lc,e=py(e),Xh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,l=s.focusNode;s=s.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 g;h!==n||r!==0&&h.nodeType!==3||(o=i+r),h!==l||s!==0&&h.nodeType!==3||(c=i+s),h.nodeType===3&&(i+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++d===r&&(o=i),m===l&&++f===s&&(c=i),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zf={focusedElem:e,selectionRange:n},Lc=!1,Nt=t;Nt!==null;)if(t=Nt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Nt=e;else for(;Nt!==null;){switch(t=Nt,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,s=n.stateNode;try{var b=qa(n.type,r,n.elementType===n.type);e=s.getSnapshotBeforeUpdate(b,l),s.__reactInternalSnapshotBeforeUpdate=e}catch(y){Ge(n,n.return,y)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Jf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Jf(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(G(163))}if(e=t.sibling,e!==null){e.return=t.return,Nt=e;break}Nt=t.return}}function Eb(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Is(e,n),s&4&&Xi(5,n);break;case 1:if(Is(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Ge(n,n.return,i)}else{var r=qa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Ge(n,n.return,i)}}s&64&&Nb(n),s&512&&ii(n,n.return);break;case 3:if(Is(e,n),s&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{Ry(e,t)}catch(i){Ge(n,n.return,i)}}break;case 27:t===null&&s&4&&Tb(n);case 26:case 5:Is(e,n),t===null&&s&4&&Sb(n),s&512&&ii(n,n.return);break;case 12:Is(e,n);break;case 13:Is(e,n),s&4&&Mb(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=TS.bind(null,n),YS(e,n))));break;case 22:if(s=n.memoizedState!==null||us,!s){t=t!==null&&t.memoizedState!==null||ot,r=us;var l=ot;us=s,(ot=t)&&!l?Vs(e,n,(n.subtreeFlags&8772)!==0):Is(e,n),us=r,ot=l}break;case 30:break;default:Is(e,n)}}function Rb(e){var t=e.alternate;t!==null&&(e.alternate=null,Rb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ih(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,Vt=!1;function is(e,t,n){for(n=n.child;n!==null;)Ab(e,t,n),n=n.sibling}function Ab(e,t,n){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount($i,n)}catch{}switch(n.tag){case 26:ot||Gn(n,t),is(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ot||Gn(n,t);var s=Qe,r=Vt;wa(n.type)&&(Qe=n.stateNode,Vt=!1),is(e,t,n),di(n.stateNode),Qe=s,Vt=r;break;case 5:ot||Gn(n,t);case 6:if(s=Qe,r=Vt,Qe=null,is(e,t,n),Qe=s,Vt=r,Qe!==null)if(Vt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(n.stateNode)}catch(l){Ge(n,t,l)}else try{Qe.removeChild(n.stateNode)}catch(l){Ge(n,t,l)}break;case 18:Qe!==null&&(Vt?(e=Qe,tg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Si(e)):tg(Qe,n.stateNode));break;case 4:s=Qe,r=Vt,Qe=n.stateNode.containerInfo,Vt=!0,is(e,t,n),Qe=s,Vt=r;break;case 0:case 11:case 14:case 15:ot||pa(2,n,t),ot||pa(4,n,t),is(e,t,n);break;case 1:ot||(Gn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&kb(n,t,s)),is(e,t,n);break;case 21:is(e,t,n);break;case 22:ot=(s=ot)||n.memoizedState!==null,is(e,t,n),ot=s;break;default:is(e,t,n)}}function Mb(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){Ge(t,t.return,n)}}function bS(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Gx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Gx),t;default:throw Error(G(435,e.tag))}}function Td(e,t){var n=bS(e);t.forEach(function(s){var r=ES.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}function Zt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],l=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 27:if(wa(o.type)){Qe=o.stateNode,Vt=!1;break e}break;case 5:Qe=o.stateNode,Vt=!1;break e;case 3:case 4:Qe=o.stateNode.containerInfo,Vt=!0;break e}o=o.return}if(Qe===null)throw Error(G(160));Ab(l,i,r),Qe=null,Vt=!1,l=r.alternate,l!==null&&(l.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Ob(t,e),t=t.sibling}var Cn=null;function Ob(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zt(t,e),Wt(e),s&4&&(pa(3,e,e.return),Xi(3,e),pa(5,e,e.return));break;case 1:Zt(t,e),Wt(e),s&512&&(ot||n===null||Gn(n,n.return)),s&64&&us&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=Cn;if(Zt(t,e),Wt(e),s&512&&(ot||n===null||Gn(n,n.return)),s&4){var l=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":l=r.getElementsByTagName("title")[0],(!l||l[Hi]||l[zt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=r.createElement(s),r.head.insertBefore(l,r.querySelector("head > title"))),Mt(l,s,n),l[zt]=e,kt(l),s=l;break e;case"link":var i=lg("link","href",r).get(s+(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(s),Mt(l,s,n),r.head.appendChild(l);break;case"meta":if(i=lg("meta","content",r).get(s+(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(s),Mt(l,s,n),r.head.appendChild(l);break;default:throw Error(G(468,s))}l[zt]=e,kt(l),s=l}e.stateNode=s}else ig(r,e.type,e.stateNode);else e.stateNode=rg(r,s,e.memoizedProps);else l!==s?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,s===null?ig(r,e.type,e.stateNode):rg(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&kd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Zt(t,e),Wt(e),s&512&&(ot||n===null||Gn(n,n.return)),n!==null&&s&4&&kd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Zt(t,e),Wt(e),s&512&&(ot||n===null||Gn(n,n.return)),e.flags&32){r=e.stateNode;try{Fr(r,"")}catch(g){Ge(e,e.return,g)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,kd(e,r,n!==null?n.memoizedProps:r)),s&1024&&(Cd=!0);break;case 6:if(Zt(t,e),Wt(e),s&4){if(e.stateNode===null)throw Error(G(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(g){Ge(e,e.return,g)}}break;case 3:if(ec=null,r=Cn,Cn=Dc(t.containerInfo),Zt(t,e),Cn=r,Wt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(g){Ge(e,e.return,g)}Cd&&(Cd=!1,Db(e));break;case 4:s=Cn,Cn=Dc(e.stateNode.containerInfo),Zt(t,e),Wt(e),Cn=s;break;case 12:Zt(t,e),Wt(e);break;case 13:Zt(t,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(bm=Xn()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Td(e,s)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=us,f=ot;if(us=d||r,ot=f||c,Zt(t,e),ot=f,us=d,Wt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||us||ot||Ra(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(g){Ge(c,c.return,g)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(g){Ge(c,c.return,g)}}}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}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Td(e,n))));break;case 19:Zt(t,e),Wt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Td(e,s)));break;case 30:break;case 21:break;default:Zt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(Cb(s)){n=s;break}s=s.return}if(n==null)throw Error(G(160));switch(n.tag){case 27:var r=n.stateNode,l=Sd(e);Cc(e,l,r);break;case 5:var i=n.stateNode;n.flags&32&&(Fr(i,""),n.flags&=-33);var o=Sd(e);Cc(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=Sd(e);qf(e,d,c);break;default:throw Error(G(161))}}catch(f){Ge(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Db(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Db(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Is(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eb(e,t.alternate,t),t=t.sibling}function Ra(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pa(4,t,t.return),Ra(t);break;case 1:Gn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&kb(t,t.return,n),Ra(t);break;case 27:di(t.stateNode);case 26:case 5:Gn(t,t.return),Ra(t);break;case 22:t.memoizedState===null&&Ra(t);break;case 30:Ra(t);break;default:Ra(t)}e=e.sibling}}function Vs(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,l=t,i=l.flags;switch(l.tag){case 0:case 11:case 15:Vs(r,l,n),Xi(4,l);break;case 1:if(Vs(r,l,n),s=l,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){Ge(s,s.return,d)}if(s=l,r=s.updateQueue,r!==null){var o=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)Ey(c[r],o)}catch(d){Ge(s,s.return,d)}}n&&i&64&&Nb(l),ii(l,l.return);break;case 27:Tb(l);case 26:case 5:Vs(r,l,n),n&&s===null&&i&4&&Sb(l),ii(l,l.return);break;case 12:Vs(r,l,n);break;case 13:Vs(r,l,n),n&&i&4&&Mb(r,l);break;case 22:l.memoizedState===null&&Vs(r,l,n),ii(l,l.return);break;case 30:break;default:Vs(r,l,n)}t=t.sibling}}function xm(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&&Gi(n))}function gm(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gi(e))}function Bn(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zb(e,t,n,s),t=t.sibling}function zb(e,t,n,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Bn(e,t,n,s),r&2048&&Xi(9,t);break;case 1:Bn(e,t,n,s);break;case 3:Bn(e,t,n,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gi(e)));break;case 12:if(r&2048){Bn(e,t,n,s),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){Ge(t,t.return,c)}}else Bn(e,t,n,s);break;case 13:Bn(e,t,n,s);break;case 23:break;case 22:l=t.stateNode,i=t.alternate,t.memoizedState!==null?l._visibility&2?Bn(e,t,n,s):oi(e,t):l._visibility&2?Bn(e,t,n,s):(l._visibility|=2,vr(e,t,n,s,(t.subtreeFlags&10256)!==0)),r&2048&&xm(i,t);break;case 24:Bn(e,t,n,s),r&2048&&gm(t.alternate,t);break;default:Bn(e,t,n,s)}}function vr(e,t,n,s,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var l=e,i=t,o=n,c=s,d=i.flags;switch(i.tag){case 0:case 11:case 15:vr(l,i,o,c,r),Xi(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?vr(l,i,o,c,r):oi(l,i):(f._visibility|=2,vr(l,i,o,c,r)),r&&d&2048&&xm(i.alternate,i);break;case 24:vr(l,i,o,c,r),r&&d&2048&&gm(i.alternate,i);break;default:vr(l,i,o,c,r)}t=t.sibling}}function oi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:oi(n,s),r&2048&&xm(s.alternate,s);break;case 24:oi(n,s),r&2048&&gm(s.alternate,s);break;default:oi(n,s)}t=t.sibling}}var Pl=8192;function rr(e){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)$b(e),e=e.sibling}function $b(e){switch(e.tag){case 26:rr(e),e.flags&Pl&&e.memoizedState!==null&&r2(Cn,e.memoizedState,e.memoizedProps);break;case 5:rr(e);break;case 3:case 4:var t=Cn;Cn=Dc(e.stateNode.containerInfo),rr(e),Cn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Pl,Pl=16777216,rr(e),Pl=t):rr(e));break;default:rr(e)}}function Lb(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 zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Nt=s,Hb(s,e)}Lb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ub(e),e=e.sibling}function Ub(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&pa(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wo(e)):zl(e);break;default:zl(e)}}function Wo(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Nt=s,Hb(s,e)}Lb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pa(8,t,t.return),Wo(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wo(t));break;default:Wo(t)}e=e.sibling}}function Hb(e,t){for(;Nt!==null;){var n=Nt;switch(n.tag){case 0:case 11:case 15:pa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Gi(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Nt=s;else e:for(n=e;Nt!==null;){s=Nt;var r=s.sibling,l=s.return;if(Rb(s),s===n){Nt=null;break e}if(r!==null){r.return=l,Nt=r;break e}Nt=l}}}var jS={getCacheForType:function(e){var t=$t(gt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},wS=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ve=null,Ce=null,Ee=0,Le=0,en=null,ta=!1,dl=!1,vm=!1,_s=0,lt=0,xa=0,La=0,ym=0,yn=0,Jr=0,ci=null,Yt=null,Gf=!1,bm=0,Tc=1/0,Ec=null,oa=null,At=0,ca=null,el=null,Br=0,Pf=0,Vf=null,Bb=null,ui=0,Yf=null;function rn(){if(Ue&2&&Ee!==0)return Ee&-Ee;if(xe.T!==null){var e=Kr;return e!==0?e:wm()}return Zv()}function Ib(){yn===0&&(yn=!(Ee&536870912)||De?Xv():536870912);var e=jn.current;return e!==null&&(e.flags|=32),yn}function ln(e,t,n){(e===Ve&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(tl(e,0),na(e,Ee,yn,!1)),Ui(e,n),(!(Ue&2)||e!==Ve)&&(e===Ve&&(!(Ue&2)&&(La|=n),lt===4&&na(e,Ee,yn,!1)),es(e))}function qb(e,t,n){if(Ue&6)throw Error(G(327));var s=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Li(e,t),r=s?kS(e,t):Ed(e,t,!0),l=s;do{if(r===0){dl&&!s&&na(e,t,0,!1);break}else{if(n=e.current.alternate,l&&!_S(n)){r=Ed(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=ci;var c=o.current.memoizedState.isDehydrated;if(c&&(tl(o,i).flags|=256),i=Ed(o,i,!1),i!==2){if(vm&&!c){o.errorRecoveryDisabledLanes|=l,La|=l,r=4;break e}l=Yt,Yt=r,l!==null&&(Yt===null?Yt=l:Yt.push.apply(Yt,l))}r=i}if(l=!1,r!==2)continue}}if(r===1){tl(e,0),na(e,t,0,!0);break}e:{switch(s=e,l=r,l){case 0:case 1:throw Error(G(345));case 4:if((t&4194048)!==t)break;case 6:na(s,t,yn,!ta);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(G(329))}if((t&62914560)===t&&(r=bm+300-Xn(),10<r)){if(na(s,t,yn,!ta),lu(s,0,!0)!==0)break e;s.timeoutHandle=ij(Px.bind(null,s,n,Yt,Ec,Gf,t,yn,La,Jr,ta,l,2,-0,0),r);break e}Px(s,n,Yt,Ec,Gf,t,yn,La,Jr,ta,l,0,-0,0)}}break}while(!0);es(e)}function Px(e,t,n,s,r,l,i,o,c,d,f,h,m,g){if(e.timeoutHandle=-1,h=t.subtreeFlags,(h&8192||(h&16785408)===16785408)&&(wi={stylesheets:null,count:0,unsuspend:a2},$b(t),h=l2(),h!==null)){e.cancelPendingCommit=h(Yx.bind(null,e,t,l,n,s,r,i,o,c,f,1,m,g)),na(e,l,i,!d);return}Yx(e,t,l,n,s,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 s=0;s<n.length;s++){var r=n[s],l=r.getSnapshot;r=r.value;try{if(!cn(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 na(e,t,n,s){t&=~ym,t&=~La,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var l=31-an(r),i=1<<l;s[l]=-1,r&=~i}n!==0&&Kv(e,n,t)}function xu(){return Ue&6?!0:(Fi(0),!1)}function jm(){if(Ce!==null){if(Le===0)var e=Ce.return;else e=Ce,ms=Ja=null,im(e),Hr=null,yi=0,e=Ce;for(;e!==null;)_b(e.alternate,e),e=e.return;Ce=null}}function tl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,IS(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jm(),Ve=e,Ce=n=vs(e.current,null),Ee=t,Le=0,en=null,ta=!1,dl=Li(e,t),vm=!1,Jr=yn=ym=La=xa=lt=0,Yt=ci=null,Gf=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-an(s),l=1<<r;t|=e[r],s&=~l}return _s=t,uu(),n}function Gb(e,t){Ne=null,xe.H=wc,t===Pi||t===fu?(t=wx(),Le=3):t===Cy?(t=wx(),Le=4):Le=t===gb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,en=t,Ce===null&&(lt=1,kc(e,vn(t,e.current)))}function Pb(){var e=xe.H;return xe.H=wc,e===null?wc:e}function Vb(){var e=xe.A;return xe.A=jS,e}function Xf(){lt=4,ta||(Ee&4194048)!==Ee&&jn.current!==null||(dl=!0),!(xa&134217727)&&!(La&134217727)||Ve===null||na(Ve,Ee,yn,!1)}function Ed(e,t,n){var s=Ue;Ue|=2;var r=Pb(),l=Vb();(Ve!==e||Ee!==t)&&(Ec=null,tl(e,t)),t=!1;var i=lt;e:do try{if(Le!==0&&Ce!==null){var o=Ce,c=en;switch(Le){case 8:jm(),i=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(t=!0);var d=Le;if(Le=0,en=null,Ar(e,o,c,d),n&&dl){i=0;break e}break;default:d=Le,Le=0,en=null,Ar(e,o,c,d)}}NS(),i=lt;break}catch(f){Gb(e,f)}while(!0);return t&&e.shellSuspendCounter++,ms=Ja=null,Ue=s,xe.H=r,xe.A=l,Ce===null&&(Ve=null,Ee=0,uu()),i}function NS(){for(;Ce!==null;)Yb(Ce)}function kS(e,t){var n=Ue;Ue|=2;var s=Pb(),r=Vb();Ve!==e||Ee!==t?(Ec=null,Tc=Xn()+500,tl(e,t)):dl=Li(e,t);e:do try{if(Le!==0&&Ce!==null){t=Ce;var l=en;t:switch(Le){case 1:Le=0,en=null,Ar(e,t,l,1);break;case 2:case 9:if(jx(l)){Le=0,en=null,Vx(t);break}t=function(){Le!==2&&Le!==9||Ve!==e||(Le=7),es(e)},l.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:jx(l)?(Le=0,en=null,Vx(t)):(Le=0,en=null,Ar(e,t,l,7));break;case 5:var i=null;switch(Ce.tag){case 26:i=Ce.memoizedState;case 5:case 27:var o=Ce;if(!i||dj(i)){Le=0,en=null;var c=o.sibling;if(c!==null)Ce=c;else{var d=o.return;d!==null?(Ce=d,gu(d)):Ce=null}break t}}Le=0,en=null,Ar(e,t,l,5);break;case 6:Le=0,en=null,Ar(e,t,l,6);break;case 8:jm(),lt=6;break e;default:throw Error(G(462))}}SS();break}catch(f){Gb(e,f)}while(!0);return ms=Ja=null,xe.H=s,xe.A=r,Ue=n,Ce!==null?0:(Ve=null,Ee=0,uu(),lt)}function SS(){for(;Ce!==null&&!F1();)Yb(Ce)}function Yb(e){var t=wb(e.alternate,e,_s);e.memoizedProps=e.pendingProps,t===null?gu(e):Ce=t}function Vx(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ux(n,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=Ux(n,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:im(t);default:_b(n,t),t=Ce=_y(t,_s),t=wb(n,t,_s)}e.memoizedProps=e.pendingProps,t===null?gu(e):Ce=t}function Ar(e,t,n,s){ms=Ja=null,im(t),Hr=null,yi=0;var r=t.return;try{if(pS(e,r,t,n,Ee)){lt=1,kc(e,vn(n,e.current)),Ce=null;return}}catch(l){if(r!==null)throw Ce=r,l;lt=1,kc(e,vn(n,e.current)),Ce=null;return}t.flags&32768?(De||s===1?e=!0:dl||Ee&536870912?e=!1:(ta=e=!0,(s===2||s===9||s===3||s===6)&&(s=jn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Xb(t,e)):gu(t)}function gu(e){var t=e;do{if(t.flags&32768){Xb(t,ta);return}e=t.return;var n=gS(t.alternate,t,_s);if(n!==null){Ce=n;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);lt===0&&(lt=5)}function Xb(e,t){do{var n=vS(e.alternate,e);if(n!==null){n.flags&=32767,Ce=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=n}while(e!==null);lt=6,Ce=null}function Yx(e,t,n,s,r,l,i,o,c){e.cancelPendingCommit=null;do vu();while(At!==0);if(Ue&6)throw Error(G(327));if(t!==null){if(t===e.current)throw Error(G(177));if(l=t.lanes|t.childLanes,l|=Fh,ak(e,n,l,i,o,c),e===Ve&&(Ce=Ve=null,Ee=0),el=t,ca=e,Br=n,Pf=l,Vf=r,Bb=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,RS(fc,function(){return Wb(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=xe.T,xe.T=null,r=ze.p,ze.p=2,i=Ue,Ue|=4;try{yS(e,t,n)}finally{Ue=i,ze.p=r,xe.T=s}}At=1,Fb(),Kb(),Qb()}}function Fb(){if(At===1){At=0;var e=ca,t=el,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=xe.T,xe.T=null;var s=ze.p;ze.p=2;var r=Ue;Ue|=4;try{Ob(t,e);var l=Zf,i=py(e.containerInfo),o=l.focusedElem,c=l.selectionRange;if(i!==o&&o&&o.ownerDocument&&my(o.ownerDocument.documentElement,o)){if(c!==null&&Xh(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 g=m.getSelection(),b=o.textContent.length,y=Math.min(c.start,b),j=c.end===void 0?y:Math.min(c.end,b);!g.extend&&y>j&&(i=j,j=y,y=i);var x=hx(o,y),p=hx(o,j);if(x&&p&&(g.rangeCount!==1||g.anchorNode!==x.node||g.anchorOffset!==x.offset||g.focusNode!==p.node||g.focusOffset!==p.offset)){var v=h.createRange();v.setStart(x.node,x.offset),g.removeAllRanges(),y>j?(g.addRange(v),g.extend(p.node,p.offset)):(v.setEnd(p.node,p.offset),g.addRange(v))}}}}for(h=[],g=o;g=g.parentNode;)g.nodeType===1&&h.push({element:g,left:g.scrollLeft,top:g.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}}Lc=!!Qf,Zf=Qf=null}finally{Ue=r,ze.p=s,xe.T=n}}e.current=t,At=2}}function Kb(){if(At===2){At=0;var e=ca,t=el,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=xe.T,xe.T=null;var s=ze.p;ze.p=2;var r=Ue;Ue|=4;try{Eb(e,t.alternate,t)}finally{Ue=r,ze.p=s,xe.T=n}}At=3}}function Qb(){if(At===4||At===3){At=0,K1();var e=ca,t=el,n=Br,s=Bb;t.subtreeFlags&10256||t.flags&10256?At=5:(At=0,el=ca=null,Zb(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(oa=null),Bh(n),t=t.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot($i,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=xe.T,r=ze.p,ze.p=2,xe.T=null;try{for(var l=e.onRecoverableError,i=0;i<s.length;i++){var o=s[i];l(o.value,{componentStack:o.stack})}}finally{xe.T=t,ze.p=r}}Br&3&&vu(),es(e),r=e.pendingLanes,n&4194090&&r&42?e===Yf?ui++:(ui=0,Yf=e):ui=0,Fi(0)}}function Zb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Gi(t)))}function vu(e){return Fb(),Kb(),Qb(),Wb()}function Wb(){if(At!==5)return!1;var e=ca,t=Pf;Pf=0;var n=Bh(Br),s=xe.T,r=ze.p;try{ze.p=32>n?32:n,xe.T=null,n=Vf,Vf=null;var l=ca,i=Br;if(At=0,el=ca=null,Br=0,Ue&6)throw Error(G(331));var o=Ue;if(Ue|=4,Ub(l.current),zb(l,l.current,i,n),Ue=o,Fi(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot($i,l)}catch{}return!0}finally{ze.p=r,xe.T=s,Zb(e,t)}}function Xx(e,t,n){t=vn(n,t),t=Hf(e.stateNode,t,2),e=ia(e,t,2),e!==null&&(Ui(e,2),es(e))}function Ge(e,t,n){if(e.tag===3)Xx(e,e,n);else for(;t!==null;){if(t.tag===3){Xx(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(oa===null||!oa.has(s))){e=vn(n,e),n=pb(2),s=ia(t,n,2),s!==null&&(xb(n,s,t,e),Ui(s,2),es(s));break}}t=t.return}}function Rd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new wS;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(vm=!0,r.add(n),e=CS.bind(null,e,t,n),t.then(e,e))}function CS(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ve===e&&(Ee&n)===n&&(lt===4||lt===3&&(Ee&62914560)===Ee&&300>Xn()-bm?!(Ue&2)&&tl(e,0):ym|=n,Jr===Ee&&(Jr=0)),es(e)}function Jb(e,t){t===0&&(t=Fv()),e=ul(e,t),e!==null&&(Ui(e,t),es(e))}function TS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jb(e,n)}function ES(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(G(314))}s!==null&&s.delete(t),Jb(e,n)}function RS(e,t){return Uh(e,t)}var Rc=null,yr=null,Ff=!1,Ac=!1,Ad=!1,Ua=0;function es(e){e!==yr&&e.next===null&&(yr===null?Rc=yr=e:yr=yr.next=e),Ac=!0,Ff||(Ff=!0,MS())}function Fi(e,t){if(!Ad&&Ac){Ad=!0;do for(var n=!1,s=Rc;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var l=0;else{var i=s.suspendedLanes,o=s.pingedLanes;l=(1<<31-an(42|e)+1)-1,l&=r&~(i&~o),l=l&201326741?l&201326741|1:l?l|2:0}l!==0&&(n=!0,Fx(s,l))}else l=Ee,l=lu(s,s===Ve?l:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(l&3)||Li(s,l)||(n=!0,Fx(s,l));s=s.next}while(n);Ad=!1}}function AS(){ej()}function ej(){Ac=Ff=!1;var e=0;Ua!==0&&(BS()&&(e=Ua),Ua=0);for(var t=Xn(),n=null,s=Rc;s!==null;){var r=s.next,l=tj(s,t);l===0?(s.next=null,n===null?Rc=r:n.next=r,r===null&&(yr=n)):(n=s,(e!==0||l&3)&&(Ac=!0)),s=r}Fi(e)}function tj(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var i=31-an(l),o=1<<i,c=r[i];c===-1?(!(o&n)||o&s)&&(r[i]=sk(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}if(t=Ve,n=Ee,n=lu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&sd(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Li(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&sd(s),Bh(n)){case 2:case 8:n=Vv;break;case 32:n=fc;break;case 268435456:n=Yv;break;default:n=fc}return s=nj.bind(null,e),n=Uh(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&sd(s),e.callbackPriority=2,e.callbackNode=null,2}function nj(e,t){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(vu()&&e.callbackNode!==n)return null;var s=Ee;return s=lu(e,e===Ve?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(qb(e,s,t),tj(e,Xn()),e.callbackNode!=null&&e.callbackNode===n?nj.bind(null,e):null)}function Fx(e,t){if(vu())return null;qb(e,t,!0)}function MS(){qS(function(){Ue&6?Uh(Pv,AS):ej()})}function wm(){return Ua===0&&(Ua=Xv()),Ua}function Kx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Po(""+e)}function Qx(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 OS(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var l=Kx((r[Xt]||null).action),i=s.submitter;i&&(t=(t=i[Xt]||null)?Kx(t.formAction):i.getAttribute("formAction"),t!==null&&(l=t,i=null));var o=new iu("action","action",null,s,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ua!==0){var c=i?Qx(r,i):new FormData(r);Lf(n,{pending:!0,data:c,method:r.method,action:l},null,c)}}else typeof l=="function"&&(o.preventDefault(),c=i?Qx(r,i):new FormData(r),Lf(n,{pending:!0,data:c,method:r.method,action:l},l,c))},currentTarget:r}]})}}for(var Md=0;Md<kf.length;Md++){var Od=kf[Md],DS=Od.toLowerCase(),zS=Od[0].toUpperCase()+Od.slice(1);Ln(DS,"on"+zS)}Ln(gy,"onAnimationEnd");Ln(vy,"onAnimationIteration");Ln(yy,"onAnimationStart");Ln("dblclick","onDoubleClick");Ln("focusin","onFocus");Ln("focusout","onBlur");Ln(Wk,"onTransitionRun");Ln(Jk,"onTransitionStart");Ln(eS,"onTransitionCancel");Ln(by,"onTransitionEnd");Xr("onMouseEnter",["mouseout","mouseover"]);Xr("onMouseLeave",["mouseout","mouseover"]);Xr("onPointerEnter",["pointerout","pointerover"]);Xr("onPointerLeave",["pointerout","pointerover"]);Qa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="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(" "),$S=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bi));function sj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var l=void 0;if(t)for(var i=s.length-1;0<=i;i--){var o=s[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){Nc(f)}r.currentTarget=null,l=c}else for(i=0;i<s.length;i++){if(o=s[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){Nc(f)}r.currentTarget=null,l=c}}}}function Se(e,t){var n=t[vf];n===void 0&&(n=t[vf]=new Set);var s=e+"__bubble";n.has(s)||(aj(t,e,2,!1),n.add(s))}function Dd(e,t,n){var s=0;t&&(s|=4),aj(n,e,s,t)}var No="_reactListening"+Math.random().toString(36).slice(2);function _m(e){if(!e[No]){e[No]=!0,Wv.forEach(function(n){n!=="selectionchange"&&($S.has(n)||Dd(n,!1,e),Dd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[No]||(t[No]=!0,Dd("selectionchange",!1,t))}}function aj(e,t,n,s){switch(xj(t)){case 2:var r=c2;break;case 8:r=u2;break;default:r=Cm}n=r.bind(null,t,n,e),r=void 0,!wf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?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 zd(e,t,n,s,r){var l=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var i=s.tag;if(i===3||i===4){var o=s.stateNode.containerInfo;if(o===r)break;if(i===4)for(i=s.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=wr(o),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){s=l=i;continue e}o=o.parentNode}}s=s.return}ly(function(){var d=l,f=Gh(n),h=[];e:{var m=jy.get(e);if(m!==void 0){var g=iu,b=e;switch(e){case"keypress":if(Yo(n)===0)break e;case"keydown":case"keyup":g=Rk;break;case"focusin":b="focus",g=dd;break;case"focusout":b="blur",g=dd;break;case"beforeblur":case"afterblur":g=dd;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":g=sx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=vk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Ok;break;case gy:case vy:case yy:g=jk;break;case by:g=zk;break;case"scroll":case"scrollend":g=xk;break;case"wheel":g=Lk;break;case"copy":case"cut":case"paste":g=_k;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=rx;break;case"toggle":case"beforetoggle":g=Hk}var y=(t&4)!==0,j=!y&&(e==="scroll"||e==="scrollend"),x=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||x===null||(w=mi(p,x),w!=null&&y.push(ji(p,w,v))),j)break;p=p.return}0<y.length&&(m=new g(m,b,null,n,f),h.push({event:m,listeners:y}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&n!==jf&&(b=n.relatedTarget||n.fromElement)&&(wr(b)||b[ol]))break e;if((g||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,g?(b=n.relatedTarget||n.toElement,g=d,b=b?wr(b):null,b!==null&&(j=zi(b),y=b.tag,b!==j||y!==5&&y!==27&&y!==6)&&(b=null)):(g=null,b=d),g!==b)){if(y=sx,w="onMouseLeave",x="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(y=rx,w="onPointerLeave",x="onPointerEnter",p="pointer"),j=g==null?m:Gl(g),v=b==null?m:Gl(b),m=new y(w,p+"leave",g,n,f),m.target=j,m.relatedTarget=v,w=null,wr(f)===d&&(y=new y(x,p+"enter",b,n,f),y.target=v,y.relatedTarget=j,w=y),j=w,g&&b)t:{for(y=g,x=b,p=0,v=y;v;v=lr(v))p++;for(v=0,w=x;w;w=lr(w))v++;for(;0<p-v;)y=lr(y),p--;for(;0<v-p;)x=lr(x),v--;for(;p--;){if(y===x||x!==null&&y===x.alternate)break t;y=lr(y),x=lr(x)}y=null}else y=null;g!==null&&Zx(h,m,g,y,!1),b!==null&&j!==null&&Zx(h,j,b,y,!0)}}e:{if(m=d?Gl(d):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var N=cx;else if(ox(m))if(fy)N=Kk;else{N=Xk;var k=Yk}else g=m.nodeName,!g||g.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?d&&qh(d.elementType)&&(N=cx):N=Fk;if(N&&(N=N(e,d))){dy(h,N,n,f);break e}k&&k(e,m,d),e==="focusout"&&d&&m.type==="number"&&d.memoizedProps.value!=null&&bf(m,"number",m.value)}switch(k=d?Gl(d):window,e){case"focusin":(ox(k)||k.contentEditable==="true")&&(kr=k,_f=d,ei=null);break;case"focusout":ei=_f=kr=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,mx(h,n,f);break;case"selectionchange":if(Zk)break;case"keydown":case"keyup":mx(h,n,f)}var _;if(Yh)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Nr?cy(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(oy&&n.locale!=="ko"&&(Nr||S!=="onCompositionStart"?S==="onCompositionEnd"&&Nr&&(_=iy()):(ea=f,Ph="value"in ea?ea.value:ea.textContent,Nr=!0)),k=Mc(d,S),0<k.length&&(S=new ax(S,e,null,n,f),h.push({event:S,listeners:k}),_?S.data=_:(_=uy(n),_!==null&&(S.data=_)))),(_=Ik?qk(e,n):Gk(e,n))&&(S=Mc(d,"onBeforeInput"),0<S.length&&(k=new ax("onBeforeInput","beforeinput",null,n,f),h.push({event:k,listeners:S}),k.data=_)),OS(h,e,d,n,f)}sj(h,t)})}function ji(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mc(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,l=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||l===null||(r=mi(e,n),r!=null&&s.unshift(ji(e,r,l)),r=mi(e,t),r!=null&&s.push(ji(e,r,l))),e.tag===3)return s;e=e.return}return[]}function lr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zx(e,t,n,s,r){for(var l=t._reactName,i=[];n!==null&&n!==s;){var o=n,c=o.alternate,d=o.stateNode;if(o=o.tag,c!==null&&c===s)break;o!==5&&o!==26&&o!==27||d===null||(c=d,r?(d=mi(n,l),d!=null&&i.unshift(ji(n,d,c))):r||(d=mi(n,l),d!=null&&i.push(ji(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var LS=/\r\n?/g,US=/\u0000|\uFFFD/g;function Wx(e){return(typeof e=="string"?e:""+e).replace(LS,`
|
|
49
|
+
`).replace(US,"")}function rj(e,t){return t=Wx(t),Wx(e)===t}function yu(){}function Ie(e,t,n,s,r,l){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Fr(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Fr(e,""+s);break;case"className":go(e,"class",s);break;case"tabIndex":go(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":go(e,n,s);break;case"style":ry(e,s,l);break;case"data":if(t!=="object"){go(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Po(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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"&&Ie(e,t,"name",r.name,r,null),Ie(e,t,"formEncType",r.formEncType,r,null),Ie(e,t,"formMethod",r.formMethod,r,null),Ie(e,t,"formTarget",r.formTarget,r,null)):(Ie(e,t,"encType",r.encType,r,null),Ie(e,t,"method",r.method,r,null),Ie(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Po(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=yu);break;case"onScroll":s!=null&&Se("scroll",e);break;case"onScrollEnd":s!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(G(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(G(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Po(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Se("beforetoggle",e),Se("toggle",e),Go(e,"popover",s);break;case"xlinkActuate":rs(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":rs(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":rs(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":rs(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":rs(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":rs(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":rs(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":rs(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":rs(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Go(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=mk.get(n)||n,Go(e,n,s))}}function Kf(e,t,n,s,r,l){switch(n){case"style":ry(e,s,l);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(G(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(G(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Fr(e,s):(typeof s=="number"||typeof s=="bigint")&&Fr(e,""+s);break;case"onScroll":s!=null&&Se("scroll",e);break;case"onScrollEnd":s!=null&&Se("scrollend",e);break;case"onClick":s!=null&&(e.onclick=yu);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[Xt]||null,l=l!=null?l[n]:null,typeof l=="function"&&e.removeEventListener(t,l,r),typeof s=="function")){typeof l!="function"&&l!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,r);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Go(e,n,s)}}}function Mt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var s=!1,r=!1,l;for(l in n)if(n.hasOwnProperty(l)){var i=n[l];if(i!=null)switch(l){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(G(137,t));default:Ie(e,t,l,i,n,null)}}r&&Ie(e,t,"srcSet",n.srcSet,n,null),s&&Ie(e,t,"src",n.src,n,null);return;case"input":Se("invalid",e);var o=l=i=r=null,c=null,d=null;for(s in n)if(n.hasOwnProperty(s)){var f=n[s];if(f!=null)switch(s){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(G(137,t));break;default:Ie(e,t,s,f,n,null)}}ny(e,l,o,c,d,i,r,!1),hc(e);return;case"select":Se("invalid",e),s=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":s=o;default:Ie(e,t,r,o,n,null)}t=l,n=i,e.multiple=!!s,t!=null?Dr(e,!!s,t,!1):n!=null&&Dr(e,!!s,n,!0);return;case"textarea":Se("invalid",e),l=r=s=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":s=o;break;case"defaultValue":r=o;break;case"children":l=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(G(91));break;default:Ie(e,t,i,o,n,null)}ay(e,s,r,l),hc(e);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ie(e,t,c,s,n,null)}return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(s=0;s<bi.length;s++)Se(bi[s],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("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)&&(s=n[d],s!=null))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(G(137,t));default:Ie(e,t,d,s,n,null)}return;default:if(qh(t)){for(f in n)n.hasOwnProperty(f)&&(s=n[f],s!==void 0&&Kf(e,t,f,s,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!=null&&Ie(e,t,o,s,n,null))}function HS(e,t,n,s){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(g in n){var h=n[g];if(n.hasOwnProperty(g)&&h!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":c=h;default:s.hasOwnProperty(g)||Ie(e,t,g,null,s,h)}}for(var m in s){var g=s[m];if(h=n[m],s.hasOwnProperty(m)&&(g!=null||h!=null))switch(m){case"type":l=g;break;case"name":r=g;break;case"checked":d=g;break;case"defaultChecked":f=g;break;case"value":i=g;break;case"defaultValue":o=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(G(137,t));break;default:g!==h&&Ie(e,t,m,g,s,h)}}yf(e,i,o,c,d,f,l,r);return;case"select":g=i=o=m=null;for(l in n)if(c=n[l],n.hasOwnProperty(l)&&c!=null)switch(l){case"value":break;case"multiple":g=c;default:s.hasOwnProperty(l)||Ie(e,t,l,null,s,c)}for(r in s)if(l=s[r],c=n[r],s.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&&Ie(e,t,r,l,s,c)}t=o,n=i,s=g,m!=null?Dr(e,!!n,m,!1):!!s!=!!n&&(t!=null?Dr(e,!!n,t,!0):Dr(e,!!n,n?[]:"",!1));return;case"textarea":g=m=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!s.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Ie(e,t,o,null,s,r)}for(i in s)if(r=s[i],l=n[i],s.hasOwnProperty(i)&&(r!=null||l!=null))switch(i){case"value":m=r;break;case"defaultValue":g=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(G(91));break;default:r!==l&&Ie(e,t,i,r,s,l)}sy(e,m,g);return;case"option":for(var b in n)if(m=n[b],n.hasOwnProperty(b)&&m!=null&&!s.hasOwnProperty(b))switch(b){case"selected":e.selected=!1;break;default:Ie(e,t,b,null,s,m)}for(c in s)if(m=s[c],g=n[c],s.hasOwnProperty(c)&&m!==g&&(m!=null||g!=null))switch(c){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Ie(e,t,c,m,s,g)}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&&!s.hasOwnProperty(y)&&Ie(e,t,y,null,s,m);for(d in s)if(m=s[d],g=n[d],s.hasOwnProperty(d)&&m!==g&&(m!=null||g!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(G(137,t));break;default:Ie(e,t,d,m,s,g)}return;default:if(qh(t)){for(var j in n)m=n[j],n.hasOwnProperty(j)&&m!==void 0&&!s.hasOwnProperty(j)&&Kf(e,t,j,void 0,s,m);for(f in s)m=s[f],g=n[f],!s.hasOwnProperty(f)||m===g||m===void 0&&g===void 0||Kf(e,t,f,m,s,g);return}}for(var x in n)m=n[x],n.hasOwnProperty(x)&&m!=null&&!s.hasOwnProperty(x)&&Ie(e,t,x,null,s,m);for(h in s)m=s[h],g=n[h],!s.hasOwnProperty(h)||m===g||m==null&&g==null||Ie(e,t,h,m,s,g)}var Qf=null,Zf=null;function Oc(e){return e.nodeType===9?e:e.ownerDocument}function Jx(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 lj(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 Wf(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 $d=null;function BS(){var e=window.event;return e&&e.type==="popstate"?e===$d?!1:($d=e,!0):($d=null,!1)}var ij=typeof setTimeout=="function"?setTimeout:void 0,IS=typeof clearTimeout=="function"?clearTimeout:void 0,eg=typeof Promise=="function"?Promise:void 0,qS=typeof queueMicrotask=="function"?queueMicrotask:typeof eg<"u"?function(e){return eg.resolve(null).then(e).catch(GS)}:ij;function GS(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function tg(e,t){var n=t,s=0,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(0<s&&8>s){n=s;var i=e.ownerDocument;if(n&1&&di(i.documentElement),n&2&&di(i.body),n&4)for(n=i.head,di(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[Hi]||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++:s=n.charCodeAt(0)-48;else s=0;n=l}while(n);Si(t)}function Jf(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":Jf(n),Ih(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function PS(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Hi])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=Rn(e.nextSibling),e===null)break}return null}function VS(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rn(e.nextSibling),e===null))return null;return e}function eh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function YS(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Rn(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 th=null;function ng(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 oj(e,t,n){switch(t=Oc(n),e){case"html":if(e=t.documentElement,!e)throw Error(G(452));return e;case"head":if(e=t.head,!e)throw Error(G(453));return e;case"body":if(e=t.body,!e)throw Error(G(454));return e;default:throw Error(G(451))}}function di(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ih(e)}var wn=new Map,sg=new Set;function Dc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ss=ze.d;ze.d={f:XS,r:FS,D:KS,C:QS,L:ZS,m:WS,X:e2,S:JS,M:t2};function XS(){var e=Ss.f(),t=xu();return e||t}function FS(e){var t=cl(e);t!==null&&t.tag===5&&t.type==="form"?tb(t):Ss.r(e)}var fl=typeof document>"u"?null:document;function cj(e,t,n){var s=fl;if(s&&typeof t=="string"&&t){var r=gn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),sg.has(r)||(sg.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),Mt(t,"link",e),kt(t),s.head.appendChild(t)))}}function KS(e){Ss.D(e),cj("dns-prefetch",e,null)}function QS(e,t){Ss.C(e,t),cj("preconnect",e,t)}function ZS(e,t,n){Ss.L(e,t,n);var s=fl;if(s&&e&&t){var r='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+gn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+gn(n.imageSizes)+'"]')):r+='[href="'+gn(e)+'"]';var l=r;switch(t){case"style":l=nl(e);break;case"script":l=hl(e)}wn.has(l)||(e=Ke({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),wn.set(l,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Ki(l))||t==="script"&&s.querySelector(Qi(l))||(t=s.createElement("link"),Mt(t,"link",e),kt(t),s.head.appendChild(t)))}}function WS(e,t){Ss.m(e,t);var n=fl;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+gn(s)+'"][href="'+gn(e)+'"]',l=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=hl(e)}if(!wn.has(l)&&(e=Ke({rel:"modulepreload",href:e},t),wn.set(l,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Qi(l)))return}s=n.createElement("link"),Mt(s,"link",e),kt(s),n.head.appendChild(s)}}}function JS(e,t,n){Ss.S(e,t,n);var s=fl;if(s&&e){var r=Or(s).hoistableStyles,l=nl(e);t=t||"default";var i=r.get(l);if(!i){var o={loading:0,preload:null};if(i=s.querySelector(Ki(l)))o.loading=5;else{e=Ke({rel:"stylesheet",href:e,"data-precedence":t},n),(n=wn.get(l))&&Nm(e,n);var c=i=s.createElement("link");kt(c),Mt(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,Jo(i,t,s)}i={type:"stylesheet",instance:i,count:1,state:o},r.set(l,i)}}}function e2(e,t){Ss.X(e,t);var n=fl;if(n&&e){var s=Or(n).hoistableScripts,r=hl(e),l=s.get(r);l||(l=n.querySelector(Qi(r)),l||(e=Ke({src:e,async:!0},t),(t=wn.get(r))&&km(e,t),l=n.createElement("script"),kt(l),Mt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},s.set(r,l))}}function t2(e,t){Ss.M(e,t);var n=fl;if(n&&e){var s=Or(n).hoistableScripts,r=hl(e),l=s.get(r);l||(l=n.querySelector(Qi(r)),l||(e=Ke({src:e,async:!0,type:"module"},t),(t=wn.get(r))&&km(e,t),l=n.createElement("script"),kt(l),Mt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},s.set(r,l))}}function ag(e,t,n,s){var r=(r=ra.current)?Dc(r):null;if(!r)throw Error(G(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=nl(n.href),n=Or(r).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=nl(n.href);var l=Or(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),wn.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},wn.set(e,n),l||n2(r,e,n,i.state))),t&&s===null)throw Error(G(528,""));return i}if(t&&s!==null)throw Error(G(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=hl(n),n=Or(r).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(G(444,e))}}function nl(e){return'href="'+gn(e)+'"'}function Ki(e){return'link[rel="stylesheet"]['+e+"]"}function uj(e){return Ke({},e,{"data-precedence":e.precedence,precedence:null})}function n2(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Mt(t,"link",n),kt(t),e.head.appendChild(t))}function hl(e){return'[src="'+gn(e)+'"]'}function Qi(e){return"script[async]"+e}function rg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+gn(n.href)+'"]');if(s)return t.instance=s,kt(s),s;var r=Ke({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),kt(s),Mt(s,"style",r),Jo(s,n.precedence,e),t.instance=s;case"stylesheet":r=nl(n.href);var l=e.querySelector(Ki(r));if(l)return t.state.loading|=4,t.instance=l,kt(l),l;s=uj(n),(r=wn.get(r))&&Nm(s,r),l=(e.ownerDocument||e).createElement("link"),kt(l);var i=l;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),Mt(l,"link",s),t.state.loading|=4,Jo(l,n.precedence,e),t.instance=l;case"script":return l=hl(n.src),(r=e.querySelector(Qi(l)))?(t.instance=r,kt(r),r):(s=n,(r=wn.get(l))&&(s=Ke({},n),km(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),kt(r),Mt(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(G(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,Jo(s,n.precedence,e));return t.instance}function Jo(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,l=r,i=0;i<s.length;i++){var o=s[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 Nm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function km(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ec=null;function lg(e,t,n){if(ec===null){var s=new Map,r=ec=new Map;r.set(n,s)}else r=ec,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var l=n[r];if(!(l[Hi]||l[zt]||e==="link"&&l.getAttribute("rel")==="stylesheet")&&l.namespaceURI!=="http://www.w3.org/2000/svg"){var i=l.getAttribute(t)||"";i=e+i;var o=s.get(i);o?o.push(l):s.set(i,[l])}}return s}function ig(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function s2(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 dj(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var wi=null;function a2(){}function r2(e,t,n){if(wi===null)throw Error(G(475));var s=wi;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=nl(n.href),l=e.querySelector(Ki(r));if(l){e=l._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=zc.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=l,kt(l);return}l=e.ownerDocument||e,n=uj(n),(r=wn.get(r))&&Nm(n,r),l=l.createElement("link"),kt(l);var i=l;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),Mt(l,"link",n),t.instance=l}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(s.count++,t=zc.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function l2(){if(wi===null)throw Error(G(475));var e=wi;return e.stylesheets&&e.count===0&&nh(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&nh(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function zc(){if(this.count--,this.count===0){if(this.stylesheets)nh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $c=null;function nh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$c=new Map,t.forEach(i2,e),$c=null,zc.call(e))}function i2(e,t){if(!(t.state.loading&4)){var n=$c.get(e);if(n)var s=n.get(null);else{n=new Map,$c.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),s=i)}s&&n.set(null,s)}r=t.instance,i=r.getAttribute("data-precedence"),l=n.get(i)||s,l===s&&n.set(null,r),n.set(i,r),this.count++,s=zc.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),l?l.parentNode.insertBefore(r,l.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var _i={$$typeof:ds,Provider:null,Consumer:null,_currentValue:Ma,_currentValue2:Ma,_threadCount:0};function o2(e,t,n,s,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=ad(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ad(0),this.hiddenUpdates=ad(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=l,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function fj(e,t,n,s,r,l,i,o,c,d,f,h){return e=new o2(e,t,n,i,o,c,d,h),t=1,l===!0&&(t|=24),l=nn(3,null,null,t),e.current=l,l.stateNode=e,t=Jh(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:s,isDehydrated:n,cache:t},tm(l),e}function hj(e){return e?(e=Tr,e):Tr}function mj(e,t,n,s,r,l){r=hj(r),s.context===null?s.context=r:s.pendingContext=r,s=la(t),s.payload={element:n},l=l===void 0?null:l,l!==null&&(s.callback=l),n=ia(e,s,t),n!==null&&(ln(n,e,t),si(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 Sm(e,t){og(e,t),(e=e.alternate)&&og(e,t)}function pj(e){if(e.tag===13){var t=ul(e,67108864);t!==null&&ln(t,e,67108864),Sm(e,67108864)}}var Lc=!0;function c2(e,t,n,s){var r=xe.T;xe.T=null;var l=ze.p;try{ze.p=2,Cm(e,t,n,s)}finally{ze.p=l,xe.T=r}}function u2(e,t,n,s){var r=xe.T;xe.T=null;var l=ze.p;try{ze.p=8,Cm(e,t,n,s)}finally{ze.p=l,xe.T=r}}function Cm(e,t,n,s){if(Lc){var r=sh(s);if(r===null)zd(e,t,s,Uc,n),cg(e,s);else if(f2(r,e,t,n,s))s.stopPropagation();else if(cg(e,s),t&4&&-1<d2.indexOf(e)){for(;r!==null;){var l=cl(r);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var i=Ta(l.pendingLanes);if(i!==0){var o=l;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-an(i);o.entanglements[1]|=c,i&=~c}es(l),!(Ue&6)&&(Tc=Xn()+500,Fi(0))}}break;case 13:o=ul(l,2),o!==null&&ln(o,l,2),xu(),Sm(l,2)}if(l=sh(s),l===null&&zd(e,t,s,Uc,n),l===r)break;r=l}r!==null&&s.stopPropagation()}else zd(e,t,s,null,n)}}function sh(e){return e=Gh(e),Tm(e)}var Uc=null;function Tm(e){if(Uc=null,e=wr(e),e!==null){var t=zi(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Bv(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 Uc=e,null}function xj(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(Q1()){case Pv:return 2;case Vv:return 8;case fc:case Z1:return 32;case Yv:return 268435456;default:return 32}default:return 32}}var ah=!1,ua=null,da=null,fa=null,Ni=new Map,ki=new Map,Ws=[],d2="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 cg(e,t){switch(e){case"focusin":case"focusout":ua=null;break;case"dragenter":case"dragleave":da=null;break;case"mouseover":case"mouseout":fa=null;break;case"pointerover":case"pointerout":Ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(t.pointerId)}}function $l(e,t,n,s,r,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:l,targetContainers:[r]},t!==null&&(t=cl(t),t!==null&&pj(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function f2(e,t,n,s,r){switch(t){case"focusin":return ua=$l(ua,e,t,n,s,r),!0;case"dragenter":return da=$l(da,e,t,n,s,r),!0;case"mouseover":return fa=$l(fa,e,t,n,s,r),!0;case"pointerover":var l=r.pointerId;return Ni.set(l,$l(Ni.get(l)||null,e,t,n,s,r)),!0;case"gotpointercapture":return l=r.pointerId,ki.set(l,$l(ki.get(l)||null,e,t,n,s,r)),!0}return!1}function gj(e){var t=wr(e.target);if(t!==null){var n=zi(t);if(n!==null){if(t=n.tag,t===13){if(t=Bv(n),t!==null){e.blockedOn=t,rk(e.priority,function(){if(n.tag===13){var s=rn();s=Hh(s);var r=ul(n,s);r!==null&&ln(r,n,s),Sm(n,s)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);jf=s,n.target.dispatchEvent(s),jf=null}else return t=cl(n),t!==null&&pj(t),e.blockedOn=n,!1;t.shift()}return!0}function ug(e,t,n){tc(e)&&n.delete(t)}function h2(){ah=!1,ua!==null&&tc(ua)&&(ua=null),da!==null&&tc(da)&&(da=null),fa!==null&&tc(fa)&&(fa=null),Ni.forEach(ug),ki.forEach(ug)}function ko(e,t){e.blockedOn===t&&(e.blockedOn=null,ah||(ah=!0,jt.unstable_scheduleCallback(jt.unstable_NormalPriority,h2)))}var So=null;function dg(e){So!==e&&(So=e,jt.unstable_scheduleCallback(jt.unstable_NormalPriority,function(){So===e&&(So=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Tm(s||n)===null)continue;break}var l=cl(n);l!==null&&(e.splice(t,3),t-=3,Lf(l,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function Si(e){function t(c){return ko(c,e)}ua!==null&&ko(ua,e),da!==null&&ko(da,e),fa!==null&&ko(fa,e),Ni.forEach(t),ki.forEach(t);for(var n=0;n<Ws.length;n++){var s=Ws[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ws.length&&(n=Ws[0],n.blockedOn===null);)gj(n),n.blockedOn===null&&Ws.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],l=n[s+1],i=r[Xt]||null;if(typeof l=="function")i||dg(n);else if(i){var o=null;if(l&&l.hasAttribute("formAction")){if(r=l,i=l[Xt]||null)o=i.formAction;else if(Tm(r)!==null)continue}else o=i.action;typeof o=="function"?n[s+1]=o:(n.splice(s,3),s-=3),dg(n)}}}function Em(e){this._internalRoot=e}bu.prototype.render=Em.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));var n=t.current,s=rn();mj(n,s,e,t,null,null)};bu.prototype.unmount=Em.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mj(e.current,2,null,e,null,null),xu(),t[ol]=null}};function bu(e){this._internalRoot=e}bu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ws.length&&t!==0&&t<Ws[n].priority;n++);Ws.splice(n,0,e),n===0&&gj(e)}};var fg=Uv.version;if(fg!=="19.1.0")throw Error(G(527,fg,"19.1.0"));ze.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=G1(t),e=e!==null?Iv(e):null,e=e===null?null:e.stateNode,e};var m2={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:xe,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Co=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Co.isDisabled&&Co.supportsFiber)try{$i=Co.inject(m2),sn=Co}catch{}}au.createRoot=function(e,t){if(!Hv(e))throw Error(G(299));var n=!1,s="",r=fb,l=hb,i=mb,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=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=fj(e,1,!1,null,null,n,s,r,l,i,o,null),e[ol]=t.current,_m(e),new Em(t)};au.hydrateRoot=function(e,t,n){if(!Hv(e))throw Error(G(299));var s=!1,r="",l=fb,i=hb,o=mb,c=null,d=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!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=fj(e,1,!0,t,n??null,s,r,l,i,o,c,d),t.context=hj(null),n=t.current,s=rn(),s=Hh(s),r=la(s),r.callback=null,ia(n,r,s),n=s,t.current.lanes=n,Ui(t,n),es(t),e[ol]=t.current,_m(e),new bu(t)};au.version="19.1.0";function vj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vj)}catch(e){console.error(e)}}vj(),Mv.exports=au;var p2=Mv.exports;const yj=u.createContext(null);function bj({data:e,router:t,identity:n,notify:s,children:r}){return a.jsx(yj.Provider,{value:{data:e,router:t,identity:n,notify:s},children:r})}function ju(){const e=u.useContext(yj);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const x2={success:()=>{},error:()=>{}},_n=()=>ju().data,at=()=>ju().router,wu=()=>ju().identity,ml=()=>ju().notify??x2;function g2(){const{probe:e}=_n(),{href:t,Link:n}=at(),s=wu(),[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]),a.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:[a.jsx("h1",{className:"text-xl font-semibold",children:"Shared app UI"}),a.jsx("p",{"data-testid":"app-ui-probe-source",className:"text-sm text-muted-foreground",children:i?"Data source unavailable":r??"Loading…"}),a.jsxs("p",{"data-testid":"app-ui-probe-identity",className:"text-sm",children:[s.label," · ",s.can("tasks.write")?"can edit tasks":"read only"]}),a.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 v2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase()),hg=e=>{const t=y2(e);return t.charAt(0).toUpperCase()+t.slice(1)},jj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim(),b2=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 j2={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 w2=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:l,iconNode:i,...o},c)=>u.createElement("svg",{ref:c,...j2,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:jj("lucide",r),...!l&&!b2(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 de=(e,t)=>{const n=u.forwardRef(({className:s,...r},l)=>u.createElement(w2,{ref:l,iconNode:t,className:jj(`lucide-${v2(hg(e))}`,`lucide-${e}`,s),...r}));return n.displayName=hg(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 _2=[["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"}]],N2=de("archive-restore",_2);/**
|
|
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 k2=[["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"}]],mg=de("archive",k2);/**
|
|
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 S2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],C2=de("arrow-down",S2);/**
|
|
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 T2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Rm=de("arrow-left",T2);/**
|
|
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 E2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],R2=de("arrow-up",E2);/**
|
|
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 A2=[["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"}]],Am=de("bot",A2);/**
|
|
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 M2=[["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"}]],O2=de("briefcase",M2);/**
|
|
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 D2=[["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"}]],z2=de("building-2",D2);/**
|
|
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 $2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pl=de("check",$2);/**
|
|
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 L2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],U2=de("chevron-down",L2);/**
|
|
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 H2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wj=de("chevron-right",H2);/**
|
|
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 B2=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],I2=de("chevron-up",B2);/**
|
|
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 q2=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],_j=de("chevrons-up-down",q2);/**
|
|
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 G2=[["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"}]],Je=de("circle-alert",G2);/**
|
|
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 P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mm=de("circle-check",P2);/**
|
|
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 V2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Y2=de("circle",V2);/**
|
|
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 X2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],F2=de("clock",X2);/**
|
|
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 K2=[["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"}]],Om=de("ellipsis",K2);/**
|
|
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 Q2=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],Z2=de("eraser",Q2);/**
|
|
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 W2=[["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"}]],Zi=de("eye",W2);/**
|
|
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 J2=[["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"}]],Nj=de("folder-git-2",J2);/**
|
|
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 eC=[["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"}]],tC=de("folder-git",eC);/**
|
|
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 nC=[["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"}]],sC=de("git-fork",nC);/**
|
|
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 aC=[["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"}]],rC=de("hard-drive",aC);/**
|
|
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 lC=[["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"}]],iC=de("house",lC);/**
|
|
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 oC=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["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"}]],cC=de("inbox",oC);/**
|
|
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 uC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],un=de("info",uC);/**
|
|
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 dC=[["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"}]],fC=de("laptop",dC);/**
|
|
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 hC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],mC=de("life-buoy",hC);/**
|
|
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 pC=[["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"}]],kj=de("list-checks",pC);/**
|
|
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 xC=[["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"}]],Sj=de("list-ordered",xC);/**
|
|
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 gC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vC=de("loader-circle",gC);/**
|
|
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 yC=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],bC=de("lock",yC);/**
|
|
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 jC=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],wC=de("message-circle",jC);/**
|
|
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 _C=[["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"}]],NC=de("messages-square",_C);/**
|
|
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 kC=[["path",{d:"M5 12h14",key:"1ays0h"}]],SC=de("minus",kC);/**
|
|
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 CC=[["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"}]],TC=de("network",CC);/**
|
|
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 EC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],RC=de("panel-left",EC);/**
|
|
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 AC=[["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"}]],Cj=de("pause",AC);/**
|
|
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 MC=[["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"}]],Dm=de("pencil",MC);/**
|
|
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 OC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],sl=de("plus",OC);/**
|
|
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 DC=[["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"}]],xl=de("refresh-cw",DC);/**
|
|
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 zC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],$C=de("rotate-ccw",zC);/**
|
|
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 LC=[["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"}]],_u=de("search-x",LC);/**
|
|
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 UC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],HC=de("search",UC);/**
|
|
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 BC=[["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"}]],IC=de("send",BC);/**
|
|
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 qC=[["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"}]],GC=de("snowflake",qC);/**
|
|
305
|
+
* @license lucide-react v0.511.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const PC=[["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"}]],Dn=de("triangle-alert",PC);/**
|
|
310
|
+
* @license lucide-react v0.511.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/const VC=[["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"}]],YC=de("user-check",VC);/**
|
|
315
|
+
* @license lucide-react v0.511.0 - ISC
|
|
316
|
+
*
|
|
317
|
+
* This source code is licensed under the ISC license.
|
|
318
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
+
*/const XC=[["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"}]],FC=de("user-cog",XC);/**
|
|
320
|
+
* @license lucide-react v0.511.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/const KC=[["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"}]],zm=de("user",KC);/**
|
|
325
|
+
* @license lucide-react v0.511.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const QC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$m=de("x",QC);/**
|
|
330
|
+
* @license lucide-react v0.511.0 - ISC
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the ISC license.
|
|
333
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/const ZC=[["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"}]],WC=de("wrench",ZC);function Tj(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=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]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Ej(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Tj(e))&&(s&&(s+=" "),s+=t);return s}const pg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xg=Ej,Wi=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return xg(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=pg(f)||pg(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||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,f)=>{let{class:h,className:m,...g}=f;return Object.entries(g).every(b=>{let[y,j]=b;return Array.isArray(j)?j.includes({...l,...o}[y]):{...l,...o}[y]===j})?[...d,h,m]:d},[]);return xg(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Lm="-",JC=e=>{const t=tT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:i=>{const o=i.split(Lm);return o[0]===""&&o.length!==1&&o.shift(),Rj(o,t)||eT(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&s[i]?[...c,...s[i]]:c}}},Rj=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?Rj(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const l=e.join(Lm);return(i=t.validators.find(({validator:o})=>o(l)))==null?void 0:i.classGroupId},gg=/^\[(.+)\]$/,eT=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}},tT=e=>{const{theme:t,classGroups:n}=e,s={nextPart:new Map,validators:[]};for(const r in n)rh(n[r],s,r,t);return s},rh=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const l=r===""?t:vg(t,r);l.classGroupId=n;return}if(typeof r=="function"){if(nT(r)){rh(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([l,i])=>{rh(i,vg(t,l),n,s)})})},vg=(e,t)=>{let n=e;return t.split(Lm).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},nT=e=>e.isThemeGetter,sT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(l,i)=>{n.set(l,i),t++,t>e&&(t=0,s=n,n=new Map)};return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=s.get(l))!==void 0)return r(l,i),i},set(l,i){n.has(l)?n.set(l,i):r(l,i)}}},lh="!",ih=":",aT=ih.length,rT=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=r=>{const l=[];let i=0,o=0,c=0,d;for(let b=0;b<r.length;b++){let y=r[b];if(i===0&&o===0){if(y===ih){l.push(r.slice(c,b)),c=b+aT;continue}if(y==="/"){d=b;continue}}y==="["?i++:y==="]"?i--:y==="("?o++:y===")"&&o--}const f=l.length===0?r:r.substring(c),h=lT(f),m=h!==f,g=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:g}};if(t){const r=t+ih,l=s;s=i=>i.startsWith(r)?l(i.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const r=s;s=l=>n({className:l,parseClassName:r})}return s},lT=e=>e.endsWith(lh)?e.substring(0,e.length-1):e.startsWith(lh)?e.substring(1):e,iT=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const r=[];let l=[];return s.forEach(i=>{i[0]==="["||t[i]?(r.push(...l.sort(),i),l=[]):l.push(i)}),r.push(...l.sort()),r}},oT=e=>({cache:sT(e.cacheSize),parseClassName:rT(e),sortModifiers:iT(e),...JC(e)}),cT=/\s+/,uT=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:l}=t,i=[],o=e.trim().split(cT);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:y}=n(f);if(h){c=f+(c.length>0?" "+c:c);continue}let j=!!y,x=s(j?b.substring(0,y):b);if(!x){if(!j){c=f+(c.length>0?" "+c:c);continue}if(x=s(b),!x){c=f+(c.length>0?" "+c:c);continue}j=!1}const p=l(m).join(":"),v=g?p+lh:p,w=v+x;if(i.includes(w))continue;i.push(w);const N=r(x,j);for(let k=0;k<N.length;++k){const _=N[k];i.push(v+_)}c=f+(c.length>0?" "+c:c)}return c};function dT(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Aj(t))&&(s&&(s+=" "),s+=n);return s}const Aj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Aj(e[s]))&&(n&&(n+=" "),n+=t);return n};function fT(e,...t){let n,s,r,l=i;function i(c){const d=t.reduce((f,h)=>h(f),e());return n=oT(d),s=n.cache.get,r=n.cache.set,l=o,o(c)}function o(c){const d=s(c);if(d)return d;const f=uT(c,n);return r(c,f),f}return function(){return l(dT.apply(null,arguments))}}const xt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Mj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Oj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hT=/^\d+\/\d+$/,mT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pT=/\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$/,xT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ir=e=>hT.test(e),_e=e=>!!e&&!Number.isNaN(Number(e)),qs=e=>!!e&&Number.isInteger(Number(e)),Ld=e=>e.endsWith("%")&&_e(e.slice(0,-1)),os=e=>mT.test(e),yT=()=>!0,bT=e=>pT.test(e)&&!xT.test(e),Dj=()=>!1,jT=e=>gT.test(e),wT=e=>vT.test(e),_T=e=>!ne(e)&&!se(e),NT=e=>gl(e,Lj,Dj),ne=e=>Mj.test(e),Ca=e=>gl(e,Uj,bT),Ud=e=>gl(e,ET,_e),yg=e=>gl(e,zj,Dj),kT=e=>gl(e,$j,wT),To=e=>gl(e,Hj,jT),se=e=>Oj.test(e),Ll=e=>vl(e,Uj),ST=e=>vl(e,RT),bg=e=>vl(e,zj),CT=e=>vl(e,Lj),TT=e=>vl(e,$j),Eo=e=>vl(e,Hj,!0),gl=(e,t,n)=>{const s=Mj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},vl=(e,t,n=!1)=>{const s=Oj.exec(e);return s?s[1]?t(s[1]):n:!1},zj=e=>e==="position"||e==="percentage",$j=e=>e==="image"||e==="url",Lj=e=>e==="length"||e==="size"||e==="bg-size",Uj=e=>e==="length",ET=e=>e==="number",RT=e=>e==="family-name",Hj=e=>e==="shadow",AT=()=>{const e=xt("color"),t=xt("font"),n=xt("text"),s=xt("font-weight"),r=xt("tracking"),l=xt("leading"),i=xt("breakpoint"),o=xt("container"),c=xt("spacing"),d=xt("radius"),f=xt("shadow"),h=xt("inset-shadow"),m=xt("text-shadow"),g=xt("drop-shadow"),b=xt("blur"),y=xt("perspective"),j=xt("aspect"),x=xt("ease"),p=xt("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"],N=()=>[...w(),se,ne],k=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],S=()=>[se,ne,c],R=()=>[ir,"full","auto",...S()],M=()=>[qs,"none","subgrid",se,ne],L=()=>["auto",{span:["full",qs,se,ne]},qs,se,ne],I=()=>[qs,"auto",se,ne],T=()=>["auto","min","max","fr",se,ne],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...S()],H=()=>[ir,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],C=()=>[e,se,ne],B=()=>[...w(),bg,yg,{position:[se,ne]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",CT,NT,{size:[se,ne]}],K=()=>[Ld,Ll,Ca],ae=()=>["","none","full",d,se,ne],Q=()=>["",_e,Ll,Ca],F=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[_e,Ld,bg,yg],W=()=>["","none",b,se,ne],me=()=>["none",_e,se,ne],ve=()=>["none",_e,se,ne],be=()=>[_e,se,ne],re=()=>[ir,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[os],breakpoint:[os],color:[yT],container:[os],"drop-shadow":[os],ease:["in","out","in-out"],font:[_T],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[os],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[os],shadow:[os],spacing:["px",_e],text:[os],"text-shadow":[os],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ir,ne,se,j]}],container:["container"],columns:[{columns:[_e,ne,se,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:N()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],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:[qs,"auto",se,ne]}],basis:[{basis:[ir,"full","auto",o,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,ir,"auto","initial","none",ne]}],grow:[{grow:["",_e,se,ne]}],shrink:[{shrink:["",_e,se,ne]}],order:[{order:[qs,"first","last","none",se,ne]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],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":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[o,"screen",...H()]}],"min-w":[{"min-w":[o,"screen","none",...H()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Ll,Ca]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,se,Ud]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ld,ne]}],"font-family":[{font:[ST,ne,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,se,ne]}],"line-clamp":[{"line-clamp":[_e,"none",se,Ud]}],leading:[{leading:[l,...S()]}],"list-image":[{"list-image":["none",se,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:C()}],"text-color":[{text:C()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",se,Ca]}],"text-decoration-color":[{decoration:C()}],"underline-offset":[{"underline-offset":[_e,"auto",se,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,ne]}],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",se,ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qs,se,ne],radial:["",se,ne],conic:[qs,se,ne]},TT,kT]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...F(),"hidden","none"]}],"divide-style":[{divide:[...F(),"hidden","none"]}],"border-color":[{border:C()}],"border-color-x":[{"border-x":C()}],"border-color-y":[{"border-y":C()}],"border-color-s":[{"border-s":C()}],"border-color-e":[{"border-e":C()}],"border-color-t":[{"border-t":C()}],"border-color-r":[{"border-r":C()}],"border-color-b":[{"border-b":C()}],"border-color-l":[{"border-l":C()}],"divide-color":[{divide:C()}],"outline-style":[{outline:[...F(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,se,ne]}],"outline-w":[{outline:["",_e,Ll,Ca]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",f,Eo,To]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",h,Eo,To]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[_e,Ca]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",m,Eo,To]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[_e,se,ne]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],"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":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":C()}],"mask-image-linear-to-color":[{"mask-linear-to":C()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":C()}],"mask-image-t-to-color":[{"mask-t-to":C()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":C()}],"mask-image-r-to-color":[{"mask-r-to":C()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":C()}],"mask-image-b-to-color":[{"mask-b-to":C()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":C()}],"mask-image-l-to-color":[{"mask-l-to":C()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":C()}],"mask-image-x-to-color":[{"mask-x-to":C()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[se,ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":C()}],"mask-image-radial-to-color":[{"mask-radial-to":C()}],"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":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":C()}],"mask-image-conic-to-color":[{"mask-conic-to":C()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,ne]}],filter:[{filter:["","none",se,ne]}],blur:[{blur:W()}],brightness:[{brightness:[_e,se,ne]}],contrast:[{contrast:[_e,se,ne]}],"drop-shadow":[{"drop-shadow":["","none",g,Eo,To]}],"drop-shadow-color":[{"drop-shadow":C()}],grayscale:[{grayscale:["",_e,se,ne]}],"hue-rotate":[{"hue-rotate":[_e,se,ne]}],invert:[{invert:["",_e,se,ne]}],saturate:[{saturate:[_e,se,ne]}],sepia:[{sepia:["",_e,se,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",se,ne]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[_e,se,ne]}],"backdrop-contrast":[{"backdrop-contrast":[_e,se,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,se,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,se,ne]}],"backdrop-invert":[{"backdrop-invert":["",_e,se,ne]}],"backdrop-opacity":[{"backdrop-opacity":[_e,se,ne]}],"backdrop-saturate":[{"backdrop-saturate":[_e,se,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,se,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",se,ne]}],ease:[{ease:["linear","initial",x,se,ne]}],delay:[{delay:[_e,se,ne]}],animate:[{animate:["none",p,se,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,se,ne]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[se,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:C()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:C()}],"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",se,ne]}],"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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",se,ne]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[_e,Ll,Ca,Ud]}],stroke:[{stroke:["none",...C()]}],"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"]}},MT=fT(AT);function J(...e){return MT(Ej(e))}const OT=Wi("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 oe({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:J(OT({variant:t}),e),...n})}function pe({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:J("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function ie({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:J("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function te(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 jg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nu(...e){return t=>{let n=!1;const s=e.map(r=>{const l=jg(r,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let r=0;r<s.length;r++){const l=s[r];typeof l=="function"?l():jg(e[r],null)}}}}function $e(...e){return u.useCallback(Nu(...e),e)}function DT(e,t){const n=u.createContext(t),s=l=>{const{children:i,...o}=l,c=u.useMemo(()=>o,Object.values(o));return a.jsx(n.Provider,{value:c,children:i})};s.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[s,r]}function ts(e,t=[]){let n=[];function s(l,i){const o=u.createContext(i),c=n.length;n=[...n,i];const d=h=>{var x;const{scope:m,children:g,...b}=h,y=((x=m==null?void 0:m[e])==null?void 0:x[c])||o,j=u.useMemo(()=>b,Object.values(b));return a.jsx(y.Provider,{value:j,children:g})};d.displayName=l+"Provider";function f(h,m){var y;const g=((y=m==null?void 0:m[e])==null?void 0:y[c])||o,b=u.useContext(g);if(b)return b;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,[s,zT(r,...t)]}function zT(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(l){const i=s.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 Lt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},$T=Av[" useId ".trim().toString()]||(()=>{}),LT=0;function An(e){const[t,n]=u.useState($T());return Lt(()=>{n(s=>s??String(LT++))},[e]),t?`radix-${t}`:""}var UT=Av[" useInsertionEffect ".trim().toString()]||Lt;function ga({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,l,i]=HT({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(`${s} 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,s])}const d=u.useCallback(f=>{var h;if(o){const m=BT(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 HT({defaultProp:e,onChange:t}){const[n,s]=u.useState(e),r=u.useRef(n),l=u.useRef(t);return UT(()=>{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,s,l]}function BT(e){return typeof e=="function"}function Ga(e){const t=qT(e),n=u.forwardRef((s,r)=>{const{children:l,...i}=s,o=u.Children.toArray(l),c=o.find(PT);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 a.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:r,children:l})});return n.displayName=`${e}.Slot`,n}var IT=Ga("Slot");function qT(e){const t=u.forwardRef((n,s)=>{const{children:r,...l}=n;if(u.isValidElement(r)){const i=YT(r),o=VT(l,r.props);return r.type!==u.Fragment&&(o.ref=s?Nu(s,i):i),u.cloneElement(r,o)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bj=Symbol("radix.slottable");function GT(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Bj,t}function PT(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bj}function VT(e,t){const n={...t};for(const s in t){const r=e[s],l=t[s];/^on[A-Z]/.test(s)?r&&l?n[s]=(...o)=>{const c=l(...o);return r(...o),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...l}:s==="className"&&(n[s]=[r,l].filter(Boolean).join(" "))}return{...e,...n}}function YT(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.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 XT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=XT.reduce((e,t)=>{const n=Ga(`Primitive.${t}`),s=u.forwardRef((r,l)=>{const{asChild:i,...o}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...o,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function Ij(e,t){e&&il.flushSync(()=>e.dispatchEvent(t))}function Qn(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function FT(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e);u.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var KT="DismissableLayer",oh="dismissableLayer.update",QT="dismissableLayer.pointerDownOutside",ZT="dismissableLayer.focusOutside",wg,qj=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ji=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:l,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(qj),[f,h]=u.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=u.useState({}),b=$e(t,_=>h(_)),y=Array.from(d.layers),[j]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(j),p=f?y.indexOf(f):-1,v=d.layersWithOutsidePointerEventsDisabled.size>0,w=p>=x,N=eE(_=>{const S=_.target,R=[...d.branches].some(M=>M.contains(S));!w||R||(r==null||r(_),i==null||i(_),_.defaultPrevented||o==null||o())},m),k=tE(_=>{const S=_.target;[...d.branches].some(M=>M.contains(S))||(l==null||l(_),i==null||i(_),_.defaultPrevented||o==null||o())},m);return FT(_=>{p===d.layers.size-1&&(s==null||s(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},m),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(wg=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),_g(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=wg)}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),_g())},[f,d]),u.useEffect(()=>{const _=()=>g({});return document.addEventListener(oh,_),()=>document.removeEventListener(oh,_)},[]),a.jsx(je.div,{...c,ref:b,style:{pointerEvents:v?w?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,k.onFocusCapture),onBlurCapture:te(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,N.onPointerDownCapture)})});Ji.displayName=KT;var WT="DismissableLayerBranch",JT=u.forwardRef((e,t)=>{const n=u.useContext(qj),s=u.useRef(null),r=$e(t,s);return u.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),a.jsx(je.div,{...e,ref:r})});JT.displayName=WT;function eE(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),s=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const l=o=>{if(o.target&&!s.current){let c=function(){Gj(QT,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);s.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:()=>s.current=!0}}function tE(e,t=globalThis==null?void 0:globalThis.document){const n=Qn(e),s=u.useRef(!1);return u.useEffect(()=>{const r=l=>{l.target&&!s.current&&Gj(ZT,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function _g(){const e=new CustomEvent(oh);document.dispatchEvent(e)}function Gj(e,t,n,{discrete:s}){const r=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?Ij(r,l):r.dispatchEvent(l)}var Hd="focusScope.autoFocusOnMount",Bd="focusScope.autoFocusOnUnmount",Ng={bubbles:!1,cancelable:!0},nE="FocusScope",ku=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:l,...i}=e,[o,c]=u.useState(null),d=Qn(r),f=Qn(l),h=u.useRef(null),m=$e(t,y=>c(y)),g=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(s){let y=function(v){if(g.paused||!o)return;const w=v.target;o.contains(w)?h.current=w:Ys(h.current,{select:!0})},j=function(v){if(g.paused||!o)return;const w=v.relatedTarget;w!==null&&(o.contains(w)||Ys(h.current,{select:!0}))},x=function(v){if(document.activeElement===document.body)for(const N of v)N.removedNodes.length>0&&Ys(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",j);const p=new MutationObserver(x);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",j),p.disconnect()}}},[s,o,g.paused]),u.useEffect(()=>{if(o){Sg.add(g);const y=document.activeElement;if(!o.contains(y)){const x=new CustomEvent(Hd,Ng);o.addEventListener(Hd,d),o.dispatchEvent(x),x.defaultPrevented||(sE(oE(Pj(o)),{select:!0}),document.activeElement===y&&Ys(o))}return()=>{o.removeEventListener(Hd,d),setTimeout(()=>{const x=new CustomEvent(Bd,Ng);o.addEventListener(Bd,f),o.dispatchEvent(x),x.defaultPrevented||Ys(y??document.body,{select:!0}),o.removeEventListener(Bd,f),Sg.remove(g)},0)}}},[o,d,f,g]);const b=u.useCallback(y=>{if(!n&&!s||g.paused)return;const j=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(j&&x){const p=y.currentTarget,[v,w]=aE(p);v&&w?!y.shiftKey&&x===w?(y.preventDefault(),n&&Ys(v,{select:!0})):y.shiftKey&&x===v&&(y.preventDefault(),n&&Ys(w,{select:!0})):x===p&&y.preventDefault()}},[n,s,g.paused]);return a.jsx(je.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});ku.displayName=nE;function sE(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Ys(s,{select:t}),document.activeElement!==n)return}function aE(e){const t=Pj(e),n=kg(t,e),s=kg(t.reverse(),e);return[n,s]}function Pj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kg(e,t){for(const n of e)if(!rE(n,{upTo:t}))return n}function rE(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 lE(e){return e instanceof HTMLInputElement&&"select"in e}function Ys(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&lE(e)&&t&&e.select()}}var Sg=iE();function iE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Cg(e,t),e.unshift(t)},remove(t){var n;e=Cg(e,t),(n=e[0])==null||n.resume()}}}function Cg(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function oE(e){return e.filter(t=>t.tagName!=="A")}var cE="Portal",eo=u.forwardRef((e,t)=>{var o;const{container:n,...s}=e,[r,l]=u.useState(!1);Lt(()=>l(!0),[]);const i=n||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?I1.createPortal(a.jsx(je.div,{...s,ref:t}),i):null});eo.displayName=cE;function uE(e,t){return u.useReducer((n,s)=>t[n][s]??n,e)}var Nn=e=>{const{present:t,children:n}=e,s=dE(t),r=typeof n=="function"?n({present:s.isPresent}):u.Children.only(n),l=$e(s.ref,fE(r));return typeof n=="function"||s.isPresent?u.cloneElement(r,{ref:l}):null};Nn.displayName="Presence";function dE(e){const[t,n]=u.useState(),s=u.useRef(null),r=u.useRef(e),l=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=uE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=Ro(s.current);l.current=o==="mounted"?d:"none"},[o]),Lt(()=>{const d=s.current,f=r.current;if(f!==e){const m=l.current,g=Ro(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),Lt(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=g=>{const y=Ro(s.current).includes(g.animationName);if(g.target===t&&y&&(c("ANIMATION_END"),!r.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},m=g=>{g.target===t&&(l.current=Ro(s.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=>{s.current=d?getComputedStyle(d):null,n(d)},[])}}function Ro(e){return(e==null?void 0:e.animationName)||"none"}function fE(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.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 Id=0;function Um(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Tg()),document.body.insertAdjacentElement("beforeend",e[1]??Tg()),Id++,()=>{Id===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Id--}},[])}function Tg(){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 qn=function(){return qn=Object.assign||function(t){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},qn.apply(this,arguments)};function Vj(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function hE(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,l;s<r;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var nc="right-scroll-bar-position",sc="width-before-scroll-bar",mE="with-scroll-bars-hidden",pE="--removed-body-scroll-bar-size";function qd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xE(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=t,n.facade}var gE=typeof window<"u"?u.useLayoutEffect:u.useEffect,Eg=new WeakMap;function vE(e,t){var n=xE(null,function(s){return e.forEach(function(r){return qd(r,s)})});return gE(function(){var s=Eg.get(n);if(s){var r=new Set(s),l=new Set(e),i=n.current;r.forEach(function(o){l.has(o)||qd(o,null)}),l.forEach(function(o){r.has(o)||qd(o,i)})}Eg.set(n,e)},[e]),n}function yE(e){return e}function bE(e,t){t===void 0&&(t=yE);var n=[],s=!1,r={read:function(){if(s)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,s);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(l){for(s=!0;n.length;){var i=n;n=[],i.forEach(l)}n={push:function(o){return l(o)},filter:function(){return n}}},assignMedium:function(l){s=!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 jE(e){e===void 0&&(e={});var t=bE(null);return t.options=qn({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 s=t.read();if(!s)throw new Error("Sidecar medium not found");return u.createElement(s,qn({},n))};Yj.isSideCarExport=!0;function wE(e,t){return e.useMedium(t),Yj}var Xj=jE(),Gd=function(){},Su=u.forwardRef(function(e,t){var n=u.useRef(null),s=u.useState({onScrollCapture:Gd,onWheelCapture:Gd,onTouchMoveCapture:Gd}),r=s[0],l=s[1],i=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,y=e.inert,j=e.allowPinchZoom,x=e.as,p=x===void 0?"div":x,v=e.gapMode,w=Vj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,k=vE([n,t]),_=qn(qn({},w),r);return u.createElement(u.Fragment,null,f&&u.createElement(N,{sideCar:Xj,removeScrollBar:d,shards:h,noRelative:g,noIsolation:b,inert:y,setCallbacks:l,allowPinchZoom:!!j,lockRef:n,gapMode:v}),i?u.cloneElement(u.Children.only(o),qn(qn({},_),{ref:k})):u.createElement(p,qn({},_,{className:c,ref:k}),o))});Su.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Su.classNames={fullWidth:sc,zeroRight:nc};var _E=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function NE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_E();return t&&e.setAttribute("nonce",t),e}function kE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var CE=function(){var e=0,t=null;return{add:function(n){e==0&&(t=NE())&&(kE(t,n),SE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TE=function(){var e=CE();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fj=function(){var e=TE(),t=function(n){var s=n.styles,r=n.dynamic;return e(s,r),null};return t},EE={left:0,top:0,right:0,gap:0},Pd=function(e){return parseInt(e||"",10)||0},RE=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Pd(n),Pd(s),Pd(r)]},AE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return EE;var t=RE(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},ME=Fj(),Ir="data-scroll-locked",OE=function(e,t,n,s){var r=e.left,l=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
335
|
+
.`.concat(mE,` {
|
|
336
|
+
overflow: hidden `).concat(s,`;
|
|
337
|
+
padding-right: `).concat(o,"px ").concat(s,`;
|
|
338
|
+
}
|
|
339
|
+
body[`).concat(Ir,`] {
|
|
340
|
+
overflow: hidden `).concat(s,`;
|
|
341
|
+
overscroll-behavior: contain;
|
|
342
|
+
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
343
|
+
padding-left: `.concat(r,`px;
|
|
344
|
+
padding-top: `).concat(l,`px;
|
|
345
|
+
padding-right: `).concat(i,`px;
|
|
346
|
+
margin-left:0;
|
|
347
|
+
margin-top:0;
|
|
348
|
+
margin-right: `).concat(o,"px ").concat(s,`;
|
|
349
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.`).concat(nc,` {
|
|
353
|
+
right: `).concat(o,"px ").concat(s,`;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.`).concat(sc,` {
|
|
357
|
+
margin-right: `).concat(o,"px ").concat(s,`;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.`).concat(nc," .").concat(nc,` {
|
|
361
|
+
right: 0 `).concat(s,`;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.`).concat(sc," .").concat(sc,` {
|
|
365
|
+
margin-right: 0 `).concat(s,`;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
body[`).concat(Ir,`] {
|
|
369
|
+
`).concat(pE,": ").concat(o,`px;
|
|
370
|
+
}
|
|
371
|
+
`)},Rg=function(){var e=parseInt(document.body.getAttribute(Ir)||"0",10);return isFinite(e)?e:0},DE=function(){u.useEffect(function(){return document.body.setAttribute(Ir,(Rg()+1).toString()),function(){var e=Rg()-1;e<=0?document.body.removeAttribute(Ir):document.body.setAttribute(Ir,e.toString())}},[])},zE=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;DE();var l=u.useMemo(function(){return AE(r)},[r]);return u.createElement(ME,{styles:OE(l,!t,r,n?"":"!important")})},ch=!1;if(typeof window<"u")try{var Ao=Object.defineProperty({},"passive",{get:function(){return ch=!0,!0}});window.addEventListener("test",Ao,Ao),window.removeEventListener("test",Ao,Ao)}catch{ch=!1}var or=ch?{passive:!1}:!1,$E=function(e){return e.tagName==="TEXTAREA"},Kj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$E(e)&&n[t]==="visible")},LE=function(e){return Kj(e,"overflowY")},UE=function(e){return Kj(e,"overflowX")},Ag=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=Qj(e,s);if(r){var l=Zj(e,s),i=l[1],o=l[2];if(i>o)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},HE=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},BE=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},Qj=function(e,t){return e==="v"?LE(t):UE(t)},Zj=function(e,t){return e==="v"?HE(t):BE(t)},IE=function(e,t){return e==="h"&&t==="rtl"?-1:1},qE=function(e,t,n,s,r){var l=IE(e,window.getComputedStyle(t).direction),i=l*s,o=n.target,c=t.contains(o),d=!1,f=i>0,h=0,m=0;do{if(!o)break;var g=Zj(e,o),b=g[0],y=g[1],j=g[2],x=y-j-l*b;(b||x)&&Qj(e,o)&&(h+=x,m+=b);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},Mo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mg=function(e){return[e.deltaX,e.deltaY]},Og=function(e){return e&&"current"in e?e.current:e},GE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PE=function(e){return`
|
|
372
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
373
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
374
|
+
`)},VE=0,cr=[];function YE(e){var t=u.useRef([]),n=u.useRef([0,0]),s=u.useRef(),r=u.useState(VE++)[0],l=u.useState(Fj)[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=hE([e.lockRef.current],(e.shards||[]).map(Og),!0).filter(Boolean);return y.forEach(function(j){return j.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),y.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(y,j){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var x=Mo(y),p=n.current,v="deltaX"in y?y.deltaX:p[0]-x[0],w="deltaY"in y?y.deltaY:p[1]-x[1],N,k=y.target,_=Math.abs(v)>Math.abs(w)?"h":"v";if("touches"in y&&_==="h"&&k.type==="range")return!1;var S=Ag(_,k);if(!S)return!0;if(S?N=_:(N=_==="v"?"h":"v",S=Ag(_,k)),!S)return!1;if(!s.current&&"changedTouches"in y&&(v||w)&&(s.current=N),!N)return!0;var R=s.current||N;return qE(R,j,y,R==="h"?v:w)},[]),c=u.useCallback(function(y){var j=y;if(!(!cr.length||cr[cr.length-1]!==l)){var x="deltaY"in j?Mg(j):Mo(j),p=t.current.filter(function(N){return N.name===j.type&&(N.target===j.target||j.target===N.shadowParent)&&GE(N.delta,x)})[0];if(p&&p.should){j.cancelable&&j.preventDefault();return}if(!p){var v=(i.current.shards||[]).map(Og).filter(Boolean).filter(function(N){return N.contains(j.target)}),w=v.length>0?o(j,v[0]):!i.current.noIsolation;w&&j.cancelable&&j.preventDefault()}}},[]),d=u.useCallback(function(y,j,x,p){var v={name:y,delta:j,target:x,should:p,shadowParent:XE(x)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(w){return w!==v})},1)},[]),f=u.useCallback(function(y){n.current=Mo(y),s.current=void 0},[]),h=u.useCallback(function(y){d(y.type,Mg(y),y.target,o(y,e.lockRef.current))},[]),m=u.useCallback(function(y){d(y.type,Mo(y),y.target,o(y,e.lockRef.current))},[]);u.useEffect(function(){return cr.push(l),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,or),document.addEventListener("touchmove",c,or),document.addEventListener("touchstart",f,or),function(){cr=cr.filter(function(y){return y!==l}),document.removeEventListener("wheel",c,or),document.removeEventListener("touchmove",c,or),document.removeEventListener("touchstart",f,or)}},[]);var g=e.removeScrollBar,b=e.inert;return u.createElement(u.Fragment,null,b?u.createElement(l,{styles:PE(r)}):null,g?u.createElement(zE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function XE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const FE=wE(Xj,YE);var Cu=u.forwardRef(function(e,t){return u.createElement(Su,qn({},e,{ref:t,sideCar:FE}))});Cu.classNames=Su.classNames;var KE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ur=new WeakMap,Oo=new WeakMap,Do={},Vd=0,Wj=function(e){return e&&(e.host||Wj(e.parentNode))},QE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=Wj(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ZE=function(e,t,n,s){var r=QE(t,Array.isArray(e)?e:[e]);Do[n]||(Do[n]=new WeakMap);var l=Do[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 g=m.getAttribute(s),b=g!==null&&g!=="false",y=(ur.get(m)||0)+1,j=(l.get(m)||0)+1;ur.set(m,y),l.set(m,j),i.push(m),y===1&&b&&Oo.set(m,!0),j===1&&m.setAttribute(n,"true"),b||m.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(t),o.clear(),Vd++,function(){i.forEach(function(h){var m=ur.get(h)-1,g=l.get(h)-1;ur.set(h,m),l.set(h,g),m||(Oo.has(h)||h.removeAttribute(s),Oo.delete(h)),g||h.removeAttribute(n)}),Vd--,Vd||(ur=new WeakMap,ur=new WeakMap,Oo=new WeakMap,Do={})}},Hm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=KE(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),ZE(s,r,n,"aria-hidden")):function(){return null}},Tu="Dialog",[Jj]=ts(Tu),[WE,Un]=Jj(Tu),e0=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:r,onOpenChange:l,modal:i=!0}=e,o=u.useRef(null),c=u.useRef(null),[d,f]=ga({prop:s,defaultProp:r??!1,onChange:l,caller:Tu});return a.jsx(WE,{scope:t,triggerRef:o,contentRef:c,contentId:An(),titleId:An(),descriptionId:An(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};e0.displayName=Tu;var t0="DialogTrigger",JE=u.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Un(t0,n),l=$e(t,r.triggerRef);return a.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":qm(r.open),...s,ref:l,onClick:te(e.onClick,r.onOpenToggle)})});JE.displayName=t0;var Bm="DialogPortal",[eR,n0]=Jj(Bm,{forceMount:void 0}),s0=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:r}=e,l=Un(Bm,t);return a.jsx(eR,{scope:t,forceMount:n,children:u.Children.map(s,i=>a.jsx(Nn,{present:n||l.open,children:a.jsx(eo,{asChild:!0,container:r,children:i})}))})};s0.displayName=Bm;var Hc="DialogOverlay",a0=u.forwardRef((e,t)=>{const n=n0(Hc,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,l=Un(Hc,e.__scopeDialog);return l.modal?a.jsx(Nn,{present:s||l.open,children:a.jsx(nR,{...r,ref:t})}):null});a0.displayName=Hc;var tR=Ga("DialogOverlay.RemoveScroll"),nR=u.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Un(Hc,n);return a.jsx(Cu,{as:tR,allowPinchZoom:!0,shards:[r.contentRef],children:a.jsx(je.div,{"data-state":qm(r.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Pa="DialogContent",r0=u.forwardRef((e,t)=>{const n=n0(Pa,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,l=Un(Pa,e.__scopeDialog);return a.jsx(Nn,{present:s||l.open,children:l.modal?a.jsx(sR,{...r,ref:t}):a.jsx(aR,{...r,ref:t})})});r0.displayName=Pa;var sR=u.forwardRef((e,t)=>{const n=Un(Pa,e.__scopeDialog),s=u.useRef(null),r=$e(t,n.contentRef,s);return u.useEffect(()=>{const l=s.current;if(l)return Hm(l)},[]),a.jsx(l0,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&l.preventDefault()}),onFocusOutside:te(e.onFocusOutside,l=>l.preventDefault())})}),aR=u.forwardRef((e,t)=>{const n=Un(Pa,e.__scopeDialog),s=u.useRef(!1),r=u.useRef(!1);return a.jsx(l0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(o=n.triggerRef.current)==null||o.focus(),l.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:l=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,l),l.defaultPrevented||(s.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()}})}),l0=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:l,...i}=e,o=Un(Pa,n),c=u.useRef(null),d=$e(t,c);return Um(),a.jsxs(a.Fragment,{children:[a.jsx(ku,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:l,children:a.jsx(Ji,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":qm(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(rR,{titleId:o.titleId}),a.jsx(iR,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Im="DialogTitle",i0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Un(Im,n);return a.jsx(je.h2,{id:r.titleId,...s,ref:t})});i0.displayName=Im;var o0="DialogDescription",c0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Un(o0,n);return a.jsx(je.p,{id:r.descriptionId,...s,ref:t})});c0.displayName=o0;var u0="DialogClose",d0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Un(u0,n);return a.jsx(je.button,{type:"button",...s,ref:t,onClick:te(e.onClick,()=>r.onOpenChange(!1))})});d0.displayName=u0;function qm(e){return e?"open":"closed"}var f0="DialogTitleWarning",[x6,h0]=DT(f0,{contentName:Pa,titleName:Im,docsSlug:"dialog"}),rR=({titleId:e})=>{const t=h0(f0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
375
|
+
|
|
376
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
377
|
+
|
|
378
|
+
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},lR="DialogDescriptionWarning",iR=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${h0(lR).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(s))},[s,e,t]),null},m0=e0,p0=s0,x0=a0,g0=r0,v0=i0,y0=c0,Gm=d0;function va({className:e,...t}){return a.jsx(vC,{role:"status","aria-label":"Loading",className:J("size-4 animate-spin",e),...t})}const qr="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",oR="border border-primary bg-accent text-accent-foreground hover:bg-accent",Eu=Wi("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"}}),q=u.forwardRef(({className:e,disabled:t,variant:n,size:s,asChild:r=!1,loading:l,children:i,...o},c)=>{const d=r?IT:"button",f=s==="icon"||s==="sm-icon"||s==="control-icon"||s==="xs-icon",h=a.jsx(va,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:J(!f&&"mr-2")}),m=r?i:l&&f?h:a.jsxs(a.Fragment,{children:[l?h:null,i]});return a.jsx(d,{className:J(Eu({variant:n,size:s,className:e})),ref:c,disabled:t||l,...o,children:m})});q.displayName="Button";const b0=u.createContext(null);function cR({container:e,children:t}){return a.jsx(b0.Provider,{value:e,children:t})}function to(){return u.useContext(b0)??void 0}function uR(e){return a.jsx(m0,{"data-slot":"alert-dialog",...e})}function dR({className:e,...t}){return a.jsx(x0,{"data-slot":"alert-dialog-overlay",className:J("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 fR({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:s,...r}){return a.jsxs(p0,{container:to(),children:[a.jsx(dR,{}),a.jsx(g0,{"data-slot":"alert-dialog-content",role:"alertdialog",className:J("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=>{s==null||s(l),l.preventDefault()},...r})]})}function hR({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:J("flex flex-col gap-2 text-center sm:text-left",e),...t})}function mR({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function pR({className:e,...t}){return a.jsx(v0,{"data-slot":"alert-dialog-title",className:J("text-lg font-semibold",e),...t})}function xR({className:e,...t}){return a.jsx(y0,{"data-slot":"alert-dialog-description",className:J("text-muted-foreground text-sm",e),...t})}function gR({className:e,variant:t,...n}){return a.jsx(Gm,{"data-slot":"alert-dialog-action",className:J(Eu({variant:t}),e),...n})}function vR({className:e,...t}){return a.jsx(Gm,{"data-slot":"alert-dialog-cancel",className:J(Eu({variant:"outline"}),e),...t})}function yR(){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 bR(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function yl(){const[e,t]=u.useState(null),n=u.useRef(null),s=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),s.current=yR();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=a.jsx(uR,{open:e!==null,onOpenChange:o=>{o||r(!1)},children:a.jsxs(fR,{onCloseAutoFocus:o=>bR(o,s.current),children:[a.jsxs(hR,{children:[a.jsx(pR,{children:e==null?void 0:e.title}),a.jsx(xR,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),a.jsxs(mR,{children:[a.jsx(vR,{children:"Cancel"}),a.jsx(gR,{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 cs="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",jR=Wi("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${cs} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${cs} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${cs} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${cs} text-foreground`,success:`${cs} border-success/40 bg-success/10 text-success`,warning:`${cs} border-warning/40 bg-warning/10 text-warning`,info:`${cs} border-info/40 bg-info/10 text-info`,error:`${cs} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${cs} 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 Re({className:e,variant:t,size:n,...s}){return a.jsx("div",{className:J(jR({variant:t,size:n}),e),...s})}function j0(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 w0(e){const[t,n]=u.useState(void 0);return Lt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=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 s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Ru="Checkbox",[wR]=ts(Ru),[_R,Pm]=wR(Ru);function NR(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:r,disabled:l,form:i,name:o,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[m,g]=ga({prop:n,defaultProp:r??!1,onChange:c,caller:Ru}),[b,y]=u.useState(null),[j,x]=u.useState(null),p=u.useRef(!1),v=b?!!i||!!b.closest("form"):!0,w={checked:m,disabled:l,setChecked:g,control:b,setControl:y,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:p,required:d,defaultChecked:ha(r)?!1:r,isFormControl:v,bubbleInput:j,setBubbleInput:x};return a.jsx(_R,{scope:t,...w,children:kR(h)?h(w):s})}var _0="CheckboxTrigger",N0=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...s},r)=>{const{control:l,value:i,disabled:o,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:b}=Pm(_0,e),y=$e(r,f),j=u.useRef(c);return u.useEffect(()=>{const x=l==null?void 0:l.form;if(x){const p=()=>h(j.current);return x.addEventListener("reset",p),()=>x.removeEventListener("reset",p)}},[l,h]),a.jsx(je.button,{type:"button",role:"checkbox","aria-checked":ha(c)?"mixed":c,"aria-required":d,"data-state":E0(c),"data-disabled":o?"":void 0,disabled:o,value:i,...s,ref:y,onKeyDown:te(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:te(n,x=>{h(p=>ha(p)?!0:!p),b&&g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});N0.displayName=_0;var Vm=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:s,checked:r,defaultChecked:l,required:i,disabled:o,value:c,onCheckedChange:d,form:f,...h}=e;return a.jsx(NR,{__scopeCheckbox:n,checked:r,defaultChecked:l,disabled:o,required:i,onCheckedChange:d,name:s,form:f,value:c,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(N0,{...h,ref:t,__scopeCheckbox:n}),m&&a.jsx(T0,{__scopeCheckbox:n})]})})});Vm.displayName=Ru;var k0="CheckboxIndicator",S0=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:s,...r}=e,l=Pm(k0,n);return a.jsx(Nn,{present:s||ha(l.checked)||l.checked===!0,children:a.jsx(je.span,{"data-state":E0(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});S0.displayName=k0;var C0="CheckboxBubbleInput",T0=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:s,hasConsumerStoppedPropagationRef:r,checked:l,defaultChecked:i,required:o,disabled:c,name:d,value:f,form:h,bubbleInput:m,setBubbleInput:g}=Pm(C0,e),b=$e(n,g),y=j0(l),j=w0(s);u.useEffect(()=>{const p=m;if(!p)return;const v=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(v,"checked").set,k=!r.current;if(y!==l&&N){const _=new Event("click",{bubbles:k});p.indeterminate=ha(l),N.call(p,ha(l)?!1:l),p.dispatchEvent(_)}},[m,y,l,r]);const x=u.useRef(ha(l)?!1:l);return a.jsx(je.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:o,disabled:c,name:d,value:f,form:h,...t,tabIndex:-1,ref:b,style:{...t.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});T0.displayName=C0;function kR(e){return typeof e=="function"}function ha(e){return e==="indeterminate"}function E0(e){return ha(e)?"indeterminate":e?"checked":"unchecked"}const bl=u.forwardRef(({className:e,...t},n)=>a.jsx(Vm,{ref:n,className:J("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:a.jsx(S0,{className:J("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?a.jsx(SC,{className:"size-4","aria-hidden":"true"}):a.jsx(pl,{className:"size-4","aria-hidden":"true"})})}));bl.displayName=Vm.displayName;const SR=Wi("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 Cs({...e}){return a.jsx(m0,{"data-slot":"dialog",...e})}function CR({...e}){const t=to();return a.jsx(p0,{"data-slot":"dialog-portal",container:t,...e})}function TR({className:e,...t}){return a.jsx(x0,{"data-slot":"dialog-overlay",className:J("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 Ts({className:e,children:t,showCloseButton:n=!0,size:s,...r}){return a.jsxs(CR,{"data-slot":"dialog-portal",children:[a.jsx(TR,{}),a.jsxs(g0,{"data-slot":"dialog-content",className:J(SR({size:s}),e),...r,children:[t,n&&a.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:[a.jsx($m,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Es({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:J("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Rs({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function As({className:e,...t}){return a.jsx(v0,{"data-slot":"dialog-title",className:J("text-lg leading-none font-semibold",e),...t})}function Ms({className:e,...t}){return a.jsx(y0,{"data-slot":"dialog-description",className:J("text-muted-foreground text-sm",e),...t})}function Ym(e){const t=e+"CollectionProvider",[n,s]=ts(t),[r,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=y=>{const{scope:j,children:x}=y,p=Ps.useRef(null),v=Ps.useRef(new Map).current;return a.jsx(r,{scope:j,itemMap:v,collectionRef:p,children:x})};i.displayName=t;const o=e+"CollectionSlot",c=Ga(o),d=Ps.forwardRef((y,j)=>{const{scope:x,children:p}=y,v=l(o,x),w=$e(j,v.collectionRef);return a.jsx(c,{ref:w,children:p})});d.displayName=o;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=Ga(f),g=Ps.forwardRef((y,j)=>{const{scope:x,children:p,...v}=y,w=Ps.useRef(null),N=$e(j,w),k=l(f,x);return Ps.useEffect(()=>(k.itemMap.set(w,{ref:w,...v}),()=>void k.itemMap.delete(w))),a.jsx(m,{[h]:"",ref:N,children:p})});g.displayName=f;function b(y){const j=l(e+"CollectionConsumer",y);return Ps.useCallback(()=>{const p=j.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${h}]`));return Array.from(j.itemMap.values()).sort((k,_)=>v.indexOf(k.ref.current)-v.indexOf(_.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:i,Slot:d,ItemSlot:g},b,s]}var ER=u.createContext(void 0);function Au(e){const t=u.useContext(ER);return e||t||"ltr"}const RR=["top","right","bottom","left"],ya=Math.min,tn=Math.max,Bc=Math.round,zo=Math.floor,Kn=e=>({x:e,y:e}),AR={left:"right",right:"left",bottom:"top",top:"bottom"},MR={start:"end",end:"start"};function uh(e,t,n){return tn(e,ya(t,n))}function Ns(e,t){return typeof e=="function"?e(t):e}function ks(e){return e.split("-")[0]}function jl(e){return e.split("-")[1]}function Xm(e){return e==="x"?"y":"x"}function Fm(e){return e==="y"?"height":"width"}function Pn(e){return["top","bottom"].includes(ks(e))?"y":"x"}function Km(e){return Xm(Pn(e))}function OR(e,t,n){n===void 0&&(n=!1);const s=jl(e),r=Km(e),l=Fm(r);let i=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=Ic(i)),[i,Ic(i)]}function DR(e){const t=Ic(e);return[dh(e),t,dh(t)]}function dh(e){return e.replace(/start|end/g,t=>MR[t])}function zR(e,t,n){const s=["left","right"],r=["right","left"],l=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:s:t?s:r;case"left":case"right":return t?l:i;default:return[]}}function $R(e,t,n,s){const r=jl(e);let l=zR(ks(e),n==="start",s);return r&&(l=l.map(i=>i+"-"+r),t&&(l=l.concat(l.map(dh)))),l}function Ic(e){return e.replace(/left|right|bottom|top/g,t=>AR[t])}function LR(e){return{top:0,right:0,bottom:0,left:0,...e}}function R0(e){return typeof e!="number"?LR(e):{top:e,right:e,bottom:e,left:e}}function qc(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function Dg(e,t,n){let{reference:s,floating:r}=e;const l=Pn(t),i=Km(t),o=Fm(i),c=ks(t),d=l==="y",f=s.x+s.width/2-r.width/2,h=s.y+s.height/2-r.height/2,m=s[o]/2-r[o]/2;let g;switch(c){case"top":g={x:f,y:s.y-r.height};break;case"bottom":g={x:f,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:h};break;case"left":g={x:s.x-r.width,y:h};break;default:g={x:s.x,y:s.y}}switch(jl(t)){case"start":g[i]-=m*(n&&d?-1:1);break;case"end":g[i]+=m*(n&&d?-1:1);break}return g}const UR=async(e,t,n)=>{const{placement:s="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}=Dg(d,s,c),m=s,g={},b=0;for(let y=0;y<o.length;y++){const{name:j,fn:x}=o[y],{x:p,y:v,data:w,reset:N}=await x({x:f,y:h,initialPlacement:s,placement:m,strategy:r,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=p??f,h=v??h,g={...g,[j]:{...g[j],...w}},N&&b<=50&&(b++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:f,y:h}=Dg(d,m,c)),y=-1)}return{x:f,y:h,placement:m,strategy:r,middlewareData:g}};async function Ci(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:l,rects:i,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=Ns(t,e),b=R0(g),j=o[m?h==="floating"?"reference":"floating":h],x=qc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(j)))==null||n?j:j.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),p=h==="floating"?{x:s,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},N=qc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:v,strategy:c}):p);return{top:(x.top-N.top+b.top)/w.y,bottom:(N.bottom-x.bottom+b.bottom)/w.y,left:(x.left-N.left+b.left)/w.x,right:(N.right-x.right+b.right)/w.x}}const HR=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:l,platform:i,elements:o,middlewareData:c}=t,{element:d,padding:f=0}=Ns(e,t)||{};if(d==null)return{};const h=R0(f),m={x:n,y:s},g=Km(r),b=Fm(g),y=await i.getDimensions(d),j=g==="y",x=j?"top":"left",p=j?"bottom":"right",v=j?"clientHeight":"clientWidth",w=l.reference[b]+l.reference[g]-m[g]-l.floating[b],N=m[g]-l.reference[g],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let _=k?k[v]:0;(!_||!await(i.isElement==null?void 0:i.isElement(k)))&&(_=o.floating[v]||l.floating[b]);const S=w/2-N/2,R=_/2-y[b]/2-1,M=ya(h[x],R),L=ya(h[p],R),I=M,T=_-y[b]-L,O=_/2-y[b]/2+S,Y=uh(I,O,T),E=!c.arrow&&jl(r)!=null&&O!==Y&&l.reference[b]/2-(O<I?M:L)-y[b]/2<0,H=E?O<I?O-I:O-T:0;return{[g]:m[g]+H,data:{[g]:Y,centerOffset:O-Y-H,...E&&{alignmentOffset:H}},reset:E}}}),BR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:l,rects:i,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...j}=Ns(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const x=ks(r),p=Pn(o),v=ks(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=m||(v||!y?[Ic(o)]:DR(o)),k=b!=="none";!m&&k&&N.push(...$R(o,y,b,w));const _=[o,...N],S=await Ci(t,j),R=[];let M=((s=l.flip)==null?void 0:s.overflows)||[];if(f&&R.push(S[x]),h){const O=OR(r,i,w);R.push(S[O[0]],S[O[1]])}if(M=[...M,{placement:r,overflows:R}],!R.every(O=>O<=0)){var L,I;const O=(((L=l.flip)==null?void 0:L.index)||0)+1,Y=_[O];if(Y&&(!(h==="alignment"?p!==Pn(Y):!1)||M.every(C=>C.overflows[0]>0&&Pn(C.placement)===p)))return{data:{index:O,overflows:M},reset:{placement:Y}};let E=(I=M.filter(H=>H.overflows[0]<=0).sort((H,C)=>H.overflows[1]-C.overflows[1])[0])==null?void 0:I.placement;if(!E)switch(g){case"bestFit":{var T;const H=(T=M.filter(C=>{if(k){const B=Pn(C.placement);return B===p||B==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(B=>B>0).reduce((B,Z)=>B+Z,0)]).sort((C,B)=>C[1]-B[1])[0])==null?void 0:T[0];H&&(E=H);break}case"initialPlacement":E=o;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function zg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $g(e){return RR.some(t=>e[t]>=0)}const IR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...r}=Ns(e,t);switch(s){case"referenceHidden":{const l=await Ci(t,{...r,elementContext:"reference"}),i=zg(l,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:$g(i)}}}case"escaped":{const l=await Ci(t,{...r,altBoundary:!0}),i=zg(l,n.floating);return{data:{escapedOffsets:i,escaped:$g(i)}}}default:return{}}}}};async function qR(e,t){const{placement:n,platform:s,elements:r}=e,l=await(s.isRTL==null?void 0:s.isRTL(r.floating)),i=ks(n),o=jl(n),c=Pn(n)==="y",d=["left","top"].includes(i)?-1:1,f=l&&c?-1:1,h=Ns(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof b=="number"&&(g=o==="end"?b*-1:b),c?{x:g*f,y:m*d}:{x:m*d,y:g*f}}const GR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:l,placement:i,middlewareData:o}=t,c=await qR(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(s=o.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:l+c.y,data:{...c,placement:i}}}}},PR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,{mainAxis:l=!0,crossAxis:i=!1,limiter:o={fn:j=>{let{x,y:p}=j;return{x,y:p}}},...c}=Ns(e,t),d={x:n,y:s},f=await Ci(t,c),h=Pn(ks(r)),m=Xm(h);let g=d[m],b=d[h];if(l){const j=m==="y"?"top":"left",x=m==="y"?"bottom":"right",p=g+f[j],v=g-f[x];g=uh(p,g,v)}if(i){const j=h==="y"?"top":"left",x=h==="y"?"bottom":"right",p=b+f[j],v=b-f[x];b=uh(p,b,v)}const y=o.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-s,enabled:{[m]:l,[h]:i}}}}}},VR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:l,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=Ns(e,t),f={x:n,y:s},h=Pn(r),m=Xm(h);let g=f[m],b=f[h];const y=Ns(o,t),j=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]+j.mainAxis,N=l.reference[m]+l.reference[v]-j.mainAxis;g<w?g=w:g>N&&(g=N)}if(d){var x,p;const v=m==="y"?"width":"height",w=["top","left"].includes(ks(r)),N=l.reference[h]-l.floating[v]+(w&&((x=i.offset)==null?void 0:x[h])||0)+(w?0:j.crossAxis),k=l.reference[h]+l.reference[v]+(w?0:((p=i.offset)==null?void 0:p[h])||0)-(w?j.crossAxis:0);b<N?b=N:b>k&&(b=k)}return{[m]:g,[h]:b}}}},YR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:l,platform:i,elements:o}=t,{apply:c=()=>{},...d}=Ns(e,t),f=await Ci(t,d),h=ks(r),m=jl(r),g=Pn(r)==="y",{width:b,height:y}=l.floating;let j,x;h==="top"||h==="bottom"?(j=h,x=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(x=h,j=m==="end"?"top":"bottom");const p=y-f.top-f.bottom,v=b-f.left-f.right,w=ya(y-f[j],p),N=ya(b-f[x],v),k=!t.middlewareData.shift;let _=w,S=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=v),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(_=p),k&&!m){const M=tn(f.left,0),L=tn(f.right,0),I=tn(f.top,0),T=tn(f.bottom,0);g?S=b-2*(M!==0||L!==0?M+L:tn(f.left,f.right)):_=y-2*(I!==0||T!==0?I+T:tn(f.top,f.bottom))}await c({...t,availableWidth:S,availableHeight:_});const R=await i.getDimensions(o.floating);return b!==R.width||y!==R.height?{reset:{rects:!0}}:{}}}};function Mu(){return typeof window<"u"}function wl(e){return A0(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ns(e){var t;return(t=(A0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function A0(e){return Mu()?e instanceof Node||e instanceof on(e).Node:!1}function zn(e){return Mu()?e instanceof Element||e instanceof on(e).Element:!1}function Zn(e){return Mu()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function Lg(e){return!Mu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}function no(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!["inline","contents"].includes(r)}function XR(e){return["table","td","th"].includes(wl(e))}function Ou(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Qm(e){const t=Zm(),n=zn(e)?$n(e):e;return["transform","translate","scale","rotate","perspective"].some(s=>n[s]?n[s]!=="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(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function FR(e){let t=ba(e);for(;Zn(t)&&!al(t);){if(Qm(t))return t;if(Ou(t))return null;t=ba(t)}return null}function Zm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function al(e){return["html","body","#document"].includes(wl(e))}function $n(e){return on(e).getComputedStyle(e)}function Du(e){return zn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ba(e){if(wl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lg(e)&&e.host||ns(e);return Lg(t)?t.host:t}function M0(e){const t=ba(e);return al(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zn(t)&&no(t)?t:M0(t)}function Ti(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=M0(e),l=r===((s=e.ownerDocument)==null?void 0:s.body),i=on(r);if(l){const o=fh(i);return t.concat(i,i.visualViewport||[],no(r)?r:[],o&&n?Ti(o):[])}return t.concat(r,Ti(r,[],n))}function fh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function O0(e){const t=$n(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Zn(e),l=r?e.offsetWidth:n,i=r?e.offsetHeight:s,o=Bc(n)!==l||Bc(s)!==i;return o&&(n=l,s=i),{width:n,height:s,$:o}}function Wm(e){return zn(e)?e:e.contextElement}function Gr(e){const t=Wm(e);if(!Zn(t))return Kn(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:l}=O0(t);let i=(l?Bc(n.width):n.width)/s,o=(l?Bc(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const KR=Kn(0);function D0(e){const t=on(e);return!Zm()||!t.visualViewport?KR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QR(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==on(e)?!1:t}function Va(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),l=Wm(e);let i=Kn(1);t&&(s?zn(s)&&(i=Gr(s)):i=Gr(e));const o=QR(l,n,s)?D0(l):Kn(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=on(l),g=s&&zn(s)?on(s):s;let b=m,y=fh(b);for(;y&&s&&g!==b;){const j=Gr(y),x=y.getBoundingClientRect(),p=$n(y),v=x.left+(y.clientLeft+parseFloat(p.paddingLeft))*j.x,w=x.top+(y.clientTop+parseFloat(p.paddingTop))*j.y;c*=j.x,d*=j.y,f*=j.x,h*=j.y,c+=v,d+=w,b=on(y),y=fh(b)}}return qc({width:f,height:h,x:c,y:d})}function Jm(e,t){const n=Du(e).scrollLeft;return t?t.left+n:Va(ns(e)).left+n}function z0(e,t,n){n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-(n?0:Jm(e,s)),l=s.top+t.scrollTop;return{x:r,y:l}}function ZR(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const l=r==="fixed",i=ns(s),o=t?Ou(t.floating):!1;if(s===i||o&&l)return n;let c={scrollLeft:0,scrollTop:0},d=Kn(1);const f=Kn(0),h=Zn(s);if((h||!h&&!l)&&((wl(s)!=="body"||no(i))&&(c=Du(s)),Zn(s))){const g=Va(s);d=Gr(s),f.x=g.x+s.clientLeft,f.y=g.y+s.clientTop}const m=i&&!h&&!l?z0(i,c,!0):Kn(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 WR(e){return Array.from(e.getClientRects())}function JR(e){const t=ns(e),n=Du(e),s=e.ownerDocument.body,r=tn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=tn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let i=-n.scrollLeft+Jm(e);const o=-n.scrollTop;return $n(s).direction==="rtl"&&(i+=tn(t.clientWidth,s.clientWidth)-r),{width:r,height:l,x:i,y:o}}function eA(e,t){const n=on(e),s=ns(e),r=n.visualViewport;let l=s.clientWidth,i=s.clientHeight,o=0,c=0;if(r){l=r.width,i=r.height;const d=Zm();(!d||d&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:l,height:i,x:o,y:c}}function tA(e,t){const n=Va(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,l=Zn(e)?Gr(e):Kn(1),i=e.clientWidth*l.x,o=e.clientHeight*l.y,c=r*l.x,d=s*l.y;return{width:i,height:o,x:c,y:d}}function Ug(e,t,n){let s;if(t==="viewport")s=eA(e,n);else if(t==="document")s=JR(ns(e));else if(zn(t))s=tA(t,n);else{const r=D0(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return qc(s)}function $0(e,t){const n=ba(e);return n===t||!zn(n)||al(n)?!1:$n(n).position==="fixed"||$0(n,t)}function nA(e,t){const n=t.get(e);if(n)return n;let s=Ti(e,[],!1).filter(o=>zn(o)&&wl(o)!=="body"),r=null;const l=$n(e).position==="fixed";let i=l?ba(e):e;for(;zn(i)&&!al(i);){const o=$n(i),c=Qm(i);!c&&o.position==="fixed"&&(r=null),(l?!c&&!r:!c&&o.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||no(i)&&!c&&$0(e,i))?s=s.filter(f=>f!==i):r=o,i=ba(i)}return t.set(e,s),s}function sA(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const i=[...n==="clippingAncestors"?Ou(t)?[]:nA(t,this._c):[].concat(n),s],o=i[0],c=i.reduce((d,f)=>{const h=Ug(t,f,r);return d.top=tn(h.top,d.top),d.right=ya(h.right,d.right),d.bottom=ya(h.bottom,d.bottom),d.left=tn(h.left,d.left),d},Ug(t,o,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function aA(e){const{width:t,height:n}=O0(e);return{width:t,height:n}}function rA(e,t,n){const s=Zn(t),r=ns(t),l=n==="fixed",i=Va(e,!0,l,t);let o={scrollLeft:0,scrollTop:0};const c=Kn(0);function d(){c.x=Jm(r)}if(s||!s&&!l)if((wl(t)!=="body"||no(r))&&(o=Du(t)),s){const g=Va(t,!0,l,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&d();l&&!s&&r&&d();const f=r&&!s&&!l?z0(r,o):Kn(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 Yd(e){return $n(e).position==="static"}function Hg(e,t){if(!Zn(e)||$n(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ns(e)===n&&(n=n.ownerDocument.body),n}function L0(e,t){const n=on(e);if(Ou(e))return n;if(!Zn(e)){let r=ba(e);for(;r&&!al(r);){if(zn(r)&&!Yd(r))return r;r=ba(r)}return n}let s=Hg(e,t);for(;s&&XR(s)&&Yd(s);)s=Hg(s,t);return s&&al(s)&&Yd(s)&&!Qm(s)?n:s||FR(e)||n}const lA=async function(e){const t=this.getOffsetParent||L0,n=this.getDimensions,s=await n(e.floating);return{reference:rA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function iA(e){return $n(e).direction==="rtl"}const oA={convertOffsetParentRelativeRectToViewportRelativeRect:ZR,getDocumentElement:ns,getClippingRect:sA,getOffsetParent:L0,getElementRects:lA,getClientRects:WR,getDimensions:aA,getScale:Gr,isElement:zn,isRTL:iA};function U0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cA(e,t){let n=null,s;const r=ns(e);function l(){var o;clearTimeout(s),(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:g}=d;if(o||t(),!m||!g)return;const b=zo(h),y=zo(r.clientWidth-(f+m)),j=zo(r.clientHeight-(h+g)),x=zo(f),v={rootMargin:-b+"px "+-y+"px "+-j+"px "+-x+"px",threshold:tn(0,ya(1,c))||1};let w=!0;function N(k){const _=k[0].intersectionRatio;if(_!==c){if(!w)return i();_?i(!1,_):s=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!U0(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(N,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,v)}n.observe(e)}return i(!0),l}function uA(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=Wm(e),f=r||l?[...d?Ti(d):[],...Ti(t)]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),l&&x.addEventListener("resize",n)});const h=d&&o?cA(d,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(x=>{let[p]=x;p&&p.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=g)==null||v.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let b,y=c?Va(e):null;c&&j();function j(){const x=Va(e);y&&!U0(y,x)&&n(),y=x,b=requestAnimationFrame(j)}return n(),()=>{var x;f.forEach(p=>{r&&p.removeEventListener("scroll",n),l&&p.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const dA=GR,fA=PR,hA=BR,mA=YR,pA=IR,Bg=HR,xA=VR,gA=(e,t,n)=>{const s=new Map,r={platform:oA,...n},l={...r.platform,_c:s};return UR(e,t,{...r,platform:l})};var vA=typeof document<"u",yA=function(){},ac=vA?u.useLayoutEffect:yA;function Gc(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,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Gc(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const l=r[s];if(!(l==="_owner"&&e.$$typeof)&&!Gc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function H0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ig(e,t){const n=H0(e);return Math.round(t*n)/n}function Xd(e){const t=u.useRef(e);return ac(()=>{t.current=e}),t}function bA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],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,g]=u.useState(s);Gc(m,s)||g(s);const[b,y]=u.useState(null),[j,x]=u.useState(null),p=u.useCallback(C=>{C!==k.current&&(k.current=C,y(C))},[]),v=u.useCallback(C=>{C!==_.current&&(_.current=C,x(C))},[]),w=l||b,N=i||j,k=u.useRef(null),_=u.useRef(null),S=u.useRef(f),R=c!=null,M=Xd(c),L=Xd(r),I=Xd(d),T=u.useCallback(()=>{if(!k.current||!_.current)return;const C={placement:t,strategy:n,middleware:m};L.current&&(C.platform=L.current),gA(k.current,_.current,C).then(B=>{const Z={...B,isPositioned:I.current!==!1};O.current&&!Gc(S.current,Z)&&(S.current=Z,il.flushSync(()=>{h(Z)}))})},[m,t,n,L,I]);ac(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[d]);const O=u.useRef(!1);ac(()=>(O.current=!0,()=>{O.current=!1}),[]),ac(()=>{if(w&&(k.current=w),N&&(_.current=N),w&&N){if(M.current)return M.current(w,N,T);T()}},[w,N,T,M,R]);const Y=u.useMemo(()=>({reference:k,floating:_,setReference:p,setFloating:v}),[p,v]),E=u.useMemo(()=>({reference:w,floating:N}),[w,N]),H=u.useMemo(()=>{const C={position:n,left:0,top:0};if(!E.floating)return C;const B=Ig(E.floating,f.x),Z=Ig(E.floating,f.y);return o?{...C,transform:"translate("+B+"px, "+Z+"px)",...H0(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:Z}},[n,o,E.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:T,refs:Y,elements:E,floatingStyles:H}),[f,T,Y,E,H])}const jA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:r}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Bg({element:s.current,padding:r}).fn(n):{}:s?Bg({element:s,padding:r}).fn(n):{}}}},wA=(e,t)=>({...dA(e),options:[e,t]}),_A=(e,t)=>({...fA(e),options:[e,t]}),NA=(e,t)=>({...xA(e),options:[e,t]}),kA=(e,t)=>({...hA(e),options:[e,t]}),SA=(e,t)=>({...mA(e),options:[e,t]}),CA=(e,t)=>({...pA(e),options:[e,t]}),TA=(e,t)=>({...jA(e),options:[e,t]});var EA="Arrow",B0=u.forwardRef((e,t)=>{const{children:n,width:s=10,height:r=5,...l}=e;return a.jsx(je.svg,{...l,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});B0.displayName=EA;var RA=B0,ep="Popper",[I0,_l]=ts(ep),[AA,q0]=I0(ep),G0=e=>{const{__scopePopper:t,children:n}=e,[s,r]=u.useState(null);return a.jsx(AA,{scope:t,anchor:s,onAnchorChange:r,children:n})};G0.displayName=ep;var P0="PopperAnchor",V0=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...r}=e,l=q0(P0,n),i=u.useRef(null),o=$e(t,i);return u.useEffect(()=>{l.onAnchorChange((s==null?void 0:s.current)||i.current)}),s?null:a.jsx(je.div,{...r,ref:o})});V0.displayName=P0;var tp="PopperContent",[MA,OA]=I0(tp),Y0=u.forwardRef((e,t)=>{var $,W,me,ve,be,re;const{__scopePopper:n,side:s="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:g="optimized",onPlaced:b,...y}=e,j=q0(tp,n),[x,p]=u.useState(null),v=$e(t,ue=>p(ue)),[w,N]=u.useState(null),k=w0(w),_=(k==null?void 0:k.width)??0,S=(k==null?void 0:k.height)??0,R=s+(l!=="center"?"-"+l:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},L=Array.isArray(d)?d:[d],I=L.length>0,T={padding:M,boundary:L.filter(zA),altBoundary:I},{refs:O,floatingStyles:Y,placement:E,isPositioned:H,middlewareData:C}=bA({strategy:"fixed",placement:R,whileElementsMounted:(...ue)=>uA(...ue,{animationFrame:g==="always"}),elements:{reference:j.anchor},middleware:[wA({mainAxis:r+S,alignmentAxis:i}),c&&_A({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?NA():void 0,...T}),c&&kA({...T}),SA({...T,apply:({elements:ue,rects:le,availableWidth:Ye,availableHeight:fe})=>{const{width:V,height:ge}=le.reference,Ae=ue.floating.style;Ae.setProperty("--radix-popper-available-width",`${Ye}px`),Ae.setProperty("--radix-popper-available-height",`${fe}px`),Ae.setProperty("--radix-popper-anchor-width",`${V}px`),Ae.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),w&&TA({element:w,padding:o}),$A({arrowWidth:_,arrowHeight:S}),m&&CA({strategy:"referenceHidden",...T})]}),[B,Z]=K0(E),z=Qn(b);Lt(()=>{H&&(z==null||z())},[H,z]);const K=($=C.arrow)==null?void 0:$.x,ae=(W=C.arrow)==null?void 0:W.y,Q=((me=C.arrow)==null?void 0:me.centerOffset)!==0,[F,U]=u.useState();return Lt(()=>{x&&U(window.getComputedStyle(x).zIndex)},[x]),a.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:F,"--radix-popper-transform-origin":[(ve=C.transformOrigin)==null?void 0:ve.x,(be=C.transformOrigin)==null?void 0:be.y].join(" "),...((re=C.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(MA,{scope:n,placedSide:B,onArrowChange:N,arrowX:K,arrowY:ae,shouldHideArrow:Q,children:a.jsx(je.div,{"data-side":B,"data-align":Z,...y,ref:v,style:{...y.style,animation:H?void 0:"none"}})})})});Y0.displayName=tp;var X0="PopperArrow",DA={top:"bottom",right:"left",bottom:"top",left:"right"},F0=u.forwardRef(function(t,n){const{__scopePopper:s,...r}=t,l=OA(X0,s),i=DA[l.placedSide];return a.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:a.jsx(RA,{...r,ref:n,style:{...r.style,display:"block"}})})});F0.displayName=X0;function zA(e){return e!==null}var $A=e=>({name:"transformOrigin",options:e,fn(t){var j,x,p;const{placement:n,rects:s,middlewareData:r}=t,i=((j=r.arrow)==null?void 0:j.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=K0(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=r.arrow)==null?void 0:x.x)??0)+o/2,g=(((p=r.arrow)==null?void 0:p.y)??0)+c/2;let b="",y="";return d==="bottom"?(b=i?h:`${m}px`,y=`${-c}px`):d==="top"?(b=i?h:`${m}px`,y=`${s.floating.height+c}px`):d==="right"?(b=`${-c}px`,y=i?h:`${g}px`):d==="left"&&(b=`${s.floating.width+c}px`,y=i?h:`${g}px`),{data:{x:b,y}}}});function K0(e){const[t,n="center"]=e.split("-");return[t,n]}var np=G0,sp=V0,ap=Y0,rp=F0,Fd="rovingFocusGroup.onEntryFocus",LA={bubbles:!1,cancelable:!0},so="RovingFocusGroup",[hh,Q0,UA]=Ym(so),[HA,zu]=ts(so,[UA]),[BA,IA]=HA(so),Z0=u.forwardRef((e,t)=>a.jsx(hh.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(hh.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(qA,{...e,ref:t})})}));Z0.displayName=so;var qA=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:r=!1,dir:l,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=u.useRef(null),g=$e(t,m),b=Au(l),[y,j]=ga({prop:i,defaultProp:o??null,onChange:c,caller:so}),[x,p]=u.useState(!1),v=Qn(d),w=Q0(n),N=u.useRef(!1),[k,_]=u.useState(0);return u.useEffect(()=>{const S=m.current;if(S)return S.addEventListener(Fd,v),()=>S.removeEventListener(Fd,v)},[v]),a.jsx(BA,{scope:n,orientation:s,dir:b,loop:r,currentTabStopId:y,onItemFocus:u.useCallback(S=>j(S),[j]),onItemShiftTab:u.useCallback(()=>p(!0),[]),onFocusableItemAdd:u.useCallback(()=>_(S=>S+1),[]),onFocusableItemRemove:u.useCallback(()=>_(S=>S-1),[]),children:a.jsx(je.div,{tabIndex:x||k===0?-1:0,"data-orientation":s,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{N.current=!0}),onFocus:te(e.onFocus,S=>{const R=!N.current;if(S.target===S.currentTarget&&R&&!x){const M=new CustomEvent(Fd,LA);if(S.currentTarget.dispatchEvent(M),!M.defaultPrevented){const L=w().filter(E=>E.focusable),I=L.find(E=>E.active),T=L.find(E=>E.id===y),Y=[I,T,...L].filter(Boolean).map(E=>E.ref.current);ew(Y,f)}}N.current=!1}),onBlur:te(e.onBlur,()=>p(!1))})})}),W0="RovingFocusGroupItem",J0=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:r=!1,tabStopId:l,children:i,...o}=e,c=An(),d=l||c,f=IA(W0,n),h=f.currentTabStopId===d,m=Q0(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:y}=f;return u.useEffect(()=>{if(s)return g(),()=>b()},[s,g,b]),a.jsx(hh.ItemSlot,{scope:n,id:d,focusable:s,active:r,children:a.jsx(je.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:te(e.onMouseDown,j=>{s?f.onItemFocus(d):j.preventDefault()}),onFocus:te(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:te(e.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){f.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const x=VA(j,f.orientation,f.dir);if(x!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let v=m().filter(w=>w.focusable).map(w=>w.ref.current);if(x==="last")v.reverse();else if(x==="prev"||x==="next"){x==="prev"&&v.reverse();const w=v.indexOf(j.currentTarget);v=f.loop?YA(v,w+1):v.slice(w+1)}setTimeout(()=>ew(v))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:y!=null}):i})})});J0.displayName=W0;var GA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function PA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VA(e,t,n){const s=PA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return GA[s]}function ew(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function YA(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var tw=Z0,nw=J0,mh=["Enter"," "],XA=["ArrowDown","PageUp","Home"],sw=["ArrowUp","PageDown","End"],FA=[...XA,...sw],KA={ltr:[...mh,"ArrowRight"],rtl:[...mh,"ArrowLeft"]},QA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ao="Menu",[Ei,ZA,WA]=Ym(ao),[er,aw]=ts(ao,[WA,_l,zu]),$u=_l(),rw=zu(),[JA,tr]=er(ao),[eM,ro]=er(ao),lw=e=>{const{__scopeMenu:t,open:n=!1,children:s,dir:r,onOpenChange:l,modal:i=!0}=e,o=$u(t),[c,d]=u.useState(null),f=u.useRef(!1),h=Qn(l),m=Au(r);return u.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),a.jsx(np,{...o,children:a.jsx(JA,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:a.jsx(eM,{scope:t,onClose:u.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:s})})})};lw.displayName=ao;var tM="MenuAnchor",lp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,r=$u(n);return a.jsx(sp,{...r,...s,ref:t})});lp.displayName=tM;var ip="MenuPortal",[nM,iw]=er(ip,{forceMount:void 0}),ow=e=>{const{__scopeMenu:t,forceMount:n,children:s,container:r}=e,l=tr(ip,t);return a.jsx(nM,{scope:t,forceMount:n,children:a.jsx(Nn,{present:n||l.open,children:a.jsx(eo,{asChild:!0,container:r,children:s})})})};ow.displayName=ip;var bn="MenuContent",[sM,op]=er(bn),cw=u.forwardRef((e,t)=>{const n=iw(bn,e.__scopeMenu),{forceMount:s=n.forceMount,...r}=e,l=tr(bn,e.__scopeMenu),i=ro(bn,e.__scopeMenu);return a.jsx(Ei.Provider,{scope:e.__scopeMenu,children:a.jsx(Nn,{present:s||l.open,children:a.jsx(Ei.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(aM,{...r,ref:t}):a.jsx(rM,{...r,ref:t})})})})}),aM=u.forwardRef((e,t)=>{const n=tr(bn,e.__scopeMenu),s=u.useRef(null),r=$e(t,s);return u.useEffect(()=>{const l=s.current;if(l)return Hm(l)},[]),a.jsx(cp,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rM=u.forwardRef((e,t)=>{const n=tr(bn,e.__scopeMenu);return a.jsx(cp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lM=Ga("MenuContent.ScrollLock"),cp=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:r,onOpenAutoFocus:l,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...y}=e,j=tr(bn,n),x=ro(bn,n),p=$u(n),v=rw(n),w=ZA(n),[N,k]=u.useState(null),_=u.useRef(null),S=$e(t,_,j.onContentChange),R=u.useRef(0),M=u.useRef(""),L=u.useRef(0),I=u.useRef(null),T=u.useRef("right"),O=u.useRef(0),Y=b?Cu:u.Fragment,E=b?{as:lM,allowPinchZoom:!0}:void 0,H=B=>{var $,W;const Z=M.current+B,z=w().filter(me=>!me.disabled),K=document.activeElement,ae=($=z.find(me=>me.ref.current===K))==null?void 0:$.textValue,Q=z.map(me=>me.textValue),F=vM(Q,Z,ae),U=(W=z.find(me=>me.textValue===F))==null?void 0:W.ref.current;(function me(ve){M.current=ve,window.clearTimeout(R.current),ve!==""&&(R.current=window.setTimeout(()=>me(""),1e3))})(Z),U&&setTimeout(()=>U.focus())};u.useEffect(()=>()=>window.clearTimeout(R.current),[]),Um();const C=u.useCallback(B=>{var z,K;return T.current===((z=I.current)==null?void 0:z.side)&&bM(B,(K=I.current)==null?void 0:K.area)},[]);return a.jsx(sM,{scope:n,searchRef:M,onItemEnter:u.useCallback(B=>{C(B)&&B.preventDefault()},[C]),onItemLeave:u.useCallback(B=>{var Z;C(B)||((Z=_.current)==null||Z.focus(),k(null))},[C]),onTriggerLeave:u.useCallback(B=>{C(B)&&B.preventDefault()},[C]),pointerGraceTimerRef:L,onPointerGraceIntentChange:u.useCallback(B=>{I.current=B},[]),children:a.jsx(Y,{...E,children:a.jsx(ku,{asChild:!0,trapped:r,onMountAutoFocus:te(l,B=>{var Z;B.preventDefault(),(Z=_.current)==null||Z.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(tw,{asChild:!0,...v,dir:x.dir,orientation:"vertical",loop:s,currentTabStopId:N,onCurrentTabStopIdChange:k,onEntryFocus:te(c,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(ap,{role:"menu","aria-orientation":"vertical","data-state":kw(j.open),"data-radix-menu-content":"",dir:x.dir,...p,...y,ref:S,style:{outline:"none",...y.style},onKeyDown:te(y.onKeyDown,B=>{const z=B.target.closest("[data-radix-menu-content]")===B.currentTarget,K=B.ctrlKey||B.altKey||B.metaKey,ae=B.key.length===1;z&&(B.key==="Tab"&&B.preventDefault(),!K&&ae&&H(B.key));const Q=_.current;if(B.target!==Q||!FA.includes(B.key))return;B.preventDefault();const U=w().filter($=>!$.disabled).map($=>$.ref.current);sw.includes(B.key)&&U.reverse(),xM(U)}),onBlur:te(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:te(e.onPointerMove,Ri(B=>{const Z=B.target,z=O.current!==B.clientX;if(B.currentTarget.contains(Z)&&z){const K=B.clientX>O.current?"right":"left";T.current=K,O.current=B.clientX}}))})})})})})})});cw.displayName=bn;var iM="MenuGroup",up=u.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return a.jsx(je.div,{role:"group",...s,ref:t})});up.displayName=iM;var oM="MenuLabel",uw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return a.jsx(je.div,{...s,ref:t})});uw.displayName=oM;var Pc="MenuItem",qg="menu.itemSelect",Lu=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:s,...r}=e,l=u.useRef(null),i=ro(Pc,e.__scopeMenu),o=op(Pc,e.__scopeMenu),c=$e(t,l),d=u.useRef(!1),f=()=>{const h=l.current;if(!n&&h){const m=new CustomEvent(qg,{bubbles:!0,cancelable:!0});h.addEventListener(qg,g=>s==null?void 0:s(g),{once:!0}),Ij(h,m),m.defaultPrevented?d.current=!1:i.onClose()}};return a.jsx(dw,{...r,ref:c,disabled:n,onClick:te(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:te(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:te(e.onKeyDown,h=>{const m=o.searchRef.current!=="";n||m&&h.key===" "||mh.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Lu.displayName=Pc;var dw=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:s=!1,textValue:r,...l}=e,i=op(Pc,n),o=rw(n),c=u.useRef(null),d=$e(t,c),[f,h]=u.useState(!1),[m,g]=u.useState("");return u.useEffect(()=>{const b=c.current;b&&g((b.textContent??"").trim())},[l.children]),a.jsx(Ei.ItemSlot,{scope:n,disabled:s,textValue:r??m,children:a.jsx(nw,{asChild:!0,...o,focusable:!s,children:a.jsx(je.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...l,ref:d,onPointerMove:te(e.onPointerMove,Ri(b=>{s?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Ri(b=>i.onItemLeave(b))),onFocus:te(e.onFocus,()=>h(!0)),onBlur:te(e.onBlur,()=>h(!1))})})})}),cM="MenuCheckboxItem",fw=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:s,...r}=e;return a.jsx(gw,{scope:e.__scopeMenu,checked:n,children:a.jsx(Lu,{role:"menuitemcheckbox","aria-checked":Vc(n)?"mixed":n,...r,ref:t,"data-state":fp(n),onSelect:te(r.onSelect,()=>s==null?void 0:s(Vc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fw.displayName=cM;var hw="MenuRadioGroup",[uM,dM]=er(hw,{value:void 0,onValueChange:()=>{}}),mw=u.forwardRef((e,t)=>{const{value:n,onValueChange:s,...r}=e,l=Qn(s);return a.jsx(uM,{scope:e.__scopeMenu,value:n,onValueChange:l,children:a.jsx(up,{...r,ref:t})})});mw.displayName=hw;var pw="MenuRadioItem",xw=u.forwardRef((e,t)=>{const{value:n,...s}=e,r=dM(pw,e.__scopeMenu),l=n===r.value;return a.jsx(gw,{scope:e.__scopeMenu,checked:l,children:a.jsx(Lu,{role:"menuitemradio","aria-checked":l,...s,ref:t,"data-state":fp(l),onSelect:te(s.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});xw.displayName=pw;var dp="MenuItemIndicator",[gw,fM]=er(dp,{checked:!1}),vw=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:s,...r}=e,l=fM(dp,n);return a.jsx(Nn,{present:s||Vc(l.checked)||l.checked===!0,children:a.jsx(je.span,{...r,ref:t,"data-state":fp(l.checked)})})});vw.displayName=dp;var hM="MenuSeparator",yw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return a.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});yw.displayName=hM;var mM="MenuArrow",bw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,r=$u(n);return a.jsx(rp,{...r,...s,ref:t})});bw.displayName=mM;var pM="MenuSub",[g6,jw]=er(pM),Vl="MenuSubTrigger",ww=u.forwardRef((e,t)=>{const n=tr(Vl,e.__scopeMenu),s=ro(Vl,e.__scopeMenu),r=jw(Vl,e.__scopeMenu),l=op(Vl,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]),a.jsx(lp,{asChild:!0,...d,children:a.jsx(dw,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":kw(n.open),...e,ref:Nu(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:te(e.onPointerMove,Ri(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:te(e.onPointerLeave,Ri(h=>{var g,b;f();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const y=(b=n.content)==null?void 0:b.dataset.side,j=y==="right",x=j?-5:5,p=m[j?"left":"right"],v=m[j?"right":"left"];l.onPointerGraceIntentChange({area:[{x:h.clientX+x,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:te(e.onKeyDown,h=>{var g;const m=l.searchRef.current!=="";e.disabled||m&&h.key===" "||KA[s.dir].includes(h.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),h.preventDefault())})})})});ww.displayName=Vl;var _w="MenuSubContent",Nw=u.forwardRef((e,t)=>{const n=iw(bn,e.__scopeMenu),{forceMount:s=n.forceMount,...r}=e,l=tr(bn,e.__scopeMenu),i=ro(bn,e.__scopeMenu),o=jw(_w,e.__scopeMenu),c=u.useRef(null),d=$e(t,c);return a.jsx(Ei.Provider,{scope:e.__scopeMenu,children:a.jsx(Nn,{present:s||l.open,children:a.jsx(Ei.Slot,{scope:e.__scopeMenu,children:a.jsx(cp,{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:te(e.onFocusOutside,f=>{f.target!==o.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:te(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:te(e.onKeyDown,f=>{var g;const h=f.currentTarget.contains(f.target),m=QA[i.dir].includes(f.key);h&&m&&(l.onOpenChange(!1),(g=o.trigger)==null||g.focus(),f.preventDefault())})})})})})});Nw.displayName=_w;function kw(e){return e?"open":"closed"}function Vc(e){return e==="indeterminate"}function fp(e){return Vc(e)?"indeterminate":e?"checked":"unchecked"}function xM(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gM(e,t){return e.map((n,s)=>e[(t+s)%e.length])}function vM(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=gM(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 yM(e,t){const{x:n,y:s}=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>s!=m>s&&n<(h-d)*(s-f)/(m-f)+d&&(r=!r)}return r}function bM(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yM(n,t)}function Ri(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jM=lw,wM=lp,_M=ow,NM=cw,kM=up,SM=uw,CM=Lu,TM=fw,EM=mw,RM=xw,AM=vw,MM=yw,OM=bw,DM=ww,zM=Nw,Uu="DropdownMenu",[$M]=ts(Uu,[aw]),qt=aw(),[LM,Sw]=$M(Uu),Cw=e=>{const{__scopeDropdownMenu:t,children:n,dir:s,open:r,defaultOpen:l,onOpenChange:i,modal:o=!0}=e,c=qt(t),d=u.useRef(null),[f,h]=ga({prop:r,defaultProp:l??!1,onChange:i,caller:Uu});return a.jsx(LM,{scope:t,triggerId:An(),triggerRef:d,contentId:An(),open:f,onOpenChange:h,onOpenToggle:u.useCallback(()=>h(m=>!m),[h]),modal:o,children:a.jsx(jM,{...c,open:f,onOpenChange:h,dir:s,modal:o,children:n})})};Cw.displayName=Uu;var Tw="DropdownMenuTrigger",Ew=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...r}=e,l=Sw(Tw,n),i=qt(n);return a.jsx(wM,{asChild:!0,...i,children:a.jsx(je.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":s?"":void 0,disabled:s,...r,ref:Nu(t,l.triggerRef),onPointerDown:te(e.onPointerDown,o=>{!s&&o.button===0&&o.ctrlKey===!1&&(l.onOpenToggle(),l.open||o.preventDefault())}),onKeyDown:te(e.onKeyDown,o=>{s||(["Enter"," "].includes(o.key)&&l.onOpenToggle(),o.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});Ew.displayName=Tw;var UM="DropdownMenuPortal",Rw=e=>{const{__scopeDropdownMenu:t,...n}=e,s=qt(t);return a.jsx(_M,{...s,...n})};Rw.displayName=UM;var Aw="DropdownMenuContent",Mw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=Sw(Aw,n),l=qt(n),i=u.useRef(!1);return a.jsx(NM,{id:r.contentId,"aria-labelledby":r.triggerId,...l,...s,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,o=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:te(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)"}})});Mw.displayName=Aw;var HM="DropdownMenuGroup",BM=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(kM,{...r,...s,ref:t})});BM.displayName=HM;var IM="DropdownMenuLabel",Ow=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(SM,{...r,...s,ref:t})});Ow.displayName=IM;var qM="DropdownMenuItem",Dw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(CM,{...r,...s,ref:t})});Dw.displayName=qM;var GM="DropdownMenuCheckboxItem",zw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(TM,{...r,...s,ref:t})});zw.displayName=GM;var PM="DropdownMenuRadioGroup",VM=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(EM,{...r,...s,ref:t})});VM.displayName=PM;var YM="DropdownMenuRadioItem",$w=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(RM,{...r,...s,ref:t})});$w.displayName=YM;var XM="DropdownMenuItemIndicator",Lw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(AM,{...r,...s,ref:t})});Lw.displayName=XM;var FM="DropdownMenuSeparator",Uw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(MM,{...r,...s,ref:t})});Uw.displayName=FM;var KM="DropdownMenuArrow",QM=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(OM,{...r,...s,ref:t})});QM.displayName=KM;var ZM="DropdownMenuSubTrigger",Hw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(DM,{...r,...s,ref:t})});Hw.displayName=ZM;var WM="DropdownMenuSubContent",Bw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,r=qt(n);return a.jsx(zM,{...r,...s,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)"}})});Bw.displayName=WM;var JM=Cw,e4=Ew,t4=Rw,Iw=Mw,qw=Ow,Gw=Dw,Pw=zw,Vw=$w,Yw=Lw,Xw=Uw,Fw=Hw,Kw=Bw;const Hu=JM,Bu=e4,n4=u.forwardRef(({className:e,inset:t,children:n,...s},r)=>a.jsxs(Fw,{ref:r,className:J("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),...s,children:[n,a.jsx(wj,{className:"ml-auto"})]}));n4.displayName=Fw.displayName;const s4=u.forwardRef(({className:e,...t},n)=>a.jsx(Kw,{ref:n,className:J("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}));s4.displayName=Kw.displayName;const lo=u.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(t4,{container:to(),children:a.jsx(Iw,{ref:s,sideOffset:t,className:J("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})}));lo.displayName=Iw.displayName;const Ya=u.forwardRef(({className:e,inset:t,...n},s)=>a.jsx(Gw,{ref:s,className:J("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}));Ya.displayName=Gw.displayName;const a4=u.forwardRef(({className:e,children:t,checked:n,...s},r)=>a.jsxs(Pw,{ref:r,className:J("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,...s,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Yw,{children:a.jsx(pl,{className:"h-4 w-4"})})}),t]}));a4.displayName=Pw.displayName;const r4=u.forwardRef(({className:e,children:t,...n},s)=>a.jsxs(Vw,{ref:s,className:J("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:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Yw,{children:a.jsx(Y2,{className:"h-2 w-2 fill-current"})})}),t]}));r4.displayName=Vw.displayName;const l4=u.forwardRef(({className:e,inset:t,...n},s)=>a.jsx(qw,{ref:s,className:J("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));l4.displayName=qw.displayName;const i4=u.forwardRef(({className:e,...t},n)=>a.jsx(Xw,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));i4.displayName=Xw.displayName;const o4={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},Tt=u.forwardRef(({className:e,type:t,inputSize:n="default",...s},r)=>a.jsx("input",{type:t,className:J("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",o4[n],e),ref:r,...s}));Tt.displayName="Input";var c4="Label",Qw=u.forwardRef((e,t)=>a.jsx(je.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())}}));Qw.displayName=c4;var Zw=Qw;const u4=Wi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=u.forwardRef(({className:e,...t},n)=>a.jsx(Zw,{ref:n,className:J(u4(),e),...t}));Me.displayName=Zw.displayName;function nr({title:e,description:t,backHref:n,backLabel:s,className:r,icon:l,link:i}){const o=a.jsx(q,{asChild:!0,variant:"outline",size:"sm",className:"mt-4 no-underline",children:a.jsx(i,{href:n,children:s})});return l?a.jsx("div",{className:J("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:a.jsxs("section",{className:"mx-auto flex max-w-xl flex-col items-center text-center","data-testid":"not-found-state",children:[a.jsx("div",{className:"text-foreground mb-2 [&_svg]:size-8",children:l}),a.jsx("h1",{className:"m-0 text-xl font-semibold tracking-tight",children:e}),a.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})}):a.jsx("div",{className:J("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:a.jsxs("section",{className:"border-border bg-card mx-auto max-w-xl rounded-xl border p-6",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:e}),a.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})})}function Kt({title:e,description:t,actions:n,className:s,children:r,...l}){return a.jsxs("header",{"data-slot":"page-header",className:J("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",s),...l,children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("h1",{className:"text-foreground text-2xl font-semibold tracking-tight",children:e}),t?a.jsx("p",{className:"text-muted-foreground text-sm",children:t}):null,r]}),n?a.jsx("div",{"data-slot":"page-header-actions",className:"flex shrink-0 items-center gap-2",children:n}):null]})}function pt({as:e="div",className:t,...n}){return a.jsx(e,{className:J("rounded-lg border",t),...n})}function Gg(e,[t,n]){return Math.min(n,Math.max(t,e))}var Ww=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"}),d4="VisuallyHidden",Jw=u.forwardRef((e,t)=>a.jsx(je.span,{...e,ref:t,style:{...Ww,...e.style}}));Jw.displayName=d4;var f4=Jw,h4=[" ","Enter","ArrowUp","ArrowDown"],m4=[" ","Enter"],Xa="Select",[Iu,qu,p4]=Ym(Xa),[Nl]=ts(Xa,[p4,_l]),Gu=_l(),[x4,_a]=Nl(Xa),[g4,v4]=Nl(Xa),e_=e=>{const{__scopeSelect:t,children:n,open:s,defaultOpen:r,onOpenChange:l,value:i,defaultValue:o,onValueChange:c,dir:d,name:f,autoComplete:h,disabled:m,required:g,form:b}=e,y=Gu(t),[j,x]=u.useState(null),[p,v]=u.useState(null),[w,N]=u.useState(!1),k=Au(d),[_,S]=ga({prop:s,defaultProp:r??!1,onChange:l,caller:Xa}),[R,M]=ga({prop:i,defaultProp:o,onChange:c,caller:Xa}),L=u.useRef(null),I=j?b||!!j.closest("form"):!0,[T,O]=u.useState(new Set),Y=Array.from(T).map(E=>E.props.value).join(";");return a.jsx(np,{...y,children:a.jsxs(x4,{required:g,scope:t,trigger:j,onTriggerChange:x,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:N,contentId:An(),value:R,onValueChange:M,open:_,onOpenChange:S,dir:k,triggerPointerDownPosRef:L,disabled:m,children:[a.jsx(Iu.Provider,{scope:t,children:a.jsx(g4,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(E=>{O(H=>new Set(H).add(E))},[]),onNativeOptionRemove:u.useCallback(E=>{O(H=>{const C=new Set(H);return C.delete(E),C})},[]),children:n})}),I?a.jsxs(N_,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:h,value:R,onChange:E=>M(E.target.value),disabled:m,form:b,children:[R===void 0?a.jsx("option",{value:""}):null,Array.from(T)]},Y):null]})})};e_.displayName=Xa;var t_="SelectTrigger",n_=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:s=!1,...r}=e,l=Gu(n),i=_a(t_,n),o=i.disabled||s,c=$e(t,i.onTriggerChange),d=qu(n),f=u.useRef("touch"),[h,m,g]=S_(y=>{const j=d().filter(v=>!v.disabled),x=j.find(v=>v.value===i.value),p=C_(j,y,x);p!==void 0&&i.onValueChange(p.value)}),b=y=>{o||(i.onOpenChange(!0),g()),y&&(i.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return a.jsx(sp,{asChild:!0,...l,children:a.jsx(je.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":k_(i.value)?"":void 0,...r,ref:c,onClick:te(r.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&b(y)}),onPointerDown:te(r.onPointerDown,y=>{f.current=y.pointerType;const j=y.target;j.hasPointerCapture(y.pointerId)&&j.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(b(y),y.preventDefault())}),onKeyDown:te(r.onKeyDown,y=>{const j=h.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(j&&y.key===" ")&&h4.includes(y.key)&&(b(),y.preventDefault())})})})});n_.displayName=t_;var s_="SelectValue",a_=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:r,children:l,placeholder:i="",...o}=e,c=_a(s_,n),{onValueNodeHasChildrenChange:d}=c,f=l!==void 0,h=$e(t,c.onValueNodeChange);return Lt(()=>{d(f)},[d,f]),a.jsx(je.span,{...o,ref:h,style:{pointerEvents:"none"},children:k_(c.value)?a.jsx(a.Fragment,{children:i}):l})});a_.displayName=s_;var y4="SelectIcon",r_=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:s,...r}=e;return a.jsx(je.span,{"aria-hidden":!0,...r,ref:t,children:s||"▼"})});r_.displayName=y4;var b4="SelectPortal",l_=e=>a.jsx(eo,{asChild:!0,...e});l_.displayName=b4;var Fa="SelectContent",i_=u.forwardRef((e,t)=>{const n=_a(Fa,e.__scopeSelect),[s,r]=u.useState();if(Lt(()=>{r(new DocumentFragment)},[]),!n.open){const l=s;return l?il.createPortal(a.jsx(o_,{scope:e.__scopeSelect,children:a.jsx(Iu.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),l):null}return a.jsx(c_,{...e,ref:t})});i_.displayName=Fa;var Sn=10,[o_,Na]=Nl(Fa),j4="SelectContentImpl",w4=Ga("SelectContent.RemoveScroll"),c_=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:l,onPointerDownOutside:i,side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:j,...x}=e,p=_a(Fa,n),[v,w]=u.useState(null),[N,k]=u.useState(null),_=$e(t,$=>w($)),[S,R]=u.useState(null),[M,L]=u.useState(null),I=qu(n),[T,O]=u.useState(!1),Y=u.useRef(!1);u.useEffect(()=>{if(v)return Hm(v)},[v]),Um();const E=u.useCallback($=>{const[W,...me]=I().map(re=>re.ref.current),[ve]=me.slice(-1),be=document.activeElement;for(const re of $)if(re===be||(re==null||re.scrollIntoView({block:"nearest"}),re===W&&N&&(N.scrollTop=0),re===ve&&N&&(N.scrollTop=N.scrollHeight),re==null||re.focus(),document.activeElement!==be))return},[I,N]),H=u.useCallback(()=>E([S,v]),[E,S,v]);u.useEffect(()=>{T&&H()},[T,H]);const{onOpenChange:C,triggerPointerDownPosRef:B}=p;u.useEffect(()=>{if(v){let $={x:0,y:0};const W=ve=>{var be,re;$={x:Math.abs(Math.round(ve.pageX)-(((be=B.current)==null?void 0:be.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((re=B.current)==null?void 0:re.y)??0))}},me=ve=>{$.x<=10&&$.y<=10?ve.preventDefault():v.contains(ve.target)||C(!1),document.removeEventListener("pointermove",W),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",me,{capture:!0})}}},[v,C,B]),u.useEffect(()=>{const $=()=>C(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[C]);const[Z,z]=S_($=>{const W=I().filter(be=>!be.disabled),me=W.find(be=>be.ref.current===document.activeElement),ve=C_(W,$,me);ve&&setTimeout(()=>ve.ref.current.focus())}),K=u.useCallback(($,W,me)=>{const ve=!Y.current&&!me;(p.value!==void 0&&p.value===W||ve)&&(R($),ve&&(Y.current=!0))},[p.value]),ae=u.useCallback(()=>v==null?void 0:v.focus(),[v]),Q=u.useCallback(($,W,me)=>{const ve=!Y.current&&!me;(p.value!==void 0&&p.value===W||ve)&&L($)},[p.value]),F=s==="popper"?ph:u_,U=F===ph?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:j}:{};return a.jsx(o_,{scope:n,content:v,viewport:N,onViewportChange:k,itemRefCallback:K,selectedItem:S,onItemLeave:ae,itemTextRefCallback:Q,focusSelectedItem:H,selectedItemText:M,position:s,isPositioned:T,searchRef:Z,children:a.jsx(Cu,{as:w4,allowPinchZoom:!0,children:a.jsx(ku,{asChild:!0,trapped:p.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(r,$=>{var W;(W=p.trigger)==null||W.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:a.jsx(F,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:$=>$.preventDefault(),...x,...U,onPlaced:()=>O(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:te(x.onKeyDown,$=>{const W=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!W&&$.key.length===1&&z($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let ve=I().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes($.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const be=$.target,re=ve.indexOf(be);ve=ve.slice(re+1)}setTimeout(()=>E(ve)),$.preventDefault()}})})})})})})});c_.displayName=j4;var _4="SelectItemAlignedPosition",u_=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:s,...r}=e,l=_a(Fa,n),i=Na(Fa,n),[o,c]=u.useState(null),[d,f]=u.useState(null),h=$e(t,_=>f(_)),m=qu(n),g=u.useRef(!1),b=u.useRef(!0),{viewport:y,selectedItem:j,selectedItemText:x,focusSelectedItem:p}=i,v=u.useCallback(()=>{if(l.trigger&&l.valueNode&&o&&d&&y&&j&&x){const _=l.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),R=l.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(l.dir!=="rtl"){const be=M.left-S.left,re=R.left-be,ue=_.left-re,le=_.width+ue,Ye=Math.max(le,S.width),fe=window.innerWidth-Sn,V=Gg(re,[Sn,Math.max(Sn,fe-Ye)]);o.style.minWidth=le+"px",o.style.left=V+"px"}else{const be=S.right-M.right,re=window.innerWidth-R.right-be,ue=window.innerWidth-_.right-re,le=_.width+ue,Ye=Math.max(le,S.width),fe=window.innerWidth-Sn,V=Gg(re,[Sn,Math.max(Sn,fe-Ye)]);o.style.minWidth=le+"px",o.style.right=V+"px"}const L=m(),I=window.innerHeight-Sn*2,T=y.scrollHeight,O=window.getComputedStyle(d),Y=parseInt(O.borderTopWidth,10),E=parseInt(O.paddingTop,10),H=parseInt(O.borderBottomWidth,10),C=parseInt(O.paddingBottom,10),B=Y+E+T+C+H,Z=Math.min(j.offsetHeight*5,B),z=window.getComputedStyle(y),K=parseInt(z.paddingTop,10),ae=parseInt(z.paddingBottom,10),Q=_.top+_.height/2-Sn,F=I-Q,U=j.offsetHeight/2,$=j.offsetTop+U,W=Y+E+$,me=B-W;if(W<=Q){const be=L.length>0&&j===L[L.length-1].ref.current;o.style.bottom="0px";const re=d.clientHeight-y.offsetTop-y.offsetHeight,ue=Math.max(F,U+(be?ae:0)+re+H),le=W+ue;o.style.height=le+"px"}else{const be=L.length>0&&j===L[0].ref.current;o.style.top="0px";const ue=Math.max(Q,Y+y.offsetTop+(be?K:0)+U)+me;o.style.height=ue+"px",y.scrollTop=W-Q+y.offsetTop}o.style.margin=`${Sn}px 0`,o.style.minHeight=Z+"px",o.style.maxHeight=I+"px",s==null||s(),requestAnimationFrame(()=>g.current=!0)}},[m,l.trigger,l.valueNode,o,d,y,j,x,l.dir,s]);Lt(()=>v(),[v]);const[w,N]=u.useState();Lt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const k=u.useCallback(_=>{_&&b.current===!0&&(v(),p==null||p(),b.current=!1)},[v,p]);return a.jsx(k4,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:g,onScrollButtonChange:k,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:a.jsx(je.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});u_.displayName=_4;var N4="SelectPopperPosition",ph=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:s="start",collisionPadding:r=Sn,...l}=e,i=Gu(n);return a.jsx(ap,{...i,...l,ref:t,align:s,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)"}})});ph.displayName=N4;var[k4,hp]=Nl(Fa,{}),xh="SelectViewport",d_=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:s,...r}=e,l=Na(xh,n),i=hp(xh,n),o=$e(t,l.onViewportChange),c=u.useRef(0);return a.jsxs(a.Fragment,{children:[a.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:s}),a.jsx(Iu.Slot,{scope:n,children:a.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:te(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const g=Math.abs(c.current-f.scrollTop);if(g>0){const b=window.innerHeight-Sn*2,y=parseFloat(h.style.minHeight),j=parseFloat(h.style.height),x=Math.max(y,j);if(x<b){const p=x+g,v=Math.min(b,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})})})]})});d_.displayName=xh;var f_="SelectGroup",[S4,C4]=Nl(f_),T4=u.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,r=An();return a.jsx(S4,{scope:n,id:r,children:a.jsx(je.div,{role:"group","aria-labelledby":r,...s,ref:t})})});T4.displayName=f_;var h_="SelectLabel",m_=u.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,r=C4(h_,n);return a.jsx(je.div,{id:r.id,...s,ref:t})});m_.displayName=h_;var Yc="SelectItem",[E4,p_]=Nl(Yc),x_=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:s,disabled:r=!1,textValue:l,...i}=e,o=_a(Yc,n),c=Na(Yc,n),d=o.value===s,[f,h]=u.useState(l??""),[m,g]=u.useState(!1),b=$e(t,p=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,p,s,r)}),y=An(),j=u.useRef("touch"),x=()=>{r||(o.onValueChange(s),o.onOpenChange(!1))};if(s==="")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 a.jsx(E4,{scope:n,value:s,disabled:r,textId:y,isSelected:d,onItemTextChange:u.useCallback(p=>{h(v=>v||((p==null?void 0:p.textContent)??"").trim())},[]),children:a.jsx(Iu.ItemSlot,{scope:n,value:s,disabled:r,textValue:f,children:a.jsx(je.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:b,onFocus:te(i.onFocus,()=>g(!0)),onBlur:te(i.onBlur,()=>g(!1)),onClick:te(i.onClick,()=>{j.current!=="mouse"&&x()}),onPointerUp:te(i.onPointerUp,()=>{j.current==="mouse"&&x()}),onPointerDown:te(i.onPointerDown,p=>{j.current=p.pointerType}),onPointerMove:te(i.onPointerMove,p=>{var v;j.current=p.pointerType,r?(v=c.onItemLeave)==null||v.call(c):j.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,p=>{var v;p.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:te(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(m4.includes(p.key)&&x(),p.key===" "&&p.preventDefault())})})})})});x_.displayName=Yc;var Yl="SelectItemText",g_=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:r,...l}=e,i=_a(Yl,n),o=Na(Yl,n),c=p_(Yl,n),d=v4(Yl,n),[f,h]=u.useState(null),m=$e(t,x=>h(x),c.onItemTextChange,x=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,x,c.value,c.disabled)}),g=f==null?void 0:f.textContent,b=u.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:j}=d;return Lt(()=>(y(b),()=>j(b)),[y,j,b]),a.jsxs(a.Fragment,{children:[a.jsx(je.span,{id:c.textId,...l,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?il.createPortal(l.children,i.valueNode):null]})});g_.displayName=Yl;var v_="SelectItemIndicator",y_=u.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return p_(v_,n).isSelected?a.jsx(je.span,{"aria-hidden":!0,...s,ref:t}):null});y_.displayName=v_;var gh="SelectScrollUpButton",b_=u.forwardRef((e,t)=>{const n=Na(gh,e.__scopeSelect),s=hp(gh,e.__scopeSelect),[r,l]=u.useState(!1),i=$e(t,s.onScrollButtonChange);return Lt(()=>{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?a.jsx(w_,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});b_.displayName=gh;var vh="SelectScrollDownButton",j_=u.forwardRef((e,t)=>{const n=Na(vh,e.__scopeSelect),s=hp(vh,e.__scopeSelect),[r,l]=u.useState(!1),i=$e(t,s.onScrollButtonChange);return Lt(()=>{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?a.jsx(w_,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});j_.displayName=vh;var w_=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:s,...r}=e,l=Na("SelectScrollButton",n),i=u.useRef(null),o=qu(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Lt(()=>{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]),a.jsx(je.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:te(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(s,50))}),onPointerMove:te(r.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),i.current===null&&(i.current=window.setInterval(s,50))}),onPointerLeave:te(r.onPointerLeave,()=>{c()})})}),R4="SelectSeparator",__=u.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return a.jsx(je.div,{"aria-hidden":!0,...s,ref:t})});__.displayName=R4;var yh="SelectArrow",A4=u.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,r=Gu(n),l=_a(yh,n),i=Na(yh,n);return l.open&&i.position==="popper"?a.jsx(rp,{...r,...s,ref:t}):null});A4.displayName=yh;var M4="SelectBubbleInput",N_=u.forwardRef(({__scopeSelect:e,value:t,...n},s)=>{const r=u.useRef(null),l=$e(s,r),i=j0(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]),a.jsx(je.select,{...n,style:{...Ww,...n.style},ref:l,defaultValue:t})});N_.displayName=M4;function k_(e){return e===""||e===void 0}function S_(e){const t=Qn(e),n=u.useRef(""),s=u.useRef(0),r=u.useCallback(i=>{const o=n.current+i;t(o),function c(d){n.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,r,l]}function C_(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=O4(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 O4(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var D4=e_,T_=n_,z4=a_,$4=r_,L4=l_,E_=i_,U4=d_,R_=m_,A_=x_,H4=g_,B4=y_,M_=b_,O_=j_,D_=__;const I4={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},yt=D4,bt=z4,ht=u.forwardRef(({className:e,children:t,triggerSize:n="default",...s},r)=>a.jsxs(T_,{ref:r,className:J("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",I4[n],e),...s,children:[t,a.jsx($4,{asChild:!0,children:a.jsx(_j,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));ht.displayName=T_.displayName;const z_=u.forwardRef(({className:e,...t},n)=>a.jsx(M_,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(I2,{className:"size-4","aria-hidden":"true"})}));z_.displayName=M_.displayName;const $_=u.forwardRef(({className:e,...t},n)=>a.jsx(O_,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(U2,{className:"size-4","aria-hidden":"true"})}));$_.displayName=O_.displayName;const mt=u.forwardRef(({className:e,children:t,position:n="popper",...s},r)=>a.jsx(L4,{container:to(),children:a.jsxs(E_,{ref:r,className:J("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,...s,children:[a.jsx(z_,{}),a.jsx(U4,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx($_,{})]})}));mt.displayName=E_.displayName;const q4=u.forwardRef(({className:e,...t},n)=>a.jsx(R_,{ref:n,className:J("px-2 py-1.5 text-sm font-semibold",e),...t}));q4.displayName=R_.displayName;const ke=u.forwardRef(({className:e,children:t,...n},s)=>a.jsxs(A_,{ref:s,className:J("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:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(B4,{children:a.jsx(pl,{className:"size-4","aria-hidden":"true"})})}),a.jsx(H4,{children:t})]}));ke.displayName=A_.displayName;const G4=u.forwardRef(({className:e,...t},n)=>a.jsx(D_,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));G4.displayName=D_.displayName;function ct({className:e,...t}){return a.jsx("div",{className:J("animate-pulse rounded-md bg-primary/10",e),...t})}const Xe=u.forwardRef(({className:e,containerClassName:t,containerRef:n,containerTabIndex:s,containerAriaLabel:r,...l},i)=>a.jsx("div",{ref:n,tabIndex:s,"aria-label":r,className:J("relative w-full overflow-auto",t),children:a.jsx("table",{ref:i,className:J("w-full caption-bottom text-sm",e),...l})}));Xe.displayName="Table";const st=u.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:J("[&_tr]:border-b",e),...t}));st.displayName="TableHeader";const Fe=u.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:J("[&_tr:last-child]:border-0",e),...t}));Fe.displayName="TableBody";const P4=u.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:J("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));P4.displayName="TableFooter";const ce=u.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:J("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));ce.displayName="TableRow";const X=u.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:J("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 P=u.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:J("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));P.displayName="TableCell";const V4=u.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:J("text-muted-foreground mt-4 text-sm",e),...t}));V4.displayName="TableCaption";var Pu="Tabs",[Y4]=ts(Pu,[zu]),L_=zu(),[X4,mp]=Y4(Pu),U_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:r,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=Au(o),[h,m]=ga({prop:s,onChange:r,defaultProp:l??"",caller:Pu});return a.jsx(X4,{scope:n,baseId:An(),value:h,onValueChange:m,orientation:i,dir:f,activationMode:c,children:a.jsx(je.div,{dir:f,"data-orientation":i,...d,ref:t})})});U_.displayName=Pu;var H_="TabsList",B_=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...r}=e,l=mp(H_,n),i=L_(n);return a.jsx(tw,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:s,children:a.jsx(je.div,{role:"tablist","aria-orientation":l.orientation,...r,ref:t})})});B_.displayName=H_;var I_="TabsTrigger",q_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:r=!1,...l}=e,i=mp(I_,n),o=L_(n),c=V_(i.baseId,s),d=Y_(i.baseId,s),f=s===i.value;return a.jsx(nw,{asChild:!0,...o,focusable:!r,active:f,children:a.jsx(je.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:te(e.onMouseDown,h=>{!r&&h.button===0&&h.ctrlKey===!1?i.onValueChange(s):h.preventDefault()}),onKeyDown:te(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(s)}),onFocus:te(e.onFocus,()=>{const h=i.activationMode!=="manual";!f&&!r&&h&&i.onValueChange(s)})})})});q_.displayName=I_;var G_="TabsContent",P_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:r,children:l,...i}=e,o=mp(G_,n),c=V_(o.baseId,s),d=Y_(o.baseId,s),f=s===o.value,h=u.useRef(f);return u.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Nn,{present:r||f,children:({present:m})=>a.jsx(je.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})})});P_.displayName=G_;function V_(e,t){return`${e}-trigger-${t}`}function Y_(e,t){return`${e}-content-${t}`}var F4=U_,X_=B_,F_=q_,K_=P_;const K4=F4,Q_=u.forwardRef(({className:e,...t},n)=>a.jsx(X_,{ref:n,className:J("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Q_.displayName=X_.displayName;const bh=u.forwardRef(({className:e,...t},n)=>a.jsx(F_,{ref:n,className:J("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}));bh.displayName=F_.displayName;const Q4=u.forwardRef(({className:e,...t},n)=>a.jsx(K_,{ref:n,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Q4.displayName=K_.displayName;const Hn=u.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:J("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}));Hn.displayName="Textarea";var[Vu]=ts("Tooltip",[_l]),Yu=_l(),Z_="TooltipProvider",Z4=700,jh="tooltip.open",[W4,pp]=Vu(Z_),W_=e=>{const{__scopeTooltip:t,delayDuration:n=Z4,skipDelayDuration:s=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)},[]),a.jsx(W4,{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,s)},[s]),isPointerInTransitRef:o,onPointerInTransitChange:u.useCallback(d=>{o.current=d},[]),disableHoverableContent:r,children:l})};W_.displayName=Z_;var Ai="Tooltip",[J4,io]=Vu(Ai),J_=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:l,disableHoverableContent:i,delayDuration:o}=e,c=pp(Ai,e.__scopeTooltip),d=Yu(t),[f,h]=u.useState(null),m=An(),g=u.useRef(0),b=i??c.disableHoverableContent,y=o??c.delayDuration,j=u.useRef(!1),[x,p]=ga({prop:s,defaultProp:r??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(jh))):c.onClose(),l==null||l(_)},caller:Ai}),v=u.useMemo(()=>x?j.current?"delayed-open":"instant-open":"closed",[x]),w=u.useCallback(()=>{window.clearTimeout(g.current),g.current=0,j.current=!1,p(!0)},[p]),N=u.useCallback(()=>{window.clearTimeout(g.current),g.current=0,p(!1)},[p]),k=u.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{j.current=!0,p(!0),g.current=0},y)},[y,p]);return u.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),a.jsx(np,{...d,children:a.jsx(J4,{scope:t,contentId:m,open:x,stateAttribute:v,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?k():w()},[c.isOpenDelayedRef,k,w]),onTriggerLeave:u.useCallback(()=>{b?N():(window.clearTimeout(g.current),g.current=0)},[N,b]),onOpen:w,onClose:N,disableHoverableContent:b,children:n})})};J_.displayName=Ai;var wh="TooltipTrigger",eN=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=io(wh,n),l=pp(wh,n),i=Yu(n),o=u.useRef(null),c=$e(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]),a.jsx(sp,{asChild:!0,...i,children:a.jsx(je.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:te(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!l.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:te(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:te(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:te(e.onBlur,r.onClose),onClick:te(e.onClick,r.onClose)})})});eN.displayName=wh;var xp="TooltipPortal",[eO,tO]=Vu(xp,{forceMount:void 0}),tN=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:r}=e,l=io(xp,t);return a.jsx(eO,{scope:t,forceMount:n,children:a.jsx(Nn,{present:n||l.open,children:a.jsx(eo,{asChild:!0,container:r,children:s})})})};tN.displayName=xp;var rl="TooltipContent",nN=u.forwardRef((e,t)=>{const n=tO(rl,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...l}=e,i=io(rl,e.__scopeTooltip);return a.jsx(Nn,{present:s||i.open,children:i.disableHoverableContent?a.jsx(sN,{side:r,...l,ref:t}):a.jsx(nO,{side:r,...l,ref:t})})}),nO=u.forwardRef((e,t)=>{const n=io(rl,e.__scopeTooltip),s=pp(rl,e.__scopeTooltip),r=u.useRef(null),l=$e(t,r),[i,o]=u.useState(null),{trigger:c,onClose:d}=n,f=r.current,{onPointerInTransitChange:h}=s,m=u.useCallback(()=>{o(null),h(!1)},[h]),g=u.useCallback((b,y)=>{const j=b.currentTarget,x={x:b.clientX,y:b.clientY},p=iO(x,j.getBoundingClientRect()),v=oO(x,p),w=cO(y.getBoundingClientRect()),N=dO([...v,...w]);o(N),h(!0)},[h]);return u.useEffect(()=>()=>m(),[m]),u.useEffect(()=>{if(c&&f){const b=j=>g(j,f),y=j=>g(j,c);return c.addEventListener("pointerleave",b),f.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",y)}}},[c,f,g,m]),u.useEffect(()=>{if(i){const b=y=>{const j=y.target,x={x:y.clientX,y:y.clientY},p=(c==null?void 0:c.contains(j))||(f==null?void 0:f.contains(j)),v=!uO(x,i);p?m():v&&(m(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,f,i,d,m]),a.jsx(sN,{...e,ref:l})}),[sO,aO]=Vu(Ai,{isInside:!1}),rO=GT("TooltipContent"),sN=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:l,onPointerDownOutside:i,...o}=e,c=io(rl,n),d=Yu(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(jh,f),()=>document.removeEventListener(jh,f)),[f]),u.useEffect(()=>{if(c.trigger){const h=m=>{const g=m.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,f]),a.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:a.jsxs(ap,{"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:[a.jsx(rO,{children:s}),a.jsx(sO,{scope:n,isInside:!0,children:a.jsx(f4,{id:c.contentId,role:"tooltip",children:r||s})})]})})});nN.displayName=rl;var aN="TooltipArrow",lO=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=Yu(n);return aO(aN,n).isInside?null:a.jsx(rp,{...r,...s,ref:t})});lO.displayName=aN;function iO(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,s,r,l)){case l:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function oO(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function cO(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function uO(e,t){const{x:n,y:s}=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>s!=m>s&&n<(h-d)*(s-f)/(m-f)+d&&(r=!r)}return r}function dO(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),fO(t)}function fO(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];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 s=e.length-1;s>=0;s--){const r=e[s];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=W_,mO=J_,pO=eN,xO=tN,rN=nN;const gO=hO,vO=mO,yO=pO,lN=u.forwardRef(({className:e,sideOffset:t=4,...n},s)=>{const r=to(),l=a.jsx(rN,{ref:s,sideOffset:t,className:J("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?a.jsx(xO,{container:r,children:l}):l});lN.displayName=rN.displayName;const Pg=["none","read","comment","write","manage","admin"];function Xc(e,t){return Pg.indexOf(e??"none")>=Pg.indexOf(t)}function gp(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function Kd(e,t){const n=gp(e);return e==="sdlc_login"&&t?`${n} on ${iN(t)}`:n}const bO=String.fromCodePoint(8296),jO=String.fromCodePoint(8297);function iN(e){return`${bO}${e}${jO}`}const Mi={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 oN(e){return e.name==="Blocked"?"warning":wO[e.category]}const Vg=1800;function Wn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Mn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function vp(e){return`${On(e)}, ${Mn(e)}`}function Ul(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function On(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function cN(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 Gs="not_set";function kO({open:e,commands:t,list_id:n,list_revision:s,default_status_id:r,statuses:l,priorities:i,members:o,on_close:c,on_created:d}){var I;const f=ml(),[h,m]=u.useState(""),[g,b]=u.useState(""),[y,j]=u.useState(r??((I=l[0])==null?void 0:I.id)??""),[x,p]=u.useState(Gs),[v,w]=u.useState(Gs),[N,k]=u.useState(!1),[_,S]=u.useState(null),[R,M]=u.useState(!1);u.useEffect(()=>{var T;e&&(m(""),b(""),j(r??((T=l[0])==null?void 0:T.id)??""),p(Gs),w(Gs),k(!1),S(null))},[e,r,l]);const L=async T=>{if(T.preventDefault(),!h.trim()){k(!0);return}M(!0),S(null);try{const O=await t.run("create_task",{list_id:n,expected_list_revision:s,title:h.trim(),description:g.trim()||null,status_id:y||null,priority_id:x===Gs?null:x,primary_user_id:v===Gs?null:v});if(!O.ok){S(O.refusal.message);return}f.success("Task created."),await d()}finally{M(!1)}};return a.jsx(Cs,{open:e,onOpenChange:T=>T?null:c(),children:a.jsx(Ts,{children:a.jsxs("form",{onSubmit:T=>void L(T),noValidate:!0,children:[a.jsxs(Es,{children:[a.jsx(As,{children:"New task"}),a.jsx(Ms,{children:"Add a task to this List."})]}),a.jsxs("div",{className:"mt-4 grid gap-4",children:[_&&a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(ie,{children:_})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"new-task-title",children:"Title"}),a.jsx(Tt,{id:"new-task-title",placeholder:"What needs doing",value:h,required:!0,"aria-invalid":N,"aria-describedby":N?"new-task-title-error":void 0,onChange:T=>{m(T.target.value),k(!1)}}),N&&a.jsx("p",{id:"new-task-title-error",className:"text-destructive text-xs",children:"Give the task a title."})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"new-task-description",children:"Description (optional)"}),a.jsx(Hn,{id:"new-task-description",rows:4,value:g,onChange:T=>b(T.target.value)})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"new-task-status",children:"Status"}),a.jsxs(yt,{value:y,onValueChange:j,children:[a.jsx(ht,{id:"new-task-status",children:a.jsx(bt,{})}),a.jsx(mt,{children:l.map(T=>a.jsx(ke,{value:T.id,children:T.name},T.id))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"new-task-priority",children:"Priority"}),a.jsxs(yt,{value:x,onValueChange:p,children:[a.jsx(ht,{id:"new-task-priority",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:Gs,children:"Not set"}),i.map(T=>a.jsx(ke,{value:T.id,children:T.name},T.id))]})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"new-task-primary",children:"Primary"}),a.jsxs(yt,{value:v,onValueChange:w,children:[a.jsx(ht,{id:"new-task-primary",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:Gs,children:"Not set"}),o.map(T=>a.jsx(ke,{value:T.user_id,children:T.label},T.user_id))]})]})]})]})]}),a.jsxs(Rs,{className:"mt-6",children:[a.jsx(q,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),a.jsx(q,{type:"submit",disabled:R,children:R?"Creating…":"Create task"})]})]})})})}const SO="Your organization's work, in queue order. Claim a task to show you are working on it.",Xl="any",uN="none",CO=1,TO=250,EO="The sdlc engine here is too old for this page",dN="Update the main checkout, then restart sdlc viewer.";function yp(){const e=_n().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function RO({org:e}){var b;const t=yp(),{href:n,Link:s}=at(),[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 j=f.current+=1;y&&l({state:"loading"});const x=await t.availability({fresh:y});j===f.current&&l(x)},[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(j=>{y&&j.ok&&o(j.data)}),()=>{y=!1}},[t.members]),u.useEffect(()=>{if(!t.access)return;let y=!0;return t.access().then(j=>{y&&j.ok&&d(j.data)}),()=>{y=!1}},[t.access]),r.state==="off"&&((b=r.refusal)==null?void 0:b.reason)!=="engine_missing")return a.jsx(nr,{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:s});const g=(c==null?void 0:c.read_only_reason)??SO;return a.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"?a.jsx(MO,{active:r,org:e,members:i,description:g,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:m}):a.jsxs(a.Fragment,{children:[a.jsx(Kt,{title:"Tasks",description:g}),r.state==="loading"&&a.jsx(fN,{}),(r.state==="error"||r.state==="off")&&a.jsx(hN,{refusal:r.refusal,on_retry:m}),r.state==="available"&&a.jsx(AO,{on_done:m})]})})}function fN(){return a.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading tasks",children:Array.from({length:6},(e,t)=>a.jsx(ct,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function hN({refusal:e,on_retry:t}){return(e==null?void 0:e.reason)==="view_outdated"?a.jsxs(oe,{variant:"destructive",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:EO}),a.jsx(ie,{children:dN})]}):(e==null?void 0:e.reason)==="engine_missing"?a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Tasks need the sdlc engine"}),a.jsx(ie,{children:e.message})]}):a.jsxs(oe,{variant:"destructive",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Tasks could not be loaded"}),a.jsxs(ie,{children:[a.jsx("p",{children:e!=null&&e.reason?e.message:"Check your connection and try again."}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function AO({on_done:e}){const{commands:t}=yp(),n=ml(),[s,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 a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Tasks are not on for this organization"}),a.jsxs(ie,{children:[a.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?a.jsx(q,{type:"button",size:"sm",className:"mt-2",disabled:s,onClick:()=>void i(),children:"Turn on Tasks"}):null]})]})}const Qd=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function MO({active:e,org:t,members:n,description:s,read_only_reason:r,reload_configuration:l}){var Ip;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=yp(),{href:f,Link:h}=at(),{self_id:m}=wu(),g=ml(),{list:b,workspace:y}=e,j=b.offers,x=j!==void 0,p=u.useMemo(()=>{var D;return((D=y.workflows.find(Be=>Be.id===b.workflow_id))==null?void 0:D.statuses)??[]},[y,b]),v=y.priorities,w=!!i&&Xc(b.permission,"write"),N=w&&Xc(b.permission,"manage"),k=u.useMemo(()=>new Map(n.map(D=>[D.user_id,D])),[n]),_=D=>{var Be;return D?D===m?"You":((Be=k.get(D))==null?void 0:Be.label)??"A member":""},[S,R]=u.useState("active"),[M,L]=u.useState(!1),[I,T]=u.useState(""),[O,Y]=u.useState("");u.useEffect(()=>{const D=setTimeout(()=>Y(I),TO);return()=>clearTimeout(D)},[I]);const[E,H]=u.useState(null),[C,B]=u.useState(Xl),[Z,z]=u.useState(!1),[K,ae]=u.useState(!1),[Q,F]=u.useState(null),[U,$]=u.useState([]),[W,me]=u.useState(null),[ve,be]=u.useState(0),[re,ue]=u.useState(!1),[le,Ye]=u.useState(null),[fe,V]=u.useState(null),[ge,Ae]=u.useState(!1),[Et,he]=u.useState(null),[Qt,Os]=u.useState({}),[dn,Ds]=u.useState(""),{confirm:ss,confirm_dialog:Cl}=yl(),fn=u.useRef(null),ka=u.useRef(null),ee=u.useRef(null),Oe=u.useRef(null),[Te,sr]=u.useState(void 0),zs=!!(O.trim()||E||C!==Xl||Z||K),$s=u.useRef(0),Ut=u.useCallback(async(D,Be=!1)=>{const Pe=D?$s.current:$s.current+=1,et={state:S,assigned_to_me:M||void 0,cursor:D,search:O.trim()||void 0,group:E??void 0,owner:C===Xl?void 0:C===uN?"":C,urgent:Z||void 0,over_estimate:K||void 0},Ot=Gt=>o(b.id,{...et,cursor:Gt});let _t=await Ot(D),tt=!!D;if(!_t.ok&&_t.refusal.code==="cursor_stale"&&(_t=await Ot(),tt=!1),Pe!==$s.current)return;if(!_t.ok){me(_t.refusal),be(Gt=>Gt+1);return}const Dt=_t.data;me(null),be(0),!(Be&&Qd(Dt,ee.current))&&(ee.current=Dt,F(Dt),Dt.facets&&sr(Dt.facets),$(Gt=>tt?[...Gt,...Dt.tasks]:Dt.tasks))},[o,b.id,S,M,O,E,C,Z,K]),Ls=u.useCallback(async()=>{const D=await c();if(V(Pe=>D.ok?null:Qd(Pe,D.refusal)?Pe:D.refusal),!D.ok&&x)return;const Be=D.ok?D.data:null;Qd(Be,Oe.current)||(Oe.current=Be,Ye(Be))},[c,x]);u.useEffect(()=>{ee.current=null,F(null)},[S,M]),u.useEffect(()=>{Ut()},[Ut]),u.useEffect(()=>{Ls()},[Ls]);const as=u.useCallback(async()=>{await Promise.all([Ut(),Ls()])},[Ut,Ls]),Us=j==null?void 0:j.refresh_ms;u.useEffect(()=>{if(!Us)return;const D=setInterval(()=>{Ut(void 0,!0),Ls()},Us);return()=>clearInterval(D)},[Us,Ut,Ls]);const Tl=u.useCallback(async(D,Be,Pe)=>{if(!i)return;const et=await i.run(D,Be);et.ok?Pe&&g.success(Pe):(g.error(et.refusal.message),et.refusal.code==="revision_conflict"&&l()),await as()},[i,g,as,l]),ar=p.find(D=>D.category==="completed"),A=async(D,Be,Pe)=>{const et=Be+Pe,Ot=U[et];if(!Ot||!Q||!i)return;const _t=async(tt,Dt)=>{const Gt=await i.run(tt,Dt);if(!Gt.ok)throw Gt.refusal;return Gt.data};try{let tt=Q.list.order_revision,Dt=D.revision;if(Ot.queue_rank===null){const Gt=U.findIndex(Hs=>Hs.queue_rank===null);for(const Hs of U.slice(Gt,et+1)){const fo=await _t("reorder",{task_id:Hs.id,expected_revision:Hs.revision,expected_order_revision:tt,placement:"end"});tt=fo.list.order_revision,Hs.id===D.id&&(Dt=fo.task.revision)}}await _t("reorder",{task_id:D.id,expected_revision:Dt,expected_order_revision:tt,placement:Pe<0?"before":"after",anchor_task_id:Ot.id})}catch(tt){g.error(tt.message)}await as()},ye=D=>{ar&&Tl("update_task",{task_id:D.id,expected_revision:D.revision,changes:{status_id:ar.id}},`${D.title} completed.`)},He=async D=>{if(!Q||!await ss({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[Pe,et]=await Promise.all([o(b.id,{limit:1}),d(y.id)]);if(!Pe.ok||!et.ok){g.error(Pe.ok?et.ok?"":et.refusal.message:Pe.refusal.message);return}await Tl("archive_task",{task_id:D.id,expected_revision:D.revision,expected_order_revision:Pe.data.list.order_revision,expected_hierarchy_revision:et.data},`${D.title} archived.`)},wt=async D=>{await Tl("release_hold",{hold_id:D},"Hold released.")},Hp=async(D,Be,Pe,et)=>{var Gt;if(!(i!=null&&i.complete)||!await ss({title:`Mark ${Be} done?`,description:Pe.reason?`“${Pe.reason}”
|
|
379
|
+
|
|
380
|
+
It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;he(D);const _t=await i.complete(Pe);if(he(null),!_t.ok){Os(Hs=>({...Hs,[D]:_t.refusal.message}));return}Os(({[D]:Hs,...fo})=>fo),Ds(`${Be} marked done.`),await as();const tt=ka.current;(Gt=(et?(tt==null?void 0:tt.querySelector(`[data-done-key="${CSS.escape(et)}"]`))??(tt==null?void 0:tt.querySelector(`[data-title-key="${CSS.escape(et)}"] a`)):null)??fn.current)==null||Gt.focus()},Bp=()=>{var D;T(""),Y(""),H(null),B(Xl),z(!1),ae(!1),(D=fn.current)==null||D.focus()},d1=new Map(p.map(D=>[D.id,D])),f1=new Map(v.map(D=>[D.id,D])),Wu=new Map(U.map(D=>[D.id,D.title])),Ju=w&&S==="active",h1=U.some(D=>D.local_done),ed=Ju||h1,td=!x||v.length>0,m1=!M&&!zs,p1=5+(td?1:0)+(ed?1:0),x1=W!==null&&(W.reason==="store_locked"||W.reason==="engine_failed")&&ve<=CO,uo=(le==null?void 0:le.holds)??[],g1=U.map(D=>D.id),v1=uo.map(D=>D.id);return a.jsxs("div",{ref:ka,className:"contents",children:[a.jsx(Kt,{title:"Tasks",description:s,actions:w?a.jsxs(q,{type:"button",onClick:()=>Ae(!0),children:[a.jsx(sl,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),x&&(Q!=null&&Q.open)?a.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[Q.open," open"]}):null,Us?a.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:W?`Not reading · trying again every ${Math.round(Us/1e3)}s`:Q?`Live · refreshes every ${Math.round(Us/1e3)}s`:"Connecting…"}):null,x?a.jsx("p",{className:"sr-only",role:"status",children:dn}):null,(x||uo.length>0)&&a.jsxs(pt,{as:"section","aria-labelledby":"waiting-title",className:"mt-4 p-4","data-testid":"tasks-waiting",children:[a.jsx("h2",{id:"waiting-title",className:"text-lg font-semibold",children:"Waiting on you"}),uo.length>0?a.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:uo.map((D,Be)=>{var _t,tt;const Pe=Mi[D.hold_type],et=D.target.kind==="task"?`Because you claim ${Wu.get(D.target.task_id)??"the task it waits on"} · `:"",Ot=D.local_done;return a.jsxs("li",{id:`waiting-${D.id}`,"data-title-key":D.id,className:"flex flex-wrap items-center gap-3 py-2",children:[D.task?a.jsx(h,{className:"text-primary min-w-40 flex-1 hover:underline",href:f(`/org/${t}/tasks/${D.task.id}`),children:D.task.title}):a.jsx("span",{className:"min-w-40 flex-1",children:D.reason}),a.jsx(Re,{variant:Pe.tone,children:D.local_label??Pe.label}),a.jsxs("div",{className:"min-w-48 flex-2",children:[D.task?a.jsx("div",{className:"text-sm",children:D.reason}):null,a.jsxs("div",{className:"text-muted-foreground text-xs",children:[et,"From ",_(D.opened_by)," · ",On(D.opened_at)]}),(_t=D.local_threads)!=null&&_t.length?a.jsxs("div",{className:"text-muted-foreground text-xs",children:["Answer it in"," ",a.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/threads`),children:"Threads"}),": ",D.local_threads.join(" · ")]}):null,Qt[D.id]?a.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Qt[D.id]}):null]}),Ot&&(i!=null&&i.complete)?a.jsx(q,{type:"button",variant:"outline",size:"sm","data-done-key":D.id,"aria-label":`Mark ${((tt=D.task)==null?void 0:tt.title)??D.reason} done`,loading:Et===D.id,onClick:()=>{var Dt;return void Hp(D.id,((Dt=D.task)==null?void 0:Dt.title)??D.reason,Ot,v1[Be+1]??null)},children:"Done"}):null,x?null:a.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void wt(D.id),children:"Release"})]},D.id)})}):le?a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,x&&fe?a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:fe.reason==="view_outdated"?`Waiting on you is not read here. ${dN}`:"Waiting on you could not be read. It is read again with the list."}):null,a.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:x?"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&&a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(Zi,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"You can view these tasks"}),a.jsx(ie,{children:"Ask an organization admin for write access to change them."})]}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4",children:[(j==null?void 0:j.archived)!==!1?a.jsx(K4,{value:S,onValueChange:D=>R(D),children:a.jsxs(Q_,{"aria-label":"Which tasks",children:[a.jsx(bh,{value:"active",children:"Active"}),a.jsx(bh,{value:"archived",children:"Archived"})]})}):null,(j==null?void 0:j.assigned_to_me)!==!1?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bl,{id:"tasks-mine",checked:M,onCheckedChange:D=>L(D===!0)}),a.jsx(Me,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,j!=null&&j.search?a.jsx(Tt,{ref:fn,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:I,onChange:D=>T(D.target.value)}):null,Te!=null&&Te.owners?a.jsx(DO,{owners:Te.owners,no_owner:Te.no_owner,value:C,on_change:B}):null]}),(Ip=Te==null?void 0:Te.groups)!=null&&Ip.length?a.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[Te.groups.map(D=>a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:qr,"aria-pressed":E===D.id,onClick:()=>H(Be=>Be===D.id?null:D.id),children:[D.label," ",D.count]},D.id)),Te.marks?a.jsxs(a.Fragment,{children:[a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:qr,"aria-pressed":Z,onClick:()=>z(D=>!D),children:["Urgent ",Te.marks.urgent]}),a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:qr,"aria-pressed":K,onClick:()=>ae(D=>!D),children:["Over estimate ",Te.marks.over_estimate]})]}):null]}):null,zs&&(Q==null?void 0:Q.matched)!==void 0&&Q.total!==void 0?a.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[Q.matched," of ",Q.total," match ·"," ",a.jsx(q,{type:"button",variant:"link",size:"inline-sm",onClick:Bp,children:"Clear"})]}):null,x1?a.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):W?a.jsx(hN,{refusal:W,on_retry:()=>void Ut()}):null,!Q&&!W&&a.jsx(fN,{}),Q&&U.length===0&&zs?a.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[a.jsx(_u,{className:"text-muted-foreground size-8","aria-hidden":"true"}),a.jsx("h2",{className:"text-lg font-semibold",children:"No tasks match"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing open matches these filters."}),a.jsx(q,{type:"button",variant:"outline",onClick:Bp,children:"Clear filters"})]}):Q&&U.length===0&&S==="active"&&!M&&x?a.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):Q&&U.length===0&&S==="active"&&!M?a.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[a.jsx(kj,{className:"text-muted-foreground size-8","aria-hidden":"true"}),a.jsx("h2",{className:"text-lg font-semibold",children:"No tasks yet"}),a.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&&a.jsxs(q,{type:"button",onClick:()=>Ae(!0),children:[a.jsx(sl,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):Q?a.jsxs(a.Fragment,{children:[a.jsx(pt,{className:"mt-4 shrink-0 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Tasks",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Title"}),a.jsx(X,{children:"Status"}),td?a.jsx(X,{className:"hidden md:table-cell",children:"Priority"}):null,a.jsx(X,{className:"hidden md:table-cell",children:"Primary"}),a.jsx(X,{className:"hidden md:table-cell",children:"Holds"}),a.jsx(X,{children:"Claimed by"}),ed?a.jsx(X,{className:"text-right",children:"Actions"}):null]})}),a.jsxs(Fe,{children:[U.map((D,Be)=>{var _t,tt;const Pe=d1.get(D.status_id),et=_O(D),Ot=D.local_done;return a.jsxs(ce,{"data-testid":"tasks-row",children:[a.jsxs(P,{"data-title-key":D.id,children:[D.no_page?a.jsx("span",{children:D.title}):a.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/tasks/${D.id}`),children:D.title}),D.parent_task_id&&Wu.get(D.parent_task_id)?a.jsx("div",{className:"text-muted-foreground text-xs",children:Wu.get(D.parent_task_id)}):null,x?a.jsx(OO,{row:D}):null,Qt[D.id]?a.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Qt[D.id]}):null]}),a.jsx(P,{children:Pe?a.jsx(Re,{variant:oN(Pe),children:Pe.name}):null}),td?a.jsx(P,{className:"hidden md:table-cell",children:D.priority_id?((_t=f1.get(D.priority_id))==null?void 0:_t.name)??"":a.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,a.jsx(P,{className:"hidden md:table-cell",children:D.owner_title?D.owner_title:D.primary_user_id?_(D.primary_user_id):a.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),a.jsx(P,{className:"hidden md:table-cell",children:et?a.jsx(Re,{variant:et.tone,children:et.label}):a.jsx("span",{className:"text-muted-foreground",children:"None"})}),a.jsx(P,{"data-testid":"tasks-claim",children:a.jsx(zO,{row:D,holder:_((tt=D.claim)==null?void 0:tt.user_id)})}),ed?a.jsx(P,{className:"text-right whitespace-nowrap",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[Ot&&"hold"in Ot?a.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${Ot.hold}`,children:"In Waiting on you"}):Ot&&(i!=null&&i.complete)?a.jsx(q,{type:"button",variant:"outline",size:"sm","data-done-key":D.id,"aria-label":`Mark ${D.title} done`,loading:Et===D.id,onClick:()=>void Hp(D.id,D.title,Ot,g1[Be+1]??null),children:"Done"}):null,Ju&&m1?a.jsxs(a.Fragment,{children:[a.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${D.title} up`,disabled:Be===0,onClick:()=>void A(D,Be,-1),children:a.jsx(R2,{className:"size-4","aria-hidden":"true"})}),a.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${D.title} down`,disabled:Be===U.length-1,onClick:()=>void A(D,Be,1),children:a.jsx(C2,{className:"size-4","aria-hidden":"true"})})]}):null,Ju?a.jsxs(Hu,{children:[a.jsx(Bu,{asChild:!0,children:a.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${D.title}`,children:a.jsx(Om,{className:"size-4","aria-hidden":"true"})})}),a.jsxs(lo,{align:"end",children:[ar&&D.status_id!==ar.id?a.jsx(Ya,{onSelect:()=>ye(D),children:"Complete"}):null,N?a.jsx(Ya,{className:"text-destructive focus:text-destructive",onSelect:()=>void He(D),children:"Archive"}):null]})]}):null]})}):null]},D.id)}),U.length===0&&a.jsx(ce,{children:a.jsx(P,{colSpan:p1,className:"text-muted-foreground h-24 text-center",children:S==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),Q.next_cursor?a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:re,onClick:async()=>{ue(!0),await Ut(Q.next_cursor??void 0),ue(!1)},children:"Load more"}):null]}):null,w&&i&&a.jsx(kO,{open:ge,commands:i,list_id:b.id,list_revision:(Q==null?void 0:Q.list.revision)??b.revision,default_status_id:b.default_status_id,statuses:p,priorities:v,members:n,on_close:()=>Ae(!1),on_created:async()=>{Ae(!1),await as()}}),Cl]})}function OO({row:e}){var n;const t=[e.local_after,e.local_detail].filter(Boolean).join(" · ");return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-muted-foreground font-mono text-xs",children:[e.id,e.match?` · matched in ${e.match}`:""]}),t?a.jsx("div",{className:"text-muted-foreground text-xs",children:t}):null,(n=e.local_marks)!=null&&n.length?a.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.local_marks.map(s=>a.jsx(Re,{variant:s.tone??"neutral",children:s.label},s.label))}):null]})}function DO({owners:e,no_owner:t,value:n,on_change:s}){return a.jsxs(yt,{value:n,onValueChange:s,children:[a.jsx(ht,{className:"w-56","aria-label":"Owner",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:Xl,children:"Any owner"}),e.map(r=>a.jsxs(ke,{value:r.id,children:[r.label," (",r.count,")"]},r.id)),t!==void 0?a.jsxs(ke,{value:uN,children:["No owner (",t,")"]}):null]})]})}function zO({row:e,holder:t}){const n=e.claim;if(!n)return a.jsx("span",{className:"text-muted-foreground",children:"Nobody"});if(n.lapsed){const s=new Date(n.lease_expires_at)<=new Date;return a.jsxs("div",{children:[a.jsxs("div",{className:"text-warning",children:["Lapsed · ",t]}),a.jsx("div",{className:"text-muted-foreground text-xs",children:s?`Ran out at ${Wn(n.lease_expires_at)}`:"Can no longer edit it"})]})}return a.jsxs("div",{className:"max-w-64",children:[a.jsxs("div",{children:[t,n.via?` · ${gp(n.via)}`:""]}),a.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?iN(n.via_device):void 0,children:["Until ",Wn(n.lease_expires_at),n.via==="sdlc_login"&&n.via_device?a.jsxs(a.Fragment,{children:[" · ",a.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:s,on_close:r,on_submit:l}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,g]=u.useState(!1),[b,y]=u.useState({}),[j,x]=u.useState(null),[p,v]=u.useState(!1);u.useEffect(()=>{e&&(o("waiting_for_user"),d(""),h(""),g(!1),y({}),x(null))},[e]);const w=$O[i],N=async k=>{k.preventDefault();const _={target:w!==null&&!c.trim(),reason:!f.trim()};if(y(_),_.target||_.reason)return;v(!0);const S={hold_type:i,reason:f.trim(),release_claim:m};i==="waiting_for_user"&&(S.target_user_id=c),i==="blocked"&&(S.target_task_id=c),i==="waiting_for_external"&&(S.target_label=c.trim());const R=await l(S);v(!1),x(R)};return a.jsx(Cs,{open:e,onOpenChange:k=>k?null:r(),children:a.jsx(Ts,{children:a.jsxs("form",{onSubmit:k=>void N(k),noValidate:!0,children:[a.jsxs(Es,{children:[a.jsx(As,{children:"Add hold"}),a.jsx(Ms,{children:"Say what this task is waiting for."})]}),a.jsxs("div",{className:"mt-4 grid gap-4",children:[j&&a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(ie,{children:j})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"hold-type",children:"Type"}),a.jsxs(yt,{value:i,onValueChange:k=>{o(k),d(""),y({})},children:[a.jsx(ht,{id:"hold-type",children:a.jsx(bt,{})}),a.jsx(mt,{children:Object.keys(Mi).map(k=>a.jsx(ke,{value:k,children:Mi[k].label},k))})]})]}),w?a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"hold-target",children:w.label}),i==="waiting_for_external"?a.jsx(Tt,{id:"hold-target",value:c,"aria-invalid":b.target,onChange:k=>d(k.target.value)}):a.jsxs(yt,{value:c,onValueChange:d,children:[a.jsx(ht,{id:"hold-target","aria-invalid":b.target,children:a.jsx(bt,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),a.jsx(mt,{children:i==="blocked"?n.map(k=>a.jsx(ke,{value:k.id,children:k.title},k.id)):t.map(k=>a.jsx(ke,{value:k.user_id,children:k.label},k.user_id))})]}),a.jsx("p",{className:b.target?"text-destructive text-xs":"text-muted-foreground text-xs",children:b.target?"Choose what it waits for.":w.help})]}):a.jsx("p",{className:"text-muted-foreground text-xs",children:"You resume it yourself."}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"hold-reason",children:"Reason"}),a.jsx(Hn,{id:"hold-reason",rows:3,placeholder:"What the task is waiting for",value:f,"aria-invalid":b.reason,onChange:k=>h(k.target.value)}),b.reason&&a.jsx("p",{className:"text-destructive text-xs",children:"Give a reason."})]}),s&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bl,{id:"hold-release-claim",checked:m,onCheckedChange:k=>g(k===!0)}),a.jsx(Me,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),a.jsxs(Rs,{className:"mt-6",children:[a.jsx(q,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),a.jsx(q,{type:"submit",disabled:p,children:p?"Adding…":"Add hold"})]})]})})})}function oo(){const e=_n().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function bp(){return a.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[a.jsx(ct,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>a.jsx(ct,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function Fc({back:e,description:t}){const{href:n,Link:s}=at();return a.jsx(nr,{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:s})}const dr="not_set",UO=10*60*1e3,Yg=20;function HO(){const{members:e}=oo(),[t,n]=u.useState([]);u.useEffect(()=>{let l=!0;return e().then(i=>{l&&i.ok&&n(i.data)}),()=>{l=!1}},[e]);const s=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=s.get(l))==null?void 0:o.label)??"A member":""},[s]);return{members:t,name:r}}function BO({active:e,task_id:t,back:n}){const s=oo(),{task:r,activity:l,listTasks:i,hierarchyRevision:o,commands:c}=s,{href:d,Link:f}=at(),h=ml(),{self_id:m}=wu(),{members:g,name:b}=HO(),{workspace:y}=e,{confirm:j,confirm_dialog:x}=yl(),[p,v]=u.useState(null),[w,N]=u.useState(!1),[k,_]=u.useState(!1),[S,R]=u.useState(null),[M,L]=u.useState([]),[I,T]=u.useState(Yg),[O,Y]=u.useState([]),[E,H]=u.useState(!1),[C,B]=u.useState(null),[Z,z]=u.useState(null),[K,ae]=u.useState(""),[Q,F]=u.useState(null),U=u.useCallback(async()=>{if(!r)return;const A=await r(t);A.ok?(v(A.data),_(!1)):A.refusal.status===404||A.refusal.status===400?N(!0):_(!0)},[r,t]),$=u.useRef(0),W=u.useCallback(async()=>{if(!l)return;const A=$.current+=1;let ye=[],He;for(;;){const wt=await l(t,He);if(A!==$.current||!wt.ok)return;if(ye=[...ye,...wt.data.events].slice(-1e3),!wt.data.more||!wt.data.next_cursor)break;He=wt.data.next_cursor}A===$.current&&L(ye.reverse())},[l,t]);u.useEffect(()=>{U(),W()},[U,W]);const me=p?y.lists.find(A=>A.id===p.task.list_id):void 0,ve=u.useMemo(()=>{var A;return((A=y.workflows.find(ye=>ye.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(ye=>{A&&Y(ye.ok?ye.data.tasks.filter(He=>He.id!==p.task.id).map(He=>({id:He.id,title:He.title})):[])}),()=>{A=!1}},[i,p==null?void 0:p.task.list_id,p==null?void 0:p.task.id,p]);const be=u.useCallback(async()=>{await Promise.all([U(),W()])},[U,W]),re=u.useCallback((A,ye)=>c?c.run(A,ye):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),ue=u.useCallback(async(A,ye,He)=>{const wt=await re(A,ye);return wt.ok?(He&&h.success(He),await be(),wt.data):(wt.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."}):wt.refusal.code==="claim_held"?(await U(),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(wt.refusal.message),await be(),null)},[re,h,be,U]),le=(p==null?void 0:p.claim)??null,Ye=le!==null&&le.id===Q&&!le.lapsed&&!le.via?le.id:null;if(u.useEffect(()=>{if(!Ye)return;const A=window.setInterval(()=>{re("renew_claim",{claim_id:Ye,lease_seconds:Vg}).then(()=>U())},UO);return()=>window.clearInterval(A)},[Ye,re,U]),w)return a.jsx(Fc,{back:n});if(k&&!p)return a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"This task could not be loaded"}),a.jsxs(ie,{children:[a.jsx("p",{children:"Check your connection and try again."}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void U(),children:"Retry"})]})]});if(!p)return a.jsx(bp,{});const{task:fe}=p,V=fe.archived_at!==null,ge=Xc(p.permission,"write")&&!V,Ae=Xc(p.permission,"manage"),Et=ve.find(A=>A.id===fe.status_id),he=ve.find(A=>A.category==="completed"),Qt=y.priorities.find(A=>A.id===fe.priority_id),Os=p.contributors.map(A=>A.user_id),dn=le!==null&&le.user_id===m,Ds=le!==null&&!le.lapsed,ss=p.checklist.filter(A=>A.is_complete).length,Cl=async()=>{const[A,ye]=await Promise.all([i(fe.list_id,{limit:1}),o(y.id)]);return A.ok?ye.ok?{ok:!0,data:{task_id:fe.id,expected_revision:fe.revision,expected_order_revision:A.data.list.order_revision,expected_hierarchy_revision:ye.data}}:ye:A},fn=(A,ye)=>ue("update_task",{task_id:fe.id,expected_revision:fe.revision,changes:A},ye),ka=A=>j(A.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${Kd(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}),ee=async()=>{if(!he)return;if(Ds&&(!dn||le.via)){const ye=le.via==="api_key"?`${dn?"Your":`${b(le.user_id)}'s`} agent is still working on it.`:le.via==="sdlc_login"?`${dn?"You are":`${b(le.user_id)} is`} still working on it via ${Kd(le.via,le.via_device)}.`:`${b(le.user_id)} is still working on it.`;if(!await j({title:"Complete this task?",description:ye,action_label:"Mark complete"}))return}await fn({status_id:he.id},"Task completed.")!==null&&le&&dn&&Ds&&await ue("end_claim",{claim_id:le.id,outcome:"completed"})},Oe=async(A,ye)=>{const He=await Cl();if(!He.ok){h.error(He.refusal.message);return}await ue(A,He.data,ye)},Te=async()=>{await j({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 Oe("archive_task","Task archived.")},sr=async()=>{await Oe("restore_task","Task restored.")},zs=async()=>{var wt;const A=le,ye=await ue("claim_task",{task_id:fe.id,lease_seconds:Vg}),He=(wt=ye==null?void 0:ye.claim)==null?void 0:wt.id;He&&!(A&&A.id===He&&A.via)&&F(He)},$s=async()=>{le&&(le.via&&!await ka(le)||(await ue("end_claim",{claim_id:le.id,outcome:"released"},"Claim released."),F(null)))},Ut=async()=>{le&&await ue("end_claim",{claim_id:le.id,outcome:"expired"},"Claim cleared.")},Ls=async A=>{A.hold_type==="paused"&&m&&(A={...A,target_user_id:m});const ye=await re("open_hold",{task_id:fe.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 ye.ok?(H(!1),h.success("Hold added."),A.release_claim&&le&&dn&&!le.via&&(await ue("end_claim",{claim_id:le.id,outcome:"released"}),F(null)),await be(),null):ye.refusal.message},as=A=>ue("checklist",{task_id:fe.id,expected_revision:fe.revision,...A}),Us=async A=>{for(const ye of A.filter(He=>!Os.includes(He)))await ue("set_contributor",{task_id:fe.id,expected_revision:fe.revision,user_id:ye,action:"add"});for(const ye of p.contributors.filter(He=>!A.includes(He.user_id)))await ue("set_contributor",{task_id:fe.id,expected_revision:fe.revision,user_id:ye.user_id,action:"remove",expected_contributor_revision:ye.revision})},Tl=A=>{var He;if(A.target.kind==="user")return b(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 ye=A.target.task_id;return a.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${ye}`),children:((He=O.find(wt=>wt.id===ye))==null?void 0:He.title)??"Another task"})},ar=A=>A.target.kind==="user"&&A.target.user_id===m&&!A.released_at?a.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void ue("release_hold",{hold_id:A.id},"Hold released."),children:"Release"}):ge?a.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void ue("resolve_hold",{hold_id:A.id},"Hold resolved."),children:"Resolve"}):null;return a.jsxs(a.Fragment,{children:[a.jsx(Kt,{title:fe.title,description:`Created ${On(fe.created_at)} by ${b(fe.created_by,m)}`,actions:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ge&&a.jsxs(a.Fragment,{children:[a.jsxs(q,{type:"button",variant:"outline",onClick:()=>B(fe.title),children:[a.jsx(Dm,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),he&&fe.status_id!==he.id&&a.jsxs(q,{type:"button",variant:"outline",onClick:()=>void ee(),children:[a.jsx(pl,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),Ae&&!V&&a.jsxs(q,{type:"button",variant:"outline",onClick:()=>void Te(),children:[a.jsx(mg,{className:"mr-2 size-4","aria-hidden":"true"}),"Archive"]})]}),children:C!==null?a.jsxs("form",{className:"flex flex-wrap items-center gap-2 pt-1",onSubmit:async A=>{A.preventDefault(),C.trim()&&await fn({title:C.trim()})!==null&&B(null)},children:[a.jsx(Me,{htmlFor:"task-title",className:"sr-only",children:"Title"}),a.jsx(Tt,{id:"task-title",className:"max-w-xl",value:C,onChange:A=>B(A.target.value)}),a.jsx(q,{type:"submit",size:"sm",children:"Save"}),a.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:()=>B(null),children:"Cancel"})]}):null}),S&&a.jsxs(oe,{variant:S.tone,className:"mt-4","data-testid":"task-notice",children:[S.tone==="warning"?a.jsx(xl,{className:"size-4","aria-hidden":"true"}):a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:S.title}),a.jsx(ie,{children:S.body})]}),V?a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(mg,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"This task is archived"}),a.jsx(ie,{children:Ae?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"It is out of the queue and cannot be claimed. Restore it to work on it again."}),a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void sr(),children:[a.jsx(N2,{className:"mr-2 size-4","aria-hidden":"true"}),"Restore"]})]}):a.jsx("p",{children:"It is out of the queue and cannot be claimed. A manager can restore it."})})]}):ge?null:a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(Zi,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"You can view this task"}),a.jsx(ie,{children:"Ask an organization admin for write access to change it."})]}),ge?a.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"task-status",children:"Status"}),a.jsxs(yt,{value:fe.status_id,onValueChange:A=>void fn({status_id:A}),children:[a.jsx(ht,{id:"task-status",children:a.jsx(bt,{})}),a.jsx(mt,{children:ve.map(A=>a.jsx(ke,{value:A.id,children:A.name},A.id))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"task-priority",children:"Priority"}),a.jsxs(yt,{value:fe.priority_id??dr,onValueChange:A=>void fn({priority_id:A===dr?null:A}),children:[a.jsx(ht,{id:"task-priority",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:dr,children:"Not set"}),y.priorities.map(A=>a.jsx(ke,{value:A.id,children:A.name},A.id))]})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"task-primary",children:"Primary"}),a.jsxs(yt,{value:fe.primary_user_id??dr,onValueChange:A=>void fn({primary_user_id:A===dr?null:A}),children:[a.jsx(ht,{id:"task-primary",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:dr,children:"Not set"}),g.map(A=>a.jsx(ke,{value:A.user_id,children:A.label},A.user_id))]})]})]}),a.jsx(IO,{members:g,selected:Os,on_change:A=>void Us(A)})]}):a.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx($o,{label:"Status",value:(Et==null?void 0:Et.name)??""}),a.jsx($o,{label:"Priority",value:(Qt==null?void 0:Qt.name)??"Not set"}),a.jsx($o,{label:"Primary",value:fe.primary_user_id?b(fe.primary_user_id,m):"Not set"}),a.jsx($o,{label:"Contributors",value:Os.map(A=>b(A,m)).join(", ")||"None"})]}),!V&&a.jsx(qO,{claim:le,mine:dn,holder:le?b(le.user_id):"",own:le!==null&&le.id===Q,can_write:ge,on_claim:()=>void zs(),on_release:()=>void $s(),on_clear:()=>void Ut()}),a.jsxs("section",{className:"mt-6","aria-labelledby":"task-description-title",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("h2",{id:"task-description-title",className:"text-lg font-semibold",children:"Description"}),ge&&Z===null&&a.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>z(fe.description??""),children:"Edit description"})]}),Z!==null?a.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async A=>{A.preventDefault(),await fn({description:Z})!==null&&z(null)},children:[a.jsx(Me,{htmlFor:"task-description",className:"sr-only",children:"Description"}),a.jsx(Hn,{id:"task-description",rows:5,value:Z,onChange:A=>z(A.target.value)}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(q,{type:"submit",size:"sm",children:"Save"}),a.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:()=>z(null),children:"Cancel"})]})]}):a.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:fe.description||a.jsx("span",{className:"text-muted-foreground",children:"No description."})})]}),a.jsxs("section",{className:"mt-6","aria-labelledby":"task-checklist-title",children:[a.jsxs("h2",{id:"task-checklist-title",className:"text-lg font-semibold",children:["Checklist",p.checklist.length>0?` · ${ss} of ${p.checklist.length} done`:""]}),a.jsx("ul",{className:"mt-2 grid gap-1",children:p.checklist.map(A=>a.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[ge?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bl,{id:`check-${A.id}`,checked:A.is_complete,onCheckedChange:ye=>void as({action:"toggle",item_id:A.id,expected_item_revision:A.revision,is_complete:ye===!0})}),a.jsx(Me,{htmlFor:`check-${A.id}`,className:"font-normal",children:A.label})]}):a.jsxs("span",{className:"text-sm",children:[A.is_complete?"Done: ":"To do: ",A.label]}),ge&&a.jsxs(Hu,{children:[a.jsx(Bu,{asChild:!0,children:a.jsx(q,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${A.label}`,children:a.jsx(Om,{className:"size-4","aria-hidden":"true"})})}),a.jsx(lo,{align:"end",children:a.jsx(Ya,{className:"text-destructive focus:text-destructive",onSelect:()=>void as({action:"archive",item_id:A.id,expected_item_revision:A.revision}),children:"Remove"})})]})]},A.id))}),p.checklist.length===0&&!ge&&a.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),ge&&a.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async A=>{A.preventDefault(),K.trim()&&await as({action:"add",label:K.trim()})!==null&&ae("")},children:[a.jsx(Me,{htmlFor:"task-new-item",children:"Add an item"}),a.jsx(Tt,{id:"task-new-item",placeholder:"Add an item and press Enter",value:K,onChange:A=>ae(A.target.value)})]})]}),a.jsxs("section",{className:"mt-6","aria-labelledby":"task-holds-title",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("h2",{id:"task-holds-title",className:"text-lg font-semibold",children:"Holds"}),ge&&a.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:()=>H(!0),children:[a.jsx(Cj,{className:"mr-2 size-4","aria-hidden":"true"}),"Add hold"]})]}),a.jsx("div",{className:"mt-2 shrink-0 overflow-x-auto rounded-lg border",children:a.jsxs(Xe,{containerAriaLabel:"Holds",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Type"}),a.jsx(X,{children:"Reason"}),a.jsx(X,{children:"Waiting on"}),a.jsx(X,{className:"text-right",children:"Actions"})]})}),a.jsxs(Fe,{children:[p.holds.map(A=>{const ye=Mi[A.hold_type];return a.jsxs(ce,{"data-testid":"task-hold",children:[a.jsx(P,{children:a.jsx(Re,{variant:ye.tone,children:ye.label})}),a.jsxs(P,{children:[a.jsx("div",{children:A.reason}),a.jsx("div",{className:"text-muted-foreground text-xs",children:A.released_at?`Released by ${b(A.released_by,m)} · ${On(A.released_at)} · Ready to resolve`:`Opened by ${b(A.opened_by,m)} · ${On(A.opened_at)} · Open`})]}),a.jsx(P,{children:Tl(A)}),a.jsx(P,{className:"text-right",children:ar(A)})]},A.id)}),p.holds.length===0&&a.jsx(ce,{children:a.jsx(P,{colSpan:4,className:"text-muted-foreground h-16 text-center",children:"Nothing is holding this task."})})]})]})}),a.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."})]}),a.jsxs("section",{className:"mt-6 pb-8","aria-labelledby":"task-activity-title",children:[a.jsx("h2",{id:"task-activity-title",className:"text-lg font-semibold",children:"Activity"}),a.jsxs("ul",{className:"mt-2 divide-y rounded-lg border",children:[M.slice(0,I).map(A=>a.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:[a.jsx("span",{children:NO(A)}),a.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[a.jsx("span",{children:A.actor_id?b(A.actor_id,m):"The system"}),A.via?a.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${Kd(A.via,A.via_device)}`,children:["via ",gp(A.via),a.jsx(mN,{via:A.via,device:A.via_device})]}):null]}),a.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:cN(A.created_at)})]},A.id)),M.length===0&&a.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),M.length>I&&a.jsx(q,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>T(A=>A+Yg),children:"Load more"})]}),ge&&me&&a.jsx(LO,{open:E,members:g,tasks:O,holds_my_web_claim:dn&&Ds&&!(le!=null&&le.via),on_close:()=>H(!1),on_submit:Ls}),x]})}function $o({label:e,value:t}){return a.jsxs("div",{className:"grid gap-1",children:[a.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),a.jsx("dd",{className:"text-sm",children:t})]})}function IO({members:e,selected:t,on_change:n}){return a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"task-contributors",children:"Contributors"}),a.jsxs(Hu,{children:[a.jsx(Bu,{asChild:!0,children:a.jsxs(q,{id:"task-contributors",type:"button",variant:"outline",className:"justify-between font-normal",children:[t.length===0?a.jsx("span",{className:"text-muted-foreground",children:"Add a contributor"}):a.jsx("span",{className:"truncate",children:e.filter(s=>t.includes(s.user_id)).map(s=>s.label).join(", ")}),a.jsx(_j,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),a.jsx(lo,{align:"start",children:e.map(s=>{const r=t.includes(s.user_id);return a.jsxs(Ya,{onSelect:()=>n(r?t.filter(l=>l!==s.user_id):[...t,s.user_id]),children:[r?a.jsx(pl,{className:"mr-2 size-4","aria-hidden":"true"}):a.jsx("span",{className:"mr-2 size-4"}),s.label]},s.user_id)})})]})]})}function mN({via:e,device:t}){return e!=="sdlc_login"||!t?null:a.jsxs(a.Fragment,{children:[" on ",a.jsx("bdi",{children:t})]})}function qO({claim:e,mine:t,holder:n,own:s,can_write:r,on_claim:l,on_release:i,on_clear:o}){let c=a.jsx(zm,{className:"size-4","aria-hidden":"true"}),d="Nobody is working on this",f=r?"Claim it to show others you are.":"",h=r?a.jsx(q,{type:"button",size:"sm",onClick:l,children:"Claim"}):null;if(e&&e.lapsed){const m=new Date(e.lease_expires_at)<=new Date;c=a.jsx(F2,{className:"size-4","aria-hidden":"true"}),d=m?`${t?"Your":`${n}'s`} claim lapsed at ${Wn(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?a.jsxs(a.Fragment,{children:[a.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:o,children:"Clear claim"}),a.jsx(q,{type:"button",size:"sm",onClick:l,children:"Take over"})]}):null}else if(e){const m=Wn(e.lease_expires_at);c=e.via==="api_key"?a.jsx(Am,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?a.jsx(fC,{className:"size-4","aria-hidden":"true"}):a.jsx(YC,{className:"size-4","aria-hidden":"true"});const g=a.jsxs(a.Fragment,{children:["Claimed via sdlc login",a.jsx(mN,{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=a.jsxs(a.Fragment,{children:[g," 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=g):t?(d=`You are working on this until ${m}`,f=s?"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?a.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:i,children:"Release claim"}):null}return a.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3 rounded-lg border p-3","data-testid":"task-claim",children:[c,a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium",children:d}),f?a.jsx("div",{className:"text-muted-foreground text-xs break-words",children:f}):null]}),h?a.jsx("div",{className:"flex items-center gap-2",children:h}):null]})}const GO=10,pN=5,PO=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,VO="The sdlc engine here is too old for this page",YO="Update the main checkout, then restart sdlc viewer.",xN="Not available",XO={added:"Added",changed:"Changed",removed:"Removed"},FO={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"};function KO(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;if(n&&PO.test(n))return{label:n,path:`/org/${e}/tasks/${n}`};const s=t!=null&&t.startsWith("issue:")?t.slice(6):null;return s&&/^iss-\d{1,9}$/.test(s)?{label:s,path:`/org/${e}/issues/${s}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const gN=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function QO({org:e,task_id:t,from:n}){var ka;const s=oo(),{href:r,Link:l}=at(),{confirm:i,confirm_dialog:o}=yl(),c=KO(e,n),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState([]),[g,b]=u.useState([]),[y,j]=u.useState(null),[x,p]=u.useState(null),[v,w]=u.useState({state:"loading"}),[N,k]=u.useState({state:"loading"}),[_,S]=u.useState(null),[R,M]=u.useState(null),[L,I]=u.useState(!1),T=u.useRef(null),O=u.useRef(null),Y=u.useRef(null),E=u.useRef(null),H=u.useRef(null),C=u.useRef(!1),B=u.useRef(0),Z=u.useRef(0),z=u.useCallback(async()=>{if(!s.taskSections)return;w({state:"loading"});const ee=await s.taskSections(t);w(ee.ok?{state:"ok",data:ee.data}:{state:"failed",refusal:ee.refusal})},[s.taskSections,t]),K=u.useCallback(async()=>{if(!s.taskRelated)return;k({state:"loading"});const ee=await s.taskRelated(t);k(ee.ok?{state:"ok",data:ee.data}:{state:"failed",refusal:ee.refusal})},[s.taskRelated,t]),ae=u.useCallback(async()=>{var zs,$s;const ee=Z.current+=1;p(null),z(),K();const[Oe,Te]=await Promise.all([s.availability(),s.task?s.task(t):Promise.resolve(null)]);if(ee!==Z.current)return;Oe.state==="active"&&m(((zs=Oe.workspace.workflows.find(Ut=>Ut.id===Oe.list.workflow_id))==null?void 0:zs.statuses)??[]);const sr=Oe.state==="off"&&(($s=Oe.refusal)==null?void 0:$s.reason)==="engine_missing"?Oe.refusal:null;if(!Te||!Te.ok&&Te.refusal.reason==="engine_missing"||sr){f({state:"engine_missing",refusal:sr??(Te&&!Te.ok?Te.refusal:{status:0,message:""})});return}if(Te.ok){B.current=0,j(null),M(null),f({state:"ok",detail:Te.data,at:new Date().toISOString()});return}if(Te.refusal.status===404||Te.refusal.reason==="not_found"){f({state:"missing"});return}if(B.current+=1,B.current===1&&gN(Te.refusal)){p(Te.refusal.retry_after??GO);return}j(Te.refusal),f(Ut=>Ut.state==="loading"?{state:"loading"}:Ut)},[s,t,z,K]);u.useEffect(()=>{ae()},[ae]),u.useEffect(()=>{if(x===null)return;const ee=setTimeout(()=>void ae(),x*1e3);return()=>clearTimeout(ee)},[x,ae]),u.useEffect(()=>{let ee=!0;return s.members().then(Oe=>{ee&&Oe.ok&&b(Oe.data)}),()=>{ee=!1}},[s.members]),u.useEffect(()=>{var Oe;if(C.current||d.state!=="ok")return;C.current=!0;const ee=(Oe=T.current)==null?void 0:Oe.querySelector("h1");ee&&(ee.tabIndex=-1,ee.focus())},[d.state]),u.useEffect(()=>{var ee;_&&((ee=Y.current)==null||ee.focus())},[_]),u.useEffect(()=>{if(R===null)return;const ee=setTimeout(()=>{var Oe;return(Oe=O.current)==null?void 0:Oe.focus()},0);return()=>clearTimeout(ee)},[R]);const Q=u.useMemo(()=>new Map(g.map(ee=>[ee.user_id,ee.label])),[g]),F=ee=>ee?Q.get(ee)??ee:"",U=()=>{S(null),ae()},$=u.useRef(null),W=ee=>($.current=ee,ee==="graph"?z():K());if(u.useEffect(()=>{var Te;const ee=$.current;if(ee===null||(ee==="graph"?v:N).state==="loading")return;$.current=null;const Oe=(ee==="graph"?E:H).current??((Te=T.current)==null?void 0:Te.querySelector("h1"));Oe==null||Oe.focus()},[v,N]),d.state==="missing")return a.jsx(sa,{children:a.jsx(Fc,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const me=a.jsx(q,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:a.jsxs(l,{href:r(c.path),children:[a.jsx(Rm,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return a.jsx(sa,{children:a.jsxs("div",{ref:T,className:"contents",children:[a.jsx(Kc,{back:me,id:null,title:t}),a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Tasks need the sdlc engine"}),a.jsx(ie,{children:d.refusal.message})]})]})});const ve=y?a.jsxs(oe,{variant:"destructive",className:"mt-4",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Could not read this task"}),a.jsxs(ie,{children:[a.jsxs("p",{children:[y.message,y.since?` Since ${Mn(y.since)}.`:"",d.state==="ok"?` This page was read at ${Mn(d.at)}.`:""," See the sdlc viewer terminal for more."]}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:U,children:"Retry"})]})]}):null,be=x!==null?a.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[a.jsx(va,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",x," seconds."]}):null,re=a.jsx("div",{role:"status","aria-live":"polite",children:be});if(d.state==="loading")return a.jsxs(sa,{children:[re,ve,!y&&x===null?a.jsx(bp,{}):null]});const{detail:ue,at:le}=d,{task:Ye}=ue,fe=h.find(ee=>ee.id===Ye.status_id),V=ue.local_done&&"task"in ue.local_done?ue.local_done:null,ge=ue.local_waits??[],Ae=V?ge[0]??null:null,Et=Ae?F(Ae.opened_by):ue.owner_title??F(ue.thread),he=v.state==="ok"?v.data:null,Qt=(he==null?void 0:he.lifecycle)==="finished",Os=Qt&&(he==null?void 0:he.outcome)==="cancelled",dn=Qt&&(he==null?void 0:he.outcome)==="complete",Ds=!!Ye.created_at,ss=ue.acceptance??[],Cl=async()=>{var Te;if(!V||!((Te=s.commands)!=null&&Te.complete)||!await i({title:`Mark ${Ye.title} done?`,description:Ae?`This answers ${Et}'s ask, “${Ae.reason}”, closes that wait, and tells ${Et} to check and continue.`:`This tells ${Et||"its thread"} to check and continue.`,action_label:"Mark done"}))return;I(!0);const Oe=await s.commands.complete(V);if(I(!1),!Oe.ok){M(Oe.refusal.message);return}await ae(),S({title:Ye.title,asker:Et||"Its thread"})},fn=a.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[V&&!_?a.jsxs(a.Fragment,{children:[a.jsxs(q,{ref:O,type:"button",variant:"outline",disabled:L,"aria-disabled":R!==null?!0:void 0,"aria-describedby":R!==null?"task-done-why":void 0,onClick:()=>{R===null&&Cl()},children:[a.jsx(pl,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),R!==null?a.jsx("span",{id:"task-done-why",className:"text-muted-foreground text-xs",children:"Read again first"}):null]}):null,a.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",Mn(le)]}),a.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:U,children:[a.jsx(xl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return a.jsxs(sa,{children:[a.jsxs("div",{ref:T,className:"contents",children:[a.jsx(Kc,{back:me,id:Ye.id,badge:fe?a.jsx(Re,{variant:oN(fe),children:fe.name}):null,title:Ye.title,created:Ds?`Created ${On(Ye.created_at)}${Et||ue.owner_title?` by ${ue.owner_title??Et}`:""}`:null,actions:fn}),re,ve,_?a.jsx("div",{ref:Y,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:a.jsxs(oe,{variant:"success",className:"mt-4",children:[a.jsx(Mm,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:["Marked ",_.title," done"]}),a.jsxs(ie,{children:[_.asker," is told to check and continue."]})]})}):null,R!==null?a.jsxs(oe,{variant:"destructive",className:"mt-4",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Done was not recorded"}),a.jsxs(ie,{children:[R," Read again to see the task as it is now."]})]}):null,Ae&&!_?a.jsxs(oe,{variant:"warning",className:"mt-4",children:[a.jsx(Dn,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:[Et," asks: ",Ae.reason]}),a.jsxs(ie,{children:["Waiting on you since ",vp(Ae.opened_at),". Done answers it and tells ",Et," to check and continue."]})]}):null,ue.view_outdated?a.jsxs(oe,{variant:"warning",className:"mt-4",children:[a.jsx(Dn,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:VO}),a.jsxs(ie,{children:[YO," Until then this page cannot read the claim and holds."]})]}):null,a.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx(Vn,{label:"Owner thread",value:ue.owner_title??(F(ue.thread)||"None")}),a.jsx(Vn,{label:"Release",value:ue.release??"None"}),a.jsx(Vn,{label:"Session",value:v.state==="loading"?"Loading…":v.state==="failed"?"Not available":he!=null&&he.session?a.jsxs(a.Fragment,{children:[he.session.provider," ",a.jsx("span",{className:"font-mono break-all",children:he.session.id})]}):"None"}),a.jsx(Vn,{label:"Now",value:ue.local_detail??(fe==null?void 0:fe.name)??""})]}),a.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),a.jsx(ZO,{detail:ue,holder:F((ka=ue.claim)==null?void 0:ka.user_id),finished_at:Qt?(he==null?void 0:he.finished_at)??null:null,read_at:le}),a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(Zi,{className:"text-info size-4","aria-hidden":"true"}),V?a.jsxs(a.Fragment,{children:[a.jsx(pe,{children:"Done is the one change this page makes"}),a.jsx(ie,{children:"Everything else about this task changes through its thread."})]}):a.jsxs(a.Fragment,{children:[a.jsx(pe,{children:"This page only reads tasks"}),a.jsx(ie,{children:"A task changes through the agent thread working on it."})]})]}),Ds?he!=null&&he.record?a.jsxs("p",{className:"mt-4 text-sm",children:["Record ",a.jsx("span",{className:"font-mono break-all",children:he.record})]}):null:a.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."}),V?a.jsx(dt,{id:"task-done-needs",title:"What Done needs",children:ss.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-muted-foreground text-xs",children:["The task's acceptance; ",Et||"its thread"," checks these after Done."]}),a.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:ss.map(ee=>a.jsx("li",{children:ee},ee))})]}):a.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",Et||"its thread"," what Done needs before marking it."]})}):ss.length>0?a.jsxs(dt,{id:"task-acceptance",title:"Acceptance",children:[a.jsx("p",{className:"text-muted-foreground text-xs",children:dn?"All met: the task finished complete":Os&&(he!=null&&he.finished_at)?`Cancelled ${On(he.finished_at)}`:"Met when the task finishes complete"}),a.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:ss.map(ee=>a.jsx("li",{children:dn?`Met: ${ee}`:ee},ee))})]}):null,a.jsx(WO,{detail:ue,waits:ge,given:V!==null,threadName:F,threadsLink:a.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/threads`),children:"Threads"})}),v.state==="loading"?a.jsxs("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading the task's sections",children:[a.jsx(ct,{className:"h-8 w-full"}),a.jsx(ct,{className:"h-8 w-full"}),a.jsx(ct,{className:"h-8 w-2/3"})]}):null,he?a.jsx(dt,{id:"task-stands",title:"Where it stands",children:a.jsxs("p",{className:"text-sm",children:[(fe==null?void 0:fe.name)??Ye.status_id,ue.local_detail?` · ${ue.local_detail}`:""]})}):null,he!=null&&he.time?a.jsx(JO,{time:he.time}):null,a.jsx(eD,{sections:v,heading_ref:E,on_retry:()=>void W("graph"),taskLink:ee=>a.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks/${ee}?from=task:${Ye.id}`),children:ee})}),he!=null&&he.files?a.jsx(tD,{files:he.files,finished:Qt}):null,he!=null&&he.proof?a.jsx(nD,{proof:he.proof,finished_at:he.finished_at,who:ue.owner_title??null}):null,he&&he.history.length>0?a.jsx(sD,{history:he.history}):null,a.jsx(vN,{related:N,heading_ref:H,on_retry:()=>void W("related"),link:ee=>{if(ee.kind==="thread")return ee.label;const Oe=ee.kind==="task"?`/org/${e}/tasks/${ee.id}?from=task:${Ye.id}`:ee.kind==="issue"?`/org/${e}/issues/${encodeURIComponent(ee.id)}?from=task:${Ye.id}`:ee.kind==="release"?`/classic/#${ee.planned?"planned":"release"}=${encodeURIComponent(ee.id)}`:null;return Oe?a.jsx(l,{className:J("text-primary hover:underline",ee.label===ee.id&&"font-mono"),href:r(Oe),children:ee.label}):ee.label}})]}),o]})}function sa({children:e}){return a.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 Kc({back:e,id:t,badge:n,title:s,created:r,actions:l}){return a.jsxs("div",{className:"grid gap-1",children:[a.jsx("div",{children:e}),t?a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[a.jsx("span",{className:"font-mono",children:t}),n]}):null,a.jsx(Kt,{title:s,description:r??void 0,actions:l})]})}function Vn({label:e,value:t}){return a.jsxs("div",{className:"grid gap-1",children:[a.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),a.jsx("dd",{className:"m-0 text-sm break-words",children:t})]})}function dt({id:e,title:t,aside:n,heading_ref:s,children:r}){return a.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[a.jsx("h2",{id:`${e}-title`,ref:s,tabIndex:s?-1:void 0,className:"text-lg font-semibold outline-none",children:t}),n?a.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),a.jsx("div",{className:"mt-2",children:r})]})}function ZO({detail:e,holder:t,finished_at:n,read_at:s}){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=a.jsx(zm,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${xN}`;else if(r){const f=new Date(r.lease_expires_at)<=new Date(Math.max(Date.now(),new Date(s).getTime()));o=a.jsx(Am,{className:"size-4","aria-hidden":"true"}),c=`${t} is working on this until ${Mn(r.lease_expires_at)}${f||r.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=a.jsx(Mm,{className:"size-4","aria-hidden":"true"}),d=`Finished ${On(n)}. Its claim ended when it finished.`);return a.jsxs(pt,{className:"mt-4 flex flex-wrap items-center gap-3 p-3","data-testid":"task-claim",children:[o,a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium",children:c}),d?a.jsx("div",{className:"text-muted-foreground text-xs break-words",children:d}):null]})]})}function WO({detail:e,waits:t,given:n,threadName:s,threadsLink:r}){if(e.view_outdated)return a.jsx(dt,{id:"task-holds",title:"Holds",children:a.jsx("p",{className:"text-sm",children:xN})});if(e.holds.length===0)return null;const l=new Map(t.map(i=>[i.id,i]));return a.jsxs(dt,{id:"task-holds",title:`Holds · ${e.holds.length} open`,children:[a.jsx("p",{className:"text-muted-foreground text-xs",children:"A hold does not change the task's status."}),a.jsx(pt,{className:"mt-2 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Holds",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Type"}),a.jsx(X,{children:"Reason"}),a.jsx(X,{children:"Waiting on"}),a.jsx(X,{children:"Opened"})]})}),a.jsx(Fe,{children:e.holds.map(i=>{var f;const o=l.get(i.id),c=Mi[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?a.jsxs(a.Fragment,{children:["Answer it in ",r,": ",o.local_threads.join(" · ")]}):null;return a.jsxs(ce,{"data-testid":"task-hold",children:[a.jsx(P,{children:a.jsx(Re,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),a.jsxs(P,{children:[a.jsx("div",{children:i.reason}),a.jsxs("div",{className:"text-muted-foreground text-xs",children:["Opened by ",s(i.opened_by)]})]}),a.jsxs(P,{children:[a.jsx("div",{children:i.target.kind==="user"?"You":i.target.kind==="external"?i.target.label:"Another task"}),d?a.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null]}),a.jsx(P,{children:vp(i.opened_at)})]},i.id)})})]})})]})}function JO({time:e}){return a.jsx(dt,{id:"task-time",title:"Time",children:a.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(Vn,{label:"Estimate",value:e.estimate?`${Ul(e.estimate.low)}–${Ul(e.estimate.high)}`:e.unknown_reason??"None"}),a.jsx(Vn,{label:"Time taken",value:e.elapsed!==null?`${Ul(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?a.jsx(Vn,{label:"Reforecast",value:a.jsxs("span",{className:"text-muted-foreground",children:[Ul(e.forecast.low),"–",Ul(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function jp({what:e,again:t,refusal:n,on_retry:s}){return a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:["Could not read ",e]}),a.jsxs(ie,{children:[a.jsx("p",{children:n.message}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:s,children:t})]})]})}function eD({sections:e,heading_ref:t,on_retry:n,taskLink:s}){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 a.jsx(dt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:a.jsx(jp,{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 a.jsx(dt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:a.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,pN),d=o.changes.length-c.length;return a.jsxs(dt,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[a.jsx(pt,{className:"overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Graph changes",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Change"}),a.jsx(X,{children:"Kind of change"}),a.jsx(X,{children:"Also in"}),a.jsx(X,{children:"In the plan"})]})}),a.jsx(Fe,{children:c.map(f=>a.jsxs(ce,{children:[a.jsxs(P,{children:[a.jsx("div",{children:f.label}),a.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),a.jsx(P,{children:XO[f.change]}),a.jsx(P,{children:f.also_in.length===0?"No other task":f.also_in.map((h,m)=>a.jsxs(u.Fragment,{children:[m>0?", ":null,s(h.id)]},h.id))}),a.jsx(P,{children:f.planned?"Yes":a.jsx(Re,{variant:"warning",children:"No longer planned"})})]},`${f.id}:${f.planned}`))})]})}),d>0?a.jsxs("p",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[d," more changes in this task's plan slice.",a.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),children:["Show all ",o.changes.length]})]}):null]})}function tD({files:e,finished:t}){const[n,s]=u.useState(!1),r=n?e.paths:e.paths.slice(0,pN);return a.jsxs(dt,{id:"task-files",title:"Files",children:[r.length>0?a.jsx("ul",{className:"grid gap-1 text-sm",children:r.map(l=>a.jsx("li",{children:a.jsx("span",{className:"font-mono break-all",children:l})},l))}):null,e.paths.length>r.length?a.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"mt-1",onClick:()=>s(!0),children:["Show all ",e.paths.length]}):null,e.landed?a.jsxs("p",{className:"mt-2 text-sm",children:["Landed ",a.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 nD({proof:e,finished_at:t,who:n}){return a.jsxs(dt,{id:"task-proof",title:"Evidence and proof",children:[e.evidence?a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.evidence}):null,e.no_code?a.jsxs("p",{className:"mt-2 text-sm",children:["No code: ",e.no_code]}):e.commit?a.jsxs("p",{className:"mt-2 text-sm",children:["Proof ",a.jsx("span",{className:"font-mono",children:e.commit.slice(0,10)})," ·"," ",e.on_main?"on main":"not yet on main"]}):null,t?a.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Finished ",On(t),n?` by ${n}`:""]}):null]})}function sD({history:e}){return a.jsxs(dt,{id:"task-history",title:"History",children:[a.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),a.jsx(pt,{className:"mt-2 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"History",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"What"}),a.jsx(X,{children:"Who"}),a.jsx(X,{children:"When"})]})}),a.jsx(Fe,{children:e.map((t,n)=>a.jsxs(ce,{children:[a.jsx(P,{children:t.what}),a.jsx(P,{children:t.who??"Its thread"}),a.jsx(P,{children:vp(t.at)})]},`${t.at}:${n}`))})]})})]})}function vN({id:e="task-related",related:t,heading_ref:n,on_retry:s,link:r,fixed:l=!1}){return t.state==="ok"&&t.data.length===0?null:a.jsx(dt,{id:e,title:"Related",heading_ref:n,children:t.state==="loading"?a.jsxs("div",{className:"grid gap-2",role:"status","aria-label":"Loading related work",children:[a.jsx(ct,{className:"h-8 w-full"}),a.jsx(ct,{className:"h-8 w-full"}),a.jsx(ct,{className:"h-8 w-2/3"})]}):t.state==="failed"?a.jsx(jp,{what:"related work",again:"Read related work again",refusal:t.refusal,on_retry:s}):a.jsx(pt,{className:"overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Related",className:l?"table-fixed":void 0,children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{className:l?"w-[14%]":void 0,children:"Kind"}),a.jsx(X,{className:l?"w-[45%]":void 0,children:"Item"}),a.jsx(X,{className:l?"w-[41%]":void 0,children:"How it relates"})]})}),a.jsx(Fe,{children:t.data.map(i=>a.jsxs(ce,{children:[a.jsx(P,{children:FO[i.kind]}),a.jsx(P,{className:l?"break-words":void 0,children:r(i)}),a.jsx(P,{className:l?"break-words":void 0,children:i.relation})]},`${i.kind}:${i.planned?"planned:":""}${i.id}`))})]})})})}function aD({org:e,task_id:t,from:n}){const s=oo(),r=`/org/${e}/tasks`;return s.taskSections?a.jsx(QO,{org:e,task_id:t,from:n??null}):a.jsx(rD,{task_id:t,back:r})}function rD({task_id:e,back:t}){const{availability:n}=oo(),[s,r]=u.useState({state:"loading"});return u.useEffect(()=>{let l=!0;return n().then(i=>{l&&r(i)}),()=>{l=!1}},[n]),s.state==="off"?a.jsx(Fc,{back:t}):a.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:s.state==="active"?a.jsx(BO,{active:s,task_id:e,back:t}):s.state==="error"?a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"This task could not be loaded"}),a.jsx(ie,{children:"Check your connection and try again."})]}):s.state==="available"?a.jsx(Fc,{back:t}):a.jsx(bp,{})})}function En({children:e}){return a.jsx("p",{role:"alert",className:"text-destructive text-sm",children:e})}const lD=["open","triaged","resolved","closed"],wp=["low","normal","high","urgent"],iD=["fixed","works_as_intended","planned","duplicate","wont_fix","cannot_reproduce"],oD=["title","description","external_reference"],Qc={open:"Open",triaged:"Triaged",escalated:"Escalated",waiting_on_fix:"Waiting on fix",resolved:"Resolved",closed:"Closed"},yN={open:"warning",triaged:"info",escalated:"info",waiting_on_fix:"info",resolved:"success",closed:"neutral"},Oi={low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},_p={fixed:"Fixed",works_as_intended:"Works as intended",planned:"Planned",duplicate:"Duplicate",wont_fix:"Won't fix",cannot_reproduce:"Cannot reproduce"},bN={title:"Title",description:"Description",external_reference:"External reference"},cD=[["year",365*24*3600],["month",30*24*3600],["week",7*24*3600],["day",24*3600],["hour",3600],["minute",60]];function rc(e,t=Date.now()){const n=Math.round((new Date(e).getTime()-t)/1e3),s=new Intl.RelativeTimeFormat("en",{numeric:"auto"});for(const[r,l]of cD)if(Math.abs(n)>=l)return s.format(Math.round(n/l),r);return"just now"}function _h(e,t,n){const s=`/org/${encodeURIComponent(e)}/proj/${encodeURIComponent(t)}/support`;return n?`${s}/${encodeURIComponent(n)}`:s}function Np(e,t){return e?t??"Not available":"A former member"}const uD="the issue integration";function dD(e){return!e.created_by&&e.reporter_kind==="customer"?uD:Np(e.created_by,e.created_by_username)}function fD(e,t){return!e.actor_id&&e.kind==="created"&&t.reporter_kind==="customer"?"The issue integration":Np(e.actor_id,e.actor_username)}const Lo="not_set",hD="Do not paste personal data. Leave out names, such as borrower names, and loan numbers; text shaped like an email address, phone number, or social security number is refused.";function mD({create:e,open:t,onOpenChange:n,onCreated:s}){const[r,l]=u.useState(""),[i,o]=u.useState(""),[c,d]=u.useState(!1),[f,h]=u.useState(""),[m,g]=u.useState(Lo),[b,y]=u.useState(!1),[j,x]=u.useState(null),p=u.useRef(null),v=()=>{l(""),o(""),d(!1),h(""),g(Lo),x(null),p.current=null},w=_=>{var S;return((S=j==null?void 0:j.personal_data)==null?void 0:S.field)===_?j.message:void 0},N=async _=>{if(_.preventDefault(),b)return;y(!0),p.current??(p.current=crypto.randomUUID());const S=await e({request_id:p.current,title:i.trim()||void 0,description:f||void 0,external_reference:r.trim()||void 0,priority:m===Lo?null:m});if(y(!1),!S.ok){S.refusal.status!==0&&(p.current=null),x(S.refusal);return}v(),s(S.data.issue,S.data.duplicates)},k=j&&!j.personal_data?j.message:void 0;return a.jsx(Cs,{open:t,onOpenChange:_=>{_||v(),n(_)},children:a.jsx(Ts,{className:"sm:max-w-2xl",children:a.jsxs("form",{onSubmit:N,className:"grid gap-4",children:[a.jsxs(Es,{children:[a.jsx(As,{children:"New support issue"}),a.jsx(Ms,{children:"Log one help-desk report. Text is shown exactly as entered."})]}),a.jsxs(oe,{variant:"warning",children:[a.jsx(Dn,{}),a.jsx(ie,{children:hD})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-issue-reference",children:"External reference"}),a.jsx(Tt,{id:"maintain-issue-reference",value:r,"aria-invalid":!!w("external_reference"),onChange:_=>{l(_.target.value),c||o(_.target.value)}}),w("external_reference")?a.jsx(En,{children:w("external_reference")}):a.jsx("p",{className:"text-muted-foreground text-xs",children:"The help-desk ticket number."})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-issue-title",children:"Title"}),a.jsx(Tt,{id:"maintain-issue-title",value:i,"aria-invalid":!!w("title"),onChange:_=>{o(_.target.value),d(!0)}}),w("title")?a.jsx(En,{children:w("title")}):a.jsx("p",{className:"text-muted-foreground text-xs",children:"Prefilled from the external reference; edit it if you like."})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-issue-description",children:"Description"}),a.jsx(Hn,{id:"maintain-issue-description",rows:4,placeholder:"What the end user reported, without personal data",value:f,"aria-invalid":!!w("description"),onChange:_=>h(_.target.value)}),w("description")?a.jsx(En,{children:w("description")}):null]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-issue-priority",children:"Priority"}),a.jsxs(yt,{value:m,onValueChange:g,children:[a.jsx(ht,{id:"maintain-issue-priority",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:Lo,children:"Not set"}),wp.map(_=>a.jsx(ke,{value:_,children:Oi[_]},_))]})]})]}),k?a.jsx(En,{children:k}):null,a.jsxs(Rs,{children:[a.jsx(q,{type:"button",variant:"outline",onClick:()=>{v(),n(!1)},children:"Cancel"}),a.jsx(q,{type:"submit",loading:b,disabled:!i.trim()&&!r.trim(),children:"Log issue"})]})]})})})}const pD=["supportAccess","assigneeCandidates","create","update","assign","transition","redact"];function jN(){return xD(_n().issues)}function xD(e){return e&&pD.every(t=>typeof e[t]=="function")?e:null}function wN(e){const[t,n]=u.useState(null);return u.useEffect(()=>{if(!e)return;let s=!1;return e.supportAccess().then(r=>{s||n({contract:e,state:r.ok?{state:"ready",access:r.data}:{state:"error"}})}),()=>{s=!0}},[e]),t&&e&&t.contract===e?t.state:{state:"loading"}}function _N({access:e,header:t,back_href:n,children:s}){const{href:r,Link:l}=at();return e.state==="loading"?a.jsxs("div",{className:"flex flex-1 items-center justify-center py-24",children:[a.jsx(va,{className:"size-5"}),a.jsx("span",{className:"sr-only",children:"Loading…"})]}):e.state==="error"||!e.access.enabled?a.jsx(nr,{title:"Page not found",description:"This page does not exist or you do not have access to it.",backHref:r(n),backLabel:"Back to the project",link:l}):e.access.can_view?a.jsx(a.Fragment,{children:s(e.access)}):a.jsxs(a.Fragment,{children:[t,a.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[a.jsx(bC,{className:"text-muted-foreground size-8","aria-hidden":!0}),a.jsx("h2",{className:"text-lg font-semibold",children:"Support needs a Maintain seat"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:e.access.seat?"You need read permission on this project to see its support issues; ask an organization admin.":"You need a Maintain seat to see this project's support issues; ask an organization admin."})]})]})}function gD(){const e=at();return t=>{e.navigate?e.navigate(t):window.location.assign(e.href(t))}}const Jt="all",Uo=25;function Nh({action:e}){return a.jsx(Kt,{title:"Support",description:"Help-desk reports logged against this project.",actions:e})}function vD({org:e,project:t,query:n}){const s=jN(),r=wN(s),l=`/org/${e}/proj/${t}`;return a.jsx("div",{className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:a.jsx(_N,{access:r,header:a.jsx(Nh,{}),back_href:l,children:i=>s?a.jsx(yD,{contract:s,access:i,org_name:e,proj_name:t,query:n}):null})})}function yD({contract:e,access:t,org_name:n,proj_name:s,query:r}){const{href:l,Link:i}=at(),o=gD(),[c,d]=u.useState(()=>new URLSearchParams(r).get("external_reference")??""),[f,h]=u.useState(Jt),[m,g]=u.useState(Jt),[b,y]=u.useState(Jt),[j,x]=u.useState(0),[p,v]=u.useState(null),[w,N]=u.useState(0),[k,_]=u.useState(null),[S,R]=u.useState([]),[M,L]=u.useState(!1),I=c.trim()!==""||f!==Jt||m!==Jt||b!==Jt,T=u.useCallback(async()=>{const C=await e.list({external_reference:c.trim()||void 0,status:f===Jt?void 0:f,priority:m===Jt?void 0:m,assignee:b===Jt?void 0:b,limit:Uo,offset:j*Uo});if(!C.ok){_(C.refusal.message);return}_(null),v(C.data.issues),N(C.data.total)},[e,c,f,m,b,j]);u.useEffect(()=>{const C=setTimeout(()=>void T(),200);return()=>clearTimeout(C)},[T]),u.useEffect(()=>{e.assigneeCandidates().then(C=>{C.ok&&R(C.data.candidates)})},[e]);const O=t.can_change?a.jsxs(q,{onClick:()=>L(!0),children:[a.jsx(sl,{className:"mr-2 size-4"}),"New issue"]}):void 0,Y=a.jsx(mD,{create:e.create,open:M,onOpenChange:L,onCreated:(C,B)=>{L(!1);const Z=_h(n,s,C.id);o(B.length?`${Z}?duplicates=${B.length}`:Z)}});if(p!==null&&w===0&&!I&&j===0)return a.jsxs(a.Fragment,{children:[a.jsx(Nh,{}),a.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[a.jsx(mC,{className:"text-muted-foreground size-8","aria-hidden":!0}),a.jsx("h2",{className:"text-lg font-semibold",children:"No support issues yet"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Log a help-desk report under its ticket number, so every report is counted once."}),t.can_change?a.jsxs(q,{onClick:()=>L(!0),children:[a.jsx(sl,{className:"mr-2 size-4"}),"Log the first issue"]}):null]}),Y]});const E=w===0?0:j*Uo+1,H=Math.min(w,(j+1)*Uo);return a.jsxs(a.Fragment,{children:[a.jsx(Nh,{action:O}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("div",{className:"relative w-full max-w-sm",children:[a.jsx(HC,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2","aria-hidden":!0}),a.jsx(Tt,{"aria-label":"Filter by external reference",placeholder:"Filter by external reference",className:"pl-9",value:c,onChange:C=>{d(C.target.value),x(0)}})]}),a.jsx(Zd,{label:"Status",value:f,onChange:C=>{h(C),x(0)},options:lD.map(C=>({value:C,label:Qc[C]}))}),a.jsx(Zd,{label:"Priority",value:m,onChange:C=>{g(C),x(0)},options:wp.map(C=>({value:C,label:Oi[C]}))}),a.jsx(Zd,{label:"Assignee",value:b,onChange:C=>{y(C),x(0)},options:[{value:"unassigned",label:"Unassigned"},{value:"cannot_act",label:"Assignee cannot act"},...S.map(C=>({value:C.user_id,label:C.username??"Not available"}))]})]}),k?a.jsx(En,{children:k}):null,a.jsx("div",{className:"rounded-md border",children:a.jsxs(Xe,{children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Title"}),a.jsx(X,{children:"External reference"}),a.jsx(X,{children:"Status"}),a.jsx(X,{children:"Priority"}),a.jsx(X,{children:"Assignee"}),a.jsx(X,{children:"Updated"})]})}),a.jsx(Fe,{children:p===null?a.jsx(ce,{children:a.jsx(P,{colSpan:6,className:"h-24 text-center",children:"Loading…"})}):p.length===0?a.jsx(ce,{children:a.jsx(P,{colSpan:6,className:"h-24 text-center",children:"No issues match these filters."})}):p.map(C=>a.jsxs(ce,{children:[a.jsx(P,{className:"max-w-md",children:a.jsx(i,{href:l(_h(n,s,C.id)),className:"font-medium hover:underline",children:C.title})}),a.jsx(P,{className:"font-mono text-xs",children:C.external_reference??""}),a.jsx(P,{children:a.jsx(Re,{variant:yN[C.status],children:Qc[C.status]})}),a.jsx(P,{children:C.priority?Oi[C.priority]:""}),a.jsx(P,{children:a.jsx(bD,{issue:C})}),a.jsx(P,{className:"text-muted-foreground",children:rc(C.updated_at)})]},C.id))})]})}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:w===0?"No issues.":`Showing ${E}–${H} of ${w} issue${w===1?"":"s"}.`}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(q,{variant:"outline",size:"sm",disabled:j===0,onClick:()=>x(C=>Math.max(0,C-1)),children:"Previous"}),a.jsx(q,{variant:"outline",size:"sm",disabled:H>=w,onClick:()=>x(C=>C+1),children:"Next"})]})]}),Y]})}function bD({issue:e}){return e.assignee_id?a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{children:e.assignee_username??"Not available"}),e.assignee_can_act===!1?a.jsx(Re,{variant:"error",children:"Assignee cannot act"}):null]}):a.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}function Zd({label:e,value:t,onChange:n,options:s}){var l;const r=u.useMemo(()=>t===Jt||s.some(i=>i.value===t),[s,t]);return a.jsxs(yt,{value:r?t:Jt,onValueChange:n,children:[a.jsx(ht,{className:"w-44","aria-label":e,children:a.jsx(bt,{placeholder:e,children:t===Jt?e:(l=s.find(i=>i.value===t))==null?void 0:l.label})}),a.jsxs(mt,{children:[a.jsx(ke,{value:Jt,children:"All"}),s.map(i=>a.jsx(ke,{value:i.value,children:i.label},i.value))]})]})}const jD="Local only · this machine · not connected to SoftwareDLC",wD="Checking sync state…",_D="Sync state unknown",ND="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",Ka="Details are in the terminal running sdlc viewer.",kD="How to fix it is in the terminal running sdlc viewer.",Xu="Loading…",Zc="Not available";function SD(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 Fl(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const CD={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 NN(e,t){const n=t?` this list was read at ${Fl(t)}.`:"";if(e.reason==="store_locked"){const s=e.store?CD[e.store]:"a local store",r=e.since?` since ${Fl(e.since)}`:"";return`Another sdlc command has held ${s}${r};${n||" nothing was read yet."} ${Ka}`}return e.status===0?`The viewer did not answer. Is sdlc viewer still running?${t?` This list was read at ${Fl(t)}.`:""}`:`The read failed.${t?` This list was read at ${Fl(t)}.`:""} ${Ka}`}const TD=e=>e.status===409,ED={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 RD(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?ED[e.reason]:void 0,s=n!==void 0&&e.reason!=="membership_invalid"&&e.reason!=="folder_invalid";return{kind:"other",cause:n??"This repository's folder cannot be read.",fix:s}}const kN=[{key:"local",label:"Local"},{key:"staging",label:"Staging"},{key:"production",label:"Production"}],AD=/^iss-\d{1,9}$/,MD=/^col-\d{1,9}$/,OD=e=>e&&e[0].toUpperCase()+e.slice(1);function SN(e){const t=OD(e.status_word??e.status.replace(/_/g," ")),n=e.group??(e.status==="resolved"?"resolved":"unplaced");return n==="resolved"?{label:t,tone:e.resolution_reason==="fixed"?"success":"neutral"}:n==="unowned"||n==="routed"?{label:t,tone:"warning"}:n==="fixing"?{label:t,tone:"info"}:{label:t,tone:"neutral"}}function fi(e,t=Date.now()){if(!e)return"";const n=Math.max(0,(t-Date.parse(e))/1e3);return Number.isFinite(n)?n<60?"just now":n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`:""}const kh={search:"",owner:null,urgent:!1,seen:[],label:null,collection:null};function lc(e){const t=new URLSearchParams(e),n=t.getAll("seen").filter(r=>kN.some(l=>l.key===r)),s=t.get("collection");return{search:t.get("search")??"",owner:t.get("owner")||null,urgent:t.get("urgent")==="1",seen:[...new Set(n)],label:t.get("label")||null,collection:s&&MD.test(s)?s:null}}function Mr(e){const t=new URLSearchParams;e.search&&t.set("search",e.search),e.owner&&t.set("owner",e.owner),e.urgent&&t.set("urgent","1");for(const n of e.seen)t.append("seen",n);return e.label&&t.set("label",e.label),e.collection&&t.set("collection",e.collection),t.toString()}function DD(e){return{search:e.search.trim()||void 0,owner:e.owner??void 0,urgent:e.urgent||void 0,seen:e.seen.length?e.seen:void 0,label:e.label?[e.label]:void 0,collection:e.collection??void 0}}const Xg=e=>!!(e.search.trim()||e.owner||e.urgent||e.seen.length||e.label||e.collection),zD={agent:"Filed by an agent",user:"Filed by you",tool:"Filed by a tool"},$D={graph:"Placed on the graph by its anchors",files:"Placed by its files",unplaced:"Triaged, not placed yet"},LD={handoff:"Handed to its owner",backlog:"Sent to the unowned backlog",batch:"Routed to a batch"};function UD(e,t=""){const n=(e??t).trim();if(!n)return"";const s=n.indexOf(": "),r=(s===-1?n:n.slice(0,s)).trim(),l=s===-1?"":n.slice(s+2).trim(),i=o=>l?`${o} ${l}`:o;switch(r){case"filed":return zD[l]??i("Filed by");case"labelled":return i("Labelled");case"unlabelled":return l?`Label removed: ${l}`:"Label removed";case"anchored":return l?`Anchored to ${l}`:"Anchored";case"triaged":return $D[l]??(l?`Triaged: ${l}`:"Triaged");case"routed":return LD[l]??(l?`Routed: ${l}`:"Routed");case"route closed":return l==="backlog"?"Taken off the unowned backlog":l?`Route closed: ${l}`:"Route closed";case"released":return l?`Released by its owner (task ${l})`:"Released by its owner";case"resolved":return l==="duplicate"?"Resolved as a duplicate":l?`Resolved · ${l.replace(/_/g," ")}`:"Resolved";case"reopened":return l?`Reopened: ${l}`:"Reopened";case"fix landed":return l?`Fix landed in ${l.slice(0,10)}`:"Fix landed";case"merged":return l?`Merged ${l} into this issue`:"Merged a duplicate into this issue";default:return n}}const HD=e=>e.replace(/`+/g,"").replace(/\s+/g," ").trim(),CN="The sdlc engine here is too old for this page",TN="Update the main checkout, then restart sdlc viewer.",EN="Issues need the sdlc engine",RN="This page only reads issues",AN="File, route and resolve issues with the issue command or through the thread working on them.",BD=10,ID=250,fr="__all",qD="none",GD=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function MN(){const e=_n().issues;if(!e)throw new Error("The Issues page rendered without the issues seam.");return e}const PD=e=>({read_at:e,scope:"project",folder:null,groups:[],facets:{owners:[],labels:[],urgent:0,seen:{local:0,staging:0,production:0}},listed:0,collections:[]});function VD({project:e,query:t,onQuery:n}){var F;const s=MN(),{href:r,Link:l}=at(),i=u.useMemo(()=>lc(t),[t]),o=Mr(i),c=Xg(i),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState(null),[g,b]=u.useState(null),y=u.useRef(0),j=u.useRef(0),x=u.useRef(null),p=u.useRef(null),v=u.useRef(!1),[w,N]=u.useState(i.search),k=u.useCallback(U=>n(Mr({...i,...U})),[i,n]),_=u.useCallback(async()=>{const U=j.current+=1;b(null);const $=await s.list(DD(lc(o)));if(U!==j.current)return;if($.ok){y.current=0,m(null),f({state:"ok",list:$.data,local:$.data.local??PD(new Date().toISOString()),key:o});return}const W=$.refusal.reason;if(W==="engine_missing")return f({state:"engine_missing",refusal:$.refusal});if(W==="view_outdated")return f({state:"view_outdated"});if(y.current+=1,y.current===1&&GD($.refusal)){b($.refusal.retry_after??BD);return}m($.refusal)},[s.list,o]);u.useEffect(()=>{_()},[_]),u.useEffect(()=>{if(g===null)return;const U=setTimeout(()=>void _(),g*1e3);return()=>clearTimeout(U)},[g,_]),u.useEffect(()=>{document.activeElement!==x.current&&N(i.search)},[i.search]),u.useEffect(()=>{if(w===i.search)return;const U=setTimeout(()=>k({search:w}),ID);return()=>clearTimeout(U)},[w,i.search,k]),u.useEffect(()=>{const U=$=>{if($.key!=="/"||$.metaKey||$.ctrlKey||$.altKey)return;const W=$.target;W&&(W.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(W.tagName))||x.current&&($.preventDefault(),x.current.focus())};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]);const S=()=>{var U;N(""),n(Mr(kh)),(U=x.current)==null||U.focus()},R=()=>{y.current=0,_()},M=()=>{v.current=!0,R()};u.useEffect(()=>{var $;if(!v.current||d.state==="loading"||g!==null)return;v.current=!1;const U=($=p.current)==null?void 0:$.querySelector("h1");U&&(U.tabIndex=-1,U.focus())},[d,h,g]);const L=U=>`/proj/${encodeURIComponent(e)}/issues${U?`?${U}`:""}`,I=U=>`/proj/${encodeURIComponent(e)}/issues/${encodeURIComponent(U)}?from=issues${o?`&${o}`:""}`,T=a.jsx("div",{role:"status","aria-live":"polite",children:g!==null?a.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[a.jsx(va,{"aria-hidden":"true"}),"Issues are busy. Reading them again…"]}):null}),O=h?a.jsxs(oe,{variant:"destructive",className:"mt-4",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Issues could not be loaded"}),a.jsxs(ie,{children:[a.jsxs("p",{children:[h.message,h.since?` Since ${Mn(h.since)}.`:"",d.state==="ok"?` The list below was read at ${Mn(d.local.read_at)}.`:"",h.message.includes(Ka)?"":` ${Ka}`]}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:M,children:"Retry"})]})]}):null,Y=a.jsx(Kt,{title:"Issues",description:"This repository's local issues: what agents and you reported, where triage placed each, and what fixes it.",actions:d.state==="ok"?a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",Mn(d.local.read_at)]}),a.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:R,children:[a.jsx(xl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]}):null});if(d.state==="engine_missing"||d.state==="view_outdated")return a.jsxs(Wd,{ref:p,children:[Y,d.state==="engine_missing"?a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:EN}),a.jsx(ie,{children:d.refusal.message})]}):a.jsxs(oe,{variant:"warning",className:"mt-6",children:[a.jsx(Dn,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:CN}),a.jsx(ie,{children:TN})]})]});if(d.state==="loading")return a.jsxs(Wd,{ref:p,children:[Y,T,O,!h&&g===null?a.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading issues",children:Array.from({length:6},(U,$)=>a.jsx(ct,{className:$===5?"h-10 w-2/3":"h-10 w-full"},$))}):null]});const{list:E,local:H}=d,C=!h&&g===null&&(d.key!==o||w!==i.search),B=Xg(lc(d.key)),Z=H.scope==="folder",z=H.listed===0&&!c,K=Math.max(0,H.listed-H.facets.owners.reduce((U,$)=>U+$.count,0)),ae=i.collection?((F=H.collections.find(U=>U.collection===i.collection))==null?void 0:F.title)??i.collection:null,Q=new Map;for(const U of E.issues){const $=U.group??"unplaced";Q.set($,[...Q.get($)??[],U])}return a.jsxs(Wd,{ref:p,children:[Y,Z&&H.folder?a.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Issues of the folder ",H.folder,", from its issue store."]}):null,a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(Zi,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:RN}),a.jsx(ie,{children:AN})]}),T,O,z?a.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[a.jsx(cC,{className:"text-muted-foreground size-8","aria-hidden":"true"}),a.jsx("h2",{className:"text-lg font-semibold",children:"No issues yet"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Issues filed in this repository with the issue command appear here."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-3",children:[a.jsx(Tt,{ref:x,type:"search",className:"w-64","aria-label":"Search issues",placeholder:"Search issues",value:w,onChange:U=>N(U.target.value)}),a.jsxs(yt,{value:i.owner??fr,onValueChange:U=>k({owner:U===fr?null:U}),children:[a.jsx(ht,{className:"w-56","aria-label":"Owner",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:fr,children:"All owners"}),a.jsxs(ke,{value:qD,children:["Unowned (",K,")"]}),H.facets.owners.map(U=>a.jsxs(ke,{value:U.key,children:[U.title," (",U.count,")"]},U.key))]})]}),a.jsxs(yt,{value:i.label??fr,onValueChange:U=>k({label:U===fr?null:U}),children:[a.jsx(ht,{className:"w-48","aria-label":"Label",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:fr,children:"All labels"}),H.facets.labels.map(U=>a.jsxs(ke,{value:U.label,children:[U.label," (",U.count,")"]},U.label))]})]})]}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2",children:[a.jsx("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":"Marks",children:a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:qr,"aria-pressed":i.urgent,onClick:()=>k({urgent:!i.urgent}),children:["Urgent ",H.facets.urgent]})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":"Seen on",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Seen on"}),kN.map(U=>{const $=i.seen.includes(U.key);return a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:qr,"aria-pressed":$,onClick:()=>k({seen:$?i.seen.filter(W=>W!==U.key):[...i.seen,U.key]}),children:[U.label," ",H.facets.seen[U.key]]},U.key)}),ae!==null?a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsxs("span",{"data-testid":"issues-collection-chip",className:J(Eu({variant:"outline",size:"sm"}),oR),children:["Collection ",ae]}),a.jsx(q,{type:"button",variant:"ghost",size:"sm-icon","aria-label":"Remove the collection filter",onClick:()=>{var U;k({collection:null}),(U=x.current)==null||U.focus()},children:a.jsx($m,{className:"size-4","aria-hidden":"true"})})]}):null]})]}),a.jsx("div",{role:"status","aria-live":"polite",children:C?a.jsxs("p",{className:"text-muted-foreground mt-3 flex items-center gap-2 text-sm",children:[a.jsx(va,{"aria-hidden":"true"}),"Searching…"]}):c&&E.total>0?a.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:[E.total," of ",H.listed," issues ·"," ",a.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:S,children:"Clear"})]}):null}),a.jsx("div",{"data-testid":"issues-results","aria-busy":C||void 0,className:"shrink-0 transition-opacity aria-busy:opacity-50",children:B&&E.total===0?a.jsxs("p",{className:"mt-6 flex items-center gap-2 text-sm",children:[a.jsx(_u,{className:"text-muted-foreground size-4","aria-hidden":"true"}),"No issues match."," ",a.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:S,children:"Clear"})]}):H.groups.map(U=>a.jsx(YD,{id:`issues-${U.key}`,title:`${U.label} · ${U.count}`,issues:Q.get(U.key)??[],folder:Z,link:$=>a.jsx(l,{className:"text-primary hover:underline",href:r(I($.id)),children:$.title})},U.key))}),!c&&H.collections.length>0?a.jsxs("section",{className:"mt-8","aria-labelledby":"issues-collections-title",children:[a.jsxs("h2",{id:"issues-collections-title",className:"text-lg font-semibold",children:["Collections · ",H.collections.length]}),a.jsx(pt,{className:"mt-2 shrink-0 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Collections",className:"table-fixed",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{className:"w-1/2",children:"Collection"}),a.jsx(X,{className:"w-1/4",children:"Resolved"}),a.jsx(X,{className:"w-1/4",children:"Updated"})]})}),a.jsx(Fe,{children:H.collections.map(U=>a.jsxs(ce,{children:[a.jsxs(P,{children:[a.jsx(l,{className:"text-primary hover:underline",href:r(L(Mr({...kh,collection:U.collection}))),children:U.title}),a.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:U.collection})]}),a.jsxs(P,{children:[U.resolved," of ",U.total," resolved"]}),a.jsx(P,{className:"text-muted-foreground",children:fi(U.updated_at)})]},U.collection))})]})})]}):null]})]})}const Wd=u.forwardRef(function({children:t},n){return a.jsx("div",{ref:n,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:t})});function YD({id:e,title:t,issues:n,folder:s,link:r}){return a.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,"data-testid":"issues-group",children:[a.jsx("h2",{id:`${e}-title`,className:"text-lg font-semibold",children:t}),a.jsx(pt,{className:"mt-2 shrink-0 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:t,className:"table-fixed",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{className:s?"w-[30%]":"w-[36%]",children:"Title"}),a.jsx(X,{className:"w-[10%]",children:"Issue"}),s?a.jsx(X,{className:"w-[12%]",children:"Project"}):null,a.jsx(X,{className:"w-[16%]",children:"Status"}),a.jsx(X,{className:"w-[8%]",children:"Urgent"}),a.jsx(X,{className:s?"w-[14%]":"w-[18%]",children:"Owner"}),a.jsx(X,{className:"w-[12%]",children:"Updated"})]})}),a.jsx(Fe,{children:n.map(l=>{var o;const i=SN(l);return a.jsxs(ce,{"data-testid":"issues-row",children:[a.jsxs(P,{className:"break-words",children:[r(l),(o=l.labels)!=null&&o.length?a.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.labels.map(c=>a.jsx(Re,{variant:"neutral",size:"dense",children:c},c))}):null]}),a.jsx(P,{className:"font-mono text-xs",children:l.id}),s?a.jsx(P,{className:"break-words",children:l.project_id??"Folder"}):null,a.jsx(P,{children:a.jsx(Re,{variant:i.tone,children:i.label})}),a.jsx(P,{children:l.urgent&&l.status!=="resolved"&&l.group!=="resolved"?a.jsx(Re,{variant:"warning",children:"Urgent"}):null}),a.jsx(P,{className:"break-words",children:l.owner_title?l.owner_title:a.jsx("span",{className:"text-muted-foreground",children:"Unowned"})}),a.jsx(P,{className:"text-muted-foreground",children:fi(l.updated_at)})]},l.id)})})]})})]})}function XD(e){var t;return(t=_n().issues)!=null&&t.issueSections?a.jsx(VD,{...e}):a.jsx(vD,{org:e.org,project:e.project,query:e.query})}function FD({update:e,issue:t,open:n,onOpenChange:s,onDone:r,onReload:l}){const[i,o]=u.useState(t.title),[c,d]=u.useState(t.description),[f,h]=u.useState(t.external_reference??""),[m,g]=u.useState(t),[b,y]=u.useState(null),[j,x]=u.useState(!1);u.useEffect(()=>{n&&(o(t.title),d(t.description),h(t.external_reference??""),g(t),y(null))},[n]);const p=N=>{var k;return((k=b==null?void 0:b.personal_data)==null?void 0:k.field)===N?b.message:void 0},v=async N=>{N.preventDefault(),x(!0);const k=await e(m.id,m.revision,{title:i,description:c,external_reference:f.trim()||null});if(x(!1),!k.ok){y(k.refusal);return}r(k.data.issue)},w=async()=>{const N=await l();N&&(g(N),y(null))};return a.jsx(Cs,{open:n,onOpenChange:s,children:a.jsx(Ts,{className:"sm:max-w-2xl",children:a.jsxs("form",{onSubmit:v,className:"grid gap-4",children:[a.jsxs(Es,{children:[a.jsx(As,{children:"Edit issue"}),a.jsx(Ms,{children:"Text is shown exactly as entered."})]}),b!=null&&b.conflict?a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{}),a.jsx(ie,{children:"Someone else saved this issue after you opened it, so nothing was saved. Your text is kept below; reload the latest issue, then save to apply it."})]}):null,a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-edit-title",children:"Title"}),a.jsx(Tt,{id:"maintain-edit-title",value:i,"aria-invalid":!!p("title"),onChange:N=>o(N.target.value)}),p("title")?a.jsx(En,{children:p("title")}):null]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-edit-description",children:"Description"}),a.jsx(Hn,{id:"maintain-edit-description",rows:4,value:c,"aria-invalid":!!p("description"),onChange:N=>d(N.target.value)}),p("description")?a.jsx(En,{children:p("description")}):null]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-edit-reference",children:"External reference"}),a.jsx(Tt,{id:"maintain-edit-reference",value:f,"aria-invalid":!!p("external_reference"),onChange:N=>h(N.target.value)}),p("external_reference")?a.jsx(En,{children:p("external_reference")}):null]}),b&&!b.conflict&&!b.personal_data?a.jsx(En,{children:b.message}):null,a.jsxs(Rs,{children:[a.jsx(q,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),b!=null&&b.conflict?a.jsxs(q,{type:"button",variant:"outline",onClick:w,children:[a.jsx(xl,{className:"mr-2 size-4"}),"Reload latest"]}):null,a.jsx(q,{type:"submit",loading:j,disabled:!!(b!=null&&b.conflict),children:"Save"})]})]})})})}function Fg(e){return e.map(t=>bN[t].toLowerCase()).join(", ")}function KD(e){switch(e.kind){case"created":return"Logged the issue";case"updated":return`Edited the ${Fg(e.fields)}`;case"redacted":return`Redacted the ${Fg(e.fields)}`;case"priority_set":return e.priority?`Set priority to ${Oi[e.priority]}`:"Cleared the priority";case"assigned":return`Assigned to ${e.assignee_id?e.assignee_username??"someone whose name is not available":"a former member"}`;case"unassigned":return"Unassigned the issue";case"transitioned":{if(e.from_status==="resolved"&&e.to_status==="open")return"Reopened the issue";const t=e.to_status?Qc[e.to_status]:"";return e.resolution_reason?`Moved to ${t}: ${_p[e.resolution_reason]}`:`Moved to ${t}`}}}function Kg(e,t){return t==="external_reference"?e.external_reference??"":e[t]}function QD({redact:e,issue:t,open:n,onOpenChange:s,onDone:r,onReload:l}){const[i,o]=u.useState("description"),[c,d]=u.useState(""),[f,h]=u.useState(!1),[m,g]=u.useState(null),[b,y]=u.useState(t);u.useEffect(()=>{n&&(y(t),d(Kg(t,i)),g(null))},[n]);const j=async x=>{x.preventDefault(),h(!0);const p=await e(b.id,b.revision,i,c);if(h(!1),!p.ok){if(p.refusal.conflict){const v=await l();v&&y(v),g("Someone else saved this issue after you opened it. The latest issue is loaded and your replacement is kept; redact again to apply it.");return}g(p.refusal.message);return}r(p.data.issue)};return a.jsx(Cs,{open:n,onOpenChange:s,children:a.jsx(Ts,{className:"sm:max-w-2xl",children:a.jsxs("form",{onSubmit:j,className:"grid gap-4",children:[a.jsxs(Es,{children:[a.jsx(As,{children:"Redact text"}),a.jsx(Ms,{children:"Replace text that holds personal data, such as a name."})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-redact-field",children:"Field"}),a.jsxs(yt,{value:i,onValueChange:x=>{const p=x;o(p),d(Kg(b,p))},children:[a.jsx(ht,{id:"maintain-redact-field",children:a.jsx(bt,{})}),a.jsx(mt,{children:oD.map(x=>a.jsx(ke,{value:x,children:bN[x]},x))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-redact-replacement",children:"Replacement text"}),a.jsx(Hn,{id:"maintain-redact-replacement",rows:4,value:c,onChange:x=>d(x.target.value)})]}),a.jsxs(oe,{variant:"warning",children:[a.jsx(Dn,{}),a.jsx(ie,{children:"This cannot be undone: the original text is removed for good. History records only that this field was redacted."})]}),m?a.jsx(En,{children:m}):null,a.jsxs(Rs,{children:[a.jsx(q,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(q,{type:"submit",variant:"destructive",loading:f,children:"Redact"})]})]})})})}function ZD({transition:e,issue:t,open:n,onOpenChange:s,onDone:r}){const[l,i]=u.useState("fixed"),[o,c]=u.useState(!1),[d,f]=u.useState(null),h=async m=>{m.preventDefault(),c(!0);const g=await e(t.id,t.revision,"resolved",l);if(c(!1),!g.ok){if(g.refusal.conflict){r(null);return}f(g.refusal.message);return}f(null),r(g.data.issue)};return a.jsx(Cs,{open:n,onOpenChange:s,children:a.jsx(Ts,{children:a.jsxs("form",{onSubmit:h,className:"grid gap-4",children:[a.jsxs(Es,{children:[a.jsx(As,{children:"Resolve issue"}),a.jsx(Ms,{children:"Choose how this report ended."})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:"maintain-resolution-reason",children:"Resolution reason *"}),a.jsxs(yt,{value:l,onValueChange:m=>i(m),children:[a.jsx(ht,{id:"maintain-resolution-reason",children:a.jsx(bt,{})}),a.jsx(mt,{children:iD.map(m=>a.jsx(ke,{value:m,children:_p[m]},m))})]}),a.jsx("p",{className:"text-muted-foreground text-xs",children:"Reopening the issue clears its reason."})]}),d?a.jsx(En,{children:d}):null,a.jsxs(Rs,{children:[a.jsx(q,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(q,{type:"submit",loading:o,children:"Resolve"})]})]})})})}const hr="not_set";function WD({org:e,project:t,issue_id:n,query:s}){const r=jN(),l=wN(r),i=_h(e,t);return a.jsx("div",{className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:a.jsx(_N,{access:l,header:a.jsx(Kt,{title:"Support"}),back_href:i,children:o=>r?a.jsx(JD,{contract:r,issue_id:n,access:o,list_href:i,duplicates:Number(new URLSearchParams(s).get("duplicates")??0)}):null})})}function JD({contract:e,issue_id:t,access:n,list_href:s,duplicates:r}){const{href:l,Link:i}=at(),o=ml(),[c,d]=u.useState(null),[f,h]=u.useState([]),[m,g]=u.useState(!1),[b,y]=u.useState([]),[j,x]=u.useState(null),p=u.useCallback(async()=>{const _=await e.issue(t);return _.ok?(d(_.data.issue),h(_.data.events),_.data.issue):(_.refusal.status===404?g(!0):o.error(_.refusal.message),null)},[e,t,o]);u.useEffect(()=>{let _=!1;return e.issue(t).then(S=>{if(!_){if(!S.ok){S.refusal.status===404?g(!0):o.error(S.refusal.message);return}d(S.data.issue),h(S.data.events)}}),()=>{_=!0}},[e,t]),u.useEffect(()=>{n.can_change&&e.assigneeCandidates().then(_=>{_.ok&&y(_.data.candidates)})},[e,n.can_change]);const v=async _=>{const S=await _;if(!S.ok){o.error(S.refusal.message),S.refusal.conflict&&await p();return}await p()};if(m)return a.jsx(nr,{title:"Support issue not found",description:"This issue does not exist in this project.",backHref:l(s),backLabel:"Back to Support",link:i});if(!c)return a.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});const w=c.status==="closed",N=n.can_change,k=_=>v(e.transition(c.id,c.revision,_));return a.jsxs(a.Fragment,{children:[a.jsx(Kt,{title:c.title,actions:N?a.jsxs(a.Fragment,{children:[w?null:a.jsxs(q,{variant:"outline",onClick:()=>x("edit"),children:[a.jsx(Dm,{className:"mr-2 size-4"}),"Edit"]}),a.jsxs(q,{variant:"outline",onClick:()=>x("redact"),children:[a.jsx(Z2,{className:"mr-2 size-4"}),"Redact"]}),c.status==="open"?a.jsx(q,{variant:"outline",disabled:!c.priority,"aria-description":c.priority?void 0:"Set a priority first.",onClick:()=>void k("triaged"),children:"Triage"}):null,c.status==="open"||c.status==="triaged"?a.jsxs(q,{onClick:()=>x("resolve"),children:[a.jsx(Mm,{className:"mr-2 size-4"}),"Resolve"]}):null,c.status==="resolved"?a.jsxs(a.Fragment,{children:[a.jsxs(q,{variant:"outline",onClick:()=>void k("open"),children:[a.jsx($C,{className:"mr-2 size-4"}),"Reopen"]}),a.jsx(q,{onClick:()=>void k("closed"),children:"Close"})]}):null]}):void 0,children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(Re,{variant:yN[c.status],children:Qc[c.status]}),a.jsxs("span",{className:"text-muted-foreground text-xs",children:["Logged by ",dD(c)," ",rc(c.created_at)]})]})}),a.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-6",children:[r>0&&c.external_reference?a.jsxs(oe,{variant:"info",children:[a.jsx(un,{}),a.jsxs(ie,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[a.jsxs("span",{children:[c.external_reference," is already logged on"," ",r===1?"another issue":`${r} other issues`," in this project."]}),a.jsx(q,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(i,{href:l(`${s}?external_reference=${encodeURIComponent(c.external_reference)}`),children:"Show both"})})]})]}):null,a.jsxs("section",{className:"flex flex-col gap-2",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Description"}),c.description?a.jsx("p",{className:"text-sm break-words whitespace-pre-wrap",children:c.description}):a.jsx("p",{className:"text-muted-foreground text-sm",children:"No description."})]}),a.jsxs("section",{className:"flex flex-col gap-2",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"History"}),a.jsx("div",{className:"rounded-md border",children:a.jsxs(Xe,{children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"When"}),a.jsx(X,{children:"Who"}),a.jsx(X,{children:"What"})]})}),a.jsx(Fe,{children:f.map(_=>a.jsxs(ce,{children:[a.jsx(P,{className:"text-muted-foreground",children:rc(_.created_at)}),a.jsx(P,{children:fD(_,c)}),a.jsx(P,{children:KD(_)})]},_.id))})]})})]})]}),a.jsxs("aside",{className:"flex w-full shrink-0 flex-col gap-5 lg:w-72",children:[a.jsx(Hl,{label:"External reference",children:c.external_reference?a.jsx("span",{className:"font-mono text-sm",children:c.external_reference}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"None"})}),c.resolution_reason?a.jsx(Hl,{label:"Resolution",children:a.jsx("span",{className:"text-sm",children:_p[c.resolution_reason]})}):null,a.jsx(Hl,{label:"Priority",id:"maintain-issue-priority",children:a.jsxs(yt,{value:c.priority??hr,disabled:!N||w,onValueChange:_=>void v(e.update(c.id,c.revision,{priority:_===hr?null:_})),children:[a.jsx(ht,{id:"maintain-issue-priority",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:hr,children:"Not set"}),wp.map(_=>a.jsx(ke,{value:_,children:Oi[_]},_))]})]})}),a.jsxs(Hl,{label:"Assignee",id:"maintain-issue-assignee",children:[a.jsxs(yt,{value:c.assignee_id??hr,disabled:!N||w,onValueChange:_=>void v(e.assign(c.id,c.revision,_===hr?null:_)),children:[a.jsx(ht,{id:"maintain-issue-assignee",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:hr,children:"Not set"}),c.assignee_id&&!b.some(_=>_.user_id===c.assignee_id)?a.jsx(ke,{value:c.assignee_id,children:Np(c.assignee_id,c.assignee_username)}):null,b.map(_=>a.jsx(ke,{value:_.user_id,children:_.username??"Not available"},_.user_id))]})]}),c.assignee_can_act===!1?a.jsx(Re,{variant:"error",className:"self-start",children:"Assignee cannot act"}):null]}),a.jsx(Hl,{label:"Updated",children:a.jsx("span",{className:"text-sm",children:rc(c.updated_at)})})]})]}),a.jsx(FD,{update:e.update,issue:c,open:j==="edit",onOpenChange:_=>x(_?"edit":null),onReload:p,onDone:()=>{x(null),p()}}),a.jsx(QD,{redact:e.redact,issue:c,open:j==="redact",onOpenChange:_=>x(_?"redact":null),onReload:p,onDone:()=>{x(null),o.success("The text was redacted."),p()}}),a.jsx(ZD,{transition:e.transition,issue:c,open:j==="resolve",onOpenChange:_=>x(_?"resolve":null),onDone:_=>{x(null),_||o.error("Someone else changed this issue; it is reloaded."),p()}})]})}function Hl({label:e,id:t,children:n}){return a.jsxs("div",{className:"flex flex-col gap-1.5",children:[t?a.jsx("label",{htmlFor:t,className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:e}):a.jsx("span",{className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:e}),n]})}const e3=10,t3=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,n3=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;function s3(e,t,n,s=""){const r=n!=null&&n.startsWith("task:")?n.slice(5):null;if(r&&t3.test(r))return{label:r,path:`/org/${e}/tasks/${r}`};const l=n!=null&&n.startsWith("release:")?n.slice(8):null;if(l&&n3.test(l))return{label:l,path:`/classic/#release=${encodeURIComponent(l)}`};const i=Mr(lc(s));return{label:"Issues",path:`/proj/${encodeURIComponent(t)}/issues${i?`?${i}`:""}`}}const a3=["Fixed in","Being fixed in","The release planned to fix it"];function r3(e){const t=e.filter(n=>n.kind==="release");for(const n of a3){const s=t.find(r=>r.relation===n);if(s)return s}return t[0]??null}function l3({org:e,project:t,issue_id:n,from:s,query:r=""}){var fe;const l=MN(),{href:i,Link:o}=at(),c=s3(e,t,s,r),d=`/proj/${encodeURIComponent(t)}/issues`,f=V=>`${d}/${encodeURIComponent(V)}`,[h,m]=u.useState({state:"loading"}),[g,b]=u.useState(null),[y,j]=u.useState(null),[x,p]=u.useState({state:"loading"}),[v,w]=u.useState({state:"loading"}),N=u.useRef(null),k=u.useRef(null),_=u.useRef(!1),S=u.useRef(0),R=u.useRef(0),M=u.useCallback(async()=>{if(!l.issueSections)return;p({state:"loading"});const V=await l.issueSections(n);p(V.ok?{state:"ok",data:V.data}:{state:"failed",refusal:V.refusal})},[l.issueSections,n]),L=u.useCallback(async()=>{if(!l.issueRelated)return;w({state:"loading"});const V=await l.issueRelated(n);w(V.ok?{state:"ok",data:V.data}:{state:"failed",refusal:V.refusal})},[l.issueRelated,n]),I=u.useCallback(async()=>{const V=R.current+=1;if(j(null),!AD.test(n)){m({state:"missing"});return}M(),L();const ge=await l.issue(n);if(V!==R.current)return;if(ge.ok){S.current=0,b(null),m({state:"ok",issue:ge.data.issue,events:ge.data.events,at:new Date().toISOString()});return}const Ae=ge.refusal.reason;if(ge.refusal.status===404||Ae==="not_found")return m({state:"missing"});if(Ae==="engine_missing")return m({state:"engine_missing",refusal:ge.refusal});if(Ae==="view_outdated")return m({state:"view_outdated"});if(S.current+=1,S.current===1&&gN(ge.refusal)){j(ge.refusal.retry_after??e3);return}b(ge.refusal)},[l.issue,n,M,L]);u.useEffect(()=>{I()},[I]),u.useEffect(()=>{if(y===null)return;const V=setTimeout(()=>void I(),y*1e3);return()=>clearTimeout(V)},[y,I]),u.useEffect(()=>{var ge;if(_.current||h.state!=="ok")return;_.current=!0;const V=(ge=N.current)==null?void 0:ge.querySelector("h1");V&&(V.tabIndex=-1,V.focus())},[h.state]);const T=u.useRef(null);u.useEffect(()=>{var Ae;const V=T.current;if(V===null||(V==="sections"?x:v).state==="loading")return;T.current=null;const ge=(V==="related"?k.current:null)??((Ae=N.current)==null?void 0:Ae.querySelector("h1"));ge==null||ge.focus()},[x,v]);const O=V=>{T.current=V,V==="sections"?M():L()},Y=()=>{S.current=0,I()},E=u.useRef(!1),H=()=>{E.current=!0,Y()};if(u.useEffect(()=>{var ge;if(!E.current||h.state==="loading"||y!==null)return;E.current=!1;const V=(ge=N.current)==null?void 0:ge.querySelector("h1");V&&(V.tabIndex=-1,V.focus())},[h,g,y]),h.state==="missing")return a.jsx(sa,{children:a.jsx(nr,{icon:a.jsx(_u,{"aria-hidden":"true"}),title:"Issue not found",description:`No issue ${n} in this repository's issue store.`,backHref:i(s==="issues"?c.path:d),backLabel:"Back to issues",link:o})});const C=a.jsx(q,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:a.jsxs(o,{href:i(c.path),children:[a.jsx(Rm,{className:"size-4","aria-hidden":"true"}),c.label]})});if(h.state==="engine_missing"||h.state==="view_outdated")return a.jsxs(sa,{children:[a.jsx(Kc,{back:C,id:null,title:n}),h.state==="engine_missing"?a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:EN}),a.jsx(ie,{children:h.refusal.message})]}):a.jsxs(oe,{variant:"warning",className:"mt-4",children:[a.jsx(Dn,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:CN}),a.jsx(ie,{children:TN})]})]});const B=g?a.jsxs(oe,{variant:"destructive",className:"mt-4",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"This issue could not be loaded"}),a.jsxs(ie,{children:[a.jsxs("p",{children:[g.message,g.since?` Since ${Mn(g.since)}.`:"",h.state==="ok"?` This page was read at ${Mn(h.at)}.`:"",g.message.includes(Ka)?"":` ${Ka}`]}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:H,children:"Retry"})]})]}):null,Z=a.jsx("div",{role:"status","aria-live":"polite",children:y!==null?a.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[a.jsx(va,{"aria-hidden":"true"}),"This issue is busy. Reading it again…"]}):null});if(h.state==="loading")return a.jsxs(sa,{children:[a.jsx("div",{children:C}),Z,B,!g&&y===null?a.jsxs("div",{className:"mt-4 grid gap-3",role:"status","aria-label":"Loading issue",children:[a.jsx(ct,{className:"h-6 w-40"}),a.jsx(ct,{className:"h-9 w-2/3"}),a.jsx(ct,{className:"h-24 w-full"})]}):null]});const{issue:z,events:K,at:ae}=h,Q=SN(z),F=x.state==="ok"?x.data:null,U=(F==null?void 0:F.reporter)??z.created_by_username??null,$=v.state==="ok"?r3(v.data):null,W=z.status==="resolved"||z.group==="resolved",me=!!(F!=null&&F.duplicate_of),ve=x.state==="loading"?"Loading…":(F==null?void 0:F.routing.owner)??z.owner_title??a.jsx("span",{className:"text-muted-foreground",children:"Unowned"}),be=V=>`${d}?${Mr({...kh,collection:V})}`,re=F==null?void 0:F.report,ue=!!(re&&(re.actual||re.expected||re.steps.length||re.where)),le=[...K].reverse(),Ye=a.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[a.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",Mn(ae)]}),a.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:Y,children:[a.jsx(xl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return a.jsx(sa,{children:a.jsxs("div",{ref:N,className:"contents",children:[a.jsx(Kc,{back:C,id:z.id,badge:a.jsxs(a.Fragment,{children:[a.jsx(Re,{variant:Q.tone,children:Q.label}),z.urgent&&!W?a.jsx(Re,{variant:"warning",children:"Urgent"}):null]}),title:z.title,created:`Reported${U?` by ${U}`:""} · ${fi(z.created_at)}`,actions:Ye}),F!=null&&F.duplicate_of?a.jsxs("p",{className:"mt-1 text-sm",children:["Duplicate of"," ",a.jsx(o,{className:"text-primary font-mono hover:underline",href:i(f(F.duplicate_of)),children:F.duplicate_of})]}):null,Z,B,x.state==="loading"?a.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",role:"status",children:[a.jsx(va,{"aria-hidden":"true"}),"Loading the issue's sections"]}):null,a.jsxs("dl",{className:"mt-4 mb-0 flex flex-wrap gap-x-12 gap-y-4","data-testid":"issue-facts",children:[a.jsx(Vn,{label:"Owner",value:ve}),me?null:a.jsx(Vn,{label:"Release",value:v.state==="loading"?"Loading…":$?a.jsx("span",{className:J($.label===$.id&&"font-mono"),children:$.label}):a.jsx("span",{className:"text-muted-foreground",children:"No release yet"})}),a.jsx(Vn,{label:"Reported",value:[U,z.created_at?On(z.created_at):null].filter(Boolean).join(" · ")})]}),a.jsxs(oe,{variant:"info",className:"mt-4",children:[a.jsx(Zi,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:RN}),a.jsx(ie,{children:AN})]}),x.state==="failed"?a.jsx("div",{className:"mt-6",children:a.jsx(jp,{what:"this issue's sections",again:"Read the issue again",refusal:x.refusal,on_retry:()=>O("sections")})}):null,F&&ue&&re?a.jsxs(dt,{id:"issue-report",title:"What happens",children:[re.actual?a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:re.actual}):null,re.expected?a.jsxs("div",{className:"mt-3",children:[a.jsx("h3",{className:"text-sm font-semibold",children:"Expected"}),a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:re.expected})]}):null,re.steps.length?a.jsxs("div",{className:"mt-3",children:[a.jsx("h3",{className:"text-sm font-semibold",children:"Steps"}),a.jsx("ol",{className:"list-decimal pl-5 text-sm",children:re.steps.map((V,ge)=>a.jsx("li",{children:V},ge))})]}):null,(fe=re.where)!=null&&fe.env?a.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:["Seen on ",re.where.env,re.where.sha?a.jsxs(a.Fragment,{children:[" ","at ",a.jsx("span",{className:"font-mono",children:re.where.sha})]}):null]}):null]}):null,F&&(F.placement.placed||F.placement.unplaced_why)?a.jsx(dt,{id:"issue-placement",title:"Placement",children:F.placement.placed?a.jsxs("p",{className:"text-sm",children:["Placed in ",F.placement.placed]}):a.jsxs(oe,{variant:"warning",children:[a.jsx(Dn,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:["Not placed yet: ",F.placement.unplaced_why]})]})}):null,F&&(F.routing.route||F.routing.owner||F.routing.none)?a.jsxs(dt,{id:"issue-routing",title:"Routing",children:[F.routing.route?a.jsx("p",{className:"text-sm",children:F.routing.route}):null,F.routing.owner?a.jsxs("p",{className:"text-sm",children:["Owner: ",F.routing.owner]}):a.jsx("p",{className:"text-muted-foreground text-sm",children:"Owner: none yet"})]}):null,F&&(F.labels.length>0||F.collections.length>0)?a.jsxs(dt,{id:"issue-labels",title:"Labels and collections",children:[F.labels.length?a.jsx("div",{className:"flex flex-wrap gap-1",children:F.labels.map(V=>a.jsx(Re,{variant:"neutral",size:"dense",children:V},V))}):null,F.collections.length?a.jsx("ul",{className:"mt-2 grid gap-1 text-sm",children:F.collections.map(V=>a.jsxs("li",{children:[a.jsx(o,{className:"text-primary hover:underline",href:i(be(V.collection)),children:V.title}),V.ref?a.jsxs("span",{className:"text-muted-foreground",children:[" · ",V.ref]}):null,a.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",V.resolved," of ",V.total," resolved"]})]},V.collection))}):null]}):null,F&&F.anchors.length>0?a.jsx(dt,{id:"issue-anchors",title:"Anchors",children:a.jsx(Jd,{label:"Anchors",heads:["Kind","Value","By"],rows:F.anchors.map(V=>[V.kind,a.jsx("span",{className:"font-mono text-xs break-all",children:V.value}),V.by??""])})}):null,F&&F.seen.length>0?a.jsx(dt,{id:"issue-seen",title:"Seen",aside:`${F.seen.length} of ${Math.max(z.occurrences??0,F.seen.length)} sightings`,children:a.jsx(Jd,{label:"Seen",heads:["When","Where","Who","Note"],rows:F.seen.map(V=>[fi(V.at),a.jsxs(a.Fragment,{children:[V.sha?a.jsx("div",{className:"font-mono text-xs",children:V.sha}):null,V.env?a.jsx("div",{className:"text-muted-foreground text-xs",children:V.env}):null]}),V.who??"",V.note??""])})}):null,le.length>0?a.jsx(dt,{id:"issue-history",title:"History",aside:"From the issue store, newest first",children:a.jsx(Jd,{label:"History",heads:["When","Who","What"],rows:le.map(V=>[fi(V.created_at),V.actor_username??"",UD(V.note,V.kind)])})}):null,a.jsx(vN,{id:"issue-related",related:v,heading_ref:k,on_retry:()=>O("related"),fixed:!0,link:V=>{const ge=V.kind==="task"?`/org/${e}/tasks/${encodeURIComponent(V.id)}?from=issue:${z.id}`:V.kind==="issue"?f(V.id):V.kind==="release"?`/classic/#${V.planned?"planned":"release"}=${encodeURIComponent(V.id)}`:null;if(V.kind==="task"&&ge){const Ae=HD(V.label);return a.jsxs("div",{className:"min-w-0",children:[a.jsx(o,{className:"text-primary font-mono text-xs hover:underline",href:i(ge),children:V.id}),Ae&&Ae!==V.id?a.jsx("div",{className:"text-muted-foreground line-clamp-1 text-xs",title:Ae,"data-testid":"related-task-title",children:Ae}):null]})}return ge?a.jsx(o,{className:J("text-primary hover:underline",V.label===V.id&&"font-mono"),href:i(ge),children:V.label}):V.label}})]})})}function Jd({label:e,heads:t,rows:n}){return a.jsx(pt,{className:"overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:e,children:[a.jsx(st,{children:a.jsx(ce,{children:t.map(s=>a.jsx(X,{children:s},s))})}),a.jsx(Fe,{children:n.map((s,r)=>a.jsx(ce,{children:s.map((l,i)=>a.jsx(P,{className:"break-words",children:l},i))},r))})]})})}function i3({org:e,project:t,issue_id:n,from:s,query:r}){var l;return(l=_n().issues)!=null&&l.issueSections?a.jsx(l3,{org:e,project:t,issue_id:n,from:s,query:r}):a.jsx(WD,{org:e,project:t,issue_id:n,query:r})}function Wc(e,t){u.useEffect(()=>{const n=setInterval(()=>{document.visibilityState==="visible"&&e()},t),s=()=>{document.visibilityState==="visible"&&e()};return document.addEventListener("visibilitychange",s),()=>{clearInterval(n),document.removeEventListener("visibilitychange",s)}},[e,t])}const ON={integration:"Integration",deploy:"Deploy",publish:"Publish",accept:"Accept",custom:"Custom"},o3={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},c3={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"},u3={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 d3(e){return u3[e??"in_batch"]}function f3(e){const t=e.turn==="next",n=t?"Next":"Waiting",s=e.batching==="managed"||e.batching==="released"?` · ${e.batching}`:"";return{label:`${n}${s}`,tone:t?"info":"neutral"}}const DN=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function h3(e,t,n,s=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${Tn(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:s&&e.hold?{label:DN(n),tone:"info"}:{label:"Running",tone:"info"}}function Tn(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function mr(e){const t=Math.round(e/60);if(t<60)return`${t} min`;const n=Math.floor(t/60),s=t%60;return s?`${n} h ${s} min`:`${n} h`}function m3(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 p3(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),s=e.teams.length;return s&&n.push(s===1?"1 team":`${s} teams`),n.length?n.join(", "):"Nobody"}}}function x3(e,t){var o,c;const{policy:n,management:s}=e,r=(o=e.layer)==null?void 0:o.kind,l=d=>p3(d,t),i=[["Mode",c3[s.mode]],["Who can join",l(s.joiners)]];return r==="implement"&&i.push(["Managers",l(s.managers)],["Manager lease",mr(s.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 ${mr(n.freeze.max_seconds)}, ${mr(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",s.stall_takers.kind==="none"?"Nobody takes one":`${l(s.stall_takers)} may take one after ${mr(n.stall_seconds)}`])),i.push(["Reorder",l(s.reorderers)]),n.max_turns>1&&i.push(["Turns at once",`Up to ${n.max_turns} independent turns`]),i.push(["Turn lease",mr(n.lease_seconds)],["Time to start",`${mr(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 zN="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",$N="A task you cannot see",g3="A former member",v3="A member";function LN(){const e=_n().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function y3({org:e,open:t,path:n}){var h;const s=LN(),{href:r,Link:l}=at(),i=s.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"?a.jsx(nr,{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}):a.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?a.jsx(j3,{org:e,open:t??null,path:n??`/org/${e}/tasks/queues`}):a.jsxs(a.Fragment,{children:[a.jsx(Kt,{title:"Queues",description:s.description??zN}),o.state==="loading"&&a.jsx(UN,{}),(o.state==="error"||o.state==="off")&&a.jsx(Sh,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Tasks are not on for this organization"}),a.jsxs(ie,{children:["Queues hold turns for tasks, so they show once Tasks are on."," ",a.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks`),children:"Go to Tasks"})]})]})]})})}function UN(){return a.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading queues",children:Array.from({length:3},(e,t)=>a.jsx(ct,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function Sh({refusal:e,on_retry:t}){return(e==null?void 0:e.reason)==="store_locked"?a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"The local stores are busy"}),a.jsxs(ie,{children:[a.jsx("p",{children:e.message}),a.jsx(q,{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"?a.jsxs(oe,{variant:e.reason==="engine_missing"?"info":"destructive",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:e.reason==="engine_missing"?"Queues need the sdlc engine":"The sdlc engine here is too old for this page"}),a.jsx(ie,{children:e.message})]}):a.jsxs(oe,{variant:"destructive",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Queues could not be loaded"}),a.jsxs(ie,{children:[a.jsx("p",{children:"The read did not answer. Try again in a moment."}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}const ef=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function b3(e,t,n,s){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${Tn(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${Tn(e)} · refreshes every ${n}s${s?` · ${s}`:""}`}function j3({org:e,open:t,path:n}){var F;const{listQueues:s,queue:r,members:l,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:h=!1}=LN(),{self_id:m}=wu(),[g,b]=u.useState(null),[y,j]=u.useState(null),[x,p]=u.useState(null),[v,w]=u.useState(null),[N,k]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let U=!0;return l().then($=>{U&&k(W=>$.ok?{state:"answered",members:$.data}:{state:"failed",members:W.members})}),()=>{U=!1}},[l]);const _=u.useMemo(()=>new Map(N.members.map(U=>[U.user_id,U])),[N.members]),S=N.state==="answered"?g3:v3,R=u.useCallback((U,$)=>{var W;return($==null?void 0:$.title)??(h?($==null?void 0:$.id)??U:U===m?"You":((W=_.get(U))==null?void 0:W.label)??S)},[_,S,m,h]),M=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[L,I]=u.useState(null),[T,O]=u.useState(!1),Y=u.useCallback((U,$)=>{M.current[U]={last:$,fresh:!0};const{list:W,detail:me}=M.current;O(W.last==="failed"||me.last==="failed"),W.fresh&&me.fresh&&W.last==="ok"&&me.last==="ok"&&I(Date.now()/1e3)},[]),E=t??((F=g==null?void 0:g.queues[0])==null?void 0:F.id)??null,H=u.useRef(E);u.useEffect(()=>{H.current=E},[E]);const C=u.useRef(0),B=u.useCallback(async()=>{var W;const U=C.current+=1;M.current.list.fresh=!1;const $=await s();if(U===C.current)if($.ok){if(b($.data),j(null),!t){const me=((W=$.data.queues[0])==null?void 0:W.id)??null;me===null?M.current.detail={last:"ok",fresh:!0}:me!==H.current&&(M.current.detail.fresh=!1)}Y("list","ok")}else j($.refusal),Y("list","failed")},[s,t,Y]),Z=u.useRef(0),z=u.useCallback(async()=>{const U=Z.current+=1;if(!E)return;M.current.detail.fresh=!1;const $=await r(E);U===Z.current&&($.ok?(p($.data),w(null),Y("detail","ok")):(w($.refusal),ef($.refusal)&&p(null),Y("detail",ef($.refusal)?"ok":"failed")))},[E,r,Y]);u.useEffect(()=>{B()},[B]),u.useEffect(()=>{p(null),w(null),z()},[z]);const K=u.useCallback(()=>{B(),z()},[B,z]);Wc(K,i);const ae=Math.round(i/1e3),Q=v!==null&&ef(v);return a.jsxs(a.Fragment,{children:[a.jsxs(Kt,{title:"Queues",description:c??zN,children:[a.jsx("p",{className:"text-muted-foreground text-xs",children:b3(L,T,ae,d)}),a.jsx("span",{className:"sr-only",role:"status",children:T?"Not reading":L===null?"Connecting":"Live"})]}),!g&&!y&&a.jsx(UN,{}),!g&&y&&a.jsx(Sh,{refusal:y,on_retry:K}),g&&g.queues.length===0?a.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[a.jsx(Sj,{className:"text-muted-foreground size-8","aria-hidden":"true"}),a.jsx("h2",{className:"text-lg font-semibold",children:"No queues yet"}),a.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."})]}):g?a.jsxs(a.Fragment,{children:[a.jsx(_3,{path:n,queues:g.queues,open_id:E,name:R,held:h}),Q?a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"This queue is no longer available"}),a.jsx(ie,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):x&&x.queue.id===E?a.jsx(N3,{org:e,detail:x,name:R,settings_note:o,subject_label:f,thread_subjects:h}):v?a.jsx(Sh,{refusal:v,on_retry:()=>void z()}):a.jsx(ct,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function Ch({org:e,subject:t,link:n}){const{href:s,Link:r}=at();return!t||t.hidden?a.jsx("span",{className:"text-muted-foreground",children:$N}):t.kind==="task"&&n?a.jsx(r,{className:"text-primary hover:underline",href:s(`/org/${e}/tasks/${t.id}`),children:t.title??t.id}):a.jsx("span",{children:t.title??t.id})}function w3(e,t,n){const s=e.freeze?`frozen until ${Tn(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 ${Tn(e.batch.opened_at)}`,s].filter(Boolean).join(" · "),warn:!1};if(e.turn){const r=e.turn.subject,l=r.hidden?$N: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?DN(e.name,e.turn.note):null,e.turn.fixing_since!==void 0?"Fixing forward":null,s].filter(Boolean);return c&&e.turn.fixing_since===void 0&&!s?{primary:`${i}${l}${o}`,secondary:tf(d.join(" · ")),warn:!1}:{primary:`${i}${l}${o}`,secondary:d.length?tf(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:s?tf(s):null,warn:!!s}}const tf=e=>e.charAt(0).toUpperCase()+e.slice(1);function _3({path:e,queues:t,open_id:n,name:s,held:r}){const{href:l,Link:i}=at();return a.jsx(pt,{className:"mt-4 shrink-0 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Queues",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Queue"}),a.jsx(X,{className:"hidden md:table-cell",children:"Step"}),a.jsx(X,{children:"Running turn"}),a.jsx(X,{className:"hidden text-right md:table-cell",children:"Waiting"})]})}),a.jsx(Fe,{children:t.map(o=>{var m;const c=o.id===n,d=m3(o),f=w3(o,s,r),h=o.waiting-(((m=o.batch)==null?void 0:m.remaining)??0);return a.jsxs(ce,{"data-testid":"queues-row",className:J(c&&"bg-accent"),children:[a.jsxs(P,{children:[a.jsx(i,{className:"text-primary hover:underline",href:l(`${e}?queue=${encodeURIComponent(o.id)}`),"aria-current":c?"page":void 0,children:o.name}),d?a.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null,a.jsxs("div",{className:"text-muted-foreground text-xs md:hidden",children:[h," waiting"]})]}),a.jsx(P,{className:"hidden md:table-cell",children:a.jsx(Re,{variant:"neutral",children:ON[o.policy.step]})}),a.jsxs(P,{children:[a.jsx("div",{className:J(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?a.jsx("div",{className:J("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),a.jsx(P,{className:"hidden text-right md:table-cell",children:h})]},o.id)})})]})})}function Ho({id:e,title:t,side:n,children:s}){return a.jsxs("section",{"aria-labelledby":e,className:"flex flex-col gap-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h3",{id:e,className:"text-sm font-semibold",children:t}),n?a.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]}),s]})}function Qg({org:e,entries:t,landing:n,queue_name:s,subject_label:r,held:l,label:i}){return a.jsx("div",{className:"overflow-x-auto rounded-lg border",children:a.jsxs(Xe,{containerAriaLabel:i,children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:r}),a.jsx(X,{children:"State"})]})}),a.jsx(Fe,{children:t.map(o=>{const c=h3(o,n,s,l);return a.jsxs(ce,{"data-testid":"queues-running",children:[a.jsxs(P,{children:[a.jsx(Ch,{org:e,subject:o.subject,link:!l}),l&&o.hold&&o.note&&!o.subject.hidden?a.jsx("div",{className:"text-muted-foreground text-xs",children:o.note}):null]}),a.jsx(P,{children:a.jsx(Re,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function N3({org:e,detail:t,name:n,settings_note:s,subject_label:r,thread_subjects:l}){var w;const{queue:i,state:o}=t,c=N=>n(N),d=new Map(o.entries.map(N=>[N.ref,N.subject])),f=o.entries.filter(N=>N.turn==="running"),h=o.entries.filter(N=>N.turn!=="running"&&N.batching!=="in_batch"),m=o.batch,g=Math.max(1,f.filter(N=>N.batching!=="in_batch").length),b=m&&i.policy.independent_turns?f.filter(N=>N.batching!=="in_batch"&&N.ref!==m.holder):[],y=o.manager,j=o.freeze,x=((w=i.layer)==null?void 0:w.kind)==="release"?i.layer.stall_hold:void 0,p=x?{who:n(x.by),why:x.reason,until:x.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 a.jsxs(pt,{as:"section","aria-labelledby":"queue-title",className:"mt-6 flex shrink-0 flex-col gap-4 p-4","data-testid":"queues-detail",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{id:"queue-title",className:"text-lg font-semibold",children:i.name}),a.jsx(Re,{variant:"neutral",children:ON[i.policy.step]}),a.jsx(Re,{variant:"neutral",children:o3[i.management.mode]})]}),i.purpose?a.jsx("p",{className:"text-muted-foreground text-sm",children:i.purpose}):null]}),y?a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm","data-testid":"queues-manager",children:[a.jsx(FC,{className:"text-muted-foreground size-4","aria-hidden":"true"}),a.jsx("span",{className:"text-muted-foreground",children:"Manager"}),a.jsx("span",{className:"font-medium",children:n(y.holder,y.holder_subject)}),a.jsxs("span",{className:"text-muted-foreground text-xs",children:["Lease until ",Tn(y.lease_until),y.serving_until!==void 0?" · serving now":""]})]}):null,j?a.jsxs(oe,{variant:"warning",children:[a.jsx(GC,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:["Frozen until ",Tn(j.lease_until)]}),a.jsxs(ie,{children:[n(j.holder,j.holder_subject)," froze this queue at ",Tn(j.since),j.label?`: ${j.label}`:"",". Only ",n(j.holder,j.holder_subject),"'s entries start until it thaws."]})]}):null,p?a.jsxs(oe,{variant:"info",children:[a.jsx(Cj,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:["Stall hold until ",Tn(p.until)]}),a.jsxs(ie,{children:[p.who,p.why?`: ${p.why}`:"",". The first entry is not treated as stalled while it lasts."]})]}):null,v?a.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running, and nothing waits in this queue."}):a.jsxs(a.Fragment,{children:[m?a.jsxs(Ho,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(m.holder,m.holder_subject)} at ${Tn(m.opened_at)}`,children:[a.jsx("div",{className:"overflow-x-auto rounded-lg border",children:a.jsxs(Xe,{containerAriaLabel:"Batch members",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Landing order"}),a.jsx(X,{children:r}),a.jsx(X,{children:"Outcome"})]})}),a.jsx(Fe,{children:m.members.map((N,k)=>{const _=d3(N.outcome);return a.jsxs(ce,{"data-testid":"queues-member",children:[a.jsx(P,{children:k+1}),a.jsx(P,{children:a.jsx(Ch,{org:e,subject:N.subject??d.get(N.ref)??(l?{kind:"thread",id:N.ref}:void 0),link:!l})}),a.jsx(P,{children:a.jsx(Re,{variant:_.tone,children:_.label})})]},N.ref)})})]})}),b.length>0?a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-muted-foreground text-xs font-medium",children:"Also running"}),a.jsx(Qg,{org:e,entries:b,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Turns running beside the batch"})]}):null]}):a.jsx(Ho,{id:"queue-running",title:f.length>1?"Running turns":"Running turn",children:f.length===0?a.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running."}):a.jsx(Qg,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Running turns"})}),a.jsx(Ho,{id:"queue-waiting",title:"Waiting",children:h.length===0?a.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing waits."}):a.jsx("div",{className:"overflow-x-auto rounded-lg border",children:a.jsxs(Xe,{containerAriaLabel:"Waiting entries",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Position"}),a.jsx(X,{children:r}),a.jsx(X,{className:"hidden md:table-cell",children:"Joined"}),a.jsx(X,{children:"Turn"}),a.jsx(X,{className:"hidden md:table-cell",children:"Note"})]})}),a.jsx(Fe,{children:h.map((N,k)=>{const _=f3(N);return a.jsxs(ce,{"data-testid":"queues-waiting",children:[a.jsx(P,{children:m?g+k+1:N.position}),a.jsx(P,{children:a.jsx(Ch,{org:e,subject:N.subject,link:!l})}),a.jsx(P,{className:"hidden md:table-cell",children:Tn(N.joined_at)}),a.jsx(P,{children:a.jsx(Re,{variant:_.tone,children:_.label})}),a.jsx(P,{className:"hidden md:table-cell",children:N.subject.hidden?"":N.note??""})]},N.ref)})})]})})})]}),a.jsx(Ho,{id:"queue-settings",title:"Settings",children:a.jsx("div",{className:"overflow-x-auto rounded-lg border",children:a.jsx(Xe,{containerAriaLabel:"Queue settings",children:a.jsx(Fe,{children:x3(i,c).map(([N,k])=>a.jsxs(ce,{children:[a.jsx(X,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:N}),a.jsx(P,{children:k})]},N))})})})}),a.jsx("p",{className:"text-muted-foreground text-xs",children:s})]})}const xs="__no_parent__";function HN(e,t){const n=new Set([t]);for(let s=!0;s;){s=!1;for(const r of e)r.parent&&n.has(r.parent)&&!n.has(r.key)&&(n.add(r.key),s=!0)}return n}const Th=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function gs({id:e,label:t,help:n,error:s,children:r}){const l=[n?`${e}-help`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Me,{htmlFor:e,children:t}),r(l),n?a.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,s?a.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:s}):null]})}function Zg({id:e,label:t,help:n,checked:s,on_change:r}){return a.jsxs("div",{className:"grid gap-1",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(bl,{id:e,className:"mt-0.5",checked:s,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:l=>r(l===!0)}),a.jsx(Me,{htmlFor:e,className:"font-normal",children:t})]}),n?a.jsx("p",{id:`${e}-help`,className:"text-muted-foreground pl-6 text-xs",children:n}):null]})}function BN({id:e,legend:t,help:n,error:s,options:r,checked:l,on_change:i,empty:o}){const c=[n?`${e}-help`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return a.jsxs("fieldset",{className:"m-0 grid min-w-0 gap-2 border-0 p-0","aria-describedby":c,"aria-invalid":s?!0:void 0,children:[a.jsx("legend",{className:"mb-2 text-sm leading-none font-medium",children:t}),r.length===0&&o?a.jsx("p",{className:"text-muted-foreground text-sm",children:o}):null,a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:r.map((d,f)=>a.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[a.jsx(bl,{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)}}),a.jsx(Me,{htmlFor:`${e}-${f}`,className:"min-w-0 font-normal break-words",children:d.label})]},d.value))}),n?a.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,s?a.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:s}):null]})}function kp({message:e}){return e?a.jsxs(oe,{variant:"destructive",role:"alert",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(ie,{children:e})]}):null}function IN({id:e,value:t,on_change:n,none:s,options:r,described_by:l}){return a.jsxs(yt,{value:t,onValueChange:n,children:[a.jsx(ht,{id:e,"aria-describedby":l,children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:xs,children:s}),r.map(i=>a.jsx(ke,{value:i.key,children:i.label||i.key},i.key))]})]})}function Sp(e){const[t,n]=u.useState(!1),[s,r]=u.useState(null);return{saving:t,refusal:s,set_refusal:r,run:async i=>{n(!0),r(null);try{const o=await i();o?r(o):e()}finally{n(!1)}}}}const qN=e=>`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts and in sdlc org, and cannot change later.`;function k3({open:e,chart:t,team:n,save:s,on_close:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(""),[h,m]=u.useState(xs),[g,b]=u.useState({}),{saving:y,refusal:j,set_refusal:x,run:p}=Sp(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)??xs),b({}),x(null))},[e,n,x]);const v=n?HN(t.teams,n.key):new Set,w=[...t.teams].filter(k=>!v.has(k.key)).sort(Th),N=k=>{if(k.preventDefault(),!n){if(!l.trim()){b({key:"Give the team a key."});return}const R=o.trim()||l.trim();p(()=>s({action:"add",kind:"team",key:l.trim(),...o.trim()?{label:o.trim()}:{},...d.trim()?{description:d.trim()}:{},...h!==xs?{parent:h}:{}},`Team ${R} added.`));return}if(!o.trim()){b({label:"Give the team a label."});return}const _=h===xs?null:h,S={...o.trim()!==n.label.trim()?{label:o.trim()}:{},...d.trim()!==(n.description??"").trim()?{description:d.trim()}:{},..._!==n.parent?{parent:_}:{}};if(Object.keys(S).length===0){r();return}p(()=>s({action:"edit",kind:"team",key:n.key,...S},`Team ${o.trim()} saved.`))};return a.jsx(Cs,{open:e,onOpenChange:k=>k||y?null:r(),children:a.jsx(Ts,{children:a.jsxs("form",{onSubmit:N,noValidate:!0,children:[a.jsxs(Es,{children:[a.jsx(As,{children:n?`Edit team ${n.label||n.key}`:"Add team"}),a.jsx(Ms,{children:n?a.jsxs(a.Fragment,{children:["Its key, ",a.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."})]}),a.jsxs("div",{className:"mt-4 grid gap-4",children:[a.jsx(kp,{message:j}),n?null:a.jsx(gs,{id:"org-team-key",label:"Key",help:qN("team"),error:g.key,children:k=>a.jsx(Tt,{id:"org-team-key",className:"font-mono",value:l,autoComplete:"off","aria-invalid":g.key?!0:void 0,"aria-describedby":k,onChange:_=>{i(_.target.value),b({})}})}),a.jsx(gs,{id:"org-team-label",label:n?"Label":"Label (optional)",help:n?void 0:"Shown on the chart; the key when left empty.",error:g.label,children:k=>a.jsx(Tt,{id:"org-team-label",value:o,"aria-invalid":g.label?!0:void 0,"aria-describedby":k,onChange:_=>{c(_.target.value),b({})}})}),a.jsx(gs,{id:"org-team-description",label:"Description (optional)",children:()=>a.jsx(Hn,{id:"org-team-description",rows:3,placeholder:"What the team does",value:d,onChange:k=>f(k.target.value)})}),a.jsx(gs,{id:"org-team-parent",label:"Parent team",help:"Where the team sits; its posts report up through the team above.",children:k=>a.jsx(IN,{id:"org-team-parent",value:h,on_change:m,none:"No parent (a root team)",options:w,described_by:k})})]}),a.jsxs(Rs,{className:"mt-6",children:[a.jsx(q,{type:"button",variant:"outline",disabled:y,onClick:r,children:"Cancel"}),a.jsx(q,{type:"submit",disabled:y,children:n?y?"Saving…":"Save":y?"Adding…":"Add team"})]})]})})})}const S3=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function C3({open:e,chart:t,job:n,save:s,on_close:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(""),[h,m]=u.useState(xs),[g,b]=u.useState(new Set),[y,j]=u.useState(!1),[x,p]=u.useState(!0),[v,w]=u.useState({}),{saving:N,refusal:k,set_refusal:_,run:S}=Sp(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)??xs),b(new Set((n==null?void 0:n.fills)??[])),j((n==null?void 0:n.requires_person)??!1),p((n==null?void 0:n.escalable)??!0),w({}),_(null))},[e,n,_]);const R=n?HN(t.job_functions,n.key):new Set,M=[...t.job_functions].filter(T=>!R.has(T.key)).sort(Th),L=[...t.slots].sort(Th).map(T=>({value:T.key,label:T.label||T.key})),I=T=>{if(T.preventDefault(),!n){if(!l.trim()){w({key:"Give the job function a key."});return}S(()=>s({action:"add",kind:"job_function",key:l.trim(),...o.trim()?{label:o.trim()}:{},...d.trim()?{description:d.trim()}:{},...h!==xs?{parent:h}:{},fills:[...g],requires_person:y,escalable:x},`Job function ${o.trim()||l.trim()} added.`));return}if(!o.trim()){w({label:"Give the job function a label."});return}const O=h===xs?null:h,Y={...o.trim()!==n.label.trim()?{label:o.trim()}:{},...d.trim()!==(n.description??"").trim()?{description:d.trim()}:{},...O!==n.parent?{parent:O}:{},...S3(n.fills,g)?{}:{fills:[...g]},...y!==n.requires_person?{requires_person:y}:{},...x!==n.escalable?{escalable:x}:{}};if(Object.keys(Y).length===0){r();return}S(()=>s({action:"edit",kind:"job_function",key:n.key,...Y},`Job function ${o.trim()} saved.`))};return a.jsx(Cs,{open:e,onOpenChange:T=>T||N?null:r(),children:a.jsx(Ts,{children:a.jsxs("form",{onSubmit:I,noValidate:!0,children:[a.jsxs(Es,{children:[a.jsx(As,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),a.jsxs(Ms,{children:["Its job description: what it does, the slots it fills and who may hold its posts.",n?a.jsxs(a.Fragment,{children:[" ","Its key, ",a.jsx("span",{className:"font-mono",children:n.key}),", does not change."]}):null]})]}),a.jsxs("div",{className:"mt-4 grid gap-4",children:[a.jsx(kp,{message:k}),n?null:a.jsx(gs,{id:"org-function-key",label:"Key",help:qN("job function"),error:v.key,children:T=>a.jsx(Tt,{id:"org-function-key",className:"font-mono",value:l,autoComplete:"off","aria-invalid":v.key?!0:void 0,"aria-describedby":T,onChange:O=>{i(O.target.value),w({})}})}),a.jsx(gs,{id:"org-function-label",label:n?"Label":"Label (optional)",error:v.label,children:T=>a.jsx(Tt,{id:"org-function-label",value:o,"aria-invalid":v.label?!0:void 0,"aria-describedby":T,onChange:O=>{c(O.target.value),w({})}})}),a.jsx(gs,{id:"org-function-description",label:"Job description (optional)",children:()=>a.jsx(Hn,{id:"org-function-description",rows:3,placeholder:"What this job function does",value:d,onChange:T=>f(T.target.value)})}),a.jsx(gs,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:T=>a.jsx(IN,{id:"org-function-parent",value:h,on_change:m,none:"No parent (a root function)",options:M,described_by:T})}),a.jsx(BN,{id:"org-function-fills",legend:"Slots it fills",options:L,checked:g,on_change:b,empty:"This org has no slots yet; add them with sdlc org add slot."}),a.jsx(Zg,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:y,on_change:j}),a.jsx(Zg,{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:x,on_change:p})]}),a.jsxs(Rs,{className:"mt-6",children:[a.jsx(q,{type:"button",variant:"outline",disabled:N,onClick:r,children:"Cancel"}),a.jsx(q,{type:"submit",disabled:N,children:n?N?"Saving…":"Save":N?"Adding…":"Add job function"})]})]})})})}function T3({open:e,chart:t,binding:n,names:s,save:r,confirm:l,on_close:i}){var S;const[o,c]=u.useState(new Set),[d,f]=u.useState(""),[h,m]=u.useState({}),{saving:g,refusal:b,set_refusal:y,run:j}=Sp(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 x=s.slot(n.slot),p=(S=t.project)!=null&&S.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)),N=[...t.posts].map(R=>R.post).sort(s.byPost).map(R=>({value:R,label:w.has(R.split("/")[1]??"")?`${s.post(R)} (fills ${x})`:s.post(R)})),k=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)&&j(()=>r({action:"bind",slot:n.slot,posts:[...o],reason:d.trim()},`Override of ${x} saved.`))},_=async()=>{await l({title:`Clear the override of ${x}?`,description:"It goes back to the posts its job descriptions name, and its reason is not kept.",action_label:"Clear",destructive:!0})&&j(()=>r({action:"unbind",slot:n.slot},`Override of ${x} cleared.`))};return a.jsx(Cs,{open:e,onOpenChange:R=>R||g?null:i(),children:a.jsx(Ts,{children:a.jsxs("form",{onSubmit:k,noValidate:!0,children:[a.jsxs(Es,{children:[a.jsxs(As,{children:["Override ",x]}),a.jsxs(Ms,{children:["Bind ",x," 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."]})]}),a.jsxs("div",{className:"mt-4 grid gap-4",children:[a.jsx(kp,{message:b}),a.jsx(BN,{id:"org-override-posts",legend:"Posts",help:"A post outside its job description is marked on the chart.",error:h.posts,options:N,checked:o,on_change:R=>{c(R),m(M=>({...M,posts:void 0}))}}),a.jsx(gs,{id:"org-override-reason",label:"Reason",error:h.reason,children:R=>a.jsx(Hn,{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(L=>({...L,reason:void 0}))}})}),a.jsxs("p",{className:"text-muted-foreground text-xs",children:["Made as ",a.jsx("span",{className:"font-mono",children:"person:user"}),", who must hold the lead post of ",v," or of a team above it."]})]}),a.jsxs(Rs,{className:"mt-6",children:[n.source==="override"?a.jsx(q,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:g,onClick:()=>void _(),children:"Clear override"}):null,a.jsx(q,{type:"button",variant:"outline",disabled:g,onClick:i,children:"Cancel"}),a.jsx(q,{type:"submit",disabled:g,children:g?"Saving…":"Save override"})]})]})})})}function GN({label:e,on_edit:t,on_remove:n}){return a.jsxs(Hu,{children:[a.jsx(Bu,{asChild:!0,children:a.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`More actions for ${e}`,children:a.jsx(Om,{className:"size-3.5","aria-hidden":"true"})})}),a.jsxs(lo,{align:"end",children:[a.jsx(Ya,{onSelect:t,children:"Edit"}),a.jsx(Ya,{className:"text-destructive focus:text-destructive",onSelect:n,children:"Remove"})]})]})}function E3({label:e,message:t,on_dismiss:n}){return a.jsxs(oe,{variant:"destructive",role:"alert",className:"mb-3",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsxs(pe,{children:[e," was not removed"]}),a.jsxs(ie,{children:[a.jsx("p",{children:t}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Dismiss"})]})]})}const R3="Who holds each post and who reports to whom in this repository's local org, worked out from its teams, job functions and posts.",A3="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",M3="scripts/agent-coordination/workflow.json",O3=4,Cp=e=>({paddingLeft:16+24*Math.min(e,O3)}),Jc={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function D3(){const e=_n().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function z3(){const e=D3(),[t,n]=u.useState({state:"loading"}),[s,r]=u.useState(null),l=u.useRef(0),i=u.useRef(null),o=u.useCallback(h=>{const m=async g=>{const b=l.current+=1;i.current&&clearTimeout(i.current);const y=await e.chart();if(b!==l.current)return;if(y.ok){r({chart:y.data,at:new Date().toISOString()}),n({state:"read"});return}const{refusal:j}=y;if(j.reason==="no_local_org"){r(null),n({state:"none"});return}if(j.retry&&j.reason==="store_locked"&&g>0){const x=j.retry_after??10;n({state:"busy",retry_after:x}),i.current=setTimeout(()=>void m(g-1),x*1e3);return}n({state:"failed",refusal:j})};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:s,f=L3(e.change,()=>void o(1),(d==null?void 0:d.chart)??$3);return a.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:[a.jsx(Kt,{title:"Org chart",description:R3}),t.state==="busy"&&!d?a.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?a.jsx(U3,{quiet:t.state==="busy"}):null,t.state==="none"?a.jsx(H3,{edit:(f==null?void 0:f.actions)??null}):null,t.state==="failed"?a.jsx(B3,{kept_at:(d==null?void 0:d.at)??null,on_retry:c}):null,d?a.jsx(I3,{chart:d.chart,edit:(f==null?void 0:f.actions)??null}):null,(f==null?void 0:f.dialogs)??null]})}const $3={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function L3(e,t,n){const s=ml(),r=PN(n),{confirm:l,confirm_dialog:i}=yl(),[o,c]=u.useState(null),[d,f]=u.useState({}),h=j=>f(x=>{if(!x[j])return x;const{[j]:p,...v}=x;return v});if(!e)return null;const m=async(j,x)=>{const p=await e(j);return p.ok?("kind"in j&&h(j.kind==="team"?"teams":"functions"),s.success(x),t(),null):p.refusal.message},g=async(j,x,p)=>{if(!await l({title:`Remove ${j==="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 N=j==="team"?"teams":"functions",k=await e({action:"remove",kind:j,key:x});if(!k.ok){f(_=>({..._,[N]:{label:p,message:k.refusal.message}}));return}h(N),s.success(`${j==="team"?"Team":"Job function"} ${p} removed.`),t()},b=()=>c(null),y=(o==null?void 0:o.kind)==="override"&&n.project.team!==null?n.project.slots.find(j=>j.slot===o.slot)??null:null;return{actions:{team:j=>c({kind:"team",team:j}),job:j=>c({kind:"function",job:j}),override:j=>c({kind:"override",slot:j}),remove:(j,x,p)=>void g(j,x,p),refused:j=>{const x=d[j];return x?a.jsx(E3,{label:x.label,message:x.message,on_dismiss:()=>h(j)}):null}},dialogs:a.jsxs(a.Fragment,{children:[a.jsx(k3,{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:b}),a.jsx(C3,{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:b}),a.jsx(T3,{open:y!==null,chart:n,binding:y,names:r,save:m,confirm:l,on_close:b}),i]})}}function U3({quiet:e=!1}){return a.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)=>a.jsx(ct,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function Pr({children:e}){return a.jsx("pre",{className:"bg-muted text-foreground m-0 overflow-x-auto rounded-md border px-3 py-2 font-mono text-sm",children:a.jsx("code",{children:e})})}function H3({edit:e}){return a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"This repository has no local org yet"}),a.jsxs(ie,{children:[a.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."}),a.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[a.jsx(Pr,{children:"sdlc org seed"}),e?null:a.jsx(Pr,{children:"sdlc org add team <key>"})]}),e?a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[a.jsx(sl,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function B3({kept_at:e,on_retry:t}){return a.jsxs(oe,{variant:"destructive",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Could not read the local org"}),a.jsxs(ie,{children:[a.jsxs("p",{children:[e?`The chart read at ${Wn(e)} is kept below. `:"","Details are in the terminal running sdlc viewer."]}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function PN(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])),s=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="",g=""]=h.split("/");return{team:t.get(m)??m,job:n.get(g)??g}},i=h=>{const{team:m,job:g}=l(h);return`${g} · ${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(g=>g.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 g=c.get(h);g&&m<e.teams.length;g=c.get(g))m+=1;return m};return{parts:l,post:i,manager:o,byPost:(h,m)=>{const[g="",b=""]=[h.split("/")[0],m.split("/")[0]],[y,j]=[l(h),l(m)];return d(g)-d(b)||y.team.localeCompare(j.team)||y.job.localeCompare(j.job)},slot:h=>s.get(h)??h,job:h=>n.get(h)??h,team:h=>t.get(h)??h}},[e])}function Aa({id:e,title:t,description:n,actions:s,children:r}){return a.jsxs("section",{"aria-labelledby":e,className:"mt-8 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[a.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[a.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),a.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:n})]}),s?a.jsx("div",{className:"flex shrink-0 gap-2",children:s}):null]}),a.jsx("div",{className:"mt-3",children:r})]})}function Wg({children:e,on_click:t}){return a.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:t,children:[a.jsx(sl,{className:"size-4","aria-hidden":"true"}),e]})}function I3({chart:e,edit:t}){const n=PN(e);return a.jsxs(a.Fragment,{children:[a.jsx(Aa,{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:a.jsx(G3,{chart:e,names:n})}),a.jsx(Aa,{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:a.jsx(Y3,{chart:e,names:n})}),t?a.jsxs(Aa,{id:"org-chart-teams",title:"Teams",description:"Each team under its parent. A post is one of its job functions staffed in it.",actions:a.jsx(Wg,{on_click:()=>t.team(null),children:"Add team"}),children:[t.refused("teams"),a.jsx(q3,{chart:e,edit:t})]}):null,a.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[a.jsxs(Aa,{id:"org-chart-functions",title:"Function tree",description:"Each job function under its parent, with the slots it fills.",actions:t?a.jsx(Wg,{on_click:()=>t.job(null),children:"Add job function"}):void 0,children:[t==null?void 0:t.refused("functions"),a.jsx(X3,{chart:e,names:n,edit:t})]}),a.jsxs(Aa,{id:"org-chart-slots",title:"Slots",description:A3,children:[e.workflow?null:a.jsxs("div",{className:"mb-3",children:[a.jsx("p",{className:"text-muted-foreground text-xs",children:"This checkout has no workflow file, so no slot is marked as a gate:"}),a.jsx("p",{className:"font-mono text-xs",children:M3})]}),a.jsx(K3,{chart:e,names:n})]})]}),a.jsx(Z3,{chart:e,names:n,edit:t})]})}function q3({chart:e,edit:t}){const n=Tp([...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 a.jsx("p",{className:"text-muted-foreground text-sm",children:"No teams yet."});const s=e.project.team,r=(l,i)=>a.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 a.jsxs("li",{children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Cp(i),"data-testid":"org-chart-team",children:[a.jsx("span",{className:"text-sm font-medium",children:d}),a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:o.key}),s===o.key?a.jsx(Re,{variant:"neutral",children:"Owns this project"}):null,a.jsx(GN,{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 a.jsx(pt,{className:"overflow-hidden",children:r(n,0)})}function Tp(e,t,n){const s=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&&s.has(o)&&o!==t(i)?r.get(o).children.push(c):l.push(c)}return l}function G3({chart:e,names:t}){const n=Tp([...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 a.jsx("p",{className:"text-muted-foreground text-sm",children:"No posts yet."});const s=new Map(e.members.map(l=>[`${l.kind}:${l.id}`,l])),r=(l,i)=>a.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 a.jsxs("li",{children:[a.jsxs("div",{className:"border-b py-2 pr-4",style:Cp(i),"data-testid":"org-chart-post",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(O2,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),a.jsx("span",{className:"text-sm font-medium",children:t.parts(o.post).job}),a.jsx("span",{className:"text-muted-foreground text-xs",children:f?`${d} · Reports to a vacant ${t.job(f.vacant)}`:d})]}),a.jsx("div",{className:"mt-1 grid min-w-0 gap-1 pl-6",children:o.holders.length===0?a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(Re,{variant:Jc.vacant.tone,children:Jc.vacant.label}),a.jsx("span",{className:"text-muted-foreground text-xs",children:"No one holds this post."})]}):o.holders.map(h=>a.jsx(P3,{holder:h,post:o.post,member:s.get(`${h.kind}:${h.id}`),names:t},`${h.kind}:${h.id}`))})]}),c.length>0?r(c,i+1):null]},o.post)})});return a.jsx(pt,{className:"overflow-hidden",children:r(n,0)})}function P3({holder:e,post:t,member:n,names:s}){const r=e.kind==="person"?zm:Am,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 ${s.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"),a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[a.jsx(r,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{className:"text-sm font-medium break-all",children:e.id}),a.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}),o?a.jsx("span",{className:"text-xs",children:o}):null]})}const V3=["sdlc org hold <team>/<function> --person <id>","sdlc org hold <team>/<function> --agent <id>"];function Y3({chart:e,names:t}){if(e.members.length===0)return a.jsxs("div",{className:"grid max-w-2xl gap-2",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:"No one holds a post yet. Give a post to a person or an agent:"}),V3.map(s=>a.jsx(Pr,{children:s},s))]});const n=[...e.members].sort((s,r)=>s.kind===r.kind?s.id.localeCompare(r.id):s.kind==="person"?-1:1);return a.jsx(pt,{className:"overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Members",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Member"}),a.jsx(X,{children:"Posts"}),a.jsx(X,{children:"Primary manager"}),a.jsx(X,{children:"Dotted lines"}),a.jsx(X,{children:"Accountable person"})]})}),a.jsx(Fe,{children:n.map(s=>{var i;const r=s.posts.find(o=>o.primary),l=s.posts.filter(o=>o.dotted);return a.jsxs(ce,{"data-testid":"org-chart-member",children:[a.jsxs(P,{children:[a.jsx("div",{className:"font-medium",children:s.id}),a.jsx("div",{className:"text-muted-foreground text-xs",children:s.kind==="person"?"Person":"Agent"})]}),a.jsx(P,{children:s.posts.map(o=>t.post(o.post)).join(", ")}),a.jsx(P,{children:r?t.manager(r.reports_to):"None"}),a.jsx(P,{children:l.length?l.map(o=>t.manager(o.reports_to)).join(", "):"None"}),a.jsx(P,{children:s.kind==="person"?"Not an agent":((i=s.accountable_person)==null?void 0:i.id)??"None"})]},`${s.kind}:${s.id}`)})})]})})}function X3({chart:e,names:t,edit:n}){const s=Tp([...e.job_functions].sort((l,i)=>(l.label||l.key).localeCompare(i.label||i.key)),l=>l.key,l=>l.parent);if(s.length===0)return a.jsx("p",{className:"text-muted-foreground text-sm",children:"No job functions yet."});const r=(l,i)=>a.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})=>a.jsxs("li",{children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Cp(i),"data-testid":"org-chart-function",children:[a.jsx("span",{className:"text-sm font-medium",children:o.label||o.key}),a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:o.fills.length?`Fills ${o.fills.map(t.slot).join(", ")}`:"No slot"}),o.requires_person?a.jsx(Re,{variant:"neutral",children:"Requires a person"}):null,n?a.jsx(GN,{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 a.jsx(pt,{className:"overflow-hidden",children:r(s,0)})}function F3(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(s=>s.id).join(", ")}`).join("; ")}const eu={covered:0,vacant:1,uncovered:2};function VN(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 K3({chart:e,names:t}){const n=VN(e);return a.jsx(pt,{className:"overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Slots",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Slot"}),a.jsx(X,{children:"Status"}),a.jsx(X,{children:"Resolves to"})]})}),a.jsxs(Fe,{children:[[...e.slot_resolution].sort((s,r)=>eu[s.status]-eu[r.status]||t.slot(s.slot).localeCompare(t.slot(r.slot))).map(s=>{const r=Jc[s.status];return a.jsxs(ce,{"data-testid":"org-chart-slot",children:[a.jsxs(P,{children:[a.jsx("div",{className:"font-medium",children:t.slot(s.slot)}),n.has(s.slot)?a.jsx("div",{className:"text-muted-foreground text-xs",children:n.get(s.slot)}):null]}),a.jsx(P,{children:a.jsx(Re,{variant:r.tone,children:r.label})}),a.jsxs(P,{children:[F3(s,t),s.status==="covered"&&s.needs_person?a.jsx("div",{className:"text-muted-foreground text-xs",children:"Needs a person"}):null]})]},s.slot)}),e.slot_resolution.length===0?a.jsx(ce,{children:a.jsx(P,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const Q3="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.",nf=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function Z3({chart:e,names:t,edit:n}){const{project:s}=e;if(s.team===null){const i=s.roots.map(t.team);return a.jsx(Aa,{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:a.jsx("div",{className:"max-w-2xl",children:a.jsx(Pr,{children:i.length?nf[0]:"sdlc org add team <key>"})})})}const r=VN(e),l=[...s.slots].sort((i,o)=>eu[i.status]-eu[o.status]||t.slot(i.slot).localeCompare(t.slot(o.slot)));return a.jsxs(Aa,{id:"org-chart-project",title:"This project",description:Q3,children:[a.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Owning team"}),a.jsx("span",{className:"text-sm font-medium",children:t.team(s.team)})]}),a.jsx(pt,{className:"mt-3 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Slots in this project",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Slot"}),a.jsx(X,{children:"Status"}),a.jsx(X,{children:"Bound to"}),a.jsx(X,{children:"Source"}),n?a.jsx(X,{className:"text-right",children:a.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),a.jsxs(Fe,{children:[l.map(i=>{const o=Jc[i.status];return a.jsxs(ce,{"data-testid":"org-chart-project-slot",children:[a.jsxs(P,{children:[a.jsx("div",{className:"font-medium",children:t.slot(i.slot)}),r.has(i.slot)?a.jsx("div",{className:"text-muted-foreground text-xs",children:r.get(i.slot)}):null]}),a.jsx(P,{children:a.jsx(Re,{variant:o.tone,children:o.label})}),a.jsx(P,{children:a.jsx(W3,{binding:i,names:t})}),a.jsx(P,{children:a.jsx(J3,{binding:i})}),n?a.jsx(P,{className:"text-right",children:a.jsx(q,{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:a.jsx(Dm,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),l.length===0?a.jsx(ce,{children:a.jsx(P,{colSpan:n?5:4,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})}),n?a.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[a.jsxs("p",{className:"text-muted-foreground text-sm",children:["Overrides made here are made as ",a.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."]}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team with sdlc org:"}),a.jsx(Pr,{children:nf[0]})]}):a.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[a.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:"}),nf.map(i=>a.jsx(Pr,{children:i},i))]})]})}function W3({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 s;return e.posts.length===0?s=e.source==="override"?"The override names no post the org still has":"No job function fills this slot":e.status==="vacant"?s=`${e.posts.map(r=>t.post(r.post)).join(", ")} has no holder`:s=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("; "),a.jsxs(a.Fragment,{children:[s,n.map(r=>a.jsx("div",{className:"text-muted-foreground text-xs",children:r},r))]})}function J3({binding:e}){var s;if(e.source==="baseline")return a.jsx(a.Fragment,{children:"From job descriptions"});const t=(s=e.set_by)==null?void 0:s.split(":").slice(1).join(":"),n=[e.reason,[t,e.set_at?On(e.set_at):null].filter(Boolean).join(", ")].filter(Boolean).join(" · ");return a.jsxs(a.Fragment,{children:["Override",n?a.jsx("div",{className:"text-muted-foreground text-xs",children:n}):null]})}const Jg=["tasks","issues","releases"],YN=u.createContext(null);function kn(){const e=u.useContext(YN);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}const ez=10,tz=()=>new Date;function nz({shell:e,now:t=tz,children:n}){const[s,r]=u.useState(null),[l,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=u.useState(null),[g,b]=u.useState(!0),[y,j]=u.useState(!1),[x,p]=u.useState(void 0),[v,w]=u.useState(!1),[N,k]=u.useState(Jg),_=u.useRef(!1),S=u.useRef(!1),R=u.useRef(null),M=u.useRef(!0),L=u.useCallback(async(T=!1)=>{R.current&&clearTimeout(R.current),R.current=null,j(!0);const[O,Y]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!M.current)return;if(j(!1),b(!1),O.ok&&Y.ok){if(_.current=!0,S.current=!1,m(null),f(t()),O.data.organizations.length===0){c("not_in_git"),r(null),i(null);return}c(null),r(O.data.organizations[0]),i(Y.data.projects);return}const E=O.ok?Y.ok?null:Y.refusal:O.refusal;if(!E)return;if(TD(E)){S.current=!1,m(null),c(E),r(null),i(null);return}const H=_.current&&!S.current&&!T;S.current=!0;const C=E.retry_after??ez;m({refusal:E,shown:!H,retryInSeconds:H?C:null}),H&&(R.current=setTimeout(()=>void L(!0),C*1e3))},[e,t]);u.useEffect(()=>(M.current=!0,L(),e.about.about().then(T=>{M.current&&(T.ok?p(T.data):T.refusal.status===404?p(null):w(!0))}),Promise.all(Jg.map(async T=>{var O;return[T,await((O=e[T])==null?void 0:O.access())]})).then(T=>{M.current&&k(T.filter(([,O])=>!(O!=null&&O.ok&&!O.data.can_view)).map(([O])=>O))}),()=>{M.current=!1,R.current&&clearTimeout(R.current)}),[e,L]);const I={loading:g,org:s,projects:l,none:o,readAt:d,failure:h,about:x,aboutFailed:v,domains:N,reading:y,refresh:()=>void L()};return a.jsx(YN.Provider,{value:I,children:n})}const sz={threads:"Threads",chat:"Chat",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},az={tasks:"Tasks",issues:"Issues",releases:"Releases"};function ic(e,t){return e.kind==="home"?"Home":e.kind==="org"?sz[e.page]:e.kind==="project"?e.page?az[e.page]:t??e.project:"Not found"}const rz="(max-width: 767px)";function lz(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(rz):null,[t,n]=u.useState((e==null?void 0:e.matches)??!1);return u.useEffect(()=>{if(!e)return;const s=()=>n(e.matches);return e.addEventListener("change",s),()=>e.removeEventListener("change",s)},[e]),t}function Bo({className:e=""}){return a.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function ev({label:e,children:t}){return a.jsxs("span",{role:"status",className:"flex flex-col gap-1",children:[a.jsx("span",{className:"sr-only",children:e}),t]})}function tv({item:e,collapsed:t}){const{Link:n}=at(),s=e.icon,r=e.title??(t?e.label:void 0),l=a.jsx("span",{className:"block",children:a.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:[a.jsx(s,{className:"size-4 shrink-0","aria-hidden":"true"}),!t&&a.jsx("span",{className:"truncate",children:e.label})]})});return a.jsx("li",{children:r?a.jsxs(vO,{children:[a.jsx(yO,{asChild:!0,children:l}),a.jsx(lN,{side:"right",children:r})]}):l})}const nv="m-0 flex list-none flex-col gap-1 p-0";function sv({label:e,collapsed:t,children:n}){return a.jsxs("div",{className:"flex flex-col gap-1 p-2",role:"group","aria-label":e,children:[!t&&a.jsx("p",{className:"m-0 px-2 text-xs font-medium text-sidebar-foreground/70",children:e}),n]})}function av({page:e,collapsed:t,sheet:n=!1,hasChat:s}){var T;const{href:r}=at(),{worktrees:l}=_n(),i=kn(),{org:o,projects:c,loading:d,none:f,about:h,aboutFailed:m,domains:g}=i,b=o?`/org/${o.slug}`:"",y=c==null?void 0:c.find(O=>O.current),j=((T=o==null?void 0:o.source)==null?void 0:T.kind)==="folder"&&y!==void 0,x=O=>j&&y?`${O} · ${y.name}`:O,p=x("Workspaces"),v=x("Tasks"),w=x("Queues"),N=O=>j?O:void 0,k=[{label:"Home",href:r(b||"/"),icon:iC,current:e.kind==="home"},{label:"Threads",href:r(`${b}/threads`),icon:NC,current:e.kind==="org"&&e.page==="threads"},...s?[{label:"Chat",href:r(`${b}/chat`),icon:wC,current:e.kind==="org"&&e.page==="chat"}]:[],...g.includes("tasks")?[{label:v,title:N(v),href:r(`${b}/tasks`),icon:kj,current:e.kind==="org"&&e.page==="tasks"}]:[],{label:w,title:N(w),href:r(`${b}/queues`),icon:Sj,current:e.kind==="org"&&e.page==="queues"},...l?[{label:"Worktrees",href:r(`${b}/worktrees`),icon:Nj,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:p,title:N(p),href:r(`${b}/workspaces`),icon:sC,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:r(`${b}/chart`),icon:TC,current:e.kind==="org"&&e.page==="chart"}],_=d?null:f?"No organization":(o==null?void 0:o.name)??"Organization",S=o?SD(o):null,R=h==null?void 0:h.version,M=R?t?R:`sdlc ${R}`:m?Zc:Xu,L=m||(h==null?void 0:h.sync.state)==="unknown"?_D:h===void 0?wD:jD;let I;return d?I=a.jsx("div",{className:"px-2 py-1",children:a.jsxs(ev,{label:"Loading projects",children:[a.jsx(Bo,{className:"h-4 w-32"}),a.jsx(Bo,{className:"h-4 w-24"})]})}):c?I=a.jsx("ul",{className:nv,children:c.map(O=>a.jsx(tv,{collapsed:t,item:{label:O.name,title:O.name,href:r(`/proj/${encodeURIComponent(O.id)}`),icon:tC,current:e.kind==="project"&&e.project===O.id}},O.id))}):I=a.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:f?"No projects":Zc}),a.jsxs("div",{className:"flex h-full flex-col bg-sidebar text-sidebar-foreground",children:[a.jsxs("div",{className:`flex items-center gap-2 p-2 ${n?"pr-11":""}`,role:"group","aria-label":"Current organization",children:[a.jsx("div",{className:"flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:a.jsx(z2,{className:"size-4","aria-hidden":"true"})}),!t&&a.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:_===null?a.jsxs(ev,{label:"Loading organization",children:[a.jsx(Bo,{className:"h-4 w-28"}),a.jsx(Bo,{className:"h-3 w-24"})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"truncate font-semibold",title:_,children:_}),S&&a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:S})]})})]}),a.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[a.jsx(sv,{label:"Organization",collapsed:t,children:a.jsx("ul",{className:nv,children:k.map(O=>a.jsx(tv,{item:O,collapsed:t},O.label))})}),!t&&a.jsx(sv,{label:"Projects",collapsed:t,children:I})]}),h!==null&&a.jsxs("div",{className:"flex flex-col gap-1 border-t border-sidebar-border p-2 text-xs text-sidebar-foreground/70",children:[a.jsx("p",{className:"m-0 truncate px-2",title:R?`sdlc ${R}`:void 0,children:M}),!t&&a.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[a.jsx(rC,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:L})]})]})]})}const iz="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function oz({page:e}){var c;const{href:t,Link:n}=at(),{org:s,projects:r,loading:l,none:i}=kn(),o=[];if(l)o.push({label:Xu});else if(i)o.push({label:"No organization"});else{const d=(s==null?void 0:s.name)??"Organization";if(o.push({label:d,href:e.kind==="home"?void 0:t(s?`/org/${s.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})}if(e.kind==="org"&&e.item!==void 0)o.push({label:ic(e),href:s?t(`/org/${s.slug}/${e.page}`):void 0}),o.push({label:e.item});else if(e.kind==="project"&&e.page&&e.item!==void 0){const f=`/proj/${encodeURIComponent(e.project)}/${e.page}${e.list_query?`?${e.list_query}`:""}`;o.push({label:ic(e),href:t(f)}),o.push({label:e.item})}else e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:ic(e)})}return a.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0",children:a.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)=>a.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[f>0&&a.jsx(wj,{className:"size-3.5 shrink-0","aria-hidden":"true"}),d.href?a.jsx(n,{href:d.href,className:`truncate text-muted-foreground no-underline hover:text-foreground ${iz}`,children:d.label}):a.jsx("span",{className:"truncate font-normal text-foreground","aria-current":f===o.length-1?"page":void 0,children:d.label})]},`${f}-${d.label}`))})})}function cz({page:e,chat:t=!1,children:n}){var p;const s=lz(),[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:g}=kn(),b=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?Xu:g?"No organization":(f==null?void 0:f.name)??"Organization",w=(e.kind==="org"||e.kind==="project")&&e.item!==void 0?`${e.item} · `:"";document.title=`${w}${ic(e,b)} · ${v} · sdlc viewer`},[e,b,f,m,g]);const y=()=>{var v;o(!1),(v=c.current)==null||v.focus()};u.useEffect(()=>{s||o(!1)},[s]);const j=s&&i;u.useEffect(()=>{var N;const v=d.current;if(!j||!v)return;(N=v.querySelector("a, button"))==null||N.focus();const w=k=>{var L;if(k.key==="Escape"){o(!1),(L=c.current)==null||L.focus();return}if(k.key!=="Tab")return;const _=[...v.querySelectorAll("a[href], button:not([disabled])")];if(_.length===0)return;const S=_[0],R=_[_.length-1],M=v.contains(document.activeElement);k.shiftKey&&(document.activeElement===S||!M)?(k.preventDefault(),R.focus()):!k.shiftKey&&(document.activeElement===R||!M)&&(k.preventDefault(),S.focus())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[j]);const x=!s&&!r;return a.jsx(gO,{children:a.jsxs("div",{className:"flex h-svh min-h-0 overflow-hidden bg-background text-foreground",children:[!s&&a.jsx("aside",{"aria-label":"Sidebar",className:`shrink-0 border-r border-sidebar-border transition-[width] ${x?"w-12":"w-64"}`,children:a.jsx(av,{page:e,collapsed:x,hasChat:t})}),j&&a.jsxs("div",{className:"fixed inset-0 z-50 flex",children:[a.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:[a.jsx(av,{page:e,collapsed:!1,sheet:!0,hasChat:t}),a.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:a.jsx($m,{className:"size-4","aria-hidden":"true"})})]}),a.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"flex-1 border-0 bg-black/80 outline-hidden",onClick:y})]}),a.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:[a.jsxs("header",{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 transition-[height] ${x?"h-12":"h-16"}`,children:[a.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":s?i:r,onClick:()=>s?o(v=>!v):l(v=>!v),children:a.jsx(RC,{className:"size-4","aria-hidden":"true"})}),a.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),a.jsx(oz,{page:e})]}),a.jsx("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto",children:n})]})]})})}const XN={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",Rp="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",Ap=`rounded-sm font-medium text-primary no-underline hover:underline ${Rp}`;function sf({children:e}){return a.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:a.jsx("code",{children:e})})}function uz({why:e}){return e.kind==="not_in_git"?a.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[a.jsx("p",{className:"m-0 text-sm",children:"This directory is not a Git repository. Start sdlc viewer inside one:"}),a.jsx(sf,{children:"sdlc viewer"})]}):e.kind==="unlisted"?a.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[a.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.`}),a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To rejoin, leave the folder here:"}),a.jsx(sf,{children:"sdlc-agents folder leave"}),a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`then add it back from the folder's home repository, ${e.home}:`}),a.jsx(sf,{children:`sdlc-agents folder add ${e.member_path} --name ${e.repository}`}),a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To work in this repository alone, leaving is enough."})]}):a.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[a.jsx("p",{className:"m-0 text-sm",children:e.cause}),e.kind==="moved_member"&&a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"Move this repository back to where the folder records it."}),a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:e.kind==="other"&&!e.fix?Ka:kD})]})}const rv=`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 ${Rp}`;function dz(){return a.jsxs("div",{role:"status",className:"flex flex-col gap-2",children:[a.jsx("span",{className:"sr-only",children:"Loading projects"}),[0,1,2].map(e=>a.jsx("span",{"aria-hidden":"true",className:"block h-9 animate-pulse rounded-md bg-muted"},e))]})}function co(){const{href:e,Link:t}=at(),{loading:n,projects:s,none:r,failure:l,readAt:i,refresh:o,reading:c}=kn(),[d,f]=u.useState(""),h=a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("h1",{className:Ep,children:"Projects"}),!r&&a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:ND})]});if(r)return a.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,a.jsx(uz,{why:r==="not_in_git"?{kind:"not_in_git"}:RD(r)})]});const m=l!=null&&l.shown?l:null,g=(s??[]).filter(b=>b.name.toLowerCase().includes(d.trim().toLowerCase()));return a.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,m&&a.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-4",children:[a.jsx("p",{className:"m-0 text-sm font-medium text-destructive",children:"The projects could not be refreshed"}),a.jsx("p",{className:"m-0 text-sm",children:NN(m.refusal,i)}),a.jsx("div",{children:a.jsx("button",{type:"button",className:rv,onClick:o,disabled:c,children:"Retry"})})]}),(s||n)&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"search","aria-label":"Filter projects",placeholder:"Filter projects",value:d,onChange:b=>f(b.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 ${Rp}`}),!m&&a.jsx("button",{type:"button",className:`${rv} ml-auto`,onClick:o,disabled:c||n,children:"Refresh"})]}),l&&!l.shown&&i&&a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`Showing the list read at ${Fl(i)}; reading again in ${l.retryInSeconds??10} seconds.`})]}),n?a.jsx(dz,{}):s&&a.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:a.jsxs("table",{className:"w-full border-collapse text-sm",children:[a.jsx("thead",{className:"border-b border-border text-left text-muted-foreground",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Name"}),a.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Location"}),a.jsx("th",{scope:"col",className:"h-10 px-3",children:a.jsx("span",{className:"sr-only",children:"Where this viewer runs"})})]})}),a.jsxs("tbody",{children:[g.map(b=>a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-3 py-2",children:a.jsx(t,{href:e(`/proj/${encodeURIComponent(b.id)}`),className:Ap,children:b.name})}),a.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:b.location??Zc}),a.jsx("td",{className:"px-3 py-2 text-right",children:b.current&&a.jsx("span",{className:"inline-flex items-center rounded-md border border-border px-2 py-0.5 text-xs font-medium",children:"This repository"})})]},b.id)),g.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-3 py-6 text-center text-muted-foreground",children:"No projects found."})})]})]})})]})}function FN({title:e,children:t}){const{href:n,Link:s}=at();return a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"flex max-w-xl flex-col gap-2 rounded-xl border border-border bg-card p-6 text-card-foreground",children:[a.jsx("h1",{className:Ep,children:e}),a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:t}),a.jsx("div",{children:a.jsx(s,{href:n("/"),className:`text-sm ${Ap}`,children:"Back to the organization's Home"})})]})})}const fz={tasks:"Tasks",issues:"Issues",releases:"Releases"};function tu({project:e}){const{href:t,Link:n}=at(),{org:s,projects:r,loading:l,domains:i}=kn(),o=r==null?void 0:r.find(c=>c.id===e);return l?a.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:Xu}):r?o?a.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("h1",{className:Ep,children:o.name}),a.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??Zc})]}),o.current?i.length>0?a.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0 text-sm",children:i.map(c=>a.jsx("li",{children:a.jsx(n,{href:t(c==="tasks"?`${s?`/org/${s.slug}`:""}/tasks`:`/proj/${encodeURIComponent(o.id)}/${c}`),className:Ap,children:fz[c]})},c))}):a.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."}):a.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.`})]}):a.jsx(FN,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):a.jsx(co,{})}const Mp=e=>e instanceof Error?e.message:String(e);async function Op(){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:Mp(e)}}}async function hz(){var e;try{const t=await fetch("api/release-links?threads",{cache:"no-store"});if(!t.ok)return null;const n=await t.json(),s=(e=n==null?void 0:n.panel)==null?void 0:e.threads;if(!s||typeof s!="object"||Array.isArray(s))return null;const r={};for(const[l,i]of Object.entries(s)){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 mz(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function pz(){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 xz(){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:Mp(e)}}}async function gz(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 Mp(n)}}const vz={probe:{source:async()=>{const e=await Op();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},Dp={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...s})=>a.jsx("a",{href:e,className:t,...s,children:n})},yz={label:"Local viewer",can:()=>!1};function bz(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),a.jsx("div",{className:"app-ui dark",children:a.jsx(bj,{data:vz,router:Dp,identity:yz,children:a.jsx(g2,{})})})}const jz="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.",wz=3e4,_z="Reading the workspaces. On a plan workspace this can take a few minutes.",Nz="The read failed. Details are in the terminal running sdlc viewer.",kz={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"}},Sz=e=>kz[e]??{label:e,tone:"neutral"},aa=e=>e.slice(0,8),KN={human:"Human",ai:"AI"},Eh=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function Cz(){const e=_n().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function Tz(e){const t=Cz(),[n,s]=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 j=(async()=>{const x=await t.overview();x.ok?(s(x.data),l(null),o(!1)):(l(x.refusal),o(!0))})().finally(()=>{f.current=null});return f.current=j,j},[t]);u.useEffect(()=>{h()},[h]),Wc(()=>void h(),wz),u.useEffect(()=>{var j;d.current&&(n||r)&&(d.current=!1,(j=c.current)==null||j.focus())},[n,r]);const m=()=>{d.current=!0,h()},g=n===null&&r===null,b=n===null&&r!==null,y=n?Ez(n,i):null;return a.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:[a.jsx(Kt,{title:"Workspaces",description:jz,actions:a.jsxs(a.Fragment,{children:[y?a.jsx("p",{className:"text-muted-foreground text-xs",children:y}):null,a.jsxs(q,{type:"button",variant:"outline",size:"sm","aria-disabled":g||void 0,"aria-describedby":g?"workspaces-reading":void 0,className:"gap-2",onClick:g?void 0:()=>void h(),children:[a.jsx(xl,{className:"size-4","aria-hidden":"true"}),"Read again"]}),g?a.jsx("span",{id:"workspaces-reading",className:"sr-only",children:"Reading…"}):null,a.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n?QN(n,i):""})]})}),a.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[g?a.jsx(Rz,{}):null,b&&r?a.jsx(Az,{refusal:r,on_retry:m}):null,n?a.jsx(Mz,{overview:n}):null]})]})}function QN(e,t){var n,s;return t||((n=e.stale)==null?void 0:n.reason)==="failed"?"a newer read failed":((s=e.stale)==null?void 0:s.reason)==="running"?"a newer read is still running":""}function Ez(e,t){const n=`Read at ${Wn(new Date(e.read_at).toISOString())}`,s=QN(e,t);return s?`${n} · ${s}`:n}function Rz(){return a.jsxs("div",{className:"mt-6",children:[a.jsx("div",{className:"grid gap-2",role:"status","aria-label":"Loading workspaces",children:Array.from({length:6},(e,t)=>a.jsx(ct,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))}),a.jsx("p",{className:"text-muted-foreground mt-3 text-sm","aria-live":"polite",children:_z})]})}function Az({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?NN(e,null):Nz;return a.jsxs(oe,{variant:"destructive",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Could not read workspaces"}),a.jsxs(ie,{children:[a.jsx("p",{children:n}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function Mz({overview:e}){const{counts:t}=e,n=[Eh(t.workspaces,"workspace"),`${t.active} active`,`${t.queued} queued`,`${t.blocked} blocked`].join(" · ");return a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status","aria-live":"polite",children:n}),a.jsxs("div",{className:"mt-4 grid gap-4 lg:grid-cols-[1.4fr_1fr]",children:[a.jsx(Io,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:a.jsx(Oz,{rows:e.workspaces})}),a.jsx(Io,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:a.jsx(Dz,{authority:e.authority})})]}),a.jsx(Io,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?a.jsx(lv,{children:"No integration or reconciliation attempts yet."}):a.jsx($z,{rows:e.activity})}),a.jsx(Io,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?a.jsx(lv,{children:"No Handoffs prepared yet."}):a.jsx(Lz,{rows:e.handoffs})})]})}function Io({id:e,title:t,caption:n,className:s,children:r}){return a.jsxs("section",{"aria-labelledby":e,className:J("min-w-0",s),children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-baseline gap-x-2",children:[a.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),n?a.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),r]})}const lv=({children:e})=>a.jsx("p",{className:"text-muted-foreground text-sm",children:e}),nu=({children:e,tone:t})=>a.jsx("div",{className:J("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function Di({status:e}){const t=Sz(e);return a.jsx(Re,{variant:t.tone,children:t.label})}function Fu({label:e,children:t}){return a.jsx(pt,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function Oz({rows:e}){return a.jsx(Fu,{label:"Workspaces",children:a.jsxs(Xe,{containerClassName:"overflow-visible",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Workspace"}),a.jsx(X,{children:"Actor"}),a.jsx(X,{children:"Forked from"}),a.jsx(X,{children:"Status"}),a.jsx(X,{children:"Projection"})]})}),a.jsx(Fe,{children:e.map(t=>a.jsxs(ce,{"data-testid":"workspaces-row",children:[a.jsxs(P,{children:[a.jsx("div",{className:"font-mono font-medium",children:t.short_id}),a.jsx(nu,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&a.jsx(nu,{children:t.projection_error})]}),a.jsx(P,{children:KN[t.actor]}),a.jsx(P,{children:t.source_id?a.jsx("span",{className:"font-mono",children:aa(t.source_id)}):a.jsx("span",{className:"text-muted-foreground",children:"No source"})}),a.jsx(P,{children:a.jsx(Di,{status:t.status})}),a.jsx(P,{children:a.jsx(Di,{status:t.projection})})]},t.id))})]})})}function Dz({authority:e}){const t=e.resolver,n=[["Workspace",a.jsx("span",{className:"font-mono",children:aa(e.workspace_id)},"id")],["Actor",KN[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"}`:a.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"?a.jsx("span",{className:"text-muted-foreground",children:"Not configured"},"resolver"):a.jsx(Di,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),a.jsx(Fu,{label:"Authority and resolver",children:a.jsx(Xe,{containerClassName:"overflow-visible",children:a.jsx(Fe,{children:n.map(([s,r])=>a.jsxs(ce,{children:[a.jsx(X,{scope:"row",className:"text-muted-foreground font-normal",children:s}),a.jsx(P,{children:r})]},s))})})})}function zz(e){const t=[e.merge_attempts?Eh(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?Eh(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 a.jsx("span",{className:"text-muted-foreground",children:n})}function $z({rows:e}){return a.jsx(Fu,{label:"Integration activity",children:a.jsxs(Xe,{containerClassName:"overflow-visible",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"Change"}),a.jsx(X,{children:"Status"}),a.jsx(X,{children:"Attempts"}),a.jsx(X,{children:"Updated"})]})}),a.jsx(Fe,{children:e.map((t,n)=>a.jsxs(ce,{children:[a.jsxs(P,{children:[a.jsx("div",{className:"font-medium",children:t.kind==="integration"?`Integrate ${aa(t.child_id)} into ${aa(t.other_id)}`:`Reconcile ${aa(t.child_id)} from ${aa(t.other_id)}`}),a.jsx(nu,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),a.jsx(P,{children:a.jsx(Di,{status:t.status})}),a.jsx(P,{children:zz(t)}),a.jsx(P,{children:cN(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function Lz({rows:e}){return a.jsx(Fu,{label:"Handoffs",children:a.jsxs(Xe,{containerClassName:"overflow-visible",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{children:"From"}),a.jsx(X,{children:"To"}),a.jsx(X,{children:"Status"}),a.jsx(X,{children:"Pinned"})]})}),a.jsx(Fe,{children:e.map(t=>a.jsxs(ce,{children:[a.jsxs(P,{children:[a.jsx("div",{className:"font-mono font-medium",children:aa(t.child_id)}),t.error?a.jsx(nu,{children:t.error}):null]}),a.jsx(P,{className:"font-mono",children:aa(t.source_id)}),a.jsx(P,{children:a.jsx(Di,{status:t.status})}),a.jsx(P,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const iv="This machine's worktrees of this repository.",Uz="Merge sends one whose thread is at rest to the main queue.",Hz=3e4,Bz=3e3,Iz=6e5,af=[{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"}],Bl={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"}},qz="no thread to land it",zp="its thread waits on you",ZN="its thread is done",WN="its thread is retired",$p=e=>e.archivable&&e.cleanup==="user",Gz=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",Pz=e=>!e.merge.offered&&(e.merge.why===ZN||e.merge.why.startsWith(WN)),Lp=e=>!e.merge.offered&&e.merge.why===qz||Pz(e),rf=(e,t)=>t==="all"?!0:t==="decide"?$p(e):(e.landed!==null?"landed":Gz(e)?"queued":Lp(e)?"orphan":"needs")===t,Vz=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!Lp(e);function oc(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 JN(e){const t=e%100,n=t>=11&&t<=13?"th":{1:"st",2:"nd",3:"rd"}[e%10]??"th";return`${e}${n}`}function Yz(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 lf=e=>Wn(new Date(e*1e3).toISOString()),Kl=e=>e.charAt(0).toUpperCase()+e.slice(1);function Xz(e,t){var r;const n=t.phase?Kl(t.phase):"No phase",s=e.merge;if(!s.offered&&s.why.startsWith(WN)){const l=(r=/; (.+) continues it$/.exec(s.why))==null?void 0:r[1];return l?`Retired · continued by ${l}`:"Retired"}return t.phase==="done"||!s.offered&&s.why===ZN?e.landed===null?"Done · without landing this":"Done":s.offered?`${n} · at rest`:s.why.startsWith("its thread is at work")?`${n} · at work`:s.why===zp?`${n} · waits on you`:s.why.startsWith("its session is not running")?`${n} · session not running`:n}function Fz(){const e=_n().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function Kz({org:e}){var B,Z;const t=Fz(),[n,s]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(null),[c,d]=u.useState(!1),[f,h]=u.useState("all"),[m,g]=u.useState(""),[b,y]=u.useState({}),j=u.useRef({}),{confirm:x,confirm_dialog:p}=yl(),v=u.useRef(!1),w=u.useCallback(async()=>{if(v.current)return;v.current=!0;const z=await t.list();v.current=!1,z.ok?(s(z.data),l(null)):l(z.refusal)},[t]),N=u.useCallback(async()=>{const z=await t.sizes();d(!z.ok),z.ok&&o(z.data)},[t]);u.useEffect(()=>{w(),N()},[w,N]);const k=(n==null?void 0:n.rows.some(z=>{var K,ae;return((K=z.write)==null?void 0:K.state)==="waiting"||((ae=z.write)==null?void 0:ae.state)==="running"}))??!1;Wc(()=>void w(),k?Bz:Hz),Wc(()=>void N(),Iz);const _=(n==null?void 0:n.rows)??[],S=z=>i==null?void 0:i.sizes[z.path],R=_.filter($p),M=i?R.reduce((z,K)=>z+(S(K)??0),0):null,L=_.length===0?iv:`${iv} ${Uz}${R.length?` ${R.length} ${R.length===1?"is":"are"} yours to decide${M!==null?`: removing them frees about ${oc(M)}`:""}.`:""}`,I=m.trim().toLowerCase(),T=z=>!I||[z.name,z.path,z.branch??"",...z.threads.map(K=>K.title??K.thread)].some(K=>K.toLowerCase().includes(I)),O=_.filter(z=>rf(z,f)&&T(z)).sort((z,K)=>{if(f==="decide")return(S(K)??0)-(S(z)??0);const ae=Q=>Vz(Q)?Q.merge.offered?0:1:2;return ae(z)-ae(K)||(z.idle_days??1/0)-(K.idle_days??1/0)}),Y=async(z,K)=>{const ae=await(z==="merge"?t.merge(K.path):t.remove(K.path));ae.ok?y(({[K.path]:Q,...F})=>F):y(Q=>({...Q,[K.path]:ae.refusal.message})),await w()},E=async z=>{if(!z.merge.offered)return;const K=z.threads.find(W=>W.thread===(z.merge.offered&&z.merge.thread)),ae=(K==null?void 0:K.title)??z.merge.thread,Q=K!=null&&K.holds.length?`has ${K.holds.length} open hold(s) (${K.holds.join(", ")})`:"has no open holds",F=z.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${z.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",U=z.merge.caveat?`
|
|
381
|
+
|
|
382
|
+
Its session could not be read: ${z.merge.caveat}. A turn it does not start passes on.`:"";await x({title:`Send ${z.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${ae}, which ${Q} and is told of the join. The queue checks the branch first, and ${F}. Nothing reaches main before then.${U}`,action_label:"Join the main queue"})&&await Y("merge",z)},H=async z=>{const K=S(z);await x({title:`Remove ${z.name}?`,description:`This deletes the folder ${z.path}${K!==void 0?` and frees about ${oc(K)}`:""}.${z.branch?` Its branch ${z.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 ${z.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})&&(K!==void 0&&(j.current[z.path]=K),await Y("remove",z))},C=async z=>{await t.dismiss(z),await w()};return a.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:[a.jsx(Kt,{title:"Worktrees",description:L}),!n&&!r&&a.jsx(Qz,{}),r?a.jsx(Zz,{refusal:r,read_at:n==null?void 0:n.read_at,on_retry:()=>void w()}):null,n!=null&&n.stale?a.jsxs(oe,{variant:"destructive",className:"mt-4",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Could not read worktrees"}),a.jsxs(ie,{children:[a.jsxs("p",{children:[n.stale.message," This list was read at ",Wn(new Date(n.read_at).toISOString()),"."]}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void w(),children:"Retry"})]})]}):null,n==null?void 0:n.removals.map(z=>a.jsxs(oe,{variant:"success",className:"mt-4",role:"status",children:[a.jsx(pe,{children:j.current[z.path]!==void 0?`Removed ${z.name} and freed ${oc(j.current[z.path])}`:`Removed ${z.name}`}),a.jsxs(ie,{children:[a.jsx("p",{children:z.branch?`Its branch ${z.branch} stays, and its records were saved.`:"Its records were saved."}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void C({removal:z.path}),children:"Dismiss"})]})]},z.path)),n&&_.length===0?a.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[a.jsx(Nj,{className:"text-muted-foreground size-8","aria-hidden":"true"}),a.jsx("h2",{className:"text-lg font-semibold",children:"Only the main checkout"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"No other worktrees. Agents make theirs in .sdlc-worktrees beside the main checkout."})]}):n?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[a.jsx(Tt,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:m,onChange:z=>g(z.target.value)}),a.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",Wn(new Date(n.read_at).toISOString())," · rereads every 30 s"]})]}),a.jsx("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Worktree state",children:af.map(z=>a.jsxs(q,{type:"button",variant:"outline",size:"sm",className:qr,"aria-pressed":f===z.id,onClick:()=>h(z.id),children:[z.label," ",_.filter(K=>rf(K,z.id)).length]},z.id))}),O.length===0?a.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[a.jsx(_u,{className:"text-muted-foreground size-8","aria-hidden":"true"}),a.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),I?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(B=af.find(z=>z.id===f))==null?void 0:B.empty," matches “",m,"”. Clear the search to see all"," ",_.filter(z=>rf(z,f)).length,"."]}),a.jsx(q,{type:"button",variant:"outline",onClick:()=>g(""),children:"Clear search"})]}):a.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(Z=af.find(z=>z.id===f))==null?void 0:Z.empty," right now."]})]}):a.jsx(pt,{className:"mt-4 shrink-0 overflow-x-auto",children:a.jsxs(Xe,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[a.jsx(st,{children:a.jsxs(ce,{children:[a.jsx(X,{className:"w-[24%]",children:"Worktree"}),a.jsx(X,{className:"w-[24%]",children:"Threads"}),a.jsx(X,{className:"w-[12%]",children:"Landed"}),a.jsx(X,{className:"w-[18%]",children:"Cleanup"}),a.jsx(X,{className:"hidden w-[10%] md:table-cell",children:"Last commit"}),a.jsx(X,{className:"w-[12%] text-right",children:"Actions"})]})}),a.jsx(Fe,{children:O.map(z=>a.jsx(Wz,{org:e,row:z,size:S(z),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:b[z.path],on_merge:()=>void E(z),on_remove:()=>void H(z),on_dismiss:K=>void C(K),on_clear_sent:()=>y(({[z.path]:K,...ae})=>ae)},z.path))})]})})]}):null,p]})}function Qz(){return a.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading worktrees",children:Array.from({length:6},(e,t)=>a.jsx(ct,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function Zz({refusal:e,read_at:t,on_retry:n}){return e.reason==="engine_missing"?a.jsxs(oe,{variant:"info",className:"mt-6",children:[a.jsx(un,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Worktrees needs a SoftwareDLC checkout"}),a.jsx(ie,{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"?a.jsxs(oe,{variant:"warning",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"The main checkout's view code is too old for Worktrees"}),a.jsx(ie,{children:"Update the main checkout, then restart sdlc viewer."})]}):a.jsxs(oe,{variant:"destructive",className:"mt-6",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"Could not read worktrees"}),a.jsxs(ie,{children:[a.jsxs("p",{children:[e.message,t?` This list was read at ${Wn(new Date(t).toISOString())}.`:""]}),a.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function qo({children:e,muted:t=!0}){return a.jsx("div",{className:J("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function Wz({org:e,row:t,size:n,sizes:s,can_write:r,sent:l,on_merge:i,on_remove:o,on_dismiss:c,on_clear_sent:d}){const{href:f,Link:h}=at(),m=e?`/org/${encodeURIComponent(e)}`:"",g=f(`${m}/threads`),b=f(`${m}/tasks`),y=Bl[t.landed??"not_landed"],j=$p(t),x=t.write,p=(x==null?void 0:x.state)==="waiting"||(x==null?void 0:x.state)==="running",v=t.threads.find(L=>"thread"in t.merge&&L.thread===t.merge.thread)??t.threads[0],w=t.merge,N=!w.offered&&w.why===zp,k=r&&t.landed===null&&!t.queue&&!N&&!Lp(t),_=n!==void 0?oc(n):s==="measuring"?"Measuring size…":s==="failed"?"Size could not be read":null,S=j?{label:"Yours to decide",muted:!1,second:[_,t.cleanup_why[0]]}:t.archivable?{label:"The manager removes it",muted:!1,second:[_]}:{label:"Stays",muted:!0,second:[_,t.why[0]??null]},R=S.second.filter(Boolean).join(" · "),M=t.path.slice(0,t.path.length-t.name.length-1)||".";return a.jsxs(a.Fragment,{children:[a.jsxs(ce,{"data-testid":"worktrees-row",children:[a.jsxs(P,{children:[a.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),a.jsx(qo,{children:t.branch??"Detached"}),M!==".sdlc-worktrees"?a.jsx(qo,{children:`in ${M}`}):null]}),a.jsx(P,{children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"truncate",title:v.title??v.thread,children:v.title??v.thread}),a.jsx(qo,{children:`${Xz(t,v)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):a.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),a.jsx(P,{children:a.jsx(Re,{variant:y.tone,children:y.label})}),a.jsxs(P,{children:[a.jsx("div",{className:J("truncate",S.muted&&"text-muted-foreground"),children:S.label}),R?a.jsx("div",{className:"hidden md:block",children:a.jsx(qo,{children:R})}):null]}),a.jsx(P,{className:"hidden md:table-cell",children:Yz(t.idle_days)}),a.jsx(P,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[p?a.jsx(q,{type:"button",variant:"outline",size:"sm",loading:!0,disabled:!0,children:(x==null?void 0:x.kind)==="merge"?x.state==="waiting"?"Waiting to join…":"Joining main…":(x==null?void 0:x.state)==="waiting"?"Waiting to remove…":"Removing…"}):t.queue?a.jsx(Re,{variant:Bl.queued.tone,children:`${Bl.queued.label} · ${JN(t.queue.position)}`}):N?a.jsx(h,{href:b,"aria-label":`${t.name}: its thread waits on you, in Waiting on you`,children:a.jsx(Re,{variant:Bl.needs_you.tone,children:Bl.needs_you.label})}):k?a.jsx(q,{type:"button",variant:"outline",size:"sm",title:w.offered?void 0:w.why,"aria-disabled":!w.offered||void 0,className:J(!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,j&&r&&!p?a.jsx(q,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),a.jsx(Jz,{row:t,threads:g,tasks:b,merge_shown:k,sent:l,on_dismiss:c,on_clear_sent:d})]})}function Jz({row:e,threads:t,tasks:n,merge_shown:s,sent:r,on_dismiss:l,on_clear_sent:i}){var b,y,j,x;const{Link:o}=at(),c=(p="Open in Threads")=>a.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:p}),d=p=>a.jsx(q,{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 g=null;if(r)g=a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:"It was not sent"}),a.jsxs(ie,{children:[a.jsx("p",{children:r}),d(i)]})]});else if((f==null?void 0:f.state)==="waiting")g=a.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")g=a.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=((b=f.lands)==null?void 0:b.by)==="manager"?`the merge manager, ${f.lands.manager}, lands it`:"it lands it on its turn";g=a.jsxs(oe,{variant:f.told?"success":"warning",role:"status",children:[a.jsx(pe,{children:`${e.name} joined the main queue, ${JN(f.position)}`}),a.jsxs(ie,{children:[a.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?a.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 ${lf(e.queue.passes_at)}.`}):null,a.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),!f.told||((j=e.queue)==null?void 0:j.position)===1?a.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`;g=a.jsxs(oe,{variant:"destructive",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:p}),a.jsxs(ie,{children:[a.jsx("p",{children:`${Kl(f.message)}${f.kind==="merge"?" Nothing was queued.":" Nothing was deleted."}`}),a.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),f.kind==="merge"?a.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(e.last_turn){const p=e.last_turn;g=a.jsxs(oe,{variant:"warning",children:[a.jsx(Je,{className:"size-4","aria-hidden":"true"}),a.jsx(pe,{children:`${e.name}'s turn ${p.outcome==="failed"?"failed":"passed on"} at ${lf(p.left_at)}`}),a.jsxs(ie,{children:[a.jsx("p",{children:`${Kl(p.reason)}. Continue the thread in its session; Merge sends it again once it is at rest.`}),a.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({turn:{execution:p.execution,left_at:p.left_at}})),a.jsx("span",{className:"mt-2",children:c()})]})]})]})}else((x=e.queue)==null?void 0:x.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?g=a.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 ${lf(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===zp?g=a.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:["Its thread waits on you. Merge comes back once you answer it. ",a.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?g=a.jsx("p",{className:"text-sm",children:c("Open its successor in Threads")}):s&&!e.merge.offered?g=a.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:[`${Kl(e.merge.why)}. `,e.merge.thread&&!e.merge.why.startsWith("its thread is at work")?c():null]}):e.merge.offered&&e.merge.caveat&&(g=a.jsx("p",{className:"text-muted-foreground text-sm",children:`${Kl(e.merge.caveat)}.`}));return g?a.jsx(ce,{className:"hover:bg-transparent",children:a.jsx(P,{colSpan:6,className:"pt-0",children:g})}):null}const e$=["reason","since","store","repository","folder","home","member_path"];function e1(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 s of e$){const r=t==null?void 0:t[s];typeof r=="string"&&(n[s]=r)}return n}function kl({base:e="",fetcher:t=fetch}){return async(n,s={})=>{const r=new URLSearchParams;for(const[c,d]of Object.entries(s))if(Array.isArray(d))for(const f of d)r.append(c,f);else d!==void 0&&d!==!1&&d!==""&&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:e1(i.status,o)}}}function t$(e={}){const t=kl(e),n=r=>async()=>{const l=await t("access");return l.ok?{ok:!0,data:l.data[r]}:l},s=encodeURIComponent;return{tasks:{access:n("tasks"),configuration:()=>t("tasks/configuration"),listTasks:r=>t(`tasks/lists/${s(r)}/tasks`),task:r=>t(`tasks/tasks/${s(r)}`)},issues:{access:n("issues"),list:(r={})=>t("issues",r),issue:r=>t(`issues/${s(r)}`),issueSections:r=>t(`issues/${s(r)}/sections`),issueRelated:r=>t(`issues/${s(r)}/related`)},releases:{access:n("releases"),list:()=>t("releases"),release:r=>t(`releases/${s(r)}`),candidate:()=>t("releases/candidate")},organizations:{access:n("organizations"),list:()=>t("orgs")},projects:{access:n("projects"),list:()=>t("projects")},about:{about:()=>t("about")}}}function n$(e={}){const t=kl(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 Ql=e=>({ok:!1,refusal:{status:0,message:e}});function t1({base:e="",fetcher:t=fetch}){return async(n,s)=>{let r;try{r=await t(`${e}api/${n}`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch{return Ql("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:e1(r.status,l)}}}function s$(e={}){const t=kl(e),n=t1(e);return{chart:()=>t("org"),change:s=>n("org-change",s)}}function a$(e={}){const t=kl(e),n=o=>`tasks/tasks/${encodeURIComponent(o)}`,{base:s="",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(Ql("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve(Ql("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()=>Ql("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(`${s}api/task-done`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}catch{return Ql("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 r$(e={}){const t=kl(e),n=t1(e);return{list:()=>t("worktrees"),sizes:()=>t("worktree-sizes"),merge:s=>n("worktree-merge",{path:s}),remove:s=>n("worktree-remove",{path:s}),dismiss:s=>n("worktree-dismiss",s)}}function l$(e={}){const t=kl(e);return{overview:()=>t("workspaces")}}const i$=15e3,o$=10,ov="idle-sessions-list",cv="idle-sessions-heading",uv="idle-sessions-confirm-text";function n1(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const c$=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,s1=e=>e===1?"1 session":`${e} sessions`;function u$(e){const t=e.released.length?`Closed ${s1(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function d$({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${c$(e.idle_hours)}`,n1(e.memory_mb)].filter(Boolean).join(" · ");return a.jsxs("li",{children:[a.jsx("p",{className:"idle-name",children:e.title}),a.jsxs("p",{className:"caption",children:[a.jsxs("span",{className:"muted",children:[t,e.unfinished&&" ·"]}),e.unfinished&&a.jsx("span",{className:"idle-unfinished",children:" unfinished work"})]})]})}function f$(){const[e,t]=u.useState(null),[n,s]=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(""),g=u.useRef(null),b=u.useRef(null),y=u.useRef(null),j=u.useRef(null),x=u.useRef(0),p=u.useRef(0),v=u.useCallback(async()=>{const T=++x.current,O=await pz();if(!O||T<p.current)return;p.current=T,h("");const Y=JSON.stringify(O);Y!==m.current&&(m.current=Y,t(O))},[]);u.useEffect(()=>{const T=setTimeout(v,0),O=setInterval(v,i$);return()=>{clearTimeout(T),clearInterval(O)}},[v]),u.useEffect(()=>{var O;const T=j.current;T&&(j.current=null,(O={cancel:b,close:g,dismiss:y}[T].current)==null||O.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 N=()=>{i===null&&(l(!0),j.current="cancel")},k=()=>{i===null&&(l(!1),j.current="close")},_=async()=>{if(i!==null)return;o(w),d(null),h("");const T=await xz();p.current=x.current+1,await v(),o(null),l(!1),s(!1),"error"in T?(h(`The sessions were not closed: ${T.error.replace(/\.+$/,"")}.`),j.current="close"):(d(T.done),j.current="dismiss")},S=()=>{d(null),j.current="close"},R=T=>{T.key==="Escape"&&(T.preventDefault(),k())},M=i!==null?`Closing ${s1(i)}…`:c?u$(c):"",L=(e==null?void 0:e.sessions.slice(0,o$))??[],I=w-L.length;return a.jsxs("div",{className:"idle",role:"group",...w?{"aria-labelledby":cv}:{"aria-label":"Idle sessions"},children:[f&&a.jsx("div",{className:"alert",role:"alert",children:f}),w>0&&e&&a.jsxs("div",{className:"idle-head",children:[a.jsxs("div",{className:"idle-title",children:[a.jsxs("h2",{className:"group",id:cv,"aria-label":`Idle sessions, ${w}`,children:["Idle sessions",a.jsx("span",{className:"count",children:w})]}),a.jsxs("p",{className:"caption muted",children:["over ",e.idle_over," h · ",n1(e.memory_mb)]})]}),a.jsxs("div",{className:"tools",children:[a.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":ov,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>s(T=>!T),children:n?"Hide":"Show"}),a.jsx("button",{type:"button",className:"pin",ref:g,"aria-expanded":r,"aria-label":"Close idle sessions…",onClick:N,children:"Close idle…"})]})]}),w>0&&a.jsxs("ul",{className:"idle-list",id:ov,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[L.map(T=>a.jsx(d$,{row:T},T.session)),I>0&&a.jsx("li",{children:a.jsxs("p",{className:"caption muted",children:["…and ",I," more"]})})]}),r&&w>0&&a.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":uv,onKeyDown:R,children:[a.jsxs("p",{id:uv,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."]}),a.jsxs("div",{className:"tools start",children:[a.jsx("button",{type:"button",className:"pin","aria-disabled":i!==null?!0:void 0,"aria-busy":i!==null?!0:void 0,onClick:_,children:i!==null?`Closing ${i}…`:`Close ${w}`}),a.jsx("button",{type:"button",className:"pin",ref:b,"aria-disabled":i!==null?!0:void 0,onClick:k,children:"Cancel"})]})]}),a.jsx("p",{className:"idle-status",role:"status",children:M}),c&&a.jsxs(a.Fragment,{children:[c.kept.length>0&&a.jsx("ul",{className:"idle-list","aria-label":"Kept sessions",children:c.kept.map(T=>a.jsxs("li",{children:[a.jsx("p",{className:"idle-name",children:T.title}),a.jsx("p",{className:"caption muted",children:T.why})]},T.session))}),a.jsx("div",{className:"tools start",children:a.jsx("button",{type:"button",className:"pin",ref:y,"aria-label":"Dismiss the close result",onClick:S,children:"Dismiss"})})]})]})}const dv={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function Rh(e){return e&&Object.hasOwn(dv,e)?dv[e]:"grey"}const h$=1e4,m$=6e4,p$=2,fv="#thread-",x$="The threads view needs a SoftwareDLC checkout (tools/vscode-threads); this repository has none.",g$={working:"▶",prod:"↑",planned:"○"};function hv({label:e,count:t,hint:n}){const s=n?`hint-${e.toLowerCase().replace(/\W+/g,"-")}`:void 0;return a.jsxs(a.Fragment,{children:[a.jsxs("h2",{className:"group","aria-label":`${e}, ${t}`,"aria-describedby":s,children:[e,a.jsx("span",{className:"count",children:t})]}),n&&a.jsx("span",{className:"sr-only",id:s,children:n})]})}function of({text:e,role:t}){return a.jsx("span",{className:`badge tone-${Rh(t)}`,children:e})}function v$({serves:e}){const t=e.slice(0,p$),n=e.length-t.length;return a.jsxs("p",{className:"caption muted serves",children:[t.map((s,r)=>a.jsxs("span",{children:[r>0&&", ",a.jsxs("a",{href:`classic/#planned=${encodeURIComponent(s.planned_release)}`,"aria-label":`serves ${s.name}, ${s.level}: open it in Planned releases`,title:"Opens in the classic view",children:["serves ",s.name," (",s.level,")"]})]},s.planned_release)),n>0&&a.jsxs(a.Fragment,{children:[a.jsxs("span",{"aria-hidden":"true",children:[", +",n," more"]}),a.jsxs("span",{className:"sr-only",children:[", and ",n," more planned releases"]})]})]})}function y$({onConnection:e}){const[t,n]=u.useState(null),[s,r]=u.useState(!1),[l,i]=u.useState(""),[o,c]=u.useState(!1),[d,f]=u.useState(null),[h,m]=u.useState(""),[g,b]=u.useState(null),y=u.useRef(""),j=u.useRef(""),x=u.useRef(null),p=u.useRef(null),v=u.useRef(null),w=L=>{var I;return L instanceof HTMLButtonElement&&L.classList.contains("pin")&&((I=x.current)!=null&&I.contains(L))?L.dataset.key??null:null},N=L=>{v.current=w(L.target)},k=()=>{setTimeout(()=>{w(document.activeElement)||(v.current=null)},0)},_=u.useCallback(async()=>{const L=await Op();if("none"in L){r(!0),i(""),e("live");return}if("error"in L){i(L.error),e("disconnected");return}r(!1),i(""),m(""),e("live");const I=JSON.stringify(L.data);I!==y.current&&(y.current=I,n(L.data))},[e]);u.useEffect(()=>{let L=!0;mz().then(O=>L&&c(O));const I=setTimeout(_,0),T=setInterval(_,h$);return()=>{L=!1,clearTimeout(I),clearInterval(T)}},[_]),u.useEffect(()=>{let L=!0;const I=()=>hz().then(O=>{L&&O&&b(Y=>JSON.stringify(Y)===JSON.stringify(O)?Y:O)});I();const T=setInterval(I,m$);return()=>{L=!1,clearInterval(T)}},[]),u.useEffect(()=>{const L=()=>{var Y,E,H;const I=window.location.hash;if(!I.startsWith(fv)||I===j.current)return;let T;try{T=decodeURIComponent(I.slice(fv.length))}catch{return}const O=document.getElementById(`thread-${T}`);!O||!((Y=x.current)!=null&&Y.contains(O))||(j.current=I,(E=O.querySelector(".thread-title"))==null||E.focus({preventScroll:!0}),(H=O.scrollIntoView)==null||H.call(O,{block:"center"}))};return L(),window.addEventListener("hashchange",L),()=>window.removeEventListener("hashchange",L)},[t]),u.useLayoutEffect(()=>{const L=v.current??p.current;if(!L||!x.current)return;const I=document.activeElement;if(I&&I!==document.body&&!x.current.contains(I)){v.current=null;return}const T=[...x.current.querySelectorAll("button.pin")].find(O=>O.dataset.key===L);T?I!==T&&T.focus({preventScroll:L!==p.current}):v.current=null});const S=async L=>{if(d)return;const I=!L.pinned;p.current=L.key,f(L.key);const T=await gz(L.key,I);f(null),T||n(O=>O&&{...O,threads:O.threads.map(Y=>Y.key===L.key?{...Y,pinned:I}:Y)}),await _(),m(T?`The pin was not saved: ${T}`:""),p.current===L.key&&(p.current=null)},R=(t==null?void 0:t.pinnedCount)??0,M=(t==null?void 0:t.threads)??[];return a.jsxs(a.Fragment,{children:[a.jsxs("header",{className:"main-head",children:[a.jsx("h1",{children:"Threads"}),t&&!s&&a.jsx("p",{className:"muted",children:t.line})]}),a.jsxs("section",{className:"card threads","aria-label":"Threads",children:[a.jsx(f$,{}),l&&a.jsxs("div",{className:"alert",role:"alert",children:["Threads unavailable: ",l.replace(/\.+$/,""),". Retrying every 10 s."]}),h&&a.jsx("div",{className:"alert",role:"alert",children:h}),s?a.jsx("p",{className:"muted",children:x$}):a.jsxs("div",{className:"thread-list",ref:x,onFocus:N,onBlur:k,children:[M.map((L,I)=>a.jsxs("div",{children:[R>0&&I===0&&a.jsx(hv,{label:"Pinned",count:R,hint:"Threads you pinned; they stay first in every order"}),R>0&&I===R&&a.jsx(hv,{label:"Other threads",count:M.length-R}),a.jsx(b$,{row:g!=null&&g[L.key]?{...L,serves:g[L.key]}:L,pinnable:o&&typeof L.pinned=="boolean",pinning:d,onPin:()=>S(L)})]},L.key)),t&&!M.length&&a.jsx("p",{className:"muted empty",children:"No threads at work or waiting."}),t&&t.hidden>0&&a.jsxs("p",{className:"caption muted",children:[t.hidden," older thread(s) not shown; sdlc view --all lists them."]})]})]})]})}function b$({row:e,pinnable:t,pinning:n,onPin:s}){const r=[e.agent,e.phase,e.age,e.waitsOn?`waits on ${e.waitsOn}`:""].filter(Boolean).join(" · ");return a.jsxs("article",{className:"thread",id:`thread-${e.key}`,style:{marginLeft:Math.min(e.depth*22,110)},children:[a.jsxs("div",{className:"thread-head",children:[a.jsx("p",{className:"thread-title",tabIndex:-1,children:e.title}),a.jsxs("div",{className:"tools",children:[e.carried?a.jsxs(a.Fragment,{children:[a.jsx(of,{text:e.carried,role:"waiting"}),e.carriedBatch&&a.jsx(of,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):a.jsx(of,{text:e.status,role:e.role}),t&&a.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||s()},children:e.pinned?"Unpin":"Pin"})]})]}),a.jsx("p",{className:"caption muted",children:r}),e.serves&&e.serves.length>0&&a.jsx(v$,{serves:e.serves}),e.summary&&a.jsx("p",{className:"caption muted",children:e.summary}),e.carriedDetail&&a.jsx("p",{className:"line",children:e.carriedDetail}),e.step&&a.jsxs("p",{className:"caption muted",children:["step: ",e.step]}),e.lines.map((l,i)=>a.jsxs("p",{className:`line tone-${Rh(l.role)}`,children:[a.jsxs("span",{"aria-hidden":"true",children:[g$[l.state]??"•"," "]}),l.state==="working"&&a.jsx("span",{className:"sr-only",children:"Working: "}),l.text]},`l${i}`)),e.holds.map((l,i)=>a.jsx("p",{className:`line tone-${Rh(l.role)}`,children:l.text},`h${i}`)),e.plan&&a.jsx("p",{className:"caption muted",children:e.plan})]})}const j$=5e3;function w$(){const[e,t]=u.useState([]),n=u.useRef(0),s=u.useRef(new Map),r=u.useCallback(c=>{const d=s.current.get(c);d&&clearTimeout(d),s.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"&&s.current.set(f,setTimeout(()=>r(f),j$))},[r]);u.useEffect(()=>{const c=s.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=a.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=>a.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:[a.jsx("span",{className:"min-w-0 flex-1 break-words",children:c.message}),a.jsx(q,{type:"button",variant:"ghost",size:"control",className:"shrink-0",onClick:()=>r(c.id),children:"Dismiss"})]},c.id))});return{notify:i,toasts:o}}const _$=e=>e instanceof Error?e.message:String(e),Ku=(e,t="")=>`api/chat/${encodeURIComponent(e)}${t}`;async function Qu(e,t){try{const n=await fetch(e,{cache:"no-store",...t}),s=await n.text();let r=null;try{r=s?JSON.parse(s):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:s||`HTTP ${n.status}`,...typeof l.reason=="string"?{reason:l.reason}:{}}}}catch(n){return{failed:{status:0,error:_$(n)}}}}async function N$(){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 mv(e,t){return Qu(Ku(e,t==null?"":`?before=${t}`))}function k$(e){return Qu(Ku(e,"/state"))}const pv=50;function S$(e){return Qu(`api/chat/states?threads=${e.map(encodeURIComponent).join(",")}`)}const a1=(e,t,n)=>Qu(Ku(e,`/${t}`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n})}),C$=(e,t)=>a1(e,"send",t),T$=(e,t)=>a1(e,"reopen",t),r1=/^(claude|codex):[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,E$=5e3,R$=1e4,xv=6e4,Vr=e=>e.startsWith("codex:")?"codex":"claude",l1={claude:"Claude",codex:"Codex"},A$={claude:"Claude Code",codex:"Codex"},Zu=e=>e.where??e.worktree??"";function M$(e){return e?e.repository?e.checkout&&e.checkout!==e.repository?`${e.repository} · worktree ${e.checkout}`:e.repository:Zu(e)||null:null}const O$=(e,t)=>[e.title,e.step,e.summary,t?Zu(t):"",(t==null?void 0:t.repository)??"",(t==null?void 0:t.checkout)??""].join(" ").toLowerCase(),D$=e=>e==null?"":new Date(e*1e3).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),Up=(e,t)=>`org/${encodeURIComponent(e)}/chat${t?`/${encodeURIComponent(t)}`:""}`,gv=(e,t)=>`org/${encodeURIComponent(e)}/threads#thread-${encodeURIComponent(t)}`,cf="text-primary underline-offset-4 hover:underline";function z$(e){const t=(e.provider??Vr(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=Zu(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 $$(e,t,n=!0){const s=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"}.${s}`;const r=e.error.replace(/[.\s]+$/,"");return t?`Not reopened: ${r}.${s}`:e.status>=500||e.status===0?`Not sent: the inbox could not be written.${s}`:`Not sent: ${r}.${s}`}const L$="This thread can't be reopened: its worktree is gone. Its transcript stays readable; start a new thread to go on.",U$="Chat cannot send to this thread: its provider keeps no inbox and cannot be resumed.";function H$(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 B$(e){const t=new Map;return e.map((n,s)=>{if(n.kind==="message"&&n.note)return`note-${n.note}`;if(n.offset==null)return`${n.kind}-x-${s}`;const r=`${n.kind}-${n.offset}`,l=t.get(r)??0;return t.set(r,l+1),`${r}-${l}`})}function I$(e,t,n){if(n.before==null||n.aligned===!1)return null;const s=n.before;if(t==null||s>t)return null;const r=e.findIndex(o=>o.offset!=null&&o.offset>=s),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 q$(e,t){return t?e.map(n=>{if(n.kind!=="message"||!n.note||!t[n.note])return n;const s=t[n.note];if(n.inbox===s.inbox&&JSON.stringify(n.successor??null)===JSON.stringify(s.successor??null))return n;const{successor:r,...l}=n;return{...l,inbox:s.inbox,...s.successor?{successor:s.successor}:{}}}):e}function i1({label:e}){return a.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 o1({state:e}){if(!e)return null;const{label:t,tone:n}=XN[e];return a.jsx(Re,{variant:n,children:t})}function G$({row:e}){const[t,n]=u.useState(!1);return a.jsxs("div",{className:"rounded-md border border-border px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(WC,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),a.jsx("span",{className:"min-w-0 flex-1 text-xs text-muted-foreground",children:e.summary}),a.jsx(q,{variant:"ghost",size:"sm","aria-expanded":t,"aria-label":`${t?"Hide":"Show"} the steps: ${e.summary}`,onClick:()=>n(s=>!s),children:t?"Hide":"Show"})]}),t&&a.jsx("ul",{className:"m-0 mt-2 flex list-none flex-col gap-1 p-0",children:e.lines.map((s,r)=>a.jsx("li",{className:`text-xs text-muted-foreground [overflow-wrap:anywhere] ${s.startsWith("Edited ")?"":"font-mono"}`,children:s},r))})]})}function P$({row:e,agent:t,onSendAgain:n}){const s=e.who==="user",r=H$(e);return a.jsxs("div",{className:"flex gap-3",children:[a.jsx(i1,{label:s?"You":t.slice(0,2).toUpperCase()}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"You":t}),a.jsx("span",{className:"text-xs text-muted-foreground",children:D$(e.at)})]}),a.jsx("p",{className:"m-0 whitespace-pre-wrap text-sm text-foreground [overflow-wrap:anywhere]",children:e.text}),e.cut&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"Shows the first 32,000 characters of this message."}),r&&a.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r,e.inbox==="expired"&&n&&a.jsx(q,{variant:"link",size:"inline-sm",onClick:()=>n(e.text),children:"Send again"})]})]})]})}function V$(){const[e,t]=u.useState({rows:null,error:"",none:!1}),n=u.useRef(""),s=u.useCallback(async(r=!0)=>{const l=await Op();if("none"in l)return t({rows:[],error:"",none:!0});if("error"in l)return r?s(!1):t(c=>({...c,error:l.error}));const i=l.data.threads.filter(c=>r1.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(s,0),l=setInterval(s,R$);return()=>{clearTimeout(r),clearInterval(l)}},[s]),{...e,retry:()=>void s()}}function Y$(e){const[t,n]=u.useState({}),s=u.useRef(e);s.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+=pv){const d=o.slice(c,c+pv);d.forEach(m=>r.current.add(m));const f=await S$(d);if(!l.current)return;if(!("ok"in f))continue;const h={};for(const[m,g]of Object.entries(f.ok))"state"in g&&(h[m]=g);n(m=>({...m,...h}))}},[]);return u.useEffect(()=>{l.current=!0;let o;const c=async()=>{await i(s.current),l.current&&(o=setTimeout(c,xv))};return o=setTimeout(c,xv),()=>{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 X$({org:e,list:t,states:n,open:s}){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 c1(t.rows??[]).filter(g=>r==="all"||Vr(g.key)===r).filter(g=>!m||O$(g,n[g.key]).includes(m))},[t.rows,r,f,n]);return a.jsxs("div",{ref:d,role:"region","aria-label":"Chat threads",tabIndex:-1,className:"flex min-w-0 flex-col gap-3 outline-hidden",children:[a.jsxs(yt,{value:r,onValueChange:m=>l(m),children:[a.jsx(ht,{"aria-label":"Show threads from",children:a.jsx(bt,{})}),a.jsxs(mt,{children:[a.jsx(ke,{value:"all",children:"All threads"}),a.jsx(ke,{value:"claude",children:"Claude Code"}),a.jsx(ke,{value:"codex",children:"Codex"})]})]}),a.jsx(Tt,{ref:c,type:"search","aria-label":"Search threads",placeholder:"Search threads",value:i,onChange:m=>o(m.target.value)}),t.error&&a.jsxs(oe,{variant:"destructive",children:[a.jsx(Dn,{"aria-hidden":"true"}),a.jsxs(ie,{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.":"",a.jsx(q,{variant:"outline",size:"sm",onClick:()=>{var m;(m=d.current)==null||m.focus(),t.retry()},children:"Retry"})]})]}),t.rows===null?t.error?null:a.jsxs("div",{role:"status",className:"flex flex-col gap-3",children:[a.jsx("span",{className:"sr-only",children:"Loading threads…"}),[0,1,2].map(m=>a.jsx(ct,{className:"h-14 w-full"},m))]}):t.rows.length===0?a.jsxs("div",{className:"flex flex-col gap-1 py-6",children:[a.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"}),a.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?a.jsxs("div",{className:"flex flex-col items-start gap-2 py-6",children:[a.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:f?`No thread matches “${f}”. Clear the search or choose All threads.`:`No ${A$[r==="all"?"claude":r]} thread in this folder. Choose All threads.`}),a.jsx(q,{variant:"outline",size:"sm",onClick:()=>{var m;o(""),l("all"),(m=c.current)==null||m.focus()},children:"Clear search"})]}):a.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0","aria-label":"Threads",children:h.map(m=>{var x;const g=(x=n[m.key])==null?void 0:x.state,b=m.step||m.summary,y=m.key===s,j=`chat-row-${m.key}`;return a.jsx("li",{children:a.jsxs("a",{id:j,href:Up(e,m.key),"aria-current":y?"page":void 0,"aria-label":`${m.title||m.key}${g?`, ${XN[g].label}`:""}`,"aria-describedby":[b?`${j}-preview`:"",m.age?`${j}-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:[a.jsx(i1,{label:Vr(m.key)==="codex"?"CO":"CL"}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[a.jsx("span",{className:"truncate text-sm font-semibold text-foreground",title:m.title||m.key,children:m.title||m.key}),b&&a.jsx("span",{id:`${j}-preview`,className:"truncate text-xs text-muted-foreground",title:b,children:b}),a.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l1[Vr(m.key)],a.jsx(o1,{state:g})]})]}),m.age&&a.jsx("span",{id:`${j}-age`,className:"shrink-0 text-xs text-muted-foreground",children:m.age})]})},m.key)})})]})}const c1=e=>[...e].sort((t,n)=>+!!n.pinned-+!!t.pinned);function F$(e,t){const[n,s]=u.useState(null),r=u.useRef(null);u.useLayoutEffect(()=>{const x=t.current;x&&r.current!==null&&(x.scrollTop=x.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),g=u.useRef(""),b=u.useCallback(async()=>{const[x,p]=await Promise.all([mv(e),k$(e)]);if("ok"in p?(c(null),f(N=>JSON.stringify(N)===JSON.stringify(p.ok)?N:p.ok)):c(p.failed),"failed"in x)return i(x.failed);i(null);const v=JSON.stringify([x.ok.rows,x.ok.before,x.ok.notes??null]);if(v===g.current)return;g.current=v;const w=x.ok.end??null;s(N=>{const k=N&&I$(N.rows,N.end,x.ok);if(!N||!k)return{rows:x.ok.rows,before:x.ok.before,end:w};const _=k.length>x.ok.rows.length?N.before:x.ok.before;return{rows:q$(k,x.ok.notes),before:_,end:w}})},[e]);u.useEffect(()=>{const x=setTimeout(b,0),p=setInterval(b,E$);return()=>{clearTimeout(x),clearInterval(p)}},[b]);const y=async()=>{if(!n||n.before==null||h)return;const x=n.before;m(!0);const p=await mv(e,x);if(m(!1),"failed"in p)return i(p.failed);const v=t.current?t.current.scrollHeight-t.current.scrollTop:null;s(w=>!w||w.before!==x?w:(r.current=v,{...w,rows:[...p.ok.rows,...w.rows],before:p.ok.before}))},j=n===null&&(l==null?void 0:l.status)===404&&(o==null?void 0:o.status)===404;return{transcript:n,readFailure:l,state:d,refresh:b,showEarlier:y,earlier:h,missing:j}}function K$({thread:e,title:t,state:n,again:s,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,g]=u.useState(null),[b,y]=u.useState(!1),j=u.useRef(null),x=u.useRef(null),{confirm:p,confirm_dialog:v}=yl(),w=z$(n),N=`chat-delivery-${e}`,k=!w||w.off||f,_=n.state!=="closed"||n.reason==="maybe_running";u.useEffect(()=>{!n.reopening_since&&_&&y(!1)},[n.reopening_since,_]);const S=u.useRef(null),R=u.useRef(!1);u.useEffect(()=>{if(!b)return;if(n.reopening_since){R.current=!0;return}if(!R.current||_||n.delivery!=="reopen")return;R.current=!1,y(!1);const T=S.current;S.current=null;const O=!!T&&!d.current.trim();O&&T&&c(T),g({text:`Not reopened: its session did not start in Terminal.${O?" Your message is back in the box.":""}`,retry:!1})},[b,n.reopening_since,_,n.delivery]);const M=async(T=d.current,O=!0)=>{var E;if(!w||k||!T.trim())return!1;if(w.reopen){const H=(n.provider??Vr(e))==="codex",C=await p({title:`Reopen ${t}?`,description:`It opens in ${Zu(n)}, in a new Terminal window running ${H?"codex resume":"claude --resume"}, with your message as its first prompt.`,action_label:"Reopen"});if(setTimeout(()=>{var B;return(B=x.current)==null?void 0:B.focus()},0),!C)return!1}h(!0),g(null);const Y=await(w.reopen?T$(e,T):C$(e,T));return h(!1),"failed"in Y?(g({text:$$(Y.failed,w.reopen,O),retry:O&&Y.failed.reason==="terminal_denied"}),O&&((E=j.current)==null||E.focus()),l(),!1):(O&&d.current===T&&c(""),w.reopen&&(S.current=T,R.current=!1,y(!0)),l(),!0)},L=u.useRef(M);if(L.current=M,u.useEffect(()=>{if(!s||k)return;r();const T=d.current.trim()!==""&&d.current!==s.text;T||(c(s.text),d.current=s.text),L.current(s.text,!T)},[s,k,r]),!w)return null;const I=T=>{T.key==="Enter"&&!T.shiftKey&&!T.nativeEvent.isComposing&&(T.preventDefault(),M())};return a.jsxs("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[m&&a.jsxs(oe,{variant:"destructive",children:[a.jsx(Dn,{"aria-hidden":"true"}),a.jsxs(ie,{className:"flex flex-col items-start gap-2",children:[m.text,m.retry&&a.jsx(q,{variant:"outline",size:"sm",onClick:()=>void M().then(T=>T&&i()),children:"Retry"})]})]}),(b||n.reopening_since)&&w.reopen&&a.jsxs(oe,{variant:"info",role:"status",children:[a.jsx(un,{"aria-hidden":"true"}),a.jsx(ie,{children:"Opened a Terminal window with your message. Its replies appear here once it starts."})]}),a.jsx(Hn,{ref:j,rows:3,"aria-label":`Message ${t}`,placeholder:`Message ${t}`,value:o,onChange:T=>c(T.target.value),onKeyDown:I}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("p",{id:N,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}),a.jsxs(q,{ref:x,size:"sm","aria-disabled":k||void 0,"aria-describedby":N,onClick:()=>void M(),loading:f,children:[a.jsx(IC,{"aria-hidden":"true"}),w.button]})]}),v]})}function Q$(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 vv({org:e,thread:t,row:n,onBack:s,onMissing:r,onState:l}){const i=u.useRef(null),{transcript:o,readFailure:c,state:d,refresh:f,showEarlier:h,earlier:m,missing:g}=F$(t,i);u.useEffect(()=>{d&&l(d)},[d,l]);const b=u.useRef(!0),[y,j]=u.useState(null),[x,p]=u.useState(""),v=u.useRef(void 0),w=(n==null?void 0:n.title)||(d==null?void 0:d.title)||t,N=l1[Vr(t)],k=(o==null?void 0:o.rows)??null,_=u.useMemo(()=>B$(k??[]),[k]),S=u.useCallback(()=>j(null),[]);u.useEffect(()=>{g&&r()},[g,r]),u.useLayoutEffect(()=>{const T=i.current;T&&b.current&&(T.scrollTop=T.scrollHeight)},[k==null?void 0:k.length]),u.useEffect(()=>{if(!k)return;let T=-1;for(let E=k.length-1;E>=0;E--){const H=k[E];if(H.kind==="message"&&H.who==="agent"){T=E;break}}const O=T>=0?k[T]:null,Y=O?_[T]:null;v.current!==void 0&&O&&Y!==v.current&&p(`${N}: ${O.text.slice(0,300)}`),v.current=Y},[k,_,N]);const R=[M$(d),Q$(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",L=!!(d&&d.state!=="continued"&&d.delivery!=="none"),I=c&&!g;return a.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3","aria-labelledby":"chat-thread-title",children:[a.jsx("div",{className:"@min-[720px]:hidden",children:a.jsxs(q,{variant:"ghost",size:"sm",onClick:s,children:[a.jsx(Rm,{"aria-hidden":"true"}),"Back to threads"]})}),a.jsxs("header",{className:"flex flex-wrap items-start gap-x-3 gap-y-1 border-b border-border pb-3",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx("h2",{id:"chat-thread-title",className:"m-0 text-base font-semibold text-foreground [overflow-wrap:anywhere]",children:w}),R&&a.jsx("span",{className:"text-xs text-muted-foreground",children:R})]}),a.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[N,a.jsx(o1,{state:d==null?void 0:d.state}),n&&a.jsx("a",{className:`text-sm ${cf}`,href:gv(e,t),children:"Open in Threads"})]})]}),I&&a.jsxs(oe,{variant:"warning",children:[a.jsx(Dn,{"aria-hidden":"true"}),a.jsxs(ie,{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.":"",a.jsxs("span",{className:"flex items-center gap-3",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:()=>{var T;(T=i.current)==null||T.focus(),f()},children:"Retry"}),n&&a.jsx("a",{className:`text-sm ${cf}`,href:gv(e,t),children:"Open in Threads"})]})]})]}),a.jsx("div",{"aria-live":"polite",className:"sr-only",children:x}),a.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:T=>{const O=T.currentTarget;b.current=O.scrollHeight-O.scrollTop-O.clientHeight<24},children:g?a.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."}):k===null&&!c?a.jsxs("div",{role:"status",className:"flex flex-col gap-3",children:[a.jsx("span",{className:"sr-only",children:"Loading the transcript…"}),a.jsx(ct,{className:"h-16 w-full"}),a.jsx(ct,{className:"h-16 w-3/4"})]}):k&&k.length===0?a.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."}):a.jsxs(a.Fragment,{children:[(o==null?void 0:o.before)!=null&&a.jsx("div",{className:"flex justify-center",children:a.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>void h(),"aria-busy":m||void 0,children:[m&&a.jsx(va,{}),"Show earlier messages"]})}),k==null?void 0:k.map((T,O)=>T.kind==="steps"?a.jsx(G$,{row:T},_[O]):a.jsx(P$,{row:T,agent:N,onSendAgain:L?Y=>j(E=>({text:Y,n:((E==null?void 0:E.n)??0)+1})):void 0},_[O]))]})}),(d==null?void 0:d.state)==="continued"?a.jsx("div",{className:"flex flex-col gap-1 border-t border-border pt-3 text-sm text-muted-foreground",children:d.successor?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"m-0",children:"Taken over by another thread, which now owns its work. Message that thread instead."}),a.jsxs("a",{className:cf,href:Up(e,d.successor.thread),children:["Open ",d.successor.title||d.successor.thread]})]}):a.jsx("p",{className:"m-0",children:"This thread was archived and takes no messages."})}):M?a.jsxs(oe,{variant:"warning",children:[a.jsx(Dn,{"aria-hidden":"true"}),a.jsx(ie,{children:L$})]}):(d==null?void 0:d.delivery)==="none"?a.jsx("p",{className:"m-0 border-t border-border pt-3 text-sm text-muted-foreground",children:U$}):d?a.jsx(K$,{thread:t,title:w,state:d,again:y,onAgainDone:S,onSent:()=>void f(),onRetried:()=>setTimeout(()=>{var T;return(T=i.current)==null?void 0:T.focus()},0)}):null]})}const Z$=[];function W$({org:e,thread:t,served:n=null}){var M,L,I;const s=V$(),r=n===!1?{...s,rows:Z$,error:"",none:!0}:s,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(T=>T.key===l),g=u.useMemo(()=>(r.rows??[]).map(T=>T.key),[r.rows]),b=Y$(g),[y,j]=u.useState(null),x=r.rows?((L=c1(r.rows)[0])==null?void 0:L.key)??null:null;u.useEffect(()=>{y===null&&x!==null&&j(x)},[y,x]);const p=y??x,v=p?{key:p,row:(I=r.rows)==null?void 0:I.find(T=>T.key===p)}:null,w=l!==null&&(!r1.test(l)||f===l&&r.rows!==null&&!m),N=u.useCallback(()=>h(l),[l]),k=u.useCallback(()=>{},[]),_=l??(v==null?void 0:v.key)??null,S=u.useMemo(()=>_&&(i==null?void 0:i.thread)===_?{...b,[_]:i}:b,[b,_,i]),R=()=>{d(!0),setTimeout(()=>{var T;return l?(T=document.getElementById(`chat-row-${l}`))==null?void 0:T.focus():void 0},0)};return w?a.jsx(nr,{title:"Thread not found",description:"This folder has no Claude Code or Codex thread at this address.",backHref:Up(e),backLabel:"Back to Chat",link:Dp.Link}):a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 p-6",children:[a.jsx(Kt,{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."}),a.jsx("div",{className:"@container flex min-h-0 flex-1",children:a.jsxs("div",{className:"flex min-h-0 w-full gap-6 rounded-lg border border-border p-4",children:[a.jsx("div",{className:`w-full @min-[720px]:block @min-[720px]:w-80 @min-[720px]:shrink-0 ${l&&!c?"hidden":""}`,children:a.jsx(X$,{org:e,list:r,states:S,open:_})}),l?a.jsx("div",{className:`min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex ${c?"hidden":"flex"}`,children:a.jsx(vv,{org:e,thread:l,row:m,onBack:R,onMissing:N,onState:o},l)}):v?a.jsx("div",{className:"hidden min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex",children:a.jsx(vv,{org:e,thread:v.key,row:v.row,onBack:k,onMissing:k,onState:o},v.key)}):null]})})]})}const pr={releases:"classic/#releases"},J$=/^#(release=|planned$|releases$)/,e6=/^#task=(.+)$/,t6=/^#issue=(.+)$/,n6=/^iss-\d{1,9}$/;function u1(e){return e.split("/").filter(Boolean).slice(1).join("/")}function s6(e,t=""){const n=e.split("/").filter(Boolean);if(n.length===0)return new URLSearchParams(t).get("section")==="issues"?{page:{kind:"home"},issues:!0}:{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==="issues"?{page:{kind:"home"},issues:!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}:pr[o]?{classic:pr[o]}:{page:{kind:"not_found"}}}const[s,r,l,i]=n;if(s==="org"&&l==="tasks"&&i==="queues"&&n.length===4)return{forward:`org/${r}/queues${t}`};if(s==="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(s==="org"&&l==="tasks"&&n.length===4){const o=decodeURIComponent(i);return{page:{kind:"org",page:"tasks",item:o},org:decodeURIComponent(r),task:o}}if(s==="org"&&l==="issues"&&n.length<=4){const o=decodeURIComponent(r);return i===void 0?{page:{kind:"home"},org:o,issues:!0}:{page:{kind:"home"},org:o,issues:!0,issue:decodeURIComponent(i)}}if(s==="proj"&&l==="issues"&&n.length<=4){const o=decodeURIComponent(r),c={kind:"project",project:o,page:"issues"};if(i===void 0)return{page:c,issues:!0,project:o};const d=decodeURIComponent(i),f=new URLSearchParams(t);f.delete("from");const h=f.toString();return{page:{...c,item:d,...h?{list_query:h}:{}},issues:!0,project:o,issue:d}}if(s==="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(pr[l])return{classic:pr[l]}}if(s==="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(pr[l])return{classic:pr[l]}}return{page:{kind:"not_found"}}}const a6={label:"Local viewer",can:()=>!1},r6={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},yv=()=>a.jsx(FN,{title:"Page not found",children:"There is no page at this address in this viewer."});function l6(){const[e,t]=u.useState("connecting");return a.jsxs("div",{className:"main viewer-panel",children:[a.jsxs("p",{className:"connection",role:"status",children:[a.jsx("span",{className:`dot ${e}`,"aria-hidden":"true"}),r6[e]]}),a.jsx(y$,{onConnection:t})]})}const Sl=()=>a.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});function i6({route:e,navigate:t}){var f;const{org:n,projects:s,loading:r,none:l}=kn(),i=e.page.kind==="project"?e.page.project:null,o=i!==null&&s!==null&&!((f=s.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 a.jsx(tu,{project:i});if(c||e.org===void 0&&r)return a.jsx(Sl,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?a.jsx(tu,{project:i}):d===void 0&&l?a.jsx(co,{}):d===void 0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):a.jsx(RO,{org:d})}function o6({route:e,navigate:t,served:n}){const{org:s,loading:r,none:l}=kn(),i=e.org===void 0&&!r&&s!==null?`org/${encodeURIComponent(s.slug)}/chat`:null;if(u.useEffect(()=>{i&&t(i)},[i,t]),i||e.org===void 0&&r)return a.jsx(Sl,{});const o=(s==null?void 0:s.slug)??e.org;return o===void 0&&l?a.jsx(co,{}):o===void 0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Chat opens once the organization reads."}):a.jsx(W$,{org:o,thread:e.thread,served:n})}function c6({route:e,navigate:t}){const{org:n,loading:s,none:r}=kn(),l=e.org===void 0&&!s&&n!==null?`org/${encodeURIComponent(n.slug)}/queues${window.location.search}`:null;if(u.useEffect(()=>{l&&t(l)},[l,t]),l||e.org===void 0&&s)return a.jsx(Sl,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&r)return a.jsx(co,{});if(i===void 0)return a.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 a.jsx(y3,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function u6({route:e,navigate:t}){var p;const{org:n,projects:s,loading:r,none:l,failure:i}=kn(),o=e.project??null,c=o!==null&&s!==null&&!((p=s.find(v=>v.id===o))!=null&&p.current),d=(s==null?void 0:s.find(v=>v.current))??null,f=new URLSearchParams(window.location.search);f.delete("section");const h=f.toString(),m=!r&&(l!==null||(i==null?void 0:i.shown)||s!==null),g=o!==null?null:d!==null?`proj/${encodeURIComponent(d.id)}/issues${e.issue?`/${encodeURIComponent(e.issue)}`:""}${h?`?${h}`:""}`:m?e.issue?`classic/#issue=${encodeURIComponent(e.issue)}`:"classic/?section=issues":null;u.useEffect(()=>{g&&t(g)},[g,t]);const[b,y]=u.useState(()=>window.location.search.replace(/^\?/,"")),j=u.useCallback(v=>{window.history.replaceState(window.history.state,"",`${window.location.pathname}${v?`?${v}`:""}`),y(v)},[]);if(o!==null&&c)return a.jsx(tu,{project:o});if(g||o===null&&r)return a.jsx(Sl,{});if(o===null)return a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Issues open once the projects read."});const x=encodeURIComponent((n==null?void 0:n.slug)??e.org??"");if(e.issue!==void 0){const v=new URLSearchParams(b).get("from");return a.jsx(i3,{org:x,project:o,issue_id:e.issue,from:v,query:b})}return a.jsx(XD,{org:x,project:o,query:b,onQuery:j})}function d6({issue:e,navigate:t}){const{projects:n,loading:s,none:r,failure:l}=kn(),i=(n==null?void 0:n.find(c=>c.current))??null,o=i!==null?`proj/${encodeURIComponent(i.id)}/issues/${encodeURIComponent(e)}`:!s&&(r!==null||l!=null&&l.shown||n!==null)?`classic/#issue=${encodeURIComponent(e)}`:null;return u.useEffect(()=>{o&&t(o)},[o,t]),a.jsx(Sl,{})}function f6({route:e,navigate:t,chat:n}){const{org:s}=kn();let r=e.page;const l=e.org!==void 0&&s!==null&&e.org!==s.slug;l&&(r={kind:"not_found"});let i;if(l)i=a.jsx(yv,{});else if("threads"in e)i=a.jsx(l6,{});else if("chat"in e)i=a.jsx(o6,{route:e,navigate:t,served:n});else if("task"in e){const o=new URLSearchParams(window.location.search).get("from");i=a.jsx(aD,{org:encodeURIComponent(e.org),task_id:e.task,from:o})}else"tasks"in e?i=a.jsx(i6,{route:e,navigate:t}):"issues"in e?i=a.jsx(u6,{route:e,navigate:t}):"chart"in e?i=a.jsx(z3,{}):"worktrees"in e?i=a.jsx(Kz,{org:(s==null?void 0:s.slug)??e.org}):"workspaces"in e?i=a.jsx(Tz,{org:(s==null?void 0:s.slug)??e.org}):"queues"in e?i=a.jsx(c6,{route:e,navigate:t}):r.kind==="home"?i=a.jsx(co,{}):r.kind==="project"?i=a.jsx(tu,{project:r.project}):i=a.jsx(yv,{});return a.jsx(cz,{page:r,chat:n===!0,children:i})}function h6({task:e,navigate:t}){const{org:n,loading:s,none:r,failure:l}=kn(),i=n!==null?`org/${encodeURIComponent(n.slug)}/tasks/${encodeURIComponent(e)}`:!s&&(r!==null||l!=null&&l.shown)?`classic/#task=${encodeURIComponent(e)}`:null;return u.useEffect(()=>{i&&t(i)},[i,t]),a.jsx(Sl,{})}const m6=e=>window.location.replace(e);function bv(e){try{return decodeURIComponent(e)}catch{return null}}function p6({navigate:e=m6,data:t,chat:n=N$}){const s=s6(u1(window.location.pathname),window.location.search),[r,l]=u.useState(null),{notify:i,toasts:o}=w$(),[c,d]=u.useState(null);u.useEffect(()=>{let x=!0;return n().then(p=>x&&d(p)),()=>{x=!1}},[n]);const f=e6.exec(window.location.hash),h=f?bv(f[1]):null,m=t6.exec(window.location.hash),g=m?bv(m[1]):null,b=g!==null&&n6.test(g)?g:null,y=J$.test(window.location.hash)||f!==null&&h===null||m!==null&&b===null?`classic/${window.location.hash}`:"classic"in s?s.classic:"forward"in s?s.forward:null;u.useEffect(()=>{y&&e(y)},[y,e]);const j=u.useMemo(()=>{if(t)return t;const x=t$();return{probe:{source:async()=>({label:"Local workspace"})},shell:x,issues:x.issues,tasks:a$(),org:s$(),worktrees:r$(),workspaces:l$(),queues:n$()}},[t]);return y||"classic"in s||"forward"in s||!j.shell?null:a.jsx("div",{className:"app-ui dark",ref:l,children:a.jsxs(cR,{container:r,children:[a.jsx(bj,{data:j,router:Dp,identity:a6,notify:i,children:a.jsx(nz,{shell:j.shell,children:h!==null?a.jsx(h6,{task:h,navigate:e}):b!==null?a.jsx(d6,{issue:b,navigate:e}):a.jsx(f6,{route:s,navigate:e,chat:c})})}),o]})})}p2.createRoot(document.getElementById("root")).render(a.jsx(u.StrictMode,{children:u1(window.location.pathname)==="app-ui-probe"?a.jsx(bz,{}):a.jsx(p6,{})}));
|