@imagile-dev/toil-ui 0.1.0-alpha.3 → 0.1.0-beta.1

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.
Files changed (97) hide show
  1. package/NOTICE +12 -5
  2. package/README.md +341 -41
  3. package/dist/app/assets/Graph-BG4Q-CNd.js +7 -0
  4. package/dist/app/assets/PowershellMan-24GyLAoI.js +1 -0
  5. package/dist/app/assets/PowershellMan-Ic3-jSrq.css +1 -0
  6. package/dist/app/assets/basket-Cj-ZPWsU.svg +73 -0
  7. package/dist/app/assets/bitter-latin-400-normal-B_gsCfHZ.woff +0 -0
  8. package/dist/app/assets/bitter-latin-400-normal-Cl9vToDR.woff2 +0 -0
  9. package/dist/app/assets/bitter-latin-600-normal-B6efaj8C.woff2 +0 -0
  10. package/dist/app/assets/bitter-latin-600-normal-Bm9hnW4x.woff +0 -0
  11. package/dist/app/assets/boot-sheet-C9B_iXU-.webp +0 -0
  12. package/dist/app/assets/chakra-petch-latin-600-normal-DQKfcdKo.woff +0 -0
  13. package/dist/app/assets/chakra-petch-latin-600-normal-DVQm9bgb.woff2 +0 -0
  14. package/dist/app/assets/chakra-petch-latin-700-normal-CnDBPjkL.woff2 +0 -0
  15. package/dist/app/assets/chakra-petch-latin-700-normal-D1s_c2du.woff +0 -0
  16. package/dist/app/assets/chakra-petch-latin-ext-600-normal-CdGvbdDU.woff2 +0 -0
  17. package/dist/app/assets/chakra-petch-latin-ext-600-normal-nL80L4xU.woff +0 -0
  18. package/dist/app/assets/chakra-petch-latin-ext-700-normal-BeviJPUl.woff +0 -0
  19. package/dist/app/assets/chakra-petch-latin-ext-700-normal-DAkvJhej.woff2 +0 -0
  20. package/dist/app/assets/chakra-petch-thai-600-normal-BiM5MXH8.woff +0 -0
  21. package/dist/app/assets/chakra-petch-thai-600-normal-C620THcd.woff2 +0 -0
  22. package/dist/app/assets/chakra-petch-thai-700-normal-B7WL5pBr.woff2 +0 -0
  23. package/dist/app/assets/chakra-petch-thai-700-normal-vZLZ_5L8.woff +0 -0
  24. package/dist/app/assets/chakra-petch-vietnamese-600-normal-Pvj4qcw_.woff +0 -0
  25. package/dist/app/assets/chakra-petch-vietnamese-600-normal-YQPWIhHU.woff2 +0 -0
  26. package/dist/app/assets/chakra-petch-vietnamese-700-normal-ZDCXY9IA.woff2 +0 -0
  27. package/dist/app/assets/chakra-petch-vietnamese-700-normal-gQuUA8Wu.woff +0 -0
  28. package/dist/app/assets/crate-loading-B9H4D652.webp +0 -0
  29. package/dist/app/assets/crate-lost-Dk5CaIuV.webp +0 -0
  30. package/dist/app/assets/dead-drop-BHoO7uon.webp +0 -0
  31. package/dist/app/assets/depot-BjEccEGj.webp +0 -0
  32. package/dist/app/assets/door-open-CL1v6qnp.svg +4 -0
  33. package/dist/app/assets/dungeon-map-Beqcufkh.webp +0 -0
  34. package/dist/app/assets/dungeon-map-T2FZ-7n0.webp +0 -0
  35. package/dist/app/assets/empty-room-BvPyqrlb.webp +0 -0
  36. package/dist/app/assets/{favicon-D8c5IAlv.svg → favicon-pNvr4nr7.svg} +5 -11
  37. package/dist/app/assets/fira-code-cyrillic-600-normal-BD56RyRT.woff +0 -0
  38. package/dist/app/assets/fira-code-cyrillic-600-normal-CPRdbepc.woff2 +0 -0
  39. package/dist/app/assets/fira-code-cyrillic-ext-600-normal-B9wE0zmr.woff2 +0 -0
  40. package/dist/app/assets/fira-code-cyrillic-ext-600-normal-DldcyWhZ.woff +0 -0
  41. package/dist/app/assets/fira-code-greek-600-normal-D_h3X2X5.woff +0 -0
  42. package/dist/app/assets/fira-code-greek-600-normal-Dxp52_By.woff2 +0 -0
  43. package/dist/app/assets/fira-code-greek-ext-600-normal-C-cQDoOk.woff +0 -0
  44. package/dist/app/assets/fira-code-greek-ext-600-normal-DtBpFRLc.woff2 +0 -0
  45. package/dist/app/assets/fira-code-latin-600-normal-BmSSHshu.woff +0 -0
  46. package/dist/app/assets/fira-code-latin-600-normal-CvYZpPHg.woff2 +0 -0
  47. package/dist/app/assets/fira-code-latin-ext-600-normal-0PFQL1eg.woff +0 -0
  48. package/dist/app/assets/fira-code-latin-ext-600-normal-Cb7jxoAi.woff2 +0 -0
  49. package/dist/app/assets/fira-code-symbols2-600-normal-Bu3RnO39.woff2 +0 -0
  50. package/dist/app/assets/fira-code-symbols2-600-normal-Dvq6IQE5.woff +0 -0
  51. package/dist/app/assets/gate-DgvMBPi9.svg +109 -0
  52. package/dist/app/assets/gauge-sheet-ZMjQ7TPd.svg +1 -0
  53. package/dist/app/assets/index-BZCjoilm.js +66 -0
  54. package/dist/app/assets/index-DNYTmC1J.css +1 -0
  55. package/dist/app/assets/jack-in-Cs60f1qu.webp +0 -0
  56. package/dist/app/assets/locked-door-CdXyTY3n.svg +4 -0
  57. package/dist/app/assets/locomotive-CPPtBzL2.webp +0 -0
  58. package/dist/app/assets/overworld-W3adxmKX.webp +0 -0
  59. package/dist/app/assets/press-start-2p-latin-400-normal-KLytu4cr.woff +0 -0
  60. package/dist/app/assets/press-start-2p-latin-400-normal-_wFEWmAB.woff2 +0 -0
  61. package/dist/app/assets/rye-latin-400-normal-CPBiwIfN.woff +0 -0
  62. package/dist/app/assets/rye-latin-400-normal-CnIDrDaJ.woff2 +0 -0
  63. package/dist/app/assets/sage-cave-Bu8KEIPH.webp +0 -0
  64. package/dist/app/assets/sensor-sheet-Dn-dKnev.svg +1 -0
  65. package/dist/app/assets/shard-sheet-NpLu-BuT.svg +101 -0
  66. package/dist/app/assets/skyline-CZ4WZ55S.webp +0 -0
  67. package/dist/app/assets/splash-Dgll39Db.webp +0 -0
  68. package/dist/app/assets/splash-hOSg5Qrh.webp +0 -0
  69. package/dist/app/assets/sprites-BUKsxG6N.webp +0 -0
  70. package/dist/app/assets/sprout-sheet-BLjjvTMl.svg +143 -0
  71. package/dist/app/assets/stone-wall-DRNYiEy2.svg +4 -0
  72. package/dist/app/assets/story-CS6l92Yr.webp +0 -0
  73. package/dist/app/assets/sun-Cyqqe255.svg +72 -0
  74. package/dist/app/assets/survey-map-BI4XT_wf.webp +0 -0
  75. package/dist/app/assets/{theme-crXsh6Dv.css → theme-63MlXwuO.css} +1 -1
  76. package/dist/app/assets/theme-BJDDePbd.css +1 -0
  77. package/dist/app/assets/theme-BVugNGOi.css +1 -0
  78. package/dist/app/assets/theme-C_ukluUB.css +1 -0
  79. package/dist/app/assets/{theme-ZdVuuddo.css → theme-D3_AOEgB.css} +1 -1
  80. package/dist/app/assets/theme-DMjUjC0D.css +1 -0
  81. package/dist/app/assets/title-1MphWZoQ.webp +0 -0
  82. package/dist/app/assets/tray-BHNdSAiO.webp +0 -0
  83. package/dist/app/assets/wanted-poster-BnjUajnc.webp +0 -0
  84. package/dist/app/assets/warp-BNB4TdQ4.webp +0 -0
  85. package/dist/app/assets/wood-CrrZEj6Y.webp +0 -0
  86. package/dist/app/index.html +3 -3
  87. package/dist/server/toil-ui.js +1779 -183
  88. package/package.json +11 -5
  89. package/dist/app/assets/Graph-By9iJybf.js +0 -7
  90. package/dist/app/assets/candle-ledger-LHVvMHKk.webp +0 -0
  91. package/dist/app/assets/crate-loading-Dw5rbPVs.webp +0 -0
  92. package/dist/app/assets/crate-lost-CaqeM6QF.webp +0 -0
  93. package/dist/app/assets/index-DqhhMfsN.js +0 -61
  94. package/dist/app/assets/index-PfJo8IRH.css +0 -1
  95. package/dist/app/assets/pallets-rO-RsztZ.webp +0 -0
  96. package/dist/app/assets/racking-BI-9puyv.webp +0 -0
  97. package/dist/app/assets/theme-CpEaUF3v.css +0 -1
@@ -1,61 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./theme-crXsh6Dv.css","./theme-ZdVuuddo.css","./theme-CpEaUF3v.css","./Graph-By9iJybf.js","./Graph-CeJeskZg.css"])))=>i.map(i=>d[i]);
2
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=ne(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var N=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&&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 ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var oe={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,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})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),M=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),N=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),P=Symbol.for(`react.view_transition`),ue=Symbol.for(`react.recoverable`),de=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=de&&e[de]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case N:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case P:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case M:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function L(e,t){ve++,_e[ve]=e.current,e.current=t}var xe=ye(null),Se=ye(null),Ce=ye(null),we=ye(null);function Te(e,t){switch(L(Ce,t),L(Se,e),L(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(xe),L(xe,e)}function Ee(){be(xe),be(Se),be(Ce)}function De(e){var t=e.memoizedState;t!==null&&(fh._currentValue=t.memoizedState,L(we,e)),t=xe.current;var n=vp(t,e.type);t!==n&&(L(Se,e),L(xe,n))}function Oe(e){Se.current===e&&(be(xe),be(Se)),we.current===e&&(be(we),fh._currentValue=ge)}var ke,R;function Ae(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,R=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+ke+e+R}var z=!1;function je(e,t){if(!e||z)return``;z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ae(n):``}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae(`Lazy`);case 13:return e.child!==t&&t!==null?Ae(`Suspense Fallback`):Ae(`Suspense`);case 19:return Ae(`SuspenseList`);case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return Ae(`Activity`);case 30:return Ae(`ViewTransition`);default:return``}}function Ne(e){try{var t=``,n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var Pe=Object.prototype.hasOwnProperty,Fe=t.unstable_scheduleCallback,Ie=t.unstable_cancelCallback,Le=t.unstable_shouldYield,Re=t.unstable_requestPaint,ze=t.unstable_now,Be=t.unstable_getCurrentPriorityLevel,Ve=t.unstable_ImmediatePriority,He=t.unstable_UserBlockingPriority,Ue=t.unstable_NormalPriority,We=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Ke=t.log,qe=t.unstable_setDisableYieldValue,Je=null,Ye=null;function Xe(e){if(typeof Ke==`function`&&qe(e),Ye&&typeof Ye.setStrictMode==`function`)try{Ye.setStrictMode(Je,e)}catch{}}var Ze=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function at(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function st(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ze(n),i=1<<r;t|=e[r],n&=~i}return t}function ct(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 lt(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ft(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&pt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function pt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=n&42?1:gt(n),(n&(e.suspendedLanes|t))===0?n:0}function gt(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 _t(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Oh(e.type)):e}function yt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var bt=Math.random().toString(36).slice(2),xt=`__reactFiber$`+bt,St=`__reactProps$`+bt,Ct=`__reactContainer$`+bt,wt=`__reactEvents$`+bt,Tt=`__reactListeners$`+bt,Et=`__reactHandles$`+bt,Dt=`__reactResources$`+bt,Ot=`__reactMarker$`+bt,kt=`__reactLoad$`+bt;function At(e){delete e[xt],delete e[St],delete e[Tt],delete e[Et]}function jt(e){var t;if(t=e[xt])return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[xt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Mt(e){if(e=e[xt]||e[Ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Nt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Pt(e){var t=e[Dt];return t||=e[Dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ft(e){e[Ot]=!0}function It(e){e[kt]=void 0}var Lt=new Set,Rt={};function zt(e,t){Bt(e,t),Bt(e+`Capture`,t)}function Bt(e,t){for(Rt[e]=t,e=0;e<t.length;e++)Lt.add(t[e])}var Vt=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]*$`),Ht={},Ut={};function Wt(e){return Pe.call(Ut,e)?!0:Pe.call(Ht,e)?!1:Vt.test(e)?Ut[e]=!0:(Ht[e]=!0,!1)}var Gt=!1;function Kt(){var e=Gt;return Gt=!1,e}function qt(e,t,n){if(Wt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Jt(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 Yt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Xt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Qt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $t(e){if(!e._valueTracker){var t=Zt(e)?`checked`:`value`;e._valueTracker=Qt(e,t,``+e[t])}}function en(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var tn=/[\n"\\]/g;function nn(e){return e.replace(tn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function rn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Xt(t)):e.value!==``+Xt(t)&&(e.value=``+Xt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):on(e,Xt(n)):o===`number`&&e.value==t?on(e,Xt(e.value)):on(e,Xt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Xt(s):e.removeAttribute(`name`)}function an(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){$t(e);return}n=n==null?``:``+Xt(n),t=t==null?n:``+Xt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),$t(e)}function on(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function sn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Xt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cn(e,t,n){t!=null&&(t=``+Xt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Xt(n)}function ln(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Xt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),$t(e)}function un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dn=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 fn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||dn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function pn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Gt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(fn(e,a,r),Gt=!0)}else for(var o in t)t.hasOwnProperty(o)&&fn(e,o,t[o])}function mn(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 hn=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`],[`maskType`,`mask-type`],[`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`]]),gn=/^[\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 _n(e){return gn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function vn(){}var yn=null;function bn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xn=null,Sn=null;function Cn(e){var t=Mt(e);if(t&&(e=t.stateNode)){var n=e[St]||null;a:switch(e=t.stateNode,t.type){case`input`:if(rn(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="`+nn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[St]||null;if(!a)throw Error(i(90));rn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&en(r)}break a;case`textarea`:cn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&sn(e,!!n.multiple,t,!1)}}}var wn=!1;function Tn(e,t,n){if(wn)return e(t,n);wn=!0;try{return e(t)}finally{if(wn=!1,(xn!==null||Sn!==null)&&(Wd(),xn&&(t=xn,e=Sn,Sn=xn=null,Cn(t),e)))for(t=0;t<e.length;t++)Cn(e[t])}}function En(e,t){var n=e.stateNode;if(n===null)return null;var r=n[St]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,On=!1;if(Dn)try{var kn={};Object.defineProperty(kn,"passive",{get:function(){On=!0}}),window.addEventListener(`test`,kn,kn),window.removeEventListener(`test`,kn,kn)}catch{On=!1}var An=null,jn=null,Mn=null;function Nn(){if(Mn)return Mn;var e,t=jn,n=t.length,r,i=`value`in An?An.value:An.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Mn=i.slice(e,1<r?1-r:void 0)}function Pn(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 Fn(){return!0}function In(){return!1}function Ln(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Fn:In,this.isPropagationStopped=In,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Fn)},persist:function(){},isPersistent:Fn}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zn=Ln(Rn),Bn=D({},Rn,{view:0,detail:0}),Vn=Ln(Bn),Hn,Un,Wn,Gn=D({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,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!==Wn&&(Wn&&e.type===`mousemove`?(Hn=e.screenX-Wn.screenX,Un=e.screenY-Wn.screenY):Un=Hn=0,Wn=e),Hn)},movementY:function(e){return`movementY`in e?e.movementY:Un}}),Kn=Ln(Gn),qn=Ln(D({},Gn,{dataTransfer:0})),Jn=Ln(D({},Bn,{relatedTarget:0})),Yn=Ln(D({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0})),Xn=Ln(D({},Rn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Zn=Ln(D({},Rn,{data:0})),Qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},$n={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`},er={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=er[e])?!!t[e]:!1}function nr(){return tr}var rr=Ln(D({},Bn,{key:function(e){if(e.key){var t=Qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?$n[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type===`keypress`?Pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ir=Ln(D({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ar=Ln(D({},Rn,{submitter:0})),or=Ln(D({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr})),sr=Ln(D({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),cr=Ln(D({},Gn,{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})),lr=Ln(D({},Rn,{newState:0,oldState:0,source:0})),ur=[9,13,27,32],dr=Dn&&`CompositionEvent`in window,fr=null;Dn&&`documentMode`in document&&(fr=document.documentMode);var pr=Dn&&`TextEvent`in window&&!fr,mr=Dn&&(!dr||fr&&8<fr&&11>=fr),hr=` `,gr=!1;function _r(e,t){switch(e){case`keyup`:return ur.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function vr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var yr=!1;function br(e,t){switch(e){case`compositionend`:return vr(t);case`keypress`:return t.which===32?(gr=!0,hr):null;case`textInput`:return e=t.data,e===hr&&gr?null:e;default:return null}}function xr(e,t){if(yr)return e===`compositionend`||!dr&&_r(e,t)?(e=Nn(),Mn=jn=An=null,yr=!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 mr&&t.locale!==`ko`?null:t.data;default:return null}}var Sr={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 Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Sr[e.type]:t===`textarea`}function wr(e,t,n,r){xn?Sn?Sn.push(r):Sn=[r]:xn=r,t=ep(t,`onChange`),0<t.length&&(n=new zn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Tr=null,Er=null;function Dr(e){qf(e,0)}function Or(e){if(en(Nt(e)))return e}function kr(e,t){if(e===`change`)return t}var Ar=!1;if(Dn){var jr;if(Dn){var Mr=`oninput`in document;if(!Mr){var Nr=document.createElement(`div`);Nr.setAttribute(`oninput`,`return;`),Mr=typeof Nr.oninput==`function`}jr=Mr}else jr=!1;Ar=jr&&(!document.documentMode||9<document.documentMode)}function Pr(){Tr&&(Tr.detachEvent(`onpropertychange`,Fr),Er=Tr=null)}function Fr(e){if(e.propertyName===`value`&&Or(Er)){var t=[];wr(t,Er,e,bn(e)),Tn(Dr,t)}}function Ir(e,t,n){e===`focusin`?(Pr(),Tr=t,Er=n,Tr.attachEvent(`onpropertychange`,Fr)):e===`focusout`&&Pr()}function Lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Or(Er)}function Rr(e,t){if(e===`click`)return Or(t)}function zr(e,t){if(e===`input`||e===`change`)return Or(t)}function Br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Vr=typeof Object.is==`function`?Object.is:Br;function Hr(e,t){if(Vr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Pe.call(t,i)||!Vr(e[i],t[i]))return!1}return!0}function Ur(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gr(e,t){var n=Wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Wr(n)}}function Kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ur(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=Ur(e.document)}return t}function Jr(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 Yr=Dn&&`documentMode`in document&&11>=document.documentMode,Xr=null,Zr=null,Qr=null,$r=!1;function ei(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$r||Xr==null||Xr!==Ur(r)||(r=Xr,`selectionStart`in r&&Jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Qr&&Hr(Qr,r)||(Qr=r,r=ep(Zr,`onSelect`),0<r.length&&(t=new zn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Xr)))}function ti(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ni={animationend:ti(`Animation`,`AnimationEnd`),animationiteration:ti(`Animation`,`AnimationIteration`),animationstart:ti(`Animation`,`AnimationStart`),transitionrun:ti(`Transition`,`TransitionRun`),transitionstart:ti(`Transition`,`TransitionStart`),transitioncancel:ti(`Transition`,`TransitionCancel`),transitionend:ti(`Transition`,`TransitionEnd`)},ri={},ii={};Dn&&(ii=document.createElement(`div`).style,`AnimationEvent`in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),`TransitionEvent`in window||delete ni.transitionend.transition);function ai(e){if(ri[e])return ri[e];if(!ni[e])return e;var t=ni[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ii)return ri[e]=t[n];return e}var oi=ai(`animationend`),si=ai(`animationiteration`),ci=ai(`animationstart`),li=ai(`transitionrun`),ui=ai(`transitionstart`),di=ai(`transitioncancel`),fi=ai(`transitionend`),pi=new Map,mi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);mi.push(`scrollEnd`);function hi(e,t){pi.set(e,t),zt(t,[e])}var gi=0;function _i(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=gi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function vi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function yi(e,t){return e=vi(e),t=vi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var bi=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&&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)},xi=[],Si=0,Ci=0;function wi(){for(var e=Si,t=Ci=Si=0;t<e;){var n=xi[t];xi[t++]=null;var r=xi[t];xi[t++]=null;var i=xi[t];xi[t++]=null;var a=xi[t];if(xi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Oi(n,i,a)}}function Ti(e,t,n,r){xi[Si++]=e,xi[Si++]=t,xi[Si++]=n,xi[Si++]=r,Ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ei(e,t,n,r){return Ti(e,t,n,r),ki(e)}function Di(e,t){return Ti(e,null,null,t),ki(e)}function Oi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ki(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function ji(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(e,t,n,r){return new ji(e,t,n,r)}function Ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pi(e,t){var n=e.alternate;return n===null?(n=Mi(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&1206910976,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 Fi(e,t){e.flags&=1206910978;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 Ii(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ni(r)&&(s=1);else if(typeof r==`string`)s=Qm(e,n,xe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Mi(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return Li(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Mi(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case N:return e=Mi(13,n,t,a),e.elementType=N,e.lanes=o,e;case ie:return e=Mi(19,n,t,a),e.elementType=ie,e.lanes=o,e;case ce:case P:return e=a|32,e=Mi(30,n,t,e),e.elementType=P,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Li(e,t,n,r){return e=Mi(7,e,r,t),e.lanes=n,e}function Ri(e,t,n){return e=Mi(6,e,null,t),e.lanes=n,e}function zi(e){var t=Mi(18,null,null,0);return t.stateNode=e,t}function B(e,t,n){return t=Mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bi=new WeakMap;function Vi(e,t){if(typeof e==`object`&&e){var n=Bi.get(e);return n===void 0?(t={value:e,source:t,stack:Ne(t)},Bi.set(e,t),t):n}return{value:e,source:t,stack:Ne(t)}}var Hi=[],Ui=0,Wi=null,Gi=0,Ki=[],qi=0,Ji=null,Yi=1,Xi=``;function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Wi,Wi=e,Gi=t}function Qi(e,t,n){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Ji=e;var r=Yi;e=Xi;var i=32-Ze(r)-1;r&=~(1<<i),n+=1;var a=32-Ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-Ze(t)+i|n<<i|r,Xi=a+e}else Yi=1<<a|n<<i|r,Xi=e}function $i(e){e.return!==null&&(Zi(e,1),Qi(e,1,0))}function ea(e){for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null;for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Xi=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null}function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Yi=t.id,Xi=t.overflow,Ji=e}var na=null,ra=null,V=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[xt]=e,t[St]=r,n){case`dialog`:K(`cancel`,t),K(`close`,t);break;case`iframe`:case`object`:case`embed`:K(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)K(Gf[n],t);break;case`source`:K(`error`,t);break;case`img`:case`image`:case`link`:K(`error`,t),K(`load`,t);break;case`details`:K(`toggle`,t);break;case`input`:K(`invalid`,t),an(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:K(`invalid`,t);break;case`textarea`:K(`invalid`,t),ln(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||op(t.textContent,n)?(r.popover!=null&&(K(`beforetoggle`,t),K(`toggle`,t)),r.onScroll!=null&&K(`scroll`,t),r.onScrollEnd!=null&&K(`scrollend`,t),r.onClick!=null&&(t.onclick=vn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(na=e.return;na;)switch(na.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:na=na.return}}function ua(e){if(e!==na)return!1;if(!V)return la(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&ra&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=_m(e)}else t===27?(t=ra,kp(e.type)?(e=gm,gm=null,ra=e):ra=t):ra=na?hm(e.stateNode.nextSibling):null;return!0}function da(){ra=na=null,V=!1}function fa(){var e=ia;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=ye(null),ha=null,ga=null;function _a(e,t,n){L(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,be(ma)}function ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ba(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ya(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ya(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ya(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function xa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[fh]:e.push(fh))}a=a.return}return e!==null&&ba(t,e,n,r),t.flags|=262144,e!==null}function Sa(e){for(e=e.firstContext;e!==null;){if(!Vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ca(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wa(e){return Ea(ha,e)}function Ta(e,t){return ha===null&&Ca(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function Na(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Pa=null;function Fa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ia=null,La=0,Ra=0,za=null;function Ba(e,t){if(Ia===null){var n=Ia=[];La=0,Ra=Bf(),za={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return La++,t.then(Va,Va),t}function Va(){if(--La===0&&(Pa=null,Ia!==null)){za!==null&&(za.status=`fulfilled`);var e=Ia;Ia=null,Ra=0,za=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ua=F.S;F.S=function(e,t){if(bd=ze(),typeof t==`object`&&t&&typeof t.then==`function`&&Ba(e,t),Pa!==null)for(var n=Ef;n!==null;)Na(n,Pa),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Na(r,n),r=r.next;if(Ra!==0){r=Pa,r===null&&(r=Pa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ua!==null&&Ua(e,t)};var Wa=ye(null);function Ga(){var e=Wa.current;return e===null?rd.pooledCache:e}function Ka(e,t){t===null?L(Wa,Wa.current):L(Wa,t.pool)}function qa(){var e=Ga();return e===null?null:{parent:Aa._currentValue,pool:e}}var Ja=Error(i(460)),Ya=Error(i(474)),Xa=Error(i(542)),Za={then:function(){}};function Qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function $a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vn,vn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(vn,vn);else{if(e=rd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e}throw to=t,Ja}}function eo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(to=e,Ja):e}}var to=null;function no(){if(to===null)throw Error(i(459));var e=to;return to=null,e}function ro(e){if(e===Ja||e===Xa)throw Error(i(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),$a(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&eo(i)===t.type)?(t=a(t,n.props),so(t,n),t.return=e,t):(t=Ii(n.type,n.key,n.props,null,e.mode,r),so(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=B(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ii(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case A:return t=B(t,e.mode,n),t.return=e,t;case oe:return t=eo(t),f(e,t,n)}if(he(t)||fe(t))return t=Li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===M)return f(e,Ta(e,t),n);co(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=eo(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===M)return p(e,t,Ta(e,n),r);co(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=eo(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===M)return m(e,t,n,Ta(t,r),i);co(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Zi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return V&&Zi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Zi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),V&&Zi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Zi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Zi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),so(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&eo(l)===r.type){n(e,r.sibling),c=a(r,o.props),so(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Li(o.props.children,e.mode,c,o.key),so(c,o),c.return=e,e=c):(c=Ii(o.type,o.key,o.props,null,e.mode,c),so(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=B(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=eo(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,oo(o),c);if(o.$$typeof===M)return _(e,r,Ta(e,o),c);co(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ri(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ja||t===Xa)throw t;var a=Mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),fo=lo(!1),po=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ho(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 go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,nd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ki(e),Oi(e,null,n),t}return Ti(e,r,t,n),ki(e)}function vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}function yo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bo=!1;function xo(){if(bo){var e=za;if(e!==null)throw e}}function So(e,t,n,r){bo=!1;var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(G&f)===f:(r&f)===f){f!==0&&f===Ra&&(bo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:po=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function Co(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Co(n[e],t)}var To=ye(null),Eo=ye(0);function Do(e,t){e=ld,L(Eo,e),L(To,t),ld=e|t.baseLanes}function Oo(){L(Eo,ld),L(To,To.current)}function ko(){ld=Eo.current,be(To),be(Eo)}var Ao=ye(null),jo=null;function Mo(e){var t=e.alternate;L(Lo,Lo.current&1),L(Ao,e),jo===null&&(t===null||To.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){L(Lo,Lo.current),L(Ao,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(L(Lo,Lo.current),L(Ao,e),jo===null&&(jo=e)):Fo()}function Fo(){L(Lo,Lo.current),L(Ao,Ao.current)}function Io(e){be(Ao),jo===e&&(jo=null),be(Lo)}var Lo=ye(0);function Ro(e,t){L(Ao,Ao.current),L(Lo,t)}function zo(e){be(Lo),be(Ao),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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}var Vo=0,H=null,U=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return Vo=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){F.H=mc;var t=U!==null&&U.next!==null;if(Vo=0,Ho=U=H=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&Sa(e)&&(Nc=!0))}function es(e,t,n,r){H=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=U=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(U===null?null:U.memoizedState)!==e&&(H.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}Vo=0,Ho=U=H=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?H.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(U===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=U.next;var t=Ho===null?H.memoizedState:Ho.next;if(t!==null)Ho=t,U=e;else{if(e===null)throw H.alternate===null?Error(i(467)):Error(i(310));U=e,e={memoizedState:U.memoizedState,baseState:U.baseState,baseQueue:U.baseQueue,queue:U.queue,next:null},Ho===null?H.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=$a(Jo,e,t),t=H,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===ue)return;if(e.$$typeof===M)return wa(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ss(),H.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),U,e)}function ps(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Vo&f)===f:(G&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ra&&(d=!0);else if((Vo&p)===p){u=u.next,p===Ra&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,H.lanes|=p,dd|=p;f=u.action,Go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,H.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Vr(o,e.memoizedState)&&(Nc=!0,d&&(n=za,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ms(e){var t=os(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Vr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=H,a=os(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Vr((U||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,rd===null)throw Error(i(349));o||Vo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=ss(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vr(e,n)}catch{return!0}}function bs(e){var t=Di(e,2);t!==null&&zd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){Xe(!0);try{n()}finally{Xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,U,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(V){var n=rd.formState;if(n!==null){a:{var r=H;if(V){if(ra){b:{for(var i=ra,a=aa;i.nodeType!==8;)if(!a||(i=hm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ra=hm(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,H,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,H,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),U,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===Ja?Xa:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=U;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=ss(),H.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();H.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;U!==null&&r!==null&&Zo(r,U.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(H.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=ss(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(nd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(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 Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Vo&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),H.lanes|=e,dd|=e,n)}function Zs(e,t,n,r){return Vr(n,t)?n:To.current===null?!(Vo&106)||Vo&1073741824&&!(G&261930)?(Nc=!0,e.memoizedState=n):(e=Ld(),H.lanes|=e,dd|=e,t):(e=Xs(e,n,r),Vr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,uc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ha(c,r),Id(e)):lc(e,t,r,Id(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,ge,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Id())}function rc(){return wa(fh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=go(n);var r=_o(t,e,n);r!==null&&(zd(r,t,n),vo(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Ei(e,t,n,r),n!==null&&(zd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Id())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Vr(s,o))return Ti(e,t,i,0),rd===null&&wi(),!1}catch{}if(n=Ei(e,t,i,r),n!==null)return zd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=Ei(e,n,r,2),t!==null&&zd(t,e,2)}function dc(e){var t=e.alternate;return e===H||t!==null&&t===H}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}var mc={readContext:wa,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:wa,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){Xe(!0);try{n(t)}finally{Xe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=sc.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,H,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,a=as();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),rd===null)throw Error(i(349));G&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=rd.identifierPrefix;if(V){var n=Xi,r=Yi;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,H)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(nd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:wa,use:ls,useCallback:Js,useContext:wa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),U.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),U,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:wa,use:ls,useCallback:Js,useContext:wa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return U===null?Xs(n,e,t):Zs(n,U.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return U===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,U,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=go(r);i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(zd(t,e,r),vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=go(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(zd(t,e,r),vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=go(n);r.tag=2,t!=null&&(r.callback=t),t=_o(e,r,n),t!==null&&(zd(t,e,n),vo(t,e,n))}};function bc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Hr(n,r)||!Hr(i,a):!0}function xc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yc.enqueueReplaceState(t,t.state,null)}function Sc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){bi(e)}function wc(e){console.error(e)}function Tc(e){bi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){return n=go(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=go(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&xa(t,n,a,!0),n=Ao.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(V)return t=Ao.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Vi(r,n),a=Oc(e.stateNode,r,a),yo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Vi(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),yo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),yo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?fo(t,null,n,r):uo(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ca(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(V&&s&&$i(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Hr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Hr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ka(t,a===null?null:a.cachePool),a===null?Oo():Do(t,a),Po(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ka(t,null),Oo(),Fo()):(Ka(t,a.cachePool),Do(t,a),Fo(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Ga();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ka(t,null),Oo(),Po(t),e!==null&&xa(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return uo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(No(t),(e=ra)?(e=dm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||xa(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(To.current===null){if(r=rd,r!==null&&(s=ht(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Di(e,s),zd(r,e,s),Mc;Zd()}t=Hc(e,t,n)}else e=o.treeContext,ra=hm(s.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return Ca(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(V&&r&&$i(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return Ca(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(V&&r&&$i(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(Ca(t),t.stateNode===null){var a=Ai,o=n.contextType;typeof o==`object`&&o&&(a=wa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},mo(t),o=n.contextType,a.context=typeof o==`object`&&o?wa(o):Ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&yc.enqueueReplaceState(a,a.state,null),So(t,r,a,i),xo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ai,typeof u==`object`&&u&&(o=wa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&xc(t,a,r,o),po=!1;var f=t.memoizedState;a.state=f,So(t,r,a,i),xo(),l=t.memoizedState,s||f!==l||po?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=po||bc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ho(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ai,typeof l==`object`&&l&&(c=wa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&xc(t,a,r,c),po=!1,f=t.memoizedState,a.state=f,So(t,r,a,i),xo();var p=t.memoizedState;o!==d||f!==p||po||e!==null&&e.dependencies!==null&&Sa(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=po||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Sa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return da(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:qa()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(V){if(i?Mo(t):Fo(),(e=ra)?(e=dm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Li(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(Mo(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Pi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Li(i,a,n,null),i.flags|=2):i=Pi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=qa():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Mi(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return uo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Li(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,uo(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,pa({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||xa(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(To.current!==null)return tl(e,t,c);if(r=rd,r!==null&&(a=ht(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Di(e,a),zd(r,e,a),Mc;return fm(o)||Zd(),tl(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ra=hm(o.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ya(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function al(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=V?Gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(xa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Sa(e)))}function dl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),_a(t,Aa,e.memoizedState.cache),da();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=xa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(Mo(t),e=ll(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(xa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:_a(t,Aa,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,V&&t.flags&1048576&&Qi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=eo(t.elementType),t.type=e,typeof e==`function`)Ni(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ho(e,t),So(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Aa,r),r!==o.cache&&ba(t,[Aa],n,!0),xo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==a){a=Vi(Error(i(424)),t),pa(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ra=hm(e.firstChild),na=t,V=!0,ia=null,aa=!0,n=fo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Rm(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(t.stateNode=yp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&V&&(r=t.stateNode=bm(t.type,t.pendingProps,Ce.current),na=t,aa=!0,a=ra,kp(t.type)?(gm=a,ra=hm(r.firstChild)):ra=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=ra)&&(r=lm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,na=t,ra=hm(r.firstChild),aa=!1,a=!0)),a||sa(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),fh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=ra)&&(n=um(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,na=t,ra=null,e=!0)),e||sa(t)),null;case 13:return Qc(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ca(t),a=wa(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return Ca(t),r=wa(Aa),e===null?(a=Ga(),a===null&&(a=rd,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},mo(t),_a(t,Aa,a)):((e.lanes&n)!==0&&(ho(e,t),So(t,null,null,n),xo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Aa,r),r!==a.cache&&ba(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Aa,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:V&&$i(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?$m(t,r):$m(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Jd())e.flags|=8192;else throw to=Za,Ya}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t)){if(Jd())e.flags|=8192;else throw to=Za,Ya}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,hd|=t)}function _l(e,t){if(!V)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function vl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yl(e,t,n){var r=t.pendingProps;switch(ea(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Aa),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=xe.current,ua(t)?ca(t,e):(e=bm(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=xe.current,ua(t))ca(t,o);else{var s=gp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[xt]=t,o[St]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(lp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=na,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[xt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||sa(t,!0)}else e=gp(e).createTextNode(r),e[xt]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[xt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[xt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gl(t,t.updateQueue),vl(t),null);case 4:return Ee(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return va(t.type),vl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Fi(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),V&&Zi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ze()>xd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!V)return vl(t),null}else 2*ze()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ze(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||V?Ro(t,o):(n=o,L(Ao,t),L(Lo,n),jo===null&&(jo=t)),V&&Zi(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Io(t),ko(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Aa),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(ea(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Aa),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return va(t.type),null;case 22:case 23:return Io(t),ko(),e!==null&&be(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Aa),null;case 25:return null;default:return null}}function xl(e,t){switch(ea(t),t.tag){case 3:va(Aa),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:va(t.type);break;case 22:case 23:Io(t),ko(),e!==null&&be(Wa);break;case 24:va(Aa)}}function Sl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){yf(t,t.return,e)}}function Cl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(t){yf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=_i(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);h(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){yf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){yf(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&om(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&sm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){yf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[St]=t}catch(t){yf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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&&kp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vn)),Ol(e,r),Gt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,kp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),Gt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,kp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lp(t,r,n),t[xt]=e,t[St]=n}catch(t){yf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=q(o);r.push(s),s.view&&(a=!0)}else a||q(o).view&&(a=!0);Bl=!0,Mp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Np(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=yi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=_i(r,n),a=yi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Rd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=yi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=yi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Rd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode);t=yi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=q(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Mp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=_i(n,r),a=yi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,mp=xh,e=qr(e),Jr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(hp={focusedElem:e,selectionRange:r},xh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&$l(e),gu(n))}}Vl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=_i(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=yi(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Sl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Lu(e,n),r&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{wo(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),au=t,ou=i}break;case 30:Lu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){yf(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Gt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?jp(s,!0):jp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&At(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 Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount==`function`)try{Ye.onCommitFiberUnmount(Je,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=Su,i=Cu;kp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),xm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),Gt=!0}catch(e){yf(n,t,e)}else try{Su.removeChild(n.stateNode),Gt=!0}catch(e){yf(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Ap(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qh(e)):Ap(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),wu(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,wu(e,t,n),ou=r;break;case 30:Dl(n,t),wu(e,t,n);break;case 7:ou||Dl(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qh(e)}catch(e){yf(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qh(e)}catch(e){yf(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(kp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=yp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ot]||r[xt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),lp(r,t,n),r[xt]=e,Ft(r),t=r;break a;case`link`:if(o=Xm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Xm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[xt]=e,Ft(r),t=r}e.stateNode=t}}else au||Zm(o,e.type,e.stateNode)}else e.stateNode=Gm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||Zm(o,e.type,e.stateNode):Gm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{un(t,``),Gt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Gt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Gt=!1,Ym=null,o=ju,ju=Tm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{qh(t.containerInfo)}catch(t){yf(e,e.return,t)}cu&&(cu=!1,Pu(e)),Gt=!1;break;case 4:a=su,su=au,r=Kt(),o=ju,ju=Tm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,Gt&&fu&&(pu=!0),Gt=r,su=a;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=ze()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=su;au=c||o,su=u||o,ou=l||s,Au(t,e,n),ou=l,su=u,au=c,Nu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Ru(e,2),au=n,ou=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=Kt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&yi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&Gt&&(e.flags|=4),fu=o,Gt=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(un(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xh=!0,t.reset(),xh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else iu(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Wl(),Fu(t,e),!du&&!pu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Np(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Ul=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Xl(e,!1));break;case 30:r=du,i=Wl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=_i(a,o),o=_i(n.memoizedProps,o);var s=yi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Ru(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Ru(n,r);break;case 27:r&2&&xm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Ru(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Dl(n,n.return),Ru(n,r);break;case 7:Dl(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Sl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Co(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Zm(Tm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),El(a,a.return);break;case 30:zu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(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&&Ma(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){yf(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Wu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&nh(n,e)):rh(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&nh(n,e));break;case 3:case 4:var r=ju;ju=Tm(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(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 Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:Cl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=wa(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wa(Aa).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,nd=0,rd=null,W=null,G=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return nd&2&&G!==0?G&-G:F.T===null?vt():Bf()}function Ld(){if(md===0){if(!(G&536870912)||V){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),md=e}else md=536870912}return e=Ao.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(_i(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===rd&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,G,md,!1)),dt(e,n),(!(nd&2)||e!==rd)&&(e===rd&&(!(nd&2)&&(fd|=n),ud===4&&Ud(e,G,md,!1)),Mf(e))}function Bd(e,t,n){if(nd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ot(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n))a=Qd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-ze(),10<a)){if(Ud(r,t,md,!od),at(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=Cp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}}while(1);Mf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vn},Vl=null,Ju(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=sh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-ze():(a&4194048)===a?bd-ze():0,m=ah(d,m),m!==null)?(Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l)):cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Vr(a(),i))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 Ud(e,t,n,r){t=st(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&pt(e,n,t)}function Wd(){return nd&6?!0:(Nf(0,!1),!1)}function Gd(){if(W!==null){if(id===0)var e=W.return;else e=W,ga=ha=null,is(e),io=null,ao=0,e=W;for(;e!==null;)xl(e.alternate,e),e=e.return;W=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),rd=e,W=n=Pi(e.current,null),G=t,id=0,ad=null,od=!1,sd=ot(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=st(e,t),wi(),n}function qd(e,t){H=null,F.H=mc,t===Ja||t===Xa?(t=no(),id=3):t===Ya?(t=no(),id=4):id=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,W===null&&(ud=1,Ec(e,Vi(t,e.current)))}function Jd(){var e=Ao.current;return e===null?!0:(G&4194048)===G?jo===null:(G&62914560)===G||G&536870912?e===jo:!1}function Yd(){var e=F.H;return F.H=mc,e===null?mc:e}function Xd(){var e=F.A;return F.A=ed,e}function Zd(){ud=4,od||(G&4194048)!==G&&Ao.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||rd===null||Ud(rd,G,md,!1)}function Qd(e,t,n){var r=nd;nd|=2;var i=Yd(),a=Xd();(rd!==e||G!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&W!==null){var s=W,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:Ao.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,ga=ha=null,nd=r,F.H=i,F.A=a,W===null&&(rd=null,G=0,wi()),o}function $d(){for(;W!==null;)nf(W)}function ef(e,t){var n=nd;nd|=2;var r=Yd(),a=Xd();rd!==e||G!==t?(Sd=null,xd=ze()+500,Kd(e,t)):sd=ot(e,t);a:do try{if(id!==0&&W!==null){t=W;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if(Qa(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||rd!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:Qa(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(W.tag){case 26:s=W.memoizedState;case 5:case 27:var c=W;if(s?eh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)W=l;else{var u=c.return;u===null?W=null:(W=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return ga=ha=null,F.H=r,F.A=a,nd=n,W===null?(rd=null,G=0,wi(),ud):0}function tf(){for(;W!==null&&!Le();)nf(W)}function nf(e){var t=fl(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):W=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,G);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:is(t);var r=t;r===na&&(V?(la(r),r.tag===5&&r.stateNode!=null&&(ra=r.stateNode)):(la(r),V=!0));default:xl(n,t),t=W=Fi(t,ld),t=fl(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):W=t}function af(e,t,n,r){ga=ha=null,is(t),io=null,ao=0;var i=t.return;try{if(jc(e,i,t,n,G)){ud=1,Ec(e,Vi(n,e.current)),W=null;return}}catch(t){if(i!==null)throw W=i,t;ud=1,Ec(e,Vi(n,e.current)),W=null;return}t.flags&32768?(V||r===1?e=!0:sd||G&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=yl(t.alternate,t,ld);if(n!==null){W=n;return}if(t=t.sibling,t!==null){W=t;return}W=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,W=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){W=e;return}W=e=n}while(e!==null);ud=6,W=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(nd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===rd&&(W=rd=null,G=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=Ci,ft(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Fa(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ue,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=nd,nd|=4;try{hu(e,t,n)}finally{nd=a,I.p=i,F.T=r}}wd=1,Bl?jd=Rp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Iu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=nd;nd|=4;try{fu=pu=!1,Mu(t,e,n),n=hp;var o=qr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Kr(s.ownerDocument.documentElement,s)){if(c!==null&&Jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Gr(s,h),v=Gr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}xh=!!mp,hp=mp=null}finally{nd=a,I.p=i,F.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=nd;nd|=4;try{_u(e,t.alternate,t)}finally{nd=i,I.p=r,F.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Re();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),_t(r),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot==`function`)try{Ye.onCommitFiberRoot(Je,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{F.T=n,I.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=_t(Dd),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,nd&6)throw Error(i(331));var c=nd;if(nd|=4,Zu(o.current),Uu(o,o.current,s,n),nd=c,Nf(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot==`function`)try{Ye.onPostCommitFiberRoot(Je,o)}catch{}return!0}finally{I.p=a,F.T=r,hf(e,t)}}function vf(e,t,n){t=Vi(n,t),t=Oc(e.stateNode,t,2),e=_o(e,t,2),e!==null&&(dt(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Vi(n,e),n=kc(2),r=_o(t,n,2),r!==null&&(Ac(n,r,t,e),dt(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rd===e&&(G&n)===n&&(ud===4||ud===3&&(G&62914560)===G&&300>ze()-yd?nd&2?pd|=n:Kd(e,0):pd|=n,hd===G&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=lt()),e=Di(e,t),e!==null&&(dt(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Fe(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=G,a=at(r,r===rd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ot(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Sp()&&(e=jf);for(var t=ze(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ct(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=rd,n=G,n=at(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ie(r),_t(n)){case 2:case 8:n=He;break;case 32:n=Ue;break;case 268435456:n=Ge;break;default:n=Ue}return r=Lf.bind(null,e),n=Fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ie(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=G;return r=at(e,e===rd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,ze()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Dp(function(){nd&6?Fe(Ve,Pf):Ff()})}function Bf(){if(jf===0){var e=Ra;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:_n(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[St]||null).action),o=r.submitter;o&&(t=(t=o[St]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new zn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<mi.length;Uf++){var Wf=mi[Uf];hi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}hi(oi,`onAnimationEnd`),hi(si,`onAnimationIteration`),hi(ci,`onAnimationStart`),hi(`dblclick`,`onDoubleClick`),hi(`focusin`,`onFocus`),hi(`focusout`,`onBlur`),hi(li,`onTransitionRun`),hi(ui,`onTransitionStart`),hi(di,`onTransitionCancel`),hi(fi,`onTransitionEnd`),Bt(`onMouseEnter`,[`mouseout`,`mouseover`]),Bt(`onMouseLeave`,[`mouseout`,`mouseover`]),Bt(`onPointerEnter`,[`pointerout`,`pointerover`]),Bt(`onPointerLeave`,[`pointerout`,`pointerover`]),zt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),zt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),zt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),zt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),zt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),zt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`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(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){bi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){bi(e)}i.currentTarget=null,a=c}}}}function K(e,t){var n=t[wt];n===void 0&&(n=t[wt]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Lt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(e,t,n,r){switch(Oh(t)){case 2:var i=Sh;break;case 8:i=Ch;break;default:i=wh}n=i.bind(null,t,n,e),i=void 0,!On||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Qf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=jt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Tn(function(){var r=a,i=bn(n),s=[];a:{var c=pi.get(e);if(c!==void 0){var l=zn,u=e;switch(e){case`keypress`:if(Pn(n)===0)break a;case`keydown`:case`keyup`:l=rr;break;case`focusin`:u=`focus`,l=Jn;break;case`focusout`:u=`blur`,l=Jn;break;case`beforeblur`:case`afterblur`:l=Jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=or;break;case oi:case si:case ci:l=Yn;break;case fi:l=sr;break;case`scroll`:case`scrollend`:l=Vn;break;case`wheel`:l=cr;break;case`copy`:case`cut`:case`paste`:l=Xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ir;break;case`submit`:l=ar;break;case`toggle`:case`beforetoggle`:l=lr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=En(m,p),g!=null&&d.push($f(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==yn&&(u=n.relatedTarget||n.fromElement)&&(jt(u)||u[Ct]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?jt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ir,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Nt(c),h=l==null?u:Nt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,jt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}a:{if(c=r?Nt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=kr;else if(Cr(c)){if(Ar)_=zr;else{_=Lr;var v=Ir}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&mn(r.elementType)&&(_=kr):_=Rr;if(_&&=_(e,r)){wr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Nt(r):window,e){case`focusin`:(Cr(v)||v.contentEditable===`true`)&&(Xr=v,Zr=r,Qr=null);break;case`focusout`:Qr=Zr=Xr=null;break;case`mousedown`:$r=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:$r=!1,ei(s,n,i);break;case`selectionchange`:if(Yr)break;case`keydown`:case`keyup`:ei(s,n,i)}var y;if(dr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else yr?_r(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(mr&&n.locale!==`ko`&&(yr||b!==`onCompositionStart`?b===`onCompositionEnd`&&yr&&(y=Nn()):(An=i,jn=`value`in An?An.value:An.textContent,yr=!0)),v=ep(r,b),0<v.length&&(b=new Zn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=vr(n),y!==null&&(b.data=y)))),(y=pr?br(e,n):xr(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=En(e,n),i!=null&&r.unshift($f(e,i,a)),i=En(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=En(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=En(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
10
- `).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||un(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&un(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:pn(e,r,o);return;case`data`:if(t!==`object`){Jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=_n(r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:K(`beforetoggle`,e),K(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=hn.get(n)||n,qt(e,n,r);else return}Gt=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:pn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)un(e,r);else if(typeof r==`number`||typeof r==`bigint`)un(e,``+r);else return;break;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Rt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[St]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Gt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}Gt=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:K(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:sp(e,t,r,d,n,null)}}an(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&sn(e,!!r,n,!0):sn(e,!!r,t,!1);return;case`textarea`:for(s in K(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:sp(e,t,s,c,n,null)}ln(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:sp(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)K(Gf[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:sp(e,t,u,r,n,null)}return;default:if(mn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||sp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Gt=!0),o=m;break;case`name`:m!==f&&(Gt=!0),a=m;break;case`checked`:m!==f&&(Gt=!0),u=m;break;case`defaultChecked`:m!==f&&(Gt=!0),d=m;break;case`value`:m!==f&&(Gt=!0),s=m;break;case`defaultValue`:m!==f&&(Gt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}rn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||sp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Gt=!0),p=o;break;case`defaultValue`:o!==l&&(Gt=!0),c=o;break;case`multiple`:o!==l&&(Gt=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?sn(e,!!n,n?[]:``,!1):sn(e,!!n,t,!0)):sn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:sp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Gt=!0),p=a;break;case`defaultValue`:a!==o&&(Gt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}cn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:sp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Gt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:sp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&sp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:sp(e,t,u,p,r,m)}return;default:if(mn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||sp(e,t,f,p,r,m)}function fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&fp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&fp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[xt]=r,n[St]=t,lp(n,e,t),Ft(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sm(e.ownerDocument.body)}n=i}while(n);qh(t)}function jp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Mp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Np(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Pp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function q(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=th(f),u>ih){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=b(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=gp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,J(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=jt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),rm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),rm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=b(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(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`:cm(n),At(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function J(e){Ep(function(){Ep(function(t){return e(t)})})}function bm(e,t,n){switch(t=gp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function xm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),At(e)}function Sm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);At(e)}var Cm=new Map,wm=new Set;function Tm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Em=I.d;I.d={f:Dm,r:Om,D:jm,C:Mm,L:Nm,m:Pm,X:Im,S:Fm,M:Lm};function Dm(){var e=Em.f(),t=Wd();return e||t}function Om(e){var t=Mt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Em.r(e)}var km=typeof document>`u`?null:document;function Am(e,t,n){var r=km;if(r&&typeof t==`string`&&t){var i=nn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wm.has(i)||(wm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),Ft(t),r.head.appendChild(t)))}}function jm(e){Em.D(e),Am(`dns-prefetch`,e,null)}function Mm(e,t){Em.C(e,t),Am(`preconnect`,e,t)}function Nm(e,t,n){Em.L(e,t,n);var r=km;if(r&&e&&t){var i=`link[rel="preload"][as="`+nn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+nn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+nn(n.imageSizes)+`"]`)):i+=`[href="`+nn(e)+`"]`;var a=i;switch(t){case`style`:a=zm(e);break;case`script`:a=Um(e)}if(!(Cm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bm(a))||t===`script`&&r.querySelector(Wm(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[kt]=!0,o.onload=o.onerror=function(){It(o)}),Ft(o),r.head.appendChild(o)}}}function Pm(e,t){Em.m(e,t);var n=km;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+nn(r)+`"][href="`+nn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Um(e)}if(!Cm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Cm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wm(a)))return}r=n.createElement(`link`),lp(r,`link`,e),Ft(r),n.head.appendChild(r)}}}function Fm(e,t,n){Em.S(e,t,n);var r=km;if(r&&e){var i=Pt(r).hoistableStyles,a=zm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cm.get(a))&&qm(e,n);var c=o=r.createElement(`link`);Ft(c),lp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Km(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Im(e,t){Em.X(e,t);var n=km;if(n&&e){var r=Pt(n).hoistableScripts,i=Um(e),a=r.get(i);a||(a=n.querySelector(Wm(i)),a||(e=D({src:e,async:!0},t),(t=Cm.get(i))&&Jm(e,t),a=n.createElement(`script`),Ft(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t){Em.M(e,t);var n=km;if(n&&e){var r=Pt(n).hoistableScripts,i=Um(e),a=r.get(i);a||(a=n.querySelector(Wm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Cm.get(i))&&Jm(e,t),a=n.createElement(`script`),Ft(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t,n,r){var a=(a=Ce.current)?Tm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=zm(n.href),t=Pt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zm(n.href);var o=Pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Cm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cm.set(e,o)),Hm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Um(n),t=Pt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zm(e){return`href="`+nn(e)+`"`}function Bm(e){return`link[rel="stylesheet"][`+e+`]`}function Vm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Hm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[kt]){r.loading=1;return}}else t=e.createElement(`link`),t[kt]=!0,t.onload=t.onerror=It.bind(null,t),lp(t,`link`,n),Ft(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Um(e){return`[src="`+nn(e)+`"]`}function Wm(e){return`script[async]`+e}function Gm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+nn(n.href)+`"]`);if(r)return t.instance=r,Ft(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ft(r),lp(r,`style`,a),Km(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zm(n.href);var o=e.querySelector(Bm(a));if(o)return t.state.loading|=4,t.instance=o,Ft(o),o;r=Vm(n),(a=Cm.get(a))&&qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,Km(o,n.precedence,e),t.instance=o;case`script`:return o=Um(n.src),(a=e.querySelector(Wm(o)))?(t.instance=a,Ft(a),a):(r=n,(a=Cm.get(o))&&(r=D({},n),Jm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ft(a),lp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Km(r,n.precedence,e));return t.instance}function Km(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Ym=null;function Xm(e,t,n){if(Ym===null){var r=new Map,i=Ym=new Map;i.set(n,r)}else i=Ym,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ot]||a[xt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Zm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qm(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 $m(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function eh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function th(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function nh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=th(t),e.suspenseyImages.push(t)),e=ch.bind(e),t.decode().then(e,e))}function rh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zm(r.href),a=t.querySelector(Bm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=sh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ft(a);return}a=t.ownerDocument||t,r=Vm(r),(i=Cm.get(i))&&qm(r,i),a=a.createElement(`link`),Ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=sh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ih=0;function ah(e,t){return e.stylesheets&&e.count===0&&uh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ih===0&&(ih=62500*pp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ih?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function oh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)uh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function sh(){this.count--,oh(this)}function ch(){this.imgCount--,oh(this)}var lh=null;function uh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lh=new Map,t.forEach(dh,e),lh=null,sh.call(e))}function dh(e,t){if(!(t.state.loading&4)){var n=lh.get(e);if(n)var r=n.get(null);else{n=new Map,lh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=sh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fh={$$typeof:M,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function ph(e,t,n,r,i,a,o,s,c){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=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function mh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ph(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Mi(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function hh(e){return e?(e=Ai,e):Ai}function gh(e,t,n,r,i,a){i=hh(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(zd(n,e,t),vo(n,e,t))}function _h(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vh(e,t){_h(e,t),(e=e.alternate)&&_h(e,t)}function yh(e){if(e.tag===13||e.tag===31){var t=Di(e,67108864);t!==null&&zd(t,e,67108864),vh(e,67108864)}}function bh(e){if(e.tag===13||e.tag===31){var t=Id();t=gt(t);var n=Di(e,t);n!==null&&zd(n,e,t),vh(e,t)}}var xh=!0;function Sh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,wh(e,t,n,r)}finally{I.p=a,F.T=i}}function Ch(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,wh(e,t,n,r)}finally{I.p=a,F.T=i}}function wh(e,t,n,r){if(xh){var i=Th(r);if(i===null)Qf(e,t,r,Eh,n),Lh(e,r);else if(zh(i,e,t,n,r))r.stopPropagation();else if(Lh(e,r),t&4&&-1<Ih.indexOf(e)){for(;i!==null;){var a=Mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(nd&6)&&(xd=ze()+500,Nf(0,!1))}}break;case 31:case 13:s=Di(a,2),s!==null&&zd(s,a,2),Wd(),vh(a,2)}if(a=Th(r),a===null&&Qf(e,t,r,Eh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Th(e){return e=bn(e),Dh(e)}var Eh=null;function Dh(e){if(Eh=null,e=jt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 Eh=e,null}function Oh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Be()){case Ve:return 2;case He:return 8;case Ue:case We:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var kh=!1,Ah=null,jh=null,Mh=null,Nh=new Map,Ph=new Map,Fh=[],Ih=`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 Lh(e,t){switch(e){case`focusin`:case`focusout`:Ah=null;break;case`dragenter`:case`dragleave`:jh=null;break;case`mouseover`:case`mouseout`:Mh=null;break;case`pointerover`:case`pointerout`:Nh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ph.delete(t.pointerId)}}function Rh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Mt(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zh(e,t,n,r,i){switch(t){case`focusin`:return Ah=Rh(Ah,e,t,n,r,i),!0;case`dragenter`:return jh=Rh(jh,e,t,n,r,i),!0;case`mouseover`:return Mh=Rh(Mh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Nh.set(a,Rh(Nh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ph.set(a,Rh(Ph.get(a)||null,e,t,n,r,i)),!0}return!1}function Bh(e){var t=jt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,yt(e.priority,function(){bh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,yt(e.priority,function(){bh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Th(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yn=r,n.target.dispatchEvent(r),yn=null}else return t=Mt(n),t!==null&&yh(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Vh(e)&&n.delete(t)}function Uh(){kh=!1,Ah!==null&&Vh(Ah)&&(Ah=null),jh!==null&&Vh(jh)&&(jh=null),Mh!==null&&Vh(Mh)&&(Mh=null),Nh.forEach(Hh),Ph.forEach(Hh)}function Wh(e,n){e.blockedOn===n&&(e.blockedOn=null,kh||(kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Uh)))}var Gh=null;function Kh(e){Gh!==e&&(Gh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===e&&(Gh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Dh(r||n)===null)continue;break}var a=Mt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qh(e){function t(t){return Wh(t,e)}Ah!==null&&Wh(Ah,e),jh!==null&&Wh(jh,e),Mh!==null&&Wh(Mh,e),Nh.forEach(t),Ph.forEach(t);for(var n=0;n<Fh.length;n++){var r=Fh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fh.length&&(n=Fh[0],n.blockedOn===null);)Bh(n),n.blockedOn===null&&Fh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[St]||null;if(typeof a==`function`)o||Kh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[St]||null)s=o.formAction;else if(Dh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kh(n)}}}function Jh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Yh(e){this._internalRoot=e}Xh.prototype.render=Yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;gh(n,Id(),e,t,null,null)},Xh.prototype.unmount=Yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gh(e.current,2,null,e,null,null),Wd(),t[Ct]=null}};function Xh(e){this._internalRoot=e}Xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fh.length&&t!==0&&t<Fh[n].priority;n++);Fh.splice(n,0,e),n===0&&Bh(e)}};var Zh=n.version;if(Zh!==`19.3.0`)throw Error(i(527,Zh,`19.3.0`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Je=$h.inject(Qh),Ye=$h}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mh(e,1,!1,null,null,n,r,null,o,s,c,Jh),e[Ct]=t.current,Xf(e),new Yh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}));function _(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var v=c(u(),1),y=typeof document<`u`?v.useLayoutEffect:()=>{},b={prefix:String(Math.round(Math.random()*1e10)),current:0},x=v.createContext(b),S=v.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;var C=new WeakMap;function w(e=!1){let t=(0,v.useContext)(x),n=(0,v.useRef)(null);if(n.current===null&&!e){let e=v.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=C.get(e);n==null?C.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,C.delete(e))}n.current=++t.current}return n.current}function T(e){let t=(0,v.useContext)(x),n=w(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function E(e){let t=v.useId(),[n]=(0,v.useState)(j()),r=n?`react-aria`:`react-aria${b.prefix}`;return e||`${r}-${t}`}var D=typeof v.useId==`function`?E:T;function O(){return!1}function k(){return!0}function A(e){return()=>{}}function j(){return typeof v.useSyncExternalStore==`function`?v.useSyncExternalStore(A,O,k):(0,v.useContext)(S)}function ee(e){let[t,n]=(0,v.useState)(e),r=(0,v.useRef)(t),i=(0,v.useRef)(null),a=(0,v.useRef)(()=>{if(!i.current)return;let e=i.current.next();e.done?i.current=null:r.current===e.value?a.current():n(e.value)});return y(()=>{r.current=t,i.current&&a.current()}),[t,(0,v.useCallback)(e=>{i.current=e(r.current),a.current()},[a])]}var te=!!(typeof window<`u`&&window.document&&window.document.createElement),ne=new Map,M;typeof FinalizationRegistry<`u`&&(M=new FinalizationRegistry(e=>{ne.delete(e)}));var re=new WeakMap;function N(e){let[t,n]=(0,v.useState)(e),r=(0,v.useRef)(null),i=D(t),a=(0,v.useRef)(null),o=re.get(a);if(M&&o!==i&&(o!=null&&M.unregister(a),M.register(a,i,a),re.set(a,i)),te){let e=ne.get(i);e&&!e.includes(r)?e.push(r):ne.set(i,[r])}return y(()=>{let e=i;return()=>{M&&(M.unregister(a),re.delete(a)),ne.delete(e)}},[i]),(0,v.useEffect)(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function ie(e,t){if(e===t)return e;let n=ne.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=ne.get(t);return r?(r.forEach(t=>t.current=e),e):t}function ae(e=[]){let t=N(),[n,r]=ee(t),i=(0,v.useCallback)(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return y(i,[t,i,...e]),n}function oe(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=se(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():se(e[n],null)})}}}function se(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ce(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ce(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function le(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ce(e))&&(r&&(r+=` `),r+=t);return r}function P(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];typeof n==`function`&&typeof i==`function`&&e[0]===`o`&&e[1]===`n`&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=_(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=le(n,i):e===`id`&&n&&i?t.id=ie(n,i):e===`ref`&&n&&i?t.ref=oe(n,i):t[e]=i===void 0?n:i}}return t}function ue(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(void 0),r=(0,v.useCallback)(t=>{if(typeof e==`function`){let n=e,r=n(t);return()=>{typeof r==`function`?r():n(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,v.useMemo)(()=>({get current(){return t.current},set current(e){t.current=e,n.current&&=(n.current(),void 0),e!=null&&(n.current=r(e))}}),[r])}var de=Symbol(`default`);function fe({values:e,children:t}){for(let[n,r]of e)t=v.createElement(n.Provider,{value:r},t);return t}function pe(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:c}=e;return(0,v.useMemo)(()=>{let e,l,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,l=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:l||o?{...o,...l}:void 0,children:u??a,"data-rac":``,render:c?e=>c(e,s):void 0}},[t,n,r,i,a,o,s,c])}function me(e,t){let n=(0,v.useContext)(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||de;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function he(e,t,n){let{ref:r,...i}=me(n,e.slot)||{},a=ue((0,v.useMemo)(()=>oe(t,r),[t,r])),o=P(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function F(e=!0){let[t,n]=(0,v.useState)(e),r=(0,v.useRef)(!1),i=(0,v.useCallback)(e=>{r.current=!0,n(!!e)},[]);return y(()=>{r.current||n(!1)},[]),[i,t]}function I(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function ge(e,t,n){let{render:r,...i}=t,a=(0,v.useRef)(null),o=(0,v.useMemo)(()=>oe(n,a),[n,a]);y(()=>{},[e,r]);let s={...i,ref:o};return r?r(s,void 0):v.createElement(e,s)}var _e={},ve=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=_e[t];return n||(n=(0,v.forwardRef)(ge.bind(null,t)),_e[t]=n),n}}),ye=`react-aria-clear-focus`,be=`react-aria-focus`,L=e=>Ce(e)?e.document:we(e)?e:e?.ownerDocument??(typeof document<`u`?document:void 0),xe=e=>L(e)?.defaultView??(typeof window<`u`?window:void 0);function Se(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Ce(e){return typeof e==`object`&&!!e&&`window`in e&&e.window===e}function we(e){return Se(e)&&e.nodeType===9}function Te(e){return Se(e)&&e.nodeType===11&&`host`in e}function Ee(e,t,n,r){if(n==null||e==null)return()=>{};let i=Array.isArray(e)?e:[e];for(let e of i)e.addEventListener(t,n,r);return()=>{for(let e of i)e.removeEventListener(t,n,r)}}function De(e,t,n,r){if(e==null)return()=>{};let i=[],a=Array.isArray(e)?e:[e];for(let e of a){let a=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);e.style.setProperty(t,n,r),i.unshift(()=>{a?e.style.setProperty(t,a,o):e.style.removeProperty(t)})}return()=>{for(let e of i)e()}}var Oe=!1;function ke(){return Oe}function R(e,t){if(!ke())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=typeof n.assignedElements!=`function`&&n.assignedSlot?.parentNode?n.assignedSlot.parentNode:Te(n)?n.host:n.parentNode}return!1}var Ae=(e=document)=>{if(!ke())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function z(e){if(ke()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function je(e,t){if(t===null)return[];t??=xe(e);let n=[t];if(!ke()||!e||e===t)return n;let r=`getRootNode`in t?t.getRootNode():null,i=e.getRootNode()??null;for(;Te(i)&&i!==r;)n.push(i),i=i.host.getRootNode();return n}function Me(e){if(!e)return!1;let t=e.getRootNode(),n=xe(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}function Ne(e){let t=Ie(L(e));t!==e&&(t&&Pe(t,e),e&&Fe(e,t))}function Pe(e,t){e.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t}))}function Fe(e,t){e.dispatchEvent(new FocusEvent(`focus`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,relatedTarget:t}))}function Ie(e){let t=Ae(e),n=t?.getAttribute(`aria-activedescendant`);return n&&e.getElementById(n)||t}function Le(e){if(ze())e.focus({preventScroll:!0});else{let t=Be(e);e.focus(),Ve(t)}}var Re=null;function ze(){if(Re==null){Re=!1;try{document.createElement(`div`).focus({get preventScroll(){return Re=!0,!0}})}catch{}}return Re}function Be(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Ve(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var He=typeof Element<`u`&&`checkVisibility`in Element.prototype;function Ue(e){let t=xe(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=xe(e),{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function We(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function Ge(e,t){return He?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&Ue(e)&&We(e,t)&&(!e.parentElement||Ge(e.parentElement,e))}var Ke=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],qe=Ke.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;Ke.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);var Je=Ke.join(`:not([hidden]):not([tabindex="-1"]),`);function Ye(e,t){return e.matches(qe)&&!Ze(e)&&(t?.skipVisibilityCheck||Ge(e))}function Xe(e){return e.matches(Je)&&Ge(e)&&!Ze(e)}function Ze(e){let t=e;for(;t!=null;){if(t instanceof xe(t).HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function Qe(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function $e(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function et(e){let t=(0,v.useRef)({isFocused:!1,observer:null});return y(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),(0,v.useCallback)(n=>{let r=z(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=Qe(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===Ae()?null:Ae();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:e})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}var tt=!1;function nt(e){for(;e&&!Ye(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=Ae(xe(e).document);if(!t||t===e)return;let n=e?.getRootNode(),r=n!=null&&Te(n)?n:xe(e),i=t=>t===e||t!=null&&R(e,t),a=e=>e===t||t!=null&&e!=null&&R(t,e);tt=!0;let o=!1,s=e=>{(a(z(e))||o)&&e.stopImmediatePropagation()},c=n=>{(a(z(n))||o)&&(n.stopImmediatePropagation(),!e&&!o&&(o=!0,Le(t),d()))},l=e=>{(i(z(e))||o)&&e.stopImmediatePropagation()},u=e=>{(i(z(e))||o)&&(e.stopImmediatePropagation(),o||(o=!0,Le(t),d()))};r.addEventListener(`blur`,s,!0),r.addEventListener(`focusout`,c,!0),r.addEventListener(`focusin`,u,!0),r.addEventListener(`focus`,l,!0);let d=()=>{cancelAnimationFrame(f),r.removeEventListener(`blur`,s,!0),r.removeEventListener(`focusout`,c,!0),r.removeEventListener(`focusin`,u,!0),r.removeEventListener(`focus`,l,!0),tt=!1,o=!1},f=requestAnimationFrame(d);return d}function rt(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function it(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function at(e){let t=null;return()=>(t??=e(),t)}var ot=at(function(){return it(/^Mac/i)}),st=at(function(){return it(/^iPhone/i)}),ct=at(function(){return it(/^iPad/i)||ot()&&navigator.maxTouchPoints>1}),lt=at(function(){return st()||ct()}),ut=at(function(){return ot()||lt()}),dt=at(function(){return rt(/AppleWebKit/i)&&(lt()||!ft())}),ft=at(function(){return rt(/Chrome|CriOS|CrMo/i)}),pt=at(function(){return rt(/Android/i)}),mt=at(function(){return rt(/(Firefox|FxiOS)/i)});function ht(e){return e.pointerType===``&&e.isTrusted?!0:pt()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function gt(e){return!pt()&&e.width===0&&e.height===0||pt()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}var _t=(0,v.createContext)({isNative:!0,open:St,useHref:e=>e});function vt(){return(0,v.useContext)(_t)}function yt(e,t){let n=e.getAttribute(`target`);return(!n||n===`_self`)&&e.origin===location.origin&&!e.hasAttribute(`download`)&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function bt(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;!dt()&&mt()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(ot()?r=!0:i=!0);let s=dt()&&ot()&&!ct()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}):new MouseEvent(`click`,{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o,detail:1,bubbles:!0,cancelable:!0});bt.isOpening=n,Le(e),e.dispatchEvent(s),bt.isOpening=!1}bt.isOpening=!1;function xt(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute(`data-href`)){let n=document.createElement(`a`);n.href=e.getAttribute(`data-href`),e.hasAttribute(`data-target`)&&(n.target=e.getAttribute(`data-target`)),e.hasAttribute(`data-rel`)&&(n.rel=e.getAttribute(`data-rel`)),e.hasAttribute(`data-download`)&&(n.download=e.getAttribute(`data-download`)),e.hasAttribute(`data-ping`)&&(n.ping=e.getAttribute(`data-ping`)),e.hasAttribute(`data-referrer-policy`)&&(n.referrerPolicy=e.getAttribute(`data-referrer-policy`)),e.appendChild(n),t(n),e.removeChild(n)}}function St(e,t){xt(e,e=>bt(e,t))}function Ct(e){let t=vt().useHref(e?.href??``),n={};if(e)for(let r of[`href`,`target`,`rel`,`download`,`ping`,`referrerPolicy`])r in e&&e[r]!==void 0&&(n[r]=r===`href`?t:e[r]);return n}function wt(e,t,n,r){!t.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&yt(e.currentTarget,e)&&n&&(e.preventDefault(),t.open(e.currentTarget,e,n,r))}var Tt=null,Et=new Set,Dt=new Map,Ot=!1,kt=!1,At={Tab:!0,Escape:!0};function jt(e,t){for(let n of Et)n(e,t)}function Mt(e){return!(e.metaKey||!ot()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Nt(e){Ot=!0,!bt.isOpening&&Mt(e)&&(Tt=`keyboard`,jt(`keyboard`,e))}function Pt(e){Tt=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(Ot=!0,jt(`pointer`,e))}function Ft(e){!bt.isOpening&&ht(e)&&(Ot=!0,Tt=`virtual`)}function It(e){if(tt)return;let t=z(e),n=xe(t),r=L(t);t===n?kt=!0:t!==r&&e.isTrusted&&(!Ot&&!kt&&(Tt=`virtual`,jt(`virtual`,e)),Ot=!1,kt=!1)}function Lt(){tt||(Ot=!1,kt=!0)}function Rt(e){if(typeof window>`u`||typeof document>`u`)return;let t=xe(e),n=L(e);if(Dt.get(t))return;let r=t.HTMLElement.prototype.focus;Reflect.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(){Ot=!0,r.apply(this,arguments)}}),n.addEventListener(`keydown`,Nt,!0),n.addEventListener(`keyup`,Nt,!0),n.addEventListener(`click`,Ft,!0),t.addEventListener(`focus`,It,!0),t.addEventListener(`blur`,Lt,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,Pt,!0),n.addEventListener(`pointermove`,Pt,!0),n.addEventListener(`pointerup`,Pt,!0)),t.addEventListener(`beforeunload`,()=>{zt(e)},{once:!0}),Dt.set(t,{focus:r})}var zt=(e,t)=>{let n=xe(e),r=L(e);t&&r.removeEventListener(`DOMContentLoaded`,t),Dt.has(n)&&(Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:Dt.get(n).focus}),r.removeEventListener(`keydown`,Nt,!0),r.removeEventListener(`keyup`,Nt,!0),r.removeEventListener(`click`,Ft,!0),n.removeEventListener(`focus`,It,!0),n.removeEventListener(`blur`,Lt,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,Pt,!0),r.removeEventListener(`pointermove`,Pt,!0),r.removeEventListener(`pointerup`,Pt,!0)),Dt.delete(n))};function Bt(e){let t=L(e),n;return t.readyState===`loading`?(n=()=>{Rt(e)},t.addEventListener(`DOMContentLoaded`,n)):Rt(e),()=>zt(e,n)}typeof document<`u`&&Bt();function Vt(){return Tt!==`pointer`}function Ht(){return Tt}function Ut(e){Tt=e,jt(e,null)}var Wt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Gt(e,t,n){let r=n?z(n):void 0,i=L(r),a=xe(r),o=a===void 0?HTMLInputElement:a.HTMLInputElement,s=a===void 0?HTMLTextAreaElement:a.HTMLTextAreaElement,c=a===void 0?HTMLElement:a.HTMLElement,l=a===void 0?KeyboardEvent:a.KeyboardEvent,u=Ae(i);return e=e||u instanceof o&&!Wt.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!At[n.key])}function Kt(e,t,n){Rt(),(0,v.useEffect)(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Gt(!!n?.isTextInput,t,r)&&e(Vt())};return Et.add(t),()=>{Et.delete(t)}},t)}function qt(e){return ot()?e.metaKey:e.ctrlKey}var Jt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Yt(e){return e instanceof HTMLInputElement&&!Jt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var Xt=v.useInsertionEffect??y;function Zt(e){let t=(0,v.useRef)(null);return Xt(()=>{t.current=e},[e]),(0,v.useCallback)((...e)=>{let n=t.current;return n?.(...e)},[])}function Qt(e,t,n,r){let i=Zt(n),a=n==null;(0,v.useEffect)(()=>{if(!(a||e.current==null))return Ee(e.current,t,i,r)},[e,t,r,a])}function $t(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=N(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(` `):i&&=i.trim().split(/\s+/).join(` `),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}var en=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),tn=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function nn(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n=typeof t.getTextInfo==`function`?t.getTextInfo():t.textInfo;if(n)return n.direction===`rtl`;if(t.script)return en.has(t.script)}let t=e.split(`-`)[0];return tn.has(t)}var rn=Symbol.for(`react-aria.i18n.locale`);function an(){let e=typeof window<`u`&&window[rn]||typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:nn(e)?`rtl`:`ltr`}}var on=an(),sn=new Set;function cn(){on=an();for(let e of sn)e(on)}function ln(){let e=j(),[t,n]=(0,v.useState)(on);return(0,v.useEffect)(()=>(sn.size===0&&window.addEventListener(`languagechange`,cn),sn.add(n),()=>{sn.delete(n),sn.size===0&&window.removeEventListener(`languagechange`,cn)}),[]),e?{locale:typeof window<`u`&&window[rn]||`en-US`,direction:`ltr`}:t}var un=v.createContext(null);function dn(){let e=ln();return(0,v.useContext)(un)||e}var fn=Symbol.for(`react-aria.i18n.locale`),pn=Symbol.for(`react-aria.i18n.strings`),mn=void 0,hn=class e{constructor(e,t=`en-US`){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=gn(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[fn];if(mn===void 0){let t=window[pn];if(!t)return null;mn={};for(let r in t)mn[r]=new e({[n]:t[r]},n)}let r=mn?.[t];if(!r)throw Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}};function gn(e,t,n=`en-US`){if(t[e])return t[e];let r=_n(e),i=vn(e);if(i&&t[`${r}-${i}`])return t[`${r}-${i}`];if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function _n(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}function vn(e){if(Intl.Locale)return new Intl.Locale(e).script}var yn=new Map,bn=new Map,xn=class{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return typeof n==`function`?n(t,this):n}plural(e,t,n=`cardinal`){let r=t[`=`+e];if(r)return typeof r==`function`?r():r;let i=this.locale+`:`+n,a=yn.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),yn.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=bn.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),bn.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}},Sn=new WeakMap;function Cn(e){let t=Sn.get(e);return t||(t=new hn(e),Sn.set(e,t)),t}function wn(e,t){return t&&hn.getGlobalDictionaryForPackage(t)||Cn(e)}function Tn(e,t){let{locale:n}=dn(),r=wn(e,t);return(0,v.useMemo)(()=>new xn(n,r),[n,r])}var En=typeof document<`u`?v.useInsertionEffect??v.useLayoutEffect:()=>{};function Dn(e,t,n){let[r,i]=(0,v.useState)(e||t),a=(0,v.useRef)(r),o=(0,v.useRef)(e!==void 0),s=e!==void 0;(0,v.useEffect)(()=>{o.current,o.current=s},[s]);let c=s?e:r;En(()=>{a.current=c});let[,l]=(0,v.useReducer)(()=>({}),{});return[c,(0,v.useCallback)((e,...t)=>{let r=typeof e==`function`?e(a.current):e;Object.is(a.current,r)||(a.current=r,i(r),l(),n?.(r,...t))},[n])]}var On=(0,v.createContext)(null),kn=(0,v.createContext)(null),An=class{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}},jn=class extends An{filter(e,t,n){let[r,i]=Ln(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},Mn=class extends An{static{this.type=`header`}},Nn=class extends An{static{this.type=`loader`}},Pn=class extends jn{static{this.type=`item`}filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}},Fn=class extends jn{static{this.type=`section`}filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}},In=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=Ln(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function Ln(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey==null?null:e.getItem(o.nextKey)}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e==null?a=null:(a=t.getItem(e),a.nextKey=null)}return[i?.key??null,a?.key??null]}var Rn=class{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}},zn=class e extends Rn{constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.parentNode.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}},Bn=class extends Rn{constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}get isConnected(){return!0}createElement(e){return new zn(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription||(this.queuedRender=!1,this.updateCollection()),this.collection}updateCollection(){for(let e of this.dirtyNodes)e instanceof zn&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof zn?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0,this.isSSR||(this.collection=this.collection.clone());for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),this.queuedRender&&e(),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}};function Vn(e){let{children:t,items:n,idScope:r,addIdAndValue:i,dependencies:a=[]}=e,o=(0,v.useMemo)(()=>void 0,[t]),s=(0,v.useMemo)(()=>new WeakMap,[...a,o]);return(0,v.useMemo)(()=>{if(n&&typeof t==`function`){let e=[];for(let a of n){let n=Hn(a)?a:null,o=n?s.get(n):null;if(!o){o=t(a);let c=o.props.id??a?.key??a?.id;r!=null&&o.props.id==null&&c!=null&&(c=r+`:`+c);let l=c??e.length;o=(0,v.cloneElement)(o,i?{key:l,id:c,value:a}:{key:l}),n&&s.set(n,o)}e.push(o)}return e}if(typeof t!=`function`)return t},[t,n,s,r,i])}function Hn(e){switch(typeof e){case`object`:return e!=null;case`function`:case`symbol`:return!0;default:return!1}}var Un=new Map,Wn=new Set;function Gn(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=z(t);if(!e(t)||!r)return;let i=Un.get(r);i||(i=new Set,Un.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=z(t);if(!e(t)||!r)return;let i=Un.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),Un.delete(r)),Un.size===0)){for(let e of Wn)e();Wn.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Gn):Gn());function Kn(){for(let[e]of Un)`isConnected`in e&&!e.isConnected&&Un.delete(e)}function qn(e){requestAnimationFrame(()=>{Kn(),Un.size===0?e():Wn.add(e)})}function Jn(e){if(!e.isConnected)return;let t=L(e);if(Ht()===`virtual`){let n=Ae(t);qn(()=>{let r=Ae(t);(r===n||r===t.body)&&e.isConnected&&Le(e)})}else Le(e)}function Yn(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=(0,v.useCallback)(e=>{if(z(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),o=et(a),s=(0,v.useCallback)(e=>{let t=z(e),r=L(t),a=r?Ae(r):Ae();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),o(e))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}function Xn(e){if(e)return t=>{let n=!0;e({...t,preventDefault(){t.preventDefault()},isDefaultPrevented(){return t.isDefaultPrevented()},stopPropagation(){n=!0},continuePropagation(){n=!1,typeof t.continuePropagation==`function`&&t.continuePropagation()},isPropagationStopped(){return n}}),n&&!(typeof t.isPropagationStopped==`function`&&t.isPropagationStopped())&&t.stopPropagation()}}var Zn=new Set([`shift`,`alt`,`control`,`meta`,`mod`]),Qn=[`Alt`,`Control`,`Meta`,`Shift`];function $n(e){let t=new Set;return e.alt&&t.add(`Alt`),e.shift&&t.add(`Shift`),e.ctrl&&t.add(`Control`),e.meta&&t.add(`Meta`),e.mod&&t.add(ot()?`Meta`:`Control`),t}function er(e){let t=new Set;return e.altKey&&t.add(`Alt`),e.ctrlKey&&t.add(`Control`),e.metaKey&&t.add(`Meta`),e.shiftKey&&t.add(`Shift`),t}function tr(e){return Qn.filter(t=>e.has(t))}function nr(e){let t=e.split(`+`).reduce((e,t)=>{let n=t.toLowerCase();return Zn.has(n)?n===`shift`?e.shift=!0:n===`alt`?e.alt=!0:n===`control`?e.ctrl=!0:n===`meta`?e.meta=!0:n===`mod`&&(e.mod=!0):e.key=t,e},{shift:!1,alt:!1,ctrl:!1,meta:!1,mod:!1,key:``});if(t.key===``)throw Error(`Invalid keyboard shortcut: "${e}". Must include exactly one non-modifier key (e.g. "a", "Enter", "ArrowDown"). Combine any of Shift, Alt, Ctrl, Meta, and Mod.`);return t}function rr(e){return e.toLowerCase()}var ir={space:` `,esc:`escape`,del:`delete`,ins:`insert`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,pageup:`pageup`,pagedown:`pagedown`};function ar(e){let t=rr(e);return ir[t]??t}function or(e){let t=tr($n(e)),n=ar(e.key);return t.length>0?`${t.join(`+`)}+${n}`:n}function sr(e){let t=tr(er(e)),n=rr(e.key);return(t.length>0?`${t.join(`+`)}+`:``)+n}function cr(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=nr(n);t.set(or(e),r)}return e=>{let n=sr(e),r=t.get(n),i=r?.(e);i===void 0&&r!==void 0?i={shouldContinuePropagation:!1,shouldPreventDefault:!0}:typeof i==`boolean`&&(i={shouldContinuePropagation:!i,shouldPreventDefault:i}),i?.shouldPreventDefault&&e.preventDefault(),(!r||i?.shouldContinuePropagation)&&e.continuePropagation()}}function lr(e){let{shortcuts:t,allowRepeats:n=!1,allowComposing:r=!1}=e,i,a;if(t){let o=cr(t),s=Xn(e=>{R(e.currentTarget,z(e))?e.nativeEvent?.repeat&&!n||e.nativeEvent?.isComposing&&!r?e.continuePropagation():o(e):e.continuePropagation()}),c=Xn(e=>{R(e.currentTarget,z(e))&&(e.nativeEvent?.repeat&&!n||e.nativeEvent?.isComposing),e.continuePropagation()});i=e.onKeyDown?_(e.onKeyDown,s):s,a=e.onKeyUp?_(e.onKeyUp,c):c}else i=Xn(e.onKeyDown),a=Xn(e.onKeyUp);return{keyboardProps:e.isDisabled?{}:{onKeyDown:i,onKeyUp:a}}}function ur(e,t){y(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}var dr=v.createContext(null);function fr(e){let t=(0,v.useContext)(dr)||{};ur(t,e);let{ref:n,...r}=t;return r}var pr=v.forwardRef(function(e,t){let{children:n,...r}=e,i=ue(t),a={...r,ref:i};return v.createElement(dr.Provider,{value:a},n)});function mr(e,t){let{focusProps:n}=Yn(e),{keyboardProps:r}=lr(e),i=P(n,r),a=fr(t),o=e.isDisabled?{}:a,s=(0,v.useRef)(e.autoFocus);(0,v.useEffect)(()=>{s.current&&t.current&&Jn(t.current),s.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:P({...i,tabIndex:c},o)}}typeof HTMLTemplateElement<`u`&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.appendChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.removeChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(e,t){return this.content.insertBefore(e,t)}}));var hr=(0,v.createContext)(!1);function gr(e){if((0,v.useContext)(hr))return v.createElement(v.Fragment,null,e.children);let t=v.createElement(hr.Provider,{value:!0},e.children);return v.createElement(`template`,null,t)}function _r(e){let t=(t,n)=>(0,v.useContext)(hr)?null:e(t,n);return t.displayName=e.displayName||e.name,(0,v.forwardRef)(t)}function vr(){return(0,v.useContext)(hr)}var yr=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),br=o(((e,t)=>{t.exports=yr()})),xr=c(m(),1),Sr=br(),Cr=(0,v.createContext)(!1),wr=(0,v.createContext)(null);function Tr(e){if((0,v.useContext)(wr))return e.content;let{collection:t,document:n}=kr(e.createCollection);return v.createElement(v.Fragment,null,v.createElement(gr,null,v.createElement(wr.Provider,{value:n},e.content)),v.createElement(Er,{render:e.children,collection:t}))}function Er({collection:e,render:t}){return t(e)}function Dr(e,t,n){let r=j(),i=(0,v.useRef)(r);i.current=r;let a=(0,v.useCallback)(()=>i.current?n():t(),[t,n]);return(0,Sr.useSyncExternalStore)(e,a)}var Or=typeof v.useSyncExternalStore==`function`?v.useSyncExternalStore:Dr;function kr(e){let[t]=(0,v.useState)(()=>new Bn(e?.()||new In));return{collection:Or((0,v.useCallback)(e=>t.subscribe(e),[t]),(0,v.useCallback)(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),(0,v.useCallback)(()=>(t.isSSR=!0,t.getCollection()),[t])),document:t}}var Ar=(0,v.createContext)(null);function jr(e){return class extends An{static{this.type=e}}}function Mr(e,t,n,r,i,a){typeof e==`string`&&(e=jr(e));let o=(0,v.useCallback)(i=>{i?.setProps(t,n,e,r,a)},[t,n,r,a,e]),s=(0,v.useContext)(Ar);if(s){let o=s.ownerDocument.nodesByProps.get(t);return o||(o=s.ownerDocument.createElement(e.type),o.setProps(t,n,e,r,a),s.appendChild(o),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(t,o)),i?v.createElement(Ar.Provider,{value:o},i):null}return v.createElement(e.type,{ref:o},i)}function Nr(e,t){let n=({node:e})=>t(e.props,e.props.ref,e),r=(0,v.forwardRef)((r,i)=>{let a=(0,v.useContext)(dr);if(!(0,v.useContext)(Cr)){if(t.length>=3)throw Error(t.name+` cannot be rendered outside a collection.`);return t(r,i)}return Mr(e,r,i,`children`in r?r.children:null,null,e=>v.createElement(dr.Provider,{value:a},v.createElement(n,{node:e})))});return r.displayName=t.name,r}function Pr(e,t,n=Fr){let r=({node:e})=>t(e.props,e.props.ref,e),i=(0,v.forwardRef)((t,i)=>Mr(e,t,i,null,n(t),e=>v.createElement(r,{node:e}))??v.createElement(v.Fragment,null));return i.displayName=t.name,i}function Fr(e){return Vn({...e,addIdAndValue:!0})}var Ir=(0,v.createContext)(null);function Lr(e){let t=(0,v.useContext)(Ir),n=(t?.dependencies||[]).concat(e.dependencies),r=e.idScope??t?.idScope,i=Fr({...e,idScope:r,dependencies:n});return(0,v.useContext)(wr)&&(i=v.createElement(Rr,null,i)),t=(0,v.useMemo)(()=>({dependencies:n,idScope:r}),[r,...n]),v.createElement(Ir.Provider,{value:t},i)}function Rr({children:e}){let t=(0,v.useContext)(wr),n=(0,v.useMemo)(()=>v.createElement(wr.Provider,{value:null},v.createElement(Cr.Provider,{value:!0},e)),[e]);return j()?v.createElement(Ar.Provider,{value:t},n):(0,xr.createPortal)(n,t)}var zr=(0,v.createContext)(null),Br={CollectionRoot({collection:e,renderDropIndicator:t}){return Vr(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Vr(e,t,n)}};function Vr(e,t,n){return Vn({items:t?e.getChildren(t.key):e,dependencies:[n],children(t){if(t.type===`content`)return v.createElement(v.Fragment,null);let r=t.render(t);return!n||t.type!==`item`?r:v.createElement(v.Fragment,null,n({type:`item`,key:t.key,dropPosition:`before`}),r,Hr(e,t,n))}})}function Hr(e,t,n){let r=t.key,i=e.getKeyAfter(r),a=i==null?null:e.getItem(i);for(;a!=null&&a.type!==`item`;)i=e.getKeyAfter(a.key),a=i==null?null:e.getItem(i);let o=t.nextKey==null?null:e.getItem(t.nextKey);for(;o!=null&&o.type!==`item`;)o=o.nextKey==null?null:e.getItem(o.nextKey);let s=[];if(o==null){let r=t;for(;r?.type===`item`&&(!a||r.parentKey!==a.parentKey&&a.level<r.level);){let t=n({type:`item`,key:r.key,dropPosition:`after`});(0,v.isValidElement)(t)&&s.push((0,v.cloneElement)(t,{key:`${r.key}-after`})),r=r.parentKey==null?null:e.getItem(r.parentKey)}}return s}var Ur=(0,v.createContext)(Br);function Wr(e){return(0,v.useMemo)(()=>e==null?null:new Set([e]),[e])}var Gr=new Set([`id`]),Kr=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),qr=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),Jr=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),Yr=new Set(`onClick.onAuxClick.onContextMenu.onDoubleClick.onMouseDown.onMouseEnter.onMouseLeave.onMouseMove.onMouseOut.onMouseOver.onMouseUp.onTouchCancel.onTouchEnd.onTouchMove.onTouchStart.onPointerDown.onPointerMove.onPointerUp.onPointerCancel.onPointerEnter.onPointerLeave.onPointerOver.onPointerOut.onGotPointerCapture.onLostPointerCapture.onScroll.onWheel.onAnimationStart.onAnimationEnd.onAnimationIteration.onTransitionCancel.onTransitionEnd.onTransitionRun.onTransitionStart`.split(`.`)),Xr=/^(data-.*)$/;function Zr(e,t={}){let{labelable:n,isLink:r,global:i,events:a=i,propNames:o}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(Gr.has(t)||n&&Kr.has(t)||r&&qr.has(t)||i&&Jr.has(t)||a&&(Yr.has(t)||t.endsWith(`Capture`)&&Yr.has(t.slice(0,-7)))||o?.has(t)||Xr.test(t))&&(s[t]=e[t]);return s}var Qr=`default`,$r=``,ei=new WeakMap;function ti(e){if(lt()&&dt()){if(Qr==="default"){let t=L(e);$r=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}Qr=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;ei.set(e,e.style[t]),e.style[t]=`none`}}function ni(e){if(lt()&&dt()){if(Qr!==`disabled`)return;Qr=`restoring`,setTimeout(()=>{qn(()=>{if(Qr===`restoring`){let t=L(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=$r||``),$r=``,Qr=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&ei.has(e)){let t=ei.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),ei.delete(e)}}function ri(e,t){let n=xe(t),r=L(t);if(r==null||n==null)return;let i,a=`meta[name="${CSS.escape(e)}"], meta[property="${CSS.escape(e)}"]`,o=r.querySelector(a);return o&&o instanceof n.HTMLMetaElement&&(e===`csp-nonce`&&o.nonce&&(i??=o.nonce||void 0),o.content&&(i??=o.content||void 0)),e===`csp-nonce`&&(i??=n.__webpack_nonce__||globalThis.__webpack_nonce__||void 0),i}var ii=new WeakMap;function ai(e){let t=L(e),n=ii.get(t);return n??=ri(`csp-nonce`,t),n!==void 0&&ii.set(t,n),n}var oi=v.createContext({register:()=>{}});oi.displayName=`PressResponderContext`;function si(){let e=(0,v.useRef)(new Map),t=(0,v.useCallback)((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=(0,v.useCallback)((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,v.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,v.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function ci(e){let t=(0,v.useContext)(oi);if(t){let{register:n,ref:r,...i}=t;e=P(i,e),n()}return ur(t,e.ref),e}var li=class{#e;constructor(e,t,n,r){this.#e=!0;let i=(r?.target??n.currentTarget)?.getBoundingClientRect(),a,o=0,s,c=null;n.clientX!=null&&n.clientY!=null&&(s=n.clientX,c=n.clientY),i&&(s!=null&&c!=null?(a=s-i.left,o=c-i.top):(a=i.width/2,o=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=o,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}},ui=Symbol(`linkClicked`),di=`react-aria-pressable-style`,fi=`data-react-aria-pressable`;function pi(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,onClick:o,isDisabled:s,isPressed:c,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:d,ref:f,...p}=ci(e),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:y,removeAllGlobalListeners:b}=si(),x=(0,v.useCallback)((e,t)=>{let i=g.current;if(s||i.didFirePressStart)return!1;let a=!0;if(i.isTriggeringEvent=!0,r){let n=new li(`pressstart`,t,e);r(n),a=n.shouldStopPropagation}return n&&n(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,h(!0),a},[s,r,n]),S=(0,v.useCallback)((e,r,a=!0)=>{let o=g.current;if(!o.didFirePressStart)return!1;o.didFirePressStart=!1,o.isTriggeringEvent=!0;let c=!0;if(i){let t=new li(`pressend`,r,e);i(t),c=t.shouldStopPropagation}if(n&&n(!1),h(!1),t&&a&&!s){let n=new li(`press`,r,e);t(n),c&&=n.shouldStopPropagation}return o.isTriggeringEvent=!1,c},[s,i,n,t]),C=Zt(S),w=Zt((0,v.useCallback)((e,t)=>{let n=g.current;if(s)return!1;if(a){n.isTriggeringEvent=!0;let r=new li(`pressup`,t,e);return a(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[s,a])),T=(0,v.useCallback)(e=>{let t=g.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&S(gi(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||ni(t.target);for(let e of t.disposables)e();t.disposables=[]}},[d,b,S]),E=Zt(T);(0,v.useEffect)(()=>{s&&g.current.isPressed&&E({currentTarget:g.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[s]);let D=(0,v.useCallback)(e=>{u&&T(e)},[u,T]),O=(0,v.useCallback)(e=>{s||o?.(e)},[s,o]),k=(0,v.useCallback)((e,t)=>{if(!s&&o){let n=new MouseEvent(`click`,e);$e(n,t),o(Qe(n))}},[s,o]),A=(0,v.useMemo)(()=>{let e=g.current,t={onKeyDown(t){if(hi(t.nativeEvent,t.currentTarget)&&R(t.currentTarget,z(t))){vi(z(t),t.key)&&t.preventDefault();let r=!0;!e.isPressed&&!t.repeat&&(e.target=t.currentTarget,e.isPressed=!0,e.pointerType=`keyboard`,r=x(t,`keyboard`));let i=t.currentTarget;y(L(t.currentTarget),`keyup`,_(t=>{hi(t,i)&&!t.repeat&&R(i,z(t))&&e.target&&w(gi(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&ot()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||R(t.currentTarget,z(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!bt.isOpening){let n=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||ht(t.nativeEvent))){let e=x(t,`virtual`),r=w(t,`virtual`),i=C(t,`virtual`);O(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=w(gi(t.currentTarget,t),r),a=C(gi(t.currentTarget,t),r,!0);n=i&&a,e.isOverTarget=!1,O(t),E(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&hi(t,e.target)){vi(z(t),t.key)&&t.preventDefault();let n=z(t),r=R(e.target,n);C(gi(e.target,t),`keyboard`,r),r&&k(t,e.target),b(),t.key!==`Enter`&&mi(e.target)&&R(e.target,n)&&!t[ui]&&(t[ui]=!0,bt(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if(t.key===`Meta`&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;e.metaKeyEvents=void 0;for(let n of t.values())e.target?.dispatchEvent(new KeyboardEvent(`keyup`,n))}};if(typeof PointerEvent<`u`){t.onPointerDown=t=>{if(t.button!==0||!R(t.currentTarget,z(t)))return;if(gt(t.nativeEvent)){e.pointerType=`virtual`;return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||ti(e.target),i=x(t,e.pointerType);let a=z(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),y(L(t.currentTarget),`pointerup`,n,!1),y(L(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(R(t.currentTarget,z(t))&&t.button===0){if(l){let n=nt(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{R(t.currentTarget,z(t))&&e.pointerType!==`virtual`&&t.button===0&&!e.isPressed&&w(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,x(gi(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,C(gi(e.target,t),e.pointerType,!1),D(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(R(e.target,z(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?E(t):(Le(e.target),e.target.click()))},80);y(t.currentTarget,`click`,()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else E(t);e.isOverTarget=!1}},r=e=>{E(e)};t.onDragStart=e=>{R(e.currentTarget,z(e))&&E(e)}}return t},[y,s,l,b,d,D,x,O,k]);return(0,v.useEffect)(()=>{if(!f)return;let e=L(f.current);if(!e||!e.head||e.getElementById(di))return;let t=e.createElement(`style`);t.id=di;let n=ai(e);n&&(t.nonce=n),t.textContent=`
11
- @layer {
12
- [${fi}] {
13
- touch-action: pan-x pan-y pinch-zoom;
14
- }
15
- }
16
- `.trim(),e.head.prepend(t)},[f]),(0,v.useEffect)(()=>{let e=g.current;return()=>{d||ni(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[d]),{isPressed:c||m,pressProps:P(p,A,{[fi]:!0})}}function mi(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function hi(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof xe(i).HTMLInputElement&&!bi(i,n)||i instanceof xe(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&mi(i))&&n!==`Enter`)}function gi(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function _i(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!mi(e)}function vi(e,t){return ot()&&t===`Enter`?!1:e instanceof HTMLInputElement?t===`Enter`&&(e.type===`checkbox`||e.type===`radio`)?!1:!bi(e,t):_i(e)}var yi=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function bi(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:yi.has(e.type)}function xi(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=(0,v.useRef)({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:s}=si(),c=(0,v.useCallback)(e=>{R(e.currentTarget,z(e))&&a.current.isFocusWithin&&!R(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,s(),n&&n(e),i&&i(!1))},[n,i,a,s]),l=et(c),u=(0,v.useCallback)(e=>{if(!R(e.currentTarget,z(e)))return;let t=z(e),n=L(t),s=Ae(n);if(!a.current.isFocusWithin&&s===t){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,l(e);let t=e.currentTarget;o(n,`focus`,e=>{let r=z(e);if(a.current.isFocusWithin&&!R(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});$e(e,t);let i=Qe(e);c(i)}},{capture:!0})}},[r,i,l,o,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:c}}}function Si(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,v.useRef)({isFocused:!1,isFocusVisible:t||Vt()}),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),l=(0,v.useCallback)(()=>c(i.current.isFocused&&i.current.isFocusVisible),[]),u=(0,v.useCallback)(e=>{i.current.isFocused=e,i.current.isFocusVisible=Vt(),o(e),l()},[l]);Kt(e=>{i.current.isFocusVisible=e,l()},[n,a],{enabled:a,isTextInput:n});let{focusProps:d}=Yn({isDisabled:r,onFocusChange:u}),{focusWithinProps:f}=xi({isDisabled:!r,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:s,focusProps:r?f:d}}var Ci=!1,wi=0;function Ti(){Ci=!0,setTimeout(()=>{Ci=!1},500)}function Ei(e){e.pointerType===`touch`&&Ti()}function Di(){let e=L(null);if(e!==void 0)return wi===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,Ei),wi++,()=>{wi--,!(wi>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,Ei)}}function Oi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=(0,v.useState)(!1),s=(0,v.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;(0,v.useEffect)(Di,[]);let{addGlobalListener:c,removeAllGlobalListeners:l}=si(),{hoverProps:u,triggerHoverEnd:d}=(0,v.useMemo)(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!R(e.currentTarget,z(e)))return;s.isHovered=!0;let l=e.currentTarget;s.target=l,c(L(z(e)),`pointerover`,e=>{s.isHovered&&s.target&&!R(s.target,z(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:l,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,t!==`touch`&&s.isHovered&&i&&(s.isHovered=!1,l(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},u={};return typeof PointerEvent<`u`&&(u.onPointerEnter=t=>{Ci&&t.pointerType===`mouse`||e(t,t.pointerType)},u.onPointerLeave=e=>{!i&&R(e.currentTarget,z(e))&&a(e,e.pointerType)}),{hoverProps:u,triggerHoverEnd:a}},[t,n,r,i,s,c,l]);return(0,v.useEffect)(()=>{i&&d({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:u,isHovered:a}}var ki=(0,v.createContext)({}),Ai=_r(function(e,t){[e,t]=he(e,t,ki);let{elementType:n=`label`,...r}=e,i=ve[n];return v.createElement(i,{className:`react-aria-Label`,...r,ref:t})});function ji(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a=`label`}=e;t=N(t);let o=N(),s={};n&&(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a===`label`?t:void 0});let c=$t({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:c}}function Mi(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}var Ni=(0,v.createContext)(null),Pi=7e3,Fi=null;function Ii(e,t=`assertive`,n=Pi){Fi?Fi.announce(e,t,n):(Fi=new Li,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?Fi.announce(e,t,n):setTimeout(()=>{Fi?.isAttached()&&Fi?.announce(e,t,n)},100))}var Li=class{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<`u`&&(this.node=document.createElement(`div`),this.node.dataset.liveAnnouncer=`true`,Object.assign(this.node.style,{border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`}),this.assertiveLog=this.createLog(`assertive`),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog(`polite`),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement(`div`);return t.setAttribute(`role`,`log`),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-relevant`,`additions`),t}destroy(){this.node&&=(document.body.removeChild(this.node),null)}announce(e,t=`assertive`,n=Pi){if(!this.node)return;let r=document.createElement(`div`);typeof e==`object`?(r.setAttribute(`role`,`img`),r.setAttribute(`aria-labelledby`,e[`aria-labelledby`])):r.textContent=e,t===`assertive`?this.assertiveLog?.appendChild(r):this.politeLog?.appendChild(r),e!==``&&setTimeout(()=>{r.remove()},n)}clear(e){this.node&&((!e||e===`assertive`)&&this.assertiveLog&&(this.assertiveLog.innerHTML=``),(!e||e===`polite`)&&this.politeLog&&(this.politeLog.innerHTML=``))}};function Ri(e,t){let{elementType:n=`button`,isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:u,onClick:d,href:f,target:p,rel:m,type:h=`button`}=e,g;g=n===`button`?{type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:`button`,href:n===`a`&&!r?f:void 0,target:n===`a`?p:void 0,type:n===`input`?h:void 0,disabled:n===`input`?r:void 0,"aria-disabled":!r||n===`input`?void 0:r,rel:n===`a`?m:void 0};let{pressProps:_,isPressed:v}=pi({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=mr(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=P(y,_,Zr(e,{labelable:!0}));return{isPressed:v,buttonProps:P(g,b,{"aria-haspopup":e[`aria-haspopup`],"aria-expanded":e[`aria-expanded`],"aria-controls":e[`aria-controls`],"aria-pressed":e[`aria-pressed`],"aria-current":e[`aria-current`],"aria-disabled":e[`aria-disabled`]})}}var zi=(0,v.createContext)({}),B=_r(function(e,t){[e,t]=he(e,t,zi);let n=e,{isPending:r}=n,{buttonProps:i,isPressed:a}=Ri(e,t);i=Vi(i,r);let{focusProps:o,isFocused:s,isFocusVisible:c}=Si(e),{hoverProps:l,isHovered:u}=Oi({...e,isDisabled:e.isDisabled||r}),d={isHovered:u,isPressed:(n.isPressed||a)&&!r,isFocused:s,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:r??!1},f=pe({...e,values:d,defaultClassName:`react-aria-Button`}),p=N(i.id),m=N(),h=i[`aria-labelledby`];r&&(h?h=`${h} ${m}`:i[`aria-label`]&&(h=`${p} ${m}`));let g=(0,v.useRef)(r);(0,v.useEffect)(()=>{let e={"aria-labelledby":h||p};(!g.current&&s&&r||g.current&&s&&!r)&&Ii(e,`assertive`),g.current=r},[r,s,h,p]);let _=Zr(e,{global:!0});return delete _.onClick,v.createElement(ve.button,{...P(_,f,i,o,l),type:i.type===`submit`&&r?`button`:i.type,id:p,ref:t,"aria-labelledby":h,slot:e.slot||void 0,"aria-disabled":r?`true`:i[`aria-disabled`],"data-disabled":e.isDisabled||void 0,"data-pressed":d.isPressed||void 0,"data-hovered":u||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":c||void 0},v.createElement(Ni.Provider,{value:{id:m}},f.children))}),Bi=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function Vi(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!Bi.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}var Hi=(0,v.createContext)({}),Ui=(0,v.forwardRef)(function(e,t){[e,t]=he(e,t,Hi);let{children:n,level:r=3,className:i,...a}=e,o=ve[`h${r}`];return v.createElement(o,{...a,ref:t,className:i??`react-aria-Heading`},n)}),Wi=(0,v.createContext)({}),Gi=_r(function(e,t){[e,t]=he(e,t,Wi);let{elementType:n=`span`,...r}=e,i=ve[n];return v.createElement(i,{className:`react-aria-Text`,...r,ref:t})});function Ki(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&n.overflow!==`hidden`&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function qi(e,t){let n=e;for(Ki(n,t)&&(n=n.parentElement);n&&!Ki(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Ji(e,t){let n=[],r=document.scrollingElement||document.documentElement;for(;e&&(Ki(e,t)&&n.push(e),e!==r);)e=e.parentElement;return n}function Yi(e,t,n={}){e!==t&&Xi(e,t,t.getBoundingClientRect(),n)}function Xi(e,t,n,r={}){let{block:i=`nearest`,inline:a=`nearest`}=r,o=e.scrollTop,s=e.scrollLeft,c=e.getBoundingClientRect(),l=window.getComputedStyle(t),u=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d,p=e===d?0:c.top,m=e===d?e.clientHeight:c.bottom,h=e===d?0:c.left,g=e===d?e.clientWidth:c.right,_=parseFloat(l.scrollMarginTop)||0,v=parseFloat(l.scrollMarginBottom)||0,y=parseFloat(l.scrollMarginLeft)||0,b=parseFloat(l.scrollMarginRight)||0,x=parseFloat(u.scrollPaddingTop)||0,S=parseFloat(u.scrollPaddingBottom)||0,C=parseFloat(u.scrollPaddingLeft)||0,w=parseFloat(u.scrollPaddingRight)||0,T=parseFloat(u.borderTopWidth)||0,E=parseFloat(u.borderBottomWidth)||0,D=parseFloat(u.borderLeftWidth)||0,O=parseFloat(u.borderRightWidth)||0,k=n.top-_,A=n.bottom+v,j=n.left-y,ee=n.right+b,te=e===d?0:D+O,ne=e===d?0:T+E,M=e===d?0:e.offsetWidth-e.clientWidth-te,re=e===d?0:e.offsetHeight-e.clientHeight-ne,N=p+(f?0:T)+x,ie=m-(f?0:E)-S-re,ae=h+(f?0:D)+C,oe=g-(f?0:O)-w;lt()&&dt()||u.direction===`ltr`?oe-=M:u.direction===`rtl`&&(ae+=M);let se=k<N||A>ie,ce=j<ae||ee>oe;if(se&&i===`start`)o+=k-N;else if(se&&i===`center`)o+=(k+A)/2-(N+ie)/2;else if(se&&i===`end`)o+=A-ie;else if(se&&i===`nearest`){let e=k-N,t=A-ie;o+=Math.abs(e)<=Math.abs(t)?e:t}if(ce&&a===`start`)s+=j-ae;else if(ce&&a===`center`)s+=(j+ee)/2-(ae+oe)/2;else if(ce&&a===`end`)s+=ee-oe;else if(ce&&a===`nearest`){let e=j-ae,t=ee-oe;s+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:s,top:o})}function Zi(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if(window.getComputedStyle(t).overflow!==`hidden`){let{left:t,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(t-i)>1||Math.abs(r-a)>1)&&(n?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let{left:t,top:r}=e.getBoundingClientRect(),i=Ji(e,!0);for(let t of i)Yi(t,e);let{left:a,top:o}=e.getBoundingClientRect();if(Math.abs(t-a)>1||Math.abs(r-o)>1){i=n?Ji(n,!0):[];for(let e of i)Yi(e,n,{block:`center`,inline:`center`});for(let t of Ji(e,!0))Yi(t,e)}}}}var Qi=0,$i=new Map;function ea(e){let[t,n]=(0,v.useState)();return y(()=>{if(!e)return;let t=$i.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${Qi++}`;n(r);let i=document.createElement(`div`);i.id=r,i.style.display=`none`,i.textContent=e,document.body.appendChild(i),t={refCount:0,element:i},$i.set(e,t)}return t.refCount++,()=>{t&&--t.refCount===0&&(t.element.remove(),$i.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}var ta={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function na(e={}){let{style:t,isFocusable:n}=e,[r,i]=(0,v.useState)(!1),{focusWithinProps:a}=xi({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=(0,v.useMemo)(()=>r?t:t?{...ta,...t}:ta,[r]);return{visuallyHiddenProps:{...a,style:o}}}function ra(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=na(e);return v.createElement(n,P(a,o),t)}var V=(0,v.createContext)(null),ia=(0,v.forwardRef)(function(e,t){return(0,v.useContext)(V)?.isInvalid?v.createElement(aa,{...e,ref:t}):null}),aa=(0,v.forwardRef)((e,t)=>{let n=(0,v.useContext)(V),{elementType:r,...i}=e,a=Zr(i,{global:!0}),o=pe({...i,defaultClassName:`react-aria-FieldError`,defaultChildren:n.validationErrors.length===0?void 0:n.validationErrors.join(` `),values:n});return o.children==null?null:v.createElement(Gi,{slot:`errorMessage`,elementType:r,...a,...o,ref:t})}),oa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},sa={...oa,customError:!0,valid:!1},ca={isInvalid:!1,validationDetails:oa,validationErrors:[]},la=(0,v.createContext)({}),ua=`__reactAriaFormValidationState`;function da(e){if(e.__reactAriaFormValidationState){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[ua];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return fa(e)}function fa(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s=`aria`}=e;n&&(t||=n===`invalid`);let c=t===void 0?null:{isInvalid:t,validationErrors:[],validationDetails:sa},l=(0,v.useMemo)(()=>!o||i==null?null:ha(ma(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=(0,v.useContext)(la),d=(0,v.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>pa(u[e])):pa(u[r]):[],[u,r]),[f,p]=(0,v.useState)(u),[m,h]=(0,v.useState)(!1);u!==f&&(p(u),h(!1));let g=(0,v.useMemo)(()=>ha(m?[]:d),[m,d]),_=(0,v.useRef)(ca),[y,b]=(0,v.useState)(ca),x=(0,v.useRef)(ca),S=()=>{if(!C)return;w(!1);let e=l||a||_.current;ga(e,x.current)||(x.current=e,b(e))},[C,w]=(0,v.useState)(!1);return(0,v.useEffect)(S),{realtimeValidation:c||g||l||a||ca,displayValidation:s===`native`?c||g||y:c||g||l||a||y,updateValidation(e){s===`aria`&&!ga(y,e)?b(e):_.current=e},resetValidation(){let e=ca;ga(e,x.current)||(x.current=e,b(e)),s===`native`&&w(!1),h(!0)},commitValidation(){s===`native`&&w(!0),h(!0)}}}function pa(e){return e?Array.isArray(e)?e:[e]:[]}function ma(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return pa(n)}return[]}function ha(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:sa}:null}function ga(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}var _a=(0,v.createContext)(null),va=(0,v.forwardRef)(function(e,t){[e,t]=he(e,t,_a);let{validationErrors:n,validationBehavior:r=`native`,children:i,className:a,...o}=e;return v.createElement(ve.form,{noValidate:r!==`native`,...o,ref:t,className:a||`react-aria-Form`},v.createElement(_a.Provider,{value:{...e,validationBehavior:r}},v.createElement(la.Provider,{value:n??{}},i)))}),ya=new WeakMap;function ba(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=ji(e),s=ae([!!t,!!n,r,i]),c=ae([!!t,!!n,r,i]);return o=P(o,{"aria-describedby":[s,c,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:c}}}function xa(e,t,n){let r=Zt(e=>{n&&!e.defaultPrevented&&n(t)});(0,v.useEffect)(()=>{let t=e?.current?.form;return t?.addEventListener(`reset`,r),()=>{t?.removeEventListener(`reset`,r)}},[e])}function Sa(e,t,n){let{validationBehavior:r,focus:i}=e;y(()=>{if(r===`native`&&n?.current&&`setCustomValidity`in n.current&&!n.current.disabled){let e=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(` `)||`Invalid value.`:``;n.current.setCustomValidity(e),n.current.hasAttribute(`title`)||(n.current.title=``),t.realtimeValidation.isInvalid||t.updateValidation(wa(n.current))}});let a=(0,v.useRef)(!1),o=Zt(()=>{a.current||t.resetValidation()}),s=Zt(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&Ta(r)===n.current&&(i?i():n.current?.focus(),Ut(`keyboard`)),e.preventDefault()}),c=Zt(()=>{t.commitValidation()});(0,v.useEffect)(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{a.current=!window.event||window.event.type===`message`&&z(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,s),e.addEventListener(`change`,c),t?.addEventListener(`reset`,o),()=>{e.removeEventListener(`invalid`,s),e.removeEventListener(`change`,c),t?.removeEventListener(`reset`,o),t&&(t.reset=r)}},[n,r])}function Ca(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function wa(e){return{isInvalid:!e.validity.valid,validationDetails:Ca(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function Ta(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}function Ea(e=!0){let[t,n]=(0,v.useState)(e),r=(0,v.useRef)(!1),i=(0,v.useCallback)(e=>{r.current=!0,n(!!e)},[]);return y(()=>{r.current||n(!1)},[]),[i,t]}function Da(e=!0){let t=N(),[n,r]=Ea(e);return{id:r?t:void 0,ref:n}}function Oa(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:a,name:o,form:s,children:c,isRequired:l,validationBehavior:u=`aria`,"aria-label":d,"aria-labelledby":f,"aria-describedby":p,onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b}=e,x=da({...e,value:t.isSelected}),{isInvalid:S,validationErrors:C,validationDetails:w}=x.displayValidation;Sa(e,x,n);let T=e=>{e.stopPropagation(),t.setSelected(z(e).checked)},{pressProps:E,isPressed:D}=pi({onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b,isDisabled:r}),[O,k]=(0,v.useState)(!1),{pressProps:A}=pi({onPressStart(e){e.pointerType===`keyboard`||e.pointerType===`virtual`?e.continuePropagation():(m?.(e),g?.(!0),k(!0))},onPressEnd(e){e.pointerType===`keyboard`||e.pointerType===`virtual`?e.continuePropagation():(h?.(e),g?.(!1),k(!1))},onPressUp(e){e.pointerType===`keyboard`||e.pointerType===`virtual`?e.continuePropagation():y?.(e)},onClick:b,onPress(r){if(r.pointerType===`keyboard`||r.pointerType===`virtual`){r.continuePropagation();return}_?.(r),t.toggle(),n.current?.focus();let{[ua]:i}=e,{commitValidation:a}=i||x;a()},isDisabled:r||i}),{focusableProps:j}=mr(e,n),ee=P(E,j),te=Zr(e,{labelable:!0});xa(n,t.defaultSelected,t.setSelected);let ne=Da(),M=Da();return{labelProps:P(A,{onClick:e=>e.preventDefault()}),inputProps:P(te,{checked:t.isSelected,"aria-required":l&&u===`aria`||void 0,required:l&&u===`native`,"aria-invalid":S||e.validationState===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,"aria-describedby":[ne.id,M.id,p].filter(Boolean).join(` `)||void 0,onChange:T,disabled:r,...a==null?{}:{value:a},name:o,form:s,type:`checkbox`,...ee}),descriptionProps:ne,errorMessageProps:M,isSelected:t.isSelected,isPressed:D||O,isDisabled:r,isReadOnly:i,isInvalid:S||e.validationState===`invalid`,validationErrors:C,validationDetails:w}}function ka(e,t,n){let{labelProps:r,inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}=Oa(e,t,n),{isIndeterminate:m}=e;return(0,v.useEffect)(()=>{n.current&&(n.current.indeterminate=!!m)}),{labelProps:P(r,(0,v.useMemo)(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}}function Aa(e={}){let{isReadOnly:t}=e,[n,r]=Dn(e.isSelected,e.defaultSelected||!1,e.onChange),[i]=(0,v.useState)(n);function a(e){t||r(e)}function o(){t||r(!n)}return{isSelected:n,defaultSelected:e.defaultSelected??i,setSelected:a,toggle:o}}function ja(e,t,n){let r=Aa({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(n){n?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(n)}}),{name:i,form:a,descriptionId:o,errorMessageId:s,validationBehavior:c}=ya.get(t);c=e.validationBehavior??c;let{realtimeValidation:l}=da({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=(0,v.useRef)(ca),d=()=>{t.setInvalid(e.value,l.isInvalid?l:u.current)};(0,v.useEffect)(d);let f=t.realtimeValidation.isInvalid?t.realtimeValidation:l,p=c===`native`?t.displayValidation:f,m=ka({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,form:e.form||a,isRequired:e.isRequired??t.isRequired,validationBehavior:c,[ua]:{realtimeValidation:f,displayValidation:p,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){u.current=e,d()}}},r,n);return{...m,inputProps:{...m.inputProps,"aria-describedby":[m.inputProps[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}var Ma=(0,v.createContext)(null),Na=(0,v.createContext)(null),Pa=(0,v.createContext)(null);function Fa(e,t){let{validationBehavior:n}=me(_a)||{},r=e.validationBehavior??n??`native`,i=(0,v.useContext)(Na),a=ue((0,v.useMemo)(()=>oe(t,e.inputRef===void 0?null:e.inputRef),[t,e.inputRef])),o={...I(e),children:typeof e.children==`function`||e.children,value:e.value,validationBehavior:r};return[i?ja(o,i,a):ka(o,Aa(e),a),a]}var Ia=(0,v.forwardRef)(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=he(r,t,Ma);let[i,a]=Fa(e,n);return v.createElement(Pa.Provider,{value:{...i,inputRef:a,defaultClassName:`react-aria-Checkbox`,isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}},v.createElement(La,{...e,ref:t}))}),La=(0,v.forwardRef)(function(e,t){let{labelProps:n,inputProps:r,isSelected:i,isDisabled:a,isReadOnly:o,isPressed:s,isInvalid:c,inputRef:l,defaultClassName:u,isIndeterminate:d,isRequired:f}=(0,v.useContext)(Pa),{isFocused:p,isFocusVisible:m,focusProps:h}=Si(),g=a||o,{hoverProps:_,isHovered:y}=Oi({...e,isDisabled:g}),b=pe({...e,defaultClassName:u,values:{isSelected:i,isIndeterminate:d||!1,isPressed:s,isHovered:y,isFocused:p,isFocusVisible:m,isDisabled:a,isReadOnly:o,isInvalid:c,isRequired:f||!1}}),x=Zr(e,{global:!0});return delete x.id,delete x.onClick,v.createElement(ve.label,{...P(x,n,_,b),ref:t,slot:e.slot||void 0,"data-selected":i||void 0,"data-indeterminate":d||void 0,"data-pressed":s||void 0,"data-hovered":y||void 0,"data-focused":p||void 0,"data-focus-visible":m||void 0,"data-disabled":a||void 0,"data-readonly":o||void 0,"data-invalid":c||void 0,"data-required":f||void 0},v.createElement(ra,{elementType:`span`},v.createElement(`input`,{...P(r,h),ref:l})),b.children)}),Ra=(0,v.createContext)({}),za=(0,v.createContext)({}),Ba=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},Va=_r(function(e,t){[e,t]=he(e,t,za);let{hoverProps:n,isHovered:r}=Oi({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:a,focusProps:o}=Si({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=pe({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-Input`});return v.createElement(ve.input,{...P(Ba(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})});function Ha(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:a=!1,type:o=`text`,validationBehavior:s=`aria`}=e,[c,l]=Dn(e.value,e.defaultValue||``,e.onChange),{focusableProps:u}=mr(e,t),d=da({...e,value:c}),{isInvalid:f,validationErrors:p,validationDetails:m}=d.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:_,errorMessageProps:y}=ba({...e,isInvalid:f,errorMessage:e.errorMessage||p}),b=Zr(e,{labelable:!0}),x={type:o,pattern:e.pattern},[S]=(0,v.useState)(c);return xa(t,e.defaultValue??S,l),Sa(e,d,t),{labelProps:h,inputProps:P(b,n===`input`?x:void 0,{disabled:r,readOnly:a,required:i&&s===`native`,"aria-required":i&&s===`aria`||void 0,"aria-invalid":f||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-activedescendant":e[`aria-activedescendant`],"aria-autocomplete":e[`aria-autocomplete`],"aria-haspopup":e[`aria-haspopup`],"aria-controls":e[`aria-controls`],value:c,onChange:e=>l(z(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,enterKeyHint:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...u,...g}),descriptionProps:_,errorMessageProps:y,isInvalid:f,validationErrors:p,validationDetails:m}}var Ua={};Ua={colorSwatchPicker:`تغييرات الألوان`,dropzoneLabel:`DropZone`,selectPlaceholder:`حدد عنصرًا`,tableResizer:`أداة تغيير الحجم`};var Wa={};Wa={colorSwatchPicker:`Цветови мостри`,dropzoneLabel:`DropZone`,selectPlaceholder:`Изберете предмет`,tableResizer:`Преоразмерител`};var Ga={};Ga={colorSwatchPicker:`Vzorky barev`,dropzoneLabel:`Místo pro přetažení`,selectPlaceholder:`Vyberte položku`,tableResizer:`Změna velikosti`};var Ka={};Ka={colorSwatchPicker:`Farveprøver`,dropzoneLabel:`DropZone`,selectPlaceholder:`Vælg et element`,tableResizer:`Størrelsesændring`};var qa={};qa={colorSwatchPicker:`Farbfelder`,dropzoneLabel:`Ablegebereich`,selectPlaceholder:`Element wählen`,tableResizer:`Größenanpassung`};var Ja={};Ja={colorSwatchPicker:`Χρωματικά δείγματα`,dropzoneLabel:`DropZone`,selectPlaceholder:`Επιλέξτε ένα αντικείμενο`,tableResizer:`Αλλαγή μεγέθους`};var Ya={};Ya={selectPlaceholder:`Select an item`,tableResizer:`Resizer`,dropzoneLabel:`DropZone`,colorSwatchPicker:`Color swatches`};var Xa={};Xa={colorSwatchPicker:`Muestras de colores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Seleccionar un artículo`,tableResizer:`Cambiador de tamaño`};var Za={};Za={colorSwatchPicker:`Värvinäidised`,dropzoneLabel:`DropZone`,selectPlaceholder:`Valige üksus`,tableResizer:`Suuruse muutja`};var Qa={};Qa={colorSwatchPicker:`Värimallit`,dropzoneLabel:`DropZone`,selectPlaceholder:`Valitse kohde`,tableResizer:`Koon muuttaja`};var $a={};$a={colorSwatchPicker:`Échantillons de couleurs`,dropzoneLabel:`DropZone`,selectPlaceholder:`Sélectionner un élément`,tableResizer:`Redimensionneur`};var eo={};eo={colorSwatchPicker:`דוגמיות צבע`,dropzoneLabel:`DropZone`,selectPlaceholder:`בחר פריט`,tableResizer:`שינוי גודל`};var to={};to={colorSwatchPicker:`Uzorci boja`,dropzoneLabel:`Zona spuštanja`,selectPlaceholder:`Odaberite stavku`,tableResizer:`Promjena veličine`};var no={};no={colorSwatchPicker:`Színtárak`,dropzoneLabel:`DropZone`,selectPlaceholder:`Válasszon ki egy elemet`,tableResizer:`Átméretező`};var ro={};ro={colorSwatchPicker:`Campioni di colore`,dropzoneLabel:`Zona di rilascio`,selectPlaceholder:`Seleziona un elemento`,tableResizer:`Ridimensionamento`};var io={};io={colorSwatchPicker:`カラースウォッチ`,dropzoneLabel:`ドロップゾーン`,selectPlaceholder:`項目を選択`,tableResizer:`サイズ変更ツール`};var ao={};ao={colorSwatchPicker:`색상 견본`,dropzoneLabel:`드롭 영역`,selectPlaceholder:`항목 선택`,tableResizer:`크기 조정기`};var oo={};oo={colorSwatchPicker:`Spalvų pavyzdžiai`,dropzoneLabel:`„DropZone“`,selectPlaceholder:`Pasirinkite elementą`,tableResizer:`Dydžio keitiklis`};var so={};so={colorSwatchPicker:`Krāsu paraugi`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izvēlēties vienumu`,tableResizer:`Izmēra mainītājs`};var co={};co={colorSwatchPicker:`Fargekart`,dropzoneLabel:`Droppsone`,selectPlaceholder:`Velg et element`,tableResizer:`Størrelsesendrer`};var lo={};lo={colorSwatchPicker:`kleurstalen`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecteer een item`,tableResizer:`Resizer`};var uo={};uo={colorSwatchPicker:`Próbki kolorów`,dropzoneLabel:`Strefa upuszczania`,selectPlaceholder:`Wybierz element`,tableResizer:`Zmiana rozmiaru`};var fo={};fo={colorSwatchPicker:`Amostras de cores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecione um item`,tableResizer:`Redimensionador`};var po={};po={colorSwatchPicker:`Amostras de cores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecione um item`,tableResizer:`Redimensionador`};var mo={};mo={colorSwatchPicker:`Specimene de culoare`,dropzoneLabel:`Zonă de plasare`,selectPlaceholder:`Selectați un element`,tableResizer:`Instrument de redimensionare`};var ho={};ho={colorSwatchPicker:`Цветовые образцы`,dropzoneLabel:`DropZone`,selectPlaceholder:`Выберите элемент`,tableResizer:`Средство изменения размера`};var go={};go={colorSwatchPicker:`Vzorkovníky farieb`,dropzoneLabel:`DropZone`,selectPlaceholder:`Vyberte položku`,tableResizer:`Nástroj na zmenu veľkosti`};var _o={};_o={colorSwatchPicker:`Barvne palete`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izberite element`,tableResizer:`Spreminjanje velikosti`};var vo={};vo={colorSwatchPicker:`Uzorci boje`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izaberite stavku`,tableResizer:`Promena veličine`};var yo={};yo={colorSwatchPicker:`Färgrutor`,dropzoneLabel:`DropZone`,selectPlaceholder:`Välj en artikel`,tableResizer:`Storleksändrare`};var bo={};bo={colorSwatchPicker:`Renk örnekleri`,dropzoneLabel:`Bırakma Bölgesi`,selectPlaceholder:`Bir öğe seçin`,tableResizer:`Yeniden boyutlandırıcı`};var xo={};xo={colorSwatchPicker:`Зразки кольорів`,dropzoneLabel:`DropZone`,selectPlaceholder:`Виберіть елемент`,tableResizer:`Засіб змінення розміру`};var So={};So={colorSwatchPicker:`颜色色板`,dropzoneLabel:`放置区域`,selectPlaceholder:`选择一个项目`,tableResizer:`尺寸调整器`};var Co={};Co={colorSwatchPicker:`色票`,dropzoneLabel:`放置區`,selectPlaceholder:`選取項目`,tableResizer:`大小調整器`};var wo={};wo={"ar-AE":Ua,"bg-BG":Wa,"cs-CZ":Ga,"da-DK":Ka,"de-DE":qa,"el-GR":Ja,"en-US":Ya,"es-ES":Xa,"et-EE":Za,"fi-FI":Qa,"fr-FR":$a,"he-IL":eo,"hr-HR":to,"hu-HU":no,"it-IT":ro,"ja-JP":io,"ko-KR":ao,"lt-LT":oo,"lv-LV":so,"nb-NO":co,"nl-NL":lo,"pl-PL":uo,"pt-BR":fo,"pt-PT":po,"ro-RO":mo,"ru-RU":ho,"sk-SK":go,"sl-SI":_o,"sr-SP":vo,"sv-SE":yo,"tr-TR":bo,"uk-UA":xo,"zh-CN":So,"zh-TW":Co};var To=(0,v.createContext)({}),Eo=(0,v.createContext)(null),Do=(0,v.forwardRef)(function(e,t){let{render:n}=(0,v.useContext)(Eo);return v.createElement(v.Fragment,null,n(e,t))});function Oo(e,t){let n=e?.renderDropIndicator,r=e?.isVirtualDragging?.(),i=(0,v.useCallback)(e=>{if(r||t?.isDropTarget(e))return n?n(e):v.createElement(Do,{target:e})},[t?.target,r,n]);return e?.useDropIndicator?i:void 0}function ko(e,t,n){let r=e.focusedKey,i=null;if(t?.isVirtualDragging?.()&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e!=null;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`)e=n.collection.getKeyAfter(e);else{if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}}i=e??t??i}return(0,v.useMemo)(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}var Ao=(0,v.createContext)({}),jo=Nr(Mn,function(e,t){return[e,t]=he(e,t,Ao),v.createElement(ve.header,{className:`react-aria-Header`,...e,ref:t},e.children)}),Mo=(0,v.createContext)(null);function No(e){let t=(0,v.useRef)({});return v.createElement(Mo.Provider,{value:t},e.children)}var Po=(0,v.createContext)({isSelected:!1}),Fo=(0,v.createContext)({});(class extends An{static{this.type=`separator`}filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}});var Io=new WeakMap;function Lo(e){return typeof e==`string`?e.replace(/\s*/g,``):``+e}function Ro(e,t){let n=Io.get(e);if(!n)throw Error(`Unknown list`);return`${n.id}-option-${Lo(t)}`}var zo=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}if(typeof this.filter==`function`)return this.filter(e);if(this.filter?.acceptNode)return this.filter.acceptNode(e);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!R(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return R(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e)){if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function Bo(e,t,n,r){return ke()?new zo(e,t,n,r):e.createTreeWalker(t,n,r)}var Vo=v.createContext(null),H=`react-aria-focus-scope-restore`,U=null;function Ho(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)([]),{parentNode:c}=(0,v.useContext)(Vo)||{},l=(0,v.useMemo)(()=>new us({scopeRef:s}),[s]);y(()=>{let e=c||ds.root;if(ds.getTreeNode(e.scopeRef)&&U&&!$o(U,e.scopeRef)){let t=ds.getTreeNode(U);t&&(e=t)}e.addChild(l),ds.addNode(l)},[l,c]),y(()=>{let e=ds.getTreeNode(s);e&&(e.contain=!!n)},[n]),y(()=>{let e=a.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==o.current;)t.push(e),e.addEventListener(H,n),e=e.nextSibling;return s.current=t,()=>{for(let e of t)e.removeEventListener(H,n)}},[t]),is(s,r,n),Jo(s,n),os(s,r,n),rs(s,i),(0,v.useEffect)(()=>{let e=Ae(L(s.current?s.current[0]:void 0)),t=null;if(Xo(e,s.current)){for(let n of ds.traverse())n.scopeRef&&Xo(e,n.scopeRef.current)&&(t=n);t===ds.getTreeNode(s)&&(U=t.scopeRef)}},[s]),y(()=>()=>{let e=ds.getTreeNode(s)?.parent?.scopeRef??null;(s===U||$o(s,U))&&(!e||ds.getTreeNode(e))&&(U=e),ds.removeTreeNode(s)},[s]);let u=(0,v.useMemo)(()=>Uo(s),[]),d=(0,v.useMemo)(()=>({focusManager:u,parentNode:l}),[l,u]);return v.createElement(Vo.Provider,{value:d},v.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,v.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:o}))}function Uo(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||Ae(L(n[0]??void 0)),c=n[0].previousElementSibling,l=cs(Wo(n),{tabbable:i,accept:o},n);l.currentNode=Xo(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&es(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||Ae(L(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=cs(Wo(n),{tabbable:i,accept:o},n);l.currentNode=Xo(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&es(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=cs(Wo(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&es(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=cs(Wo(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&es(o,!0),o}}}function Wo(e){return e[0].parentElement}function Go(e){let t=ds.getTreeNode(U);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Ko(e){if(!e.form)return Array.from(L(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=xe(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function qo(e){if(e.checked)return!0;let t=Ko(e);return t.length>0&&!t.some(e=>e.checked)}function Jo(e,t){let n=(0,v.useRef)(void 0),r=(0,v.useRef)(void 0);y(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=L(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Go(e)||t.isComposing)return;let n=Ae(a),r=e.current;if(!r||!Xo(n,r))return;let i=cs(Wo(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&(es(o,!0),o instanceof xe(o).HTMLInputElement&&o.select())},s=t=>{(!U||$o(U,e))&&Xo(z(t),e.current)?(U=e,n.current=z(t)):Go(e)&&!Zo(z(t),e)?n.current?es(n.current):U&&U.current&&ns(U.current):Go(e)&&(n.current=z(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=Ht(),i=(r===`virtual`||r===null)&&pt()&&ft(),o=Ae(a);if(!i&&o&&Go(e)&&!Zo(o,e)){U=e;let r=z(t);r&&r.isConnected?(n.current=r,es(n.current)):U.current&&ns(U.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),y(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function Yo(e){return Zo(e)}function Xo(e,t){return!e||!t?!1:t.some(t=>R(t,e))}function Zo(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of ds.traverse(ds.getTreeNode(t)))if(n&&Xo(e,n.current))return!0;return!1}function Qo(e){return Zo(e,U)}function $o(e,t){let n=ds.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function es(e,t=!1){if(e!=null&&!t)try{Jn(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function ts(e,t=!0){let n=e[0].previousElementSibling,r=Wo(e),i=cs(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=Wo(e),i=cs(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function ns(e,t=!0){es(ts(e,t))}function rs(e,t){let n=v.useRef(t);(0,v.useEffect)(()=>{n.current&&(U=e,!Xo(Ae(L(e.current?e.current[0]:void 0)),U.current)&&e.current&&ns(e.current)),n.current=!1},[e])}function is(e,t,n){y(()=>{if(t||n)return;let r=e.current,i=L(r?r[0]:void 0),a=t=>{let n=z(t);Xo(n,e.current)?U=e:Yo(n)||(U=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function as(e){let t=ds.getTreeNode(U);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function os(e,t,n){let r=(0,v.useRef)(typeof document<`u`?Ae(L(e.current?e.current[0]:void 0)):null);y(()=>{let r=e.current,i=L(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!U||$o(U,e))&&Xo(Ae(i),e.current)&&(U=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),y(()=>{let r=L(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Go(e)||t.isComposing)return;let n=r.activeElement;if(!Zo(n,e)||!as(e))return;let i=ds.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=cs(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Zo(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Zo(s,e));t.preventDefault(),t.stopPropagation(),s?es(s,!0):Yo(a)?es(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),y(()=>{let n=L(e.current?e.current[0]:void 0);if(!t)return;let i=ds.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=ds.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=Ae(n);if(t&&i&&(a&&Zo(a,e)||a===n.body&&as(e))){let t=ds.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){ss(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&ds.getTreeNode(n.scopeRef)){let e=ts(n.scopeRef.current,!0);if(e){ss(e);return}}n=n.parent}}})}}},[e,t])}function ss(e){e.dispatchEvent(new CustomEvent(H,{bubbles:!0,cancelable:!0}))&&es(e)}function cs(e,t,n){let r=t?.tabbable?Xe:Ye,i=L(e?.nodeType===Node.ELEMENT_NODE?e:null),a=Bo(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return R(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!qo(e)||a.currentNode.tagName===`INPUT`&&a.currentNode.type===`radio`&&a.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||Xo(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}var ls=class e{constructor(){this.fastMap=new Map,this.root=new us({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new us({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&Xo(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},us=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}},ds=new ls;function fs(e){return ut()?e.altKey:e.ctrlKey}function ps(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,r=e.current?.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),e.current?.querySelector(n)}var ms=new WeakMap;function hs(e){let t=N();return ms.set(e,t),t}function gs(e){return ms.get(e)}var _s=1e3;function vs(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=(0,v.useRef)({search:``,timeout:void 0});return(0,v.useEffect)(()=>{let e=i.current.timeout;return()=>{clearTimeout(e)}},[i]),{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{if(i.current.search.length>0&&e.key===` `){if(e.preventDefault(),(!(`continuePropagation`in e)||`continuePropagation`in e&&!e.isPropagationStopped())&&e.stopPropagation(),i.current.search+=` `,t.getKeyForSearch!=null){let e=t.getKeyForSearch(i.current.search,n.focusedKey);e??=t.getKeyForSearch(i.current.search),e!=null&&(n.setFocusedKey(e),r&&r(e))}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},_s)}}:void 0,onKeyDown:t.getKeyForSearch?e=>{let a=ys(e.key);if(!(!a||e.ctrlKey||e.metaKey||e.altKey||!R(e.currentTarget,z(e))||i.current.search.length===0&&a===` `)){if(i.current.search+=a,t.getKeyForSearch!=null){let a=t.getKeyForSearch(i.current.search,n.focusedKey);if(a??=t.getKeyForSearch(i.current.search),a!=null)n.setFocusedKey(a),r&&r(a),e.preventDefault(),`continuePropagation`in e||e.stopPropagation();else{i.current.search=``,clearTimeout(i.current.timeout),i.current.timeout=void 0;return}}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},_s)}}:void 0}}}function ys(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function bs(e,t){let n=(0,v.useRef)(!0),r=(0,v.useRef)(null);y(()=>(n.current=!0,()=>{n.current=!1}),[]),y(()=>{n.current?n.current=!1:(!r.current||t.some((e,t)=>!Object.is(e,r[t])))&&e(),r.current=t},t)}function xs(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:s=!1,escapeKeyBehavior:c=`clearSelection`,selectOnFocus:l=t.selectionBehavior===`replace`,disallowTypeAhead:u=!1,shouldUseVirtualFocus:d,allowsTabNavigation:f=!1,scrollRef:p=r,linkBehavior:m=`action`,UNSTABLE_focusOnEntry:h}=e,{direction:g}=dn(),_=vt(),y=(e,n,i)=>{if(n!=null){if(t.isLink(n)&&m===`selection`&&l&&!fs(e)){(0,xr.flushSync)(()=>{t.setFocusedKey(n,i)});let a=ps(r,n),o=t.getItemProps(n);if(a){_.open(a,e,o.href,o.routerOptions);return}return!1}if(t.setFocusedKey(n,i),t.isLink(n)&&m===`override`)return!1;if(e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(n);return}if(l&&!fs(e)){t.replaceSelection(n);return}}return!1},b=e=>{if(n.getKeyBelow){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyBelow?.(t.focusedKey);if(r==null&&a&&(r=n.getFirstKey?.(t.focusedKey)),r!=null){y(e,r);return}}return!1},x=e=>{if(n.getKeyAbove){let r=t.focusedKey==null?n.getLastKey?.():n.getKeyAbove?.(t.focusedKey);if(r==null&&a&&(r=n.getLastKey?.(t.focusedKey)),r!=null){y(e,r);return}}return!1},S=e=>{if(n.getFirstKey){if(t.focusedKey===null&&e.shiftKey)return!1;let r=n.getFirstKey(t.focusedKey,qt(e));if(t.setFocusedKey(r),r!=null){if(qt(e)&&e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(r);return}if(l){t.replaceSelection(r);return}}}return!1},C=e=>{if(n.getKeyLeftOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyLeftOf?.(t.focusedKey);if(r==null&&a&&(r=g===`rtl`?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),r!=null){y(e,r,g===`rtl`?`first`:`last`);return}}return!1},w=e=>{if(n.getKeyRightOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyRightOf?.(t.focusedKey);if(r==null&&a&&(r=g===`rtl`?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),r!=null){y(e,r,g===`rtl`?`last`:`first`);return}}return!1},T=e=>{if(n.getLastKey){if(t.focusedKey===null&&e.shiftKey)return!1;let r=n.getLastKey(t.focusedKey,qt(e));if(t.setFocusedKey(r),r!=null){if(qt(e)&&e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(r);return}if(l){t.replaceSelection(r);return}}}return!1},E=e=>{if(n.getKeyPageBelow&&t.focusedKey!=null){let r=n.getKeyPageBelow(t.focusedKey);if(r!=null)return y(e,r)}return!1},D=e=>{if(n.getKeyPageAbove&&t.focusedKey!=null){let r=n.getKeyPageAbove(t.focusedKey);if(r!=null)return y(e,r)}return!1},O=()=>{if(t.selectionMode===`multiple`&&s!==!0)t.selectAll();else return!1},k=()=>{if(c===`clearSelection`&&!o&&t.selectedKeys.size!==0)t.clearSelection();else return!1},A=()=>{if(!f&&r.current){let e=cs(r.current,{tabbable:!0}),t,n;do n=e.lastChild(),n&&(t=n);while(n);let i=Ae();t&&(!Me(t)||i&&!Xe(i))&&Le(t)}return{shouldContinuePropagation:!0,shouldPreventDefault:!1}},j=()=>(!f&&r.current&&r.current.focus(),{shouldContinuePropagation:!0,shouldPreventDefault:!1}),ee=(e,t)=>({[ot()?e+`+Shift+Alt`:e+`+Shift+Control`]:t,[e+`+Shift`]:t,[ot()?e+`+Alt`:e+`+Control`]:t,[e]:t}),{keyboardProps:te}=lr({shortcuts:{...ee(`ArrowDown`,b),...ee(`ArrowUp`,x),...ee(`ArrowLeft`,C),...ee(`ArrowRight`,w),...ee(`PageDown`,E),...ee(`PageUp`,D)},allowRepeats:!0}),{keyboardProps:ne}=lr({shortcuts:{...ee(`Home`,S),...ee(`End`,T),"Mod+A":O,Escape:k,Tab:A,"Tab+Shift":j}}),M=(0,v.useRef)({top:0,left:0});Qt(p,`scroll`,()=>{M.current={top:p.current?.scrollTop??0,left:p.current?.scrollLeft??0}});let re=e=>{if(t.isFocused){R(e.currentTarget,z(e))||t.setFocused(!1);return}if(!R(e.currentTarget,z(e)))return;let i=Ht();t.setFocused(!0);let a=e=>{e!=null&&(t.setFocusedKey(e),l&&!t.isSelected(e)&&t.replaceSelection(e))};if(h&&(i===`keyboard`||i===`virtual`))a(h===`first`?n.getFirstKey?.():n.getLastKey?.());else if(t.focusedKey==null){let r=e.relatedTarget;r&&e.currentTarget.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?a(t.lastSelectedKey??n.getLastKey?.()):a(t.firstSelectedKey??n.getFirstKey?.())}else p.current&&(p.current.scrollTop=M.current.top,p.current.scrollLeft=M.current.left);if(t.focusedKey!=null&&p.current){let e=ps(r,t.focusedKey);e instanceof HTMLElement&&(!Me(e)&&!d&&Le(e),(i===`keyboard`||h&&i===`virtual`)&&Zi(e,{containingElement:r.current}))}},N=e=>{R(e.currentTarget,e.relatedTarget)||t.setFocused(!1)},ie=(0,v.useRef)(!1);Qt(r,be,d?e=>{let{detail:n}=e;e.stopPropagation(),t.setFocused(!0),n?.focusStrategy===`first`&&(ie.current=!0)}:void 0);let ae=n.getFirstKey?.()??null;bs(()=>{if(ie.current){if(ae==null){let e=Ae();Ne(r.current),Fe(e,null),t.collection.size>0&&(ie.current=!1)}else t.setFocusedKey(ae),ie.current=!1}},[ae,t.collection.size]),bs(()=>{t.collection.size>0&&(ie.current=!1)},[t.focusedKey]),Qt(r,ye,d?e=>{e.stopPropagation(),t.setFocused(!1),e.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);let oe=(0,v.useRef)(i),se=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(oe.current){let e=null;i===`first`&&(e=n.getFirstKey?.()??null),i===`last`&&(e=n.getLastKey?.()??null);let a=t.selectedKeys;if(a.size){for(let n of a)if(t.canSelectItem(n)){e=n;break}}t.setFocused(!0),t.setFocusedKey(e),e!=null&&l&&!a.size&&t.canSelectItem(e)&&t.replaceSelection(e),e==null&&!d&&r.current&&Jn(r.current),t.collection.size>0&&(oe.current=!1,se.current=!0)}});let ce=(0,v.useRef)(t.focusedKey),le=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==ce.current||se.current)&&p.current&&r.current){let e=Ht(),n=ps(r,t.focusedKey);if(!(n instanceof HTMLElement))return;(e===`keyboard`||se.current)&&(le.current&&cancelAnimationFrame(le.current),le.current=requestAnimationFrame(()=>{p.current&&(Yi(p.current,n),e!==`virtual`&&Zi(n,{containingElement:r.current}))}))}!d&&t.isFocused&&t.focusedKey==null&&ce.current!=null&&r.current&&Jn(r.current),ce.current=t.focusedKey,se.current=!1}),(0,v.useEffect)(()=>()=>{le.current&&cancelAnimationFrame(le.current)},[]),Qt(r,`react-aria-focus-scope-restore`,e=>{e.preventDefault(),t.setFocused(!0)});let ue={...P(ne,te),onFocus:re,onBlur:N,onMouseDown(e){p.current===z(e)&&e.preventDefault()}},{typeSelectProps:de}=vs({keyboardDelegate:n,selectionManager:t});u||(ue=P(de,ue));let fe;d||(fe=t.focusedKey==null?0:-1);let pe=hs(t.collection);return{collectionProps:P(ue,{tabIndex:fe,"data-collection":pe})}}var Ss=class{constructor(e){this.ref=e}getItemRect(e){let t=this.ref.current;if(!t)return null;let n=e==null?null:ps(this.ref,e);if(!n)return null;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return{x:i.left-r.left-t.clientLeft+t.scrollLeft,y:i.top-r.top-t.clientTop+t.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:e?.scrollWidth??0,height:e?.scrollHeight??0}}getVisibleRect(){let e=this.ref.current;return{x:e?.scrollLeft??0,y:e?.scrollTop??0,width:e?.clientWidth??0,height:e?.clientHeight??0}}},Cs=class{constructor(...e){if(e.length===1){let t=e[0];this.collection=t.collection,this.ref=t.ref,this.collator=t.collator,this.disabledKeys=t.disabledKeys||new Set,this.disabledBehavior=t.disabledBehavior||`all`,this.orientation=t.orientation||`vertical`,this.direction=t.direction,this.layout=t.layout||`stack`,this.layoutDelegate=t.layoutDelegate||new Ss(t.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout=`stack`,this.orientation=`vertical`,this.disabledBehavior=`all`,this.layoutDelegate=new Ss(this.ref);this.layout===`stack`&&this.orientation===`vertical`&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){return this.disabledBehavior===`all`&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&e.props?.disabledBehavior!==`selection`}findNextNonDisabled(e,t,n=!1){let r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e?.type===`item`&&(n||!this.isDisabled(e)))return r;r=t(r)}return null}getNextKey(e,t){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,e=>this.collection.getKeyAfter(e),t?.includeDisabled)}getPreviousKey(e,t){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,e=>this.collection.getKeyBefore(e),t?.includeDisabled)}findKey(e,t,n){let r=e,i=this.layoutDelegate.getItemRect(r);if(!i||r==null)return null;let a=i;do{if(r=t(r),r==null)break;i=this.layoutDelegate.getItemRect(r)}while(i&&n(a,i)&&r!=null);return r}isSameRow(e,t){return e.y===t.y||e.x!==t.x}isSameColumn(e,t){return e.x===t.x||e.y!==t.y}isReversed(e){let t=this.getNextKey(e),n=ps(this.ref,e);if(t!=null){let e=ps(this.ref,t);return!n||!e?!1:n.getBoundingClientRect().top>e.getBoundingClientRect().top}let r=this.getPreviousKey(e);if(r!=null){let e=ps(this.ref,r);return!n||!e?!1:e.getBoundingClientRect().top>n.getBoundingClientRect().top}return!1}getKeyBelow(e,t){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getNextKey(e,t),this.isSameRow):this.orientation===`vertical`&&this.isReversed(e)?this.getPreviousKey(e,t):this.getNextKey(e,t)}getKeyAbove(e,t){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getPreviousKey(e,t),this.isSameRow):this.orientation===`vertical`&&this.isReversed(e)?this.getNextKey(e,t):this.getPreviousKey(e,t)}getNextColumn(e,t,n){return t?this.getPreviousKey(e,n):this.getNextKey(e,n)}getKeyRightOf(e,t){let n=this.direction===`ltr`?`getKeyRightOf`:`getKeyLeftOf`;return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[n](e),t?.includeDisabled)):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`rtl`,t):this.findKey(e,e=>this.getNextColumn(e,this.direction===`rtl`,t),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`rtl`,t):null}getKeyLeftOf(e,t){let n=this.direction===`ltr`?`getKeyLeftOf`:`getKeyRightOf`;return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[n](e),t?.includeDisabled)):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`ltr`,t):this.findKey(e,e=>this.getNextColumn(e,this.direction===`ltr`,t),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`ltr`,t):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyAfter(e))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;let r=this.isReversed(e);if(t&&!Ki(t))return this.getFirstKey();let i=e;if(this.orientation===`horizontal`){let e=Math.max(0,n.x+n.width-this.layoutDelegate.getVisibleRect().width);for(;n&&n.x>e&&i!=null;)i=this.getKeyAbove(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}else{let e=this.layoutDelegate.getVisibleRect(),t=r?n.y-e.height:Math.max(0,n.y+n.height-e.height);for(;n&&n.y>t&&i!=null;)i=this.getKeyAbove(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}return i??(r?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;let r=this.isReversed(e);if(t&&!Ki(t))return this.getLastKey();let i=e;if(this.orientation===`horizontal`){let e=Math.min(this.layoutDelegate.getContentSize().width,n.x-n.width+this.layoutDelegate.getVisibleRect().width);for(;n&&n.x<e&&i!=null;)i=this.getKeyBelow(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}else{let e=Math.min(this.layoutDelegate.getContentSize().height,n.y-n.height+this.layoutDelegate.getVisibleRect().height);for(;n&&n.y<e&&i!=null;)i=this.getKeyBelow(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}return i??(r?this.getFirstKey():this.getLastKey())}getKeyForSearch(e,t){if(!this.collator)return null;let n=this.collection,r=t||this.getFirstKey();for(;r!=null;){let t=n.getItem(r);if(!t)return null;let i=t.textValue.slice(0,e.length);if(t.textValue&&this.collator.compare(i,e)===0)return r;r=this.getNextKey(r)}return null}},ws=new Map;function Ts(e){let{locale:t}=dn(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(ws.has(n))return ws.get(n);let r=new Intl.Collator(t,e);return ws.set(n,r),r}function Es(e){let{selectionManager:t,collection:n,disabledKeys:r,ref:i,keyboardDelegate:a,layoutDelegate:o,orientation:s}=e,c=Ts({usage:`search`,sensitivity:`base`}),l=t.disabledBehavior,u=(0,v.useMemo)(()=>a||new Cs({collection:n,disabledKeys:r,disabledBehavior:l,ref:i,collator:c,layoutDelegate:o,orientation:s}),[a,o,n,r,i,c,l,s]),{collectionProps:d}=xs({...e,ref:i,selectionManager:t,keyboardDelegate:u});return{listProps:d}}function Ds(e,t,n){let r=Zr(e,{labelable:!0}),i=e.selectionBehavior||`toggle`,a=e.orientation||`vertical`,o=e.linkBehavior||(i===`replace`?`action`:`override`);i===`toggle`&&o===`action`&&(o=`override`);let{listProps:s}=Es({...e,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,linkBehavior:o}),{focusWithinProps:c}=xi({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),l=N(e.id);Io.set(t,{id:l,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction,linkBehavior:o,UNSTABLE_itemBehavior:e.UNSTABLE_itemBehavior});let{labelProps:u,fieldProps:d}=ji({...e,id:l,labelElementType:`span`});return{labelProps:u,listBoxProps:P(r,c,t.selectionManager.selectionMode===`multiple`?{"aria-multiselectable":`true`}:{},{role:`listbox`,"aria-orientation":a,...P(d,s)})}}var Os=500;function ks(e){let{isDisabled:t,pointerType:n,onLongPressStart:r,onLongPressEnd:i,onLongPress:a,threshold:o=Os,accessibilityDescription:s}=e,c=(0,v.useRef)(void 0),{addGlobalListener:l,removeAllGlobalListeners:u}=si(),d=e=>n?e.pointerType===n:e.pointerType===`mouse`||e.pointerType===`touch`,{pressProps:f}=pi({isDisabled:t,onPressStart(e){if(e.continuePropagation(),d(e)){r&&r({...e,type:`longpressstart`}),c.current=setTimeout(()=>{e.target.dispatchEvent(new PointerEvent(`pointercancel`,{bubbles:!0})),l(e.target,`click`,e=>e.preventDefault(),{once:!0}),L(e.target).activeElement!==e.target&&Le(e.target),a&&a({...e,type:`longpress`}),c.current=void 0},o),e.pointerType===`touch`&&l(e.target,`contextmenu`,e=>e.preventDefault(),{once:!0});let t=xe(e.target);l(t,`pointerup`,()=>{setTimeout(()=>{u()},100)},{once:!0})}},onPressEnd(e){c.current&&clearTimeout(c.current),i&&d(e)&&i({...e,type:`longpressend`})}});return{longPressProps:P(f,ea(a&&!t?s:void 0))}}function As(e){let{id:t,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:s,isDisabled:c,onAction:l,allowsDifferentPressOrigin:u,linkBehavior:d=`action`}=e,f=vt();t=N(t);let p=e=>{if(e.pointerType===`keyboard`&&fs(e))n.toggleSelection(r);else{if(n.selectionMode===`none`)return;if(n.isLink(r)){if(d===`selection`&&i.current){let t=n.getItemProps(r);f.open(i.current,e,t.href,t.routerOptions),n.setSelectedKeys(n.selectedKeys);return}if(d===`override`||d===`none`)return}n.selectionMode===`single`?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):e&&e.shiftKey?n.extendSelection(r):n.selectionBehavior===`toggle`||e&&(qt(e)||e.pointerType===`touch`||e.pointerType===`virtual`)?n.toggleSelection(r):n.replaceSelection(r)}};(0,v.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(o?Ne(i.current):s?s():Ae()!==i.current&&i.current&&Jn(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,o]),c||=n.isDisabled(r);let m={};!o&&!c?m={tabIndex:r===n.focusedKey?0:-1,onFocus(e){z(e)===i.current&&n.setFocusedKey(r)}}:c&&(m.onMouseDown=e=>{e.preventDefault()}),(0,v.useEffect)(()=>{c&&n.focusedKey===r&&n.setFocusedKey(null)},[n,c,r]);let h=n.isLink(r)&&d===`override`,g=l&&e.UNSTABLE_itemBehavior===`action`,y=n.isLink(r)&&d!==`selection`&&d!==`none`,b=!c&&n.canSelectItem(r)&&!h&&!g,x=(l||y)&&!c,S=x&&(n.selectionBehavior===`replace`?!b:!b||n.isEmpty),C=x&&b&&n.selectionBehavior===`replace`,w=S||C,T=(0,v.useRef)(null),E=w&&b,D=(0,v.useRef)(!1),O=(0,v.useRef)(!1),k=n.getItemProps(r),A=e=>{l&&(l(),i.current?.dispatchEvent(new CustomEvent(`react-aria-item-action`,{bubbles:!0}))),y&&i.current&&f.open(i.current,e,k.href,k.routerOptions)},j={ref:i};a?(j.onPressStart=e=>{T.current=e.pointerType,D.current=E,e.pointerType===`keyboard`&&(!w||Ms(e.key))&&p(e)},u?(j.onPressUp=S?void 0:e=>{e.pointerType===`mouse`&&b&&p(e)},j.onPress=S?A:e=>{e.pointerType!==`keyboard`&&e.pointerType!==`mouse`&&b&&p(e)}):j.onPress=e=>{if(S||C&&e.pointerType!==`mouse`){if(e.pointerType===`keyboard`&&!js(e.key))return;A(e)}else e.pointerType!==`keyboard`&&b&&p(e)}):(j.onPressStart=e=>{T.current=e.pointerType,D.current=E,O.current=S,b&&(e.pointerType===`mouse`&&!S||e.pointerType===`keyboard`&&(!x||Ms(e.key)))&&p(e)},j.onPress=e=>{(e.pointerType===`touch`||e.pointerType===`pen`||e.pointerType===`virtual`||e.pointerType===`keyboard`&&w&&js(e.key)||e.pointerType===`mouse`&&O.current)&&(w?A(e):b&&p(e))});let ee=gs(n.collection);if(m[`data-collection`]=ee,m[`data-key`]=r,j.preventFocusOnPress=o,o&&(j=P(j,{onPressStart(e){e.pointerType!==`touch`&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(e){e.pointerType===`touch`&&(n.setFocused(!0),n.setFocusedKey(r))}})),k)for(let e of[`onPressStart`,`onPressEnd`,`onPressChange`,`onPress`,`onPressUp`,`onClick`])k[e]&&(j[e]=_(j[e],k[e]));let{pressProps:te,isPressed:ne}=pi(j),M=C?e=>{T.current===`mouse`&&(e.stopPropagation(),e.preventDefault(),A(e))}:void 0,{longPressProps:re}=ks({isDisabled:!E,onLongPress(e){e.pointerType===`touch`&&(p(e),n.setSelectionBehavior(`toggle`))}}),ie=e=>{T.current===`touch`&&D.current&&e.preventDefault()},ae=d!==`none`&&n.isLink(r)?e=>{bt.isOpening||e.preventDefault()}:void 0,oe=P(m,b||S||o&&!c?te:{},E?re:{},{onDoubleClick:M,onDragStartCapture:ie,onClick:ae,id:t},o?{onMouseDown:e=>e.preventDefault()}:void 0),se=e=>{let t=e;for(;t&&t!==i.current;){let e=t.getAttribute(`data-collection`);if(e!=null)return e!==ee;t=t.parentElement}return Xe(e)},ce=oe.onPointerDown;oe.onPointerDown=e=>{let t=z(e);t&&t!==i.current&&se(t)?e.stopPropagation():ce?.(e)};let le=oe.onMouseDown;return oe.onMouseDown=e=>{let t=z(e);t&&t!==i.current&&se(t)?e.stopPropagation():le?.(e)},{itemProps:oe,isPressed:ne,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:c,allowsSelection:b,hasAction:w}}function js(e){return e===`Enter`}function Ms(e){return e===` `}function Ns(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function Ps(e){return Fs(e,0)}function Fs(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function Is(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...Ls(e,t),t],i=[...Ls(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function Ls(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}var Rs=new WeakMap;function zs(e){let t=Rs.get(e);if(t!=null)return t;let n=0,r=t=>{for(let i of t)i.type===`section`?r(Ns(i,e)):i.type===`item`&&n++};return r(e),Rs.set(e,n),n}function Bs(e,t,n){let{key:r}=e,i=Io.get(t),a=e.isDisabled??t.selectionManager.isDisabled(r),o=e.isSelected??t.selectionManager.isSelected(r),s=e.shouldSelectOnPressUp??i?.shouldSelectOnPressUp,c=e.shouldFocusOnHover??i?.shouldFocusOnHover,l=e.shouldUseVirtualFocus??i?.shouldUseVirtualFocus,u=e.isVirtualized??i?.isVirtualized,d=ae(),f=ae(),p={role:`option`,"aria-disabled":a||void 0,"aria-selected":t.selectionManager.selectionMode===`none`?void 0:o,"aria-label":e[`aria-label`],"aria-labelledby":d,"aria-describedby":f},m=t.collection.getItem(r);if(u){let e=Number(m?.index);p[`aria-posinset`]=Number.isNaN(e)?void 0:e+1,p[`aria-setsize`]=zs(t.collection)}let h=i?.onAction?()=>i?.onAction?.(r):void 0,g=Ro(t,r),{itemProps:v,isPressed:y,isFocused:b,hasAction:x,allowsSelection:S}=As({selectionManager:t.selectionManager,key:r,ref:n,shouldSelectOnPressUp:s,allowsDifferentPressOrigin:s&&c,isVirtualized:u,shouldUseVirtualFocus:l,isDisabled:a,onAction:h||m?.props?.onAction?_(m?.props?.onAction,h):void 0,linkBehavior:i?.linkBehavior,UNSTABLE_itemBehavior:i?.UNSTABLE_itemBehavior,id:g}),{hoverProps:C}=Oi({isDisabled:a||!c,onHoverStart(){Vt()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r))}}),w=Zr(m?.props);delete w.id;let T=Ct(m?.props);return{optionProps:{...p,...P(w,v,C,T),id:g},labelProps:{id:d},descriptionProps:{id:f},isFocused:b,isFocusVisible:b&&t.selectionManager.isFocused&&Vt(),isSelected:o,isDisabled:a,isPressed:y,allowsSelection:S,hasAction:x}}function Vs(e){let{heading:t,"aria-label":n}=e,r=N();return{itemProps:{role:`presentation`},headingProps:t?{id:r,role:`presentation`,onMouseDown:e=>{e.preventDefault()}}:{},groupProps:{role:`group`,"aria-label":n,"aria-labelledby":t?r:void 0}}}function Hs(e){let t=v.version.split(`.`);return parseInt(t[0],10)>=19?e:e?`true`:void 0}var Us=class{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let t=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&e.type===`section`)for(let n of e.childNodes)t(n)};for(let n of e)t(n);let n=null,r=0,i=0;for(let[e,t]of this.keyMap)n?(n.nextKey=e,t.prevKey=n.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=r++),(t.type===`section`||t.type===`item`)&&i++,n=t,n.nextKey=void 0;this._size=i,this.lastKey=n?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}},Ws=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Gs(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ks(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=(0,v.useRef)(!1),[,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=(0,v.useRef)(null),[,u]=(0,v.useState)(null),[d,f]=Dn((0,v.useMemo)(()=>qs(e.selectedKeys),[e.selectedKeys]),(0,v.useMemo)(()=>qs(e.defaultSelectedKeys,new Ws),[e.defaultSelectedKeys]),e.onSelectionChange),p=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[m,h]=(0,v.useState)(i);i===`replace`&&m===`toggle`&&typeof d==`object`&&d.size===0&&h(`replace`);let g=(0,v.useRef)(i);return(0,v.useEffect)(()=>{i!==g.current&&(h(i),g.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:m,setSelectionBehavior:h,get isFocused(){return o.current},setFocused(e){o.current=e,s(e)},get focusedKey(){return c.current},get childFocusStrategy(){return l.current},setFocusedKey(e,t=`first`){c.current=e,l.current=t,u(e)},selectedKeys:d,setSelectedKeys(e){(r||!Gs(e,d))&&f(e)},disabledKeys:p,disabledBehavior:a}}function qs(e,t){return e?e===`all`?`all`:new Ws(e):t}var Js=class e{constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null,this.fullCollection=n?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&Is(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&Is(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new Ws([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new Ws(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?Is(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Ws(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Ws([t],t,t):new Ws;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new Ws;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=this.fullCollection??this.collection,t=[],n=r=>{for(;r!=null;){if(this.canSelectItemIn(r,e)){let i=e.getItem(r);i?.type===`item`&&t.push(r),i?.hasChildNodes&&(this.allowsCellSelection||i.type!==`item`)&&n(Ps(Ns(i,e))?.key??null)}r=e.getKeyAfter(r)}};return n(e.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Ws)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,t){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let n=t.getItem(e);return!(!n||n?.props?.isDisabled||n.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){let t=this.collection.getItem(e);return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!t?.props?.isDisabled)&&t?.props?.disabledBehavior!==`selection`}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}},Ys=class{build(e,t){return this.context=t,Xs(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:n}=e;if(v.isValidElement(t)&&t.type===v.Fragment)yield*this.iterateCollection({children:t.props.children,items:n});else if(typeof t==`function`){if(!n)throw Error(`props.children was a function but props.items is missing`);let e=0;for(let r of n)yield*this.getFullNode({value:r,index:e},{renderer:t}),e++}else{let e=[];v.Children.forEach(t,t=>{t&&e.push(t)});let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}getKey(e,t,n,r){if(e.key!=null)return e.key;if(t.type===`cell`&&t.key!=null)return`${r}${t.key}`;let i=t.value;if(i!=null){let e=i.key??i.id;if(e==null)throw Error(`No key found for item`);return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){if(v.isValidElement(e.element)&&e.element.type===v.Fragment){let i=[];v.Children.forEach(e.element.props.children,e=>{i.push(e)});let a=e.index??0;for(let e of i)yield*this.getFullNode({element:e,index:a++},t,n,r);return}let i=e.element;if(!i&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context))){n.index=e.index,n.parentKey=r?r.key:null,yield n;return}i=t.renderer(e.value)}if(v.isValidElement(i)){let a=i.type;if(typeof a!=`function`&&typeof a.getCollectionNode!=`function`){let e=i.type;throw Error(`Unknown element <${e}> in collection.`)}let o=a.getCollectionNode(i.props,this.context),s=e.index??0,c=o.next();for(;!c.done&&c.value;){let a=c.value;e.index=s;let l=a.key??null;l??=a.element?null:this.getKey(i,e,t,n);let u=[...this.getFullNode({...a,key:l,index:s,wrapper:Zs(e.wrapper,a.wrapper)},this.getChildState(t,a),n?`${n}${i.key}`:i.key,r)];for(let t of u){if(t.value=a.value??e.value??null,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw Error(`Unsupported type <${Qs(t.type)}> in <${Qs(r?.type??`unknown parent type`)}>. Only <${Qs(e.type)}> is supported.`);s++,yield t}c=o.next(u)}return}if(e.key==null||e.type==null)return;let a=this,o={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:(r?.level??0)+ +(r?.type===`item`),index:e.index,rendered:e.rendered,textValue:e.textValue??``,"aria-label":e[`aria-label`],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Xs(function*(){if(!e.hasChildNodes||!e.childNodes)return;let n=0;for(let r of e.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let e=a.getFullNode({...r,index:n},a.getChildState(t,r),o.key,o);for(let t of e)n++,yield t}})};yield o}constructor(){this.cache=new WeakMap}};function Xs(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||=e();for(let e of n)t.push(e),yield e}}}function Zs(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function Qs(e){return e[0].toUpperCase()+e.slice(1)}function $s(e,t,n){let r=(0,v.useMemo)(()=>new Ys,[]),{children:i,items:a,collection:o}=e;return(0,v.useMemo)(()=>o||t(r.build({children:i,items:a},n)),[r,i,a,o,n,t])}function ec(e){let{filter:t,layoutDelegate:n}=e,r=Ks(e),i=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=$s(e,(0,v.useCallback)(e=>t?new Us(t(e)):new Us(e),[t]),(0,v.useMemo)(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning])),o=(0,v.useMemo)(()=>new Js(a,r,{layoutDelegate:n}),[a,r,n]);return nc(a,o),{collection:a,disabledKeys:i,selectionManager:o}}function tc(e,t){let n=(0,v.useMemo)(()=>t?e.collection.filter(t):e.collection,[e.collection,t]),r=e.selectionManager.withCollection(n);return nc(n,r),{collection:n,selectionManager:r,disabledKeys:e.disabledKeys}}function nc(e,t){let n=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let r=n.current.getKeyAfter(t.focusedKey),i=null;for(;r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyAfter(r)}if(i==null)for(r=n.current.getKeyBefore(t.focusedKey);r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyBefore(r)}t.setFocusedKey(i)}n.current=e},[e,t])}function rc(e,t){let{collection:n,onLoadMore:r,scrollOffset:i=1,direction:a=`end`}=e,o=(0,v.useRef)(null),s=Zt(e=>{for(let t of e)t.isIntersecting&&r&&r()});y(()=>{if(t.current){let e=100*i,n=a===`start`?`${e}% 0px 0px 0px`:`0px ${e}% ${e}% ${e}%`;o.current=new IntersectionObserver(s,{root:qi(t?.current),rootMargin:n}),o.current.observe(t.current)}return()=>{o.current&&o.current.disconnect()}},[n,t,i,a])}var ic=(0,v.createContext)(null),ac=(0,v.createContext)(null),oc=(0,v.forwardRef)(function(e,t){[e,t]=he(e,t,ic);let n=(0,v.useContext)(ac);return n?v.createElement(cc,{state:n,props:e,listBoxRef:t}):v.createElement(Tr,{content:v.createElement(Lr,e)},n=>v.createElement(sc,{props:e,listBoxRef:t,collection:n}))});function sc({props:e,listBoxRef:t,collection:n}){e={...e,collection:n,children:null,items:null};let{layoutDelegate:r}=(0,v.useContext)(Ur),i=ec({...e,layoutDelegate:r});return v.createElement(cc,{state:i,props:e,listBoxRef:t})}function cc({state:e,props:t,listBoxRef:n}){[t,n]=he(t,n,On);let{dragAndDropHooks:r,layout:i=`stack`,orientation:a=`vertical`,filter:o}=t,s=tc(e,o),{collection:c,selectionManager:l}=s,u=!!r?.useDraggableCollectionState,d=!!r?.useDroppableCollectionState,{direction:f}=dn(),{disabledBehavior:p,disabledKeys:m}=l,h=Ts({usage:`search`,sensitivity:`base`}),{isVirtualized:g,layoutDelegate:_,dropTargetDelegate:y,CollectionRoot:b}=(0,v.useContext)(Ur),x=(0,v.useMemo)(()=>t.keyboardDelegate||new Cs({collection:c,collator:h,ref:n,disabledKeys:m,disabledBehavior:p,layout:i,orientation:a,direction:f,layoutDelegate:_}),[c,h,n,p,m,a,f,t.keyboardDelegate,i,_]),{listBoxProps:S}=Ds({...t,shouldSelectOnPressUp:u||t.shouldSelectOnPressUp,keyboardDelegate:x,isVirtualized:g},s,n);(0,v.useRef)(u),(0,v.useRef)(d),(0,v.useEffect)(()=>{},[u,d]);let C,w,T,E=!1,D=null,O=(0,v.useRef)(null);if(u&&r){C=r.useDraggableCollectionState({collection:c,selectionManager:l,preview:r.renderDragPreview?O:void 0}),r.useDraggableCollection({},C,n);let e=r.DragPreview;D=r.renderDragPreview?v.createElement(e,{ref:O},r.renderDragPreview):null}if(d&&r){w=r.useDroppableCollectionState({collection:c,selectionManager:l});let e=r.dropTargetDelegate||y||new r.ListDropTargetDelegate(c,n,{orientation:a,layout:i,direction:f});T=r.useDroppableCollection({keyboardDelegate:x,dropTargetDelegate:e},w,n),E=w.isDropTarget({type:`root`})}let{focusProps:k,isFocused:A,isFocusVisible:j}=Si(),ee=s.collection.size===0,te={isDropTarget:E,isEmpty:ee,isFocused:A,isFocusVisible:j,layout:t.layout||`stack`,orientation:a,state:s},ne=pe({...t,children:void 0,defaultClassName:`react-aria-ListBox`,values:te}),M=null;ee&&t.renderEmptyState&&(M=v.createElement(`div`,{role:`option`,style:{display:`contents`}},t.renderEmptyState(te)));let re=Zr(t,{global:!0});return v.createElement(Ho,null,v.createElement(ve.div,{...P(re,ne,S,k,T?.collectionProps),ref:n,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":E||void 0,"data-empty":ee||void 0,"data-focused":A||void 0,"data-focus-visible":j||void 0,"data-layout":t.layout||`stack`,"data-orientation":a},v.createElement(fe,{values:[[ic,t],[ac,s],[To,{dragAndDropHooks:r,dragState:C,dropState:w}],[Fo,{elementType:`div`}],[Eo,{render:dc}],[zr,{name:`ListBoxSection`,render:lc}]]},v.createElement(No,null,v.createElement(b,{collection:c,scrollRef:n,persistedKeys:ko(l,r,w),renderDropIndicator:Oo(r,w)}))),M,D))}function lc(e,t,n,r=`react-aria-ListBoxSection`){let i=(0,v.useContext)(ac),{dragAndDropHooks:a,dropState:o}=(0,v.useContext)(To),{CollectionBranch:s}=(0,v.useContext)(Ur),[c,l]=F(),{headingProps:u,groupProps:d}=Vs({heading:l,"aria-label":e[`aria-label`]??void 0}),f=pe({...e,id:void 0,children:void 0,defaultClassName:r,values:void 0}),p=Zr(e,{global:!0});return delete p.id,v.createElement(ve.section,{...P(p,f,d),ref:t},v.createElement(Ao.Provider,{value:{...u,ref:c}},v.createElement(s,{collection:i.collection,parent:n,renderDropIndicator:Oo(a,o)})))}var uc=Nr(Pn,function(e,t,n){let r=ue(t),i=(0,v.useContext)(ac),{dragAndDropHooks:a,dragState:o,dropState:s}=(0,v.useContext)(To),c=o&&!(o.isDisabled||o.selectionManager.isDisabled(n.key)),{optionProps:l,labelProps:u,descriptionProps:d,...f}=Bs({key:n.key,"aria-label":e?.[`aria-label`]},i,r),{hoverProps:p,isHovered:m}=Oi({isDisabled:!f.allowsSelection&&!f.hasAction&&!c,onHoverStart:n.props.onHoverStart,onHoverChange:n.props.onHoverChange,onHoverEnd:n.props.onHoverEnd}),{keyboardProps:h}=lr(e),{focusProps:g}=Yn(e),_=null;o&&a&&(_=a.useDraggableItem({key:n.key,hasAction:f.hasAction},o));let y=null;s&&a&&(y=a.useDroppableItem({target:{type:`item`,key:n.key,dropPosition:`on`}},s,r));let b=o&&o.isDragging(n.key),x=pe({...e,id:void 0,children:e.children,defaultClassName:`react-aria-ListBoxItem`,values:{...f,isHovered:m,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!o,isDragging:b,isDropTarget:y?.isDropTarget}});(0,v.useEffect)(()=>{n.textValue},[n.textValue]);let S=e.href?ve.a:ve.div,C=Zr(e,{global:!0});return delete C.id,delete C.onClick,e.href&&l.tabIndex==null&&(l.tabIndex=-1),v.createElement(S,{...P(C,x,l,p,h,g,_?.dragProps,y?.dropProps),ref:r,"data-allows-dragging":!!o||void 0,"data-selected":f.isSelected||void 0,"data-disabled":f.isDisabled||void 0,"data-hovered":m||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":f.isFocusVisible||void 0,"data-pressed":f.isPressed||void 0,"data-dragging":b||void 0,"data-drop-target":y?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},v.createElement(fe,{values:[[Wi,{slots:{[de]:u,label:u,description:d}}],[Po,{isSelected:f.isSelected}]]},x.children))});function dc(e,t){t=ue(t);let{dragAndDropHooks:n,dropState:r}=(0,v.useContext)(To),{dropIndicatorProps:i,isHidden:a,isDropTarget:o}=n.useDropIndicator(e,r,t);return a?null:v.createElement(pc,{...e,dropIndicatorProps:i,isDropTarget:o,ref:t})}function fc(e,t){let{dropIndicatorProps:n,isDropTarget:r,...i}=e,a=pe({...i,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:r}});return v.createElement(v.Fragment,null,v.createElement(ve.div,{...n,...a,role:`option`,ref:t,"data-drop-target":r||void 0}))}var pc=(0,v.forwardRef)(fc);Nr(Nn,function(e,t,n){let r=(0,v.useContext)(ac),{isLoading:i,onLoadMore:a,scrollOffset:o,...s}=e,c=(0,v.useRef)(null);rc((0,v.useMemo)(()=>({onLoadMore:a,collection:r?.collection,sentinelRef:c,scrollOffset:o}),[a,o,r?.collection]),c);let l=pe({...s,id:void 0,children:n.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return v.createElement(v.Fragment,null,v.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:Hs(!0)},v.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:c,style:{position:`absolute`,height:1,width:1}})),i&&l.children&&v.createElement(v.Fragment,null,v.createElement(ve.div,{...P(Zr(e,{global:!0}),{tabIndex:-1}),...l,role:`option`,ref:t},l.children)))});var mc=(0,v.createContext)({placement:`bottom`}),hc=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function gc(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}var _c=new WeakMap,vc=[];function yc(e,t){let n=xe(e?.[0]),r=t instanceof n.Element?{root:t}:t,i=r?.root??document.body,a=r?.shouldUseInert&&hc,o=new Set(e),s=new Set,c=e=>a&&e instanceof n.HTMLElement?e.inert:e.getAttribute(`aria-hidden`)===`true`,l=(e,t)=>{a&&e instanceof n.HTMLElement?e.inert=t:t?e.setAttribute(`aria-hidden`,`true`):(e.removeAttribute(`aria-hidden`),e instanceof n.HTMLElement&&(e.inert=!1))},u=new Set;if(ke()){let t=i.getRootNode();for(let n of e){let e=n.getRootNode();for(;Te(e)&&e!==t;)u.add(e),e=e.host.getRootNode()}}let d=e=>{for(let t of e.querySelectorAll(`[data-live-announcer], [data-react-aria-top-layer]`))o.add(t);let t=e=>{if(s.has(e)||o.has(e)||e.parentElement&&s.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of o)if(R(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=Bo(L(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&f(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;e!=null;)f(e),e=n.nextNode()}},f=e=>{let t=_c.get(e)??0;c(e)&&t===0||(t===0&&l(e,!0),s.add(e),_c.set(e,t+1))};vc.length&&vc[vc.length-1].disconnect(),d(i);let p=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>R(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&gc(e)?o.add(e):e instanceof Element&&d(e);if(ke()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});p.observe(i,{childList:!0,subtree:!0});let m=new Set;if(ke())for(let e of u){let t=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>R(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&gc(e)?o.add(e):e instanceof Element&&d(e);if(ke()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});t.observe(e,{childList:!0,subtree:!0}),m.add(t)}let h={visibleNodes:o,hiddenNodes:s,observe(){p.observe(i,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return vc.push(h),()=>{if(p.disconnect(),ke())for(let e of m)e.disconnect();for(let e of s){let t=_c.get(e);t!=null&&(t===1?(l(e,!1),_c.delete(e)):_c.set(e,t-1))}h===vc[vc.length-1]?(vc.pop(),vc.length&&vc[vc.length-1].observe()):vc.splice(vc.indexOf(h),1)}}function bc(e){let t=vc[vc.length-1];if(t&&!t.visibleNodes.has(e))return t.visibleNodes.add(e),()=>{t.visibleNodes.delete(e)}}var xc={top:`top`,bottom:`top`,left:`left`,right:`left`},Sc={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Cc={top:`left`,left:`top`},wc={top:`height`,left:`width`},Tc={width:`totalWidth`,height:`totalHeight`},Ec={},Dc=()=>typeof document<`u`?window.visualViewport:null;function Oc(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c={},l=(t?.scale??1)>1;if(e.tagName===`BODY`||e.tagName===`HTML`){let l=document.documentElement;i=l.clientWidth,a=l.clientHeight,n=t?.width??i,r=t?.height??a,c.top=l.scrollTop||e.scrollTop,c.left=l.scrollLeft||e.scrollLeft,t&&(o=Math.max(0,t.pageTop-(c.top??0)),s=Math.max(0,t.pageLeft-(c.left??0)))}else({width:n,height:r,top:o,left:s}=zc(e,!1)),c.top=e.scrollTop,c.left=e.scrollLeft,i=n,a=r;return dt()&&(e.tagName===`BODY`||e.tagName===`HTML`)&&l&&(c.top=0,c.left=0,o=t?.pageTop??0,s=t?.pageLeft??0),{width:n,height:r,totalWidth:i,totalHeight:a,scroll:c,top:o,left:s}}function kc(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function Ac(e,t,n,r,i,a,o){let s=i.scroll[e]??0,c=r[wc[e]],l=o[e]+r.scroll[xc[e]]+a,u=o[e]+r.scroll[xc[e]]+c-a,d=t-s+r.scroll[xc[e]]+o[e]-r[xc[e]],f=t-s+n+r.scroll[xc[e]]+o[e]-r[xc[e]];return d<l?l-d:f>u?Math.max(u-f,l-d):0}function jc(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function Mc(e){if(Ec[e])return Ec[e];let[t,n]=e.split(` `),r=xc[t]||`right`,i=Cc[r];xc[n]||(n=`center`);let a=wc[r],o=wc[i];return Ec[e]={placement:t,crossPlacement:n,axis:r,crossAxis:i,size:a,crossSize:o},Ec[e]}function Nc(e,t,n,r,i,a,o,s,c,l,u){let{placement:d,crossPlacement:f,axis:p,crossAxis:m,size:h,crossSize:g}=r,_={};_[m]=e[m]??0,f===`center`?_[m]+=((e[g]??0)-(n[g]??0))/2:f!==m&&(_[m]+=(e[g]??0)-(n[g]??0)),_[m]+=a;let v=e[m]-n[g]+c+l,y=e[m]+e[g]-c-l;if(_[m]=Mi(_[m],v,y),d===p){let t=s?u[h]:u[Tc[h]];_[Sc[p]]=Math.floor(t-e[p]+i)}else _[p]=Math.floor(e[p]+e[h]+i);return _}function Pc(e,t,n,r,i,a,o,s,c,l,u){let d=(e.top==null?c[Tc.height]-(e.bottom??0)-o:e.top)-(c.scroll.top??0),f=l?n.top:0,p={top:Math.max(t.top+f,(u?.offsetTop??t.top)+f),bottom:Math.min(t.top+t.height+f,(u?.offsetTop??0)+(u?.height??0))};return s===`top`?Math.max(0,d+o-p.top-((i.top??0)+(i.bottom??0)+a)):Math.max(0,p.bottom-d-((i.top??0)+(i.bottom??0)+a))}function Fc(e,t,n,r,i,a,o,s){let{placement:c,axis:l,size:u}=a;return c===l?Math.max(0,n[l]-(o.scroll[l]??0)-(e[l]+(s?t[l]:0))-(r[l]??0)-r[Sc[l]]-i):Math.max(0,e[u]+e[l]+(s?t[l]:0)-n[l]-n[u]+(o.scroll[l]??0)-(r[l]??0)-r[Sc[l]]-i)}function Ic(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=Mc(e),{size:y,crossAxis:b,crossSize:x,placement:S,crossPlacement:C}=v,w=Nc(t,s,n,v,u,d,l,f,m,h,c),T=u,E=Fc(s,l,t,i,a+u,v,c,g);if(o&&n[y]>E){let e=Mc(`${Sc[S]} ${C}`),r=Nc(t,s,n,e,u,d,l,f,m,h,c);Fc(s,l,t,i,a+u,e,c,g)>E&&(v=e,w=r,T=u)}let D=`bottom`;v.axis===`top`?v.placement===`top`?D=`top`:v.placement===`bottom`&&(D=`bottom`):v.crossAxis===`top`&&(v.crossPlacement===`top`?D=`bottom`:v.crossPlacement===`bottom`&&(D=`top`));let O=Ac(b,w[b],n[x],s,c,a,l);w[b]+=O;let k=Pc(w,s,l,f,i,a,n.height,D,c,g,_);p&&p<k&&(k=p),n.height=Math.min(n.height,k),w=Nc(t,s,n,v,T,d,l,f,m,h,c),O=Ac(b,w[b],n[x],s,c,a,l),w[b]+=O;let A={},j=t[b]-w[b]-i[xc[b]],ee=j+.5*t[x],te=m/2+h,ne=xc[b]===`left`?(i.left??0)+(i.right??0):(i.top??0)+(i.bottom??0),M=n[x]-ne-m/2-h;A[b]=Mi(Mi(ee,t[b]+m/2-(w[b]+i[xc[b]]),t[b]+t[x]-m/2-(w[b]+i[xc[b]])),te,M),{placement:S,crossPlacement:C}=v,m?j=A[b]:C===`right`?j+=t[x]:C===`center`&&(j+=t[x]/2);let re=S===`left`||S===`top`?n[y]:0,N={x:S===`top`||S===`bottom`?j:re,y:S===`left`||S===`right`?j:re};return{position:w,maxHeight:k,arrowOffsetLeft:A.left,arrowOffsetTop:A.top,placement:S,triggerAnchorPoint:N}}function Lc(e){let{placement:t,targetNode:n,overlayNode:r,scrollNode:i,padding:a,shouldFlip:o,boundaryElement:s,offset:c,crossOffset:l,maxHeight:u,arrowSize:d=0,arrowBoundaryOffset:f=0,targetRect:p}=e,m=Dc(),h=r instanceof HTMLElement?Vc(r):document.documentElement,g=h===document.documentElement,_=window.getComputedStyle(h).position,v=!!_&&_!==`static`,y=g?zc(n,!1,p):Bc(n,h,!1,p);if(!g){let{marginTop:e,marginLeft:t}=window.getComputedStyle(n);y.top+=parseInt(e,10)||0,y.left+=parseInt(t,10)||0}let b=zc(r,!0),x=jc(r);b.width+=(x.left??0)+(x.right??0),b.height+=(x.top??0)+(x.bottom??0);let S=kc(i),C=Oc(s,m),w=Oc(h,m),T;if((s.tagName===`BODY`||s.tagName===`HTML`)&&!g){let e=Rc(h,!1);T={top:-(e.top-C.top),left:-(e.left-C.left),width:0,height:0}}else T=(s.tagName===`BODY`||s.tagName===`HTML`)&&g?{top:0,left:0,width:0,height:0}:Bc(s,h,!1);let E=R(s,h);return Ic(t,y,b,S,x,a,o,C,w,T,c,l,v,u,d,f,E,m)}function Rc(e,t){let{top:n,left:r,width:i,height:a}=e.getBoundingClientRect();return t&&e instanceof e.ownerDocument.defaultView.HTMLElement&&(i=e.offsetWidth,a=e.offsetHeight),{top:n,left:r,width:i,height:a}}function zc(e,t,n){let{top:r,left:i,width:a,height:o}=n||Rc(e,t),{scrollTop:s,scrollLeft:c,clientTop:l,clientLeft:u}=document.documentElement;return{top:r+s-l,left:i+c-u,width:a,height:o}}function Bc(e,t,n,r){let i=window.getComputedStyle(e),a;if(i.position===`fixed`)a=r||Rc(e,n);else{a=zc(e,n,r);let i=zc(t,n),o=window.getComputedStyle(t);i.top+=(parseInt(o.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(o.borderLeftWidth,10)||0)-t.scrollLeft,a.top-=i.top,a.left-=i.left}return a.top-=parseInt(i.marginTop,10)||0,a.left-=parseInt(i.marginLeft,10)||0,a}function Vc(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position===`static`&&!Hc(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!Hc(t);)t=t.parentElement;return t||document.documentElement}function Hc(e){let t=window.getComputedStyle(e);return t.transform!==`none`||/transform|perspective/.test(t.willChange)||t.filter!==`none`||t.contain===`paint`||`backdropFilter`in t&&t.backdropFilter!==`none`||`WebkitBackdropFilter`in t&&t.WebkitBackdropFilter!==`none`}var Uc=new WeakMap;function Wc(e){let{triggerRef:t,isOpen:n,onClose:r}=e;(0,v.useEffect)(()=>!n||r===null?void 0:Ee(je(t.current),`scroll`,e=>{let n=z(e);if(!t.current||n instanceof Node&&!R(n,t.current)||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)return;let i=r||Uc.get(t.current);i&&i()},!0),[n,r,t])}function Gc(){return window.ResizeObserver!==void 0}function Kc(e){let{ref:t,box:n,onResize:r}=e,i=Zt(r);(0,v.useEffect)(()=>{let e=t?.current;if(e){if(Gc()){let t=new window.ResizeObserver(e=>{e.length&&i()});return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}return window.addEventListener(`resize`,i,!1),()=>{window.removeEventListener(`resize`,i,!1)}}},[t,n])}var qc=typeof document<`u`?window.visualViewport:null;function Jc(e){let{direction:t}=dn(),{arrowSize:n,targetRef:r,overlayRef:i,arrowRef:a,scrollRef:o=i,placement:s=`bottom`,containerPadding:c=12,shouldFlip:l=!0,boundaryElement:u=typeof document<`u`?document.body:null,offset:d=0,crossOffset:f=0,shouldUpdatePosition:p=!0,isOpen:m=!0,onClose:h,maxHeight:g,arrowBoundaryOffset:_=0,getTargetRect:b}=e,[x,S]=(0,v.useState)(null),C=[p,s,i.current,r.current,a?.current,o.current,c,l,u,d,f,m,t,g,_,n],w=(0,v.useRef)(qc?.scale);(0,v.useEffect)(()=>{m&&(w.current=qc?.scale)},[m]);let T=(0,v.useCallback)(()=>{if(p===!1||!m||!i.current||!r.current||!u||qc?.scale!==w.current)return;let e=null;if(o.current&&Me(o.current)){let t=Ae()?.getBoundingClientRect(),n=o.current.getBoundingClientRect();e={type:`top`,offset:(t?.top??0)-n.top},e.offset>n.height/2&&(e.type=`bottom`,e.offset=(t?.bottom??0)-n.bottom)}let h=i.current;!g&&i.current&&(h.style.top=`0px`,h.style.bottom=``,h.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+`px`);let v=Lc({placement:Xc(s,t),overlayNode:i.current,targetNode:r.current,scrollNode:o.current||i.current,padding:c,shouldFlip:l,boundaryElement:u,offset:d,crossOffset:f,maxHeight:g,arrowSize:n??(a?.current?Rc(a.current,!0).width:0),arrowBoundaryOffset:_,targetRect:b?.(r.current)});if(!v.position)return;h.style.top=``,h.style.bottom=``,h.style.left=``,h.style.right=``,Object.keys(v.position).forEach(e=>h.style[e]=v.position[e]+`px`),h.style.maxHeight=v.maxHeight==null?``:v.maxHeight+`px`;let y=Ae();if(e&&y&&o.current){let t=y.getBoundingClientRect(),n=o.current.getBoundingClientRect(),r=t[e.type]-n[e.type];o.current.scrollTop+=r-e.offset}S(v)},C);y(T,C),Yc(T),Kc({ref:i,onResize:T}),Kc({ref:r,onResize:T});let E=(0,v.useRef)(!1);y(()=>{let e,t=()=>{E.current=!0,clearTimeout(e),e=setTimeout(()=>{E.current=!1},500),T()},n=()=>{E.current&&t()};qc?.addEventListener(`resize`,t),qc?.addEventListener(`scroll`,n);let r=Ee(je(window),`scroll`,n);return()=>{qc?.removeEventListener(`resize`,t),qc?.removeEventListener(`scroll`,n),r()}},[T]);let D=(0,v.useCallback)(()=>{E.current||h?.()},[h,E]);return Wc({triggerRef:r,isOpen:m,onClose:h&&D}),{overlayProps:{style:{position:x?`absolute`:`fixed`,top:x?void 0:0,left:x?void 0:0,zIndex:1e5,...x?.position,maxHeight:x?.maxHeight??`100vh`}},placement:x?.placement??null,triggerAnchorPoint:x?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":`true`,role:`presentation`,style:{left:x?.arrowOffsetLeft,top:x?.arrowOffsetTop}},updatePosition:T}}function Yc(e){y(()=>(window.addEventListener(`resize`,e,!1),()=>{window.removeEventListener(`resize`,e,!1)}),[e])}function Xc(e,t){return t===`rtl`?e.replace(`start`,`right`).replace(`end`,`left`):e.replace(`start`,`left`).replace(`end`,`right`)}function Zc(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=(0,v.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=Zt(e=>{n&&Qc(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),s=Zt(e=>{n&&n(e)});(0,v.useEffect)(()=>{let e=a.current;if(r)return;let n=t.current,i=L(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&Qc(n,t)&&s(n),e.isPointerDown=!1};return i.addEventListener(`pointerdown`,o,!0),i.addEventListener(`click`,n,!0),()=>{i.removeEventListener(`pointerdown`,o,!0),i.removeEventListener(`click`,n,!0)}}},[t,r])}function Qc(e,t){if(e.button>0)return!1;let n=z(e);if(n){let e=n.ownerDocument;if(!e||!R(e.documentElement,n)||n.closest(`[data-react-aria-top-layer]`))return!1}return t.current?!e.composedPath().includes(t.current):!1}var $c=[];function el(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e,c=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{if(i&&!$c.includes(t))return $c.push(t),()=>{let e=$c.indexOf(t);e>=0&&$c.splice(e,1)}},[i,t]);let l=()=>{$c[$c.length-1]===t&&n&&n()},u=e=>{let n=$c[$c.length-1];c.current=n,(!s||s(z(e)))&&n===t&&e.stopPropagation()},d=e=>{(!s||s(z(e)))&&($c[$c.length-1]===t&&e.stopPropagation(),c.current===t&&l()),c.current=void 0},{keyboardProps:f}=lr({shortcuts:{Escape:()=>{if(!o)l();else return!1}}});Zc({ref:t,onInteractOutside:a&&i?d:void 0,onInteractOutsideStart:u});let{focusWithinProps:p}=xi({isDisabled:!r,onBlurWithin:e=>{e.relatedTarget&&!Qo(e.relatedTarget)&&(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{...f,...p},underlayProps:{}}}var tl=typeof document<`u`&&window.visualViewport,nl=0,rl;function il(e={}){let{isDisabled:t}=e;y(()=>{if(!t)return nl++,nl===1&&(rl=lt()&&dt()?ol():al()),()=>{nl--,nl===0&&rl()}},[t])}function al(){let e=window.innerWidth-document.documentElement.clientWidth;return _(e>0&&(`scrollbarGutter`in document.documentElement.style?De(document.documentElement,`scrollbar-gutter`,`stable`):De(document.documentElement,`padding-right`,`${e}px`)),De(document.documentElement,`overflow`,`hidden`))}function ol(){let e=De(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=z(e);t=Ki(r)?r:qi(r,!0),n=!1;let i=r.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(r,!0)&&(n=!0),e.composedPath().some(e=>e instanceof HTMLInputElement&&e.type===`range`)&&(n=!0),`selectionStart`in r&&`selectionEnd`in r&&r.selectionStart<r.selectionEnd&&r.ownerDocument.activeElement===r&&(n=!0)},i=document.createElement(`style`),a=ai();a&&(i.nonce=a),i.textContent=`@layer {
17
- * {
18
- overscroll-behavior: contain;
19
- }
20
- }`,document.head.prepend(i);let o=e=>{e.touches.length===2||n||(!t||t===document.documentElement||t===document.body||t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth)&&e.preventDefault()},s=e=>{let t=z(e),n=e.relatedTarget;n&&Yt(n)?(n.focus({preventScroll:!0}),sl(n,Yt(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;Reflect.defineProperty(HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(e){let t=Ae(),n=t!=null&&Yt(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&sl(this,n)}});let l=_(Ee(document,`touchstart`,r,{passive:!1,capture:!0}),Ee(document,`touchmove`,o,{passive:!1,capture:!0}),Ee(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),Reflect.defineProperty(HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:c})}}function sl(e,t){t||!tl?cl(e):tl.addEventListener(`resize`,()=>cl(e),{once:!0})}function cl(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=qi(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.top<t.top||r.bottom>t.top+n.clientHeight){let n=t.bottom;tl&&(n=Math.min(n,tl.offsetTop+tl.height));let i=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:`smooth`})}}n=e.parentElement}}function ll(e,t){let{triggerRef:n,popoverRef:r,groupRef:i,isNonModal:a,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:s,...c}=e,l=c.trigger===`SubmenuTrigger`,{overlayProps:u,underlayProps:d}=el({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!a||l,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:s},i??r),{overlayProps:f,arrowProps:p,placement:m,triggerAnchorPoint:h}=Jc({...c,targetRef:n,overlayRef:r,isOpen:t.isOpen,onClose:a&&!l?t.close:null,getTargetRect:c.getTargetRect??(t.point?()=>new DOMRect(t.point.x,t.point.y,0,0):void 0)});il({isDisabled:a||!t.isOpen}),(0,v.useEffect)(()=>{if(t.isOpen&&r.current)return a?bc(i?.current??r.current):yc([i?.current??r.current],{shouldUseInert:!0})},[a,t.isOpen,r,i]);let{focusWithinProps:g}=xi(e);return{popoverProps:P(u,f,g),arrowProps:p,underlayProps:d,placement:m,triggerAnchorPoint:h}}var ul={};ul={dismiss:`تجاهل`};var dl={};dl={dismiss:`Отхвърляне`};var fl={};fl={dismiss:`Odstranit`};var pl={};pl={dismiss:`Luk`};var ml={};ml={dismiss:`Schließen`};var hl={};hl={dismiss:`Απόρριψη`};var gl={};gl={dismiss:`Dismiss`};var _l={};_l={dismiss:`Descartar`};var vl={};vl={dismiss:`Lõpeta`};var yl={};yl={dismiss:`Hylkää`};var bl={};bl={dismiss:`Rejeter`};var xl={};xl={dismiss:`התעלם`};var Sl={};Sl={dismiss:`Odbaci`};var Cl={};Cl={dismiss:`Elutasítás`};var wl={};wl={dismiss:`Ignora`};var Tl={};Tl={dismiss:`閉じる`};var El={};El={dismiss:`무시`};var Dl={};Dl={dismiss:`Atmesti`};var Ol={};Ol={dismiss:`Nerādīt`};var kl={};kl={dismiss:`Lukk`};var Al={};Al={dismiss:`Negeren`};var jl={};jl={dismiss:`Zignoruj`};var Ml={};Ml={dismiss:`Descartar`};var Nl={};Nl={dismiss:`Dispensar`};var Pl={};Pl={dismiss:`Revocare`};var Fl={};Fl={dismiss:`Пропустить`};var Il={};Il={dismiss:`Zrušiť`};var Ll={};Ll={dismiss:`Opusti`};var Rl={};Rl={dismiss:`Odbaci`};var zl={};zl={dismiss:`Avvisa`};var Bl={};Bl={dismiss:`Kapat`};var Vl={};Vl={dismiss:`Скасувати`};var Hl={};Hl={dismiss:`取消`};var Ul={};Ul={dismiss:`關閉`};var Wl={};Wl={"ar-AE":ul,"bg-BG":dl,"cs-CZ":fl,"da-DK":pl,"de-DE":ml,"el-GR":hl,"en-US":gl,"es-ES":_l,"et-EE":vl,"fi-FI":yl,"fr-FR":bl,"he-IL":xl,"hr-HR":Sl,"hu-HU":Cl,"it-IT":wl,"ja-JP":Tl,"ko-KR":El,"lt-LT":Dl,"lv-LV":Ol,"nb-NO":kl,"nl-NL":Al,"pl-PL":jl,"pt-BR":Ml,"pt-PT":Nl,"ro-RO":Pl,"ru-RU":Fl,"sk-SK":Il,"sl-SI":Ll,"sr-SP":Rl,"sv-SE":zl,"tr-TR":Bl,"uk-UA":Vl,"zh-CN":Hl,"zh-TW":Ul};function Gl(e){return e&&e.__esModule?e.default:e}function Kl(e){let{onDismiss:t,...n}=e,r=$t(n,Tn(Gl(Wl),`@react-aria/overlays`).format(`dismiss`)),i=()=>{t&&t()};return v.createElement(ra,null,v.createElement(`button`,{...r,tabIndex:-1,onClick:i,style:{width:1,height:1}}))}var ql=v.forwardRef(({children:e,...t},n)=>{let r=(0,v.useRef)(!1),i=(0,v.useContext)(oi),a=P(i||{},{...t,register(){r.current=!0,i&&i.register()}});return a.ref=ue(n||i?.ref),ur(i,a.ref),(0,v.useEffect)(()=>{r.current||=!0},[]),v.createElement(oi.Provider,{value:a},e)});function Jl({children:e}){let t=(0,v.useMemo)(()=>({register:()=>{}}),[]);return v.createElement(oi.Provider,{value:t},e)}var Yl=(0,v.createContext)({});function Xl(){return(0,v.useContext)(Yl)??{}}var Zl=v.createContext(null);function Ql(e){let t=j(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,a]=(0,v.useState)(!1),o=(0,v.useMemo)(()=>({contain:i,setContain:a}),[i,a]),{getContainer:s}=Xl();if(!e.portalContainer&&s&&(n=s()),!n)return null;let c=e.children;return e.disableFocusManagement||(c=v.createElement(Ho,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},c)),c=v.createElement(Zl.Provider,{value:o},v.createElement(Jl,null,v.createElement(dr.Provider,{value:null},c))),xr.createPortal(c,n)}function $l(){let e=(0,v.useContext)(Zl)?.setContain;y(()=>{e?.(!0)},[e])}function eu(e){let[t,n]=Dn(e.isOpen,e.defaultOpen||!1,e.onOpenChange),[r,i]=(0,v.useState)(null);return{isOpen:t,setOpen:n,open:(0,v.useCallback)(()=>{n(!0)},[n]),close:(0,v.useCallback)(()=>{n(!1)},[n]),toggle:(0,v.useCallback)(()=>{n(!t)},[n,t]),point:r,setPoint:i}}function tu(e,t=!0){let[n,r]=(0,v.useState)(!0),i=n&&t;return y(()=>{if(i&&e.current&&`getAnimations`in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),ru(e,i,(0,v.useCallback)(()=>r(!1),[])),i}function nu(e,t){let[n,r]=(0,v.useState)(t?`open`:`closed`);switch(n){case`open`:t||r(`exiting`);break;case`closed`:case`exiting`:t&&r(`open`)}let i=n===`exiting`;return ru(e,i,(0,v.useCallback)(()=>{r(e=>e===`exiting`?`closed`:e)},[])),i}function ru(e,t,n){y(()=>{if(t&&e.current){if(!(`getAnimations`in e.current)){n();return}let t=e.current.getAnimations();if(t.length===0){n();return}let r=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{r||(0,xr.flushSync)(()=>{n()})}),()=>{r=!0}}},[e,t,n])}var iu=(0,v.createContext)(null),au=(0,v.createContext)(null),ou=(0,v.forwardRef)(function(e,t){[e,t]=he(e,t,iu);let n=(0,v.useContext)(hd),r=eu(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=nu(t,i.isOpen),o=e.isExiting||!e.shouldSkipAnimation&&a||!1,s=vr(),{direction:c}=dn();if(s){let t=e.children;return typeof t==`function`&&(t=t({trigger:e.trigger||null,placement:`bottom`,isEntering:!1,isExiting:!1,defaultChildren:null})),v.createElement(v.Fragment,null,t)}return i&&!i.isOpen&&!o?null:v.createElement(su,{...e,triggerRef:e.triggerRef,state:i,popoverRef:t,isExiting:o,dir:c})});function su({state:e,isExiting:t,UNSTABLE_portalContainer:n,clearContexts:r,...i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useContext)(au),c=s&&i.trigger===`SubmenuTrigger`,{popoverProps:l,underlayProps:u,arrowProps:d,placement:f,triggerAnchorPoint:p}=ll({...i,offset:i.offset??8,arrowRef:a,groupRef:c?s:o},e),m=i.popoverRef,h=tu(m,!!f),g=i.isEntering||!i.shouldSkipAnimation&&h||!1,_=pe({...i,defaultClassName:`react-aria-Popover`,values:{trigger:i.trigger||null,placement:f,isEntering:g,isExiting:t}}),b=!i.isNonModal||i.trigger===`SubmenuTrigger`||i.trigger===`PreviewTrigger`,[x,S]=(0,v.useState)(i.trigger===`PreviewTrigger`);y(()=>{m.current&&S(b&&!m.current.querySelector(`[role=dialog]`))},[m,b]),(0,v.useEffect)(()=>{x&&i.trigger!==`PreviewTrigger`&&(i.trigger!==`SubmenuTrigger`||Ht()!==`pointer`)&&m.current&&!Me(m.current)&&Jn(m.current)},[x,m,i.trigger]);let C=(0,v.useMemo)(()=>{let e=_.children;if(r)for(let t of r)e=v.createElement(t.Provider,{value:null},e);return e},[_.children,r]),[w,T]=(0,v.useState)(null),E=(0,v.useCallback)(()=>{i.triggerRef.current&&T(i.triggerRef.current.getBoundingClientRect().width+`px`)},[i.triggerRef]);y(E,[E]),Kc({ref:_.style?.[`--trigger-width`]?void 0:i.triggerRef,onResize:E});let D={...l.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,..._.style,"--trigger-width":_.style?.[`--trigger-width`]||w},O=v.createElement(ve.div,{...P(Zr(i,{global:!0}),l),..._,id:x?i.id:void 0,role:x?`dialog`:void 0,tabIndex:x?-1:void 0,"aria-label":i[`aria-label`],"aria-labelledby":i[`aria-labelledby`],ref:m,slot:i.slot||void 0,style:D,dir:i.dir,"data-trigger":i.trigger,"data-placement":f,"data-entering":g||void 0,"data-exiting":t||void 0},!i.isNonModal&&v.createElement(Kl,{onDismiss:e.close}),v.createElement(mc.Provider,{value:{...d,placement:f,ref:a}},C),v.createElement(Kl,{onDismiss:e.close}));return c?v.createElement(Ql,{...i,shouldContainFocus:x&&i.trigger!==`PreviewTrigger`,isExiting:t,portalContainer:n??s?.current??void 0},O):v.createElement(Ql,{...i,shouldContainFocus:x&&i.trigger!==`PreviewTrigger`,isExiting:t,portalContainer:n},!i.isNonModal&&e.isOpen&&v.createElement(`div`,{"data-testid":`underlay`,...u,style:{position:`fixed`,inset:0}}),v.createElement(`div`,{ref:o,style:{display:`contents`}},v.createElement(au.Provider,{value:o},O)))}var cu=(0,v.createContext)({}),lu={};lu={longPressMessage:`اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`};var uu={};uu={longPressMessage:`Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто`};var du={};du={longPressMessage:`Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku`};var fu={};fu={longPressMessage:`Langt tryk eller tryk på Alt + pil ned for at åbne menuen`};var pu={};pu={longPressMessage:`Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen`};var mu={};mu={longPressMessage:`Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού`};var hu={};hu={longPressMessage:`Long press or press Alt + ArrowDown to open menu`};var gu={};gu={longPressMessage:`Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú`};var _u={};_u={longPressMessage:`Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool`};var vu={};vu={longPressMessage:`Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli`};var yu={};yu={longPressMessage:`Appuyez de manière prolongée ou appuyez sur Alt\xA0+\xA0Flèche vers le bas pour ouvrir le menu.`};var bu={};bu={longPressMessage:`לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט`};var xu={};xu={longPressMessage:`Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika`};var Su={};Su={longPressMessage:`Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához`};var Cu={};Cu={longPressMessage:`Premi a lungo o premi Alt + Freccia giù per aprire il menu`};var wu={};wu={longPressMessage:`長押しまたは Alt+下矢印キーでメニューを開く`};var Tu={};Tu={longPressMessage:`길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기`};var Eu={};Eu={longPressMessage:`Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.`};var Du={};Du={longPressMessage:`Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa`};var Ou={};Ou={longPressMessage:`Langt trykk eller trykk Alt + PilNed for å åpne menyen`};var ku={};ku={longPressMessage:`Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`};var Au={};Au={longPressMessage:`Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu`};var ju={};ju={longPressMessage:`Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu`};var Mu={};Mu={longPressMessage:`Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu`};var Nu={};Nu={longPressMessage:`Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul`};var Pu={};Pu={longPressMessage:`Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню`};var Fu={};Fu={longPressMessage:`Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol`};var Iu={};Iu={longPressMessage:`Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol`};var Lu={};Lu={longPressMessage:`Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni`};var Ru={};Ru={longPressMessage:`Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn`};var zu={};zu={longPressMessage:`Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın`};var Bu={};Bu={longPressMessage:`Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню`};var Vu={};Vu={longPressMessage:`长按或按 Alt + 向下方向键以打开菜单`};var Hu={};Hu={longPressMessage:`長按或按 Alt+向下鍵以開啟功能表`};var Uu={};Uu={"ar-AE":lu,"bg-BG":uu,"cs-CZ":du,"da-DK":fu,"de-DE":pu,"el-GR":mu,"en-US":hu,"es-ES":gu,"et-EE":_u,"fi-FI":vu,"fr-FR":yu,"he-IL":bu,"hr-HR":xu,"hu-HU":Su,"it-IT":Cu,"ja-JP":wu,"ko-KR":Tu,"lt-LT":Eu,"lv-LV":Du,"nb-NO":Ou,"nl-NL":ku,"pl-PL":Au,"pt-BR":ju,"pt-PT":Mu,"ro-RO":Nu,"ru-RU":Pu,"sk-SK":Fu,"sl-SI":Iu,"sr-SP":Lu,"sv-SE":Ru,"tr-TR":zu,"uk-UA":Bu,"zh-CN":Vu,"zh-TW":Hu};function Wu(e){let{onContextMenu:t}=e,n=(0,v.useRef)(!1),{longPressProps:r}=ks({onLongPressStart(){n.current=!1},onLongPress(e){n.current?n.current=!1:t?.({target:e.target,x:e.x,y:e.y})}});return t?{contextMenuProps:P(lt()?r:{},{onContextMenu(e){e.stopPropagation(),e.preventDefault(),n.current=!0;let r=e.currentTarget.getBoundingClientRect();t({target:e.currentTarget,x:e.clientX-r.x,y:e.clientY-r.y})},onKeyDown(e){if(ot()&&e.ctrlKey&&e.key===`Enter`){n.current=!1;let r=e.currentTarget;e.stopPropagation(),setTimeout(()=>{if(n.current)n.current=!1;else{let e=r.getBoundingClientRect();t({target:r,x:e.width/2,y:e.height/2})}},10)}}})}:{contextMenuProps:{}}}function Gu(e,t,n){let{type:r}=e,{isOpen:i}=t;(0,v.useEffect)(()=>{n&&n.current&&Uc.set(n.current,t.close)});let a;r===`menu`?a=!0:r===`listbox`&&(a=`listbox`);let o=N();return{triggerProps:{"aria-haspopup":a,"aria-expanded":i,"aria-controls":i?o:void 0,onPress:t.toggle},overlayProps:{id:o}}}function Ku(e){return e&&e.__esModule?e.default:e}function qu(e,t,n){let{type:r=`menu`,isDisabled:i,trigger:a=`press`}=e,o=N(),{triggerProps:s,overlayProps:c}=Gu({type:r},t,n),l=(e,n,r=`first`)=>{if(!e||n.isDefaultPrevented())return!1;t.toggle(r)},{keyboardProps:u}=lr({isDisabled:i,shortcuts:{Enter:e=>l(a!==`longPress`,e,`first`)," ":e=>l(a!==`longPress`,e,`first`),ArrowDown:e=>l(a!==`longPress`,e,`first`),ArrowUp:e=>l(a!==`longPress`,e,`last`),"Alt+Enter":e=>l(a===`longPress`,e,`first`),"Alt+ ":e=>l(a===`longPress`,e,`first`),"Alt+ArrowDown":e=>l(!0,e,`first`),"Alt+ArrowUp":e=>l(!0,e,`last`)}}),d=Tn(Ku(Uu),`@react-aria/menu`),{longPressProps:f}=ks({isDisabled:i||a!==`longPress`,accessibilityDescription:d.format(`longPressMessage`),onLongPressStart(){t.close()},onLongPress(){t.open(`first`)}}),p={preventFocusOnPress:!0,onPressStart(e){e.pointerType!==`touch`&&e.pointerType!==`keyboard`&&!i&&(Le(e.target),t.open(e.pointerType===`virtual`?`first`:null))},onPress(e){e.pointerType===`touch`&&!i&&(Le(e.target),t.toggle())}};delete s.onPress;let{contextMenuProps:m}=Wu({onContextMenu(e){let n=e.target.getBoundingClientRect();t.setPoint({x:n.x+e.x,y:n.y+e.y}),t.open()}});(0,v.useEffect)(()=>{if(t.isOpen&&a===`contextMenu`){let e=e=>{(e.button===2||e.button===0&&e.ctrlKey===!0)&&z(e)===document.body&&t.close()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)}},[t,a]);let h;if(a===`press`)h={...p,...u};else if(a===`longPress`)h={...f,...u};else if(a===`contextMenu`){h=m;let{"aria-haspopup":e,"aria-expanded":t,"aria-controls":n,...r}=s;s=r}return{menuTriggerProps:{...s,...h,id:o},menuProps:{...c,"aria-labelledby":o,autoFocus:t.focusStrategy||!0,onClose:t.close}}}var Ju=new WeakMap;function Yu(e,t,n){let{shouldFocusWrap:r=!0,onKeyDown:i,onKeyUp:a,...o}=e;!e[`aria-label`]&&e[`aria-labelledby`];let s=Zr(e,{labelable:!0}),{listProps:c}=Es({...o,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,shouldFocusWrap:r,linkBehavior:`override`});return Ju.set(t,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:P(s,{onKeyDown:i,onKeyUp:a},{role:`menu`,...c,onKeyDown:t=>{(t.key!==`Escape`||e.shouldUseVirtualFocus)&&c.onKeyDown?.(t)}})}}function Xu(e,t,n){let{id:r,key:i,closeOnSelect:a,shouldCloseOnSelect:o,isVirtualized:s,"aria-haspopup":c,onPressStart:l,onPressUp:u,onPress:d,onPressChange:f,onPressEnd:p,onClick:m,onHoverStart:h,onHoverChange:g,onHoverEnd:_,onKeyDown:y,onKeyUp:b,onFocus:x,onFocusChange:S,onBlur:C,selectionManager:w=t.selectionManager}=e,T=!!c,E=T&&e[`aria-expanded`]===`true`,D=e.isDisabled??w.isDisabled(i),O=e.isSelected??w.isSelected(i),k=Ju.get(t),A=t.collection.getItem(i),j=e.onClose||k.onClose,ee=vt(),te=()=>{if(!T&&(A?.props?.onAction?A.props.onAction():e.onAction&&e.onAction(i),k.onAction)){let e=k.onAction;e(i,A?.value)}},ne=`menuitem`;T||(w.selectionMode===`single`?ne=`menuitemradio`:w.selectionMode===`multiple`&&(ne=`menuitemcheckbox`));let M=ae(),re=ae(),N=ae(),ie={id:r,"aria-disabled":D||void 0,role:ne,"aria-label":e[`aria-label`],"aria-labelledby":M,"aria-describedby":[e[`aria-describedby`],re,N].filter(Boolean).join(` `)||void 0,"aria-controls":e[`aria-controls`],"aria-haspopup":c,"aria-expanded":e[`aria-expanded`]};if(w.selectionMode!==`none`&&!T&&(ie[`aria-checked`]=O),s){let e=Number(A?.index);ie[`aria-posinset`]=Number.isNaN(e)?void 0:e+1,ie[`aria-setsize`]=zs(t.collection)}let oe=(0,v.useRef)(!1),se=e=>{f?.(e),oe.current=e},ce=(0,v.useRef)(null),le=e=>{e.pointerType!==`keyboard`&&(ce.current={pointerType:e.pointerType}),e.pointerType===`mouse`&&(oe.current||e.target.click()),u?.(e)},ue=e=>{m?.(e),te(),wt(e,ee,A.props.href,A?.props.routerOptions);let t=ce.current?.pointerType===`keyboard`?ce.current?.key===`Enter`||w.selectionMode===`none`||w.isLink(i):w.selectionMode!==`multiple`||w.isLink(i);t=o??a??t,j&&!T&&t&&j(),ce.current=null},{itemProps:de,isFocused:fe}=As({id:r,selectionManager:w,key:i,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:`none`,shouldUseVirtualFocus:k.shouldUseVirtualFocus}),{pressProps:pe,isPressed:me}=pi({onPressStart:l,onPress:d,onPressUp:le,onPressChange:se,onPressEnd:p,isDisabled:D}),{hoverProps:he}=Oi({isDisabled:D,onHoverStart(e){!Vt()&&!(E&&c)&&(w.setFocused(!0),w.setFocusedKey(i)),h?.(e)},onHoverChange:g,onHoverEnd:_}),{keyboardProps:F}=lr({shortcuts:{" ":e=>{ce.current={pointerType:`keyboard`,key:` `},z(e).click(),Ut(`keyboard`)},Enter:e=>{ce.current={pointerType:`keyboard`,key:`Enter`};let t=z(e);if(t.tagName!==`A`)t.click(),Ut(`keyboard`);else return Ut(`keyboard`),{shouldPreventDefault:!1,shouldContinuePropagation:!1}}},onKeyDown:y,onKeyUp:b}),{focusableProps:I}=mr({onBlur:C,onFocus:x,onFocusChange:S},n),ge=Zr(A?.props);delete ge.id;let _e=Ct(A?.props);return{menuItemProps:{...ie,...P(ge,_e,T?{onFocus:de.onFocus,"data-collection":de[`data-collection`],"data-key":de[`data-key`]}:de,pe,he,F,I,k.shouldUseVirtualFocus||T?{onMouseDown:e=>e.preventDefault()}:void 0,D?void 0:{onClick:ue}),tabIndex:de.tabIndex!=null&&E&&!k.shouldUseVirtualFocus?-1:de.tabIndex},labelProps:{id:M},descriptionProps:{id:re},keyboardShortcutProps:{id:N},isFocused:fe,isFocusVisible:fe&&w.isFocused&&Vt()&&!E,isSelected:O,isPressed:me,isDisabled:D}}function Zu(e){let{heading:t,"aria-label":n}=e,r=N();return{itemProps:{role:`presentation`},headingProps:t?{id:r,role:`presentation`}:{},groupProps:{role:`group`,"aria-label":n,"aria-labelledby":t?r:void 0}}}function Qu(e){let t=eu(e),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)([]),o=()=>{a([]),t.close()},s=(e,t)=>{a(n=>t>n.length?n:[...n.slice(0,t),e])},c=(e,t)=>{a(n=>n[t]===e?n.slice(0,t):n)};return{focusStrategy:n,...t,open(e=null){r(e),t.open()},toggle(e=null){r(e),t.toggle()},close(){o()},expandedKeysStack:i,openSubmenu:s,closeSubmenu:c}}var $u=class{constructor(e,{expandedKeys:t}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,t||=new Set;let n=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&(e.type===`section`||t.has(e.key)))for(let t of e.childNodes)n(t)};for(let t of e)n(t);let r=null,i=0;for(let[e,t]of this.keyMap)r?(r.nextKey=e,t.prevKey=r.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=i++),r=t,r.nextKey=void 0;this.lastKey=r?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}};function ed(e){let{onExpandedChange:t}=e,[n,r]=Dn(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=Ks(e),a=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),o=$s(e,(0,v.useCallback)(e=>new $u(e,{expandedKeys:n}),[n]),null);return(0,v.useEffect)(()=>{i.focusedKey!=null&&!o.getItem(i.focusedKey)&&i.setFocusedKey(null)},[o,i.focusedKey]),{collection:o,expandedKeys:n,disabledKeys:a,toggleKey:e=>{r(td(n,e))},setExpandedKeys:r,selectionManager:new Js(o,i)}}function td(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}var nd=(0,v.createContext)(null),rd=(0,v.createContext)(null),W=(0,v.createContext)(null),G=(0,v.createContext)(null);function id(e){let t=Qu(e),n=(0,v.useRef)(null),{menuTriggerProps:r,menuProps:i}=qu({...e,type:`menu`},t,n),a=(0,v.useRef)(null);return vr()?null:v.createElement(fe,{values:[[nd,{...i,ref:a}],[hd,t],[W,t],[iu,{trigger:`MenuTrigger`,triggerRef:n,scrollRef:a,placement:`bottom start`,"aria-labelledby":i[`aria-labelledby`],offset:e.trigger===`contextMenu`?0:void 0}]]},v.createElement(ql,{...r,ref:n,isPressed:t.isOpen},e.children))}var ad=(0,v.createContext)(null);(class extends An{static{this.type=`submenutrigger`}filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}});var od=(0,v.forwardRef)(function(e,t){return[e,t]=he(e,t,nd),v.createElement(Tr,{content:v.createElement(Lr,e)},n=>v.createElement(sd,{props:e,collection:n,menuRef:t}))});function sd({props:e,collection:t,menuRef:n}){[e,n]=he(e,n,On);let{filter:r,...i}=e,a=(0,v.useMemo)(()=>r?t.filter(r):t,[t,r]),o=ed({...e,collection:a,children:void 0}),s=(0,v.useContext)(W),{isVirtualized:c,CollectionRoot:l}=(0,v.useContext)(Ur),{menuProps:u}=Yu({...e,isVirtualized:c,onClose:e.onClose||s?.close},o,n),d=pe({...e,children:void 0,defaultClassName:`react-aria-Menu`,values:{isEmpty:o.collection.size===0}}),f=null;o.collection.size===0&&e.renderEmptyState&&(f=v.createElement(`div`,{role:`menuitem`,style:{display:`contents`}},e.renderEmptyState()));let p=Zr(e,{global:!0});return v.createElement(Ho,null,v.createElement(ve.div,{...P(p,d,u),ref:n,slot:e.slot||void 0,"data-empty":o.collection.size===0||void 0,onScroll:e.onScroll},v.createElement(fe,{values:[[rd,o],[Fo,{elementType:`div`}],[zr,{name:`MenuSection`,render:ld}],[ad,{parentMenuRef:n,shouldUseVirtualFocus:i?.shouldUseVirtualFocus}],[dd,{shouldCloseOnSelect:e.shouldCloseOnSelect}],[On,null],[kn,null],[G,o.selectionManager],[W,s??Qu({})]]},v.createElement(No,null,v.createElement(l,{collection:o.collection,persistedKeys:Wr(o.selectionManager.focusedKey),scrollRef:n}))),f))}var cd=class extends Js{constructor(e,t){super(e.collection,t),this.parent=e}get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}};function ld(e,t,n,r=`react-aria-MenuSection`){let i=(0,v.useContext)(rd),{CollectionBranch:a}=(0,v.useContext)(Ur),[o,s]=F(),{headingProps:c,groupProps:l}=Zu({heading:s,"aria-label":n.props[`aria-label`]??void 0}),u=pe({...e,id:void 0,children:void 0,defaultClassName:r,className:n.props?.className,style:n.props?.style,values:void 0}),d=(0,v.useContext)(G),f=Ks(e),p=e.selectionMode==null?d:new cd(d,f),m=me(dd)?.shouldCloseOnSelect,h=Zr(e,{global:!0});return delete h.id,v.createElement(ve.section,{...P(h,u,l),ref:t},v.createElement(fe,{values:[[Ao,{...c,ref:o}],[G,p],[dd,{shouldCloseOnSelect:e.shouldCloseOnSelect??m}]]},v.createElement(a,{collection:i.collection,parent:n})))}var ud=Pr(Fn,ld),dd=(0,v.createContext)(null),fd=Nr(Pn,function(e,t,n){[e,t]=he(e,t,dd);let r=me(dd)?.id,i=(0,v.useContext)(rd),a=ue(t),o=(0,v.useContext)(G),{isVirtualized:s}=(0,v.useContext)(Ur),{menuItemProps:c,labelProps:l,descriptionProps:u,keyboardShortcutProps:d,...f}=Xu({...e,id:r,key:n.key,selectionManager:o,isVirtualized:s},i,a),{hoverProps:p,isHovered:m}=Oi({isDisabled:f.isDisabled}),h=pe({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-MenuItem`,values:{...f,isHovered:m,isFocusVisible:f.isFocusVisible,selectionMode:o.selectionMode,selectionBehavior:o.selectionBehavior,hasSubmenu:!!e[`aria-haspopup`],isOpen:e[`aria-expanded`]===`true`}}),g=e.href?ve.a:ve.div,_=Zr(e,{global:!0});return delete _.id,delete _.onClick,v.createElement(g,{...P(_,h,c,p),ref:a,"data-disabled":f.isDisabled||void 0,"data-hovered":m||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":f.isFocusVisible||void 0,"data-pressed":f.isPressed||void 0,"data-selected":f.isSelected||void 0,"data-selection-mode":o.selectionMode===`none`?void 0:o.selectionMode,"data-has-submenu":!!e[`aria-haspopup`]||void 0,"data-open":e[`aria-expanded`]===`true`||void 0},v.createElement(fe,{values:[[Wi,{slots:{[de]:l,label:l,description:u}}],[cu,d],[Po,{isSelected:f.isSelected}]]},h.children))});Nr(Nn,function(e,t,n){let r=(0,v.useContext)(rd),{isLoading:i,onLoadMore:a,scrollOffset:o,...s}=e,c=(0,v.useRef)(null);rc((0,v.useMemo)(()=>({onLoadMore:a,collection:r?.collection,sentinelRef:c,scrollOffset:o}),[a,o,r?.collection]),c);let l=pe({...s,id:void 0,children:n.rendered,defaultClassName:`react-aria-MenuLoadingIndicator`,values:void 0});return v.createElement(v.Fragment,null,v.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:Hs(!0)},v.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:c,style:{position:`absolute`,height:1,width:1}})),i&&l.children&&v.createElement(v.Fragment,null,v.createElement(ve.div,{...P(Zr(e,{global:!0}),{tabIndex:-1}),...l,role:`menuitem`,ref:t},l.children)))});function pd(e,t){let{role:n=`dialog`}=e,r=ae();r=e[`aria-label`]?void 0:r;let i=ae();i=n===`alertdialog`&&!e[`aria-describedby`]?i:void 0;let a=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(t.current&&!Me(t.current)){Jn(t.current);let e=setTimeout(()=>{(Ae()===t.current||Ae()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),Jn(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),$l(),(0,v.useRef)(!1),(0,v.useEffect)(()=>{});let o=e[`aria-describedby`]??i;return{dialogProps:{...Zr(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]??r,"aria-describedby":o,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:r},contentProps:{id:i}}}var md=(0,v.createContext)(null),hd=(0,v.createContext)(null);function gd(e){let t=Qu(e),n=(0,v.useRef)(null),{triggerProps:r,overlayProps:i}=Gu({type:`dialog`},t,n);return r.id=N(),i[`aria-labelledby`]=r.id,vr()?null:v.createElement(fe,{values:[[hd,t],[W,t],[md,i],[iu,{trigger:`DialogTrigger`,triggerRef:n,id:i.id,"aria-labelledby":i[`aria-labelledby`]}]]},v.createElement(ql,{...r,ref:n,isPressed:t.isOpen},e.children))}var _d=(0,v.forwardRef)(function(e,t){let n=e[`aria-labelledby`];[e,t]=he(e,t,md);let{dialogProps:r,titleProps:i,contentProps:a}=pd({...e,"aria-labelledby":n},t),o=(0,v.useContext)(hd);!r[`aria-label`]&&!r[`aria-labelledby`]&&e[`aria-labelledby`]&&(r[`aria-labelledby`]=e[`aria-labelledby`]);let s=pe({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),c=Zr(e,{global:!0});return v.createElement(ve.section,{...P(c,s,r),render:e.render,ref:t,slot:e.slot||void 0},v.createElement(fe,{values:[[Hi,{slots:{[de]:{},title:{...i,level:2}}}],[Wi,{slots:{[de]:{},description:a}}],[zi,{slots:{[de]:{},close:{onPress:()=>o?.close()}}}]]},s.children))});function vd(e={}){let{locale:t}=dn();return(0,v.useMemo)(()=>new Intl.ListFormat(t,e),[t,e])}var yd=1500,bd=500,xd={},Sd=0,Cd=!1,wd=null,Td=null;function Ed(e={}){let{delay:t=yd,closeDelay:n=bd}=e,{isOpen:r,open:i,close:a}=eu(e),[o,s]=(0,v.useState)(!1),c=(0,v.useMemo)(()=>`${++Sd}`,[]),l=(0,v.useRef)(null),u=(0,v.useRef)(a),d=()=>{xd[c]=m},f=()=>{for(let e in xd)e!==c&&(xd[e](!0,!0),delete xd[e])},p=e=>{l.current&&clearTimeout(l.current),l.current=null,f(),d(),s(!!e),Cd=!0,i(),wd&&=(clearTimeout(wd),null),Td&&=(clearTimeout(Td),null)},m=(e,t)=>{s(!!t),e||n<=0?(l.current&&clearTimeout(l.current),l.current=null,u.current()):l.current||=setTimeout(()=>{l.current=null,u.current()},n),wd&&=(clearTimeout(wd),null),Cd&&(Td&&clearTimeout(Td),Td=setTimeout(()=>{delete xd[c],Td=null,Cd=!1},Math.max(bd,n)))},h=()=>{f(),d(),!r&&!Cd?(wd&&clearTimeout(wd),wd=setTimeout(()=>{wd=null,Cd=!0,p(!1)},t)):r||p(!0)};return(0,v.useEffect)(()=>{u.current=a},[a]),(0,v.useEffect)(()=>()=>{l.current&&clearTimeout(l.current),xd[c]&&delete xd[c]},[c]),{isOpen:r,shouldSkipAnimation:o,open:e=>{!e&&t>0&&!l.current?h():p(Cd)},close:m}}function Dd(e,t,n){let{overlayProps:r,underlayProps:i}=el({...e,isOpen:t.isOpen,onClose:t.close},n);return il({isDisabled:!t.isOpen}),$l(),(0,v.useEffect)(()=>{if(t.isOpen&&n.current)return yc([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:P(r),underlayProps:i}}var Od=typeof document<`u`&&window.visualViewport;function kd(){let e=j(),[t,n]=(0,v.useState)(()=>e?{width:0,height:0}:Ad());return(0,v.useEffect)(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{Od&&Od.scale>1||e(Ad())},r,i=t=>{Od&&Od.scale>1||Yt(z(t))&&(r=requestAnimationFrame(()=>{let t=Ae();(!t||!Yt(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(Ad()),lt()&&dt()&&window.addEventListener(`blur`,i,!0),Od?Od.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),lt()&&dt()&&window.removeEventListener(`blur`,i,!0),Od?Od.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function Ad(){return{width:Od?Math.min(Od.width*Od.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:Od?Od.height*Od.scale:document.documentElement.clientHeight}}var jd=(0,v.createContext)(null),Md=(0,v.createContext)(null),Nd=(0,v.forwardRef)(function(e,t){if((0,v.useContext)(Md))return v.createElement(Ld,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,children:s,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d,...f}=e;return v.createElement(Fd,{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d},v.createElement(Ld,{...f,modalRef:t},s))});function Pd(e,t){[e,t]=he(e,t,jd);let n=(0,v.useContext)(hd),r=eu(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=ue(t),o=(0,v.useRef)(null),s=nu(a,i.isOpen),c=nu(o,i.isOpen),l=s||c||e.isExiting||!1,u=j();return!i.isOpen&&!l||u?null:v.createElement(Id,{...e,state:i,isExiting:l,overlayRef:a,modalRef:o})}var Fd=(0,v.forwardRef)(Pd);function Id({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:r}=t,{modalProps:i,underlayProps:a}=Dd(t,r,n),o=tu(t.overlayRef)||t.isEntering||!1,s=pe({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:o,isExiting:t.isExiting,state:r}}),c=kd(),l,u;if(typeof document<`u`){let e=Ki(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().width%1,n=e.getBoundingClientRect().height%1;l=e.scrollWidth-t,u=e.scrollHeight-n}let d={...s.style,"--visual-viewport-width":c.width+`px`,"--visual-viewport-height":c.height+`px`,"--page-width":l===void 0?void 0:l+`px`,"--page-height":u===void 0?void 0:u+`px`};return v.createElement(Ql,{isExiting:t.isExiting,portalContainer:e},v.createElement(ve.div,{...P(Zr(t,{global:!0}),a),...s,style:d,ref:t.overlayRef,"data-entering":o||void 0,"data-exiting":t.isExiting||void 0},v.createElement(fe,{values:[[Md,{modalProps:i,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[hd,r]]},s.children)))}function Ld(e){let{modalProps:t,modalRef:n,isExiting:r,isDismissable:i}=(0,v.useContext)(Md),a=(0,v.useContext)(hd),o=ue((0,v.useMemo)(()=>oe(e.modalRef,n),[e.modalRef,n])),s=tu(o),c=pe({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:s,isExiting:r,state:a}});return v.createElement(ve.div,{...P(Zr(e,{global:!0}),t),...c,ref:o,"data-entering":s||void 0,"data-exiting":r||void 0},i&&v.createElement(Kl,{onDismiss:a.close}),c.children)}var Rd=new WeakMap;function zd(e,t,n){let{value:r,children:i,"aria-label":a,"aria-labelledby":o,onPressStart:s,onPressEnd:c,onPressChange:l,onPress:u,onPressUp:d,onClick:f}=e,p=e.isDisabled||t.isDisabled,m=t.selectedValue===r,h=e=>{e.stopPropagation(),t.setSelectedValue(r)},{pressProps:g,isPressed:_}=pi({onPressStart:s,onPressEnd:c,onPressChange:l,onPress:u,onPressUp:d,onClick:f,isDisabled:p}),{pressProps:y,isPressed:b}=pi({onPressStart:s,onPressEnd:c,onPressChange:l,onPressUp:d,onClick:f,isDisabled:p,onPress(e){u?.(e),t.setSelectedValue(r),n.current?.focus()}}),{focusableProps:x}=mr(P(e,{onFocus:()=>t.setLastFocusedValue(r)}),n),S=P(g,x),C=Zr(e,{labelable:!0}),w=-1;t.selectedValue==null?(t.lastFocusedValue===r||t.lastFocusedValue==null)&&(w=0):t.selectedValue===r&&(w=0),p&&(w=void 0);let{name:T,form:E,descriptionId:D,errorMessageId:O,validationBehavior:k}=Rd.get(t);xa(n,t.defaultSelectedValue,t.setSelectedValue),Sa({validationBehavior:k},t,n);let A=Da();return{labelProps:P(y,(0,v.useMemo)(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:P(C,{...S,type:`radio`,name:T,form:E,tabIndex:w,disabled:p,required:t.isRequired&&k===`native`,checked:m,value:r,onChange:h,"aria-describedby":[e[`aria-describedby`],A.id,t.isInvalid?O:null,D].filter(Boolean).join(` `)||void 0}),descriptionProps:A,isDisabled:p,isSelected:m,isPressed:_||b}}function Bd(e,t){let{name:n,form:r,isReadOnly:i,isRequired:a,isDisabled:o,orientation:s=`vertical`,validationBehavior:c=`aria`}=e,{direction:l}=dn(),{isInvalid:u,validationErrors:d,validationDetails:f}=t.displayValidation,{labelProps:p,fieldProps:m,descriptionProps:h,errorMessageProps:g}=ba({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||d}),_=Zr(e,{labelable:!0}),{focusWithinProps:v}=xi({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});function y(e,n){let r=cs(n.currentTarget,{from:z(n),accept:e=>e instanceof xe(e).HTMLInputElement&&e.type===`radio`}),i;return e===`next`?(i=r.nextNode(),i||=(r.currentNode=n.currentTarget,r.firstChild())):(i=r.previousNode(),i||=(r.currentNode=n.currentTarget,r.lastChild())),i?(i.focus(),t.setSelectedValue(i.value),!0):!1}let{keyboardProps:b}=lr({shortcuts:{ArrowRight:e=>y(l===`rtl`&&s!==`vertical`?`prev`:`next`,e),ArrowLeft:e=>y(l===`rtl`&&s!==`vertical`?`next`:`prev`,e),ArrowDown:e=>y(`next`,e),ArrowUp:e=>y(`prev`,e)},allowRepeats:!0}),x=N(n);return Rd.set(t,{name:x,form:r,descriptionId:h.id,errorMessageId:g.id,validationBehavior:c}),{radioGroupProps:P(_,{role:`radiogroup`,...b,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":i||void 0,"aria-required":a||void 0,"aria-disabled":o||void 0,"aria-orientation":s,...m,...v}),labelProps:p,descriptionProps:h,errorMessageProps:g,isInvalid:u,validationErrors:d,validationDetails:f}}var Vd=Math.round(Math.random()*1e10),Hd=0;function Ud(e){let t=(0,v.useMemo)(()=>e.name||`radio-group-${Vd}-${++Hd}`,[e.name]),[n,r]=Dn(e.value,e.defaultValue??null,e.onChange),[i]=(0,v.useState)(n),[a,o]=(0,v.useState)(null),s=da({...e,value:n}),c=t=>{!e.isReadOnly&&!e.isDisabled&&(r(t),s.commitValidation())},l=s.displayValidation.isInvalid;return{...s,name:t,selectedValue:n,defaultSelectedValue:e.value===void 0?e.defaultValue??null:i,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(l?`invalid`:null),isInvalid:l}}var Wd=(0,v.createContext)(null),Gd=(0,v.createContext)(null),Kd=(0,v.createContext)(null),qd=(0,v.forwardRef)(function(e,t){[e,t]=he(e,t,Wd);let{validationBehavior:n}=me(_a)||{},r=e.validationBehavior??n??`native`,i=Ud({...e,validationBehavior:r}),[a,o]=F(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:s,labelProps:c,descriptionProps:l,errorMessageProps:u,...d}=Bd({...e,label:o,validationBehavior:r},i),f=pe({...e,values:{orientation:e.orientation||`vertical`,isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-RadioGroup`}),p=Zr(e,{global:!0});return v.createElement(ve.div,{...P(p,f,s),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`vertical`,"data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},v.createElement(fe,{values:[[Kd,i],[ki,{...c,ref:a,elementType:`span`}],[Wi,{slots:{description:l,errorMessage:u}}],[V,d]]},v.createElement(No,null,f.children)))}),Jd=(0,v.forwardRef)(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=he(r,t,Gd);let i=v.useContext(Kd),a=ue((0,v.useMemo)(()=>oe(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),o=zd({...I(e),children:typeof e.children==`function`||e.children},i,a);return v.createElement(Yd.Provider,{value:{...o,inputRef:a,defaultClassName:`react-aria-Radio`}},v.createElement(Xd,{...e,ref:t}))}),Yd=(0,v.createContext)(null),Xd=(0,v.forwardRef)(function(e,t){let{labelProps:n,inputProps:r,isSelected:i,isDisabled:a,isPressed:o,defaultClassName:s,inputRef:c}=(0,v.useContext)(Yd),l=v.useContext(Kd),{isFocused:u,isFocusVisible:d,focusProps:f}=Si(),p=a||l.isReadOnly,{hoverProps:m,isHovered:h}=Oi({...e,isDisabled:p}),g=pe({...e,defaultClassName:s,values:{isSelected:i,isPressed:o,isHovered:h,isFocused:u,isFocusVisible:d,isDisabled:a,isReadOnly:l.isReadOnly,isInvalid:l.isInvalid,isRequired:l.isRequired}}),_=Zr(e,{global:!0});return delete _.id,delete _.onClick,v.createElement(ve.label,{...P(_,n,m,g),ref:t,"data-selected":i||void 0,"data-pressed":o||void 0,"data-hovered":h||void 0,"data-focused":u||void 0,"data-focus-visible":d||void 0,"data-disabled":a||void 0,"data-readonly":l.isReadOnly||void 0,"data-invalid":l.isInvalid||void 0,"data-required":l.isRequired||void 0},v.createElement(ra,{elementType:`span`},v.createElement(`input`,{...P(r,f),ref:c})),g.children)}),Zd=new WeakMap;function Qd(e,t,n){let{keyboardDelegate:r,isDisabled:i,isRequired:a,name:o,form:s,validationBehavior:c=`aria`}=e,l=Ts({usage:`search`,sensitivity:`base`}),u=(0,v.useMemo)(()=>r||new Cs(t.collection,t.disabledKeys,n,l),[r,t.collection,t.disabledKeys,l,n]),{menuTriggerProps:d,menuProps:f}=qu({isDisabled:i,type:`listbox`},t,n),{keyboardProps:p}=lr({shortcuts:{ArrowLeft:()=>{if(t.selectionManager.selectionMode===`multiple`)return!1;let e=t.selectedKey==null?u.getFirstKey?.():u.getKeyAbove?.(t.selectedKey);e!=null&&t.setSelectedKey(e)},ArrowRight:()=>{if(t.selectionManager.selectionMode===`multiple`)return!1;let e=t.selectedKey==null?u.getFirstKey?.():u.getKeyBelow?.(t.selectedKey);e!=null&&t.setSelectedKey(e)}},allowRepeats:!0,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp}),{typeSelectProps:m}=vs({keyboardDelegate:u,selectionManager:t.selectionManager,onTypeSelect(e){t.setSelectedKey(e)}}),{isInvalid:h,validationErrors:g,validationDetails:y}=t.displayValidation,{labelProps:b,fieldProps:x,descriptionProps:S,errorMessageProps:C}=ba({...e,labelElementType:`span`,isInvalid:h,errorMessage:e.errorMessage||g});t.selectionManager.selectionMode===`multiple`&&(m={});let w=Zr(e,{labelable:!0}),T=P(m,d,x),E=N();return Zd.set(t,{isDisabled:i,isRequired:a,name:o,form:s,validationBehavior:c}),{labelProps:{...b,onClick:()=>{e.isDisabled||(n.current?.focus(),Ut(`keyboard`))}},triggerProps:P(w,{...T,isDisabled:i,onKeyDown:_(T.onKeyDown,p.onKeyDown),onKeyUp:p.onKeyUp,"aria-labelledby":[E,T[`aria-labelledby`],T[`aria-label`]&&!T[`aria-labelledby`]?T.id:null].filter(Boolean).join(` `),onFocus(n){t.isFocused||(e.onFocus&&e.onFocus(n),e.onFocusChange&&e.onFocusChange(!0),t.setFocused(!0))},onBlur(n){t.isOpen||(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))}}),valueProps:{id:E},menuProps:{...f,onAction:void 0,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:`selection`,onBlur:n=>{R(n.currentTarget,n.relatedTarget)||(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))},"aria-labelledby":[x[`aria-labelledby`],T[`aria-label`]&&!x[`aria-labelledby`]?T.id:null].filter(Boolean).join(` `)},descriptionProps:S,errorMessageProps:C,isInvalid:h,validationErrors:g,validationDetails:y,hiddenSelectProps:{isDisabled:i,name:o,label:e.label,state:t,triggerRef:n,form:s}}}function $d(e,t,n){let r=Zd.get(t)||{},{autoComplete:i,name:a=r.name,form:o=r.form,isDisabled:s=r.isDisabled}=e,{validationBehavior:c,isRequired:l}=r,{visuallyHiddenProps:u}=na({style:{position:`fixed`,top:0,left:0}});xa(e.selectRef,t.defaultValue,t.setValue),Sa({validationBehavior:c,focus:()=>n.current?.focus()},t,e.selectRef);let d=t.setValue,f=(0,v.useCallback)(e=>{let t=z(e);t.multiple?d(Array.from(t.selectedOptions,e=>e.value)):d(e.currentTarget.value)},[d]);return{containerProps:{...u,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":`aria-hidden-focus`},inputProps:{style:{display:`none`}},selectProps:{tabIndex:-1,autoComplete:i,disabled:s,multiple:t.selectionManager.selectionMode===`multiple`,required:c===`native`&&l,name:a,form:o,value:t.value??``,onChange:f,onInput:f}}}function ef(e){let{state:t,triggerRef:n,label:r,name:i,form:a,isDisabled:o}=e,s=(0,v.useRef)(null),c=(0,v.useRef)(null),{containerProps:l,selectProps:u}=$d({...e,selectRef:t.collection.size<=300?s:c},t,n),d=Array.isArray(t.value)?t.value:[t.value];if(t.collection.size<=300)return v.createElement(`div`,{...l,"data-testid":`hidden-select-container`},v.createElement(`label`,null,r,v.createElement(`select`,{...u,ref:s},v.createElement(`option`,{value:``,label:`\xA0`},`\xA0`),[...t.collection.getKeys()].map(e=>{let n=t.collection.getItem(e);if(n&&n.type===`item`)return v.createElement(`option`,{key:n.key,value:n.key},n.textValue)}),t.collection.size===0&&i&&d.map((e,t)=>v.createElement(`option`,{key:t,value:e??``})))));if(i){let{validationBehavior:e}=Zd.get(t)||{};d.length===0&&(d=[null]);let n=d.map((t,n)=>{let r={type:`hidden`,autoComplete:u.autoComplete,name:i,form:a,disabled:o,value:t??``};return e===`native`?v.createElement(`input`,{key:n,...r,ref:n===0?c:null,style:{display:`none`},type:`text`,required:n===0&&u.required,onChange:()=>{}}):v.createElement(`input`,{key:n,...r,ref:n===0?c:null})});return v.createElement(v.Fragment,null,n)}return null}function tf(e){let{selectionMode:t=`single`,shouldCloseOnSelect:n=t===`single`}=e,r=eu(e),[i,a]=(0,v.useState)(null),o=(0,v.useMemo)(()=>e.defaultValue===void 0?t===`single`?e.defaultSelectedKey??null:[]:e.defaultValue,[e.defaultValue,e.defaultSelectedKey,t]),[s,c]=Dn((0,v.useMemo)(()=>e.value===void 0?t===`single`?e.selectedKey:void 0:e.value,[e.value,e.selectedKey,t]),o,e.onChange),l=t===`single`&&Array.isArray(s)?s[0]:s,u=n=>{if(t===`single`){let t=Array.isArray(n)?n[0]??null:n;c(t),t!==l&&e.onSelectionChange?.(t)}else{let e=[];Array.isArray(n)?e=n:n!=null&&(e=[n]),c(e)}},d=ec({...e,selectionMode:t,disallowEmptySelection:t===`single`,allowDuplicateSelectionEvents:!0,selectedKeys:(0,v.useMemo)(()=>nf(l),[l]),onSelectionChange:e=>{if(e!==`all`){if(t===`single`){let t=e.values().next().value??null;u(t)}else u([...e]);n&&r.close(),m.commitValidation()}}}),f=d.selectionManager.firstSelectedKey,p=(0,v.useMemo)(()=>[...d.selectionManager.selectedKeys].map(e=>d.collection.getItem(e)).filter(e=>e!=null),[d.selectionManager.selectedKeys,d.collection]),m=da({...e,value:Array.isArray(l)&&l.length===0?null:l}),[h,g]=(0,v.useState)(!1),[_]=(0,v.useState)(l);return{...m,...d,...r,value:l,defaultValue:o??_,setValue:u,selectedKey:f,setSelectedKey:u,selectedItem:p[0]??null,selectedItems:p,defaultSelectedKey:e.defaultSelectedKey??(e.selectionMode===`single`?_:null),focusStrategy:i,open(t=null){(d.collection.size!==0||e.allowsEmptyCollection)&&(a(t),r.open())},toggle(t=null){(d.collection.size!==0||e.allowsEmptyCollection)&&(a(t),r.toggle())},isFocused:h,setFocused:g}}function nf(e){if(e!==void 0)return e===null?[]:Array.isArray(e)?e:[e]}function rf(e){return e&&e.__esModule?e.default:e}var af=(0,v.createContext)(null),of=(0,v.createContext)(null),sf=_r(function(e,t){[e,t]=he(e,t,af);let{children:n,isDisabled:r=!1,isInvalid:i=!1,isRequired:a=!1}=e,o=(0,v.useMemo)(()=>typeof n==`function`?n({isOpen:!1,isDisabled:r,isInvalid:i,isRequired:a,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):n,[n,r,i,a]);return v.createElement(Tr,{content:o},n=>v.createElement(lf,{props:e,collection:n,selectRef:t}))}),cf=[ki,zi,Wi];function lf({props:e,selectRef:t,collection:n}){let{validationBehavior:r}=me(_a)||{},i=e.validationBehavior??r??`native`,a=tf({...e,collection:n,children:void 0,validationBehavior:i}),{isFocusVisible:o,focusProps:s}=Si({within:!0}),c=(0,v.useRef)(null),[l,u]=F(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:d,triggerProps:f,valueProps:p,menuProps:m,descriptionProps:h,errorMessageProps:g,hiddenSelectProps:_,...y}=Qd({...I(e),label:u,validationBehavior:i},a,c),b=(0,v.useMemo)(()=>({isOpen:a.isOpen,isFocused:a.isFocused,isFocusVisible:o,isDisabled:e.isDisabled||!1,isInvalid:y.isInvalid||!1,isRequired:e.isRequired||!1}),[a.isOpen,a.isFocused,o,e.isDisabled,y.isInvalid,e.isRequired]),x=pe({...e,values:b,defaultClassName:`react-aria-Select`}),S=Zr(e,{global:!0});delete S.id;let C=(0,v.useRef)(null);return v.createElement(fe,{values:[[af,e],[of,a],[uf,p],[ki,{...d,ref:l,elementType:`span`}],[zi,{...f,ref:c,isPressed:a.isOpen,autoFocus:e.autoFocus}],[hd,a],[iu,{trigger:`Select`,triggerRef:c,scrollRef:C,placement:`bottom start`,"aria-labelledby":m[`aria-labelledby`],clearContexts:cf}],[ic,{...m,ref:C}],[ac,a],[Wi,{slots:{description:h,errorMessage:g}}],[V,y]]},v.createElement(ve.div,{...P(S,x,s),ref:t,slot:e.slot||void 0,"data-focused":a.isFocused||void 0,"data-focus-visible":o||void 0,"data-open":a.isOpen||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":y.isInvalid||void 0,"data-required":e.isRequired||void 0},x.children,v.createElement(ef,{..._,autoComplete:e.autoComplete})))}var uf=(0,v.createContext)(null),df=_r(function(e,t){[e,t]=he(e,t,uf);let n=(0,v.useContext)(of),{placeholder:r}=me(af),i=n.selectedItems.map(e=>{let t=e.props?.children;return typeof t==`function`&&(t=t({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:`single`,selectionBehavior:`toggle`})),t}),a=vd(),o=(0,v.useMemo)(()=>n.selectedItems.map(e=>e?.textValue),[n.selectedItems]),s=n.selectionManager.selectionMode,c=(0,v.useMemo)(()=>s===`single`?o[0]??``:a.format(o),[s,a,o]),l=(0,v.useMemo)(()=>{if(s===`single`)return i[0];let e=a.formatToParts(o);if(e.length===0)return null;let t=0;return e.map(e=>e.type===`element`?v.createElement(v.Fragment,{key:t},i[t++]):e.value)},[s,a,o,i]),u=Tn(rf(wo),`react-aria-components`),d=pe({...e,defaultChildren:l??r??u.format(`selectPlaceholder`),defaultClassName:`react-aria-SelectValue`,values:{selectedItem:n.selectedItems[0]?.value??null,selectedItems:(0,v.useMemo)(()=>n.selectedItems.map(e=>e.value??null),[n.selectedItems]),selectedText:c,isPlaceholder:n.selectedItems.length===0,state:n}}),f=Zr(e,{global:!0});return v.createElement(ve.span,{ref:t,...f,...d,"data-placeholder":n.selectedItems.length===0||void 0},v.createElement(Wi.Provider,{value:void 0},d.children))}),ff=(0,v.createContext)({}),pf=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},mf=(0,v.forwardRef)(function(e,t){[e,t]=he(e,t,ff);let{hoverProps:n,isHovered:r}=Oi(e),{isFocused:i,isFocusVisible:a,focusProps:o}=Si({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=pe({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-TextArea`});return v.createElement(ve.textarea,{...P(pf(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),hf=(0,v.createContext)(null),gf=_r(function(e,t){[e,t]=he(e,t,hf);let{validationBehavior:n}=me(_a)||{},r=e.validationBehavior??n??`native`,i=(0,v.useRef)(null);[e,i]=he(e,i,kn);let[a,o]=F(!e[`aria-label`]&&!e[`aria-labelledby`]),[s,c]=(0,v.useState)(`input`),{labelProps:l,inputProps:u,descriptionProps:d,errorMessageProps:f,...p}=Ha({...I(e),inputElementType:s,label:o,validationBehavior:r},i),m=(0,v.useCallback)(e=>{i.current=e,e&&c(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),h=pe({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:p.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),g=Zr(e,{global:!0});return delete g.id,v.createElement(ve.div,{...g,...h,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":p.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},v.createElement(fe,{values:[[ki,{...l,ref:a}],[za,{...u,ref:m}],[ff,{...u,ref:m}],[Ra,{role:`presentation`,isInvalid:p.isInvalid,isDisabled:e.isDisabled||!1}],[Wi,{slots:{description:d,errorMessage:f}}],[V,p]]},h.children))}),_f=v.createContext(null);function vf(e){let{children:t}=e,n=(0,v.useContext)(_f),[r,i]=(0,v.useState)(0),a=(0,v.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(e=>e+1),n&&n.addModal()},removeModal(){i(e=>e-1),n&&n.removeModal()}}),[n,r]);return v.createElement(_f.Provider,{value:a},t)}function yf(){let e=(0,v.useContext)(_f);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function bf(e){let{modalProviderProps:t}=yf();return v.createElement(`div`,{"data-overlay-container":!0,...e,...t})}function xf(e){return v.createElement(vf,null,v.createElement(bf,e))}function Sf(e){let t=j(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=Xl();if(!e.portalContainer&&i&&(n=i()),v.useEffect(()=>{if(n?.closest(`[data-overlay-container]`))throw Error(`An OverlayContainer must not be inside another container. Please change the portalContainer prop.`)},[n]),!n)return null;let a=v.createElement(xf,r);return xr.createPortal(a,n)}function Cf(e,t){let n=Zr(e,{labelable:!0}),{hoverProps:r}=Oi({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:P(n,r,{role:`tooltip`})}}function wf(e,t,n){let{isDisabled:r,trigger:i,shouldCloseOnPress:a=!0}=e,o=N(),s=(0,v.useRef)(!1),c=(0,v.useRef)(!1),l=()=>{(s.current||c.current)&&t.open(c.current)},u=e=>{!s.current&&!c.current&&t.close(e)};(0,v.useEffect)(()=>{let e=e=>{n&&n.current&&e.key===`Escape`&&(e.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[n,t]);let d=()=>{i!==`focus`&&(Ht()===`pointer`?s.current=!0:s.current=!1,l())},f=()=>{i!==`focus`&&(c.current=!1,s.current=!1,u())},p=()=>{a&&(c.current=!1,s.current=!1,u(!0))},m=()=>{Vt()&&(c.current=!0,l())},h=()=>{c.current=!1,s.current=!1,u(!0)},{hoverProps:g}=Oi({isDisabled:r,onHoverStart:d,onHoverEnd:f}),{focusableProps:_}=mr({isDisabled:r,onFocus:m,onBlur:h},n);return{triggerProps:{"aria-describedby":t.isOpen?o:void 0,...P(_,g,{onPointerDown:p,onKeyDown:p}),tabIndex:void 0},tooltipProps:{id:o}}}var Tf=(0,v.createContext)(null),Ef=(0,v.createContext)(null);function Df(e){let t=Ed(e),n=(0,v.useRef)(null),{triggerProps:r,tooltipProps:i}=wf(e,t,n);return v.createElement(fe,{values:[[Tf,t],[Ef,{...i,triggerRef:n}]]},v.createElement(pr,{...r,ref:n},e.children))}var Of=(0,v.forwardRef)(function({UNSTABLE_portalContainer:e,...t},n){[t,n]=he(t,n,Ef);let r=(0,v.useContext)(Tf),i=Ed(t),a=t.isOpen!=null||t.defaultOpen!=null||!r?i:r,o=nu(n,a.isOpen),s=t.isExiting||!a.shouldSkipAnimation&&o||!1;return!a.isOpen&&!s?null:v.createElement(Sf,{portalContainer:e},v.createElement(kf,{...t,tooltipRef:n,isExiting:s}))});function kf(e){let t=(0,v.useContext)(Tf),n=(0,v.useRef)(null),{overlayProps:r,arrowProps:i,placement:a,triggerAnchorPoint:o}=Jc({placement:e.placement||`top`,targetRef:e.triggerRef,overlayRef:e.tooltipRef,arrowRef:n,offset:e.offset,crossOffset:e.crossOffset,isOpen:t.isOpen,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,containerPadding:e.containerPadding,onClose:()=>t.close(!0)}),s=tu(e.tooltipRef,!!a),c=e.isEntering||!t.shouldSkipAnimation&&s||!1,l=pe({...e,defaultClassName:`react-aria-Tooltip`,values:{placement:a,isEntering:c,isExiting:e.isExiting,state:t}});e=P(e,r);let{tooltipProps:u}=Cf(e,t),d=Zr(e,{global:!0});return v.createElement(ve.div,{...P(d,l,u),ref:e.tooltipRef,style:{...r.style,"--trigger-anchor-point":o?`${o.x}px ${o.y}px`:void 0,...l.style},"data-placement":a??void 0,"data-entering":c||void 0,"data-exiting":e.isExiting||void 0},v.createElement(mc.Provider,{value:{...i,placement:a,ref:n}},l.children))}var Af=g(),jf=`toil-ui.motion`,Mf=`(prefers-reduced-motion: reduce)`;function Nf(){try{return localStorage.getItem(jf)===`reduced`?`reduced`:`full`}catch{return`full`}}var Pf=null,Ff=new Set;function If(){return Pf??=Nf(),Pf}function Lf(){typeof document<`u`&&(document.documentElement.dataset.motion=If())}function Rf(e){Pf=e;try{localStorage.setItem(jf,e)}catch{}Lf();for(let e of Ff)e()}function zf(e){return Ff.add(e),()=>Ff.delete(e)}function Bf(){return[(0,v.useSyncExternalStore)(zf,If,()=>`full`),Rf]}function Vf(){return typeof window>`u`||typeof window.matchMedia!=`function`||window.matchMedia(Mf).matches}function Hf(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(Mf);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function Uf(){let[e]=Bf(),t=(0,v.useSyncExternalStore)(Hf,Vf,()=>!0);return(0,v.useEffect)(Lf,[e]),e===`full`&&!t}var Wf=`toil-ui.particles`;function Gf(){try{let e=JSON.parse(localStorage.getItem(Wf)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`boolean`))}catch{return{}}}var Kf=null,qf=()=>Kf??=Gf();function K(e,t){Kf={...qf(),[e]:t};try{localStorage.setItem(Wf,JSON.stringify(Kf))}catch{}for(let e of Ff)e()}function Jf(e){return[(0,v.useSyncExternalStore)(zf,()=>qf()[e]??!0,()=>!0),t=>K(e,t)]}function Yf(e){let t=Uf(),[n]=Jf(e);return t&&n}var Xf={name:`crate`,label:`Crate`,description:`toil's own brand: the site's warm near-black and flame-to-amber accent in a warehouse of pallet racking that drifts as you scroll, dust in a light shaft, and the crate in its hard hat when there's nothing to show yet.`,schemes:{dark:{bg:`#16130f`,surface:`#1f1a15`,raised:`#2a231c`,ink:`#f6f1e9`,muted:`#b4a998`,line:`#4a423a`,accent:`#ff6a3d`,accentInk:`#160b05`,link:`#ffb84d`,focus:`#6fb2ff`,ok:`#ffb84d`,warn:`#ffb84d`,danger:`#ff6a3d`,bannerBg:`#2a231c`,bannerInk:`#ffb84d`}},fonts:{body:`'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif`,display:`'Source Serif 4', Georgia, 'Times New Roman', serif`,mono:`'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, monospace`},radius:`8px`,motion:`subtle`,ambient:{particles:`dust`},sounds:{},assets:{emptyState:`assets/crate-lost.webp`,mark:`assets/mark.svg`,loading:`assets/crate-loading.webp`,racking:`assets/racking.webp`,pallets:`assets/pallets.webp`},lexicon:{"dossiers.lede":`Each dossier is one consignment of work: its repositories, its tracker, its pipelines and its environments, all on one manifest. Pick one to see its stories, pull requests, builds and deployments on the same dock.`,"dossier.eyebrow":`Consignment`,"settings.eyebrow":`Yard office`,"attention.note":`Open crates ranked by their insights, heaviest first. Each insight names the data it rests on, stencilled on the side.`,"aging.note":`How long each crate in progress has sat on the floor, from its history, oldest first.`,"trace.note":`Each work item with the pull requests that name it, their latest builds, and the environments it has shipped to.`,"graph.note":`Arrows run the way each link reads, from the source's own links. Blocking chains are stacked left to right.`,"ask.note":`Answers cite the crates they rest on. The agent reads the manifest; it never changes a ticket. What it suggests comes back as a proposal, for you to sign for.`,"empty.dossiers":`No consignments on the floor: toil sees no dossiers yet. One is made with toil dossiers init.`,"empty.sprint":`No sprint is on the loading schedule for this dossier's work items.`,"empty.burnup":`No sprint is on the schedule, so there is nothing to tally.`,"empty.column":`Bay empty.`,"empty.prs":`No pull requests waiting at the dock for this dossier.`,"empty.builds":`No builds on record for this dossier's pull requests.`,"empty.deployments":`This dossier names no environment, so there is no delivery to check.`,"empty.links":`No links between this dossier's items: every crate stands on its own.`,"empty.ask":`Pick a question, or ask your own. Every answer comes with its paperwork: the items it rests on.`,"loading.dossiers":`Pulling the dossiers off the rack…`,"loading.dossier":`Pulling {name} off the rack…`,"loading.graph":`Chalking the graph on the floor…`,"loading.answer":`Checking the manifest…`,"ask.placeholder":`Ask the dock about {name}`,"ask.placeholder.short":`Ask the dock`,"ask.welcome":`Ask about {name}: what is on the floor, who is loading what, what is stuck in the aisle. Every answer comes with its paperwork: the items it rests on.`,"status.cache":`Checking the manifest`,"status.live":`Radioing the yard`,"status.registry":`Reading the form`,"status.writing":`Filling in the docket`,"status.done":`Signed off in {seconds} s`,"status.stopped":`Called off after {seconds} s`},voice:`Speak like a terse warehouse dockworker near the end of a long shift: short, flat sentences, practical and unhurried. Work items are crates, the sprint is this week's shipment, a pull request is a load waiting at the dock, a build is the forklift check, a deployment is a delivery that has left the yard, and a blocker is a pallet in the aisle. Lead with what is stuck and what would move it. Dry, never cheerful and never unkind: if there is a joke, it is on the paperwork, never on a person. These words go around the facts, never instead of them.`},Zf={name:`harvest`,label:`Harvest`,description:`A 16-bit farm: a pixel font, wooden sign panels, a sky that runs from dawn on the sprint's first day to dusk on its last, and crops that grow a stage with each column an item moves.`,schemes:{light:{bg:`#efe3c2`,surface:`#f6ecd2`,raised:`#fdf6e3`,ink:`#2b1a0e`,muted:`#5c3f24`,line:`#b08a5a`,accent:`#2f6b1f`,accentInk:`#ffffff`,link:`#8a3410`,focus:`#1f55a8`,ok:`#2c6a1c`,warn:`#7a4800`,danger:`#a3200f`,bannerBg:`#3b2614`,bannerInk:`#fbe7b5`}},fonts:{body:`'Pixelify Sans', system-ui, -apple-system, 'Segoe UI', sans-serif`,display:`'Pixelify Sans', system-ui, -apple-system, 'Segoe UI', sans-serif`,mono:`ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace`},radius:`0px`,motion:`subtle`,ambient:{particles:`leaves`},sounds:{},assets:{panel:`assets/wood-panel.svg`,sign:`assets/wood-sign.svg`,seed:`assets/crop-seed.svg`,sprout:`assets/crop-sprout.svg`,grown:`assets/crop-grown.svg`,harvested:`assets/crop-harvested.svg`,portrait:`assets/portrait.svg`,emptyState:`assets/empty-field.svg`,loading:`assets/watering-can.svg`,mark:`assets/mark.svg`,fields:`assets/fields.webp`},terms:{board:`Farm plot`,sprint:`Season calendar`,agent:`Almanac`,dependencies:`Irrigation`},lexicon:{"dossiers.lede":`Each dossier is one plot of work: its repositories, its tracker, its pipelines and its environments. Pick one to walk its stories, pull requests, builds and deployments in a single field.`,"dossier.eyebrow":`Homestead`,"settings.eyebrow":`Tool shed`,"attention.note":`Open items ranked by their insights, the thirstiest first. Each insight names the data it rests on.`,"aging.note":`How long each item in progress has been in the ground, from its history, oldest first.`,"trace.note":`Each work item with the pull requests that name it, their latest builds, and the environments it has been planted in.`,"graph.note":`Arrows run the way each link reads, from the source's own links. Blocking chains run left to right, like water downhill.`,"ask.note":`Answers cite the items they rest on. The almanac reads; it never changes a ticket. What it suggests comes back as a proposal for you to plant.`,"empty.dossiers":`The fields are fallow: toil sees no dossiers yet. A dossier is sown with toil dossiers init.`,"empty.sprint":`No season is under way in this dossier's work items.`,"empty.burnup":`No season is under way, so there is no harvest to chart.`,"empty.column":`Bare soil.`,"empty.prs":`No pull requests in the basket for this dossier.`,"empty.builds":`No builds have come up for this dossier's pull requests.`,"empty.deployments":`This dossier names no environment, so there is no market to send the harvest to.`,"empty.links":`No links between this dossier's items: every row grows on its own.`,"empty.ask":`Pick a question, or ask your own. Every answer says which rows it was picked from.`,"loading.dossiers":`Walking out to the dossiers…`,"loading.dossier":`Walking the rows of {name}…`,"loading.graph":`Laying out the irrigation…`,"loading.answer":`Checking the almanac…`,"ask.placeholder":`Ask the almanac about {name}`,"ask.placeholder.short":`Ask the almanac`,"ask.welcome":`Ask about {name}: what is growing, who is tending what, where the fence is down. Every answer says which rows it was picked from.`,"status.cache":`Reading the almanac`,"status.live":`Walking out to the field`,"status.registry":`Checking the seed packet`,"status.writing":`Writing it down`,"status.done":`Brought in after {seconds} s`,"status.stopped":`Left in the field after {seconds} s`},voice:`Speak like a patient farmhand leaning on the fence: calm, warm and plain, in no hurry. Work items are crops, the sprint is the season, the board is the field, in progress is growing, done is harvested, a blocker is a fence down or a dry ditch, and a build is the morning walk along the rows. Say what is growing well before what needs tending, then what to do about it today. Gentle about people, honest about the weather, and short. The farm words go around the facts, never instead of them.`},Qf={name:`plain`,label:`Plain`,description:`Light and quiet, with a dark variant: toil's rounded brand face, Fredoka, on headings and figures, and IBM Plex Sans to read. The accessibility baseline every other theme is held to.`,schemes:{light:{bg:`#ffffff`,surface:`#f5f6f8`,raised:`#ffffff`,ink:`#1b1f24`,muted:`#4f5863`,line:`#c9d0d8`,accent:`#0b5cad`,accentInk:`#ffffff`,link:`#0b5cad`,focus:`#0b5cad`,ok:`#116329`,warn:`#7a4a00`,danger:`#b42318`,bannerBg:`#fff1c2`,bannerInk:`#3d2c00`},dark:{bg:`#0f1115`,surface:`#171a21`,raised:`#1e222b`,ink:`#e8eaed`,muted:`#a7afba`,line:`#3a414d`,accent:`#8cc4ff`,accentInk:`#0b1220`,link:`#8cc4ff`,focus:`#8cc4ff`,ok:`#6fd394`,warn:`#f0b849`,danger:`#ff8a80`,bannerBg:`#3a2d07`,bannerInk:`#ffe7a3`}},fonts:{body:`'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`,display:`'Fredoka', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif`,mono:`ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace`},radius:`6px`,motion:`none`,sounds:{},assets:{mark:`assets/mark-light.svg`,markDark:`assets/mark-dark.svg`}},$f={name:`realm`,label:`Realm`,description:`A grimdark house ledger: soot and iron around aged vellum, leather-bound folios with wax-sealed headings, the dependency graph as an engraved war-table map, epics as campaigns, and the agent as the house's steward.`,schemes:{light:{bg:`#cbbd9e`,surface:`#e2d7bf`,raised:`#ece4d2`,ink:`#1a1410`,muted:`#46392c`,line:`#8a7558`,accent:`#6e1c18`,accentInk:`#f1e8d4`,link:`#2b3f52`,focus:`#24405e`,ok:`#2b4a22`,warn:`#663f00`,danger:`#7f1a12`,bannerBg:`#1a1715`,bannerInk:`#e6dcc6`}},fonts:{body:`'EB Garamond', Georgia, 'Times New Roman', serif`,display:`'Grenze Gotisch', Georgia, 'Times New Roman', serif`,mono:`ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace`},radius:`2px`,motion:`none`,ambient:{particles:`embers`},sounds:{},assets:{vellum:`assets/vellum.webp`,frame:`assets/iron-band.svg`,rule:`assets/rule.svg`,capital:`assets/capital.svg`,seal:`assets/wax-seal.svg`,map:`assets/war-map.webp`,blocked:`assets/broken-road.svg`,empty:`assets/ledger.svg`,mark:`assets/mark.svg`,loading:`assets/candle-ledger.webp`},terms:{epic:`Campaign`,sprint:`Ledger`,agent:`Steward`,dependencies:`War table`,blocked:`Broken road`},lexicon:{"dossiers.lede":`Each dossier is one ledger of the house's work: its repositories, its tracker, its pipelines and its environments. Choose one to read its stories, pull requests, builds and deployments on a single page.`,"dossier.eyebrow":`The ledger`,"settings.eyebrow":`The war council`,"attention.note":`Open items ranked by their insights, the gravest first. Each insight names the record it rests on.`,"aging.note":`How long each item in progress has stood unfinished, from its history, oldest first.`,"trace.note":`Each work item with the pull requests that name it, their latest builds, and the environments where it now stands.`,"graph.note":`Arrows run the way each link reads, from the source's own links. Blocking chains run left to right across the war table.`,"ask.note":`Answers cite the items they rest on. The steward reads; it never changes a ticket. What it counsels comes back as a proposal, for you to seal.`,"empty.dossiers":`The ledgers are empty: toil sees no dossiers yet. A dossier is founded with toil dossiers init.`,"empty.sprint":`No sprint is entered in this dossier's work items.`,"empty.burnup":`No sprint is entered, so there is nothing to reckon.`,"empty.column":`None stand here.`,"empty.prs":`No pull requests have come before the council for this dossier.`,"empty.builds":`No builds are recorded for this dossier's pull requests.`,"empty.deployments":`This dossier names no environment, so no rider brings word of deployments.`,"empty.links":`No links between this dossier's items. The war table is bare.`,"empty.ask":`Pick a question, or ask your own. The steward cites every record an answer rests on.`,"loading.dossiers":`Opening the ledgers…`,"loading.dossier":`Opening the ledger of {name}…`,"loading.graph":`Laying out the war table…`,"loading.answer":`The steward is writing…`,"ask.placeholder":`Petition the steward about {name}`,"ask.placeholder.short":`Petition the steward`,"ask.welcome":`Petition the steward about {name}: the season's ledger, who holds which charge, which roads are broken. Every answer names the records it rests on.`,"status.cache":`Consulting the ledger`,"status.live":`Sending a rider to the tracker`,"status.registry":`Reading the writ`,"status.writing":`Writing the reply`,"status.done":`Sealed in {seconds} s`,"status.stopped":`Withdrawn after {seconds} s`},voice:`Speak as the steward of a great house reporting to its war council by candlelight: terse, formal and grave, in short, measured sentences, with no flourish and no cheer. Epics are campaigns, the sprint is this season's ledger, work items are its entries, a blocker is a broken road or a fortress that holds, a failing build is a breach in the wall, and a deployment is word sent to a far keep. Report the state of the ledger first, then the threats, then what you counsel. Ominous in tone, never mocking and never unkind to any person. The old words go around the facts, never instead of them.`},ep={name:`starship`,label:`Starship`,description:`A starship's bridge console: HUD frames, scanlines and a slow starfield over a nebula, holo panels with a glow, sprint health as ship's readouts, and the dependency graph as a star chart.`,schemes:{dark:{bg:`#05070f`,surface:`#0a1222`,raised:`#101b31`,ink:`#e6f1ff`,muted:`#9fb4cd`,line:`#2a4262`,accent:`#36d6ff`,accentInk:`#00121c`,link:`#7fe3ff`,focus:`#ffcf4a`,ok:`#5df2a6`,warn:`#ffc857`,danger:`#ff7a8e`,bannerBg:`#0a1222`,bannerInk:`#7fe3ff`}},fonts:{body:`'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif`,display:`'Orbitron', 'Exo 2', system-ui, sans-serif`,mono:`ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace`},radius:`2px`,motion:`subtle`,ambient:{particles:`stars`},sounds:{},assets:{starfield:`assets/starfield.svg`,chart:`assets/star-chart.svg`,computer:`assets/computer.svg`,loading:`assets/lightspeed.svg`,mark:`assets/mark.svg`,nebula:`assets/nebula.webp`,emptyState:`assets/empty-sector.webp`},terms:{sprint:`Ship's status`,agent:`Ship's computer`,dependencies:`Star chart`,blocked:`Hazard`},lexicon:{"dossiers.lede":`Each dossier is one mission: its repositories, its tracker, its pipelines and its environments. Select one to bring its stories, pull requests, builds and deployments onto the main screen.`,"dossier.eyebrow":`Mission`,"settings.eyebrow":`Engineering`,"attention.note":`Open items ranked by their insights, most critical first. Each insight names the sensor data it rests on.`,"aging.note":`How long each item in progress has been in flight, from its history, oldest first.`,"trace.note":`Each work item with the pull requests that name it, their latest builds, and the environments it has jumped to.`,"graph.note":`Arrows run the way each link reads, from the source's own links. Blocking chains plot left to right.`,"ask.note":`Answers cite the items they rest on. The ship's computer reads; it never changes a ticket. What it suggests comes back as a proposal, for the bridge to authorise.`,"empty.dossiers":`No missions on the board: toil sees no dossiers yet. Commission one with toil dossiers init.`,"empty.sprint":`No sprint is under way in this dossier's work items. All stations standing by.`,"empty.burnup":`No sprint is under way, so there is no burn to plot.`,"empty.column":`Sector clear.`,"empty.prs":`No pull requests on the scanner for this dossier.`,"empty.builds":`No builds logged for this dossier's pull requests.`,"empty.deployments":`This dossier names no environment, so there is no sector to scan for deployments.`,"empty.links":`No links between this dossier's items. The star chart is empty space.`,"empty.ask":`Pick a question, or ask your own. The computer cites every record it used.`,"loading.dossiers":`Scanning for dossiers…`,"loading.dossier":`Plotting a course to {name}…`,"loading.graph":`Drawing the star chart…`,"loading.answer":`Computing…`,"ask.placeholder":`Query the computer about {name}`,"ask.placeholder.short":`Query the computer`,"ask.welcome":`Query the ship's computer about {name}: the mission, the duty roster, the hazards on the heading. It cites every record it used.`,"status.cache":`Reading the ship's records`,"status.live":`Hailing the tracker`,"status.registry":`Checking the command manual`,"status.writing":`Logging`,"status.done":`Logged in {seconds} s`,"status.stopped":`Aborted after {seconds} s`},voice:`Write like a starship's log: crisp, formal and calm, in the first person plural of a bridge crew. The sprint is the current mission, work items are tasks on the duty roster, a blocker is a hazard on the heading, a failing build is a system fault, a deployment is a jump to another sector, and the dependency graph is the star chart. Report status first, then hazards, then the recommended course. Steady under pressure, with no exclamation marks and no alarm. Ship's terms go around the facts, never instead of them.`},tp=[`bg`,`surface`,`raised`,`ink`,`muted`,`line`,`accent`,`accentInk`,`link`,`focus`,`ok`,`warn`,`danger`,`bannerBg`,`bannerInk`],np=`modulepreload`,rp=function(e,t){return new URL(e,t).href},ip={},ap=function(e){return e.pathname.endsWith(`.css`)},op=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=rp(t,n);let r=s(t);if(r.href in ip)return;ip[r.href]=!0;let i=ap(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:np,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},sp=[Qf,Xf,Zf,ep,$f],cp={harvest:()=>op(()=>Promise.resolve({}),__vite__mapDeps([0]),import.meta.url),starship:()=>op(()=>Promise.resolve({}),__vite__mapDeps([1]),import.meta.url),realm:()=>op(()=>Promise.resolve({}),__vite__mapDeps([2]),import.meta.url)},lp=new Map;function up(e){let t=cp[e];if(!t)return Promise.resolve();let n=lp.get(e);return n||(n=t().then(()=>void 0,t=>console.error(`The ${e} theme's stylesheet didn't load, so it shows its colours only:`,t)),lp.set(e,n)),n}var dp=e=>`--${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;function fp(e,t,n){return`${e} {\n color-scheme: ${t};\n${tp.map(e=>` ${dp(e)}: ${n[e]};`).join(`
21
- `)}\n}`}function pp(e){let t=`:root[data-theme="${e.name}"]`,[n,r]=Object.entries(e.schemes),i=e.fonts,a=[`${t} {\n --font-body: ${i.body};\n --font-display: ${i.display};\n --font-mono: ${i.mono};\n --radius: ${e.radius};\n}`,fp(t,n[0],n[1])];return r&&(a.push(fp(`${t}[data-scheme="${r[0]}"]`,r[0],r[1])),a.push(`@media (prefers-color-scheme: ${r[0]}) {\n${fp(`${t}[data-scheme="system"]`,r[0],r[1])}\n}`)),a.join(`
22
- `)}var mp=e=>sp.find(t=>t.name===e)??sp.find(e=>e.name===`crate`),hp=.1,gp=1.5;function _p(e,t,n){return Math.max(0,Math.min(e.max,Math.round(e.density*t*n/1e5)))}function vp(){return{x:0,y:0,vx:0,vy:0,age:0,life:1,kind:0,seed:0,size:1}}function yp(e,t,n,r,i){for(let a of t)a.age+=n,e.step(a,n,r)||(Object.assign(a,vp()),e.spawn(a,r,i,!1))}function bp(e,t,n,r){let i=_p(e,n.w,n.h);for(;t.length<i;){let i=vp();e.spawn(i,n,r,!0),t.push(i)}t.length=i}function xp(e,t){let n=e.getContext(`2d`);if(!n)return()=>void 0;let r=Math.min(window.devicePixelRatio||1,gp),i=t.sprites((e,t)=>{let n=document.createElement(`canvas`);n.width=n.height=Math.ceil(e*r);let i=n.getContext(`2d`);return i&&(i.scale(r,r),t(i,e)),n}),a=[],o={w:0,h:0,t:0},s=Math.random,c=()=>{o.w=e.clientWidth,o.h=e.clientHeight,e.width=Math.round(o.w*r),e.height=Math.round(o.h*r),bp(t,a,o,s)},l=0,u,d=0,f=!1,p=e=>{l=0;let c=d?Math.min((e-d)/1e3,hp):0;d=e,o.t+=c,yp(t,a,c,o,s),n.setTransform(r,0,0,r,0,0),n.clearRect(0,0,o.w,o.h);for(let e of a){let r=t.alpha(e,o);r<=.004||(n.globalAlpha=Math.min(1,r),t.draw(n,e,i,o))}n.globalAlpha=1,f&&(u=setTimeout(m,Math.max(0,29.333333333333336-(performance.now()-e))))},m=()=>{u=void 0,l=requestAnimationFrame(p)},h=()=>{f||document.hidden||(f=!0,d=0,m())},g=()=>{f=!1,cancelAnimationFrame(l),clearTimeout(u),l=0,u=void 0},_=()=>document.hidden?g():h();return c(),window.addEventListener(`resize`,c),document.addEventListener(`visibilitychange`,_),h(),()=>{g(),window.removeEventListener(`resize`,c),document.removeEventListener(`visibilitychange`,_),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,e.width,e.height)}}function Sp(e,t=.2){let n=e.age/e.life;return n<=0||n>=1?0:Math.min(1,n/t,(1-n)/t)}function Cp(e,t=.25){return(n,r)=>{let i=r/2,a=n.createRadialGradient(i,i,0,i,i,i);a.addColorStop(0,`rgba(${e}, 1)`),a.addColorStop(t,`rgba(${e}, 0.9)`),a.addColorStop(1,`rgba(${e}, 0)`),n.fillStyle=a,n.fillRect(0,0,r,r)}}function wp(e,t,n){t&&e.drawImage(t,n.x-n.size/2,n.y-n.size/2,n.size,n.size)}var Tp=Math.PI*2,Ep=(e,t,n)=>t+e()*(n-t);function Dp(e,t,n,r){let i=115*Math.PI/180,a=Math.sin(i),o=-Math.cos(i),s=Math.abs(n*a)+Math.abs(r*o),c=((e-n/2)*a+(t-r/2)*o)/s+.5;return Math.exp(-(((c-.64)/.07)**2))}var Op={density:2.2,max:34,spawn(e,{w:t,h:n},r){for(let i=0;i<6&&(e.x=r()*t,e.y=r()*n,!(r()<.25||Dp(e.x,e.y,t,n)>.35));i++);e.vx=Ep(r,-5,5),e.vy=Ep(r,-4,2),e.life=Ep(r,9,18),e.age=r()*e.life*.5,e.kind=r()<.7?0:1,e.seed=r(),e.size=Ep(r,3,6)},step(e,t,{w:n,h:r,t:i}){return e.x+=(e.vx+Math.sin(i*.5+e.seed*Tp)*3)*t,e.y+=(e.vy+Math.cos(i*.4+e.seed*Tp)*2)*t,e.age<e.life&&e.x>-10&&e.x<n+10&&e.y>-10&&e.y<r+10},alpha(e,{w:t,h:n}){return Sp(e)*(.12+.43*Dp(e.x,e.y,t,n))},sprites:e=>[e(8,Cp(`246, 241, 233`,.18)),e(8,Cp(`255, 184, 77`,.18))],draw:(e,t,n)=>wp(e,n[t.kind],t)};function kp(e,t){return(n,r)=>{let i=r/5;[`..XX.`,`.XXXX`,`XVVX.`,`.X...`].forEach((r,a)=>[...r].forEach((r,o)=>{r!==`.`&&(n.fillStyle=r===`V`?t:e,n.fillRect(o*i,a*i,i,i))}))}}var Ap={density:1.3,max:20,spawn(e,{w:t,h:n},r,i){e.kind=r()<.45?3:Math.floor(r()*3),e.seed=r(),e.x=r()*t,e.kind===3?(e.y=i?r()*n:n+6,e.vx=Ep(r,4,10),e.vy=Ep(r,-14,-7),e.size=4):(e.y=i?r()*n:-12,e.vx=Ep(r,-6,6),e.vy=Ep(r,16,26),e.size=10),e.life=60},step(e,t,{w:n,h:r,t:i}){let a=e.kind===3?6:22;return e.x+=(e.vx+Math.sin(i*.9+e.seed*Tp)*a)*t,e.y+=e.vy*t,e.y>-16&&e.y<r+16&&e.x>-16&&e.x<n+16},alpha:e=>e.kind===3?.55:.5,sprites:e=>[e(10,kp(`#4f9a2a`,`#2f6b1f`)),e(10,kp(`#c9932a`,`#8a5226`)),e(10,kp(`#b8541c`,`#7a2e0e`)),e(4,(e,t)=>{e.fillStyle=`#e0b52c`,e.fillRect(0,0,t,t)})],draw(e,t,n,{t:r}){if(t.kind===3)return wp(e,n[3],t);let i=Math.floor((r*1.2+t.seed*4)%4);e.save(),e.translate(Math.round(t.x),Math.round(t.y)),e.rotate(i*Math.PI/2),e.drawImage(n[t.kind],-t.size/2,-t.size/2,t.size,t.size),e.restore()}},jp=28*Math.PI/180,Mp={dust:Op,leaves:Ap,stars:{density:1.2,max:18,spawn(e,{w:t,h:n},r){e.seed=r(),r()<.2?(e.kind=1,e.x=Ep(r,-.3,.7)*t,e.y=Ep(r,-.2,.6)*n,e.vx=Math.cos(jp)*Ep(r,700,1e3),e.vy=Math.sin(jp)*Ep(r,700,1e3),e.size=Ep(r,90,170),e.life=Ep(r,3,8)):(e.kind=0,e.x=r()*t,e.y=r()*n,e.life=Ep(r,6,14),e.age=r()*e.life,e.size=Ep(r,7,11))},step(e,t,{w:n,h:r}){return e.kind===1?(e.age-(e.life-.6)>0&&(e.x+=e.vx*t,e.y+=e.vy*t),e.age<e.life&&e.x<n+200&&e.y<r+200):e.age<e.life},alpha(e){if(e.kind===1)return e.age>e.life-.6?.45:0;let t=Math.max(0,Math.sin(e.age/e.life*Tp*2+e.seed*Tp));return Sp(e,.15)*(.15+.6*t**3)},sprites:e=>[e(12,(e,t)=>{Cp(`127, 227, 255`,.12)(e,t),e.fillStyle=`rgba(230, 241, 255, 0.85)`,e.fillRect(t/2-.5,1,1,t-2),e.fillRect(1,t/2-.5,t-2,1)}),e(160,(e,t)=>{let n=e.createLinearGradient(0,0,t,0);n.addColorStop(0,`rgba(54, 214, 255, 0)`),n.addColorStop(.85,`rgba(127, 227, 255, 0.8)`),n.addColorStop(1,`rgba(230, 241, 255, 1)`),e.fillStyle=n,e.fillRect(0,t/2-1,t,2)})],draw(e,t,n){if(t.kind===0)return wp(e,n[0],t);e.save(),e.translate(t.x,t.y),e.rotate(jp),e.drawImage(n[1],-t.size,-t.size/2,t.size,t.size),e.restore()}},embers:{density:1.4,max:22,spawn(e,{w:t,h:n},r,i){e.seed=r(),r()<.7?(e.kind=1,e.x=r()*t,e.y=i?r()*n:-8,e.vx=Ep(r,-5,5),e.vy=Ep(r,8,16),e.size=Ep(r,3,6),e.life=Ep(r,14,24)):(e.kind=0,e.x=r()*t,e.y=i?Ep(r,.4,1)*n:n+8,e.vx=Ep(r,-6,6),e.vy=Ep(r,-34,-18),e.size=Ep(r,5,9),e.life=Ep(r,8,16))},step(e,t,{w:n,h:r,t:i}){let a=e.kind===1?Math.sin(i*.7+e.seed*Tp)*10:Math.sin(i*1.3+e.seed*Tp)*8;return e.x+=(e.vx+a)*t,e.y+=e.vy*t,e.age<e.life&&e.y>-10&&e.y<r+10&&e.x>-10&&e.x<n+10},alpha(e,t){if(e.kind===1)return Sp(e,.2)*.45;let n=.75+.25*Math.sin(t.t*9+e.seed*40);return Sp(e,.25)*.7*n},sprites:e=>[e(10,Cp(`214, 98, 24`,.22)),e(6,e=>{e.fillStyle=`#5d554b`,e.beginPath(),e.moveTo(1,2),e.lineTo(4,.5),e.lineTo(5.5,3),e.lineTo(3.5,5.5),e.lineTo(.5,4.5),e.closePath(),e.fill()})],draw:(e,t,n)=>wp(e,n[t.kind],t)}},Np=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Pp=o(((e,t)=>{t.exports=Np()})),q=Pp(),Fp=new Set([`crate`]),Ip=[`far`,`mid`,`near`],Lp=()=>typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`animation-timeline: scroll()`);function Rp(e,t){(0,v.useEffect)(()=>{let n=e.current;if(!t||!n||Lp())return;let r=[...n.querySelectorAll(`.ambient-layer`)],i=[],a=()=>r.map(e=>{let t=getComputedStyle(e);return{el:e,depth:parseFloat(t.getPropertyValue(`--depth`))||0,tile:parseFloat(t.getPropertyValue(`--tile`))||0}}),o=0,s=()=>{o=0,(!i.length||i.some(e=>!e.tile))&&(i=a());for(let{el:e,depth:t,tile:n}of i){let r=n>0?window.scrollY*t%n:0;e.style.transform=`translate3d(0, ${(-r).toFixed(1)}px, 0)`}},c=()=>{o||=requestAnimationFrame(s)};return s(),window.addEventListener(`scroll`,c,{passive:!0}),()=>{cancelAnimationFrame(o),window.removeEventListener(`scroll`,c);for(let e of r)e.style.removeProperty(`transform`)}},[e,t])}function zp({theme:e}){let t=Uf(),n=Yf(e),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=sp.find(t=>t.name===e)?.ambient?.particles,o=n&&a?Mp[a]:void 0,s=Fp.has(e);return(0,v.useEffect)(()=>{if(o&&i.current)return xp(i.current,o)},[o]),Rp(r,t&&s),!o&&!s?null:(0,q.jsxs)(`div`,{className:`ambient`,"aria-hidden":`true`,ref:r,children:[s&&Ip.map(e=>(0,q.jsx)(`div`,{className:`ambient-layer ambient-layer--${e}`},e)),o&&(0,q.jsx)(`canvas`,{className:`ambient-particles`,ref:i})]})}var Bp=864e5,Vp=7*Bp,Hp=e=>e.type!==`EPIC`&&(e.type!==`OTHER`||e.typeName===null),Up=e=>[...e.history?.transitions??[]].sort((e,t)=>e.at<t.at?-1:+(e.at>t.at));function Wp(e){return Up(e).filter(e=>e.toCategory===`DONE`&&e.fromCategory!==`DONE`).at(-1)?.at??null}function Gp(e){if(e.statusCategory!==`DONE`)return null;if(!e.history)return{id:e.id,days:null,reason:`No history synced`};let t=Wp(e);if(!t)return{id:e.id,days:null,reason:`No move into Done recorded`};let n=Up(e).find(e=>e.toCategory===`IN_PROGRESS`&&e.at<=t)?.at;return n?{id:e.id,start:n,end:t,days:(Date.parse(t)-Date.parse(n))/Bp}:{id:e.id,days:null,reason:`Never recorded as In progress before Done`}}function Kp(e){let t=e.filter(Hp).map(Gp).filter(e=>e!==null);return{known:t.filter(e=>e.days!==null).sort((e,t)=>e.end<t.end?-1:1),unknown:t.filter(e=>e.days===null).map(({id:e,reason:t})=>({id:e,reason:t}))}}function qp(e,t){if(!e.length)return null;let n=[...e].sort((e,t)=>e-t);return n[Math.max(0,Math.ceil(t/100*n.length)-1)]}function Jp(e,t){if(e.statusCategory!==`IN_PROGRESS`)return null;if(!e.history)return{id:e.id,days:null,reason:`No history synced`};let n=null;for(let t of Up(e))t.toCategory===`IN_PROGRESS`?n===null&&(n=t.at):n=null;return n?{id:e.id,since:n,days:(Date.parse(t)-Date.parse(n))/Bp}:{id:e.id,days:null,reason:`No move into In progress recorded`}}function Yp(e,t){let n=e.filter(Hp).map(e=>Jp(e,t)).filter(e=>e!==null);return{known:n.filter(e=>e.days!==null).sort((e,t)=>t.days-e.days),unknown:n.filter(e=>e.days===null).map(({id:e,reason:t})=>({id:e,reason:t}))}}function Xp(e){let t=Date.parse(e),n=new Date(t).getUTCDay(),r=Math.floor(t/Bp)*Bp-(n+6)%7*Bp;return new Date(r).toISOString()}function Zp(e,t,n=6){let r=Date.parse(Xp(t)),i=Array.from({length:n},(e,t)=>({start:new Date(r-(n-1-t)*Vp).toISOString(),items:[],partial:t===n-1})),a=[],o=0;for(let t of e.filter(Hp)){if(t.statusCategory!==`DONE`)continue;let e=Wp(t);if(!e){a.push({id:t.id,reason:t.history?`No move into Done recorded`:`No history synced`});continue}let n=i.find(t=>t.start===Xp(e));n?n.items.push(t.id):e<i[0].start&&o++}return{weeks:i,unknown:a,earlier:o}}var Qp=864e5,$p=e=>e.slice(0,e.indexOf(`:`));function em(e){let t=new Map;for(let n of e){let e=n.iteration;if(!e||!(e.start&&e.end))continue;let r=t.get(e.name)??{name:e.name,start:null,end:null,sources:[]},i=$p(n.id);r.sources.some(e=>e.connection===i)||(r.sources.push({connection:i,id:e.id,name:e.name,path:e.path,start:e.start,end:e.end}),(!r.start||e.start<r.start)&&(r.start=e.start),(!r.end||e.end>r.end)&&(r.end=e.end)),t.set(e.name,r)}return[...t.values()].sort((e,t)=>e.start<t.start?-1:1)}function tm(e,t){let n=em(e);return n.find(e=>e.start<=t&&t<e.end)??n.filter(e=>e.start<=t).at(-1)??null}var nm=(e,t)=>e.iteration?.name===t.name,rm=`github project items`;function im(e){let t=e.iteration;if(!t)return{kind:`planned`,at:null,from:null,evidence:`no iteration`};let n=e=>e===t.name||t.path!==null&&e===t.path,r=(e.history?.iterations??[]).filter(e=>e.to.some(n)&&!e.from.some(n)).at(-1);if(r){let e=r.from.find(e=>!(t.path&&t.path.startsWith(`${e}\\`)));return e?{kind:`carried`,at:r.at,from:e,evidence:`history.iterations`}:{kind:t.start!==null&&r.at>t.start?`added`:`planned`,at:r.at,from:null,evidence:`history.iterations`}}let i=e.native[rm];if(i?.createdAt){let e=new Date(i.createdAt).toISOString();return{kind:t.start!==null&&e>t.start?`added`:`planned`,at:e,from:null,evidence:`${rm}: createdAt`}}return{kind:`planned`,at:null,from:null,evidence:e.history?`history.iterations`:`no history synced`}}var am=e=>e.statusCategory===`DONE`,om=e=>e.estimate?.unit===`points`?e.estimate.value:0,sm=e=>({count:e.length,points:e.reduce((e,t)=>e+om(t),0)});function cm(e,t){let n=0;for(let r=Math.floor(e/Qp)*Qp;r<t;r+=Qp){let e=new Date(r).getUTCDay();e!==0&&e!==6&&n++}return n}function lm(e,t){return t.filter(t=>t.kind===`build`&&t.items.includes(e)).sort((e,t)=>e.at<t.at?1:-1)[0]??null}function um(e,t){return e.estimate||am(e)||e.type===`EPIC`||e.type===`OTHER`?!1:!(e.parent?t.get(e.parent):void 0)?.estimate}function dm(e,t,n){let r=tm(e,n);if(!r)return null;let i=new Map(e.map(e=>[e.id,e])),a=e.filter(e=>nm(e,r)),o=new Map(a.map(e=>[e.id,im(e)])),s=e=>a.filter(t=>o.get(t.id).kind===e),c=[];for(let e of a){if(am(e))continue;let n=[];for(let t of e.links){let e=i.get(t.target);t.type===`blocks`&&t.direction===`inward`&&e&&!am(e)&&n.push({code:`blocked`,by:e.id})}let r=o.get(e.id);r.kind===`carried`&&n.push({code:`carried`,from:r.from});let a=lm(e.id,t);a?.outcome===`failed`&&n.push({code:`failing-build`,change:a.id}),um(e,i)&&n.push({code:`unestimated`}),n.length&&c.push({id:e.id,reasons:n})}let l=Date.parse(r.start),u=Date.parse(r.end);return{sprint:r,items:a,entries:o,days:{gone:cm(l,Math.min(Date.parse(n),u)),total:cm(l,u)},planned:sm(s(`planned`)),added:sm(s(`added`)),carried:sm(s(`carried`)),done:sm(a.filter(am)),remaining:sm(a.filter(e=>!am(e))),otherUnits:a.filter(e=>e.estimate&&e.estimate.unit!==`points`).map(e=>e.id),unestimated:a.filter(e=>um(e,i)).map(e=>e.id),risks:c}}function fm(e){switch(e.code){case`blocked`:return`Blocked by [[${e.by}]], which isn't done`;case`carried`:return`Carried over from ${e.from}`;case`failing-build`:return`Its latest build failed`;case`unestimated`:return`No estimate`}}var pm={blocked:`Blocked`,"failing-build":`Build failing`,aging:`Aging`,"deployed-not-closed":`Deployed, still open`,carried:`Carried over`,"pr-no-build":`PR with no build`,stale:`Stale`,blocking:`Blocking`,"built-not-deployed":`Merged, not deployed`,unestimated:`No estimate`,added:`Added mid-sprint`},mm=864e5,hm=e=>`${Math.round(e*10)/10} ${Math.round(e*10)/10==1?`day`:`days`}`;function gm(e){let t=Kp(e.items).known.map(e=>e.days),n=t.length>=3?qp(t,85):null;return{...e,byId:new Map(e.items.map(e=>[e.id,e])),p85:n===null?null:{days:n,from:t.length},ages:new Map(Yp(e.items,e.now).known.map(e=>[e.id,e.days]))}}function _m(e,t){if(e.statusCategory===`DONE`||!Hp(e))return[];let n=[],r=e=>t.byId.has(e)&&t.byId.get(e).statusCategory!==`DONE`;for(let t of e.links)t.type===`blocks`&&r(t.target)&&(t.direction===`inward`?n.push({code:`blocked`,weight:3,text:`Blocked by [[${t.target}]], which isn't done`,evidence:`links (${t.name})`}):n.push({code:`blocking`,weight:2,text:`Blocks [[${t.target}]]`,evidence:`links (${t.name})`}));let i=lm(e.id,t.changes);i?.outcome===`failed`&&n.push({code:`failing-build`,weight:3,text:`Its latest build, ${i.title}, failed`,evidence:`toil ${i.command}`});let a=t.ages.get(e.id);a!==void 0&&t.p85&&a>t.p85.days&&n.push({code:`aging`,weight:3,text:`In progress for ${hm(a)}, longer than 85% of this dossier's finished items took (${hm(t.p85.days)})`,evidence:`history.transitions, against ${t.p85.from} cycle times`});let o=t.deployments.filter(t=>t.items.includes(e.id));o.length&&n.push({code:`deployed-not-closed`,weight:2,text:`Running in ${o.map(e=>e.environment).join(` and `)}, but still ${e.status??`open`}`,evidence:`toil ${o[0].command}`});let s=t.health?.entries.get(e.id);s?.kind===`carried`&&n.push({code:`carried`,weight:2,text:`Carried over from ${s.from}`,evidence:s.evidence});let c=t.changes.filter(t=>t.kind===`pull-request`&&t.items.includes(e.id));for(let e of c.filter(e=>e.outcome===`open`))t.changes.some(t=>t.kind===`build`&&t.builds===e.id)||n.push({code:`pr-no-build`,weight:2,text:`Pull request ${e.title} is open with no build`,evidence:`toil ${e.command}`});if(e.updated){let r=(Date.parse(t.now)-Date.parse(e.updated))/mm;r>5&&n.push({code:`stale`,weight:2,text:`No update for ${hm(r)}`,evidence:`updated`})}let l=c.filter(e=>e.outcome===`merged`);return l.length&&!o.length&&t.deployments.length&&n.push({code:`built-not-deployed`,weight:1,text:`${l.length===1?`Its pull request is`:`Its pull requests are`} merged, but no environment runs ${l.length===1?`it`:`them`} yet`,evidence:`toil ${l[0].command}, toil ${t.deployments[0].command}`}),um(e,t.byId)&&n.push({code:`unestimated`,weight:1,text:`No estimate`,evidence:`estimate`}),s?.kind===`added`&&n.push({code:`added`,weight:1,text:`Added after the sprint started`,evidence:s.evidence}),n.sort((e,t)=>t.weight-e.weight)}function vm(e){return e.items.map(t=>({id:t.id,insights:_m(t,e)})).filter(e=>e.insights.length).map(e=>({...e,score:e.insights.reduce((e,t)=>e+t.weight,0)})).sort((e,t)=>t.score-e.score)}var ym=(0,v.createContext)(null);function J(){let e=(0,v.useContext)(ym);if(!e)throw Error(`useData() needs the shell to have loaded the dossier first.`);return e}var bm=new WeakMap;function xm(){let{dossier:e,now:t}=J(),n=bm.get(e);n||bm.set(e,n=new Map);let r=n.get(t);if(!r){let i=dm(e.items,e.changes,t);r={health:i,insights:gm({items:e.items,changes:e.changes,deployments:e.deployments,health:i,now:t})},n.set(t,r)}return r}var Sm={jira:`Jira`,ado:`Azure DevOps`,github:`GitHub`,bitbucket:`Bitbucket`,jenkins:`Jenkins`,openshift:`OpenShift`};function Cm(e){return Sm[e.split(`-`)[0]]??e}function wm(e){return e.source.key.replace(/^[^/]+\//,``)}var Tm=new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:`UTC`}),Em=new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`,timeZone:`UTC`}),Dm=e=>Tm.format(new Date(e)),Om=e=>Number.isNaN(Date.parse(e))?`at an unknown time`:`${Em.format(new Date(e))} UTC`,km=e=>e?e.name??e.id:`Unassigned`,Am=e=>`#/dossier/${encodeURIComponent(e)}`,jm=(e,t)=>`${Am(e)}/item/${encodeURIComponent(t)}`,Mm=e=>`${Am(e)}/prs`,Nm=e=>`${Am(e)}/people`,Pm=e=>`${Am(e)}/command-center`,Fm=(e,t)=>`${Am(e)}/board/${encodeURIComponent(t)}`,Im=(e,t)=>`${Am(e)}/worklog${t?`/${t}`:``}`,Lm=(e,t)=>`${Am(e)}/worklog/standup${t?`/${t.from}/${t.to}`:``}`,Rm=e=>`#/settings/connections/${encodeURIComponent(e)}`,zm=(e,t)=>`#/settings/dossiers/${encodeURIComponent(e)}/${t}`,Bm=`#/settings/agent`,Vm=`#/settings/agent-usage/caps`,Hm=e=>{let t=e.slice(e.indexOf(`:`)+1);return`${t.slice(0,t.lastIndexOf(`#`)).replace(/^.*\//,``)} ${t.slice(t.lastIndexOf(`#`))}`},Um={TODO:`To do`,IN_PROGRESS:`In progress`,DONE:`Done`,UNKNOWN:`Unknown`};function Wm(e){let t=e.estimate;if(!t)return`No estimate`;let n=t.unit===`points`?t.value===1?`point`:`points`:t.unit===`hours`?t.value===1?`hour`:`hours`:t.value===1?`day`:`days`;return`${t.value} ${n}`}var Gm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Km=e=>Array.isArray(e)?e.filter(Gm):[],qm=e=>typeof e==`string`&&e!==``?e:null,Jm=e=>{if(typeof e!=`number`&&typeof e!=`string`)return``;let t=new Date(e).getTime();return Number.isNaN(t)?``:new Date(t).toISOString()},Ym=e=>e.split(`-`)[0];function Xm(e,t){let n=e.state===`MERGED`||e.state===`DECLINED`;return{id:e.id,kind:`pull-request`,source:Ym(e.source.area),command:e.source.command,items:e.workItems.filter(e=>t.has(e)),title:e.title,url:e.url,state:e.state,outcome:e.state===`MERGED`?`merged`:e.state===`DECLINED`?`declined`:`open`,builds:null,mergeCommit:e.state===`MERGED`?e.mergeCommit:null,at:Jm((n?e.mergedAt??e.closedAt??e.updated:null)??e.created),change:e}}var Zm={SUCCESS:`passed`,FAILURE:`failed`,UNSTABLE:`failed`,ABORTED:`failed`};function Qm(e,t,n,r){return Km(e).map(e=>{let i=qm(e.result);return{id:`${t}:${n}#${e.number}`,kind:`build`,source:`jenkins`,command:`jenkins pipeline runs`,items:r.items,title:qm(e.fullDisplayName)??`${n} #${e.number}`,url:qm(e.url),state:e.building===!0?`BUILDING`:i??`UNKNOWN`,outcome:e.building===!0||i===null?`running`:Zm[i]??`failed`,builds:r.id,mergeCommit:null,at:Jm(e.timestamp)}})}function $m(e,t,n){return Km(e).flatMap(e=>{let r=(Gm(e.triggerInfo)?qm(e.triggerInfo[`pr.number`]):null)??/^refs\/pull\/(\d+)\/merge$/.exec(qm(e.sourceBranch)??``)?.[1],i=r?n.find(e=>e.id.endsWith(`#${r}`)):void 0;if(!i)return[];let a=qm(e.status),o=qm(e.result),s=Gm(e.definition)?qm(e.definition.name):null;return[{id:`${t}:build#${e.id}`,kind:`build`,source:`ado`,command:`ado run list`,items:i.items,title:`${s??`build`} ${e.buildNumber}`,url:Gm(e._links)&&Gm(e._links.web)?qm(e._links.web.href):null,state:a===`completed`?o??`completed`:a??`unknown`,outcome:a===`completed`?o===`succeeded`?`passed`:`failed`:`running`,builds:i.id,mergeCommit:null,at:Jm(e.finishTime??e.startTime??e.queueTime)}]})}var eh=e=>[...new Set(e.filter(e=>e!==null))];function th(e,t,n){let r=Km(e);if(!r.length)return null;let i=r.filter(e=>e.conclusion!==null&&e.conclusion!==`success`&&e.conclusion!==`skipped`&&e.conclusion!==`neutral`),a=r.filter(e=>e.status!==`completed`),o=i[0]??a[0]??r[0],s=r.map(e=>Jm(e.completed_at??e.started_at)).sort().at(-1);return{id:`${n.id}/checks`,kind:`build`,source:`github`,command:`github commit checks`,items:n.items,title:eh(r.map(e=>qm(e.name))).join(`, `),url:qm(o.html_url),state:i.length?`failure (${eh(i.map(e=>qm(e.name))).join(`, `)})`:a.length?`in_progress`:`success`,outcome:i.length?`failed`:a.length?`running`:`passed`,builds:n.id,mergeCommit:null,at:s}}function nh(e,t){if(!e)return{includes:[],items:[],unknownCommit:!0};let n=t.filter(e=>e.outcome===`merged`&&e.mergeCommit).sort((e,t)=>e.at<t.at?-1:1),r=n.findIndex(t=>t.mergeCommit.startsWith(e)||e.startsWith(t.mergeCommit));if(r<0)return{includes:[],items:[],unknownCommit:!0};let i=n.slice(0,r+1);return{includes:i.map(e=>e.id),items:[...new Set(i.flatMap(e=>e.items))],unknownCommit:!1}}var rh=/:(?:(.+)-)?([0-9a-f]{7,40})$/;function ih(e,t,n,r){let i=Gm(e)?e:{};return Km(i.deployments).filter(e=>n.includes(String(e.name))).map(e=>{let n=qm(Km(e.images)[0]?.image)??``,[,a,o]=rh.exec(n)??[],s=qm(e.ready)??`?`,c=typeof e.unavailableReplicas==`number`?e.unavailableReplicas:0;return{id:`openshift:${i.namespace}/${e.name}`,environment:t,source:`openshift`,command:`openshift deployment list`,name:`${e.name} in ${i.namespace}`,commit:o??``,version:a??null,state:`${s} ready`,outcome:c>0?`failed`:`passed`,url:null,...nh(o,r.filter(t=>t.id.includes(`/${e.name}#`)))}})}function ah(e,t,n){let r=Km(e).filter(e=>e.status===`completed`&&e.result===`succeeded`&&Gm(e.templateParameters)&&qm(e.templateParameters.environment)).sort((e,t)=>Jm(e.finishTime)<Jm(t.finishTime)?1:-1),i=new Set,a=[];for(let e of r){let r=qm(e.templateParameters.environment);if(i.has(r))continue;i.add(r);let o=qm(e.sourceVersion)??``;a.push({id:`${t}:build#${e.id}`,environment:r,source:`ado`,command:`ado run list`,name:`${Gm(e.definition)?qm(e.definition.name):`deploy`} ${e.buildNumber}`,commit:o.slice(0,7),version:null,state:String(e.result),outcome:`passed`,url:Gm(e._links)&&Gm(e._links.web)?qm(e._links.web.href):null,...nh(o,n)})}return a}var oh=[`dev`,`test`,`staging`,`prod`],sh=(e,t)=>{let n=e=>oh.includes(e)?oh.indexOf(e):oh.length;return n(e.environment)-n(t.environment)||e.environment.localeCompare(t.environment)},ch=864e5,lh=7*ch;function uh(e,t){let n=Date.parse(e),r=Date.parse(t);if(!(r>n))return 0;let i=0;for(;n<r;){let e=Math.min(r,(Math.floor(n/ch)+1)*ch),t=new Date(n).getUTCDay();t!==0&&t!==6&&(i+=(e-n)/ch),n=e}return i}var dh=e=>e.state===`OPEN`||e.state===`DRAFT`,fh=e=>Math.round(e*10)/10,ph=e=>`${fh(e)} working ${fh(e)===1?`day`:`days`}`,mh={draft:`Draft (its author)`,changes:`Changes (its author)`,checks:`Checks`,review:`Review`,merge:`Merge`};function hh(e,t){let n=(e,n,r)=>({on:e,since:n,days:n?uh(n,t):null,why:r}),r=[...e.reviews??[]].reverse().find(e=>e.state===`CHANGES_REQUESTED`)?.at??null;if(e.state===`DRAFT`)return n(`draft`,e.created,`it is a draft`);if(e.reviewers.some(e=>e.state===`CHANGES_REQUESTED`))return n(`changes`,r??e.firstReviewAt,`${e.reviewers.filter(e=>e.state===`CHANGES_REQUESTED`).map(e=>e.person.name??e.person.id).join(`, `)} asked for changes`);if(e.checks===`FAILING`)return n(`checks`,e.checksAt,`its checks are failing`);if(!e.reviewers.some(e=>e.state===`APPROVED`)){let t=e.reviewers.length?`no approval yet from ${e.reviewers.map(e=>e.person.name??e.person.id).join(`, `)}`:`no reviewer is asked yet`;return n(`review`,e.created,e.firstReviewAt?`${t}, though it has been reviewed`:t)}return e.checks===`PENDING`?n(`checks`,e.checksAt,`its checks are still running`):n(`merge`,e.approvedAt,e.mergeable===!1?`approved, but it has a merge conflict`:`approved and ready`)}var gh=[`XS`,`S`,`M`,`L`,`XL`],_h={XS:9,S:49,M:249,L:999,XL:1/0};function vh(e){let t=e.size&&e.size.additions!==null&&e.size.deletions!==null?e.size.additions+e.size.deletions:null;return{bucket:t===null?null:gh.find(e=>t<=_h[e]),lines:t,files:e.size?.files??null}}var yh={"slow-pickup":`No first review in 2 working days`,"failing-checks":`Checks failing for over a day`,conflict:`Merge conflict`,"no-work-item":`No linked work item`,"item-done":`Work item done, pull request still open`,"merged-item-open":`Merged, work item not done`},bh=(e,t)=>e.workItems.filter(e=>t.has(e));function xh(e,t,n){let r=[],i=bh(e,t).map(e=>t.get(e));if(e.state===`OPEN`){let t=e.created?uh(e.created,e.firstReviewAt??n):null;!e.firstReviewAt&&t!==null&&t>2&&r.push({flag:`slow-pickup`,text:`Open ${ph(t)} with no review yet.`})}if(dh(e)){e.checks===`FAILING`&&e.checksAt&&Date.parse(n)-Date.parse(e.checksAt)>864e5&&r.push({flag:`failing-checks`,text:`Failing since ${e.checksAt.slice(0,16).replace(`T`,` `)} UTC, ${fh((Date.parse(n)-Date.parse(e.checksAt))/ch)} days.`}),e.mergeable===!1&&r.push({flag:`conflict`,text:`It doesn't merge cleanly into ${e.branch.target??`its target`}.`}),i.length||r.push({flag:`no-work-item`,text:e.workItems.length?`It names ${e.workItems.join(`, `)}, none of which this dossier holds.`:`Its title, branch and description name no work item.`});for(let e of i.filter(e=>e.statusCategory===`DONE`))r.push({flag:`item-done`,text:`[[${e.id}]] is ${e.status??`done`} while this is still open.`})}if(e.state===`MERGED`)for(let e of i.filter(e=>e.statusCategory===`TODO`||e.statusCategory===`IN_PROGRESS`))r.push({flag:`merged-item-open`,text:`Merged, but [[${e.id}]] is still ${e.status??`open`}.`});return r}function Sh(e,t,n){let r=e.filter(dh).map(e=>({change:e,wait:hh(e,n),size:vh(e),items:bh(e,t),flags:xh(e,t,n)})),i=e=>e.wait.on===`draft`?2:+(e.wait.days===null);return r.sort((e,t)=>i(e)-i(t)||(t.wait.days??0)-(e.wait.days??0)||e.change.id.localeCompare(t.change.id))}function Ch(e,t,n){return e.flatMap(e=>xh(e,t,n).map(t=>({change:e,hit:t})))}var wh=[`HUMAN`,`AGENT`,`BOT`],Th={ALL:`All`,HUMAN:`People`,AGENT:`Agents`,BOT:`Bots`},Eh=e=>{let t=e.filter(e=>e!==null);return{median:qp(t,50),p85:qp(t,85),n:t.length,unknown:e.length-t.length}};function Dh(e,t,n=6){let r=Date.parse(Xp(t)),i=new Date(r-(n-1)*lh).toISOString(),a=e=>e!==null&&e>=i&&e<=t,o=e.filter(e=>a(e.created)),s=e.filter(e=>e.state===`MERGED`&&(a(e.mergedAt)||e.mergedAt===null&&a(e.updated??e.created))),c=(e,t)=>t===`ALL`?e:e.filter(e=>e.authorKind===t),l=[`ALL`,...wh],u=e=>Object.fromEntries(l.map(t=>[t,e(t)])),d=(e,t)=>e&&t?uh(e,t):null,f=e=>e.filter(e=>e.approvedAt!==null||e.reviews===null),p=e=>e.filter(e=>e.firstReviewAt!==null||e.reviews===null).map(e=>e.firstReviewAt?d(e.created,e.firstReviewAt):null);return{from:i,to:t,pickup:u(e=>Eh(p(c(o,e)))),review:u(e=>Eh(f(c(s,e)).map(e=>d(e.firstReviewAt,e.approvedAt)))),merge:u(e=>Eh(f(c(s,e)).map(e=>d(e.approvedAt,e.mergedAt)))),rounds:u(e=>Eh(c(s,e).map(e=>e.reviews?e.reviews.length?1+e.reviews.filter(e=>e.state===`CHANGES_REQUESTED`).length:0:null))),mergedUnreviewed:u(e=>c(s,e).filter(e=>e.reviews!==null&&!e.approvedAt).length),sizes:u(e=>{let t=Object.fromEntries([...gh,`unknown`].map(e=>[e,0]));for(let n of c(o,e))t[vh(n).bucket??`unknown`]++;return t}),throughput:u(e=>{let t=Array.from({length:n},(e,t)=>({start:new Date(r-(n-1-t)*lh).toISOString(),items:[],partial:t===n-1}));for(let n of c(s,e))n.mergedAt&&t.find(e=>e.start===Xp(n.mergedAt))?.items.push(n.id);return t}),unplacedMerges:s.filter(e=>!e.mergedAt).length,counts:u(e=>c([...new Set([...o,...s])],e).length)}}function Oh(e){for(let[t,n]of Object.entries(e.native)){if(!t.endsWith(` pr get`)||typeof n!=`object`||!n)continue;let e=n.included?.files;if(!Array.isArray(e))continue;let r=(e,t)=>{let n=e&&typeof e==`object`?e[t]:void 0;return typeof n==`string`&&n!==``?n:null};return e.flatMap(e=>{let t=e&&typeof e==`object`?e:{},n=r(t,`filename`)??r(t.path,`toString`)??r(t.new,`path`)??r(t.old,`path`)??r(t.item,`path`);return n?[n.replace(/^\//,``)]:[]})}return null}function kh(e){let t=e,n=t.endsWith(`/`);n&&(t=t.slice(0,-1));let r=t.startsWith(`/`)||t.slice(0,-1).includes(`/`);t=t.replace(/^\//,``);let i=t.split(/(\*\*\/?|\*|\?)/).map(e=>e===`**/`||e===`**`?`(?:.*/)?`+(e===`**`?`.*`:``):e===`*`?`[^/]*`:e===`?`?`[^/]`:e.replace(/[.+^${}()|[\]\\]/g,`\\$&`)).join(``);return RegExp(`^${r?``:`(?:.*/)?`}${i}${n?`/.*`:`(?:/.*)?`}$`)}function Ah(e){return e.split(/\r?\n/).flatMap(e=>{let t=e.replace(/(^|\s)#.*$/,``).trim();if(!t)return[];let[n,...r]=t.split(/\s+/);return!n||!r.length?[]:[{pattern:n,owners:r.map(e=>e.replace(/^@/,``)),test:kh(n===`*`?`**`:n)}]})}function jh(e,t){for(let n=t.length-1;n>=0;n--)if(t[n].test.test(e))return t[n].owners;return[]}var Mh=e=>e.slice(0,e.lastIndexOf(`/`)+1);function Nh(e,t,n,r=3){let i=Oh(e)??[],a=e.author?.id.toLowerCase(),o=new Map,s=(e,t,n)=>{if(e.toLowerCase()===a)return;let r=o.get(e)??{id:e,why:[],score:0};r.why.includes(t)||r.why.push(t),r.score+=n,o.set(e,r)};if(n)for(let e of i)for(let t of jh(e,n))s(t,`owns ${e} in CODEOWNERS`,3);let c=new Set(i),l=new Set(i.map(Mh));for(let n of t){if(n.id===e.id||n.repo!==e.repo||!n.reviews?.length)continue;let t=Oh(n)??[],r=t.filter(e=>c.has(e)),i=t.filter(e=>!c.has(e)&&l.has(Mh(e)));if(!r.length&&!i.length)continue;let a=`#${n.id.slice(n.id.lastIndexOf(`#`)+1)}`;for(let e of n.reviews)s(e.by.id,`reviewed ${a}, which changed ${r.length?r[0]:`${Mh(i[0])}…`}`,r.length?2:1)}return[...o.values()].sort((e,t)=>t.score-e.score||e.id.localeCompare(t.id)).slice(0,r)}function Ph(e,t,n){let r=Number(e.id.slice(e.id.lastIndexOf(`#`)+1)),i={id:`review:${e.id}:${t.id}`,from:`reviewers`,item:e.id,title:`Ask ${t.id} to review ${Hm(e.id)}`,reason:`${t.id} ${t.why.join(`; `)}.`},a=e.source.area;if(a===`github`){let e=t.id.includes(`/`);return{...i,command:`github pr add-reviewers`,input:{dossier:n,number:r,...e?{teamReviewer:[t.id.slice(t.id.indexOf(`/`)+1)]}:{reviewer:[t.id]}},note:null}}return a===`bitbucket`?{...i,command:`bitbucket pr add-reviewer`,input:{dossier:n,id:r,user:t.id},note:null}:a===`bitbucket-cloud`?{...i,command:`bitbucket-cloud pr update`,input:{dossier:n,id:r,reviewers:t.id},note:`This replaces the reviewer list, which is empty now: check nobody was added since the last sync.`}:{...i,command:null,input:null,note:`toil has no command that adds a reviewer on ${Cm(a)} yet. Add ${t.id} on the pull request's page${e.url?`: ${e.url}`:``}.`}}var Fh=864e5,Ih=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Lh=e=>(e??``).trim().toLowerCase();function Rh(e){let t=Ih(e)?e:{},n=[],r=[];t.people!==void 0&&!Array.isArray(t.people)&&n.push(`The dossier's "people" isn't a list, so nobody is mapped.`);for(let[e,i]of(Array.isArray(t.people)?t.people:[]).entries()){if(!Ih(i)||typeof i.name!=`string`||!i.name.trim()){n.push(`people[${e}] has no name, so it was left out.`);continue}let t=Object.fromEntries(Object.entries(Ih(i.ids)?i.ids:{}).filter(e=>typeof e[1]==`string`&&e[1].trim()!==``).map(([e,t])=>[e,t.trim()]));r.push({name:i.name.trim(),kind:i.kind===`agent`?`agent`:`human`,email:typeof i.email==`string`?i.email:null,ids:t})}let i=t.wipLimit,a=typeof i==`number`&&Number.isInteger(i)&&i>0?i:null;return i!==void 0&&a===null&&n.push(`The dossier's "wipLimit" isn't a whole number above 0, so no limit is shown.`),{people:r,wipLimit:a,notes:n}}var zh=(e,t)=>`${e}\u0000${Lh(t)}`,Bh=e=>zh(e.area,e.id),Vh=e=>e.replace(/-cloud$/,``);function Hh(e,t){return e.ids[t]??(Vh(t)===t?void 0:e.ids[Vh(t)])}function Uh(e,t){let n=Hh(e,t.area);return n!==void 0&&(Lh(n)===Lh(t.id)||t.email!==null&&Lh(n)===Lh(t.email))}var Wh=e=>`person:${e}`,Gh=e=>`id:${e.area}:${e.id}`,Kh=(e,t)=>t?{area:e,id:t.id,name:t.name,email:t.email}:null;function qh(e,t){let n=new Map,r=e=>{if(!e)return;let t=Bh(e),r=n.get(t);n.set(t,r?{...r,name:r.name??e.name,email:r.email??e.email}:e)};for(let t of e){r(Kh(t.source.area,t.assignee));for(let e of t.history?.transitions??[])r(Kh(t.source.area,e.by))}for(let e of t){r(Kh(e.source.area,e.author));for(let t of e.reviewers)r(Kh(e.source.area,t.person));for(let t of e.reviews??[])r(Kh(e.source.area,t.by))}return n}var Jh=e=>e.state===`OPEN`||e.state===`DRAFT`,Yh=e=>e.statusCategory===`DONE`,Xh=e=>Math.round(e*10)/10;function Zh(e){let t=[...e.history?.transitions??[]].sort((e,t)=>e.at<t.at?-1:+(e.at>t.at));return(t.filter(t=>e.status!==null&&Lh(t.to)===Lh(e.status)).at(-1)??t.filter(t=>t.toCategory===e.statusCategory&&t.fromCategory!==e.statusCategory).at(-1))?.at??null}function Qh(e,t){if(e.authorKind!==`AGENT`)return[];let n=Kh(e.source.area,e.author),r=Lh(e.authorKindSignal);return t.filter(e=>n&&Uh(e,n)||[e.name,...Object.values(e.ids)].some(e=>Lh(e).length>1&&r.includes(Lh(e))))}function $h(e,t,n,r){let{items:i,changes:a,byId:o,now:s}=r,c=(e,n)=>{let r=Kh(e,n);return r!==null&&t(r)},l=i.filter(e=>c(e.source.area,e.assignee)),u=l.filter(e=>e.statusCategory===`IN_PROGRESS`&&Hp(e)).map(e=>{let t=Zh(e);return{item:e,since:t,days:t?Xh((Date.parse(s)-Date.parse(t))/Fh):null}}),d=new Map;for(let e of u)d.set(e.item.status??`In progress`,[...d.get(e.item.status??`In progress`)??[],e]);let f=[...d.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({status:e,items:t.sort((e,t)=>(t.days??-1)-(e.days??-1)||e.item.id.localeCompare(t.item.id))})),p=e=>c(e.source.area,e.author)||n!==null&&Qh(e,[n]).length>0,m=a.filter(e=>Jh(e)&&p(e)).map(e=>{let t=!n&&e.authorKind===`AGENT`?Qh(e,r.agents)[0]?.name??`an agent the dossier doesn't name (${e.authorKindSignal??`its account`})`:null;return{change:e,wait:hh(e,s),withAgent:t}}).sort((e,t)=>(t.wait.days??-1)-(e.wait.days??-1)||e.change.id.localeCompare(t.change.id)),h=a.filter(e=>e.state===`OPEN`&&!c(e.source.area,e.author)&&e.reviewers.some(t=>t.state===`PENDING`&&c(e.source.area,t.person))).map(e=>({change:e,days:e.created?Xh(uh(e.created,s)):null})).sort((e,t)=>(t.days??-1)-(e.days??-1)||e.change.id.localeCompare(t.change.id)),g=l.filter(e=>!Yh(e)).flatMap(e=>{let t=e.links.filter(e=>e.type===`blocks`&&e.direction===`inward`).map(e=>({id:e.target,item:o.get(e.target)??null})).filter(e=>!e.item||!Yh(e.item));return t.length?[{item:e,by:t}]:[]}),_=Date.parse(s)-14*Fh,v=e=>e!==null&&Date.parse(e)>=_&&Date.parse(e)<=Date.parse(s),y=[...i.flatMap(e=>(e.history?.transitions??[]).filter(t=>v(t.at)&&c(e.source.area,t.by)&&t.from!==t.to).map(t=>({kind:`moved`,at:t.at,item:e,from:t.from,to:t.to}))),...a.filter(e=>e.state===`MERGED`&&v(e.mergedAt)&&p(e)).map(e=>({kind:`merged`,at:e.mergedAt,change:e})),...a.flatMap(e=>(e.reviews??[]).filter(t=>v(t.at)&&c(e.source.area,t.by)).map(t=>({kind:`reviewed`,at:t.at,change:e,state:t.state})))].sort((e,t)=>e.at<t.at?1:e.at>t.at?-1:0);return{who:e,wip:f,wipCount:u.length,overLimit:r.wipLimit===null?null:u.length>r.wipLimit,prs:m,reviews:h,blocked:g,activity:y.slice(0,8),moreActivity:Math.max(0,y.length-8)}}var eg=e=>e.wipCount>0||e.prs.length>0||e.reviews.length>0||e.blocked.length>0||e.activity.length>0,tg=(e,t)=>e.who.name.localeCompare(t.who.name,`en`,{sensitivity:`base`})||e.who.key.localeCompare(t.who.key);function ng(e){let{dossier:t,entries:n,wipLimit:r,items:i,now:a}=e,o=e.changes,s=new Map(i.map(e=>[e.id,e])),c=qh(i,o),l=n.filter(e=>e.kind===`agent`),u={items:i,changes:o,byId:s,now:a,wipLimit:r,agents:l},d=e=>n.find(t=>Uh(t,e)),f=n.map(e=>{let t=[...c.values()].filter(t=>Uh(e,t)),n=Object.entries(e.ids).filter(([e,n])=>!t.some(t=>Vh(t.area)===Vh(e)&&(Lh(t.id)===Lh(n)||Lh(t.email)===Lh(n)))).map(([e,t])=>({area:e,id:t,name:null,email:null}));return $h({key:Wh(e.name),name:e.name,kind:e.kind,mapped:!0,identities:[...t,...n],email:e.email},t=>Uh(e,t),e.kind===`agent`?e:null,u)}),p=new Set(o.filter(e=>e.authorKind===`BOT`&&e.author).map(e=>zh(e.source.area,e.author.id))),m=e=>!p.has(Bh(e)),h=[...c.values()].filter(e=>!d(e)),g=h.filter(m).map(e=>$h({key:Gh(e),name:e.name??e.id,kind:`human`,mapped:!1,identities:[e],email:e.email},t=>Bh(t)===Bh(e),null,u)).filter(eg),{suggestions:_,ambiguous:v}=rg(t,n,h.filter(m)),y=o.filter(e=>e.authorKind===`AGENT`&&Qh(e,l).length===0),b=[...f].sort(tg),x=dm(i,[],a);return{dossier:t,people:b,unmapped:g.sort(tg),suggestions:_,ambiguous:v,unnamedAgents:y,bots:h.filter(e=>!m(e)),wipLimit:r,team:{wip:{total:[...b,...g].reduce((e,t)=>e+t.wipCount,0),limit:r,over:[...b,...g].filter(e=>e.overLimit).sort(tg).map(e=>({key:e.who.key,name:e.who.name,count:e.wipCount}))},reviewQueue:o.filter(e=>e.state===`OPEN`).map(e=>({change:e,wait:hh(e,a)})).filter(e=>e.wait.on===`review`).sort((e,t)=>(t.wait.days??-1)-(e.wait.days??-1)||e.change.id.localeCompare(t.change.id)),unassigned:x?{sprint:x.sprint.name,items:x.items.filter(e=>!e.assignee&&!Yh(e)&&Hp(e))}:null}}}function rg(e,t,n){let r=[],i=[],a=new Map;for(let e of n)e.email&&a.set(Lh(e.email),[...a.get(Lh(e.email))??[],e]);let o=e=>`${e.area} ${e.id}`;for(let[n,s]of[...a.entries()].sort(([e],[t])=>e.localeCompare(t))){let a=t.filter(e=>Lh(e.email)===n),c=new Map;for(let e of s)c.set(e.area,[...c.get(e.area)??[],e]);let l=[...c.entries()].filter(([,e])=>e.length>1);if(a.length>1){i.push(`${n} is the email of ${a.map(e=>e.name).join(` and `)}, so ${s.map(o).join(`, `)} ${s.length===1?`is`:`are`} not matched to either.`);continue}if(l.length){i.push(`${n} is on ${l.map(([e,t])=>`${t.length} ${e} accounts (${t.map(e=>e.id).join(`, `)})`).join(` and `)}, so nothing is suggested for it.`);continue}let u=a[0];if(u){let t=s.filter(e=>Hh(u,e.area)!==void 0);for(let e of t)i.push(`${o(e)} has ${u.name}'s email, but ${u.name} already has a ${e.area} identity (${Hh(u,e.area)}), so it isn't suggested.`);let a=s.filter(e=>!t.includes(e));a.length&&r.push({identities:a,person:u.name,name:u.name,email:n,command:`dossiers person`,input:{dossier:e,name:u.name,id:a.map(e=>`${e.area}=${e.id}`)}});continue}if(s.length<2)continue;let d=s.find(e=>e.name)?.name??s[0].id;r.push({identities:s,person:null,name:d,email:n,command:`dossiers person`,input:{dossier:e,name:d,id:s.map(e=>`${e.area}=${e.id}`),email:n}})}return{suggestions:r,ambiguous:i}}function ig(e){let t=e=>/^[\w@.:=-]+$/.test(e)?e:`"${e.replace(/(["\\$`])/g,`\\$1`)}"`;return[`toil dossiers person`,t(e.input.dossier),t(e.input.name),...e.input.id.flatMap(e=>[`--id`,t(e)]),...e.input.email?[`--email`,t(e.input.email)]:[]].join(` `)}function ag(e,t){return[...e.people,...e.unmapped].find(e=>e.who.key===t)}function og(e,t,n,r){let i=t.startsWith(`person:`)?r.find(e=>Wh(e.name)===t):void 0,a=ag(e,t),o=i?e=>Uh(i,e):a?e=>a.who.identities.some(t=>Bh(t)===Bh(e)):null;return o?n.filter(e=>{let t=Kh(e.source.area,e.assignee);return t!==null&&o(t)}):[]}var sg={acceptance:`Acceptance criteria`,description:`Description`,done:`Done state`,blockers:`Blockers`,scope:`Scope`},cg={ready:`Ready`,thin:`Thin`,blocked:`Blocked`},lg=[`ready`,`thin`,`blocked`],ug=`Microsoft.VSTS.Common.AcceptanceCriteria`,dg=e=>typeof e==`object`&&!!e&&!Array.isArray(e),fg=new Set([`$schema`,`name`,`description`,`env`,`repos`,`environments`,`people`,`wipLimit`]);function pg(e){let t=dg(e)?e:{},n=[],r=(Array.isArray(t.repos)?t.repos:[]).flatMap(e=>dg(e)&&typeof e.name==`string`&&e.name?[e.name]:[]),i=[],a={};for(let[e,r]of Object.entries(t)){if(fg.has(e)||!dg(r))continue;i.push(e);let t=dg(r.fields)?r.fields:{},o=typeof t.acceptanceCriteria==`string`&&t.acceptanceCriteria.trim()?t.acceptanceCriteria.trim():null,s=e.startsWith(`ado`)?ug:null,c=r.readiness,l=25,u=[];c!==void 0&&!dg(c)&&n.push(`The ${e} section's "readiness" isn't an object of minWords and templates, so the defaults apply.`),dg(c)&&(c.minWords!==void 0&&(typeof c.minWords==`number`&&Number.isInteger(c.minWords)&&c.minWords>=0?l=c.minWords:n.push(`The ${e} section's readiness.minWords isn't a whole number of 0 or more, so 25 applies.`)),c.templates!==void 0&&(Array.isArray(c.templates)&&c.templates.every(e=>typeof e==`string`)?u=[...new Set(c.templates.flatMap(e=>xg(e).map(Sg).filter(Boolean)))]:n.push(`The ${e} section's readiness.templates isn't a list of template texts, so no template is taken out of descriptions.`))),a[e]={acceptanceField:o??s,acceptanceFrom:o?`dossier`:s?`default`:null,minWords:l,templateLines:u}}return{sources:i,repos:r,areas:a,notes:n}}var mg={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:` `},hg=e=>Number.isInteger(e)&&e>=0&&e<=1114111?String.fromCodePoint(e):`�`,gg=e=>e.replace(/&(#\d+|#x[0-9a-f]+|[a-z]+);/gi,(e,t)=>t[0]===`#`?hg(t[1]===`x`||t[1]===`X`?parseInt(t.slice(2),16):Number(t.slice(1))):mg[t.toLowerCase()]??e);function _g(e){return gg(e.replace(/<input\b[^>]*type=["']?checkbox[^>]*>/gi,`[ ] `).replace(/<h([1-6])\b[^>]*>/gi,(e,t)=>`\n${`#`.repeat(Number(t))} `).replace(/<li\b[^>]*>/gi,`
23
- - `).replace(/<(br|\/p|\/div|\/li|\/h[1-6]|\/tr|\/ul|\/ol)\b[^>]*>/gi,`
24
- `).replace(/<[^>]+>/g,``))}function vg(e){if(!dg(e))return``;if(e.type===`text`&&typeof e.text==`string`)return e.text;let t=(Array.isArray(e.content)?e.content:[]).map(vg).join(``);switch(e.type){case`heading`:return`\n${`#`.repeat(dg(e.attrs)&&typeof e.attrs.level==`number`?e.attrs.level:1)} ${t}\n`;case`taskItem`:return`\n[ ] ${t}\n`;case`listItem`:return`\n- ${t}\n`;case`paragraph`:case`blockquote`:case`codeBlock`:return`\n${t}\n`;case`hardBreak`:return`
25
- `;default:return t}}var yg=e=>e.replace(/^\s*h([1-6])\.\s+/gim,(e,t)=>`${`#`.repeat(Number(t))} `);function bg(e,t){return e==null?``:dg(e)?vg(e):typeof e==`string`?t===`html`||t===void 0&&/<\/?[a-z][\s\S]*?>/i.test(e)?_g(e):t===`wiki`?yg(e):e:``}var xg=e=>e.split(/\r?\n/),Sg=e=>e.replace(/^\s*(?:(?:#{1,6}|[-*+]|\d+[.)]|\[[ xX]?\])\s*)+/,``).replace(/[:.]\s*$/,``).replace(/\s+/g,` `).trim().toLowerCase(),Cg=/[\p{L}\p{N}][\p{L}\p{N}'’-]*/gu,wg=e=>e.match(Cg)?.length??0,Tg=/^(tbd|tba|todo|to do|n\/?a|none|nothing|wip|placeholder|description|details|lorem ipsum.*|[-_.=*#~]+)$/i,Eg=/<[^<>\n]{1,60}>|\{[^{}\n]{1,60}\}/g;function Dg(e,t){let n=new Set(t);return xg(e).filter(e=>{let t=Sg(e);return t!==``&&!n.has(t)&&!Tg.test(t)}).map(e=>e.replace(Eg,` `)).join(`
26
- `)}var Og=/^\s*(?:#{1,6}\s*|\*{1,2})?(acceptance criteria|definition of done|done when)\s*\**\s*(?::\s*(.*))?$/i,kg=/^\s*(?:[-*+]\s*)?\[[ xX]?\]\s+\S/;function Ag(e,t=[]){let n=e=>wg(Dg(e,t)),r=xg(e);for(let e=0;e<r.length;e++){let t=Og.exec(r[e]);if(t){if(n(t[2]??``)>0)return`heading`;for(let t=e+1;t<r.length&&!/^\s*#{1,6}\s/.test(r[t]);t++)if(n(r[t])>0)return`heading`}}return r.some(e=>kg.test(e)&&n(e)>0)?`checklist`:null}function jg(e,t){let n=t.toLowerCase();for(let t of Object.values(e.native??{})){if(!dg(t))continue;let e=dg(t.fields)?t.fields:t;for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n&&r!=null&&r!==``)return{value:r,key:t};for(let[t,n]of Object.entries(e))if(/^acceptance\s*criteria$/i.test(t)&&n!=null&&n!==``)return{value:n,key:t}}return null}function Mg(e){let t=e.source.area;return t.startsWith(`jira`)?{command:`${t} issue transitions`,input:{key:e.source.key}}:t.startsWith(`ado`)&&e.typeName?{command:`${t} work-item states`,input:{type:e.typeName}}:null}var Ng={proposed:`TODO`,inprogress:`IN_PROGRESS`,resolved:`IN_PROGRESS`,completed:`DONE`,removed:`DONE`},Pg={new:`TODO`,indeterminate:`IN_PROGRESS`,done:`DONE`};function Fg(e,t,n,r){if(r)return{command:t,error:r};let i=Array.isArray(n)?n:dg(n)&&Array.isArray(n.transitions)?n.transitions:[];return e.source.area.startsWith(`ado`)?{command:t,kind:`states`,states:i.filter(dg).map(e=>({name:String(e.name??``),category:typeof e.category==`string`?e.category.toLowerCase()===`removed`?null:Ng[e.category.toLowerCase()]??null:null}))}:{command:t,kind:`transitions`,states:i.filter(dg).map(e=>{let t=dg(e.to)?e.to:{},n=dg(t.statusCategory)&&typeof t.statusCategory.key==`string`?Pg[t.statusCategory.key]??null:null;return{name:String(t.name??e.name??``),category:n}})}}var Ig=(e,t,n,r)=>({check:e,label:sg[e],state:t,reason:n,source:r}),Lg=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Rg(e,t,n){let r=t?.acceptanceField??null;if(r){let n=jg(e,r);if(n){let e=wg(Dg(bg(n.value),t?.templateLines??[]));if(e>0)return Ig(`acceptance`,`pass`,`${Lg(e,`word`)} in ${n.key}.`,`field ${n.key}`)}}let i=Ag(n,t?.templateLines??[]);return i?Ig(`acceptance`,`pass`,i===`heading`?`A heading in the description lists them.`:`The description has a checklist.`,`description`):Ig(`acceptance`,`thin`,`None found. ${r?`${r} is empty, and the description has`:`The description has`} no acceptance criteria heading or checklist.`,r?`field ${r}, description`:`description`)}function zg(e,t,n){let r=t?.minWords??25,i=wg(n),a=wg(Dg(n,t?.templateLines??[])),o=i-a,s=o>0?`, not counting ${Lg(o,`word`)} of template or placeholder text`:``;return!e.body||i===0?Ig(`description`,`thin`,`No description; ${Lg(r,`word`)} are needed.`,`description`):a>=r?Ig(`description`,`pass`,`${Lg(a,`word`)} of real text${s}.`,`description`):Ig(`description`,`thin`,`${Lg(a,`word`)} of real text${s}; ${Lg(r,`word`)} are needed.`,`description`)}var Bg=(e,t)=>e.source.connection===t.source.connection&&(e.typeName??e.type).toLowerCase()===(t.typeName??t.type).toLowerCase(),Vg=e=>e.statusCategory===`DONE`||(e.history?.transitions??[]).some(e=>e.toCategory===`DONE`);function Hg(e,t,n){let r=e.typeName??e.type.toLowerCase();if(e.statusCategory===`DONE`)return Ig(`done`,`fail`,`Already done (${e.status??`Done`}).`,`status`);if(n?.error)return Ig(`done`,`thin`,`The live read failed: ${n.error}`,`toil ${n.command}`);if(n?.states){let e=n.states.filter(e=>e.category===`DONE`);return n.kind===`states`?e.length?Ig(`done`,`pass`,`The ${r} workflow has a Done state: ${e.map(e=>e.name).join(`, `)}.`,`toil ${n.command}`):Ig(`done`,`fail`,`The ${r} workflow has no Done state, so it can never be finished.`,`toil ${n.command}`):e.length?Ig(`done`,`pass`,`It can move to Done now: ${e.map(e=>e.name).join(`, `)}.`,`toil ${n.command}`):Ig(`done`,`thin`,`None of the ${Lg(n.states.length,`move`)} it offers now goes straight to Done; the workflow may get there in more steps.`,`toil ${n.command}`)}if(e.statusCategory===`UNKNOWN`)return Ig(`done`,`thin`,`toil couldn't tell what category the status ${e.status??`(none)`} is in, so it isn't known to be open.`,`status`);if(e.source.area===`github`)return Ig(`done`,`pass`,`Open (${e.status??`open`}); a GitHub issue closes from any state.`,`status`);let i=[...t.values()].find(t=>t.id!==e.id&&Bg(t,e)&&Vg(t));return i?Ig(`done`,`pass`,`Open (${e.status??`open`}), and another ${r} here reached Done ([[${i.id}]]), so the workflow gets there.`,`cache`):Ig(`done`,`thin`,`Open (${e.status??`open`}), but no ${r} in this dossier has reached Done, so a way there isn't known from the cache. Check the workflow live.`,`cache`)}function Ug(e,t){let n=e.links.filter(e=>e.type===`blocks`&&e.direction===`inward`);if(!n.length)return Ig(`blockers`,`pass`,`Nothing blocks it.`,`links`);let r=n.filter(e=>t.has(e.target)&&t.get(e.target).statusCategory!==`DONE`),i=n.filter(e=>!t.has(e.target));return r.length?Ig(`blockers`,`fail`,`Blocked by ${r.map(e=>`[[${e.target}]] (${t.get(e.target).status??`open`})`).join(`, `)}.`,`links`):i.length?Ig(`blockers`,`thin`,`Blocked by ${i.map(e=>e.target).join(`, `)}, which this dossier doesn't hold, so whether ${i.length===1?`it's`:`they're`} still open isn't known.`,`links`):Ig(`blockers`,`pass`,`Its ${n.length===1?`blocker is`:`blockers are`} done (${n.map(e=>`[[${e.target}]]`).join(`, `)}).`,`links`)}var Wg=e=>e.source.area===`github`?/^[^/]+\/([^#]+)#/.exec(e.source.key)?.[1]??null:null;function Gg(e,t){if(!t.sources.includes(e.source.area))return Ig(`scope`,`fail`,`It came from ${e.source.area}, which isn't one of this dossier's sources (${t.sources.join(`, `)||`none`}).`,`dossier`);let n=t.repos;if(!n.length)return Ig(`scope`,`thin`,`The dossier names no repository, so an agent could plan it but has nowhere to implement it. Add one with toil dossiers add-repo.`,`dossier repos`);let r=Wg(e);return r&&n.includes(r)?Ig(`scope`,`pass`,`${e.source.area} is one of the dossier's sources, and its repository, ${r}, is in the dossier.`,`dossier repos`):n.length===1?Ig(`scope`,`pass`,`${e.source.area} is one of the dossier's sources, and an agent works in ${n[0]}.`,`dossier repos`):Ig(`scope`,`pass`,`${e.source.area} is one of the dossier's sources, which names ${Lg(n.length,`repository`,`repositories`)} (${n.join(`, `)}); one is chosen when it starts.`,`dossier repos`)}var Kg={fail:0,thin:1,pass:2};function qg({item:e,settings:t,byId:n,live:r}){let i=t.areas[e.source.area],a=e.body?bg(e.body.content,e.body.format):``,o=[Rg(e,i,a),zg(e,i,a),Hg(e,n,r),Ug(e,n),Gg(e,t)],s=o.some(e=>e.state===`fail`)?`blocked`:o.some(e=>e.state===`thin`)?`thin`:`ready`,c=o.filter(e=>e.state!==`pass`).sort((e,t)=>Kg[e.state]-Kg[t.state]);return{id:e.id,verdict:s,rows:o,why:c}}function Jg(e,t){let n=new Map(e.map(e=>[e.id,e]));return e.map(e=>qg({item:e,settings:t,byId:n}))}function Yg(e){let t={ready:0,thin:0,blocked:0};for(let n of e)t[n.verdict]++;return t}var Xg=[`pr list`,`pr get`],Zg={family:`jira`,items:[`issue search`,`issue get`],history:[`issue history`],context:[],changes:[]},Qg={family:`ado`,items:[`work-item get`,`work-item get-many`],history:[`work-item history`],context:[`work-item iterations`],changes:Xg},$g={jira:Zg,"jira-cloud":Zg,ado:Qg,"ado-cloud":Qg,github:{family:`github`,items:[`issue list`,`issue search`,`issue get`,`project items`],history:[`issue history`],context:[],changes:Xg},bitbucket:{family:`bitbucket`,items:[],history:[],context:[],changes:Xg},"bitbucket-cloud":{family:`bitbucket-cloud`,items:[],history:[],context:[],changes:Xg}},e_=Object.keys($g),t_=[`estimate`,`estimateUnit`,`priority`,`type`,`team`,`dueDate`,`iteration`,`estimateLabel`,`iterationDays`],n_=[`HUMAN`,`AGENT`,`BOT`],r_=class extends Error{code;fix;details;constructor(e,t,n={}){super(t),this.name=`ToilError`,this.code=e,this.fix=n.fix,this.details=n.details}};function i_(){let e=new Set,t=[];return{list:t,warn:(n,r)=>{let i=`${n}\u0000${r}`;e.has(i)||(e.add(i),t.push({code:n,message:r}))}}}var Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>typeof e==`string`&&e!==``?e:null,a_=e=>typeof e==`number`&&Number.isFinite(e)?e:null;function o_(e){if(typeof e==`string`)return e===``?null:e;if(typeof e==`number`&&Number.isFinite(e))return String(e);if(Array.isArray(e)){for(let t of e){let e=o_(t);if(e!==null)return e}return null}return Y(e)?X(e.value)??X(e.name)??X(e.displayName)??X(e.title):null}function s_(e){if(e==null||e===``)return null;if(typeof e!=`string`)return;let t=e.replace(/([+-]\d{2})(\d{2})$/,`$1:$2`);if(!/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?)?$/.test(t))return;let n=/T|\s/.test(t)?/(Z|[+-]\d{2}:\d{2})$/.test(t)?t:`${t}Z`:`${t}T00:00:00Z`,r=Date.parse(n.replace(` `,`T`));return Number.isNaN(r)?void 0:new Date(r).toISOString()}function c_(e){if(e==null||e===``)return null;if(typeof e!=`string`)return;let t=/^(\d{4}-\d{2}-\d{2})/.exec(e);return t?t[1]:void 0}var l_={epic:`EPIC`,story:`STORY`,"user story":`STORY`,"product backlog item":`STORY`,requirement:`STORY`,task:`TASK`,"sub-task":`TASK`,subtask:`TASK`,bug:`BUG`,defect:`BUG`,incident:`INCIDENT`};function u_(e,t={}){if(e===null)return`OTHER`;let n=e.toLowerCase();return t[n]??l_[n]??`OTHER`}function d_(e,t,n,r){return{owi:`0.2`,id:f_(e.connection,t),source:{area:e.area,connection:e.connection,key:t,command:e.command},url:null,type:`OTHER`,typeName:null,title:n,body:null,status:null,statusCategory:`UNKNOWN`,resolution:null,assignee:null,reporter:null,priority:null,estimate:null,labels:[],team:null,iteration:null,parent:null,children:[],links:[],created:null,updated:null,resolved:null,dueDate:null,history:null,unmapped:[],native:r}}var f_=(e,t)=>`${e}:${t}`;function Z(e,t,n){e.unmapped.some(e=>e.field===t)||e.unmapped.push({field:t,reason:n})}function p_(e,t,n,r){let i=s_(n);i===void 0?Z(e,t,`${r} holds ${JSON.stringify(n)}, which isn't a date-time`):e[t]=i}function m_(e,t,n){let r=c_(t);r===void 0?Z(e,`dueDate`,`${n} holds ${JSON.stringify(t)}, which isn't a date`):e.dueDate=r}function h_(e,t,n,r){return t.warn(`OWI_UNKNOWN_STATE`,`"${n}" (${e.source.area}) is a status OWI has no category for, so its items are UNKNOWN: ${r}`),Z(e,`statusCategory`,`"${n}" has no category: ${r}`),`UNKNOWN`}var g_=e=>e.fields.estimateUnit??`points`;function __(e,t,n){let r=X(e)??(typeof e==`number`?String(e):null);return r===null?null:{id:r,name:X(t),email:X(n)}}function v_(e){return e.find(e=>e.state===`current`)??[...e].reverse().find(e=>e.state===`future`)??e[e.length-1]??null}var y_=[`Microsoft.VSTS.Scheduling.StoryPoints`,`Microsoft.VSTS.Scheduling.Effort`,`Microsoft.VSTS.Scheduling.Size`],b_=`Microsoft.VSTS.Scheduling.OriginalEstimate`,x_={New:`TODO`,"To Do":`TODO`,Approved:`TODO`,Proposed:`TODO`,Active:`IN_PROGRESS`,"In Progress":`IN_PROGRESS`,Doing:`IN_PROGRESS`,Committed:`IN_PROGRESS`,Open:`IN_PROGRESS`,Resolved:`IN_PROGRESS`,Closed:`DONE`,Done:`DONE`,Removed:`DONE`},S_={"System.LinkTypes.Dependency-Forward":{type:`blocks`,direction:`outward`,name:`Successor`},"System.LinkTypes.Dependency-Reverse":{type:`blocks`,direction:`inward`,name:`Predecessor`},"System.LinkTypes.Related":{type:`relates`,direction:`outward`,name:`Related`},"System.LinkTypes.Duplicate-Forward":{type:`duplicates`,direction:`inward`,name:`Duplicate`},"System.LinkTypes.Duplicate-Reverse":{type:`duplicates`,direction:`outward`,name:`Duplicate Of`}},C_=`System.LinkTypes.Hierarchy-Reverse`,w_=`System.LinkTypes.Hierarchy-Forward`;function T_(e){if(Y(e)&&Array.isArray(e.value))return e.value.filter(Y);if(Y(e)&&typeof e.id==`number`&&Y(e.fields))return[e]}function E_(e){if(Y(e))return __(e.uniqueName??e.id,e.displayName,typeof e.uniqueName==`string`&&e.uniqueName.includes(`@`)?e.uniqueName:null);if(typeof e==`string`){let t=/^(.*?)\s*<([^>]+)>$/.exec(e);return t?__(t[2],t[1],t[2].includes(`@`)?t[2]:null):__(e,e,null)}return null}var D_=e=>typeof e==`string`?/\/workItems\/(\d+)$/i.exec(e)?.[1]:void 0,O_=(e,t)=>{let n=e.replace(/^\\+/,``).split(`\\`);return t&&n[1]?.toLowerCase()===`iteration`&&n.splice(1,1),n.join(`\\`).toLowerCase()};function k_(e,t){if(!Y(e)||e.structureType!==`iteration`)return!1;let n=e=>{if(Y(e)){if(typeof e.path==`string`){let n=Y(e.attributes)?e.attributes:{};t.set(O_(e.path,!0),{id:X(e.identifier),start:s_(n.startDate)??null,end:s_(n.finishDate)??null})}for(let t of Array.isArray(e.children)?e.children:[])n(t)}};return n(e),!0}function A_(e,t,n,r){if(typeof t.id!=`number`)return;let i=String(t.id),a=t.fields??{},o=d_(e,i,X(a[`System.Title`])??``,{[e.command]:t});X(a[`System.Title`])===null&&Z(o,`title`,`the record has no System.Title`);let s=Y(t._links)?t._links:{},c=Y(s.html)?X(s.html.href):null,l=X(t.url),u=X(a[`System.TeamProject`]);c?o.url=c:l?.includes(`/_apis/`)&&u?o.url=`${l.slice(0,l.indexOf(`/_apis/`))}/${encodeURIComponent(u)}/_workitems/edit/${i}`:Z(o,`url`,`the record has no html link and no System.TeamProject to build one from`);let d=n.fields.type??`System.WorkItemType`;o.typeName=o_(a[d]),o.type=u_(o.typeName,{issue:`STORY`}),d in a||Z(o,`type`,j_(d,n.fields.type!==void 0&&`type`)),typeof a[`System.Description`]==`string`&&(o.body={format:`html`,content:a[`System.Description`]}),o.status=X(a[`System.State`]),o.status===null?Z(o,`status`,`the record has no System.State`):o.statusCategory=x_[o.status]??h_(o,n,o.status,`a custom state; ${e.area} work-item states shows its category`),o.statusCategory===`DONE`&&(o.resolution=X(a[`System.Reason`])??(o.status===`Removed`?`Removed`:null)),o.assignee=E_(a[`System.AssignedTo`]),o.reporter=E_(a[`System.CreatedBy`]);let f=n.fields.priority??`Microsoft.VSTS.Common.Priority`;o.priority=o_(a[f]),n.fields.priority!==void 0&&a[f]===void 0&&Z(o,`priority`,j_(f,`priority`)),o.labels=typeof a[`System.Tags`]==`string`?a[`System.Tags`].split(`;`).map(e=>e.trim()).filter(Boolean):[],n.fields.team!==void 0&&(o.team=o_(a[n.fields.team]),a[n.fields.team]===void 0&&Z(o,`team`,j_(n.fields.team,`team`))),M_(o,a,n);let p=n.fields.iteration??`System.IterationPath`,m=X(a[p]);if(m===null)Z(o,`iteration`,j_(p,n.fields.iteration!==void 0&&`iteration`));else{let e=r.get(O_(m,!1));o.iteration={id:e?.id??null,name:m.split(`\\`).pop(),path:m,start:e?.start??null,end:e?.end??null,state:null},!e&&p===`System.IterationPath`&&m.includes(`\\`)&&Z(o,`iteration.dates`,`the iteration's dates come from ado work-item iterations: add its output to the input`)}for(let n of Array.isArray(t.relations)?t.relations:[]){if(!Y(n))continue;let t=D_(n.url);if(t===void 0)continue;let r=String(n.rel??``);r===C_?o.parent=f_(e.connection,t):r===w_?o.children.push(f_(e.connection,t)):S_[r]?o.links.push({...S_[r],target:f_(e.connection,t)}):(r.startsWith(`System.LinkTypes.`)||r.startsWith(`Microsoft.VSTS.`))&&o.links.push({type:`other`,direction:`outward`,target:f_(e.connection,t),name:r})}o.parent===null&&typeof a[`System.Parent`]==`number`&&(o.parent=f_(e.connection,String(a[`System.Parent`]))),p_(o,`created`,a[`System.CreatedDate`],`System.CreatedDate`),p_(o,`updated`,a[`System.ChangedDate`],`System.ChangedDate`),p_(o,`resolved`,a[`Microsoft.VSTS.Common.ClosedDate`],`Microsoft.VSTS.Common.ClosedDate`);let h=n.fields.dueDate??(a[`Microsoft.VSTS.Scheduling.DueDate`]===void 0?`Microsoft.VSTS.Scheduling.TargetDate`:`Microsoft.VSTS.Scheduling.DueDate`);return n.fields.dueDate!==void 0&&a[h]===void 0?Z(o,`dueDate`,j_(h,`dueDate`)):m_(o,a[h],h),o}var j_=(e,t)=>`${e} has no value, or the record doesn't have it (Azure DevOps leaves empty fields out)${t?`; fields ${t} names it`:``}`;function M_(e,t,n){let r=n.fields.estimate;if(r!==void 0){let i=a_(t[r]);i===null?Z(e,`estimate`,t[r]===void 0?j_(r,`estimate`):`${r} holds ${JSON.stringify(t[r])}, not a number`):e.estimate={value:i,unit:n.fields.estimateUnit?g_(n):r===`Microsoft.VSTS.Scheduling.OriginalEstimate`?`hours`:`points`,field:r};return}for(let n of y_){let r=a_(t[n]);if(r!==null)return void(e.estimate={value:r,unit:`points`,field:n})}let i=a_(t[b_]);if(i!==null)return void(e.estimate={value:i,unit:`hours`,field:b_});Z(e,`estimate`,`none of StoryPoints, Effort, Size or OriginalEstimate has a value; Azure DevOps leaves empty fields out, so an unestimated item and one estimated in a field of the team's own look alike: point fields estimate at that field`)}function N_(e,t){if(!Array.isArray(e.data))return;let n=t.fields.iteration??`System.IterationPath`,r=new Map,i=e.data.filter(e=>Y(e)&&typeof e.id==`number`&&Y(e.fields));i.sort((e,t)=>(a_(e.rev)??0)-(a_(t.rev)??0));for(let e of i){let t=String(e.id),i=e.fields,a=s_(i[`System.ChangedDate`]);if(!a)continue;let o=r.get(t);o||r.set(t,o={history:{transitions:[],iterations:[]},state:null,path:null});let s=E_(i[`System.ChangedBy`]),c=X(i[`System.State`]);c!==null&&c!==o.state&&(o.history.transitions.push({from:o.state,to:c,fromCategory:o.state===null?null:x_[o.state]??`UNKNOWN`,toCategory:x_[c]??`UNKNOWN`,at:a,by:s}),o.state=c);let l=X(i[n]);l!==null&&l!==o.path&&(o.history.iterations.push({from:o.path===null?[]:[o.path],to:[l],at:a,by:s}),o.path=l)}return new Map([...r].map(([e,{history:t}])=>[e,t]))}function P_(e,t,n,r,i){let a=`${t}#${n}`;return{owi:`0.2`,id:f_(e.connection,a),source:{area:e.area,connection:e.connection,key:a,command:e.command},url:null,repo:t,title:r,branch:{source:null,target:null},state:`OPEN`,author:null,authorKind:`HUMAN`,authorKindSource:`default`,authorKindSignal:null,reviewers:[],reviews:null,checks:null,checksAt:null,mergeable:null,size:null,workItems:[],mergeCommit:null,created:null,firstReviewAt:null,approvedAt:null,mergedAt:null,closedAt:null,updated:null,unmapped:[],native:{[e.command]:i}}}function F_(e,t,n){e.unmapped.some(e=>e.field===t)||e.unmapped.push({field:t,reason:n})}function I_(e,t,n,r){let i=typeof n==`number`&&Number.isFinite(n)?new Date(n).toISOString():s_(n);return i===void 0?(F_(e,t,`${r} holds ${JSON.stringify(n)}, which isn't a date-time`),null):i}function L_(e){let t={};if(!Y(e.included))return t;for(let n of[`reviews`,`checks`,`commits`,`files`])Array.isArray(e.included[n])&&(t[n]=e.included[n]);return t}var R_=(e,t)=>e.command.endsWith(` pr list`)?`${e.command} doesn't return ${t}: map ${e.area} pr get --include ${t} for each pull request as well`:`the input wasn't read with --include ${t}: map ${e.area} pr get --include ${t}`,z_=/^[a-z0-9]+(-[a-z0-9]+)*$/;function B_(e){return(e??[]).map(e=>{let t,n;if(typeof e==`string`){let r=e.lastIndexOf(`=`);if(r<=0)throw new r_(`INVALID_INPUT`,`"${e}" isn't a key pattern.`,{fix:`Write it as pattern=connection, with {n} where the number is: PAY-{n}=corp-jira, or AB#{n}=corp-ado.`});t=e.slice(0,r),n=e.slice(r+1)}else({text:t,connection:n}=e);if(t.split(`{n}`).length!==2||t===`{n}`)throw new r_(`INVALID_INPUT`,`The key pattern "${t}" must hold {n} exactly once, beside some text (PAY-{n}, AB#{n}).`,{fix:`Put {n} where the number is, once: PAY-{n}=corp-jira.`});if(!z_.test(n))throw new r_(`INVALID_INPUT`,`"${n}" isn't a connection name (the part after = in ${t}=${n}).`,{fix:`Name the connection the keys belong to: lowercase letters, digits and single hyphens, as toil connections list shows it.`});return{text:t,connection:n}})}var V_=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function H_(e){let[t,n]=e.split(`{n}`),r=/^\w/.test(t)?`(?<![\\w-])`:``,i=n===``||/\w$/.test(n)?`(?!\\w)`:``;return RegExp(`${r}${V_(t)}(\\d+)${V_(n)}${i}`,`g`)}var U_=(e,t,n)=>e.text.endsWith(`#{n}`)&&!e.text.includes(`/`)?n:t,W_=e=>e.replace(/```[\s\S]*?```/g,` `).replace(/`[^`\n]*`/g,` `);function G_(e,t,n=()=>[]){let r=[],i=e=>{r.includes(e)||r.push(e)};for(let r of e){if(!r)continue;let e=W_(r);for(let t of n(e))i(t);for(let n of t)for(let t of e.matchAll(H_(n.text)))i(f_(n.connection,U_(n,t[0],t[1])))}return r}function K_(e){let t=e?.split(`/`).at(-1)??``;return/^(\d+)[-_]/.exec(t)?.[1]??null}var q_=/(?<![\w/#-])#(\d+)\b/g,J_=[`claude/`,`copilot/`,`codex/`],Y_=/^co-authored-by:\s*(.+)$/gim,X_=[{name:`Claude`,test:/\bclaude\b|@anthropic\.com\b/i},{name:`GitHub Copilot`,test:/\bcopilot\b/i},{name:`Codex`,test:/\bcodex\b|@openai\.com\b/i},{name:`Cursor`,test:/\bcursor\s*agent\b|@cursor\.(com|sh)\b/i},{name:`Devin`,test:/\bdevin\b|@cognition\.ai\b/i}],Z_=[`copilot`,`copilot-swe-agent[bot]`,`claude[bot]`,`devin-ai-integration[bot]`,`chatgpt-codex-connector[bot]`];function Q_(e){for(let t of e)for(let e of t.matchAll(Y_)){let t=e[1].trim();if(X_.some(e=>e.test.test(t)))return`Co-Authored-By: ${t}`}return null}function $_(e,t,n){let r=(t,n,r)=>{e.authorKind=t,e.authorKindSource=n,e.authorKindSignal=r},i=e.author?ev(t.changes.authors,e.author):void 0;if(i)return r(i.kind,`override`,`override for ${i.id}`);if(n.account)return r(n.account.kind,`account`,n.account.signal);let a=n.messages?Q_(n.messages):null;if(a)return r(`AGENT`,`trailer`,a);if(J_.find(t=>e.branch.source?.toLowerCase().startsWith(t)))return r(`AGENT`,`branch`,`branch ${e.branch.source}`);r(`HUMAN`,`default`,null),n.messages===null&&F_(e,`authorKind`,`HUMAN by default: no override, account or branch says otherwise, and the commits (whose Co-Authored-By trailers can name an agent) weren't read; map pr get --include commits`)}function ev(e,t){let n=[t.id,t.name,t.email].filter(e=>!!e).map(e=>e.toLowerCase());for(let[t,r]of Object.entries(e))if(n.includes(t.toLowerCase()))return{id:t,kind:r}}function tv(e){let t=Array.isArray(e)?e.map(e=>{let t=e.lastIndexOf(`=`);if(t<=0)throw new r_(`INVALID_INPUT`,`"${e}" isn't an author kind.`,{fix:`Write it as id=KIND, with KIND one of HUMAN, AGENT or BOT: release-bot=BOT.`});return[e.slice(0,t),e.slice(t+1)]}):Object.entries(e??{}),n={};for(let[e,r]of t){let t=String(r).toUpperCase();if(!n_.includes(t))throw new r_(`INVALID_INPUT`,`"${r}" isn't an author kind (for ${e}).`,{fix:`Use one of ${n_.join(`, `)}.`});n[e]=t}return n}function nv(e,t){let n=[...t].sort((e,t)=>e.at<t.at?-1:+(e.at>t.at));e.reviews=n;let r=n.filter(t=>!e.author||t.by.id.toLowerCase()!==e.author.id.toLowerCase());e.firstReviewAt=r[0]?.at??null,e.approvedAt=r.find(e=>e.state===`APPROVED`)?.at??null}function rv(e,t){let n=e=>e.map(e=>e.at).filter(e=>e!==null).sort();if(!t.length){e.checks=`NONE`,e.checksAt=null;return}let r=t.filter(e=>e.outcome===`fail`),i=r.length?`FAILING`:t.some(e=>e.outcome===`pending`)?`PENDING`:`PASSING`;e.checks=i,e.checksAt=i===`FAILING`?n(r)[0]??null:n(t).at(-1)??null}function iv(e){return e.flatMap(e=>{if(!Y(e))return[];let t=X(e.message)??(Y(e.commit)?X(e.commit.message):null)??X(e.comment);return t?[t]:[]})}function av(e,t){let n=e=>e.source.command.endsWith(` pr get`),[r,i]=n(t)||!n(e)?[t,e]:[e,t];return{...r,native:{...i.native,...r.native}}}function ov(e){if(Array.isArray(e))return e.filter(Y);if(Y(e)&&typeof e.pullRequestId==`number`)return[e]}var sv=e=>typeof e==`number`&&e>=5?`APPROVED`:typeof e==`number`&&e<=-5?`CHANGES_REQUESTED`:`PENDING`,cv=e=>X(e)?.replace(/^refs\/heads\//,``)??null,lv=(e,t)=>Y(e.properties)&&Y(e.properties[t])?X(String(e.properties[t].$value??``)):null,uv={succeeded:`pass`,notApplicable:`pass`,failed:`fail`,error:`fail`,pending:`pending`,notSet:`pending`};function dv(e,t,n,r){let i=String(e.pullRequestId),a=X(t.webUrl);if(a)return`${a}/pullrequest/${i}`;let o=(X(t.url)??X(e.url))?.split(`/_apis/`)[0];return!o||!n||!r?null:`${o.slice(0,o.lastIndexOf(`/`))}/${encodeURIComponent(n)}/_git/${encodeURIComponent(r)}/pullrequest/${i}`}function fv(e,t,n){let r=Y(t.repository)?t.repository:{},i=Y(r.project)?X(r.project.name):e.inputs.project??null,a=X(r.name)??e.inputs.repo??null;if(!i||!a||typeof t.pullRequestId!=`number`)return;let o=String(t.pullRequestId),s=P_(e,`${i}/${a}`,o,X(t.title)??`Pull request ${o}`,t);s.url=dv(t,r,i,a),s.branch={source:cv(t.sourceRefName),target:cv(t.targetRefName)},s.author=E_(t.createdBy),s.state=t.status===`completed`?`MERGED`:t.status===`abandoned`?`DECLINED`:t.isDraft===!0?`DRAFT`:`OPEN`,s.created=I_(s,`created`,t.creationDate,`creationDate`);let c=s.state===`MERGED`||s.state===`DECLINED`?I_(s,`closedAt`,t.closedDate,`closedDate`):null;s.closedAt=c,s.mergedAt=s.state===`MERGED`?c:null,F_(s,`updated`,`Azure DevOps records no last-updated time on a pull request`),s.mergeCommit=s.state===`MERGED`&&Y(t.lastMergeCommit)?X(t.lastMergeCommit.commitId):null,s.mergeable=t.mergeStatus===`succeeded`||t.mergeStatus!==`conflicts`&&null,s.mergeable===null&&s.state!==`MERGED`&&s.state!==`DECLINED`&&F_(s,`mergeable`,`Azure DevOps reported mergeStatus ${JSON.stringify(t.mergeStatus??null)}, which says neither clean nor conflicting`);let l=t=>[...t.matchAll(q_)].map(t=>f_(e.connection,t[1])),u=K_(s.branch.source);s.workItems=G_([s.title,u?`#${u}`:null,s.branch.source,X(t.description)],n.changes.keys,l);let d=s.author?.id.toLowerCase();s.reviewers=(Array.isArray(t.reviewers)?t.reviewers.filter(Y):[]).flatMap(e=>{let t=E_(e);return t?[{person:t,state:sv(e.vote)}]:[]});let f=L_(t);if(f.reviews){let e=[];for(let t of f.reviews.filter(Y).filter(e=>e.isDeleted!==!0)){let n=Array.isArray(t.comments)?t.comments.filter(Y):[];if(lv(t,`CodeReviewThreadType`)===`VoteUpdate`){let r=Number(lv(t,`CodeReviewVoteResult`)),i=E_(n[0]?.author),a=I_(s,`reviews`,t.publishedDate??n[0]?.publishedDate,`a vote thread's publishedDate`);i&&a&&Number.isFinite(r)&&e.push({by:i,state:r>=5?`APPROVED`:r<=-5?`CHANGES_REQUESTED`:`DISMISSED`,at:a});continue}let r=n[0];if(!r||r.commentType===`system`)continue;let i=E_(r.author),a=I_(s,`reviews`,r.publishedDate,`a comment's publishedDate`);i&&a&&i.id.toLowerCase()!==d&&e.push({by:i,state:`COMMENTED`,at:a})}nv(s,e)}else for(let t of[`reviews`,`firstReviewAt`,`approvedAt`])F_(s,t,R_(e,`reviews`));if(f.checks){let e=new Map;for(let t of f.checks.filter(Y)){let n=Y(t.context)?`${X(t.context.genre)??``}/${X(t.context.name)??``}`:String(t.id),r=String(t.updatedDate??t.creationDate??``),i=e.get(n);(!i||String(i.updatedDate??i.creationDate??``)<=r)&&e.set(n,t)}rv(s,[...e.entries()].map(([e,t])=>({name:e,outcome:uv[String(t.state)]??`pending`,at:I_(s,`checksAt`,t.updatedDate??t.creationDate,`a status's creationDate`)})))}else F_(s,`checks`,R_(e,`checks`));return f.files?(s.size={files:f.files.filter(e=>!(Y(e)&&Y(e.item)&&e.item.isFolder===!0)).length,additions:null,deletions:null},F_(s,`size`,`Azure DevOps lists the files a pull request changes, not the lines, so additions and deletions are empty`)):F_(s,`size`,R_(e,`files`)),$_(s,n,{account:(Y(t.createdBy)?X(t.createdBy.descriptor):null)?.startsWith(`svc.`)?{kind:`BOT`,signal:`account ${s.author?.name??s.author?.id??`unknown`}, a service identity`}:null,messages:f.commits?iv(f.commits):null}),s}function pv(e){if(Array.isArray(e))return e.filter(Y);if(Y(e)&&(typeof e.id==`number`||typeof e.id==`string`))return[e]}var mv=(e,t)=>{t.changes.keys.length||F_(e,`workItems`,`Bitbucket has no tracker of its own, and no key patterns were given, so no work item keys were read: pass a key pattern such as PAY-{n}=<jira connection>`)},hv=(e,t,n)=>[X(e.title),t,X(n)],gv=e=>Y(e)?__(e.name??e.slug,e.displayName,e.emailAddress):null,_v={APPROVED:`APPROVED`,NEEDS_WORK:`CHANGES_REQUESTED`,UNAPPROVED:`PENDING`},vv={APPROVED:`APPROVED`,REVIEWED:`CHANGES_REQUESTED`,UNAPPROVED:`DISMISSED`},yv={SUCCESSFUL:`pass`,FAILED:`fail`,CANCELLED:`fail`,INPROGRESS:`pending`,UNKNOWN:`pending`};function bv(e,t,n){let r=Y(t.toRef)?t.toRef:{},i=Y(t.fromRef)?t.fromRef:{},a=Y(r.repository)?r.repository:{},o=Y(a.project)?X(a.project.key):null,s=X(a.slug),c=o&&s?`${o}/${s}`:e.inputs.project&&e.inputs.repo?`${e.inputs.project}/${e.inputs.repo}`:null;if(!c||t.id===void 0)return;let l=String(t.id),u=P_(e,c,l,X(t.title)??`Pull request ${l}`,t);u.url=X((Y(t.links)&&Array.isArray(t.links.self)?t.links.self.filter(Y):[])[0]?.href),u.branch={source:X(i.displayId),target:X(r.displayId)};let d=Y(t.author)?t.author.user:void 0;u.author=gv(d),u.state=t.state===`MERGED`?`MERGED`:t.state===`DECLINED`?`DECLINED`:t.draft===!0?`DRAFT`:`OPEN`,u.created=I_(u,`created`,t.createdDate,`createdDate`),u.updated=I_(u,`updated`,t.updatedDate,`updatedDate`);let f=I_(u,`closedAt`,t.closedDate,`closedDate`);u.closedAt=u.state===`MERGED`||u.state===`DECLINED`?f:null,u.mergedAt=u.state===`MERGED`?f:null;let p=Y(t.properties)?t.properties:{};u.mergeCommit=u.state===`MERGED`&&Y(p.mergeCommit)?X(p.mergeCommit.id):null;let m=Y(p.mergeResult)?p.mergeResult.outcome:void 0;u.mergeable=m===`CLEAN`||m!==`CONFLICTED`&&null,u.mergeable===null&&u.state===`OPEN`&&F_(u,`mergeable`,`Bitbucket sent no properties.mergeResult outcome for it`),u.workItems=G_(hv(t,u.branch.source,t.description),n.changes.keys),mv(u,n),u.reviewers=(Array.isArray(t.reviewers)?t.reviewers.filter(Y):[]).flatMap(e=>{let t=gv(e.user);return t?[{person:t,state:_v[String(e.status)]??`PENDING`}]:[]});let h=L_(t);if(h.reviews)nv(u,h.reviews.filter(Y).flatMap(e=>{let t=gv(e.user),n=vv[String(e.action)],r=I_(u,`reviews`,e.createdDate,`an activity's createdDate`);return t&&n&&r?[{by:t,state:n,at:r}]:[]}));else for(let t of[`reviews`,`firstReviewAt`,`approvedAt`])F_(u,t,R_(e,`reviews`));return h.checks?rv(u,h.checks.filter(Y).map(e=>({name:X(e.name)??X(e.key)??`build`,outcome:yv[String(e.state)]??`pending`,at:I_(u,`checksAt`,e.dateAdded,`a build status's dateAdded`)}))):F_(u,`checks`,R_(e,`checks`)),h.files?(u.size={files:h.files.length,additions:null,deletions:null},F_(u,`size`,`Bitbucket Data Center lists the files a pull request changes, not the lines, so additions and deletions are empty`)):F_(u,`size`,R_(e,`files`)),$_(u,n,{account:Y(d)&&d.type===`SERVICE`?{kind:`BOT`,signal:`account ${String(d.name??d.slug)}, type SERVICE`}:null,messages:h.commits?iv(h.commits):null}),u}var xv=e=>Y(e)?__(e.account_id??e.uuid??e.nickname,e.display_name??e.nickname,null):null,Sv={SUCCESSFUL:`pass`,FAILED:`fail`,STOPPED:`fail`,INPROGRESS:`pending`};function Cv(e,t,n){let r=Y(t.destination)?t.destination:{},i=Y(t.source)?t.source:{},a=(Y(r.repository)?X(r.repository.full_name):null)??(e.inputs.workspace&&e.inputs.repo?`${e.inputs.workspace}/${e.inputs.repo}`:null);if(!a||t.id===void 0)return;let o=String(t.id),s=P_(e,a,o,X(t.title)??`Pull request ${o}`,t);s.url=Y(t.links)&&Y(t.links.html)?X(t.links.html.href):null,s.branch={source:Y(i.branch)?X(i.branch.name):null,target:Y(r.branch)?X(r.branch.name):null},s.author=xv(t.author),s.state=t.state===`MERGED`?`MERGED`:t.state===`DECLINED`||t.state===`SUPERSEDED`?`DECLINED`:t.draft===!0?`DRAFT`:`OPEN`,s.created=I_(s,`created`,t.created_on,`created_on`),s.updated=I_(s,`updated`,t.updated_on,`updated_on`),(s.state===`MERGED`||s.state===`DECLINED`)&&(F_(s,`mergedAt`,`Bitbucket Cloud's pull request records no merge or close time; updated is the nearest it has`),F_(s,`closedAt`,`Bitbucket Cloud's pull request records no merge or close time; updated is the nearest it has`)),s.mergeCommit=s.state===`MERGED`&&Y(t.merge_commit)?X(t.merge_commit.hash):null,(s.state===`OPEN`||s.state===`DRAFT`)&&F_(s,`mergeable`,`Bitbucket Cloud's pull request doesn't say whether it merges cleanly`);let c=X(t.description)??(Y(t.summary)?X(t.summary.raw):null);s.workItems=G_(hv(t,s.branch.source,c),n.changes.keys),mv(s,n);let l=new Map;for(let e of Array.isArray(t.reviewers)?t.reviewers:[]){let t=xv(e);t&&l.set(t.id,{person:t,state:`PENDING`})}for(let e of Array.isArray(t.participants)?t.participants.filter(Y):[]){let t=xv(e.user);t&&(e.role===`REVIEWER`||e.state)&&l.set(t.id,{person:t,state:e.state===`approved`||e.approved===!0?`APPROVED`:e.state===`changes_requested`?`CHANGES_REQUESTED`:`PENDING`})}s.reviewers=[...l.values()];let u=L_(t);if(u.reviews)nv(s,u.reviews.filter(Y).flatMap(e=>{let t=Y(e.approval)?{e:e.approval,kind:`APPROVED`}:Y(e.changes_requested)?{e:e.changes_requested,kind:`CHANGES_REQUESTED`}:null;if(!t)return[];let n=xv(t.e.user),r=I_(s,`reviews`,t.e.date,`an activity entry's date`);return n&&r?[{by:n,state:t.kind,at:r}]:[]}));else for(let t of[`reviews`,`firstReviewAt`,`approvedAt`])F_(s,t,R_(e,`reviews`));if(u.checks?rv(s,u.checks.filter(Y).map(e=>({name:X(e.name)??X(e.key)??`build`,outcome:Sv[String(e.state)]??`pending`,at:I_(s,`checksAt`,e.updated_on??e.created_on,`a status's updated_on`)}))):F_(s,`checks`,R_(e,`checks`)),u.files){let e=u.files.filter(Y);s.size={files:e.length,additions:e.reduce((e,t)=>e+(a_(t.lines_added)??0),0),deletions:e.reduce((e,t)=>e+(a_(t.lines_removed)??0),0)}}else F_(s,`size`,R_(e,`files`));let d=Y(t.author)?t.author:{};return $_(s,n,{account:d.type===`app_user`?{kind:`BOT`,signal:`account ${String(d.display_name??d.account_id)}, an app user`}:null,messages:u.commits?iv(u.commits):null}),s}var wv=[`Estimate`,`Size`,`Story Points`],Tv=`Status`,Ev={todo:`TODO`,"to do":`TODO`,backlog:`TODO`,ready:`TODO`,new:`TODO`,"in progress":`IN_PROGRESS`,doing:`IN_PROGRESS`,"in review":`IN_PROGRESS`,done:`DONE`},Dv=/^(?:story[ -]?points?|points?|pts|sp|estimate)\s*[:=/ -]\s*(\d+(?:\.\d+)?)$/i,Ov=`"points: N", "story points: N", "pts: N", "sp: N" or "estimate: N"`;function kv(e){let t=e.split(`{n}`);if(t.length!==2)throw new r_(`INVALID_INPUT`,`estimateLabel "${e}" must hold {n} exactly once, where the number is.`,{fix:`Write the label with {n} for the number, for example estimateLabel=points: {n} or estimateLabel=size/{n}.`});let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`^${n(t[0])}(\\d+(?:\\.\\d+)?)${n(t[1])}$`,`i`)}function Av(e){let t=a_(e.number);if(t===null)return;let n=X(e.html_url),r=n?/^https?:\/\/[^/]+(?:\/[^/]+)*?\/([^/]+)\/([^/]+)\/issues\/\d+$/.exec(n):null;if(r)return`${r[1]}/${r[2]}#${t}`;let i=X(e.repository_url),a=i?/\/repos\/([^/]+)\/([^/]+)$/.exec(i):null;return a?`${a[1]}/${a[2]}#${t}`:void 0}var jv=e=>{let t=typeof e==`string`?/\/repos\/([^/]+)\/([^/]+)\/issues\/(\d+)$/.exec(e):null;return t?`${t[1]}/${t[2]}#${t[3]}`:void 0},Mv=e=>Y(e)?__(e.login,e.name,e.email):null;function Nv(e){let t=Array.isArray(e)?e:Y(e)&&Array.isArray(e.issues)?e.issues:Y(e)&&typeof e.number==`number`?[e]:void 0;if(!t)return;let n=t.filter(Y),r=n.filter(e=>e.pull_request===void 0);return{issues:r,pulls:n.length-r.length}}function Pv(e,t,n){let r=Av(t);if(r===void 0)return;let i=d_(e,r,X(t.title)??``,{[e.command]:t});i.url=X(t.html_url),i.typeName=Y(t.type)?X(t.type.name):null,i.type=u_(i.typeName),t.type===void 0&&Z(i,`type`,`the record has no type field: this GitHub server doesn't have issue types`),typeof t.body==`string`&&(i.body={format:`markdown`,content:t.body}),i.status=X(t.state),i.statusCategory=i.status===`closed`?`DONE`:i.status===`open`?`TODO`:`UNKNOWN`,i.resolution=i.status===`closed`?X(t.state_reason):null,i.assignee=Array.isArray(t.assignees)&&t.assignees.length>0?Mv(t.assignees[0]):Mv(t.assignee),i.reporter=Mv(t.user),i.labels=(Array.isArray(t.labels)?t.labels:[]).flatMap(e=>typeof e==`string`?[e]:Y(e)&&typeof e.name==`string`?[e.name]:[]);let a=jv(t.parent_issue_url);a&&(i.parent=f_(e.connection,a)),Array.isArray(t.sub_issues)&&(i.children=t.sub_issues.flatMap(t=>Y(t)&&Av(t)?[f_(e.connection,Av(t))]:[])),p_(i,`created`,t.created_at,`created_at`),p_(i,`updated`,t.updated_at,`updated_at`),p_(i,`resolved`,t.closed_at,`closed_at`),Fv(i,n),i.links=Rv(e.connection,r,typeof t.body==`string`?t.body:``);let o=Y(t.issue_dependencies_summary)?t.issue_dependencies_summary:{},s=a_(o.total_blocked_by)??0,c=a_(o.total_blocking)??0;return s+c>0&&Z(i,`links`,`GitHub records ${s} blocked-by and ${c} blocking issue dependencies for this issue, which no toil command reads yet: only "Blocked by #n", "Depends on #n" and "Blocks #n" in the body are mapped`),i}function Fv(e,t){let n=t.fields.estimateLabel===void 0?Dv:kv(t.fields.estimateLabel),r=e.labels.flatMap(e=>{let t=n.exec(e.trim());return t?[{label:e,value:Number(t[1])}]:[]});r.length===1?e.estimate={value:r[0].value,unit:g_(t),field:`label:${r[0].label}`}:r.length>1&&Z(e,`estimate`,`${r.length} labels hold an estimate (${r.map(e=>`"${e.label}"`).join(`, `)}), so none was picked: keep one`)}var Iv=/\b(blocked by|depends on|blocks)\s*(?::\s*)?((?:[\w.-]+\/[\w.-]+)?#\d+(?:\s*(?:,|and|&)\s*(?:[\w.-]+\/[\w.-]+)?#\d+)*)/gi,Lv=/(?:([\w.-]+)\/([\w.-]+))?#(\d+)/g;function Rv(e,t,n){let r=t.slice(0,t.lastIndexOf(`#`)),i=n.replace(/```[\s\S]*?(?:```|$)/g,` `).replace(/`[^`\n]*`/g,` `),a=[];for(let n of i.matchAll(Iv)){let i=n[1].toLowerCase();for(let o of n[2].matchAll(Lv)){let n=`${o[1]?`${o[1]}/${o[2]}`:r}#${o[3]}`;if(n===t)continue;let s={type:`blocks`,direction:i===`blocks`?`outward`:`inward`,target:f_(e,n),name:i};a.some(e=>e.direction===s.direction&&e.target===s.target)||a.push(s)}}return a}function zv(e,t){for(let n of e)for(let e of[...n.links]){let r=e.type===`blocks`?t.get(e.target):void 0;if(!r)continue;let i=e.direction===`inward`?`outward`:`inward`;r.links.some(e=>e.type===`blocks`&&e.target===n.id&&e.direction===i)||r.links.push({type:`blocks`,direction:i,target:n.id,name:i===`outward`?`blocks`:`blocked by`})}}function Bv(e){let t=Y(e.milestone)?e.milestone:null,n=t?a_(t.number):null,r=t?X(t.title):null;return!t||n===null||r===null?null:{number:n,title:r,due:s_(t.due_on)??null,closed:t.state===`closed`}}function Vv(e,t){let n=t.fields.iterationDays===void 0?void 0:Number(t.fields.iterationDays),r=e=>`${e.source.connection}\u0000${e.source.key.slice(0,e.source.key.lastIndexOf(`#`))}`,i=new Map;for(let{item:t,issue:n}of e){let e=Bv(n);if(!e)continue;let a=i.get(r(t))??new Map;i.set(r(t),a),a.set(e.number,e)}let a=new Map;for(let[e,t]of i){let r=[...t.values()].filter(e=>e.due!==null).sort((e,t)=>e.due<t.due?-1:1);for(let i of t.values()){let t=null;if(i.due!==null){let e=n===void 0?r.filter(e=>e.due<i.due).at(-1):void 0;t=e?e.due:new Date(Date.parse(i.due)-(n??14)*864e5).toISOString()}a.set(`${e}\u0000${i.number}`,{id:String(i.number),name:i.title,path:null,start:t,end:i.due,state:i.closed?`past`:null})}}for(let{item:t,issue:n}of e){let e=Bv(n),i=e?a.get(`${r(t)}\u0000${e.number}`):void 0;i&&(t.iteration={...i})}}function Hv(e){if(!Array.isArray(e.data)||!e.data.every(e=>Y(e)&&`fieldValues`in e))return;let t=[],n=0;for(let r of e.data){let i=Y(r.content)?r.content:{},a=new Map;for(let e of Array.isArray(r.fieldValues)?r.fieldValues:[])Y(e)&&Y(e.field)&&typeof e.field.name==`string`&&a.set(e.field.name,e);if(r.type===`PULL_REQUEST`){n++;continue}if(r.type===`DRAFT_ISSUE`){typeof r.id==`string`&&t.push({key:`${e.inputs.owner??`project`}/draft/${r.id}`,item:r,values:a,draft:!0});continue}let o=Y(i.repository)?X(i.repository.nameWithOwner):null,s=a_(i.number);o&&s!==null&&t.push({key:`${o}#${s}`,item:r,values:a,draft:!1})}return{entries:t,pulls:n}}function Uv(e,t){let n=Y(t.item.content)?t.item.content:{},r=d_(e,t.key,X(n.title)??``,{});if(r.url=X(n.url),r.typeName=t.draft?`Draft issue`:null,r.status=t.draft?null:X(n.state)?.toLowerCase()??null,r.statusCategory=r.status===`closed`?`DONE`:`TODO`,p_(r,`created`,t.item.createdAt,`createdAt`),p_(r,`updated`,n.updatedAt??null,`updatedAt`),!t.draft)for(let e of[`type`,`assignee`,`reporter`,`labels`,`parent`])Z(r,e,`the board carries only the title, state and URL: add github issue get output for this issue to the input`);return r}function Wv(e,t,n,r){e.native[n.command]=t.item;let i=t.values.get(Tv),a=i?X(i.name):null;a!==null&&e.status!==`closed`&&(e.status=a,e.statusCategory=Ev[a.toLowerCase()]??h_(e,r,a,`a board status option of the project's own`));let o=r.fields.estimate,s=o??wv.find(e=>a_(t.values.get(e)?.number)!==null),c=s===void 0?null:a_(t.values.get(s)?.number);s!==void 0&&c!==null?(Gv(e,`estimate`),e.estimate={value:c,unit:g_(r),field:s}):e.estimate===null&&Z(e,`estimate`,`${o?`the board item has no number in "${o}" (fields estimate)`:`the board item has no number in a field named ${wv.map(e=>`"${e}"`).join(`, `)} (point fields estimate at the project's own)`}, and no label holds one (${Kv(r)})`);let l=(t,n)=>Z(e,n,`the board item has no value in "${t}": the field is empty, or the project has no field of that name (fields ${n})`),u=r.fields.iteration,d=u?t.values.get(u):[...t.values.values()].find(e=>e.__typename===`ProjectV2ItemFieldIterationValue`);if(d&&X(d.title)){Gv(e,`iteration`);let t=s_(d.startDate)??null,n=a_(d.duration),r=t&&n!==null?new Date(Date.parse(t)+n*864e5).toISOString():null;e.iteration={id:X(d.iterationId),name:d.title,path:null,start:t,end:r,state:null}}else e.iteration===null&&(u?l(u,`iteration`):Z(e,`iteration`,`the board item has no iteration value (it isn't in an iteration, or the project has no iteration field), and the issue has no milestone`));for(let n of[`priority`,`team`,`dueDate`]){let i=r.fields[n];if(i===void 0)continue;Gv(e,n);let a=t.values.get(i),o=a?X(a.name)??X(a.text)??X(a.date)??(a_(a.number)===null?null:String(a.number)):null;o===null?l(i,n):n===`dueDate`?m_(e,o,i):e[n]=o}if(r.fields.type!==void 0){let n=t.values.get(r.fields.type),i=n?X(n.name)??X(n.text):null;Gv(e,`type`),i?(e.typeName=i,e.type=u_(i)):l(r.fields.type,`type`)}}var Gv=(e,t)=>{e.unmapped=e.unmapped.filter(e=>e.field!==t)},Kv=e=>e.fields.estimateLabel===void 0?Ov:`"${e.fields.estimateLabel}" (fields estimateLabel)`;function qv(e,t){e.estimate===null&&Z(e,`estimate`,`no label holds an estimate (${Kv(t)}), and no project board covers the issue: label it, name the team's own label with fields estimateLabel, or add github project items output to the input`),e.iteration===null&&Z(e,`iteration`,`the issue has no milestone, and no project board covers it: set a milestone, or add github project items output to the input`);for(let n of[`priority`,`team`,`dueDate`,`type`])t.fields[n]!==void 0&&Z(e,n,`"${t.fields[n]}" is a project field: add github project items output to the input`)}function Jv(e){if(!Array.isArray(e.data))return;let t={transitions:[],iterations:[]};for(let n of e.data){if(!Y(n))continue;let e=s_(n.created_at);if(!e)continue;let r=Mv(n.actor);if(n.event===`closed`)t.transitions.push({from:`open`,to:`closed`,fromCategory:`TODO`,toCategory:`DONE`,at:e,by:r});else if(n.event===`reopened`)t.transitions.push({from:`closed`,to:`open`,fromCategory:`DONE`,toCategory:`TODO`,at:e,by:r});else if(n.event===`milestoned`||n.event===`demilestoned`){let i=Y(n.milestone)?X(n.milestone.title):null;if(i===null)continue;let a=n.event===`milestoned`?`to`:`from`,o=t.iterations.at(-1);o&&o.at===e&&o[a].length===0?o[a]=[i]:t.iterations.push({from:a===`from`?[i]:[],to:a===`to`?[i]:[],at:e,by:r})}}return t}function Yv(e){if(Array.isArray(e))return e.filter(Y);if(Y(e)&&typeof e.number==`number`)return[e]}var Xv={APPROVED:`APPROVED`,CHANGES_REQUESTED:`CHANGES_REQUESTED`,COMMENTED:`COMMENTED`,DISMISSED:`DISMISSED`},Zv=new Set([`failure`,`timed_out`,`cancelled`,`action_required`,`startup_failure`,`stale`]);function Qv(e){if(!Y(e))return null;let t=X(e.login)??``;return Z_.includes(t.toLowerCase())?{kind:`AGENT`,signal:`account ${t}, a coding agent's`}:e.type===`Bot`||t.endsWith(`[bot]`)?{kind:`BOT`,signal:`account ${t}, type Bot`}:null}function $v(e,t){let n=Y(e.base)&&Y(e.base.repo)?X(e.base.repo.full_name):null;if(n)return n;let{owner:r,repo:i}=t.inputs;return r&&i?`${r}/${i}`:null}function ey(e,t,n){let r=$v(t,e);if(!r||typeof t.number!=`number`)return;let i=String(t.number),a=P_(e,r,i,X(t.title)??`Pull request ${i}`,t);a.url=X(t.html_url),a.branch={source:Y(t.head)?X(t.head.ref):null,target:Y(t.base)?X(t.base.ref):null},a.author=Mv(t.user),a.state=X(t.merged_at)?`MERGED`:t.state===`closed`?`DECLINED`:t.draft===!0?`DRAFT`:`OPEN`,a.created=I_(a,`created`,t.created_at,`created_at`),a.updated=I_(a,`updated`,t.updated_at,`updated_at`),a.mergedAt=I_(a,`mergedAt`,t.merged_at,`merged_at`),a.closedAt=I_(a,`closedAt`,t.closed_at,`closed_at`),a.mergeCommit=a.state===`MERGED`?X(t.merge_commit_sha):null;let o=t=>[...[...t.matchAll(q_)].map(t=>f_(e.connection,`${r}#${t[1]}`)),...[...t.matchAll(/(?<![\w.-])([\w.-]+\/[\w.-]+)#(\d+)\b/g)].map(t=>f_(e.connection,`${t[1]}#${t[2]}`))],s=K_(a.branch.source);a.workItems=G_([a.title,s?`#${s}`:null,a.branch.source,X(t.body)],n.changes.keys,o).filter(e=>e!==a.id);let c=L_(t),l=Array.isArray(t.requested_reviewers)?t.requested_reviewers.flatMap(e=>Mv(e)?[Mv(e)]:[]):[],u=Array.isArray(t.requested_teams)?t.requested_teams.flatMap(e=>Y(e)&&X(e.slug)?[{id:`team:${X(e.slug)}`,name:X(e.name),email:null}]:[]):[],d=new Map;if(c.reviews){let e=[];for(let t of c.reviews){if(!Y(t))continue;let n=Mv(t.user),r=Xv[String(t.state)],i=I_(a,`reviews`,t.submitted_at,`a review's submitted_at`);n&&r&&i&&e.push({by:n,state:r,at:i})}nv(a,e);for(let e of a.reviews)e.state===`APPROVED`||e.state===`CHANGES_REQUESTED`?d.set(e.by.id,{person:e.by,state:e.state}):(e.state===`DISMISSED`||!d.has(e.by.id)&&e.by.id!==a.author?.id)&&d.set(e.by.id,{person:e.by,state:`PENDING`})}else F_(a,`reviews`,R_(e,`reviews`)),F_(a,`firstReviewAt`,R_(e,`reviews`)),F_(a,`approvedAt`,R_(e,`reviews`));for(let e of[...l,...u])d.set(e.id,{person:e,state:`PENDING`});a.reviewers=[...d.values()].filter(e=>e.person.id!==a.author?.id),c.checks?rv(a,c.checks.filter(Y).map(e=>({name:X(e.name)??`check`,outcome:e.status===`completed`?Zv.has(String(e.conclusion))?`fail`:`pass`:`pending`,at:I_(a,`checksAt`,e.completed_at??e.started_at,`a check run's completed_at`)}))):F_(a,`checks`,R_(e,`checks`)),typeof t.mergeable==`boolean`?a.mergeable=t.mergeable:(a.state===`OPEN`||a.state===`DRAFT`)&&F_(a,`mergeable`,e.command.endsWith(` pr list`)?`${e.command} doesn't say whether a pull request merges cleanly: map ${e.area} pr get`:`GitHub had not worked out mergeability yet (mergeable was null); read it again in a moment`);let f=c.files?.filter(Y),p=a_(t.additions)??(f?f.reduce((e,t)=>e+(a_(t.additions)??0),0):null),m=a_(t.deletions)??(f?f.reduce((e,t)=>e+(a_(t.deletions)??0),0):null),h=a_(t.changed_files)??(f?f.length:null);return p!==null||m!==null||h!==null?a.size={files:h,additions:p,deletions:m}:F_(a,`size`,`${e.command} doesn't say how big a pull request is: map ${e.area} pr get`),$_(a,n,{account:Qv(t.user),messages:c.commits?iv(c.commits):null}),a}var ty=[`Story Points`,`Story point estimate`],ny=`timeoriginalestimate`,ry=`Epic Link`,iy={new:`TODO`,indeterminate:`IN_PROGRESS`,done:`DONE`};function ay(e){if(Y(e)&&Array.isArray(e.issues))return e.issues.filter(Y);if(Y(e)&&typeof e.key==`string`&&Y(e.fields))return[e]}function oy(e,t){let n=e.fields??{};if(t in n)return t;if(Y(e.names)){for(let[r,i]of Object.entries(e.names))if(i===t&&r in n)return r}}var sy=e=>Y(e)?__(e.accountId??e.name??e.key,e.displayName,e.emailAddress):null;function cy(e){let t;if(Y(e))t=e;else if(typeof e==`string`){let n=/\[(.*)\]\s*$/s.exec(e)?.[1];if(n===void 0)return;t={};for(let e of n.split(/,(?=[A-Za-z]+=)/)){let n=e.indexOf(`=`);n>0&&(t[e.slice(0,n)]=e.slice(n+1)===`<null>`?null:e.slice(n+1))}}let n=X(t?.name);if(!t||n===null)return;let r=String(t.state??``).toLowerCase();return{id:t.id===void 0||t.id===null?null:String(t.id),name:n,path:null,start:s_(t.startDate)??null,end:s_(t.endDate)??null,state:r===`active`?`current`:r===`closed`?`past`:r===`future`?`future`:null}}var ly={blocks:`blocks`,duplicate:`duplicates`,relates:`relates`};function uy(e,t,n,r){let i=X(t.key);if(i===null)return;let a=t.fields??{},o=d_(e,i,X(a.summary)??``,{[e.command]:t});X(a.summary)===null&&Z(o,`title`,`the record has no summary`);let s=X(t.self);s?.includes(`/rest/`)?o.url=`${s.slice(0,s.indexOf(`/rest/`))}/browse/${encodeURIComponent(i)}`:Z(o,`url`,`the record has no self link to take the site from`);let c=n.fields.type,l=c===void 0?Y(a.issuetype)?X(a.issuetype.name):null:o_(a[c]);if(c!==void 0&&!(c in a)&&Z(o,`type`,`the record has no field "${c}" (fields type)`),o.typeName=l,o.type=c===void 0&&Y(a.issuetype)&&a.issuetype.subtask===!0?`TASK`:u_(l),typeof a.description==`string`?o.body={format:`wiki`,content:a.description}:Y(a.description)&&(o.body={format:`adf`,content:a.description}),Y(a.status)){o.status=X(a.status.name);let e=Y(a.status.statusCategory)?X(a.status.statusCategory.key):null,t=e===null?void 0:iy[e];t&&o.status&&r.set(o.status,t),o.statusCategory=t??h_(o,n,o.status??`(none)`,e===null?`the status came without its statusCategory`:`its statusCategory is "${e}"`)}else Z(o,`status`,`the record has no status field`);o.resolution=Y(a.resolution)?X(a.resolution.name):null,o.assignee=sy(a.assignee),o.reporter=sy(a.reporter);let u=n.fields.priority??`priority`;o.priority=o_(a[u]),n.fields.priority!==void 0&&!(u in a)&&Z(o,`priority`,`the record has no field "${u}" (fields priority)`),o.labels=Array.isArray(a.labels)?a.labels.filter(e=>typeof e==`string`):[],n.fields.team!==void 0&&(n.fields.team in a?o.team=o_(a[n.fields.team]):Z(o,`team`,`the record has no field "${n.fields.team}" (fields team)`)),dy(o,t,n),fy(o,t,n);let d=Y(a.parent)?X(a.parent.key):X(a[oy(t,ry)??ry])??null;o.parent=d===null?null:f_(e.connection,d),o.children=(Array.isArray(a.subtasks)?a.subtasks:[]).flatMap(t=>Y(t)&&typeof t.key==`string`?[f_(e.connection,t.key)]:[]);for(let t of Array.isArray(a.issuelinks)?a.issuelinks:[]){if(!Y(t)||!Y(t.type))continue;let n=Y(t.outwardIssue)?X(t.outwardIssue.key):null,r=Y(t.inwardIssue)?X(t.inwardIssue.key):null,i=n??r;i!==null&&o.links.push({type:ly[String(t.type.name??``).toLowerCase()]??`other`,direction:n===null?`inward`:`outward`,target:f_(e.connection,i),name:X(n===null?t.type.inward:t.type.outward)??X(t.type.name)??``})}p_(o,`created`,a.created,`created`),p_(o,`updated`,a.updated,`updated`),p_(o,`resolved`,a.resolutiondate,`resolutiondate`);let f=n.fields.dueDate??`duedate`;return n.fields.dueDate!==void 0&&!(f in a)?Z(o,`dueDate`,`the record has no field "${f}" (fields dueDate)`):m_(o,a[f],f),`created`in a||Z(o,`created`,`the record has no created field`),o}function dy(e,t,n){let r=t.fields??{},i=n.fields.estimate;if(i!==void 0){let a=oy(t,i);if(a===void 0)return Z(e,`estimate`,`the record has no field "${i}" (fields estimate)`);let o=a_(r[a]);if(o===null){r[a]!==null&&r[a]!==void 0&&Z(e,`estimate`,`"${i}" holds ${JSON.stringify(r[a])}, not a number`);return}if(a===`timeoriginalestimate`){if(n.fields.estimateUnit!==void 0&&n.fields.estimateUnit!==`hours`)return Z(e,`estimate`,`${ny} is in seconds, which OWI reads as hours, not ${n.fields.estimateUnit}`);e.estimate={value:o/3600,unit:`hours`,field:a}}else e.estimate={value:o,unit:g_(n),field:a};return}let a=!1;for(let n of ty){let i=oy(t,n);if(i===void 0)continue;a=!0;let o=a_(r[i]);if(o!==null)return void(e.estimate={value:o,unit:`points`,field:i})}if(`timeoriginalestimate`in r){a=!0;let t=a_(r[ny]);if(t!==null)return void(e.estimate={value:t/3600,unit:`hours`,field:ny})}a||Z(e,`estimate`,`the record has none of ${[...ty,ny].map(e=>`"${e}"`).join(`, `)}: register the estimate field in the connection's customFields, ask for it with --fields, or point fields estimate at it`)}function fy(e,t,n){let r=n.fields.iteration??`Sprint`,i=oy(t,r);if(i===void 0){Z(e,`iteration`,`the record has no "${r}" field: register the sprint field in the connection's customFields, or point fields iteration at it`);return}let a=t.fields?.[i],o=(a==null?[]:Array.isArray(a)?a:[a]).map(cy);o.some(e=>e===void 0)&&Z(e,`iteration`,`"${i}" holds a value that isn't a sprint`),e.iteration=v_(o.filter(e=>e!==void 0))}function py(e,t,n){if(!Array.isArray(e.data))return;let r=t.fields.iteration??`Sprint`,i={transitions:[],iterations:[]};for(let t of e.data){if(!Y(t)||!Array.isArray(t.items))continue;let e=s_(t.created);if(!e)continue;let a=sy(t.author);for(let o of t.items){if(!Y(o))continue;let t=String(o.field??``),s=Object.hasOwn(o,`toString`)?X(o.toString):null;if(t.toLowerCase()===`status`&&s!==null){let t=X(o.fromString),r=s;i.transitions.push({from:t,to:r,fromCategory:t===null?null:n(t)??`UNKNOWN`,toCategory:n(r)??`UNKNOWN`,at:e,by:a})}else if(t===r||o.fieldId===r){let t=e=>(X(e)??``).split(`,`).map(e=>e.trim()).filter(Boolean);i.iterations.push({from:t(o.fromString),to:t(s),at:e,by:a})}}}return i}var my=5e3,hy=Object.fromEntries(Object.entries($g).map(([e,t])=>[e,{items:t.items.map(t=>`${e} ${t}`),history:t.history.map(t=>`${e} ${t}`),context:t.context.map(t=>`${e} ${t}`),changes:t.changes.map(t=>`${e} ${t}`)}])),gy={jira:()=>`Jira's changelog names statuses only, and a status no item in the input is in has no category to learn`,ado:e=>`a state in the revisions is a custom one, outside the default states OWI knows; ${e} work-item states shows its category`,github:()=>`GitHub issues are only open or closed, so this should not happen; the history is kept as it was read`,bitbucket:()=>`Bitbucket has no work items, so this should not happen`,"bitbucket-cloud":()=>`Bitbucket has no work items, so this should not happen`},_y=Object.fromEntries(Object.entries($g).filter(([,e])=>e.family===`ado`).map(([e])=>[`${e} work-item search`,`it returns work item ids only: fetch their fields with ${e} work-item get-many and map that`])),vy=e=>Y(e)&&`ok`in e&&Y(e.meta)&&typeof e.meta.command==`string`;function yy(e){let t=e.trim();if(t===``)throw new r_(`INVALID_INPUT`,`The input is empty.`,{fix:`Pipe a toil command's output in (toil jira issue search … | toil util owi map), or pass the file that holds it.`});try{return by(JSON.parse(t))}catch{}return t.split(/\r?\n/).flatMap((e,t)=>{if(e.trim()===``)return[];try{return[JSON.parse(e)]}catch(e){throw new r_(`INVALID_INPUT`,`Line ${t+1} of the input isn't JSON (${e.message}), and the input as a whole isn't one JSON value either.`,{fix:`Pass one envelope, a JSON array of envelopes, or one envelope a line.`})}})}function by(e){return Array.isArray(e)&&e.length>0&&e.every(e=>vy(e)||xy(e))?e:[e]}var xy=e=>Y(e)&&typeof e.key==`string`&&`history`in e&&Object.keys(e).length===2;function Sy(e,t={}){let n=[],r=[];return e.forEach((e,i)=>{let a=`document ${i+1}`,o=xy(e)?e:void 0,s=o?o.history:e,c=o?.key??t.key,l,u,d,f={};if(vy(s)){if(l=s.meta.command,s.ok!==!0){let e=Y(s.error)?X(s.error.code):null;r.push({at:a,command:l,reason:`the call failed${e?` (${e})`:``}, so there is nothing to map`});return}u=s.data;let e=Y(s.meta.context)?s.meta.context:{};if(d=Y(e.connection)?X(e.connection.value)??void 0:void 0,Y(e.inputs))for(let[t,n]of Object.entries(e.inputs))Y(n)&&typeof n.value==`string`&&(f[t]=n.value)}else if(t.command!==void 0)l=t.command,u=s;else throw new r_(`INVALID_INPUT`,`${a} of the input isn't a toil envelope, so it doesn't say which command it came from.`,{fix:`Pass the whole envelope a command printed, or name the command with --command (for example --command "jira issue search") when passing its data alone.`});let p=[...e_].sort((e,t)=>t.length-e.length).find(e=>l.startsWith(`${e} `)),m=p?hy[p]:void 0;if(!p||!m||![...m.items,...m.history,...m.context,...m.changes].includes(l)){if(_y[l]){r.push({at:a,command:l,reason:_y[l]});return}let e=Object.values(hy).flatMap(e=>[...e.items,...e.history,...e.context,...e.changes]);throw new r_(`INVALID_INPUT`,`${a} is the output of "${l}", which OWI doesn't map.`,{fix:`Map the output of one of: ${e.join(`, `)}.`})}n.push({area:p,command:l,connection:d??p,data:u,inputs:f,at:a,...c===void 0?{}:{key:c}})}),{documents:n,skipped:r}}function Cy(e){let t=Array.isArray(e)?e.map(e=>{let t=e.indexOf(`=`);if(t<=0||t===e.length-1)throw new r_(`INVALID_INPUT`,`"${e}" isn't a field override.`,{fix:`Write it as name=field, for example estimate=customfield_10234 or estimateUnit=hours.`});return[e.slice(0,t),e.slice(t+1)]}):Object.entries(e??{}),n={};for(let[e,r]of t){if(!t_.includes(e))throw new r_(`INVALID_INPUT`,`"${e}" isn't an OWI field that can be pointed at a field of your own.`,{fix:`Use one of: ${t_.join(`, `)}.`});if(e===`estimateUnit`&&![`points`,`hours`,`days`].includes(r))throw new r_(`INVALID_INPUT`,`estimateUnit must be points, hours or days, not "${r}".`,{fix:`Pass estimateUnit=points, estimateUnit=hours or estimateUnit=days.`});if(e===`estimateLabel`&&kv(r),e===`iterationDays`&&!(/^\d+$/.test(r)&&Number(r)>=1&&Number(r)<=366))throw new r_(`INVALID_INPUT`,`iterationDays must be a whole number of days from 1 to 366, not "${r}".`,{fix:`Pass the sprint length in days, for example iterationDays=14.`});n[e]=r}return n}function wy(e,t={}){let n=i_(),r={fields:t.fields??{},warn:n.warn},i=[...t.skipped??[]],a=new Map,o=0,s=0,c=(e,t)=>{if(!e)return void i.push({at:t.at,command:t.command,reason:`a record has no key to name the item by`});let n=a.get(e.id);n&&(o++,e.native={...n.native,...e.native}),a.set(e.id,e)},l=e=>t=>hy[t.area]?.[e].includes(t.command)===!0,u=e.filter(l(`items`)),d=e.filter(l(`history`)),f=e.filter(l(`context`)),p=new Map;for(let e of f){let t=p.get(e.connection)??new Map;p.set(e.connection,t),k_(e.data,t)||i.push({at:e.at,command:e.command,reason:`it doesn't hold an iteration tree`})}let m=new Map,h=[],g=[];for(let e of u){let t=$g[e.area].family;if(t===`jira`){let t=ay(e.data);t||i.push({at:e.at,command:e.command,reason:`it doesn't hold Jira issues`});let n=m.get(e.connection)??new Map;m.set(e.connection,n);for(let i of t??[])c(uy(e,i,r,n),e)}else if(t===`ado`){let t=T_(e.data);t||i.push({at:e.at,command:e.command,reason:`it doesn't hold work items`});for(let n of t??[])c(A_(e,n,r,p.get(e.connection)??new Map),e)}else if(e.command===`${e.area} project items`){let t=Hv(e);t?(h.push({doc:e,entries:t.entries}),s+=t.pulls):i.push({at:e.at,command:e.command,reason:`it doesn't hold project items`})}else{let t=Nv(e.data);t||i.push({at:e.at,command:e.command,reason:`it doesn't hold GitHub issues`}),s+=t?.pulls??0;for(let n of t?.issues??[]){let t=Pv(e,n,r);c(t,e),t&&g.push({item:t,issue:n})}}}Vv(g,r);let _=new Set;for(let{doc:e,entries:t}of h)for(let n of t){let t=f_(e.connection,n.key);_.add(t);let i=a.get(t);i||(i=Uv(e,n),a.set(t,i)),Wv(i,n,e,r)}for(let e of a.values())$g[e.source.area]?.family===`github`&&!_.has(e.id)&&qv(e,r);zv(g.map(e=>e.item).filter(e=>a.get(e.id)===e),a);let v=[],y=(e,t,n)=>{let r=f_(e.connection,t),i=a.get(r);if(!i)return void v.push({id:r,history:n});i.history=i.history?{transitions:[...i.history.transitions,...n.transitions],iterations:[...i.history.iterations,...n.iterations]}:n,i.native[e.command]=e.data};for(let e of d){let t=$g[e.area].family;if(t===`ado`){let t=N_(e,r);t||i.push({at:e.at,command:e.command,reason:`it doesn't hold revisions`});for(let[n,r]of t??[])y(e,n,r);continue}let n=Ey(e);if(n===void 0){i.push({at:e.at,command:e.command,reason:`its output doesn't say which ${t===`github`?`issue`:`issue key`} it belongs to: wrap it as { "key": "…", "history": <envelope> }, or pass --key`});continue}let a=m.get(e.connection)??new Map,o=t===`github`?Jv(e):py(e,r,e=>a.get(e));o?y(e,n,o):i.push({at:e.at,command:e.command,reason:`it doesn't hold a history`})}for(let e of a.values())e.history?.transitions.some(e=>e.toCategory===`UNKNOWN`||e.fromCategory===`UNKNOWN`)&&Z(e,`history.transitions`,`some statuses in the history have no category: ${gy[$g[e.source.area]?.family??`jira`](e.source.area)}`);let b=Ty(e.filter(l(`changes`)),{...r,changes:{keys:t.keys??[],authors:t.authors??{}}},i);o>0&&n.warn(`OWI_DUPLICATE_ITEM`,`${o} records named an item already in the input; the later record was kept, and native holds both.`),s>0&&n.warn(`OWI_PULL_REQUESTS_SKIPPED`,`${s} pull requests in issue lists or boards were left out: an issue list holds too little of a pull request to map it as a change; map github pr list or github pr get for those.`);let x=[...a.values()];x.length>5e3&&(n.warn(`OWI_ITEMS_CAPPED`,`The input holds ${x.length} items; the first ${my} were mapped and ${x.length-my} left out. Map the rest in another call.`),x=x.slice(0,my));for(let e of i)n.warn(`OWI_SKIPPED`,`${e.at}${e.command?` (${e.command})`:``} wasn't mapped: ${e.reason}.`);let S=b;return S.length>5e3&&(n.warn(`OWI_ITEMS_CAPPED`,`The input holds ${S.length} changes; the first ${my} were mapped and ${S.length-my} left out. Map the rest in another call.`),S=S.slice(0,my)),{items:x,changes:S,histories:v,skipped:i,warnings:n.list}}function Ty(e,t,n){let r=new Map;for(let i of e){let e=$g[i.area].family,a=e===`github`?Yv(i.data):e===`ado`?ov(i.data):pv(i.data);if(!a)n.push({at:i.at,command:i.command,reason:`it doesn't hold pull requests`});else for(let o of a){let a=e===`github`?ey(i,o,t):e===`ado`?fv(i,o,t):e===`bitbucket-cloud`?Cv(i,o,t):bv(i,o,t);if(!a){n.push({at:i.at,command:i.command,reason:`a pull request has no number or repository to name it by`});continue}let s=r.get(a.id);r.set(a.id,s?av(s,a):a)}}for(let e of r.values())e.workItems=e.workItems.filter(e=>!r.has(e));return[...r.values()]}function Ey(e){let t=e.key?.trim();if(!t)return;if($g[e.area]?.family!==`github`||t.includes(`/`))return t;let n=t.replace(/^#/,``),{owner:r,repo:i}=e.inputs;return r&&i&&/^\d+$/.test(n)?`${r}/${i}#${n}`:void 0}var Dy=[`title`,`body`,`labels`,`parent`,`links`],Oy=.35,ky=new Set(`a about above after again all also am an and any are as at be been before being below between both but by can could did do does doing down during each few for from further had has have having he her here hers him his how i if in into is it its itself just me more most my no nor not now of off on once only or other our ours out over own same she should so some such than that the their theirs them then there these they this those through to too under until up very was we were what when where which while who whom why will with would you your yours see per via etc get got`.split(` `)),Ay=/[\p{L}\p{N}]+/gu,jy=/\p{M}+/gu;function My(e){return e.length<=3||/^\d/.test(e)?e:e.endsWith(`ies`)&&e.length>4?`${e.slice(0,-3)}y`:e.endsWith(`sses`)?e.slice(0,-2):e.endsWith(`ing`)&&e.length>5?e.slice(0,-3):e.endsWith(`ed`)&&e.length>4?e.slice(0,-2):e.endsWith(`s`)&&!/(ss|us|is)$/.test(e)?e.slice(0,-1):e}function Ny(e){return e.normalize(`NFKD`).replace(jy,``).toLowerCase().match(Ay)??[]}var Py=e=>e.length>=2&&!ky.has(e)&&!/^\d{1,2}$/.test(e);function Fy(e){let t=[];for(let n of Ny(e))Py(n)&&t.push({term:My(n),word:n});return t}function Iy(e){let t=new Set;for(let n of Ny(e)){if(!Py(n))continue;let e=` ${n} `;for(let n=0;n+3<=e.length;n++)t.add(e.slice(n,n+3))}return t}var Ly={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:` `,"#39":`'`};function Ry(e){if(!e)return``;if(e.format===`adf`||typeof e.content!=`string`)return zy(e.content);let t=e.content;return t=e.format===`html`?t.replace(/<[^<>]*>/g,` `).replace(/&(amp|lt|gt|quot|apos|nbsp|#39);/g,(e,t)=>Ly[t]??` `):e.format===`wiki`?t.replace(/\[([^|[\]]*)\|[^[\]]*\]/g,`$1`).replace(/\{[A-Za-z]+(?::[^{}]*)?\}/g,` `).replace(/^h[1-6]\.\s/gm,` `):t.replace(/!?\[([^[\]]*)\]\([^()]*\)/g,`$1`).replace(/<[^<>]*>/g,` `),t.replace(/(?<![A-Za-z0-9+.-])[A-Za-z][A-Za-z0-9+.-]*:\/\/\S*/g,` `)}function zy(e){let t=[],n=[e];for(;n.length;){let e=n.pop();if(Array.isArray(e)){for(let t=e.length-1;t>=0;t--)n.push(e[t]);continue}if(typeof e!=`object`||!e)continue;let r=e;typeof r.text==`string`?t.push(r.text):typeof r.attrs?.text==`string`&&t.push(r.attrs.text),Array.isArray(r.content)&&n.push(r.content)}return t.join(` `)}var By=1.2,Vy=.75,Hy=2,Uy=.7,Wy=.7,Gy=.3,Ky=.04,qy=.08,Jy=.05,Yy=.1,Xy=6e7,Zy=8,Qy=.15,$y=e=>Math.round(e*1e4)/1e4,eb=(e,t)=>e<t?-1:+(e>t),tb=class{fields;docs=[];byId=new Map;df=new Map;labelDf=new Map;on;avgTitle;avgBody;duplicateIds=[];constructor(e,t={}){this.fields=t.fields&&t.fields.length?Dy.filter(e=>t.fields.includes(e)):Dy,this.on=Object.fromEntries(Dy.map(e=>[e,this.fields.includes(e)]));let n=new Set,r=[];for(let t of e)n.has(t.id)?this.duplicateIds.includes(t.id)||this.duplicateIds.push(t.id):(n.add(t.id),r.push(t));r.sort((e,t)=>eb(e.id,t.id));let i=0,a=0;for(let e of r){let t=this.read(e);this.byId.set(e.id,this.docs.length),this.docs.push(t),i+=t.titleLength,a+=t.bodyLength;for(let e of new Set([...t.title.keys(),...t.body.keys()]))this.df.set(e,(this.df.get(e)??0)+1);for(let e of t.labels)this.labelDf.set(e,(this.labelDf.get(e)??0)+1)}let o=this.docs.filter(e=>e.hasBody).length;this.avgTitle=i/(this.docs.length||1)||1,this.avgBody=o?a/o:1;for(let e of this.docs)this.weigh(e)}get size(){return this.docs.length}titleOnlyIds(){return this.on.body?this.docs.filter(e=>!e.hasBody).map(e=>e.ref.id):[]}cutBodyIds(){return this.docs.filter(e=>e.bodyCut).map(e=>e.ref.id)}has(e){return this.byId.has(e)}ref(e){let t=this.byId.get(e);return t===void 0?void 0:this.docs[t].ref}ids(){return this.docs.map(e=>e.ref.id)}query(e,t={}){let n={terms:new Map,trigrams:this.on.title?Iy(e):new Set};for(let{term:t,word:r}of Fy(e))n.terms.has(t)||n.terms.set(t,r);return this.rank(this.docs,(e,t)=>this.scoreQuery(n,e,t),t)}item(e,t={}){let n=this.byId.get(e);if(n===void 0)return;let r=this.docs[n];return this.rank(this.docs.filter(e=>e!==r),(e,t)=>this.scorePair(r,e,t),t)}compare(e,t){let n=this.byId.get(e),r=this.byId.get(t);if(n===void 0||r===void 0||n===r)return;let i=this.scorePair(this.docs[n],this.docs[r],!0);return{score:i.score,why:i.why}}pairs(e={},t={}){let n=lb(e.threshold),r=ub(e.limit),i=this.docs.length,a=new Map,o=(e,t,n,r)=>{let i=a.get(e);i||a.set(e,i={docs:[],...n?{full:[],title:[]}:{},...r===void 0?{}:{label:r}}),i.docs.push(t),n&&(i.full.push(n.full),i.title.push(n.title))};this.docs.forEach((e,t)=>{for(let[n,r]of e.full)o(`t\u0000${n}`,t,{full:r,title:e.titleOnly.get(n)??0});for(let n of e.trigrams)o(`g\u0000${n}`,t);for(let n of e.labels)o(`l\u0000${n}`,t,void 0,this.labelWeight(n));e.parent!==null&&o(`p\u0000${e.parent}`,t)});let s=[...a.entries()].filter(([,e])=>e.docs.length>1).sort((e,t)=>e[1].docs.length-t[1].docs.length||eb(e[0],t[0])),c=0,l=0;for(let[,e]of s){let t=e.docs.length*e.docs.length;if(c+t>Xy)break;c+=t,l++}let u=s.length-l,d=l?s[l-1][1].docs.length:0,f=this.docs.map(()=>[]);for(let[e,t]of s.slice(0,l))t.docs.forEach((n,r)=>f[n].push({p:t,at:r,kind:e[0]}));let p=this.docs.map(()=>[]);this.on.links&&this.docs.forEach((e,t)=>{for(let n of e.links){let e=this.byId.get(n.target);e!==void 0&&e!==t&&p[Math.min(t,e)].push(Math.max(t,e))}});let m=new Float64Array(i),h=new Float64Array(i),g=new Int32Array(i),_=new Float64Array(i),v=new Uint8Array(i),y=new Int32Array(i).fill(-1),b=u>0,x=[],S=0,C=0,w=(e,t,n,i)=>{if(x.length===r&&!ib(e,t,n,x[x.length-1]))return;let a=x.length;for(;a>0&&ib(e,t,n,x[a-1]);)a--;x.splice(a,0,{score:e,i:t,j:n,full:i}),x.length>r&&x.pop()};for(let e=0;e<i;e++){let t=[],r=n=>{y[n]!==e&&(y[n]=e,m[n]=0,h[n]=0,g[n]=0,_[n]=0,v[n]=0,t.push(n))};for(let{p:t,at:n,kind:i}of f[e]){let{docs:e}=t;if(i===`t`){let i=t.full,a=t.title,o=i[n],s=a[n];for(let t=n+1;t<e.length;t++){let n=e[t];r(n),m[n]=m[n]+o*i[t],h[n]=h[n]+s*a[t]}}else for(let a=n+1;a<e.length;a++){let n=e[a];r(n),i===`g`?g[n]=g[n]+1:i===`l`?_[n]=_[n]+t.label:v[n]=v[n]|1}}for(let t of p[e])r(t),v[t]=v[t]|2;let i=this.docs[e];for(let r of t){C++;let t=this.docs[r],a=!(this.on.body&&i.hasBody&&t.hasBody),o=a?i.titleNorm*t.titleNorm:i.fullNorm*t.fullNorm,s=o>0?(a?h[r]:m[r])/o:0,c=i.trigrams.size+t.trigrams.size,l=c?2*g[r]/c:0,u=ob(this.weighParts(s,l,Math.min(qy,_[r]),v[r]&1?Jy:0,v[r]&2?Yy:0)),d=!1;b&&u<n&&u>=n-Qy&&(u=this.scorePair(i,t).score,d=!0),!(u<n)&&(S++,w(u,e,r,d))}}let T=x.map(({i:e,j:n,score:r,full:i})=>{let a=this.scorePair(this.docs[e],this.docs[n],!0);return t.rescored?.({a:this.docs[e].ref.id,b:this.docs[n].ref.id,summed:r,full:a.score,exact:i||!b}),{score:a.score,a:this.docs[e].ref,b:this.docs[n].ref,why:a.why}}).filter(e=>e.score>=n).sort((e,t)=>t.score-e.score||eb(e.a.id,t.a.id)||eb(e.b.id,t.b.id));return{count:S,pairs:T,search:{compared:C,skippedFeatures:u,maxItemsPerFeature:u?d:null}}}labelWeight(e){return Ky*(1-(this.labelDf.get(e)??0)/(this.docs.length||1))}read(e){let t=new Map,n=new Map,r=new Map,i=(e,t)=>{let n=r.get(e);(n===void 0||t.length<n.length||t.length===n.length&&t<n)&&r.set(e,t)},a=0;if(this.on.title)for(let{term:n,word:r}of Fy(e.title))t.set(n,(t.get(n)??0)+1),i(n,r),a++;let o=0,s=!1;if(this.on.body)for(let{term:t,word:r}of Fy(Ry(e.body))){if(o===5e3){s=!0;break}n.set(t,(n.get(t)??0)+1),i(t,r),o++}return{ref:{id:e.id,title:e.title,source:e.source??null,url:e.url??null},title:t,body:n,surface:r,titleLength:a,bodyLength:o,hasBody:o>0,bodyCut:s,trigrams:this.on.title?Iy(e.title):new Set,labels:this.on.labels?[...new Set(e.labels??[])].sort(eb):[],parent:this.on.parent?e.parent??null:null,links:this.on.links?e.links??[]:[],full:new Map,fullNorm:0,titleOnly:new Map,titleNorm:0}}idf(e){let t=this.docs.length,n=this.df.get(e)??0;return Math.log(1+(t-n+.5)/(n+.5))}weigh(e){let t=t=>nb(t,e.titleLength,this.avgTitle),n=t=>nb(t,e.bodyLength,this.avgBody),r=0,i=0;for(let[n,r]of e.title){let a=this.idf(n)*t(r);e.titleOnly.set(n,a),i+=a*a}for(let i of new Set([...e.title.keys(),...e.body.keys()])){let a=e.title.get(i),o=e.body.get(i),s=this.idf(i)*(Hy*(a?t(a):0)+(o?n(o):0));e.full.set(i,s),r+=s*s}e.fullNorm=Math.sqrt(r),e.titleNorm=Math.sqrt(i)}scorePair(e,t,n=!1){let[r,i]=eb(e.ref.id,t.ref.id)<=0?[e,t]:[t,e],a=!(this.on.body&&r.hasBody&&i.hasBody),o=a?r.titleOnly:r.full,s=a?i.titleOnly:i.full,c=a?r.titleNorm*i.titleNorm:r.fullNorm*i.fullNorm,l=[],u=0;for(let[e,t]of o){let a=s.get(e);if(a===void 0)continue;let o=t*a;u+=o,n&&l.push({term:e,weight:o,title:r.title.has(e)&&i.title.has(e)})}let d=c>0?u/c:0,f=this.on.title?rb(r.trigrams,i.trigrams):0,p=r.labels.filter(e=>i.labels.includes(e)),m=Math.min(qy,p.reduce((e,t)=>e+this.labelWeight(t),0)),h=r.parent!==null&&r.parent===i.parent?r.parent:null,g=ab(e,t),_=this.weighParts(d,f,m,h?Jy:0,g?Yy:0),v=ob(_);if(!n)return{score:v};let y=e=>{let t=r.surface.get(e),n=i.surface.get(e);return t.length<n.length||t.length===n.length&&t<=n?t:n},b=l.sort((e,t)=>t.weight-e.weight||eb(e.term,t.term));return{score:v,why:this.explain({titleTerms:b.filter(e=>e.title).slice(0,Zy).map(e=>y(e.term)),bodyTerms:b.filter(e=>!e.title).slice(0,Zy).map(e=>y(e.term)),trigram:f,labels:p,parent:h,link:g,titleOnly:a,parts:_})}}scoreQuery(e,t,n=!1){let r=0,i=0,a=[];for(let[o,s]of e.terms){let e=this.idf(o);i+=e;let c=t.title.has(o)?Math.min(1,nb(t.title.get(o),t.titleLength,this.avgTitle)):0,l=t.body.has(o)?Uy*Math.min(1,nb(t.body.get(o),t.bodyLength,this.avgBody)):0,u=Math.max(c,l);u!==0&&(r+=e*u,n&&a.push({term:s,weight:e*u,title:c>=l}))}let o=i>0?r/i:0,s=this.on.title?rb(e.trigrams,t.trigrams):0,c=this.weighParts(o,s,0,0,0),l=ob(c);if(!n)return{score:l};let u=a.sort((e,t)=>t.weight-e.weight||eb(e.term,t.term));return{score:l,why:this.explain({titleTerms:u.filter(e=>e.title).slice(0,Zy).map(e=>e.term),bodyTerms:u.filter(e=>!e.title).slice(0,Zy).map(e=>e.term),trigram:s,labels:[],parent:null,link:null,titleOnly:this.on.body&&!t.hasBody,parts:c})}}weighParts(e,t,n,r,i){let a=this.on.title?Wy:1,o=this.on.title?Gy:0;return{terms:a*e,trigram:o*t,labels:n,parent:r,link:i}}explain(e){let t={terms:$y(e.parts.terms),trigram:$y(e.parts.trigram),labels:$y(e.parts.labels),parent:$y(e.parts.parent),link:$y(e.parts.link)},n={...e,trigram:$y(e.trigram),parts:t};return{summary:cb(n),...n}}rank(e,t,n){let r=lb(n.threshold),i=ub(n.limit),a=e.map(e=>({doc:e,score:t(e).score})).filter(e=>e.score>=r).sort((e,t)=>t.score-e.score||eb(e.doc.ref.id,t.doc.ref.id));return{count:a.length,matches:a.slice(0,i).map(({doc:e})=>{let n=t(e,!0);return{...e.ref,score:n.score,why:n.why}})}}};function nb(e,t,n){return e*2.2/(e+By*(.25+Vy*t/n))}function rb(e,t){if(!e.size||!t.size)return 0;let[n,r]=e.size<=t.size?[e,t]:[t,e],i=0;for(let e of n)r.has(e)&&i++;return 2*i/(e.size+t.size)}function ib(e,t,n,r){return e>r.score||e===r.score&&(t<r.i||t===r.i&&n<r.j)}function ab(e,t){let n=e.links.find(e=>e.target===t.ref.id);if(n)return{type:n.type,direction:n.direction,name:n.name};let r=t.links.find(t=>t.target===e.ref.id);return r?{type:r.type,direction:r.direction===`outward`?`inward`:`outward`,name:r.name}:null}function ob(e){return $y(Math.min(1,e.terms+e.trigram+e.labels+e.parent+e.link))}var sb=e=>`${Math.round(e*100)}%`;function cb(e){let t=[];return e.titleTerms.length&&t.push(`title terms ${e.titleTerms.join(`, `)}`),e.bodyTerms.length&&t.push(`body terms ${e.bodyTerms.join(`, `)}`),e.trigram>0&&t.push(`titles ${sb(e.trigram)} alike by trigram`),e.labels.length&&t.push(`shared label${e.labels.length>1?`s`:``} ${e.labels.join(`, `)}`),e.parent&&t.push(`same parent ${e.parent}`),e.link&&t.push(`linked (${e.link.name})`),t.length||t.push(`nothing in common`),e.titleOnly&&t.push(`compared on titles alone`),`${t.join(`; `)}.`}function lb(e){return e===void 0||!Number.isFinite(e)?Oy:Math.min(1,Math.max(0,e))}function ub(e){return e===void 0||!Number.isFinite(e)?10:Math.max(1,Math.floor(e))}function db(e,t={}){let{documents:n,skipped:r}=Sy(typeof e==`string`?yy(e):by(e),{command:t.command,key:t.key});return wy(n,{fields:Cy(t.fields),skipped:r,keys:B_(t.keyPatterns),authors:tv(t.authorKinds)})}var fb={readOnly:!0,caller:`toil-ui`},pb=e=>`project = ${e} ORDER BY Rank ASC`,mb=[`ado`,`ado-cloud`],hb=`SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.Id]`,gb=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_b=e=>Array.isArray(e)?e.filter(gb):[],vb=e=>Array.isArray(e)?e.flatMap(e=>typeof e==`string`||typeof e==`number`?[String(e)]:[]):[],yb=class extends Error{call;constructor(e){super(e.error??`${e.command} failed.`),this.call=e}};function bb(e){let t=gb(e.areas)?e.areas:{},n=gb(e.dossier)?e.dossier:{};return{summary:{name:String(e.name),description:typeof n.description==`string`?n.description:null,sources:Object.entries(t).map(([e,t])=>({area:e,connection:t.connection?.value??null})),environments:Object.keys(gb(n.environments)?n.environments:{})},areas:t,dossier:n}}function xb(e){return gb(e)?Object.fromEntries(Object.entries(e).filter(e=>t_.includes(e[0])&&typeof e[1]==`string`)):{}}function Sb(e){let t=e=>e.mergedAt??e.closedAt??e.updated??e.created??``,n=e=>e.state===`OPEN`||e.state===`DRAFT`,r=e.filter(e=>!n(e)).sort((e,n)=>t(e)<t(n)?1:-1).slice(0,20),i=new Set([...e.filter(n),...r]);return e.filter(e=>i.has(e))}var Cb=`reviews,checks,commits,files`,wb=[{area:`bitbucket`,all:`ALL`,id:`id`},{area:`bitbucket-cloud`,all:`ALL`,id:`id`},{area:`ado`,all:`all`,id:`id`},{area:`ado-cloud`,all:`all`,id:`id`},{area:`github`,all:`all`,id:`number`}],Tb=[`.github/CODEOWNERS`,`CODEOWNERS`,`docs/CODEOWNERS`];function Eb(e){let t=new Set;for(let n of e){let e=n.source.connection;n.source.area.startsWith(`jira`)?t.add(`${n.source.key.replace(/-\d+$/,``)}-{n}=${e}`):n.source.area.startsWith(`ado`)?t.add(`AB#{n}=${e}`):n.source.area===`github`&&t.add(`${n.source.key.replace(/#\d+$/,``)}#{n}=${e}`)}return[...t]}function Db(e,t,n){if(e.authorKinds===void 0)return{};if(!gb(e.authorKinds))return n.push(`The ${t} section's authorKinds isn't an object of author id to HUMAN, AGENT or BOT, so it was left out.`),{};let r={};for(let[i,a]of Object.entries(e.authorKinds))typeof a==`string`&&n_.includes(a.toUpperCase())?r[i]=a.toUpperCase():n.push(`The ${t} section's authorKinds gives ${i} as ${JSON.stringify(a)}, which isn't HUMAN, AGENT or BOT, so it was left out.`);return r}function Ob(e){let t=e.filter(e=>typeof e.number==`number`),n=e=>String(e.closed_at??e.updated_at??``),r=t.filter(e=>e.state===`closed`).sort((e,t)=>n(e)<n(t)?1:-1).slice(0,50),i=new Set([...t.filter(e=>e.state!==`closed`),...r]);return t.filter(e=>i.has(e)).map(e=>e.number)}var kb=(e,t)=>e.ok?e.meta.context?.connection?.value??t:t;async function Ab(e,t,n={}){let r={dossier:[],work:[],prs:[],owners:[],builds:[],deployments:[]},i=async(t,n,i)=>{let a=await e(n,i,fb),o={command:n,input:i,ok:a.ok,error:a.ok?null:`${a.error.message}${a.error.fix?` ${a.error.fix}`:``}`};if(r[t].push(o),!a.ok){if(t===`dossier`)throw new yb(o);return null}return a},{summary:a,areas:o,dossier:s}=bb((await i(`dossier`,`dossiers show`,{dossier:t})).data),c=e=>gb(s[e])?s[e]:{},l=_b(s.repos).map(e=>String(e.name)),u={dossier:t},d={jira:[],ado:[],"ado-cloud":[],github:[]},f=[];o.jira?.inputs.project&&f.push((async()=>{let e=await i(`work`,`jira issue search`,{...u,jql:pb(o.jira.inputs.project)});if(!e)return;d.jira.push(e);let t=_b(e.data.issues).map(e=>String(e.key));for(let e of t){let t=await i(`work`,`jira issue history`,{...u,key:e});t&&d.jira.push({key:e,history:t})}})());for(let e of mb.filter(e=>o[e]))f.push((async()=>{let t=await i(`work`,`${e} work-item iterations`,u);t&&d[e].push(t);let n=await i(`work`,`${e} work-item search`,{...u,wiql:hb}),r=n?_b(n.data.workItems).map(e=>Number(e.id)):[];if(!r.length)return;let a=await i(`work`,`${e} work-item get-many`,{...u,id:r});a&&d[e].push(a);for(let t of r){let n=await i(`work`,`${e} work-item history`,{...u,id:t});n&&d[e].push(n)}})());o.github&&f.push((async()=>{let e=`${o.github.inputs.owner}/${o.github.inputs.repo}`,t=new Set,n=vb(c(`github`).projects);if(!n.length){let e=await i(`work`,`github issue list`,{...u,state:`all`});if(!e)return;d.github.push(e);for(let t of Ob(_b(e.data))){let e=await i(`work`,`github issue history`,{...u,number:t});e&&d.github.push({key:String(t),history:e})}return}for(let r of n){let n=await i(`work`,`github project items`,{...u,project:Number(r)});if(n){d.github.push(n);for(let r of _b(n.data)){let n=gb(r.content)?r.content:{};gb(n.repository)&&n.repository.nameWithOwner===e&&typeof n.number==`number`&&t.add(n.number)}}}if(!t.size)return;let r=await i(`work`,`github issue get`,{...u,number:[...t],subIssues:!0});r&&d.github.push(r);for(let e of t){let t=await i(`work`,`github issue history`,{...u,number:e});t&&d.github.push({key:String(e),history:t})}})()),await Promise.all(f);let p=n.mapOwi??db,m=Object.entries(d).flatMap(([e,t])=>t.length?p(t,{fields:xb(c(e).fields)}).items:[]),h=[],g=[],_=gb(s.environments)?s.environments:{},v=Object.entries(_).flatMap(([e,t])=>gb(t.openshift)&&typeof t.openshift.namespace==`string`?[[e,t.openshift.namespace]]:[]),y=new Map(m.map(e=>[e.id,e])),b=Eb(m),x=[],S=[],C={},w=async e=>{let t=new Map,n=await i(`prs`,`${e.area} pr list`,{...u,state:e.all});if(!n)return{prs:[],gets:t};let r=Db(c(e.area),e.area,x),a=p([n],{keyPatterns:b,authorKinds:r});if(!a.changes)return x.push(`The toil Toil UI runs with maps no pull requests (it reads OWI 0.1), so none are shown. Upgrade toil to one that maps OWI 0.2 changes.`),{prs:[],gets:t};let o=a.changes,s=[n];for(let n of Sb(o)){let r=Number(n.id.slice(n.id.lastIndexOf(`#`)+1)),a=await i(`prs`,`${e.area} pr get`,{...u,[e.id]:r,include:Cb});a&&(s.push(a),t.set(n.id,a))}let l=p(s,{keyPatterns:b,authorKinds:r}).changes??[];return S.push(...l),{prs:l,gets:t}},T=e=>e.map(e=>Xm(e,y)),E=async e=>{let t=[];for(let[n,r]of v){let a=await i(`deployments`,`openshift deployment list`,{...u,env:n,namespace:r});a&&t.push(...ih(a.data,n,l,e))}return t};if(o.bitbucket){let e=T((await w(wb[0])).prs);h.push(...e);for(let t of vb(c(`jenkins`).jobs))for(let n of e){let e=n.id.slice(n.id.lastIndexOf(`#`)+1),r=await i(`builds`,`jenkins pipeline runs`,{...u,name:`${t}/PR-${e}`,limit:5});r&&h.push(...Qm(r.data,kb(r,`jenkins`),`${t}/PR-${e}`,n))}}if(o[`bitbucket-cloud`]&&h.push(...T((await w(wb[1])).prs)),o.ado){let e=T((await w(wb[2])).prs);h.push(...e);let t=e[0]?.change?.source.connection??o.ado.connection?.value??`ado`;for(let n of vb(c(`ado`).builds)){let r=await i(`builds`,`ado run list`,{...u,name:n,top:20});r&&h.push(...$m(r.data,kb(r,t),e))}for(let n of vb(c(`ado`).deployments)){let r=await i(`deployments`,`ado run list`,{...u,name:n,top:20});r&&g.push(...ah(r.data,kb(r,t),e))}}if(o[`ado-cloud`]?.inputs.repo&&h.push(...T((await w(wb[3])).prs)),o.github){let{prs:e,gets:t}=await w(wb[4]),n=T(e);h.push(...n),r.builds.push(...r.prs.filter(e=>e.command===`github pr get`));for(let e of n){let n=t.get(e.id),r=n&&gb(n.data)&&gb(n.data.included)?n.data.included.checks:void 0,i=Array.isArray(r)?th(r,e.change.source.connection,e):null;i&&h.push(i)}if(e.some(e=>(e.state===`OPEN`||e.state===`DRAFT`)&&!e.reviewers.length)){let e=`${o.github.inputs.owner}/${o.github.inputs.repo}`;for(let t of Tb){let n=await i(`owners`,`github repo file`,{...u,path:t}),r=n&&gb(n.data)&&typeof n.data.text==`string`?n.data.text:null;if(r!==null){C[e]={path:t,text:r};break}}}}v.length&&g.push(...await E(h.filter(e=>e.kind===`pull-request`)));let D=Rh(s);return{...a,items:m,pullRequests:S,codeowners:C,prNotes:x,changes:h,deployments:g.sort(sh),people:D.people,wipLimit:D.wipLimit,peopleNotes:D.notes,readiness:pg(s),calls:r}}async function jb(e){let t=[],n=async(n,r)=>{let i=await e(n,r,fb),a={command:n,input:r,ok:i.ok,error:i.ok?null:`${i.error.message}${i.error.fix?` ${i.error.fix}`:``}`};if(t.push(a),!i.ok)throw new yb(a);return i.data},r=_b((await n(`dossiers list`,{})).dossiers).filter(e=>e.shadowedBy===null||e.shadowedBy===void 0).map(e=>String(e.name)),i=[];for(let e of r)i.push(bb(await n(`dossiers show`,{dossier:e})).summary);return{dossiers:i,calls:t}}function Mb(e){let t=(e.name??e.id).replace(/[^\p{L}\p{N} .-]/gu,` `).split(/[\s.-]+/).filter(Boolean);return(t.length>1?[t[0][0],t.at(-1)[0]]:[t[0]?.[0],t[0]?.[1]]).filter(Boolean).join(``).toUpperCase()||`?`}var Nb=6;function Pb(e){let t=0;for(let n of e.id)t=t*31+n.charCodeAt(0)>>>0;return t%Nb}function Fb({person:e,labelled:t=!1}){if(!e)return(0,q.jsx)(`span`,{className:`avatar avatar--none`,...t?{role:`img`,"aria-label":`Unassigned`}:{"aria-hidden":!0},children:`–`});let n=e.name??e.id;return(0,q.jsx)(`span`,{className:`avatar avatar--${Pb(e)}`,...t?{role:`img`,"aria-label":n,title:n}:{"aria-hidden":!0},children:Mb(e)})}var Ib=new URL(new URL(`crate-lost-CaqeM6QF.webp`,import.meta.url).href,``+import.meta.url).href,Lb=new URL(new URL(`crate-loading-Dw5rbPVs.webp`,import.meta.url).href,``+import.meta.url).href,Rb={EmptyState:({message:e,children:t})=>(0,q.jsxs)(`div`,{className:`skin-empty skin-empty--art`,children:[(0,q.jsx)(`img`,{src:Ib,alt:``,width:240,height:160}),(0,q.jsx)(`p`,{children:e}),t]}),Loading:({message:e})=>(0,q.jsxs)(`div`,{className:`skin-loading skin-empty--art`,role:`status`,children:[(0,q.jsx)(`img`,{src:Lb,alt:``,width:240,height:160}),(0,q.jsx)(`p`,{children:e})]})},zb=new URL(`crop-grown-HG5zb5pJ.svg`,import.meta.url).href,Bb=new URL(`crop-harvested-Q-ua5_kg.svg`,import.meta.url).href,Vb=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%20shape-rendering='crispEdges'%3e%3crect%20x='5'%20y='11'%20width='1'%20height='1'%20fill='%23c9932a'/%3e%3crect%20x='10'%20y='11'%20width='1'%20height='1'%20fill='%23c9932a'/%3e%3crect%20x='4'%20y='12'%20width='8'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='2'%20y='13'%20width='2'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='4'%20y='13'%20width='3'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='7'%20y='13'%20width='1'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='8'%20y='13'%20width='4'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='12'%20y='13'%20width='2'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='14'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='2'%20y='14'%20width='3'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='5'%20y='14'%20width='1'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='6'%20y='14'%20width='5'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='11'%20y='14'%20width='1'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='12'%20y='14'%20width='2'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='14'%20y='14'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='15'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='15'%20width='14'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='15'%20y='15'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3c/svg%3e`,Hb=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%20shape-rendering='crispEdges'%3e%3crect%20x='4'%20y='6'%20width='2'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='10'%20y='6'%20width='2'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='3'%20y='7'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='4'%20y='7'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='6'%20y='7'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='9'%20y='7'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='10'%20y='7'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='12'%20y='7'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='4'%20y='8'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='5'%20y='8'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='9'%20y='8'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='11'%20y='8'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='6'%20y='9'%20width='4'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='7'%20y='10'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='7'%20y='11'%20width='1'%20height='1'%20fill='%232f6b1f'/%3e%3crect%20x='8'%20y='11'%20width='1'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='4'%20y='12'%20width='8'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='2'%20y='13'%20width='2'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='4'%20y='13'%20width='3'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='7'%20y='13'%20width='1'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='8'%20y='13'%20width='4'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='12'%20y='13'%20width='2'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='14'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='2'%20y='14'%20width='3'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='5'%20y='14'%20width='1'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='6'%20y='14'%20width='5'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='11'%20y='14'%20width='1'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='12'%20y='14'%20width='2'%20height='1'%20fill='%238a5530'/%3e%3crect%20x='14'%20y='14'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='15'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='15'%20width='14'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='15'%20y='15'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3c/svg%3e`,Ub=new URL(`empty-field-BN05R29i.svg`,import.meta.url).href,Wb=new URL(`fields-BxauQmw0.webp`,import.meta.url).href,Gb=new URL(`mark-bSC__Aar.svg`,import.meta.url).href,Kb=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%20shape-rendering='crispEdges'%3e%3crect%20x='6'%20y='1'%20width='4'%20height='1'%20fill='%23f2c94c'/%3e%3crect%20x='5'%20y='2'%20width='1'%20height='1'%20fill='%23f2c94c'/%3e%3crect%20x='6'%20y='2'%20width='1'%20height='1'%20fill='%23c9932a'/%3e%3crect%20x='7'%20y='2'%20width='2'%20height='1'%20fill='%23f2c94c'/%3e%3crect%20x='9'%20y='2'%20width='1'%20height='1'%20fill='%23c9932a'/%3e%3crect%20x='10'%20y='2'%20width='1'%20height='1'%20fill='%23f2c94c'/%3e%3crect%20x='4'%20y='3'%20width='8'%20height='1'%20fill='%23f2c94c'/%3e%3crect%20x='4'%20y='4'%20width='8'%20height='1'%20fill='%23a3200f'/%3e%3crect%20x='1'%20y='5'%20width='14'%20height='1'%20fill='%23f2c94c'/%3e%3crect%20x='2'%20y='6'%20width='12'%20height='1'%20fill='%23c9932a'/%3e%3crect%20x='3'%20y='7'%20width='10'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='3'%20y='8'%20width='2'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='5'%20y='8'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='6'%20y='8'%20width='4'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='10'%20y='8'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='11'%20y='8'%20width='2'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='3'%20y='9'%20width='2'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='5'%20y='9'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='6'%20y='9'%20width='4'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='10'%20y='9'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='11'%20y='9'%20width='2'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='3'%20y='10'%20width='1'%20height='1'%20fill='%23e98aa0'/%3e%3crect%20x='4'%20y='10'%20width='8'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='12'%20y='10'%20width='1'%20height='1'%20fill='%23e98aa0'/%3e%3crect%20x='3'%20y='11'%20width='3'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='6'%20y='11'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='7'%20y='11'%20width='2'%20height='1'%20fill='%23d99a6c'/%3e%3crect%20x='9'%20y='11'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='10'%20y='11'%20width='3'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='4'%20y='12'%20width='3'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='7'%20y='12'%20width='2'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='12'%20width='3'%20height='1'%20fill='%23f2c29b'/%3e%3crect%20x='4'%20y='13'%20width='3'%20height='1'%20fill='%233d6fb6'/%3e%3crect%20x='7'%20y='13'%20width='2'%20height='1'%20fill='%23d8d0c0'/%3e%3crect%20x='9'%20y='13'%20width='3'%20height='1'%20fill='%233d6fb6'/%3e%3crect%20x='3'%20y='14'%20width='4'%20height='1'%20fill='%233d6fb6'/%3e%3crect%20x='7'%20y='14'%20width='2'%20height='1'%20fill='%23d8d0c0'/%3e%3crect%20x='9'%20y='14'%20width='4'%20height='1'%20fill='%233d6fb6'/%3e%3crect%20x='2'%20y='15'%20width='2'%20height='1'%20fill='%233d6fb6'/%3e%3crect%20x='4'%20y='15'%20width='1'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='5'%20y='15'%20width='6'%20height='1'%20fill='%233d6fb6'/%3e%3crect%20x='11'%20y='15'%20width='1'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='15'%20width='2'%20height='1'%20fill='%233d6fb6'/%3e%3c/svg%3e`,qb=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%20shape-rendering='crispEdges'%3e%3crect%20x='6'%20y='1'%20width='4'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='5'%20y='2'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='10'%20y='2'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='3'%20width='8'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='15'%20y='3'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='3'%20y='4'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='4'%20width='8'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='4'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='14'%20y='4'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='15'%20y='4'%20width='1'%20height='1'%20fill='%23a8c9e8'/%3e%3crect%20x='3'%20y='5'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='5'%20width='1'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='5'%20y='5'%20width='2'%20height='1'%20fill='%23a8c9e8'/%3e%3crect%20x='7'%20y='5'%20width='5'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='5'%20width='3'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='3'%20y='6'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='6'%20width='1'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='5'%20y='6'%20width='2'%20height='1'%20fill='%23a8c9e8'/%3e%3crect%20x='7'%20y='6'%20width='5'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='6'%20width='2'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='3'%20y='7'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='7'%20width='8'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='7'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='3'%20y='8'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='8'%20width='8'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='8'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='3'%20y='9'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='9'%20width='8'%20height='1'%20fill='%237d93b8'/%3e%3crect%20x='12'%20y='9'%20width='1'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='4'%20y='10'%20width='8'%20height='1'%20fill='%233b4a63'/%3e%3crect%20x='14'%20y='11'%20width='1'%20height='1'%20fill='%23a8c9e8'/%3e%3crect%20x='5'%20y='12'%20width='2'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='14'%20y='12'%20width='1'%20height='1'%20fill='%23a8c9e8'/%3e%3crect%20x='4'%20y='13'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='5'%20y='13'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='7'%20y='13'%20width='1'%20height='1'%20fill='%238fd14f'/%3e%3crect%20x='12'%20y='13'%20width='1'%20height='1'%20fill='%23a8c9e8'/%3e%3crect%20x='5'%20y='14'%20width='2'%20height='1'%20fill='%234f9a2a'/%3e%3crect%20x='2'%20y='15'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='3'%20y='15'%20width='9'%20height='1'%20fill='%235c3519'/%3e%3crect%20x='12'%20y='15'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3c/svg%3e`,Jb=new URL(`wood-panel-CFA5lKLa.svg`,import.meta.url).href,Yb=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%20width='12'%20height='12'%20shape-rendering='crispEdges'%3e%3crect%20x='0'%20y='0'%20width='12'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='1'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='1'%20width='10'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='1'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='2'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='2'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='2'%20width='8'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='2'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='2'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='3'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='3'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='3'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='3'%20y='3'%20width='6'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='3'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='3'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='3'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='4'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='4'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='4'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='3'%20y='4'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='8'%20y='4'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='4'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='4'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='4'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='5'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='5'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='5'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='3'%20y='5'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='8'%20y='5'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='5'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='5'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='5'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='6'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='6'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='6'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='3'%20y='6'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='8'%20y='6'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='6'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='6'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='6'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='7'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='7'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='7'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='3'%20y='7'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='8'%20y='7'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='7'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='7'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='7'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='8'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='8'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='8'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='3'%20y='8'%20width='6'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='9'%20y='8'%20width='1'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='8'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='8'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='9'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='9'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='2'%20y='9'%20width='8'%20height='1'%20fill='%238a5226'/%3e%3crect%20x='10'%20y='9'%20width='1'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='9'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='10'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='1'%20y='10'%20width='10'%20height='1'%20fill='%23dea36a'/%3e%3crect%20x='11'%20y='10'%20width='1'%20height='1'%20fill='%233b2614'/%3e%3crect%20x='0'%20y='11'%20width='12'%20height='1'%20fill='%233b2614'/%3e%3c/svg%3e`,Xb={"dossiers.lede":`Each dossier is one body of work: its repositories, its tracker, its pipelines and its environments. Pick one to see its stories, pull requests, builds and deployments together.`,"dossier.eyebrow":`Dossier`,"settings.eyebrow":`Settings`,"attention.note":`Open items ranked by their insights, weightiest first. Each insight names the data it rests on.`,"aging.note":`How long each item in progress has been in progress, from its history, oldest first.`,"trace.note":`Each work item with the pull requests that name it, their latest builds, and the environments running them.`,"graph.note":`Arrows run the way each link reads, from the source's own links. Blocking chains run left to right.`,"ask.note":`Answers cite the items they rest on. The agent reads; it never changes a ticket. What it suggests comes back as a proposal for you to apply.`,"empty.dossiers":`toil sees no dossiers yet. A dossier is made with toil dossiers init.`,"empty.sprint":`No sprint is running in this dossier's work items.`,"empty.burnup":`No sprint is running, so there is nothing to burn up.`,"empty.column":`Nothing here.`,"empty.prs":`No pull requests for this dossier.`,"empty.builds":`No builds for this dossier's pull requests.`,"empty.deployments":`This dossier names no environment to read deployments from.`,"empty.links":`No links between this dossier's items.`,"empty.ask":`Pick a question, or ask your own, to see how answers cite their sources.`,"loading.dossiers":`Reading the dossiers…`,"loading.dossier":`Reading {name}…`,"loading.graph":`Drawing the graph…`,"loading.answer":`Thinking…`,"ask.placeholder":`Ask about {name}`,"ask.placeholder.short":`Ask a question`,"ask.welcome":`Ask anything about {name}: its sprint, its people, what is blocked or waiting on review. Every answer cites the items it rests on.`,"status.cache":`Reading the cache`,"status.live":`Reading live through toil`,"status.registry":`Reading a command's fields`,"status.writing":`Writing`,"status.done":`Done in {seconds} s`,"status.stopped":`Stopped after {seconds} s`};Object.keys(Xb);function Zb(e,t,n,r={}){return((t?e?.[n]:void 0)??Xb[n]).replace(/\{([a-z]+)\}/g,(e,t)=>r[t]??e)}var Qb=(0,v.createContext)(sp[0]),$b=Qb.Provider,ex=()=>(0,v.useContext)(Qb),tx={theme:sp[0].name,scheme:`system`,wording:!0,voice:!0,setTheme:()=>void 0,setScheme:()=>void 0,setWording:()=>void 0,setVoice:()=>void 0},nx=(0,v.createContext)(tx),rx=nx.Provider,ix=()=>(0,v.useContext)(nx),ax=(e,t)=>t.wording&&e.lexicon!==void 0,ox=(e,t)=>t.voice&&e.voice!==void 0;function sx(e,t,n,r=!0){let i=r?e.terms?.[t]:void 0;return i&&i.toLowerCase()!==n.toLowerCase()?`${i} (${n})`:n}function cx(){let e=ex(),{wording:t}=ix();return(n,r)=>sx(e,n,r,t)}function lx(){let e=ex(),t=ax(e,ix());return(n,r)=>Zb(e.lexicon,t,n,r)}var ux=e=>new URL(Object.assign({"../../themes/harvest/assets/crop-grown.svg":zb,"../../themes/harvest/assets/crop-harvested.svg":Bb,"../../themes/harvest/assets/crop-seed.svg":Vb,"../../themes/harvest/assets/crop-sprout.svg":Hb,"../../themes/harvest/assets/empty-field.svg":Ub,"../../themes/harvest/assets/fields.webp":Wb,"../../themes/harvest/assets/mark.svg":Gb,"../../themes/harvest/assets/portrait.svg":Kb,"../../themes/harvest/assets/watering-can.svg":qb,"../../themes/harvest/assets/wood-panel.svg":Jb,"../../themes/harvest/assets/wood-sign.svg":Yb})[`../../themes/harvest/assets/${e}`],import.meta.url).href,dx={TODO:ux(`crop-seed.svg`),IN_PROGRESS:ux(`crop-grown.svg`),DONE:ux(`crop-harvested.svg`),UNKNOWN:ux(`crop-sprout.svg`)};function fx({src:e,size:t=32,className:n}){return(0,q.jsx)(`img`,{className:n,src:e,alt:``,width:t,height:t,loading:`lazy`,decoding:`async`})}function px(){let{health:e}=xm();return e?(0,q.jsxs)(`div`,{className:`harvest-calendar`,"aria-hidden":`true`,children:[(0,q.jsxs)(`span`,{className:`harvest-calendar-day`,children:[`Day `,e.days.gone]}),(0,q.jsx)(`span`,{className:`harvest-calendar-grid`,children:Array.from({length:e.days.total},(t,n)=>(0,q.jsx)(`i`,{className:n+1<e.days.gone?`gone`:n+1===e.days.gone?`today`:void 0},n))})]}):null}function mx({id:e,children:t}){let n=(0,v.useContext)(ym)!==null;return(0,q.jsxs)(q.Fragment,{children:[e===`sprint`&&n&&(0,q.jsx)(px,{}),t]})}function hx({children:e}){let t=cx();return(0,q.jsxs)(`div`,{className:`bubble bubble--agent harvest-dialogue`,children:[(0,q.jsx)(fx,{src:ux(`portrait.svg`),size:48,className:`harvest-portrait`}),(0,q.jsxs)(`div`,{className:`harvest-dialogue-text`,children:[(0,q.jsx)(`p`,{className:`harvest-name`,children:t(`agent`,`Agent`)}),e]})]})}var gx={Card:({item:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[t,(0,q.jsx)(fx,{src:dx[e.statusCategory],className:`harvest-crop harvest-crop--${e.statusCategory.toLowerCase()}`})]}),Panel:mx,ChatMessage:({from:e,children:t})=>e===`agent`?(0,q.jsx)(hx,{children:t}):(0,q.jsx)(`div`,{className:`bubble bubble--you`,children:t}),EmptyState:({message:e,children:t})=>(0,q.jsxs)(`div`,{className:`skin-empty skin-empty--art harvest-empty`,children:[(0,q.jsx)(`img`,{src:ux(`empty-field.svg`),alt:``,width:192,height:96,loading:`lazy`,decoding:`async`}),(0,q.jsx)(`p`,{children:e}),t]}),Loading:({message:e})=>(0,q.jsxs)(`div`,{className:`skin-loading skin-empty--art harvest-loading`,role:`status`,children:[(0,q.jsx)(fx,{src:ux(`watering-can.svg`),size:64,className:`harvest-can`}),(0,q.jsx)(`p`,{children:e})]})},_x=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2016'%20width='24'%20height='16'%20fill='none'%20stroke='%231a1410'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c!--%20A%20blocker:%20the%20road%20runs%20up%20to%20a%20keep%20and%20breaks%20off.%20--%3e%3cpath%20d='M1%2013.5H7'%20stroke-width='1.4'%20stroke-dasharray='2%201.6'/%3e%3cpath%20d='M8.5%2011.5%2010%2014.5M9.5%2010.8%2011.5%2013'%20stroke='%236e1c18'%20stroke-width='1.2'/%3e%3cpath%20d='M13%2015V6h1.6V4.5h1.6V6h1.6V4.5h1.6V6H21v9Z'%20fill='%233a3733'%20stroke-width='1'/%3e%3cpath%20d='M16.4%2015v-3h1.6v3'%20stroke='%23d8cbb0'%20stroke-width='.9'/%3e%3c/svg%3e`,vx=new URL(`candle-ledger-LHVvMHKk.webp`,import.meta.url).href,yx=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0Ij4KPCEtLSBUaGUgZG9zc2llciB0aXRsZSdzIG9uZSBpbGx1bWluYXRlZCBjYXBpdGFsOiBhbiBveGJsb29kIGZpZWxkIGluIGEgdGFybmlzaGVkLWdvbGQgZnJhbWUsIHJpdmV0ZWQgYXQgdGhlIGNvcm5lcnMuIC0tPgo8cmVjdCB4PSIxIiB5PSIxIiB3aWR0aD0iNjIiIGhlaWdodD0iNjIiIGZpbGw9IiM0YTE0MTEiIHN0cm9rZT0iIzljN2EzYyIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxyZWN0IHg9IjUuNSIgeT0iNS41IiB3aWR0aD0iNTMiIGhlaWdodD0iNTMiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzljN2EzYyIgc3Ryb2tlLXdpZHRoPSIuOCIgb3BhY2l0eT0iLjgiLz4KPGcgc3Ryb2tlPSIjMmEwYzBhIiBzdHJva2Utd2lkdGg9Ii42IiBvcGFjaXR5PSIuNTUiPgo8cGF0aCBkPSJNOCAyMCAyMCA4TTggMzIgMzIgOE04IDQ0IDQ0IDhNOCA1NiA1NiA4TTIwIDU2IDU2IDIwTTMyIDU2IDU2IDMyTTQ0IDU2IDU2IDQ0Ii8+CjwvZz4KPGcgZmlsbD0iI2I4OTc1YSI+PGNpcmNsZSBjeD0iNS41IiBjeT0iNS41IiByPSIyIi8+PGNpcmNsZSBjeD0iNTguNSIgY3k9IjUuNSIgcj0iMiIvPjxjaXJjbGUgY3g9IjUuNSIgY3k9IjU4LjUiIHI9IjIiLz48Y2lyY2xlIGN4PSI1OC41IiBjeT0iNTguNSIgcj0iMiIvPjwvZz4KPC9zdmc+Cg==`,bx=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgd2lkdGg9IjQ4IiBoZWlnaHQ9IjQ4IiBmaWxsPSJub25lIj4KPCEtLSBBIGZvbGlvJ3MgYmluZGluZywgY3V0IGFzIGEgYm9yZGVyIGltYWdlOiBhIGRhcmsgbGVhdGhlciBiYW5kIHdpdGggYSBnaWx0LXRvb2xlZCBpbm5lciBydWxlIGFuZCBhbiBpcm9uIHJpdmV0IGluIGVhY2ggY29ybmVyLiAtLT4KPHBhdGggZD0iTTAgMEg0OFY0OEgwWk0xMiAxMlYzNkgzNlYxMloiIGZpbGw9IiMyYjIxMWIiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8cGF0aCBkPSJNMSAxSDQ3VjQ3SDFaIiBzdHJva2U9IiMxNDExMGUiIHN0cm9rZS13aWR0aD0iMiIvPgo8cGF0aCBkPSJNMyAzSDQ1VjQ1SDNaIiBzdHJva2U9IiM1YTQ2MzYiIHN0cm9rZS13aWR0aD0iMSIvPgo8cGF0aCBkPSJNOSA5SDM5VjM5SDlaIiBzdHJva2U9IiM5YzdhM2MiIHN0cm9rZS13aWR0aD0iMSIvPgo8cGF0aCBkPSJNMTEuNSAxMS41SDM2LjVWMzYuNUgxMS41WiIgc3Ryb2tlPSIjMTQxMTBlIiBzdHJva2Utd2lkdGg9IjEiLz4KPGcgZmlsbD0iIzZiNjY2MCIgc3Ryb2tlPSIjMTQxMTBlIiBzdHJva2Utd2lkdGg9Ii44Ij48Y2lyY2xlIGN4PSI2IiBjeT0iNiIgcj0iMi40Ii8+PGNpcmNsZSBjeD0iNDIiIGN5PSI2IiByPSIyLjQiLz48Y2lyY2xlIGN4PSI2IiBjeT0iNDIiIHI9IjIuNCIvPjxjaXJjbGUgY3g9IjQyIiBjeT0iNDIiIHI9IjIuNCIvPjwvZz4KPGcgZmlsbD0iI2JkYjZhYSI+PGNpcmNsZSBjeD0iNS4zIiBjeT0iNS4zIiByPSIuOCIvPjxjaXJjbGUgY3g9IjQxLjMiIGN5PSI1LjMiIHI9Ii44Ii8+PGNpcmNsZSBjeD0iNS4zIiBjeT0iNDEuMyIgcj0iLjgiLz48Y2lyY2xlIGN4PSI0MS4zIiBjeT0iNDEuMyIgcj0iLjgiLz48L2c+Cjwvc3ZnPgo=`,xx=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20200%20120'%20width='200'%20height='120'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c!--%20An%20empty%20state:%20a%20ledger%20lying%20open%20on%20its%20binding,%20its%20ruled%20pages%20blank.%20--%3e%3cpath%20d='M14%2024%20100%2030%20186%2024V104L100%20110%2014%20104Z'%20fill='%232b211b'%20stroke='%2314110e'%20stroke-width='1.6'/%3e%3cpath%20d='M20%2020C46%2018%2076%2020%2098%2027V104C76%2098%2046%2096%2020%2098Z'%20fill='%23e6dcc6'%20stroke='%233a3733'%20stroke-width='1.2'/%3e%3cpath%20d='M180%2020C154%2018%20124%2020%20102%2027V104C124%2098%20154%2096%20180%2098Z'%20fill='%23ddd1b8'%20stroke='%233a3733'%20stroke-width='1.2'/%3e%3cg%20stroke='%239c8a6c'%20stroke-width='.7'%3e%3cpath%20d='M30%2038C52%2037%2072%2039%2090%2043M30%2050C52%2049%2072%2051%2090%2055M30%2062C52%2061%2072%2063%2090%2067M30%2074C52%2073%2072%2075%2090%2079M110%2043C128%2039%20148%2037%20170%2038M110%2055C128%2051%20148%2049%20170%2050M110%2067C128%2063%20148%2061%20170%2062M110%2079C128%2075%20148%2073%20170%2074'/%3e%3c/g%3e%3cpath%20d='M44%2032V92M156%2032V92'%20stroke='%236e1c18'%20stroke-width='.7'%20stroke-opacity='.7'/%3e%3cpath%20d='M100%2027V108'%20stroke='%2314110e'%20stroke-width='2'/%3e%3cpath%20d='M186%2058H196V70H186'%20fill='%233a3733'%20stroke='%2314110e'%20stroke-width='1.2'/%3e%3ccircle%20cx='191'%20cy='64'%20r='1.6'%20fill='%239c7a3c'/%3e%3c/svg%3e`,Sx=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gUmVhbG0ncyBiYWRnZTogdGhlIHRpbGUgYXMgYW4gaXJvbiBwbGF0ZSB3aXRoIGEgdGFybmlzaGVkLWdvbGQgcnVsZSBhbmQgZm91ciByaXZldHMsIHRoZSBwYWdlIGFnZWQgdmVsbHVtLiBUaGUgYmFkZ2UncyBzaWxob3VldHRlLCBza2lubmVkLiAtLT4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icjlpIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzRhNDY0MCIvPgo8c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzJhMjcyNCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMxNDExMGUiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJyOWciIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjYzlhODVlIi8+CjxzdG9wIG9mZnNldD0iLjUiIHN0b3AtY29sb3I9IiM5YzdhM2MiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjNWU0NTIwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icjlyIiBjeD0iLjM1IiBjeT0iLjM1IiByPSIuNyI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Q5YmQ3YSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM1ZTQ1MjAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPC9kZWZzPgo8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIiBmaWxsPSJ1cmwoI3I5aSkiLz4KPHBhdGggZD0iTTE4LjYgOS4ySDQwLjdMNTQuOCAyMy4zVjQ1LjRBOS40IDkuNCAwIDAgMSA0NS40IDU0LjhIMTguNkE5LjQgOS40IDAgMCAxIDkuMiA0NS40VjE4LjZBOS40IDkuNCAwIDAgMSAxOC42IDkuMloiIHN0cm9rZT0idXJsKCNyOWcpIiBzdHJva2Utd2lkdGg9IjEuNCIvPgo8ZyBmaWxsPSJ1cmwoI3I5cikiPjxjaXJjbGUgY3g9IjEzLjQiIGN5PSIxMy40IiByPSIxLjkiLz48Y2lyY2xlIGN4PSIxMy40IiBjeT0iNTAuNiIgcj0iMS45Ii8+PGNpcmNsZSBjeD0iNTAuNiIgY3k9IjUwLjYiIHI9IjEuOSIvPjxjaXJjbGUgY3g9IjQ2LjIiIGN5PSIxMy40IiByPSIxLjYiLz48L2c+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMyIDMyLjYpIHNjYWxlKDEuMjIpIHRyYW5zbGF0ZSgtMzEuNSAtMzIuNSkiPgo8cGF0aCBkPSJNMjMgMTcuNWgxM2w3IDd2MjBhMyAzIDAgMCAxLTMgM0gyM2EzIDMgMCAwIDEtMy0zdi0yNGEzIDMgMCAwIDEgMy0zWiIgZmlsbD0iI2Q4Y2JiMCIgc3Ryb2tlPSIjNWU0NTIwIiBzdHJva2Utd2lkdGg9Ii44Ii8+CjxwYXRoIGQ9Ik0zNiAxNy41djQuNWEyLjUgMi41IDAgMCAwIDIuNSAyLjVINDNaIiBmaWxsPSIjOWM3YTNjIi8+CjxwYXRoIGQ9Im0yNC41IDI3LjUgNSA0LjMtNSA0LjMiIHN0cm9rZT0iIzE0MTEwZSIgc3Ryb2tlLXdpZHRoPSIzLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMzEuOCA0MGg2LjIiIHN0cm9rZT0iIzZlMWMxOCIgc3Ryb2tlLXdpZHRoPSIzLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L2c+Cjwvc3ZnPgo=`,Cx=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjAgMTYiIHdpZHRoPSIxNjAiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiPgo8IS0tIFRoZSBoZWFkZXIncyBlbWJvc3NlZCBydWxlOiB0d28gdGFybmlzaGVkLWdvbGQgbGluZXMgd2l0aCBhIHNoYWRvdyBiZW5lYXRoLCBhbmQgYSByaXZldCBhdCB0aGUgY2VudHJlIGFuZCBlYWNoIGVuZC4gLS0+CjxwYXRoIGQ9Ik04IDcuNUg3ME05MCA3LjVIMTUyIiBzdHJva2U9IiM5YzdhM2MiIHN0cm9rZS13aWR0aD0iMS4yIi8+CjxwYXRoIGQ9Ik04IDlINzBNOTAgOUgxNTIiIHN0cm9rZT0iIzE0MTEwZSIgc3Ryb2tlLW9wYWNpdHk9Ii43IiBzdHJva2Utd2lkdGg9Ii44Ii8+CjxwYXRoIGQ9Ik04MCAyLjUgODUuNSA4IDgwIDEzLjUgNzQuNSA4WiIgZmlsbD0iIzZlMWMxOCIgc3Ryb2tlPSIjOWM3YTNjIiBzdHJva2Utd2lkdGg9IjEiLz4KPGcgZmlsbD0iIzZiNjY2MCIgc3Ryb2tlPSIjMTQxMTBlIiBzdHJva2Utd2lkdGg9Ii44Ij48Y2lyY2xlIGN4PSI1IiBjeT0iOCIgcj0iMi40Ii8+PGNpcmNsZSBjeD0iMTU1IiBjeT0iOCIgcj0iMi40Ii8+PC9nPgo8L3N2Zz4K`,wx=new URL(`vellum-DlU0Uxzz.webp`,import.meta.url).href,Tx=new URL(`war-map-_sup_aJg.webp`,import.meta.url).href,Ex=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20width='32'%20height='32'%3e%3c!--%20A%20plain%20wax%20seal:%20oxblood,%20pressed%20with%20a%20ring%20and%20a%20single%20rivet%20mark,%20no%20device.%20--%3e%3cpath%20d='M16%202.5c2%200%202.8%201.6%204.6%202s3.4-.4%204.6.9.4%203%201.2%204.6%202.4%202.4%202.4%204.4-1.4%202.6-1.8%204.4.6%203.4-.7%204.7-3.1.8-4.7%201.7-2%202.9-4%203.1-2.9-1.5-4.8-2-3.6.2-4.8-1.1-.4-3-1.4-4.6S2.5%2018.4%202.5%2016.3%204%2013.6%204.4%2011.8%204%208.5%205.4%207.3s3.1-.6%204.7-1.5S13.9%202.5%2016%202.5Z'%20fill='%236e1c18'%20stroke='%233a0d0b'%20stroke-width='1'/%3e%3ccircle%20cx='16'%20cy='16'%20r='8.2'%20fill='none'%20stroke='%233a0d0b'%20stroke-width='1.6'/%3e%3ccircle%20cx='16'%20cy='16'%20r='8.2'%20fill='none'%20stroke='%23a5453a'%20stroke-width='.6'%20stroke-dasharray='3%209'%20transform='rotate(-30%2016%2016)'/%3e%3ccircle%20cx='16'%20cy='16'%20r='2.4'%20fill='%233a0d0b'/%3e%3c/svg%3e`,Dx=e=>new URL(Object.assign({"../../themes/realm/assets/broken-road.svg":_x,"../../themes/realm/assets/candle-ledger.webp":vx,"../../themes/realm/assets/capital.svg":yx,"../../themes/realm/assets/iron-band.svg":bx,"../../themes/realm/assets/ledger.svg":xx,"../../themes/realm/assets/mark.svg":Sx,"../../themes/realm/assets/rule.svg":Cx,"../../themes/realm/assets/vellum.webp":wx,"../../themes/realm/assets/war-map.webp":Tx,"../../themes/realm/assets/wax-seal.svg":Ex})[`../../themes/realm/assets/${e}`],import.meta.url).href;function Ox({item:e}){let t=(0,v.useContext)(ym),n=cx(),r=e.parent?t?.byId.get(e.parent):void 0;return!r||r.type!==`EPIC`?null:(0,q.jsxs)(`p`,{className:`realm-campaign`,children:[n(`epic`,r.typeName??`Epic`),`: `,r.title]})}function kx({children:e}){let t=cx();return(0,q.jsxs)(`div`,{className:`bubble bubble--agent realm-steward`,children:[(0,q.jsxs)(`p`,{className:`realm-steward-name`,children:[(0,q.jsx)(`img`,{src:Dx(`wax-seal.svg`),alt:``,width:24,height:24,loading:`lazy`,decoding:`async`}),t(`agent`,`Agent`)]}),e]})}var Ax={Card:({item:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[t,(0,q.jsx)(Ox,{item:e})]}),Header:({children:e})=>(0,q.jsxs)(q.Fragment,{children:[e,(0,q.jsx)(`img`,{className:`realm-rule realm-rule--header`,src:Dx(`rule.svg`),alt:``,width:160,height:16,loading:`lazy`,decoding:`async`,"aria-hidden":`true`})]}),ChatMessage:({from:e,children:t})=>e===`agent`?(0,q.jsx)(kx,{children:t}):(0,q.jsx)(`div`,{className:`bubble bubble--you`,children:t}),EmptyState:({message:e,children:t})=>(0,q.jsxs)(`div`,{className:`skin-empty skin-empty--art realm-ledger`,children:[(0,q.jsx)(`img`,{src:Dx(`ledger.svg`),alt:``,width:200,height:120,loading:`lazy`,decoding:`async`}),(0,q.jsx)(`p`,{children:e}),t]}),Loading:({message:e})=>(0,q.jsxs)(`div`,{className:`skin-loading skin-empty--art realm-candle`,role:`status`,children:[(0,q.jsx)(`img`,{src:Dx(`candle-ledger.webp`),alt:``,width:240,height:160,decoding:`async`}),(0,q.jsx)(`p`,{children:e})]})},jx=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20width='32'%20height='32'%3e%3ccircle%20cx='16'%20cy='16'%20r='14'%20fill='%230a1222'%20stroke='%2336d6ff'%20stroke-width='1.5'/%3e%3ccircle%20cx='16'%20cy='16'%20r='9.5'%20fill='none'%20stroke='%237fe3ff'%20stroke-width='1'%20stroke-dasharray='3%202.2'/%3e%3ccircle%20cx='16'%20cy='16'%20r='4.5'%20fill='%2336d6ff'/%3e%3ccircle%20cx='16'%20cy='16'%20r='2'%20fill='%23e6f1ff'/%3e%3c/svg%3e`,Mx=new URL(`empty-sector-amtiZ3_V.webp`,import.meta.url).href,Nx=new URL(`lightspeed-LxKj3vD3.svg`,import.meta.url).href,Px=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gU3RhcnNoaXAncyBiYWRnZTogYSByaXZldGVkIGh1bGwgcGxhdGUsIHRoZSBwYWdlIGEgY29uc29sZSBzY3JlZW4gd2l0aCBhIGdsb3dpbmcgcHJvbXB0LiBUaGUgYmFkZ2UncyBzaWxob3VldHRlLCBza2lubmVkLiAtLT4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0iYjZzIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzRhNWY3ZCIvPgo8c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzI1MzI0YSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMxNDFjMmMiLz4KPC9saW5lYXJHcmFkaWVudD4KPGNsaXBQYXRoIGlkPSJiNmMiPgo8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIi8+CjwvY2xpcFBhdGg+CjxmaWx0ZXIgaWQ9ImI2ZyIgeD0iLTQwJSIgeT0iLTQwJSIgd2lkdGg9IjE4MCUiIGhlaWdodD0iMTgwJSI+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjEuMSIgcmVzdWx0PSJiIi8+CjxmZU1lcmdlPgo8ZmVNZXJnZU5vZGUgaW49ImIiLz4KPGZlTWVyZ2VOb2RlIGluPSJTb3VyY2VHcmFwaGljIi8+CjwvZmVNZXJnZT4KPC9maWx0ZXI+CjwvZGVmcz4KPHBhdGggZD0iTTE4IDZINDJMNTggMjJWNDZBMTIgMTIgMCAwIDEgNDYgNThIMThBMTIgMTIgMCAwIDEgNiA0NlYxOEExMiAxMiAwIDAgMSAxOCA2WiIgZmlsbD0idXJsKCNiNnMpIi8+CjxnIGNsaXAtcGF0aD0idXJsKCNiNmMpIiBzdHJva2U9IiMwYTEyMjIiIHN0cm9rZS13aWR0aD0iLjkiIG9wYWNpdHk9Ii43Ij4KPHBhdGggZD0iTTYgMjBINjRNNiA1Nkg2NE0xNiA2VjY0TTQ4IDZWNjQiLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjYjZjKSIgc3Ryb2tlPSIjN2Q5NmI4IiBzdHJva2Utd2lkdGg9Ii41IiBvcGFjaXR5PSIuNSI+CjxwYXRoIGQ9Ik02IDIwLjlINjRNMTYuOSA2VjY0Ii8+CjwvZz4KPHBhdGggZD0iTTE4IDYuNkg0MS44TDU3LjQgMjIuMlY0NkExMS40IDExLjQgMCAwIDEgNDYgNTcuNEgxOEExMS40IDExLjQgMCAwIDEgNi42IDQ2VjE4QTExLjQgMTEuNCAwIDAgMSAxOCA2LjZaIiBzdHJva2U9IiM4ZmE3YzgiIHN0cm9rZS13aWR0aD0iMS4xIiBvcGFjaXR5PSIuNzUiLz4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMS41IiBmaWxsPSIjOGZhN2M4Ii8+CjxjaXJjbGUgY3g9IjExLjYiIGN5PSIxMS42IiByPSIuNiIgZmlsbD0iI2RiZTdmNyIvPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjUyIiByPSIxLjUiIGZpbGw9IiM4ZmE3YzgiLz4KPGNpcmNsZSBjeD0iMTEuNiIgY3k9IjUxLjYiIHI9Ii42IiBmaWxsPSIjZGJlN2Y3Ii8+CjxjaXJjbGUgY3g9IjUyIiBjeT0iNTIiIHI9IjEuNSIgZmlsbD0iIzhmYTdjOCIvPgo8Y2lyY2xlIGN4PSI1MS42IiBjeT0iNTEuNiIgcj0iLjYiIGZpbGw9IiNkYmU3ZjciLz4KPGNpcmNsZSBjeD0iNDkuNSIgY3k9IjI2LjUiIHI9IjEuNSIgZmlsbD0iIzhmYTdjOCIvPgo8Y2lyY2xlIGN4PSI0OS4xIiBjeT0iMjYuMSIgcj0iLjYiIGZpbGw9IiNkYmU3ZjciLz4KPGNpcmNsZSBjeD0iMjQiIGN5PSI1MiIgcj0iMS41IiBmaWxsPSIjOGZhN2M4Ii8+CjxjaXJjbGUgY3g9IjIzLjYiIGN5PSI1MS42IiByPSIuNiIgZmlsbD0iI2RiZTdmNyIvPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjMwIiByPSIxLjUiIGZpbGw9IiM4ZmE3YzgiLz4KPGNpcmNsZSBjeD0iMTEuNiIgY3k9IjI5LjYiIHI9Ii42IiBmaWxsPSIjZGJlN2Y3Ii8+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMyIDMyLjUpIHNjYWxlKDEuMykgdHJhbnNsYXRlKC0zMS41IC0zMi41KSI+CjxwYXRoIGQ9Ik0yMyAxNy41aDEzbDcgN3YyMGEzIDMgMCAwIDEtMyAzSDIzYTMgMyAwIDAgMS0zLTN2LTI0YTMgMyAwIDAgMSAzLTNaIiBmaWxsPSIjMDQxMzFkIiBzdHJva2U9IiMzNmQ2ZmYiIHN0cm9rZS13aWR0aD0iMS4yIiBmaWx0ZXI9InVybCgjYjZnKSIvPgo8cGF0aCBkPSJNMzYgMTcuNXY0LjVhMi41IDIuNSAwIDAgMCAyLjUgMi41SDQzWiIgZmlsbD0iIzFhNmY4NSIvPgo8ZyBmaWx0ZXI9InVybCgjYjZnKSIgc3Ryb2tlPSIjMzZkNmZmIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+CjxwYXRoIGQ9Im0yNC41IDI3LjUgNSA0LjMtNSA0LjMiLz4KPHBhdGggZD0iTTMxLjggNDBoNi4yIi8+CjwvZz4KPHBhdGggZD0iTTIyLjUgMjIuNWgxME0yMi41IDQ0LjJoMTciIHN0cm9rZT0iIzM2ZDZmZiIgc3Ryb2tlLXdpZHRoPSIuNSIgb3BhY2l0eT0iLjQ1Ii8+CjwvZz4KPC9zdmc+Cg==`,Fx=new URL(`nebula-t0QcaA3K.webp`,import.meta.url).href,Ix=new URL(`star-chart-Chk7Xt5X.svg`,import.meta.url).href,Lx=new URL(`starfield-BM71b4P5.svg`,import.meta.url).href,Rx=e=>new URL(Object.assign({"../../themes/starship/assets/computer.svg":jx,"../../themes/starship/assets/empty-sector.webp":Mx,"../../themes/starship/assets/lightspeed.svg":Nx,"../../themes/starship/assets/mark.svg":Px,"../../themes/starship/assets/nebula.webp":Fx,"../../themes/starship/assets/star-chart.svg":Ix,"../../themes/starship/assets/starfield.svg":Lx})[`../../themes/starship/assets/${e}`],import.meta.url).href;function zx(){return(0,q.jsxs)(`span`,{className:`hud-corners`,"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{className:`hud-corner hud-corner--tl`}),(0,q.jsx)(`i`,{className:`hud-corner hud-corner--tr`}),(0,q.jsx)(`i`,{className:`hud-corner hud-corner--bl`}),(0,q.jsx)(`i`,{className:`hud-corner hud-corner--br`})]})}function Bx({children:e}){let t=cx();return(0,q.jsxs)(`div`,{className:`bubble bubble--agent starship-computer`,children:[(0,q.jsxs)(`p`,{className:`starship-voice`,children:[(0,q.jsx)(`img`,{src:Rx(`computer.svg`),alt:``,width:24,height:24,loading:`lazy`,decoding:`async`}),t(`agent`,`Agent`)]}),e]})}var Vx={Panel:({children:e})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(zx,{}),e]}),Header:({children:e})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(zx,{}),e]}),ChatMessage:({from:e,children:t})=>e===`agent`?(0,q.jsx)(Bx,{children:t}):(0,q.jsx)(`div`,{className:`bubble bubble--you`,children:t}),EmptyState:({message:e,children:t})=>(0,q.jsxs)(`div`,{className:`skin-empty skin-empty--art starship-empty`,children:[(0,q.jsx)(`img`,{src:Rx(`empty-sector.webp`),alt:``,width:240,height:160,loading:`lazy`,decoding:`async`}),(0,q.jsx)(`p`,{children:e}),t]}),Loading:({message:e})=>(0,q.jsxs)(`div`,{className:`skin-loading skin-empty--art starship-jump`,role:`status`,children:[(0,q.jsx)(`img`,{src:Rx(`lightspeed.svg`),alt:``,width:240,height:120,loading:`lazy`,decoding:`async`}),(0,q.jsx)(`p`,{children:e})]})},Hx={Card:({children:e})=>e,Panel:({children:e})=>e,Avatar:Fb,ChatMessage:({from:e,children:t})=>(0,q.jsx)(`div`,{className:`bubble bubble--${e}`,children:t}),EmptyState:({message:e,children:t})=>(0,q.jsxs)(`div`,{className:`skin-empty`,children:[(0,q.jsx)(`p`,{children:e}),t]}),Loading:({message:e})=>(0,q.jsx)(`p`,{className:`skin-loading`,role:`status`,children:e}),Header:({children:e})=>e},Ux={crate:Rb,harvest:gx,starship:Vx,realm:Ax},Wx=e=>({...Hx,...Ux[e]}),Gx=(0,v.createContext)(Hx),Kx=Gx.Provider,qx=()=>(0,v.useContext)(Gx),Jx=new URL(`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gVG9pbCBVSSdzIG1hcmsgaW4gYW55IHRoZW1lIHRoYXQgYnJpbmdzIG5vbmUgb2YgaXRzIG93biwgc3VjaCBhcyBvbmUgZnJvbSB0aGUgdXNlcidzIGZvbGRlcjogdGhlIHN0YW5kYXJkIGJhZGdlLCB0aGUgc2l0ZSdzIGZhdmljb24uIC0tPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJiMiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSI4IiB5MT0iNTgiIHgyPSI1OCIgeTI9IjgiPgo8c3RvcCBvZmZzZXQ9Ii4wOCIgc3RvcC1jb2xvcj0iI2ZmNmEzZCIvPgo8c3RvcCBvZmZzZXQ9Ii45MiIgc3RvcC1jb2xvcj0iI2ZmYjg0ZCIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+CjxwYXRoIGQ9Ik0xOCA2SDQyTDU4IDIyVjQ2QTEyIDEyIDAgMCAxIDQ2IDU4SDE4QTEyIDEyIDAgMCAxIDYgNDZWMThBMTIgMTIgMCAwIDEgMTggNloiIGZpbGw9InVybCgjYjIpIi8+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMyIDMyLjUpIHNjYWxlKDEuMykgdHJhbnNsYXRlKC0zMS41IC0zMi41KSI+CjxwYXRoIGQ9Ik0yMyAxNy41aDEzbDcgN3YyMGEzIDMgMCAwIDEtMyAzSDIzYTMgMyAwIDAgMS0zLTN2LTI0YTMgMyAwIDAgMSAzLTNaIiBmaWxsPSIjZjZmMWU5Ii8+CjxwYXRoIGQ9Ik0zNiAxNy41djQuNWEyLjUgMi41IDAgMCAwIDIuNSAyLjVINDNaIiBmaWxsPSIjMTYxMzBmIi8+CjxwYXRoIGQ9Im0yNC41IDI3LjUgNSA0LjMtNSA0LjMiIHN0cm9rZT0iIzE2MTMwZiIgc3Ryb2tlLXdpZHRoPSIzLjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMzEuOCA0MGg2LjIiIHN0cm9rZT0iI2M0M2QxMiIgc3Ryb2tlLXdpZHRoPSIzLjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L2c+Cjwvc3ZnPgo=`,``+import.meta.url).href,Yx={plain:{light:new URL(`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gUGxhaW4ncyBiYWRnZSwgbGlnaHQgc2NoZW1lOiB0aGUgYmFkZ2UncyBzaWxob3VldHRlIGluIFBsYWluJ3Mgb3duIGFjY2VudCwgYSB3aGl0ZSBwYWdlLCBQbGFpbidzIGluayBmb3IgdGhlIGNoZXZyb24gYW5kIGl0cyBhY2NlbnQgZm9yIHRoZSBjdXJzb3IgKDE2LjY6MSBhbmQgNi43OjEgb24gdGhlIHBhZ2U7IHRoZSBwYWdlIGlzIDYuNzoxIG9uIHRoZSB0aWxlKS4gLS0+CjxwYXRoIGQ9Ik0xOCA2SDQyTDU4IDIyVjQ2QTEyIDEyIDAgMCAxIDQ2IDU4SDE4QTEyIDEyIDAgMCAxIDYgNDZWMThBMTIgMTIgMCAwIDEgMTggNloiIGZpbGw9IiMwYjVjYWQiLz4KPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIgMzIuNSkgc2NhbGUoMS4zKSB0cmFuc2xhdGUoLTMxLjUgLTMyLjUpIj4KPHBhdGggZD0iTTIzIDE3LjVoMTNsNyA3djIwYTMgMyAwIDAgMS0zIDNIMjNhMyAzIDAgMCAxLTMtM3YtMjRhMyAzIDAgMCAxIDMtM1oiIGZpbGw9IiNmZmZmZmYiLz4KPHBhdGggZD0iTTM2IDE3LjV2NC41YTIuNSAyLjUgMCAwIDAgMi41IDIuNUg0M1oiIGZpbGw9IiMxYjFmMjQiLz4KPHBhdGggZD0ibTI0LjUgMjcuNSA1IDQuMy01IDQuMyIgc3Ryb2tlPSIjMWIxZjI0IiBzdHJva2Utd2lkdGg9IjMuNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0zMS44IDQwaDYuMiIgc3Ryb2tlPSIjMGI1Y2FkIiBzdHJva2Utd2lkdGg9IjMuNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CjwvZz4KPC9zdmc+Cg==`,``+import.meta.url).href,dark:new URL(`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gUGxhaW4ncyBiYWRnZSwgZGFyayBzY2hlbWU6IHRoZSB0aWxlIGluIFBsYWluJ3MgZGFyayBhY2NlbnQsIGEgZGFyayBwYWdlLCBQbGFpbidzIGluayBmb3IgdGhlIGNoZXZyb24gYW5kIHRoZSBhY2NlbnQgZm9yIHRoZSBjdXJzb3IgKDE1LjU6MSBhbmQgMTAuMjoxIG9uIHRoZSBwYWdlOyB0aGUgcGFnZSBpcyAxMC4yOjEgb24gdGhlIHRpbGUpLiAtLT4KPHBhdGggZD0iTTE4IDZINDJMNTggMjJWNDZBMTIgMTIgMCAwIDEgNDYgNThIMThBMTIgMTIgMCAwIDEgNiA0NlYxOEExMiAxMiAwIDAgMSAxOCA2WiIgZmlsbD0iIzhjYzRmZiIvPgo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzMiAzMi41KSBzY2FsZSgxLjMpIHRyYW5zbGF0ZSgtMzEuNSAtMzIuNSkiPgo8cGF0aCBkPSJNMjMgMTcuNWgxM2w3IDd2MjBhMyAzIDAgMCAxLTMgM0gyM2EzIDMgMCAwIDEtMy0zdi0yNGEzIDMgMCAwIDEgMy0zWiIgZmlsbD0iIzBiMTIyMCIvPgo8cGF0aCBkPSJNMzYgMTcuNXY0LjVhMi41IDIuNSAwIDAgMCAyLjUgMi41SDQzWiIgZmlsbD0iI2U4ZWFlZCIvPgo8cGF0aCBkPSJtMjQuNSAyNy41IDUgNC4zLTUgNC4zIiBzdHJva2U9IiNlOGVhZWQiIHN0cm9rZS13aWR0aD0iMy40IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTMxLjggNDBoNi4yIiBzdHJva2U9IiM4Y2M0ZmYiIHN0cm9rZS13aWR0aD0iMy40IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPC9nPgo8L3N2Zz4K`,``+import.meta.url).href},crate:new URL(`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gQ3JhdGUncyBiYWRnZToga3JhZnQgY2FyZGJvYXJkIHdpdGggYSBoYXphcmQtc3RyaXBlZCB0YXBlLCBhbmQgdGhlIHBhZ2UgYXMgYSBzaGlwcGluZyBsYWJlbCB3aXRoIGEgc3RlbmNpbGxlZCBwcm9tcHQuIFRoZSBiYWRnZSdzIHNpbGhvdWV0dGUsIHNraW5uZWQuIC0tPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJiNGMiPgo8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIi8+CjwvY2xpcFBhdGg+CjxsaW5lYXJHcmFkaWVudCBpZD0iYjRrIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Q0YTQ2NyIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNiMDdiM2YiLz4KPC9saW5lYXJHcmFkaWVudD4KPGZpbHRlciBpZD0iYjRmIiB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj4KPGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuMDYgMC45IiBudW1PY3RhdmVzPSIyIiBzZWVkPSI3Ii8+CjxmZUNvbG9yTWF0cml4IHZhbHVlcz0iMCAwIDAgMCAwLjM1ICAwIDAgMCAwIDAuMjIgIDAgMCAwIDAgMC4wOCAgMCAwIDAgMC41NSAtMC4xMiIvPgo8ZmVDb21wb3NpdGUgaW4yPSJTb3VyY2VHcmFwaGljIiBvcGVyYXRvcj0iaW4iLz4KPC9maWx0ZXI+CjxwYXR0ZXJuIGlkPSJiNGgiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPgo8cmVjdCB3aWR0aD0iNiIgaGVpZ2h0PSI2IiBmaWxsPSIjZmZiODRkIi8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjYiIGZpbGw9IiMyYTFmMTIiLz4KPC9wYXR0ZXJuPgo8L2RlZnM+CjxnIGNsaXAtcGF0aD0idXJsKCNiNGMpIj4KICA8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIiBmaWxsPSJ1cmwoI2I0aykiLz4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNiNGYpIi8+CiAgPHBhdGggZD0iTTYgMjIuNUg1OCIgc3Ryb2tlPSIjOGE1YTJiIiBzdHJva2Utd2lkdGg9Ii44IiBvcGFjaXR5PSIuNTUiLz4KPC9nPgo8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIiBzdHJva2U9IiM3YTRkMjIiIHN0cm9rZS13aWR0aD0iMS40IiBmaWxsPSJub25lIi8+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMyIDMyLjUpIHNjYWxlKDEuMykgdHJhbnNsYXRlKC0zMS41IC0zMi41KSI+CjxwYXRoIGQ9Ik0yMyAxNy41aDEzbDcgN3YyMGEzIDMgMCAwIDEtMyAzSDIzYTMgMyAwIDAgMS0zLTN2LTI0YTMgMyAwIDAgMSAzLTNaIiBmaWxsPSIjZjNlYWQ4IiBzdHJva2U9IiM3YTRkMjIiIHN0cm9rZS13aWR0aD0iLjkiLz4KPHBhdGggZD0iTTM2IDE3LjV2NC41YTIuNSAyLjUgMCAwIDAgMi41IDIuNUg0M1oiIGZpbGw9IiM5YTZhMzUiLz4KPHBhdGggZD0ibTI0LjUgMjcuNSA1IDQuMy01IDQuMyIgc3Ryb2tlPSIjMWYxNjBkIiBzdHJva2Utd2lkdGg9IjMuNiIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIvPgo8cGF0aCBkPSJNMzEuOCA0MGg2LjIiIHN0cm9rZT0iIzFmMTYwZCIgc3Ryb2tlLXdpZHRoPSIzLjYiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiLz4KPHBhdGggZD0iTTI4LjQgMzEuOEgzMU0zNC45IDM4VjQyIiBzdHJva2U9IiNmM2VhZDgiIHN0cm9rZS13aWR0aD0iMSIvPgo8L2c+CjxnIGNsaXAtcGF0aD0idXJsKCNiNGMpIj4KPHJlY3QgeD0iMCIgeT0iNDYuNSIgd2lkdGg9IjY0IiBoZWlnaHQ9IjciIGZpbGw9InVybCgjYjRoKSIgb3BhY2l0eT0iLjkyIi8+CjxyZWN0IHg9IjAiIHk9IjQ2LjUiIHdpZHRoPSI2NCIgaGVpZ2h0PSI3IiBmaWxsPSIjZmZmIiBvcGFjaXR5PSIuMTIiLz4KPHBhdGggZD0iTTAgNDYuNUg2NE0wIDUzLjVINjQiIHN0cm9rZT0iIzJhMWYxMiIgc3Ryb2tlLXdpZHRoPSIuNiIgb3BhY2l0eT0iLjYiLz4KPC9nPgo8L3N2Zz4K`,``+import.meta.url).href,harvest:new URL(new URL(`mark-bSC__Aar.svg`,import.meta.url).href,``+import.meta.url).href,starship:new URL(`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gU3RhcnNoaXAncyBiYWRnZTogYSByaXZldGVkIGh1bGwgcGxhdGUsIHRoZSBwYWdlIGEgY29uc29sZSBzY3JlZW4gd2l0aCBhIGdsb3dpbmcgcHJvbXB0LiBUaGUgYmFkZ2UncyBzaWxob3VldHRlLCBza2lubmVkLiAtLT4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0iYjZzIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzRhNWY3ZCIvPgo8c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzI1MzI0YSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMxNDFjMmMiLz4KPC9saW5lYXJHcmFkaWVudD4KPGNsaXBQYXRoIGlkPSJiNmMiPgo8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIi8+CjwvY2xpcFBhdGg+CjxmaWx0ZXIgaWQ9ImI2ZyIgeD0iLTQwJSIgeT0iLTQwJSIgd2lkdGg9IjE4MCUiIGhlaWdodD0iMTgwJSI+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjEuMSIgcmVzdWx0PSJiIi8+CjxmZU1lcmdlPgo8ZmVNZXJnZU5vZGUgaW49ImIiLz4KPGZlTWVyZ2VOb2RlIGluPSJTb3VyY2VHcmFwaGljIi8+CjwvZmVNZXJnZT4KPC9maWx0ZXI+CjwvZGVmcz4KPHBhdGggZD0iTTE4IDZINDJMNTggMjJWNDZBMTIgMTIgMCAwIDEgNDYgNThIMThBMTIgMTIgMCAwIDEgNiA0NlYxOEExMiAxMiAwIDAgMSAxOCA2WiIgZmlsbD0idXJsKCNiNnMpIi8+CjxnIGNsaXAtcGF0aD0idXJsKCNiNmMpIiBzdHJva2U9IiMwYTEyMjIiIHN0cm9rZS13aWR0aD0iLjkiIG9wYWNpdHk9Ii43Ij4KPHBhdGggZD0iTTYgMjBINjRNNiA1Nkg2NE0xNiA2VjY0TTQ4IDZWNjQiLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjYjZjKSIgc3Ryb2tlPSIjN2Q5NmI4IiBzdHJva2Utd2lkdGg9Ii41IiBvcGFjaXR5PSIuNSI+CjxwYXRoIGQ9Ik02IDIwLjlINjRNMTYuOSA2VjY0Ii8+CjwvZz4KPHBhdGggZD0iTTE4IDYuNkg0MS44TDU3LjQgMjIuMlY0NkExMS40IDExLjQgMCAwIDEgNDYgNTcuNEgxOEExMS40IDExLjQgMCAwIDEgNi42IDQ2VjE4QTExLjQgMTEuNCAwIDAgMSAxOCA2LjZaIiBzdHJva2U9IiM4ZmE3YzgiIHN0cm9rZS13aWR0aD0iMS4xIiBvcGFjaXR5PSIuNzUiLz4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMS41IiBmaWxsPSIjOGZhN2M4Ii8+CjxjaXJjbGUgY3g9IjExLjYiIGN5PSIxMS42IiByPSIuNiIgZmlsbD0iI2RiZTdmNyIvPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjUyIiByPSIxLjUiIGZpbGw9IiM4ZmE3YzgiLz4KPGNpcmNsZSBjeD0iMTEuNiIgY3k9IjUxLjYiIHI9Ii42IiBmaWxsPSIjZGJlN2Y3Ii8+CjxjaXJjbGUgY3g9IjUyIiBjeT0iNTIiIHI9IjEuNSIgZmlsbD0iIzhmYTdjOCIvPgo8Y2lyY2xlIGN4PSI1MS42IiBjeT0iNTEuNiIgcj0iLjYiIGZpbGw9IiNkYmU3ZjciLz4KPGNpcmNsZSBjeD0iNDkuNSIgY3k9IjI2LjUiIHI9IjEuNSIgZmlsbD0iIzhmYTdjOCIvPgo8Y2lyY2xlIGN4PSI0OS4xIiBjeT0iMjYuMSIgcj0iLjYiIGZpbGw9IiNkYmU3ZjciLz4KPGNpcmNsZSBjeD0iMjQiIGN5PSI1MiIgcj0iMS41IiBmaWxsPSIjOGZhN2M4Ii8+CjxjaXJjbGUgY3g9IjIzLjYiIGN5PSI1MS42IiByPSIuNiIgZmlsbD0iI2RiZTdmNyIvPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjMwIiByPSIxLjUiIGZpbGw9IiM4ZmE3YzgiLz4KPGNpcmNsZSBjeD0iMTEuNiIgY3k9IjI5LjYiIHI9Ii42IiBmaWxsPSIjZGJlN2Y3Ii8+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMyIDMyLjUpIHNjYWxlKDEuMykgdHJhbnNsYXRlKC0zMS41IC0zMi41KSI+CjxwYXRoIGQ9Ik0yMyAxNy41aDEzbDcgN3YyMGEzIDMgMCAwIDEtMyAzSDIzYTMgMyAwIDAgMS0zLTN2LTI0YTMgMyAwIDAgMSAzLTNaIiBmaWxsPSIjMDQxMzFkIiBzdHJva2U9IiMzNmQ2ZmYiIHN0cm9rZS13aWR0aD0iMS4yIiBmaWx0ZXI9InVybCgjYjZnKSIvPgo8cGF0aCBkPSJNMzYgMTcuNXY0LjVhMi41IDIuNSAwIDAgMCAyLjUgMi41SDQzWiIgZmlsbD0iIzFhNmY4NSIvPgo8ZyBmaWx0ZXI9InVybCgjYjZnKSIgc3Ryb2tlPSIjMzZkNmZmIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+CjxwYXRoIGQ9Im0yNC41IDI3LjUgNSA0LjMtNSA0LjMiLz4KPHBhdGggZD0iTTMxLjggNDBoNi4yIi8+CjwvZz4KPHBhdGggZD0iTTIyLjUgMjIuNWgxME0yMi41IDQ0LjJoMTciIHN0cm9rZT0iIzM2ZDZmZiIgc3Ryb2tlLXdpZHRoPSIuNSIgb3BhY2l0eT0iLjQ1Ii8+CjwvZz4KPC9zdmc+Cg==`,``+import.meta.url).href,realm:new URL(`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSI+CjwhLS0gUmVhbG0ncyBiYWRnZTogdGhlIHRpbGUgYXMgYW4gaXJvbiBwbGF0ZSB3aXRoIGEgdGFybmlzaGVkLWdvbGQgcnVsZSBhbmQgZm91ciByaXZldHMsIHRoZSBwYWdlIGFnZWQgdmVsbHVtLiBUaGUgYmFkZ2UncyBzaWxob3VldHRlLCBza2lubmVkLiAtLT4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icjlpIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzRhNDY0MCIvPgo8c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzJhMjcyNCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMxNDExMGUiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJyOWciIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjYzlhODVlIi8+CjxzdG9wIG9mZnNldD0iLjUiIHN0b3AtY29sb3I9IiM5YzdhM2MiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjNWU0NTIwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icjlyIiBjeD0iLjM1IiBjeT0iLjM1IiByPSIuNyI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Q5YmQ3YSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM1ZTQ1MjAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPC9kZWZzPgo8cGF0aCBkPSJNMTggNkg0Mkw1OCAyMlY0NkExMiAxMiAwIDAgMSA0NiA1OEgxOEExMiAxMiAwIDAgMSA2IDQ2VjE4QTEyIDEyIDAgMCAxIDE4IDZaIiBmaWxsPSJ1cmwoI3I5aSkiLz4KPHBhdGggZD0iTTE4LjYgOS4ySDQwLjdMNTQuOCAyMy4zVjQ1LjRBOS40IDkuNCAwIDAgMSA0NS40IDU0LjhIMTguNkE5LjQgOS40IDAgMCAxIDkuMiA0NS40VjE4LjZBOS40IDkuNCAwIDAgMSAxOC42IDkuMloiIHN0cm9rZT0idXJsKCNyOWcpIiBzdHJva2Utd2lkdGg9IjEuNCIvPgo8ZyBmaWxsPSJ1cmwoI3I5cikiPjxjaXJjbGUgY3g9IjEzLjQiIGN5PSIxMy40IiByPSIxLjkiLz48Y2lyY2xlIGN4PSIxMy40IiBjeT0iNTAuNiIgcj0iMS45Ii8+PGNpcmNsZSBjeD0iNTAuNiIgY3k9IjUwLjYiIHI9IjEuOSIvPjxjaXJjbGUgY3g9IjQ2LjIiIGN5PSIxMy40IiByPSIxLjYiLz48L2c+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMyIDMyLjYpIHNjYWxlKDEuMjIpIHRyYW5zbGF0ZSgtMzEuNSAtMzIuNSkiPgo8cGF0aCBkPSJNMjMgMTcuNWgxM2w3IDd2MjBhMyAzIDAgMCAxLTMgM0gyM2EzIDMgMCAwIDEtMy0zdi0yNGEzIDMgMCAwIDEgMy0zWiIgZmlsbD0iI2Q4Y2JiMCIgc3Ryb2tlPSIjNWU0NTIwIiBzdHJva2Utd2lkdGg9Ii44Ii8+CjxwYXRoIGQ9Ik0zNiAxNy41djQuNWEyLjUgMi41IDAgMCAwIDIuNSAyLjVINDNaIiBmaWxsPSIjOWM3YTNjIi8+CjxwYXRoIGQ9Im0yNC41IDI3LjUgNSA0LjMtNSA0LjMiIHN0cm9rZT0iIzE0MTEwZSIgc3Ryb2tlLXdpZHRoPSIzLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMzEuOCA0MGg2LjIiIHN0cm9rZT0iIzZlMWMxOCIgc3Ryb2tlLXdpZHRoPSIzLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L2c+Cjwvc3ZnPgo=`,``+import.meta.url).href};function Xx(e,t=`light`){let n=Yx[e];return n?typeof n==`string`?n:n[t]:Jx}function Zx(e,t=`light`,n=document){let r=n.querySelector(`link[rel="icon"]`);r||(r=n.createElement(`link`),r.rel=`icon`,n.head.append(r)),r.type=`image/svg+xml`,r.href=Xx(e,t)}var Qx=[`system`,`light`,`dark`],$x=`toil-ui.theme`;function eS(){try{let e=JSON.parse(localStorage.getItem($x)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}}function tS(e,t){return e===`off`?!1:e===`on`||typeof t!=`boolean`||t}function nS(e){let t=new URLSearchParams(e),n=eS();return{theme:[t.get(`theme`),n.theme].find(e=>sp.some(t=>t.name===e))??`crate`,scheme:[t.get(`scheme`),n.scheme].find(e=>Qx.includes(e))??`system`,wording:tS(t.get(`wording`),n.wording),voice:tS(t.get(`voice`),n.voice)}}function rS(){let[e,t]=(0,v.useState)(()=>nS(window.location.search));return(0,v.useEffect)(()=>{up(e.theme),document.documentElement.dataset.theme=e.theme,document.documentElement.dataset.scheme=e.scheme;try{localStorage.setItem($x,JSON.stringify(e))}catch{}let t=window.matchMedia?.(`(prefers-color-scheme: dark)`),n=()=>Zx(e.theme,e.scheme===`system`?t?.matches?`dark`:`light`:e.scheme);return n(),t?.addEventListener(`change`,n),()=>t?.removeEventListener(`change`,n)},[e]),{...e,setTheme:e=>t(t=>({...t,theme:e})),setScheme:e=>t(t=>({...t,scheme:e})),setWording:e=>t(t=>({...t,wording:e})),setVoice:e=>t(t=>({...t,voice:e}))}}var iS=1500,aS=`a scripted preview, not a model`,oS=`No agent is set up in this Toil UI, so nobody can answer yet. Toil UI reasons with the subscription you already have, through one of three adapters: Claude (the Claude Agent SDK, @anthropic-ai/claude-agent-sdk), GitHub Copilot (@github/copilot-sdk) or Codex (@openai/codex-sdk).`,sS=`Press Install for the one your organization approves under Settings, Agent, with its CLI on PATH, and choose it there, or pick an installed one for this chat from Answered by, above. The dashboards work without one, and toil-ui --sample shows the scripted agent.`,cS=`analyze`,lS=/\[\[([^\]]+)\]\]/g;function uS(e){let t=[],n=0;for(let r of e.matchAll(lS))r.index>n&&t.push({text:e.slice(n,r.index)}),t.push({cite:r[1]}),n=r.index+r[0].length;return n<e.length&&t.push({text:e.slice(n)}),t}function dS({id:e,withTitle:t=!1}){let{byId:n,prById:r,dossier:i}=J(),a=n.get(e),o=a?void 0:r?.get(e);return o?(0,q.jsx)(fS,{change:o,withTitle:t}):a?(0,q.jsxs)(`a`,{href:jm(i.name,e),className:`item-link`,children:[(0,q.jsxs)(`span`,{className:`key`,children:[(0,q.jsx)(`span`,{className:`source`,children:Cm(a.source.area)}),` `,wm(a)]}),t&&(0,q.jsxs)(`span`,{className:`title`,children:[` `,a.title]})]}):(0,q.jsx)(`code`,{className:`missing`,children:e})}function fS({change:e,withTitle:t=!1}){let n=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`key`,children:[(0,q.jsx)(`span`,{className:`source`,children:Cm(e.source.area)}),` `,Hm(e.id)]}),t&&(0,q.jsxs)(`span`,{className:`title`,children:[` `,e.title]})]});return e.url?(0,q.jsx)(`a`,{href:e.url,className:`item-link`,children:n}):(0,q.jsx)(`span`,{className:`item-link`,children:n})}function pS({text:e}){return(0,q.jsx)(q.Fragment,{children:uS(e).map((e,t)=>`cite`in e?(0,q.jsx)(dS,{id:e.cite},t):(0,q.jsx)(`span`,{children:e.text},t))})}function mS(e,t){let n=e.type.charAt(0)+e.type.slice(1).toLowerCase(),r=e.typeName&&e.typeName.toLowerCase()!==n.toLowerCase()?`${e.typeName} (${n})`:n;return t?.terms?.epic&&e.type===`EPIC`?sx(t,`epic`,e.typeName??n):r}var hS=(...e)=>e.filter(Boolean).join(` `);function gS({as:e,gap:t=`md`,className:n,...r}){return(0,q.jsx)(e??`div`,{className:hS(`l-stack`,n),"data-gap":t,...r})}function _S({as:e,gap:t=`sm`,className:n,...r}){return(0,q.jsx)(e??`div`,{className:hS(`l-cluster`,n),"data-gap":t,...r})}function vS({as:e,min:t=`md`,className:n,...r}){return(0,q.jsx)(e??`ul`,{className:hS(`l-card-grid`,n),"data-min":t,...r})}function Q({as:e,className:t,...n}){return(0,q.jsx)(e??`article`,{className:hS(`l-card`,t),"data-card":``,...n})}function yS(){let e=(0,v.useRef)(null),[t,n]=(0,v.useState)({start:!1,end:!1}),r=(0,v.useCallback)(()=>{let t=e.current;if(!t)return;let r=t.scrollLeft>1,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;n(e=>e.start===r&&e.end===i?e:{start:r,end:i})},[]);return(0,v.useEffect)(()=>{let t=e.current;if(!t)return;r(),t.addEventListener(`scroll`,r,{passive:!0});let n=typeof ResizeObserver==`function`?new ResizeObserver(r):null;return n?.observe(t),t.firstElementChild&&n?.observe(t.firstElementChild),()=>{t.removeEventListener(`scroll`,r),n?.disconnect()}},[r]),{ref:e,edges:t,overflowing:t.start||t.end}}function bS({label:e,className:t,children:n,hint:r=`Scroll sideways for more.`}){let{ref:i,edges:a,overflowing:o}=yS(),s=(0,v.useId)();return(0,q.jsxs)(`div`,{className:hS(`l-scroll`,t),"data-more-start":a.start||void 0,"data-more-end":a.end||void 0,children:[(0,q.jsx)(`div`,{ref:i,className:`l-scroll__body`,"data-scroller":``,role:`region`,"aria-label":e,tabIndex:o?0:void 0,"aria-describedby":o?s:void 0,children:n}),o&&(0,q.jsx)(`span`,{id:s,className:`sr-only`,children:r})]})}function xS({label:e,caption:t,columns:n,rows:r,rowKey:i,wide:a=!1,className:o}){return(0,q.jsx)(`div`,{className:hS(`l-table`,o),"data-wide":a||void 0,children:(0,q.jsx)(bS,{label:e,hint:`Scroll sideways for more columns.`,children:(0,q.jsxs)(`table`,{role:`table`,children:[t&&(0,q.jsx)(`caption`,{className:`sr-only`,children:t}),(0,q.jsx)(`thead`,{role:`rowgroup`,children:(0,q.jsx)(`tr`,{role:`row`,children:n.map((e,t)=>(0,q.jsx)(`th`,{role:`columnheader`,scope:`col`,children:e.header},t))})}),(0,q.jsx)(`tbody`,{role:`rowgroup`,children:r.map(e=>(0,q.jsx)(`tr`,{role:`row`,children:n.map((t,n)=>{let r=t.rowHeader?`th`:`td`;return(0,q.jsxs)(r,{role:t.rowHeader?`rowheader`:`cell`,scope:t.rowHeader?`row`:void 0,children:[(0,q.jsx)(`span`,{className:`l-table__label`,"aria-hidden":`true`,children:t.label}),(0,q.jsx)(`span`,{className:`l-table__value`,children:t.cell(e)})]},n)})},i(e)))})]})})})}function SS(e){let t=e.replace(/[/\\]+$/,``).search(/[/\\][^/\\]*$/),n=t>0&&e.length-t<=40?t:Math.max(0,e.length-18);return[e.slice(0,n),e.slice(n)]}function CS({value:e,what:t}){let[n,r]=(0,v.useState)(null);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:`btn btn--small l-copy`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0)}catch{r(!1)}},"aria-label":`Copy ${t}`,children:`Copy`}),(0,q.jsx)(`span`,{role:`status`,className:`sr-only`,children:n===null?``:n?`Copied ${t}.`:`This browser wouldn't copy; select the ${t} instead.`})]})}function wS({value:e,what:t=`path`,copy:n=!0}){let[r,i]=SS(e);return(0,q.jsxs)(`span`,{className:`l-path`,children:[(0,q.jsxs)(`code`,{className:`l-path__text`,title:e,"data-truncate":``,children:[(0,q.jsx)(`span`,{className:`l-path__head`,children:r}),(0,q.jsx)(`span`,{className:`l-path__tail`,children:i})]}),n&&(0,q.jsx)(CS,{value:e,what:t})]})}function TS({value:e,what:t=`URL`,copy:n=!0}){return(0,q.jsx)(wS,{value:e,what:t,copy:n})}function ES(e){let[t,n]=(0,v.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(e).matches);return(0,v.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var DS=new Map([[`jira issue create`,{issueType:`--type`}],[`jira-cloud issue create`,{issueType:`--type`}]]),OS=(e,t)=>DS.get(e)?.[t]??`--${t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,kS={posix:`bash/zsh`,powershell:`PowerShell`},AS=/['\u2018\u2019\u201A\u201B]/g,jS=/[\r\n\u0085\u2028\u2029\0]/,MS=/[&|<>^%"]/;function NS(e,t){if(jS.test(e))return`it holds a line break`;let n=t===`powershell`?MS.exec(e)?.[0]:void 0;return n?`it holds ${n}, which cmd.exe acts on when PowerShell runs npm's toil.cmd shim`:null}function PS(e,t){return NS(e,t)?null:t===`posix`?`'${e.replace(/'/g,`'\\''`)}'`:`'${e.replace(AS,e=>e+e)}'`}var FS=new Set([`ado work-item create`,`ado work-item update`,`alation document create`,`alation document update`,`jira issue create`,`jira issue update`,`jira-cloud issue create`,`jira-cloud issue update`,`splitio flag update`,`splitio flag toggle-many`]),$=(e,...t)=>t.map(t=>[t,e]),IS=new Map([...$([`app`,`hash`],`contrast library get`),...$([`app`,`trace`],`contrast finding get`),...$([`app`],`contrast app findings`,`contrast app libraries`),...$([`buildId`],`saucelabs build get`,`saucelabs build jobs`),...$([`commentId`],`github pr delete-comment`,`github pr delete-review-comment`),...$([`commit`],`ado commit status`,`bitbucket commit status`,`bitbucket-cloud commit get`,`bitbucket-cloud commit status`),...$([`deviceId`],`saucelabs device get`),...$([`fileKeyOrUrl`],`figma file comments`,`figma file get`,`figma file versions`),...$([`flag`],`splitio flag archive`,`splitio flag get`,`splitio flag kill`,`splitio flag restore`,`splitio flag set-default`,`splitio flag set-rule`,`splitio flag toggle`,`splitio flag update`),...$([`id`,`attachmentId`],`ado work-item download`),...$([`id`,`commentId`],`bitbucket pr delete-comment`,`bitbucket pr reply`,`bitbucket pr resolve`,`bitbucket-cloud pr delete-comment`,`bitbucket-cloud pr reply`,`bitbucket-cloud pr resolve`),...$([`id`,`threadId`,`commentId`],`ado pr delete-comment`),...$([`id`,`threadId`],`ado pr reply`,`ado pr resolve`,`ado-cloud pr reply`,`ado-cloud pr resolve`),...$([`id`],`ado pipeline get`,`ado pipeline run`,`ado pr abandon`,`ado pr approve`,`ado pr builds`,`ado pr comment`,`ado pr comment-inline`,`ado pr comments`,`ado pr diff`,`ado pr files`,`ado pr get`,`ado pr merge`,`ado pr reviewers`,`ado pr unapprove`,`ado pr update`,`ado pr wait-for-author`,`ado run cancel`,`ado run get`,`ado run logs`,`ado work-item assign`,`ado work-item attach`,`ado work-item attachments`,`ado work-item comment`,`ado work-item comments`,`ado work-item get`,`ado work-item get-many`,`ado work-item history`,`ado work-item link`,`ado work-item tag`,`ado work-item transition`,`ado work-item untag`,`ado work-item update`,`ado-cloud backlog items`,`ado-cloud board get`,`ado-cloud pr abandon`,`ado-cloud pr approve`,`ado-cloud pr comment`,`ado-cloud pr comment-inline`,`ado-cloud pr comments`,`ado-cloud pr get`,`ado-cloud pr merge`,`ado-cloud pr reviewers`,`ado-cloud pr threads`,`ado-cloud pr unapprove`,`ado-cloud pr update`,`ado-cloud pr wait-for-author`,`ado-cloud sprint items`,`ado-cloud work-item comment`,`ado-cloud work-item comments`,`ado-cloud work-item get`,`ado-cloud work-item get-many`,`ado-cloud work-item history`,`ado-cloud work-item transition`,`ado-cloud work-item update`,`alation column get`,`alation datasource get`,`alation document get`,`alation document update`,`alation folder get`,`alation job get`,`alation schema get`,`alation table get`,`bitbucket pr add-reviewer`,`bitbucket pr approve`,`bitbucket pr builds`,`bitbucket pr comment`,`bitbucket pr comment-inline`,`bitbucket pr comments`,`bitbucket pr decline`,`bitbucket pr diff`,`bitbucket pr files`,`bitbucket pr get`,`bitbucket pr merge`,`bitbucket pr needs-work`,`bitbucket pr reviewers`,`bitbucket pr unapprove`,`bitbucket pr update`,`bitbucket-cloud pr approve`,`bitbucket-cloud pr builds`,`bitbucket-cloud pr comment`,`bitbucket-cloud pr comment-inline`,`bitbucket-cloud pr comments`,`bitbucket-cloud pr decline`,`bitbucket-cloud pr diff`,`bitbucket-cloud pr files`,`bitbucket-cloud pr get`,`bitbucket-cloud pr merge`,`bitbucket-cloud pr request-changes`,`bitbucket-cloud pr reviewers`,`bitbucket-cloud pr unapprove`,`bitbucket-cloud pr update`,`checkmarx project get`,`checkmarx scan get`,`checkmarx scan stats`,`confluence attachment delete`,`confluence attachment download`,`confluence page attach`,`confluence page attachments`,`confluence page children`,`confluence page comment`,`confluence page comments`,`confluence page delete`,`confluence page get`,`confluence page history`,`confluence page label`,`confluence page labels`,`confluence page unlabel`,`confluence page update`,`confluence-cloud attachment delete`,`confluence-cloud attachment download`,`confluence-cloud page attach`,`confluence-cloud page attachments`,`confluence-cloud page children`,`confluence-cloud page comment`,`confluence-cloud page comments`,`confluence-cloud page delete`,`confluence-cloud page get`,`confluence-cloud page history`,`confluence-cloud page label`,`confluence-cloud page labels`,`confluence-cloud page unlabel`,`confluence-cloud page update`,`dynatrace entity get`,`dynatrace problem get`,`dynatrace trace get`,`kibana dashboard export`,`kibana rule get`,`sde project get`,`splitio change-request get`),...$([`index`],`elasticsearch index count`,`elasticsearch index search`),...$([`jobId`],`saucelabs job assets`,`saucelabs job build`,`saucelabs job delete`,`saucelabs job get`,`saucelabs job stop`,`saucelabs job update`,`saucelabs rdc-job delete`,`saucelabs rdc-job get`,`saucelabs rdc-job stop`,`saucelabs rdc-job update`),...$([`key`,`attachmentId`],`jira issue download`,`jira-cloud issue download`),...$([`key`],`confluence space get`,`confluence-cloud space get`,`jira issue assign`,`jira issue attach`,`jira issue attachments`,`jira issue comment`,`jira issue comments`,`jira issue get`,`jira issue history`,`jira issue label`,`jira issue link`,`jira issue log-work`,`jira issue set-sprint`,`jira issue transition`,`jira issue transitions`,`jira issue unlabel`,`jira issue update`,`jira-cloud issue assign`,`jira-cloud issue attach`,`jira-cloud issue attachments`,`jira-cloud issue comment`,`jira-cloud issue comments`,`jira-cloud issue get`,`jira-cloud issue history`,`jira-cloud issue label`,`jira-cloud issue link`,`jira-cloud issue log-work`,`jira-cloud issue set-sprint`,`jira-cloud issue transition`,`jira-cloud issue transitions`,`jira-cloud issue unlabel`,`jira-cloud issue update`),...$([`method`,`path`],`ado-cloud api`,`bitbucket-cloud api`,`jira api`),...$([`name`,`number`],`artifactory build get`,`jenkins run get`,`jenkins run logs`),...$([`name`],`ado project get`,`ado-cloud project get`,`artifactory build runs`,`jenkins pipeline get`,`jenkins pipeline run`,`jenkins pipeline runs`),...$([`number`,`commentId`],`github pr reply`),...$([`number`],`github issue assign`,`github issue get`,`github issue history`,`github issue label`,`github issue unassign`,`github issue unlabel`,`github pr add-reviewers`,`github pr approve`,`github pr close`,`github pr comment`,`github pr comment-inline`,`github pr comments`,`github pr diff`,`github pr disable-auto-merge`,`github pr draft`,`github pr enable-auto-merge`,`github pr enqueue`,`github pr files`,`github pr get`,`github pr merge`,`github pr ready`,`github pr remove-reviewers`,`github pr reopen`,`github pr request-changes`,`github pr review-comments`,`github pr reviewers`,`github pr reviews`,`github pr status`,`github pr threads`,`github pr update`),...$([`path`],`bitbucket-cloud file get`,`bitbucket-cloud file list`,`github repo file`),...$([`pipeline`,`step`],`bitbucket-cloud pipeline logs`),...$([`pipeline`],`bitbucket-cloud pipeline get`,`bitbucket-cloud pipeline steps`),...$([`plugin`],`skills marketplace disable`,`skills marketplace enable`,`skills marketplace sync`),...$([`pod`],`openshift pod logs`),...$([`project`],`github project fields`,`github project items`,`jira-cloud project get`),...$([`projectId`],`figma project files`),...$([`publicId`],`sonatypeiq application get`),...$([`query`],`alation search`),...$([`ref`],`github commit checks`,`github commit status`),...$([`repo`,`path`,`keyvals`],`artifactory artifact set-properties`),...$([`repo`,`path`],`artifactory artifact get`,`artifactory artifact properties`),...$([`repository`],`logscale repository query`),...$([`sessionId`,`app`],`saucelabs session install-app`),...$([`sessionId`,`command`],`saucelabs session shell`),...$([`sessionId`,`url`],`saucelabs session open-url`),...$([`sessionId`],`saucelabs session appium`,`saucelabs session delete`,`saucelabs session end-test`,`saucelabs session get`,`saucelabs session installations`,`saucelabs session launch-app`,`saucelabs session network`,`saucelabs session network-profiles`,`saucelabs session settings`,`saucelabs session start-test`,`saucelabs session tests`,`saucelabs session uninstall-app`),...$([`sql`],`db execute`,`db lint`,`db query`),...$([`table`],`db table describe`,`db table preview`),...$([`task`],`sde task get`),...$([`teamId`],`saucelabs team get`,`saucelabs team members`),...$([`threadId`],`github pr resolve`),...$([`tunnelId`],`saucelabs tunnel get`,`saucelabs tunnel jobs`,`saucelabs tunnel stop`)]),LS=e=>e.replace(/[ -]/g,`_`);function RS(e,t){return!e.command||!e.input?{line:null,reason:`toil has no command for this change.`}:VS(e.command,e.input,t,!0)}function zS(e,t){return VS(e.command,e.input,t,!1)}function BS(e,t,n){let r=[];FS.has(e)&&r.push(`put the input in a file and pass it with toil ${e}'s --input-file`),t&&r.push(`switch this card to bash/zsh, where single quotes carry it`),r.push(`apply it over MCP with the tool ${n} and the input below`);let i=r.length===1?r[0]:`${r.slice(0,-1).join(`, `)}, or ${r.at(-1)}`;return`${i.charAt(0).toUpperCase()}${i.slice(1)}.`}function VS(e,t,n,r){let i=IS.get(e)??[],a=Object.keys(t).filter(e=>!i.includes(e)).sort((e,t)=>e===`dossier`?-1:+(t===`dossier`)),o=(i,a,o)=>{let s={tool:LS(e),input:r?{...t,allowWrite:!0}:t};return{line:null,reason:`The ${i} value can't be passed safely on a ${kS[n]} command line: ${a}. ${BS(e,o,s.tool)}`,mcp:s}},s=[];for(let r of[...i.filter(e=>e in t),...a]){let a=t[r],c=i.includes(r),l=OS(e,r),u=c?`<${r}>`:l;for(let e of Array.isArray(a)?a:[a]){if(e===!0&&!c){s.push(l);continue}let t=String(e),r=NS(t,n);if(r)return o(u,r,n===`powershell`&&!r.includes(`line break`));if(c&&t.startsWith(`-`))return o(u,`it starts with -, so toil would read it as a flag`,!1);c?s.push(PS(t,n)):s.push(t.startsWith(`-`)?PS(`${l}=${t}`,n):`${l} ${PS(t,n)}`)}}return{line:`toil ${e} ${s.join(` `)}${r?` --allow-write`:``}`,reason:null}}function HS(e=typeof navigator>`u`?void 0:navigator){let t=e?.userAgentData?.platform||e?.platform||``;return/^win/i.test(t)?`powershell`:`posix`}var US=`https://imagile-dev.github.io/toil`,WS={dossiers:{title:`dossiers`,text:`A dossier names the repositories, tracker, pipelines and environments of one body of work. Each card is read from the cache a sync filled, so opening this page asks no tracker anything.`,page:`/docs/ui/`,anchor:`the-dossiers-view`},dashboard:{title:`this dashboard`,text:`Every panel is read through toil, read-only, and says which commands fed it. A call that failed shows on its own panel with toil's message and fix.`,page:`/docs/ui/`,anchor:`what-it-reads`},insights:{title:`insights`,text:`An insight is something about an item that deserves a look, such as Blocked, Stale or Build failing, weightiest first. Each one names the field, history or command it rests on.`,page:`/docs/ui/`,anchor:`insights`},prs:{title:`pull requests`,text:`Read from every code host the dossier names, the open ones ranked by how long each has waited and on what. Flow figures are the team's, never one person's.`,page:`/docs/ui/`,anchor:`pull-requests`},people:{title:`the People view`,text:`What is on each person's plate, from the dossier's people section and the same items and pull requests as the dashboard. It never ranks or scores anyone.`,page:`/docs/ui/`,anchor:`people`},readiness:{title:`the Command Center`,text:`Each verdict is worked out from the cached records, with no model call and no live read. Only ready items are slated, in the dossier's order.`,page:`/docs/ui/`,anchor:`readiness-and-the-command-center`},worklog:{title:`the worklog`,text:`One page a day, folded by code from the sync, the pull requests, the builds and the agent's runs: facts only, each line linked to where it came from. Days and times are UTC.`,page:`/docs/ui/`,anchor:`worklog`},standup:{title:`the stand-up`,text:`Built by code from the worklog's days, facts only, so the same days always give the same report. Days and times are UTC.`,page:`/docs/ui/`,anchor:`stand-up`},proposal:{title:`the write gate`,text:`Nothing changes until you run the command yourself. toil's write gate then needs writes on for the connection and --allow-write on the call.`,page:`/docs/core/`,anchor:`writes`},settings:{title:`toil's configuration`,text:`Changes run toil's own connections and dossiers commands, never an edit to a file, and each is in toil's audit log as toil-ui. Nothing here writes to a tracker.`,page:`/docs/ui/`,anchor:`toils-configuration`},connections:{title:`connections`,text:`A connection is one instance of an area: its host, its credential and whether writes are on. toil connections list never returns a secret, which stays in the OS credential store.`,page:`/docs/core/`,anchor:`configuration`},"dossier-setup":{title:`dossier setup`,text:`Each form runs one toil dossiers command, which checks the file before writing it and refuses to add what's already there unless you tick Replace. A dossier holds no secret and can't turn writes on.`,page:`/docs/dossiers/`,anchor:`create-check-use-share`},"dossier-list":{title:`where dossiers come from`,text:`Your own dossiers, any folders you listed, and the ones a repository checks in. Check finds problems without contacting any service.`,page:`/docs/dossiers/`,anchor:`where-dossiers-live`},"repo-setup":{title:`setting up a repo`,text:`For a repository with a dossier checked in: which of your connections each area would use, the ones still missing, and one test read through each. It changes nothing.`,page:`/docs/dossiers/`,anchor:`onboarding-to-a-repo-that-has-a-dossier`},bounds:{title:`bounds and the time limit`,text:`toil has no command to change these, and Toil UI never edits toil's files, so they're shown as toil reports them. Only your own config file can relax a bound, and only the file workspace.`,page:`/docs/core/`,anchor:`files-and-the-workspace`},audit:{title:`usage of toil`,text:`From toil audit stats, which reads only toil's audit log on this machine and sends it nowhere. It counts the command, how it was called and how it ended, never what a call was given or got back.`,page:`/docs/core/`,anchor:`the-audit-log`},"audit-failures":{title:`failures`,text:`The log keeps each failure's error code, never its message, so the fix shown is the one that usually applies to that code.`,page:`/docs/core/`,anchor:`the-audit-log`},"model-usage":{title:`the agent's usage`,text:`Figures the Claude, Codex and Copilot SDKs reported, kept only in Toil UI's local cache and sent nowhere. A figure an SDK didn't report reads not reported; your vendor's bill is the authority.`,page:`/docs/ui/`,anchor:`what-the-agents-models-used`},caps:{title:`caps`,text:`At 80% the chat says so; at 100% the question stops, naming the cap. A cap counts only what the SDK reports, so it guards against a runaway and is not a budget.`,page:`/docs/ui/`,anchor:`what-the-agents-models-used`},agent:{title:`the agent`,text:`The agent your organization already approved answers in the chat, on your own subscription, and only reads. These are Toil UI's own settings, kept in its data folder, never in toil's config.`,page:`/docs/ui/`,anchor:`the-agent`},assignments:{title:`assigning work to an agent`,text:`An assignment runs on your adapter, within your time limit and usage caps. Nothing it proposes leaves this machine until you apply it through toil's write gate.`,page:`/docs/ui/`,anchor:`assigning-work-to-an-agent`},"themed-wording":{title:`themed wording`,text:`The theme's own lede, eyebrows, notes, empty states and loading lines, and its names for a sprint, a board or an epic beside the real ones. Buttons, links, figures, ids, commands and errors always read the same.`,page:`/docs/themes/`,anchor:`visuals-wording-and-voice`},"themed-voice":{title:`themed agent voice`,text:`The agent answers in the theme's register. It changes phrasing only: citations, figures and proposals stay exact.`,page:`/docs/themes/`,anchor:`the-checkboxes`},motion:{title:`motion and effects`,text:`Reduce motion stops the themes' animations, particles and parallax in this browser. Your system's reduced-motion setting stops them whichever way this is set.`,page:`/docs/themes/`,anchor:`motion-and-particles`}},GS=e=>`${US}${e.page}#${e.anchor}`,KS={dossiers:`dossiers`,dashboard:`dashboard`,prs:`prs`,people:`people`,"command-center":`readiness`,worklog:`worklog`,standup:`standup`,item:`readiness`,assignment:`assignments`,settings:`settings`},qS={"agent-usage":`model-usage`,agent:`agent`,usage:`audit`,dossiers:`dossier-setup`,connections:`connections`};function JS(e,t){return GS(WS[e===`settings`&&t?qS[t]??`settings`:KS[e]])}function YS({topic:e}){let t=WS[e];return(0,q.jsxs)(gd,{children:[(0,q.jsxs)(Df,{delay:400,closeDelay:200,children:[(0,q.jsx)(B,{className:`btn help-button`,"data-help":e,"aria-label":`About ${t.title}`,children:(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`help-button__mark`,children:`i`})}),(0,q.jsx)(Of,{className:`help-tooltip`,offset:6,children:t.text})]}),(0,q.jsx)(ou,{className:`popover help-popover`,placement:`bottom`,offset:6,children:(0,q.jsxs)(_d,{className:`help-popover__dialog`,"aria-label":`About ${t.title}`,children:[(0,q.jsxs)(Ui,{slot:`title`,className:`help-popover__title`,children:[`About `,t.title]}),(0,q.jsx)(`p`,{children:t.text}),(0,q.jsx)(`p`,{children:(0,q.jsxs)(`a`,{href:GS(t),target:`_blank`,rel:`noopener noreferrer`,"data-read-more":``,children:[`Read more`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` about `,t.title,` in the docs (opens in a new tab)`]})]})})]})})]})}function XS({href:e,label:t}){return(0,q.jsx)(`a`,{className:`btn btn--small edit-link`,href:e,"aria-label":t,title:t,"data-edit-link":``,children:(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`✎`})})}function ZS(e,t){(0,v.useEffect)(()=>{if(!e||!t)return;let n=document.getElementById(e)??document.querySelector(`main h1`);n&&(n.tabIndex<0&&!n.hasAttribute(`tabindex`)&&n.setAttribute(`tabindex`,`-1`),n.scrollIntoView?.({block:`start`}),n.focus())},[e,t])}var QS=`toil-ui.shell`,$S=new Set,eC=null;function tC(){if(eC)return eC;try{let e=localStorage.getItem(QS);if(e===`posix`||e===`powershell`)return eC=e}catch{}return eC=HS()}function nC(e){eC=e;try{localStorage.setItem(QS,e)}catch{}for(let e of $S)e()}var rC=e=>($S.add(e),()=>$S.delete(e)),iC=()=>(0,v.useSyncExternalStore)(rC,tC,tC);function aC({proposal:e,onDismiss:t,kind:n=`Proposed change, not applied`,actions:r,children:i}){let[a,o]=(0,v.useState)(null),s=iC(),{line:c,reason:l,mcp:u}=RS(e,s),d=e.hint?{text:e.hint.text,...zS(e.hint,s)}:null,f=!!(e.command||e.hint);return(0,q.jsxs)(`article`,{className:`proposal`,"aria-label":`Proposal: ${e.title}`,children:[(0,q.jsx)(`p`,{className:`proposal-kind`,children:n}),(0,q.jsx)(`h3`,{children:e.title}),(0,q.jsx)(`p`,{children:(0,q.jsx)(pS,{text:e.reason})}),f&&(0,q.jsx)(qd,{className:`shells`,orientation:`horizontal`,value:s,onChange:e=>nC(e),"aria-label":`Show the command for`,children:[`powershell`,`posix`].map(e=>(0,q.jsx)(Jd,{value:e,className:`shell-choice`,children:kS[e]},e))}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`note`,children:[`Apply it yourself through toil's write gate: `,(0,q.jsx)(YS,{topic:`proposal`})]}),(0,q.jsx)(`pre`,{className:`command`,children:(0,q.jsx)(`code`,{children:c})})]}):e.command&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`failure`,children:l}),u&&(0,q.jsx)(`pre`,{className:`command`,"aria-label":`MCP call to ${u.tool}`,children:(0,q.jsx)(`code`,{children:JSON.stringify({tool:u.tool,input:u.input},null,2)})})]}),e.note&&(0,q.jsx)(`p`,{className:`note`,children:e.note}),d&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`note`,children:d.text}),d.line?(0,q.jsx)(`pre`,{className:`command`,children:(0,q.jsx)(`code`,{children:d.line})}):(0,q.jsx)(`p`,{className:`failure`,children:d.reason})]}),i,(0,q.jsxs)(`div`,{className:`proposal-actions`,children:[r,c&&(0,q.jsx)(B,{className:`btn`,onPress:async()=>{try{await navigator.clipboard.writeText(c),o(`yes`)}catch{o(`no`)}},children:`Copy command`}),t&&(0,q.jsx)(B,{className:`btn btn--quiet`,onPress:t,children:`Dismiss`}),(0,q.jsx)(`span`,{className:`note`,role:`status`,children:a===`yes`?`Copied.`:a===`no`?`Couldn't copy: select the command instead.`:``})]})]})}var oC=120,sC=/^(what|whats|what's|why|how|who|whose|when|where|which)\b/i;function cC(e){let t=e.trim();return t.endsWith(`?`)||sC.test(t)}var lC=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function uC(e,t){for(let n of t){if(e.includes(n.id))return n;let t=wm(n),r=/^\d+$/.test(t)?`#${t}\\b`:`(?<![\\w#-])${lC(t)}(?![\\w-])`;if(new RegExp(r,`i`).test(e))return n}return null}var dC=new WeakMap;function fC(e,t){let n=dC.get(e);return n||dC.set(e,n=new tb(e.filter(e=>e.statusCategory!==`DONE`))),n.query(t,{limit:3,threshold:Oy}).matches}function pC(e,t,n=new Set){for(let r of e)if(!(!r.trim()||n.has(r)||cC(r)||uC(r,t)))return{prompt:r,matches:fC(t,r)};return null}function mC(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=oC?t:`${t.slice(0,119).trimEnd()}…`}var hC=e=>`Filed from a Toil UI chat: ${e.replace(/\s+/g,` `).trim()}`;function gC(e,t){let n=new Map;for(let r of e)r.source.area===t&&r.statusCategory!==`DONE`&&r.typeName&&n.set(r.typeName,(n.get(r.typeName)??0)+1);return[...n.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))[0]?.[0]??null}function _C(e){let t=new Map;for(let n of e)n.statusCategory!==`DONE`&&t.set(n.source.area,(t.get(n.source.area)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))[0]?.[0]??null}var vC=e=>`To attach the work instead, which writes nothing, name ${e} in the branch and in every commit message.`;function yC(e,t,n){let r=wm(t),i={id:`ticket:${n}:sub:${t.id}`,from:`ticket`,item:t.id,title:`Create a sub-task under ${r}`,reason:`The work reads closest to [[${t.id}]]. ${vC(r)}`},a=mC(e),o=t.source.area;if(o===`jira`||o===`jira-cloud`){let r=o===`jira`?`Sub-task`:`Subtask`;return{...i,command:`${o} issue create`,input:{dossier:n,project:t.source.key.split(`-`)[0],issueType:r,parent:t.source.key,summary:a,description:hC(e)},note:`${r} is Jira's default name for the type; your project may call it something else.`}}if(o===`ado`)return{...i,command:`ado work-item create`,input:{dossier:n,type:`Task`,title:a,description:hC(e),parent:t.source.key},note:null};if(o===`ado-cloud`)return{...i,command:`ado-cloud work-item create`,input:{dossier:n,type:`Task`,title:a,description:hC(e)},note:`ado-cloud work-item create takes no parent: once it exists, link it under ${r} on the board.`};if(o===`github`){let r=/^([^/]+)\/([^#]+)#(\d+)$/.exec(t.source.key);if(r)return{...i,command:`github issue create`,input:{dossier:n,owner:r[1],repo:r[2],title:a,body:`Part of #${r[3]}. ${hC(e)}`},note:`toil has no sub-issue command, so this names its parent in the body; add it as a sub-issue on GitHub if the repository uses them.`}}return{...i,command:null,input:null,note:`toil has no create command for ${o} items.`}}function bC(e,t,n,r){let i=mC(e),a=r?.source.area??_C(t),o={id:`ticket:${n}:new`,from:`ticket`,item:`${n}:new`,title:`Create a new ticket: ${i}`,reason:r?`Not one of the matches: a ticket of its own.`:`No open item shares enough words with the work to be its ticket.`};if(a===`jira`||a===`jira-cloud`)return{...o,command:`${a} issue create`,input:{dossier:n,summary:i,description:hC(e)},note:`The project and issue type come from the dossier and the connection's defaults; add --project or --type where they don't set them.`};if(a===`ado`||a===`ado-cloud`){let r=gC(t,a);return{...o,command:`${a} work-item create`,input:{dossier:n,type:r??`Task`,title:i,description:hC(e)},note:r?`${r} is the type most of the dossier's open ${a} items have; change --type if this is something else.`:`Task is a guess: no open item shows which type the process uses; change --type if it calls it something else.`}}return a===`github`?{...o,command:`github issue create`,input:{dossier:n,title:i,body:hC(e)},note:`The repository comes from the dossier; add --owner and --repo where it names none.`}:{...o,command:null,input:null,note:a?`toil has no create command for ${a} items.`:`The dossier has no open item to say which tracker a new ticket goes on.`}}function xC(e,t,n,r){let i=e.matches.flatMap(e=>t.get(e.id)?[t.get(e.id)]:[]);return[...i.map(t=>yC(e.prompt,t,r)),bC(e.prompt,n,r,i[0]??null)]}function SC({prompts:e}){let{agent:t,byId:n,dossier:r}=J(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(new Set),u=(0,v.useMemo)(()=>new Set(t.starters(r.name).map(e=>e.label)),[t,r.name]),d=(0,v.useMemo)(()=>pC(e,r.items,u),[e,r.items,u]),f=(0,v.useMemo)(()=>d?xC(d,n,r.items,r.name):[],[d,n,r.items,r.name]);if(!d||o===d.prompt)return null;let p=d.matches[0]?n.get(d.matches[0].id):void 0;return(0,q.jsxs)(`section`,{className:`ticket-banner`,"aria-labelledby":`ticket-banner-title`,children:[(0,q.jsx)(`h3`,{id:`ticket-banner-title`,children:`Not ticketed yet`}),d.matches.length?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{children:[`This work names no ticket. These open items in `,r.name,` read closest to it:`]}),(0,q.jsx)(`ul`,{className:`rows`,children:d.matches.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:e.id,withTitle:!0}),` `,(0,q.jsxs)(`span`,{className:`score`,children:[Math.round(e.score*100),`% alike`]}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,e.why.summary.replace(/\.$/,``),`)`]})]},e.id))}),(0,q.jsxs)(`p`,{className:`note`,children:[`Attach it to one by naming its key in your branch and commits`,p?` (${wm(p)})`:``,`: nothing is written. Or ticket it, as a sub-task under a match or a new ticket.`]})]}):(0,q.jsxs)(`p`,{children:[`This work names no ticket, and no open item in `,r.name,` shares enough words with it to be one: there is no likely ticket. Ticket it as a new one.`]}),(0,q.jsxs)(`p`,{className:`note`,children:[`Matched by shared words, as `,(0,q.jsx)(`code`,{children:`toil util owi similar`}),` scores them, not by meaning. Ticketing it is a proposal for you to apply; nothing is created here.`]}),(0,q.jsxs)(`div`,{className:`ticket-banner__actions`,children:[(0,q.jsx)(B,{className:`btn btn--accent btn--small`,"aria-expanded":i,"aria-controls":`ticket-banner-proposals`,onPress:()=>a(e=>!e),children:i?`Hide`:`Ticket this`}),(0,q.jsx)(B,{className:`btn btn--small`,onPress:()=>s(d.prompt),children:`Not now`})]}),i&&(0,q.jsx)(`div`,{id:`ticket-banner-proposals`,className:`ticket-banner__proposals`,children:f.filter(e=>!c.has(e.id)).map(e=>(0,q.jsx)(aC,{proposal:e,onDismiss:()=>l(t=>new Set(t).add(e.id))},e.id))})]})}var CC={claude:`Claude`,codex:`Codex`,copilot:`GitHub Copilot`},wC=[`inputTokens`,`cachedInputTokens`,`cacheWriteTokens`,`outputTokens`,`premiumRequests`];function TC(e){let t=[e.inputTokens,e.outputTokens,e.cacheWriteTokens,e.inputIncludesCached?void 0:e.cachedInputTokens];if(!(t.every(e=>e===void 0)&&e.cachedInputTokens===void 0))return t.reduce((e,t)=>e+(t??0),0)}var EC=(e,t)=>e===void 0?t:t===void 0?e:Math.max(e,t);function DC(e,t){let n={...e,...t};for(let r of[...wC,`costUsd`]){let i=EC(e[r],t[r]);i===void 0?delete n[r]:n[r]=i}return n}function OC(e,t){return t.at>=e.at?DC(e,t):DC(t,e)}function kC(e){let t=new Map;for(let n of e){let e=t.get(n.id);t.set(n.id,e?OC(e,n):n)}return[...t.values()]}function AC(e){let t={reports:0,costUsd:{},plan:!1};for(let n of kC(e)){t.reports++;for(let e of wC)typeof n[e]==`number`&&(t[e]=(t[e]??0)+n[e]);let e=TC(n);e!==void 0&&(t.tokens=(t.tokens??0)+e),typeof n.costUsd==`number`&&n.costSource!==`none`&&(t.costUsd[n.costSource]=(t.costUsd[n.costSource]??0)+n.costUsd),n.plan&&typeof n.costUsd==`number`&&(t.plan=!0)}return t}function jC(e,t){let n=new Map;for(let r of kC(e))n.set(t(r),[...n.get(t(r))??[],r]);return[...n].map(([e,t])=>({key:e,sample:t[0],totals:AC(t)})).sort((e,t)=>(t.totals.tokens??0)-(e.totals.tokens??0)||(e.key<t.key?-1:1))}var MC=e=>e.at.slice(0,10),NC=e=>`${e.adapter}:${e.model??``}`,PC=e=>e.model??`the CLI's default model (not named by the SDK)`;function FC(e){return e<1e3?String(Math.round(e)):e<1e6?`${e<1e4?(e/1e3).toFixed(1).replace(/\.0$/,``):Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`}function IC(e){return e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}var LC=(e,t)=>e===void 0?`${t} not reported`:`${FC(e)} ${t}`;function RC(e,t){let n=[LC(e.inputTokens,`in`),LC(e.outputTokens,`out`),LC(e.cachedInputTokens,`cached`),LC(e.cacheWriteTokens,`cache write`)];return t===`copilot`?(n.push(e.premiumRequests===void 0?`premium requests not reported`:`${BC(e.premiumRequests)} premium ${e.premiumRequests===1?`request`:`requests`}`),n):(n.push(...zC(e,t)),n)}function zC(e,t){if(t===`copilot`)return[];let n=[];return e.costUsd[`sdk-estimate`]!==void 0&&n.push(`~${IC(e.costUsd[`sdk-estimate`])} (SDK estimate${e.plan?`, API-equivalent: your plan is not billed per token`:``})`),e.costUsd[`your-rates`]!==void 0&&n.push(`~${IC(e.costUsd[`your-rates`])} (computed from your rates)`),n.length||n.push(t===`codex`?`no dollar figure (add your rates under Settings, Agent usage)`:`cost not reported`),n}var BC=e=>String(Math.round(e*100)/100),VC=[{key:`claude.chat`,adapter:`claude`,scope:`chat`,units:[`tokens`,`usd`]},{key:`claude.day`,adapter:`claude`,scope:`day`,units:[`tokens`,`usd`]},{key:`codex.chat`,adapter:`codex`,scope:`chat`,units:[`tokens`,`usd`]},{key:`codex.day`,adapter:`codex`,scope:`day`,units:[`tokens`,`usd`]},{key:`copilot.chat`,adapter:`copilot`,scope:`chat`,units:[`tokens`,`premium-requests`]},{key:`copilot.day`,adapter:`copilot`,scope:`day`,units:[`tokens`,`premium-requests`]}],HC={tokens:`tokens`,usd:`US dollars`,"premium-requests":`premium requests`};function UC(e,t){return t===`usd`?IC(e):`${t===`tokens`?Math.round(e).toLocaleString(`en-US`):BC(e)} ${t===`tokens`?`tokens`:e===1?`premium request`:`premium requests`}`}var WC=[`at`,`day`,`adapter`,`model`,`dossier`,`chatId`,`turn`,`inputTokens`,`cachedInputTokens`,`cacheWriteTokens`,`outputTokens`,`premiumRequests`,`costUsd`,`costSource`,`id`],GC=e=>{if(e==null)return``;let t=String(e),n=/^[=+\-@\t\r]/.test(t)?`'${t}`:t;return/[",\n\r]/.test(n)||n!==t?`"${n.replace(/"/g,`""`)}"`:n};function KC(e){let t=kC(e).sort((e,t)=>e.at<t.at?-1:+(e.at>t.at)),n=[WC.join(`,`)];for(let e of t)n.push(WC.map(t=>GC(t===`day`?MC(e):e[t])).join(`,`));return`${n.join(`
27
- `)}\n`}function qC({usage:e}){let t=jC(e.records,NC);return(0,q.jsxs)(`div`,{className:`usage-footer`,role:`group`,"aria-label":`What this answer used`,"data-usage-footer":``,children:[t.length===0?(0,q.jsxs)(`p`,{className:`usage-line`,children:[CC[e.adapter],` reported no usage for this answer.`]}):t.map(t=>(0,q.jsxs)(`p`,{className:`usage-line`,children:[e.sample&&(0,q.jsx)(`span`,{className:`usage-sample`,children:`Sample figures, not from a model. `}),(0,q.jsxs)(`span`,{className:`usage-model`,children:[CC[t.sample.adapter],`, `,PC(t.sample),`:`]}),` `,RC(t.totals,t.sample.adapter).join(` · `)]},t.key)),e.quota&&(0,q.jsxs)(`p`,{className:`usage-line`,children:[e.quota.unlimited?`Your Copilot premium requests are unlimited`:e.quota.remaining===null?`Copilot gave no count of premium requests left`:`${e.quota.remaining} premium requests left this period${e.quota.entitlement===null?``:` of ${e.quota.entitlement}`}${e.quota.resetDate?`, until ${e.quota.resetDate.slice(0,10)}`:``}`,` `,`(experimental, from the Copilot SDK's account.getQuota).`]}),e.notices.map((e,t)=>(0,q.jsxs)(`p`,{className:`usage-notice`,role:`status`,children:[e,` `,(0,q.jsx)(XS,{href:Vm,label:`Edit the usage caps`})]},t))]})}function JC({usages:e}){if(e.length===0)return null;let t=e.flatMap(e=>e.records),n=jC(t,NC),r=AC(t),i=e[e.length-1],a=e.some(e=>e.sample);return(0,q.jsxs)(`div`,{className:`chat-usage`,"aria-label":`What this chat used`,"data-chat-usage":``,children:[(0,q.jsxs)(`p`,{className:`usage-line`,children:[a&&(0,q.jsx)(`span`,{className:`usage-sample`,children:`Sample figures. `}),`This chat: `,r.tokens===void 0?`tokens not reported`:`${FC(r.tokens)} tokens`,n.length>1?`, on ${n.length} models`:``,`.`]}),n.map(e=>(0,q.jsxs)(`p`,{className:`usage-line`,children:[(0,q.jsxs)(`span`,{className:`usage-model`,children:[CC[e.sample.adapter],`, `,PC(e.sample),`:`]}),` `,RC(e.totals,e.sample.adapter).join(` · `)]},e.key)),(0,q.jsx)(YC,{usage:i})]})}function YC({usage:e}){let t=(0,v.useId)(),n=e.context;if(!n)return(0,q.jsxs)(`p`,{className:`usage-line`,children:[`Context: not reported by the `,CC[e.adapter],` SDK.`]});let r=Math.min(1,n.used/n.window),i=`${FC(n.used)} of ${FC(n.window)} tokens (${Math.round(r*100)}%)`;return(0,q.jsxs)(`p`,{className:`usage-line context-meter`,children:[(0,q.jsxs)(`span`,{id:t,children:[`Context of the last answer: `,i]}),(0,q.jsx)(`meter`,{min:0,max:n.window,value:Math.min(n.used,n.window),"aria-labelledby":t})]})}function XC(){return(0,q.jsx)(`span`,{className:`stale-chip`,children:`Stale`})}function ZC({stale:e,className:t=``}){return(0,q.jsxs)(`p`,{className:`stale-note ${t}`.trim(),"data-stale":``,children:[(0,q.jsx)(XC,{}),` `,(0,q.jsxs)(`span`,{children:[e.text,`.`]})]})}var QC=6e4;function $C({load:e}){let[t,n]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!e)return;let t=!0,r=()=>e().then(e=>t&&n(e),()=>void 0);r();let i=setInterval(r,QC);return()=>{t=!1,clearInterval(i)}},[e]),t?.stale?(0,q.jsxs)(`p`,{className:`banner banner--stale`,role:`status`,"data-server-stale":``,children:[(0,q.jsx)(`strong`,{children:`Toil UI is out of date.`}),` `,t.stale,` Running chats and assignments started on the older one. Stop it with Ctrl+C where it runs, then start it again: `,(0,q.jsx)(`code`,{className:`any-break`,children:t.restart})]}):null}var ew=[`refine`,`investigate`,`implement`],tw={claude:`Claude`,copilot:`GitHub Copilot`,codex:`Codex`},nw={refine:{label:`Refine`,does:`Drafts acceptance criteria, suggests an estimate, splits the item into children where it is too big, checks for duplicates, and lists open questions.`,changes:`Nothing directly: every change comes back as a proposal for you to apply.`},investigate:{label:`Investigate`,does:`Researches the item across the dossier's sources (related items, pull requests, builds) and writes a report that cites each one.`,changes:`Nothing. The report is saved with the assignment, and posting it as a comment is a proposal.`},implement:{label:`Implement`,does:`Works the item in a copy of the dossier's repository, on a new local branch, through the adapter's coding runtime and its own sandbox.`,changes:`Only that branch, in a folder of its own, with no network. Pushing it and opening a pull request are proposals.`}},rw={queued:`Queued`,working:`Working`,"needs-you":`Needs you`,done:`Done`,failed:`Failed`};function iw(e,t){return e.startedAt?Math.max(0,Date.parse(e.endedAt??t)-Date.parse(e.startedAt)):null}function aw(e){if(e===null)return`not started`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} min ${String(t%60).padStart(2,`0`)} s`}function ow(e){return e.renewedBy?`It was renewed already, as ${e.renewedBy}.`:e.stale?e.stale.restart?e.stale.restart:e.state===`working`?`It is working now, and a renew never interrupts a turn: renew it once it ends.`:e.state===`needs-you`?`It is waiting on you: review its proposals and questions, or mark it reviewed, first.`:e.state===`queued`?`It hasn't started, so it starts on today's instructions anyway.`:null:`Nothing it started on has changed, so it doesn't need renewing.`}var sw=[`needs-you`,`failed`,`cap`,`done`,`stale`],cw={"needs-you":`Needs you`,failed:`Failed`,cap:`Stopped at a usage cap`,done:`Done`,stale:`Gone stale`},lw={browser:!1,states:{"needs-you":!0,failed:!0,cap:!0,done:!1,stale:!0},quiet:null,mine:!1},uw=(e,t,n=`${t}s`)=>`${e===1?`a`:e} ${e===1?t:n}`;function dw(e,t){if(e.kind!==`state`||e.state===e.previous)return null;let n=e.adapter?tw[e.adapter]:`An agent`;return{key:`assignment:${e.id}`,state:e.state,agent:n,item:e.item,itemTitle:e.itemTitle??null,dossier:e.dossier,href:t.href,mine:t.mine,...fw(e.state,e)}}function fw(e,t){if(e===`needs-you`)return t.stop===`injection`?{notable:`needs-you`,why:`stopped on text in the item that looked like an instruction to it`}:{notable:`needs-you`,why:[t.questions?`asked ${uw(t.questions,`question`)}`:``,t.pending?`${t.pending} ${t.pending===1?`proposal`:`proposals`} to review`:``].filter(Boolean).join(`, `)||`waiting on you`};if(e===`done`)return{notable:`done`,why:`finished`};if(e===`failed`){if(t.stop===`usage`)return{notable:`cap`,why:`stopped at its usage cap`};if(t.stop===`cancelled`)return{notable:null,why:`stopped by a person`};if(t.stop===`time`)return{notable:`failed`,why:`stopped at its time limit`};if(t.stop===`interrupted`)return{notable:`failed`,why:`Toil UI stopped while it ran`};let e=t.message.split(`
28
- `)[0].trim();return{notable:`failed`,why:e?e.length>160?`${e.slice(0,157)}...`:e:`failed`}}return{notable:null,why:e}}var pw=/^([01]?\d|2[0-3]):([0-5]\d)$/;function mw(e,t){if(!e)return!1;let n=e=>{let t=pw.exec(e);return t?Number(t[1])*60+Number(t[2]):null},r=n(e.from),i=n(e.to);if(r===null||i===null||r===i)return!1;let a=t.getHours()*60+t.getMinutes();return r<i?a>=r&&a<i:a>=r||a<i}var hw=(e,t)=>e.notable!==null&&t.states[e.notable]&&(!t.mine||e.mine),gw=4e3,_w=class{emit;settings;timers;windowMs;held=new Map;timer=null;constructor(e,t,n={set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)},r=gw){this.emit=e,this.settings=t,this.timers=n,this.windowMs=r}push(e,t){let n=this.held.get(e.key);n?n.last=e:this.held.set(e.key,{from:t,last:e}),this.timer===null&&(this.timer=this.timers.set(()=>this.flush(),this.windowMs))}flush(){this.timer!==null&&this.timers.clear(this.timer),this.timer=null;let e=this.settings(),t=[...this.held.values()].filter(t=>t.last.state!==t.from&&hw(t.last,e)).map(e=>e.last);this.held.clear(),t.length&&this.emit(t)}stop(){this.timer!==null&&this.timers.clear(this.timer),this.timer=null,this.held.clear()}},vw={"needs-you":[`needs you`,`need you`],done:[`finished`,`finished`],failed:[`failed`,`failed`],cap:[`stopped at a usage cap`,`stopped at a usage cap`],stale:[`went stale`,`went stale`]},yw=e=>`${e.agent} ${vw[e.notable][0]}${e.item?` on ${e.item}${e.itemTitle?` ${e.itemTitle}`:``}`:` in ${e.dossier}`}: ${e.why}`;function bw(e){let t=e.map(yw);if(e.length===1){let n=e[0];return{title:`${n.agent} ${vw[n.notable][0]}`,lines:t}}let n=new Set(e.map(e=>e.notable));if(n.size===1){let r=[...n][0];return{title:`${e.length} ${r===`stale`?`sessions`:`agents`} ${vw[r][1]}`,lines:t}}return{title:`${e.length} agent updates`,lines:t}}function xw(e){if(!e)return structuredClone(lw);try{let t=JSON.parse(e),n={...lw.states};for(let e of sw)typeof t?.states?.[e]==`boolean`&&(n[e]=t.states[e]);let r=t?.quiet,i=r&&typeof r.from==`string`&&typeof r.to==`string`&&pw.test(r.from)&&pw.test(r.to)?{from:r.from,to:r.to}:null;return{browser:t?.browser===!0,states:n,quiet:i,mine:t?.mine===!0}}catch{return structuredClone(lw)}}var Sw=`toil-ui.notify`,Cw=`toil-ui.notify.mine`,ww=6e4,Tw=5e3,Ew=e=>{try{return localStorage.getItem(e)}catch{return null}},Dw=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},Ow=()=>typeof Notification>`u`?`unsupported`:Notification.permission,kw=(0,v.createContext)(null),Aw=()=>(0,v.useContext)(kw);function jw(e,t){return{...e,assign:async n=>{let r=await e.assign(n);return t(r.id),r},start:async(n,r)=>{let i=await e.start(n,r);return t(i.id),i},renew:async n=>{let r=await e.renew(n);return t(r.id),r}}}function Mw(){let e=(0,v.useRef)(null),t=(0,v.useCallback)(()=>{if(!e.current)try{let t=JSON.parse(Ew(Cw)??`[]`);e.current=new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}catch{e.current=new Set}return e.current},[]);return{mine:t,mark:(0,v.useCallback)(e=>{let n=t();n.add(e),Dw(Cw,JSON.stringify([...n].slice(-500)))},[t])}}function Nw({assignments:e,dossier:t,mine:n,children:r}){let[i,a]=(0,v.useState)(()=>xw(Ew(Sw))),[o,s]=(0,v.useState)(Ow),[c,l]=(0,v.useState)([]),u=(0,v.useRef)(i);u.current=i;let d=(0,v.useRef)(0),f=(0,v.useRef)(0),p=(0,v.useRef)(null),m=(0,v.useCallback)(e=>{let t=u.current,{title:n,lines:r}=bw(e),i=typeof document<`u`&&document.visibilityState===`hidden`;if(i&&(p.current===null&&(p.current=document.title),f.current+=e.length,document.title=`(${f.current}) ${p.current}`),!mw(t.quiet,new Date)&&(l(t=>[{id:d.current++,title:n,changes:e},...t].slice(0,3)),i&&t.browser&&Ow()===`granted`))try{new Notification(n,{body:r.join(`
29
- `),tag:`toil-ui`})}catch{}},[]),h=(0,v.useMemo)(()=>new _w(m,()=>u.current),[m]);return(0,v.useEffect)(()=>()=>h.stop(),[h]),(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&p.current!==null&&(document.title=p.current,p.current=null,f.current=0)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,v.useEffect)(()=>{if(!e?.events||e.disabled)return;let t=new AbortController,r=`latest`,i,a=()=>{e.events(r,e=>{r=e.seq;let t=dw(e,{mine:n().has(e.id),href:`${Am(e.dossier)}/assignment/${encodeURIComponent(e.id)}`});t&&h.push(t,e.previous)},t.signal).then(()=>void 0,()=>void 0).finally(()=>{t.signal.aborted||(i=setTimeout(a,Tw))})};return a(),()=>{t.abort(),clearTimeout(i)}},[e,h,n]),(0,v.useEffect)(()=>{if(!e||e.disabled||!t)return;let r=null,i=!0,a=()=>e.list(t,{inbox:!1}).then(e=>{if(!i)return;let t=e.assignments.filter(e=>e.stale);if(r)for(let e of t)r.has(e.id)||h.push({key:`stale:${e.id}`,state:`stale`,notable:`stale`,agent:e.adapter?tw[e.adapter]:`An agent`,item:e.item,itemTitle:e.itemTitle,why:e.stale.text,dossier:e.dossier,href:`${Am(e.dossier)}/assignment/${encodeURIComponent(e.id)}`,mine:n().has(e.id)},`fresh`);r=new Set([...r??[],...t.map(e=>e.id)])},()=>void 0);a();let o=setInterval(a,ww);return()=>{i=!1,clearInterval(o)}},[e,t,h,n]),(0,q.jsx)(kw,{value:{settings:i,save:e=>{a(e),Dw(Sw,JSON.stringify(e))},permission:o,ask:async()=>{if(typeof Notification>`u`)return`unsupported`;let e=Notification.permission==="default"?await Notification.requestPermission():Notification.permission;return s(e),e},report:(e,t)=>h.push(e,t),notices:c,dismiss:e=>l(t=>t.filter(t=>t.id!==e))},children:r})}function Pw(){let e=Aw();return(0,q.jsx)(`div`,{className:`notices`,role:`status`,"aria-label":`Notifications`,"data-notices":``,children:e?.notices.map(t=>(0,q.jsxs)(`div`,{className:`notice`,children:[(0,q.jsx)(`p`,{className:`notice__title`,children:(0,q.jsx)(`strong`,{children:t.title})}),(0,q.jsx)(`ul`,{className:`notice__lines`,children:t.changes.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(`a`,{href:e.href,children:Fw(e)})},e.key))}),(0,q.jsxs)(B,{className:`btn btn--small`,onPress:()=>e.dismiss(t.id),children:[`Dismiss`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,t.title]})]})]},t.id))})}var Fw=e=>`${e.item?`${e.item}${e.itemTitle?` ${e.itemTitle}`:``}`:e.dossier}: ${e.why}`;function Iw({on:e,set:t,children:n}){return(0,q.jsxs)(Ia,{className:`check`,isSelected:e,onChange:t,children:[(0,q.jsx)(`span`,{className:`box`,"aria-hidden":`true`,children:e?`✓`:``}),n]})}function Lw({label:e,value:t,save:n}){let[r,i]=(0,v.useState)(t),a=!pw.test(r);return(0,q.jsxs)(gf,{className:`field-text`,value:r,onChange:e=>{i(e),pw.test(e)&&n(e)},isInvalid:a,children:[(0,q.jsx)(Ai,{children:e}),(0,q.jsx)(Va,{inputMode:`numeric`}),(0,q.jsxs)(ia,{className:`failure`,children:[`Use HH:MM, like 22:00. Until then the quiet hours keep `,t,`.`]})]})}function Rw(){let e=Aw(),[t,n]=(0,v.useState)(null);if(!e)return null;let r=e.settings,i=t=>e.save({...r,...t}),a=async t=>{if(n(null),!t)return i({browser:!1});let r=await e.ask();if(r===`granted`)return i({browser:!0});i({browser:!1}),n(r===`unsupported`?`This browser has no notifications, so Toil UI shows its notices in the page only.`:`The browser didn't allow notifications for this page, so Toil UI shows its notices in the page only. Allow them in the browser's settings for this site, then turn this on again.`)};return(0,q.jsxs)(Q,{as:`section`,className:`panel notify-setting`,"aria-labelledby":`notify-title`,children:[(0,q.jsx)(`h2`,{id:`notify-title`,children:`Notifications`}),(0,q.jsx)(`p`,{className:`note`,children:`A notice when an agent's state changes, never for a tool call or its progress. Changes within a few seconds become one notice. Saved in this browser only.`}),(0,q.jsxs)(`fieldset`,{className:`notify-states`,children:[(0,q.jsx)(`legend`,{children:`Notify when an agent is`}),sw.map(e=>(0,q.jsx)(Iw,{on:r.states[e],set:t=>i({states:{...r.states,[e]:t}}),children:cw[e]},e))]}),(0,q.jsx)(Iw,{on:r.mine,set:e=>i({mine:e}),children:`Only for agents I started in this browser`}),(0,q.jsx)(Iw,{on:r.quiet!==null,set:e=>i({quiet:e?{from:`22:00`,to:`07:00`}:null}),children:`Quiet hours`}),r.quiet&&(0,q.jsxs)(`div`,{className:`notify-quiet`,children:[(0,q.jsx)(Lw,{label:`From (HH:MM, this computer's time)`,value:r.quiet.from,save:e=>i({quiet:{...r.quiet,from:e}})}),(0,q.jsx)(Lw,{label:`To (HH:MM)`,value:r.quiet.to,save:e=>i({quiet:{...r.quiet,to:e}})})]}),(0,q.jsx)(Iw,{on:r.browser,set:e=>void a(e),children:`Browser notifications while this tab is hidden`}),(0,q.jsx)(`p`,{className:`note`,role:`status`,children:t??(r.browser?`The browser draws them on this computer; nothing is sent anywhere.`:`Off. The browser is asked for permission only when you turn this on.`)})]})}var zw=()=>typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`chat-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,Bw=6e4,Vw=e=>String(Math.max(1,Math.round(e/1e3))),Hw=e=>e.parts.map(e=>e.text).join(`
30
-
31
- `),Uw=e=>e.model?`${e.label} (${e.model})`:e.label,Ww=`(max-width: 599px)`;function Gw(e){let t=lx();return ES(Ww)?t(`ask.placeholder.short`):t(`ask.placeholder`,{name:e})}function Kw(e,t,n){if(e.error&&!e.stopped)return null;if(e.done)return{text:t(e.stopped?`status.stopped`:`status.done`,{seconds:Vw(e.ms??0)}),tool:null,elapsed:null};let r=e.answer?.activity,i=`${Math.max(0,Math.floor((n-e.started)/1e3))} s`;return r?.phase===`tool`?{text:t(r.source===`live`?`status.live`:r.source===`registry`?`status.registry`:`status.cache`),tool:r.tool??null,elapsed:i}:r?.phase===`writing`||e.answer&&e.answer.parts.length>0?{text:t(`status.writing`),tool:null,elapsed:i}:{text:t(`loading.answer`),tool:null,elapsed:i}}function qw(){let{agent:e,dossier:t}=J(),n=ex(),r=ix(),i={theme:n.name,voice:ox(n,r)},[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(0),g=(0,v.useRef)(zw()),_=(0,v.useRef)(null),y=a.filter(e=>e.kind===`turn`),b=y.some(e=>!e.done);(0,v.useEffect)(()=>()=>_.current?.abort(),[]);let x=(e,t)=>o(n=>n.map(n=>n.kind===`turn`&&n.id===e?{...n,...t}:n)),S=()=>{e.adapters&&e.adapters().then(u,()=>u(null))},C=async(n,r=n)=>{if(b||!n.trim())return;let a=h.current++,c={id:g.current,turn:y.length+1},l=y.flatMap(e=>e.done&&!e.error&&e.answer?.parts.length?[{prompt:e.prompt,answer:Hw(e.answer).slice(0,iS+1),by:e.answer.by}]:[]).slice(-8),u={...s?{adapter:s}:{},...l.length?{history:l}:{}},d=new AbortController;_.current=d;let p=Date.now();o(e=>[...e,{kind:`turn`,id:a,prompt:r,answer:null,error:null,done:!1,started:p,...n===`analyze`?{analyze:!0}:{}}]);try{let r=null;if(e.stream)for await(let o of e.stream(t.name,n,d.signal,i,c,u)){if(d.signal.aborted)return;r=o,x(a,{answer:o})}else r=await e.ask(t.name,n,i,c,u),x(a,{answer:r});d.signal.aborted||(x(a,{done:!0,ms:Date.now()-p}),r?.session&&f(r.session))}catch(e){if(d.signal.aborted)return;let t=e?.usage;x(a,{answer:null,error:`The agent couldn't answer: ${e instanceof Error?e.message:String(e)}`,done:!0,ms:Date.now()-p,...t?{usage:t}:{}})}},w=()=>{let e=y.find(e=>!e.done);_.current?.abort(),e&&x(e.id,{done:!0,stopped:!0,ms:Date.now()-e.started,...e.answer?{answer:{...e.answer,activity:void 0}}:{}})},T=(e,t)=>{e!==s&&(c(e),o(e=>e.length?[...e,{kind:`switch`,id:h.current++,label:t}]:e))},E=Aw(),D=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let e=d?.stale??null;e&&!D.current&&E?.report({key:`chat:${g.current}:${d.renewals}`,state:`stale`,notable:`stale`,agent:`The chat`,item:null,itemTitle:null,why:e.text,dossier:t.name,href:Am(t.name),mine:!0},`fresh`),D.current=e!==null},[d]);let O=()=>{e.session&&y.length&&e.session(g.current).then(e=>e&&f(e),()=>void 0)},k=y.length>0;return(0,v.useEffect)(()=>{if(!k||!e.session)return;let t=setInterval(O,Bw);return()=>clearInterval(t)},[k,e]),{entries:a,turns:y,busy:b,ask:C,stop:w,adapter:s,adapters:l,refreshAdapters:S,switchTo:T,session:d,checkSession:O,renew:async()=>{if(!e.renew)return`This agent keeps no sessions, so there is nothing to renew.`;if(b)return`It is answering a question now, and a renew never interrupts one.`;m(null);try{return f(await e.renew(g.current,t.name)),o(e=>[...e,{kind:`renew`,id:h.current++}]),null}catch(e){let t=`The chat couldn't be renewed: ${e instanceof Error?e.message:String(e)}`;return m(t),t}},renewProblem:p}}var Jw=(0,v.createContext)(null),Yw=()=>(0,v.useContext)(Jw);function Xw({children:e}){let t=qw();return(0,q.jsx)(Jw,{value:t,children:e})}function Zw(){let{dossier:e}=J(),t=lx(),n=Gw(e.name),r=Yw(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1);if(!r)throw Error(`The Ask bar needs the ChatScope the App puts around a dossier's pages.`);let c=r,l=c.turns[c.turns.length-1],u=()=>{s(!0),c.refreshAdapters(),c.checkSession()};return(0,q.jsxs)(`section`,{className:`ask-bar`,"aria-label":`Ask about ${e.name}`,children:[(0,q.jsxs)(`form`,{className:`ask-bar__form`,onSubmit:e=>{if(e.preventDefault(),u(),!i.trim())return;let t=i;a(``),c.ask(t)},children:[(0,q.jsx)(gf,{className:`field-text ask-bar__field`,value:i,onChange:a,"aria-label":`Your question`,children:(0,q.jsx)(Va,{placeholder:n,onClick:u,"data-ask-bar":``})}),(0,q.jsx)(B,{type:`submit`,className:`btn btn--accent`,children:`Ask`}),(0,q.jsx)(B,{className:`btn`,onPress:()=>{u(),c.ask(cS,`Analyze`)},isDisabled:c.busy,"data-analyze":``,children:`Analyze`})]}),c.session?.stale&&!o&&(0,q.jsx)(ZC,{stale:c.session.stale,className:`ask-bar__stale`}),l&&!o&&(0,q.jsxs)(`p`,{className:`ask-bar__resume note`,children:[c.turns.length,` `,c.turns.length===1?`question`:`questions`,` in this chat`,l.done?``:`, ${Kw(l,t,Date.now())?.text??``}`,`.`,` `,(0,q.jsx)(B,{className:`btn btn--small`,onPress:u,"data-ask-resume":``,children:`Open the conversation`})]}),(0,q.jsx)(Fd,{className:`ask-overlay`,"data-backdrop":``,isDismissable:!0,isOpen:o,onOpenChange:s,children:(0,q.jsx)(Nd,{className:`ask-modal`,children:(0,q.jsx)(Qw,{chat:c,text:i,setText:a})})})]})}function Qw({chat:e,text:t,setText:n}){let{agent:r,dossier:i}=J(),{health:a}=xm(),{EmptyState:o,ChatMessage:s}=qx(),c=lx(),l=Gw(i.name),[u,d]=(0,v.useState)(new Set),[f,p]=(0,v.useState)(()=>Date.now()),m=(0,v.useRef)(null),{entries:h,turns:g,busy:_}=e,y=g[g.length-1],b=r.starters(i.name);(0,v.useEffect)(()=>{m.current?.scrollIntoView?.({block:`nearest`})},[h]),(0,v.useEffect)(()=>{if(!_)return;p(Date.now());let e=setInterval(()=>p(Date.now()),1e3);return()=>clearInterval(e)},[_]);let x=r=>{r.preventDefault();let i=t;n(``),e.ask(i)},S=e.adapters?.options??[],C=S.find(t=>t.name===(e.adapter??e.adapters?.chosen)),w=C?Uw(C):r.label??`the agent chosen in Settings`,T=g.flatMap(e=>e.done&&(e.answer?.usage??e.usage)?[e.answer?.usage??e.usage]:[]),E=y?Kw(y,c,f):null,D=e=>{let t=S.find(t=>t.name===e.adapter);return e.by===`scripted`?`a scripted preview, not a model`:t?e.model?`${t.label} (${e.model})`:t.label:e.by};return(0,q.jsxs)(_d,{className:`ask ask-focus`,"aria-labelledby":`ask`,children:[(0,q.jsxs)(`div`,{className:`ask-strip`,children:[(0,q.jsxs)(`div`,{className:`ask-strip__text`,children:[(0,q.jsxs)(Ui,{slot:`title`,id:`ask`,children:[`Ask about `,i.name]}),(0,q.jsxs)(`p`,{className:`ask-strip__context note`,children:[(0,q.jsxs)(`span`,{children:[`Dossier `,i.name]}),(0,q.jsx)(`span`,{children:a?`${a.sprint.name}, day ${a.days.gone} of ${a.days.total}`:`No sprint running`}),(0,q.jsxs)(`span`,{children:[`Answered by`,` `,r.adapters?(0,q.jsx)($w,{label:w,list:e.adapters,current:e.adapter,onPick:e.switchTo}):(0,q.jsx)(`strong`,{children:w})]})]})]}),(0,q.jsx)(eT,{agentLabel:w}),e.session?.stale&&!e.session.stale.restart&&r.renew&&(0,q.jsx)(B,{className:`btn btn--small`,onPress:()=>void e.renew(),isDisabled:_,"data-chat-renew":``,children:`Renew`}),(0,q.jsx)(B,{slot:`close`,className:`btn btn--small`,"data-ask-close":``,children:`Close`})]}),(0,q.jsxs)(`div`,{className:`ask-scroll`,"data-scroller":``,tabIndex:0,role:`region`,"aria-label":`The conversation`,children:[(0,q.jsx)(`p`,{className:`note`,children:c(`ask.note`)}),e.session?.stale&&(0,q.jsx)(ZC,{stale:e.session.stale}),e.session?.stale?.restart&&(0,q.jsx)(`p`,{className:`note any-break`,children:e.session.stale.restart}),e.session?.stale&&_&&(0,q.jsx)(`p`,{className:`note`,children:`Renew waits for this answer: it never interrupts one.`}),e.renewProblem&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:e.renewProblem}),(0,q.jsxs)(`div`,{className:`log`,role:`log`,"aria-live":`polite`,"aria-busy":_,"aria-label":`Conversation`,children:[h.length===0&&(r.notice?(0,q.jsx)(`p`,{className:`note agent-notice`,children:r.notice}):(0,q.jsx)(o,{message:c(`ask.welcome`,{name:i.name})})),h.map(e=>e.kind===`renew`?(0,q.jsx)(`p`,{className:`ask-switch note`,children:`Renewed on today's instructions. The conversation above stays, and the next question carries a summary of it.`},`r${e.id}`):e.kind===`switch`?(0,q.jsxs)(`p`,{className:`ask-switch note`,children:[`Switched to `,e.label,` for this chat. The next question carries a summary of the conversation so far.`]},`s${e.id}`):(0,q.jsxs)(`div`,{className:`turn`,children:[(0,q.jsx)(s,{from:`you`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`sr-only`,children:`You asked: `}),e.prompt]})}),e.error?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:e.error}),e.usage&&(0,q.jsx)(qC,{usage:e.usage})]}):(0,q.jsxs)(s,{from:`agent`,children:[e.answer&&e.answer.parts.length>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h3`,{children:e.answer.prompt}),e.done&&e.answer.warnings&&e.answer.warnings.length>0&&(0,q.jsx)(`div`,{className:`answer-checks`,"aria-label":`Checks on this answer`,children:e.answer.warnings.map((e,t)=>(0,q.jsx)(`p`,{className:`failure`,children:e},t))}),e.answer.parts.map((e,t)=>(0,q.jsx)(`p`,{children:(0,q.jsx)(pS,{text:e.text})},t)),e.done&&(0,q.jsxs)(`p`,{className:`by`,children:[e.stopped?`Stopped before the end. `:`Cites ${e.answer.citations.length} ${e.answer.citations.length===1?`item`:`items`}.${e.answer.unverified&&e.answer.unverified.length>0?` Names ${e.answer.unverified.length} its tools never returned.`:``} `,`Answered by: `,D(e.answer),e.ms===void 0?``:`, in ${Vw(e.ms)} s`,`.`,e.answer.carried?` It was given a summary of the ${e.answer.carried} earlier ${e.answer.carried===1?`turn`:`turns`}.`:``]}),e.done&&e.answer.usage&&(0,q.jsx)(qC,{usage:e.answer.usage})]}):(0,q.jsx)(`p`,{className:`note`,children:e.stopped?`Stopped before any answer arrived.`:c(`loading.answer`)}),e.done&&!e.stopped&&e.answer?.proposals.filter(e=>!u.has(e.id)).map(e=>(0,q.jsx)(aC,{proposal:e,onDismiss:()=>d(t=>new Set(t).add(e.id))},e.id))]})]},e.id)),(0,q.jsx)(SC,{prompts:g.filter(e=>!e.analyze).map(e=>e.prompt)}),(0,q.jsx)(`div`,{ref:m})]})]}),(0,q.jsxs)(`div`,{className:`ask-foot`,children:[E&&(0,q.jsxs)(`div`,{className:`ask-status`,children:[(0,q.jsxs)(`p`,{role:`status`,className:`ask-status__line`,"data-ask-status":``,children:[E.text,E.tool&&(0,q.jsxs)(q.Fragment,{children:[`: `,(0,q.jsx)(`code`,{children:E.tool})]}),E.elapsed&&(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`ask-status__time`,children:[` · `,E.elapsed]})]}),_&&(0,q.jsx)(B,{className:`btn btn--small`,onPress:e.stop,"data-ask-stop":``,children:`Stop`})]}),(0,q.jsx)(JC,{usages:T}),b.length>0&&(g.length===0?(0,q.jsx)(`div`,{className:`starters`,role:`group`,"aria-label":`Starter questions`,children:b.map(t=>(0,q.jsx)(B,{className:`starter`,onPress:()=>void e.ask(t.id,t.label),isDisabled:_,children:t.label},t.id))}):(0,q.jsxs)(id,{children:[(0,q.jsx)(B,{className:`btn btn--small ask-suggest`,isDisabled:_,"data-ask-suggestions":``,children:`Suggestions`}),(0,q.jsx)(ou,{className:`popover menu-popover`,placement:`top start`,offset:6,children:(0,q.jsx)(od,{className:`menu`,"aria-label":`Suggested questions`,onAction:t=>void e.ask(String(t),b.find(e=>e.id===t)?.label??String(t)),children:b.map(e=>(0,q.jsx)(fd,{id:e.id,className:`menu-item`,children:e.label},e.id))})})]})),(0,q.jsxs)(`form`,{className:`ask-form`,onSubmit:x,children:[(0,q.jsxs)(gf,{className:`field-text`,value:t,onChange:n,isDisabled:_,autoFocus:!0,children:[(0,q.jsx)(Ai,{children:`Your question`}),(0,q.jsx)(Va,{placeholder:l})]}),(0,q.jsx)(B,{type:`submit`,className:`btn btn--accent`,isDisabled:_||!t.trim(),children:`Ask`}),(0,q.jsx)(B,{className:`btn`,onPress:()=>void e.ask(cS,`Analyze`),isDisabled:_,children:`Analyze`})]})]})]})}function $w({label:e,list:t,current:n,onPick:r}){return(0,q.jsxs)(gd,{children:[(0,q.jsxs)(B,{className:`btn btn--small agent-switch`,"data-agent-switch":``,children:[e,(0,q.jsx)(`span`,{"aria-hidden":`true`,children:` ▾`}),(0,q.jsx)(`span`,{className:`sr-only`,children:`, change the agent for this chat`})]}),(0,q.jsx)(ou,{className:`popover agent-switch__popover`,placement:`bottom start`,offset:6,children:(0,q.jsx)(_d,{className:`agent-switch__dialog`,"aria-labelledby":`agent-switch-title`,children:({close:e})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ui,{slot:`title`,id:`agent-switch-title`,className:`ask-info__title`,children:`Agent for this chat`}),t?(0,q.jsx)(`ul`,{className:`agent-picks`,children:t.options.map(i=>{let a=(n??t.chosen)===i.name;return(0,q.jsxs)(`li`,{className:`agent-pick`,children:[(0,q.jsxs)(B,{className:`agent-pick__button`,isDisabled:!i.ready,"aria-current":a?!0:void 0,onPress:()=>{r(i.name===t.chosen?null:i.name,Uw(i)),e()},children:[(0,q.jsx)(`strong`,{children:i.label}),(0,q.jsxs)(`span`,{className:`note`,children:[i.name===`scripted`?`Canned answers, no model`:i.model?`Model ${i.model}`:`Its CLI's default model`,i.name===t.chosen&&i.name!==`scripted`?`, the default from Settings`:``]}),(0,q.jsx)(`span`,{className:i.ready?`agent-pick__ready`:`agent-missing`,children:a?`Answering`:i.ready?`Ready`:`Unavailable`})]}),!i.ready&&(0,q.jsxs)(`p`,{className:`note agent-pick__why`,children:[i.problem,i.fix?` ${i.fix}`:``,i.action&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(`a`,{href:`#/settings/agent`,onClick:e,children:i.action===`install`?`Install ${i.label}`:`Fix ${i.label}`})]})]})]},i.name)})}):(0,q.jsx)(`p`,{className:`note`,children:`Reading the agents…`}),(0,q.jsx)(`p`,{className:`note`,children:`Switching holds for this chat, from its next question. The default stays under Settings, Agent.`})]})})})]})}function eT({agentLabel:e}){let t=ex(),n=ox(t,ix())?`Answers are written in ${t.label}'s voice, or in your own custom voice if you saved one. A voice changes their phrasing only: citations, figures and proposals stay exact.`:t.voice?`Themed agent voice is off, so answers are in plain wording, whatever the theme.`:`${t.label} has no voice of its own, so answers are in plain wording.`;return(0,q.jsxs)(gd,{children:[(0,q.jsxs)(B,{className:`btn info-button`,"data-ask-info":``,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`info-button__mark`,children:`i`}),(0,q.jsx)(`span`,{className:`sr-only`,children:`About these answers`})]}),(0,q.jsx)(ou,{className:`popover ask-info`,placement:`bottom end`,offset:6,children:(0,q.jsxs)(_d,{className:`ask-info__dialog`,"aria-labelledby":`ask-info-title`,children:[(0,q.jsx)(Ui,{slot:`title`,id:`ask-info-title`,className:`ask-info__title`,children:`About these answers`}),(0,q.jsx)(`p`,{children:n}),(0,q.jsxs)(`p`,{children:[`Answered by `,e??`the agent chosen in Settings`,`.`]}),(0,q.jsx)(`p`,{children:`The agent only reads: its tools can't change a ticket, and anything it suggests comes back as a proposal for you to apply.`}),(0,q.jsxs)(`p`,{children:[`Change the voice under `,(0,q.jsx)(`a`,{href:`#/settings/toil`,children:`Settings, General`}),`, and add your own instructions or voice under `,(0,q.jsx)(`a`,{href:`#/settings/agent`,children:`Settings, Agent`}),`.`]})]})})]})}function tT({label:e,value:t,options:n,onChange:r}){return(0,q.jsxs)(sf,{className:`choice`,selectedKey:t,onSelectionChange:e=>e!==null&&r(String(e)),children:[(0,q.jsx)(Ai,{children:e}),(0,q.jsxs)(B,{className:`btn choice-button`,children:[(0,q.jsx)(df,{children:()=>n.find(e=>e.id===t)?.label??t}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`▾`})]}),(0,q.jsx)(ou,{className:`popover`,children:(0,q.jsx)(oc,{className:`menu`,children:n.map(e=>(0,q.jsx)(uc,{id:e.id,className:`menu-item`,children:e.label},e.id))})})]})}function nT(e){let t=[];for(let n of e){let e=t.find(e=>e.command===n.command);e?e.count++:t.push({command:n.command,count:1})}return t}function rT({calls:e,alerts:t=!0}){if(!e.length)return null;let n=nT(e),r=t?e.filter(e=>!e.ok):[];return(0,q.jsxs)(q.Fragment,{children:[r.map((e,t)=>(0,q.jsxs)(`p`,{role:`alert`,className:`failure`,children:[(0,q.jsxs)(`code`,{children:[`toil `,e.command]}),` failed: `,e.error]},t)),(0,q.jsxs)(`details`,{className:`fed-by`,children:[(0,q.jsxs)(`summary`,{children:[`Fed by`,` `,n.map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&`, `,(0,q.jsxs)(`code`,{children:[`toil `,e.command]}),e.count>1&&` ×${e.count}`]},e.command))]}),(0,q.jsx)(`ul`,{className:`plain calls`,children:e.map((e,t)=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`code`,{className:`call`,children:[`execute(`,JSON.stringify(e.command),`, `,JSON.stringify(e.input),`)`]}),!e.ok&&(0,q.jsx)(`span`,{className:`failure`,children:` (failed)`})]},t))})]})]})}function iT({id:e,title:t,calls:n,children:r,alerts:i=!0}){let{Panel:a}=qx();return(0,q.jsx)(Q,{as:`section`,className:`panel`,"aria-labelledby":e,children:(0,q.jsxs)(a,{id:e,children:[(0,q.jsx)(`h2`,{id:e,children:t}),r,(0,q.jsx)(rT,{calls:n,alerts:i})]})})}var aT={pass:`✓`,thin:`!`,fail:`✕`},oT={pass:`Passes`,thin:`Thin`,fail:`Fails`},sT={ready:`✓`,thin:`!`,blocked:`✕`};function cT({verdict:e}){return(0,q.jsxs)(`span`,{className:`verdict verdict--${e}`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:sT[e]}),` `,cg[e]]})}function lT({readiness:e}){return(0,q.jsx)(`ul`,{className:`rows readiness-rows`,children:e.rows.map(e=>(0,q.jsxs)(`li`,{className:`readiness-row readiness-row--${e.state}`,children:[(0,q.jsx)(`span`,{className:`readiness-mark`,"aria-hidden":`true`,children:aT[e.state]}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.label}),` `,(0,q.jsx)(`span`,{className:`readiness-state`,children:oT[e.state]}),`: `,(0,q.jsx)(pS,{text:e.reason}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`Source: `,(0,q.jsx)(`code`,{children:e.source})]})]})]},e.check))})}function uT({readiness:e}){return e.why.length?(0,q.jsx)(`ul`,{className:`why-not`,children:e.why.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`strong`,{children:[e.label,`:`]}),` `,(0,q.jsx)(pS,{text:e.reason})]},e.check))}):(0,q.jsx)(`span`,{className:`field`,children:`Every check passes.`})}var dT={ready:`Every check passes: an agent can start on it.`,thin:`Something is missing. A person can still decide to start it on its own, but the Command Center never slates it.`,blocked:`It can't be worked on as it is, so it is never started.`};function fT({item:e}){let{dossier:t,byId:n,execute:r}=J(),i=t.readiness,[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=qg({item:e,settings:i,byId:n,...a?{live:a.result}:{}}),u=e.statusCategory===`DONE`?null:Mg(e);return(0,q.jsxs)(Q,{as:`section`,className:`panel readiness-panel`,"aria-labelledby":`readiness`,children:[(0,q.jsx)(`h2`,{id:`readiness`,children:`Ready for an agent?`}),(0,q.jsxs)(`p`,{className:`readiness-verdict`,children:[(0,q.jsx)(cT,{verdict:l.verdict}),` `,dT[l.verdict]]}),(0,q.jsx)(lT,{readiness:l}),u&&r&&(0,q.jsxs)(`p`,{className:`readiness-live`,children:[(0,q.jsx)(B,{className:`btn btn--small`,onPress:async()=>{if(!r||!u)return;c(!0);let n=await r(u.command,{dossier:t.name,...u.input},fb);o({result:Fg(e,u.command,n.ok?n.data:null,n.ok?void 0:`${n.error.message}${n.error.fix?` ${n.error.fix}`:``}`),at:new Date().toISOString()}),c(!1)},isDisabled:s,children:s?`Reading the workflow…`:a?`Read the workflow again`:`Check the workflow live`}),` `,(0,q.jsx)(`span`,{className:`field`,"aria-live":`polite`,children:a?`Read live ${Om(a.at)} with toil ${u.command}.`:`One read-only call, toil ${u.command}, settles the done state.`})]}),(0,q.jsxs)(`p`,{className:`note`,children:[`Worked out from the cached record`,a?` and one live read`:``,`, with no model call. The checks and their settings (fields.acceptanceCriteria, readiness.minWords, readiness.templates in the `,e.source.area,` section) are in Toil UI's README.`]}),i.notes.map((e,t)=>(0,q.jsx)(`p`,{role:`note`,className:`failure`,children:e},t))]})}var pT=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function mT(e){let t=2166136261;for(let n of e.map(e=>`${e.id}@${e.updated??``}@${e.status??``}`).join(`
32
- `))t^=n.charCodeAt(0),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,`0`)}var hT=[{id:`open`,label:`Not done`},{id:`done`,label:`Done`},{id:`all`,label:`All`}],gT=[{header:`Item`,label:`Item`,rowHeader:!0,cell:e=>(0,q.jsx)(dS,{id:e.item.id,withTitle:!0})},{header:`Verdict`,label:`Verdict`,cell:e=>(0,q.jsx)(cT,{verdict:e.readiness.verdict})},{header:`Why not ready`,label:`Why not ready`,cell:e=>(0,q.jsx)(uT,{readiness:e.readiness})},{header:`Assignee`,label:`Assignee`,cell:e=>km(e.item.assignee)},{header:`Status`,label:`Status`,cell:e=>`${e.item.status??`None`} (${Um[e.item.statusCategory]})`}];function _T(){let{dossier:e,now:t,startReady:n}=J(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),{EmptyState:s}=qx(),c=e.readiness,l=(0,v.useMemo)(()=>{let t=Jg(e.items,c);return e.items.map((e,n)=>({item:e,readiness:t[n]}))},[e,c]),[u,d]=(0,v.useState)(`all`),[f,p]=(0,v.useState)(`open`),[m,h]=(0,v.useState)(`all`),[g,_]=(0,v.useState)(`all`),[y,b]=(0,v.useState)(`all`),x=l.filter(e=>e.item.statusCategory!==`DONE`),S=Yg(x.map(e=>e.readiness)),C=x.filter(e=>e.readiness.verdict===`ready`),w={id:mT(C.map(e=>e.item)),items:C.map(e=>e.item.id)},T=e=>e.typeName??e.type,E=e=>e.assignee?km(e.assignee):``,D=[...new Set(l.map(e=>T(e.item)))].sort(),O=[...new Set(l.map(e=>E(e.item)).filter(Boolean))].sort(),k=[...new Set(l.map(e=>e.item.source.area))].sort(),A=l.filter(e=>(f===`all`||f===`done`==(e.item.statusCategory===`DONE`))&&(u===`all`||e.readiness.verdict===u)&&(m===`all`||T(e.item)===m)&&(g===`all`||(g===`none`?!e.item.assignee:E(e.item)===g))&&(y===`all`||e.item.source.area===y)),j=[...e.calls.dossier,...e.calls.work];return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsx)(`p`,{className:`eyebrow`,children:(0,q.jsx)(`a`,{href:Am(e.name),children:e.name})}),(0,q.jsx)(`h1`,{tabIndex:-1,children:`Command Center`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`Every work item in `,e.name,`, each with its readiness verdict and, where it isn't ready, why, from the records read `,Om(t),`. `,(0,q.jsx)(YS,{topic:`readiness`})]}),c.notes.map((e,t)=>(0,q.jsx)(`p`,{role:`note`,className:`failure`,children:e},t))]}),(0,q.jsx)(vS,{as:`ul`,min:`sm`,className:`team-strip readiness-tally`,"aria-label":`Open items by verdict`,children:lg.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(gS,{gap:`xs`,className:`team-tile`,children:[(0,q.jsx)(`h2`,{className:`readiness-tally__head`,children:(0,q.jsx)(cT,{verdict:e})}),(0,q.jsx)(`p`,{className:`team-figure`,children:S[e]}),(0,q.jsx)(`p`,{className:`note`,children:e===`ready`?`Every check passes.`:e===`thin`?`Missing acceptance criteria, description or another check a person can waive.`:`Done already, blocked by an open item, or outside the dossier.`})]})},e))}),(0,q.jsxs)(Q,{as:`section`,className:`panel readiness-slate`,"aria-labelledby":`slate`,children:[(0,q.jsx)(`h2`,{id:`slate`,children:`Start every ready item`}),(0,q.jsx)(`p`,{children:C.length?`${pT(C.length,`item is`,`items are`)} ready and would be slated, in the dossier's order (plan ${w.id}).`:`No open item is ready, so nothing would be slated. The list below says what each one is missing.`}),C.length>0&&(0,q.jsx)(`ul`,{className:`plain cites`,"aria-label":`Slated items`,children:C.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(dS,{id:e.item.id,withTitle:!0})},e.item.id))}),(0,q.jsxs)(_S,{className:`readiness-start`,children:[(0,q.jsxs)(B,{className:`btn`,isDisabled:!n||C.length===0||a,onPress:async()=>{if(n){o(!0);try{i({ok:!0,text:await n(w)})}catch(e){i({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{o(!1)}}},"aria-describedby":`slate-note`,children:[`Start `,pT(C.length,`ready item`)]}),(0,q.jsx)(`p`,{id:`slate-note`,className:`note`,children:n?`Assigns each item above to an agent in implement mode, as listed: proposals wait for you, and nothing leaves this machine until you apply one.`:`This view has no agent assignments, so it shows the plan it would start.`})]}),(0,q.jsx)(`p`,{className:r&&!r.ok?`failure`:`note`,role:`status`,children:r?.text??``})]}),(0,q.jsxs)(iT,{id:`cc-items`,title:`Items`,calls:j,children:[(0,q.jsxs)(_S,{className:`readiness-filters`,role:`group`,"aria-label":`Filter the items`,children:[(0,q.jsx)(tT,{label:`Verdict`,value:u,onChange:e=>d(e),options:[{id:`all`,label:`All`},...lg.map(e=>({id:e,label:cg[e]}))]}),(0,q.jsx)(tT,{label:`Status`,value:f,onChange:p,options:hT}),(0,q.jsx)(tT,{label:`Type`,value:m,onChange:h,options:[{id:`all`,label:`All`},...D.map(e=>({id:e,label:e}))]}),(0,q.jsx)(tT,{label:`Assignee`,value:g,onChange:_,options:[{id:`all`,label:`Anyone`},{id:`none`,label:`Unassigned`},...O.map(e=>({id:e,label:e}))]}),k.length>1&&(0,q.jsx)(tT,{label:`Source`,value:y,onChange:b,options:[{id:`all`,label:`All`},...k.map(e=>({id:e,label:`${Cm(e)} (${e})`}))]})]}),(0,q.jsxs)(`p`,{className:`note`,"aria-live":`polite`,children:[`Showing `,pT(A.length,`item`),` of `,l.length,`.`]}),A.length?(0,q.jsx)(xS,{label:`Items and their readiness`,caption:`${e.name}'s items and their readiness`,columns:gT,rows:A,rowKey:e=>e.item.id,wide:!0}):(0,q.jsx)(s,{message:`No item matches these filters.`})]})]})}var vT=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function yT({sources:e,dossier:t}){let n=t?(0,q.jsx)(XS,{href:zm(t,`sources`),label:`Edit ${t}'s sources`}):null;return e.length?(0,q.jsxs)(`div`,{className:`source-badges`,children:[(0,q.jsx)(`ul`,{className:`badges`,"aria-label":`Sources`,children:e.map(e=>(0,q.jsxs)(`li`,{className:`badge`,title:e.connection?`${Cm(e.area)}, connection ${e.connection}`:`${Cm(e.area)}, your default connection`,children:[Cm(e.area),e.connection&&(0,q.jsxs)(`span`,{className:`sr-only`,children:[`, connection `,e.connection]})]},e.area))}),n]}):(0,q.jsxs)(`p`,{className:`note`,children:[`No sources linked yet. `,n]})}function bT({preview:e,sprint:t=!0}){let n=e.sprint;return(0,q.jsxs)(`ul`,{className:`count-strip`,"aria-label":`Counts`,children:[t&&n&&(0,q.jsx)(xT,{value:String(n.daysLeft),label:`${n.daysLeft===1?`day`:`days`} left`}),(0,q.jsx)(xT,{value:String(e.inProgress),label:`in progress`}),(0,q.jsx)(xT,{value:String(e.blocked),label:`blocked`,tone:e.blocked?`warn`:void 0}),(0,q.jsx)(xT,{value:String(e.awaitingReview),label:e.awaitingReview===1?`PR waits on review`:`PRs wait on review`})]})}function xT({value:e,label:t,tone:n}){return(0,q.jsxs)(`li`,{className:`count${n?` count--${n}`:``}`,children:[(0,q.jsx)(`span`,{className:`count__value`,children:e}),` `,(0,q.jsx)(`span`,{className:`count__label`,children:t})]})}function ST({sprint:e}){let t=e.burn,n=Math.max(1,...t.map(e=>e.scope)),r=Math.max(1,t.length-1+e.ahead),i=e=>100*e/r,a=e=>28-26*e/n,o=e=>t.map((t,n)=>`${i(n).toFixed(1)},${a(e(t)).toFixed(1)}`).join(` `);return(0,q.jsx)(`svg`,{className:`mini-burnup`,viewBox:`0 0 100 30`,preserveAspectRatio:`none`,role:`img`,"aria-label":`Burn-up: ${e.done} of ${e.scope} points done`,children:t.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`polyline`,{className:`mini-burnup__scope`,points:o(e=>e.scope),vectorEffect:`non-scaling-stroke`}),(0,q.jsx)(`polyline`,{className:`mini-burnup__done`,points:o(e=>e.done),vectorEffect:`non-scaling-stroke`})]})})}function CT({sprint:e}){return(0,q.jsxs)(`p`,{className:`sprint-line`,children:[(0,q.jsx)(`span`,{className:`sprint-line__name`,children:e.name}),` `,(0,q.jsxs)(`span`,{className:`note`,children:[vT(e.daysLeft,`working day`),` left of `,e.daysTotal,`, `,e.done,` of `,vT(e.scope,`point`),` done`]})]})}function wT({field:e,dossier:t,value:n,config:r,onSaved:i,children:a}){let[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(n??``),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),m=(0,v.useRef)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(!1),_=(0,v.useId)(),y=e===`name`?`Rename ${t}`:n?`Edit ${t}'s description`:`Add a description to ${t}`;(0,v.useEffect)(()=>{o?m.current?.select():g.current&&(g.current=!1,h.current?.focus())},[o]);let b=()=>{g.current=!0,s(!1),p(null)},x=async()=>{if(!r||u)return;let a=c.trim();if(a===(n??``))return b();d(!0),p(null);try{let n=await r.run(`dossiers describe`,{dossier:t,[e]:a});if(!n.ok){p({message:n.error.message,fix:n.error.fix??null});return}let o=n.data;g.current=e===`description`,s(!1),i({name:o.name,description:o.description??null,renamed:o.renamed?{from:o.renamed.from,to:o.renamed.to}:null})}catch(e){p({message:e instanceof Error?e.message:String(e),fix:null})}finally{d(!1)}};return!o||!r||r.disabled?(0,q.jsxs)(`span`,{className:`editable editable--${e}`,children:[a,r&&!r.disabled&&(0,q.jsx)(`button`,{ref:h,type:`button`,className:`btn btn--small edit-pencil`,"data-edit":``,"aria-label":y,title:y,onClick:()=>{l(n??``),s(!0)},children:(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`✎`})})]}):(0,q.jsxs)(`span`,{className:`editable editable--${e} editable--open`,children:[(0,q.jsx)(`label`,{className:`sr-only`,htmlFor:_,children:e===`name`?`New name for ${t}`:`Description of ${t}`}),(0,q.jsx)(`input`,{ref:m,id:_,className:`edit-field`,value:c,disabled:u,maxLength:e===`name`?64:300,spellCheck:e===`description`,autoComplete:`off`,"aria-describedby":`${_}-hint${f?` ${_}-error`:``}`,"aria-invalid":f?!0:void 0,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),x()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),l(n??``),b())}}),(0,q.jsx)(`span`,{id:`${_}-hint`,className:`edit-hint note`,children:u?`Saving through toil dossiers describe…`:e===`name`?`Enter renames it with toil dossiers describe; Escape cancels. Lowercase letters, digits and hyphens.`:`Enter saves it with toil dossiers describe; Escape cancels.`}),f&&(0,q.jsxs)(`span`,{id:`${_}-error`,role:`alert`,className:`edit-error failure`,children:[f.message,f.fix&&(0,q.jsxs)(`span`,{className:`note`,children:[` Fix: `,f.fix]})]})]})}var TT=864e5,ET=e=>e.estimate?.unit===`points`?e.estimate.value:0;function DT(e,t){let n=Date.parse(e.sprint.start),r=Date.parse(e.sprint.end),i=Math.min(Date.parse(t),r),a=[],o=e.items.filter(e=>e.statusCategory===`DONE`&&ET(e)>0&&!Wp(e)).map(e=>e.id);for(let t=Math.floor(n/TT)*TT+TT-1;t-TT+1<=i;t+=TT){let n=new Date(Math.min(t,i)).toISOString(),r=0,o=0;for(let t of e.items){let i=e.entries.get(t.id);(i.kind!==`added`||i.at!==null&&i.at<=n)&&(r+=ET(t));let a=t.statusCategory===`DONE`?Wp(t):null;a&&a<=n&&(o+=ET(t))}a.push({at:n,scope:r,done:o})}let s=Date.parse(a.at(-1)?.at??new Date(i).toISOString());return{days:a,ahead:Math.max(0,Math.ceil((r-s)/TT)),unplaced:o}}var OT=e=>e.statusCategory===`DONE`;function kT(e,t){return!OT(e)&&e.links.some(e=>e.type===`blocks`&&e.direction===`inward`&&t.has(e.target)&&!OT(t.get(e.target)))}function AT(e,t,n){let r=new Map(e.items.map(e=>[e.id,e])),i=dm(e.items,e.changes,t),a=null;if(i){let e=DT(i,t);a={name:i.sprint.name,daysLeft:Math.max(0,i.days.total-i.days.gone),daysTotal:i.days.total,done:i.done.points,scope:i.done.points+i.remaining.points,burn:e.days.map(e=>({scope:e.scope,done:e.done})),ahead:e.ahead}}let o=e.pullRequests??[],s=e.items.filter(e=>e.statusCategory===`IN_PROGRESS`).length,c=e.items.filter(e=>kT(e,r)).length,l=o.filter(e=>e.state===`OPEN`&&hh(e,t).on===`review`).length,u=ng({dossier:e.name,entries:e.people??[],wipLimit:e.wipLimit??null,items:e.items,changes:o,now:t}),d=[...u.people,...u.unmapped].map(e=>({key:e.who.key,name:e.who.name,kind:e.who.kind})),f=n===null?null:e.items.filter(e=>e.updated!==null&&e.updated>n).length+o.filter(e=>e.updated!==null&&e.updated>n).length;return{sprint:a,inProgress:s,blocked:c,awaitingReview:l,people:d,changedSince:f,motion:s+c+l}}function jT(e,t,n=[]){return e.filter(e=>e.type!==`EPIC`&&e.type!==`OTHER`).map(e=>{let r=t.filter(t=>t.items.includes(e.id)),i=r.filter(e=>e.kind===`pull-request`),a=r.filter(e=>e.kind===`build`),o=[],s=e.statusCategory===`DONE`;return!s&&lm(e.id,t)?.outcome===`failed`&&o.push(`failing-build`),s&&i.length===0&&o.push(`done-without-change`),!s&&i.length>0&&i.every(e=>e.outcome===`merged`)&&o.push(`merged-not-done`),{item:e,changes:i,builds:a,deployedTo:n.filter(t=>t.items.includes(e.id)),flags:o}})}var MT={"failing-build":`Latest build failed`,"done-without-change":`Done with no linked change`,"merged-not-done":`All changes merged, item still open`},NT=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function PT(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function FT(e){return`nodeType`in e}function IT(e){return e?PT(e)?e:FT(e)?e.ownerDocument?.defaultView??window:window:window}function LT(e){let{Document:t}=IT(e);return e instanceof t}function RT(e){return!PT(e)&&e instanceof IT(e).HTMLElement}function zT(e){return e instanceof IT(e).SVGElement}function BT(e){return e?PT(e)?e.document:FT(e)?LT(e)?e:RT(e)||zT(e)?e.ownerDocument:document:document:document}var VT=NT?v.useLayoutEffect:v.useEffect;function HT(e){let t=(0,v.useRef)(e);return VT(()=>{t.current=e}),(0,v.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function UT(){let e=(0,v.useRef)(null);return[(0,v.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,v.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function WT(e,t){t===void 0&&(t=[e]);let n=(0,v.useRef)(e);return VT(()=>{n.current!==e&&(n.current=e)},t),n}function GT(e,t){let n=(0,v.useRef)();return(0,v.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function KT(e){let t=HT(e),n=(0,v.useRef)(null);return[n,(0,v.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function qT(e){let t=(0,v.useRef)();return(0,v.useEffect)(()=>{t.current=e},[e]),t.current}var JT={};function YT(e,t){return(0,v.useMemo)(()=>{if(t)return t;let n=JT[e]==null?0:JT[e]+1;return JT[e]=n,e+`-`+n},[e,t])}function XT(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var ZT=XT(1),QT=XT(-1);function $T(e){return`clientX`in e&&`clientY`in e}function eE(e){if(!e)return!1;let{KeyboardEvent:t}=IT(e.target);return t&&e instanceof t}function tE(e){if(!e)return!1;let{TouchEvent:t}=IT(e.target);return t&&e instanceof t}function nE(e){if(tE(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return $T(e)?{x:e.clientX,y:e.clientY}:null}var rE=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function iE(e){return e.matches(rE)?e:e.querySelector(rE)}var aE={display:`none`};function oE(e){let{id:t,value:n}=e;return v.createElement(`div`,{id:t,style:aE},n)}function sE(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return v.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function cE(){let[e,t]=(0,v.useState)(``);return{announce:(0,v.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var lE=(0,v.createContext)(null);function uE(e){let t=(0,v.useContext)(lE);(0,v.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function dE(){let[e]=(0,v.useState)(()=>new Set),t=(0,v.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,v.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var fE={draggable:`
33
- To pick up a draggable item, press the space bar.
34
- While dragging, use the arrow keys to move the item.
35
- Press space again to drop the item in its new position, or press escape to cancel.
36
- `},pE={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function mE(e){let{announcements:t=pE,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=fE}=e,{announce:a,announcement:o}=cE(),s=YT(`DndLiveRegion`),[c,l]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{l(!0)},[]),uE((0,v.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=v.createElement(v.Fragment,null,v.createElement(oE,{id:r,value:i.draggable}),v.createElement(sE,{id:s,announcement:o}));return n?(0,xr.createPortal)(u,n):u}var hE;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(hE||={});function gE(){}function _E(e,t){return(0,v.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function vE(){var e=[...arguments];return(0,v.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var yE=Object.freeze({x:0,y:0});function bE(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xE(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function SE(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var CE=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=SE(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(bE)};function wE(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function TE(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yE}function EE(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var DE=EE(1);function OE(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function kE(e,t,n){let r=OE(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var AE={ignoreTransform:!1};function jE(e,t){t===void 0&&(t=AE);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=IT(e).getComputedStyle(e);t&&(n=kE(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function ME(e){return jE(e,{ignoreTransform:!0})}function NE(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function PE(e,t){return t===void 0&&(t=IT(e).getComputedStyle(e)),t.position===`fixed`}function FE(e,t){t===void 0&&(t=IT(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function IE(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(LT(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!RT(i)||zT(i)||n.includes(i))return n;let a=IT(e).getComputedStyle(i);return i!==e&&FE(i,a)&&n.push(i),PE(i,a)?n:r(i.parentNode)}return e?r(e):n}function LE(e){let[t]=IE(e,1);return t??null}function RE(e){return!NT||!e?null:PT(e)?e:FT(e)?LT(e)||e===BT(e).scrollingElement?window:RT(e)?e:null:null}function zE(e){return PT(e)?e.scrollX:e.scrollLeft}function BE(e){return PT(e)?e.scrollY:e.scrollTop}function VE(e){return{x:zE(e),y:BE(e)}}var HE;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(HE||={});function UE(e){return!NT||!e?!1:e===document.scrollingElement}function WE(e){let t={x:0,y:0},n=UE(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var GE={x:.2,y:.2};function KE(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=GE);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=WE(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=HE.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=HE.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=HE.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=HE.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function qE(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function JE(e){return e.reduce((e,t)=>ZT(e,VE(t)),yE)}function YE(e){return e.reduce((e,t)=>e+zE(t),0)}function XE(e){return e.reduce((e,t)=>e+BE(t),0)}function ZE(e,t){if(t===void 0&&(t=jE),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);LE(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var QE=[[`x`,[`left`,`right`],YE],[`y`,[`top`,`bottom`],XE]],$E=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=IE(t),r=JE(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of QE)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},eD=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function tD(e){let{EventTarget:t}=IT(e);return e instanceof t?e:BT(e)}function nD(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var rD;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(rD||={});function iD(e){e.preventDefault()}function aD(e){e.stopPropagation()}var oD;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(oD||={});var sD={start:[oD.Space,oD.Enter],cancel:[oD.Esc],end:[oD.Space,oD.Enter,oD.Tab]},cD=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case oD.Right:return{...n,x:n.x+25};case oD.Left:return{...n,x:n.x-25};case oD.Down:return{...n,y:n.y+25};case oD.Up:return{...n,y:n.y-25}}},lD=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new eD(BT(t)),this.windowListeners=new eD(IT(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(rD.Resize,this.handleCancel),this.windowListeners.add(rD.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(rD.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&ZE(n),t(yE)}handleKeyDown(e){if(eE(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=sD,coordinateGetter:a=cD,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:yE;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=QT(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=WE(n),p=qE(n),m={x:Math.min(i===oD.Right?p.right-p.width/2:p.right,Math.max(i===oD.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===oD.Down?p.bottom-p.height/2:p.bottom,Math.max(i===oD.Down?p.top:p.top+p.height/2,u.y))},h=i===oD.Right&&!s||i===oD.Left&&!c,g=i===oD.Down&&!l||i===oD.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===oD.Right&&e<=d.x||i===oD.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===oD.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===oD.Down&&e<=d.y||i===oD.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===oD.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,ZT(QT(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};lD.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=sD,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function uD(e){return!!(e&&`distance`in e)}function dD(e){return!!(e&&`delay`in e)}var fD=class{constructor(e,t,n){n===void 0&&(n=tD(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=BT(i),this.documentListeners=new eD(this.document),this.listeners=new eD(n),this.windowListeners=new eD(IT(i)),this.initialCoordinates=nE(r)??yE,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(rD.Resize,this.handleCancel),this.windowListeners.add(rD.DragStart,iD),this.windowListeners.add(rD.VisibilityChange,this.handleCancel),this.windowListeners.add(rD.ContextMenu,iD),this.documentListeners.add(rD.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dD(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(uD(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(rD.Click,aD,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(rD.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=nE(e)??yE,s=QT(n,o);if(!t&&a){if(uD(a)){if(a.tolerance!=null&&nD(s,a.tolerance))return this.handleCancel();if(nD(s,a.distance))return this.handleStart()}if(dD(a)&&nD(s,a.tolerance))return this.handleCancel();this.handlePending(a,s)}else e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===oD.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},pD={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},mD=class extends fD{constructor(e){let{event:t}=e,n=BT(t.target);super(e,pD,n)}};mD.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var hD={move:{name:`mousemove`},end:{name:`mouseup`}},gD;(function(e){e[e.RightClick=2]=`RightClick`})(gD||={});var _D=class extends fD{constructor(e){super(e,hD,BT(e.event.target))}};_D.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==gD.RightClick&&(r?.({event:n}),!0)}}];var vD={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},yD=class extends fD{constructor(e){super(e,vD)}static setup(){return window.addEventListener(vD.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(vD.move.name,e)};function e(){}}};yD.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var bD;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(bD||={});var xD;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(xD||={});function SD(e){let{acceleration:t,activator:n=bD.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=xD.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=wD({delta:d,disabled:!a}),[m,h]=UT(),g=(0,v.useRef)({x:0,y:0}),_=(0,v.useRef)({x:0,y:0}),y=(0,v.useMemo)(()=>{switch(n){case bD.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case bD.DraggableRect:return i}},[n,i,c]),b=(0,v.useRef)(null),x=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),S=(0,v.useMemo)(()=>s===xD.TreeOrder?[...l].reverse():l,[s,l]);(0,v.useEffect)(()=>{if(!a||!l.length||!y)h();else{for(let e of S){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=KE(e,i,y,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),b.current=e,m(x,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()}},[t,x,r,h,a,o,JSON.stringify(y),JSON.stringify(p),m,l,S,u,JSON.stringify(f)])}var CD={x:{[HE.Backward]:!1,[HE.Forward]:!1},y:{[HE.Backward]:!1,[HE.Forward]:!1}};function wD(e){let{delta:t,disabled:n}=e,r=qT(t);return GT(e=>{if(n||!r||!e)return CD;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[HE.Backward]:e.x[HE.Backward]||i.x===-1,[HE.Forward]:e.x[HE.Forward]||i.x===1},y:{[HE.Backward]:e.y[HE.Backward]||i.y===-1,[HE.Forward]:e.y[HE.Forward]||i.y===1}}},[n,t,r])}function TD(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return GT(e=>t==null?null:r??e??null,[r,t])}function ED(e,t){return(0,v.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var DD;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(DD||={});var OD;(function(e){e.Optimized=`optimized`})(OD||={});var kD=new Map;function AD(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,v.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,v.useRef)(e),d=g(),f=WT(d),p=(0,v.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,v.useRef)(null),h=GT(t=>{if(d&&!n)return kD;if(!t||t===kD||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new $E(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,v.useEffect)(()=>{u.current=e},[e]),(0,v.useEffect)(()=>{d||p()},[n,d]),(0,v.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,v.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case DD.Always:return!1;case DD.BeforeDragging:return n;default:return!n}}}function jD(e,t){return GT(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function MD(e,t){return jD(e,t)}function ND(e){let{callback:t,disabled:n}=e,r=HT(t),i=(0,v.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,v.useEffect)(()=>()=>i?.disconnect(),[i]),i}function PD(e){let{callback:t,disabled:n}=e,r=HT(t),i=(0,v.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,v.useEffect)(()=>()=>i?.disconnect(),[i]),i}function FD(e){return new $E(jE(e),e)}function ID(e,t,n){t===void 0&&(t=FD);let[r,i]=(0,v.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=ND({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=PD({callback:a});return VT(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function LD(e){return TE(e,jD(e))}var RD=[];function zD(e){let t=(0,v.useRef)(e),n=GT(n=>e?n&&n!==RD&&e&&t.current&&e.parentNode===t.current.parentNode?n:IE(e):RD,[e]);return(0,v.useEffect)(()=>{t.current=e},[e]),n}function BD(e){let[t,n]=(0,v.useState)(null),r=(0,v.useRef)(e),i=(0,v.useCallback)(e=>{let t=RE(e.target);t&&n(e=>e?(e.set(t,VE(t)),new Map(e)):null)},[]);return(0,v.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=RE(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,VE(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{RE(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,v.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ZT(e,t),yE):JE(e):yE,[e,t])}function VD(e,t){t===void 0&&(t=[]);let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n.current=null},t),(0,v.useEffect)(()=>{let t=e!==yE;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?QT(e,n.current):yE}function HD(e){(0,v.useEffect)(()=>{if(!NT)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function UD(e,t){return(0,v.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function WD(e){return(0,v.useMemo)(()=>e?NE(e):null,[e])}var GD=[];function KD(e,t){t===void 0&&(t=jE);let[n]=e,r=WD(n?IT(n):null),[i,a]=(0,v.useState)(GD);function o(){a(()=>e.length?e.map(e=>UE(e)?r:new $E(t(e),e)):GD)}let s=PD({callback:o});return VT(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function qD(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return RT(t)?t:e}function JD(e){let{measure:t}=e,[n,r]=(0,v.useState)(null),i=PD({callback:(0,v.useCallback)(e=>{for(let{target:n}of e)if(RT(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=KT((0,v.useCallback)(e=>{let n=qD(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,v.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var YD=[{sensor:mD,options:{}},{sensor:lD,options:{}}],XD={current:{}},ZD={draggable:{measure:ME},droppable:{measure:ME,strategy:DD.WhileDragging,frequency:OD.Optimized},dragOverlay:{measure:jE}},QD=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},$D={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new QD,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:gE},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ZD,measureDroppableContainers:gE,windowRect:null,measuringScheduled:!1},eO={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:gE,draggableNodes:new Map,over:null,measureDroppableContainers:gE},tO=(0,v.createContext)(eO),nO=(0,v.createContext)($D);function rO(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new QD}}}function iO(e,t){switch(t.type){case hE.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case hE.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case hE.DragEnd:case hE.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case hE.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new QD(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case hE.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new QD(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case hE.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new QD(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function aO(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,v.useContext)(tO),a=qT(r),o=qT(n?.id);return(0,v.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!eE(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=iE(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function oO(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function sO(e){return(0,v.useMemo)(()=>({draggable:{...ZD.draggable,...e?.draggable},droppable:{...ZD.droppable,...e?.droppable},dragOverlay:{...ZD.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function cO(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,v.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;VT(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=TE(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=LE(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var lO=(0,v.createContext)({...yE,scaleX:1,scaleY:1}),uO;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(uO||={});var dO=(0,v.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=YD,collisionDetection:o=CE,measuring:s,modifiers:c,...l}=e,[u,d]=(0,v.useReducer)(iO,void 0,rO),[f,p]=dE(),[m,h]=(0,v.useState)(uO.Uninitialized),g=m===uO.Initialized,{draggable:{active:_,nodes:y,translate:b},droppable:{containers:x}}=u,S=_==null?null:y.get(_),C=(0,v.useRef)({initial:null,translated:null}),w=(0,v.useMemo)(()=>_==null?null:{id:_,data:S?.data??XD,rect:C},[_,S]),T=(0,v.useRef)(null),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(null),A=WT(l,Object.values(l)),j=YT(`DndDescribedBy`,t),ee=(0,v.useMemo)(()=>x.getEnabled(),[x]),te=sO(s),{droppableRects:ne,measureDroppableContainers:M,measuringScheduled:re}=AD(ee,{dragging:g,dependencies:[b.x,b.y],config:te.droppable}),N=TD(y,_),ie=(0,v.useMemo)(()=>O?nE(O):null,[O]),ae=z(),oe=MD(N,te.draggable.measure);cO({activeNode:_==null?null:y.get(_),config:ae.layoutShiftCompensation,initialRect:oe,measure:te.draggable.measure});let se=ID(N,te.draggable.measure,oe),ce=ID(N?N.parentElement:null),le=(0,v.useRef)({activatorEvent:null,active:null,activeNode:N,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:x,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),P=x.getNodeFor(le.current.over?.id),ue=JD({measure:te.dragOverlay.measure}),de=ue.nodeRef.current??N,fe=g?ue.rect??se:null,pe=!!(ue.nodeRef.current&&ue.rect),me=LD(pe?null:se),he=WD(de?IT(de):null),F=zD(g?P??N:null),I=KD(F),ge=oO(c,{transform:{x:b.x-me.x,y:b.y-me.y,scaleX:1,scaleY:1},activatorEvent:O,active:w,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:fe,over:le.current.over,overlayNodeRect:ue.rect,scrollableAncestors:F,scrollableAncestorRects:I,windowRect:he}),_e=ie?ZT(ie,b):null,ve=BD(F),ye=VD(ve),be=VD(ve,[se]),L=ZT(ge,ye),xe=fe?DE(fe,ge):null,Se=w&&xe?o({active:w,collisionRect:xe,droppableRects:ne,droppableContainers:ee,pointerCoordinates:_e}):null,Ce=xE(Se,`id`),[we,Te]=(0,v.useState)(null),Ee=wE(pe?ge:ZT(ge,be),we?.rect??null,se),De=(0,v.useRef)(null),Oe=(0,v.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=y.get(T.current);if(!i)return;let a=e.nativeEvent,o=new n({active:T.current,activeNode:i,event:a,options:r,context:le,onAbort(e){if(!y.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!y.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=y.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:C}};(0,xr.unstable_batchedUpdates)(()=>{r?.(i),h(uO.Initializing),d({type:hE.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),D(De.current),k(a)})},onMove(e){d({type:hE.DragMove,coordinates:e})},onEnd:s(hE.DragEnd),onCancel:s(hE.DragCancel)});De.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=le.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===hE.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=hE.DragCancel)}T.current=null,(0,xr.unstable_batchedUpdates)(()=>{d({type:e}),h(uO.Uninitialized),Te(null),D(null),k(null),De.current=null;let t=e===hE.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[y]),ke=ED(a,(0,v.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=y.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,Oe(n,t))},[y,Oe]));HD(a),VT(()=>{se&&m===uO.Initializing&&h(uO.Initialized)},[se,m]),(0,v.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=le.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:L.x,y:L.y},over:i};(0,xr.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[L.x,L.y]),(0,v.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=le.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(Ce),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,xr.unstable_batchedUpdates)(()=>{Te(s),a?.(c),f({type:`onDragOver`,event:c})})},[Ce]),VT(()=>{le.current={activatorEvent:O,active:w,activeNode:N,collisionRect:xe,collisions:Se,droppableRects:ne,draggableNodes:y,draggingNode:de,draggingNodeRect:fe,droppableContainers:x,over:we,scrollableAncestors:F,scrollAdjustedTranslate:L},C.current={initial:fe,translated:xe}},[w,N,Se,xe,y,de,fe,ne,x,we,F,L]),SD({...ae,delta:b,draggingRect:xe,pointerCoordinates:_e,scrollableAncestors:F,scrollableAncestorRects:I});let R=(0,v.useMemo)(()=>({active:w,activeNode:N,activeNodeRect:se,activatorEvent:O,collisions:Se,containerNodeRect:ce,dragOverlay:ue,draggableNodes:y,droppableContainers:x,droppableRects:ne,over:we,measureDroppableContainers:M,scrollableAncestors:F,scrollableAncestorRects:I,measuringConfiguration:te,measuringScheduled:re,windowRect:he}),[w,N,se,O,Se,ce,ue,y,x,ne,we,M,F,I,te,re,he]),Ae=(0,v.useMemo)(()=>({activatorEvent:O,activators:ke,active:w,activeNodeRect:se,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:y,over:we,measureDroppableContainers:M}),[O,ke,w,se,d,j,y,we,M]);return v.createElement(lE.Provider,{value:p},v.createElement(tO.Provider,{value:Ae},v.createElement(nO.Provider,{value:R},v.createElement(lO.Provider,{value:Ee},i)),v.createElement(aO,{disabled:n?.restoreFocus===!1})),v.createElement(mE,{...n,hiddenTextDescribedById:j}));function z(){let e=E?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),fO=(0,v.createContext)(null),pO=`button`,mO=`Draggable`;function hO(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=YT(mO),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,v.useContext)(tO),{role:p=pO,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,v.useContext)(g?lO:fO),[y,b]=KT(),[x,S]=KT(),C=UD(o,t),w=WT(n);return VT(()=>(d.set(t,{id:t,key:a,node:y,activatorNode:x,data:w}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,v.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===pO?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:C,node:y,over:f,setNodeRef:b,setActivatorNodeRef:S,transform:_}}var gO=`Droppable`,_O={timeout:25};function vO(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=YT(gO),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,v.useContext)(tO),u=(0,v.useRef)({disabled:n}),d=(0,v.useRef)(!1),f=(0,v.useRef)(null),p=(0,v.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={..._O,...i},_=WT(h??r),y=PD({callback:(0,v.useCallback)(()=>{d.current?(p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)):d.current=!0},[g]),disabled:m||!o}),[b,x]=KT((0,v.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y])),S=WT(t);return(0,v.useEffect)(()=>{y&&b.current&&(y.disconnect(),d.current=!1,y.observe(b.current))},[b,y]),(0,v.useEffect)(()=>(s({type:hE.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:f,data:S}}),()=>s({type:hE.UnregisterDroppable,key:a,id:r})),[r]),(0,v.useEffect)(()=>{n!==u.current.disabled&&(s({type:hE.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function yO(e){let{Avatar:t}=qx();return(0,q.jsx)(t,{...e})}function bO({category:e,status:t}){let n=Um[e];return(0,q.jsxs)(`span`,{className:`chip chip--${e.toLowerCase()}`,children:[t??n,t&&t.toLowerCase()!==n.toLowerCase()&&(0,q.jsxs)(`span`,{className:`chip-cat`,children:[` · `,n]})]})}var xO={blocked:`M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM3.8 12.2l8.4-8.4`,"failing-build":`M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM5.5 5.5l5 5m0-5-5 5`,aging:`M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM8 4.5V8l2.5 1.5`,"deployed-not-closed":`M8 13V3m-4 4 4-4 4 4M3 14h10`,carried:`M3 9a5 5 0 0 1 9-3m0-3v3H9M13 7v6H3`,"pr-no-build":`M5 3v10M5 3a1.5 1.5 0 1 0 0 .01M11 13V7a2 2 0 0 0-2-2H7m0 0 1.5-1.5M7 5l1.5 1.5`,stale:`M4 2h8M4 14h8M5 2c0 4 6 4 6 6s-6 2-6 6M11 2c0 4-6 4-6 6s6 2 6 6`,blocking:`M5.5 2h5L14 5.5v5L10.5 14h-5L2 10.5v-5ZM5 8h6`,"built-not-deployed":`M2.5 5 8 2l5.5 3v6L8 14l-5.5-3ZM2.5 5 8 8l5.5-3M8 8v6`,unestimated:`M6 6a2 2 0 1 1 3 1.7c-.6.4-1 .8-1 1.5V10M8 12.5v.5`,added:`M8 3v10M3 8h10`};function SO({insights:e,max:t=3,compact:n=!1}){if(!e.length)return null;let r=e.slice(0,t),i=e.slice(t);return(0,q.jsxs)(`ul`,{className:`insight-chips${n?` insight-chips--compact`:``}`,"aria-label":`Insights`,children:[r.map(e=>n?(0,q.jsxs)(`li`,{className:`insight insight--icon insight--w${e.weight}`,title:pm[e.code],children:[(0,q.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,focusable:`false`,children:(0,q.jsx)(`path`,{d:xO[e.code]})}),(0,q.jsx)(`span`,{className:`insight-word`,children:pm[e.code]})]},e.code):(0,q.jsx)(`li`,{className:`insight insight--w${e.weight}`,children:pm[e.code]},e.code)),i.length>0&&(0,q.jsxs)(`li`,{className:`insight insight--more`,...n?{title:i.map(e=>pm[e.code]).join(`, `)}:{},children:[`+`,i.length,` more`]})]})}var CO=(e,t)=>`${Am(e)}/assignment/${encodeURIComponent(t)}`,wO=e=>e.state===`working`||e.state===`queued`&&e.waiting===`slot`,TO=2e3;function EO(e){let{assignments:t}=J(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(0),c=(0,v.useCallback)(()=>s(e=>e+1),[]);(0,v.useEffect)(()=>{if(!t||t.disabled)return;let n=!0;return t.list(e).then(e=>{n&&(r(e),a(null))},e=>n&&a(e instanceof Error?e.message:String(e))),()=>{n=!1}},[t,e,o]);let l=n?.assignments.some(wO)??!1;return(0,v.useEffect)(()=>{if(!l)return;let e=setInterval(c,TO);return()=>clearInterval(e)},[l,c]),{list:n,error:i,reload:c}}function DO({a:e}){let t=e.state===`queued`&&e.waiting===`start`?`Queued, waiting for Start`:rw[e.state];return(0,q.jsx)(`span`,{className:`assign-state assign-state--${e.state}`,children:t})}function OO(e){if(!e.usage)return`usage not reported yet`;if(!e.usage.records.length)return`${CC[e.usage.adapter]} reported no usage`;let t=RC(AC(e.usage.records),e.usage.adapter).slice(0,2);return`${e.usage.sample?`sample figures: `:``}${t.join(`, `)}`}function kO({a:e,now:t}){let n=e.proposals.filter(e=>e.status===`pending`).length;return(0,q.jsx)(Q,{className:`assign-card`,children:(0,q.jsxs)(gS,{gap:`xs`,children:[(0,q.jsxs)(_S,{className:`assign-card__top`,children:[(0,q.jsx)(DO,{a:e}),(0,q.jsx)(`span`,{className:`assign-mode`,children:nw[e.mode].label})]}),(0,q.jsxs)(`p`,{className:`assign-card__item`,children:[(0,q.jsx)(dS,{id:e.item}),` `,(0,q.jsx)(`span`,{className:`assign-card__title`,children:e.itemTitle})]}),(0,q.jsxs)(`p`,{className:`note`,children:[e.adapter?tw[e.adapter]:`No adapter chosen yet`,` · `,aw(e.ranMs??iw(e,t)),` · `,OO(e)]}),e.state===`needs-you`&&(0,q.jsx)(`p`,{className:`assign-needs`,children:[n?`${n} ${n===1?`proposal`:`proposals`} to review`:``,e.questions.length?`${e.questions.length} ${e.questions.length===1?`question`:`questions`}`:``,e.stop?.reason===`injection`?`stopped on a possible injection`:``].filter(Boolean).join(`, `)}),e.stop&&e.state===`failed`&&(0,q.jsx)(`p`,{className:`assign-stop`,children:e.stop.message}),e.stale&&(0,q.jsx)(ZC,{stale:e.stale}),e.renewedBy&&(0,q.jsxs)(`p`,{className:`note`,children:[`Renewed as `,(0,q.jsx)(`a`,{href:CO(e.dossier,e.renewedBy),children:`a fresh assignment`}),`.`]}),(0,q.jsx)(`p`,{children:(0,q.jsxs)(`a`,{href:CO(e.dossier,e.id),children:[`Open the assignment`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` on `,e.item]})]})})]})})}function AO({item:e,list:t,start:n,close:r,onDone:i}){let{assignments:a,dossier:o}=J(),s=t.adapters.filter(e=>!e.problem),[c,l]=(0,v.useState)(n?.adapter??s.find(e=>e.name===t.preferred)?.name??s[0]?.name??null),[u,d]=(0,v.useState)(n?.mode??`refine`),[f,p]=(0,v.useState)(t.repos[0]?.name??null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),y=t.adapters.find(e=>e.name===c),b=u===`implement`?y?.implement??(t.repos.length?null:`${o.name} lists no repository with a local path, so implement mode has nothing to clone. Add one with toil dossiers add-repo ${o.name} <folder>.`):null,x=a&&!a.disabled&&c!==null&&!y?.problem&&!b&&!m&&(u!==`implement`||f!==null);return(0,q.jsxs)(`form`,{className:`assign-form`,onSubmit:async t=>{if(t.preventDefault(),x&&a&&c){h(!0),_(null);try{i(n?await a.start(n.id,c):await a.assign({dossier:o.name,item:e.id,mode:u,adapter:c,...u===`implement`&&f?{repo:f}:{}})),r()}catch(e){_(e instanceof Error?e.message:String(e))}finally{h(!1)}}},noValidate:!0,children:[(0,q.jsx)(Ui,{slot:`title`,level:2,id:`assign-title`,children:n?`Start the assignment`:`Assign to an agent`}),(0,q.jsxs)(`p`,{className:`note`,children:[(0,q.jsx)(dS,{id:e.id}),` `,e.title]}),(0,q.jsxs)(qd,{className:`agent-adapters`,value:c??``,onChange:e=>l(e),children:[(0,q.jsx)(Ai,{children:`Adapter`}),t.adapters.map(e=>(0,q.jsxs)(Jd,{value:e.name,className:`agent-choice`,isDisabled:e.problem!==null,children:[(0,q.jsx)(`strong`,{children:e.label}),(0,q.jsx)(`span`,{className:e.problem?`agent-missing`:`note`,children:e.problem??(e.implement?`Refine and investigate.`:`Refine, investigate and implement.`)})]},e.name))]}),n?(0,q.jsxs)(`p`,{children:[`Mode: `,(0,q.jsx)(`strong`,{children:nw[n.mode].label}),`, as the tracker asked (`,n.trigger,`). `,nw[n.mode].does]}):(0,q.jsxs)(qd,{className:`agent-adapters`,value:u,onChange:e=>d(e),children:[(0,q.jsx)(Ai,{children:`Mode`}),ew.map(e=>(0,q.jsxs)(Jd,{value:e,className:`agent-choice`,children:[(0,q.jsx)(`strong`,{children:nw[e].label}),(0,q.jsxs)(`span`,{className:`note`,children:[nw[e].does,` `,nw[e].changes]})]},e))]}),u===`implement`&&t.repos.length>0&&(0,q.jsxs)(qd,{className:`agent-adapters`,value:f??``,onChange:p,children:[(0,q.jsx)(Ai,{children:`Repository to clone`}),t.repos.map(e=>(0,q.jsxs)(Jd,{value:e.name,className:`agent-choice`,children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`span`,{className:`note any-break`,children:e.path})]},e.name))]}),b&&(0,q.jsx)(`p`,{className:`failure`,children:b}),(0,q.jsxs)(`p`,{className:`note`,children:[`It runs on your adapter's own subscription, `,t.settings.concurrent===1?`one assignment at a time`:`${t.settings.concurrent} assignments at a time`,`, for up to `,t.settings.timeLimitMinutes,` minutes, within your usage caps. Nothing it proposes leaves this machine until you apply it, and applying runs toil's own command through its write gate.`]}),t.settings.problem&&(0,q.jsx)(`p`,{className:`failure`,children:t.settings.problem}),a?.disabled&&(0,q.jsx)(`p`,{className:`failure`,children:a.disabled}),g&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:g}),(0,q.jsxs)(`div`,{className:`assign-actions`,children:[(0,q.jsx)(B,{type:`submit`,className:`btn btn--accent`,isDisabled:!x,children:m?`Assigning…`:n?`Start`:`Assign`}),(0,q.jsx)(B,{className:`btn`,onPress:r,children:`Cancel`})]})]})}function jO({item:e,start:t,isOpen:n,onOpenChange:r,onDone:i}){let a=n===void 0?{}:{isOpen:n,...r?{onOpenChange:r}:{}},o=i??(e=>void(window.location.hash=CO(e.dossier,e.id)));return(0,q.jsx)(Fd,{className:`feedback-overlay`,"data-backdrop":``,isDismissable:!0,...a,children:(0,q.jsx)(Nd,{className:`feedback-modal`,children:(0,q.jsx)(_d,{className:`feedback-dialog`,"aria-labelledby":`assign-title`,children:({close:n})=>(0,q.jsx)(MO,{item:e,...t?{start:t}:{},close:n,onDone:o})})})})}function MO({item:e,start:t,close:n,onDone:r}){let{assignments:i,dossier:a}=J(),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!i)return void l(`This view has no agent assignments.`);if(i.disabled)return void l(i.disabled);let e=!0;return i.list(a.name).then(t=>e&&s(t),t=>e&&l(t instanceof Error?t.message:String(t))),()=>{e=!1}},[i,a.name]),o?(0,q.jsx)(AO,{item:e,list:o,...t?{start:t}:{},close:n,onDone:r}):(0,q.jsxs)(`div`,{className:`assign-form`,children:[(0,q.jsx)(Ui,{slot:`title`,level:2,id:`assign-title`,children:`Assign to an agent`}),(0,q.jsx)(`p`,{className:c?`failure`:`note`,children:c??`Reading the adapters on this machine…`}),(0,q.jsx)(`div`,{className:`assign-actions`,children:(0,q.jsx)(B,{className:`btn`,onPress:n,children:`Close`})})]})}function NO({item:e}){let{assignments:t}=J();return t?(0,q.jsxs)(gd,{children:[(0,q.jsxs)(B,{className:`btn`,"data-assign-open":``,children:[`Assign to agent`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,e.id]})]}),(0,q.jsx)(jO,{item:e})]}):null}function PO({a:e,onStarted:t}){let[n,r]=(0,v.useState)(!1);return(0,q.jsxs)(`li`,{className:`assign-inbox__row`,children:[(0,q.jsxs)(_S,{children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(dS,{id:e.item}),` `,e.itemTitle,`: `,(0,q.jsx)(`strong`,{children:nw[e.mode].label.toLowerCase()}),`, asked for by the tracker's `,e.trigger,`.`]}),(0,q.jsxs)(B,{className:`btn btn--accent btn--small`,onPress:()=>r(!0),"data-inbox-start":``,children:[`Start`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,e.item]}),`…`]})]}),(0,q.jsx)(jO,{item:{id:e.item,title:e.itemTitle},start:e,isOpen:n,onOpenChange:r,onDone:t})]})}function FO({list:e,onSaved:t}){let{assignments:n}=J(),[r,i]=(0,v.useState)(String(e.settings.concurrent||1)),[a,o]=(0,v.useState)(String(e.settings.timeLimitMinutes)),[s,c]=(0,v.useState)(null),l=(0,v.useId)();return n?.saveSettings?(0,q.jsxs)(`details`,{className:`assign-limits`,children:[(0,q.jsx)(`summary`,{children:`Limits`}),(0,q.jsxs)(`form`,{className:`assign-limits__form`,onSubmit:async e=>{e.preventDefault();try{await n.saveSettings({concurrent:Number(r),timeLimitMinutes:Number(a)}),c(`Saved. The next assignment runs on these limits.`),t()}catch(e){c(e instanceof Error?e.message:String(e))}},"aria-describedby":l,children:[(0,q.jsxs)(gf,{className:`field-text`,value:r,onChange:i,inputMode:`numeric`,children:[(0,q.jsx)(Ai,{children:`Assignments at once (1 to 3)`}),(0,q.jsx)(Va,{})]}),(0,q.jsxs)(gf,{className:`field-text`,value:a,onChange:o,inputMode:`numeric`,children:[(0,q.jsx)(Ai,{children:`Minutes each (1 to 240)`}),(0,q.jsx)(Va,{})]}),(0,q.jsx)(B,{type:`submit`,className:`btn`,children:`Save the limits`}),(0,q.jsx)(`p`,{id:l,className:`note`,role:`status`,children:s??`Usage caps are under Settings, Agent usage: an assignment is one chat there.`}),!s&&(0,q.jsx)(XS,{href:`#/settings/agent-usage/caps`,label:`Edit the usage caps`})]})]}):null}function IO(){let{dossier:e,now:t,assignments:n}=J(),{list:r,error:i,reload:a}=EO(e.name);if(!n)return null;let o=r?.assignments.filter(e=>e.state===`queued`&&e.waiting===`start`)??[],s=r?.assignments.filter(e=>e.state!==`queued`||e.waiting!==`start`)??[];return(0,q.jsxs)(Q,{as:`section`,className:`panel agents-lane`,"aria-labelledby":`agents`,children:[(0,q.jsx)(`h2`,{id:`agents`,children:`Agents`}),(0,q.jsxs)(`p`,{className:`note`,children:[`Work items assigned to an agent from Toil UI: each one's state, mode, adapter, run time and what it used. `,r?`${r.settings.concurrent===1?`One runs at a time`:`${r.settings.concurrent} run at a time`}, for up to ${r.settings.timeLimitMinutes} minutes each.`:``,` Assign an item from its card's menu on the board, or from its page.`]}),n.disabled&&(0,q.jsx)(`p`,{className:`note`,children:n.disabled}),i&&(0,q.jsx)(`p`,{className:`failure`,children:i}),r?.settings.problem&&(0,q.jsx)(`p`,{className:`failure`,children:r.settings.problem}),o.length>0&&(0,q.jsxs)(`section`,{className:`assign-inbox`,"aria-labelledby":`agent-inbox`,children:[(0,q.jsx)(`h3`,{id:`agent-inbox`,children:`Agent inbox`}),(0,q.jsx)(`p`,{className:`note`,children:`Items whose tracker asks for an agent, by an agent: label or by assignment to one of the dossier's agents. Nothing runs until you press Start.`}),(0,q.jsx)(`ul`,{className:`rows`,children:o.map(e=>(0,q.jsx)(PO,{a:e,onStarted:a},e.id))})]}),r&&!s.length&&(0,q.jsxs)(`p`,{children:[`Nothing assigned to an agent in `,e.name,` yet.`]}),s.length>0&&(0,q.jsx)(vS,{min:`sm`,className:`assign-lane`,"aria-label":`Assignments`,children:s.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(kO,{a:e,now:t})},e.id))}),r&&(0,q.jsx)(LO,{list:r,onDone:a}),r&&(0,q.jsx)(FO,{list:r,onSaved:a})]})}function LO({list:e,onDone:t}){let{assignments:n,dossier:r}=J(),i=Yw(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null);if(!n)return null;let p=[...i?.session?.stale?[{key:`chat`,label:`The chat about ${r.name}: ${i.session.stale.text}`,skip:i.session.stale.restart??(i.busy?`It is answering a question now, and a renew never interrupts one.`:null),run:async()=>{let e=await i.renew();if(e)throw Error(e)}}]:[],...e.assignments.filter(e=>e.stale).map(e=>({key:e.id,label:`${nw[e.mode].label} ${e.item} on ${e.adapter?tw[e.adapter]:`no adapter`}, ${rw[e.state].toLowerCase()}: ${e.stale.text}`,skip:ow(e),run:()=>n.renew(e.id)}))];if(!p.length&&!a)return null;let m=d??p,h=m.filter(e=>!e.skip),g=async()=>{c(!0);let e=[];for(let t of h)try{await t.run(),e.push(`Renewed: ${t.label}`)}catch(n){e.push(`Not renewed: ${t.label}. ${n instanceof Error?n.message:String(n)}`)}u(e),c(!1),t()};return(0,q.jsxs)(q.Fragment,{children:[p.length>0&&(0,q.jsxs)(_S,{children:[(0,q.jsx)(B,{className:`btn`,onPress:()=>(u(null),f(p),o(!0)),"data-renew-all":``,children:`Renew all stale…`}),(0,q.jsxs)(`span`,{className:`note`,children:[(0,q.jsx)(XC,{}),` `,p.length===1?`One session started`:`${p.length} sessions started`,` on instructions that have changed since.`]})]}),(0,q.jsx)(Fd,{className:`feedback-overlay`,"data-backdrop":``,isDismissable:!0,isOpen:a,onOpenChange:o,children:(0,q.jsx)(Nd,{className:`feedback-modal`,children:(0,q.jsx)(_d,{className:`feedback-dialog`,"aria-labelledby":`renew-title`,children:({close:e})=>(0,q.jsxs)(`div`,{className:`assign-form`,children:[(0,q.jsx)(Ui,{slot:`title`,level:2,id:`renew-title`,children:`Renew stale sessions`}),(0,q.jsx)(`p`,{className:`note`,children:`Each renews as a fresh session on today's instructions, with what the old one left as context. The old one stays readable. Renew never interrupts a turn, and skips any session waiting on you.`}),(0,q.jsx)(`ul`,{className:`rows renew-list`,children:m.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`strong`,{children:e.skip?`Skipped`:`Renews`}),`: `,e.label,e.skip&&(0,q.jsxs)(`span`,{className:`note`,children:[` `,e.skip]})]},e.key))}),l&&(0,q.jsx)(`ul`,{className:`rows`,role:`status`,"aria-label":`What was renewed`,children:l.map((e,t)=>(0,q.jsx)(`li`,{children:e},t))}),(0,q.jsxs)(`div`,{className:`assign-actions`,children:[!l&&(0,q.jsx)(B,{className:`btn btn--accent`,onPress:()=>void g(),isDisabled:s||!h.length,"data-renew-confirm":``,children:s?`Renewing…`:h.length?`Renew ${h.length}`:`Nothing to renew`}),(0,q.jsx)(B,{className:`btn`,onPress:e,children:l?`Close`:`Cancel`})]})]})})})})]})}function RO({item:e}){let{dossier:t,now:n,assignments:r}=J(),{list:i,error:a}=EO(t.name);if(!r)return null;let o=i?.assignments.filter(t=>t.item===e.id)??[];return(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`item-agents`,children:[(0,q.jsx)(`h2`,{id:`item-agents`,children:`Agents`}),(0,q.jsxs)(_S,{children:[(0,q.jsx)(NO,{item:e}),(0,q.jsx)(`span`,{className:`note`,children:`Refine, investigate or implement it with Claude, Copilot or Codex. Its proposals wait for you.`})]}),a&&(0,q.jsx)(`p`,{className:`failure`,children:a}),o.length>0&&(0,q.jsx)(vS,{min:`sm`,className:`assign-lane`,"aria-label":`Assignments on ${e.id}`,children:o.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(kO,{a:e,now:n})},e.id))})]})}function zO(e,t){let n=[e,tw[e].toLowerCase()];return t.find(e=>e.kind===`agent`&&(n.some(t=>e.name.toLowerCase().includes(t))||Object.values(e.ids).some(e=>n.includes(e.toLowerCase()))))??null}function BO({people:e}){let{dossier:t,now:n,assignments:r}=J(),{list:i}=EO(t.name);if(!r||!i)return null;let a=[...new Set(i.assignments.flatMap(e=>e.adapter?[e.adapter]:[]))].sort();return(0,q.jsxs)(`section`,{className:`people-section`,"aria-labelledby":`agent-assignments`,children:[(0,q.jsx)(`h2`,{id:`agent-assignments`,children:`Agents' assignments`}),(0,q.jsx)(`p`,{className:`note`,children:`What each agent was assigned from Toil UI, as a teammate's plate: its own runs, not the pull requests above.`}),a.length?(0,q.jsx)(vS,{min:`md`,className:`people-cards`,children:a.map(t=>{let r=zO(t,e),a=i.assignments.filter(e=>e.adapter===t);return(0,q.jsx)(`li`,{children:(0,q.jsx)(Q,{className:`assign-agent`,children:(0,q.jsxs)(gS,{gap:`xs`,children:[(0,q.jsx)(`h3`,{children:r?`${r.name} (${tw[t]})`:tw[t]}),(0,q.jsx)(`p`,{className:`note`,children:VO.map(e=>[e,a.filter(t=>t.state===e).length]).filter(([,e])=>e).map(([e,t])=>`${t} ${rw[e].toLowerCase()}`).join(`, `)}),a.some(e=>e.stale)&&(0,q.jsxs)(`p`,{className:`note`,"data-stale":``,children:[(0,q.jsx)(XC,{}),` `,a.filter(e=>e.stale).length,` started on instructions that have changed since.`]}),(0,q.jsx)(`ul`,{className:`rows`,children:a.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(DO,{a:e}),` `,e.stale&&(0,q.jsx)(XC,{}),` `,(0,q.jsx)(`a`,{href:CO(e.dossier,e.id),children:nw[e.mode].label}),` `,(0,q.jsx)(dS,{id:e.item}),` `,(0,q.jsx)(`span`,{className:`note`,children:aw(e.ranMs??iw(e,n))})]},e.id))})]})})},t)})}):(0,q.jsxs)(`p`,{children:[`Nothing has been assigned to an agent in `,t.name,` yet.`]})]})}var VO=[`working`,`needs-you`,`queued`,`done`,`failed`],HO=[`TODO`,`IN_PROGRESS`,`DONE`];function UO(e){let t=e.filter(Hp);return(t.some(e=>e.statusCategory===`UNKNOWN`)?[...HO,`UNKNOWN`]:HO).map(e=>({category:e,items:t.filter(t=>t.statusCategory===e)}))}var WO=e=>e.source.area.split(`-`)[0];function GO(e,t,n){let r=n.filter(n=>WO(n)===WO(e)&&n.source.connection===e.source.connection&&n.statusCategory===t&&n.status),i=r.filter(t=>t.typeName===e.typeName),a=new Map;for(let e of i.length?i:r)a.set(e.status,(a.get(e.status)??0)+1);return[...a.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0]??null}function KO(e,t,n,r){if(t===e.statusCategory||t===`UNKNOWN`)return null;let i=wm(e),a=Um[t],o=GO(e,t,n),s={id:`board:${e.id}:${t}`,from:`board`,item:e.id,title:`Move ${i} to ${a}`,reason:`Dragged on the board from ${Um[e.statusCategory]} (${e.status??`no status`}).`},c=WO(e);if(c===`github`)return{...s,command:null,input:null,note:`toil has no command that sets a GitHub Projects status yet. Change ${i}'s Status field on the project board${e.url?`: ${e.url}`:``}.`};let l={text:`List the transitions the workflow offers:`,command:`jira issue transitions`,input:{dossier:r,key:e.source.key}},u={text:`List the states the work item type has:`,command:`${e.source.area} work-item states`,input:{dossier:r,type:e.typeName??`User Story`}};if(e.source.area===`ado-cloud`)return o?{...s,command:`ado-cloud work-item update`,input:{dossier:r,id:Number(e.source.key),field:[`System.State=${o}`]},note:null}:{...s,command:null,input:null,note:`No ${a} item in this dossier shows which state to use.`,hint:u};if(!o){let e=c===`jira`?l:u;return{...s,command:null,input:null,note:`No ${a} item in this dossier shows which status to use.`,hint:e}}return c===`jira`?{...s,command:`jira issue transition`,input:{dossier:r,key:e.source.key,transition:o},note:`"${o}" is the status other ${a} items use; the workflow may name the transition differently.`,hint:l}:c===`ado`?{...s,command:`ado work-item transition`,input:{dossier:r,id:Number(e.source.key),state:o},note:null}:{...s,command:null,input:null,note:`toil has no status change for ${e.source.area} items.`}}var qO=e=>Um[e],JO=class extends mD{static activators=[{eventName:`onPointerDown`,handler:(...e)=>e[0].nativeEvent.pointerType!==`touch`&&mD.activators[0].handler(...e)}]},YO={delay:250,tolerance:8},XO=10,ZO=(e,t)=>(n,{active:r,context:{collisionRect:i,droppableRects:a,over:o}})=>{let s={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[n.code];if(!s||!i)return;n.preventDefault();let c=e.indexOf(o?.id??t(r)),l=e[Math.min(e.length-1,Math.max(0,c+s))],u=l?a.get(l):void 0;if(u)return{x:u.left+Math.max(0,(u.width-i.width)/2),y:u.top+48}};function QO({item:e,others:t,onMove:n,menuOpen:r,setMenuOpen:i}){let{insights:a}=xm(),{dossier:o,assignments:s}=J(),{Card:c}=qx(),{attributes:l,listeners:u,setNodeRef:d,setActivatorNodeRef:f,transform:p,isDragging:m}=hO({id:e.id,attributes:{role:`group`,roleDescription:`draggable card`}}),[h,g]=(0,v.useState)(!1),_=(0,v.useRef)(null),y=(0,v.useId)(),b=wm(e),x=jm(o.name,e.id),S=p?{transform:`translate3d(${p.x}px, ${p.y}px, 0)`}:void 0,C=e=>{_.current=e,f(e)},w=e=>{e.target===e.currentTarget&&!m&&(e.key===`m`||e.key===`M`)&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(e.preventDefault(),i(!0)):u?.onKeyDown?.(e)},T=e=>{e.target.closest(`a`)||m||(e.preventDefault(),i(!0))},E=e=>{e.button!==0||e.target.closest(`a, button`)||(window.location.hash=x)},D=e=>{i(e),e||requestAnimationFrame(()=>document.activeElement===document.body&&_.current?.focus())},O=e=>{D(!1),e===`open`?window.location.hash=x:e===`assign`?g(!0):n(e)};return(0,q.jsxs)(`li`,{ref:d,style:S,className:`card card--${e.statusCategory.toLowerCase()}${m?` card--dragging`:``}`,children:[(0,q.jsx)(`div`,{ref:C,className:`card-grip`,...l,...u,"aria-labelledby":`${y}-key ${y}-title`,"aria-keyshortcuts":`M`,onKeyDown:w,onContextMenu:T,onClick:E,children:(0,q.jsxs)(c,{item:e,children:[(0,q.jsxs)(`div`,{className:`card-top`,children:[(0,q.jsx)(`a`,{id:`${y}-key`,href:x,className:`item-link card-key`,draggable:!1,children:(0,q.jsx)(`span`,{className:`key`,children:b})}),(0,q.jsx)(bO,{category:e.statusCategory,status:e.status})]}),(0,q.jsx)(`p`,{id:`${y}-title`,className:`card-title`,children:e.title}),(0,q.jsxs)(`div`,{className:`card-foot`,children:[(0,q.jsxs)(`span`,{className:`who`,children:[(0,q.jsx)(yO,{person:e.assignee}),` `,km(e.assignee)]}),(0,q.jsxs)(`span`,{className:`card-meta`,children:[(0,q.jsx)(SO,{insights:_m(e,a),compact:!0}),(0,q.jsxs)(`span`,{className:`field`,children:[(0,q.jsx)(`span`,{className:`source`,children:Cm(e.source.area)}),` · `,Wm(e)]})]})]})]})}),(0,q.jsx)(ou,{triggerRef:_,isOpen:r,onOpenChange:D,placement:`bottom start`,className:`popover`,children:(0,q.jsxs)(od,{className:`menu`,"aria-label":`${b} ${e.title}`,autoFocus:`first`,onAction:O,children:[(0,q.jsx)(fd,{id:`open`,className:`menu-item`,children:`Open`}),(0,q.jsxs)(ud,{children:[(0,q.jsx)(jo,{className:`menu-header`,children:`Move to`}),t.map(e=>(0,q.jsx)(fd,{id:e,className:`menu-item`,children:qO(e)},e))]}),s?(0,q.jsx)(fd,{id:`assign`,className:`menu-item`,children:`Assign to an agent…`}):null]})}),s&&(0,q.jsx)(jO,{item:e,isOpen:h,onOpenChange:g})]})}function $O({category:e,items:t,all:n,onMove:r,menuFor:i,setMenuFor:a}){let{setNodeRef:o,isOver:s}=vO({id:e}),c=lx(),l=`col-${e}`;return(0,q.jsxs)(`section`,{ref:o,className:`column column--${e.toLowerCase()}${s?` column--over`:``}`,"aria-labelledby":l,children:[(0,q.jsxs)(`h3`,{id:l,children:[qO(e),` `,(0,q.jsx)(`span`,{className:`count`,children:t.length})]}),t.length?(0,q.jsx)(`ul`,{className:`cards`,children:t.map(t=>(0,q.jsx)(QO,{item:t,others:n.filter(t=>t!==e&&t!==`UNKNOWN`),onMove:e=>r(t,e),menuOpen:i===t.id,setMenuOpen:e=>a(e?t.id:null)},t.id))}):(0,q.jsx)(`p`,{className:`note`,children:c(`empty.column`)})]})}function ek({items:e}){let{dossier:t,byId:n}=J(),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),l=UO(e),u=l.map(e=>e.category),d=vE(_E(JO,{activationConstraint:{distance:6}}),_E(yD,{activationConstraint:YO}),_E(lD,{coordinateGetter:ZO(u,e=>n.get(String(e))?.statusCategory)})),f=e=>{let t=n.get(String(e));return t?wm(t):String(e)},p=(e,n)=>{let r=KO(e,n,t.items,t.name);r?(i(e=>[r,...e.filter(e=>e.id!==r.id&&e.item!==r.item)]),o(`Proposed: ${r.title}. Nothing has changed in ${t.name}'s tracker.`)):o(`${wm(e)} is already in ${qO(n)}. Nothing proposed.`)};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`note`,children:`One column per status category, across every tracker, each card with its own status word. Drag a card to another column, or open its menu with a right-click, a long press or M, to propose a move: nothing changes until someone applies it with toil.`}),(0,q.jsx)(dO,{sensors:d,onDragEnd:e=>{let t=n.get(String(e.active.id));t&&(`touches`in e.activatorEvent&&Math.hypot(e.delta.x,e.delta.y)<XO?c(t.id):e.over&&p(t,e.over.id))},accessibility:{announcements:{onDragStart:({active:e})=>`Picked up ${f(e.id)}. Moving it proposes a change; nothing is changed.`,onDragOver:({active:e,over:t})=>t?`${f(e.id)} is over ${qO(t.id)}.`:`${f(e.id)} is not over a column.`,onDragEnd:({active:e,over:t})=>{if(!t)return`Dropped ${f(e.id)} outside the columns. Nothing proposed.`;let r=n.get(String(e.id))?.statusCategory===t.id;return`Dropped ${f(e.id)} on ${qO(t.id)}${r?`, where it already is. Nothing proposed.`:`.`}`},onDragCancel:({active:e})=>`Stopped dragging ${f(e.id)}. Nothing proposed.`},screenReaderInstructions:{draggable:`To pick up the card, press Space or Enter. Use the arrow keys to move it to the next or previous column, then press Space or Enter to propose the move, or Escape to cancel. Press M or the Menu key for its menu.`}},children:(0,q.jsx)(`div`,{className:`board`,style:{gridTemplateColumns:`repeat(${l.length}, minmax(15rem, 1fr))`},children:l.map(e=>(0,q.jsx)($O,{category:e.category,items:e.items,all:u,onMove:p,menuFor:s,setMenuFor:c},e.category))})}),(0,q.jsx)(`p`,{className:`sr-only`,role:`status`,children:a}),r.length>0&&(0,q.jsxs)(`div`,{className:`proposals`,"aria-label":`Proposed moves`,role:`group`,children:[(0,q.jsx)(`h3`,{children:`Proposed moves`}),r.map(e=>(0,q.jsx)(aC,{proposal:e,onDismiss:()=>i(t=>t.filter(t=>t.id!==e.id))},e.id))]})]})}var tk=560,nk={left:34,right:12,top:14,bottom:26},rk=e=>Math.round(e*10)/10;function ik({caption:e,head:t,rows:n}){return(0,q.jsxs)(`details`,{className:`figures`,children:[(0,q.jsx)(`summary`,{children:`Show the figures`}),(0,q.jsx)(xS,{label:e,caption:e,rows:n.map((e,t)=>({i:t,cells:e})),rowKey:e=>String(e.i),columns:t.map((e,t)=>({header:e,label:e,rowHeader:t===0,cell:e=>e.cells[t]}))})]})}function ak({label:e,height:t,children:n}){let r=(0,v.useId)(),i=`chart-fill-${r.replace(/[^\w-]/g,``)}`;return(0,q.jsxs)(`svg`,{className:`chart`,viewBox:`0 0 ${tk} ${t}`,role:`img`,"aria-labelledby":r,preserveAspectRatio:`xMidYMid meet`,style:{"--chart-fill":`url(#${i})`},children:[(0,q.jsx)(`title`,{id:r,children:e}),(0,q.jsx)(`defs`,{children:(0,q.jsxs)(`linearGradient`,{id:i,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`0`,className:`chart-stop chart-stop--top`}),(0,q.jsx)(`stop`,{offset:`1`,className:`chart-stop chart-stop--bottom`})]})}),n]})}var ok=e=>{let t=e<=5?1:e<=12?2:e<=30?5:10;return Array.from({length:Math.floor(e/t)+1},(e,n)=>n*t)};function sk({b:e,sprint:t}){let n=e.days.length+e.ahead,r=Math.max(1,...e.days.map(e=>e.scope)),i=e=>nk.left+(tk-nk.left-nk.right)*(e+1)/Math.max(1,n),a=e=>220-nk.bottom-(220-nk.top-nk.bottom)*e/r,o=nk.left,s=[`${o},${a(e.days[0]?.scope??0)}`,...e.days.map((e,t)=>`${i(t)},${a(e.scope)}`)].join(` `),c=[`${o},${a(0)}`,...e.days.map((e,t)=>`${i(t)},${a(e.done)}`)].join(` `),l=e.days.at(-1),u=`${c} ${i(e.days.length-1)},${a(0)} ${o},${a(0)}`,d=l?`${t} burn-up: ${l.done} of ${l.scope} points done after ${e.days.length} days, with ${e.ahead} days to go.${e.days[0]&&l.scope>e.days[0].scope?` Scope grew from ${e.days[0].scope} to ${l.scope} points.`:``}`:`${t} burn-up: no days yet.`;return(0,q.jsxs)(`figure`,{className:`chart-figure`,children:[(0,q.jsxs)(ak,{label:d,height:220,children:[ok(r).map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`line`,{className:`grid`,x1:nk.left,x2:tk-nk.right,y1:a(e),y2:a(e)}),(0,q.jsx)(`text`,{className:`axis`,x:nk.left-6,y:a(e)+4,textAnchor:`end`,children:e})]},e)),(0,q.jsx)(`line`,{className:`today`,x1:i(e.days.length-1),x2:i(e.days.length-1),y1:nk.top,y2:220-nk.bottom}),(0,q.jsx)(`polygon`,{className:`area`,points:u}),(0,q.jsx)(`polyline`,{className:`line line--scope`,points:s,pathLength:1}),(0,q.jsx)(`polyline`,{className:`line line--done`,points:c,pathLength:1}),(0,q.jsx)(`text`,{className:`axis`,x:o,y:212,children:`Start`}),(0,q.jsx)(`text`,{className:`axis`,x:i(e.days.length-1),y:212,textAnchor:`middle`,children:`Today`}),(0,q.jsx)(`text`,{className:`axis`,x:tk-nk.right,y:212,textAnchor:`end`,children:`End`})]}),(0,q.jsxs)(`figcaption`,{className:`legend`,children:[(0,q.jsx)(`span`,{className:`key-swatch key-swatch--done`,"aria-hidden":`true`}),` Done points `,(0,q.jsx)(`span`,{className:`key-swatch key-swatch--scope`,"aria-hidden":`true`}),` Scope`,e.unplaced.length>0&&(0,q.jsxs)(`span`,{className:`note`,children:[` `,e.unplaced.length,` done items have no recorded finish and aren't drawn.`]})]}),(0,q.jsx)(ik,{caption:`${t} burn-up by day`,head:[`Day`,`Scope (points)`,`Done (points)`],rows:e.days.map(e=>[Dm(e.at),e.scope,e.done])})]})}function ck({weeks:e,noun:t=`items finished`}){let n=Math.max(1,...e.map(e=>e.items.length)),r=(tk-nk.left-nk.right)/e.length,i=Math.min(48,r*.6),a=e=>74-56*e/n,o=`Throughput: ${e.reduce((e,t)=>e+t.items.length,0)} ${t} in ${e.length} weeks, ${e.map(e=>e.items.length).join(`, `)} by week, oldest first. The last week is still running.`;return(0,q.jsxs)(`figure`,{className:`chart-figure`,children:[(0,q.jsxs)(ak,{label:o,height:96,children:[(0,q.jsx)(`line`,{className:`grid`,x1:nk.left,x2:tk-nk.right,y1:a(0),y2:a(0)}),e.map((e,t)=>{let n=nk.left+r*t+r/2;return(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`rect`,{className:`bar${e.partial?` bar--partial`:``}`,x:n-i/2,y:a(e.items.length),width:i,height:Math.max(0,a(0)-a(e.items.length)),rx:3}),(0,q.jsx)(`text`,{className:`axis axis--value`,x:n,y:a(e.items.length)-5,textAnchor:`middle`,children:e.items.length}),(0,q.jsx)(`text`,{className:`axis`,x:n,y:90,textAnchor:`middle`,children:Dm(e.start).replace(/ \d{4}$/,``)})]},e.start)})]}),(0,q.jsx)(ik,{caption:`${t[0].toUpperCase()}${t.slice(1)} per week`,head:[`Week of`,t===`items finished`?`Finished`:`Count`],rows:e.map(e=>[`${Dm(e.start)}${e.partial?` (so far)`:``}`,e.items.length])})]})}function lk({points:e,p85:t}){let n=e.map(e=>Date.parse(e.end)),r=Math.min(...n),i=Math.max(...n),a=Math.max(1,i-r),o=Math.max(1,...e.map(e=>e.days),t??0),s=e=>nk.left+10+(tk-nk.left-nk.right-20)*(e-r)/a,c=e=>200-nk.bottom-(200-nk.top-nk.bottom)*e/(o*1.1),l=`Cycle time: ${e.length} finished items, from ${rk(Math.min(...e.map(e=>e.days)))} to ${rk(o)} days.${t===null?``:` 85% finished within ${rk(t)} days.`}`;return(0,q.jsxs)(`figure`,{className:`chart-figure`,children:[(0,q.jsxs)(ak,{label:l,height:200,children:[ok(Math.ceil(o)).map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`line`,{className:`grid`,x1:nk.left,x2:tk-nk.right,y1:c(e),y2:c(e)}),(0,q.jsx)(`text`,{className:`axis`,x:nk.left-6,y:c(e)+4,textAnchor:`end`,children:e})]},e)),t!==null&&(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`line`,{className:`p85`,x1:nk.left,x2:tk-nk.right,y1:c(t),y2:c(t)}),(0,q.jsxs)(`text`,{className:`axis axis--p85`,x:tk-nk.right,y:c(t)-5,textAnchor:`end`,children:[`85% within `,rk(t),` days`]})]}),e.map(e=>(0,q.jsx)(`circle`,{className:`dot`,cx:s(Date.parse(e.end)),cy:c(e.days),r:6},e.id)),(0,q.jsx)(`text`,{className:`axis`,x:nk.left,y:192,children:Dm(new Date(r).toISOString())}),(0,q.jsx)(`text`,{className:`axis`,x:tk-nk.right,y:192,textAnchor:`end`,children:Dm(new Date(i).toISOString())})]}),(0,q.jsx)(ik,{caption:`Cycle time per finished item`,head:[`Item`,`Finished`,`Cycle time`],rows:e.map(e=>[e.label,Dm(e.end),`${rk(e.days)} days`])})]})}function uk({days:e}){let t=e.reduce((e,t)=>e+t.calls,0),n=e.reduce((e,t)=>!e||t.calls>e.calls?t:e,null),r=`Calls per day: ${t} calls in ${e.length} days${n&&n.calls>0?`, the most on ${Dm(n.day)} with ${n.calls}`:``}.`;return(0,q.jsx)(fk,{days:e,value:e=>e.calls,label:r,max:String,figures:(0,q.jsx)(ik,{caption:`Calls per day, UTC`,head:[`Day`,`Calls`,`Failed`],rows:e.map(e=>[Dm(e.day),e.calls,e.failed])})})}function dk({days:e,compact:t}){let n=e.reduce((e,t)=>e+t.tokens,0),r=e.reduce((e,t)=>!e||t.tokens>e.tokens?t:e,null),i=`Tokens per day: ${t(n)} tokens in ${e.length} days${r&&r.tokens>0?`, the most on ${Dm(r.day)} with ${t(r.tokens)}`:``}.`;return(0,q.jsx)(fk,{days:e,value:e=>e.tokens,label:i,max:t,figures:(0,q.jsx)(ik,{caption:`Tokens per day, UTC`,head:[`Day`,`Tokens`],rows:e.map(e=>[Dm(e.day),e.tokens.toLocaleString(`en-US`)])})})}function fk({days:e,value:t,label:n,max:r,figures:i}){let a=Math.max(1,...e.map(t)),o=(tk-nk.left-nk.right)/Math.max(1,e.length),s=Math.max(2,Math.min(32,o*.7)),c=e=>88-70*e/a,l=Math.max(1,Math.ceil(e.length/6));return(0,q.jsxs)(`figure`,{className:`chart-figure`,children:[(0,q.jsxs)(ak,{label:n,height:110,children:[(0,q.jsx)(`line`,{className:`grid`,x1:nk.left,x2:tk-nk.right,y1:c(0),y2:c(0)}),(0,q.jsx)(`text`,{className:`axis`,x:nk.left-6,y:c(a)+4,textAnchor:`end`,children:r(a)}),e.map((n,r)=>{let i=nk.left+o*r+o/2;return(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`rect`,{className:`bar`,x:i-s/2,y:c(t(n)),width:s,height:Math.max(0,c(0)-c(t(n))),rx:2}),(r%l===0||r===e.length-1)&&(0,q.jsx)(`text`,{className:`axis${r!==e.length-1&&r/l%2==1?` axis--minor`:``}`,x:i,y:106,textAnchor:`middle`,children:Dm(n.day).replace(/ \d{4}$/,``)})]},n.day)})]}),i]})}var pk=e=>Math.round(e*10)/10,mk=e=>`${pk(e)} ${pk(e)===1?`day`:`days`}`;function hk({list:e,what:t}){return e.length?(0,q.jsxs)(`div`,{className:`unknowns`,children:[(0,q.jsxs)(`p`,{className:`note`,children:[e.length,` `,e.length===1?`item has`:`items have`,` no `,t,` the data can show:`]}),(0,q.jsx)(`ul`,{className:`plain`,children:e.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:e.id}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`Unknown: `,e.reason,`.`]})]},e.id))})]}):null}function gk(){let{now:e}=J(),{health:t}=xm(),{EmptyState:n}=qx(),r=lx();return t?(0,q.jsx)(sk,{b:DT(t,e),sprint:t.sprint.name}):(0,q.jsx)(n,{message:r(`empty.burnup`)})}function _k(){let{dossier:e,now:t}=J(),n=Zp(e.items,t),r=n.weeks.reduce((e,t)=>e+t.items.length,0),i=n.weeks.filter(e=>!e.partial),a=i.length?i.reduce((e,t)=>e+t.items.length,0)/i.length:0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`big-figure`,children:[(0,q.jsx)(`span`,{className:`big-number`,children:pk(a)}),` items a week`,(0,q.jsxs)(`span`,{className:`note`,children:[` over the last `,i.length,` full weeks; `,r,` finished in `,n.weeks.length,` weeks.`]})]}),(0,q.jsx)(ck,{weeks:n.weeks}),(0,q.jsx)(`p`,{className:`note`,children:`Counted in the week of each item's last move into Done, from its history.`}),(0,q.jsx)(hk,{list:n.unknown,what:`finish date`})]})}function vk(){let{dossier:e,byId:t}=J(),{insights:n}=xm(),r=Kp(e.items),i=r.known.map(e=>{let n=t.get(e.id);return{id:e.id,label:`${Cm(n.source.area)} ${wm(n)}`,end:e.end,days:e.days}});return(0,q.jsxs)(q.Fragment,{children:[i.length?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`big-figure`,children:[n.p85?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`big-number`,children:pk(n.p85.days)}),` days for `,85,`% of items`]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`big-number`,children:i.length}),` `,i.length===1?`item`:`items`,` timed`]}),(0,q.jsx)(`span`,{className:`note`,children:` From the first move into In progress to the last into Done.`})]}),(0,q.jsx)(lk,{points:i,p85:n.p85?.days??null}),!n.p85&&(0,q.jsxs)(`p`,{className:`note`,children:[`Fewer than `,3,` cycle times, so no percentile yet, and nothing is flagged as aging.`]})]}):(0,q.jsx)(`p`,{children:`No finished item here has a cycle time the data can show.`}),(0,q.jsx)(hk,{list:r.unknown,what:`cycle time`})]})}function yk(){let{dossier:e,now:t,byId:n}=J(),{insights:r}=xm(),i=Yp(e.items,t),a=Math.max(1,...i.known.map(e=>e.days),r.p85?.days??0);return(0,q.jsxs)(q.Fragment,{children:[i.known.length?(0,q.jsx)(`ul`,{className:`aging`,children:i.known.map(e=>{let t=n.get(e.id),i=r.p85!==null&&e.days>r.p85.days;return(0,q.jsxs)(`li`,{className:i?`aging--over`:void 0,children:[(0,q.jsxs)(`div`,{className:`aging-row`,children:[(0,q.jsx)(dS,{id:e.id,withTitle:!0}),(0,q.jsxs)(`span`,{className:`aging-days`,children:[mk(e.days),i&&(0,q.jsxs)(`span`,{className:`flag`,children:[` past p`,85]})]})]}),(0,q.jsxs)(`div`,{className:`aging-bar`,"aria-hidden":`true`,children:[(0,q.jsx)(`span`,{style:{width:`${100*e.days/a}%`}}),r.p85&&(0,q.jsx)(`i`,{style:{left:`${100*r.p85.days/a}%`}})]}),(0,q.jsxs)(`p`,{className:`evidence`,children:[(0,q.jsx)(yO,{person:t.assignee}),` `,t.status,`, in progress since `,Om(e.since),`. Source: `,(0,q.jsx)(`code`,{children:`history.transitions`})]})]},e.id)})}):(0,q.jsx)(`p`,{children:`Nothing in progress has a recorded start.`}),r.p85&&(0,q.jsxs)(`p`,{className:`note`,children:[`The marker on each bar is p`,85,` of this dossier's cycle times, `,mk(r.p85.days),`.`]}),(0,q.jsx)(hk,{list:i.unknown,what:`start`})]})}function bk(){let{insights:e}=xm(),t=vm(e);return t.length?(0,q.jsx)(`ol`,{className:`attention`,children:t.map((e,t)=>(0,q.jsxs)(`li`,{className:`attention-item attention-item--w${e.insights[0].weight}`,children:[(0,q.jsx)(`span`,{className:`rank`,"aria-hidden":`true`,children:t+1}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(dS,{id:e.id,withTitle:!0}),(0,q.jsx)(SO,{insights:e.insights,max:4}),(0,q.jsx)(`ul`,{className:`reasons`,children:e.insights.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[pm[e.code],`: `]}),(0,q.jsx)(pS,{text:e.text}),`. `,(0,q.jsxs)(`span`,{className:`field`,children:[`Source: `,(0,q.jsx)(`code`,{children:e.evidence})]})]},e.code))})]})]},e.id))}):(0,q.jsx)(`p`,{children:`Nothing open needs attention.`})}var xk=(0,v.lazy)(()=>op(()=>import(`./Graph-By9iJybf.js`).then(e=>({default:e.Graph})),__vite__mapDeps([3,4]),import.meta.url)),Sk=e=>`${e} ${e===1?`point`:`points`}`,Ck=e=>e.slice(e.lastIndexOf(`#`));function wk({of:e}){return(0,q.jsx)(`span`,{className:`outcome outcome--${e.outcome}`,children:e.state})}function Tk({change:e}){let t=e.kind===`pull-request`?`${Ck(e.id)} ${e.title}`:e.title;return e.url?(0,q.jsx)(`a`,{href:e.url,children:t}):(0,q.jsx)(`span`,{children:t})}function Ek({ids:e}){return e.length?(0,q.jsx)(`span`,{className:`cites`,children:e.map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&`, `,(0,q.jsx)(dS,{id:e})]},e))}):(0,q.jsx)(`span`,{className:`note`,children:`No work item named`})}function Dk(e){return[{header:`Work item`,label:`Work item`,rowHeader:!0,cell:e=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(dS,{id:e.item.id,withTitle:!0}),(0,q.jsxs)(`span`,{className:`field`,children:[` `,Wm(e.item)]})]})},{header:`Status`,label:`Status`,cell:e=>(0,q.jsxs)(q.Fragment,{children:[e.item.status,e.item.status?.toLowerCase()!==Um[e.item.statusCategory].toLowerCase()&&(0,q.jsxs)(`span`,{className:`field`,children:[` (`,Um[e.item.statusCategory],`)`]})]})},{header:`Pull requests`,label:`Pull requests`,cell:e=>e.changes.length?(0,q.jsx)(`ul`,{className:`plain`,children:e.changes.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(Tk,{change:e}),` `,(0,q.jsx)(wk,{of:e})]},e.id))}):`None linked`},{header:`Builds`,label:`Builds`,cell:t=>t.changes.length?(0,q.jsx)(`ul`,{className:`plain`,children:t.changes.map(t=>{let n=e.filter(e=>e.builds===t.id).sort((e,t)=>e.at<t.at?1:-1)[0];return(0,q.jsx)(`li`,{children:n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Tk,{change:n}),` `,(0,q.jsx)(wk,{of:n})]}):(0,q.jsxs)(`span`,{className:`note`,children:[`No build for `,Ck(t.id)]})},t.id)})}):`None`},{header:`Deployed to`,label:`Deployed to`,cell:e=>e.deployedTo.length?e.deployedTo.map(e=>e.environment).join(`, `):`Not deployed`},{header:`Check`,label:`Check`,cell:e=>e.flags.length?(0,q.jsx)(`ul`,{className:`plain flags`,children:e.flags.map(e=>(0,q.jsx)(`li`,{children:MT[e]},e))}):`No gaps`}]}function Ok(e){let{dossier:t,now:n}=J();return(0,v.useMemo)(()=>{if(!e)return null;let r=ng({dossier:t.name,entries:t.people??[],wipLimit:t.wipLimit??null,items:t.items,changes:t.pullRequests??[],now:n}),i=ag(r,e);return{name:i?.who.name??null,items:i?og(r,e,t.items,t.people??[]):[]}},[e,t,n])}function kk({person:e}={}){let{dossier:t,now:n,config:r,described:i}=J(),a=(0,v.useMemo)(()=>AT(t,n,null),[t,n]),o=Ok(e),{EmptyState:s,Loading:c}=qx(),l=cx(),u=lx(),[d,f]=(0,v.useState)(!1),{health:p}=xm();jk(p);let m=jT(p?.items??t.items,t.changes,t.deployments),h=d?m.filter(e=>e.flags.length):m,g=t.changes.filter(e=>e.kind===`pull-request`),_=t.changes.filter(e=>e.kind===`build`),y=[...t.calls.work,...t.calls.prs,...t.calls.builds,...t.calls.deployments];return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head dossier-head`,children:[(0,q.jsxs)(`p`,{className:`eyebrow`,children:[u(`dossier.eyebrow`),` `,(0,q.jsx)(YS,{topic:`dashboard`})]}),(0,q.jsx)(`h1`,{tabIndex:-1,children:(0,q.jsx)(wT,{field:`name`,dossier:t.name,value:t.name,config:r??null,onSaved:i??(()=>void 0),children:t.name})}),(0,q.jsx)(`p`,{className:`lede`,children:(0,q.jsx)(wT,{field:`description`,dossier:t.name,value:t.description,config:r??null,onSaved:i??(()=>void 0),children:t.description??(0,q.jsx)(`span`,{className:`note`,children:`No description`})})}),(0,q.jsxs)(`div`,{className:`dossier-head__strip`,children:[(0,q.jsx)(yT,{sources:t.sources,dossier:t.name}),(0,q.jsx)(bT,{preview:a})]}),(0,q.jsx)(rT,{calls:t.calls.dossier})]}),(0,q.jsx)(`div`,{className:`dashboard`,children:(0,q.jsxs)(`div`,{className:`dash-main`,children:[(0,q.jsx)(iT,{id:`sprint`,title:l(`sprint`,p?`${p.sprint.name}: day ${p.days.gone} of ${p.days.total}`:`Sprint`),calls:t.calls.work,children:p?(0,q.jsx)(Nk,{h:p}):(0,q.jsx)(s,{message:u(`empty.sprint`)})}),(0,q.jsxs)(iT,{id:`attention`,title:`Needs attention`,calls:y,alerts:!1,children:[(0,q.jsxs)(`p`,{className:`note`,children:[u(`attention.note`),` `,(0,q.jsx)(YS,{topic:`insights`})]}),(0,q.jsx)(bk,{})]}),(0,q.jsxs)(iT,{id:`board`,title:l(`board`,p?`${p.sprint.name} board`:`Board`),calls:t.calls.work,alerts:!1,children:[o&&(0,q.jsx)(Ak,{name:o.name,shown:(p?.items??t.items).filter(e=>o.items.includes(e)).length,all:o.items.length}),(0,q.jsx)(ek,{items:o?(p?.items??t.items).filter(e=>o.items.includes(e)):p?.items??t.items})]}),(0,q.jsx)(IO,{}),(0,q.jsxs)(`div`,{className:`panel-grid panel-grid--two`,children:[(0,q.jsx)(iT,{id:`throughput`,title:`Throughput`,calls:t.calls.work,alerts:!1,children:(0,q.jsx)(_k,{})}),(0,q.jsx)(iT,{id:`cycle`,title:`Cycle time`,calls:t.calls.work,alerts:!1,children:(0,q.jsx)(vk,{})})]}),(0,q.jsxs)(iT,{id:`aging`,title:`Aging work in progress`,calls:t.calls.work,alerts:!1,children:[(0,q.jsx)(`p`,{className:`note`,children:u(`aging.note`)}),(0,q.jsx)(yk,{})]}),(0,q.jsx)(iT,{id:`graph`,title:l(`dependencies`,`Dependencies`),calls:t.calls.work,alerts:!1,children:(0,q.jsx)(v.Suspense,{fallback:(0,q.jsx)(c,{message:u(`loading.graph`)}),children:(0,q.jsx)(xk,{})})}),(0,q.jsxs)(iT,{id:`trace`,title:`Stories, pull requests, builds and deployments`,calls:y,alerts:!1,children:[(0,q.jsx)(`p`,{className:`note`,children:u(`trace.note`)}),(0,q.jsxs)(Ia,{className:`check`,isSelected:d,onChange:f,children:[(0,q.jsx)(`span`,{className:`box`,"aria-hidden":`true`,children:d?`✓`:``}),`Only items with something to check`]}),(0,q.jsx)(xS,{className:`trace`,label:`Work items and their delivery`,wide:!0,rows:h,rowKey:e=>e.item.id,columns:Dk(_)})]}),(0,q.jsxs)(`div`,{className:`panel-grid`,children:[(0,q.jsxs)(iT,{id:`prs`,title:`Pull requests`,calls:t.calls.prs,children:[(0,q.jsxs)(`p`,{className:`note`,children:[(0,q.jsx)(`a`,{href:Mm(t.name),children:`The pull requests view`}),` ranks the open ones by how long each has waited and on what, with flags and flow by author kind.`]}),g.length?(0,q.jsx)(`ul`,{className:`rows`,children:g.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(Tk,{change:e}),` `,(0,q.jsx)(wk,{of:e}),(0,q.jsxs)(`p`,{className:`evidence`,children:[(0,q.jsx)(Ek,{ids:e.items}),`. `,e.outcome===`merged`?`Merged`:`Opened`,` `,Om(e.at),`.`]})]},e.id))}):(0,q.jsx)(s,{message:u(`empty.prs`)})]}),(0,q.jsx)(iT,{id:`builds`,title:`Builds`,calls:t.calls.builds,children:_.length?(0,q.jsx)(`ul`,{className:`rows`,children:_.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(Tk,{change:e}),` `,(0,q.jsx)(wk,{of:e}),(0,q.jsxs)(`p`,{className:`evidence`,children:[`For pull request `,e.builds?Ck(e.builds):`none`,`, `,Om(e.at),`.`]})]},e.id))}):(0,q.jsx)(s,{message:u(`empty.builds`)})}),(0,q.jsx)(iT,{id:`deployments`,title:`Deployments`,calls:t.calls.deployments,children:t.deployments.length?(0,q.jsx)(`ul`,{className:`rows`,children:t.deployments.map(e=>(0,q.jsx)(Mk,{d:e},e.id))}):(0,q.jsx)(s,{message:u(`empty.deployments`)})})]})]})})]})}function Ak({name:e,shown:t,all:n}){let{dossier:r}=J(),i=(0,v.useRef)(null);(0,v.useEffect)(()=>{(i.current?.closest(`section`)??i.current)?.scrollIntoView?.({block:`start`})},[]);let a=e=>`${e} ${e===1?`item`:`items`}`;return(0,q.jsxs)(`p`,{id:`board-filter`,ref:i,className:`board-filter`,tabIndex:-1,children:[e===null?(0,q.jsx)(q.Fragment,{children:`The People view's link named nobody this dossier's data shows, so no items are shown. `}):(0,q.jsxs)(q.Fragment,{children:[`Showing `,e,`'s items: `,a(t),` on this board`,n>t?`, of ${a(n)} assigned to them in all`:``,`.`,` `]}),(0,q.jsx)(`a`,{href:Am(r.name),children:`Show everyone's`}),` · `,(0,q.jsx)(`a`,{href:Nm(r.name),children:`Back to People`})]})}function jk(e){let t=e&&e.days.total>1?Math.min(1,Math.max(0,(e.days.gone-1)/(e.days.total-1))):null;(0,v.useEffect)(()=>{if(t===null)return;let e=document.documentElement;return e.style.setProperty(`--sprint-progress`,t.toFixed(3)),()=>{e.style.removeProperty(`--sprint-progress`)}},[t])}function Mk({d:e}){let t=e.url?(0,q.jsx)(`a`,{href:e.url,children:e.name}):(0,q.jsx)(`span`,{children:e.name});return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`h3`,{className:`env`,children:e.environment}),(0,q.jsxs)(`p`,{children:[t,` `,(0,q.jsx)(`span`,{className:`outcome outcome--${e.outcome}`,children:e.state})]}),(0,q.jsxs)(`p`,{className:`evidence`,children:[e.version?`${e.version}, `:``,`commit `,(0,q.jsx)(`code`,{children:e.commit}),`.`,` `,e.unknownCommit?(0,q.jsx)(`span`,{className:`failure`,children:`No listed pull request merged as this commit.`}):(0,q.jsxs)(q.Fragment,{children:[`Includes `,e.includes.length,` merged pull `,e.includes.length===1?`request`:`requests`,e.items.length?(0,q.jsxs)(q.Fragment,{children:[`, for `,(0,q.jsx)(Ek,{ids:e.items})]}):`, none for this sprint`,`.`]})]})]})}function Nk({h:e}){let t=e.done.points+e.remaining.points,n=t=>e.items.filter(n=>e.entries.get(n.id)?.kind===t);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`note`,children:[Dm(e.sprint.start),` to `,Dm(e.sprint.end),`, working days only.`]}),(0,q.jsxs)(`ul`,{className:`stats`,"aria-label":`Sprint figures`,children:[(0,q.jsx)(Pk,{label:`Done`,value:`${e.done.points} of ${t}`,note:`points, ${e.done.count} items`}),(0,q.jsx)(Pk,{label:`Planned`,value:String(e.planned.points),note:`points, ${e.planned.count} items`}),(0,q.jsx)(Pk,{label:`Added mid-sprint`,value:String(e.added.points),note:`points, ${e.added.count} items`}),(0,q.jsx)(Pk,{label:`Carried over`,value:String(e.carried.points),note:`points, ${e.carried.count} items`})]}),(0,q.jsx)(`div`,{className:`meter`,role:`img`,"aria-label":`${e.done.points} of ${t} points done`,children:(0,q.jsx)(`span`,{style:{width:`${t?100*e.done.points/t:0}%`}})}),(0,q.jsx)(gk,{}),e.otherUnits.length>0&&(0,q.jsxs)(`p`,{className:`note`,children:[`Points totals leave out items estimated in other units:`,` `,e.otherUnits.map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&`, `,(0,q.jsx)(dS,{id:e})]},e)),`.`]}),(0,q.jsx)(`h3`,{children:`At risk`}),e.risks.length?(0,q.jsx)(`ul`,{className:`rows`,children:e.risks.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:e.id,withTitle:!0}),(0,q.jsx)(`ul`,{className:`reasons`,children:e.reasons.map((e,t)=>(0,q.jsx)(`li`,{children:(0,q.jsx)(pS,{text:fm(e)})},t))})]},e.id))}):(0,q.jsx)(`p`,{children:`Nothing.`}),[`added`,`carried`].map(t=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h3`,{children:t===`added`?`Added after the sprint started`:`Carried over`}),n(t).length?(0,q.jsx)(`ul`,{className:`rows`,children:n(t).map(t=>{let n=e.entries.get(t.id);return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:t.id,withTitle:!0}),(0,q.jsxs)(`p`,{className:`evidence`,children:[n.from?`From ${n.from}`:`Added`,n.at?` on ${Om(n.at)}`:``,`, `,Sk(t.estimate?.unit===`points`?t.estimate.value:0),t.estimate?``:` (no estimate)`,`. Source: `,(0,q.jsx)(`code`,{children:n.evidence})]})]},t.id)})}):(0,q.jsx)(`p`,{children:`None.`})]},t))]})}function Pk({label:e,value:t,note:n}){return(0,q.jsxs)(`li`,{className:`stat`,children:[(0,q.jsx)(`span`,{className:`stat-label`,children:e}),(0,q.jsx)(`span`,{className:`stat-value`,children:t}),(0,q.jsx)(`span`,{className:`stat-note`,children:n})]})}var Fk=`toil-ui:looked`;function Ik(){try{let e=JSON.parse(window.localStorage.getItem(Fk)??`{}`);return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`&&!Number.isNaN(Date.parse(e[1]))))}catch{return{}}}function Lk(e){try{window.localStorage.setItem(Fk,JSON.stringify(e))}catch{}}var Rk=e=>Ik()[e]??null;function zk(e){let t=Ik();return e.filter(e=>t[e]).sort((e,n)=>t[e]<t[n]?1:-1)[0]??null}function Bk(e,t=new Date().toISOString()){Lk({...Ik(),[e]:t})}function Vk(e,t){let{[e]:n,...r}=Ik();n!==void 0&&Lk({...r,[t]:n})}function Hk(e,t,n){if(e.length===1)return e[0];let r=zk(e);if(r)return r;if(!n)return null;let i=e.filter(e=>t.has(e)).sort((e,n)=>t.get(n).motion-t.get(e).motion);return i[0]&&t.get(i[0]).motion>0?i[0]:null}function Uk({dossiers:e,calls:t,loaded:n,now:r,synced:i,config:a,onDescribed:o}){let{EmptyState:s}=qx(),c=lx(),l=new Map;for(let t of e){let e=n[t.name];e?.ok&&l.set(t.name,AT(e.value,r,Rk(t.name)))}let u=Hk(e.map(e=>e.name),l,e.every(e=>n[e.name]!==void 0)),d=u?[...e.filter(e=>e.name===u),...e.filter(e=>e.name!==u)]:e;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsx)(`h1`,{tabIndex:-1,children:`Dossiers`}),(0,q.jsxs)(`p`,{className:`lede`,children:[c(`dossiers.lede`),` `,(0,q.jsx)(YS,{topic:`dossiers`})]})]}),e.length===0?(0,q.jsx)(s,{message:c(`empty.dossiers`)}):(0,q.jsx)(vS,{className:`dossiers`,min:`sm`,children:d.map(e=>(0,q.jsx)(`li`,{className:e.name===u?`dossiers__lead`:void 0,children:(0,q.jsx)(Gk,{summary:e,loaded:n[e.name],preview:l.get(e.name)??null,synced:i?i[e.name]??null:void 0,lead:e.name===u,config:a,onDescribed:o})},e.name))}),(0,q.jsx)(rT,{calls:t})]})}var Wk=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Gk({summary:e,loaded:t,preview:n,synced:r,lead:i,config:a,onDescribed:o}){let{Avatar:s}=qx(),c=`dossier-${e.name}`,l=n?.people.slice(0,6)??[],u=(n?.people.length??0)-l.length;return(0,q.jsxs)(Q,{className:`dossier-card${i?` dossier-card--lead`:``}`,"aria-labelledby":c,children:[(0,q.jsxs)(`div`,{className:`dossier-card__head`,children:[(0,q.jsx)(`h2`,{id:c,children:(0,q.jsx)(wT,{field:`name`,dossier:e.name,value:e.name,config:a,onSaved:o,children:(0,q.jsx)(`a`,{href:Am(e.name),children:e.name})})}),(0,q.jsx)(wT,{field:`description`,dossier:e.name,value:e.description,config:a,onSaved:o,children:e.description?(0,q.jsx)(`span`,{className:`dossier-card__desc`,children:e.description}):(0,q.jsx)(`span`,{className:`note`,children:`No description`})})]}),(0,q.jsx)(`div`,{className:`dossier-card__body`,children:t?t.ok?n?(0,q.jsxs)(q.Fragment,{children:[n.sprint?(0,q.jsxs)(`div`,{className:`dossier-card__sprint`,children:[(0,q.jsx)(CT,{sprint:n.sprint}),(0,q.jsx)(ST,{sprint:n.sprint})]}):(0,q.jsx)(`p`,{className:`note`,children:`No sprint running.`}),(0,q.jsx)(bT,{preview:n,sprint:!1}),l.length>0&&(0,q.jsxs)(`ul`,{className:`avatars`,"aria-label":`People: ${n.people.map(e=>e.name).join(`, `)}`,children:[l.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(s,{person:{id:e.key,name:e.name,email:null},labelled:!0})},e.key)),u>0&&(0,q.jsxs)(`li`,{className:`avatars__more`,"aria-hidden":`true`,children:[`+`,u]})]})]}):null:(0,q.jsxs)(`p`,{className:`note`,children:[`Its work couldn't be read: `,t.message]}):(0,q.jsx)(`p`,{className:`note`,role:`status`,children:`Reading what the last sync stored…`})}),(0,q.jsxs)(`div`,{className:`dossier-card__foot`,children:[(0,q.jsx)(yT,{sources:e.sources,dossier:e.name}),(0,q.jsxs)(`p`,{className:`note dossier-card__when`,children:[r===void 0?`Sample data.`:r===null?`Not synced yet.`:`Synced ${Om(r.at)}${r.status===`ok`?``:r.status===`partial`?`, some sources failed`:`, and it failed`}.`,n&&n.changedSince!==null&&(0,q.jsxs)(q.Fragment,{children:[` `,n.changedSince?`${Wk(n.changedSince,`change`)} since you last looked.`:`Nothing changed since you last looked.`]})]})]})]})}var Kk=new WeakMap;function qk(e,t){let n=Kk.get(e);return n||Kk.set(e,n=new tb(e)),n.item(t,{limit:5})?.matches??[]}var Jk={blocks:[`Blocks`,`Blocked by`],relates:[`Relates to`,`Relates to`],duplicates:[`Duplicates`,`Duplicated by`],implements:[`Implements`,`Implemented by`],other:[`Linked to`,`Linked from`]};function Yk({id:e}){let{byId:t,dossier:n,now:r}=J(),i=ex(),{insights:a}=xm(),{EmptyState:o}=qx(),s=t.get(e);if(!s)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h1`,{tabIndex:-1,children:`No such item`}),(0,q.jsx)(o,{message:`The dossier has no item ${e}.`,children:(0,q.jsx)(`p`,{children:(0,q.jsxs)(`a`,{href:Am(n.name),children:[`Back to `,n.name]})})})]});let c=n.changes.filter(t=>t.items.includes(e)),l=n.deployments.filter(t=>t.items.includes(e)),u=im(s),d=Cm(s.source.area),f=_m(s,a),p=Gp(s),m=Jp(s,r),h=e=>Math.round(e*10)/10,g=qk(n.items,e);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsxs)(`p`,{className:`eyebrow`,children:[d,` `,wm(s)]}),(0,q.jsx)(`h1`,{tabIndex:-1,children:s.title}),(0,q.jsxs)(`p`,{className:`item-meta`,children:[(0,q.jsx)(bO,{category:s.statusCategory,status:s.status}),` `,(0,q.jsx)(yO,{person:s.assignee}),` `,km(s.assignee),s.url&&(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`a`,{href:s.url,children:[`Open in `,d]})]})]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel insights-panel`,"aria-labelledby":`insights`,children:[(0,q.jsx)(`h2`,{id:`insights`,children:`Insights`}),f.length?(0,q.jsx)(`ul`,{className:`rows`,children:f.map(e=>(0,q.jsxs)(`li`,{className:`insight-row insight-row--w${e.weight}`,children:[(0,q.jsx)(`span`,{className:`insight insight--w${e.weight}`,children:pm[e.code]}),` `,(0,q.jsx)(pS,{text:e.text}),`.`,` `,(0,q.jsxs)(`span`,{className:`field`,children:[`Source: `,(0,q.jsx)(`code`,{children:e.evidence})]})]},e.code))}):(0,q.jsx)(`p`,{children:s.statusCategory===`DONE`?`Done: nothing to act on.`:`Nothing stands out.`}),(0,q.jsx)(`p`,{className:`note`,children:p?p.days===null?`Cycle time unknown: ${p.reason}.`:`Cycle time ${h(p.days)} days, from ${Om(p.start)} to ${Om(p.end)}.`:m?m.days===null?`Time in progress unknown: ${m.reason}.`:`In progress for ${h(m.days)} days, since ${Om(m.since)}.`:`Not started.`})]}),(0,q.jsx)(fT,{item:s},s.id),(0,q.jsxs)(Q,{as:`section`,className:`panel duplicates-panel`,"aria-labelledby":`duplicates`,children:[(0,q.jsx)(`h2`,{id:`duplicates`,children:`Possible duplicates`}),g.length?(0,q.jsx)(`ul`,{className:`rows`,children:g.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:e.id,withTitle:!0}),` `,(0,q.jsxs)(`span`,{className:`score`,children:[Math.round(e.score*100),`% alike`]}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,e.why.summary.replace(/\.$/,``),`)`]})]},e.id))}):(0,q.jsxs)(`p`,{children:[`None in `,n.name,`: no item shares enough words with this one.`]}),(0,q.jsxs)(`p`,{className:`note`,children:[`By shared words in titles and bodies, title trigrams, labels, parent and links, as `,(0,q.jsx)(`code`,{children:`toil util owi similar`}),` scores them: not by meaning, so a duplicate written in other words isn't found.`]})]}),(0,q.jsx)(RO,{item:s}),(0,q.jsxs)(`div`,{className:`item-grid`,children:[(0,q.jsxs)(`section`,{"aria-labelledby":`fields`,children:[(0,q.jsxs)(`div`,{className:`edit-head`,children:[(0,q.jsx)(`h2`,{id:`fields`,children:`Fields`}),(0,q.jsx)(XS,{href:zm(n.name,`fields`),label:`Edit ${n.name}'s field names`})]}),(0,q.jsxs)(`dl`,{className:`fields`,children:[(0,q.jsx)(`dt`,{children:`Source`}),(0,q.jsxs)(`dd`,{children:[d,`, connection `,(0,q.jsx)(`code`,{children:s.source.connection}),` `,(0,q.jsx)(XS,{href:Rm(s.source.connection),label:`Edit the ${s.source.connection} connection`}),`, read with `,(0,q.jsxs)(`code`,{children:[`toil `,s.source.command]})]}),(0,q.jsx)(`dt`,{children:`Type`}),(0,q.jsx)(`dd`,{children:mS(s,i)}),(0,q.jsx)(`dt`,{children:`Status`}),(0,q.jsxs)(`dd`,{children:[s.status??`None`,` (`,Um[s.statusCategory],`)`,s.resolution&&`, resolution ${s.resolution}`]}),(0,q.jsx)(`dt`,{children:`Estimate`}),(0,q.jsxs)(`dd`,{children:[Wm(s),s.estimate&&(0,q.jsxs)(q.Fragment,{children:[`, from `,(0,q.jsx)(`code`,{children:s.estimate.field})]})]}),(0,q.jsx)(`dt`,{children:`Assignee`}),(0,q.jsx)(`dd`,{children:km(s.assignee)}),(0,q.jsx)(`dt`,{children:`Priority`}),(0,q.jsx)(`dd`,{children:s.priority??`None`}),(0,q.jsx)(`dt`,{children:`Sprint`}),(0,q.jsxs)(`dd`,{children:[s.iteration?s.iteration.path??s.iteration.name:`None`,s.iteration&&u.kind!==`planned`&&(0,q.jsxs)(q.Fragment,{children:[` `,`(`,u.kind===`added`?`added mid-sprint`:`carried over from ${u.from}`,`, source `,(0,q.jsx)(`code`,{children:u.evidence}),`)`]})]}),(0,q.jsx)(`dt`,{children:`Parent`}),(0,q.jsx)(`dd`,{children:s.parent?(0,q.jsx)(dS,{id:s.parent,withTitle:!0}):`None`}),(0,q.jsx)(`dt`,{children:`Labels`}),(0,q.jsx)(`dd`,{children:s.labels.length?s.labels.join(`, `):`None`}),(0,q.jsx)(`dt`,{children:`Created`}),(0,q.jsx)(`dd`,{children:s.created?Om(s.created):`Unknown`}),(0,q.jsx)(`dt`,{children:`Updated`}),(0,q.jsx)(`dd`,{children:s.updated?Om(s.updated):`Unknown`}),s.resolved&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:`Resolved`}),(0,q.jsx)(`dd`,{children:Om(s.resolved)})]})]})]}),(0,q.jsxs)(`section`,{"aria-labelledby":`related`,children:[(0,q.jsx)(`h2`,{id:`related`,children:`Related work`}),s.children.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h3`,{children:`Children`}),(0,q.jsx)(`ul`,{className:`rows`,children:s.children.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(dS,{id:e,withTitle:!0})},e))})]}),(0,q.jsx)(`h3`,{children:`Links`}),s.links.length?(0,q.jsx)(`ul`,{className:`rows`,children:s.links.map((e,t)=>(0,q.jsxs)(`li`,{children:[Jk[e.type][e.direction===`outward`?0:1],` `,(0,q.jsx)(dS,{id:e.target,withTitle:!0}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,e.name,`)`]})]},t))}):(0,q.jsx)(`p`,{children:`None.`}),(0,q.jsx)(`h3`,{children:`Pull requests and builds`}),c.length?(0,q.jsx)(`ul`,{className:`rows`,children:c.map(e=>(0,q.jsxs)(`li`,{children:[e.url?(0,q.jsx)(`a`,{href:e.url,children:e.title}):e.title,` `,(0,q.jsx)(`span`,{className:`outcome outcome--${e.outcome}`,children:e.state}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,(0,q.jsxs)(`code`,{children:[`toil `,e.command]}),`)`]})]},e.id))}):(0,q.jsx)(`p`,{children:`None linked.`}),(0,q.jsx)(`h3`,{children:`Deployed to`}),l.length?(0,q.jsx)(`ul`,{className:`rows`,children:l.map(e=>(0,q.jsxs)(`li`,{children:[e.environment,`: `,e.name,`, commit `,(0,q.jsx)(`code`,{children:e.commit}),` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,(0,q.jsxs)(`code`,{children:[`toil `,e.command]}),`)`]})]},e.id))}):(0,q.jsx)(`p`,{children:`Not deployed anywhere the dossier names.`})]}),(0,q.jsxs)(`section`,{"aria-labelledby":`history`,children:[(0,q.jsx)(`h2`,{id:`history`,children:`History`}),s.history?s.history.transitions.length===0?(0,q.jsx)(`p`,{children:`No status changes recorded.`}):(0,q.jsx)(xS,{label:`${wm(s)}'s status changes`,rows:s.history.transitions.map((e,t)=>({...e,i:t})),rowKey:e=>String(e.i),columns:[{header:`When`,label:`When`,cell:e=>Om(e.at)},{header:`From`,label:`From`,cell:e=>e.from??`Created`},{header:`To`,label:`To`,cell:e=>e.to},{header:`By`,label:`By`,cell:e=>e.by?km(e.by):`Unknown`}]}):(0,q.jsx)(`p`,{children:`No history synced for this item.`}),s.unmapped.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h3`,{children:`Not mapped`}),(0,q.jsx)(`ul`,{className:`rows`,children:s.unmapped.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`code`,{children:e.field}),`: `,e.reason]},e.field))})]})]})]})]})}var Xk=e=>e?Om(e):`not yet`;function Zk({id:e}){let{dossier:t,assignments:n,now:r}=J(),{EmptyState:i}=qx(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(0),_=(0,v.useCallback)(()=>g(e=>e+1),[]);(0,v.useEffect)(()=>{if(!n)return;let t=!0;return n.get(e).then(e=>t&&(o(e),c(null)),e=>t&&c(e instanceof Error?e.message:String(e))),()=>{t=!1}},[n,e,h]);let y=a?.state===`working`||a?.state===`queued`&&a.waiting===`slot`;if((0,v.useEffect)(()=>{if(!y)return;let e=setInterval(_,TO);return()=>clearInterval(e)},[y,_]),!n||s&&!a)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h1`,{tabIndex:-1,children:`No such assignment`}),(0,q.jsx)(i,{message:s??`This view has no agent assignments.`,children:(0,q.jsx)(`p`,{children:(0,q.jsxs)(`a`,{href:Am(t.name),children:[`Back to `,t.name]})})})]});if(!a)return(0,q.jsx)(`p`,{className:`note`,children:`Reading the assignment…`});let b=async(e,t)=>{f(!0),u(null);try{await t(),u(e)}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1),_()}},x=a,S=x.state===`queued`&&x.waiting===`start`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsxs)(`p`,{className:`eyebrow`,children:[(0,q.jsx)(`a`,{href:Am(x.dossier),children:x.dossier}),` · Agent assignment`]}),(0,q.jsxs)(`h1`,{tabIndex:-1,children:[nw[x.mode].label,`: `,x.itemTitle]}),(0,q.jsxs)(`p`,{className:`item-meta`,children:[(0,q.jsx)(DO,{a:x}),` `,(0,q.jsx)(dS,{id:x.item}),` · `,x.adapter?tw[x.adapter]:`no adapter chosen yet`,` `,(0,q.jsx)(XS,{href:Bm,label:`Edit the agent settings`}),` · `,x.origin===`tracker`?`queued by the tracker (${x.trigger})`:`assigned in Toil UI`]}),(0,q.jsxs)(`p`,{className:`note`,children:[`Created `,Xk(x.createdAt),`; started `,Xk(x.startedAt),`; `,x.endedAt?`ended ${Xk(x.endedAt)}`:`still going`,`; ran `,aw(x.ranMs??iw(x,r)),`; `,OO(x),`. `,nw[x.mode].changes]})]}),x.stop&&(0,q.jsxs)(`p`,{role:`note`,className:x.stop.reason===`injection`?`assign-warn`:`failure`,children:[x.stop.message,` `,x.stop.fix]}),x.stale&&(0,q.jsxs)(`div`,{className:`stale-block`,children:[(0,q.jsx)(ZC,{stale:x.stale}),(0,q.jsx)(`p`,{className:`note`,children:ow(x)??`Renew starts it again as a fresh assignment on today's instructions, with what this run left as context. This one stays as it is.`})]}),x.renews&&(0,q.jsxs)(`p`,{className:`note`,children:[`This renews `,(0,q.jsx)(`a`,{href:CO(x.dossier,x.renews),children:`an earlier assignment`}),` on the same item, which started on older instructions; what it left was in this run's prompt.`]}),x.renewedBy&&(0,q.jsxs)(`p`,{className:`note`,children:[`Renewed as `,(0,q.jsx)(`a`,{href:CO(x.dossier,x.renewedBy),children:`a fresh assignment`}),` on today's instructions.`]}),(0,q.jsxs)(_S,{className:`assign-actions`,children:[x.stale&&!ow(x)&&(0,q.jsx)(B,{className:`btn btn--accent`,onPress:()=>b(`Renewed.`,async()=>{let e=await n.renew(x.id);return window.location.hash=CO(e.dossier,e.id),e}),isDisabled:d,"data-renew":``,children:`Renew`}),S&&(0,q.jsx)(B,{className:`btn btn--accent`,onPress:()=>m(!0),isDisabled:d,children:`Start…`}),(x.state===`queued`||x.state===`working`)&&(0,q.jsx)(B,{className:`btn`,onPress:()=>b(x.state===`working`?`Stopping it.`:`Taken off the queue.`,()=>n.cancel(x.id)),isDisabled:d,children:x.state===`working`?`Stop`:`Take off the queue`}),x.state===`needs-you`&&(0,q.jsx)(B,{className:`btn`,onPress:()=>b(`Marked reviewed.`,()=>n.finish(x.id)),isDisabled:d,children:`Mark reviewed`}),(0,q.jsx)(`span`,{className:`note`,role:`status`,children:l??``})]}),S&&(0,q.jsx)(jO,{item:{id:x.item,title:x.itemTitle},start:x,isOpen:p,onOpenChange:m,onDone:_}),x.questions.length>0&&(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`assign-questions`,children:[(0,q.jsx)(`h2`,{id:`assign-questions`,children:`Questions for you`}),(0,q.jsx)(`ul`,{className:`rows`,children:x.questions.map((e,t)=>(0,q.jsx)(`li`,{children:e},t))}),(0,q.jsx)(`p`,{className:`note`,children:`Answer them on the item, then assign it again; or mark this reviewed.`})]}),x.report&&(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`assign-report`,children:[(0,q.jsx)(`h2`,{id:`assign-report`,children:x.mode===`investigate`?`Report`:`What the agent said`}),(x.report.warnings.length>0||x.report.unverified.length>0)&&(0,q.jsx)(`div`,{className:`answer-checks`,role:`note`,children:x.report.warnings.map((e,t)=>(0,q.jsx)(`p`,{children:e},t))}),x.report.parts.map((e,t)=>(0,q.jsx)(`p`,{children:(0,q.jsx)(pS,{text:e.text})},t)),x.usage&&(0,q.jsx)(qC,{usage:x.usage})]}),x.branch&&(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`assign-branch`,children:[(0,q.jsxs)(`h2`,{id:`assign-branch`,children:[`Branch `,x.branch.name]}),(0,q.jsxs)(`p`,{children:[`In a clone of `,x.branch.repo,` at `,(0,q.jsx)(wS,{value:x.branch.folder,what:`folder`}),`, `,x.branch.onBranch?`on ${x.branch.name}`:`not on ${x.branch.name}`,`, with `,x.branch.files.length===1?`one changed file`:`${x.branch.files.length} changed files`,`, staged and not committed.`]}),x.branch.files.length>0&&(0,q.jsx)(`ul`,{className:`rows`,children:x.branch.files.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`code`,{children:e.path}),` `,(0,q.jsx)(`span`,{className:`note`,children:e.status}),x.branch?.hidden?.includes(e.path)&&(0,q.jsx)(`span`,{className:`assign-stop`,children:` not in the diff below`})]},`${e.status}:${e.path}`))}),x.branch.diff&&(0,q.jsx)(bS,{label:`The staged diff`,children:(0,q.jsx)(`pre`,{className:`assign-diff`,children:(0,q.jsx)(`code`,{children:x.branch.diff})})})]}),x.proposals.length>0&&(0,q.jsxs)(`section`,{className:`proposals`,"aria-labelledby":`assign-proposals`,children:[(0,q.jsx)(`h2`,{id:`assign-proposals`,children:`Proposals`}),(0,q.jsx)(`p`,{className:`note`,children:`Each change the agent proposes, with what it would set. Apply runs its toil command through the write gate: the connection needs writes on, and this press is the call's allow-write. Nothing has changed until then.`}),x.proposals.map(e=>(0,q.jsx)($k,{p:e,busy:d,onApply:()=>b(`Applied: ${e.title}.`,()=>n.apply(x.id,e.id)),onDismiss:()=>b(`Dismissed: ${e.title}.`,()=>n.dismiss(x.id,e.id))},e.id))]}),x.startedOn&&(0,q.jsxs)(`details`,{className:`assign-record`,children:[(0,q.jsx)(`summary`,{children:`What this run started on`}),(0,q.jsxs)(`dl`,{className:`fields`,children:[(0,q.jsx)(`dt`,{children:`toil`}),(0,q.jsx)(`dd`,{children:x.startedOn.toil}),(0,q.jsx)(`dt`,{children:`Toil UI`}),(0,q.jsx)(`dd`,{children:x.startedOn.toilUi}),(0,q.jsx)(`dt`,{children:`Adapter`}),(0,q.jsxs)(`dd`,{children:[tw[x.startedOn.adapter],`, `,x.startedOn.model??`the CLI's default model`]}),(0,q.jsx)(`dt`,{children:`Skills`}),(0,q.jsx)(`dd`,{children:x.startedOn.skills.length?x.startedOn.skills.join(`, `):`none: Toil UI gives an assigned agent its tools and prompt only`}),(0,q.jsx)(`dt`,{children:`Tools`}),(0,q.jsx)(`dd`,{className:`any-break`,children:x.startedOn.tools.join(`, `)}),(0,q.jsx)(`dt`,{children:`Dossier`}),(0,q.jsxs)(`dd`,{className:`any-break`,children:[x.startedOn.dossier.name,`, `,(0,q.jsx)(`code`,{children:x.startedOn.dossier.fingerprint??`unread`})]}),(0,q.jsx)(`dt`,{children:`Item`}),(0,q.jsxs)(`dd`,{className:`any-break`,children:[x.startedOn.item.id,`, updated `,x.startedOn.item.updated?Om(x.startedOn.item.updated):`at an unknown time`,`, `,(0,q.jsx)(`code`,{children:x.startedOn.item.fingerprint})]}),(0,q.jsx)(`dt`,{children:`Prompt`}),(0,q.jsx)(`dd`,{className:`any-break`,children:(0,q.jsx)(`code`,{children:x.startedOn.prompt})}),(0,q.jsx)(`dt`,{children:`Install fingerprint`}),(0,q.jsx)(`dd`,{className:`any-break`,children:x.startedOn.fingerprint?(0,q.jsxs)(q.Fragment,{children:[`toil `,x.startedOn.fingerprint.toil.version,` at `,x.startedOn.fingerprint.toil.commit?.slice(0,7)??`an unrecorded commit`,`, Toil UI `,x.startedOn.fingerprint.toilUi.version,` at `,x.startedOn.fingerprint.toilUi.commit?.slice(0,7)??`an unrecorded commit`,`; skills`,` `,Object.entries(x.startedOn.fingerprint.skills).map(([e,t])=>`${e} ${t.slice(0,12)}`).join(`, `)||`none`,`; dossier `,(0,q.jsx)(`code`,{children:x.startedOn.fingerprint.dossier?.slice(0,12)??`unread`}),`; prompts `,(0,q.jsx)(`code`,{children:x.startedOn.fingerprint.prompts.slice(0,12)})]}):`not recorded: this run started before Toil UI recorded one, so it is never called stale`})]}),(0,q.jsx)(`p`,{className:`note`,children:`Fingerprints are SHA-256 of what the run read, so a later look can tell whether the item, the dossier or the prompt has changed since.`})]}),(0,q.jsxs)(`details`,{className:`assign-transcript`,children:[(0,q.jsxs)(`summary`,{children:[`Transcript (`,x.transcript.length,` lines)`]}),(0,q.jsx)(`ol`,{className:`assign-lines`,children:x.transcript.map((e,t)=>(0,q.jsxs)(`li`,{className:`assign-line assign-line--${e.kind}`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`note`,children:Om(e.at)}),` `,(0,q.jsx)(`strong`,{children:e.title})]}),e.detail&&(0,q.jsx)(`pre`,{className:`assign-detail`,children:(0,q.jsx)(`code`,{children:e.detail})})]},t))})]})]})}var Qk={pending:`Proposed change, not applied`,applied:`Applied`,failed:`Not applied: toil refused it`,dismissed:`Dismissed`};function $k({p:e,busy:t,onApply:n,onDismiss:r}){let i=e.status===`pending`||e.status===`failed`;return(0,q.jsxs)(aC,{proposal:e,kind:Qk[e.status],actions:i?(0,q.jsxs)(q.Fragment,{children:[e.command&&e.input&&(0,q.jsxs)(B,{className:`btn btn--accent`,onPress:n,isDisabled:t,children:[`Apply`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,e.title]})]}),(0,q.jsxs)(B,{className:`btn btn--quiet`,onPress:r,isDisabled:t,children:[`Dismiss`,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,e.title]})]})]}):null,children:[e.diff.length>0&&(0,q.jsx)(xS,{label:`What ${e.title} changes`,caption:`What it changes`,rows:e.diff,rowKey:e=>e.field,columns:[{header:`Field`,label:`Field`,rowHeader:!0,cell:e=>(0,q.jsx)(`code`,{children:e.field})},{header:`Now`,label:`Now`,cell:e=>e.before===null?(0,q.jsx)(`span`,{className:`note`,children:`not in the synced item`}):e.before===``?(0,q.jsx)(`span`,{className:`note`,children:`empty`}):(0,q.jsx)(`span`,{className:`assign-before`,children:e.before})},{header:`Proposed`,label:`Proposed`,cell:e=>(0,q.jsx)(`span`,{className:`assign-after`,children:e.after})}]}),e.outcome&&(0,q.jsxs)(`p`,{className:e.outcome.ok?`note`:`failure`,role:`status`,children:[Om(e.outcome.at),`: `,e.outcome.message]})]})}function eA(e,t){return async n=>{let r=await e.list(t),i=r.adapters.filter(e=>!e.problem&&!e.implement),a=i.find(e=>e.name===r.preferred)??i[0];if(!a)throw Error(`No adapter here can take implement mode (only Codex can, once its SDK and CLI are set up under Settings, Agent), so nothing was started.`);if(!r.repos.length)throw Error(`${t} lists no repository with a local path, so implement mode has nothing to work in; add one with toil dossiers add-repo ${t} <folder>. Nothing was started.`);if(r.repos.length>1)throw Error(`${t} lists ${r.repos.length} repositories with a local path (${r.repos.map(e=>e.name).join(`, `)}), and one plan can't say which each item needs; assign each item from its page instead. Nothing was started.`);let o=new Set(r.assignments.filter(e=>e.mode===`implement`&&(e.state===`queued`||e.state===`working`)).map(e=>e.item)),s=n.items.filter(e=>!o.has(e)),c=[],l=[];for(let n of s)try{await e.assign({dossier:t,item:n,mode:`implement`,adapter:a.name,repo:r.repos[0].name}),c.push(n)}catch(e){l.push(`${n}: ${e instanceof Error?e.message:String(e)}`)}let u=n.items.length-s.length,d=`Queued ${(e=>e===1?`one implement assignment`:`${e} implement assignments`)(c.length)} on ${a.label}${u?`, leaving ${u} already queued or working`:``}.`;if(l.length)throw Error(`${d} ${l.length===1?`One item`:`${l.length} items`} couldn't be queued: ${l.join(`; `)}`);return`${d} They run ${r.settings.concurrent===1?`one at a time`:`${r.settings.concurrent} at a time`}; follow them in the Agents lane on the dashboard.`}}function tA(e){return Array.from(e).length}var nA=(e,t,n=`${t}s`)=>`${e===1?`a`:e} ${e===1?t:n}`;function rA(e,t){if(e===``)return null;let n=(e.match(/\r\n|\r|\n/g)??[]).length,r=(e.match(/ /g)??[]).length,i=(e.match(/\t/g)??[]).length,a=tA(e.replace(/\r\n/g,`
37
- `));return n===a?nA(n,`${t} newline`):r===a?nA(r,`${t} space`):i===a?nA(i,`${t} tab`):nA(a,`${t} whitespace character`)}var iA=/\s/u,aA=[[`"`,`"`],[`'`,`'`],["`","`"],[`“`,`”`],[`‘`,`’`]],oA=/^(bearer|token)[ \t]+/i;function sA(e){let t=e,n=!1,r=aA.find(([e,n])=>t.length>e.length+n.length&&t.startsWith(e)&&t.endsWith(n));r&&(t=t.slice(r[0].length,t.length-r[1].length),n=!0);let i=oA.exec(t),a=i&&i[0].length<t.length?`${i[1]} `:null;return i&&a&&(t=t.slice(i[0].length)),{inner:t,quoted:n,prefix:a}}function cA(e,t){let n=e.trim();if(n===``)return t.empty===`keep`?{status:`empty`,empty:`keep`,message:`Kept the existing secret.`,fix:null}:t.empty===`skip`?{status:`empty`,empty:`skip`,message:`Nothing was entered, so none is stored.`,fix:null}:{status:`empty`,empty:`required`,message:`Nothing was entered, and this one is required.`,fix:`Paste or type the secret, then press Enter.${t.envVars?.length?` To define this connection with env vars instead, cancel and set ${t.envVars.join(`, `)}.`:``}`};let r=tA(n),i=e.slice(0,e.length-e.trimStart().length),a=e.slice(e.trimEnd().length),o=[rA(i,`leading`),rA(a,`trailing`)].filter(e=>e!==null),s=o.length?o.join(` and `):null,{inner:c,quoted:l,prefix:u}=sA(n),d=/[\r\n]/.test(c),f=!t.password&&[...c].some(e=>iA.test(e));if(d||f){let e=t.password?`password`:`token`;return{status:`refused`,message:d?`This has a line break in the middle, so the paste most likely took two lines. Nothing was stored.`:`This has ${c.includes(` `)?`a tab`:`a space`} in the middle, so the paste most likely took more than the token. Nothing was stored.`,fix:`Copy just the ${e}, on its own, and paste it again.`,length:r}}let p=l&&u?`the quotes and "${u}"`:l?`the quotes`:u?`"${u}"`:null,m=p?{without:c,withoutLength:tA(c),what:p,question:l&&u?`This is in quotes and starts with "${u}". Store it without them? [Y/n]`:l?`This is in quotes. Store it without them? [Y/n]`:`This starts with "${u}". Store it without that? [Y/n]`}:null;return{status:`ok`,value:n,length:r,removed:s,received:lA(r,s),wrapper:m}}function lA(e,t){return`Received ${e} character${e===1?``:`s`}${t?` (removed ${t})`:``}.`}function uA(e,t){return e.ok?{ok:!0,message:t,warnings:(e.meta.warnings??[]).map(e=>e.message)}:{ok:!1,message:e.error.message,fix:e.error.fix??null}}function dA(e){return{ok:!1,message:e instanceof Error?e.message:String(e),fix:null}}function fA({outcome:e}){return e?e.ok?(0,q.jsxs)(`div`,{role:`status`,className:`outcome-line outcome-line--ok`,children:[(0,q.jsx)(`p`,{children:e.message}),e.warnings.length>0&&(0,q.jsx)(`ul`,{className:`plain`,children:e.warnings.map((e,t)=>(0,q.jsx)(`li`,{className:`note`,children:e},t))})]}):(0,q.jsxs)(`div`,{role:`alert`,className:`outcome-line outcome-line--failed failure`,children:[(0,q.jsx)(`p`,{children:e.message}),e.fix&&(0,q.jsxs)(`p`,{className:`note`,children:[`Fix: `,e.fix]})]}):(0,q.jsx)(`div`,{role:`status`,className:`outcome-line`})}function pA(e,t=[]){return[`toil`,e,...t].join(` `)}function mA({title:e,explain:t,runs:n,submit:r,disabled:i,onSubmit:a,children:o,danger:s=!1,titleId:c}){let l=(0,v.useId)(),u=c??l,[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null);return(0,q.jsxs)(`form`,{className:`change`,"aria-labelledby":c??`${u}-title`,onSubmit:async e=>{if(e.preventDefault(),!(i||d)){f(!0),m(null);try{m(await a())}catch(e){m(dA(e))}finally{f(!1)}}},noValidate:!0,children:[(0,q.jsx)(`h3`,{id:c??`${u}-title`,tabIndex:c?-1:void 0,children:e}),(0,q.jsx)(`p`,{className:`explain`,children:t}),o,(0,q.jsxs)(`p`,{className:`runs`,children:[`Runs `,(0,q.jsx)(`code`,{children:n})]}),(0,q.jsxs)(`div`,{className:`change-actions`,children:[(0,q.jsx)(`button`,{type:`submit`,className:`btn ${s?`btn--danger`:`btn--accent`}`,disabled:i!==null||d,"aria-describedby":i?`${u}-off`:void 0,children:d?`Running…`:r}),i&&(0,q.jsxs)(`span`,{id:`${u}-off`,className:`note`,children:[`Turned off: `,i]})]}),(0,q.jsx)(fA,{outcome:p})]})}function hA({label:e,value:t,onChange:n,hint:r,type:i=`text`,required:a=!1,autoComplete:o=`off`,placeholder:s}){let c=(0,v.useId)();return(0,q.jsxs)(`div`,{className:`field-row`,children:[(0,q.jsxs)(`label`,{htmlFor:c,children:[e,a&&(0,q.jsx)(`span`,{className:`req`,children:` (required)`})]}),(0,q.jsx)(`input`,{id:c,type:i,value:t,onChange:e=>n(e.target.value),"aria-describedby":r?`${c}-hint`:void 0,required:a,autoComplete:o,spellCheck:!1,placeholder:s}),r&&(0,q.jsx)(`p`,{id:`${c}-hint`,className:`note`,children:r})]})}function gA({label:e,value:t,onChange:n,hint:r,rows:i=3}){let a=(0,v.useId)();return(0,q.jsxs)(`div`,{className:`field-row`,children:[(0,q.jsx)(`label`,{htmlFor:a,children:e}),(0,q.jsx)(`textarea`,{id:a,rows:i,value:t,onChange:e=>n(e.target.value),"aria-describedby":r?`${a}-hint`:void 0,spellCheck:!1}),r&&(0,q.jsx)(`p`,{id:`${a}-hint`,className:`note`,children:r})]})}function _A({label:e,value:t,onChange:n,options:r,hint:i}){let a=(0,v.useId)();return(0,q.jsxs)(`div`,{className:`field-row`,children:[(0,q.jsx)(`label`,{htmlFor:a,children:e}),(0,q.jsx)(`select`,{id:a,value:t,onChange:e=>n(e.target.value),"aria-describedby":i?`${a}-hint`:void 0,children:r.map(e=>(0,q.jsx)(`option`,{value:e.value,children:e.label},e.value))}),i&&(0,q.jsx)(`p`,{id:`${a}-hint`,className:`note`,children:i})]})}function vA({label:e,checked:t,onChange:n,hint:r}){let i=(0,v.useId)();return(0,q.jsxs)(`div`,{className:`field-row field-row--check`,children:[(0,q.jsx)(`input`,{id:i,type:`checkbox`,checked:t,onChange:e=>n(e.target.checked),"aria-describedby":r?`${i}-hint`:void 0}),(0,q.jsx)(`label`,{htmlFor:i,children:e}),r&&(0,q.jsx)(`p`,{id:`${i}-hint`,className:`note`,children:r})]})}function yA(e){return e.status===`empty`?e.empty===`keep`?`Empty: the current secret is kept`:e.empty===`required`?`Empty: this one is required`:`Empty: none is stored`:e.status===`refused`?`${e.message} ${e.fix}`:`${e.length} character${e.length===1?``:`s`}${e.removed?` (removed ${e.removed})`:``}`}var bA=e=>e.status===`ok`&&e.wrapper?e.wrapper.question.replace(/ \[Y\/n\]$/,``):null;function xA(e,t,n){if(t.status===`refused`||t.status===`empty`&&t.empty===`required`)return{ok:!1,message:`${e}: ${t.message}`,fix:t.fix};let r=bA(t);return r&&!n?{ok:!1,message:`${e}: ${r}`,fix:`Choose Remove it or Keep it under ${e}, then save again.`}:null}function SA({label:e,value:t,onChange:n,rules:r,asking:i,kept:a,onKeep:o,hint:s}){let c=(0,v.useId)(),l=cA(t,r),u=bA(l);return(0,q.jsxs)(`div`,{className:`field-row`,children:[(0,q.jsxs)(`label`,{htmlFor:c,children:[e,r.empty===`required`&&(0,q.jsx)(`span`,{className:`req`,children:` (required)`})]}),(0,q.jsx)(`input`,{id:c,type:`password`,value:t,onChange:e=>n(e.target.value),onPaste:e=>{let t=e.clipboardData.getData(`text`);if(!/[\r\n]/.test(t))return;e.preventDefault();let r=e.currentTarget,i=r.selectionStart??r.value.length,a=r.selectionEnd??i;n(r.value.slice(0,i)+t+r.value.slice(a))},"aria-describedby":`${c}-count${s?` ${c}-hint`:``}`,required:r.empty===`required`,autoComplete:`new-password`,spellCheck:!1}),(0,q.jsx)(`p`,{id:`${c}-count`,className:`note${l.status===`refused`?` failure`:``}`,"aria-live":`polite`,children:yA(l)}),i&&u&&!a&&(0,q.jsxs)(`div`,{className:`secret-ask`,role:`group`,"aria-label":`${e}: ${u}`,children:[(0,q.jsx)(`p`,{children:u}),(0,q.jsxs)(`div`,{className:`change-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn btn--small`,onClick:()=>l.status===`ok`&&l.wrapper&&n(l.wrapper.without),children:`Remove it`}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn--small btn--quiet`,onClick:o,children:`Keep it`})]})]}),s&&(0,q.jsx)(`p`,{id:`${c}-hint`,className:`note`,children:s})]})}var CA=e=>Math.round(e*10)/10,wA=e=>`${CA(e)} ${CA(e)===1?`day`:`days`}`,TA=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,EA=e=>`${Cm(e.area)} ${e.name&&e.name!==e.id?`${e.id} (${e.name})`:e.id}`;function DA(){let{dossier:e,now:t}=J(),{EmptyState:n}=qx(),r=(0,v.useMemo)(()=>ng({dossier:e.name,entries:e.people??[],wipLimit:e.wipLimit??null,items:e.items,changes:e.pullRequests??[],now:t}),[e,t]),i=[...e.calls.dossier,...e.calls.work,...e.calls.prs],a=r.people.filter(e=>e.who.kind===`human`).length,o=r.people.length-a;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsx)(`p`,{className:`eyebrow`,children:(0,q.jsx)(`a`,{href:Am(e.name),children:e.name})}),(0,q.jsx)(`h1`,{tabIndex:-1,children:`People`}),(0,q.jsxs)(`p`,{className:`lede`,children:[r.people.length?`${[a?TA(a,`person`,`people`):``,o?TA(o,`agent`):``].filter(Boolean).join(` and `)} from the dossier's people, and ${TA(r.unmapped.length,`account`)} it doesn't map.`:`This dossier lists nobody yet, so each account its data names has a card of its own (${r.unmapped.length}).`,` `,`Read `,Om(t),`; work in progress counts work items, not the epics and features that hold them. `,(0,q.jsx)(YS,{topic:`people`})]}),!r.people.length&&(0,q.jsxs)(`p`,{className:`note`,children:[`Say who is who across systems in the dossier's people, from Settings, Dossiers, or with `,(0,q.jsxs)(`code`,{children:[`toil dossiers person `,e.name,` "Pat Example" --id jira=pat --id github=pat-ex`]}),`.`,` `,(0,q.jsx)(XS,{href:zm(e.name,`people`),label:`Edit ${e.name}'s people`})]}),(e.peopleNotes??[]).map((e,t)=>(0,q.jsx)(`p`,{role:`note`,className:`failure`,children:e},t))]}),(0,q.jsx)(iT,{id:`team`,title:`Team`,calls:i,alerts:!1,children:(0,q.jsx)(OA,{view:r})}),r.people.length>0&&(0,q.jsxs)(`section`,{className:`people-section`,"aria-labelledby":`people-cards`,children:[(0,q.jsxs)(`div`,{className:`edit-head`,children:[(0,q.jsx)(`h2`,{id:`people-cards`,children:`People and agents`}),(0,q.jsx)(XS,{href:zm(e.name,`people`),label:`Edit ${e.name}'s people`})]}),(0,q.jsx)(vS,{min:`md`,className:`people-cards`,children:r.people.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(kA,{card:e,limit:r.wipLimit})},e.who.key))})]}),(0,q.jsx)(BO,{people:e.people??[]}),(r.suggestions.length>0||r.ambiguous.length>0)&&(0,q.jsxs)(iT,{id:`matches`,title:`Possible matches`,calls:e.calls.dossier,alerts:!1,children:[(0,q.jsx)(`p`,{className:`note`,children:`Accounts that share an email with a person, or with an account in another system. Nothing is mapped until you approve it, and an email that fits more than one person suggests nothing.`}),r.suggestions.length>0&&(0,q.jsx)(`ul`,{className:`rows`,children:r.suggestions.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(jA,{suggestion:e})},`${e.name}:${e.input.id.join(`,`)}`))}),r.ambiguous.map((e,t)=>(0,q.jsx)(`p`,{className:`evidence`,children:e},t))]}),(0,q.jsxs)(`section`,{className:`people-section`,"aria-labelledby":`unmapped-cards`,children:[(0,q.jsx)(`h2`,{id:`unmapped-cards`,children:r.people.length?`Not in the dossier's people`:`Accounts in this dossier's data`}),(0,q.jsxs)(`p`,{className:`note`,children:[`Each account the data names that the dossier doesn't map to a person, with something on its plate.`,r.bots.length>0&&` ${TA(r.bots.length,`bot account`)} (${r.bots.map(e=>e.id).join(`, `)}) only wrote bots' pull requests and ${r.bots.length===1?`is`:`are`} left out.`]}),r.unnamedAgents.length>0&&(0,q.jsxs)(`p`,{className:`note`,children:[TA(r.unnamedAgents.length,`pull request`),` `,r.unnamedAgents.length===1?`was`:`were`,` written with an agent the dossier's people don't name (`,[...new Set(r.unnamedAgents.map(e=>e.authorKindSignal??`an agent account`))].join(`; `),`). Add the agent with `,(0,q.jsxs)(`code`,{children:[`toil dossiers person `,e.name,` "<name>" --kind agent`]}),` to give it a card.`]}),r.unmapped.length?(0,q.jsx)(vS,{min:`md`,className:`people-cards`,children:r.unmapped.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(kA,{card:e,limit:r.wipLimit})},e.who.key))}):(0,q.jsx)(n,{message:r.people.length?`Every account with work on its plate is mapped to someone.`:`This dossier's data names nobody with work on their plate.`})]})]})}function OA({view:e}){let{wip:t,reviewQueue:n,unassigned:r}=e.team,i=n[0];return(0,q.jsxs)(vS,{as:`ul`,min:`sm`,className:`team-strip`,children:[(0,q.jsx)(`li`,{children:(0,q.jsxs)(gS,{gap:`xs`,className:`team-tile`,children:[(0,q.jsx)(`h3`,{children:`Work in progress`}),(0,q.jsx)(`p`,{className:`team-figure`,children:t.total}),(0,q.jsxs)(`p`,{className:`note`,children:[t.limit===null?(0,q.jsxs)(q.Fragment,{children:[`No limit is set in the dossier. Set one with `,(0,q.jsxs)(`code`,{children:[`toil dossiers wip-limit `,e.dossier,` 3`]}),`.`]}):t.over.length?(0,q.jsxs)(q.Fragment,{children:[`Limit `,t.limit,` per person. Over it: `,t.over.map(e=>`${e.name} (${e.count})`).join(`, `),`.`]}):(0,q.jsxs)(q.Fragment,{children:[`Limit `,t.limit,` per person. Nobody is over it.`]}),` `,(0,q.jsx)(XS,{href:zm(e.dossier,`wip`),label:`Edit ${e.dossier}'s work-in-progress limit`})]})]})}),(0,q.jsx)(`li`,{children:(0,q.jsxs)(gS,{gap:`xs`,className:`team-tile`,children:[(0,q.jsx)(`h3`,{children:`Review queue`}),(0,q.jsx)(`p`,{className:`team-figure`,children:n.length}),(0,q.jsx)(`p`,{className:`note`,children:i?(0,q.jsxs)(q.Fragment,{children:[`Open pull requests waiting on a review. Longest: `,(0,q.jsx)(fS,{change:i.change}),`, `,i.wait.days===null?`for an unknown time`:ph(i.wait.days),`.`]}):`No open pull request waits on a review.`})]})}),(0,q.jsx)(`li`,{children:(0,q.jsxs)(gS,{gap:`xs`,className:`team-tile`,children:[(0,q.jsx)(`h3`,{children:`Unassigned this sprint`}),(0,q.jsx)(`p`,{className:`team-figure`,children:r?r.items.length:`–`}),r?r.items.length?(0,q.jsx)(`ul`,{className:`plain cites`,"aria-label":`Unassigned in ${r.sprint}`,children:r.items.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(dS,{id:e.id,withTitle:!0})},e.id))}):(0,q.jsxs)(`p`,{className:`note`,children:[`Everything in `,r.sprint,` that isn't done has someone on it.`]}):(0,q.jsx)(`p`,{className:`note`,children:`No sprint is current in this dossier's data.`})]})})]})}function kA({card:e,limit:t}){let{dossier:n}=J(),{who:r}=e,i=`who-${r.key.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,a=r.identities.find(e=>e.name)??r.identities[0];return(0,q.jsx)(Q,{className:`person-card`,"aria-labelledby":i,children:(0,q.jsxs)(gS,{gap:`sm`,children:[(0,q.jsxs)(`div`,{className:`person-head`,children:[(0,q.jsx)(yO,{person:{id:a?.id??r.name,name:r.name,email:r.email}}),(0,q.jsx)(`h3`,{id:i,children:r.name}),(0,q.jsxs)(`ul`,{className:`person-tags`,"aria-label":`About ${r.name}`,children:[r.kind===`agent`&&(0,q.jsx)(`li`,{className:`person-tag`,children:`Agent`}),!r.mapped&&(0,q.jsx)(`li`,{className:`person-tag`,children:`Not mapped`}),e.overLimit&&(0,q.jsxs)(`li`,{className:`person-tag person-tag--warn`,children:[`Over the limit: `,e.wipCount,` of `,t]})]})]}),(0,q.jsx)(`p`,{className:`note any-break`,children:r.identities.length?r.identities.map(EA).join(` · `):`No identities in the dossier yet.`}),(0,q.jsx)(`p`,{children:(0,q.jsxs)(`a`,{href:Fm(n.name,r.key),children:[r.name,`'s items on the board`]})}),(0,q.jsxs)(`h4`,{children:[`In progress `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,e.wipCount,t===null?``:` of ${t}`,`)`]})]}),e.wip.length?e.wip.map(e=>(0,q.jsxs)(`div`,{className:`person-group`,children:[(0,q.jsx)(`p`,{className:`person-status`,children:e.status}),(0,q.jsx)(`ul`,{className:`plain`,children:e.items.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:e.item.id,withTitle:!0}),(0,q.jsxs)(`span`,{className:`field`,children:[` `,e.days===null?`time in this status not recorded`:`for ${wA(e.days)}`]})]},e.item.id))})]},e.status)):(0,q.jsx)(`p`,{className:`note`,children:`Nothing in progress.`}),(0,q.jsx)(`h4`,{children:`Open pull requests`}),e.prs.length?(0,q.jsx)(`ul`,{className:`plain`,children:e.prs.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(fS,{change:e.change,withTitle:!0}),(0,q.jsxs)(`span`,{className:`field`,children:[` `,mh[e.wait.on],`, `,e.wait.days===null?`for an unknown time`:ph(e.wait.days),e.withAgent&&`; written with ${e.withAgent}`]})]},e.change.id))}):(0,q.jsx)(`p`,{className:`note`,children:`None open.`}),(0,q.jsx)(`h4`,{children:`Reviews waiting on them`}),e.reviews.length?(0,q.jsx)(`ul`,{className:`plain`,children:e.reviews.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(fS,{change:e.change,withTitle:!0}),(0,q.jsxs)(`span`,{className:`field`,children:[` `,e.days===null?`opened at an unknown time`:`open ${ph(e.days)}`]})]},e.change.id))}):(0,q.jsx)(`p`,{className:`note`,children:`None waiting.`}),(0,q.jsx)(`h4`,{children:`Blocked`}),e.blocked.length?(0,q.jsx)(`ul`,{className:`plain`,children:e.blocked.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(dS,{id:e.item.id,withTitle:!0}),(0,q.jsx)(`span`,{className:`field`,children:` blocked by `}),e.by.map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&`, `,(0,q.jsx)(dS,{id:e.id}),e.item?(0,q.jsxs)(`span`,{className:`field`,children:[` (`,e.item.status??`not done`,`)`]}):(0,q.jsx)(`span`,{className:`field`,children:` (not in this dossier, so its status is unknown)`})]},e.id))]},e.item.id))}):(0,q.jsx)(`p`,{className:`note`,children:`Nothing blocked.`}),(0,q.jsxs)(`h4`,{children:[`Recent activity `,(0,q.jsxs)(`span`,{className:`field`,children:[`(last `,14,` days)`]})]}),e.activity.length?(0,q.jsxs)(`ul`,{className:`plain`,children:[e.activity.map((e,t)=>(0,q.jsx)(`li`,{children:(0,q.jsx)(AA,{a:e})},t)),e.moreActivity>0&&(0,q.jsxs)(`li`,{className:`note`,children:[`and `,e.moreActivity,` more`]})]}):(0,q.jsx)(`p`,{className:`note`,children:`Nothing recorded.`})]})})}function AA({a:e}){let t=(0,q.jsxs)(`span`,{className:`field`,children:[` `,e.at.slice(0,10)]});if(e.kind===`moved`)return(0,q.jsxs)(q.Fragment,{children:[`Moved `,(0,q.jsx)(dS,{id:e.item.id}),` `,e.from?`from ${e.from} `:``,`to `,e.to,t]});if(e.kind===`merged`)return(0,q.jsxs)(q.Fragment,{children:[`Their pull request merged: `,(0,q.jsx)(fS,{change:e.change}),t]});let n=e.state===`APPROVED`?`Approved`:e.state===`CHANGES_REQUESTED`?`Asked for changes on`:e.state===`DISMISSED`?`Had a review dismissed on`:`Commented on`;return(0,q.jsxs)(q.Fragment,{children:[n,` `,(0,q.jsx)(fS,{change:e.change}),t]})}function jA({suggestion:e}){let{config:t,refresh:n}=J(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=(0,v.useId)(),c=t?t.disabled:`This view has no access to toil's config commands; run the command below in a terminal.`;return(0,q.jsxs)(gS,{gap:`xs`,children:[(0,q.jsx)(`p`,{children:e.person?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`strong`,{children:e.identities.map(EA).join(`, `)}),` `,e.identities.length===1?`has`:`have`,` `,e.person,`'s email (`,e.email,`): probably `,e.person,`.`]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`strong`,{children:e.identities.map(EA).join(` and `)}),` share the email `,e.email,`: probably one person, `,e.name,`.`]})}),(0,q.jsxs)(`p`,{className:`runs any-break`,children:[`Applies `,(0,q.jsx)(`code`,{children:ig(e)})]}),(0,q.jsxs)(_S,{children:[(0,q.jsx)(`button`,{type:`button`,className:`btn btn--accent`,onClick:async()=>{if(t&&!c){o(!0);try{let n=await t.run(e.command,e.input);i(uA(n,`Mapped in ${e.input.dossier}'s people. Reload the dossier to see the cards change.`))}catch(e){i(dA(e))}finally{o(!1)}}},disabled:c!==null||a||r?.ok===!0,"aria-describedby":c?s:void 0,children:a?`Running…`:e.person?`Map to ${e.person}`:`Add ${e.name}`}),c&&(0,q.jsxs)(`span`,{id:s,className:`note`,children:[`Turned off: `,c]})]}),(0,q.jsx)(fA,{outcome:r}),r?.ok&&n&&(0,q.jsx)(`p`,{children:(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:n,children:`Reload the dossier`})})]})}var MA=e=>Math.round(e*10)/10,NA=[`ALL`,...wh],PA=e=>e===null?`files not counted`:`${e} ${e===1?`file`:`files`}`,FA={HUMAN:`Person`,AGENT:`Agent`,BOT:`Bot`};function IA({change:e}){let t=e.authorKindSource==="default"?`no signal said otherwise`:`${e.authorKindSource}: ${e.authorKindSignal}`;return(0,q.jsxs)(`span`,{className:`kind kind--${e.authorKind.toLowerCase()}`,children:[`· `,FA[e.authorKind],` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,t,`)`]})]})}function LA({ids:e}){return e.length?(0,q.jsx)(`span`,{className:`cites`,children:e.map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&`, `,(0,q.jsx)(dS,{id:e})]},e))}):(0,q.jsx)(`span`,{className:`note`,children:`None`})}var RA=[{header:`Pull request`,label:`Pull request`,rowHeader:!0,cell:e=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(fS,{change:e.change,withTitle:!0}),(0,q.jsxs)(`span`,{className:`field`,children:[` `,e.change.repo]})]})},{header:`Waiting on`,label:`Waiting on`,cell:e=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`strong`,{children:mh[e.wait.on]}),(0,q.jsxs)(`span`,{className:`field`,children:[` `,e.wait.days===null?`for an unknown time`:`for ${ph(e.wait.days)}`,`: `,e.wait.why]})]})},{header:`Author`,label:`Author`,cell:e=>(0,q.jsxs)(q.Fragment,{children:[km(e.change.author),` `,(0,q.jsx)(IA,{change:e.change})]})},{header:`Work items`,label:`Work items`,cell:e=>(0,q.jsx)(LA,{ids:e.items})},{header:`Size`,label:`Size`,cell:e=>e.size.bucket?(0,q.jsxs)(q.Fragment,{children:[e.size.bucket,` `,(0,q.jsxs)(`span`,{className:`field`,children:[`(`,e.size.lines,` lines, `,PA(e.size.files),`)`]})]}):(0,q.jsx)(`span`,{className:`note`,children:e.size.files===null?`Unknown`:`${PA(e.size.files)}, lines not counted`})},{header:`Flags`,label:`Flags`,cell:e=>e.flags.length?(0,q.jsx)(`ul`,{className:`plain flags`,children:e.flags.map(e=>(0,q.jsx)(`li`,{children:yh[e.flag]},e.flag))}):`None`}],zA=(e,t)=>(0,q.jsxs)(q.Fragment,{children:[e.median===null?`No data`:t(e.median),(0,q.jsxs)(`span`,{className:`field`,children:[` `,`(n=`,e.n,e.unknown?`, ${e.unknown} unknown`:``,e.p85!==null&&e.n>1?`; 85% within ${t(e.p85)}`:``,`)`]})]});function BA(e){return[{name:`Pickup`,note:`opened to first review`,sample:e.pickup,unit:ph},{name:`Review`,note:`first review to approval`,sample:e.review,unit:ph},{name:`Merge`,note:`approval to merge`,sample:e.merge,unit:ph},{name:`Review rounds`,note:`per merged pull request`,sample:e.rounds,unit:e=>`${MA(e)} ${MA(e)===1?`round`:`rounds`}`}]}var VA=[{header:`Median`,label:`Median`,rowHeader:!0,cell:e=>(0,q.jsxs)(q.Fragment,{children:[e.name,` `,(0,q.jsx)(`span`,{className:`field`,children:e.note})]})},...NA.map(e=>({header:Th[e],label:Th[e],cell:t=>zA(t.sample[e],t.unit)}))];function HA(){let{dossier:e,byId:t,now:n}=J(),{EmptyState:r}=qx(),i=e.pullRequests??[],a=Sh(i,t,n),o=Ch(i,t,n),s=Dh(i,n),c=Object.fromEntries(Object.entries(e.codeowners??{}).map(([e,t])=>[e,Ah(t.text)])),l=a.filter(e=>!e.change.reviewers.length),u=e.calls.prs;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsx)(`p`,{className:`eyebrow`,children:(0,q.jsx)(`a`,{href:Am(e.name),children:e.name})}),(0,q.jsx)(`h1`,{tabIndex:-1,children:`Pull requests`}),(0,q.jsxs)(`p`,{className:`lede`,children:[a.length,` open across `,new Set(i.map(e=>e.repo)).size,` `,new Set(i.map(e=>e.repo)).size===1?`repository`:`repositories`,`, `,i.length-a.length,` merged or closed. Read `,Om(n),`. `,(0,q.jsx)(YS,{topic:`prs`})]}),(e.prNotes??[]).map((e,t)=>(0,q.jsx)(`p`,{role:`note`,className:`failure`,children:e},t))]}),(0,q.jsxs)(iT,{id:`queue`,title:`Waiting now`,calls:u,children:[(0,q.jsx)(`p`,{className:`note`,children:`Open pull requests, longest wait first, each with what it waits on and since when. Drafts come last. Waits count working days, Monday to Friday UTC.`}),a.length?(0,q.jsx)(xS,{className:`pr-queue`,label:`Open pull requests`,wide:!0,rows:a,rowKey:e=>e.change.id,columns:RA}):(0,q.jsx)(r,{message:`No open pull requests for this dossier.`})]}),(0,q.jsxs)(iT,{id:`flags`,title:`Flags`,calls:u,alerts:!1,children:[(0,q.jsxs)(`p`,{className:`note`,children:[`A first review waiting over `,2,` working days, checks failing for over `,24,` hours, a merge conflict, no linked work item, a work item done while its pull request is open, and a merged pull request whose item isn't done.`]}),o.length?(0,q.jsx)(`ul`,{className:`rows`,children:o.map(({change:e,hit:t})=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`strong`,{children:yh[t.flag]}),`: `,(0,q.jsx)(fS,{change:e,withTitle:!0}),(0,q.jsx)(`p`,{className:`evidence`,children:(0,q.jsx)(pS,{text:t.text})})]},`${e.id}:${t.flag}:${t.text}`))}):(0,q.jsx)(`p`,{children:`Nothing to flag.`})]}),(0,q.jsxs)(iT,{id:`flow`,title:`Flow`,calls:u,alerts:!1,children:[(0,q.jsxs)(`p`,{className:`note`,children:[`The `,s.throughput.ALL.length,` weeks from `,Om(s.from),`, split by who wrote each pull request. n is how many pull requests a figure rests on; unknown counts those whose record can't say (a host that keeps no review times, or reviews not read).`]}),(0,q.jsx)(xS,{className:`pr-metrics`,label:`Pull request flow by author kind`,rows:BA(s),rowKey:e=>e.name,columns:VA}),s.mergedUnreviewed.ALL>0&&(0,q.jsxs)(`p`,{className:`note`,children:[s.mergedUnreviewed.ALL,` merged `,s.mergedUnreviewed.ALL===1?`pull request has`:`pull requests have`,` no approval on record, so review and merge time leave `,s.mergedUnreviewed.ALL===1?`it`:`them`,` out (`,wh.map(e=>`${Th[e]}: ${s.mergedUnreviewed[e]}`).join(`, `),`).`]}),(0,q.jsx)(`h3`,{children:`Merged per week`}),(0,q.jsx)(ck,{weeks:s.throughput.ALL,noun:`pull requests merged`}),(0,q.jsxs)(`p`,{className:`note`,children:[wh.map(e=>`${Th[e]}: ${s.throughput[e].reduce((e,t)=>e+t.items.length,0)}`).join(`, `),`.`,s.unplacedMerges>0&&` ${s.unplacedMerges} merged ${s.unplacedMerges===1?`pull request has`:`pull requests have`} no merge time on record (Bitbucket Cloud keeps none) and ${s.unplacedMerges===1?`isn't`:`aren't`} counted in a week.`]}),(0,q.jsx)(`h3`,{children:`Size of pull requests opened`}),(0,q.jsx)(xS,{className:`pr-sizes`,label:`Pull request sizes by author kind`,rows:[...gh,`unknown`],rowKey:e=>e,columns:[{header:`Size`,label:`Size`,rowHeader:!0,cell:e=>e===`unknown`?(0,q.jsxs)(q.Fragment,{children:[`Unknown `,(0,q.jsx)(`span`,{className:`field`,children:`(lines not counted)`})]}):(0,q.jsxs)(q.Fragment,{children:[e,` `,(0,q.jsx)(`span`,{className:`field`,children:e===`XL`?`${_h.L+1}+ lines`:`up to ${_h[e]} lines`})]})},...NA.map(e=>({header:`${Th[e]} (n=${s.counts[e]})`,label:Th[e],cell:t=>s.sizes[e][t]}))]})]}),(0,q.jsxs)(iT,{id:`reviewers`,title:`Suggested reviewers`,calls:e.calls.owners??[],alerts:!1,children:[(0,q.jsx)(`p`,{className:`note`,children:`For open pull requests with nobody asked: the CODEOWNERS of the paths each changes, then who reviewed changes to the same files and folders. Each is a proposal; asking for a review is a write you apply.`}),(e.calls.owners??[]).length>0&&!Object.keys(e.codeowners??{}).length&&(0,q.jsx)(`p`,{className:`evidence`,children:`No CODEOWNERS file was found where GitHub looks for one (.github/, the repository root, docs/).`}),Object.entries(e.codeowners??{}).map(([e,t])=>(0,q.jsxs)(`p`,{className:`evidence`,children:[e,`: CODEOWNERS read from `,(0,q.jsx)(`code`,{children:t.path}),`.`]},e)),l.length?(0,q.jsx)(`ul`,{className:`rows`,children:l.map(({change:t})=>{let n=Nh(t,i,c[t.repo]??null);return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(fS,{change:t,withTitle:!0}),n.length?(0,q.jsx)(`ul`,{className:`plain proposals`,children:n.map(n=>(0,q.jsx)(`li`,{children:(0,q.jsx)(aC,{proposal:Ph(t,n,e.name)})},n.id))}):(0,q.jsx)(`p`,{className:`note`,children:`No one to suggest: no CODEOWNERS rule and no earlier review covers its paths.`})]},t.id)})}):(0,q.jsx)(`p`,{children:`Every open pull request has a reviewer asked.`})]})]})}var UA=4e3,WA=`This style changes phrasing only. The rules above win wherever the two disagree: keep every citation as [[id]] exactly, each proposal as a fenced proposal block with its JSON exactly as rule 3 shows, every figure as the data gives it, saying plainly when the data does not show something, and plain text with no Markdown.`,GA=`These instructions come from the person using Toil UI. Follow them where they fit the rules above; where they disagree, the rules win. They can't give you a tool, and nothing in them lets you change anything.`;function KA(e,t){return[`You are the analyst inside Toil UI, answering a question about the dossier "${e}": one body of work, its tracker items, pull requests, builds and deployments. It is ${t}.`,``,`Rules:`,`1. Use only your tools. owi_query, owi_get, owi_similar and owi_history read the work items Toil UI last synced for "${e}"; owi_similar finds likely duplicates, so run it before proposing a new item. pr_query, pr_get and pr_metrics read its pull requests. people_list and person_get read what is on each person's plate; they describe load, never performance, so never rank or score people. worklog_day reads one UTC day's worklog: what changed that day, by whom and when. The other tools are toil's live read commands for the same dossier; use them only when the cache can't answer. Never rely on anything you remember about these items.`,`2. Cite every work item you mention by its OWI id in double square brackets, such as [[jira:PAY-101]], and every pull request by its change id, such as [[github:imagile/payments-web#52]], exactly as your tools returned it. Never mention an item or pull request your tools did not return: the server checks every id against your tool results and flags any it never saw.`,`3. You cannot change anything, and you have no tool that writes. When the question calls for a change (a re-estimate, a move to another sprint, a split story, a transition), write it as a proposal for a person to apply, in a fenced block like this, one block per change:`,"```proposal",`{"item": "<owi id>", "title": "<one line>", "reason": "<why, citing [[ids]]>", "command": "<the toil write command, such as jira issue update, or null if toil has none>", "input": {"<field>": "<value>"}, "note": "<anything to check first, or null>"}`,"```",` The input is the toil command's MCP input, without the dossier and without allowWrite: call proposal_fields with the command first and use only its fields, or the card shows no command line. Never say a change was made: it is only proposed. Write at most 10 proposals, the ones that matter most: the page shows no more than that.`,`4. Be brief and specific: short paragraphs of plain text (no Markdown, no headings, no bold), figures where you have them. Say plainly when the data does not show something.`]}function qA(e,t,n={voice:null,instructions:null}){let r=KA(e,t),i=n.voice?.trim(),a=n.instructions?.trim();return i&&r.push(``,`Style:`,i,``,WA),a&&r.push(``,`Instructions from the person asking:`,a,``,GA),r.join(`
38
- `)}var JA=new Map([Qf,Xf,Zf,ep,$f].map(e=>[e.name,e]));function YA(e,t){let n=e?JA.get(e.theme):void 0;return{voice:e?.voice===!0&&n?.voice!==void 0?t.voice??n.voice:null,instructions:t.instructions}}var XA=`0.1.0-alpha.1`,ZA=e=>e.padEnd(40,`0`),QA=e=>Date.parse(e),$A=(e,t,n,r)=>({ok:!0,data:t,error:null,meta:{command:e,durationMs:233,version:XA,context:{connection:{value:n,source:`dossier`},inputs:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{value:t,source:`dossier`}]))}}}),ej=(e,t)=>t?`${e}\n\n${t}`:e,tj=`Co-Authored-By: Claude <you@example.com>`,nj=`https://bitbucket.imagile.dev`,rj=(e,t,n=`NORMAL`)=>({name:e,id:e.length*101,displayName:t,active:!0,slug:e,type:n,...n===`NORMAL`?{emailAddress:`you@example.com`}:{}}),ij={slug:`payments-core`,name:`payments-core`,project:{key:`PAY`,name:`Payments`}},aj=rj(`jsmith`,`J. Smith`),oj=rj(`achen`,`A. Chen`),sj=rj(`svc-renovate`,`Renovate`,`SERVICE`),cj=e=>({id:e.id,version:2,title:e.title,...e.description?{description:e.description}:{},state:e.state,open:e.state===`OPEN`,closed:e.state!==`OPEN`,draft:!1,createdDate:QA(e.created),updatedDate:QA(e.updated??e.closed??e.created),...e.closed?{closedDate:QA(e.closed)}:{},fromRef:{id:`refs/heads/${e.branch}`,displayId:e.branch,latestCommit:ZA(e.head),repository:ij},toRef:{id:`refs/heads/master`,displayId:`master`,latestCommit:ZA(`f00d000`),repository:ij},locked:!1,author:{user:e.author,role:`AUTHOR`,approved:!1,status:`UNAPPROVED`},reviewers:(e.reviewers??[]).map(e=>({user:e.user,role:`REVIEWER`,approved:e.status===`APPROVED`,status:e.status})),participants:[],properties:{...e.state===`OPEN`?{mergeResult:{outcome:e.outcome??`CLEAN`,current:!0}}:{},...e.merge?{mergeCommit:{displayId:e.merge,id:ZA(e.merge)}}:{},commentCount:0},links:{self:[{href:`${nj}/projects/PAY/repos/payments-core/pull-requests/${e.id}`}]}}),lj=e=>({...cj(e),included:{reviews:(e.activities??[]).map((t,n)=>({id:e.id*100+n,createdDate:QA(t.at),user:t.user,action:t.action})),checks:(e.builds??[]).map((t,n)=>({state:t.state,key:`payments-core-PR-${e.id}`,name:`payments-core » PR-${e.id} #${n+1}`,url:`https://jenkins.imagile.dev/job/payments-core/job/PR-${e.id}/${n+1}/`,dateAdded:QA(t.at)})),commits:(e.commits??[e.title]).map((t,n)=>({id:ZA(`${e.head.slice(0,5)}${n}`),displayId:`${e.head.slice(0,5)}${n}`,message:t,author:{name:e.author.displayName,emailAddress:`you@example.com`},authorTimestamp:QA(e.created)})),files:Array.from({length:e.files??1},(t,n)=>({contentId:ZA(`c${e.id}${n}`),path:{toString:`src/main/java/payments/File${n}.java`},type:`MODIFY`}))}}),uj=[{id:311,title:`PAY-101 Tokenise PANs in the edge proxy`,description:`First slice of Card payments v2 (PAY-100).`,state:`OPEN`,author:aj,branch:`feature/PAY-101-tokenise`,head:`e91a4c2`,created:`2026-10-12T15:30:00.000Z`,updated:`2026-10-12T17:00:00.000Z`,reviewers:[{user:oj,status:`NEEDS_WORK`}],activities:[{user:oj,action:`REVIEWED`,at:`2026-10-12T17:00:00.000Z`}],builds:[{state:`FAILED`,at:`2026-10-12T15:35:00.000Z`},{state:`FAILED`,at:`2026-10-12T16:05:00.000Z`}],files:6},{id:305,title:`PAY-104 Round refund totals half-up`,state:`OPEN`,author:oj,branch:`bugfix/PAY-104-rounding`,head:`3c5d7e1`,created:`2026-10-07T10:15:00.000Z`,reviewers:[{user:aj,status:`UNAPPROVED`}],outcome:`CONFLICTED`,builds:[{state:`SUCCESSFUL`,at:`2026-10-07T10:40:00.000Z`}],files:2},{id:298,title:`PAY-105 Show the last four digits on receipts`,state:`MERGED`,author:aj,branch:`feature/PAY-105-last-four`,head:`8a6b2f0`,created:`2026-10-08T09:00:00.000Z`,closed:`2026-10-09T14:50:00.000Z`,merge:`4e1d2a9`,reviewers:[{user:oj,status:`APPROVED`}],activities:[{user:oj,action:`REVIEWED`,at:`2026-10-08T16:00:00.000Z`},{user:oj,action:`APPROVED`,at:`2026-10-09T11:00:00.000Z`}],builds:[{state:`SUCCESSFUL`,at:`2026-10-09T14:20:00.000Z`}],files:4},{id:296,title:`PAY-106 Register the tokeniser with the gateway`,state:`MERGED`,author:aj,branch:`feature/PAY-106-gateway`,head:`2d9e8b4`,created:`2026-10-06T13:00:00.000Z`,closed:`2026-10-07T11:40:00.000Z`,merge:`7b3c9d2`,reviewers:[{user:oj,status:`APPROVED`}],activities:[{user:oj,action:`APPROVED`,at:`2026-10-07T09:30:00.000Z`}],builds:[{state:`SUCCESSFUL`,at:`2026-10-07T11:10:00.000Z`}],files:3},{id:290,title:`Bump the HTTP client to 5.3`,state:`MERGED`,author:sj,branch:`renovate/http-client-5.x`,head:`0f4e6a3`,created:`2026-09-29T09:00:00.000Z`,closed:`2026-09-30T10:00:00.000Z`,merge:`1a2b3c4`,reviewers:[{user:oj,status:`APPROVED`}],activities:[{user:oj,action:`APPROVED`,at:`2026-09-30T09:15:00.000Z`}],builds:[{state:`SUCCESSFUL`,at:`2026-09-30T09:30:00.000Z`}],files:1}],dj=uj.map(cj),fj=Object.fromEntries(uj.map(e=>[e.id,lj(e)])),pj=`https://ado.imagile.dev/DefaultCollection`,mj=(e,t)=>({displayName:t,uniqueName:`IMAGILE\\${e}`,id:`abc12345-0000-0000-0000-0000000000${e.length}0`,descriptor:`win.${e}`}),hj=mj(`dokafor`,`D. Okafor`),gj=mj(`jpark`,`J. Park`),_j={id:`abc12345-0000-0000-0000-000000000500`,name:`settlement`,url:`${pj}/Payments/_apis/git/repositories/settlement`,webUrl:`${pj}/Payments/_git/settlement`,project:{name:`Payments`}},vj=e=>({repository:_j,pullRequestId:e.id,codeReviewId:e.id,status:e.status,createdBy:hj,creationDate:e.created,...e.closed?{closedDate:e.closed}:{},title:e.title,description:e.description,sourceRefName:`refs/heads/${e.branch}`,targetRefName:`refs/heads/main`,mergeStatus:`succeeded`,isDraft:!1,lastMergeSourceCommit:{commitId:ZA(e.head)},...e.merge?{lastMergeCommit:{commitId:ZA(e.merge)}}:{},reviewers:[{...gj,vote:e.vote,isRequired:!0,hasDeclined:!1,isFlagged:!1}],url:`${_j.url}/pullRequests/${e.id}`}),yj=e=>({...vj(e),included:{reviews:e.votes.map((t,n)=>({id:e.id*10+n,publishedDate:t.at,lastUpdatedDate:t.at,isDeleted:!1,status:`closed`,comments:[{id:1,author:gj,content:`J. Park voted ${t.value}`,publishedDate:t.at,commentType:`system`}],properties:{CodeReviewThreadType:{$type:`System.String`,$value:`VoteUpdate`},CodeReviewVoteResult:{$type:`System.String`,$value:String(t.value)}}})),checks:e.statuses.map((e,t)=>({id:t+1,state:e.state,description:`settlement-ci ${e.state}`,context:{name:`settlement-ci`,genre:`continuous-integration`},creationDate:e.at,updatedDate:e.at,iterationId:1})),commits:e.commits.map((t,n)=>({commitId:ZA(`${e.head.slice(0,5)}${n}`),comment:t,author:{name:hj.displayName,email:`you@example.com`,date:e.created}})),files:Array.from({length:e.files},(t,n)=>({changeTrackingId:n+1,changeId:n+1,item:{objectId:ZA(`f${e.id}${n}`),path:`/src/Settlement/File${n}.cs`},changeType:`edit`}))}}),bj=[{id:87,title:`Write the daily settlement CSV`,description:`For #2302. One file per merchant, written at 02:00 UTC.`,status:`active`,branch:`feature/2302-settlement-csv`,head:`87ab3e2`,created:`2026-10-12T09:20:00Z`,vote:-5,votes:[{value:-5,at:`2026-10-12T14:00:00Z`}],statuses:[{state:`pending`,at:`2026-10-13T07:55:00Z`}],commits:[`Write the settlement CSV`],files:5},{id:84,title:`Schedule the settlement export job`,description:`Task #2305.`,status:`completed`,branch:`feature/2305-schedule`,head:`84cd1f9`,created:`2026-10-07T16:00:00Z`,closed:`2026-10-08T12:30:00Z`,merge:`c84e5f0`,vote:10,votes:[{value:10,at:`2026-10-08T10:00:00Z`}],statuses:[{state:`succeeded`,at:`2026-10-08T12:10:00Z`}],commits:[`Schedule the export at 02:00 UTC`],files:2},{id:80,title:`Settlement job skeleton`,description:`The empty job and its pipeline.`,status:`completed`,branch:`feature/skeleton`,head:`80ef2a1`,created:`2026-09-29T10:00:00Z`,closed:`2026-10-01T11:00:00Z`,merge:`b80a1d2`,vote:10,votes:[{value:10,at:`2026-09-30T15:00:00Z`}],statuses:[{state:`succeeded`,at:`2026-10-01T10:30:00Z`}],commits:[ej(`Add the settlement job skeleton`,tj),`Add its pipeline`],files:9}],xj=bj.map(vj),Sj=Object.fromEntries(bj.map(e=>[e.id,yj(e)])),Cj=`https://ghe.imagile.dev`,wj=`${Cj}/api/v3`,Tj=(e,t,n=`User`)=>({login:e,id:t,avatar_url:`${Cj}/avatars/u/${t}`,type:n}),Ej=Tj(`ada-dev`,11),Dj=Tj(`bo-web`,12),Oj=Tj(`dependabot[bot]`,49699333,`Bot`),kj={full_name:`imagile/payments-web`,name:`payments-web`,owner:{login:`imagile`}},Aj=e=>({url:`${wj}/repos/imagile/payments-web/pulls/${e.number}`,id:7e3+e.number,number:e.number,state:e.merged?`closed`:`open`,locked:!1,title:e.title,user:e.user,body:e.body,draft:e.draft??!1,html_url:`${Cj}/imagile/payments-web/pull/${e.number}`,created_at:e.created,updated_at:e.updated??e.merged??e.created,closed_at:e.merged??null,merged_at:e.merged??null,merge_commit_sha:ZA(e.merge),requested_reviewers:e.requested??[],requested_teams:[],labels:[],head:{label:`imagile:${e.branch}`,ref:e.branch,sha:ZA(e.head),repo:kj},base:{label:`imagile:main`,ref:`main`,sha:ZA(`0a0a0a0`),repo:kj}}),jj=e=>({...Aj(e),merged:!!e.merged,mergeable:e.merged?null:e.mergeable===void 0||e.mergeable,mergeable_state:e.merged?`unknown`:`clean`,comments:0,review_comments:0,commits:e.commits.length,additions:e.files.reduce((e,t)=>e+t.additions,0),deletions:e.files.reduce((e,t)=>e+t.deletions,0),changed_files:e.files.length,included:{reviews:(e.reviews??[]).map((t,n)=>({id:9e4+e.number*10+n,user:t.user,body:``,state:t.state,submitted_at:t.at,commit_id:ZA(e.head),author_association:`MEMBER`})),checks:e.checks.map((t,n)=>({id:8e3+e.number*10+n,name:t.name,head_sha:ZA(e.head),status:t.conclusion===null?`in_progress`:`completed`,conclusion:t.conclusion,html_url:`${Cj}/imagile/payments-web/actions/runs/${8e3+e.number*10+n}/job/${8001+e.number*10+n}`,started_at:t.at,completed_at:t.conclusion===null?null:t.at,app:{slug:`github-actions`,name:`GitHub Actions`}})),commits:e.commits.map((t,n)=>({sha:ZA(`${e.head.slice(0,5)}${n}`),commit:{message:t,author:{name:e.user.login,email:`you@example.com`,date:e.created}},author:e.user})),files:e.files.map(e=>({filename:e.path,status:`modified`,additions:e.additions,deletions:e.deletions,changes:e.additions+e.deletions}))}}),Mj=[{number:53,title:`Keep focus in the card form on Safari`,body:`Fixes #43.`,user:Dj,branch:`fix/43-safari-focus`,draft:!0,head:`53d0e12`,created:`2026-10-12T13:00:00Z`,updated:`2026-10-12T13:25:00Z`,merge:`53f9a00`,checks:[{name:`test`,conclusion:`success`,at:`2026-10-12T13:15:00Z`},{name:`e2e-safari`,conclusion:`failure`,at:`2026-10-12T13:25:00Z`}],commits:[`Keep focus in the expiry field`],files:[{path:`src/checkout/card-form.tsx`,additions:18,deletions:6}]},{number:52,title:`Saved-card picker`,body:`Closes #42. Part of #41.`,user:Dj,branch:`feature/saved-cards`,head:`52c4b88`,created:`2026-10-11T10:00:00Z`,updated:`2026-10-11T10:28:00Z`,merge:`52e7d00`,requested:[Ej],checks:[{name:`test`,conclusion:`success`,at:`2026-10-11T10:20:00Z`},{name:`e2e-safari`,conclusion:`success`,at:`2026-10-11T10:28:00Z`}],commits:[`Add the saved-card picker`,`Show the expiry beside each card`],files:[{path:`src/checkout/saved-cards.tsx`,additions:210,deletions:4},{path:`src/checkout/saved-cards.test.tsx`,additions:96,deletions:0},{path:`src/checkout/card-form.tsx`,additions:12,deletions:3}]},{number:51,title:`Retry the address lookup once`,body:`The lookup service times out under load; retry once after 300 ms.`,user:Ej,branch:`claude/address-retry`,head:`51a7f30`,created:`2026-10-08T09:00:00Z`,updated:`2026-10-09T08:10:00Z`,merge:`51b0c00`,checks:[{name:`test`,conclusion:`failure`,at:`2026-10-09T08:10:00Z`}],commits:[ej(`Retry the address lookup once`,tj)],files:[{path:`src/address/lookup.ts`,additions:31,deletions:5},{path:`src/address/lookup.test.ts`,additions:40,deletions:0}]},{number:50,title:`Use the order currency on receipts`,body:`Closes #44.`,user:Ej,branch:`fix/44-receipt-currency`,head:`50b1c77`,created:`2026-10-12T14:30:00Z`,merged:`2026-10-12T15:55:00Z`,merge:`5a7e3f1`,reviews:[{user:Dj,state:`APPROVED`,at:`2026-10-12T15:20:00Z`}],checks:[{name:`test`,conclusion:`success`,at:`2026-10-12T15:40:00Z`}],commits:[`Format receipts in the order currency`],files:[{path:`src/receipt/total.tsx`,additions:9,deletions:4}]},{number:49,title:`Bump vite from 7.1.2 to 7.1.5`,body:`Bumps vite from 7.1.2 to 7.1.5.`,user:Oj,branch:`dependabot/npm_and_yarn/vite-7.1.5`,head:`49c2d11`,created:`2026-10-03T06:00:00Z`,merged:`2026-10-05T09:30:00Z`,merge:`49e0a00`,reviews:[{user:Ej,state:`APPROVED`,at:`2026-10-05T09:10:00Z`}],checks:[{name:`test`,conclusion:`success`,at:`2026-10-03T06:20:00Z`}],commits:[`Bump vite from 7.1.2 to 7.1.5`],files:[{path:`package.json`,additions:1,deletions:1},{path:`package-lock.json`,additions:12,deletions:12}]},{number:48,title:`Order summary panel`,body:`From the checkout refresh designs.`,user:Ej,branch:`feature/order-summary`,head:`48a9e66`,created:`2026-10-01T09:00:00Z`,merged:`2026-10-02T10:00:00Z`,merge:`1c9b8e4`,reviews:[{user:Dj,state:`CHANGES_REQUESTED`,at:`2026-10-01T14:00:00Z`},{user:Dj,state:`APPROVED`,at:`2026-10-02T09:00:00Z`}],checks:[{name:`test`,conclusion:`success`,at:`2026-10-01T09:20:00Z`}],commits:[`Add the order summary panel`,`Round the subtotal as the designs show`],files:[{path:`src/checkout/summary.tsx`,additions:140,deletions:2},{path:`src/checkout/card-form.tsx`,additions:6,deletions:1}]}],Nj=Mj.map(Aj),Pj=Object.fromEntries(Mj.map(e=>[e.number,jj(e)]));btoa(`# Who reviews what
39
- * @ada-dev
40
- src/checkout/ @bo-web
41
- src/address/ @bo-web @ada-dev
42
- `),ZA(`c0de0e5`),`${Cj}`;var Fj=`https://bitbucket-cloud.imagile.dev`,Ij=(e,t,n)=>({display_name:t,nickname:e,type:`user`,uuid:`{abc12345-0000-0000-0000-0000000000${n}0}`,account_id:`557058:abc12345-0000-0000-0000-0000000000${n}0`}),Lj=Ij(`bo-web`,`Bo W.`,1),Rj=Ij(`ada-dev`,`Ada D.`,2),zj={full_name:`imagile/checkout-sdk`,name:`checkout-sdk`,type:`repository`,uuid:`{abc12345-0000-0000-0000-000000000700}`},Bj=e=>({type:`pullrequest`,id:e.id,title:e.title,description:e.description,summary:{type:`rendered`,raw:e.description,markup:`markdown`},state:e.state,draft:!1,author:e.author,source:{branch:{name:e.branch},commit:{hash:e.head.padEnd(12,`0`)},repository:zj},destination:{branch:{name:`main`},commit:{hash:`a0a0a0a0a0a0`},repository:zj},...e.merge?{merge_commit:{hash:e.merge.padEnd(12,`0`)}}:{merge_commit:null},comment_count:0,task_count:0,close_source_branch:!0,created_on:e.created,updated_on:e.updated,reviewers:e.reviewers.map(e=>e.user),participants:e.reviewers.map(t=>({type:`participant`,user:t.user,role:`REVIEWER`,approved:t.state===`approved`,state:t.state,participated_on:t.state?e.updated:null})),links:{html:{href:`${Fj}/imagile/checkout-sdk/pull-requests/${e.id}`},self:{href:`${Fj}/2.0/repositories/imagile/checkout-sdk/pullrequests/${e.id}`}}}),Vj=e=>({...Bj(e),included:{reviews:e.approvals.map(t=>({approval:{date:t.at,user:t.user,pullrequest:{id:e.id,type:`pullrequest`}},pull_request:{id:e.id,type:`pullrequest`}})),checks:e.statuses.map((t,n)=>({type:`commitstatus`,key:`checkout-sdk-ci-${n}`,name:`checkout-sdk CI`,state:t.state,url:`${Fj}/imagile/checkout-sdk/pipelines/results/${e.id*10+n}`,created_on:t.at,updated_on:t.at})),commits:e.commits.map((t,n)=>({type:`commit`,hash:`${e.head}${n}`.padEnd(40,`0`),message:t,author:{type:`author`,raw:`${e.author.display_name} <you@example.com>`},date:e.created})),files:e.files.map(e=>({type:`diffstat`,status:`modified`,lines_added:e.added,lines_removed:e.removed,old:{path:e.path,type:`commit_file`},new:{path:e.path,type:`commit_file`}}))}}),Hj=[{id:12,title:`Format receipt totals in the order currency`,description:`The SDK side of imagile/payments-web#44.`,state:`OPEN`,author:Lj,branch:`copilot/receipt-currency`,head:`12ab3c4`,created:`2026-10-10T11:00:00.000000+00:00`,updated:`2026-10-10T11:25:00.000000+00:00`,reviewers:[{user:Rj,state:null}],approvals:[],statuses:[{state:`SUCCESSFUL`,at:`2026-10-10T11:25:00.000000+00:00`}],commits:[`Format totals with Intl.NumberFormat`],files:[{path:`src/money.ts`,added:22,removed:7}]},{id:9,title:`Saved-card hooks`,description:`useSavedCards and useDefaultCard, for imagile/payments-web#42.`,state:`MERGED`,author:Rj,branch:`feature/saved-card-hooks`,head:`09cd5e6`,merge:`9f1e2d3`,created:`2026-10-06T08:30:00.000000+00:00`,updated:`2026-10-07T12:00:00.000000+00:00`,reviewers:[{user:Lj,state:`approved`}],approvals:[{user:Lj,at:`2026-10-07T10:00:00.000000+00:00`}],statuses:[{state:`SUCCESSFUL`,at:`2026-10-06T08:50:00.000000+00:00`}],commits:[`Add useSavedCards`,`Add useDefaultCard`],files:[{path:`src/hooks/saved-cards.ts`,added:120,removed:0},{path:`src/hooks/saved-cards.test.ts`,added:64,removed:0}]}],Uj=Hj.map(Bj),Wj=Object.fromEntries(Hj.map(e=>[e.id,Vj(e)])),Gj={project:`PAY`,repo:`payments-core`},Kj={collection:`DefaultCollection`,project:`Payments`,repo:`settlement`},qj={owner:`imagile`,repo:`payments-web`},Jj={workspace:`imagile`,repo:`checkout-sdk`};`${[$A(`bitbucket pr list`,dj,`corp-bitbucket`,Gj),...Object.values(fj).map(e=>$A(`bitbucket pr get`,e,`corp-bitbucket`,Gj)),$A(`ado pr list`,xj,`corp-ado`,Kj),...Object.values(Sj).map(e=>$A(`ado pr get`,e,`corp-ado`,Kj)),$A(`github pr list`,Nj,`github`,qj),...Object.values(Pj).map(e=>$A(`github pr get`,e,`github`,qj)),$A(`bitbucket-cloud pr list`,Uj,`bitbucket-cloud`,Jj),...Object.values(Wj).map(e=>$A(`bitbucket-cloud pr get`,e,`bitbucket-cloud`,Jj))].map(e=>JSON.stringify(e)).join(`
43
- `)}`;var Yj=e=>Date.parse(e),Xj=e=>e.padEnd(40,`0`),Zj=`https://jenkins.imagile.dev`,Qj=(e,t,n,r,i)=>({number:t,url:`${Zj}/job/payments-core/job/PR-${e}/${t}/`,result:n,duration:n===null?0:i,timestamp:Yj(r),building:n===null,displayName:`#${t}`,fullDisplayName:`payments-core » PR-${e} #${t}`,description:null,id:String(t),queueId:9e3+e*10+t}),$j={311:[Qj(311,2,`FAILURE`,`2026-10-12T16:05:00.000Z`,412e3),Qj(311,1,`FAILURE`,`2026-10-12T15:35:00.000Z`,398e3)],305:[Qj(305,1,`SUCCESS`,`2026-10-07T10:40:00.000Z`,455e3)],298:[Qj(298,3,`SUCCESS`,`2026-10-09T14:20:00.000Z`,441e3)],296:[Qj(296,1,`SUCCESS`,`2026-10-07T11:10:00.000Z`,43e4)],290:[Qj(290,1,`SUCCESS`,`2026-09-30T09:30:00.000Z`,42e4)]},eM=(e,t,n,r,i,a)=>({name:e,ready:`${r}/${i}`,desiredReplicas:i,readyReplicas:r,updatedReplicas:r,availableReplicas:r,unavailableReplicas:i-r,age:a,images:[{name:e,image:t}],strategy:`RollingUpdate`,labels:{"app.kubernetes.io/name":e,"app.kubernetes.io/version":n}}),tM=(e,t)=>({namespace:e,kind:`Deployment`,count:t.length,deployments:t}),nM={"payments-dev":tM(`payments-dev`,[eM(`payments-core`,`artifactory.imagile.dev/payments/payments-core:1.14.0-4e1d2a9`,`1.14.0`,2,2,`3d`)]),"payments-prod":tM(`payments-prod`,[eM(`payments-core`,`artifactory.imagile.dev/payments/payments-core:1.13.2-1a2b3c4`,`1.13.2`,3,3,`13d`)]),"checkout-staging":tM(`checkout-staging`,[eM(`payments-web`,`artifactory.imagile.dev/checkout/payments-web:2026.10.12-5a7e3f1`,`2026.10.12`,2,2,`18h`)]),"checkout-prod":tM(`checkout-prod`,[eM(`payments-web`,`artifactory.imagile.dev/checkout/payments-web:2026.10.02-1c9b8e4`,`2026.10.02`,4,4,`11d`)])},rM=`https://ado.imagile.dev/DefaultCollection`,iM={displayName:`D. Okafor`,uniqueName:`IMAGILE\\dokafor`,id:`abc12345-0000-0000-0000-000000000070`,descriptor:`win.dokafor`},aM=e=>({id:e.id,buildNumber:e.number,status:e.status,...e.result?{result:e.result}:{},queueTime:e.at,startTime:e.at,...e.status===`completed`?{finishTime:e.at}:{},sourceBranch:e.branch,sourceVersion:Xj(e.commit),definition:{...e.definition,path:`\\`},project:{name:`Payments`},reason:e.pr?`pullRequest`:`individualCI`,...e.pr?{triggerInfo:{"pr.number":String(e.pr),"pr.sourceBranch":`refs/heads/feature/${e.pr}`}}:{},...e.environment?{templateParameters:{environment:e.environment}}:{},requestedFor:iM,_links:{web:{href:`${rM}/Payments/_build/results?buildId=${e.id}`}},url:`${rM}/Payments/_apis/build/Builds/${e.id}`}),oM={id:12,name:`settlement-ci`},sM={id:13,name:`settlement-deploy`};aM({id:5530,definition:oM,number:`20261013.1`,status:`inProgress`,branch:`refs/pull/87/merge`,commit:`87ab3e2`,at:`2026-10-13T07:55:00Z`,pr:87}),aM({id:5512,definition:oM,number:`20261008.3`,status:`completed`,result:`succeeded`,branch:`refs/pull/84/merge`,commit:`84cd1f9`,at:`2026-10-08T12:10:00Z`,pr:84}),aM({id:5461,definition:oM,number:`20261001.2`,status:`completed`,result:`succeeded`,branch:`refs/pull/80/merge`,commit:`80ef2a1`,at:`2026-10-01T10:30:00Z`,pr:80}),aM({id:5521,definition:sM,number:`20261008.1`,status:`completed`,result:`succeeded`,branch:`refs/heads/main`,commit:`c84e5f0`,at:`2026-10-08T14:00:00Z`,environment:`test`}),aM({id:5470,definition:sM,number:`20261002.1`,status:`completed`,result:`succeeded`,branch:`refs/heads/main`,commit:`b80a1d2`,at:`2026-10-02T16:00:00Z`,environment:`prod`}),aM({id:5466,definition:sM,number:`20261001.1`,status:`completed`,result:`succeeded`,branch:`refs/heads/main`,commit:`b80a1d2`,at:`2026-10-01T13:00:00Z`,environment:`test`});var cM=[{name:`card-payments`,description:`Card payments v2: tokenised cards at the edge. Jira, Bitbucket, Jenkins and OpenShift.`,env:`dev`,repos:[{name:`payments-core`,remotes:[`ssh://git@bitbucket.imagile.dev:7999/pay/payments-core.git`]}],jira:{connection:`corp-jira`,project:`PAY`,fields:{acceptanceCriteria:`customfield_10500`},readiness:{minWords:20}},bitbucket:{connection:`corp-bitbucket`,project:`PAY`,repo:`payments-core`},jenkins:{connection:`corp-jenkins`,jobs:[`payments-core`]},environments:{dev:{openshift:{connection:`ocp-nonprod`,namespace:`payments-dev`}},prod:{openshift:{connection:`ocp-prod`,namespace:`payments-prod`}}},people:[{name:`J. Smith`,ids:{jira:`jsmith`,bitbucket:`jsmith`}},{name:`A. Chen`,email:`you@example.com`,ids:{jira:`achen`}},{name:`R. Patel`,ids:{jira:`rpatel`}}],wipLimit:2},{name:`settlement`,description:`Daily settlement reports for finance. Azure DevOps Server: Boards, Repos and Pipelines.`,repos:[{name:`settlement`,remotes:[`https://ado.imagile.dev/DefaultCollection/Payments/_git/settlement`]}],ado:{connection:`corp-ado`,collection:`DefaultCollection`,project:`Payments`,repo:`settlement`,builds:[`settlement-ci`],deployments:[`settlement-deploy`]}},{name:`checkout-web`,description:`The checkout web front end and its SDK. GitHub Enterprise with Projects and Actions, Bitbucket Cloud for the SDK, deployed on OpenShift.`,env:`staging`,repos:[{name:`payments-web`,remotes:[`https://ghe.imagile.dev/imagile/payments-web.git`]},{name:`checkout-sdk`,remotes:[`https://bitbucket-cloud.imagile.dev/imagile/checkout-sdk.git`]}],github:{connection:`github`,owner:`imagile`,repo:`payments-web`,projects:[`7`],readiness:{minWords:10,templates:[[`## What`,`## Why`,`## Acceptance criteria`].join(`
44
- `)]}},"bitbucket-cloud":{connection:`bitbucket-cloud`,workspace:`imagile`,repo:`checkout-sdk`},environments:{staging:{openshift:{connection:`ocp-nonprod`,namespace:`checkout-staging`}},prod:{openshift:{connection:`ocp-prod`,namespace:`checkout-prod`}}},people:[{name:`Ada D.`,ids:{github:`ada-dev`,"bitbucket-cloud":`557058:abc12345-0000-0000-0000-000000000020`}},{name:`Bo W.`,ids:{github:`bo-web`}},{name:`Claude`,kind:`agent`,ids:{}}],wipLimit:2}],lM=`/home/you/.toil/dossiers`,uM=e=>`${lM}/${e}.json`,dM={jira:[`project`],bitbucket:[`project`,`repo`],"bitbucket-cloud":[`workspace`,`repo`],jenkins:[`instance`],ado:[`collection`,`organization`,`project`,`repo`],github:[`owner`,`repo`],openshift:[`instance`]},fM=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function pM(e){let{name:t,description:n,env:r,repos:i,environments:a,people:o,wipLimit:s,...c}=e,l=new Set([...Object.keys(c),...Object.values(a??{}).flatMap(e=>Object.keys(e))]),u={};for(let e of[...l].sort()){let t=(r===void 0?void 0:a?.[r]?.[e])??(fM(c[e])?c[e]:{}),n=Object.fromEntries((dM[e]??[]).flatMap(e=>typeof t[e]==`string`?[[e,t[e]]]:[]));u[e]={connection:typeof t.connection==`string`?{value:t.connection,source:`dossier`}:null,writes:!1,env:e===`openshift`?r??null:null,inputs:n}}return{name:t,source:`user`,file:uM(t),by:`input`,match:null,repo:null,adopted:!0,areas:u,dossier:{name:t,description:n,...r?{env:r}:{},repos:i,...c,...a?{environments:a}:{},...o?{people:o}:{},...s?{wipLimit:s}:{}},problems:[]}}function mM(){return{folder:null,places:{user:lM,listed:[],repo:null},dossiers:cM.map(e=>({name:e.name,description:e.description,source:`user`,file:uM(e.name),shadowedBy:null,problems:0})),broken:[]}}var hM=`0.1.0-alpha.1`,gM=`https://jira.imagile.dev`,_M=`https://ado.imagile.dev/DefaultCollection`,vM=`https://ghe.imagile.dev`,yM=`${vM}/api/v3`,bM=(e,t,n,r={})=>({ok:!0,data:t,error:null,meta:{command:e,durationMs:412,version:hM,context:{connection:{value:n,source:`default`,default:`named`},...Object.keys(r).length?{inputs:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{value:t,source:`dossier`}]))}:{}}}}),xM=(e,t)=>({self:`${gM}/rest/api/2/user?username=${e}`,name:e,key:e,displayName:t,active:!0}),SM=xM(`jsmith`,`J. Smith`),CM=xM(`achen`,`A. Chen`),wM=xM(`rpatel`,`R. Patel`),TM={todo:{name:`To Do`,id:`10000`,statusCategory:{id:2,key:`new`,name:`To Do`}},progress:{name:`In Progress`,id:`3`,statusCategory:{id:4,key:`indeterminate`,name:`In Progress`}},review:{name:`In Review`,id:`10100`,statusCategory:{id:4,key:`indeterminate`,name:`In Progress`}},done:{name:`Done`,id:`10001`,statusCategory:{id:3,key:`done`,name:`Done`}}},EM={epic:{name:`Epic`,id:`10000`,subtask:!1},story:{name:`Story`,id:`10001`,subtask:!1},bug:{name:`Bug`,id:`1`,subtask:!1},subtask:{name:`Sub-task`,id:`10003`,subtask:!0}},DM=(e,t,n,r)=>`com.atlassian.greenhopper.service.sprint.Sprint@6f3a${e}[id=${e},rapidViewId=7,state=${t},name=Sprint ${e},startDate=${n},endDate=${r},completeDate=${t===`CLOSED`?r:`<null>`},sequence=${e},goal=]`,OM=DM(40,`CLOSED`,`2026-09-07T09:00:00.000Z`,`2026-09-18T17:00:00.000Z`),kM=DM(41,`CLOSED`,`2026-09-21T09:00:00.000Z`,`2026-10-02T17:00:00.000Z`),AM=DM(42,`ACTIVE`,`2026-10-05T09:00:00.000Z`,`2026-10-16T17:00:00.000Z`),jM=(e,t,n,r)=>({id:String(r),type:e===`Blocks`?{id:`10000`,name:`Blocks`,inward:`is blocked by`,outward:`blocks`}:{id:`10003`,name:`Relates`,inward:`relates to`,outward:`relates to`},[t===`outward`?`outwardIssue`:`inwardIssue`]:{key:n,fields:{}}}),MM=(e,t)=>({expand:`renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations`,id:String(20100+t),self:`${gM}/rest/api/2/issue/${20100+t}`,key:e.key,fields:{summary:e.summary,description:e.description??null,issuetype:{self:`${gM}/rest/api/2/issuetype/${EM[e.type].id}`,...EM[e.type]},status:{self:`${gM}/rest/api/2/status/${TM[e.status].id}`,...TM[e.status]},resolution:e.resolved?{self:`${gM}/rest/api/2/resolution/10000`,id:`10000`,name:`Done`}:null,resolutiondate:e.resolved??null,priority:{self:`${gM}/rest/api/2/priority/3`,name:e.priority??`Medium`,id:`3`},assignee:e.assignee??null,reporter:wM,labels:e.labels??[`payments`],project:{self:`${gM}/rest/api/2/project/10200`,id:`10200`,key:`PAY`,name:`Payments`},created:e.created,updated:e.updated,duedate:null,timeoriginalestimate:null,issuelinks:e.links??[],subtasks:(e.subtasks??[]).map(e=>({key:e,fields:{}})),...e.parent?{parent:{key:e.parent,fields:{}}}:{},"Story Points":e.points??null,Sprint:e.sprints??null,"Epic Link":e.epic??null}}),NM=[{key:`PAY-92`,type:`story`,summary:`Mask card numbers in the gateway logs`,status:`done`,assignee:SM,points:3,sprints:[OM],created:`2026-09-01T09:00:00.000+0000`,updated:`2026-09-17T14:00:00.000+0000`,resolved:`2026-09-17T14:00:00.000+0000`},{key:`PAY-95`,type:`story`,summary:`Look up the card scheme from the BIN`,status:`done`,assignee:CM,points:3,sprints:[kM],created:`2026-09-08T11:00:00.000+0000`,updated:`2026-09-25T11:00:00.000+0000`,resolved:`2026-09-25T11:00:00.000+0000`},{key:`PAY-97`,type:`bug`,summary:`A double click charges twice`,status:`done`,assignee:SM,points:2,sprints:[kM],created:`2026-09-16T08:20:00.000+0000`,updated:`2026-09-30T16:00:00.000+0000`,resolved:`2026-09-30T16:00:00.000+0000`,priority:`High`},{key:`PAY-98`,type:`story`,summary:`Decline codes in the merchant report`,status:`done`,assignee:wM,points:5,sprints:[kM],created:`2026-09-10T10:00:00.000+0000`,updated:`2026-10-02T15:00:00.000+0000`,resolved:`2026-10-02T15:00:00.000+0000`},{key:`PAY-100`,type:`epic`,summary:`Card payments v2`,status:`progress`,assignee:wM,created:`2026-08-31T10:00:00.000+0000`,updated:`2026-10-09T11:00:00.000+0000`,description:`h2. Goal
45
- Store cards as tokens and charge them without the PAN leaving the edge.`},{key:`PAY-101`,type:`story`,summary:`Tokenise card numbers at the edge`,status:`progress`,assignee:SM,points:5,sprints:[AM],epic:`PAY-100`,subtasks:[`PAY-106`],links:[jM(`Blocks`,`outward`,`PAY-102`,30001)],created:`2026-09-14T09:30:00.000+0000`,updated:`2026-10-08T16:10:00.000+0000`,priority:`High`,description:`The gateway swaps the PAN for a token before anything is logged.
46
-
47
- * PAN never reaches the app tier
48
- * Token format agreed with the vault team`},{key:`PAY-102`,type:`story`,summary:`Store tokens in the vault`,status:`todo`,assignee:CM,points:3,sprints:[AM],epic:`PAY-100`,links:[jM(`Blocks`,`inward`,`PAY-101`,30001),jM(`Blocks`,`outward`,`PAY-103`,30002)],created:`2026-09-14T09:35:00.000+0000`,updated:`2026-10-05T09:10:00.000+0000`},{key:`PAY-103`,type:`story`,summary:`Charge a stored token`,status:`todo`,points:8,sprints:[AM],epic:`PAY-100`,links:[jM(`Blocks`,`inward`,`PAY-102`,30002)],created:`2026-09-14T09:40:00.000+0000`,updated:`2026-10-05T09:10:00.000+0000`},{key:`PAY-104`,type:`bug`,summary:`Refund total rounds half-cents down`,status:`review`,assignee:CM,points:2,sprints:[kM,AM],created:`2026-09-22T13:00:00.000+0000`,updated:`2026-10-07T10:20:00.000+0000`,priority:`High`,labels:[`payments`,`refunds`]},{key:`PAY-105`,type:`story`,summary:`Show the last four digits on receipts`,status:`done`,assignee:SM,points:3,sprints:[AM],epic:`PAY-100`,created:`2026-09-15T08:00:00.000+0000`,updated:`2026-10-09T15:30:00.000+0000`,resolved:`2026-10-09T15:30:00.000+0000`},{key:`PAY-106`,type:`subtask`,summary:`Add the tokeniser to the gateway config`,status:`done`,assignee:SM,parent:`PAY-101`,sprints:[AM],created:`2026-10-05T10:00:00.000+0000`,updated:`2026-10-07T12:00:00.000+0000`,resolved:`2026-10-07T12:00:00.000+0000`},{key:`PAY-107`,type:`story`,summary:`Retry declined charges once`,status:`todo`,sprints:[AM],links:[jM(`Relates`,`outward`,`PAY-103`,30003)],created:`2026-10-08T13:45:00.000+0000`,updated:`2026-10-08T14:00:00.000+0000`}],PM=(e,t,n,r)=>({id:String(e),author:t,created:n,items:r}),FM=(e,t)=>({field:`status`,fieldtype:`jira`,from:TM[e].id,fromString:TM[e].name,to:TM[t].id,toString:TM[t].name}),IM=(e,t)=>({field:`Sprint`,fieldtype:`custom`,from:null,fromString:e,to:null,toString:t}),LM={"PAY-92":[PM(40001,SM,`2026-09-09T10:00:00.000+0000`,[FM(`todo`,`progress`)]),PM(40002,SM,`2026-09-17T14:00:00.000+0000`,[FM(`progress`,`done`)])],"PAY-95":[PM(40011,CM,`2026-09-22T10:00:00.000+0000`,[FM(`todo`,`progress`)]),PM(40012,CM,`2026-09-24T15:00:00.000+0000`,[FM(`progress`,`review`)]),PM(40013,SM,`2026-09-25T11:00:00.000+0000`,[FM(`review`,`done`)])],"PAY-97":[PM(40021,SM,`2026-09-23T09:00:00.000+0000`,[FM(`todo`,`progress`)]),PM(40022,CM,`2026-09-30T16:00:00.000+0000`,[FM(`progress`,`done`)])],"PAY-98":[PM(40031,wM,`2026-09-21T14:00:00.000+0000`,[FM(`todo`,`progress`)]),PM(40032,wM,`2026-10-01T10:00:00.000+0000`,[FM(`progress`,`review`)]),PM(40033,CM,`2026-10-02T15:00:00.000+0000`,[FM(`review`,`done`)])],"PAY-101":[PM(40101,SM,`2026-10-06T09:15:00.000+0000`,[FM(`todo`,`progress`)])],"PAY-104":[PM(40201,CM,`2026-09-29T10:00:00.000+0000`,[FM(`todo`,`progress`)]),PM(40202,wM,`2026-10-05T09:05:00.000+0000`,[IM(`Sprint 41`,`Sprint 41, Sprint 42`)]),PM(40203,CM,`2026-10-07T10:20:00.000+0000`,[FM(`progress`,`review`)])],"PAY-105":[PM(40301,SM,`2026-10-06T11:00:00.000+0000`,[FM(`todo`,`progress`)]),PM(40302,SM,`2026-10-08T17:00:00.000+0000`,[FM(`progress`,`review`)]),PM(40303,CM,`2026-10-09T15:30:00.000+0000`,[FM(`review`,`done`)])],"PAY-107":[PM(40401,wM,`2026-10-08T14:00:00.000+0000`,[IM(``,`Sprint 42`)])]},RM=(e,t)=>({displayName:t,url:`https://ado.imagile.dev/_apis/Identities/abc12345-0000-0000-0000-0000000000${e.length}0`,id:`abc12345-0000-0000-0000-0000000000${e.length}0`,uniqueName:`IMAGILE\\${e}`,descriptor:`win.abc12345${e}`}),zM=RM(`dokafor`,`D. Okafor`),BM=RM(`mlind`,`M. Lind`),VM=RM(`knakamura`,`K. Nakamura`),HM=(e,t)=>({rel:e,url:`${_M}/_apis/wit/workItems/${t}`,attributes:{isLocked:!1,name:e.split(`.`).pop()}}),UM=e=>({id:e.id,rev:6,fields:{"System.AreaPath":`Payments\\Settlement`,"System.TeamProject":`Payments`,"System.IterationPath":e.iteration,"System.WorkItemType":e.type,"System.State":e.state,"System.Reason":e.reason,...e.assignee?{"System.AssignedTo":e.assignee}:{},"System.CreatedDate":e.created,"System.CreatedBy":VM,"System.ChangedDate":e.changed,"System.ChangedBy":e.assignee??VM,"System.Title":e.title,...e.description?{"System.Description":e.description}:{},"Microsoft.VSTS.Common.Priority":2,...e.points===void 0?{}:{"Microsoft.VSTS.Scheduling.StoryPoints":e.points},...e.hours===void 0?{}:{"Microsoft.VSTS.Scheduling.OriginalEstimate":e.hours},...e.teamPoints===void 0?{}:{"Custom.TeamPoints":e.teamPoints},...e.closed?{"Microsoft.VSTS.Common.ClosedDate":e.closed}:{},"System.Tags":e.tags??`settlement`},relations:e.relations??[],_links:{self:{href:`${_M}/_apis/wit/workItems/${e.id}`},html:{href:`${_M}/Payments/_workitems/edit/${e.id}`}},url:`${_M}/_apis/wit/workItems/${e.id}`}),WM=`Payments\\Sprint 42`,GM=[{id:2290,type:`User Story`,title:`Read settlement batches from the ledger`,state:`Closed`,reason:`Acceptance tests pass`,assignee:zM,iteration:`Payments\\Sprint 40`,points:3,teamPoints:3,created:`2026-09-01T09:00:00Z`,changed:`2026-09-15T16:00:00Z`,closed:`2026-09-15T16:00:00Z`},{id:2294,type:`Bug`,title:`Batch totals ignore refunds`,state:`Closed`,reason:`Fixed and verified`,assignee:BM,iteration:`Payments\\Sprint 41`,points:2,teamPoints:2,created:`2026-09-14T13:00:00Z`,changed:`2026-09-26T11:30:00Z`,closed:`2026-09-26T11:30:00Z`},{id:2297,type:`User Story`,title:`Group settlements by merchant`,state:`Closed`,reason:`Acceptance tests pass`,assignee:zM,iteration:`Payments\\Sprint 41`,points:5,teamPoints:5,created:`2026-09-15T10:00:00Z`,changed:`2026-10-01T15:00:00Z`,closed:`2026-10-01T15:00:00Z`},{id:2301,type:`Feature`,title:`Settlement reports`,state:`Active`,reason:`Implementation started`,assignee:VM,iteration:`Payments`,relations:[HM(`System.LinkTypes.Hierarchy-Forward`,2302),HM(`System.LinkTypes.Hierarchy-Forward`,2303)],created:`2026-08-24T14:00:00Z`,changed:`2026-10-05T09:30:00Z`},{id:2302,type:`User Story`,title:`Export the daily settlement CSV`,state:`Active`,reason:`Implementation started`,assignee:zM,iteration:WM,points:5,teamPoints:5,relations:[HM(`System.LinkTypes.Hierarchy-Reverse`,2301),HM(`System.LinkTypes.Dependency-Forward`,2303),HM(`System.LinkTypes.Hierarchy-Forward`,2305)],created:`2026-09-10T10:00:00Z`,changed:`2026-10-06T08:45:00Z`,description:`<div>One CSV per merchant, written at 02:00 UTC.</div>`},{id:2303,type:`User Story`,title:`Email the settlement report to finance`,state:`New`,reason:`New`,iteration:WM,points:3,teamPoints:3,relations:[HM(`System.LinkTypes.Hierarchy-Reverse`,2301),HM(`System.LinkTypes.Dependency-Reverse`,2302)],created:`2026-09-10T10:05:00Z`,changed:`2026-10-05T09:30:00Z`},{id:2304,type:`Bug`,title:`Settlement totals are a day early in UTC-5`,state:`Active`,reason:`Approved`,assignee:BM,iteration:WM,points:2,teamPoints:2,created:`2026-09-24T16:20:00Z`,changed:`2026-10-07T11:00:00Z`,tags:`settlement; timezones`},{id:2305,type:`Task`,title:`Schedule the export job`,state:`Closed`,reason:`Completed`,assignee:zM,iteration:WM,hours:4,relations:[HM(`System.LinkTypes.Hierarchy-Reverse`,2302)],created:`2026-10-05T10:00:00Z`,changed:`2026-10-08T13:00:00Z`,closed:`2026-10-08T13:00:00Z`},{id:2306,type:`User Story`,title:`Reconcile chargebacks against settlements`,state:`New`,reason:`New`,iteration:WM,points:5,created:`2026-10-02T09:00:00Z`,changed:`2026-10-09T10:15:00Z`},{id:2307,type:`Bug`,title:`Retire the legacy settlement endpoint`,state:`Removed`,reason:`Removed from the backlog`,iteration:WM,points:1,created:`2026-09-01T09:00:00Z`,changed:`2026-10-07T09:00:00Z`,closed:`2026-10-07T09:00:00Z`}],KM=(e,t,n,r,i,a)=>({id:e,rev:t,fields:{"System.WorkItemType":e===2304||e===2294?`Bug`:`User Story`,"System.State":i,"System.IterationPath":a,"System.ChangedDate":n,"System.ChangedBy":r},url:`${_M}/_apis/wit/workItems/${e}/revisions/${t}`}),qM=`Payments\\Sprint 40`,JM=`Payments\\Sprint 41`,YM={2290:[KM(2290,1,`2026-09-01T09:00:00Z`,VM,`New`,`Payments`),KM(2290,2,`2026-09-04T15:00:00Z`,VM,`New`,qM),KM(2290,3,`2026-09-08T10:00:00Z`,zM,`Active`,qM),KM(2290,4,`2026-09-15T16:00:00Z`,zM,`Closed`,qM)],2294:[KM(2294,1,`2026-09-14T13:00:00Z`,VM,`New`,JM),KM(2294,2,`2026-09-22T09:30:00Z`,BM,`Active`,JM),KM(2294,3,`2026-09-26T11:30:00Z`,BM,`Closed`,JM)],2297:[KM(2297,1,`2026-09-15T10:00:00Z`,VM,`New`,JM),KM(2297,2,`2026-09-23T09:00:00Z`,zM,`Active`,JM),KM(2297,3,`2026-10-01T15:00:00Z`,zM,`Closed`,JM)],2302:[KM(2302,1,`2026-09-10T10:00:00Z`,VM,`New`,`Payments`),KM(2302,2,`2026-09-30T15:00:00Z`,VM,`New`,WM),KM(2302,3,`2026-10-06T08:45:00Z`,zM,`Active`,WM)],2304:[KM(2304,1,`2026-09-24T16:20:00Z`,VM,`New`,`Payments\\Sprint 41`),KM(2304,2,`2026-09-28T09:00:00Z`,BM,`Active`,`Payments\\Sprint 41`),KM(2304,3,`2026-10-05T08:30:00Z`,VM,`Active`,WM)],2306:[KM(2306,1,`2026-10-02T09:00:00Z`,VM,`New`,`Payments`),KM(2306,2,`2026-10-09T10:15:00Z`,VM,`New`,WM)]},XM=(e,t,n,r)=>({id:r,identifier:`abc12345-0000-0000-0000-0000000004${r}`,name:e,structureType:`iteration`,hasChildren:!1,path:`\\Payments\\Iteration\\${e}`,attributes:{startDate:t,finishDate:n},url:`${_M}/Payments/_apis/wit/classificationNodes/Iterations/${encodeURIComponent(e)}`}),ZM={id:40,identifier:`abc12345-0000-0000-0000-000000000400`,name:`Payments`,structureType:`iteration`,hasChildren:!0,path:`\\Payments\\Iteration`,children:[XM(`Sprint 40`,`2026-09-07T00:00:00Z`,`2026-09-18T00:00:00Z`,40),XM(`Sprint 41`,`2026-09-21T00:00:00Z`,`2026-10-02T00:00:00Z`,41),XM(`Sprint 42`,`2026-10-05T00:00:00Z`,`2026-10-16T00:00:00Z`,42),XM(`Sprint 43`,`2026-10-19T00:00:00Z`,`2026-10-30T00:00:00Z`,43)],url:`${_M}/Payments/_apis/wit/classificationNodes/Iterations`},QM=(e,t)=>({login:e,id:t,avatar_url:`${vM}/avatars/u/${t}`,type:`User`}),$M=QM(`ada-dev`,11),eN=QM(`bo-web`,12),tN={Feature:{id:3,name:`Feature`},Task:{id:1,name:`Task`},Bug:{id:2,name:`Bug`}},nN=`imagile/payments-web`,rN=e=>({id:9e3+e.number,number:e.number,title:e.title,state:e.state,state_reason:e.state===`closed`?`completed`:null,locked:!1,body:e.body,html_url:`${vM}/${nN}/issues/${e.number}`,repository_url:`${yM}/repos/${nN}`,user:$M,labels:e.labels.map((e,t)=>({id:500+t,name:e,color:`d73a4a`,description:null})),assignees:e.assignee?[e.assignee]:[],type:{...tN[e.type],node_id:`IT_kwDOabc12345${e.type}`,description:null,color:`gray`},sub_issues_summary:{total:e.subs?.length??0,completed:0,percent_completed:0},parent_issue_url:e.parent?`${yM}/repos/${nN}/issues/${e.parent}`:null,created_at:e.created,updated_at:e.updated,closed_at:e.closed??null}),iN=[{number:36,title:`Pay button stays disabled after an error`,type:`Bug`,state:`closed`,assignee:eN,labels:[`bug`],created:`2026-09-21T10:00:00Z`,updated:`2026-09-24T17:00:00Z`,closed:`2026-09-24T17:00:00Z`,body:`After a declined card the Pay button never re-enables.`},{number:38,title:`Show card brand icons`,type:`Task`,state:`closed`,assignee:$M,labels:[`checkout`,`ui`],created:`2026-09-21T10:30:00Z`,updated:`2026-10-01T12:00:00Z`,closed:`2026-10-01T12:00:00Z`,body:`Visa, Mastercard and Amex icons beside the card number field.`},{number:41,title:`Checkout accepts saved cards`,type:`Feature`,state:`open`,assignee:$M,labels:[`checkout`],subs:[42],created:`2026-09-28T12:00:00Z`,updated:`2026-10-08T09:00:00Z`,body:`Customers pick a saved card at checkout instead of typing it again.
49
-
50
- - [ ] Card picker
51
- - [ ] 3-D Secure on saved cards`},{number:42,title:`Saved-card picker component`,type:`Task`,state:`open`,assignee:eN,labels:[`checkout`,`ui`],parent:41,created:`2026-09-28T12:10:00Z`,updated:`2026-10-09T14:00:00Z`,body:`A list of saved cards with the last four digits and expiry.`},{number:43,title:`Card form loses focus on Safari`,type:`Bug`,state:`open`,assignee:eN,labels:[`bug`,`safari`],created:`2026-10-07T08:30:00Z`,updated:`2026-10-07T08:45:00Z`,body:`Typing the expiry moves focus back to the card number field on Safari 18.`},{number:44,title:`Receipt page shows the wrong currency symbol`,type:`Bug`,state:`closed`,assignee:$M,labels:[`bug`],created:`2026-10-01T10:00:00Z`,updated:`2026-10-12T16:00:00Z`,closed:`2026-10-12T16:00:00Z`,body:`EUR receipts show $.`},{number:45,title:`End-to-end test for 3-D Secure`,type:`Task`,state:`open`,labels:[`testing`],created:`2026-10-05T11:00:00Z`,updated:`2026-10-05T11:00:00Z`,body:`Cover the challenge flow with the issuer simulator.`}],aN={36:{status:`Done`,estimate:2,added:`2026-09-21T10:05:00Z`,sprint:41},38:{status:`Done`,estimate:3,added:`2026-09-21T10:35:00Z`,sprint:41},41:{status:`In Progress`,estimate:5,added:`2026-09-28T12:05:00Z`},42:{status:`In Review`,estimate:3,added:`2026-09-28T12:15:00Z`},43:{status:`Todo`,estimate:2,added:`2026-10-07T09:00:00Z`},44:{status:`Done`,estimate:1,added:`2026-10-01T10:05:00Z`},45:{status:`Todo`,added:`2026-10-05T11:05:00Z`}},oN={Todo:`f75ad846`,"In Progress":`47fc9ee4`,"In Review":`a1b2c3d4`,Done:`98236657`},sN=e=>{let t=aN[e.number];return{id:`PVTI_abc12345${e.number}`,type:`ISSUE`,isArchived:!1,createdAt:t.added,updatedAt:e.updated,content:{__typename:`Issue`,number:e.number,title:e.title,state:e.state.toUpperCase(),url:`${vM}/${nN}/issues/${e.number}`,updatedAt:e.updated,repository:{nameWithOwner:nN}},fieldValues:[{__typename:`ProjectV2ItemFieldTextValue`,text:e.title,field:{id:`PVTF_abc12345title`,name:`Title`}},{__typename:`ProjectV2ItemFieldSingleSelectValue`,name:t.status,optionId:oN[t.status],field:{id:`PVTSSF_abc12345`,name:`Status`}},...t.estimate===void 0?[]:[{__typename:`ProjectV2ItemFieldNumberValue`,number:t.estimate,field:{id:`PVTF_abc12345`,name:`Estimate`}}],t.sprint===41?{__typename:`ProjectV2ItemFieldIterationValue`,title:`Sprint 41`,iterationId:`b7e2a91c`,startDate:`2026-09-21`,duration:12,field:{id:`PVTIF_abc12345`,name:`Sprint`}}:{__typename:`ProjectV2ItemFieldIterationValue`,title:`Sprint 42`,iterationId:`cfc16e4d`,startDate:`2026-10-05`,duration:12,field:{id:`PVTIF_abc12345`,name:`Sprint`}}]}},cN=(e,t,n)=>[{id:7e3+e*10,node_id:`CE_kwDOabc1234570${e}`,event:`closed`,actor:t,created_at:n,state_reason:`completed`,commit_id:null}],lN=[{id:7001,node_id:`LE_kwDOabc123457001`,event:`labeled`,actor:$M,created_at:`2026-10-01T10:01:00Z`,label:{name:`bug`,color:`d73a4a`}},{id:7002,node_id:`CE_kwDOabc123457002`,event:`closed`,actor:$M,created_at:`2026-10-12T16:00:00Z`,state_reason:`completed`,commit_id:null}],uN={owner:`imagile`,repo:`payments-web`},dN=[bM(`jira issue get`,{issues:NM.map(MM),errors:[]},`corp-jira`),...Object.entries(LM).map(([e,t])=>({key:e,history:bM(`jira issue history`,t,`corp-jira`)})),bM(`ado work-item iterations`,ZM,`corp-ado`,{collection:`DefaultCollection`,project:`Payments`}),bM(`ado work-item get-many`,{count:GM.length,value:GM.map(UM),missing:[]},`corp-ado`,{collection:`DefaultCollection`,project:`Payments`}),...Object.values(YM).map(e=>bM(`ado work-item history`,e,`corp-ado`,{collection:`DefaultCollection`,project:`Payments`})),bM(`github issue get`,{issues:iN.map(e=>e.subs?{...rN(e),sub_issues:e.subs.map(e=>rN(iN.find(t=>t.number===e)))}:rN(e)),errors:[]},`github`,uN),{key:`36`,history:bM(`github issue history`,cN(36,eN,`2026-09-24T17:00:00Z`),`github`,uN)},{key:`38`,history:bM(`github issue history`,cN(38,$M,`2026-10-01T12:00:00Z`),`github`,uN)},{key:`44`,history:bM(`github issue history`,lN,`github`,uN)},bM(`github project items`,iN.map(sN),`github`,{owner:`imagile`})];`${dN.map(e=>JSON.stringify(e)).join(`
52
- `)}`,`${JSON.stringify(bM(`jira issue history`,LM[`PAY-104`],`corp-jira`),null,2)}`,`${JSON.stringify(dN.find(e=>e.meta?.command===`ado work-item get-many`),null,2)}`;var fN=dN,pN=e=>`history`in e,mN=e=>fN.find(t=>!pN(t)&&t.meta?.command===e).data,hN=e=>fN.filter(pN).filter(t=>t.history.meta?.command===e),gN=mN(`jira issue get`).issues,_N={"PAY-101":[`* The PAN is swapped for a token before the first log line`,`* A replayed token is refused`].join(`
53
- `),"PAY-102":[`* A stored token charges once`,`* A second charge with the same idempotency key is refused`].join(`
54
- `)};gN.length,gN.map(e=>_N[e.key]?{...e,fields:{...e.fields,customfield_10500:_N[e.key]}}:e);var vN=gN.map(e=>e.key),yN={self:`https://jira.imagile.dev/rest/api/2/user?username=jsmith`,name:`jsmith`,key:`jsmith`,displayName:`J. Smith`,active:!0},bN=(e,t,n,r)=>({id:String(e),author:yN,created:t,items:[{field:`status`,fieldtype:`jira`,from:n[0],fromString:n[1],to:r[0],toString:r[1]}]}),xN={"PAY-106":[bN(40501,`2026-10-06T09:30:00.000+0000`,[`10000`,`To Do`],[`3`,`In Progress`]),bN(40502,`2026-10-07T12:00:00.000+0000`,[`3`,`In Progress`],[`10001`,`Done`])]},SN=Object.fromEntries(vN.map(e=>[e,hN(`jira issue history`).find(t=>t.key===e)?.history.data??xN[e]??[]]));mN(`ado work-item iterations`);var CN=mN(`ado work-item get-many`).value.map(e=>e.id),wN=`https://ado.imagile.dev/DefaultCollection`;`${wN}`,CN.map(e=>({id:e,url:`${wN}/_apis/wit/workItems/${e}`}));var TN=new Map(fN.filter(e=>!pN(e)&&e.meta?.command===`ado work-item history`).map(e=>[e.data[0].id,e.data])),EN=(e,t)=>({displayName:t,id:`abc12345-0000-0000-0000-0000000000${e.length}0`,uniqueName:`IMAGILE\\${e}`}),DN=EN(`knakamura`,`K. Nakamura`),ON=EN(`dokafor`,`D. Okafor`),kN=(e,t,n,r,i,a,o)=>({id:e,rev:t,fields:{"System.WorkItemType":i,"System.State":a,"System.IterationPath":o,"System.ChangedDate":n,"System.ChangedBy":r},url:`${wN}/_apis/wit/workItems/${e}/revisions/${t}`}),AN=`Payments`,jN=`Payments\\Sprint 42`,MN={2301:[kN(2301,1,`2026-08-24T14:00:00Z`,DN,`Feature`,`New`,AN),kN(2301,2,`2026-10-05T09:30:00Z`,DN,`Feature`,`Active`,AN)],2303:[kN(2303,1,`2026-09-10T10:05:00Z`,DN,`User Story`,`New`,AN),kN(2303,2,`2026-09-30T15:00:00Z`,DN,`User Story`,`New`,jN)],2305:[kN(2305,1,`2026-10-05T10:00:00Z`,ON,`Task`,`New`,jN),kN(2305,2,`2026-10-06T09:00:00Z`,ON,`Task`,`Active`,jN),kN(2305,3,`2026-10-08T13:00:00Z`,ON,`Task`,`Closed`,jN)],2307:[kN(2307,1,`2026-09-01T09:00:00Z`,DN,`Bug`,`New`,AN),kN(2307,2,`2026-09-30T15:00:00Z`,DN,`Bug`,`New`,jN),kN(2307,3,`2026-10-07T09:00:00Z`,DN,`Bug`,`Removed`,jN)]},NN=Object.fromEntries(CN.map(e=>[e,TN.get(e)??MN[e]])),PN=mN(`github project items`).map(e=>e.content.number);mN(`github issue get`);var FN=Object.fromEntries(PN.map(e=>[e,hN(`github issue history`).find(t=>t.key===String(e))?.history.data??[]])),IN=(e,t,n,r)=>({self:`https://jira.imagile.dev/rest/api/2/status/${t}`,name:e,id:t,statusCategory:{id:n===`new`?2:n===`done`?3:4,key:n,name:r}}),LN={progress:IN(`In Progress`,`3`,`indeterminate`,`In Progress`),review:IN(`In Review`,`10100`,`indeterminate`,`In Progress`),done:IN(`Done`,`10001`,`done`,`Done`),todo:IN(`To Do`,`10000`,`new`,`To Do`)},RN={"To Do":[{id:`11`,name:`Start Progress`,to:LN.progress}],"In Progress":[{id:`21`,name:`Submit for Review`,to:LN.review},{id:`31`,name:`Done`,to:LN.done},{id:`41`,name:`Stop Progress`,to:LN.todo}],"In Review":[{id:`31`,name:`Done`,to:LN.done},{id:`51`,name:`Back to In Progress`,to:LN.progress}]},zN=e=>String(e.fields?.status?.name??``),BN=Object.fromEntries(gN.filter(e=>zN(e)!==`Done`).map(e=>[e.key,RN[zN(e)]??[]])),VN=[{name:`New`,color:`b2b2b2`,category:`Proposed`},{name:`Active`,color:`007acc`,category:`InProgress`},{name:`Resolved`,color:`ff9d00`,category:`Resolved`},{name:`Closed`,color:`339933`,category:`Completed`},{name:`Removed`,color:`ffffff`,category:`Removed`}],HN={"User Story":VN,Bug:VN,Feature:VN},UN=`2026-10-13T08:00:00.000Z`,WN=`card-payments`,GN=`settlement`,KN=`checkout-web`,qN=(e,t,n)=>({dossier:e,area:t,...n?{env:n}:{}}),JN=(e,t,n,r)=>Object.entries(r).map(([r,i])=>({command:`${t} pr get`,input:{dossier:e,[n]:Number(r),include:Cb},data:i,...qN(e,t)}));[mM(),...cM.map(e=>({command:`dossiers show`,input:{dossier:e.name},data:pM(e)})),(pb(`PAY`),{...qN(WN,`jira`)}),...vN.map(e=>({command:`jira issue history`,input:{dossier:WN,key:e},data:SN[e],...qN(WN,`jira`)})),...Object.entries(BN).map(([e,t])=>({command:`jira issue transitions`,input:{dossier:WN,key:e},data:t,...qN(WN,`jira`)})),{...qN(WN,`bitbucket`)},...JN(WN,`bitbucket`,`id`,fj),...Object.entries($j).map(([e,t])=>({command:`jenkins pipeline runs`,input:{dossier:WN,name:`payments-core/PR-${e}`,limit:5},data:t,...qN(WN,`jenkins`)})),(nM[`payments-dev`],{...qN(WN,`openshift`,`dev`)}),(nM[`payments-prod`],{...qN(WN,`openshift`,`prod`)}),{...qN(GN,`ado`)},{...qN(GN,`ado`)},{...qN(GN,`ado`)},...CN.map(e=>({command:`ado work-item history`,input:{dossier:GN,id:e},data:NN[e],...qN(GN,`ado`)})),...Object.entries(HN).map(([e,t])=>({command:`ado work-item states`,input:{dossier:GN,type:e},data:t,...qN(GN,`ado`)})),{...qN(GN,`ado`)},...JN(GN,`ado`,`id`,Sj),{...qN(GN,`ado`)},{...qN(GN,`ado`)},{...qN(KN,`github`)},{...qN(KN,`github`)},...PN.map(e=>({command:`github issue history`,input:{dossier:KN,number:e},data:FN[e],...qN(KN,`github`)})),{...qN(KN,`github`)},...JN(KN,`github`,`number`,Pj),(Tb[0],{...qN(KN,`github`)}),{...qN(KN,`bitbucket-cloud`)},...JN(KN,`bitbucket-cloud`,`id`,Wj),(nM[`checkout-staging`],{...qN(KN,`openshift`,`staging`)}),(nM[`checkout-prod`],{...qN(KN,`openshift`,`prod`)})];function YN(e){let t=e.installed?`${e.package} ${e.version??``} is installed beside Toil UI`.replace(` `,` `):`${e.package} isn't installed beside Toil UI; Toil UI was tested with ${e.tested}`,n=e.cli.path?`It would start ${e.cli.path}`:`${e.cli.problem??`Its CLI was not found.`}${e.cli.fix?` ${e.cli.fix}`:``}`;return[`${t}.`,n.endsWith(`.`)?n:`${n}.`,...e.notes]}function XN({adapters:e,client:t,onInstalled:n}){let[r,i]=(0,v.useState)(null);return(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`agent-adapters`,children:[(0,q.jsx)(`h2`,{id:`agent-adapters`,children:`Adapters on this machine`}),(0,q.jsx)(`p`,{className:`note`,children:`Each adapter needs its SDK beside Toil UI and its own CLI on this machine. Install runs one npm command, shown to you first, at the version Toil UI was tested with.`}),(0,q.jsx)(`ul`,{className:`adapter-status`,children:e.map(e=>{let t=e.installed&&e.cli.path!==null;return(0,q.jsxs)(`li`,{className:`adapter-status__row`,"data-adapter":e.name,children:[(0,q.jsxs)(`div`,{className:`adapter-status__head`,children:[(0,q.jsx)(`strong`,{children:e.label}),(0,q.jsx)(`span`,{className:t?`agent-pick__ready`:`agent-missing`,children:t?`Ready`:e.installed?`Needs a fix`:`Not installed`})]}),YN(e).map((t,n)=>(0,q.jsx)(`p`,{className:n===1&&!e.cli.path?`agent-missing`:`note`,children:t},n)),!e.installed&&(0,q.jsx)(`div`,{className:`proposal-actions`,children:(0,q.jsxs)(B,{className:`btn btn--accent`,onPress:()=>i(e),"data-install":e.name,children:[`Install `,e.label]})})]},e.name)})}),r&&(0,q.jsx)(ZN,{adapter:r,plan:r.install,client:t,onClose:()=>i(null),onInstalled:e=>{n?.(e)}})]})}function ZN({adapter:e,plan:t,client:n,onClose:r,onInstalled:i}){let[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(`ready`),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),p=(0,v.useRef)(null),m=t.argv!==null&&n!==null,h=async()=>{if(!n)return;c(`running`),o([]),u(``);let r=new AbortController;p.current=r;try{let a=await n.install(e.name,t.command,e=>o(t=>[...t.slice(-400),e]),r.signal);c(`done`),u(`Installed ${e.package} ${a.version??``}, and Toil UI loaded it.${a.cli.path?` ${e.label} is ready.`:` ${a.cli.problem??``} ${a.cli.fix??``}`}`.replace(/\s+/g,` `).trim()),i(a)}catch(e){c(`failed`),u(e instanceof Error?e.message:String(e))}},g=async()=>{try{await navigator.clipboard.writeText(t.command),f(`Copied the command.`)}catch{f(`Copying was refused here; select the command above and copy it yourself.`)}};return(0,q.jsx)(Fd,{className:`feedback-overlay`,"data-backdrop":``,isDismissable:s!==`running`,isOpen:!0,onOpenChange:e=>!e&&r(),children:(0,q.jsx)(Nd,{className:`feedback-modal`,children:(0,q.jsx)(_d,{className:`feedback-dialog`,"aria-labelledby":`install-title`,children:(0,q.jsxs)(`div`,{className:`feedback-body`,children:[(0,q.jsxs)(Ui,{slot:`title`,id:`install-title`,children:[`Install `,e.label,`'s SDK`]}),(0,q.jsxs)(`p`,{children:[`Toil UI runs this one command, through the npm that came with your Node and with your own npm config, so your organization's registry and proxy apply. It installs `,e.package,` `,e.tested,`, the version Toil UI was tested with, beside Toil UI, runs no install scripts, and takes nothing published in the last 14 days.`]}),(0,q.jsx)(`pre`,{className:`install-command`,"data-scroller":``,tabIndex:0,role:`region`,"aria-label":`The command`,children:t.command}),t.folder&&(0,q.jsxs)(`p`,{className:`note`,children:[`It installs into `,t.folder,`.`]}),t.problem&&(0,q.jsxs)(`p`,{className:`failure`,children:[t.problem,` `,t.fix]}),!n&&(0,q.jsx)(`p`,{className:`config-off`,children:`This is the preview, so nothing is installed. Toil UI on your own machine runs this command when you press Install.`}),a.length>0&&(0,q.jsx)(`pre`,{className:`install-output`,"data-scroller":``,tabIndex:0,role:`log`,"aria-label":`npm's output`,children:a.join(`
55
- `)}),l&&(0,q.jsx)(`p`,{role:s===`failed`?`alert`:`status`,className:s===`failed`?`failure`:`note`,children:l}),(0,q.jsxs)(`div`,{className:`proposal-actions`,children:[m&&s!==`done`&&(0,q.jsx)(B,{className:`btn btn--accent`,onPress:()=>void h(),isDisabled:s===`running`,"data-install-run":``,children:s===`running`?`Installing…`:s===`failed`?`Try again`:`Install`}),(0,q.jsx)(B,{className:`btn`,onPress:()=>void g(),"data-install-copy":``,children:`Copy command`}),s===`running`?(0,q.jsx)(B,{className:`btn`,onPress:()=>p.current?.abort(),children:`Stop`}):(0,q.jsx)(B,{className:`btn`,slot:`close`,children:s===`done`?`Done`:`Cancel`}),(0,q.jsx)(`span`,{className:`note`,role:`status`,children:d})]})]})})})})}var QN={claude:[`@anthropic-ai/claude-agent-sdk@0.3.289`,`zod@4.6.5`],copilot:[`@github/copilot-sdk@1.0.16`],codex:[`@openai/codex-sdk@0.160.0`]},$N=e=>new Date(Date.parse(e)-12096e5).toISOString().slice(0,10),eP=e=>QN[e][0].slice(QN[e][0].lastIndexOf(`@`)+1),tP=`/home/you/.npm-global`,nP=`npm install --global --prefix ${tP} --ignore-scripts --before=${$N(UN)} --no-audit --no-fund --omit=optional ${QN.claude.join(` `)}`,rP=[{name:`claude`,label:`Claude`,package:`@anthropic-ai/claude-agent-sdk`,installed:!1,version:null,tested:eP(`claude`),cli:{path:`/home/you/.local/bin/claude`,problem:null,fix:null},endpoints:[`anthropic`,`bedrock`,`foundry`,`vertex`],model:`haiku`,install:{adapter:`claude`,kind:`global`,folder:tP,command:nP,argv:null,problem:null,fix:null},notes:[]},{name:`copilot`,label:`GitHub Copilot`,package:`@github/copilot-sdk`,installed:!0,version:eP(`copilot`),tested:eP(`copilot`),cli:{path:`C:\\Users\\you\\AppData\\Roaming\\npm\\node_modules\\@github\\copilot\\npm-loader.js`,problem:null,fix:null},endpoints:[],model:null,install:{adapter:`copilot`,kind:`global`,folder:tP,command:nP.replace(QN.claude.join(` `),QN.copilot.join(` `)),argv:null,problem:null,fix:null},notes:[`copilot.cmd on PATH is an npm shim the SDK can't start, so Toil UI starts the script it runs, C:\\Users\\you\\AppData\\Roaming\\npm\\node_modules\\@github\\copilot\\npm-loader.js, with Node.`]},{name:`codex`,label:`Codex`,package:`@openai/codex-sdk`,installed:!0,version:eP(`codex`),tested:eP(`codex`),cli:{path:`/usr/local/bin/codex`,problem:null,fix:null},endpoints:[],model:null,install:{adapter:`codex`,kind:`global`,folder:tP,command:nP.replace(QN.claude.join(` `),QN.codex.join(` `)),argv:null,problem:null,fix:null},notes:[]}],iP={anthropic:`Anthropic API`,bedrock:`Amazon Bedrock`,foundry:`Microsoft Foundry`,vertex:`Google Vertex AI`};function aP(e){return`${e.installed?`${e.package} is installed`:`${e.package} isn't installed`}; ${e.cli.path?`it would start ${e.cli.path}`:e.cli.problem??`its CLI was not found`}`.replace(/\.$/,``)}function oP({client:e,onChange:t,dossier:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let t=!0;return e.status().then(e=>{t&&(i(e),o(e.settings))},e=>t&&c(e instanceof Error?e.message:String(e))),()=>{t=!1}},[e]);let p=async n=>{if(n.preventDefault(),a){f(!0),u(``);try{let n=await e.save({...a,endpoint:a.adapter===`claude`?a.endpoint:null});i(n),o(n.settings),c(null),u(n.settings.adapter===`none`?`Saved: no agent answers.`:`Saved: ${n.adapters.find(e=>e.name===n.settings.adapter)?.label??n.settings.adapter} answers from the next question.`),t?.(n)}catch(e){c(e instanceof Error?e.message:String(e))}finally{f(!1)}}},m=r?.adapters.every(e=>!e.installed),h=async()=>{try{let t=await e.status();i(t)}catch(e){c(e instanceof Error?e.message:String(e))}},g=(e,t)=>e.adapter===t?e.model:e.models[t]??null,_=(e,t,n)=>{let r=n||null,i={...e.models};r?i[t]=r:delete i[t],o({...e,models:i,...e.adapter===t?{model:r}:{}})};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`agent-settings`,children:[(0,q.jsx)(`h2`,{id:`agent-settings`,children:`Agent`}),(0,q.jsx)(`p`,{className:`note`,children:`The agent reasons with the subscription you already have, through its own CLI on this machine. Toil UI never downloads one, stores no keys, and gives the agent read-only tools: anything it suggests changing comes back as a proposal for you to apply.`}),r?.problem&&(0,q.jsx)(`p`,{className:`failure`,children:r.problem}),s&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:s}),!r||!a?!s&&(0,q.jsx)(`p`,{className:`note`,children:`Reading the agent settings…`}):(0,q.jsxs)(`form`,{className:`agent-form`,onSubmit:p,children:[m&&(0,q.jsxs)(`p`,{className:`failure`,children:[`None of the three agent SDKs is installed beside Toil UI: `,r.adapters.map(e=>`${e.label} (${e.package})`).join(`, `),`. Press Install below for the one your organization approves, with its CLI on PATH, and choose it here.`]}),(0,q.jsxs)(qd,{className:`agent-adapters`,value:a.adapter,onChange:e=>{let t=e;o({...a,adapter:t,model:t===`none`?null:a.models[t]??null,cliPath:t===`none`?null:a.cliPaths[t]??null})},children:[(0,q.jsx)(Ai,{children:`Adapter`}),(0,q.jsxs)(Jd,{value:`none`,className:`agent-choice`,children:[(0,q.jsx)(`strong`,{children:`None`}),(0,q.jsx)(`span`,{className:`note`,children:`The dashboards only; a chat answers only once it is switched to an adapter.`})]}),r.adapters.map(e=>(0,q.jsxs)(Jd,{value:e.name,className:`agent-choice`,children:[(0,q.jsx)(`strong`,{children:e.label}),(0,q.jsxs)(`span`,{className:e.installed&&e.cli.path?`note`:`agent-missing`,children:[aP(e),`.`]})]},e.name))]}),(0,q.jsxs)(`fieldset`,{className:`agent-models`,children:[(0,q.jsx)(`legend`,{children:`Models, each empty for its CLI's default`}),(0,q.jsx)(`p`,{className:`note`,children:`Each adapter runs with its own, whether it answers by default, in a chat switched to it, or on an assignment.`}),r.adapters.map(e=>(0,q.jsxs)(gf,{className:`field-text`,value:g(a,e.name)??``,onChange:t=>_(a,e.name,t),children:[(0,q.jsxs)(Ai,{children:[e.label,`'s model`]}),(0,q.jsx)(Va,{spellCheck:!1,autoComplete:`off`})]},e.name))]}),a.adapter!==`none`&&(0,q.jsxs)(gf,{className:`field-text`,value:a.cliPath??``,onChange:e=>o({...a,cliPath:e||null,cliPaths:{...a.cliPaths,[a.adapter]:e||void 0}}),children:[(0,q.jsxs)(Ai,{children:[r.adapters.find(e=>e.name===a.adapter)?.label??a.adapter,`'s CLI path (empty to use the one on PATH)`]}),(0,q.jsx)(Va,{spellCheck:!1,autoComplete:`off`})]}),a.adapter===`claude`&&(0,q.jsxs)(qd,{className:`shells`,orientation:`horizontal`,value:a.endpoint??``,onChange:e=>o({...a,endpoint:e||null}),children:[(0,q.jsx)(Ai,{className:`agent-label`,children:`Endpoint`}),(0,q.jsx)(Jd,{value:``,className:`shell-choice`,children:`Claude Code's default`}),(r.adapters.find(e=>e.name===`claude`)?.endpoints??[]).map(e=>(0,q.jsx)(Jd,{value:e,className:`shell-choice`,children:iP[e]??e},e))]}),a.adapter===`claude`&&a.endpoint&&a.endpoint!==`anthropic`&&(0,q.jsx)(`p`,{className:`note`,children:`Claude Code reads that cloud's own region and credentials from its environment, as it does on its own; Toil UI sets only the switch.`}),(0,q.jsxs)(`div`,{className:`proposal-actions`,children:[(0,q.jsx)(B,{type:`submit`,className:`btn btn--accent`,isDisabled:d,children:`Save`}),(0,q.jsx)(`span`,{className:`note`,role:`status`,children:l})]})]})]}),r&&(0,q.jsx)(XN,{adapters:r.adapters,client:e,onInstalled:()=>void h()}),r&&(0,q.jsx)(cP,{saved:r.settings,save:async t=>{if(!r)throw Error(`The agent settings have not loaded yet.`);let n=await e.save({...r.settings,...t});return i(n),o(e=>e?{...e,instructions:n.settings.instructions,voice:n.settings.voice}:n.settings),n.settings},dossier:n??null,prompt:t=>e.prompt(n,t)})]})}function sP(){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`agent-settings`,children:[(0,q.jsx)(`h2`,{id:`agent-settings`,children:`Agent`}),(0,q.jsx)(`p`,{className:`note`,children:`The preview answers with a scripted agent. The local app answers with the one your organization approved: Claude (the Claude Agent SDK, on the Anthropic API, Bedrock, Foundry or Vertex), GitHub Copilot (the Copilot SDK) or Codex (the Codex SDK), each through its own CLI on your machine. You choose the adapter, each one's model and the CLI path here; no key is ever stored.`})]}),(0,q.jsx)(XN,{adapters:rP,client:null}),(0,q.jsx)(cP,{saved:{instructions:null,voice:null},dossier:`card-payments`,disabled:`This is the preview, so nothing is saved. Toil UI on your own machine keeps these in its data folder, in agent.json.`,prompt:async(e,t)=>qA(`card-payments`,UN,YA(e,t))})]})}function cP({saved:e,save:t,prompt:n,disabled:r,dossier:i}){let a=ex(),o=ix(),s={theme:a.name,voice:ox(a,o)},[c,l]=(0,v.useState)(e.instructions??``),[u,d]=(0,v.useState)(e.voice??``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=(0,v.useId)(),S={instructions:c.trim()||null,voice:u.trim()||null},C=(e.instructions??``)!==c.trim()||(e.voice??``)!==u.trim(),w=(0,v.useRef)(!1);w.current=y!==null;let T=t?``:`${S.instructions??``}\u0000${S.voice??``}`;(0,v.useEffect)(()=>{if(!w.current)return;let e=!0;return n(s,S).then(t=>e&&b(t),()=>e&&b(null)),()=>{e=!1}},[s.theme,s.voice,T]);let E=e=>t=>{e(t),h(``)},D=async e=>{if(e.preventDefault(),t){p(!0),h(``);try{let e=await t(S);l(e.instructions??``),d(e.voice??``),_(null),h(`Saved: the next question uses them.`),y!==null&&b(await n(s,e))}catch(e){_(e instanceof Error?e.message:String(e))}finally{p(!1)}}},O=async()=>{if(y!==null)return b(null);try{b(await n(s,S)),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},k=s.voice?`Themed agent voice is on in ${a.label}, so a custom voice here replaces ${a.label}'s.`:a.voice?`Themed agent voice is off, so a custom voice is not used until you switch it on under Settings, General.`:`${a.label} has no voice, so a custom voice is not used in it. Pick a game theme to use one.`;return(0,q.jsxs)(Q,{as:`section`,className:`panel instructions`,"aria-labelledby":`agent-instructions`,children:[(0,q.jsx)(`h2`,{id:`agent-instructions`,children:`Instructions`}),(0,q.jsx)(`p`,{className:`note`,children:`Your own words for every answer. They come after toil's rules in the prompt, and the rules win where the two disagree: answers still cite their items, give figures as the data has them, and suggest changes only as proposals. Instructions can't widen what the agent can do, since its tools only read.`}),r&&(0,q.jsx)(`p`,{className:`config-off`,children:r}),g&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:g}),(0,q.jsxs)(`form`,{className:`agent-form`,onSubmit:D,children:[(0,q.jsx)(lP,{label:`General instructions`,hint:`For example: answer in British English, or lead with risks.`,value:c,onChange:E(l)}),(0,q.jsx)(lP,{label:`Custom voice`,hint:`Replaces the theme's voice while Themed agent voice is on. ${k}`,value:u,onChange:E(d)}),(0,q.jsxs)(`div`,{className:`proposal-actions`,children:[t&&(0,q.jsx)(B,{type:`submit`,className:`btn btn--accent`,isDisabled:f||!C,children:`Save`}),(0,q.jsx)(B,{className:`btn`,onPress:()=>void O(),"aria-expanded":y!==null,"aria-controls":y===null?void 0:x,"data-full-prompt":``,children:y===null?`Show the full prompt`:`Hide the full prompt`}),(0,q.jsx)(`span`,{className:`note`,role:`status`,children:m})]})]}),y!==null&&(0,q.jsxs)(`div`,{className:`full-prompt`,children:[(0,q.jsx)(`p`,{className:`note`,children:t?`What the agent is sent now, in this theme, for a question about ${i??`a dossier`}${i?`, the first dossier toil lists`:``}.${C?` Your unsaved changes are not in it until you save.`:``}`:`What the agent would be sent in this theme, for the sample dossier ${i??`card-payments`}.`}),(0,q.jsx)(`pre`,{id:x,className:`full-prompt__text`,tabIndex:0,role:`region`,"aria-label":`The full prompt`,"data-scroller":``,children:y})]})]})}function lP({label:e,hint:t,value:n,onChange:r}){let i=(0,v.useId)();return(0,q.jsxs)(gf,{className:`field-text field-text--area`,value:n,onChange:r,maxLength:UA,"aria-describedby":`${i}-hint ${i}-count`,children:[(0,q.jsx)(Ai,{children:e}),(0,q.jsx)(mf,{rows:4,spellCheck:!0}),(0,q.jsx)(`span`,{className:`note`,id:`${i}-hint`,children:t}),(0,q.jsxs)(`span`,{className:`note counter`,id:`${i}-count`,children:[n.length.toLocaleString(`en-GB`),` of `,UA.toLocaleString(`en-GB`),` characters`]})]})}var uP=[`connections list`,`connections test`,`dossiers list`,`dossiers show`,`dossiers check`,`audit stats`,`audit list`],dP=[`connections add`,`connections login`,`connections default`,`connections writes`,`connections remove`,`dossiers init`,`dossiers add-repo`,`dossiers link`,`dossiers field`,`dossiers person`,`dossiers wip-limit`,`dossiers onboard`,`dossiers describe`];[...uP,...dP];function fP(e){if(e.definedIn)return e.definedIn===`env`;let t=Object.values(e.values);return t.length>0&&t.every(e=>e===`env`||e===`ci`)}function pP(e){return`TOIL_CONN_${e.toUpperCase().replace(/-/g,`_`)}_`}function mP(e,t){let n=t.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1_$2`).toUpperCase();return`${pP(e)}${n}`}function hP(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}var gP={env:`env var`,ci:`CI variable`,file:`config file`,store:`credential store`,defaults:`area defaults`};function _P(e){return e.ok?{ok:!0,data:e.data,warnings:(e.meta.warnings??[]).map(e=>e.message)}:{ok:!1,message:`${e.error.message}${e.error.fix?` ${e.error.fix}`:``}`}}function vP({config:e,at:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(async()=>{try{r(_P(await e.run(`connections list`,{})))}catch(e){r({ok:!1,message:e instanceof Error?e.message:String(e)})}},[e]);if((0,v.useEffect)(()=>{o(),e.areas().then(a,()=>a([]))},[e,o]),ZS(t?`conn-${t}`:null,!!n),!n)return(0,q.jsx)(`p`,{className:`skin-loading`,children:`Reading your connections with toil connections list…`});if(!n.ok)return(0,q.jsx)(`div`,{role:`alert`,className:`failure`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`code`,{children:`toil connections list`}),` failed: `,n.message]})});let{data:s}=n;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`conn-list`,children:[(0,q.jsx)(`h2`,{id:`conn-list`,children:`Your connections`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`From `,(0,q.jsx)(`code`,{children:`toil connections list`}),`. Changes are written to `,(0,q.jsx)(wS,{value:s.configFile,what:`config file path`}),`. `,(0,q.jsx)(YS,{topic:`connections`})]}),t&&!s.connections.some(e=>e.name===t)&&(0,q.jsxs)(`p`,{role:`status`,className:`failure`,children:[`toil has no connection named `,(0,q.jsx)(`code`,{children:t}),`. It may have been removed or renamed; add it again below.`]}),s.connections.length===0?(0,q.jsx)(`p`,{children:`toil has no connections yet. Add one below.`}):(0,q.jsx)(vS,{min:`lg`,className:`conn-cards`,children:s.connections.map(t=>(0,q.jsx)(`li`,{children:(0,q.jsx)(yP,{connection:t,areas:i??[],config:e,configFile:s.configFile,onChanged:o})},t.name))})]}),(0,q.jsx)(wP,{areas:i,config:e,onChanged:o})]})}function yP({connection:e,areas:t,config:n,configFile:r,onChanged:i}){let[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d=fP(e),f=`conn-${e.name}`,p=t.find(t=>t.name===e.area)?.connection.filter(e=>e.secret)??[],m=async()=>{u(!0),c(null);try{let t=await n.run(`connections test`,{name:e.name}),r=t.ok?t.data:null,i=r?r.live?`${e.name} answered ${r.request??`its check`}${r.authenticated?`, so its credential works.`:`, but that read needs no credential, so it shows only that the host answers.`}`:`toil has no live check for ${e.area} connections, so nothing was sent; the settings are complete and the secret was read.`:``;c(uA(t,i))}catch(e){c(dA(e))}finally{u(!1)}},h=e=>o(t=>t===e?null:e),g=async(e,t)=>{let n=uA(e,t);return n.ok&&await i(),n};return(0,q.jsxs)(Q,{className:`conn-card`,"aria-labelledby":f,children:[(0,q.jsxs)(`div`,{className:`conn-head`,children:[(0,q.jsx)(`h3`,{id:f,tabIndex:-1,children:(0,q.jsx)(`code`,{children:e.name})}),(0,q.jsxs)(`ul`,{className:`conn-tags`,"aria-label":`About this connection`,children:[(0,q.jsx)(`li`,{className:`tag`,children:e.area}),e.isDefault&&(0,q.jsxs)(`li`,{className:`tag tag--accent`,children:[e.area,`'s default`]}),(0,q.jsxs)(`li`,{className:`tag ${e.writes?`tag--warn`:``}`,children:[`Writes `,e.writes?`on`:`off`]}),d&&(0,q.jsx)(`li`,{className:`tag`,children:`Set by env vars`})]})]}),(0,q.jsxs)(`dl`,{className:`facts`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:`Host`}),(0,q.jsx)(`dd`,{children:e.host??`None set`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:`Values from`}),(0,q.jsx)(`dd`,{children:Object.keys(e.values).length===0?`Nothing beyond its area`:Object.entries(e.values).map(([e,t])=>`${e}: ${gP[t]??t}`).join(`, `)})]})]}),d&&(0,q.jsxs)(`p`,{className:`note`,children:[`Made by env vars alone (`,(0,q.jsxs)(`code`,{children:[pP(e.name),`*`]}),`, or `,e.area,`'s own `,(0,q.jsxs)(`code`,{children:[`TOIL_`,e.area.toUpperCase().replace(/-/g,`_`),`_*`]}),` and CI variables), not by `,(0,q.jsx)(`code`,{children:r}),`. toil's commands can't change a variable, so this connection is read-only here: change the variables where they're set. Testing it changes nothing.`]}),(0,q.jsxs)(`div`,{className:`conn-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:m,disabled:l,"aria-describedby":`${f}-test`,children:l?`Testing…`:`Test`}),!d&&(0,q.jsxs)(q.Fragment,{children:[!e.isDefault&&(0,q.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":a==="default",onClick:()=>h(`default`),children:`Make default`}),(0,q.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":a===`writes`,onClick:()=>h(`writes`),children:e.writes?`Turn writes off`:`Turn writes on`}),p.length>0&&(0,q.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":a===`login`,onClick:()=>h(`login`),children:`Replace secret`}),(0,q.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":a===`remove`,onClick:()=>h(`remove`),children:`Remove`})]})]}),(0,q.jsxs)(`p`,{id:`${f}-test`,className:`note`,children:[`Test sends `,e.area,`'s one cheap authenticated read, as a real command would (`,(0,q.jsx)(`code`,{children:pA(`connections test`,[e.name])}),`), and changes nothing.`]}),(0,q.jsx)(fA,{outcome:s}),a==="default"&&(0,q.jsx)(mA,{title:`Make ${e.name} the ${e.area} default`,explain:`${e.area} commands use it when a call names no connection and its dossier names none. The previous default stays as it is, just no longer the default.`,runs:pA(`connections default`,[e.name]),submit:`Make default`,disabled:n.disabled,onSubmit:async()=>g(await n.run(`connections default`,{name:e.name}),`${e.name} is now the ${e.area} default.`)}),a===`writes`&&(0,q.jsx)(bP,{connection:e,config:n,after:g}),a===`login`&&(0,q.jsx)(xP,{connection:e,fields:p,config:n,after:g}),a===`remove`&&(0,q.jsx)(mA,{title:`Remove ${e.name}`,explain:`Takes ${e.name} out of ${r} and deletes its secrets from the OS credential store, unless another connection uses them. A dossier that names it then fails until it names another. This can't be undone here: adding it again means typing its secret again.`,runs:pA(`connections remove`,[e.name]),submit:`Remove ${e.name}`,danger:!0,disabled:n.disabled,onSubmit:async()=>g(await n.run(`connections remove`,{name:e.name}),`${e.name} was removed.`)})]})}function bP({connection:e,config:t,after:n}){let[r,i]=(0,v.useState)(``);return e.writes?(0,q.jsx)(mA,{title:`Turn writes off for ${e.name}`,explain:`Commands can no longer change anything in ${e.area} through ${e.name}, even with --allow-write. Reads carry on as before.`,runs:pA(`connections writes`,[e.name,`off`]),submit:`Turn writes off`,disabled:t.disabled,onSubmit:async()=>n(await t.run(`connections writes`,{name:e.name,state:`off`}),`Writes are off for ${e.name}.`)}):(0,q.jsx)(mA,{title:`Turn writes on for ${e.name}`,explain:(0,q.jsxs)(q.Fragment,{children:[`Writes let commands change data in `,e.area,` through `,e.name,` when a call also passes `,(0,q.jsx)(`code`,{children:`--allow-write`}),`. Toil UI itself never writes to `,e.area,`: its proposals are commands for you to run. toil asks you to type the connection's name to turn writes on, here as on the terminal, and turns them on only if it matches.`]}),runs:pA(`connections writes`,[e.name,`on`]),submit:`Turn writes on`,danger:!0,disabled:t.disabled,onSubmit:async()=>{let a=r;return i(``),n(await t.run(`connections writes`,{name:e.name,state:`on`},{answers:{"confirm-name":a}}),`Writes are on for ${e.name}.`)},children:(0,q.jsx)(hA,{label:`Type ${e.name} to turn them on`,value:r,onChange:i,required:!0})})}function xP({connection:e,fields:t,config:n,after:r}){let[i,a]=(0,v.useState)({}),o=SP(),s=t=>e.values[t.name]===`store`||e.values[t.name]===`file`,c=e=>({password:e.password,empty:s(e)?`keep`:`skip`});return(0,q.jsx)(mA,{title:`Replace ${e.name}'s secret`,explain:`Stores what you type in the OS credential store, reads it back to check, and only then points ${e.name} at it and deletes the old one. A field left empty keeps its secret as it is. Toil UI doesn't keep what you type: it goes to toil in one request, and the fields are cleared.`,runs:pA(`connections login`,[e.name]),submit:`Save to the credential store`,disabled:n.disabled,onSubmit:async()=>{let s=o.refusal(t.map(e=>[e.name,i[e.name]??``,c(e)]));if(s)return s;let l=Object.fromEntries(t.map(e=>[e.name,i[e.name]??``])),u=o.answers();return a({}),o.reset(),r(await n.run(`connections login`,{name:e.name},{secrets:l,answers:u}),`${e.name}'s secret was replaced in the credential store.`)},children:t.map(e=>(0,q.jsx)(SA,{label:`${e.name}${e.description?` (${e.description})`:``}`,value:i[e.name]??``,onChange:t=>{a(n=>({...n,[e.name]:t})),o.changed(e.name)},rules:c(e),asking:o.asking,kept:o.kept(e.name),onKeep:()=>o.keep(e.name)},e.name))})}function SP(){let[e,t]=(0,v.useState)({}),[n,r]=(0,v.useState)(!1);return{asking:n,kept:t=>e[t]===!0,keep:e=>t(t=>({...t,[e]:!0})),changed:e=>t(t=>t[e]?{...t,[e]:!1}:t),reset:()=>{t({}),r(!1)},refusal:t=>{for(let[n,i,a]of t){let t=xA(n,cA(i,a),e[n]===!0);if(t)return r(!0),t}return null},answers:()=>Object.fromEntries(Object.keys(e).filter(t=>e[t]).map(e=>[`unwrap:${e}`,`n`]))}}var CP=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;function wP({areas:e,config:t,onChanged:n}){let r=(e??[]).filter(e=>e.connection.length>0);return e===null?null:r.length===0?(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`conn-add`,children:[(0,q.jsx)(`h2`,{id:`conn-add`,children:`Add a connection`}),(0,q.jsxs)(`p`,{children:[`The toil this server runs doesn't say what each area's connection holds, so the page can't ask for it. Add one with `,(0,q.jsx)(`code`,{children:`toil connections add`}),` in a terminal.`]})]}):(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`conn-add`,children:[(0,q.jsx)(`h2`,{id:`conn-add`,children:`Add a connection`}),(0,q.jsx)(TP,{areas:r,config:t,onAdded:n})]})}function TP({areas:e,config:t,onAdded:n,area:r,suggest:i,title:a=`A new connection`}){let o=e.filter(e=>e.connection.length>0&&(r===void 0||e.name===r)),[s,c]=(0,v.useState)(i?.name??``),[l,u]=(0,v.useState)(r??``),[d,f]=(0,v.useState)(i?.values??{}),[p,m]=(0,v.useState)({}),h=SP(),g=e=>({password:e.password,empty:e.required?`required`:`skip`,envVars:[`${mP(s||`<name>`,`area`)}=${_?.name??`<area>`}`,...y.map(e=>mP(s||`<name>`,e.name))]}),_=o.find(e=>e.name===l)??o[0],y=_?.connection??[],b=y.filter(e=>!e.secret),x=b.filter(e=>e.required),S=b.filter(e=>!e.required),C=y.filter(e=>e.secret),w=e=>`${e.name}${e.description?` (${e.description})`:``}`;if(!_)return(0,q.jsxs)(`p`,{className:`note`,children:[`The toil this server runs doesn't say what a `,r,` connection holds. Add one with `,(0,q.jsx)(`code`,{children:`toil connections add`}),` in a terminal.`]});let T=[`area ${_.name}`,...b.filter(e=>(d[e.name]??``)!==``).map(e=>`${e.name} ${d[e.name]}`),...C.filter(e=>(p[e.name]??``)!==``).map(e=>`${e.name} to the OS credential store`)].join(`, `);return(0,q.jsxs)(mA,{title:a,explain:(0,q.jsxs)(q.Fragment,{children:[`Asks for what `,(0,q.jsx)(`code`,{children:`toil connections add`}),` asks on a terminal. The settings go into your config file and each secret into the OS credential store, never the file. The first connection to an area becomes its default. Writes start off.`]}),runs:pA(`connections add`,[s||`<name>`,`--area`,_.name]),submit:`Save connection`,disabled:t.disabled,onSubmit:async()=>{if(!CP.test(s))return{ok:!1,message:`"${s}" isn't a valid connection name.`,fix:`Use lowercase letters, digits and single hyphens, starting with a letter, e.g. corp-jira.`};let e={confirm:`y`};for(let t of b)e[`setting:${t.name}`]=d[t.name]??``;let r=h.refusal(C.map(e=>[e.name,p[e.name]??``,g(e)]));if(r)return r;Object.assign(e,h.answers());let i=Object.fromEntries(C.map(e=>[e.name,p[e.name]??``]));m({}),h.reset();let a=uA(await t.run(`connections add`,{name:s,area:_.name},{answers:e,secrets:i}),`${s} was added.`);return a.ok&&(c(``),f({}),await n(s)),a},children:[(0,q.jsx)(hA,{label:`Name`,value:s,onChange:c,required:!0,hint:`Lowercase letters, digits and single hyphens, e.g. corp-jira.`}),r===void 0&&(0,q.jsx)(_A,{label:`Area`,value:_.name,onChange:e=>{u(e),f({}),m({}),h.reset()},options:o.map(e=>({value:e.name,label:e.name})),hint:_.description}),x.map(e=>(0,q.jsx)(hA,{label:w(e),value:d[e.name]??``,onChange:t=>f(n=>({...n,[e.name]:t})),required:!0,placeholder:e.default??void 0},e.name)),C.map(e=>(0,q.jsx)(SA,{label:`${w(e)}${e.password?`, a password`:``}`,value:p[e.name]??``,onChange:t=>{m(n=>({...n,[e.name]:t})),h.changed(e.name)},rules:g(e),asking:h.asking,kept:h.kept(e.name),onKeep:()=>h.keep(e.name),hint:`Goes to the OS credential store; never shown again, and never in the config file.`},e.name)),S.length>0&&(0,q.jsxs)(`details`,{className:`more`,children:[(0,q.jsxs)(`summary`,{children:[`Optional settings (`,S.length,`)`]}),S.map(e=>(0,q.jsx)(hA,{label:w(e),value:d[e.name]??``,onChange:t=>f(n=>({...n,[e.name]:t})),placeholder:e.default??void 0,hint:e.default?`Left empty, it stays ${e.default}.`:void 0},e.name))]}),(0,q.jsxs)(`p`,{className:`note`,children:[`Saves: `,T,`.`]})]})}var EP={matched:`Ready`,default:`Ready (your default)`,created:`Added`,pinned:`Pinned in your copy`,missing:`No connection yet`,ambiguous:`Several fit: pick one`},DP=e=>`host`in e?`host ${e.host}`:`connection`in e?`connection ${e.connection}`:`your default`;function OP(e){return e.ok?{ok:!0,plan:e.data,warnings:(e.meta.warnings??[]).map(e=>e.message)}:{ok:!1,message:e.error.message,fix:e.error.fix??null}}function kP({config:e,areas:t,onChanged:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d={...r.trim()?{cwd:r.trim()}:{},...a.trim()?{dossier:a.trim()}:{}},f=async(t={})=>{u(!0);try{let n=OP(await e.run(`dossiers onboard`,{...d,plan:!0,...t}));return c(n),n}catch(e){let t={ok:!1,message:dA(e).message,fix:null};return c(t),t}finally{u(!1)}},p=e=>{e.preventDefault(),l||f()},m=[...d.dossier?[d.dossier]:[],...d.cwd?[`--cwd`,d.cwd]:[],`--plan`];return(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`repo-setup`,children:[(0,q.jsx)(`h2`,{id:`repo-setup`,children:`Set up this repo`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`For a repository with a dossier checked in, through `,(0,q.jsx)(`code`,{children:`toil dossiers onboard`}),`, which on a terminal asks for each missing connection itself. `,(0,q.jsx)(YS,{topic:`repo-setup`})]}),(0,q.jsxs)(`form`,{className:`change`,"aria-labelledby":`repo-setup-form`,onSubmit:p,noValidate:!0,children:[(0,q.jsx)(`h3`,{id:`repo-setup-form`,children:`Check a repository`}),(0,q.jsx)(hA,{label:`Repository folder`,value:r,onChange:i,hint:`A folder in the clone. Left empty, the folder Toil UI was started in.`}),(0,q.jsx)(hA,{label:`Dossier`,value:a,onChange:o,hint:`Left empty, the one the folder resolves to.`}),(0,q.jsxs)(`p`,{className:`runs`,children:[`Runs `,(0,q.jsx)(`code`,{children:pA(`dossiers onboard`,m)}),`, which reads your config and dossiers and sends one test read per connection. It changes nothing.`]}),(0,q.jsx)(`div`,{className:`change-actions`,children:(0,q.jsx)(`button`,{type:`submit`,className:`btn btn--accent`,disabled:l,"aria-busy":l||void 0,children:l?`Checking…`:`Check this repo`})})]}),s&&!s.ok&&(0,q.jsx)(fA,{outcome:{ok:!1,message:s.message,fix:s.fix}}),s?.ok&&(0,q.jsx)(AP,{loadedPlan:s,areas:t,config:e,rerun:f,onChanged:n})]})}function AP({loadedPlan:e,areas:t,config:n,rerun:r,onChanged:i}){let{plan:a,warnings:o}=e,s=a.areas.filter(e=>e.connection!==null&&e.test?.ok).length,c=a.ok?{ok:!0,message:`${a.dossier.name} is set up: every area has a connection and read successfully.`,warnings:o}:{ok:!1,message:`${a.dossier.name}: ${s} of ${a.areas.length} area${a.areas.length===1?``:`s`} ready.`,fix:a.check.ok?null:`dossiers check found problems, listed below.`},l=a.areas.filter(e=>e.status===`missing`),u=a.areas.filter(e=>e.status===`ambiguous`);return(0,q.jsxs)(gS,{gap:`sm`,className:`shown`,children:[(0,q.jsxs)(`p`,{className:`note`,children:[(0,q.jsx)(wS,{value:a.dossier.file,what:`${a.dossier.name}'s file path`}),` (`,a.dossier.source,`)`,a.ownCopy&&(0,q.jsxs)(q.Fragment,{children:[`; your own copy, `,(0,q.jsx)(wS,{value:a.ownCopy,what:`your copy's file path`}),`, applies`]})]}),(0,q.jsx)(fA,{outcome:c}),(0,q.jsx)(xS,{label:`What ${a.dossier.name}'s areas use`,caption:`What ${a.dossier.name}'s areas use`,rows:a.areas,rowKey:e=>e.path,columns:[{header:`Area`,label:`Area`,rowHeader:!0,cell:e=>e.path},{header:`Selects`,label:`Selects`,cell:e=>(0,q.jsx)(`span`,{className:`any-break`,children:DP(e.selects)})},{header:`Status`,label:`Status`,cell:e=>(0,q.jsx)(`span`,{className:e.status===`missing`||e.status===`ambiguous`?`failure`:void 0,children:EP[e.status]})},{header:`Connection`,label:`Connection`,cell:e=>e.connection??(e.candidates?e.candidates.join(`, `):`–`)},{header:`Test read`,label:`Test read`,cell:e=>e.test===null?`–`:e.test.ok?(0,q.jsx)(`span`,{className:`any-break`,children:e.test.request??`settings and secret only`}):(0,q.jsx)(`span`,{className:`failure`,children:e.test.error?.message})}]}),a.check.problems.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`h4`,{className:`shown-repos`,children:`dossiers check`}),(0,q.jsx)(`ul`,{className:`plain`,children:a.check.problems.map((e,t)=>(0,q.jsxs)(`li`,{className:e.level===`error`?`failure`:`note`,children:[e.level,`: `,(0,q.jsx)(`code`,{children:e.path}),` `,e.message]},t))})]}),l.map(e=>{let a=`host`in e.selects?e.selects.host:void 0;return(0,q.jsx)(TP,{areas:t,config:n,area:e.area,title:`Add a ${e.area} connection${a?` on ${a}`:``}`,suggest:{...e.suggest?.name?{name:e.suggest.name}:{},...e.suggest?.baseUrl?{values:{baseUrl:e.suggest.baseUrl}}:{}},onAdded:async()=>{await r(),await i()}},e.path)}),u.map(e=>(0,q.jsx)(jP,{area:e,dossier:a.dossier.name,config:n,pin:t=>r({pin:[`${e.area}=${t}`]})},e.path))]})}function jP({area:e,dossier:t,config:n,pin:r}){let i=e.candidates??[],[a,o]=(0,v.useState)(i[0]??``);return(0,q.jsx)(mA,{title:`Pick the ${e.area} connection for ${t}`,explain:`Several of your ${e.area} connections fit ${e.path}. The one you pick is pinned in your own copy of ${t} (~/.toil/dossiers), which then applies wherever the shared one does. Your copy is yours, so writes may follow its bindings.`,runs:pA(`dossiers onboard`,[t,`--plan`,`--pin`,`${e.area}=${a||`<connection>`}`]),submit:`Pin it`,disabled:n.disabled,onSubmit:async()=>{let t=await r(a);return t.ok?{ok:!0,message:`${a} is pinned for ${e.area}.`,warnings:t.warnings}:{ok:!1,message:t.message,fix:t.fix}},children:(0,q.jsx)(_A,{label:`Connection`,value:a,onChange:o,options:i.map(e=>({value:e,label:e}))})})}var MP=e=>e.ok?{ok:!0,value:e.data}:{ok:!1,message:`${e.error.message}${e.error.fix?` ${e.error.fix}`:``}`},NP={sources:`dossier-form-sources`,repos:`dossier-form-repos`,fields:`dossier-form-fields`,people:`dossier-form-people`,wip:`dossier-form-wip`};function PP({config:e,at:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(t?.dossier??``);(0,v.useEffect)(()=>{t?.dossier&&l(t.dossier)},[t?.dossier]);let u=(0,v.useCallback)(async()=>{try{r(MP(await e.run(`dossiers list`,{})))}catch(e){r({ok:!1,message:e instanceof Error?e.message:String(e)})}},[e]);(0,v.useEffect)(()=>{u(),e.areas().then(a,()=>a([])),e.run(`connections list`,{}).then(e=>e.ok&&s(e.data.connections),()=>{})},[e,u]);let d=!!(t&&n?.ok&&n.value.dossiers.some(e=>e.name===t.dossier));if(ZS(t?d?NP[t.section??``]??`dossier-change`:`dossier-change`:null,!!n),!n)return(0,q.jsx)(`p`,{className:`skin-loading`,children:`Reading your dossiers with toil dossiers list…`});if(!n.ok)return(0,q.jsx)(`div`,{role:`alert`,className:`failure`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`code`,{children:`toil dossiers list`}),` failed: `,n.message]})});let f=n.value.dossiers,p=f.find(e=>e.name===c)?.name??f[0]?.name??``;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(kP,{config:e,areas:i,onChanged:u}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`dossier-list`,children:[(0,q.jsx)(`h2`,{id:`dossier-list`,children:`Your dossiers`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`From `,(0,q.jsx)(`code`,{children:`toil dossiers list`}),`; yours are in `,(0,q.jsx)(wS,{value:n.value.places.user,what:`folder path`}),`. `,(0,q.jsx)(YS,{topic:`dossier-list`})]}),f.length===0?(0,q.jsx)(`p`,{children:`toil sees no dossiers yet. Create one below.`}):(0,q.jsx)(vS,{min:`lg`,className:`conn-cards`,children:f.map(t=>(0,q.jsx)(`li`,{children:(0,q.jsx)(FP,{dossier:t,config:e})},t.file))})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`dossier-change`,children:[(0,q.jsx)(`h2`,{id:`dossier-change`,tabIndex:-1,children:`Create or change a dossier`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`Each form runs one `,(0,q.jsx)(`code`,{children:`toil dossiers`}),` command. `,(0,q.jsx)(YS,{topic:`dossier-setup`})]}),t&&n.ok&&!d&&(0,q.jsxs)(`p`,{role:`status`,className:`failure`,children:[`toil sees no dossier named `,(0,q.jsx)(`code`,{children:t.dossier}),`. It may have been removed or renamed; create it again below.`]}),(0,q.jsx)(LP,{config:e,onChanged:u}),f.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_A,{label:`Dossier to change`,value:p,onChange:l,options:f.map(e=>({value:e.name,label:`${e.name} (${e.source})`})),hint:`The forms below change this one.`}),(0,q.jsx)(RP,{config:e,dossier:p}),(0,q.jsx)(zP,{config:e,dossier:p,areas:i,connections:o}),(0,q.jsx)(HP,{config:e,dossier:p,areas:i}),(0,q.jsx)(BP,{config:e,dossier:p,areas:i}),(0,q.jsx)(VP,{config:e,dossier:p})]})]})]})}function FP({dossier:e,config:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),c=`dossier-card-${e.name}`;return(0,q.jsxs)(Q,{className:`conn-card`,"aria-labelledby":c,children:[(0,q.jsxs)(`div`,{className:`conn-head`,children:[(0,q.jsx)(`h3`,{id:c,children:(0,q.jsx)(`code`,{children:e.name})}),(0,q.jsxs)(`ul`,{className:`conn-tags`,"aria-label":`About this dossier`,children:[(0,q.jsx)(`li`,{className:`tag`,children:e.source}),e.problems>0&&(0,q.jsxs)(`li`,{className:`tag tag--warn`,children:[e.problems,` problem`,e.problems===1?``:`s`]})]})]}),e.description&&(0,q.jsx)(`p`,{children:e.description}),(0,q.jsxs)(`p`,{className:`note`,children:[(0,q.jsx)(wS,{value:e.file,what:`${e.name}'s file path`}),e.shadowedBy&&(0,q.jsxs)(q.Fragment,{children:[` (a dossier of the same name in `,e.shadowedBy,` takes precedence)`]})]}),(0,q.jsxs)(_S,{className:`conn-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":n!==null,onClick:async()=>{if(n)return r(null);try{r(MP(await t.run(`dossiers show`,{dossier:e.name})))}catch(e){r({ok:!1,message:e instanceof Error?e.message:String(e)})}},children:n?`Hide`:`Show`}),(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:async()=>{a(null);try{let n=await t.run(`dossiers check`,{dossier:e.name}),r=n.ok?n.data:null;s(r?.problems??[]),a(r&&!r.ok?{ok:!1,message:`${e.name} has problems toil would refuse it for.`,fix:null}:uA(n,r?.problems.length?`${e.name} checks out, with ${r.problems.length} warning${r.problems.length===1?``:`s`}.`:`${e.name} checks out: no problems.`))}catch(e){a(dA(e))}},children:`Check`})]}),(0,q.jsx)(fA,{outcome:i}),o.length>0&&(0,q.jsx)(`ul`,{className:`plain`,children:o.map((e,t)=>(0,q.jsxs)(`li`,{className:e.level===`error`?`failure`:`note`,children:[e.level,`: `,(0,q.jsx)(`code`,{children:e.path}),` `,e.message]},t))}),n&&!n.ok&&(0,q.jsxs)(`p`,{role:`alert`,className:`failure`,children:[(0,q.jsxs)(`code`,{children:[`toil dossiers show `,e.name]}),` failed: `,n.message]}),n?.ok&&(0,q.jsx)(IP,{shown:n.value})]})}function IP({shown:e}){let t=Object.entries(e.areas),n=e.dossier.repos??[];return(0,q.jsxs)(gS,{className:`shown`,gap:`sm`,children:[(0,q.jsx)(xS,{label:`What ${e.name} gives each area`,caption:`What ${e.name} gives each area`,rows:t,rowKey:([e])=>e,columns:[{header:`Area`,label:`Area`,rowHeader:!0,cell:([e])=>e},{header:`Connection`,label:`Connection`,cell:([,e])=>e.error?(0,q.jsx)(`span`,{className:`failure`,children:e.error.message}):e.connection?`${e.connection.value} (${e.connection.source})`:`Your default`},{header:`Writes`,label:`Writes`,cell:([,e])=>e.writes===null?`–`:e.writes?`On`:`Off`},{header:`Inputs`,label:`Inputs`,cell:([,e])=>(0,q.jsxs)(q.Fragment,{children:[Object.entries(e.inputs).map(([e,t])=>`${e}=${t}`).join(`, `)||`None`,e.env&&(0,q.jsxs)(`span`,{className:`note`,children:[` (environment `,e.env,`)`]})]})}]}),(0,q.jsx)(`h4`,{className:`shown-repos`,children:`People`}),e.dossier.people?.length?(0,q.jsx)(`ul`,{className:`plain`,children:e.dossier.people.map(e=>(0,q.jsxs)(`li`,{className:`any-break`,children:[e.name,e.kind===`agent`&&` (agent)`,(0,q.jsxs)(`span`,{className:`note`,children:[` `,Object.entries(e.ids??{}).map(([e,t])=>`${e} ${t}`).join(`, `)||`no identities yet`,e.email&&`; email ${e.email}`]})]},e.name))}):(0,q.jsx)(`p`,{className:`note`,children:`None yet.`}),(0,q.jsxs)(`p`,{className:`note`,children:[`Work-in-progress limit: `,e.dossier.wipLimit===void 0?`none set`:`${e.dossier.wipLimit} per person`,`.`]}),(0,q.jsx)(`h4`,{className:`shown-repos`,children:`Repositories`}),n.length?(0,q.jsx)(`ul`,{className:`plain`,children:n.map(e=>(0,q.jsxs)(`li`,{children:[e.name,e.remotes[0]&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(TS,{value:e.remotes[0],what:`${e.name}'s remote URL`})]})]},e.name))}):(0,q.jsx)(`p`,{className:`note`,children:`None yet.`})]})}function LP({config:e,onChanged:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``);return(0,q.jsxs)(mA,{title:`Create a dossier`,explain:`Makes an empty dossier for one body of work in your own folder (~/.toil/dossiers/<name>.json). Add its repositories and areas with the forms below. It refuses a name you already have.`,runs:pA(`dossiers init`,[n||`<name>`,...i?[`--description`,`…`]:[]]),submit:`Create dossier`,disabled:e.disabled,onSubmit:async()=>{let o=uA(await e.run(`dossiers init`,{name:n,...i?{description:i}:{}}),`${n} was created.`);return o.ok&&(r(``),a(``),await t()),o},children:[(0,q.jsx)(hA,{label:`Name`,value:n,onChange:r,required:!0,hint:`Lowercase letters, digits and single hyphens, e.g. payments.`}),(0,q.jsx)(hA,{label:`Description`,value:i,onChange:a,hint:`One line saying what the body of work is.`})]})}function RP({config:e,dossier:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1);return(0,q.jsxs)(mA,{titleId:`dossier-form-repos`,title:`Add a repository to ${t}`,explain:`Records a repository by its remote URL, or by a folder on this machine (its git root and origin remote). Any credential in a remote is left out of the file. toil then picks this dossier for calls made in that repository.`,runs:pA(`dossiers add-repo`,[t,n||`<folder|remote>`,...i?[`--name`,i]:[],...o?[`--replace`]:[]]),submit:`Add repository`,disabled:e.disabled,onSubmit:async()=>uA(await e.run(`dossiers add-repo`,{dossier:t,location:n,...i?{name:i}:{},...o?{replace:o}:{}}),`The repository was added to ${t}.`),children:[(0,q.jsx)(hA,{label:`Folder or remote URL`,value:n,onChange:r,required:!0,hint:(0,q.jsxs)(q.Fragment,{children:[`e.g. `,(0,q.jsx)(`span`,{className:`any-break`,children:`https://git.imagile.dev/pay/payments-api.git`})]})}),(0,q.jsx)(hA,{label:`Name in the dossier`,value:i,onChange:a,hint:`Defaults to the folder's or remote's last part.`}),(0,q.jsx)(vA,{label:`Replace a repository of that name`,checked:o,onChange:s})]})}function zP({config:e,dossier:t,areas:n,connections:r}){let[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),m=n.map(e=>e.name),h=m.includes(i)?i:m.includes(`jira`)?`jira`:m[0]??``,g=r.filter(e=>e.area===h),_=[t,h,...o?[`--connection`,o]:[],...hP(c).flatMap(e=>[`--set`,e]),...hP(u).flatMap(e=>[`--add`,e]),...f?[`--replace`]:[]];return(0,q.jsxs)(mA,{titleId:`dossier-form-sources`,title:`Link an area to ${t}`,explain:`Attaches an area to the dossier: which of your connections its calls use (or your default), the keys it supplies to every call (project=PAY), and reference data lists (projects=FEES). toil refuses, from here, a link that would point the dossier at a connection with writes on: a person makes that one with toil dossiers link in a terminal.`,runs:pA(`dossiers link`,_),submit:`Link area`,disabled:e.disabled,onSubmit:async()=>uA(await e.run(`dossiers link`,{dossier:t,area:h,...o?{connection:o}:{},...hP(c).length?{set:hP(c)}:{},...hP(u).length?{add:hP(u)}:{},...f?{replace:f}:{}}),`${h} was linked to ${t}.`),children:[(0,q.jsx)(_A,{label:`Area`,value:h,onChange:e=>(a(e),s(``)),options:m.map(e=>({value:e,label:e}))}),(0,q.jsx)(_A,{label:`Connection`,value:o,onChange:s,options:[{value:``,label:`Your ${h} default`},...g.map(e=>({value:e.name,label:`${e.name}${e.writes?` (writes on)`:``}`}))]}),(0,q.jsx)(gA,{label:`Keys to set, one key=value per line`,value:c,onChange:l,hint:`The area's context inputs (project=PAY, owner=imagile) are applied to calls; any other key is kept as reference data.`}),(0,q.jsx)(gA,{label:`Values to add to lists, one key=value per line`,value:u,onChange:d,hint:`e.g. projects=FEES`}),(0,q.jsx)(vA,{label:`Replace values already set`,checked:f,onChange:p})]})}function BP({config:e,dossier:t,areas:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(`human`),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),p=hP(a),m=[t,r?/\s/.test(r)?`"${r}"`:r:`<name>`,...p.flatMap(e=>[`--id`,e]),...s===`agent`?[`--kind`,`agent`]:[],...l?[`--email`,l]:[],...d?[`--replace`]:[]];return(0,q.jsxs)(mA,{titleId:`dossier-form-people`,title:`Add a person to ${t}`,explain:(0,q.jsxs)(q.Fragment,{children:[`Says who someone is in each system, so the People view gathers their work from all of them: one area=identity per line, the user name, login or email that system shows. An agent is a person of kind agent. Their email is only compared, to suggest which accounts are theirs. Removing a person or an identity is a delete, made in a terminal with `,(0,q.jsxs)(`code`,{children:[`toil dossiers person `,t,` <name> --remove`]}),`.`]}),runs:pA(`dossiers person`,m),submit:`Add person`,disabled:e.disabled,onSubmit:async()=>{let n=uA(await e.run(`dossiers person`,{dossier:t,name:r,...p.length?{id:p}:{},...s===`agent`?{kind:s}:{},...l?{email:l}:{},...d?{replace:d}:{}}),`${r} is in ${t}'s people.`);return n.ok&&(i(``),o(``),u(``)),n},children:[(0,q.jsx)(hA,{label:`Name`,value:r,onChange:i,required:!0,hint:`As the team writes it, e.g. Pat Example.`}),(0,q.jsx)(gA,{label:`Identities, one area=identity per line`,value:a,onChange:o,hint:(0,q.jsxs)(q.Fragment,{children:[`e.g. jira=pat and github=pat-ex. Areas: `,n.map(e=>e.name).join(`, `)||`the ones toil has`,`.`]})}),(0,q.jsx)(_A,{label:`Kind`,value:s,onChange:e=>c(e===`agent`?`agent`:`human`),options:[{value:`human`,label:`Person`},{value:`agent`,label:`Agent`}]}),(0,q.jsx)(hA,{label:`Email`,value:l,onChange:u,hint:`Optional, e.g. you@example.com. Compared only, to suggest matches.`}),(0,q.jsx)(vA,{label:`Replace an identity, kind or email already set`,checked:d,onChange:f})]})}function VP({config:e,dossier:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),o=Number(n);return(0,q.jsxs)(mA,{titleId:`dossier-form-wip`,title:`Set ${t}'s work-in-progress limit`,explain:(0,q.jsxs)(q.Fragment,{children:[`How many items one person may have in progress at once, as the team agreed. The People view counts each person's work in progress against it, and names nobody else's. Clearing it is a delete, made in a terminal with `,(0,q.jsxs)(`code`,{children:[`toil dossiers wip-limit `,t,` --clear`]}),`.`]}),runs:pA(`dossiers wip-limit`,[t,n||`<limit>`,...i?[`--replace`]:[]]),submit:`Set limit`,disabled:e.disabled,onSubmit:async()=>!Number.isInteger(o)||o<1?{ok:!1,message:`The limit must be a whole number above 0.`,fix:`Type a number such as 3.`}:uA(await e.run(`dossiers wip-limit`,{dossier:t,limit:o,...i?{replace:i}:{}}),`${t}'s limit is ${o} per person.`),children:[(0,q.jsx)(hA,{label:`Limit`,value:n,onChange:r,required:!0,hint:`A whole number, e.g. 3.`}),(0,q.jsx)(vA,{label:`Replace a limit already set`,checked:i,onChange:a})]})}function HP({config:e,dossier:t,areas:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),d=n.map(e=>e.name),f=d.includes(r)?r:d.includes(`jira`)?`jira`:d[0]??``;return(0,q.jsxs)(mA,{titleId:`dossier-form-fields`,title:`Name a field in ${t}`,explain:`Gives one of the area's fields a friendly name in this dossier (storyPoints for customfield_10002), so commands and Toil UI's work items use the name. The OWI fields estimate, priority, type, team and dueDate are pointed at a team's own field the same way.`,runs:pA(`dossiers field`,[t,f,a||`<alias>`,s||`<field-id>`,...l?[`--replace`]:[]]),submit:`Name field`,disabled:e.disabled,onSubmit:async()=>uA(await e.run(`dossiers field`,{dossier:t,area:f,alias:a,id:s,...l?{replace:l}:{}}),`${a} now names ${s} in ${t}.`),children:[(0,q.jsx)(_A,{label:`Area`,value:f,onChange:i,options:d.map(e=>({value:e,label:e}))}),(0,q.jsx)(hA,{label:`Alias`,value:a,onChange:o,required:!0,hint:`A camelCase name, e.g. storyPoints or estimate.`}),(0,q.jsx)(hA,{label:`Field id`,value:s,onChange:c,required:!0,hint:`The service's own id, e.g. customfield_10002.`}),(0,q.jsx)(vA,{label:`Point an existing alias at this field`,checked:l,onChange:u})]})}var UP=e=>e%1e3==0?`${e/1e3} s`:`${e} ms`;function WP({config:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null);if((0,v.useEffect)(()=>{e.run(`connections list`,{}).then(e=>{if(!e.ok)return c(e.error.message);n(e.data.configFile),i(e.meta.warnings?.find(e=>e.code===`BOUND_RELAXED`)?.message??null)},e=>c(e instanceof Error?e.message:String(e))),e.settings().then(o,e=>c(e instanceof Error?e.message:String(e)))},[e]),s)return(0,q.jsx)(`div`,{role:`alert`,className:`failure`,children:(0,q.jsxs)(`p`,{children:[`The settings didn't load: `,s]})});if(!t||!a)return(0,q.jsx)(`p`,{className:`skin-loading`,children:`Reading toil's settings…`});let l=a.timeout;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`lede`,children:[`Shown as toil reports them, with where each is set. `,(0,q.jsx)(YS,{topic:`bounds`})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`bounds`,children:[(0,q.jsx)(`h2`,{id:`bounds`,children:`Bounds`}),(0,q.jsxs)(`dl`,{className:`fields`,children:[(0,q.jsx)(`dt`,{children:`The file workspace`}),(0,q.jsx)(`dd`,{children:r?`Relaxed: commands may read and write files anywhere you can, except toil's own files.`:`Held: commands read and write files only inside the workspace.`}),(0,q.jsx)(`dt`,{children:`Set in`}),(0,q.jsxs)(`dd`,{children:[(0,q.jsx)(wS,{value:t,what:`config file path`}),`, as `,(0,q.jsxs)(`code`,{children:[`"bounds": `,`{`,` "files": "unbounded" `,`}`]})]})]}),r&&(0,q.jsxs)(`p`,{className:`note`,children:[`toil says: `,r]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`timeout`,children:[(0,q.jsx)(`h2`,{id:`timeout`,children:`Time limit`}),(0,q.jsxs)(`dl`,{className:`fields`,children:[(0,q.jsx)(`dt`,{children:`Each command stops after`}),(0,q.jsxs)(`dd`,{children:[UP(l.effectiveMs),l.effectiveMs===l.defaultMs?`, toil's default`:``]}),(0,q.jsx)(`dt`,{children:`Set by`}),(0,q.jsxs)(`dd`,{children:[(0,q.jsx)(`code`,{children:l.variable}),l.value===null?`, which is not set`:`=${l.value}`,`, in the environment `,(0,q.jsx)(`code`,{children:`toil-ui`}),` was started from`]})]}),(0,q.jsxs)(`p`,{className:`note`,children:[`Without the variable, a command that declares a longer limit (a scan, a report) gets its own. `,(0,q.jsx)(`code`,{children:`toil wait`}),` has its own `,(0,q.jsx)(`code`,{children:`--timeout`}),`, capped by `,(0,q.jsxs)(`code`,{children:[`"wait": `,`{`,` "maxTimeout" `,`}`]}),` in `,(0,q.jsx)(`code`,{children:t}),`. To change the limit, set `,l.variable,` and start `,(0,q.jsx)(`code`,{children:`toil-ui`}),` again.`]})]})]})}function GP(){let[e,t]=Bf(),n=Uf(),r=e===`reduced`;return(0,q.jsxs)(Q,{as:`section`,className:`panel motion-setting`,"aria-labelledby":`motion`,children:[(0,q.jsx)(`h2`,{id:`motion`,children:`Motion and effects`}),(0,q.jsxs)(`div`,{className:`theme-setting__row`,children:[(0,q.jsxs)(Ia,{className:`check`,isSelected:r,onChange:e=>t(e?`reduced`:`full`),children:[(0,q.jsx)(`span`,{className:`box`,"aria-hidden":`true`,children:r?`✓`:``}),`Reduce motion and effects`]}),(0,q.jsx)(YS,{topic:`motion`})]}),(0,q.jsx)(`p`,{className:`note`,children:r?`Nothing moves: no animations, particles or parallax. Saved in this browser only.`:n?`The themes' animations, particles and parallax are on, apart from any theme's particles switched off under Theme. Saved in this browser only.`:`Your system asks for reduced motion, so nothing moves whichever way this is set.`})]})}function KP(){let e=ex(),t=ix(),n=e.lexicon===void 0,r=e.voice===void 0,i=e.ambient?.particles,[a,o]=Jf(e.name),[s]=Bf(),c=Uf();return(0,q.jsxs)(Q,{as:`section`,className:`panel theme-setting`,"aria-labelledby":`theme-setting`,children:[(0,q.jsx)(`h2`,{id:`theme-setting`,children:`Theme`}),(0,q.jsx)(tT,{label:`Theme`,value:e.name,onChange:t.setTheme,options:sp.map(e=>({id:e.name,label:e.label}))}),(0,q.jsx)(`p`,{className:`note`,children:e.description}),(0,q.jsx)(`p`,{className:`note`,id:`theme-effects`,children:i?`Particles: ${i}, ${a?c?`on`:`off while motion is reduced`:`off`}.`:`Particles: none.`}),(0,q.jsxs)(`div`,{className:`theme-setting__row`,children:[(0,q.jsx)(qP,{label:`Themed wording`,on:t.wording&&!n,disabled:n,onChange:t.setWording,describedBy:`theme-none-note`}),(0,q.jsx)(YS,{topic:`themed-wording`})]}),(0,q.jsxs)(`div`,{className:`theme-setting__row`,children:[(0,q.jsx)(qP,{label:`Themed agent voice`,on:t.voice&&!r,disabled:r,onChange:t.setVoice,describedBy:`theme-none-note`}),(0,q.jsx)(YS,{topic:`themed-voice`})]}),i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(qP,{label:`Particles and ambient effects`,on:a,disabled:!1,onChange:o,describedBy:`theme-particles-note`}),(0,q.jsx)(`p`,{className:`note`,id:`theme-particles-note`,children:c?`${e.label}'s ${i} behind the page. Off removes the particles entirely; other animations keep following Motion and effects. Kept for ${e.label} only, so each theme has its own.`:`${s===`reduced`?`Reduce motion and effects is ticked below`:`Your system asks for reduced motion`}, so no particles show whichever way this is set. It's kept for ${e.label} for when motion is back.`})]}),(n||r)&&(0,q.jsx)(`p`,{className:`note theme-setting__plain`,id:`theme-none-note`,children:n&&r?`${e.label} has no wording or voice of its own, so both are off while it's chosen. Pick a game theme to use them.`:`${e.label} has no ${n?`wording`:`voice`} of its own, so that box is off while it's chosen.`}),(0,q.jsx)(`p`,{className:`note`,children:`Saved in this browser only. To ask for a new theme, send a feature request from Feedback.`})]})}function qP({label:e,on:t,disabled:n,onChange:r,describedBy:i}){return(0,q.jsxs)(Ia,{className:`check`,isSelected:t,isDisabled:n,onChange:r,"aria-describedby":i,children:[(0,q.jsx)(`span`,{className:`box`,"aria-hidden":`true`,children:t?`✓`:``}),e]})}var JP={days:{by:[`day`]},commands:{by:[`command`],unused:!0},doors:{by:[`via`,`caller`]}},YP=e=>({command:e,outcome:`failed`,limit:10});function XP(e,t,n){let r=new Map(e.map(e=>[e.day??``,e])),i=[],a=Date.parse(`${n}T00:00:00Z`);for(let e=Date.parse(`${t.slice(0,10)}T00:00:00Z`);e<=a&&i.length<400;e+=864e5){let t=new Date(e).toISOString().slice(0,10),n=r.get(t);i.push({day:t,calls:n?.calls??0,failed:n?.failed??0})}return i}function ZP(e,t){return e===`api`?t===`toil-ui`?`Toil UI`:t?`A program, ${t}`:`A program, unnamed`:e===`mcp`?`MCP`:e===`cli`?`The CLI`:e??`Unknown`}var QP=e=>e.filter(e=>e.failed>0).sort((e,t)=>t.failed-e.failed||t.calls-e.calls);function $P(e){let t=new Map;for(let n of e){let e=n.area??``;t.set(e,[...t.get(e)??[],n])}return[...t].sort((e,t)=>e[0]<t[0]?-1:1).map(([e,t])=>({area:e,commands:t}))}var eF=(e,t)=>t===0?`0%`:`${Math.round(e/t*100)}%`,tF=e=>e>=1e3?`${(e/1e3).toFixed(1)} s`:`${e} ms`,nF=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,rF=e=>e.ok?{ok:!0,data:e.data}:{ok:!1,message:`${e.error.message}${e.error.fix?` ${e.error.fix}`:``}`};async function iF(e,t,n){try{return rF(await e.run(t,n))}catch(e){return{ok:!1,message:e instanceof Error?e.message:String(e)}}}function aF({config:e,today:t=new Date().toISOString().slice(0,10)}){let[n,r]=(0,v.useState)(null);if((0,v.useEffect)(()=>{let t=!0,n=new Date().toISOString(),i=t=>iF(e,`audit stats`,{...t,until:n});return Promise.all([i(JP.days),i(JP.commands),i(JP.doors)]).then(([e,n,i])=>{t&&r({days:e,commands:n,doors:i})}),()=>{t=!1}},[e]),!n)return(0,q.jsx)(`p`,{className:`skin-loading`,children:`Reading toil's audit log with toil audit stats…`});let i=[n.days,n.commands,n.doors].find(e=>!e.ok);if(i||!n.days.ok||!n.commands.ok||!n.doors.ok)return(0,q.jsx)(`div`,{role:`alert`,className:`failure`,children:(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`code`,{children:`toil audit stats`}),` failed: `,i?.message]})});let a=n.days.data,o=n.commands.data,s=n.doors.data,c=o.totals,l=QP(o.groups).slice(0,8);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{as:`section`,className:`panel usage`,"aria-labelledby":`usage-totals`,children:[(0,q.jsx)(`h2`,{id:`usage-totals`,children:`Usage of toil`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`From `,(0,q.jsx)(`code`,{children:`toil audit stats`}),`, since `,Dm(o.window.since),`, UTC. `,(0,q.jsx)(YS,{topic:`audit`})]}),(0,q.jsxs)(`dl`,{className:`fields usage-totals`,children:[(0,q.jsx)(`dt`,{children:`Calls`}),(0,q.jsx)(`dd`,{children:c.calls}),(0,q.jsx)(`dt`,{children:`Failed`}),(0,q.jsxs)(`dd`,{children:[c.failed,` (`,eF(c.failed,c.calls),`)`]}),(0,q.jsx)(`dt`,{children:`Wrote`}),(0,q.jsxs)(`dd`,{children:[c.writes,` (`,eF(c.writes,c.calls),`)`]}),(0,q.jsx)(`dt`,{children:`Time per call`}),(0,q.jsxs)(`dd`,{children:[tF(c.durationMs.median),` median, `,tF(c.durationMs.p95),` at the 95th percentile`]})]}),c.calls===0&&(0,q.jsx)(`p`,{className:`note`,children:`No command has run in this window yet. Each call toil makes, from the CLI, MCP or Toil UI, adds a line.`}),(0,q.jsx)(uk,{days:XP(a.groups,a.window.since,a.window.until?new Date(Date.parse(a.window.until)-1).toISOString().slice(0,10):t)})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`usage-doors`,children:[(0,q.jsx)(`h2`,{id:`usage-doors`,children:`How toil was called`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`By front door: the CLI, MCP (an agent), or a program through toil's API, which Toil UI is. From `,(0,q.jsx)(`code`,{children:`toil audit stats --by via --by caller`}),`.`]}),(0,q.jsx)(xS,{label:`Calls by front door`,caption:`Calls by front door`,rows:s.groups,rowKey:e=>`${e.via}:${e.caller}`,columns:[{header:`Front door`,label:`Front door`,rowHeader:!0,cell:e=>ZP(e.via,e.caller)},{header:`Calls`,label:`Calls`,cell:e=>`${e.calls} (${eF(e.calls,s.totals.calls)})`},{header:`Failed`,label:`Failed`,cell:e=>e.failed}]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`usage-top`,children:[(0,q.jsx)(`h2`,{id:`usage-top`,children:`Used most`}),(0,q.jsx)(xS,{label:`Commands used most`,caption:`The commands called most`,rows:o.groups.slice(0,10),rowKey:e=>e.command??``,columns:[{header:`Command`,label:`Command`,rowHeader:!0,cell:e=>(0,q.jsx)(`code`,{children:e.command})},{header:`Calls`,label:`Calls`,cell:e=>e.calls},{header:`Failed`,label:`Failed`,cell:e=>e.failed},{header:`Median`,label:`Median`,cell:e=>tF(e.durationMs.median)},{header:`Last`,label:`Last called`,cell:e=>Om(e.lastSeen)}]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`usage-failing`,children:[(0,q.jsx)(`h2`,{id:`usage-failing`,children:`Failed most`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`Each with its top error code and the fix that usually applies. `,(0,q.jsx)(YS,{topic:`audit-failures`})]}),l.length===0?(0,q.jsx)(`p`,{children:`No command failed in this window.`}):(0,q.jsx)(`ul`,{className:`usage-failing`,children:l.map(t=>(0,q.jsx)(`li`,{children:(0,q.jsx)(oF,{group:t,config:e})},t.command))})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`usage-unused`,children:[(0,q.jsx)(`h2`,{id:`usage-unused`,children:`Not used`}),(0,q.jsx)(sF,{unused:o.unused??[]})]})]})}function oF({group:e,config:t}){let[n,r]=(0,v.useState)(null),i=(0,v.useId)(),a=e.errors[0],o=async()=>{if(n!==null&&n!==`loading`)return r(null);r(`loading`),r(await iF(t,`audit list`,YP(e.command??``)))};return(0,q.jsxs)(Q,{className:`usage-fail`,children:[(0,q.jsx)(`h3`,{children:(0,q.jsx)(`code`,{children:e.command})}),(0,q.jsxs)(`p`,{children:[`Failed `,e.failed,` of `,nF(e.calls,`call`),a?(0,q.jsxs)(q.Fragment,{children:[`, most often with `,(0,q.jsx)(`code`,{children:a.code}),` (`,a.count,`)`]}):null,`.`]}),a?.fix&&(0,q.jsxs)(`p`,{className:`note`,children:[`Usual fix: `,a.fix]}),e.errors.length>1&&(0,q.jsxs)(`p`,{className:`note`,children:[`Also:`,` `,e.errors.slice(1).map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0?`, `:``,(0,q.jsx)(`code`,{children:e.code}),` (`,e.count,`)`]},e.code))]}),(0,q.jsxs)(`div`,{className:`conn-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":n!==null,"aria-controls":i,onClick:()=>void o(),"data-usage-lines":``,children:n===null?`Show recent failures`:`Hide recent failures`}),(0,q.jsxs)(`span`,{className:`runs`,children:[`runs `,(0,q.jsxs)(`code`,{children:[`toil audit list --command "`,e.command,`" --outcome failed --limit 10`]})]})]}),(0,q.jsxs)(`div`,{id:i,children:[n===`loading`&&(0,q.jsx)(`p`,{className:`skin-loading`,children:`Reading the audit log…`}),n!==null&&n!==`loading`&&!n.ok&&(0,q.jsxs)(`p`,{role:`alert`,className:`failure`,children:[(0,q.jsx)(`code`,{children:`toil audit list`}),` failed: `,n.message]}),n!==null&&n!==`loading`&&n.ok&&(0,q.jsx)(xS,{label:`Recent failures of ${e.command}`,caption:`Recent failures of ${e.command}, newest first`,rows:n.data,rowKey:e=>`${e.time}:${e.via}:${e.outcome}`,columns:[{header:`When`,label:`When`,rowHeader:!0,cell:e=>Om(e.time)},{header:`Error`,label:`Error`,cell:e=>(0,q.jsx)(`code`,{children:e.outcome})},{header:`From`,label:`From`,cell:e=>ZP(e.via,e.caller)},{header:`Connection`,label:`Connection`,cell:e=>e.connection?(0,q.jsx)(`code`,{children:e.connection}):`none`},{header:`Took`,label:`Took`,cell:e=>tF(e.durationMs)}]})]})]})}function sF({unused:e}){if(e.length===0)return(0,q.jsx)(`p`,{children:`Every command toil has was called at least once in this window.`});let t=$P(e),n=e.filter(e=>!e.mcp).length;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`lede`,children:[nF(e.length,`command`),` had no call in this window, from `,(0,q.jsx)(`code`,{children:`toil audit stats --unused`}),`. A command no agent reaches for may need a clearer description or skill page.`,` `,n>0&&(0,q.jsxs)(q.Fragment,{children:[n===1?`One of them is`:`${n} of them are`,` never served over MCP, so only a person on the CLI can run `,n===1?`it`:`them`,`.`]})]}),(0,q.jsxs)(`details`,{className:`more`,children:[(0,q.jsx)(`summary`,{children:`Show them, by area`}),(0,q.jsx)(`dl`,{className:`usage-unused`,children:t.map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:e.area===``?`toil's own`:e.area}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`ul`,{children:e.commands.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`code`,{children:e.command}),!e.mcp&&(0,q.jsx)(`span`,{className:`runs`,children:` (CLI only)`})]},e.command))})})]},e.area))})]})]})}var cF=e=>e.tokens===void 0?`not reported`:FC(e.tokens),lF=e=>e===void 0?`not reported`:FC(e);function uF(e,t){if(t===`copilot`)return e.premiumRequests===void 0?`premium requests not reported`:`${UC(e.premiumRequests,`premium-requests`)}`;if(t)return zC(e,t).join(`; `);let n=[...e.costUsd[`sdk-estimate`]===void 0?[]:[`~${UC(e.costUsd[`sdk-estimate`],`usd`)} SDK estimate`],...e.costUsd[`your-rates`]===void 0?[]:[`~${UC(e.costUsd[`your-rates`],`usd`)} from your rates`]];return e.premiumRequests!==void 0&&n.push(UC(e.premiumRequests,`premium-requests`)),n.length?n.join(`; `):`no dollar figure`}function dF(e,t,n){let r=new Map(jC(e,MC).map(e=>[e.key,e.totals.tokens??0])),i=[];for(let e=Date.parse(`${t.slice(0,10)}T00:00:00Z`);e<=Date.parse(`${n}T00:00:00Z`)&&i.length<400;e+=864e5){let t=new Date(e).toISOString().slice(0,10);i.push({day:t,tokens:r.get(t)??0})}return i}function fF({api:e,landOn:t=null}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!e)return;let t=!0;return e.view().then(e=>t&&r(e),e=>t&&a(e instanceof Error?e.message:String(e))),()=>{t=!1}},[e]),ZS(t,n!==null||i!==null),e?i?(0,q.jsxs)(`p`,{role:`alert`,className:`failure`,children:[`Reading the model usage failed: `,i]}):n?(0,q.jsx)(pF,{view:n,api:e,onSaved:r}):(0,q.jsx)(`p`,{className:`skin-loading`,children:`Reading what the agent's models used…`}):(0,q.jsx)(`p`,{className:`failure`,children:`This app wasn't given the agent's usage, so there is nothing to show.`})}function pF({view:e,api:t,onSaved:n}){let r=e.records,i=(0,v.useMemo)(()=>AC(r),[r]),a=(0,v.useMemo)(()=>jC(r,e=>e.adapter),[r]),o=(0,v.useMemo)(()=>jC(r,NC),[r]),s=(0,v.useMemo)(()=>jC(r,e=>e.dossier),[r]),c=(0,v.useMemo)(()=>jC(r,e=>e.chatId).slice(0,10),[r]),l=(0,v.useMemo)(()=>{let e=new Map;for(let t of r)e.set(t.chatId,Math.max(e.get(t.chatId)??0,t.turn));return e},[r]),u=e.now.slice(0,10),d=()=>{let e=new Blob([KC(r)],{type:`text/csv;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`toil-ui-model-usage-${u}.csv`,document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{as:`section`,className:`panel usage`,"aria-labelledby":`model-usage-totals`,children:[(0,q.jsx)(`h2`,{id:`model-usage-totals`,children:`Usage of the agent's models`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`What the Claude, Codex and Copilot SDKs reported each chat used, since `,Dm(e.since),`, UTC. `,(0,q.jsx)(YS,{topic:`model-usage`})]}),e.sample&&(0,q.jsx)(`p`,{className:`note`,children:`These are sample figures, made up for the preview. No model reported them.`}),e.retentionDays!==null&&e.retentionDays<30&&(0,q.jsxs)(`p`,{className:`note`,children:[`The cache keeps a record `,e.retentionDays,` days, so this window holds only the last `,e.retentionDays,`.`]}),(0,q.jsxs)(`dl`,{className:`fields usage-totals`,children:[(0,q.jsx)(`dt`,{children:`Tokens`}),(0,q.jsx)(`dd`,{children:cF(i)}),(0,q.jsx)(`dt`,{children:`In, out`}),(0,q.jsxs)(`dd`,{children:[lF(i.inputTokens),` in, `,lF(i.outputTokens),` out`]}),(0,q.jsx)(`dt`,{children:`Cache`}),(0,q.jsxs)(`dd`,{children:[lF(i.cachedInputTokens),` read, `,lF(i.cacheWriteTokens),` written`]}),(0,q.jsx)(`dt`,{children:`Dollars`}),(0,q.jsx)(`dd`,{children:uF({...i,premiumRequests:void 0},null)}),(0,q.jsx)(`dt`,{children:`Premium requests`}),(0,q.jsx)(`dd`,{children:i.premiumRequests===void 0?`none reported`:UC(i.premiumRequests,`premium-requests`)})]}),i.reports===0&&(0,q.jsx)(`p`,{className:`note`,children:`No chat has used a model in this window yet. Each answer the agent gives adds what its SDK reported.`}),(0,q.jsx)(dk,{days:dF(r,e.since,u),compact:FC}),(0,q.jsxs)(`div`,{className:`conn-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:d,disabled:i.reports===0,"data-usage-export":``,children:`Export as CSV`}),(0,q.jsx)(`span`,{className:`runs`,children:`one row per report, a figure the SDK didn't report left empty`})]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`model-usage-adapters`,children:[(0,q.jsx)(`h2`,{id:`model-usage-adapters`,children:`By adapter`}),(0,q.jsx)(xS,{label:`Usage by adapter`,caption:`Usage by adapter`,rows:a,rowKey:e=>e.key,columns:[{header:`Adapter`,label:`Adapter`,rowHeader:!0,cell:e=>CC[e.sample.adapter]},{header:`Tokens`,label:`Tokens`,cell:e=>cF(e.totals)},{header:`In / out`,label:`In / out`,cell:e=>`${lF(e.totals.inputTokens)} / ${lF(e.totals.outputTokens)}`},{header:`Cost`,label:`Cost`,cell:e=>uF(e.totals,e.sample.adapter)}]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`model-usage-models`,children:[(0,q.jsx)(`h2`,{id:`model-usage-models`,children:`By model`}),(0,q.jsx)(xS,{label:`Usage by model`,caption:`Usage by model and the adapter it ran on`,rows:o,rowKey:e=>e.key,columns:[{header:`Model`,label:`Model`,rowHeader:!0,cell:e=>(0,q.jsx)(`code`,{children:PC(e.sample)})},{header:`Adapter`,label:`Adapter`,cell:e=>CC[e.sample.adapter]},{header:`Tokens`,label:`Tokens`,cell:e=>cF(e.totals)},{header:`Cost`,label:`Cost`,cell:e=>uF(e.totals,e.sample.adapter)}]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`model-usage-dossiers`,children:[(0,q.jsx)(`h2`,{id:`model-usage-dossiers`,children:`By dossier`}),(0,q.jsx)(xS,{label:`Usage by dossier`,caption:`Usage by dossier`,rows:s,rowKey:e=>e.key,columns:[{header:`Dossier`,label:`Dossier`,rowHeader:!0,cell:e=>e.key},{header:`Tokens`,label:`Tokens`,cell:e=>cF(e.totals)},{header:`Cost`,label:`Cost`,cell:e=>uF(e.totals,null)}]})]}),(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`model-usage-chats`,children:[(0,q.jsx)(`h2`,{id:`model-usage-chats`,children:`Chats that used the most`}),c.length===0?(0,q.jsx)(`p`,{children:`No chat in this window.`}):(0,q.jsx)(xS,{label:`The chats that used the most`,caption:`The ten chats that used the most tokens`,rows:c,rowKey:e=>e.key,columns:[{header:`Started`,label:`Started`,rowHeader:!0,cell:e=>Om(e.sample.at)},{header:`Dossier`,label:`Dossier`,cell:e=>e.sample.dossier},{header:`Model`,label:`Model`,cell:e=>`${CC[e.sample.adapter]}, ${PC(e.sample)}`},{header:`Questions`,label:`Questions`,cell:e=>l.get(e.key)??1},{header:`Tokens`,label:`Tokens`,cell:e=>cF(e.totals)},{header:`Cost`,label:`Cost`,cell:e=>uF(e.totals,e.sample.adapter)}]})]}),(0,q.jsx)(hF,{view:e,api:t,onSaved:n})]})}var mF=e=>Object.fromEntries(VC.map(t=>{let n=e.caps[t.key];return[t.key,n&&n!==`off`?{on:!0,unit:n.unit,limit:String(n.limit)}:{on:!1,unit:t.units[0],limit:``}]}));function hF({view:e,api:t,onSaved:n}){let[r,i]=(0,v.useState)(()=>mF(e.settings)),a=e.settings.codexRates,[o,s]=(0,v.useState)(()=>({input:a?String(a.inputPerMillion):``,cached:a?String(a.cachedInputPerMillion):``,output:a?String(a.outputPerMillion):``})),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),m=e.sample?`This preview shows sample caps, so they can't be saved.`:null,h=e=>e.trim()!==``&&Number.isFinite(Number(e))?Number(e):e,g=async e=>{e.preventDefault(),l(null),d(``);let i=o.input.trim()||o.cached.trim()||o.output.trim(),a={caps:Object.fromEntries(VC.map(e=>[e.key,r[e.key].on?{unit:r[e.key].unit,limit:h(r[e.key].limit)}:`off`])),codexRates:i?{inputPerMillion:h(o.input),cachedInputPerMillion:h(o.cached),outputPerMillion:h(o.output)}:null};p(!0);try{n(await t.save(a)),d(`Saved. The next question is held to these caps.`)}catch(e){l(e instanceof Error?e.message:String(e))}finally{p(!1)}};return(0,q.jsxs)(Q,{as:`section`,className:`panel`,"aria-labelledby":`model-usage-caps`,children:[(0,q.jsx)(`h2`,{id:`model-usage-caps`,tabIndex:-1,children:`Caps`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`Optional, and off until you turn one on. Codex reports usage when an answer ends, so its cap refuses the next question rather than stopping one partway. `,(0,q.jsx)(YS,{topic:`caps`})]}),e.problem&&(0,q.jsxs)(`p`,{role:`alert`,className:`failure`,children:[e.problem,` Until the caps can be read, the agent answers nothing.`]}),m&&(0,q.jsx)(`p`,{className:`note`,children:m}),(0,q.jsxs)(`form`,{className:`caps-form`,onSubmit:e=>void g(e),children:[(0,q.jsxs)(`fieldset`,{className:`caps-grid`,disabled:!!m||f,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:`Caps per chat and per day`}),VC.map(e=>{let t=r[e.key],n=t=>i(n=>({...n,[e.key]:{...n[e.key],...t}})),a=`cap-${e.key.replace(`.`,`-`)}`;return(0,q.jsxs)(`div`,{className:`cap-row`,"data-cap":e.key,children:[(0,q.jsxs)(`label`,{className:`cap-on`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:t.on,onChange:e=>n({on:e.target.checked})}),CC[e.adapter],`, `,e.scope===`chat`?`per chat`:`per day (UTC)`]}),(0,q.jsxs)(`label`,{htmlFor:`${a}-limit`,className:`sr-only`,children:[CC[e.adapter],` `,e.scope===`chat`?`per-chat`:`per-day`,` limit`]}),(0,q.jsx)(`input`,{id:`${a}-limit`,className:`cap-limit`,inputMode:`decimal`,value:t.limit,disabled:!t.on,placeholder:t.on?`limit`:`off`,onChange:e=>n({limit:e.target.value})}),(0,q.jsxs)(`label`,{htmlFor:`${a}-unit`,className:`sr-only`,children:[CC[e.adapter],` `,e.scope===`chat`?`per-chat`:`per-day`,` unit`]}),(0,q.jsx)(`select`,{id:`${a}-unit`,value:t.unit,disabled:!t.on,onChange:e=>n({unit:e.target.value}),children:e.units.map(e=>(0,q.jsx)(`option`,{value:e,children:HC[e]},e))}),(0,q.jsx)(`code`,{className:`cap-key`,children:e.key})]},e.key)})]}),(0,q.jsxs)(`fieldset`,{className:`rates-grid`,disabled:!!m||f,children:[(0,q.jsx)(`legend`,{children:`Codex rates, in dollars per million tokens`}),(0,q.jsx)(`p`,{className:`note`,children:`The Codex SDK reports tokens and no dollar figure. With your rates, Toil UI computes one for each Codex answer from now on, labelled as computed from your rates. Leave all three empty for none.`}),[[`input`,`Input`],[`cached`,`Cached input`],[`output`,`Output`]].map(([e,t])=>(0,q.jsxs)(`label`,{className:`rate`,children:[t,(0,q.jsx)(`input`,{inputMode:`decimal`,value:o[e],onChange:t=>s(n=>({...n,[e]:t.target.value}))})]},e))]}),(0,q.jsxs)(`div`,{className:`conn-actions`,children:[(0,q.jsx)(`button`,{type:`submit`,className:`btn btn--accent`,disabled:!!m||f,children:`Save caps and rates`}),(0,q.jsx)(`span`,{className:`runs`,role:`status`,children:u})]}),c&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:c})]})]})}var gF=[{page:`connections`,label:`Connections`,about:`The connections toil uses: add, test, set the default, turn writes on or off, replace a secret, remove.`,topic:`connections`},{page:`dossiers`,label:`Dossiers`,about:`Set up a repository that has a dossier, create dossiers, and give them repositories, areas, field names, people and a work-in-progress limit.`,topic:`dossier-setup`},{page:`toil`,label:`General`,about:`How Toil UI looks, talks, moves and notifies in this browser, and the settings toil has no command for.`,topic:`bounds`},{page:`usage`,label:`Usage`,about:`How toil is used on this machine: calls per day, the commands used and failing most, and the ones never called, from toil's local audit log.`,topic:`audit`},{page:`agent-usage`,label:`Agent usage`,about:`What the agent's models used in your chats, and optional caps that stop a runaway.`,topic:`model-usage`},{page:`agent`,label:`Agent`,about:`Which agent answers questions in the chat, and your own instructions for it.`,topic:`agent`}];function _F({page:e,at:t=[],config:n,agent:r,modelUsage:i=null}){let a=gF.find(t=>t.page===e),o=lx();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsx)(`p`,{className:`eyebrow`,children:o(`settings.eyebrow`)}),(0,q.jsx)(`h1`,{tabIndex:-1,children:`toil's configuration`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`What `,(0,q.jsx)(`code`,{children:`toil connections`}),` and `,(0,q.jsx)(`code`,{children:`toil dossiers`}),` manage, through toil's own commands. `,(0,q.jsx)(YS,{topic:`settings`})]})]}),(0,q.jsx)(`nav`,{className:`subnav`,"aria-label":`Settings pages`,children:(0,q.jsx)(`ul`,{children:gF.map(t=>(0,q.jsx)(`li`,{children:(0,q.jsx)(`a`,{href:`#/settings/${t.page}`,"aria-current":t.page===e?`page`:void 0,children:t.label})},t.page))})}),n?.disabled&&e!==`agent`&&e!==`usage`&&e!==`agent-usage`&&(0,q.jsxs)(`p`,{className:`config-off`,children:[(0,q.jsx)(`strong`,{children:`Changes are turned off.`}),` `,n.disabled]}),(0,q.jsx)(`h2`,{className:`page-title`,children:a.label}),(0,q.jsxs)(`p`,{className:`lede`,children:[a.about,` `,(0,q.jsx)(YS,{topic:a.topic})]}),e===`toil`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(KP,{}),(0,q.jsx)(GP,{}),(0,q.jsx)(Rw,{})]}),e===`agent`?r?(0,q.jsx)(oP,{...r}):(0,q.jsx)(sP,{}):e===`agent-usage`?(0,q.jsx)(fF,{api:i,landOn:t[0]===`caps`?`model-usage-caps`:null}):n?e===`connections`?(0,q.jsx)(vP,{config:n,...t[0]?{at:t[0]}:{}}):e===`dossiers`?(0,q.jsx)(PP,{config:n,...t[0]?{at:{dossier:t[0],section:t[1]??null}}:{}}):e===`usage`?(0,q.jsx)(aF,{config:n}):(0,q.jsx)(WP,{config:n}):(0,q.jsx)(`p`,{className:`failure`,children:`This app wasn't given toil's config commands, so there is nothing to show.`})]})}var vF=/^\d{4}-\d{2}-\d{2}$/;function yF(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:new Date(t).toISOString().slice(0,10)}function bF(e){if(typeof e!=`string`||!vF.test(e))return!1;let t=Date.parse(`${e}T00:00:00Z`);return!Number.isNaN(t)&&new Date(t).toISOString().slice(0,10)===e}var xF=e=>e.slice(0,7);function SF(e,t){return new Date(Date.parse(`${e}T00:00:00Z`)+t*864e5).toISOString().slice(0,10)}function CF(e){let t=[];for(let n=`${e}-01`;xF(n)===e;n=SF(n,1))t.push(n);return t}function wF(e,t){let[n,r]=e.split(`-`).map(Number),i=n*12+(r-1)+t;return`${String(Math.floor(i/12)).padStart(4,`0`)}-${String(i%12+1).padStart(2,`0`)}`}var TF=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],EF=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],DF=e=>String(e).padStart(2,`0`),OF=e=>new Date(`${e}T00:00:00Z`),kF=e=>{let t=new Date(e);return`${DF(t.getUTCHours())}:${DF(t.getUTCMinutes())}`},AF=e=>{let t=OF(e);return`${EF[t.getUTCDay()]} ${t.getUTCDate()} ${TF[t.getUTCMonth()]} ${t.getUTCFullYear()}`},jF=e=>{let t=OF(e);return`${t.getUTCDate()} ${TF[t.getUTCMonth()].slice(0,3)} ${t.getUTCFullYear()}`},MF=e=>{let t=OF(`${e}-01`);return`${TF[t.getUTCMonth()]} ${t.getUTCFullYear()}`},NF=e=>`${jF(yF(e))} ${kF(e)} UTC`;function PF(e){if(!e.observed)return``;let t=e.observed.previousSync,n=t?`; the one before ran ${yF(t)===yF(e.at)?`at ${kF(t)} UTC`:NF(t)}`:``;return`first seen by the sync at ${kF(e.at)} UTC${n}`}var FF={running:`still running`,finished:`finished`,failed:`failed`,stopped:`stopped before it finished`,capped:`stopped at its cap`};function IF(e){switch(e.state){case`applied`:return`applied: toil's audit log has the write at ${NF(e.at)} (${e.via})`;case`not-applied`:return`not applied: toil's audit log has no matching write`;case`no-command`:return`toil has no command for it, so nothing to apply`;case`unknown`:return`couldn't check toil's audit log: ${e.why}`}}var LF=[`done`,`progress`,`blocked`,`next`],RF={done:`Done`,progress:`In progress`,blocked:`Blocked`,next:`Next`},zF=(e,t)=>e===`done`?`Nothing done.`:e===`progress`?`Nothing in progress.`:e===`blocked`?`Nothing blocked.`:t?`Nothing assigned and not started in ${t}.`:`No current sprint to take it from.`;function BF(e){let t=SF(e,-1);for(;[0,6].includes(new Date(`${t}T00:00:00Z`).getUTCDay());)t=SF(t,-1);return t}var VF=e=>({from:BF(e),to:e}),HF=e=>[...e.team,...e.people.flatMap(e=>LF.flatMap(t=>e.lines[t]))];function UF(e,t){return t.at?e.from===e.to?`${kF(t.at)} UTC`:`${jF(yF(t.at))} ${kF(t.at)} UTC`:`as of the latest sync`}var WF=e=>e.from===e.to?jF(e.from):`${jF(e.from)} to ${jF(e.to)}`,GF=e=>e.asOf?`Review waits, the sprint and Next are as of the sync at ${jF(yF(e.asOf))} ${kF(e.asOf)} UTC.`:`Review waits, the sprint and Next come from a sync, and none has run yet, so there are none.`,KF=e=>`${e.name}${e.account&&e.account.id!==e.name?` (${e.account.area} ${e.account.id})`:e.account?` (${e.account.area})`:``}${e.kind===`agent`?` (agent)`:``}`,qF=e=>`Stand-up: ${e.dossier}, ${WF(e)}`,JF=e=>`Built by Toil UI from the worklog, ${WF(e)}, times in UTC: facts only, each linked to its source. ${GF(e)}`,YF=(e,t)=>`Write up the stand-up for ${e}${t===e?``:` to ${t}`}`;function XF(e,t){let n=new Set(HF(t).map(e=>e.fact)),r=new Set;for(let t of e.matchAll(/\bF(\d+)\b/g))n.has(`F${t[1]}`)&&r.add(`F${t[1]}`);return[...r]}var ZF=e=>({ok:!1,message:e instanceof Error?e.message:String(e)}),QF=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function $F({api:e,from:t,to:n,ignored:r}){let{dossier:i,now:a}=J(),{Loading:o}=qx(),s=yF(a),c=t&&n?{from:t,to:n}:VF(s),[l,u]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(!e)return;let t=!0;return u(null),e.standup(i.name,c.from,c.to).then(e=>t&&u({ok:!0,value:e}),e=>t&&u(ZF(e))),()=>{t=!1}},[e,i.name,c.from,c.to]);let d=(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsxs)(`p`,{className:`eyebrow`,children:[(0,q.jsx)(`a`,{href:Am(i.name),children:i.name}),` · `,(0,q.jsx)(`a`,{href:Im(i.name),children:`Worklog`})]}),(0,q.jsx)(`h1`,{tabIndex:-1,children:`Stand-up`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`The worklog's days, grouped by person into done, in progress, blocked and next, with the team's lines first. `,(0,q.jsx)(YS,{topic:`standup`})]})]});return e?(0,q.jsxs)(q.Fragment,{children:[d,(0,q.jsxs)(`div`,{className:`standup`,children:[(0,q.jsxs)(iT,{id:`standup-range`,title:`Days`,calls:[],children:[r&&(0,q.jsxs)(`p`,{role:`status`,className:`note`,children:[`“`,r,`” isn't a day as yyyy-mm-dd, so this is since the last working day instead.`]}),(0,q.jsx)(eI,{from:c.from,to:c.to,today:s,explicit:!!(t&&n)},`${c.from}/${c.to}`)]}),l?l.ok?(0,q.jsx)(aI,{api:e,data:l.value,onRebuilt:e=>u({ok:!0,value:e})}):(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:l.message}):(0,q.jsx)(o,{message:`Folding the stand-up`})]})]}):(0,q.jsxs)(q.Fragment,{children:[d,(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:`This Toil UI keeps no worklog, so it has no stand-up to fold from one.`})]})}function eI({from:e,to:t,today:n,explicit:r}){let{dossier:i}=J(),[a,o]=(0,v.useState)(e),[s,c]=(0,v.useState)(t);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`note`,children:[r?`The days you picked.`:`Since the last working day, through today.`,` At most `,31,` days.`,r&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(`a`,{href:Lm(i.name),children:`Back to since the last working day`}),`.`]})]}),(0,q.jsxs)(va,{className:`standup-range`,onSubmit:e=>{e.preventDefault(),window.location.hash=Lm(i.name,{from:a,to:s})},children:[(0,q.jsxs)(gf,{className:`field-text`,value:a,onChange:o,isRequired:!0,children:[(0,q.jsx)(Ai,{children:`From`}),(0,q.jsx)(Va,{type:`date`,max:n})]}),(0,q.jsxs)(gf,{className:`field-text`,value:s,onChange:c,isRequired:!0,children:[(0,q.jsx)(Ai,{children:`To`}),(0,q.jsx)(Va,{type:`date`,max:n})]}),(0,q.jsx)(B,{type:`submit`,className:`btn`,isDisabled:!a||!s,children:`Show these days`})]})]})}function tI({line:e}){let{byId:t,prById:n,dossier:r}=J();return t.has(e.subject)||n?.has(e.subject)?(0,q.jsx)(dS,{id:e.subject,withTitle:!0}):e.subject.startsWith(`run:`)&&e.day?(0,q.jsx)(`a`,{href:Im(r.name,e.day),className:`item-link`,children:(0,q.jsx)(`span`,{className:`key`,children:e.label})}):e.url?(0,q.jsx)(`a`,{href:e.url,className:`item-link`,children:(0,q.jsx)(`span`,{className:`key`,children:e.label})}):(0,q.jsx)(`span`,{className:`item-link`,children:(0,q.jsx)(`span`,{className:`key`,children:e.label})})}function nI({report:e,line:t,highlight:n}){let{byId:r,prById:i}=J(),a=r.has(t.subject)||i?.has(t.subject)?null:t.title;return(0,q.jsxs)(`li`,{className:`worklog-line standup-line`,id:`fact-${t.fact}`,"data-cited":n||void 0,children:[(0,q.jsx)(`span`,{className:`standup-fact`,children:t.fact}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(tI,{line:t}),a&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(pS,{text:a})]}),`: `,(0,q.jsx)(pS,{text:t.text}),` `,(0,q.jsxs)(`span`,{className:`note`,children:[`(`,t.at?(0,q.jsx)(`time`,{dateTime:t.at,children:UF(e,t)}):UF(e,t),`)`]})]})]})}function rI({report:e,lines:t,none:n,cited:r}){return t.length?(0,q.jsx)(`ul`,{className:`rows worklog-lines`,children:t.map(t=>(0,q.jsx)(nI,{report:e,line:t,highlight:r.has(t.fact)},t.fact))}):(0,q.jsx)(`p`,{className:`note`,children:n})}function iI({report:e,group:t,cited:n}){let r=`standup-${t.key.replace(/[^A-Za-z0-9-]/g,`-`)}`,i=LF.reduce((e,n)=>e+t.lines[n].length,0);return(0,q.jsxs)(iT,{id:r,title:KF(t),calls:[],children:[!t.mapped&&t.key!==`none`&&(0,q.jsx)(`p`,{className:`note`,children:`Not in the dossier's people: an account the People view can map to someone.`}),i===0?(0,q.jsx)(`p`,{className:`note`,children:`Nothing recorded for these days.`}):(0,q.jsx)(`div`,{className:`standup-buckets`,children:LF.map(r=>(0,q.jsxs)(`section`,{className:`worklog-section`,children:[(0,q.jsx)(`h3`,{children:RF[r]}),(0,q.jsx)(rI,{report:e,lines:t.lines[r],none:zF(r,e.sprint),cited:n})]},r))})]})}function aI({api:e,data:t,onRebuilt:n}){let{report:r}=t,[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),c=async i=>{if(a(i),s(!1),i)try{let i=await e.standup(r.dossier,r.from,r.to);i.markdown!==t.markdown&&(n(i),s(!0))}catch{}},l=new Set(i?XF(i.parts.map(e=>e.text).join(`
56
- `),r):[]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{className:`standup-summary`,"aria-labelledby":`standup-title`,children:[(0,q.jsx)(`h2`,{id:`standup-title`,children:qF(r)}),(0,q.jsx)(`p`,{className:`note`,children:JF(r)}),r.gaps.length>0&&(0,q.jsxs)(`section`,{className:`worklog-gaps`,"aria-labelledby":`standup-gaps`,children:[(0,q.jsx)(`h3`,{id:`standup-gaps`,children:`Coverage`}),(0,q.jsx)(`ul`,{children:r.gaps.map((e,t)=>(0,q.jsx)(`li`,{children:e},t))})]})]}),(0,q.jsx)(iT,{id:`standup-team`,title:`Team`,calls:[],children:(0,q.jsx)(rI,{report:r,lines:r.team,none:`No sprint, scope changes, or builds and deployments that broke or recovered.`,cited:l})}),r.people.length?r.people.map(e=>(0,q.jsx)(iI,{report:r,group:e,cited:l},e.key)):(0,q.jsx)(`p`,{className:`note`,children:`Nobody is in the dossier's people, and nobody did anything the worklog recorded on these days.`}),(0,q.jsx)(iT,{id:`standup-share`,title:`Copy, export and publish`,calls:[],children:(0,q.jsx)(sI,{api:e,data:t})}),(0,q.jsxs)(iT,{id:`standup-writeup`,title:`Write it up`,calls:[],children:[o&&(0,q.jsx)(`p`,{role:`status`,className:`note`,children:`A sync landed while the agent wrote, so the report above was built again from what the agent read, and its fact numbers match the write-up.`}),(0,q.jsx)(cI,{report:r,answer:i,onAnswer:e=>void c(e)})]})]})}function oI({value:e,label:t,what:n}){let[r,i]=(0,v.useState)(null),a=async()=>{try{await navigator.clipboard.writeText(e),i(!0)}catch{i(!1)}};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{className:`btn`,onPress:()=>void a(),children:t}),(0,q.jsx)(`span`,{role:`status`,className:`sr-only`,children:r===null?``:r?`Copied the stand-up as ${n}.`:`This browser wouldn't copy; select the ${n} below instead.`}),r===!1&&(0,q.jsxs)(`span`,{className:`note`,children:[`This browser wouldn't copy; select the `,n,` below instead.`]})]})}function sI({api:e,data:t}){let{report:n}=t,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=async t=>{t.preventDefault(),c(!0),o(null);try{o({ok:!0,value:await e.exportTo(n.dossier,{from:n.from,to:n.to},r)})}catch(e){o(ZF(e))}finally{c(!1)}};return(0,q.jsxs)(`div`,{className:`worklog-page`,children:[(0,q.jsx)(`p`,{className:`note`,children:`Markdown suits Slack, Teams and a wiki page; plain text suits a chat that shows Markdown as it is typed. Both are the report as shown, line for line.`}),(0,q.jsxs)(`div`,{className:`worklog-actions`,children:[(0,q.jsx)(oI,{value:t.markdown,label:`Copy as Markdown`,what:`Markdown`}),(0,q.jsx)(oI,{value:t.text,label:`Copy as plain text`,what:`plain text`})]}),(0,q.jsxs)(`section`,{className:`worklog-section`,"aria-labelledby":`standup-export`,children:[(0,q.jsx)(`h3`,{id:`standup-export`,children:`Export and publish`}),(0,q.jsx)(`p`,{className:`note`,children:`Export writes the Markdown to a new file in a folder you name, through toil's own file service. Publishing it to Confluence or GitHub is then a proposal, for you to run through toil's write gate.`}),e.disabled?(0,q.jsx)(`p`,{className:`note`,children:e.disabled}):(0,q.jsxs)(va,{className:`worklog-export`,onSubmit:e=>void l(e),children:[(0,q.jsxs)(gf,{className:`field-text`,value:r,onChange:i,isRequired:!0,children:[(0,q.jsx)(Ai,{children:`Folder, as a full path`}),(0,q.jsx)(Va,{autoComplete:`off`,spellCheck:!1})]}),(0,q.jsx)(B,{type:`submit`,className:`btn`,isDisabled:s||!r.trim(),children:`Export`})]}),a&&(a.ok?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{role:`status`,children:[`toil wrote `,QF(a.value.bytes,`byte`),` to `,(0,q.jsx)(wS,{value:a.value.path,what:`exported file's path`}),`.`]}),a.value.proposals.length?a.value.proposals.map(e=>(0,q.jsx)(aC,{proposal:e},e.id)):(0,q.jsx)(`p`,{className:`note`,children:`This dossier names no Confluence space and no GitHub repository, so there is nowhere to propose publishing it.`})]}):(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:a.message}))]}),(0,q.jsxs)(`details`,{className:`worklog-md`,children:[(0,q.jsx)(`summary`,{children:`The stand-up as Markdown`}),(0,q.jsx)(`pre`,{role:`region`,"aria-label":`The stand-up as Markdown`,tabIndex:0,children:(0,q.jsx)(`code`,{children:t.markdown})})]}),(0,q.jsxs)(`details`,{className:`worklog-md`,children:[(0,q.jsx)(`summary`,{children:`The stand-up as plain text`}),(0,q.jsx)(`pre`,{role:`region`,"aria-label":`The stand-up as plain text`,tabIndex:0,children:(0,q.jsx)(`code`,{children:t.text})})]})]})}function cI({report:e,answer:t,onAnswer:n}){let{agent:r,dossier:i}=J(),a=ex(),o=ix(),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=new Map(HF(e).map(e=>[e.fact,e])),f=async()=>{c(!0),u(null),n(null);try{let t={id:typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`standup-${Date.now()}`,turn:1};n(await r.ask(i.name,YF(e.from,e.to),{theme:a.name,voice:ox(a,o)},t))}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}},p=t?XF(t.parts.map(e=>e.text).join(`
57
- `),e):[];return(0,q.jsxs)(`div`,{className:`worklog-page`,children:[(0,q.jsx)(`p`,{className:`note`,children:`Optional. The agent turns the facts above into a short narrative, in the theme's voice when that is on. It reads the same report, names the fact lines it used, and its usage counts like any chat's. The report above stays the record.`}),r.notice&&(0,q.jsx)(`p`,{className:`note agent-notice`,children:r.notice}),(0,q.jsxs)(`div`,{className:`worklog-actions`,children:[(0,q.jsx)(B,{className:`btn`,"data-standup-writeup":``,isDisabled:s,onPress:()=>void f(),children:t?`Write it up again`:`Write it up`}),s&&(0,q.jsx)(`span`,{role:`status`,children:`The agent is writing it up.`})]}),l&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:l}),t&&(0,q.jsxs)(`section`,{className:`standup-writeup`,"aria-labelledby":`standup-writeup-by`,children:[(0,q.jsxs)(`h3`,{id:`standup-writeup-by`,children:[`Written by the agent (`,t.by===`scripted`?`a scripted preview, not a model`:t.by,`), not by Toil UI`]}),t.warnings?.map((e,t)=>(0,q.jsx)(`p`,{className:`note`,children:e},t)),t.parts.map((e,t)=>(0,q.jsx)(`p`,{children:(0,q.jsx)(pS,{text:e.text})},t)),(0,q.jsxs)(`p`,{className:`note`,children:[p.length?`Rests on ${QF(p.length,`fact line`)} of the report, marked above: `:`Names none of the report's fact lines, so check it against the report before you use it.`,p.map((e,t)=>(0,q.jsxs)(`span`,{children:[t?`, `:``,(0,q.jsx)(B,{className:`btn btn--small`,"aria-label":`${e}: ${d.get(e)?.label??``} ${d.get(e)?.text??``}`,onPress:()=>document.getElementById(`fact-${e}`)?.scrollIntoView({block:`center`}),children:e})]},e)),p.length?`.`:``,t.unverified&&t.unverified.length>0?` It names ${QF(t.unverified.length,`id`)} its tools never returned.`:``]})]})]})}var lI=`This is sample data, so it keeps no notes and writes no files. Toil UI on your own machine keeps each page in its data folder and exports through toil.`,uI=e=>({ok:!1,message:e instanceof Error?e.message:String(e)}),dI=[[`Mon`,`Monday`],[`Tue`,`Tuesday`],[`Wed`,`Wednesday`],[`Thu`,`Thursday`],[`Fri`,`Friday`],[`Sat`,`Saturday`],[`Sun`,`Sunday`]],fI=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function pI({api:e,day:t}){let{dossier:n}=J(),{Loading:r}=qx(),[i,a]=(0,v.useState)(t?xF(t):null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=o?.ok?o.value.today:null,d=t??u;(0,v.useEffect)(()=>{if(!e)return;let t=!0;return s(null),e.month(n.name,i??void 0).then(e=>t&&s({ok:!0,value:e}),e=>t&&s(uI(e))),()=>{t=!1}},[e,n.name,i]),(0,v.useEffect)(()=>{if(!e||!d)return;let t=!0;return l(null),e.day(n.name,d).then(e=>t&&l({ok:!0,value:e}),e=>t&&l(uI(e))),()=>{t=!1}},[e,n.name,d]);let f=(0,q.jsxs)(`div`,{className:`view-head`,children:[(0,q.jsx)(`p`,{className:`eyebrow`,children:(0,q.jsx)(`a`,{href:Am(n.name),children:n.name})}),(0,q.jsx)(`h1`,{tabIndex:-1,children:`Worklog`}),(0,q.jsxs)(`p`,{className:`lede`,children:[`One page a day of what happened, facts only. `,(0,q.jsx)(YS,{topic:`worklog`})]}),e&&(0,q.jsx)(`p`,{children:(0,q.jsx)(`a`,{className:`btn`,href:Lm(n.name),"data-standup-link":``,children:`Stand-up since the last working day`})})]});return e?(0,q.jsxs)(q.Fragment,{children:[f,(0,q.jsxs)(`div`,{className:`worklog`,children:[(0,q.jsx)(iT,{id:`worklog-calendar`,title:o?.ok?MF(o.value.month):`Calendar`,calls:[],children:o?o.ok?(0,q.jsx)(mI,{data:o.value,selected:d,onMonth:a}):(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:o.message}):(0,q.jsx)(r,{message:`Reading the calendar`})}),(0,q.jsx)(iT,{id:`worklog-day`,title:d?AF(d):`The day`,calls:[],children:c?c.ok?(0,q.jsx)(yI,{api:e,data:c.value,today:u,onChange:e=>l({ok:!0,value:e})}):(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:c.message}):(0,q.jsx)(r,{message:`Folding the page`})})]})]}):(0,q.jsxs)(q.Fragment,{children:[f,(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:`This Toil UI keeps no worklog: it has no cache to fold one from.`})]})}function mI({data:e,selected:t,onMonth:n}){let{dossier:r}=J(),i=new Map(e.days.map(e=>[e.day,e])),a=CF(e.month),o=(new Date(`${a[0]}T00:00:00Z`).getUTCDay()+6)%7,s=[...Array(o).fill(null),...a];for(;s.length%7;)s.push(null);let c=Array.from({length:s.length/7},(e,t)=>s.slice(t*7,t*7+7)),l=e.first?xF(e.first):e.month,u=wF(e.month,-1),d=wF(e.month,1);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`calendar-nav`,children:[(0,q.jsx)(B,{className:`btn btn--small`,isDisabled:e.month<=l,onPress:()=>n(u),children:`Previous month`}),(0,q.jsx)(B,{className:`btn btn--small`,isDisabled:e.month>=xF(e.today),onPress:()=>n(d),children:`Next month`})]}),(0,q.jsxs)(`table`,{className:`calendar`,children:[(0,q.jsxs)(`caption`,{className:`sr-only`,children:[MF(e.month),`: `,fI(e.days.length,`day`),` with a page. Days are UTC.`]}),(0,q.jsx)(`thead`,{children:(0,q.jsx)(`tr`,{children:dI.map(([e,t])=>(0,q.jsx)(`th`,{scope:`col`,children:(0,q.jsx)(`abbr`,{title:t,children:e})},e))})}),(0,q.jsx)(`tbody`,{children:c.map((n,a)=>(0,q.jsx)(`tr`,{children:n.map((n,a)=>{if(!n)return(0,q.jsx)(`td`,{},a);let o=i.get(n),s=Number(n.slice(8));return o?(0,q.jsx)(`td`,{children:(0,q.jsxs)(`a`,{href:Im(r.name,n),className:`calendar__day`,"aria-current":n===t?`date`:void 0,"data-today":n===e.today||void 0,children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[AF(n),n===e.today?`, today`:``,`: `]}),(0,q.jsx)(`span`,{className:`calendar__n`,"aria-hidden":`true`,children:s}),(0,q.jsxs)(`span`,{className:`calendar__count`,children:[o.lines,(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,o.lines===1?`line`:`lines`,o.gaps?`, ${fI(o.gaps,`coverage note`)}`:``]}),o.gaps>0&&(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`*`})]})]})},n):(0,q.jsxs)(`td`,{className:n>e.today?`calendar__future`:`calendar__empty`,children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[AF(n),`: `,n>e.today?`not yet`:`no page`]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:s})]},n)})},a))})]}),(0,q.jsxs)(`p`,{className:`note`,children:[`A number under a day is how many lines its page has; a star means the page says what the cache can't vouch for. The cache keeps `,fI(e.retentionDays,`day`),` after each sync, and so do the pages.`]})]})}function hI({e}){let{byId:t,prById:n}=J();return t.has(e.subject)||n?.has(e.subject)?(0,q.jsx)(dS,{id:e.subject,withTitle:!0}):e.url?(0,q.jsx)(`a`,{href:e.url,className:`item-link`,children:(0,q.jsx)(`span`,{className:`key`,children:e.label})}):(0,q.jsx)(`span`,{className:`item-link`,children:(0,q.jsx)(`span`,{className:`key`,children:e.label})})}function gI({e}){let{byId:t,prById:n}=J(),r=t.has(e.subject)||n?.has(e.subject)?null:e.title;return(0,q.jsxs)(`li`,{className:`worklog-line`,children:[(0,q.jsx)(`time`,{dateTime:e.at,children:kF(e.at)}),` `,(0,q.jsxs)(`span`,{children:[(0,q.jsx)(hI,{e}),r&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(pS,{text:r})]}),`: `,(0,q.jsx)(pS,{text:e.text}),e.by&&(0,q.jsxs)(`span`,{className:`by`,children:[`, by `,e.by]}),e.observed&&(0,q.jsxs)(`span`,{className:`note`,children:[` `,`(`,PF(e),`)`]})]})]})}function _I({title:e,events:t,none:n}){return(0,q.jsxs)(`section`,{className:`worklog-section`,children:[(0,q.jsx)(`h3`,{children:e}),t.length?(0,q.jsx)(`ul`,{className:`rows worklog-lines`,children:t.map(e=>(0,q.jsx)(gI,{e},e.key))}):(0,q.jsx)(`p`,{className:`note`,children:n})]})}function vI({line:e}){let{run:t}=e;return(0,q.jsxs)(`li`,{className:`worklog-line`,children:[(0,q.jsx)(`time`,{dateTime:t.startedAt,children:kF(t.startedAt)}),` `,(0,q.jsxs)(`span`,{children:[t.kind===`ask`?`Asked`:`Assigned`,` `,t.by,`: “`,t.prompt,`”, `,FF[t.outcome],t.finishedAt&&` at ${kF(t.finishedAt)}`,t.citations.length>0&&`, citing ${fI(t.citations.length,`item`)}${t.unverified.length?` (${t.unverified.length} unverified)`:``}`,t.error&&(0,q.jsxs)(`span`,{className:`failure`,children:[`: `,t.error]}),e.proposals.length>0&&(0,q.jsx)(`ul`,{className:`plain worklog-proposals`,children:e.proposals.map(e=>(0,q.jsxs)(`li`,{children:[`Proposal: `,(0,q.jsx)(pS,{text:e.proposal.title}),e.proposal.command&&(0,q.jsxs)(q.Fragment,{children:[` `,`(`,(0,q.jsxs)(`code`,{children:[`toil `,e.proposal.command]}),`)`]}),`, `,(0,q.jsx)(`span`,{className:e.applied.state===`applied`?void 0:`note`,children:IF(e.applied)})]},e.proposal.id))}),(0,q.jsxs)(`details`,{className:`worklog-transcript`,children:[(0,q.jsx)(`summary`,{children:`Transcript, written by the agent`}),t.answer?t.answer.split(/\n{2,}/).map((e,t)=>(0,q.jsx)(`p`,{children:(0,q.jsx)(pS,{text:e})},t)):(0,q.jsx)(`p`,{className:`note`,children:`No answer was recorded.`})]})]})]})}function yI({api:e,data:t,today:n,onChange:r}){let{page:i}=t,[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=async()=>{c(!0);try{let t=await e.rebuild(i.dossier,i.day);r(t),o(t.same===null?`Rebuilt from the cache. There was no page kept to compare it with.`:t.same?`Rebuilt from the cache: the same, line for line, as the page kept.`:`Rebuilt from the cache: it differs from the page kept, which now matches the cache again.`)}catch(e){o(`The rebuild failed: ${e instanceof Error?e.message:String(e)}`)}finally{c(!1)}};return(0,q.jsxs)(`div`,{className:`worklog-page`,children:[(0,q.jsxs)(`p`,{className:`note`,children:[`Built by Toil UI from its cache, facts only`,t.file?`, and kept at `:`. Sample data keeps no file.`,t.file&&(0,q.jsx)(wS,{value:t.file,what:`page's path`})]}),i.gaps.length>0&&(0,q.jsxs)(`section`,{className:`worklog-gaps`,"aria-labelledby":`gaps-${i.day}`,children:[(0,q.jsx)(`h3`,{id:`gaps-${i.day}`,children:`Coverage`}),(0,q.jsx)(`ul`,{children:i.gaps.map((e,t)=>(0,q.jsx)(`li`,{children:e},t))})]}),(0,q.jsx)(_I,{title:`Work items`,events:i.work,none:`No status changes, sprint changes or new blockers recorded.`}),(0,q.jsx)(_I,{title:`Pull requests`,events:i.prs,none:`No pull requests opened, reviewed, merged or declined.`}),(0,q.jsx)(_I,{title:`Builds and deployments`,events:i.delivery,none:`No builds or deployments failed or recovered.`}),(0,q.jsxs)(`section`,{className:`worklog-section`,children:[(0,q.jsx)(`h3`,{children:`Agent runs`}),i.agents.length?(0,q.jsx)(`ul`,{className:`rows worklog-lines`,children:i.agents.map(e=>(0,q.jsx)(vI,{line:e},e.run.id))}):(0,q.jsx)(`p`,{className:`note`,children:`No agent runs.`})]}),(0,q.jsx)(bI,{api:e,data:t,today:n,onChange:r}),(0,q.jsxs)(`section`,{className:`worklog-section`,children:[(0,q.jsx)(`h3`,{children:`Sources`}),i.sources.length?(0,q.jsx)(`ul`,{className:`plain`,children:i.sources.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`code`,{children:e.area}),`: `,e.syncs?`${fI(e.syncs,`sync`)} this day${e.failed?`, ${e.failed} failed`:``}, the last at ${kF(e.last)} UTC`:`no sync this day`]},e.area))}):(0,q.jsx)(`p`,{className:`note`,children:`No syncs recorded.`})]}),(0,q.jsxs)(`div`,{className:`worklog-actions`,children:[(0,q.jsx)(B,{className:`btn`,"data-worklog-rebuild":``,isDisabled:s,onPress:()=>void l(),children:`Rebuild this day`}),(0,q.jsx)(`a`,{className:`btn`,href:Lm(i.dossier,{from:i.day,to:i.day}),children:`Stand-up for this day`}),a&&(0,q.jsx)(`p`,{role:`status`,className:`note`,children:a})]}),(0,q.jsx)(xI,{api:e,dossier:i.dossier,day:i.day}),(0,q.jsxs)(`details`,{className:`worklog-md`,children:[(0,q.jsx)(`summary`,{children:`The page as Markdown`}),(0,q.jsx)(`pre`,{role:`region`,"aria-label":`The page as Markdown`,tabIndex:0,children:(0,q.jsx)(`code`,{children:t.markdown})})]})]})}function bI({api:e,data:t,today:n,onChange:r}){let{page:i}=t,[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),l=i.day===n,u=async t=>{t.preventDefault(),c(null);try{r(await e.addNote(i.dossier,a)),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}};return(0,q.jsxs)(`section`,{className:`worklog-section`,children:[(0,q.jsx)(`h3`,{children:`Notes`}),i.notes.length?(0,q.jsx)(`ul`,{className:`rows worklog-lines`,children:i.notes.map(e=>(0,q.jsxs)(`li`,{className:`worklog-line`,children:[(0,q.jsx)(`time`,{dateTime:e.at,children:kF(e.at)}),` `,(0,q.jsxs)(`span`,{children:[(0,q.jsxs)(`span`,{className:`by`,children:[e.by,`:`]}),` `,e.text]})]},e.id))}):(0,q.jsx)(`p`,{className:`note`,children:`No notes.`}),l&&(e.disabled?(0,q.jsx)(`p`,{className:`note`,children:e.disabled}):(0,q.jsxs)(va,{className:`worklog-note`,onSubmit:e=>void u(e),children:[(0,q.jsxs)(gf,{className:`field-text field-text--area`,value:a,onChange:o,maxLength:2e3,children:[(0,q.jsx)(Ai,{children:`Add a note to today's page`}),(0,q.jsx)(mf,{rows:2})]}),(0,q.jsx)(B,{type:`submit`,className:`btn`,isDisabled:!a.trim(),children:`Add the note`}),s&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:s})]}))]})}function xI({api:e,dossier:t,day:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(`day`),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d=async i=>{i.preventDefault(),u(!0),c(null);let o=a===`day`?{day:n}:{month:xF(n)};try{c({ok:!0,value:await e.exportTo(t,o,r)})}catch(e){c(uI(e))}finally{u(!1)}};return(0,q.jsxs)(`section`,{className:`worklog-section`,"aria-labelledby":`worklog-export`,children:[(0,q.jsx)(`h3`,{id:`worklog-export`,children:`Export and publish`}),(0,q.jsx)(`p`,{className:`note`,children:`Export writes the Markdown to a new file in a folder you name, through toil's own file service. Publishing it to Confluence or GitHub is then a proposal, for you to run through toil's write gate.`}),e.disabled?(0,q.jsx)(`p`,{className:`note`,children:e.disabled}):(0,q.jsxs)(va,{className:`worklog-export`,onSubmit:e=>void d(e),children:[(0,q.jsxs)(qd,{className:`shells`,orientation:`horizontal`,value:a,onChange:e=>o(e),children:[(0,q.jsx)(Ai,{children:`Export`}),(0,q.jsx)(Jd,{value:`day`,className:`shell-choice`,children:`This day`}),(0,q.jsx)(Jd,{value:`month`,className:`shell-choice`,children:MF(xF(n))})]}),(0,q.jsxs)(gf,{className:`field-text`,value:r,onChange:i,isRequired:!0,children:[(0,q.jsx)(Ai,{children:`Folder, as a full path`}),(0,q.jsx)(Va,{autoComplete:`off`,spellCheck:!1})]}),(0,q.jsx)(B,{type:`submit`,className:`btn`,isDisabled:l||!r.trim(),children:`Export`})]}),s&&(s.ok?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{role:`status`,children:[`toil wrote `,fI(s.value.bytes,`byte`),` to `,(0,q.jsx)(wS,{value:s.value.path,what:`exported file's path`}),`.`]}),s.value.proposals.length?s.value.proposals.map(e=>(0,q.jsx)(aC,{proposal:e},e.id)):(0,q.jsx)(`p`,{className:`note`,children:`This dossier names no Confluence space and no GitHub repository, so there is nowhere to propose publishing it.`})]}):(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:s.message}))]})}var SI=`This is sample data, so it sends nothing. Toil UI on your own machine sends through toil feedback, or use the form at https://imagile-dev.github.io/toil/feedback/.`;function CI(e){if(!e?.ok)return null;let t=e.data;return typeof t?.disclaimer!=`string`||typeof t.report!=`object`||t.report===null||typeof t.sent!=`boolean`?null:t}function wI(e){let t=e.error;return t?/has no command "feedback"/.test(t.message)?`The toil this Toil UI runs (${e.meta.version}) has no feedback command; it needs a newer toil. Until then, use the form at https://imagile-dev.github.io/toil/feedback/.`:`${t.message}${t.fix?` ${t.fix}`:``}`:`toil returned no report.`}var TI={kind:`bug`,title:``,body:``,email:``},EI=300;function DI({api:e}){return(0,q.jsxs)(gd,{children:[(0,q.jsx)(B,{className:`btn feedback-open`,children:`Feedback`}),(0,q.jsx)(OI,{api:e})]})}function OI({api:e,isOpen:t,onOpenChange:n}){let r=t===void 0?{}:{isOpen:t,...n?{onOpenChange:n}:{}};return(0,q.jsx)(Fd,{className:`feedback-overlay`,"data-backdrop":``,isDismissable:!0,...r,children:(0,q.jsx)(Nd,{className:`feedback-modal`,children:(0,q.jsx)(_d,{className:`feedback-dialog`,"aria-labelledby":`feedback-title`,children:({close:t})=>(0,q.jsx)(kI,{api:e,close:t})})})})}function kI({api:e,close:t}){let[n,r]=(0,v.useState)(TI),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({state:`idle`}),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=(0,v.useRef)(null),p=n.title.trim()!==``&&n.body.trim()!==``&&n.email.trim()!==``;(0,v.useEffect)(()=>{if(!p){s({state:`idle`});return}let t=new AbortController;s({state:`loading`});let r=setTimeout(()=>{e.preview(n,t.signal).then(e=>{if(t.signal.aborted)return;let n=CI(e);s(n?{state:`ready`,data:n}:{state:`problem`,message:wI(e)})},e=>!t.signal.aborted&&s({state:`problem`,message:e instanceof Error?e.message:String(e)}))},EI);return()=>{clearTimeout(r),t.abort()}},[e,n,p]),(0,v.useEffect)(()=>{u?.ok&&f.current?.focus()},[u]);let m=e=>{r(t=>({...t,...e})),a(!1),d(null)},h=o.state===`ready`?o.data:null,g=h!==null&&i&&!c&&e.disabled===null;return u?.ok?(0,q.jsxs)(`div`,{className:`feedback-body`,children:[(0,q.jsx)(Ui,{slot:`title`,level:2,id:`feedback-title`,children:`Feedback sent`}),(0,q.jsx)(`p`,{ref:f,tabIndex:-1,role:`status`,children:u.message}),(0,q.jsx)(`p`,{className:`note`,children:`It becomes a public GitHub issue in imagile-dev/toil, and the email address you gave hears when it is filed and when it closes.`}),(0,q.jsx)(`div`,{className:`feedback-actions`,children:(0,q.jsx)(B,{className:`btn btn--accent`,onPress:t,children:`Close`})})]}):(0,q.jsxs)(`form`,{className:`feedback-body`,onSubmit:async t=>{if(t.preventDefault(),g){l(!0);try{let t=await e.send(n),r=CI(t);d(r?.sent?{ok:!0,message:r.message??`Sent.`}:{ok:!1,message:r?`toil sent nothing: the report was not approved.`:wI(t)})}catch(e){d({ok:!1,message:e instanceof Error?e.message:String(e)})}finally{l(!1)}}},noValidate:!0,children:[(0,q.jsx)(Ui,{slot:`title`,level:2,id:`feedback-title`,children:`Send feedback to Imagile`}),(0,q.jsxs)(`p`,{className:`note`,children:[`A bug report or a feature request, sent through `,(0,q.jsx)(`code`,{children:`toil feedback`}),`. Only what you type below is sent, with toil's version and commit.`]}),(0,q.jsxs)(qd,{className:`shells`,orientation:`horizontal`,value:n.kind,onChange:e=>m({kind:e}),children:[(0,q.jsx)(Ai,{className:`feedback-label`,children:`Kind`}),(0,q.jsx)(Jd,{value:`bug`,className:`shell-choice`,children:`Bug report`}),(0,q.jsx)(Jd,{value:`feature`,className:`shell-choice`,children:`Feature request`})]}),(0,q.jsxs)(gf,{className:`field-text`,value:n.title,onChange:e=>m({title:e}),maxLength:120,isRequired:!0,children:[(0,q.jsx)(Ai,{className:`feedback-label`,children:`Title`}),(0,q.jsx)(Va,{autoComplete:`off`})]}),(0,q.jsxs)(gf,{className:`field-text feedback-details`,value:n.body,onChange:e=>m({body:e}),maxLength:4e3,isRequired:!0,children:[(0,q.jsx)(Ai,{className:`feedback-label`,children:`Details`}),(0,q.jsx)(mf,{rows:5})]}),(0,q.jsxs)(gf,{className:`field-text`,type:`email`,value:n.email,onChange:e=>m({email:e}),isRequired:!0,children:[(0,q.jsx)(Ai,{className:`feedback-label`,children:`Your email, kept private`}),(0,q.jsx)(Va,{autoComplete:`email`,spellCheck:!1})]}),(0,q.jsxs)(`section`,{className:`feedback-preview`,"aria-labelledby":`feedback-preview-title`,children:[(0,q.jsx)(`h3`,{id:`feedback-preview-title`,children:`Exactly what will be sent`}),(0,q.jsxs)(`div`,{"aria-live":`polite`,children:[o.state===`idle`&&(0,q.jsx)(`p`,{className:`note`,children:`Fill in the title, details and email to see the report.`}),o.state===`loading`&&(0,q.jsx)(`p`,{className:`note`,children:`Asking toil for the report…`}),o.state===`problem`&&(0,q.jsx)(`p`,{className:`failure`,children:o.message}),h&&(0,q.jsxs)(`p`,{className:`note`,children:[`To `,(0,q.jsx)(`code`,{children:h.endpoint}),`:`]})]}),h&&(0,q.jsx)(`pre`,{className:`feedback-report`,tabIndex:0,"aria-label":`The report, as toil would send it`,children:JSON.stringify(h.report,null,2)})]}),h&&(0,q.jsxs)(`div`,{className:`feedback-consent`,children:[(0,q.jsx)(`p`,{id:`feedback-disclaimer`,className:`feedback-disclaimer`,children:h.disclaimer}),(0,q.jsxs)(Ia,{className:`check`,isSelected:i,onChange:a,isRequired:!0,"aria-describedby":`feedback-disclaimer`,children:[(0,q.jsx)(`span`,{className:`box`,"aria-hidden":`true`,children:i?`✓`:``}),`I have removed company data from this report and agree to send it to Imagile LLC.`]})]}),e.disabled&&(0,q.jsxs)(`p`,{className:`config-off`,children:[(0,q.jsx)(`strong`,{children:`Sending is turned off.`}),` `,e.disabled]}),u&&!u.ok&&(0,q.jsx)(`p`,{role:`alert`,className:`failure`,children:u.message}),(0,q.jsxs)(`div`,{className:`feedback-actions`,children:[(0,q.jsx)(B,{type:`submit`,className:`btn btn--accent`,isDisabled:!g,children:c?`Sending…`:`Send`}),(0,q.jsx)(B,{className:`btn`,onPress:t,children:`Cancel`})]})]})}function AI(e){let t=e.replace(/^#\/?/,``).split(`/`);if(t[0]===`settings`){let e=t[1]===`dossiers`||t[1]===`toil`||t[1]===`usage`||t[1]===`agent-usage`||t[1]===`agent`?t[1]:`connections`,n=t.slice(2).filter(Boolean).map(e=>{try{return decodeURIComponent(e)}catch{return e}});return n.length?{view:`settings`,page:e,at:n}:{view:`settings`,page:e}}if(t[0]===`dossier`&&t[1]){let e=decodeURIComponent(t[1]);if(t[2]===`item`&&t[3])return{view:`item`,dossier:e,id:decodeURIComponent(t.slice(3).join(`/`))};if(t[2]===`assignment`&&t[3])return{view:`assignment`,dossier:e,id:decodeURIComponent(t[3])};if(t[2]===`prs`)return{view:`prs`,dossier:e};if(t[2]===`people`)return{view:`people`,dossier:e};if(t[2]===`command-center`)return{view:`command-center`,dossier:e};if(t[2]===`board`&&t[3])return{view:`dashboard`,dossier:e,person:decodeURIComponent(t.slice(3).join(`/`))};if(t[2]===`worklog`&&t[3]===`standup`){let[n,r]=[t[4],t[5]].map(e=>e?decodeURIComponent(e):void 0),i=[n,r].filter(e=>e!==void 0&&e!==``&&!bF(e));return i.length||!n&&r?{view:`standup`,dossier:e,from:null,to:null,ignored:i.join(`, `)||r}:{view:`standup`,dossier:e,from:n??null,to:r||n||null}}return t[2]===`worklog`?{view:`worklog`,dossier:e,day:bF(t[3])?t[3]:null}:{view:`dashboard`,dossier:e}}return{view:`dossiers`}}function jI(){let[e,t]=(0,v.useState)(()=>AI(window.location.hash));return(0,v.useEffect)(()=>{let e=()=>t(AI(window.location.hash));return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}var MI=e=>({ok:!1,message:e instanceof Error?e.message:String(e)});function NI({execute:e,agent:t,config:n,now:r,preview:i,agentSettings:a,feedback:o,modelUsage:s,worklog:c,startReady:l,assignments:u,synced:d,afterDescribe:f,serverStatus:p}){let m=jI(),{mine:h,mark:g}=Mw(),_=(0,v.useMemo)(()=>u?jw(u,g):void 0,[u,g]),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)({}),C=rS(),w=mp(C.theme),T=(0,v.useRef)(null),E=(0,v.useRef)(!0),D=m.view===`dossiers`||m.view===`settings`?null:m.dossier;(0,v.useEffect)(()=>{if(m.view!==`dossiers`||y)return;let t=!0;return jb(e).then(e=>t&&b({ok:!0,value:e}),e=>t&&b(MI(e))),()=>{t=!1}},[m.view,y,e]);let O=(m.view===`dossiers`&&y?.ok?y.value.dossiers.map(e=>e.name):[]).find(e=>!x[e]);(0,v.useEffect)(()=>{if(!O)return;let t=!0;return Ab(e,O).then(e=>t&&S(t=>({...t,[O]:{ok:!0,value:e}})),e=>t&&S(t=>({...t,[O]:MI(e)}))),()=>{t=!1}},[O,e]);let k=m.view===`dashboard`&&D&&x[D]?.ok?D:null;(0,v.useEffect)(()=>{k&&Bk(k)},[k]);let A=e=>{if(f?.(),!e.renamed){b(t=>t?.ok?{ok:!0,value:{...t.value,dossiers:t.value.dossiers.map(t=>t.name===e.name?{...t,description:e.description}:t)}}:t),S(t=>{let n=t[e.name];return n?.ok?{...t,[e.name]:{ok:!0,value:{...n.value,description:e.description}}}:t});return}let{from:t,to:n}=e.renamed;if(Vk(t,n),b(null),S(({[t]:e,...n})=>n),D===t){let e=window.location.hash.replace(/^#\/dossier\/[^/]+/,``);window.location.hash=`${Am(n)}${e}`}};(0,v.useEffect)(()=>{if(!D||x[D])return;let t=!0;return Ab(e,D).then(e=>t&&S(t=>({...t,[D]:{ok:!0,value:e}})),e=>t&&S(t=>({...t,[D]:MI(e)}))),()=>{t=!1}},[D,x,e]);let j=JSON.stringify(m),ee=(0,v.useRef)(!1),te=m.view===`settings`&&!!m.at;(0,v.useEffect)(()=>{E.current?E.current=!1:ee.current=!te},[j,te]),(0,v.useEffect)(()=>{let e=ee.current?T.current?.querySelector(`#board-filter`)??T.current?.querySelector(`h1`):null;e&&(ee.current=!1,e.focus())});let ne=e=>{e.preventDefault(),T.current?.querySelector(`h1`)?.focus()},M=Wx(w.name),re=(e,t)=>Zb(w.lexicon,ax(w,C),e,t),N=[{href:`#/`,label:`Dossiers`,current:m.view===`dossiers`},...D?[{href:Am(D),label:D,current:m.view===`dashboard`},{href:Mm(D),label:`Pull requests`,current:m.view===`prs`},{href:Nm(D),label:`People`,current:m.view===`people`},{href:Pm(D),label:`Command Center`,current:m.view===`command-center`},{href:Im(D),label:`Worklog`,current:m.view===`worklog`||m.view===`standup`}]:[],{href:`#/settings`,label:`Settings`,current:m.view===`settings`}],ie=(0,v.useRef)(null),ae=ES(FI),oe=II(ie,!ae,N.map(e=>e.label).join(`|`)),se=ae||oe,ce=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(tT,{label:`Theme`,value:w.name,onChange:C.setTheme,options:sp.map(e=>({id:e.name,label:e.label}))}),Object.keys(w.schemes).length>1&&(0,q.jsx)(tT,{label:`Appearance`,value:C.scheme,onChange:e=>C.setScheme(e),options:[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}]})]}),le=(0,q.jsxs)(`a`,{className:`btn help-link`,href:JS(m.view,m.view===`settings`?m.page:void 0),target:`_blank`,rel:`noopener noreferrer`,"data-help-link":``,children:[`Help`,(0,q.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]}),P=D?x[D]:void 0,ue=e=>(0,q.jsxs)(`div`,{role:`alert`,className:`failure`,children:[(0,q.jsx)(`h1`,{tabIndex:-1,children:`The data didn't load`}),(0,q.jsx)(`p`,{children:e})]}),de;if(m.view===`settings`)de=(0,q.jsx)(_F,{page:m.page,...m.at?{at:m.at}:{},config:n??null,modelUsage:s??null,...a?{agent:a}:{}});else if(m.view===`dossiers`)de=y?y.ok?(0,q.jsx)(Uk,{dossiers:y.value.dossiers,calls:y.value.calls,loaded:x,now:r,synced:d??(i?null:{}),config:n??null,onDescribed:A}):ue(y.message):(0,q.jsx)(M.Loading,{message:re(`loading.dossiers`)});else if(!P)de=(0,q.jsx)(M.Loading,{message:re(`loading.dossier`,{name:m.dossier})});else if(!P.ok)de=ue(P.message);else{let i={dossier:P.value,byId:new Map(P.value.items.map(e=>[e.id,e])),prById:new Map((P.value.pullRequests??[]).map(e=>[e.id,e])),agent:t,now:r,execute:e,...n?{config:n}:{},..._?{assignments:_}:{},...l?{startReady:l}:_&&!_.disabled?{startReady:eA(_,m.dossier)}:{},refresh:()=>S(({[m.dossier]:e,...t})=>t),described:A};de=(0,q.jsx)(ym,{value:i,children:(0,q.jsxs)(Xw,{children:[(0,q.jsx)(Zw,{}),m.view===`item`?(0,q.jsx)(Yk,{id:m.id}):m.view===`assignment`?(0,q.jsx)(Zk,{id:m.id}):m.view===`prs`?(0,q.jsx)(HA,{}):m.view===`people`?(0,q.jsx)(DA,{}):m.view===`worklog`?(0,q.jsx)(pI,{api:c??null,day:m.day}):m.view===`standup`?(0,q.jsx)($F,{api:c??null,from:m.from,to:m.to,...m.ignored?{ignored:m.ignored}:{}}):m.view===`command-center`?(0,q.jsx)(_T,{}):(0,q.jsx)(kk,{...m.person?{person:m.person}:{}})]},m.dossier)})}return(0,q.jsx)(Nw,{assignments:_,dossier:D,mine:h,children:(0,q.jsx)($b,{value:w,children:(0,q.jsx)(rx,{value:C,children:(0,q.jsxs)(Kx,{value:M,children:[(0,q.jsx)(PI,{css:sp.map(pp).join(`
58
- `)}),(0,q.jsx)(zp,{theme:w.name}),(0,q.jsx)(`a`,{className:`skip`,href:`#main`,onClick:ne,children:`Skip to content`}),(0,q.jsxs)(`header`,{children:[i&&(0,q.jsxs)(`p`,{className:`banner`,role:`note`,children:[(0,q.jsx)(`strong`,{children:`Toil UI alpha, on sample data.`}),` Nothing here connects to a tracker.`]}),(0,q.jsx)(`div`,{className:`top`,"data-one-row":``,ref:ie,children:(0,q.jsxs)(M.Header,{children:[(0,q.jsx)(`a`,{className:`brand`,href:`#/`,children:(0,q.jsxs)(`span`,{className:`brand-name`,children:[(0,q.jsx)(`span`,{className:`wordmark`,children:`toil`}),` `,(0,q.jsx)(`span`,{className:`sticker`,children:(0,q.jsx)(`span`,{className:`sticker__face`,children:`UI`})})]})}),se?(0,q.jsx)(RI,{links:N,feedback:o,controls:ce,help:le}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`nav`,{"aria-label":`Views`,children:(0,q.jsx)(LI,{links:N})}),(0,q.jsxs)(`div`,{className:`settings`,children:[le,o&&(0,q.jsx)(DI,{api:o}),ce]})]})]})}),(0,q.jsx)($C,{load:p}),(0,q.jsx)(Pw,{}),(0,q.jsxs)(`p`,{className:`sync`,children:[i?`Sample data`:`Data`,` read `,Om(r),` through toil, read-only.`]})]}),(0,q.jsx)(`main`,{id:`main`,ref:T,"data-view":m.view,children:de})]})})})})}function PI({css:e}){let t=typeof CSSStyleSheet<`u`&&`replaceSync`in CSSStyleSheet.prototype&&`adoptedStyleSheets`in document;return(0,v.useInsertionEffect)(()=>{if(!t)return;let n=new CSSStyleSheet;return n.replaceSync(e),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==n)}},[e,t]),t?null:(0,q.jsx)(`style`,{children:e})}var FI=`(max-width: 1023px)`;function II(e,t,n){let[r,i]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let a=()=>{if(r!==null){(r.links!==n||window.innerWidth>r.width)&&i(null);return}let a=e.current;if(!t||!a)return;let o=[...a.querySelectorAll(`.brand, nav, .settings`)],s=[...a.querySelectorAll(`nav li`)],c=e=>{let t=e.map(e=>e.getBoundingClientRect()).filter(e=>e.height>0);return t.some(e=>t.some(t=>e.top>=t.bottom))};(c(o)||c(s))&&i({width:window.innerWidth,links:n})};return a(),window.addEventListener(`resize`,a),()=>window.removeEventListener(`resize`,a)},[e,t,n,r]),r!==null&&r.links===n}function LI({links:e,onFollow:t}){return(0,q.jsx)(`ul`,{children:e.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(`a`,{href:e.href,"aria-current":e.current?`page`:void 0,onClick:t,children:e.label})},e.href))})}function RI({links:e,feedback:t,controls:n,help:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=e.find(e=>e.current)?.label;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(gd,{isOpen:i,onOpenChange:a,children:[(0,q.jsxs)(B,{className:`btn menu-button`,"data-menu-button":``,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`menu-button__icon`,children:`☰`}),`Menu`]}),(0,q.jsx)(ou,{className:`popover nav-menu`,placement:`bottom end`,offset:6,children:(0,q.jsxs)(_d,{className:`nav-menu__dialog`,"aria-label":c?`Menu, on ${c}`:`Menu`,children:[(0,q.jsx)(`nav`,{"aria-label":`Views`,children:(0,q.jsx)(LI,{links:e,onFollow:()=>a(!1)})}),(0,q.jsxs)(`div`,{className:`nav-menu__settings`,children:[r,t&&(0,q.jsx)(B,{className:`btn feedback-open`,onPress:()=>{a(!1),s(!0)},children:`Feedback`}),n]})]})})]}),t&&(0,q.jsx)(OI,{api:t,isOpen:o,onOpenChange:s})]})}var zI=`X-Toil-UI-Session`,BI=`X-Toil-UI-CSRF`,VI=class extends Error{usage;constructor(e,t){super(e),this.usage=t}};async function HI(e,t){try{let t=await e.json();if(t.error?.message)return new VI(`${t.error.message}${t.error.fix?` ${t.error.fix}`:``}`,t.error.usage)}catch{}return Error(`${t} failed: the server answered ${e.status}.`)}async function UI(e=`./`,t=window.location,n=window.history){let r=new URLSearchParams(t.search).get(`token`);if(!r)throw Error(`This page needs the URL toil-ui printed when it started, which carries the launch token. A reloaded page forgets its session, so open that URL again.`);let i=await fetch(`${e}api/session`,{method:`POST`,credentials:`omit`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r})}),a=new URLSearchParams(t.search);a.delete(`token`);let o=a.toString();if(n.replaceState(null,``,`${t.pathname}${o?`?${o}`:``}${t.hash}`),!i.ok)throw await HI(i,`Signing in`);return await i.json()}var WI=(e,t,n,r={})=>fetch(`${e}${n}`,{method:r.body===void 0?`GET`:`POST`,credentials:`omit`,headers:{[zI]:t.session,...r.body===void 0?{}:{"Content-Type":`application/json`,[BI]:t.csrf}},...r.body===void 0?{}:{body:JSON.stringify(r.body)},signal:r.signal}),GI=e=>typeof e==`object`&&!!e&&`ok`in e&&`meta`in e;function KI(e,t=`./`){return async(n,r={},i={})=>{let a=await WI(t,e,`api/execute`,{body:{command:n,input:r},signal:i.signal}),o;try{o=await a.clone().json()}catch{o=void 0}if(GI(o))return o;throw await HI(a,`toil ${n}`)}}function qI(e,t=`./`){let n=async(e,t)=>{if(!e.ok)throw await HI(e,t);return await e.json()};return{status:async()=>n(await WI(t,e,`api/sync`),`Reading the sync status`),start:async r=>n(await WI(t,e,`api/sync`,{body:r===void 0?{}:{dossier:r}}),`Starting the sync`),wipe:async()=>n(await WI(t,e,`api/cache/wipe`,{body:{confirm:`wipe`}}),`Wiping the cache`)}}function JI(e,t=`./`){let n=async n=>{let r=await WI(t,e,n);if(!r.ok)throw await HI(r,n);return await r.json()};return{disabled:null,areas:()=>n(`api/config/areas`),settings:()=>n(`api/config/settings`),async run(n,r,i={}){let a=await WI(t,e,`api/config`,{body:{command:n,input:r,...i}}),o;try{o=await a.clone().json()}catch{o=void 0}if(GI(o))return o;throw await HI(a,`toil ${n}`)}}}function YI(e,t=`./`){let n=async(n,r,i)=>{let a=await WI(t,e,`api/feedback`,{body:{fields:n,...r?{consent:!0}:{}},...i?{signal:i}:{}}),o;try{o=await a.clone().json()}catch{o=void 0}if(GI(o))return o;throw await HI(a,`toil feedback`)};return{disabled:e.sample?SI:null,preview:(e,t)=>n(e,!1,t),send:e=>n(e,!0)}}var XI={claude:`Claude, through the Claude Agent SDK`,copilot:`GitHub Copilot, through the Copilot SDK`,codex:`Codex, through the Codex SDK`,scripted:aS,none:`nobody yet: no agent is set up`};async function ZI(e,t,n=`./`){let r=new Map;for(let i of t){let t=await WI(n,e,`api/agent/starters?dossier=${encodeURIComponent(i)}`);r.set(i,t.ok?await t.json():[])}return{...e.agent===`none`?{notice:`${oS} ${sS}`}:{},label:XI[e.agent]??e.agent,starters:e=>r.get(e)??[],async adapters(){let t=await WI(n,e,`api/agent/adapters`);if(!t.ok)throw await HI(t,`Reading the agents`);return await t.json()},async ask(t,r,i,a,o){let s=await WI(n,e,`api/agent/ask`,{body:{dossier:t,prompt:r,...i,...a?{chat:a}:{},...$I(o)}});if(!s.ok)throw await HI(s,`The question`);return await s.json()},async*stream(t,r,i,a,o,s){let c=await WI(n,e,`api/agent/ask`,{body:{dossier:t,prompt:r,stream:!0,...a,...o?{chat:o}:{},...$I(s)},...i?{signal:i}:{}});if(!c.ok)throw await HI(c,`The question`);/^application\/x-ndjson/.test(c.headers.get(`content-type`)??``)?yield*eL(c):yield await c.json()},async session(t){let r=await WI(n,e,`api/agent/session?chat=${encodeURIComponent(t)}`);if(!r.ok)throw await HI(r,`Reading the chat's session`);return await r.json()},async renew(t,r){let i=await WI(n,e,`api/agent/renew`,{body:{chat:t,dossier:r}});if(!i.ok)throw await HI(i,`Renewing the chat`);return await i.json()}}}async function QI(e,t=`./`){let n=await WI(t,e,`api/fingerprint`);if(!n.ok)throw await HI(n,`Reading the server's version`);return await n.json()}var $I=e=>({...e?.adapter?{adapter:e.adapter}:{},...e?.history?.length?{history:e.history}:{}});async function*eL(e){if(!e.body)throw Error(`The answer arrived with no body.`);let t=e.body.getReader(),n=new TextDecoder,r=``,i=!1,a=e=>{let t=JSON.parse(e);if(t.error)throw new VI(`${t.error.message??`The agent failed.`}${t.error.fix?` ${t.error.fix}`:``}`,t.error.usage);return t.done&&(i=!0),t.answer??null};for(;;){let{value:e,done:i}=await t.read();e&&(r+=n.decode(e,{stream:!0}));let o;for(;(o=r.indexOf(`
59
- `))>=0;){let e=r.slice(0,o).trim();if(r=r.slice(o+1),!e)continue;let t=a(e);t&&(yield t)}if(i)break}if(r.trim()){let e=a(r.trim());e&&(yield e)}if(!i)throw Error(`The answer stopped partway: the connection to Toil UI closed.`)}async function tL(e,t){if(!e.body)throw Error(`The install answered with no body.`);let n=e.body.getReader(),r=new TextDecoder,i=``,a=null,o=e=>{let n=JSON.parse(e);if(n.error)throw Error(`${n.error.message??`The install failed.`}${n.error.fix?` ${n.error.fix}`:``}`);typeof n.line==`string`&&t(n.line),n.done&&n.status&&(a=n.status)};for(;;){let{value:e,done:t}=await n.read();e&&(i+=r.decode(e,{stream:!0}));let a;for(;(a=i.indexOf(`
60
- `))>=0;){let e=i.slice(0,a).trim();i=i.slice(a+1),e&&o(e)}if(t)break}if(i.trim()&&o(i.trim()),!a)throw Error(`The install stopped partway: the connection to Toil UI closed.`);return a}function nL(e,t=`./`){let n=async(e,t)=>{if(!e.ok)throw await HI(e,t);return await e.json()};return{status:async()=>n(await WI(t,e,`api/agent/settings`),`Reading the agent settings`),save:async r=>n(await WI(t,e,`api/agent/settings`,{body:r}),`Saving the agent settings`),async prompt(n,r){let i=await WI(t,e,`api/agent/prompt?${new URLSearchParams({...n?{dossier:n}:{},theme:r.theme,voice:r.voice?`on`:`off`})}`);if(!i.ok)throw await HI(i,`Reading the full prompt`);return(await i.json()).prompt},async installPlan(n){let r=await WI(t,e,`api/agent/install?adapter=${encodeURIComponent(n)}`);if(!r.ok)throw await HI(r,`Reading the install command`);return await r.json()},async install(n,r,i,a){let o=await WI(t,e,`api/agent/install`,{body:{adapter:n,command:r},...a?{signal:a}:{}});if(!o.ok)throw await HI(o,`The install`);return tL(o,i)}}}function rL(e,t=`./`){let n=async(e,t)=>{if(!e.ok)throw await HI(e,t);return await e.json()},r=e=>new URLSearchParams(Object.entries(e).filter(e=>e[1]!==void 0)).toString();return{disabled:e.sample?lI:null,month:async(i,a)=>n(await WI(t,e,`api/worklog/month?${r({dossier:i,month:a})}`),`Reading the worklog`),day:async(i,a)=>n(await WI(t,e,`api/worklog/day?${r({dossier:i,day:a})}`),`Reading the page`),rebuild:async(r,i)=>n(await WI(t,e,`api/worklog/rebuild`,{body:{dossier:r,day:i}}),`Rebuilding the page`),addNote:async(r,i)=>n(await WI(t,e,`api/worklog/note`,{body:{dossier:r,text:i}}),`Adding the note`),exportTo:async(r,i,a)=>n(await WI(t,e,`api/worklog/export`,{body:{dossier:r,...i,folder:a}}),`The export`),standup:async(i,a,o)=>n(await WI(t,e,`api/worklog/standup?${r({dossier:i,from:a,to:o})}`),`Building the stand-up`)}}function iL(e,t=`./`){let n=async(e,t)=>{if(!e.ok)throw await HI(e,t);return await e.json()};return{view:async()=>n(await WI(t,e,`api/usage`),`Reading the model usage`),save:async r=>n(await WI(t,e,`api/usage/settings`,{body:r}),`Saving the caps`)}}var aL=1e3;function oL(e){let t=(e?.dossiers??[]).map(e=>e.lastSyncAt).sort();return t.length?t[t.length-1]:null}function sL({dossier:e}){let t=e.sources.filter(e=>e.status===`failed`);return(0,q.jsxs)(`li`,{className:`sync-dossier`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`strong`,{children:e.name}),` `,(0,q.jsxs)(`span`,{className:`sync-when`,children:[`synced `,Om(e.lastSyncAt)]})]}),e.status===`failed`&&t.length===0&&(0,q.jsxs)(`p`,{className:`sync-bad`,children:[`The latest sync couldn't read this dossier: `,e.error]}),e.sources.length>0&&(0,q.jsx)(`ul`,{className:`sync-sources`,"aria-label":`${e.name} sources`,children:e.sources.map(e=>(0,q.jsx)(`li`,{className:e.status===`failed`?`sync-bad`:void 0,children:e.status===`ok`?(0,q.jsxs)(q.Fragment,{children:[Cm(e.area),` `,(0,q.jsxs)(`span`,{className:`sync-area`,children:[`(`,e.area,`)`]}),`: up to date`]}):(0,q.jsxs)(q.Fragment,{children:[Cm(e.area),` `,(0,q.jsxs)(`span`,{className:`sync-area`,children:[`(`,e.area,`)`]}),`: failed `,Om(e.lastAttemptAt),`. `,e.error,` `,e.fix,` `,(0,q.jsx)(`strong`,{children:e.stale&&e.lastSuccessAt?`Showing the last good copy, from ${Om(e.lastSuccessAt)}.`:`Nothing synced from it yet.`})]})},e.area))})]})}function cL({client:e,onChange:t,pollMs:n=aL}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),d=(0,v.useRef)(!1),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useCallback)(e=>{if(i(e),o(null),d.current&&!e.job.running){let n=e.dossiers.flatMap(e=>e.sources).filter(e=>e.status===`failed`).length;u(e.job.error?`The sync stopped: ${e.job.error}`:n?`Sync finished; ${n} source${n===1?``:`s`} failed.`:`Sync finished.`),t(e)}d.current=e.job.running},[t]),h=e=>o(e instanceof Error?e.message:String(e));(0,v.useEffect)(()=>{e.status().then(m,h)},[e,m]);let g=r?.job.running===!0;(0,v.useEffect)(()=>{if(!g)return;let t=setInterval(()=>e.status().then(m,h),n);return()=>clearInterval(t)},[g,e,m,n]),(0,v.useEffect)(()=>{s&&f.current?.focus()},[s]);let _=()=>{u(`Sync started.`),d.current=!0,e.start().then(m,h)},y=()=>{c(!1),p.current?.focus()},b=()=>{e.wipe().then(e=>{c(!1),m(e),u(`The cache is wiped. Nothing synced is left on this machine.`),t(e),p.current?.focus()},h)},x=e=>{e.key===`Escape`&&y()},S=r?.job,C=oL(r);return(0,q.jsx)(`aside`,{className:`sync-panel`,"aria-labelledby":`sync-heading`,children:(0,q.jsxs)(`div`,{className:`sync-inner`,children:[(0,q.jsxs)(`div`,{className:`sync-head`,children:[(0,q.jsx)(`h2`,{id:`sync-heading`,children:`Sync`}),(0,q.jsx)(`p`,{className:`sync-when`,children:r?C?`Last synced ${Om(C)}. Kept ${r.retentionDays} days.`:`Nothing synced yet: press Sync now to read your dossiers through toil.`:`Reading the cache…`}),(0,q.jsxs)(`div`,{className:`sync-actions`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:_,disabled:!r||g,children:g?`Syncing…`:`Sync now`}),(0,q.jsx)(`button`,{type:`button`,ref:p,onClick:()=>c(!0),disabled:!r||g,"aria-expanded":s,"aria-controls":`sync-confirm`,children:`Wipe the cache…`})]})]}),(0,q.jsx)(`p`,{role:`status`,className:`sync-live`,children:g&&S?`Syncing ${S.dossier??`the dossiers`}: ${S.dossiersDone} of ${S.dossiersTotal||`?`} dossiers, ${S.requests} requests, ${S.pages} pages${S.retries?`, ${S.retries} retries`:``}. ${S.messages[S.messages.length-1]??``}`:l}),g&&S&&S.dossiersTotal>0&&(0,q.jsx)(`progress`,{className:`sync-progress`,max:S.dossiersTotal,value:S.dossiersDone,"aria-label":`Dossiers synced`}),a&&(0,q.jsx)(`p`,{role:`alert`,className:`sync-bad`,children:a}),S&&!g&&S.error&&(0,q.jsxs)(`p`,{className:`sync-bad`,children:[`The last sync stopped: `,S.error]}),s&&(0,q.jsxs)(`div`,{className:`sync-confirm`,id:`sync-confirm`,role:`group`,"aria-labelledby":`sync-confirm-text`,onKeyDown:x,children:[(0,q.jsx)(`p`,{id:`sync-confirm-text`,children:`Delete everything Toil UI synced to this machine? The dashboards will be empty until the next sync, which fetches everything again. Your trackers are not touched.`}),(0,q.jsxs)(`div`,{className:`sync-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`sync-danger`,onClick:b,children:`Wipe it`}),(0,q.jsx)(`button`,{type:`button`,ref:f,onClick:y,children:`Cancel`})]})]}),r&&r.dossiers.length>0&&(0,q.jsx)(`ul`,{className:`sync-dossiers`,"aria-label":`Dossiers in the cache`,children:r.dossiers.map(e=>(0,q.jsx)(sL,{dossier:e},e.name))})]})})}var lL=`X-Toil-UI-Session`,uL=`X-Toil-UI-CSRF`;async function dL(e,t){try{let t=await e.json();if(t.error?.message)return new VI(`${t.error.message}${t.error.fix?` ${t.error.fix}`:``}`,t.error.usage)}catch{}return Error(`${t} failed: the server answered ${e.status}.`)}var fL=`This Toil UI assigns nothing: start toil-ui with its cache to assign items to an agent.`;function pL(e,t=`./`){let n=async(n,r,i)=>{let a=await fetch(`${t}api/${n}`,{method:i===void 0?`GET`:`POST`,credentials:`omit`,headers:{[lL]:e.session,...i===void 0?{}:{"Content-Type":`application/json`,[uL]:e.csrf}},...i===void 0?{}:{body:JSON.stringify(i)}});if(!a.ok)throw await dL(a,r);return await a.json()};return{disabled:e.assignments?null:fL,list:(e,t)=>n(`assignments?dossier=${encodeURIComponent(e)}${t?.inbox===!1?`&inbox=0`:``}`,`Reading the assignments`),get:e=>n(`assignments/one?id=${encodeURIComponent(e)}`,`Reading the assignment`),assign:e=>n(`assignments`,`Assigning the item`,e),start:(e,t)=>n(`assignments/start`,`Starting the assignment`,{id:e,...t?{adapter:t}:{}}),cancel:e=>n(`assignments/cancel`,`Stopping the assignment`,{id:e}),apply:(e,t)=>n(`assignments/apply`,`Applying the proposal`,{id:e,proposal:t}),dismiss:(e,t)=>n(`assignments/dismiss`,`Dismissing the proposal`,{id:e,proposal:t}),finish:e=>n(`assignments/finish`,`Marking it reviewed`,{id:e}),renew:e=>n(`assignments/renew`,`Renewing the assignment`,{id:e}),async events(n,r,i){let a=await fetch(`${t}api/assignments/events?since=${n}`,{credentials:`omit`,headers:{[lL]:e.session},signal:i});if(!a.ok||!a.body)throw await dL(a,`Reading the assignment events`);let o=a.body.getReader(),s=new TextDecoder,c=``;for(;;){let{value:e,done:t}=await o.read();e&&(c+=s.decode(e,{stream:!0}));let n;for(;(n=c.indexOf(`
61
- `))>=0;){let e=c.slice(0,n).trim();c=c.slice(n+1),e&&r(JSON.parse(e))}if(t){let e=(c+s.decode()).trim();e&&r(JSON.parse(e));return}}},...e.sample?{}:{saveSettings:e=>n(`assignments/settings`,`Saving the limits`,{concurrent:e.concurrent,timeLimitMinutes:e.timeLimitMinutes})}}}var mL=e=>Object.fromEntries((e?.dossiers??[]).map(e=>[e.name,{at:e.lastSyncAt,status:e.status}])),hL=(0,Af.createRoot)(document.getElementById(`root`));function gL({session:e,execute:t,agent:n,names:r,status:i}){let[a,o]=(0,v.useState)(()=>oL(i)),[s,c]=(0,v.useState)(()=>mL(i)),[l,u]=(0,v.useState)(n),[d]=(0,v.useState)(()=>e.agentSettings?nL(e):null),f=(0,v.useCallback)(t=>{ZI({...e,agent:t.kind},r).then(e=>{u(e),m(e=>e+1)})},[e,r]),[p,m]=(0,v.useState)(0),[h]=(0,v.useState)(()=>e.sync?qI(e):null),[g]=(0,v.useState)(()=>JI(e)),[_]=(0,v.useState)(()=>YI(e)),[y]=(0,v.useState)(()=>rL(e)),[b]=(0,v.useState)(()=>iL(e)),[x]=(0,v.useState)(()=>pL(e)),[S]=(0,v.useState)(()=>()=>QI(e)),C=(0,v.useCallback)(e=>{o(oL(e)),c(mL(e)),m(e=>e+1)},[]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(NI,{serverStatus:S,execute:t,agent:l,config:g,feedback:_,modelUsage:b,assignments:x,worklog:y,...e.sync?{synced:s,afterDescribe:()=>void h?.status().then(e=>c(mL(e)),()=>void 0)}:{},now:a??e.now,preview:e.sample,...d?{agentSettings:{client:d,onChange:f,...r[0]?{dossier:r[0]}:{}}}:{}},p),h&&(0,q.jsx)(cL,{client:h,onChange:C})]})}async function _L(){let e=await UI(),t=KI(e),n=await t(`dossiers list`,{},fb),r=n.ok?(n.data.dossiers??[]).map(e=>String(e.name)):[],i=await ZI(e,r),a=e.sync?await qI(e).status().catch(()=>null):null;hL.render((0,q.jsx)(v.StrictMode,{children:(0,q.jsx)(gL,{session:e,execute:t,agent:i,names:r,status:a})}))}_L().catch(e=>{hL.render((0,q.jsx)(`main`,{id:`main`,children:(0,q.jsxs)(`div`,{role:`alert`,className:`failure`,children:[(0,q.jsx)(`h1`,{children:`Toil UI couldn't start`}),(0,q.jsx)(`p`,{children:e instanceof Error?e.message:String(e)})]})}))});export{lx as a,br as c,o as d,c as f,cx as i,m as l,dS as n,J as o,qx as r,Pp as s,bO as t,u};