@jonit-dev/night-watch-cli 1.8.14-beta.7 → 1.8.15

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 (68) hide show
  1. package/dist/cli.js +1611 -409
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/doctor.d.ts.map +1 -1
  4. package/dist/commands/doctor.js +16 -0
  5. package/dist/commands/doctor.js.map +1 -1
  6. package/dist/commands/init.d.ts.map +1 -1
  7. package/dist/commands/init.js +13 -0
  8. package/dist/commands/init.js.map +1 -1
  9. package/dist/commands/install.d.ts +4 -0
  10. package/dist/commands/install.d.ts.map +1 -1
  11. package/dist/commands/install.js +26 -4
  12. package/dist/commands/install.js.map +1 -1
  13. package/dist/commands/logs.d.ts.map +1 -1
  14. package/dist/commands/logs.js +14 -4
  15. package/dist/commands/logs.js.map +1 -1
  16. package/dist/commands/merge.d.ts.map +1 -1
  17. package/dist/commands/merge.js +20 -0
  18. package/dist/commands/merge.js.map +1 -1
  19. package/dist/commands/queue.d.ts.map +1 -1
  20. package/dist/commands/queue.js +11 -7
  21. package/dist/commands/queue.js.map +1 -1
  22. package/dist/commands/review.d.ts.map +1 -1
  23. package/dist/commands/review.js +26 -0
  24. package/dist/commands/review.js.map +1 -1
  25. package/dist/commands/run.d.ts.map +1 -1
  26. package/dist/commands/run.js +24 -0
  27. package/dist/commands/run.js.map +1 -1
  28. package/dist/commands/shared/telemetry.d.ts +27 -0
  29. package/dist/commands/shared/telemetry.d.ts.map +1 -0
  30. package/dist/commands/shared/telemetry.js +73 -0
  31. package/dist/commands/shared/telemetry.js.map +1 -0
  32. package/dist/commands/status.d.ts.map +1 -1
  33. package/dist/commands/status.js +24 -0
  34. package/dist/commands/status.js.map +1 -1
  35. package/dist/commands/telemetry.d.ts +3 -0
  36. package/dist/commands/telemetry.d.ts.map +1 -0
  37. package/dist/commands/telemetry.js +52 -0
  38. package/dist/commands/telemetry.js.map +1 -0
  39. package/dist/commands/ux.d.ts +14 -0
  40. package/dist/commands/ux.d.ts.map +1 -0
  41. package/dist/commands/ux.js +169 -0
  42. package/dist/commands/ux.js.map +1 -0
  43. package/dist/scripts/night-watch-cron.sh +36 -12
  44. package/dist/telemetry-bootstrap.d.ts +2 -0
  45. package/dist/telemetry-bootstrap.d.ts.map +1 -0
  46. package/dist/telemetry-bootstrap.js +32 -0
  47. package/dist/telemetry-bootstrap.js.map +1 -0
  48. package/dist/templates/night-watch.config.json +14 -0
  49. package/dist/web/assets/index-BheLL2O2.css +1 -0
  50. package/dist/web/assets/index-BsTuwxzi.js +447 -0
  51. package/dist/web/index.html +2 -2
  52. package/package.json +2 -2
  53. package/dist/web/assets/index-6Yf-Q6Di.js +0 -442
  54. package/dist/web/assets/index-B6E6kOoR.js +0 -406
  55. package/dist/web/assets/index-BbiKFOgi.css +0 -1
  56. package/dist/web/assets/index-C-xpWpS8.css +0 -1
  57. package/dist/web/assets/index-C3BV1Hoa.js +0 -406
  58. package/dist/web/assets/index-CEYe-290.js +0 -412
  59. package/dist/web/assets/index-CL3Q-KB4.css +0 -1
  60. package/dist/web/assets/index-DIMUXIP8.css +0 -1
  61. package/dist/web/assets/index-DatF4suf.css +0 -1
  62. package/dist/web/assets/index-DpvzoXEv.js +0 -442
  63. package/dist/web/assets/index-Ds8OqaCa.css +0 -1
  64. package/dist/web/assets/index-DyME41HV.css +0 -1
  65. package/dist/web/assets/index-FDOCfjkP.js +0 -442
  66. package/dist/web/assets/index-NR27JE3b.js +0 -406
  67. package/dist/web/assets/index-Q3IYCcdZ.js +0 -447
  68. package/dist/web/assets/index-uBao8iYf.js +0 -447
@@ -1,406 +0,0 @@
1
- var oy=Object.defineProperty;var fg=l=>{throw TypeError(l)};var dy=(l,r,d)=>r in l?oy(l,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):l[r]=d;var hg=(l,r,d)=>dy(l,typeof r!="symbol"?r+"":r,d),bf=(l,r,d)=>r.has(l)||fg("Cannot "+d);var J=(l,r,d)=>(bf(l,r,"read from private field"),d?d.call(l):r.get(l)),et=(l,r,d)=>r.has(l)?fg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(l):r.set(l,d),Ce=(l,r,d,c)=>(bf(l,r,"write to private field"),c?c.call(l,d):r.set(l,d),d),je=(l,r,d)=>(bf(l,r,"access private method"),d);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const b of h.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&c(b)}).observe(document,{childList:!0,subtree:!0});function d(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(f){if(f.ep)return;f.ep=!0;const h=d(f);fetch(f.href,h)}})();function Qf(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function fy(l){if(Object.prototype.hasOwnProperty.call(l,"__esModule"))return l;var r=l.default;if(typeof r=="function"){var d=function c(){return this instanceof c?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};d.prototype=r.prototype}else d={};return Object.defineProperty(d,"__esModule",{value:!0}),Object.keys(l).forEach(function(c){var f=Object.getOwnPropertyDescriptor(l,c);Object.defineProperty(d,c,f.get?f:{enumerable:!0,get:function(){return l[c]}})}),d}var Nf={exports:{}},Qi={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var mg;function hy(){if(mg)return Qi;mg=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function d(c,f,h){var b=null;if(h!==void 0&&(b=""+h),f.key!==void 0&&(b=""+f.key),"key"in f){h={};for(var N in f)N!=="key"&&(h[N]=f[N])}else h=f;return f=h.ref,{$$typeof:l,type:c,key:b,ref:f!==void 0?f:null,props:h}}return Qi.Fragment=r,Qi.jsx=d,Qi.jsxs=d,Qi}var gg;function my(){return gg||(gg=1,Nf.exports=hy()),Nf.exports}var s=my(),Sf={exports:{}},Le={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var xg;function gy(){if(xg)return Le;xg=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),b=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),_=Symbol.iterator;function k(L){return L===null||typeof L!="object"?null:(L=_&&L[_]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function $(L,le,ge){this.props=L,this.context=le,this.refs=A,this.updater=ge||S}$.prototype.isReactComponent={},$.prototype.setState=function(L,le){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,le,"setState")},$.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function B(){}B.prototype=$.prototype;function M(L,le,ge){this.props=L,this.context=le,this.refs=A,this.updater=ge||S}var X=M.prototype=new B;X.constructor=M,C(X,$.prototype),X.isPureReactComponent=!0;var ie=Array.isArray;function F(){}var Z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function ee(L,le,ge){var ve=ge.ref;return{$$typeof:l,type:L,key:le,ref:ve!==void 0?ve:null,props:ge}}function O(L,le){return ee(L.type,le,L.props)}function ne(L){return typeof L=="object"&&L!==null&&L.$$typeof===l}function ae(L){var le={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ge){return le[ge]})}var he=/\/+/g;function pe(L,le){return typeof L=="object"&&L!==null&&L.key!=null?ae(""+L.key):le.toString(36)}function re(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(F,F):(L.status="pending",L.then(function(le){L.status==="pending"&&(L.status="fulfilled",L.value=le)},function(le){L.status==="pending"&&(L.status="rejected",L.reason=le)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,le,ge,ve,we){var xe=typeof L;(xe==="undefined"||xe==="boolean")&&(L=null);var Te=!1;if(L===null)Te=!0;else switch(xe){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(L.$$typeof){case l:case r:Te=!0;break;case j:return Te=L._init,P(Te(L._payload),le,ge,ve,we)}}if(Te)return we=we(L),Te=ve===""?"."+pe(L,0):ve,ie(we)?(ge="",Te!=null&&(ge=Te.replace(he,"$&/")+"/"),P(we,le,ge,"",function(Dt){return Dt})):we!=null&&(ne(we)&&(we=O(we,ge+(we.key==null||L&&L.key===we.key?"":(""+we.key).replace(he,"$&/")+"/")+Te)),le.push(we)),1;Te=0;var Ze=ve===""?".":ve+":";if(ie(L))for(var We=0;We<L.length;We++)ve=L[We],xe=Ze+pe(ve,We),Te+=P(ve,le,ge,xe,we);else if(We=k(L),typeof We=="function")for(L=We.call(L),We=0;!(ve=L.next()).done;)ve=ve.value,xe=Ze+pe(ve,We++),Te+=P(ve,le,ge,xe,we);else if(xe==="object"){if(typeof L.then=="function")return P(re(L),le,ge,ve,we);throw le=String(L),Error("Objects are not valid as a React child (found: "+(le==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":le)+"). If you meant to render a collection of children, use an array instead.")}return Te}function te(L,le,ge){if(L==null)return L;var ve=[],we=0;return P(L,ve,"","",function(xe){return le.call(ge,xe,we++)}),ve}function de(L){if(L._status===-1){var le=L._result;le=le(),le.then(function(ge){(L._status===0||L._status===-1)&&(L._status=1,L._result=ge)},function(ge){(L._status===0||L._status===-1)&&(L._status=2,L._result=ge)}),L._status===-1&&(L._status=0,L._result=le)}if(L._status===1)return L._result.default;throw L._result}var me=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var le=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(le))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},_e={map:te,forEach:function(L,le,ge){te(L,function(){le.apply(this,arguments)},ge)},count:function(L){var le=0;return te(L,function(){le++}),le},toArray:function(L){return te(L,function(le){return le})||[]},only:function(L){if(!ne(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Le.Activity=T,Le.Children=_e,Le.Component=$,Le.Fragment=d,Le.Profiler=f,Le.PureComponent=M,Le.StrictMode=c,Le.Suspense=y,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Le.__COMPILER_RUNTIME={__proto__:null,c:function(L){return Z.H.useMemoCache(L)}},Le.cache=function(L){return function(){return L.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(L,le,ge){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ve=C({},L.props),we=L.key;if(le!=null)for(xe in le.key!==void 0&&(we=""+le.key),le)!R.call(le,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&le.ref===void 0||(ve[xe]=le[xe]);var xe=arguments.length-2;if(xe===1)ve.children=ge;else if(1<xe){for(var Te=Array(xe),Ze=0;Ze<xe;Ze++)Te[Ze]=arguments[Ze+2];ve.children=Te}return ee(L.type,we,ve)},Le.createContext=function(L){return L={$$typeof:b,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:h,_context:L},L},Le.createElement=function(L,le,ge){var ve,we={},xe=null;if(le!=null)for(ve in le.key!==void 0&&(xe=""+le.key),le)R.call(le,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(we[ve]=le[ve]);var Te=arguments.length-2;if(Te===1)we.children=ge;else if(1<Te){for(var Ze=Array(Te),We=0;We<Te;We++)Ze[We]=arguments[We+2];we.children=Ze}if(L&&L.defaultProps)for(ve in Te=L.defaultProps,Te)we[ve]===void 0&&(we[ve]=Te[ve]);return ee(L,xe,we)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(L){return{$$typeof:N,render:L}},Le.isValidElement=ne,Le.lazy=function(L){return{$$typeof:j,_payload:{_status:-1,_result:L},_init:de}},Le.memo=function(L,le){return{$$typeof:p,type:L,compare:le===void 0?null:le}},Le.startTransition=function(L){var le=Z.T,ge={};Z.T=ge;try{var ve=L(),we=Z.S;we!==null&&we(ge,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(F,me)}catch(xe){me(xe)}finally{le!==null&&ge.types!==null&&(le.types=ge.types),Z.T=le}},Le.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Le.use=function(L){return Z.H.use(L)},Le.useActionState=function(L,le,ge){return Z.H.useActionState(L,le,ge)},Le.useCallback=function(L,le){return Z.H.useCallback(L,le)},Le.useContext=function(L){return Z.H.useContext(L)},Le.useDebugValue=function(){},Le.useDeferredValue=function(L,le){return Z.H.useDeferredValue(L,le)},Le.useEffect=function(L,le){return Z.H.useEffect(L,le)},Le.useEffectEvent=function(L){return Z.H.useEffectEvent(L)},Le.useId=function(){return Z.H.useId()},Le.useImperativeHandle=function(L,le,ge){return Z.H.useImperativeHandle(L,le,ge)},Le.useInsertionEffect=function(L,le){return Z.H.useInsertionEffect(L,le)},Le.useLayoutEffect=function(L,le){return Z.H.useLayoutEffect(L,le)},Le.useMemo=function(L,le){return Z.H.useMemo(L,le)},Le.useOptimistic=function(L,le){return Z.H.useOptimistic(L,le)},Le.useReducer=function(L,le,ge){return Z.H.useReducer(L,le,ge)},Le.useRef=function(L){return Z.H.useRef(L)},Le.useState=function(L){return Z.H.useState(L)},Le.useSyncExternalStore=function(L,le,ge){return Z.H.useSyncExternalStore(L,le,ge)},Le.useTransition=function(){return Z.H.useTransition()},Le.version="19.2.4",Le}var vg;function If(){return vg||(vg=1,Sf.exports=gy()),Sf.exports}var U=If();const ze=Qf(U);var jf={exports:{}},Ii={},wf={exports:{}},Ef={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var pg;function xy(){return pg||(pg=1,(function(l){function r(P,te){var de=P.length;P.push(te);e:for(;0<de;){var me=de-1>>>1,_e=P[me];if(0<f(_e,te))P[me]=te,P[de]=_e,de=me;else break e}}function d(P){return P.length===0?null:P[0]}function c(P){if(P.length===0)return null;var te=P[0],de=P.pop();if(de!==te){P[0]=de;e:for(var me=0,_e=P.length,L=_e>>>1;me<L;){var le=2*(me+1)-1,ge=P[le],ve=le+1,we=P[ve];if(0>f(ge,de))ve<_e&&0>f(we,ge)?(P[me]=we,P[ve]=de,me=ve):(P[me]=ge,P[le]=de,me=le);else if(ve<_e&&0>f(we,de))P[me]=we,P[ve]=de,me=ve;else break e}}return te}function f(P,te){var de=P.sortIndex-te.sortIndex;return de!==0?de:P.id-te.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var b=Date,N=b.now();l.unstable_now=function(){return b.now()-N}}var y=[],p=[],j=1,T=null,_=3,k=!1,S=!1,C=!1,A=!1,$=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function X(P){for(var te=d(p);te!==null;){if(te.callback===null)c(p);else if(te.startTime<=P)c(p),te.sortIndex=te.expirationTime,r(y,te);else break;te=d(p)}}function ie(P){if(C=!1,X(P),!S)if(d(y)!==null)S=!0,F||(F=!0,ae());else{var te=d(p);te!==null&&re(ie,te.startTime-P)}}var F=!1,Z=-1,R=5,ee=-1;function O(){return A?!0:!(l.unstable_now()-ee<R)}function ne(){if(A=!1,F){var P=l.unstable_now();ee=P;var te=!0;try{e:{S=!1,C&&(C=!1,B(Z),Z=-1),k=!0;var de=_;try{t:{for(X(P),T=d(y);T!==null&&!(T.expirationTime>P&&O());){var me=T.callback;if(typeof me=="function"){T.callback=null,_=T.priorityLevel;var _e=me(T.expirationTime<=P);if(P=l.unstable_now(),typeof _e=="function"){T.callback=_e,X(P),te=!0;break t}T===d(y)&&c(y),X(P)}else c(y);T=d(y)}if(T!==null)te=!0;else{var L=d(p);L!==null&&re(ie,L.startTime-P),te=!1}}break e}finally{T=null,_=de,k=!1}te=void 0}}finally{te?ae():F=!1}}}var ae;if(typeof M=="function")ae=function(){M(ne)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,pe=he.port2;he.port1.onmessage=ne,ae=function(){pe.postMessage(null)}}else ae=function(){$(ne,0)};function re(P,te){Z=$(function(){P(l.unstable_now())},te)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(P){P.callback=null},l.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<P?Math.floor(1e3/P):5},l.unstable_getCurrentPriorityLevel=function(){return _},l.unstable_next=function(P){switch(_){case 1:case 2:case 3:var te=3;break;default:te=_}var de=_;_=te;try{return P()}finally{_=de}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(P,te){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var de=_;_=P;try{return te()}finally{_=de}},l.unstable_scheduleCallback=function(P,te,de){var me=l.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?me+de:me):de=me,P){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=de+_e,P={id:j++,callback:te,priorityLevel:P,startTime:de,expirationTime:_e,sortIndex:-1},de>me?(P.sortIndex=de,r(p,P),d(y)===null&&P===d(p)&&(C?(B(Z),Z=-1):C=!0,re(ie,de-me))):(P.sortIndex=_e,r(y,P),S||k||(S=!0,F||(F=!0,ae()))),P},l.unstable_shouldYield=O,l.unstable_wrapCallback=function(P){var te=_;return function(){var de=_;_=te;try{return P.apply(this,arguments)}finally{_=de}}}})(Ef)),Ef}var yg;function vy(){return yg||(yg=1,wf.exports=xy()),wf.exports}var Tf={exports:{}},ra={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var bg;function py(){if(bg)return ra;bg=1;var l=If();function r(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)p+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+y+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var c={d:{f:d,r:function(){throw Error(r(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(y,p,j){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:T==null?null:""+T,children:y,containerInfo:p,implementation:j}}var b=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function N(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ra.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ra.createPortal=function(y,p){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return h(y,p,null,j)},ra.flushSync=function(y){var p=b.T,j=c.p;try{if(b.T=null,c.p=2,y)return y()}finally{b.T=p,c.p=j,c.d.f()}},ra.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,c.d.C(y,p))},ra.prefetchDNS=function(y){typeof y=="string"&&c.d.D(y)},ra.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var j=p.as,T=N(j,p.crossOrigin),_=typeof p.integrity=="string"?p.integrity:void 0,k=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;j==="style"?c.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:T,integrity:_,fetchPriority:k}):j==="script"&&c.d.X(y,{crossOrigin:T,integrity:_,fetchPriority:k,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ra.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var j=N(p.as,p.crossOrigin);c.d.M(y,{crossOrigin:j,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&c.d.M(y)},ra.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var j=p.as,T=N(j,p.crossOrigin);c.d.L(y,j,{crossOrigin:T,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ra.preloadModule=function(y,p){if(typeof y=="string")if(p){var j=N(p.as,p.crossOrigin);c.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:j,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else c.d.m(y)},ra.requestFormReset=function(y){c.d.r(y)},ra.unstable_batchedUpdates=function(y,p){return y(p)},ra.useFormState=function(y,p,j){return b.H.useFormState(y,p,j)},ra.useFormStatus=function(){return b.H.useHostTransitionStatus()},ra.version="19.2.4",ra}var Ng;function Cx(){if(Ng)return Tf.exports;Ng=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Tf.exports=py(),Tf.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var Sg;function yy(){if(Sg)return Ii;Sg=1;var l=vy(),r=If(),d=Cx();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function b(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 N(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 y(e){if(h(e)!==e)throw Error(c(188))}function p(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var u=a.return;if(u===null)break;var o=u.alternate;if(o===null){if(n=u.return,n!==null){a=n;continue}break}if(u.child===o.child){for(o=u.child;o;){if(o===a)return y(u),e;if(o===n)return y(u),t;o=o.sibling}throw Error(c(188))}if(a.return!==n.return)a=u,n=o;else{for(var x=!1,E=u.child;E;){if(E===a){x=!0,a=u,n=o;break}if(E===n){x=!0,n=u,a=o;break}E=E.sibling}if(!x){for(E=o.child;E;){if(E===a){x=!0,a=o,n=u;break}if(E===n){x=!0,n=o,a=u;break}E=E.sibling}if(!x)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}var T=Object.assign,_=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),M=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function pe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case $:return"Profiler";case A:return"StrictMode";case ie:return"Suspense";case F:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case M:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var re=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},me=[],_e=-1;function L(e){return{current:e}}function le(e){0>_e||(e.current=me[_e],me[_e]=null,_e--)}function ge(e,t){_e++,me[_e]=e.current,e.current=t}var ve=L(null),we=L(null),xe=L(null),Te=L(null);function Ze(e,t){switch(ge(xe,t),ge(we,e),ge(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?z0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=z0(t),e=U0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}le(ve),ge(ve,e)}function We(){le(ve),le(we),le(xe)}function Dt(e){e.memoizedState!==null&&ge(Te,e);var t=ve.current,a=U0(t,e.type);t!==a&&(ge(we,e),ge(ve,a))}function da(e){we.current===e&&(le(ve),le(we)),Te.current===e&&(le(Te),Fi._currentValue=de)}var Ja,Ka;function fa(e){if(Ja===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ja=t&&t[1]||"",Ka=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ja+e+Ka}var ha=!1;function yn(e,t){if(!e||ha)return"";ha=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(K){var I=K}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(K){I=K}e.call(ce.prototype)}}else{try{throw Error()}catch(K){I=K}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(K){if(K&&I&&typeof K.stack=="string")return[K.stack,I.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=n.DetermineComponentFrameRoot(),x=o[0],E=o[1];if(x&&E){var z=x.split(`
44
- `),Q=E.split(`
45
- `);for(u=n=0;n<z.length&&!z[n].includes("DetermineComponentFrameRoot");)n++;for(;u<Q.length&&!Q[u].includes("DetermineComponentFrameRoot");)u++;if(n===z.length||u===Q.length)for(n=z.length-1,u=Q.length-1;1<=n&&0<=u&&z[n]!==Q[u];)u--;for(;1<=n&&0<=u;n--,u--)if(z[n]!==Q[u]){if(n!==1||u!==1)do if(n--,u--,0>u||z[n]!==Q[u]){var se=`
46
- `+z[n].replace(" at new "," at ");return e.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",e.displayName)),se}while(1<=n&&0<=u);break}}}finally{ha=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?fa(a):""}function $t(e,t){switch(e.tag){case 26:case 27:case 5:return fa(e.type);case 16:return fa("Lazy");case 13:return e.child!==t&&t!==null?fa("Suspense Fallback"):fa("Suspense");case 19:return fa("SuspenseList");case 0:case 15:return yn(e.type,!1);case 11:return yn(e.type.render,!1);case 1:return yn(e.type,!0);case 31:return fa("Activity");default:return""}}function ua(e){try{var t="",a=null;do t+=$t(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
47
- Error generating stack: `+n.message+`
48
- `+n.stack}}var en=Object.prototype.hasOwnProperty,tn=l.unstable_scheduleCallback,an=l.unstable_cancelCallback,Ua=l.unstable_shouldYield,bn=l.unstable_requestPaint,Qt=l.unstable_now,ul=l.unstable_getCurrentPriorityLevel,Zr=l.unstable_ImmediatePriority,Gs=l.unstable_UserBlockingPriority,kn=l.unstable_NormalPriority,Zs=l.unstable_LowPriority,cl=l.unstable_IdlePriority,Qe=l.log,ol=l.unstable_setDisableYieldValue,mt=null,Vt=null;function At(e){if(typeof Qe=="function"&&ol(e),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(mt,e)}catch{}}var _t=Math.clz32?Math.clz32:tt,oe=Math.log,Ne=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-(oe(e)/Ne|0)|0}var jt=256,bt=262144,kt=4194304;function Nn(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&261888;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 Kl(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var u=0,o=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var E=n&134217727;return E!==0?(n=E&~o,n!==0?u=Nn(n):(x&=E,x!==0?u=Nn(x):a||(a=E&~e,a!==0&&(u=Nn(a))))):(E=n&~o,E!==0?u=Nn(E):x!==0?u=Nn(x):a||(a=n&~e,a!==0&&(u=Nn(a)))),u===0?0:t!==0&&t!==u&&(t&o)===0&&(o=u&-u,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:u}function dl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pu(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 Wr(){var e=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),e}function Ws(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function fl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yu(e,t,a,n,u,o){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var E=e.entanglements,z=e.expirationTimes,Q=e.hiddenUpdates;for(a=x&~a;0<a;){var se=31-_t(a),ce=1<<se;E[se]=0,z[se]=-1;var I=Q[se];if(I!==null)for(Q[se]=null,se=0;se<I.length;se++){var K=I[se];K!==null&&(K.lane&=-536870913)}a&=~ce}n!==0&&ht(e,n,0),o!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=o&~(x&~t))}function ht(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-_t(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function ma(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-_t(a),u=1<<n;u&t|e[n]&t&&(e[n]|=t),a&=~u}}function Qr(e,t){var a=t&-t;return a=(a&42)!==0?1:Qs(a),(a&(e.suspendedLanes|t))!==0?0:a}function Qs(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 na(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Is(){var e=te.p;return e!==0?e:(e=window.event,e===void 0?32:sg(e.type))}function Ir(e,t){var a=te.p;try{return te.p=e,t()}finally{te.p=a}}var nn=Math.random().toString(36).slice(2),wt="__reactFiber$"+nn,Bt="__reactProps$"+nn,zn="__reactContainer$"+nn,es="__reactEvents$"+nn,bu="__reactListeners$"+nn,Nu="__reactHandles$"+nn,Su="__reactResources$"+nn,ts="__reactMarker$"+nn;function Xs(e){delete e[wt],delete e[Bt],delete e[es],delete e[bu],delete e[Nu]}function Un(e){var t=e[wt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[zn]||a[wt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=P0(e);e!==null;){if(a=e[wt])return a;e=P0(e)}return t}e=a,a=e.parentNode}return null}function Oe(e){if(e=e[wt]||e[zn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ga(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ln(e){var t=e[Su];return t||(t=e[Su]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function zt(e){e[ts]=!0}var ju=new Set,Xr={};function Sn(e,t){hl(e,t),hl(e+"Capture",t)}function hl(e,t){for(Xr[e]=t,e=0;e<t.length;e++)ju.add(t[e])}var wu=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]*$"),Eu={},Ln={};function Jr(e){return en.call(Ln,e)?!0:en.call(Eu,e)?!1:wu.test(e)?Ln[e]=!0:(Eu[e]=!0,!1)}function It(e,t,a){if(Jr(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Js(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function at(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Kr(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(x){a=""+x,o.call(this,x)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function as(e){if(!e._valueTracker){var t=jn(e)?"checked":"value";e._valueTracker=Kr(e,t,""+e[t])}}function ml(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=jn(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function sn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ks=/[\n"\\]/g;function Xt(e){return e.replace(Ks,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function er(e,t,a,n,u,o,x,E){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?ns(e,x,Et(t)):a!=null?ns(e,x,Et(a)):n!=null&&e.removeAttribute("value"),u==null&&o!=null&&(e.defaultChecked=!!o),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+Et(E):e.removeAttribute("name")}function gl(e,t,a,n,u,o,x,E){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){as(e);return}a=a!=null?""+Et(a):"",t=t!=null?""+Et(t):a,E||t===e.value||(e.value=t),e.defaultValue=t}n=n??u,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=E?e.checked:!!n,e.defaultChecked=!!n,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),as(e)}function ns(e,t,a){t==="number"&&sn(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Hn(e,t,a,n){if(e=e.options,t){t={};for(var u=0;u<a.length;u++)t["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=t.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Et(a),t=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,n&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function ls(e,t,a){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Et(a):""}function ei(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(re(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Et(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),as(e)}function rn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ss=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 rs(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||ss.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Tu(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var u in t)n=t[u],t.hasOwnProperty(u)&&a[u]!==n&&rs(e,u,n)}else for(var o in t)t.hasOwnProperty(o)&&rs(e,o,t[o])}function tr(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 vo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cu=/^[\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 is(e){return Cu.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function La(){}var ti=null;function ar(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qn=null,xl=null;function Mu(e){var t=Oe(e);if(t&&(e=t.stateNode)){var a=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(er(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Xt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var u=n[Bt]||null;if(!u)throw Error(c(90));er(n,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&ml(n)}break e;case"textarea":ls(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Hn(e,!!a.multiple,t,!1)}}}var ai=!1;function ni(e,t,a){if(ai)return e(t,a);ai=!0;try{var n=e(t);return n}finally{if(ai=!1,(qn!==null||xl!==null)&&(Sc(),qn&&(t=qn,e=xl,xl=qn=null,Mu(t),e)))for(t=0;t<e.length;t++)Mu(e[t])}}function us(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Bt]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),li=!1;if(un)try{var cs={};Object.defineProperty(cs,"passive",{get:function(){li=!0}}),window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{li=!1}var wn=null,nr=null,lr=null;function Yt(){if(lr)return lr;var e,t=nr,a=t.length,n,u="value"in wn?wn.value:wn.textContent,o=u.length;for(e=0;e<a&&t[e]===u[e];e++);var x=a-e;for(n=1;n<=x&&t[a-n]===u[o-n];n++);return lr=u.slice(e,1<n?1-n:void 0)}function os(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 cn(){return!0}function Vn(){return!1}function Tt(e){function t(a,n,u,o,x){this._reactName=a,this._targetInst=u,this.type=n,this.nativeEvent=o,this.target=x,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(a=e[E],this[E]=a?a(o):o[E]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?cn:Vn,this.isPropagationStopped=Vn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=cn)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=cn)},persist:function(){},isPersistent:cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ds=Tt(En),fs=T({},En,{view:0,detail:0}),si=Tt(fs),sr,hs,ms,rr=T({},fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xs,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!==ms&&(ms&&e.type==="mousemove"?(sr=e.screenX-ms.screenX,hs=e.screenY-ms.screenY):hs=sr=0,ms=e),sr)},movementY:function(e){return"movementY"in e?e.movementY:hs}}),Ou=Tt(rr),po=T({},rr,{dataTransfer:0}),yo=Tt(po),bo=T({},fs,{relatedTarget:0}),ir=Tt(bo),No=T({},En,{animationName:0,elapsedTime:0,pseudoElement:0}),vl=Tt(No),So=T({},En,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pl=Tt(So),gs=T({},En,{data:0}),yl=Tt(gs),jo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wo={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"},Eo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function To(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Eo[e])?!!t[e]:!1}function xs(){return To}var Co=T({},fs,{key:function(e){if(e.key){var t=jo[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wo[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xs,charCode:function(e){return e.type==="keypress"?os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mo=Tt(Co),Oo=T({},rr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ru=Tt(Oo),Ro=T({},fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xs}),Do=Tt(Ro),Du=T({},En,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ao=Tt(Du),_o=T({},rr,{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}),ko=Tt(_o),zo=T({},En,{newState:0,oldState:0}),Uo=Tt(zo),Au=[9,13,27,32],ri=un&&"CompositionEvent"in window,vs=null;un&&"documentMode"in document&&(vs=document.documentMode);var Lo=un&&"TextEvent"in window&&!vs,_u=un&&(!ri||vs&&8<vs&&11>=vs),ku=" ",zu=!1;function Uu(e,t){switch(e){case"keyup":return Au.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bl=!1;function Ho(e,t){switch(e){case"compositionend":return Lu(t);case"keypress":return t.which!==32?null:(zu=!0,ku);case"textInput":return e=t.data,e===ku&&zu?null:e;default:return null}}function qo(e,t){if(bl)return e==="compositionend"||!ri&&Uu(e,t)?(e=Yt(),lr=nr=wn=null,bl=!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 _u&&t.locale!=="ko"?null:t.data;default:return null}}var Vo={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 Hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vo[e.type]:t==="textarea"}function ii(e,t,a,n){qn?xl?xl.push(n):xl=[n]:qn=n,t=Oc(t,"onChange"),0<t.length&&(a=new ds("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Nl=null,ps=null;function xa(e){O0(e,0)}function on(e){var t=ga(e);if(ml(t))return e}function qu(e,t){if(e==="change")return t}var Tn=!1;if(un){var ui;if(un){var Ta="oninput"in document;if(!Ta){var ci=document.createElement("div");ci.setAttribute("oninput","return;"),Ta=typeof ci.oninput=="function"}ui=Ta}else ui=!1;Tn=ui&&(!document.documentMode||9<document.documentMode)}function oi(){Nl&&(Nl.detachEvent("onpropertychange",di),ps=Nl=null)}function di(e){if(e.propertyName==="value"&&on(ps)){var t=[];ii(t,ps,e,ar(e)),ni(xa,t)}}function Pe(e,t,a){e==="focusin"?(oi(),Nl=t,ps=a,Nl.attachEvent("onpropertychange",di)):e==="focusout"&&oi()}function Sl(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return on(ps)}function Bo(e,t){if(e==="click")return on(t)}function gt(e,t){if(e==="input"||e==="change")return on(t)}function ys(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var la=typeof Object.is=="function"?Object.is:ys;function bs(e,t){if(la(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var u=a[n];if(!en.call(t,u)||!la(e[u],t[u]))return!1}return!0}function Vu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bu(e,t){var a=Vu(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Vu(a)}}function Ie(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ie(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=sn(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=sn(e.document)}return t}function ur(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 Yu=un&&"documentMode"in document&&11>=document.documentMode,jl=null,cr=null,Jt=null,or=!1;function Ns(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;or||jl==null||jl!==sn(n)||(n=jl,"selectionStart"in n&&ur(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Jt&&bs(Jt,n)||(Jt=n,n=Oc(cr,"onSelect"),0<n.length&&(t=new ds("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=jl)))}function Bn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var wl={animationend:Bn("Animation","AnimationEnd"),animationiteration:Bn("Animation","AnimationIteration"),animationstart:Bn("Animation","AnimationStart"),transitionrun:Bn("Transition","TransitionRun"),transitionstart:Bn("Transition","TransitionStart"),transitioncancel:Bn("Transition","TransitionCancel"),transitionend:Bn("Transition","TransitionEnd")},fi={},Pu={};un&&(Pu=document.createElement("div").style,"AnimationEvent"in window||(delete wl.animationend.animation,delete wl.animationiteration.animation,delete wl.animationstart.animation),"TransitionEvent"in window||delete wl.transitionend.transition);function Yn(e){if(fi[e])return fi[e];if(!wl[e])return e;var t=wl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Pu)return fi[e]=t[a];return e}var $u=Yn("animationend"),Fu=Yn("animationiteration"),dr=Yn("animationstart"),Po=Yn("transitionrun"),$o=Yn("transitionstart"),Gu=Yn("transitioncancel"),hi=Yn("transitionend"),mi=new Map,gi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");gi.push("scrollEnd");function va(e,t){mi.set(e,t),Sn(t,[e])}var El=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ca=[],Ha=0,Ss=0;function Tl(){for(var e=Ha,t=Ss=Ha=0;t<e;){var a=ca[t];ca[t++]=null;var n=ca[t];ca[t++]=null;var u=ca[t];ca[t++]=null;var o=ca[t];if(ca[t++]=null,n!==null&&u!==null){var x=n.pending;x===null?u.next=u:(u.next=x.next,x.next=u),n.pending=u}o!==0&&js(a,u,o)}}function qa(e,t,a,n){ca[Ha++]=e,ca[Ha++]=t,ca[Ha++]=a,ca[Ha++]=n,Ss|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function fr(e,t,a,n){return qa(e,t,a,n),ws(e)}function Va(e,t){return qa(e,null,null,t),ws(e)}function js(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var u=!1,o=e.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(u=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,u&&t!==null&&(u=31-_t(a),e=o.hiddenUpdates,n=e[u],n===null?e[u]=[t]:n.push(t),t.lane=a|536870912),o):null}function ws(e){if(50<Hi)throw Hi=0,Pd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ca={};function hr(e,t,a,n){this.tag=e,this.key=a,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,t,a,n){return new hr(e,t,a,n)}function mr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ba(e,t){var a=e.alternate;return a===null?(a=Kt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Zu(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function gr(e,t,a,n,u,o){var x=0;if(n=e,typeof e=="function")mr(e)&&(x=1);else if(typeof e=="string")x=Jp(e,a,ve.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Kt(31,a,t,u),e.elementType=ee,e.lanes=o,e;case C:return Ya(a.children,u,o,t);case A:x=8,u|=24;break;case $:return e=Kt(12,a,t,u|2),e.elementType=$,e.lanes=o,e;case ie:return e=Kt(13,a,t,u),e.elementType=ie,e.lanes=o,e;case F:return e=Kt(19,a,t,u),e.elementType=F,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M:x=10;break e;case B:x=9;break e;case X:x=11;break e;case Z:x=14;break e;case R:x=16,n=null;break e}x=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=Kt(x,a,t,u),t.elementType=e,t.type=n,t.lanes=o,t}function Ya(e,t,a,n){return e=Kt(7,e,n,t),e.lanes=a,e}function xi(e,t,a){return e=Kt(6,e,null,t),e.lanes=a,e}function Wu(e){var t=Kt(18,null,null,0);return t.stateNode=e,t}function Cl(e,t,a){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function pa(e,t){if(typeof e=="object"&&e!==null){var a=vi.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ua(t)},vi.set(e,t),t)}return{value:e,source:t,stack:ua(t)}}var Pn=[],$n=0,Es=null,dn=0,sa=[],Ee=0,ya=null,Pa=1,g="";function i(e,t){Pn[$n++]=dn,Pn[$n++]=Es,Es=e,dn=t}function m(e,t,a){sa[Ee++]=Pa,sa[Ee++]=g,sa[Ee++]=ya,ya=e;var n=Pa;e=g;var u=32-_t(n)-1;n&=~(1<<u),a+=1;var o=32-_t(t)+u;if(30<o){var x=u-u%5;o=(n&(1<<x)-1).toString(32),n>>=x,u-=x,Pa=1<<32-_t(t)+u|a<<u|n,g=o+e}else Pa=1<<o|a<<u|n,g=e}function v(e){e.return!==null&&(i(e,1),m(e,1,0))}function w(e){for(;e===Es;)Es=Pn[--$n],Pn[$n]=null,dn=Pn[--$n],Pn[$n]=null;for(;e===ya;)ya=sa[--Ee],sa[Ee]=null,g=sa[--Ee],sa[Ee]=null,Pa=sa[--Ee],sa[Ee]=null}function D(e,t){sa[Ee++]=Pa,sa[Ee++]=g,sa[Ee++]=ya,Pa=t.id,g=t.overflow,ya=e}var H=null,q=null,Y=!1,fe=null,ye=!1,Ue=Error(c(519));function $e(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fn(pa(t,e)),Ue}function De(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[wt]=e,t[Bt]=n,a){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(a=0;a<Vi.length;a++)Ye(Vi[a],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),gl(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),ei(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||_0(t.textContent,a)?(n.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),n.onScroll!=null&&Ye("scroll",t),n.onScrollEnd!=null&&Ye("scrollend",t),n.onClick!=null&&(t.onclick=La),t=!0):t=!1,t||$e(e,!0)}function yt(e){for(H=e.return;H;)switch(H.tag){case 5:case 31:case 13:ye=!1;return;case 27:case 3:ye=!0;return;default:H=H.return}}function Ft(e){if(e!==H)return!1;if(!Y)return yt(e),Y=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||lf(e.type,e.memoizedProps)),a=!a),a&&q&&$e(e),yt(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));q=Y0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));q=Y0(e)}else t===27?(t=q,Vl(e.type)?(e=of,of=null,q=e):q=t):q=H?Za(e.stateNode.nextSibling):null;return!0}function Gt(){q=H=null,Y=!1}function Cn(){var e=fe;return e!==null&&(ja===null?ja=e:ja.push.apply(ja,e),fe=null),e}function fn(e){fe===null?fe=[e]:fe.push(e)}var xr=L(null),Fn=null,$a=null;function Mn(e,t,a){ge(xr,t._currentValue),t._currentValue=a}function hn(e){e._currentValue=xr.current,le(xr)}function pi(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Gn(e,t,a,n){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var o=u.dependencies;if(o!==null){var x=u.child;o=o.firstContext;e:for(;o!==null;){var E=o;o=u;for(var z=0;z<t.length;z++)if(E.context===t[z]){o.lanes|=a,E=o.alternate,E!==null&&(E.lanes|=a),pi(o.return,a,e),n||(x=null);break e}o=E.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(c(341));x.lanes|=a,o=x.alternate,o!==null&&(o.lanes|=a),pi(x,a,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function Fa(e,t,a,n){e=null;for(var u=t,o=!1;u!==null;){if(!o){if((u.flags&524288)!==0)o=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var E=u.type;la(u.pendingProps.value,x.value)||(e!==null?e.push(E):e=[E])}}else if(u===Te.current){if(x=u.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Fi):e=[Fi])}u=u.return}e!==null&&Gn(t,e,a,n),t.flags|=262144}function vr(e){for(e=e.firstContext;e!==null;){if(!la(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ts(e){Fn=e,$a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ea(e){return ph(Fn,e)}function Qu(e,t){return Fn===null&&Ts(e),ph(e,t)}function ph(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},$a===null){if(e===null)throw Error(c(308));$a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else $a=$a.next=t;return a}var Wv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Qv=l.unstable_scheduleCallback,Iv=l.unstable_NormalPriority,Ut={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fo(){return{controller:new Wv,data:new Map,refCount:0}}function yi(e){e.refCount--,e.refCount===0&&Qv(Iv,function(){e.controller.abort()})}var bi=null,Go=0,pr=0,yr=null;function Xv(e,t){if(bi===null){var a=bi=[];Go=0,pr=Qd(),yr={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Go++,t.then(yh,yh),t}function yh(){if(--Go===0&&bi!==null){yr!==null&&(yr.status="fulfilled");var e=bi;bi=null,pr=0,yr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jv(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var u=0;u<a.length;u++)(0,a[u])(t)},function(u){for(n.status="rejected",n.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),n}var bh=P.S;P.S=function(e,t){n0=Qt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Xv(e,t),bh!==null&&bh(e,t)};var Cs=L(null);function Zo(){var e=Cs.current;return e!==null?e:ot.pooledCache}function Iu(e,t){t===null?ge(Cs,Cs.current):ge(Cs,t.pool)}function Nh(){var e=Zo();return e===null?null:{parent:Ut._currentValue,pool:e}}var br=Error(c(460)),Wo=Error(c(474)),Xu=Error(c(542)),Ju={then:function(){}};function Sh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(La,La),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Eh(e),e;default:if(typeof t.status=="string")t.then(La,La);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=n}},function(n){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Eh(e),e}throw Os=t,br}}function Ms(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Os=a,br):a}}var Os=null;function wh(){if(Os===null)throw Error(c(459));var e=Os;return Os=null,e}function Eh(e){if(e===br||e===Xu)throw Error(c(483))}var Nr=null,Ni=0;function Ku(e){var t=Ni;return Ni+=1,Nr===null&&(Nr=[]),jh(Nr,e,t)}function Si(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ec(e,t){throw t.$$typeof===_?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Th(e){function t(G,V){if(e){var W=G.deletions;W===null?(G.deletions=[V],G.flags|=16):W.push(V)}}function a(G,V){if(!e)return null;for(;V!==null;)t(G,V),V=V.sibling;return null}function n(G){for(var V=new Map;G!==null;)G.key!==null?V.set(G.key,G):V.set(G.index,G),G=G.sibling;return V}function u(G,V){return G=Ba(G,V),G.index=0,G.sibling=null,G}function o(G,V,W){return G.index=W,e?(W=G.alternate,W!==null?(W=W.index,W<V?(G.flags|=67108866,V):W):(G.flags|=67108866,V)):(G.flags|=1048576,V)}function x(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function E(G,V,W,ue){return V===null||V.tag!==6?(V=xi(W,G.mode,ue),V.return=G,V):(V=u(V,W),V.return=G,V)}function z(G,V,W,ue){var Me=W.type;return Me===C?se(G,V,W.props.children,ue,W.key):V!==null&&(V.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===R&&Ms(Me)===V.type)?(V=u(V,W.props),Si(V,W),V.return=G,V):(V=gr(W.type,W.key,W.props,null,G.mode,ue),Si(V,W),V.return=G,V)}function Q(G,V,W,ue){return V===null||V.tag!==4||V.stateNode.containerInfo!==W.containerInfo||V.stateNode.implementation!==W.implementation?(V=Cl(W,G.mode,ue),V.return=G,V):(V=u(V,W.children||[]),V.return=G,V)}function se(G,V,W,ue,Me){return V===null||V.tag!==7?(V=Ya(W,G.mode,ue,Me),V.return=G,V):(V=u(V,W),V.return=G,V)}function ce(G,V,W){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=xi(""+V,G.mode,W),V.return=G,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case k:return W=gr(V.type,V.key,V.props,null,G.mode,W),Si(W,V),W.return=G,W;case S:return V=Cl(V,G.mode,W),V.return=G,V;case R:return V=Ms(V),ce(G,V,W)}if(re(V)||ae(V))return V=Ya(V,G.mode,W,null),V.return=G,V;if(typeof V.then=="function")return ce(G,Ku(V),W);if(V.$$typeof===M)return ce(G,Qu(G,V),W);ec(G,V)}return null}function I(G,V,W,ue){var Me=V!==null?V.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Me!==null?null:E(G,V,""+W,ue);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case k:return W.key===Me?z(G,V,W,ue):null;case S:return W.key===Me?Q(G,V,W,ue):null;case R:return W=Ms(W),I(G,V,W,ue)}if(re(W)||ae(W))return Me!==null?null:se(G,V,W,ue,null);if(typeof W.then=="function")return I(G,V,Ku(W),ue);if(W.$$typeof===M)return I(G,V,Qu(G,W),ue);ec(G,W)}return null}function K(G,V,W,ue,Me){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return G=G.get(W)||null,E(V,G,""+ue,Me);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case k:return G=G.get(ue.key===null?W:ue.key)||null,z(V,G,ue,Me);case S:return G=G.get(ue.key===null?W:ue.key)||null,Q(V,G,ue,Me);case R:return ue=Ms(ue),K(G,V,W,ue,Me)}if(re(ue)||ae(ue))return G=G.get(W)||null,se(V,G,ue,Me,null);if(typeof ue.then=="function")return K(G,V,W,Ku(ue),Me);if(ue.$$typeof===M)return K(G,V,W,Qu(V,ue),Me);ec(V,ue)}return null}function be(G,V,W,ue){for(var Me=null,Xe=null,Se=V,qe=V=0,Ge=null;Se!==null&&qe<W.length;qe++){Se.index>qe?(Ge=Se,Se=null):Ge=Se.sibling;var Je=I(G,Se,W[qe],ue);if(Je===null){Se===null&&(Se=Ge);break}e&&Se&&Je.alternate===null&&t(G,Se),V=o(Je,V,qe),Xe===null?Me=Je:Xe.sibling=Je,Xe=Je,Se=Ge}if(qe===W.length)return a(G,Se),Y&&i(G,qe),Me;if(Se===null){for(;qe<W.length;qe++)Se=ce(G,W[qe],ue),Se!==null&&(V=o(Se,V,qe),Xe===null?Me=Se:Xe.sibling=Se,Xe=Se);return Y&&i(G,qe),Me}for(Se=n(Se);qe<W.length;qe++)Ge=K(Se,G,qe,W[qe],ue),Ge!==null&&(e&&Ge.alternate!==null&&Se.delete(Ge.key===null?qe:Ge.key),V=o(Ge,V,qe),Xe===null?Me=Ge:Xe.sibling=Ge,Xe=Ge);return e&&Se.forEach(function(Fl){return t(G,Fl)}),Y&&i(G,qe),Me}function Ae(G,V,W,ue){if(W==null)throw Error(c(151));for(var Me=null,Xe=null,Se=V,qe=V=0,Ge=null,Je=W.next();Se!==null&&!Je.done;qe++,Je=W.next()){Se.index>qe?(Ge=Se,Se=null):Ge=Se.sibling;var Fl=I(G,Se,Je.value,ue);if(Fl===null){Se===null&&(Se=Ge);break}e&&Se&&Fl.alternate===null&&t(G,Se),V=o(Fl,V,qe),Xe===null?Me=Fl:Xe.sibling=Fl,Xe=Fl,Se=Ge}if(Je.done)return a(G,Se),Y&&i(G,qe),Me;if(Se===null){for(;!Je.done;qe++,Je=W.next())Je=ce(G,Je.value,ue),Je!==null&&(V=o(Je,V,qe),Xe===null?Me=Je:Xe.sibling=Je,Xe=Je);return Y&&i(G,qe),Me}for(Se=n(Se);!Je.done;qe++,Je=W.next())Je=K(Se,G,qe,Je.value,ue),Je!==null&&(e&&Je.alternate!==null&&Se.delete(Je.key===null?qe:Je.key),V=o(Je,V,qe),Xe===null?Me=Je:Xe.sibling=Je,Xe=Je);return e&&Se.forEach(function(cy){return t(G,cy)}),Y&&i(G,qe),Me}function ut(G,V,W,ue){if(typeof W=="object"&&W!==null&&W.type===C&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case k:e:{for(var Me=W.key;V!==null;){if(V.key===Me){if(Me=W.type,Me===C){if(V.tag===7){a(G,V.sibling),ue=u(V,W.props.children),ue.return=G,G=ue;break e}}else if(V.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===R&&Ms(Me)===V.type){a(G,V.sibling),ue=u(V,W.props),Si(ue,W),ue.return=G,G=ue;break e}a(G,V);break}else t(G,V);V=V.sibling}W.type===C?(ue=Ya(W.props.children,G.mode,ue,W.key),ue.return=G,G=ue):(ue=gr(W.type,W.key,W.props,null,G.mode,ue),Si(ue,W),ue.return=G,G=ue)}return x(G);case S:e:{for(Me=W.key;V!==null;){if(V.key===Me)if(V.tag===4&&V.stateNode.containerInfo===W.containerInfo&&V.stateNode.implementation===W.implementation){a(G,V.sibling),ue=u(V,W.children||[]),ue.return=G,G=ue;break e}else{a(G,V);break}else t(G,V);V=V.sibling}ue=Cl(W,G.mode,ue),ue.return=G,G=ue}return x(G);case R:return W=Ms(W),ut(G,V,W,ue)}if(re(W))return be(G,V,W,ue);if(ae(W)){if(Me=ae(W),typeof Me!="function")throw Error(c(150));return W=Me.call(W),Ae(G,V,W,ue)}if(typeof W.then=="function")return ut(G,V,Ku(W),ue);if(W.$$typeof===M)return ut(G,V,Qu(G,W),ue);ec(G,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,V!==null&&V.tag===6?(a(G,V.sibling),ue=u(V,W),ue.return=G,G=ue):(a(G,V),ue=xi(W,G.mode,ue),ue.return=G,G=ue),x(G)):a(G,V)}return function(G,V,W,ue){try{Ni=0;var Me=ut(G,V,W,ue);return Nr=null,Me}catch(Se){if(Se===br||Se===Xu)throw Se;var Xe=Kt(29,Se,null,G.mode);return Xe.lanes=ue,Xe.return=G,Xe}finally{}}}var Rs=Th(!0),Ch=Th(!1),Ml=!1;function Qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Io(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 Ol(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rl(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ke&2)!==0){var u=n.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),n.pending=t,t=ws(e),js(e,null,a),t}return qa(e,n,t,a),ws(e)}function ji(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,ma(e,a)}}function Xo(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var u=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?u=o=x:o=o.next=x,a=a.next}while(a!==null);o===null?u=o=t:o=o.next=t}else u=o=t;a={baseState:n.baseState,firstBaseUpdate:u,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Jo=!1;function wi(){if(Jo){var e=yr;if(e!==null)throw e}}function Ei(e,t,a,n){Jo=!1;var u=e.updateQueue;Ml=!1;var o=u.firstBaseUpdate,x=u.lastBaseUpdate,E=u.shared.pending;if(E!==null){u.shared.pending=null;var z=E,Q=z.next;z.next=null,x===null?o=Q:x.next=Q,x=z;var se=e.alternate;se!==null&&(se=se.updateQueue,E=se.lastBaseUpdate,E!==x&&(E===null?se.firstBaseUpdate=Q:E.next=Q,se.lastBaseUpdate=z))}if(o!==null){var ce=u.baseState;x=0,se=Q=z=null,E=o;do{var I=E.lane&-536870913,K=I!==E.lane;if(K?(Fe&I)===I:(n&I)===I){I!==0&&I===pr&&(Jo=!0),se!==null&&(se=se.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var be=e,Ae=E;I=t;var ut=a;switch(Ae.tag){case 1:if(be=Ae.payload,typeof be=="function"){ce=be.call(ut,ce,I);break e}ce=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ae.payload,I=typeof be=="function"?be.call(ut,ce,I):be,I==null)break e;ce=T({},ce,I);break e;case 2:Ml=!0}}I=E.callback,I!==null&&(e.flags|=64,K&&(e.flags|=8192),K=u.callbacks,K===null?u.callbacks=[I]:K.push(I))}else K={lane:I,tag:E.tag,payload:E.payload,callback:E.callback,next:null},se===null?(Q=se=K,z=ce):se=se.next=K,x|=I;if(E=E.next,E===null){if(E=u.shared.pending,E===null)break;K=E,E=K.next,K.next=null,u.lastBaseUpdate=K,u.shared.pending=null}}while(!0);se===null&&(z=ce),u.baseState=z,u.firstBaseUpdate=Q,u.lastBaseUpdate=se,o===null&&(u.shared.lanes=0),zl|=x,e.lanes=x,e.memoizedState=ce}}function Mh(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Oh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Mh(a[e],t)}var Sr=L(null),tc=L(0);function Rh(e,t){e=tl,ge(tc,e),ge(Sr,t),tl=e|t.baseLanes}function Ko(){ge(tc,tl),ge(Sr,Sr.current)}function ed(){tl=tc.current,le(Sr),le(tc)}var Ma=L(null),Ga=null;function Dl(e){var t=e.alternate;ge(Ct,Ct.current&1),ge(Ma,e),Ga===null&&(t===null||Sr.current!==null||t.memoizedState!==null)&&(Ga=e)}function td(e){ge(Ct,Ct.current),ge(Ma,e),Ga===null&&(Ga=e)}function Dh(e){e.tag===22?(ge(Ct,Ct.current),ge(Ma,e),Ga===null&&(Ga=e)):Al()}function Al(){ge(Ct,Ct.current),ge(Ma,Ma.current)}function Oa(e){le(Ma),Ga===e&&(Ga=null),le(Ct)}var Ct=L(0);function ac(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||uf(a)||cf(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Zn=0,He=null,rt=null,Lt=null,nc=!1,jr=!1,Ds=!1,lc=0,Ti=0,wr=null,Kv=0;function Nt(){throw Error(c(321))}function ad(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!la(e[a],t[a]))return!1;return!0}function nd(e,t,a,n,u,o){return Zn=o,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?mm:pd,Ds=!1,o=a(n,u),Ds=!1,jr&&(o=_h(t,a,n,u)),Ah(e),o}function Ah(e){P.H=Oi;var t=rt!==null&&rt.next!==null;if(Zn=0,Lt=rt=He=null,nc=!1,Ti=0,wr=null,t)throw Error(c(300));e===null||Ht||(e=e.dependencies,e!==null&&vr(e)&&(Ht=!0))}function _h(e,t,a,n){He=e;var u=0;do{if(jr&&(wr=null),Ti=0,jr=!1,25<=u)throw Error(c(301));if(u+=1,Lt=rt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=gm,o=t(a,n)}while(jr);return o}function ep(){var e=P.H,t=e.useState()[0];return t=typeof t.then=="function"?Ci(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(He.flags|=1024),t}function ld(){var e=lc!==0;return lc=0,e}function sd(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function rd(e){if(nc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nc=!1}Zn=0,Lt=rt=He=null,jr=!1,Ti=lc=0,wr=null}function oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?He.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Mt(){if(rt===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Lt===null?He.memoizedState:Lt.next;if(t!==null)Lt=t,rt=e;else{if(e===null)throw He.alternate===null?Error(c(467)):Error(c(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Lt===null?He.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ci(e){var t=Ti;return Ti+=1,wr===null&&(wr=[]),e=jh(wr,e,t),t=He,(Lt===null?t.memoizedState:Lt.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?mm:pd),e}function rc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ci(e);if(e.$$typeof===M)return ea(e)}throw Error(c(438,String(e)))}function id(e){var t=null,a=He.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=He.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=sc(),He.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=O;return t.index++,a}function Wn(e,t){return typeof t=="function"?t(e):t}function ic(e){var t=Mt();return ud(t,rt,e)}function ud(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var u=e.baseQueue,o=n.pending;if(o!==null){if(u!==null){var x=u.next;u.next=o.next,o.next=x}t.baseQueue=u=o,n.pending=null}if(o=e.baseState,u===null)e.memoizedState=o;else{t=u.next;var E=x=null,z=null,Q=t,se=!1;do{var ce=Q.lane&-536870913;if(ce!==Q.lane?(Fe&ce)===ce:(Zn&ce)===ce){var I=Q.revertLane;if(I===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),ce===pr&&(se=!0);else if((Zn&I)===I){Q=Q.next,I===pr&&(se=!0);continue}else ce={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},z===null?(E=z=ce,x=o):z=z.next=ce,He.lanes|=I,zl|=I;ce=Q.action,Ds&&a(o,ce),o=Q.hasEagerState?Q.eagerState:a(o,ce)}else I={lane:ce,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},z===null?(E=z=I,x=o):z=z.next=I,He.lanes|=ce,zl|=ce;Q=Q.next}while(Q!==null&&Q!==t);if(z===null?x=o:z.next=E,!la(o,e.memoizedState)&&(Ht=!0,se&&(a=yr,a!==null)))throw a;e.memoizedState=o,e.baseState=x,e.baseQueue=z,n.lastRenderedState=o}return u===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function cd(e){var t=Mt(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,u=a.pending,o=t.memoizedState;if(u!==null){a.pending=null;var x=u=u.next;do o=e(o,x.action),x=x.next;while(x!==u);la(o,t.memoizedState)||(Ht=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function kh(e,t,a){var n=He,u=Mt(),o=Y;if(o){if(a===void 0)throw Error(c(407));a=a()}else a=t();var x=!la((rt||u).memoizedState,a);if(x&&(u.memoizedState=a,Ht=!0),u=u.queue,fd(Lh.bind(null,n,u,e),[e]),u.getSnapshot!==t||x||Lt!==null&&Lt.memoizedState.tag&1){if(n.flags|=2048,Er(9,{destroy:void 0},Uh.bind(null,n,u,a,t),null),ot===null)throw Error(c(349));o||(Zn&127)!==0||zh(n,t,a)}return a}function zh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=sc(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Uh(e,t,a,n){t.value=a,t.getSnapshot=n,Hh(t)&&qh(e)}function Lh(e,t,a){return a(function(){Hh(t)&&qh(e)})}function Hh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!la(e,a)}catch{return!0}}function qh(e){var t=Va(e,2);t!==null&&wa(t,e,2)}function od(e){var t=oa();if(typeof e=="function"){var a=e;if(e=a(),Ds){At(!0);try{a()}finally{At(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:e},t}function Vh(e,t,a,n){return e.baseState=a,ud(e,rt,typeof n=="function"?n:Wn)}function tp(e,t,a,n,u){if(oc(e))throw Error(c(485));if(e=t.action,e!==null){var o={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){o.listeners.push(x)}};P.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,Bh(t,o)):(o.next=a.next,t.pending=a.next=o)}}function Bh(e,t){var a=t.action,n=t.payload,u=e.state;if(t.isTransition){var o=P.T,x={};P.T=x;try{var E=a(u,n),z=P.S;z!==null&&z(x,E),Yh(e,t,E)}catch(Q){dd(e,t,Q)}finally{o!==null&&x.types!==null&&(o.types=x.types),P.T=o}}else try{o=a(u,n),Yh(e,t,o)}catch(Q){dd(e,t,Q)}}function Yh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Ph(e,t,n)},function(n){return dd(e,t,n)}):Ph(e,t,a)}function Ph(e,t,a){t.status="fulfilled",t.value=a,$h(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Bh(e,a)))}function dd(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,$h(t),t=t.next;while(t!==n)}e.action=null}function $h(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fh(e,t){return t}function Gh(e,t){if(Y){var a=ot.formState;if(a!==null){e:{var n=He;if(Y){if(q){t:{for(var u=q,o=ye;u.nodeType!==8;){if(!o){u=null;break t}if(u=Za(u.nextSibling),u===null){u=null;break t}}o=u.data,u=o==="F!"||o==="F"?u:null}if(u){q=Za(u.nextSibling),n=u.data==="F!";break e}}$e(n)}n=!1}n&&(t=a[0])}}return a=oa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fh,lastRenderedState:t},a.queue=n,a=dm.bind(null,He,n),n.dispatch=a,n=od(!1),o=vd.bind(null,He,!1,n.queue),n=oa(),u={state:t,dispatch:null,action:e,pending:null},n.queue=u,a=tp.bind(null,He,u,o,a),u.dispatch=a,n.memoizedState=e,[t,a,!1]}function Zh(e){var t=Mt();return Wh(t,rt,e)}function Wh(e,t,a){if(t=ud(e,t,Fh)[0],e=ic(Wn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Ci(t)}catch(x){throw x===br?Xu:x}else n=t;t=Mt();var u=t.queue,o=u.dispatch;return a!==t.memoizedState&&(He.flags|=2048,Er(9,{destroy:void 0},ap.bind(null,u,a),null)),[n,o,e]}function ap(e,t){e.action=t}function Qh(e){var t=Mt(),a=rt;if(a!==null)return Wh(t,a,e);Mt(),t=t.memoizedState,a=Mt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Er(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=He.updateQueue,t===null&&(t=sc(),He.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function Ih(){return Mt().memoizedState}function uc(e,t,a,n){var u=oa();He.flags|=e,u.memoizedState=Er(1|t,{destroy:void 0},a,n===void 0?null:n)}function cc(e,t,a,n){var u=Mt();n=n===void 0?null:n;var o=u.memoizedState.inst;rt!==null&&n!==null&&ad(n,rt.memoizedState.deps)?u.memoizedState=Er(t,o,a,n):(He.flags|=e,u.memoizedState=Er(1|t,o,a,n))}function Xh(e,t){uc(8390656,8,e,t)}function fd(e,t){cc(2048,8,e,t)}function np(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=sc(),He.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Jh(e){var t=Mt().memoizedState;return np({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Kh(e,t){return cc(4,2,e,t)}function em(e,t){return cc(4,4,e,t)}function tm(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function am(e,t,a){a=a!=null?a.concat([e]):null,cc(4,4,tm.bind(null,t,e),a)}function hd(){}function nm(e,t){var a=Mt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&ad(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function lm(e,t){var a=Mt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&ad(t,n[1]))return n[0];if(n=e(),Ds){At(!0);try{e()}finally{At(!1)}}return a.memoizedState=[n,t],n}function md(e,t,a){return a===void 0||(Zn&1073741824)!==0&&(Fe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=s0(),He.lanes|=e,zl|=e,a)}function sm(e,t,a,n){return la(a,t)?a:Sr.current!==null?(e=md(e,a,n),la(e,t)||(Ht=!0),e):(Zn&42)===0||(Zn&1073741824)!==0&&(Fe&261930)===0?(Ht=!0,e.memoizedState=a):(e=s0(),He.lanes|=e,zl|=e,t)}function rm(e,t,a,n,u){var o=te.p;te.p=o!==0&&8>o?o:8;var x=P.T,E={};P.T=E,vd(e,!1,t,a);try{var z=u(),Q=P.S;if(Q!==null&&Q(E,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var se=Jv(z,n);Mi(e,t,se,Aa(e))}else Mi(e,t,n,Aa(e))}catch(ce){Mi(e,t,{then:function(){},status:"rejected",reason:ce},Aa())}finally{te.p=o,x!==null&&E.types!==null&&(x.types=E.types),P.T=x}}function lp(){}function gd(e,t,a,n){if(e.tag!==5)throw Error(c(476));var u=im(e).queue;rm(e,u,t,de,a===null?lp:function(){return um(e),a(n)})}function im(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:de},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function um(e){var t=im(e);t.next===null&&(t=e.alternate.memoizedState),Mi(e,t.next.queue,{},Aa())}function xd(){return ea(Fi)}function cm(){return Mt().memoizedState}function om(){return Mt().memoizedState}function sp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Aa();e=Ol(a);var n=Rl(t,e,a);n!==null&&(wa(n,t,a),ji(n,t,a)),t={cache:Fo()},e.payload=t;return}t=t.return}}function rp(e,t,a){var n=Aa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},oc(e)?fm(t,a):(a=fr(e,t,a,n),a!==null&&(wa(a,e,n),hm(a,t,n)))}function dm(e,t,a){var n=Aa();Mi(e,t,a,n)}function Mi(e,t,a,n){var u={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(oc(e))fm(t,u);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var x=t.lastRenderedState,E=o(x,a);if(u.hasEagerState=!0,u.eagerState=E,la(E,x))return qa(e,t,u,0),ot===null&&Tl(),!1}catch{}finally{}if(a=fr(e,t,u,n),a!==null)return wa(a,e,n),hm(a,t,n),!0}return!1}function vd(e,t,a,n){if(n={lane:2,revertLane:Qd(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(t)throw Error(c(479))}else t=fr(e,a,n,2),t!==null&&wa(t,e,2)}function oc(e){var t=e.alternate;return e===He||t!==null&&t===He}function fm(e,t){jr=nc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function hm(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,ma(e,a)}}var Oi={readContext:ea,use:rc,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};Oi.useEffectEvent=Nt;var mm={readContext:ea,use:rc,useCallback:function(e,t){return oa().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:Xh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,uc(4194308,4,tm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return uc(4194308,4,e,t)},useInsertionEffect:function(e,t){uc(4,2,e,t)},useMemo:function(e,t){var a=oa();t=t===void 0?null:t;var n=e();if(Ds){At(!0);try{e()}finally{At(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=oa();if(a!==void 0){var u=a(t);if(Ds){At(!0);try{a(t)}finally{At(!1)}}}else u=t;return n.memoizedState=n.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},n.queue=e,e=e.dispatch=rp.bind(null,He,e),[n.memoizedState,e]},useRef:function(e){var t=oa();return e={current:e},t.memoizedState=e},useState:function(e){e=od(e);var t=e.queue,a=dm.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:hd,useDeferredValue:function(e,t){var a=oa();return md(a,e,t)},useTransition:function(){var e=od(!1);return e=rm.bind(null,He,e.queue,!0,!1),oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=He,u=oa();if(Y){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),ot===null)throw Error(c(349));(Fe&127)!==0||zh(n,t,a)}u.memoizedState=a;var o={value:a,getSnapshot:t};return u.queue=o,Xh(Lh.bind(null,n,o,e),[e]),n.flags|=2048,Er(9,{destroy:void 0},Uh.bind(null,n,o,a,t),null),a},useId:function(){var e=oa(),t=ot.identifierPrefix;if(Y){var a=g,n=Pa;a=(n&~(1<<32-_t(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=lc++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Kv++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xd,useFormState:Gh,useActionState:Gh,useOptimistic:function(e){var t=oa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=vd.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:id,useCacheRefresh:function(){return oa().memoizedState=sp.bind(null,He)},useEffectEvent:function(e){var t=oa(),a={impl:e};return t.memoizedState=a,function(){if((Ke&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},pd={readContext:ea,use:rc,useCallback:nm,useContext:ea,useEffect:fd,useImperativeHandle:am,useInsertionEffect:Kh,useLayoutEffect:em,useMemo:lm,useReducer:ic,useRef:Ih,useState:function(){return ic(Wn)},useDebugValue:hd,useDeferredValue:function(e,t){var a=Mt();return sm(a,rt.memoizedState,e,t)},useTransition:function(){var e=ic(Wn)[0],t=Mt().memoizedState;return[typeof e=="boolean"?e:Ci(e),t]},useSyncExternalStore:kh,useId:cm,useHostTransitionStatus:xd,useFormState:Zh,useActionState:Zh,useOptimistic:function(e,t){var a=Mt();return Vh(a,rt,e,t)},useMemoCache:id,useCacheRefresh:om};pd.useEffectEvent=Jh;var gm={readContext:ea,use:rc,useCallback:nm,useContext:ea,useEffect:fd,useImperativeHandle:am,useInsertionEffect:Kh,useLayoutEffect:em,useMemo:lm,useReducer:cd,useRef:Ih,useState:function(){return cd(Wn)},useDebugValue:hd,useDeferredValue:function(e,t){var a=Mt();return rt===null?md(a,e,t):sm(a,rt.memoizedState,e,t)},useTransition:function(){var e=cd(Wn)[0],t=Mt().memoizedState;return[typeof e=="boolean"?e:Ci(e),t]},useSyncExternalStore:kh,useId:cm,useHostTransitionStatus:xd,useFormState:Qh,useActionState:Qh,useOptimistic:function(e,t){var a=Mt();return rt!==null?Vh(a,rt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:id,useCacheRefresh:om};gm.useEffectEvent=Jh;function yd(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:T({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var bd={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Aa(),u=Ol(n);u.payload=t,a!=null&&(u.callback=a),t=Rl(e,u,n),t!==null&&(wa(t,e,n),ji(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Aa(),u=Ol(n);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=Rl(e,u,n),t!==null&&(wa(t,e,n),ji(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Aa(),n=Ol(a);n.tag=2,t!=null&&(n.callback=t),t=Rl(e,n,a),t!==null&&(wa(t,e,a),ji(t,e,a))}};function xm(e,t,a,n,u,o,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,x):t.prototype&&t.prototype.isPureReactComponent?!bs(a,n)||!bs(u,o):!0}function vm(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&bd.enqueueReplaceState(t,t.state,null)}function As(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=T({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function pm(e){El(e)}function ym(e){console.error(e)}function bm(e){El(e)}function dc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Nm(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Nd(e,t,a){return a=Ol(a),a.tag=3,a.payload={element:null},a.callback=function(){dc(e,t)},a}function Sm(e){return e=Ol(e),e.tag=3,e}function jm(e,t,a,n){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var o=n.value;e.payload=function(){return u(o)},e.callback=function(){Nm(t,a,n)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Nm(t,a,n),typeof u!="function"&&(Ul===null?Ul=new Set([this]):Ul.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})})}function ip(e,t,a,n,u){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Fa(t,a,u,!0),a=Ma.current,a!==null){switch(a.tag){case 31:case 13:return Ga===null?jc():a.alternate===null&&St===0&&(St=3),a.flags&=-257,a.flags|=65536,a.lanes=u,n===Ju?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Gd(e,n,u)),!1;case 22:return a.flags|=65536,n===Ju?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Gd(e,n,u)),!1}throw Error(c(435,a.tag))}return Gd(e,n,u),jc(),!1}if(Y)return t=Ma.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,n!==Ue&&(e=Error(c(422),{cause:n}),fn(pa(e,a)))):(n!==Ue&&(t=Error(c(423),{cause:n}),fn(pa(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,n=pa(n,a),u=Nd(e.stateNode,n,u),Xo(e,u),St!==4&&(St=2)),!1;var o=Error(c(520),{cause:n});if(o=pa(o,a),Li===null?Li=[o]:Li.push(o),St!==4&&(St=2),t===null)return!0;n=pa(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=Nd(a.stateNode,n,e),Xo(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Ul===null||!Ul.has(o))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Sm(u),jm(u,e,a,n),Xo(a,u),!1}a=a.return}while(a!==null);return!1}var Sd=Error(c(461)),Ht=!1;function ta(e,t,a,n){t.child=e===null?Ch(t,null,a,n):Rs(t,e.child,a,n)}function wm(e,t,a,n,u){a=a.render;var o=t.ref;if("ref"in n){var x={};for(var E in n)E!=="ref"&&(x[E]=n[E])}else x=n;return Ts(t),n=nd(e,t,a,x,o,u),E=ld(),e!==null&&!Ht?(sd(e,t,u),Qn(e,t,u)):(Y&&E&&v(t),t.flags|=1,ta(e,t,n,u),t.child)}function Em(e,t,a,n,u){if(e===null){var o=a.type;return typeof o=="function"&&!mr(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,Tm(e,t,o,n,u)):(e=gr(a.type,null,n,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Rd(e,u)){var x=o.memoizedProps;if(a=a.compare,a=a!==null?a:bs,a(x,n)&&e.ref===t.ref)return Qn(e,t,u)}return t.flags|=1,e=Ba(o,n),e.ref=t.ref,e.return=t,t.child=e}function Tm(e,t,a,n,u){if(e!==null){var o=e.memoizedProps;if(bs(o,n)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=n=o,Rd(e,u))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,Qn(e,t,u)}return jd(e,t,a,n,u)}function Cm(e,t,a,n){var u=n.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(n=t.child=e.child,u=0;n!==null;)u=u|n.lanes|n.childLanes,n=n.sibling;n=u&~o}else n=0,t.child=null;return Mm(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Iu(t,o!==null?o.cachePool:null),o!==null?Rh(t,o):Ko(),Dh(t);else return n=t.lanes=536870912,Mm(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Iu(t,o.cachePool),Rh(t,o),Al(),t.memoizedState=null):(e!==null&&Iu(t,null),Ko(),Al());return ta(e,t,u,a),t.child}function Ri(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mm(e,t,a,n,u){var o=Zo();return o=o===null?null:{parent:Ut._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Iu(t,null),Ko(),Dh(t),e!==null&&Fa(e,t,n,!0),t.childLanes=u,null}function fc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Om(e,t,a){return Rs(t,e.child,null,a),e=fc(t,t.pendingProps),e.flags|=2,Oa(t),t.memoizedState=null,e}function up(e,t,a){var n=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Y){if(n.mode==="hidden")return e=fc(t,n),t.lanes=536870912,Ri(null,e);if(td(t),(e=q)?(e=B0(e,ye),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Pa,overflow:g}:null,retryLane:536870912,hydrationErrors:null},a=Wu(e),a.return=t,t.child=a,H=t,q=null)):e=null,e===null)throw $e(t);return t.lanes=536870912,null}return fc(t,n)}var o=e.memoizedState;if(o!==null){var x=o.dehydrated;if(td(t),u)if(t.flags&256)t.flags&=-257,t=Om(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ht||Fa(e,t,a,!1),u=(a&e.childLanes)!==0,Ht||u){if(n=ot,n!==null&&(x=Qr(n,a),x!==0&&x!==o.retryLane))throw o.retryLane=x,Va(e,x),wa(n,e,x),Sd;jc(),t=Om(e,t,a)}else e=o.treeContext,q=Za(x.nextSibling),H=t,Y=!0,fe=null,ye=!1,e!==null&&D(t,e),t=fc(t,n),t.flags|=4096;return t}return e=Ba(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function jd(e,t,a,n,u){return Ts(t),a=nd(e,t,a,n,void 0,u),n=ld(),e!==null&&!Ht?(sd(e,t,u),Qn(e,t,u)):(Y&&n&&v(t),t.flags|=1,ta(e,t,a,u),t.child)}function Rm(e,t,a,n,u,o){return Ts(t),t.updateQueue=null,a=_h(t,n,a,u),Ah(e),n=ld(),e!==null&&!Ht?(sd(e,t,o),Qn(e,t,o)):(Y&&n&&v(t),t.flags|=1,ta(e,t,a,o),t.child)}function Dm(e,t,a,n,u){if(Ts(t),t.stateNode===null){var o=Ca,x=a.contextType;typeof x=="object"&&x!==null&&(o=ea(x)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=bd,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},Qo(t),x=a.contextType,o.context=typeof x=="object"&&x!==null?ea(x):Ca,o.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(yd(t,a,x,n),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(x=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),x!==o.state&&bd.enqueueReplaceState(o,o.state,null),Ei(t,n,o,u),wi(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var E=t.memoizedProps,z=As(a,E);o.props=z;var Q=o.context,se=a.contextType;x=Ca,typeof se=="object"&&se!==null&&(x=ea(se));var ce=a.getDerivedStateFromProps;se=typeof ce=="function"||typeof o.getSnapshotBeforeUpdate=="function",E=t.pendingProps!==E,se||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(E||Q!==x)&&vm(t,o,n,x),Ml=!1;var I=t.memoizedState;o.state=I,Ei(t,n,o,u),wi(),Q=t.memoizedState,E||I!==Q||Ml?(typeof ce=="function"&&(yd(t,a,ce,n),Q=t.memoizedState),(z=Ml||xm(t,a,z,n,I,Q,x))?(se||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=Q),o.props=n,o.state=Q,o.context=x,n=z):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,Io(e,t),x=t.memoizedProps,se=As(a,x),o.props=se,ce=t.pendingProps,I=o.context,Q=a.contextType,z=Ca,typeof Q=="object"&&Q!==null&&(z=ea(Q)),E=a.getDerivedStateFromProps,(Q=typeof E=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(x!==ce||I!==z)&&vm(t,o,n,z),Ml=!1,I=t.memoizedState,o.state=I,Ei(t,n,o,u),wi();var K=t.memoizedState;x!==ce||I!==K||Ml||e!==null&&e.dependencies!==null&&vr(e.dependencies)?(typeof E=="function"&&(yd(t,a,E,n),K=t.memoizedState),(se=Ml||xm(t,a,se,n,I,K,z)||e!==null&&e.dependencies!==null&&vr(e.dependencies))?(Q||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,K,z),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,K,z)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=K),o.props=n,o.state=K,o.context=z,n=se):(typeof o.componentDidUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,hc(e,t),n=(t.flags&128)!==0,o||n?(o=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&n?(t.child=Rs(t,e.child,null,u),t.child=Rs(t,null,a,u)):ta(e,t,a,u),t.memoizedState=o.state,e=t.child):e=Qn(e,t,u),e}function Am(e,t,a,n){return Gt(),t.flags|=256,ta(e,t,a,n),t.child}var wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ed(e){return{baseLanes:e,cachePool:Nh()}}function Td(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Da),e}function _m(e,t,a){var n=t.pendingProps,u=!1,o=(t.flags&128)!==0,x;if((x=o)||(x=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Y){if(u?Dl(t):Al(),(e=q)?(e=B0(e,ye),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Pa,overflow:g}:null,retryLane:536870912,hydrationErrors:null},a=Wu(e),a.return=t,t.child=a,H=t,q=null)):e=null,e===null)throw $e(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var E=n.children;return n=n.fallback,u?(Al(),u=t.mode,E=mc({mode:"hidden",children:E},u),n=Ya(n,u,a,null),E.return=t,n.return=t,E.sibling=n,t.child=E,n=t.child,n.memoizedState=Ed(a),n.childLanes=Td(e,x,a),t.memoizedState=wd,Ri(null,n)):(Dl(t),Cd(t,E))}var z=e.memoizedState;if(z!==null&&(E=z.dehydrated,E!==null)){if(o)t.flags&256?(Dl(t),t.flags&=-257,t=Md(e,t,a)):t.memoizedState!==null?(Al(),t.child=e.child,t.flags|=128,t=null):(Al(),E=n.fallback,u=t.mode,n=mc({mode:"visible",children:n.children},u),E=Ya(E,u,a,null),E.flags|=2,n.return=t,E.return=t,n.sibling=E,t.child=n,Rs(t,e.child,null,a),n=t.child,n.memoizedState=Ed(a),n.childLanes=Td(e,x,a),t.memoizedState=wd,t=Ri(null,n));else if(Dl(t),cf(E)){if(x=E.nextSibling&&E.nextSibling.dataset,x)var Q=x.dgst;x=Q,n=Error(c(419)),n.stack="",n.digest=x,fn({value:n,source:null,stack:null}),t=Md(e,t,a)}else if(Ht||Fa(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=ot,x!==null&&(n=Qr(x,a),n!==0&&n!==z.retryLane))throw z.retryLane=n,Va(e,n),wa(x,e,n),Sd;uf(E)||jc(),t=Md(e,t,a)}else uf(E)?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,q=Za(E.nextSibling),H=t,Y=!0,fe=null,ye=!1,e!==null&&D(t,e),t=Cd(t,n.children),t.flags|=4096);return t}return u?(Al(),E=n.fallback,u=t.mode,z=e.child,Q=z.sibling,n=Ba(z,{mode:"hidden",children:n.children}),n.subtreeFlags=z.subtreeFlags&65011712,Q!==null?E=Ba(Q,E):(E=Ya(E,u,a,null),E.flags|=2),E.return=t,n.return=t,n.sibling=E,t.child=n,Ri(null,n),n=t.child,E=e.child.memoizedState,E===null?E=Ed(a):(u=E.cachePool,u!==null?(z=Ut._currentValue,u=u.parent!==z?{parent:z,pool:z}:u):u=Nh(),E={baseLanes:E.baseLanes|a,cachePool:u}),n.memoizedState=E,n.childLanes=Td(e,x,a),t.memoizedState=wd,Ri(e.child,n)):(Dl(t),a=e.child,e=a.sibling,a=Ba(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Cd(e,t){return t=mc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Kt(22,e,null,t),e.lanes=0,e}function Md(e,t,a){return Rs(t,e.child,null,a),e=Cd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function km(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),pi(e.return,t,a)}function Od(e,t,a,n,u,o){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:u,treeForkCount:o}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=n,x.tail=a,x.tailMode=u,x.treeForkCount=o)}function zm(e,t,a){var n=t.pendingProps,u=n.revealOrder,o=n.tail;n=n.children;var x=Ct.current,E=(x&2)!==0;if(E?(x=x&1|2,t.flags|=128):x&=1,ge(Ct,x),ta(e,t,n,a),n=Y?dn:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&km(e,a,t);else if(e.tag===19)km(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=t.child,u=null;a!==null;)e=a.alternate,e!==null&&ac(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),Od(t,!1,u,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ac(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}Od(t,!0,a,null,o,n);break;case"together":Od(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Qn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),zl|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Fa(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=Ba(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ba(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Rd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vr(e)))}function cp(e,t,a){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),Mn(t,Ut,e.memoizedState.cache),Gt();break;case 27:case 5:Dt(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:Mn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,td(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Dl(t),t.flags|=128,null):(a&t.child.childLanes)!==0?_m(e,t,a):(Dl(t),e=Qn(e,t,a),e!==null?e.sibling:null);Dl(t);break;case 19:var u=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Fa(e,t,a,!1),n=(a&t.childLanes)!==0),u){if(n)return zm(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ge(Ct,Ct.current),n)break;return null;case 22:return t.lanes=0,Cm(e,t,a,t.pendingProps);case 24:Mn(t,Ut,e.memoizedState.cache)}return Qn(e,t,a)}function Um(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Rd(e,a)&&(t.flags&128)===0)return Ht=!1,cp(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,Y&&(t.flags&1048576)!==0&&m(t,dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Ms(t.elementType),t.type=e,typeof e=="function")mr(e)?(n=As(e,n),t.tag=1,t=Dm(null,t,e,n,a)):(t.tag=0,t=jd(null,t,e,n,a));else{if(e!=null){var u=e.$$typeof;if(u===X){t.tag=11,t=wm(null,t,e,n,a);break e}else if(u===Z){t.tag=14,t=Em(null,t,e,n,a);break e}}throw t=pe(e)||e,Error(c(306,t,""))}}return t;case 0:return jd(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,u=As(n,t.pendingProps),Dm(e,t,n,u,a);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var o=t.memoizedState;u=o.element,Io(e,t),Ei(t,n,null,a);var x=t.memoizedState;if(n=x.cache,Mn(t,Ut,n),n!==o.cache&&Gn(t,[Ut],a,!0),wi(),n=x.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Am(e,t,n,a);break e}else if(n!==u){u=pa(Error(c(424)),t),fn(u),t=Am(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(q=Za(e.firstChild),H=t,Y=!0,fe=null,ye=!0,a=Ch(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Gt(),n===u){t=Qn(e,t,a);break e}ta(e,t,n,a)}t=t.child}return t;case 26:return hc(e,t),e===null?(a=Z0(t.type,null,t.pendingProps,null))?t.memoizedState=a:Y||(a=t.type,e=t.pendingProps,n=Rc(xe.current).createElement(a),n[wt]=t,n[Bt]=e,aa(n,a,e),zt(n),t.stateNode=n):t.memoizedState=Z0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dt(t),e===null&&Y&&(n=t.stateNode=$0(t.type,t.pendingProps,xe.current),H=t,ye=!0,u=q,Vl(t.type)?(of=u,q=Za(n.firstChild)):q=u),ta(e,t,t.pendingProps.children,a),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Y&&((u=n=q)&&(n=qp(n,t.type,t.pendingProps,ye),n!==null?(t.stateNode=n,H=t,q=Za(n.firstChild),ye=!1,u=!0):u=!1),u||$e(t)),Dt(t),u=t.type,o=t.pendingProps,x=e!==null?e.memoizedProps:null,n=o.children,lf(u,o)?n=null:x!==null&&lf(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=nd(e,t,ep,null,null,a),Fi._currentValue=u),hc(e,t),ta(e,t,n,a),t.child;case 6:return e===null&&Y&&((e=a=q)&&(a=Vp(a,t.pendingProps,ye),a!==null?(t.stateNode=a,H=t,q=null,e=!0):e=!1),e||$e(t)),null;case 13:return _m(e,t,a);case 4:return Ze(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Rs(t,null,n,a):ta(e,t,n,a),t.child;case 11:return wm(e,t,t.type,t.pendingProps,a);case 7:return ta(e,t,t.pendingProps,a),t.child;case 8:return ta(e,t,t.pendingProps.children,a),t.child;case 12:return ta(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Mn(t,t.type,n.value),ta(e,t,n.children,a),t.child;case 9:return u=t.type._context,n=t.pendingProps.children,Ts(t),u=ea(u),n=n(u),t.flags|=1,ta(e,t,n,a),t.child;case 14:return Em(e,t,t.type,t.pendingProps,a);case 15:return Tm(e,t,t.type,t.pendingProps,a);case 19:return zm(e,t,a);case 31:return up(e,t,a);case 22:return Cm(e,t,a,t.pendingProps);case 24:return Ts(t),n=ea(Ut),e===null?(u=Zo(),u===null&&(u=ot,o=Fo(),u.pooledCache=o,o.refCount++,o!==null&&(u.pooledCacheLanes|=a),u=o),t.memoizedState={parent:n,cache:u},Qo(t),Mn(t,Ut,u)):((e.lanes&a)!==0&&(Io(e,t),Ei(t,null,null,a),wi()),u=e.memoizedState,o=t.memoizedState,u.parent!==n?(u={parent:n,cache:n},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Mn(t,Ut,n)):(n=o.cache,Mn(t,Ut,n),n!==u.cache&&Gn(t,[Ut],a,!0))),ta(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function In(e){e.flags|=4}function Dd(e,t,a,n,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(c0())e.flags|=8192;else throw Os=Ju,Wo}else e.flags&=-16777217}function Lm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!J0(t))if(c0())e.flags|=8192;else throw Os=Ju,Wo}function gc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wr():536870912,e.lanes|=t,Or|=t)}function Di(e,t){if(!Y)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,n|=u.subtreeFlags&65011712,n|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,n|=u.subtreeFlags,n|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function op(e,t,a){var n=t.pendingProps;switch(w(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return xt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),hn(Ut),We(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ft(t)?In(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cn())),xt(t),null;case 26:var u=t.type,o=t.memoizedState;return e===null?(In(t),o!==null?(xt(t),Lm(t,o)):(xt(t),Dd(t,u,null,n,a))):o?o!==e.memoizedState?(In(t),xt(t),Lm(t,o)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&In(t),xt(t),Dd(t,u,e,n,a)),null;case 27:if(da(t),a=xe.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&In(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return xt(t),null}e=ve.current,Ft(t)?De(t):(e=$0(u,n,a),t.stateNode=e,In(t))}return xt(t),null;case 5:if(da(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&In(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return xt(t),null}if(o=ve.current,Ft(t))De(t);else{var x=Rc(xe.current);switch(o){case 1:o=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:o=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":o=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":o=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":o=x.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?x.createElement("select",{is:n.is}):x.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?x.createElement(u,{is:n.is}):x.createElement(u)}}o[wt]=t,o[Bt]=n;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)o.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=o;e:switch(aa(o,u,n),u){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&In(t)}}return xt(t),Dd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&In(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=xe.current,Ft(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,u=H,u!==null)switch(u.tag){case 27:case 5:n=u.memoizedProps}e[wt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||_0(e.nodeValue,a)),e||$e(t,!0)}else e=Rc(e).createTextNode(n),e[wt]=t,t.stateNode=e}return xt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ft(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[wt]=t}else Gt(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else a=Cn(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Oa(t),t):(Oa(t),null);if((t.flags&128)!==0)throw Error(c(558))}return xt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ft(t),n!==null&&n.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[wt]=t}else Gt(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),u=!1}else u=Cn(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Oa(t),t):(Oa(t),null)}return Oa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,u=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(u=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==u&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),gc(t,t.updateQueue),xt(t),null);case 4:return We(),e===null&&Kd(t.stateNode.containerInfo),xt(t),null;case 10:return hn(t.type),xt(t),null;case 19:if(le(Ct),n=t.memoizedState,n===null)return xt(t),null;if(u=(t.flags&128)!==0,o=n.rendering,o===null)if(u)Di(n,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ac(e),o!==null){for(t.flags|=128,Di(n,!1),e=o.updateQueue,t.updateQueue=e,gc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Zu(a,e),a=a.sibling;return ge(Ct,Ct.current&1|2),Y&&i(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Qt()>bc&&(t.flags|=128,u=!0,Di(n,!1),t.lanes=4194304)}else{if(!u)if(e=ac(o),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,gc(t,e),Di(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Y)return xt(t),null}else 2*Qt()-n.renderingStartTime>bc&&a!==536870912&&(t.flags|=128,u=!0,Di(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(e=n.last,e!==null?e.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Qt(),e.sibling=null,a=Ct.current,ge(Ct,u?a&1|2:a&1),Y&&i(t,n.treeForkCount),e):(xt(t),null);case 22:case 23:return Oa(t),ed(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),a=t.updateQueue,a!==null&&gc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&le(Cs),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hn(Ut),xt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function dp(e,t){switch(w(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hn(Ut),We(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return da(t),null;case 31:if(t.memoizedState!==null){if(Oa(t),t.alternate===null)throw Error(c(340));Gt()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Oa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Gt()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(Ct),null;case 4:return We(),null;case 10:return hn(t.type),null;case 22:case 23:return Oa(t),ed(),e!==null&&le(Cs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hn(Ut),null;case 25:return null;default:return null}}function Hm(e,t){switch(w(t),t.tag){case 3:hn(Ut),We();break;case 26:case 27:case 5:da(t);break;case 4:We();break;case 31:t.memoizedState!==null&&Oa(t);break;case 13:Oa(t);break;case 19:le(Ct);break;case 10:hn(t.type);break;case 22:case 23:Oa(t),ed(),e!==null&&le(Cs);break;case 24:hn(Ut)}}function Ai(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){n=void 0;var o=a.create,x=a.inst;n=o(),x.destroy=n}a=a.next}while(a!==u)}}catch(E){lt(t,t.return,E)}}function _l(e,t,a){try{var n=t.updateQueue,u=n!==null?n.lastEffect:null;if(u!==null){var o=u.next;n=o;do{if((n.tag&e)===e){var x=n.inst,E=x.destroy;if(E!==void 0){x.destroy=void 0,u=t;var z=a,Q=E;try{Q()}catch(se){lt(u,z,se)}}}n=n.next}while(n!==o)}}catch(se){lt(t,t.return,se)}}function qm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Oh(t,a)}catch(n){lt(e,e.return,n)}}}function Vm(e,t,a){a.props=As(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){lt(e,t,n)}}function _i(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(u){lt(e,t,u)}}function On(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(u){lt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){lt(e,t,u)}else a.current=null}function Bm(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(u){lt(e,e.return,u)}}function Ad(e,t,a){try{var n=e.stateNode;_p(n,e.type,a,t),n[Bt]=t}catch(u){lt(e,e.return,u)}}function Ym(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vl(e.type)||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ym(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&&Vl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kd(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=La));else if(n!==4&&(n===27&&Vl(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(kd(e,t,a),e=e.sibling;e!==null;)kd(e,t,a),e=e.sibling}function xc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Vl(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(xc(e,t,a),e=e.sibling;e!==null;)xc(e,t,a),e=e.sibling}function Pm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);aa(t,n,a),t[wt]=e,t[Bt]=a}catch(o){lt(e,e.return,o)}}var Xn=!1,qt=!1,zd=!1,$m=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function fp(e,t){if(e=e.containerInfo,af=Lc,e=Yo(e),ur(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var u=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var x=0,E=-1,z=-1,Q=0,se=0,ce=e,I=null;t:for(;;){for(var K;ce!==a||u!==0&&ce.nodeType!==3||(E=x+u),ce!==o||n!==0&&ce.nodeType!==3||(z=x+n),ce.nodeType===3&&(x+=ce.nodeValue.length),(K=ce.firstChild)!==null;)I=ce,ce=K;for(;;){if(ce===e)break t;if(I===a&&++Q===u&&(E=x),I===o&&++se===n&&(z=x),(K=ce.nextSibling)!==null)break;ce=I,I=ce.parentNode}ce=K}a=E===-1||z===-1?null:{start:E,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(nf={focusedElem:e,selectionRange:a},Lc=!1,Zt=t;Zt!==null;)if(t=Zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zt=e;else for(;Zt!==null;){switch(t=Zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,u=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var be=As(a.type,u);e=n.getSnapshotBeforeUpdate(be,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(Ae){lt(a,a.return,Ae)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)rf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Zt=e;break}Zt=t.return}}function Fm(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Kn(e,a),n&4&&Ai(5,a);break;case 1:if(Kn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){lt(a,a.return,x)}else{var u=As(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){lt(a,a.return,x)}}n&64&&qm(a),n&512&&_i(a,a.return);break;case 3:if(Kn(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Oh(e,t)}catch(x){lt(a,a.return,x)}}break;case 27:t===null&&n&4&&Pm(a);case 26:case 5:Kn(e,a),t===null&&n&4&&Bm(a),n&512&&_i(a,a.return);break;case 12:Kn(e,a);break;case 31:Kn(e,a),n&4&&Wm(e,a);break;case 13:Kn(e,a),n&4&&Qm(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Np.bind(null,a),Bp(e,a))));break;case 22:if(n=a.memoizedState!==null||Xn,!n){t=t!==null&&t.memoizedState!==null||qt,u=Xn;var o=qt;Xn=n,(qt=t)&&!o?el(e,a,(a.subtreeFlags&8772)!==0):Kn(e,a),Xn=u,qt=o}break;case 30:break;default:Kn(e,a)}}function Gm(e){var t=e.alternate;t!==null&&(e.alternate=null,Gm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Xs(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 vt=null,ba=!1;function Jn(e,t,a){for(a=a.child;a!==null;)Zm(e,t,a),a=a.sibling}function Zm(e,t,a){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(mt,a)}catch{}switch(a.tag){case 26:qt||On(a,t),Jn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:qt||On(a,t);var n=vt,u=ba;Vl(a.type)&&(vt=a.stateNode,ba=!1),Jn(e,t,a),Yi(a.stateNode),vt=n,ba=u;break;case 5:qt||On(a,t);case 6:if(n=vt,u=ba,vt=null,Jn(e,t,a),vt=n,ba=u,vt!==null)if(ba)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(o){lt(a,t,o)}else try{vt.removeChild(a.stateNode)}catch(o){lt(a,t,o)}break;case 18:vt!==null&&(ba?(e=vt,q0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Lr(e)):q0(vt,a.stateNode));break;case 4:n=vt,u=ba,vt=a.stateNode.containerInfo,ba=!0,Jn(e,t,a),vt=n,ba=u;break;case 0:case 11:case 14:case 15:_l(2,a,t),qt||_l(4,a,t),Jn(e,t,a);break;case 1:qt||(On(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Vm(a,t,n)),Jn(e,t,a);break;case 21:Jn(e,t,a);break;case 22:qt=(n=qt)||a.memoizedState!==null,Jn(e,t,a),qt=n;break;default:Jn(e,t,a)}}function Wm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lr(e)}catch(a){lt(t,t.return,a)}}}function Qm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lr(e)}catch(a){lt(t,t.return,a)}}function hp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $m),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $m),t;default:throw Error(c(435,e.tag))}}function vc(e,t){var a=hp(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var u=Sp.bind(null,e,n);n.then(u,u)}})}function Na(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var u=a[n],o=e,x=t,E=x;e:for(;E!==null;){switch(E.tag){case 27:if(Vl(E.type)){vt=E.stateNode,ba=!1;break e}break;case 5:vt=E.stateNode,ba=!1;break e;case 3:case 4:vt=E.stateNode.containerInfo,ba=!0;break e}E=E.return}if(vt===null)throw Error(c(160));Zm(o,x,u),vt=null,ba=!1,o=u.alternate,o!==null&&(o.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Im(t,e),t=t.sibling}var mn=null;function Im(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Na(t,e),Sa(e),n&4&&(_l(3,e,e.return),Ai(3,e),_l(5,e,e.return));break;case 1:Na(t,e),Sa(e),n&512&&(qt||a===null||On(a,a.return)),n&64&&Xn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var u=mn;if(Na(t,e),Sa(e),n&512&&(qt||a===null||On(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(n){case"title":o=u.getElementsByTagName("title")[0],(!o||o[ts]||o[wt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=u.createElement(n),u.head.insertBefore(o,u.querySelector("head > title"))),aa(o,n,a),o[wt]=e,zt(o),n=o;break e;case"link":var x=I0("link","href",u).get(n+(a.href||""));if(x){for(var E=0;E<x.length;E++)if(o=x[E],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(E,1);break t}}o=u.createElement(n),aa(o,n,a),u.head.appendChild(o);break;case"meta":if(x=I0("meta","content",u).get(n+(a.content||""))){for(E=0;E<x.length;E++)if(o=x[E],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(E,1);break t}}o=u.createElement(n),aa(o,n,a),u.head.appendChild(o);break;default:throw Error(c(468,n))}o[wt]=e,zt(o),n=o}e.stateNode=n}else X0(u,e.type,e.stateNode);else e.stateNode=Q0(u,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?X0(u,e.type,e.stateNode):Q0(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ad(e,e.memoizedProps,a.memoizedProps)}break;case 27:Na(t,e),Sa(e),n&512&&(qt||a===null||On(a,a.return)),a!==null&&n&4&&Ad(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Na(t,e),Sa(e),n&512&&(qt||a===null||On(a,a.return)),e.flags&32){u=e.stateNode;try{rn(u,"")}catch(be){lt(e,e.return,be)}}n&4&&e.stateNode!=null&&(u=e.memoizedProps,Ad(e,u,a!==null?a.memoizedProps:u)),n&1024&&(zd=!0);break;case 6:if(Na(t,e),Sa(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(be){lt(e,e.return,be)}}break;case 3:if(_c=null,u=mn,mn=Dc(t.containerInfo),Na(t,e),mn=u,Sa(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Lr(t.containerInfo)}catch(be){lt(e,e.return,be)}zd&&(zd=!1,Xm(e));break;case 4:n=mn,mn=Dc(e.stateNode.containerInfo),Na(t,e),Sa(e),mn=n;break;case 12:Na(t,e),Sa(e);break;case 31:Na(t,e),Sa(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vc(e,n)));break;case 13:Na(t,e),Sa(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(yc=Qt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vc(e,n)));break;case 22:u=e.memoizedState!==null;var z=a!==null&&a.memoizedState!==null,Q=Xn,se=qt;if(Xn=Q||u,qt=se||z,Na(t,e),qt=se,Xn=Q,Sa(e),n&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(a===null||z||Xn||qt||_s(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){z=a=t;try{if(o=z.stateNode,u)x=o.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{E=z.stateNode;var ce=z.memoizedProps.style,I=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;E.style.display=I==null||typeof I=="boolean"?"":(""+I).trim()}}catch(be){lt(z,z.return,be)}}}else if(t.tag===6){if(a===null){z=t;try{z.stateNode.nodeValue=u?"":z.memoizedProps}catch(be){lt(z,z.return,be)}}}else if(t.tag===18){if(a===null){z=t;try{var K=z.stateNode;u?V0(K,!0):V0(z.stateNode,!1)}catch(be){lt(z,z.return,be)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,vc(e,a))));break;case 19:Na(t,e),Sa(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vc(e,n)));break;case 30:break;case 21:break;default:Na(t,e),Sa(e)}}function Sa(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Ym(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var u=a.stateNode,o=_d(e);xc(e,o,u);break;case 5:var x=a.stateNode;a.flags&32&&(rn(x,""),a.flags&=-33);var E=_d(e);xc(e,E,x);break;case 3:case 4:var z=a.stateNode.containerInfo,Q=_d(e);kd(e,Q,z);break;default:throw Error(c(161))}}catch(se){lt(e,e.return,se)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Xm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Kn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fm(e,t.alternate,t),t=t.sibling}function _s(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_l(4,t,t.return),_s(t);break;case 1:On(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Vm(t,t.return,a),_s(t);break;case 27:Yi(t.stateNode);case 26:case 5:On(t,t.return),_s(t);break;case 22:t.memoizedState===null&&_s(t);break;case 30:_s(t);break;default:_s(t)}e=e.sibling}}function el(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,u=e,o=t,x=o.flags;switch(o.tag){case 0:case 11:case 15:el(u,o,a),Ai(4,o);break;case 1:if(el(u,o,a),n=o,u=n.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(Q){lt(n,n.return,Q)}if(n=o,u=n.updateQueue,u!==null){var E=n.stateNode;try{var z=u.shared.hiddenCallbacks;if(z!==null)for(u.shared.hiddenCallbacks=null,u=0;u<z.length;u++)Mh(z[u],E)}catch(Q){lt(n,n.return,Q)}}a&&x&64&&qm(o),_i(o,o.return);break;case 27:Pm(o);case 26:case 5:el(u,o,a),a&&n===null&&x&4&&Bm(o),_i(o,o.return);break;case 12:el(u,o,a);break;case 31:el(u,o,a),a&&x&4&&Wm(u,o);break;case 13:el(u,o,a),a&&x&4&&Qm(u,o);break;case 22:o.memoizedState===null&&el(u,o,a),_i(o,o.return);break;case 30:break;default:el(u,o,a)}t=t.sibling}}function Ud(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&yi(a))}function Ld(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yi(e))}function gn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jm(e,t,a,n),t=t.sibling}function Jm(e,t,a,n){var u=t.flags;switch(t.tag){case 0:case 11:case 15:gn(e,t,a,n),u&2048&&Ai(9,t);break;case 1:gn(e,t,a,n);break;case 3:gn(e,t,a,n),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yi(e)));break;case 12:if(u&2048){gn(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,x=o.id,E=o.onPostCommit;typeof E=="function"&&E(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){lt(t,t.return,z)}}else gn(e,t,a,n);break;case 31:gn(e,t,a,n);break;case 13:gn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,x=t.alternate,t.memoizedState!==null?o._visibility&2?gn(e,t,a,n):ki(e,t):o._visibility&2?gn(e,t,a,n):(o._visibility|=2,Tr(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Ud(x,t);break;case 24:gn(e,t,a,n),u&2048&&Ld(t.alternate,t);break;default:gn(e,t,a,n)}}function Tr(e,t,a,n,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,x=t,E=a,z=n,Q=x.flags;switch(x.tag){case 0:case 11:case 15:Tr(o,x,E,z,u),Ai(8,x);break;case 23:break;case 22:var se=x.stateNode;x.memoizedState!==null?se._visibility&2?Tr(o,x,E,z,u):ki(o,x):(se._visibility|=2,Tr(o,x,E,z,u)),u&&Q&2048&&Ud(x.alternate,x);break;case 24:Tr(o,x,E,z,u),u&&Q&2048&&Ld(x.alternate,x);break;default:Tr(o,x,E,z,u)}t=t.sibling}}function ki(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,u=n.flags;switch(n.tag){case 22:ki(a,n),u&2048&&Ud(n.alternate,n);break;case 24:ki(a,n),u&2048&&Ld(n.alternate,n);break;default:ki(a,n)}t=t.sibling}}var zi=8192;function Cr(e,t,a){if(e.subtreeFlags&zi)for(e=e.child;e!==null;)Km(e,t,a),e=e.sibling}function Km(e,t,a){switch(e.tag){case 26:Cr(e,t,a),e.flags&zi&&e.memoizedState!==null&&Kp(a,mn,e.memoizedState,e.memoizedProps);break;case 5:Cr(e,t,a);break;case 3:case 4:var n=mn;mn=Dc(e.stateNode.containerInfo),Cr(e,t,a),mn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=zi,zi=16777216,Cr(e,t,a),zi=n):Cr(e,t,a));break;default:Cr(e,t,a)}}function e0(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 Ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Zt=n,a0(n,e)}e0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)t0(e),e=e.sibling}function t0(e){switch(e.tag){case 0:case 11:case 15:Ui(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Ui(e);break;case 12:Ui(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,pc(e)):Ui(e);break;default:Ui(e)}}function pc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Zt=n,a0(n,e)}e0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),pc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,pc(t));break;default:pc(t)}e=e.sibling}}function a0(e,t){for(;Zt!==null;){var a=Zt;switch(a.tag){case 0:case 11:case 15:_l(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:yi(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Zt=n;else e:for(a=e;Zt!==null;){n=Zt;var u=n.sibling,o=n.return;if(Gm(n),n===a){Zt=null;break e}if(u!==null){u.return=o,Zt=u;break e}Zt=o}}}var mp={getCacheForType:function(e){var t=ea(Ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return ea(Ut).controller.signal}},gp=typeof WeakMap=="function"?WeakMap:Map,Ke=0,ot=null,Be=null,Fe=0,nt=0,Ra=null,kl=!1,Mr=!1,Hd=!1,tl=0,St=0,zl=0,ks=0,qd=0,Da=0,Or=0,Li=null,ja=null,Vd=!1,yc=0,n0=0,bc=1/0,Nc=null,Ul=null,Pt=0,Ll=null,Rr=null,al=0,Bd=0,Yd=null,l0=null,Hi=0,Pd=null;function Aa(){return(Ke&2)!==0&&Fe!==0?Fe&-Fe:P.T!==null?Qd():Is()}function s0(){if(Da===0)if((Fe&536870912)===0||Y){var e=bt;bt<<=1,(bt&3932160)===0&&(bt=262144),Da=e}else Da=536870912;return e=Ma.current,e!==null&&(e.flags|=32),Da}function wa(e,t,a){(e===ot&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(Dr(e,0),Hl(e,Fe,Da,!1)),fl(e,a),((Ke&2)===0||e!==ot)&&(e===ot&&((Ke&2)===0&&(ks|=a),St===4&&Hl(e,Fe,Da,!1)),Rn(e))}function r0(e,t,a){if((Ke&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||dl(e,t),u=n?pp(e,t):Fd(e,t,!0),o=n;do{if(u===0){Mr&&!n&&Hl(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!xp(a)){u=Fd(e,t,!1),o=!1;continue}if(u===2){if(o=t,e.errorRecoveryDisabledLanes&o)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var E=e;u=Li;var z=E.current.memoizedState.isDehydrated;if(z&&(Dr(E,x).flags|=256),x=Fd(E,x,!1),x!==2){if(Hd&&!z){E.errorRecoveryDisabledLanes|=o,ks|=o,u=4;break e}o=ja,ja=u,o!==null&&(ja===null?ja=o:ja.push.apply(ja,o))}u=x}if(o=!1,u!==2)continue}}if(u===1){Dr(e,0),Hl(e,t,0,!0);break}e:{switch(n=e,o=u,o){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Hl(n,t,Da,!kl);break e;case 2:ja=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=yc+300-Qt(),10<u)){if(Hl(n,t,Da,!kl),Kl(n,0,!0)!==0)break e;al=t,n.timeoutHandle=L0(i0.bind(null,n,a,ja,Nc,Vd,t,Da,ks,Or,kl,o,"Throttled",-0,0),u);break e}i0(n,a,ja,Nc,Vd,t,Da,ks,Or,kl,o,null,-0,0)}}break}while(!0);Rn(e)}function i0(e,t,a,n,u,o,x,E,z,Q,se,ce,I,K){if(e.timeoutHandle=-1,ce=t.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:La},Km(t,o,ce);var be=(o&62914560)===o?yc-Qt():(o&4194048)===o?n0-Qt():0;if(be=ey(ce,be),be!==null){al=o,e.cancelPendingCommit=be(g0.bind(null,e,t,o,a,n,u,x,E,z,se,ce,null,I,K)),Hl(e,o,x,!Q);return}}g0(e,t,o,a,n,u,x,E,z)}function xp(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var u=a[n],o=u.getSnapshot;u=u.value;try{if(!la(o(),u))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Hl(e,t,a,n){t&=~qd,t&=~ks,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var u=t;0<u;){var o=31-_t(u),x=1<<o;n[o]=-1,u&=~x}a!==0&&ht(e,a,t)}function Sc(){return(Ke&6)===0?(qi(0),!1):!0}function $d(){if(Be!==null){if(nt===0)var e=Be.return;else e=Be,$a=Fn=null,rd(e),Nr=null,Ni=0,e=Be;for(;e!==null;)Hm(e.alternate,e),e=e.return;Be=null}}function Dr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Up(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),al=0,$d(),ot=e,Be=a=Ba(e.current,null),Fe=t,nt=0,Ra=null,kl=!1,Mr=dl(e,t),Hd=!1,Or=Da=qd=ks=zl=St=0,ja=Li=null,Vd=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var u=31-_t(n),o=1<<u;t|=e[u],n&=~o}return tl=t,Tl(),a}function u0(e,t){He=null,P.H=Oi,t===br||t===Xu?(t=wh(),nt=3):t===Wo?(t=wh(),nt=4):nt=t===Sd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ra=t,Be===null&&(St=1,dc(e,pa(t,e.current)))}function c0(){var e=Ma.current;return e===null?!0:(Fe&4194048)===Fe?Ga===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?e===Ga:!1}function o0(){var e=P.H;return P.H=Oi,e===null?Oi:e}function d0(){var e=P.A;return P.A=mp,e}function jc(){St=4,kl||(Fe&4194048)!==Fe&&Ma.current!==null||(Mr=!0),(zl&134217727)===0&&(ks&134217727)===0||ot===null||Hl(ot,Fe,Da,!1)}function Fd(e,t,a){var n=Ke;Ke|=2;var u=o0(),o=d0();(ot!==e||Fe!==t)&&(Nc=null,Dr(e,t)),t=!1;var x=St;e:do try{if(nt!==0&&Be!==null){var E=Be,z=Ra;switch(nt){case 8:$d(),x=6;break e;case 3:case 2:case 9:case 6:Ma.current===null&&(t=!0);var Q=nt;if(nt=0,Ra=null,Ar(e,E,z,Q),a&&Mr){x=0;break e}break;default:Q=nt,nt=0,Ra=null,Ar(e,E,z,Q)}}vp(),x=St;break}catch(se){u0(e,se)}while(!0);return t&&e.shellSuspendCounter++,$a=Fn=null,Ke=n,P.H=u,P.A=o,Be===null&&(ot=null,Fe=0,Tl()),x}function vp(){for(;Be!==null;)f0(Be)}function pp(e,t){var a=Ke;Ke|=2;var n=o0(),u=d0();ot!==e||Fe!==t?(Nc=null,bc=Qt()+500,Dr(e,t)):Mr=dl(e,t);e:do try{if(nt!==0&&Be!==null){t=Be;var o=Ra;t:switch(nt){case 1:nt=0,Ra=null,Ar(e,t,o,1);break;case 2:case 9:if(Sh(o)){nt=0,Ra=null,h0(t);break}t=function(){nt!==2&&nt!==9||ot!==e||(nt=7),Rn(e)},o.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:Sh(o)?(nt=0,Ra=null,h0(t)):(nt=0,Ra=null,Ar(e,t,o,7));break;case 5:var x=null;switch(Be.tag){case 26:x=Be.memoizedState;case 5:case 27:var E=Be;if(x?J0(x):E.stateNode.complete){nt=0,Ra=null;var z=E.sibling;if(z!==null)Be=z;else{var Q=E.return;Q!==null?(Be=Q,wc(Q)):Be=null}break t}}nt=0,Ra=null,Ar(e,t,o,5);break;case 6:nt=0,Ra=null,Ar(e,t,o,6);break;case 8:$d(),St=6;break e;default:throw Error(c(462))}}yp();break}catch(se){u0(e,se)}while(!0);return $a=Fn=null,P.H=n,P.A=u,Ke=a,Be!==null?0:(ot=null,Fe=0,Tl(),St)}function yp(){for(;Be!==null&&!Ua();)f0(Be)}function f0(e){var t=Um(e.alternate,e,tl);e.memoizedProps=e.pendingProps,t===null?wc(e):Be=t}function h0(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Rm(a,t,t.pendingProps,t.type,void 0,Fe);break;case 11:t=Rm(a,t,t.pendingProps,t.type.render,t.ref,Fe);break;case 5:rd(t);default:Hm(a,t),t=Be=Zu(t,tl),t=Um(a,t,tl)}e.memoizedProps=e.pendingProps,t===null?wc(e):Be=t}function Ar(e,t,a,n){$a=Fn=null,rd(t),Nr=null,Ni=0;var u=t.return;try{if(ip(e,u,t,a,Fe)){St=1,dc(e,pa(a,e.current)),Be=null;return}}catch(o){if(u!==null)throw Be=u,o;St=1,dc(e,pa(a,e.current)),Be=null;return}t.flags&32768?(Y||n===1?e=!0:Mr||(Fe&536870912)!==0?e=!1:(kl=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ma.current,n!==null&&n.tag===13&&(n.flags|=16384))),m0(t,e)):wc(t)}function wc(e){var t=e;do{if((t.flags&32768)!==0){m0(t,kl);return}e=t.return;var a=op(t.alternate,t,tl);if(a!==null){Be=a;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);St===0&&(St=5)}function m0(e,t){do{var a=dp(e.alternate,e);if(a!==null){a.flags&=32767,Be=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=a}while(e!==null);St=6,Be=null}function g0(e,t,a,n,u,o,x,E,z){e.cancelPendingCommit=null;do Ec();while(Pt!==0);if((Ke&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(o=t.lanes|t.childLanes,o|=Ss,yu(e,a,o,x,E,z),e===ot&&(Be=ot=null,Fe=0),Rr=t,Ll=e,al=a,Bd=o,Yd=u,l0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jp(kn,function(){return b0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=P.T,P.T=null,u=te.p,te.p=2,x=Ke,Ke|=4;try{fp(e,t,a)}finally{Ke=x,te.p=u,P.T=n}}Pt=1,x0(),v0(),p0()}}function x0(){if(Pt===1){Pt=0;var e=Ll,t=Rr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=P.T,P.T=null;var n=te.p;te.p=2;var u=Ke;Ke|=4;try{Im(t,e);var o=nf,x=Yo(e.containerInfo),E=o.focusedElem,z=o.selectionRange;if(x!==E&&E&&E.ownerDocument&&Ie(E.ownerDocument.documentElement,E)){if(z!==null&&ur(E)){var Q=z.start,se=z.end;if(se===void 0&&(se=Q),"selectionStart"in E)E.selectionStart=Q,E.selectionEnd=Math.min(se,E.value.length);else{var ce=E.ownerDocument||document,I=ce&&ce.defaultView||window;if(I.getSelection){var K=I.getSelection(),be=E.textContent.length,Ae=Math.min(z.start,be),ut=z.end===void 0?Ae:Math.min(z.end,be);!K.extend&&Ae>ut&&(x=ut,ut=Ae,Ae=x);var G=Bu(E,Ae),V=Bu(E,ut);if(G&&V&&(K.rangeCount!==1||K.anchorNode!==G.node||K.anchorOffset!==G.offset||K.focusNode!==V.node||K.focusOffset!==V.offset)){var W=ce.createRange();W.setStart(G.node,G.offset),K.removeAllRanges(),Ae>ut?(K.addRange(W),K.extend(V.node,V.offset)):(W.setEnd(V.node,V.offset),K.addRange(W))}}}}for(ce=[],K=E;K=K.parentNode;)K.nodeType===1&&ce.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ce.length;E++){var ue=ce[E];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Lc=!!af,nf=af=null}finally{Ke=u,te.p=n,P.T=a}}e.current=t,Pt=2}}function v0(){if(Pt===2){Pt=0;var e=Ll,t=Rr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=P.T,P.T=null;var n=te.p;te.p=2;var u=Ke;Ke|=4;try{Fm(e,t.alternate,t)}finally{Ke=u,te.p=n,P.T=a}}Pt=3}}function p0(){if(Pt===4||Pt===3){Pt=0,bn();var e=Ll,t=Rr,a=al,n=l0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pt=5:(Pt=0,Rr=Ll=null,y0(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ul=null),na(a),t=t.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(mt,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=P.T,u=te.p,te.p=2,P.T=null;try{for(var o=e.onRecoverableError,x=0;x<n.length;x++){var E=n[x];o(E.value,{componentStack:E.stack})}}finally{P.T=t,te.p=u}}(al&3)!==0&&Ec(),Rn(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===Pd?Hi++:(Hi=0,Pd=e):Hi=0,qi(0)}}function y0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,yi(t)))}function Ec(){return x0(),v0(),p0(),b0()}function b0(){if(Pt!==5)return!1;var e=Ll,t=Bd;Bd=0;var a=na(al),n=P.T,u=te.p;try{te.p=32>a?32:a,P.T=null,a=Yd,Yd=null;var o=Ll,x=al;if(Pt=0,Rr=Ll=null,al=0,(Ke&6)!==0)throw Error(c(331));var E=Ke;if(Ke|=4,t0(o.current),Jm(o,o.current,x,a),Ke=E,qi(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(mt,o)}catch{}return!0}finally{te.p=u,P.T=n,y0(e,t)}}function N0(e,t,a){t=pa(a,t),t=Nd(e.stateNode,t,2),e=Rl(e,t,2),e!==null&&(fl(e,2),Rn(e))}function lt(e,t,a){if(e.tag===3)N0(e,e,a);else for(;t!==null;){if(t.tag===3){N0(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ul===null||!Ul.has(n))){e=pa(a,e),a=Sm(2),n=Rl(t,a,2),n!==null&&(jm(a,n,t,e),fl(n,2),Rn(n));break}}t=t.return}}function Gd(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new gp;var u=new Set;n.set(t,u)}else u=n.get(t),u===void 0&&(u=new Set,n.set(t,u));u.has(a)||(Hd=!0,u.add(a),e=bp.bind(null,e,t,a),t.then(e,e))}function bp(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ot===e&&(Fe&a)===a&&(St===4||St===3&&(Fe&62914560)===Fe&&300>Qt()-yc?(Ke&2)===0&&Dr(e,0):qd|=a,Or===Fe&&(Or=0)),Rn(e)}function S0(e,t){t===0&&(t=Wr()),e=Va(e,t),e!==null&&(fl(e,t),Rn(e))}function Np(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),S0(e,a)}function Sp(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),S0(e,a)}function jp(e,t){return tn(e,t)}var Tc=null,_r=null,Zd=!1,Cc=!1,Wd=!1,ql=0;function Rn(e){e!==_r&&e.next===null&&(_r===null?Tc=_r=e:_r=_r.next=e),Cc=!0,Zd||(Zd=!0,Ep())}function qi(e,t){if(!Wd&&Cc){Wd=!0;do for(var a=!1,n=Tc;n!==null;){if(e!==0){var u=n.pendingLanes;if(u===0)var o=0;else{var x=n.suspendedLanes,E=n.pingedLanes;o=(1<<31-_t(42|e)+1)-1,o&=u&~(x&~E),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,T0(n,o))}else o=Fe,o=Kl(n,n===ot?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||dl(n,o)||(a=!0,T0(n,o));n=n.next}while(a);Wd=!1}}function wp(){j0()}function j0(){Cc=Zd=!1;var e=0;ql!==0&&zp()&&(e=ql);for(var t=Qt(),a=null,n=Tc;n!==null;){var u=n.next,o=w0(n,t);o===0?(n.next=null,a===null?Tc=u:a.next=u,u===null&&(_r=a)):(a=n,(e!==0||(o&3)!==0)&&(Cc=!0)),n=u}Pt!==0&&Pt!==5||qi(e),ql!==0&&(ql=0)}function w0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,u=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var x=31-_t(o),E=1<<x,z=u[x];z===-1?((E&a)===0||(E&n)!==0)&&(u[x]=pu(E,t)):z<=t&&(e.expiredLanes|=E),o&=~E}if(t=ot,a=Fe,a=Kl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&an(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||dl(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&an(n),na(a)){case 2:case 8:a=Gs;break;case 32:a=kn;break;case 268435456:a=cl;break;default:a=kn}return n=E0.bind(null,e),a=tn(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&an(n),e.callbackPriority=2,e.callbackNode=null,2}function E0(e,t){if(Pt!==0&&Pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ec()&&e.callbackNode!==a)return null;var n=Fe;return n=Kl(e,e===ot?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(r0(e,n,t),w0(e,Qt()),e.callbackNode!=null&&e.callbackNode===a?E0.bind(null,e):null)}function T0(e,t){if(Ec())return null;r0(e,t,!0)}function Ep(){Lp(function(){(Ke&6)!==0?tn(Zr,wp):j0()})}function Qd(){if(ql===0){var e=pr;e===0&&(e=jt,jt<<=1,(jt&261888)===0&&(jt=256)),ql=e}return ql}function C0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:is(""+e)}function M0(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Tp(e,t,a,n,u){if(t==="submit"&&a&&a.stateNode===u){var o=C0((u[Bt]||null).action),x=n.submitter;x&&(t=(t=x[Bt]||null)?C0(t.formAction):x.getAttribute("formAction"),t!==null&&(o=t,x=null));var E=new ds("action","action",null,n,u);e.push({event:E,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(ql!==0){var z=x?M0(u,x):new FormData(u);gd(a,{pending:!0,data:z,method:u.method,action:o},null,z)}}else typeof o=="function"&&(E.preventDefault(),z=x?M0(u,x):new FormData(u),gd(a,{pending:!0,data:z,method:u.method,action:o},o,z))},currentTarget:u}]})}}for(var Id=0;Id<gi.length;Id++){var Xd=gi[Id],Cp=Xd.toLowerCase(),Mp=Xd[0].toUpperCase()+Xd.slice(1);va(Cp,"on"+Mp)}va($u,"onAnimationEnd"),va(Fu,"onAnimationIteration"),va(dr,"onAnimationStart"),va("dblclick","onDoubleClick"),va("focusin","onFocus"),va("focusout","onBlur"),va(Po,"onTransitionRun"),va($o,"onTransitionStart"),va(Gu,"onTransitionCancel"),va(hi,"onTransitionEnd"),hl("onMouseEnter",["mouseout","mouseover"]),hl("onMouseLeave",["mouseout","mouseover"]),hl("onPointerEnter",["pointerout","pointerover"]),hl("onPointerLeave",["pointerout","pointerover"]),Sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vi="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(" "),Op=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vi));function O0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],u=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var x=n.length-1;0<=x;x--){var E=n[x],z=E.instance,Q=E.currentTarget;if(E=E.listener,z!==o&&u.isPropagationStopped())break e;o=E,u.currentTarget=Q;try{o(u)}catch(se){El(se)}u.currentTarget=null,o=z}else for(x=0;x<n.length;x++){if(E=n[x],z=E.instance,Q=E.currentTarget,E=E.listener,z!==o&&u.isPropagationStopped())break e;o=E,u.currentTarget=Q;try{o(u)}catch(se){El(se)}u.currentTarget=null,o=z}}}}function Ye(e,t){var a=t[es];a===void 0&&(a=t[es]=new Set);var n=e+"__bubble";a.has(n)||(R0(t,e,2,!1),a.add(n))}function Jd(e,t,a){var n=0;t&&(n|=4),R0(a,e,n,t)}var Mc="_reactListening"+Math.random().toString(36).slice(2);function Kd(e){if(!e[Mc]){e[Mc]=!0,ju.forEach(function(a){a!=="selectionchange"&&(Op.has(a)||Jd(a,!1,e),Jd(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mc]||(t[Mc]=!0,Jd("selectionchange",!1,t))}}function R0(e,t,a,n){switch(sg(t)){case 2:var u=ny;break;case 8:u=ly;break;default:u=gf}a=u.bind(null,t,a,e),u=void 0,!li||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),n?u!==void 0?e.addEventListener(t,a,{capture:!0,passive:u}):e.addEventListener(t,a,!0):u!==void 0?e.addEventListener(t,a,{passive:u}):e.addEventListener(t,a,!1)}function ef(e,t,a,n,u){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var x=n.tag;if(x===3||x===4){var E=n.stateNode.containerInfo;if(E===u)break;if(x===4)for(x=n.return;x!==null;){var z=x.tag;if((z===3||z===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;E!==null;){if(x=Un(E),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){n=o=x;continue e}E=E.parentNode}}n=n.return}ni(function(){var Q=o,se=ar(a),ce=[];e:{var I=mi.get(e);if(I!==void 0){var K=ds,be=e;switch(e){case"keypress":if(os(a)===0)break e;case"keydown":case"keyup":K=Mo;break;case"focusin":be="focus",K=ir;break;case"focusout":be="blur",K=ir;break;case"beforeblur":case"afterblur":K=ir;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=Ou;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=yo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=Do;break;case $u:case Fu:case dr:K=vl;break;case hi:K=Ao;break;case"scroll":case"scrollend":K=si;break;case"wheel":K=ko;break;case"copy":case"cut":case"paste":K=pl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Ru;break;case"toggle":case"beforetoggle":K=Uo}var Ae=(t&4)!==0,ut=!Ae&&(e==="scroll"||e==="scrollend"),G=Ae?I!==null?I+"Capture":null:I;Ae=[];for(var V=Q,W;V!==null;){var ue=V;if(W=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||W===null||G===null||(ue=us(V,G),ue!=null&&Ae.push(Bi(V,ue,W))),ut)break;V=V.return}0<Ae.length&&(I=new K(I,be,null,a,se),ce.push({event:I,listeners:Ae}))}}if((t&7)===0){e:{if(I=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",I&&a!==ti&&(be=a.relatedTarget||a.fromElement)&&(Un(be)||be[zn]))break e;if((K||I)&&(I=se.window===se?se:(I=se.ownerDocument)?I.defaultView||I.parentWindow:window,K?(be=a.relatedTarget||a.toElement,K=Q,be=be?Un(be):null,be!==null&&(ut=h(be),Ae=be.tag,be!==ut||Ae!==5&&Ae!==27&&Ae!==6)&&(be=null)):(K=null,be=Q),K!==be)){if(Ae=Ou,ue="onMouseLeave",G="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(Ae=Ru,ue="onPointerLeave",G="onPointerEnter",V="pointer"),ut=K==null?I:ga(K),W=be==null?I:ga(be),I=new Ae(ue,V+"leave",K,a,se),I.target=ut,I.relatedTarget=W,ue=null,Un(se)===Q&&(Ae=new Ae(G,V+"enter",be,a,se),Ae.target=W,Ae.relatedTarget=ut,ue=Ae),ut=ue,K&&be)t:{for(Ae=Rp,G=K,V=be,W=0,ue=G;ue;ue=Ae(ue))W++;ue=0;for(var Me=V;Me;Me=Ae(Me))ue++;for(;0<W-ue;)G=Ae(G),W--;for(;0<ue-W;)V=Ae(V),ue--;for(;W--;){if(G===V||V!==null&&G===V.alternate){Ae=G;break t}G=Ae(G),V=Ae(V)}Ae=null}else Ae=null;K!==null&&D0(ce,I,K,Ae,!1),be!==null&&ut!==null&&D0(ce,ut,be,Ae,!0)}}e:{if(I=Q?ga(Q):window,K=I.nodeName&&I.nodeName.toLowerCase(),K==="select"||K==="input"&&I.type==="file")var Xe=qu;else if(Hu(I))if(Tn)Xe=gt;else{Xe=Sl;var Se=Pe}else K=I.nodeName,!K||K.toLowerCase()!=="input"||I.type!=="checkbox"&&I.type!=="radio"?Q&&tr(Q.elementType)&&(Xe=qu):Xe=Bo;if(Xe&&(Xe=Xe(e,Q))){ii(ce,Xe,a,se);break e}Se&&Se(e,I,Q),e==="focusout"&&Q&&I.type==="number"&&Q.memoizedProps.value!=null&&ns(I,"number",I.value)}switch(Se=Q?ga(Q):window,e){case"focusin":(Hu(Se)||Se.contentEditable==="true")&&(jl=Se,cr=Q,Jt=null);break;case"focusout":Jt=cr=jl=null;break;case"mousedown":or=!0;break;case"contextmenu":case"mouseup":case"dragend":or=!1,Ns(ce,a,se);break;case"selectionchange":if(Yu)break;case"keydown":case"keyup":Ns(ce,a,se)}var qe;if(ri)e:{switch(e){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else bl?Uu(e,a)&&(Ge="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ge="onCompositionStart");Ge&&(_u&&a.locale!=="ko"&&(bl||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&bl&&(qe=Yt()):(wn=se,nr="value"in wn?wn.value:wn.textContent,bl=!0)),Se=Oc(Q,Ge),0<Se.length&&(Ge=new yl(Ge,e,null,a,se),ce.push({event:Ge,listeners:Se}),qe?Ge.data=qe:(qe=Lu(a),qe!==null&&(Ge.data=qe)))),(qe=Lo?Ho(e,a):qo(e,a))&&(Ge=Oc(Q,"onBeforeInput"),0<Ge.length&&(Se=new yl("onBeforeInput","beforeinput",null,a,se),ce.push({event:Se,listeners:Ge}),Se.data=qe)),Tp(ce,e,Q,a,se)}O0(ce,t)})}function Bi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Oc(e,t){for(var a=t+"Capture",n=[];e!==null;){var u=e,o=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||o===null||(u=us(e,a),u!=null&&n.unshift(Bi(e,u,o)),u=us(e,t),u!=null&&n.push(Bi(e,u,o))),e.tag===3)return n;e=e.return}return[]}function Rp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function D0(e,t,a,n,u){for(var o=t._reactName,x=[];a!==null&&a!==n;){var E=a,z=E.alternate,Q=E.stateNode;if(E=E.tag,z!==null&&z===n)break;E!==5&&E!==26&&E!==27||Q===null||(z=Q,u?(Q=us(a,o),Q!=null&&x.unshift(Bi(a,Q,z))):u||(Q=us(a,o),Q!=null&&x.push(Bi(a,Q,z)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var Dp=/\r\n?/g,Ap=/\u0000|\uFFFD/g;function A0(e){return(typeof e=="string"?e:""+e).replace(Dp,`
49
- `).replace(Ap,"")}function _0(e,t){return t=A0(t),A0(e)===t}function it(e,t,a,n,u,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||rn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&rn(e,""+n);break;case"className":Js(e,"class",n);break;case"tabIndex":Js(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Js(e,a,n);break;case"style":Tu(e,n,o);break;case"data":if(t!=="object"){Js(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=is(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(a==="formAction"?(t!=="input"&&it(e,t,"name",u.name,u,null),it(e,t,"formEncType",u.formEncType,u,null),it(e,t,"formMethod",u.formMethod,u,null),it(e,t,"formTarget",u.formTarget,u,null)):(it(e,t,"encType",u.encType,u,null),it(e,t,"method",u.method,u,null),it(e,t,"target",u.target,u,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=is(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=La);break;case"onScroll":n!=null&&Ye("scroll",e);break;case"onScrollEnd":n!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=is(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),It(e,"popover",n);break;case"xlinkActuate":at(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":at(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":at(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":at(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":at(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":at(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":at(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":at(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":at(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":It(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=vo.get(a)||a,It(e,a,n))}}function tf(e,t,a,n,u,o){switch(a){case"style":Tu(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?rn(e,n):(typeof n=="number"||typeof n=="bigint")&&rn(e,""+n);break;case"onScroll":n!=null&&Ye("scroll",e);break;case"onScrollEnd":n!=null&&Ye("scrollend",e);break;case"onClick":n!=null&&(e.onclick=La);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),o=e[Bt]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,u),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,u);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):It(e,a,n)}}}function aa(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var n=!1,u=!1,o;for(o in a)if(a.hasOwnProperty(o)){var x=a[o];if(x!=null)switch(o){case"src":n=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,o,x,a,null)}}u&&it(e,t,"srcSet",a.srcSet,a,null),n&&it(e,t,"src",a.src,a,null);return;case"input":Ye("invalid",e);var E=o=x=u=null,z=null,Q=null;for(n in a)if(a.hasOwnProperty(n)){var se=a[n];if(se!=null)switch(n){case"name":u=se;break;case"type":x=se;break;case"checked":z=se;break;case"defaultChecked":Q=se;break;case"value":o=se;break;case"defaultValue":E=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:it(e,t,n,se,a,null)}}gl(e,o,E,z,Q,x,u,!1);return;case"select":Ye("invalid",e),n=x=o=null;for(u in a)if(a.hasOwnProperty(u)&&(E=a[u],E!=null))switch(u){case"value":o=E;break;case"defaultValue":x=E;break;case"multiple":n=E;default:it(e,t,u,E,a,null)}t=o,a=x,e.multiple=!!n,t!=null?Hn(e,!!n,t,!1):a!=null&&Hn(e,!!n,a,!0);return;case"textarea":Ye("invalid",e),o=u=n=null;for(x in a)if(a.hasOwnProperty(x)&&(E=a[x],E!=null))switch(x){case"value":n=E;break;case"defaultValue":u=E;break;case"children":o=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(c(91));break;default:it(e,t,x,E,a,null)}ei(e,n,u,o);return;case"option":for(z in a)if(a.hasOwnProperty(z)&&(n=a[z],n!=null))switch(z){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:it(e,t,z,n,a,null)}return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(n=0;n<Vi.length;n++)Ye(Vi[n],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(Q in a)if(a.hasOwnProperty(Q)&&(n=a[Q],n!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:it(e,t,Q,n,a,null)}return;default:if(tr(t)){for(se in a)a.hasOwnProperty(se)&&(n=a[se],n!==void 0&&tf(e,t,se,n,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(n=a[E],n!=null&&it(e,t,E,n,a,null))}function _p(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,o=null,x=null,E=null,z=null,Q=null,se=null;for(K in a){var ce=a[K];if(a.hasOwnProperty(K)&&ce!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":z=ce;default:n.hasOwnProperty(K)||it(e,t,K,null,n,ce)}}for(var I in n){var K=n[I];if(ce=a[I],n.hasOwnProperty(I)&&(K!=null||ce!=null))switch(I){case"type":o=K;break;case"name":u=K;break;case"checked":Q=K;break;case"defaultChecked":se=K;break;case"value":x=K;break;case"defaultValue":E=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(c(137,t));break;default:K!==ce&&it(e,t,I,K,n,ce)}}er(e,x,E,z,Q,se,o,u);return;case"select":K=x=E=I=null;for(o in a)if(z=a[o],a.hasOwnProperty(o)&&z!=null)switch(o){case"value":break;case"multiple":K=z;default:n.hasOwnProperty(o)||it(e,t,o,null,n,z)}for(u in n)if(o=n[u],z=a[u],n.hasOwnProperty(u)&&(o!=null||z!=null))switch(u){case"value":I=o;break;case"defaultValue":E=o;break;case"multiple":x=o;default:o!==z&&it(e,t,u,o,n,z)}t=E,a=x,n=K,I!=null?Hn(e,!!a,I,!1):!!n!=!!a&&(t!=null?Hn(e,!!a,t,!0):Hn(e,!!a,a?[]:"",!1));return;case"textarea":K=I=null;for(E in a)if(u=a[E],a.hasOwnProperty(E)&&u!=null&&!n.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:it(e,t,E,null,n,u)}for(x in n)if(u=n[x],o=a[x],n.hasOwnProperty(x)&&(u!=null||o!=null))switch(x){case"value":I=u;break;case"defaultValue":K=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==o&&it(e,t,x,u,n,o)}ls(e,I,K);return;case"option":for(var be in a)if(I=a[be],a.hasOwnProperty(be)&&I!=null&&!n.hasOwnProperty(be))switch(be){case"selected":e.selected=!1;break;default:it(e,t,be,null,n,I)}for(z in n)if(I=n[z],K=a[z],n.hasOwnProperty(z)&&I!==K&&(I!=null||K!=null))switch(z){case"selected":e.selected=I&&typeof I!="function"&&typeof I!="symbol";break;default:it(e,t,z,I,n,K)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ae in a)I=a[Ae],a.hasOwnProperty(Ae)&&I!=null&&!n.hasOwnProperty(Ae)&&it(e,t,Ae,null,n,I);for(Q in n)if(I=n[Q],K=a[Q],n.hasOwnProperty(Q)&&I!==K&&(I!=null||K!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(c(137,t));break;default:it(e,t,Q,I,n,K)}return;default:if(tr(t)){for(var ut in a)I=a[ut],a.hasOwnProperty(ut)&&I!==void 0&&!n.hasOwnProperty(ut)&&tf(e,t,ut,void 0,n,I);for(se in n)I=n[se],K=a[se],!n.hasOwnProperty(se)||I===K||I===void 0&&K===void 0||tf(e,t,se,I,n,K);return}}for(var G in a)I=a[G],a.hasOwnProperty(G)&&I!=null&&!n.hasOwnProperty(G)&&it(e,t,G,null,n,I);for(ce in n)I=n[ce],K=a[ce],!n.hasOwnProperty(ce)||I===K||I==null&&K==null||it(e,t,ce,I,n,K)}function k0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var u=a[n],o=u.transferSize,x=u.initiatorType,E=u.duration;if(o&&E&&k0(x)){for(x=0,E=u.responseEnd,n+=1;n<a.length;n++){var z=a[n],Q=z.startTime;if(Q>E)break;var se=z.transferSize,ce=z.initiatorType;se&&k0(ce)&&(z=z.responseEnd,x+=se*(z<E?1:(E-Q)/(z-Q)))}if(--n,t+=8*(o+x)/(u.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 af=null,nf=null;function Rc(e){return e.nodeType===9?e:e.ownerDocument}function z0(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 U0(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 lf(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 sf=null;function zp(){var e=window.event;return e&&e.type==="popstate"?e===sf?!1:(sf=e,!0):(sf=null,!1)}var L0=typeof setTimeout=="function"?setTimeout:void 0,Up=typeof clearTimeout=="function"?clearTimeout:void 0,H0=typeof Promise=="function"?Promise:void 0,Lp=typeof queueMicrotask=="function"?queueMicrotask:typeof H0<"u"?function(e){return H0.resolve(null).then(e).catch(Hp)}:L0;function Hp(e){setTimeout(function(){throw e})}function Vl(e){return e==="head"}function q0(e,t){var a=t,n=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(u),Lr(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Yi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Yi(a);for(var o=a.firstChild;o;){var x=o.nextSibling,E=o.nodeName;o[ts]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=x}}else a==="body"&&Yi(e.ownerDocument.body);a=u}while(a);Lr(t)}function V0(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function rf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":rf(a),Xs(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function qp(e,t,a,n){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ts])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Za(e.nextSibling),e===null)break}return null}function Vp(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Za(e.nextSibling),e===null))return null;return e}function B0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Za(e.nextSibling),e===null))return null;return e}function uf(e){return e.data==="$?"||e.data==="$~"}function cf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bp(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Za(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 of=null;function Y0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Za(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function P0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function $0(e,t,a){switch(t=Rc(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Yi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Xs(e)}var Wa=new Map,F0=new Set;function Dc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var nl=te.d;te.d={f:Yp,r:Pp,D:$p,C:Fp,L:Gp,m:Zp,X:Qp,S:Wp,M:Ip};function Yp(){var e=nl.f(),t=Sc();return e||t}function Pp(e){var t=Oe(e);t!==null&&t.tag===5&&t.type==="form"?um(t):nl.r(e)}var kr=typeof document>"u"?null:document;function G0(e,t,a){var n=kr;if(n&&typeof t=="string"&&t){var u=Xt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),F0.has(u)||(F0.add(u),e={rel:e,crossOrigin:a,href:t},n.querySelector(u)===null&&(t=n.createElement("link"),aa(t,"link",e),zt(t),n.head.appendChild(t)))}}function $p(e){nl.D(e),G0("dns-prefetch",e,null)}function Fp(e,t){nl.C(e,t),G0("preconnect",e,t)}function Gp(e,t,a){nl.L(e,t,a);var n=kr;if(n&&e&&t){var u='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Xt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Xt(a.imageSizes)+'"]')):u+='[href="'+Xt(e)+'"]';var o=u;switch(t){case"style":o=zr(e);break;case"script":o=Ur(e)}Wa.has(o)||(e=T({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Wa.set(o,e),n.querySelector(u)!==null||t==="style"&&n.querySelector(Pi(o))||t==="script"&&n.querySelector($i(o))||(t=n.createElement("link"),aa(t,"link",e),zt(t),n.head.appendChild(t)))}}function Zp(e,t){nl.m(e,t);var a=kr;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Xt(n)+'"][href="'+Xt(e)+'"]',o=u;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ur(e)}if(!Wa.has(o)&&(e=T({rel:"modulepreload",href:e},t),Wa.set(o,e),a.querySelector(u)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($i(o)))return}n=a.createElement("link"),aa(n,"link",e),zt(n),a.head.appendChild(n)}}}function Wp(e,t,a){nl.S(e,t,a);var n=kr;if(n&&e){var u=ln(n).hoistableStyles,o=zr(e);t=t||"default";var x=u.get(o);if(!x){var E={loading:0,preload:null};if(x=n.querySelector(Pi(o)))E.loading=5;else{e=T({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Wa.get(o))&&df(e,a);var z=x=n.createElement("link");zt(z),aa(z,"link",e),z._p=new Promise(function(Q,se){z.onload=Q,z.onerror=se}),z.addEventListener("load",function(){E.loading|=1}),z.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ac(x,t,n)}x={type:"stylesheet",instance:x,count:1,state:E},u.set(o,x)}}}function Qp(e,t){nl.X(e,t);var a=kr;if(a&&e){var n=ln(a).hoistableScripts,u=Ur(e),o=n.get(u);o||(o=a.querySelector($i(u)),o||(e=T({src:e,async:!0},t),(t=Wa.get(u))&&ff(e,t),o=a.createElement("script"),zt(o),aa(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(u,o))}}function Ip(e,t){nl.M(e,t);var a=kr;if(a&&e){var n=ln(a).hoistableScripts,u=Ur(e),o=n.get(u);o||(o=a.querySelector($i(u)),o||(e=T({src:e,async:!0,type:"module"},t),(t=Wa.get(u))&&ff(e,t),o=a.createElement("script"),zt(o),aa(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(u,o))}}function Z0(e,t,a,n){var u=(u=xe.current)?Dc(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=zr(a.href),a=ln(u).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=zr(a.href);var o=ln(u).hoistableStyles,x=o.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,x),(o=u.querySelector(Pi(e)))&&!o._p&&(x.instance=o,x.state.loading=5),Wa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Wa.set(e,a),o||Xp(u,e,a,x.state))),t&&n===null)throw Error(c(528,""));return x}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ur(a),a=ln(u).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function zr(e){return'href="'+Xt(e)+'"'}function Pi(e){return'link[rel="stylesheet"]['+e+"]"}function W0(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Xp(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),aa(t,"link",a),zt(t),e.head.appendChild(t))}function Ur(e){return'[src="'+Xt(e)+'"]'}function $i(e){return"script[async]"+e}function Q0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Xt(a.href)+'"]');if(n)return t.instance=n,zt(n),n;var u=T({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),zt(n),aa(n,"style",u),Ac(n,a.precedence,e),t.instance=n;case"stylesheet":u=zr(a.href);var o=e.querySelector(Pi(u));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;n=W0(a),(u=Wa.get(u))&&df(n,u),o=(e.ownerDocument||e).createElement("link"),zt(o);var x=o;return x._p=new Promise(function(E,z){x.onload=E,x.onerror=z}),aa(o,"link",n),t.state.loading|=4,Ac(o,a.precedence,e),t.instance=o;case"script":return o=Ur(a.src),(u=e.querySelector($i(o)))?(t.instance=u,zt(u),u):(n=a,(u=Wa.get(o))&&(n=T({},a),ff(n,u)),e=e.ownerDocument||e,u=e.createElement("script"),zt(u),aa(u,"link",n),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Ac(n,a.precedence,e));return t.instance}function Ac(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=n.length?n[n.length-1]:null,o=u,x=0;x<n.length;x++){var E=n[x];if(E.dataset.precedence===t)o=E;else if(o!==u)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function df(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ff(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _c=null;function I0(e,t,a){if(_c===null){var n=new Map,u=_c=new Map;u.set(a,n)}else u=_c,n=u.get(a),n||(n=new Map,u.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var o=a[u];if(!(o[ts]||o[wt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var x=o.getAttribute(t)||"";x=e+x;var E=n.get(x);E?E.push(o):n.set(x,[o])}}return n}function X0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Jp(e,t,a){if(a===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 J0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Kp(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=zr(n.href),o=t.querySelector(Pi(u));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=kc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,zt(o);return}o=t.ownerDocument||t,n=W0(n),(u=Wa.get(u))&&df(n,u),o=o.createElement("link"),zt(o);var x=o;x._p=new Promise(function(E,z){x.onload=E,x.onerror=z}),aa(o,"link",n),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=kc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var hf=0;function ey(e,t){return e.stylesheets&&e.count===0&&Uc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Uc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&hf===0&&(hf=62500*kp());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Uc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>hf?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(u)}}:null}function kc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var zc=null;function Uc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,zc=new Map,t.forEach(ty,e),zc=null,kc.call(e))}function ty(e,t){if(!(t.state.loading&4)){var a=zc.get(e);if(a)var n=a.get(null);else{a=new Map,zc.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<u.length;o++){var x=u[o];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),n=x)}n&&a.set(null,n)}u=t.instance,x=u.getAttribute("data-precedence"),o=a.get(x)||n,o===n&&a.set(null,u),a.set(x,u),this.count++,n=kc.bind(this),u.addEventListener("load",n),u.addEventListener("error",n),o?o.parentNode.insertBefore(u,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Fi={$$typeof:M,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function ay(e,t,a,n,u,o,x,E,z){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=Ws(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ws(0),this.hiddenUpdates=Ws(null),this.identifierPrefix=n,this.onUncaughtError=u,this.onCaughtError=o,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function K0(e,t,a,n,u,o,x,E,z,Q,se,ce){return e=new ay(e,t,a,x,z,Q,se,ce,E),t=1,o===!0&&(t|=24),o=Kt(3,null,null,t),e.current=o,o.stateNode=e,t=Fo(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},Qo(o),e}function eg(e){return e?(e=Ca,e):Ca}function tg(e,t,a,n,u,o){u=eg(u),n.context===null?n.context=u:n.pendingContext=u,n=Ol(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Rl(e,n,t),a!==null&&(wa(a,e,t),ji(a,e,t))}function ag(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function mf(e,t){ag(e,t),(e=e.alternate)&&ag(e,t)}function ng(e){if(e.tag===13||e.tag===31){var t=Va(e,67108864);t!==null&&wa(t,e,67108864),mf(e,67108864)}}function lg(e){if(e.tag===13||e.tag===31){var t=Aa();t=Qs(t);var a=Va(e,t);a!==null&&wa(a,e,t),mf(e,t)}}var Lc=!0;function ny(e,t,a,n){var u=P.T;P.T=null;var o=te.p;try{te.p=2,gf(e,t,a,n)}finally{te.p=o,P.T=u}}function ly(e,t,a,n){var u=P.T;P.T=null;var o=te.p;try{te.p=8,gf(e,t,a,n)}finally{te.p=o,P.T=u}}function gf(e,t,a,n){if(Lc){var u=xf(n);if(u===null)ef(e,t,n,Hc,a),rg(e,n);else if(ry(u,e,t,a,n))n.stopPropagation();else if(rg(e,n),t&4&&-1<sy.indexOf(e)){for(;u!==null;){var o=Oe(u);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var x=Nn(o.pendingLanes);if(x!==0){var E=o;for(E.pendingLanes|=2,E.entangledLanes|=2;x;){var z=1<<31-_t(x);E.entanglements[1]|=z,x&=~z}Rn(o),(Ke&6)===0&&(bc=Qt()+500,qi(0))}}break;case 31:case 13:E=Va(o,2),E!==null&&wa(E,o,2),Sc(),mf(o,2)}if(o=xf(n),o===null&&ef(e,t,n,Hc,a),o===u)break;u=o}u!==null&&n.stopPropagation()}else ef(e,t,n,null,a)}}function xf(e){return e=ar(e),vf(e)}var Hc=null;function vf(e){if(Hc=null,e=Un(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=b(t),e!==null)return e;e=null}else if(a===31){if(e=N(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Hc=e,null}function sg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ul()){case Zr:return 2;case Gs:return 8;case kn:case Zs:return 32;case cl:return 268435456;default:return 32}default:return 32}}var pf=!1,Bl=null,Yl=null,Pl=null,Gi=new Map,Zi=new Map,$l=[],sy="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 rg(e,t){switch(e){case"focusin":case"focusout":Bl=null;break;case"dragenter":case"dragleave":Yl=null;break;case"mouseover":case"mouseout":Pl=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zi.delete(t.pointerId)}}function Wi(e,t,a,n,u,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[u]},t!==null&&(t=Oe(t),t!==null&&ng(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function ry(e,t,a,n,u){switch(t){case"focusin":return Bl=Wi(Bl,e,t,a,n,u),!0;case"dragenter":return Yl=Wi(Yl,e,t,a,n,u),!0;case"mouseover":return Pl=Wi(Pl,e,t,a,n,u),!0;case"pointerover":var o=u.pointerId;return Gi.set(o,Wi(Gi.get(o)||null,e,t,a,n,u)),!0;case"gotpointercapture":return o=u.pointerId,Zi.set(o,Wi(Zi.get(o)||null,e,t,a,n,u)),!0}return!1}function ig(e){var t=Un(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=b(a),t!==null){e.blockedOn=t,Ir(e.priority,function(){lg(a)});return}}else if(t===31){if(t=N(a),t!==null){e.blockedOn=t,Ir(e.priority,function(){lg(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=xf(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);ti=n,a.target.dispatchEvent(n),ti=null}else return t=Oe(a),t!==null&&ng(t),e.blockedOn=a,!1;t.shift()}return!0}function ug(e,t,a){qc(e)&&a.delete(t)}function iy(){pf=!1,Bl!==null&&qc(Bl)&&(Bl=null),Yl!==null&&qc(Yl)&&(Yl=null),Pl!==null&&qc(Pl)&&(Pl=null),Gi.forEach(ug),Zi.forEach(ug)}function Vc(e,t){e.blockedOn===t&&(e.blockedOn=null,pf||(pf=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,iy)))}var Bc=null;function cg(e){Bc!==e&&(Bc=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Bc===e&&(Bc=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],u=e[t+2];if(typeof n!="function"){if(vf(n||a)===null)continue;break}var o=Oe(a);o!==null&&(e.splice(t,3),t-=3,gd(o,{pending:!0,data:u,method:a.method,action:n},n,u))}}))}function Lr(e){function t(z){return Vc(z,e)}Bl!==null&&Vc(Bl,e),Yl!==null&&Vc(Yl,e),Pl!==null&&Vc(Pl,e),Gi.forEach(t),Zi.forEach(t);for(var a=0;a<$l.length;a++){var n=$l[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<$l.length&&(a=$l[0],a.blockedOn===null);)ig(a),a.blockedOn===null&&$l.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var u=a[n],o=a[n+1],x=u[Bt]||null;if(typeof o=="function")x||cg(a);else if(x){var E=null;if(o&&o.hasAttribute("formAction")){if(u=o,x=o[Bt]||null)E=x.formAction;else if(vf(u)!==null)continue}else E=x.action;typeof E=="function"?a[n+1]=E:(a.splice(n,3),n-=3),cg(a)}}}function og(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function yf(e){this._internalRoot=e}Yc.prototype.render=yf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Aa();tg(a,n,e,t,null,null)},Yc.prototype.unmount=yf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tg(e.current,2,null,e,null,null),Sc(),t[zn]=null}};function Yc(e){this._internalRoot=e}Yc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Is();e={blockedOn:null,target:e,priority:t};for(var a=0;a<$l.length&&t!==0&&t<$l[a].priority;a++);$l.splice(a,0,e),a===0&&ig(e)}};var dg=r.version;if(dg!=="19.2.4")throw Error(c(527,dg,"19.2.4"));te.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=p(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var uy={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pc.isDisabled&&Pc.supportsFiber)try{mt=Pc.inject(uy),Vt=Pc}catch{}}return Ii.createRoot=function(e,t){if(!f(e))throw Error(c(299));var a=!1,n="",u=pm,o=ym,x=bm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=K0(e,1,!1,null,null,a,n,null,u,o,x,og),e[zn]=t.current,Kd(e),new yf(t)},Ii.hydrateRoot=function(e,t,a){if(!f(e))throw Error(c(299));var n=!1,u="",o=pm,x=ym,E=bm,z=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(z=a.formState)),t=K0(e,1,!0,t,a??null,n,u,z,o,x,E,og),t.context=eg(null),a=t.current,n=Aa(),n=Qs(n),u=Ol(n),u.callback=null,Rl(a,u,n),a=n,t.current.lanes=a,fl(t,a),Rn(t),e[zn]=t.current,Kd(e),new Yc(t)},Ii.version="19.2.4",Ii}var jg;function by(){if(jg)return jf.exports;jg=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),jf.exports=yy(),jf.exports}var Ny=by();const Sy=Qf(Ny);/**
50
- * react-router v7.13.0
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var wg="popstate";function jy(l={}){function r(f,h){let{pathname:b="/",search:N="",hash:y=""}=Ps(f.location.hash.substring(1));return!b.startsWith("/")&&!b.startsWith(".")&&(b="/"+b),Hf("",{pathname:b,search:N,hash:y},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function d(f,h){let b=f.document.querySelector("base"),N="";if(b&&b.getAttribute("href")){let y=f.location.href,p=y.indexOf("#");N=p===-1?y:y.slice(0,p)}return N+"#"+(typeof h=="string"?h:fu(h))}function c(f,h){Xa(f.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(h)})`)}return Ey(r,d,c,l)}function pt(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function Xa(l,r){if(!l){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function wy(){return Math.random().toString(36).substring(2,10)}function Eg(l,r){return{usr:l.state,key:l.key,idx:r}}function Hf(l,r,d=null,c){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof r=="string"?Ps(r):r,state:d,key:r&&r.key||c||wy()}}function fu({pathname:l="/",search:r="",hash:d=""}){return r&&r!=="?"&&(l+=r.charAt(0)==="?"?r:"?"+r),d&&d!=="#"&&(l+=d.charAt(0)==="#"?d:"#"+d),l}function Ps(l){let r={};if(l){let d=l.indexOf("#");d>=0&&(r.hash=l.substring(d),l=l.substring(0,d));let c=l.indexOf("?");c>=0&&(r.search=l.substring(c),l=l.substring(0,c)),l&&(r.pathname=l)}return r}function Ey(l,r,d,c={}){let{window:f=document.defaultView,v5Compat:h=!1}=c,b=f.history,N="POP",y=null,p=j();p==null&&(p=0,b.replaceState({...b.state,idx:p},""));function j(){return(b.state||{idx:null}).idx}function T(){N="POP";let A=j(),$=A==null?null:A-p;p=A,y&&y({action:N,location:C.location,delta:$})}function _(A,$){N="PUSH";let B=Hf(C.location,A,$);d&&d(B,A),p=j()+1;let M=Eg(B,p),X=C.createHref(B);try{b.pushState(M,"",X)}catch(ie){if(ie instanceof DOMException&&ie.name==="DataCloneError")throw ie;f.location.assign(X)}h&&y&&y({action:N,location:C.location,delta:1})}function k(A,$){N="REPLACE";let B=Hf(C.location,A,$);d&&d(B,A),p=j();let M=Eg(B,p),X=C.createHref(B);b.replaceState(M,"",X),h&&y&&y({action:N,location:C.location,delta:0})}function S(A){return Ty(A)}let C={get action(){return N},get location(){return l(f,b)},listen(A){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(wg,T),y=A,()=>{f.removeEventListener(wg,T),y=null}},createHref(A){return r(f,A)},createURL:S,encodeLocation(A){let $=S(A);return{pathname:$.pathname,search:$.search,hash:$.hash}},push:_,replace:k,go(A){return b.go(A)}};return C}function Ty(l,r=!1){let d="http://localhost";typeof window<"u"&&(d=window.location.origin!=="null"?window.location.origin:window.location.href),pt(d,"No window.location.(origin|href) available to create URL");let c=typeof l=="string"?l:fu(l);return c=c.replace(/ $/,"%20"),!r&&c.startsWith("//")&&(c=d+c),new URL(c,d)}function Mx(l,r,d="/"){return Cy(l,r,d,!1)}function Cy(l,r,d,c){let f=typeof r=="string"?Ps(r):r,h=il(f.pathname||"/",d);if(h==null)return null;let b=Ox(l);My(b);let N=null;for(let y=0;N==null&&y<b.length;++y){let p=qy(h);N=Ly(b[y],p,c)}return N}function Ox(l,r=[],d=[],c="",f=!1){let h=(b,N,y=f,p)=>{let j={relativePath:p===void 0?b.path||"":p,caseSensitive:b.caseSensitive===!0,childrenIndex:N,route:b};if(j.relativePath.startsWith("/")){if(!j.relativePath.startsWith(c)&&y)return;pt(j.relativePath.startsWith(c),`Absolute route path "${j.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),j.relativePath=j.relativePath.slice(c.length)}let T=rl([c,j.relativePath]),_=d.concat(j);b.children&&b.children.length>0&&(pt(b.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${T}".`),Ox(b.children,r,_,T,y)),!(b.path==null&&!b.index)&&r.push({path:T,score:zy(T,b.index),routesMeta:_})};return l.forEach((b,N)=>{var y;if(b.path===""||!((y=b.path)!=null&&y.includes("?")))h(b,N);else for(let p of Rx(b.path))h(b,N,!0,p)}),r}function Rx(l){let r=l.split("/");if(r.length===0)return[];let[d,...c]=r,f=d.endsWith("?"),h=d.replace(/\?$/,"");if(c.length===0)return f?[h,""]:[h];let b=Rx(c.join("/")),N=[];return N.push(...b.map(y=>y===""?h:[h,y].join("/"))),f&&N.push(...b),N.map(y=>l.startsWith("/")&&y===""?"/":y)}function My(l){l.sort((r,d)=>r.score!==d.score?d.score-r.score:Uy(r.routesMeta.map(c=>c.childrenIndex),d.routesMeta.map(c=>c.childrenIndex)))}var Oy=/^:[\w-]+$/,Ry=3,Dy=2,Ay=1,_y=10,ky=-2,Tg=l=>l==="*";function zy(l,r){let d=l.split("/"),c=d.length;return d.some(Tg)&&(c+=ky),r&&(c+=Dy),d.filter(f=>!Tg(f)).reduce((f,h)=>f+(Oy.test(h)?Ry:h===""?Ay:_y),c)}function Uy(l,r){return l.length===r.length&&l.slice(0,-1).every((c,f)=>c===r[f])?l[l.length-1]-r[r.length-1]:0}function Ly(l,r,d=!1){let{routesMeta:c}=l,f={},h="/",b=[];for(let N=0;N<c.length;++N){let y=c[N],p=N===c.length-1,j=h==="/"?r:r.slice(h.length)||"/",T=to({path:y.relativePath,caseSensitive:y.caseSensitive,end:p},j),_=y.route;if(!T&&p&&d&&!c[c.length-1].route.index&&(T=to({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},j)),!T)return null;Object.assign(f,T.params),b.push({params:f,pathname:rl([h,T.pathname]),pathnameBase:Py(rl([h,T.pathnameBase])),route:_}),T.pathnameBase!=="/"&&(h=rl([h,T.pathnameBase]))}return b}function to(l,r){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[d,c]=Hy(l.path,l.caseSensitive,l.end),f=r.match(d);if(!f)return null;let h=f[0],b=h.replace(/(.)\/+$/,"$1"),N=f.slice(1);return{params:c.reduce((p,{paramName:j,isOptional:T},_)=>{if(j==="*"){let S=N[_]||"";b=h.slice(0,h.length-S.length).replace(/(.)\/+$/,"$1")}const k=N[_];return T&&!k?p[j]=void 0:p[j]=(k||"").replace(/%2F/g,"/"),p},{}),pathname:h,pathnameBase:b,pattern:l}}function Hy(l,r=!1,d=!0){Xa(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let c=[],f="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(b,N,y)=>(c.push({paramName:N,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(c.push({paramName:"*"}),f+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):d?f+="\\/*$":l!==""&&l!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,r?void 0:"i"),c]}function qy(l){try{return l.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Xa(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),l}}function il(l,r){if(r==="/")return l;if(!l.toLowerCase().startsWith(r.toLowerCase()))return null;let d=r.endsWith("/")?r.length-1:r.length,c=l.charAt(d);return c&&c!=="/"?null:l.slice(d)||"/"}var Vy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function By(l,r="/"){let{pathname:d,search:c="",hash:f=""}=typeof l=="string"?Ps(l):l,h;return d?(d=d.replace(/\/\/+/g,"/"),d.startsWith("/")?h=Cg(d.substring(1),"/"):h=Cg(d,r)):h=r,{pathname:h,search:$y(c),hash:Fy(f)}}function Cg(l,r){let d=r.replace(/\/+$/,"").split("/");return l.split("/").forEach(f=>{f===".."?d.length>1&&d.pop():f!=="."&&d.push(f)}),d.length>1?d.join("/"):"/"}function Cf(l,r,d,c){return`Cannot include a '${l}' character in a manually specified \`to.${r}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${d}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yy(l){return l.filter((r,d)=>d===0||r.route.path&&r.route.path.length>0)}function Xf(l){let r=Yy(l);return r.map((d,c)=>c===r.length-1?d.pathname:d.pathnameBase)}function Jf(l,r,d,c=!1){let f;typeof l=="string"?f=Ps(l):(f={...l},pt(!f.pathname||!f.pathname.includes("?"),Cf("?","pathname","search",f)),pt(!f.pathname||!f.pathname.includes("#"),Cf("#","pathname","hash",f)),pt(!f.search||!f.search.includes("#"),Cf("#","search","hash",f)));let h=l===""||f.pathname==="",b=h?"/":f.pathname,N;if(b==null)N=d;else{let T=r.length-1;if(!c&&b.startsWith("..")){let _=b.split("/");for(;_[0]==="..";)_.shift(),T-=1;f.pathname=_.join("/")}N=T>=0?r[T]:"/"}let y=By(f,N),p=b&&b!=="/"&&b.endsWith("/"),j=(h||b===".")&&d.endsWith("/");return!y.pathname.endsWith("/")&&(p||j)&&(y.pathname+="/"),y}var rl=l=>l.join("/").replace(/\/\/+/g,"/"),Py=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),$y=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,Fy=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,Gy=class{constructor(l,r,d,c=!1){this.status=l,this.statusText=r||"",this.internal=c,d instanceof Error?(this.data=d.toString(),this.error=d):this.data=d}};function Zy(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function Wy(l){return l.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Dx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ax(l,r){let d=l;if(typeof d!="string"||!Vy.test(d))return{absoluteURL:void 0,isExternal:!1,to:d};let c=d,f=!1;if(Dx)try{let h=new URL(window.location.href),b=d.startsWith("//")?new URL(h.protocol+d):new URL(d),N=il(b.pathname,r);b.origin===h.origin&&N!=null?d=N+b.search+b.hash:f=!0}catch{Xa(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:f,to:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _x=["POST","PUT","PATCH","DELETE"];new Set(_x);var Qy=["GET",..._x];new Set(Qy);var Yr=U.createContext(null);Yr.displayName="DataRouter";var co=U.createContext(null);co.displayName="DataRouterState";var Iy=U.createContext(!1),kx=U.createContext({isTransitioning:!1});kx.displayName="ViewTransition";var Xy=U.createContext(new Map);Xy.displayName="Fetchers";var Jy=U.createContext(null);Jy.displayName="Await";var za=U.createContext(null);za.displayName="Navigation";var gu=U.createContext(null);gu.displayName="Location";var An=U.createContext({outlet:null,matches:[],isDataRoute:!1});An.displayName="Route";var Kf=U.createContext(null);Kf.displayName="RouteError";var zx="REACT_ROUTER_ERROR",Ky="REDIRECT",eb="ROUTE_ERROR_RESPONSE";function tb(l){if(l.startsWith(`${zx}:${Ky}:{`))try{let r=JSON.parse(l.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function ab(l){if(l.startsWith(`${zx}:${eb}:{`))try{let r=JSON.parse(l.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Gy(r.status,r.statusText,r.data)}catch{}}function nb(l,{relative:r}={}){pt(Pr(),"useHref() may be used only in the context of a <Router> component.");let{basename:d,navigator:c}=U.useContext(za),{hash:f,pathname:h,search:b}=xu(l,{relative:r}),N=h;return d!=="/"&&(N=h==="/"?d:rl([d,h])),c.createHref({pathname:N,search:b,hash:f})}function Pr(){return U.useContext(gu)!=null}function _n(){return pt(Pr(),"useLocation() may be used only in the context of a <Router> component."),U.useContext(gu).location}var Ux="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Lx(l){U.useContext(za).static||U.useLayoutEffect(l)}function oo(){let{isDataRoute:l}=U.useContext(An);return l?xb():lb()}function lb(){pt(Pr(),"useNavigate() may be used only in the context of a <Router> component.");let l=U.useContext(Yr),{basename:r,navigator:d}=U.useContext(za),{matches:c}=U.useContext(An),{pathname:f}=_n(),h=JSON.stringify(Xf(c)),b=U.useRef(!1);return Lx(()=>{b.current=!0}),U.useCallback((y,p={})=>{if(Xa(b.current,Ux),!b.current)return;if(typeof y=="number"){d.go(y);return}let j=Jf(y,JSON.parse(h),f,p.relative==="path");l==null&&r!=="/"&&(j.pathname=j.pathname==="/"?r:rl([r,j.pathname])),(p.replace?d.replace:d.push)(j,p.state,p)},[r,d,h,f,l])}U.createContext(null);function xu(l,{relative:r}={}){let{matches:d}=U.useContext(An),{pathname:c}=_n(),f=JSON.stringify(Xf(d));return U.useMemo(()=>Jf(l,JSON.parse(f),c,r==="path"),[l,f,c,r])}function sb(l,r){return Hx(l,r)}function Hx(l,r,d,c,f){var B;pt(Pr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:h}=U.useContext(za),{matches:b}=U.useContext(An),N=b[b.length-1],y=N?N.params:{},p=N?N.pathname:"/",j=N?N.pathnameBase:"/",T=N&&N.route;{let M=T&&T.path||"";Vx(p,!T||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let _=_n(),k;if(r){let M=typeof r=="string"?Ps(r):r;pt(j==="/"||((B=M.pathname)==null?void 0:B.startsWith(j)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${j}" but pathname "${M.pathname}" was given in the \`location\` prop.`),k=M}else k=_;let S=k.pathname||"/",C=S;if(j!=="/"){let M=j.replace(/^\//,"").split("/");C="/"+S.replace(/^\//,"").split("/").slice(M.length).join("/")}let A=Mx(l,{pathname:C});Xa(T||A!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Xa(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let $=ob(A&&A.map(M=>Object.assign({},M,{params:Object.assign({},y,M.params),pathname:rl([j,h.encodeLocation?h.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?j:rl([j,h.encodeLocation?h.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),b,d,c,f);return r&&$?U.createElement(gu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...k},navigationType:"POP"}},$):$}function rb(){let l=gb(),r=Zy(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),d=l instanceof Error?l.stack:null,c="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:c},h={padding:"2px 4px",backgroundColor:c},b=null;return console.error("Error handled by React Router default ErrorBoundary:",l),b=U.createElement(U.Fragment,null,U.createElement("p",null,"💿 Hey developer 👋"),U.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",U.createElement("code",{style:h},"ErrorBoundary")," or"," ",U.createElement("code",{style:h},"errorElement")," prop on your route.")),U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},r),d?U.createElement("pre",{style:f},d):null,b)}var ib=U.createElement(rb,null),qx=class extends U.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,r){return r.location!==l.location||r.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:r.error,location:r.location,revalidation:l.revalidation||r.revalidation}}componentDidCatch(l,r){this.props.onError?this.props.onError(l,r):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const d=ab(l.digest);d&&(l=d)}let r=l!==void 0?U.createElement(An.Provider,{value:this.props.routeContext},U.createElement(Kf.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?U.createElement(ub,{error:l},r):r}};qx.contextType=Iy;var Mf=new WeakMap;function ub({children:l,error:r}){let{basename:d}=U.useContext(za);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let c=tb(r.digest);if(c){let f=Mf.get(r);if(f)throw f;let h=Ax(c.location,d);if(Dx&&!Mf.get(r))if(h.isExternal||c.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const b=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:c.replace}));throw Mf.set(r,b),b}return U.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return l}function cb({routeContext:l,match:r,children:d}){let c=U.useContext(Yr);return c&&c.static&&c.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=r.route.id),U.createElement(An.Provider,{value:l},d)}function ob(l,r=[],d=null,c=null,f=null){if(l==null){if(!d)return null;if(d.errors)l=d.matches;else if(r.length===0&&!d.initialized&&d.matches.length>0)l=d.matches;else return null}let h=l,b=d==null?void 0:d.errors;if(b!=null){let j=h.findIndex(T=>T.route.id&&(b==null?void 0:b[T.route.id])!==void 0);pt(j>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(b).join(",")}`),h=h.slice(0,Math.min(h.length,j+1))}let N=!1,y=-1;if(d)for(let j=0;j<h.length;j++){let T=h[j];if((T.route.HydrateFallback||T.route.hydrateFallbackElement)&&(y=j),T.route.id){let{loaderData:_,errors:k}=d,S=T.route.loader&&!_.hasOwnProperty(T.route.id)&&(!k||k[T.route.id]===void 0);if(T.route.lazy||S){N=!0,y>=0?h=h.slice(0,y+1):h=[h[0]];break}}}let p=d&&c?(j,T)=>{var _,k;c(j,{location:d.location,params:((k=(_=d.matches)==null?void 0:_[0])==null?void 0:k.params)??{},unstable_pattern:Wy(d.matches),errorInfo:T})}:void 0;return h.reduceRight((j,T,_)=>{let k,S=!1,C=null,A=null;d&&(k=b&&T.route.id?b[T.route.id]:void 0,C=T.route.errorElement||ib,N&&(y<0&&_===0?(Vx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,A=null):y===_&&(S=!0,A=T.route.hydrateFallbackElement||null)));let $=r.concat(h.slice(0,_+1)),B=()=>{let M;return k?M=C:S?M=A:T.route.Component?M=U.createElement(T.route.Component,null):T.route.element?M=T.route.element:M=j,U.createElement(cb,{match:T,routeContext:{outlet:j,matches:$,isDataRoute:d!=null},children:M})};return d&&(T.route.ErrorBoundary||T.route.errorElement||_===0)?U.createElement(qx,{location:d.location,revalidation:d.revalidation,component:C,error:k,children:B(),routeContext:{outlet:null,matches:$,isDataRoute:!0},onError:p}):B()},null)}function eh(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function db(l){let r=U.useContext(Yr);return pt(r,eh(l)),r}function fb(l){let r=U.useContext(co);return pt(r,eh(l)),r}function hb(l){let r=U.useContext(An);return pt(r,eh(l)),r}function th(l){let r=hb(l),d=r.matches[r.matches.length-1];return pt(d.route.id,`${l} can only be used on routes that contain a unique "id"`),d.route.id}function mb(){return th("useRouteId")}function gb(){var c;let l=U.useContext(Kf),r=fb("useRouteError"),d=th("useRouteError");return l!==void 0?l:(c=r.errors)==null?void 0:c[d]}function xb(){let{router:l}=db("useNavigate"),r=th("useNavigate"),d=U.useRef(!1);return Lx(()=>{d.current=!0}),U.useCallback(async(f,h={})=>{Xa(d.current,Ux),d.current&&(typeof f=="number"?await l.navigate(f):await l.navigate(f,{fromRouteId:r,...h}))},[l,r])}var Mg={};function Vx(l,r,d){!r&&!Mg[l]&&(Mg[l]=!0,Xa(!1,d))}U.memo(vb);function vb({routes:l,future:r,state:d,onError:c}){return Hx(l,void 0,d,c,r)}function pb({to:l,replace:r,state:d,relative:c}){pt(Pr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=U.useContext(za);Xa(!f,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=U.useContext(An),{pathname:b}=_n(),N=oo(),y=Jf(l,Xf(h),b,c==="path"),p=JSON.stringify(y);return U.useEffect(()=>{N(JSON.parse(p),{replace:r,state:d,relative:c})},[N,p,c,r,d]),null}function sl(l){pt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function yb({basename:l="/",children:r=null,location:d,navigationType:c="POP",navigator:f,static:h=!1,unstable_useTransitions:b}){pt(!Pr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let N=l.replace(/^\/*/,"/"),y=U.useMemo(()=>({basename:N,navigator:f,static:h,unstable_useTransitions:b,future:{}}),[N,f,h,b]);typeof d=="string"&&(d=Ps(d));let{pathname:p="/",search:j="",hash:T="",state:_=null,key:k="default"}=d,S=U.useMemo(()=>{let C=il(p,N);return C==null?null:{location:{pathname:C,search:j,hash:T,state:_,key:k},navigationType:c}},[N,p,j,T,_,k,c]);return Xa(S!=null,`<Router basename="${N}"> is not able to match the URL "${p}${j}${T}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:U.createElement(za.Provider,{value:y},U.createElement(gu.Provider,{children:r,value:S}))}function bb({children:l,location:r}){return sb(qf(l),r)}function qf(l,r=[]){let d=[];return U.Children.forEach(l,(c,f)=>{if(!U.isValidElement(c))return;let h=[...r,f];if(c.type===U.Fragment){d.push.apply(d,qf(c.props.children,h));return}pt(c.type===sl,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),pt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let b={id:c.props.id||h.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(b.children=qf(c.props.children,h)),d.push(b)}),d}var Jc="get",Kc="application/x-www-form-urlencoded";function fo(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function Nb(l){return fo(l)&&l.tagName.toLowerCase()==="button"}function Sb(l){return fo(l)&&l.tagName.toLowerCase()==="form"}function jb(l){return fo(l)&&l.tagName.toLowerCase()==="input"}function wb(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Eb(l,r){return l.button===0&&(!r||r==="_self")&&!wb(l)}var $c=null;function Tb(){if($c===null)try{new FormData(document.createElement("form"),0),$c=!1}catch{$c=!0}return $c}var Cb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Of(l){return l!=null&&!Cb.has(l)?(Xa(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kc}"`),null):l}function Mb(l,r){let d,c,f,h,b;if(Sb(l)){let N=l.getAttribute("action");c=N?il(N,r):null,d=l.getAttribute("method")||Jc,f=Of(l.getAttribute("enctype"))||Kc,h=new FormData(l)}else if(Nb(l)||jb(l)&&(l.type==="submit"||l.type==="image")){let N=l.form;if(N==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=l.getAttribute("formaction")||N.getAttribute("action");if(c=y?il(y,r):null,d=l.getAttribute("formmethod")||N.getAttribute("method")||Jc,f=Of(l.getAttribute("formenctype"))||Of(N.getAttribute("enctype"))||Kc,h=new FormData(N,l),!Tb()){let{name:p,type:j,value:T}=l;if(j==="image"){let _=p?`${p}.`:"";h.append(`${_}x`,"0"),h.append(`${_}y`,"0")}else p&&h.append(p,T)}}else{if(fo(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');d=Jc,c=null,f=Kc,b=l}return h&&f==="text/plain"&&(b=h,h=void 0),{action:c,method:d.toLowerCase(),encType:f,formData:h,body:b}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ah(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function Ob(l,r,d,c){let f=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return d?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${c}`:f.pathname=`${f.pathname}.${c}`:f.pathname==="/"?f.pathname=`_root.${c}`:r&&il(f.pathname,r)==="/"?f.pathname=`${r.replace(/\/$/,"")}/_root.${c}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${c}`,f}async function Rb(l,r){if(l.id in r)return r[l.id];try{let d=await import(l.module);return r[l.id]=d,d}catch(d){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(d),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Db(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function Ab(l,r,d){let c=await Promise.all(l.map(async f=>{let h=r.routes[f.route.id];if(h){let b=await Rb(h,d);return b.links?b.links():[]}return[]}));return Ub(c.flat(1).filter(Db).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Og(l,r,d,c,f,h){let b=(y,p)=>d[p]?y.route.id!==d[p].route.id:!0,N=(y,p)=>{var j;return d[p].pathname!==y.pathname||((j=d[p].route.path)==null?void 0:j.endsWith("*"))&&d[p].params["*"]!==y.params["*"]};return h==="assets"?r.filter((y,p)=>b(y,p)||N(y,p)):h==="data"?r.filter((y,p)=>{var T;let j=c.routes[y.route.id];if(!j||!j.hasLoader)return!1;if(b(y,p)||N(y,p))return!0;if(y.route.shouldRevalidate){let _=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((T=d[0])==null?void 0:T.params)||{},nextUrl:new URL(l,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function _b(l,r,{includeHydrateFallback:d}={}){return kb(l.map(c=>{let f=r.routes[c.route.id];if(!f)return[];let h=[f.module];return f.clientActionModule&&(h=h.concat(f.clientActionModule)),f.clientLoaderModule&&(h=h.concat(f.clientLoaderModule)),d&&f.hydrateFallbackModule&&(h=h.concat(f.hydrateFallbackModule)),f.imports&&(h=h.concat(f.imports)),h}).flat(1))}function kb(l){return[...new Set(l)]}function zb(l){let r={},d=Object.keys(l).sort();for(let c of d)r[c]=l[c];return r}function Ub(l,r){let d=new Set;return new Set(r),l.reduce((c,f)=>{let h=JSON.stringify(zb(f));return d.has(h)||(d.add(h),c.push({key:h,link:f})),c},[])}function Bx(){let l=U.useContext(Yr);return ah(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function Lb(){let l=U.useContext(co);return ah(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var nh=U.createContext(void 0);nh.displayName="FrameworkContext";function Yx(){let l=U.useContext(nh);return ah(l,"You must render this element inside a <HydratedRouter> element"),l}function Hb(l,r){let d=U.useContext(nh),[c,f]=U.useState(!1),[h,b]=U.useState(!1),{onFocus:N,onBlur:y,onMouseEnter:p,onMouseLeave:j,onTouchStart:T}=r,_=U.useRef(null);U.useEffect(()=>{if(l==="render"&&b(!0),l==="viewport"){let C=$=>{$.forEach(B=>{b(B.isIntersecting)})},A=new IntersectionObserver(C,{threshold:.5});return _.current&&A.observe(_.current),()=>{A.disconnect()}}},[l]),U.useEffect(()=>{if(c){let C=setTimeout(()=>{b(!0)},100);return()=>{clearTimeout(C)}}},[c]);let k=()=>{f(!0)},S=()=>{f(!1),b(!1)};return d?l!=="intent"?[h,_,{}]:[h,_,{onFocus:Xi(N,k),onBlur:Xi(y,S),onMouseEnter:Xi(p,k),onMouseLeave:Xi(j,S),onTouchStart:Xi(T,k)}]:[!1,_,{}]}function Xi(l,r){return d=>{l&&l(d),d.defaultPrevented||r(d)}}function qb({page:l,...r}){let{router:d}=Bx(),c=U.useMemo(()=>Mx(d.routes,l,d.basename),[d.routes,l,d.basename]);return c?U.createElement(Bb,{page:l,matches:c,...r}):null}function Vb(l){let{manifest:r,routeModules:d}=Yx(),[c,f]=U.useState([]);return U.useEffect(()=>{let h=!1;return Ab(l,r,d).then(b=>{h||f(b)}),()=>{h=!0}},[l,r,d]),c}function Bb({page:l,matches:r,...d}){let c=_n(),{future:f,manifest:h,routeModules:b}=Yx(),{basename:N}=Bx(),{loaderData:y,matches:p}=Lb(),j=U.useMemo(()=>Og(l,r,p,h,c,"data"),[l,r,p,h,c]),T=U.useMemo(()=>Og(l,r,p,h,c,"assets"),[l,r,p,h,c]),_=U.useMemo(()=>{if(l===c.pathname+c.search+c.hash)return[];let C=new Set,A=!1;if(r.forEach(B=>{var X;let M=h.routes[B.route.id];!M||!M.hasLoader||(!j.some(ie=>ie.route.id===B.route.id)&&B.route.id in y&&((X=b[B.route.id])!=null&&X.shouldRevalidate)||M.hasClientLoader?A=!0:C.add(B.route.id))}),C.size===0)return[];let $=Ob(l,N,f.unstable_trailingSlashAwareDataRequests,"data");return A&&C.size>0&&$.searchParams.set("_routes",r.filter(B=>C.has(B.route.id)).map(B=>B.route.id).join(",")),[$.pathname+$.search]},[N,f.unstable_trailingSlashAwareDataRequests,y,c,h,j,r,l,b]),k=U.useMemo(()=>_b(T,h),[T,h]),S=Vb(T);return U.createElement(U.Fragment,null,_.map(C=>U.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...d})),k.map(C=>U.createElement("link",{key:C,rel:"modulepreload",href:C,...d})),S.map(({key:C,link:A})=>U.createElement("link",{key:C,nonce:d.nonce,...A,crossOrigin:A.crossOrigin??d.crossOrigin})))}function Yb(...l){return r=>{l.forEach(d=>{typeof d=="function"?d(r):d!=null&&(d.current=r)})}}var Pb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Pb&&(window.__reactRouterVersion="7.13.0")}catch{}function $b({basename:l,children:r,unstable_useTransitions:d,window:c}){let f=U.useRef();f.current==null&&(f.current=jy({window:c,v5Compat:!0}));let h=f.current,[b,N]=U.useState({action:h.action,location:h.location}),y=U.useCallback(p=>{d===!1?N(p):U.startTransition(()=>N(p))},[d]);return U.useLayoutEffect(()=>h.listen(y),[h,y]),U.createElement(yb,{basename:l,children:r,location:b.location,navigationType:b.action,navigator:h,unstable_useTransitions:d})}var Px=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$x=U.forwardRef(function({onClick:r,discover:d="render",prefetch:c="none",relative:f,reloadDocument:h,replace:b,state:N,target:y,to:p,preventScrollReset:j,viewTransition:T,unstable_defaultShouldRevalidate:_,...k},S){let{basename:C,unstable_useTransitions:A}=U.useContext(za),$=typeof p=="string"&&Px.test(p),B=Ax(p,C);p=B.to;let M=nb(p,{relative:f}),[X,ie,F]=Hb(c,k),Z=Zb(p,{replace:b,state:N,target:y,preventScrollReset:j,relative:f,viewTransition:T,unstable_defaultShouldRevalidate:_,unstable_useTransitions:A});function R(O){r&&r(O),O.defaultPrevented||Z(O)}let ee=U.createElement("a",{...k,...F,href:B.absoluteURL||M,onClick:B.isExternal||h?r:R,ref:Yb(S,ie),target:y,"data-discover":!$&&d==="render"?"true":void 0});return X&&!$?U.createElement(U.Fragment,null,ee,U.createElement(qb,{page:M})):ee});$x.displayName="Link";var Fx=U.forwardRef(function({"aria-current":r="page",caseSensitive:d=!1,className:c="",end:f=!1,style:h,to:b,viewTransition:N,children:y,...p},j){let T=xu(b,{relative:p.relative}),_=_n(),k=U.useContext(co),{navigator:S,basename:C}=U.useContext(za),A=k!=null&&Jb(T)&&N===!0,$=S.encodeLocation?S.encodeLocation(T).pathname:T.pathname,B=_.pathname,M=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;d||(B=B.toLowerCase(),M=M?M.toLowerCase():null,$=$.toLowerCase()),M&&C&&(M=il(M,C)||M);const X=$!=="/"&&$.endsWith("/")?$.length-1:$.length;let ie=B===$||!f&&B.startsWith($)&&B.charAt(X)==="/",F=M!=null&&(M===$||!f&&M.startsWith($)&&M.charAt($.length)==="/"),Z={isActive:ie,isPending:F,isTransitioning:A},R=ie?r:void 0,ee;typeof c=="function"?ee=c(Z):ee=[c,ie?"active":null,F?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let O=typeof h=="function"?h(Z):h;return U.createElement($x,{...p,"aria-current":R,className:ee,ref:j,style:O,to:b,viewTransition:N},typeof y=="function"?y(Z):y)});Fx.displayName="NavLink";var Fb=U.forwardRef(({discover:l="render",fetcherKey:r,navigate:d,reloadDocument:c,replace:f,state:h,method:b=Jc,action:N,onSubmit:y,relative:p,preventScrollReset:j,viewTransition:T,unstable_defaultShouldRevalidate:_,...k},S)=>{let{unstable_useTransitions:C}=U.useContext(za),A=Ib(),$=Xb(N,{relative:p}),B=b.toLowerCase()==="get"?"get":"post",M=typeof N=="string"&&Px.test(N),X=ie=>{if(y&&y(ie),ie.defaultPrevented)return;ie.preventDefault();let F=ie.nativeEvent.submitter,Z=(F==null?void 0:F.getAttribute("formmethod"))||b,R=()=>A(F||ie.currentTarget,{fetcherKey:r,method:Z,navigate:d,replace:f,state:h,relative:p,preventScrollReset:j,viewTransition:T,unstable_defaultShouldRevalidate:_});C&&d!==!1?U.startTransition(()=>R()):R()};return U.createElement("form",{ref:S,method:B,action:$,onSubmit:c?y:X,...k,"data-discover":!M&&l==="render"?"true":void 0})});Fb.displayName="Form";function Gb(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gx(l){let r=U.useContext(Yr);return pt(r,Gb(l)),r}function Zb(l,{target:r,replace:d,state:c,preventScrollReset:f,relative:h,viewTransition:b,unstable_defaultShouldRevalidate:N,unstable_useTransitions:y}={}){let p=oo(),j=_n(),T=xu(l,{relative:h});return U.useCallback(_=>{if(Eb(_,r)){_.preventDefault();let k=d!==void 0?d:fu(j)===fu(T),S=()=>p(l,{replace:k,state:c,preventScrollReset:f,relative:h,viewTransition:b,unstable_defaultShouldRevalidate:N});y?U.startTransition(()=>S()):S()}},[j,p,T,d,c,r,l,f,h,b,N,y])}var Wb=0,Qb=()=>`__${String(++Wb)}__`;function Ib(){let{router:l}=Gx("useSubmit"),{basename:r}=U.useContext(za),d=mb(),c=l.fetch,f=l.navigate;return U.useCallback(async(h,b={})=>{let{action:N,method:y,encType:p,formData:j,body:T}=Mb(h,r);if(b.navigate===!1){let _=b.fetcherKey||Qb();await c(_,d,b.action||N,{unstable_defaultShouldRevalidate:b.unstable_defaultShouldRevalidate,preventScrollReset:b.preventScrollReset,formData:j,body:T,formMethod:b.method||y,formEncType:b.encType||p,flushSync:b.flushSync})}else await f(b.action||N,{unstable_defaultShouldRevalidate:b.unstable_defaultShouldRevalidate,preventScrollReset:b.preventScrollReset,formData:j,body:T,formMethod:b.method||y,formEncType:b.encType||p,replace:b.replace,state:b.state,fromRouteId:d,flushSync:b.flushSync,viewTransition:b.viewTransition})},[c,f,r,d])}function Xb(l,{relative:r}={}){let{basename:d}=U.useContext(za),c=U.useContext(An);pt(c,"useFormAction must be used inside a RouteContext");let[f]=c.matches.slice(-1),h={...xu(l||".",{relative:r})},b=_n();if(l==null){h.search=b.search;let N=new URLSearchParams(h.search),y=N.getAll("index");if(y.some(j=>j==="")){N.delete("index"),y.filter(T=>T).forEach(T=>N.append("index",T));let j=N.toString();h.search=j?`?${j}`:""}}return(!l||l===".")&&f.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),d!=="/"&&(h.pathname=h.pathname==="/"?d:rl([d,h.pathname])),fu(h)}function Jb(l,{relative:r}={}){let d=U.useContext(kx);pt(d!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Gx("useViewTransitionState"),f=xu(l,{relative:r});if(!d.isTransitioning)return!1;let h=il(d.currentLocation.pathname,c)||d.currentLocation.pathname,b=il(d.nextLocation.pathname,c)||d.nextLocation.pathname;return to(f.pathname,b)!=null||to(f.pathname,h)!=null}var Kb=Cx();const e1=Qf(Kb);/**
61
- * @license lucide-react v0.564.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const Zx=(...l)=>l.filter((r,d,c)=>!!r&&r.trim()!==""&&c.indexOf(r)===d).join(" ").trim();/**
66
- * @license lucide-react v0.564.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const t1=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
- * @license lucide-react v0.564.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const a1=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,d,c)=>c?c.toUpperCase():d.toLowerCase());/**
76
- * @license lucide-react v0.564.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const Rg=l=>{const r=a1(l);return r.charAt(0).toUpperCase()+r.slice(1)};/**
81
- * @license lucide-react v0.564.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */var n1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
86
- * @license lucide-react v0.564.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const l1=l=>{for(const r in l)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};/**
91
- * @license lucide-react v0.564.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const s1=U.forwardRef(({color:l="currentColor",size:r=24,strokeWidth:d=2,absoluteStrokeWidth:c,className:f="",children:h,iconNode:b,...N},y)=>U.createElement("svg",{ref:y,...n1,width:r,height:r,stroke:l,strokeWidth:c?Number(d)*24/Number(r):d,className:Zx("lucide",f),...!h&&!l1(N)&&{"aria-hidden":"true"},...N},[...b.map(([p,j])=>U.createElement(p,j)),...Array.isArray(h)?h:[h]]));/**
96
- * @license lucide-react v0.564.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const Re=(l,r)=>{const d=U.forwardRef(({className:c,...f},h)=>U.createElement(s1,{ref:h,iconNode:r,className:Zx(`lucide-${t1(Rg(l))}`,`lucide-${l}`,c),...f}));return d.displayName=Rg(l),d};/**
101
- * @license lucide-react v0.564.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const r1=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Wx=Re("activity",r1);/**
106
- * @license lucide-react v0.564.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const i1=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],u1=Re("arrow-down",i1);/**
111
- * @license lucide-react v0.564.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const c1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Dg=Re("arrow-right",c1);/**
116
- * @license lucide-react v0.564.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const o1=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],d1=Re("arrow-up-down",o1);/**
121
- * @license lucide-react v0.564.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const f1=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],h1=Re("arrow-up",f1);/**
126
- * @license lucide-react v0.564.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const m1=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],g1=Re("bell",m1);/**
131
- * @license lucide-react v0.564.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const x1=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Ag=Re("briefcase",x1);/**
136
- * @license lucide-react v0.564.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const v1=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Qx=Re("calendar",v1);/**
141
- * @license lucide-react v0.564.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const p1=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],lh=Re("chart-column",p1);/**
146
- * @license lucide-react v0.564.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const y1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b1=Re("check",y1);/**
151
- * @license lucide-react v0.564.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const N1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],sh=Re("chevron-down",N1);/**
156
- * @license lucide-react v0.564.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const S1=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],j1=Re("chevron-left",S1);/**
161
- * @license lucide-react v0.564.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const w1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],E1=Re("chevron-right",w1);/**
166
- * @license lucide-react v0.564.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const T1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],C1=Re("chevron-up",T1);/**
171
- * @license lucide-react v0.564.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const M1=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],O1=Re("chevrons-up-down",M1);/**
176
- * @license lucide-react v0.564.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const R1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Dn=Re("circle-alert",R1);/**
181
- * @license lucide-react v0.564.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const D1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],_g=Re("circle-arrow-down",D1);/**
186
- * @license lucide-react v0.564.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const A1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ix=Re("circle-check",A1);/**
191
- * @license lucide-react v0.564.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const _1=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],vu=Re("circle-check-big",_1);/**
196
- * @license lucide-react v0.564.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const k1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],z1=Re("circle-x",k1);/**
201
- * @license lucide-react v0.564.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const U1=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Xx=Re("clock",U1);/**
206
- * @license lucide-react v0.564.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const L1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Jx=Re("external-link",L1);/**
211
- * @license lucide-react v0.564.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const H1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],q1=Re("eye-off",H1);/**
216
- * @license lucide-react v0.564.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const V1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rh=Re("eye",V1);/**
221
- * @license lucide-react v0.564.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const B1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Vf=Re("file-text",B1);/**
226
- * @license lucide-react v0.564.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const Y1=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],ih=Re("git-merge",Y1);/**
231
- * @license lucide-react v0.564.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const P1=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],ho=Re("git-pull-request",P1);/**
236
- * @license lucide-react v0.564.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const $1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],F1=Re("globe",$1);/**
241
- * @license lucide-react v0.564.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const G1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Z1=Re("house",G1);/**
246
- * @license lucide-react v0.564.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const W1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Q1=Re("info",W1);/**
251
- * @license lucide-react v0.564.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const I1=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],X1=Re("kanban",I1);/**
256
- * @license lucide-react v0.564.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const J1=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 19H3",key:"wbqt3n"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]],kg=Re("list-restart",J1);/**
261
- * @license lucide-react v0.564.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const K1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Kx=Re("loader-circle",K1);/**
266
- * @license lucide-react v0.564.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const e2=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],ev=Re("map",e2);/**
271
- * @license lucide-react v0.564.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const t2=[["path",{d:"M5 12h14",key:"1ays0h"}]],a2=Re("minus",t2);/**
276
- * @license lucide-react v0.564.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const n2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],uh=Re("panels-top-left",n2);/**
281
- * @license lucide-react v0.564.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const l2=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ao=Re("pause",l2);/**
286
- * @license lucide-react v0.564.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const s2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],mo=Re("pen",s2);/**
291
- * @license lucide-react v0.564.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const r2=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],vn=Re("play",r2);/**
296
- * @license lucide-react v0.564.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const i2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$s=Re("plus",i2);/**
301
- * @license lucide-react v0.564.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const u2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],no=Re("refresh-cw",u2);/**
306
- * @license lucide-react v0.564.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const c2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ch=Re("rotate-ccw",c2);/**
311
- * @license lucide-react v0.564.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const o2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],tv=Re("save",o2);/**
316
- * @license lucide-react v0.564.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const d2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$r=Re("search",d2);/**
321
- * @license lucide-react v0.564.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const f2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],zg=Re("settings-2",f2);/**
326
- * @license lucide-react v0.564.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const h2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],m2=Re("settings",h2);/**
331
- * @license lucide-react v0.564.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const g2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ug=Re("square",g2);/**
336
- * @license lucide-react v0.564.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const x2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],v2=Re("terminal",x2);/**
341
- * @license lucide-react v0.564.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const p2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Fr=Re("trash-2",p2);/**
346
- * @license lucide-react v0.564.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const y2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ys=Re("triangle-alert",y2);/**
351
- * @license lucide-react v0.564.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const b2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],N2=Re("wifi",b2);/**
356
- * @license lucide-react v0.564.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const S2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gr=Re("x",S2);/**
361
- * @license lucide-react v0.564.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const j2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Lg=Re("zap",j2),av=[{id:"executor",label:"Executor",processName:"executor",color:{bg:"bg-blue-500",border:"border-blue-500/60"}},{id:"reviewer",label:"Reviewer",processName:"reviewer",color:{bg:"bg-green-500",border:"border-green-500/60"}},{id:"qa",label:"QA",processName:"qa",color:{bg:"bg-purple-500",border:"border-purple-500/60"}},{id:"audit",label:"Audit",processName:"audit",color:{bg:"bg-orange-500",border:"border-orange-500/60"}},{id:"slicer",label:"Planner",processName:"planner",color:{bg:"bg-yellow-500",border:"border-yellow-500/60"}},{id:"analytics",label:"Analytics",processName:"analytics",color:{bg:"bg-pink-500",border:"border-pink-500/60"}},{id:"pr-resolver",label:"PR Resolver",processName:"pr-resolver",color:{bg:"bg-teal-500",border:"border-teal-500/60"}},{id:"merger",label:"Merger",processName:"merger",color:{bg:"bg-cyan-500",border:"border-cyan-500/60"}}],nv=[{id:"executor",label:"Executor",processName:"executor",color:{bg:"bg-blue-500",border:"border-blue-500/60"},triggerEndpoint:"/api/actions/run",scheduleTemplateKey:"executor",getEnabled:l=>l.executorEnabled??!0,getSchedule:l=>l.cronSchedule??"5 */2 * * *",settingsSection:"general",buildEnabledPatch:l=>({executorEnabled:l})},{id:"reviewer",label:"Reviewer",processName:"reviewer",color:{bg:"bg-green-500",border:"border-green-500/60"},triggerEndpoint:"/api/actions/review",scheduleTemplateKey:"reviewer",getEnabled:l=>l.reviewerEnabled??!0,getSchedule:l=>l.reviewerSchedule??"25 */3 * * *",settingsSection:"general",buildEnabledPatch:l=>({reviewerEnabled:l})},{id:"qa",label:"QA",processName:"qa",color:{bg:"bg-purple-500",border:"border-purple-500/60"},triggerEndpoint:"/api/actions/qa",scheduleTemplateKey:"qa",getEnabled:l=>{var r;return((r=l.qa)==null?void 0:r.enabled)??!0},getSchedule:l=>{var r;return((r=l.qa)==null?void 0:r.schedule)??"45 2,10,18 * * *"},settingsSection:"general",buildEnabledPatch:(l,r)=>({qa:{...r.qa??{},enabled:l}})},{id:"audit",label:"Audit",processName:"audit",color:{bg:"bg-orange-500",border:"border-orange-500/60"},triggerEndpoint:"/api/actions/audit",scheduleTemplateKey:"audit",getEnabled:l=>{var r;return((r=l.audit)==null?void 0:r.enabled)??!0},getSchedule:l=>{var r;return((r=l.audit)==null?void 0:r.schedule)??"50 3 * * 1"},settingsSection:"advanced",buildEnabledPatch:(l,r)=>({audit:{...r.audit??{},enabled:l}})},{id:"slicer",label:"Planner",processName:"planner",color:{bg:"bg-yellow-500",border:"border-yellow-500/60"},triggerEndpoint:"/api/actions/planner",scheduleTemplateKey:"slicer",getEnabled:l=>{var r;return((r=l.roadmapScanner)==null?void 0:r.enabled)??!0},getSchedule:l=>{var r;return((r=l.roadmapScanner)==null?void 0:r.slicerSchedule)??"35 */6 * * *"},settingsSection:"advanced",buildEnabledPatch:(l,r)=>({roadmapScanner:{...r.roadmapScanner??{},enabled:l}})},{id:"analytics",label:"Analytics",processName:"analytics",color:{bg:"bg-pink-500",border:"border-pink-500/60"},triggerEndpoint:"/api/actions/analytics",scheduleTemplateKey:"analytics",getEnabled:l=>{var r;return((r=l.analytics)==null?void 0:r.enabled)??!1},getSchedule:l=>{var r;return((r=l.analytics)==null?void 0:r.schedule)??"0 6 * * 1"},settingsSection:"advanced",buildEnabledPatch:(l,r)=>({analytics:{...r.analytics??{},enabled:l}})},{id:"pr-resolver",label:"PR Resolver",processName:"pr-resolver",color:{bg:"bg-teal-500",border:"border-teal-500/60"},triggerEndpoint:"/api/actions/resolve",scheduleTemplateKey:"prResolver",getEnabled:l=>{var r;return((r=l.prResolver)==null?void 0:r.enabled)??!0},getSchedule:l=>{var r;return((r=l.prResolver)==null?void 0:r.schedule)??"15 6,14,22 * * *"},settingsSection:"advanced",buildEnabledPatch:(l,r)=>({prResolver:{...r.prResolver??{},enabled:l}})},{id:"merger",label:"Merger",processName:"merger",color:{bg:"bg-cyan-500",border:"border-cyan-500/60"},triggerEndpoint:"/api/actions/merge",scheduleTemplateKey:"merger",getEnabled:l=>{var r;return((r=l.merger)==null?void 0:r.enabled)??!1},getSchedule:l=>{var r;return((r=l.merger)==null?void 0:r.schedule)??"55 */4 * * *"},settingsSection:"advanced",buildEnabledPatch:(l,r)=>({merger:{...r.merger??{},enabled:l}})}];function w2(l){return nv.find(r=>r.id===l)}const oh="";let dh=!1,lo=null;function E2(l){dh=l}function Hg(l){lo=l}function T2(){return dh}function fh(l){return encodeURIComponent(l.replace(/\//g,"~"))}function Rt(l){return dh&&lo?l.replace("/api/",`/api/projects/${fh(lo)}/`):l}function C2(){return ct("/api/mode")}function lv(){return ct("/api/projects")}function M2(l){const r=fh(l);return ct(`/api/projects/${r}`,{method:"DELETE"})}async function ct(l,r){const d=`${oh}${l}`,c=await fetch(d,{headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!c.ok){const f=await c.json().catch(()=>({error:"Unknown error"}));throw new Error(f.error||`HTTP ${c.status}: ${c.statusText}`)}return c.json()}function Rf(){return ct(Rt("/api/status"))}function sv(){return ct(Rt("/api/prs"))}function O2(l,r){const d=`?lines=${encodeURIComponent(r)}`;return ct(Rt(`/api/logs/${encodeURIComponent(l)}${d}`))}function hh(){return ct(Rt("/api/config"))}async function R2(){if(T2()){const r=(await lv()).filter(c=>c.valid);return(await Promise.all(r.map(async c=>{try{const f=await ct(`/api/projects/${fh(c.name)}/config`);return{projectId:c.name,config:f}}catch(f){return console.error(`Failed to fetch config for project ${c.name}`,f),null}}))).filter(c=>c!==null)}else{const l=await hh();return[{projectId:lo||"current",config:l}]}}function so(l){return ct(Rt("/api/config"),{method:"PUT",body:JSON.stringify(l)})}function D2(){return ct(Rt("/api/doctor"))}function rv(){return ct(Rt("/api/schedule-info"))}function A2(){return ct(Rt("/api/actions/review"),{method:"POST"})}function iv(l){const r=w2(l);return r?ct(Rt(r.triggerEndpoint),{method:"POST"}):Promise.reject(new Error(`Unknown job ID: ${l}`))}function ou(){return ct(Rt("/api/actions/install-cron"),{method:"POST"})}function uv(){return ct(Rt("/api/actions/uninstall-cron"),{method:"POST"})}function _2(l="all"){return ct(Rt("/api/actions/cancel"),{method:"POST",body:JSON.stringify({type:l})})}const Jl=["Draft","Ready","In Progress","Review","Done"];function cv(){return ct(Rt("/api/board/status"))}function k2(l){return ct(Rt("/api/board/issues"),{method:"POST",body:JSON.stringify(l)})}function ov(l,r){return ct(Rt(`/api/board/issues/${l}/move`),{method:"PATCH",body:JSON.stringify({column:r})})}async function z2(l){const r=`${oh}${Rt(`/api/board/issues/${l}`)}`,d=await fetch(r,{headers:{"Content-Type":"application/json"},method:"DELETE"});if(!d.ok){const c=await d.json().catch(()=>({error:"Unknown error"}));throw new Error(c.error||`HTTP ${d.status}: ${d.statusText}`)}}function U2(){return ct(Rt("/api/actions/clear-lock"),{method:"POST"})}function L2(l,r=[],d){const c=(d==null?void 0:d.enabled)??!0,f=U.useRef(l);f.current=l,U.useEffect(()=>{if(!c)return;const h=`${oh}${Rt("/api/status/events")}`,b=new EventSource(h);return b.addEventListener("status_changed",N=>{try{const y=JSON.parse(N.data);f.current(y)}catch{}}),()=>{b.close()}},[c,...r])}function qg(){return ct("/api/queue/status")}function H2(l){const r=`?window=${encodeURIComponent(l)}`;return ct(`/api/queue/analytics${r}`)}function q2(l){return ct("/api/queue/clear",{method:"POST",body:JSON.stringify({force:!1})})}function V2(){return ct("/api/global-notifications")}function Vg(l){return ct("/api/global-notifications",{method:"PUT",body:JSON.stringify(l)})}function B2(){return ct(Rt("/api/roadmap"))}function Y2(){return ct(Rt("/api/roadmap/scan"),{method:"POST"})}function dv(l){return ct(Rt("/api/roadmap/toggle"),{method:"PUT",body:JSON.stringify({enabled:l})})}function pn(l,r=[],d){const c=(d==null?void 0:d.enabled)??!0,[f,h]=U.useState(null),[b,N]=U.useState(!0),[y,p]=U.useState(null),j=U.useRef(l);j.current=l;const T=U.useRef(()=>{(async()=>{p(null);try{const k=await j.current();h(k)}catch(k){p(k instanceof Error?k:new Error("Unknown error"))}})()});return U.useEffect(()=>{if(!c)return;let _=!1;return N(!0),p(null),(async()=>{try{const S=await j.current();_||h(S)}catch(S){_||p(S instanceof Error?S:new Error("Unknown error"))}finally{_||N(!1)}})(),()=>{_=!0}},[...r,c]),{data:f,loading:b,error:y,refetch:T.current}}const Bg=l=>{let r;const d=new Set,c=(p,j)=>{const T=typeof p=="function"?p(r):p;if(!Object.is(T,r)){const _=r;r=j??(typeof T!="object"||T===null)?T:Object.assign({},r,T),d.forEach(k=>k(r,_))}},f=()=>r,N={setState:c,getState:f,getInitialState:()=>y,subscribe:p=>(d.add(p),()=>d.delete(p))},y=r=l(c,f,N);return N},P2=l=>l?Bg(l):Bg,$2=l=>l;function F2(l,r=$2){const d=ze.useSyncExternalStore(l.subscribe,()=>r(l.getState()),()=>r(l.getInitialState()));return ze.useDebugValue(d),d}const Yg=l=>{const r=P2(l),d=c=>F2(r,c);return Object.assign(d,r),d},G2=l=>l?Yg(l):Yg,Z2=typeof localStorage<"u"?localStorage.getItem("nw-selected-project"):null,Wt=G2((l,r)=>({projectName:"Night Watch",setProjectName:d=>l({projectName:d}),toasts:[],addToast:d=>{const c=Math.random().toString(36).substring(7);l(f=>({toasts:[...f.toasts,{...d,id:c}]})),setTimeout(()=>{l(f=>({toasts:f.toasts.filter(h=>h.id!==c)}))},5e3)},removeToast:d=>l(c=>({toasts:c.toasts.filter(f=>f.id!==d)})),status:null,setStatus:d=>l(c=>!c.status||new Date(d.timestamp)>new Date(c.status.timestamp)?{status:d}:c),globalModeLoading:!0,setGlobalModeLoading:d=>l({globalModeLoading:d}),isGlobalMode:!1,setGlobalMode:d=>{E2(d),l({isGlobalMode:d})},projects:[],setProjects:d=>l({projects:d}),selectedProjectId:Z2,selectProject:d=>{Hg(d),d?localStorage.setItem("nw-selected-project",d):localStorage.removeItem("nw-selected-project"),l(c=>{const f=c.projects.find(h=>h.name===d);return{selectedProjectId:d,...f?{projectName:f.name}:{}}})},removeProjectFromList:d=>{l(c=>{var N;const f=c.projects.filter(y=>y.name!==d),h=c.selectedProjectId===d,b=h?((N=f[0])==null?void 0:N.name)??null:c.selectedProjectId;return h&&(Hg(b),b?localStorage.setItem("nw-selected-project",b):localStorage.removeItem("nw-selected-project")),{projects:f,selectedProjectId:b,...h&&f[0]?{projectName:f[0].name}:{}}})},getJobStates:()=>{const{status:d}=r(),c=d==null?void 0:d.config;return nv.map(f=>({id:f.id,label:f.label,processName:f.processName,color:f.color,enabled:c?f.getEnabled(c):!0,schedule:c?f.getSchedule(c):"",triggerEndpoint:f.triggerEndpoint}))}})),W2=()=>{const[l,r]=U.useState(!1),{projectName:d,isGlobalMode:c,projects:f,selectedProjectId:h,selectProject:b,globalModeLoading:N}=Wt(),{data:y}=pn(sv,[h],{enabled:!N}),p=(y==null?void 0:y.length)??0,j=U.useMemo(()=>[{icon:Z1,label:"Dashboard",path:"/",section:"Overview"},{icon:v2,label:"Logs",path:"/logs"},{icon:X1,label:"Board",path:"/board",section:"Work"},{icon:ho,label:"Pull Requests",path:"/prs",badge:p},{icon:ev,label:"Roadmap",path:"/roadmap"},{icon:Qx,label:"Automation",path:"/scheduling",section:"Automation"},{icon:m2,label:"Settings",path:"/settings",section:"Config"}],[p]);return s.jsxs("aside",{className:`
366
- relative flex flex-col transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]
367
- ${l?"w-20":"w-72"} h-screen flex-shrink-0 z-50
368
- bg-[#030712]/80 backdrop-blur-xl border-r border-white/5
369
- `,children:[s.jsx("div",{className:`p-6 border-b border-white/5 ${l?"items-center justify-center flex":""}`,children:l?s.jsx("div",{className:"relative group",children:s.jsx("div",{className:"h-10 w-10 bg-indigo-600 rounded-xl flex items-center justify-center text-white font-bold cursor-pointer shadow-lg shadow-indigo-500/20 group-hover:bg-indigo-500 transition-colors bg-gradient-to-br from-indigo-500 to-indigo-700",title:"Switch Project",children:"NW"})}):s.jsxs("div",{className:"relative w-full",children:[s.jsx("label",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-3 block pl-1",children:c?"Projects":"Workspace"}),c?s.jsxs("div",{className:"relative",children:[s.jsx(Ag,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-indigo-400 pointer-events-none"}),s.jsx("select",{value:h||"",onChange:T=>b(T.target.value),className:"w-full bg-[#111827] border border-white/10 text-slate-200 rounded-lg py-3 pl-10 pr-8 text-sm font-medium shadow-sm appearance-none cursor-pointer hover:border-white/20 transition-colors focus:outline-none focus:border-indigo-500/50 focus:ring-1 focus:ring-indigo-500/20",children:f.filter(T=>T.valid).map(T=>s.jsx("option",{value:T.name,children:T.name},T.name))}),s.jsx(O1,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-slate-500 pointer-events-none"})]}):s.jsxs("div",{className:"w-full bg-[#111827] border border-white/10 text-slate-200 rounded-lg py-3 px-3.5 text-sm font-medium shadow-sm flex items-center",children:[s.jsx(Ag,{className:"h-4 w-4 text-indigo-400 mr-3"}),s.jsx("span",{className:"truncate",children:d})]})]})}),s.jsx("nav",{className:"flex-1 py-6 overflow-y-auto overflow-x-hidden scrollbar-hide",children:s.jsx("ul",{className:"space-y-1.5 px-4",children:j.map(T=>s.jsxs(ze.Fragment,{children:[T.section&&!l&&s.jsx("li",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest px-3.5 pt-4 pb-1",children:T.section}),s.jsx("li",{children:s.jsx(Fx,{to:T.path,className:({isActive:_})=>`
370
- flex items-center px-3.5 py-3 rounded-xl transition-all duration-200 group relative
371
- ${_?"bg-indigo-500/10 text-indigo-300 shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05)]":"text-slate-400 hover:bg-white/5 hover:text-slate-200"}
372
- ${l?"justify-center":""}
373
- `,children:({isActive:_})=>s.jsxs(s.Fragment,{children:[s.jsx(T.icon,{className:`h-5 w-5 transition-colors ${_?"text-indigo-400 drop-shadow-[0_0_8px_rgba(99,102,241,0.5)]":"text-slate-500 group-hover:text-slate-300"} ${l?"":"mr-3.5"}`}),!l&&s.jsx("span",{className:"flex-1 text-sm font-medium tracking-wide",children:T.label}),T.badge&&(l?s.jsx("span",{className:"absolute top-2 right-2 h-2 w-2 bg-indigo-500 rounded-full border border-[#030712] shadow-sm"}):s.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-md ${_?"bg-indigo-500/20 text-indigo-300":"bg-white/5 text-slate-400 border border-white/5"}`,children:T.badge})),_&&!l&&s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-indigo-500 rounded-r-full shadow-[0_0_10px_rgba(99,102,241,0.4)]"}),l&&s.jsx("div",{className:"absolute left-full ml-4 px-3 py-1.5 bg-[#111827] text-white text-xs font-medium rounded-md border border-white/10 shadow-xl opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-50 transition-opacity translate-x-2 group-hover:translate-x-0",children:T.label})]})})})]},T.path))})}),s.jsx("div",{className:"p-4 border-t border-white/5 flex justify-end",children:s.jsx("button",{onClick:()=>r(!l),className:"p-2 rounded-lg hover:bg-white/5 text-slate-500 hover:text-slate-300 transition-colors",children:l?s.jsx(E1,{className:"h-5 w-5"}):s.jsx(j1,{className:"h-5 w-5"})})})]})},Q2=()=>{const{projectName:l}=Wt();return s.jsxs("header",{className:"h-20 flex items-center justify-between px-8 z-40 sticky top-0 bg-[#030712]/80 backdrop-blur-md border-b border-white/5",children:[s.jsxs("div",{className:"flex items-center space-x-6",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-mono text-indigo-400 mb-0.5 tracking-tight",children:"Active Project"}),s.jsx("h1",{className:"text-xl font-semibold text-white tracking-tight leading-none",children:l})]}),s.jsx("div",{className:"h-8 w-px bg-white/10 mx-2"}),s.jsxs("div",{className:"flex items-center space-x-2 text-xs font-medium px-3 py-1.5 rounded-full border transition-colors bg-emerald-500/5 text-emerald-400 border-emerald-500/20 shadow-[0_0_10px_-4px_rgba(16,185,129,0.3)]",children:[s.jsx(N2,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"uppercase tracking-wider text-[10px]",children:"Online"})]})]}),s.jsxs("div",{className:"flex items-center space-x-5",children:[s.jsxs("div",{className:"relative hidden md:block group",children:[s.jsx("input",{type:"text",placeholder:"Search ( / )",className:"w-72 pl-10 pr-4 py-2 rounded-lg border border-white/5 bg-white/5 text-sm text-slate-200 focus:outline-none focus:ring-1 focus:ring-indigo-500/50 focus:border-indigo-500/50 transition-all placeholder:text-slate-600 focus:bg-[#0b101b]"}),s.jsx($r,{className:"absolute left-3.5 top-2.5 h-4 w-4 text-slate-500 group-focus-within:text-indigo-400 transition-colors"})]}),s.jsx("div",{className:"flex items-center space-x-3",children:s.jsxs("button",{className:"p-2.5 text-slate-400 hover:text-white hover:bg-white/5 rounded-full relative transition-all",children:[s.jsx(g1,{className:"h-5 w-5"}),s.jsx("span",{className:"absolute top-2.5 right-2.5 h-2 w-2 bg-red-500 rounded-full ring-2 ring-[#030712]"})]})}),s.jsx("div",{className:"h-9 w-9 rounded-full bg-gradient-to-tr from-indigo-600 to-purple-600 ring-2 ring-white/10 flex items-center justify-center text-white font-bold text-xs shadow-lg",children:"AD"})]})]})},I2=({toast:l,onDismiss:r})=>{const d={success:s.jsx(vu,{className:"h-5 w-5 text-green-400"}),error:s.jsx(Dn,{className:"h-5 w-5 text-red-400"}),info:s.jsx(Q1,{className:"h-5 w-5 text-blue-400"}),warning:s.jsx(Ys,{className:"h-5 w-5 text-amber-400"})},c={success:"border-l-green-500",error:"border-l-red-500",info:"border-l-blue-500",warning:"border-l-amber-500"};return s.jsx("div",{className:`
374
- pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg
375
- bg-slate-900 border border-slate-800 border-l-4 ${c[l.type]}
376
- shadow-lg ring-1 ring-black ring-opacity-5 transition-all
377
- animate-in slide-in-from-right-full fade-in duration-300
378
- `,children:s.jsx("div",{className:"p-4",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0",children:d[l.type]}),s.jsxs("div",{className:"ml-3 w-0 flex-1 pt-0.5",children:[s.jsx("p",{className:"text-sm font-medium text-slate-200",children:l.title}),l.message&&s.jsx("p",{className:"mt-1 text-sm text-slate-400",children:l.message})]}),s.jsx("div",{className:"ml-4 flex flex-shrink-0",children:s.jsxs("button",{type:"button",className:"inline-flex rounded-md text-slate-400 hover:text-slate-200 focus:outline-none focus:ring-2 focus:ring-indigo-500",onClick:()=>r(l.id),children:[s.jsx("span",{className:"sr-only",children:"Close"}),s.jsx(Gr,{className:"h-5 w-5"})]})})]})})})},X2=()=>{const{toasts:l,removeToast:r}=Wt();return s.jsx("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 flex flex-col items-end px-4 py-6 sm:items-end sm:p-6 z-[100] gap-4",children:l.map(d=>s.jsx(I2,{toast:d,onDismiss:r},d.id))})};function J2(){const{setGlobalMode:l,setGlobalModeLoading:r,setProjects:d,selectProject:c,selectedProjectId:f}=Wt();U.useEffect(()=>{r(!0),C2().then(async({globalMode:h})=>{if(l(h),!h)return;const b=await lv();d(b);const N=b.filter(y=>y.valid);f&&N.some(y=>y.name===f)?c(f):N.length>0&&c(N[0].name)}).catch(()=>{l(!1)}).finally(()=>{r(!1)})},[])}function Pg(l){if(!(l!=null&&l.timestamp))return Number.NEGATIVE_INFINITY;const r=new Date(l.timestamp).getTime();return Number.isNaN(r)?Number.NEGATIVE_INFINITY:r}function Fc(l,r){return l?r?Pg(l)>=Pg(r)?l:r:l:r}function K2(){const{setStatus:l,setProjectName:r,selectedProjectId:d,globalModeLoading:c,status:f}=Wt(),h=U.useRef(null);h.current=Wt.getState().status,L2(b=>{Fc(b,h.current)===b&&l(b)},[d,c],{enabled:!c}),U.useEffect(()=>{if(c)return;Rf().then(N=>{Fc(N,h.current)===N&&l(N)}).catch(()=>{});const b=setInterval(()=>{Rf().then(N=>{Fc(N,h.current)===N&&l(N)}).catch(()=>{})},3e4);return()=>clearInterval(b)},[d,c,l]),U.useEffect(()=>{const b=()=>{Rf().then(N=>{Fc(N,h.current)===N&&l(N)}).catch(()=>{})};return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[d,l]),U.useEffect(()=>{f!=null&&f.projectName&&r(f.projectName)},[f==null?void 0:f.projectName,r])}const ft=({children:l,className:r="",onClick:d})=>s.jsxs("div",{className:`
379
- relative bg-[#0b101b] rounded-xl border border-white/5
380
- shadow-[0_4px_20px_-4px_rgba(0,0,0,0.5)]
381
- transition-all duration-300
382
- ${d?"cursor-pointer hover:border-indigo-500/30 hover:shadow-indigo-500/5 group":""}
383
- ${r}
384
- `,onClick:d,children:[d&&s.jsx("div",{className:"absolute inset-0 bg-indigo-500/0 group-hover:bg-indigo-500/[0.02] transition-colors rounded-xl pointer-events-none"}),s.jsx("div",{className:"relative z-10",children:l})]}),Ve=({children:l,variant:r="primary",size:d="md",loading:c=!1,className:f="",disabled:h,...b})=>{const N="inline-flex items-center justify-center rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-offset-[#030712] disabled:opacity-50 disabled:pointer-events-none active:scale-[0.98]",y={primary:"bg-indigo-600 text-white hover:bg-indigo-500 focus:ring-indigo-500 shadow-[0_0_15px_-3px_rgba(79,70,229,0.4)] border border-indigo-500/50 hover:shadow-[0_0_20px_-3px_rgba(79,70,229,0.5)]",secondary:"bg-[#1f2937] text-slate-200 hover:bg-[#374151] focus:ring-slate-500 border border-white/5",danger:"bg-red-600/10 text-red-400 hover:bg-red-600/20 focus:ring-red-500 border border-red-900/50 hover:border-red-500/50",ghost:"bg-transparent text-slate-400 hover:bg-white/5 hover:text-slate-200 focus:ring-slate-400",outline:"border border-slate-700/50 bg-transparent text-slate-300 hover:bg-white/5 hover:border-slate-500 focus:ring-slate-400"},p={sm:"h-8 px-3 text-xs tracking-wide",md:"h-10 px-4 py-2 text-sm",lg:"h-12 px-6 text-base",icon:"h-9 w-9"};return s.jsxs("button",{className:`${N} ${y[r]} ${p[d]} ${f}`,disabled:h||c,...b,children:[c&&s.jsx(Kx,{className:"mr-2 h-4 w-4 animate-spin"}),l]})},Ia=({children:l,variant:r="default",className:d=""})=>{const c={default:"bg-indigo-500/10 text-indigo-400 ring-1 ring-inset ring-indigo-500/20",success:"bg-emerald-500/10 text-emerald-400 ring-1 ring-inset ring-emerald-500/20",warning:"bg-amber-500/10 text-amber-400 ring-1 ring-inset ring-amber-500/20",error:"bg-red-500/10 text-red-400 ring-1 ring-inset ring-red-500/20",neutral:"bg-slate-500/10 text-slate-400 ring-1 ring-inset ring-slate-500/20",info:"bg-blue-500/10 text-blue-400 ring-1 ring-inset ring-blue-500/20"};return s.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium tracking-wide ${c[r]} ${d}`,children:l})},fv={Draft:{dot:"bg-slate-500",badge:"neutral"},Ready:{dot:"bg-green-500",badge:"success"},"In Progress":{dot:"bg-blue-500",badge:"info"},Review:{dot:"bg-amber-500",badge:"warning"},Done:{dot:"bg-slate-600",badge:"neutral"}},eN=({defaultColumn:l,onClose:r,onCreated:d})=>{const[c,f]=U.useState(""),[h,b]=U.useState(""),[N,y]=U.useState(l),[p,j]=U.useState(!1),[T,_]=U.useState(null),{addToast:k}=Wt(),S=async C=>{if(C.preventDefault(),!!c.trim()){j(!0),_(null);try{await k2({title:c.trim(),body:h,column:N}),k({title:"Issue created",message:`"${c.trim()}" added to ${N}`,type:"success"}),d(),r()}catch(A){_(A instanceof Error?A.message:"Failed to create issue")}finally{j(!1)}}};return s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),s.jsxs("div",{className:"relative bg-[#0f172a] border border-white/10 rounded-2xl shadow-2xl w-full max-w-lg",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/5",children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"New Board Issue"}),s.jsx("button",{onClick:r,className:"p-1.5 rounded-lg hover:bg-white/5 text-slate-500 hover:text-slate-300 transition-colors",children:s.jsx(Gr,{className:"h-5 w-5"})})]}),s.jsxs("form",{onSubmit:S,className:"p-6 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 uppercase tracking-wide block mb-1.5",children:"Title"}),s.jsx("input",{type:"text",value:c,onChange:C=>f(C.target.value),placeholder:"Issue title...",required:!0,className:"w-full bg-slate-950/50 border border-white/10 text-slate-200 rounded-lg px-3 py-2.5 text-sm placeholder-slate-600 focus:outline-none focus:border-indigo-500/50 focus:ring-1 focus:ring-indigo-500/20"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 uppercase tracking-wide block mb-1.5",children:"Column"}),s.jsx("select",{value:N,onChange:C=>y(C.target.value),className:"w-full bg-slate-950/50 border border-white/10 text-slate-200 rounded-lg px-3 py-2.5 text-sm focus:outline-none focus:border-indigo-500/50 appearance-none cursor-pointer",children:Jl.map(C=>s.jsx("option",{value:C,children:C},C))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 uppercase tracking-wide block mb-1.5",children:"Body (optional)"}),s.jsx("textarea",{value:h,onChange:C=>b(C.target.value),placeholder:"Issue description...",rows:5,className:"w-full bg-slate-950/50 border border-white/10 text-slate-200 rounded-lg px-3 py-2.5 text-sm placeholder-slate-600 focus:outline-none focus:border-indigo-500/50 focus:ring-1 focus:ring-indigo-500/20 resize-none font-mono"})]}),T&&s.jsx("p",{className:"text-sm text-red-400",children:T}),s.jsxs("div",{className:"flex justify-end space-x-3 pt-2",children:[s.jsx(Ve,{variant:"ghost",type:"button",onClick:r,children:"Cancel"}),s.jsx(Ve,{type:"submit",disabled:p||!c.trim(),children:p?"Creating...":"Create Issue"})]})]})]})]})},tN=({issue:l,onClose:r,onMoved:d,onClosed:c})=>{const[f,h]=U.useState(!1),[b,N]=U.useState(!1),[y,p]=U.useState(!1),{addToast:j}=Wt(),T=async S=>{if(S!==l.column){h(!0);try{await ov(l.number,S),j({title:"Issue moved",message:`#${l.number} moved to ${S}`,type:"success"}),d(),r()}catch(C){j({title:"Move failed",message:C instanceof Error?C.message:"Failed to move issue",type:"error"})}finally{h(!1)}}},_=async()=>{p(!1),N(!0);try{await z2(l.number),j({title:"Issue closed",message:`#${l.number} closed on GitHub`,type:"success"}),c(),r()}catch(S){j({title:"Close failed",message:S instanceof Error?S.message:"Failed to close issue",type:"error"})}finally{N(!1)}},k=l.column??"Draft";return s.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[s.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:r}),s.jsxs("div",{className:"relative bg-[#0a0f1e] border-l border-white/10 w-full max-w-xl flex flex-col shadow-2xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-start justify-between p-6 border-b border-white/5 flex-shrink-0",children:[s.jsxs("div",{className:"flex-1 min-w-0 pr-4",children:[s.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[s.jsxs("span",{className:"text-slate-500 text-sm font-mono",children:["#",l.number]}),s.jsx(Ia,{variant:fv[k].badge,children:k})]}),s.jsx("h2",{className:"text-lg font-semibold text-slate-100 leading-snug",children:l.title}),l.assignees.length>0&&s.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Assigned to: ",l.assignees.join(", ")]})]}),s.jsx("button",{onClick:r,className:"p-1.5 rounded-lg hover:bg-white/5 text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0",children:s.jsx(Gr,{className:"h-5 w-5"})})]}),s.jsxs("div",{className:"flex items-center space-x-3 px-6 py-3 border-b border-white/5 flex-shrink-0 flex-wrap gap-y-2",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"Move to:"}),Jl.filter(S=>S!==l.column).map(S=>s.jsx("button",{onClick:()=>T(S),disabled:f,className:"text-xs px-2.5 py-1 rounded-md bg-slate-800 text-slate-300 hover:bg-slate-700 hover:text-slate-100 border border-slate-700 transition-colors disabled:opacity-50",children:S},S))]}),s.jsxs("div",{className:"flex items-center space-x-2 ml-auto",children:[l.url&&!l.url.startsWith("local://")&&s.jsxs("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center space-x-1 text-xs text-indigo-400 hover:text-indigo-300 transition-colors",children:[s.jsx(Jx,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:"GitHub"})]}),s.jsx("button",{onClick:()=>p(!0),disabled:b,className:"text-xs px-2.5 py-1 rounded-md bg-red-500/10 text-red-400 hover:bg-red-500/20 border border-red-500/20 transition-colors disabled:opacity-50",children:b?"Closing...":"Close Issue"})]})]}),y&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:()=>p(!1)}),s.jsxs("div",{className:"relative bg-[#0a0f1e] border border-white/10 rounded-xl p-6 max-w-sm w-full mx-4 shadow-2xl",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-100 mb-2",children:"Close issue?"}),s.jsxs("p",{className:"text-sm text-slate-400 mb-4",children:["Close issue #",l.number,': "',l.title,'"?']}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx(Ve,{variant:"ghost",onClick:()=>p(!1),children:"Cancel"}),s.jsx(Ve,{onClick:_,children:"Confirm"})]})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.body?s.jsx("pre",{className:"text-sm text-slate-300 whitespace-pre-wrap font-mono leading-relaxed break-words",children:l.body}):s.jsx("p",{className:"text-slate-500 text-sm italic",children:"No description provided."})})]})]})},aN=({issue:l,onClick:r,onDragStart:d})=>{const[c,f]=U.useState(!1);return s.jsx("div",{className:"relative",draggable:!0,onDragStart:h=>{h.dataTransfer.setData("issueNumber",String(l.number)),h.dataTransfer.effectAllowed="move",f(!0),d(l)},onDragEnd:()=>f(!1),children:s.jsxs(ft,{className:`p-3 cursor-grab hover:border-indigo-500/30 transition-all select-none ${c?"opacity-30":""}`,onClick:r,children:[s.jsxs("span",{className:"text-[10px] font-mono text-slate-600",children:["#",l.number]}),s.jsx("p",{className:"text-xs font-medium text-slate-200 line-clamp-2 mt-0.5 leading-snug",children:l.title}),l.assignees.length>0&&s.jsx("p",{className:"text-[10px] text-slate-500 mt-1.5 truncate",children:l.assignees.join(", ")})]})})},nN=({name:l,issues:r,draggingIssue:d,onIssueClick:c,onNewIssue:f,onMoveIssue:h,onDragStart:b})=>{const N=fv[l],[y,p]=U.useState(!1),j=d!==null&&d.column!==l;return s.jsxs("div",{className:`flex flex-col min-w-[220px] max-w-[220px] h-full rounded-xl transition-colors ${y&&j?"bg-indigo-500/5 ring-1 ring-indigo-500/30":""}`,onDragOver:T=>{j&&(T.preventDefault(),T.dataTransfer.dropEffect="move",p(!0))},onDragLeave:()=>p(!1),onDrop:T=>{T.preventDefault(),p(!1),d&&d.column!==l&&h(d,l)},children:[s.jsxs("div",{className:"flex items-center justify-between mb-3 flex-shrink-0",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${N.dot}`}),s.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:l}),s.jsx("span",{className:"text-[10px] font-bold text-slate-600 bg-slate-800 rounded-full px-1.5 py-0.5",children:r.length})]}),s.jsx("button",{onClick:()=>f(l),className:"p-1 rounded-md hover:bg-white/5 text-slate-600 hover:text-slate-400 transition-colors",title:`Add issue to ${l}`,children:s.jsx($s,{className:"h-3.5 w-3.5"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto space-y-2 pr-1 scrollbar-hide min-h-0",children:r.length===0?s.jsx("div",{className:`border-2 border-dashed rounded-xl h-24 flex items-center justify-center transition-colors ${y&&j?"border-indigo-500/40":"border-slate-800"}`,children:s.jsx("span",{className:"text-xs text-slate-700",children:y&&j?"Drop here":"No issues"})}):r.map(T=>s.jsx(aN,{issue:T,onClick:()=>c(T),onDragStart:b},T.id))})]})},lN=()=>{const[l,r]=U.useState(null),[d,c]=U.useState(null),[f,h]=U.useState(null),[b,N]=U.useState(null),y=U.useRef(!1),{addToast:p,selectedProjectId:j,globalModeLoading:T}=Wt(),{data:_,loading:k,error:S,refetch:C}=pn(cv,[j],{enabled:!T});U.useEffect(()=>{const B=setInterval(()=>{y.current||C()},3e4);return()=>clearInterval(B)},[C]);const A=U.useCallback(async(B,M)=>{h(null);const X=b??(_==null?void 0:_.columns);if(!X)return;const ie=X,F={};for(const R of Jl)F[R]=(X[R]??[]).filter(ee=>ee.number!==B.number);const Z={...B,column:M};F[M]=[...F[M]??[],Z],N(F),r(R=>(R==null?void 0:R.number)===B.number?Z:R),y.current=!0;try{await ov(B.number,M),C(),setTimeout(()=>{N(null),y.current=!1},800)}catch(R){N(ie),r(ee=>(ee==null?void 0:ee.number)===B.number?B:ee),y.current=!1,p({title:"Move failed",message:R instanceof Error?R.message:"Failed to move issue",type:"error"})}},[p,C,b,_]);if(T||k)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Loading board..."})});if(S&&S.message.includes("Board not configured"))return s.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[s.jsx("div",{className:"text-4xl",children:"📋"}),s.jsx("h2",{className:"text-xl font-semibold text-slate-200",children:"Board not configured"}),s.jsxs("p",{className:"text-slate-500 text-sm max-w-sm text-center",children:["Run ",s.jsx("code",{className:"font-mono bg-slate-800 px-2 py-0.5 rounded text-indigo-300",children:"night-watch board setup"})," in your project to create a GitHub Projects board."]})]});if(S)return s.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[s.jsx("div",{className:"text-slate-300",children:"Failed to load board"}),s.jsx("div",{className:"text-sm text-slate-500",children:S.message}),s.jsx(Ve,{onClick:()=>C(),children:"Retry"})]});if(!_)return null;const $=b??_.columns;return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6 flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-slate-100",children:"Board"}),s.jsxs("p",{className:"text-sm text-slate-500 mt-1",children:[Jl.reduce((B,M)=>{var X;return B+(((X=$[M])==null?void 0:X.length)??0)},0)," issues across ",Jl.length," columns"]})]}),s.jsxs(Ve,{onClick:()=>c("Ready"),children:[s.jsx($s,{className:"h-4 w-4 mr-2"}),"New Issue"]})]}),s.jsx("div",{className:"flex-1 overflow-x-auto overflow-y-hidden",onDragEnd:()=>h(null),children:s.jsx("div",{className:"flex space-x-4 h-full pb-4",style:{minWidth:`${Jl.length*236}px`},children:Jl.map(B=>s.jsx(nN,{name:B,issues:$[B]??[],draggingIssue:f,onIssueClick:r,onNewIssue:c,onMoveIssue:A,onDragStart:h},B))})}),l&&s.jsx(tN,{issue:l,onClose:()=>r(null),onMoved:()=>C(),onClosed:()=>C()}),d&&s.jsx(eN,{defaultColumn:d,onClose:()=>c(null),onCreated:()=>C()})]})},sN=[{name:"executor",displayName:"Executor",processName:"executor",triggerId:"executor",cancelType:"run",runningLabel:"Running",idleLabel:"Idle"},{name:"reviewer",displayName:"Reviewer",processName:"reviewer",triggerId:"reviewer",cancelType:"review",runningLabel:"Running",idleLabel:"Idle"},{name:"qa",displayName:"QA",processName:"qa",triggerId:"qa",runningLabel:"Running",idleLabel:"Idle"},{name:"auditor",displayName:"Auditor",processName:"audit",triggerId:"audit",runningLabel:"Running",idleLabel:"Idle"},{name:"planner",displayName:"Planner",processName:"planner",triggerId:"planner",runningLabel:"Writing PRDs",idleLabel:"Idle"},{name:"analytics",displayName:"Analytics",processName:"analytics",triggerId:"analytics",runningLabel:"Running",idleLabel:"Idle"},{name:"pr-resolver",displayName:"PR Resolver",processName:"pr-resolver",triggerId:"pr-resolver",runningLabel:"Resolving",idleLabel:"Idle"},{name:"merger",displayName:"Merger",processName:"merger",triggerId:"merger",runningLabel:"Running",idleLabel:"Idle"}],rN=({processes:l,activePrd:r,onCancelProcess:d,onForceClear:c,onViewLog:f,cancellingProcess:h,clearingLock:b,onTriggerJob:N,triggeringJob:y})=>{const p=T=>l.find(_=>_.name===T),j=(T,_)=>T.length<=_?T:T.slice(0,_-1)+"...";return s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-8 gap-3",children:sN.map(T=>{const _=p(T.processName),k=(_==null?void 0:_.running)??!1,S=_==null?void 0:_.pid,C=h===T.cancelType,A=k&&T.cancelType,$=!k&&T.name==="executor"&&r,B=k?S?`PID: ${S}`:T.runningLabel:T.idleLabel,M=k&&T.name==="executor"&&r?j(r,20):null;return s.jsxs("div",{className:`flex items-center gap-2 p-2.5 rounded-lg border transition-colors ${k?"bg-green-950/30 border-green-800/50":"bg-slate-950/50 border-slate-800"}`,children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full flex-shrink-0 ${k?"bg-green-500 animate-pulse shadow-[0_0_8px_rgba(34,197,94,0.5)]":"bg-slate-700"}`}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:`text-sm font-medium ${k?"text-slate-200":"text-slate-400"}`,children:T.displayName}),s.jsx("div",{className:"text-xs text-slate-500 truncate",children:M?s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Vf,{className:"h-3 w-3 flex-shrink-0"}),M]}):B})]}),s.jsxs("div",{className:"flex-shrink-0",children:[A&&s.jsx("button",{onClick:()=>T.cancelType&&d(T.cancelType),disabled:C,className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded transition-colors disabled:opacity-50",title:"Stop process",children:s.jsx(Ug,{className:"h-3.5 w-3.5"})}),$&&s.jsx("button",{onClick:c,disabled:b,className:"p-1 text-amber-400 hover:text-amber-300 hover:bg-amber-500/10 rounded transition-colors disabled:opacity-50",title:"Force clear stale state",children:s.jsx(Ug,{className:"h-3.5 w-3.5"})}),!A&&!$&&k&&s.jsx("button",{onClick:f,className:"p-1 text-slate-400 hover:text-slate-300 hover:bg-white/5 rounded transition-colors",title:"View log",children:s.jsx(Vf,{className:"h-3.5 w-3.5"})}),!k&&!$&&s.jsx("button",{onClick:()=>N(T.triggerId),disabled:y!==null,className:"p-1 text-slate-500 hover:text-green-400 hover:bg-green-500/10 rounded transition-colors disabled:opacity-50",title:`Run ${T.displayName}`,children:y===T.triggerId?s.jsx("div",{className:"h-3.5 w-3.5 border-2 border-current border-t-transparent rounded-full animate-spin"}):s.jsx(vn,{className:"h-3.5 w-3.5"})})]})]},T.name)})})},iN={Draft:"text-slate-400 bg-slate-500/10 ring-slate-500/20",Ready:"text-green-400 bg-green-500/10 ring-green-500/20","In Progress":"text-blue-400 bg-blue-500/10 ring-blue-500/20",Review:"text-amber-400 bg-amber-500/10 ring-amber-500/20",Done:"text-slate-500 bg-slate-600/10 ring-slate-600/20"},uN=()=>{var he,pe;const l=oo(),[r,d]=U.useState(null),[c,f]=U.useState(!1),[h,b]=U.useState(null),[N,y]=U.useState(!1),{setProjectName:p,addToast:j,selectedProjectId:T,globalModeLoading:_,status:k}=Wt(),{data:S}=pn(rv,[T],{enabled:!_}),{data:C,loading:A}=pn(()=>cv().catch(()=>null),[T],{enabled:!_}),$=k;if(ze.useEffect(()=>{$!=null&&$.projectName&&p($.projectName)},[$,p]),_)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Loading..."})});if(!$)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Loading..."})});const B=$.prs.length,M=$.prs.filter(re=>re.reviewScore!==null&&re.reviewScore<70).length,X=((he=C==null?void 0:C.columns.Ready)==null?void 0:he.length)??0,ie=((pe=C==null?void 0:C.columns["In Progress"])==null?void 0:pe.length)??0;$.processes.find(re=>re.name==="executor"),$.processes.find(re=>re.name==="reviewer"),$.processes.find(re=>re.name==="qa"),$.processes.find(re=>re.name==="audit"),$.processes.find(re=>re.name==="planner"),$.processes.find(re=>re.name==="analytics");const F=async re=>{d(re);try{const P=await _2(re),te=P.results.every(de=>de.success);j({title:te?"Process Cancelled":"Cancel Failed",message:P.results.map(de=>de.message).join("; "),type:te?"success":"error"})}catch(P){j({title:"Cancel Failed",message:P instanceof Error?P.message:"Failed to cancel process",type:"error"})}finally{d(null)}},Z=async()=>{f(!0);try{await U2(),j({title:"Lock Cleared",message:"Stale executor state removed",type:"success"})}catch(re){j({title:"Clear Failed",message:re instanceof Error?re.message:"Failed to clear lock",type:"error"})}finally{f(!1)}},R=async re=>{b(re);try{await iv(re==="planner"?"slicer":re),j({title:"Job Triggered",message:`${re[0].toUpperCase()+re.slice(1)} job has been queued.`,type:"success"})}catch(P){j({title:"Trigger Failed",message:P instanceof Error?P.message:`Failed to trigger ${re}`,type:"error"})}finally{b(null)}},ee=async()=>{if(S){y(!0);try{S.paused?(await ou(),j({title:"Schedule Resumed",message:"Cron schedules are active.",type:"success"})):(await uv(),j({title:"Schedule Paused",message:"Cron schedules are deactivated.",type:"info"}))}catch(re){j({title:"Action Failed",message:re instanceof Error?re.message:"Toggle failed",type:"error"})}finally{y(!1)}}},O=re=>{if(!re)return"Not scheduled";try{const P=new Date(re),te=new Date,de=P.getTime()-te.getTime(),me=Math.floor(de/6e4);return me<0?"Running now...":me<60?`in ${me} min`:me<1440?`in ${Math.floor(me/60)} hr${me>=120?"s":""}`:`in ${Math.floor(me/1440)} day${me>=2880?"s":""}`}catch{return"Unknown"}},ae=(()=>{var te,de,me,_e,L,le;if(S!=null&&S.paused)return null;const re=[{agent:"Executor",nextRun:(S==null?void 0:S.executor.nextRun)??null},{agent:"Reviewer",nextRun:(S==null?void 0:S.reviewer.nextRun)??null},{agent:"QA",nextRun:((te=S==null?void 0:S.qa)==null?void 0:te.nextRun)??null},{agent:"Auditor",nextRun:((de=S==null?void 0:S.audit)==null?void 0:de.nextRun)??null},{agent:"Planner",nextRun:((me=S==null?void 0:S.planner)==null?void 0:me.nextRun)??null},{agent:"Analytics",nextRun:((_e=S==null?void 0:S.analytics)==null?void 0:_e.nextRun)??null},{agent:"PR Resolver",nextRun:((L=S==null?void 0:S.prResolver)==null?void 0:L.nextRun)??null},{agent:"Merger",nextRun:((le=S==null?void 0:S.merger)==null?void 0:le.nextRun)??null}];let P=null;for(const ge of re)ge.nextRun&&(!P||new Date(ge.nextRun)<new Date(P.nextRun))&&(P=ge);return P?{agent:P.agent,time:O(P.nextRun)}:null})();return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsxs(ft,{className:"p-5",onClick:()=>l("/board"),children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-slate-500",children:"Board Ready"}),s.jsx("h3",{className:"text-3xl font-bold text-slate-100 mt-1",children:X})]}),s.jsx("div",{className:"p-2 bg-green-500/10 rounded-lg text-green-400",children:s.jsx(vu,{className:"h-5 w-5"})})]}),s.jsx("p",{className:"text-xs text-slate-500 mt-4",children:"issues ready to start"})]}),s.jsxs(ft,{className:"p-5",onClick:()=>l("/board"),children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-slate-500",children:"In Progress"}),s.jsx("h3",{className:"text-3xl font-bold text-slate-100 mt-1",children:ie})]}),s.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg text-blue-400",children:s.jsx(Wx,{className:"h-5 w-5"})})]}),s.jsx("p",{className:"text-xs text-slate-500 mt-4",children:"issues in progress"})]}),s.jsxs(ft,{className:"p-5",onClick:()=>l("/prs"),children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-slate-500",children:"Open PRs"}),s.jsx("h3",{className:"text-3xl font-bold text-slate-100 mt-1",children:B})]}),s.jsx("div",{className:"p-2 bg-purple-500/10 rounded-lg text-purple-400",children:s.jsx(Xx,{className:"h-5 w-5"})})]}),s.jsx("p",{className:`text-xs mt-4 ${M>0?"text-red-400 font-medium":"text-slate-500"}`,children:M>0?`${M} need work`:"All passing"})]}),s.jsxs(ft,{className:"p-5",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-slate-500",children:"Automation"}),s.jsx("h3",{className:"text-3xl font-bold text-slate-100 mt-1",children:S!=null&&S.paused?"Paused":$.crontab.installed?"Active":"Inactive"})]}),s.jsx("button",{onClick:ee,disabled:N||!S||!$.crontab.installed,title:S!=null&&S.paused?"Resume scheduling":"Pause scheduling",className:`p-2 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${S!=null&&S.paused?"bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20":$.crontab.installed?"bg-indigo-500/10 text-indigo-400 hover:bg-indigo-500/20":"bg-slate-700/50 text-slate-500"}`,children:N?s.jsx(no,{className:"h-5 w-5 animate-spin"}):S!=null&&S.paused?s.jsx(vn,{className:"h-5 w-5 fill-current"}):$.crontab.installed?s.jsx(ao,{className:"h-5 w-5"}):s.jsx(Qx,{className:"h-5 w-5"})})]}),s.jsx("p",{className:"text-xs text-slate-500 mt-4",children:S!=null&&S.paused?"All schedules paused":$.crontab.installed?`${$.crontab.entries.length} entr${$.crontab.entries.length===1?"y":"ies"} installed`:"No crontab entries"})]})]}),s.jsxs(ft,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h2",{className:"text-base font-semibold text-slate-200",children:"Agents"}),s.jsx("button",{onClick:()=>l("/logs"),className:"text-xs text-slate-400 hover:text-slate-300 transition-colors",children:"View logs"})]}),s.jsx(rN,{processes:$.processes,activePrd:$.activePrd,onCancelProcess:F,onForceClear:Z,onViewLog:()=>l("/logs"),cancellingProcess:r,clearingLock:c,onTriggerJob:R,triggeringJob:h})]}),ae?s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-slate-900/50 rounded-lg border border-slate-800",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[s.jsx("span",{children:"Next automation:"}),s.jsx("span",{className:"text-slate-200 font-medium",children:ae.agent}),s.jsx("span",{children:ae.time})]}),s.jsxs("button",{onClick:()=>l("/scheduling"),className:"text-sm text-indigo-400 hover:text-indigo-300 flex items-center transition-colors",children:["Manage Schedules ",s.jsx(Dg,{className:"ml-1 h-3 w-3"})]})]}):S!=null&&S.paused?s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-amber-900/20 rounded-lg border border-amber-800/40",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-400",children:[s.jsx(ao,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:"Automation is paused"})]}),s.jsxs("button",{onClick:ee,disabled:N,className:"text-sm text-emerald-400 hover:text-emerald-300 flex items-center transition-colors disabled:opacity-50",children:[N?s.jsx(no,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):s.jsx(vn,{className:"h-3.5 w-3.5 mr-1.5 fill-current"}),"Resume"]})]}):null,s.jsxs("div",{className:"mt-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:"GitHub Board"}),s.jsxs("button",{onClick:()=>l("/board"),className:"text-sm text-indigo-400 hover:text-indigo-300 flex items-center transition-colors",children:["View board ",s.jsx(Dg,{className:"ml-1 h-3 w-3"})]})]}),s.jsx(ft,{className:"p-4",children:A?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx("div",{className:"text-slate-400 text-sm",children:"Loading board..."})}):C?s.jsx("div",{className:"flex flex-wrap gap-3",children:Jl.map(re=>{var te;const P=((te=C.columns[re])==null?void 0:te.length)??0;return s.jsxs("button",{onClick:()=>l("/board"),className:`inline-flex items-center space-x-2 px-3 py-2 rounded-lg ring-1 ring-inset transition-colors hover:opacity-80 ${iN[re]}`,children:[s.jsx("span",{className:"text-xs font-medium",children:re}),s.jsx("span",{className:"text-xs font-bold",children:P})]},re)})}):s.jsxs("p",{className:"text-sm text-slate-500 italic",children:["Board not configured — run ",s.jsx("code",{className:"font-mono bg-slate-800 px-1.5 py-0.5 rounded text-indigo-300 text-xs",children:"night-watch board setup"})," to enable."]})})]})]})},cN=()=>{const[l,r]=U.useState(!0),[d,c]=U.useState(""),[f,h]=U.useState("executor"),b=U.useRef(null),{selectedProjectId:N,globalModeLoading:y}=Wt(),p=Wt(B=>B.status),{data:j,loading:T,error:_,refetch:k}=pn(()=>O2(f,500),[f,N],{enabled:!y}),S=(j==null?void 0:j.lines)||[];U.useEffect(()=>{l&&b.current&&(b.current.scrollTop=b.current.scrollHeight)},[S,l]),U.useEffect(()=>{if(!l)return;const B=window.setInterval(()=>{k()},3e3);return()=>window.clearInterval(B)},[l,f,k]);const C=S.filter(B=>B.toLowerCase().includes(d.toLowerCase())),A=B=>{h(B),c("")},$=B=>{if(!(p!=null&&p.processes))return!1;const M=p.processes.find(X=>X.name===B);return(M==null?void 0:M.running)??!1};return _?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[s.jsx(Dn,{className:"h-12 w-12 text-red-400"}),s.jsx("div",{className:"text-slate-300",children:"Failed to load logs"}),s.jsx("div",{className:"text-sm text-slate-500",children:_.message}),s.jsx(Ve,{onClick:()=>k(),children:"Retry"})]}):s.jsxs("div",{className:"flex flex-col h-[calc(100vh-8rem)]",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4 bg-slate-900 p-2 rounded-lg border border-slate-800 shadow-sm",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("div",{className:"relative group",children:[s.jsx("input",{type:"text",placeholder:"Filter logs...",className:"pl-9 pr-4 py-1.5 rounded-md border border-slate-700 bg-slate-950 text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent w-64 placeholder:text-slate-600",value:d,onChange:B=>c(B.target.value)}),s.jsx($r,{className:"absolute left-2.5 top-2 h-4 w-4 text-slate-500 group-focus-within:text-indigo-400"})]}),s.jsx("div",{className:"h-6 w-px bg-slate-700 mx-2"}),s.jsx("div",{className:"flex space-x-1",children:av.map(({processName:B,label:M})=>s.jsx("button",{onClick:()=>A(B),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${f===B?"bg-slate-800 text-slate-200 shadow-sm border border-slate-700":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{children:M}),$(B)&&s.jsx("div",{className:"h-2 w-2 bg-green-500 rounded-full animate-pulse"})]})},B))})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs(Ve,{size:"sm",variant:"ghost",onClick:()=>k(),children:[s.jsx(_g,{className:"h-4 w-4 mr-2"}),"Refresh"]}),s.jsxs(Ve,{size:"sm",variant:"ghost",onClick:()=>r(!l),children:[l?s.jsx(ao,{className:"h-4 w-4 mr-2"}):s.jsx(vn,{className:"h-4 w-4 mr-2"}),l?"Pause":"Resume"]})]})]}),s.jsxs("div",{className:"flex-1 bg-slate-900 rounded-xl overflow-hidden shadow-inner border border-slate-800 flex flex-col relative",children:[s.jsxs("div",{className:"bg-slate-950/50 backdrop-blur text-xs text-slate-500 px-4 py-1.5 flex justify-between border-b border-slate-800",children:[s.jsxs("span",{children:["File: ",f,".log"]}),s.jsxs("span",{children:[C.length," lines"]})]}),s.jsxs("div",{ref:b,className:"flex-1 overflow-y-auto p-4 font-mono text-sm terminal-scroll bg-slate-900",children:[T?s.jsx("div",{className:"flex items-center justify-center h-full text-slate-500",children:"Loading logs..."}):C.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-slate-500",children:d?"No logs match your filter":"No logs yet — logs will appear after the first run"}):C.map((B,M)=>{const X=B.includes("[ERROR]"),ie=B.includes("[WARN]");return s.jsxs("div",{className:`leading-6 hover:bg-slate-800/50 px-2 rounded -mx-2 ${X?"text-red-400":ie?"text-amber-400":"text-slate-300"}`,children:[s.jsx("span",{className:"text-slate-600 select-none w-10 inline-block text-right mr-4 text-xs opacity-50",children:M+1}),B]},M)}),l&&s.jsx("div",{className:"h-4"})," "]}),!l&&s.jsxs("div",{className:"absolute bottom-4 right-4 bg-indigo-600 text-white px-3 py-1.5 rounded-full shadow-lg shadow-indigo-900/40 text-xs font-medium flex items-center cursor-pointer hover:bg-indigo-500 transition-colors",onClick:()=>r(!0),children:[s.jsx(_g,{className:"h-4 w-4 mr-2"}),"Scroll to bottom"]})]})]})},oN=()=>{const[l,r]=U.useState(null),[d,c]=U.useState(!1),[f,h]=U.useState("all"),[b,N]=U.useState("number"),[y,p]=U.useState("desc"),{addToast:j,selectedProjectId:T,globalModeLoading:_}=Wt(),{data:k,loading:S,error:C,refetch:A}=pn(sv,[T],{enabled:!_}),$=k??[],B=O=>{switch(O){case"pass":return s.jsx(vu,{className:"h-4 w-4 text-green-500"});case"fail":return s.jsx(z1,{className:"h-4 w-4 text-red-500"});case"pending":return s.jsx(Kx,{className:"h-4 w-4 text-amber-500 animate-spin"});default:return s.jsx(Dn,{className:"h-4 w-4 text-slate-500"})}},M=O=>{switch(O){case"pass":return"All CI checks passed";case"fail":return"One or more CI checks failed";case"pending":return"CI checks are still running";default:return"No CI data available"}},X=O=>O===null?"No review decision yet":O===100?"PR has been approved":O===0?"Changes have been requested":`Review score: ${O}`,ie=U.useMemo(()=>$.filter(O=>{switch(f){case"needs-work":return O.ciStatus==="fail"||O.reviewScore===0;case"pending":return O.ciStatus==="pending"||O.ciStatus==="unknown"||O.reviewScore===null;case"passed":return O.ciStatus==="pass"&&O.reviewScore===100;case"all":default:return!0}}),[$,f]),F=U.useMemo(()=>[...ie].sort((ne,ae)=>{let he=0;switch(b){case"number":he=ne.number-ae.number;break;case"title":he=ne.title.localeCompare(ae.title);break;case"branch":he=ne.branch.localeCompare(ae.branch);break;case"ciStatus":{const pe={fail:0,pending:1,unknown:2,pass:3};he=(pe[ne.ciStatus]??2)-(pe[ae.ciStatus]??2);break}case"reviewScore":{const pe=ne.reviewScore??-1,re=ae.reviewScore??-1;he=pe-re;break}}return y==="asc"?he:-he}),[ie,b,y]),Z=O=>{b===O?p(y==="asc"?"desc":"asc"):(N(O),p("desc"))},R=O=>b!==O?s.jsx(d1,{className:"h-3 w-3 text-slate-600"}):y==="asc"?s.jsx(h1,{className:"h-3 w-3 text-indigo-400"}):s.jsx(u1,{className:"h-3 w-3 text-indigo-400"});if(S)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Loading PRs..."})});if(C)return s.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[s.jsx(Dn,{className:"h-12 w-12 text-red-400"}),s.jsx("div",{className:"text-slate-300",children:"Failed to load PRs"}),s.jsx("div",{className:"text-sm text-slate-500",children:C.message}),s.jsx(Ve,{onClick:()=>A(),children:"Retry"})]});const ee=async()=>{c(!0);try{const O=await A2();j({title:"Reviewer Started",message:O.pid?`Started with PID ${O.pid}`:"Reviewer started",type:"success"})}catch(O){j({title:"Reviewer Failed",message:O instanceof Error?O.message:"Failed to start reviewer",type:"error"})}finally{c(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex space-x-1",children:[s.jsx("button",{onClick:()=>h("all"),className:`px-3 py-1 rounded-full text-xs font-medium cursor-pointer border transition-colors ${f==="all"?"bg-slate-800 text-slate-200 border-slate-700":"text-slate-500 hover:bg-slate-800 hover:text-slate-300 border-transparent"}`,children:"All"}),s.jsx("button",{onClick:()=>h("needs-work"),className:`px-3 py-1 rounded-full text-xs font-medium cursor-pointer border transition-colors ${f==="needs-work"?"bg-red-900/50 text-red-300 border-red-800":"text-slate-500 hover:bg-slate-800 hover:text-slate-300 border-transparent"}`,children:"Needs Work"}),s.jsx("button",{onClick:()=>h("pending"),className:`px-3 py-1 rounded-full text-xs font-medium cursor-pointer border transition-colors ${f==="pending"?"bg-amber-900/50 text-amber-300 border-amber-800":"text-slate-500 hover:bg-slate-800 hover:text-slate-300 border-transparent"}`,children:"Pending"}),s.jsx("button",{onClick:()=>h("passed"),className:`px-3 py-1 rounded-full text-xs font-medium cursor-pointer border transition-colors ${f==="passed"?"bg-green-900/50 text-green-300 border-green-800":"text-slate-500 hover:bg-slate-800 hover:text-slate-300 border-transparent"}`,children:"Passed"})]}),s.jsxs(Ve,{size:"sm",onClick:ee,disabled:d,children:[s.jsx($r,{className:"h-4 w-4 mr-2"}),d?"Starting...":"Run Reviewer Now"]})]}),s.jsx("div",{className:"bg-slate-900 rounded-lg shadow-sm border border-slate-800 overflow-hidden",children:s.jsxs("table",{className:"min-w-full divide-y divide-slate-800",children:[s.jsx("thead",{className:"bg-slate-950/50",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider cursor-pointer hover:text-slate-300",onClick:()=>Z("number"),children:s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{children:"Title"}),R("number")]})}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider cursor-pointer hover:text-slate-300",onClick:()=>Z("branch"),children:s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{children:"Branch"}),R("branch")]})}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider cursor-pointer hover:text-slate-300",onClick:()=>Z("ciStatus"),children:s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{children:"CI Status"}),R("ciStatus")]})}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider cursor-pointer hover:text-slate-300",onClick:()=>Z("reviewScore"),children:s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{children:"Review Score"}),R("reviewScore")]})}),s.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Actions"})]})}),s.jsxs("tbody",{className:"divide-y divide-slate-800",children:[F.map(O=>s.jsxs("tr",{className:"hover:bg-slate-800/50 cursor-pointer transition-colors",onClick:()=>r(l===O.number?null:O.number),children:[s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsxs("span",{className:"text-slate-500 font-mono mr-2",children:["#",O.number]}),s.jsx("span",{className:"font-medium text-slate-200",children:O.title})]})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("span",{className:"px-2 py-1 bg-slate-800 text-slate-400 border border-slate-700 rounded text-xs font-mono",children:O.branch})}),s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex items-center space-x-2",title:M(O.ciStatus),children:[B(O.ciStatus),s.jsx("span",{className:"text-sm capitalize text-slate-400",children:O.ciStatus})]})}),s.jsx("td",{className:"px-6 py-4",children:O.reviewScore!==null?s.jsxs("div",{className:"flex items-center space-x-2",title:X(O.reviewScore),children:[s.jsx("div",{className:"w-24 h-2 bg-slate-800 rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full ${O.reviewScore>=70?"bg-green-500":"bg-red-500"}`,style:{width:`${O.reviewScore}%`}})}),s.jsx("span",{className:`text-sm font-bold ${O.reviewScore>=70?"text-green-500":"text-red-500"}`,children:O.reviewScore})]}):s.jsx("span",{className:"text-slate-600 text-sm",title:"No review decision yet",children:"—"})}),s.jsx("td",{className:"px-6 py-4 text-right",children:s.jsx("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:"text-slate-500 hover:text-indigo-400",onClick:ne=>ne.stopPropagation(),children:s.jsx(Jx,{className:"h-4 w-4"})})})]},O.number)),F.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"px-6 py-12 text-center text-slate-500",children:$.length===0?"No open PRs found.":`No PRs match the "${f}" filter.`})})]})]})}),l&&s.jsx(ft,{className:"p-6 bg-slate-900 border-indigo-900/50 animate-in fade-in slide-in-from-top-4 duration-300",children:(()=>{const O=$.find(ne=>ne.number===l);return O?s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold text-slate-200",children:O.title}),s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Branch: ",s.jsx("span",{className:"font-mono",children:O.branch})]})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"text-center",title:M(O.ciStatus),children:[s.jsx("div",{className:"text-xs text-slate-500",children:"CI Status"}),s.jsxs("div",{className:"flex items-center space-x-1 mt-1",children:[B(O.ciStatus),s.jsx("span",{className:"text-sm capitalize text-slate-300",children:O.ciStatus})]})]}),O.reviewScore!==null&&s.jsxs("div",{className:"text-center",title:X(O.reviewScore),children:[s.jsx("div",{className:"text-xs text-slate-500",children:"Review Score"}),s.jsx("div",{className:`text-xl font-bold mt-1 ${O.reviewScore>=70?"text-green-500":"text-red-500"}`,children:O.reviewScore})]})]})]}):null})()})]})},Qa=ze.forwardRef(({className:l="",label:r,checked:d,onChange:c,...f},h)=>{const b=N=>{c&&c(N.target.checked)};return s.jsxs("label",{className:`inline-flex items-center cursor-pointer ${l}`,children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:"checkbox",className:"sr-only peer",ref:h,checked:d,onChange:b,...f}),s.jsx("div",{className:"w-11 h-6 bg-slate-800 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-indigo-500/50 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-slate-400 after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-indigo-600 peer-checked:after:bg-white peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"})]}),r&&s.jsx("span",{className:"ml-3 text-sm font-medium text-slate-300 select-none",children:r})]})});Qa.displayName="Switch";const dN=()=>{const{addToast:l,selectedProjectId:r,globalModeLoading:d}=Wt(),[c,f]=U.useState(!1),[h,b]=U.useState(!1),{data:N,loading:y,error:p,refetch:j}=pn(B2,[r],{enabled:!d});U.useEffect(()=>{if(!(N!=null&&N.enabled))return;const B=setInterval(()=>{j()},1e4);return()=>clearInterval(B)},[N==null?void 0:N.enabled,j]);const T=async B=>{b(!0);try{await dv(B),l({title:B?"Scanner Enabled":"Scanner Disabled",message:B?"Roadmap scanner is now active.":"Roadmap scanner has been paused.",type:B?"success":"info"}),j()}catch(M){l({title:"Toggle Failed",message:M instanceof Error?M.message:"Failed to toggle scanner",type:"error"})}finally{b(!1)}},_=async()=>{f(!0);try{const B=await Y2();B.created.length>0?l({title:"Scan Complete",message:`Created ${B.created.length} PRD(s): ${B.created.join(", ")}`,type:"success"}):l({title:"Scan Complete",message:"No new PRDs to create.",type:"info"}),B.errors.length>0&&l({title:"Scan Errors",message:B.errors.join("; "),type:"warning"}),j()}catch(B){l({title:"Scan Failed",message:B instanceof Error?B.message:"Failed to scan roadmap",type:"error"})}finally{f(!1)}};if(y)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Loading roadmap scanner..."})});if(p)return s.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[s.jsx(Dn,{className:"h-12 w-12 text-red-400"}),s.jsx("div",{className:"text-slate-300",children:"Failed to load roadmap data"}),s.jsx("div",{className:"text-sm text-slate-500",children:p.message}),s.jsx(Ve,{onClick:()=>j(),children:"Retry"})]});if(!N)return null;if(N.status==="no-roadmap")return s.jsxs("div",{className:"space-y-6 max-w-6xl mx-auto",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("h1",{className:"text-3xl font-bold text-slate-100",children:"Roadmap Scanner"})}),s.jsx(ft,{className:"p-12",children:s.jsxs("div",{className:"flex flex-col items-center text-center space-y-4",children:[s.jsx("div",{className:"p-4 bg-slate-800 rounded-full",children:s.jsx(ev,{className:"h-10 w-10 text-slate-500"})}),s.jsx("h2",{className:"text-xl font-semibold text-slate-200",children:"No ROADMAP.md Found"}),s.jsxs("p",{className:"text-slate-400 max-w-md",children:["Create a ",s.jsx("code",{className:"text-indigo-400 bg-indigo-500/10 px-1.5 py-0.5 rounded text-sm",children:"ROADMAP.md"})," in your project root with checklist items (",s.jsx("code",{className:"text-slate-300 text-sm",children:"- [ ] Feature"}),") or heading-based items (",s.jsx("code",{className:"text-slate-300 text-sm",children:"### Feature"}),") to get started."]})]})})]});const k=N.totalItems>0?Math.round(N.processedItems/N.totalItems*100):0,S=hN(N.status),C=mN(N.items),A=N.lastScan?gN(N.lastScan):"Never",$=N.autoScanInterval?Math.round(N.autoScanInterval/60):5;return s.jsxs("div",{className:"space-y-6 max-w-6xl mx-auto",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-3xl font-bold text-slate-100",children:"Roadmap Scanner"}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx(Qa,{label:N.enabled?"Enabled":"Disabled",checked:N.enabled,onChange:T,disabled:h}),s.jsxs(Ve,{onClick:_,loading:c,disabled:!N.enabled||N.status==="complete",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Scan Now"]})]})]}),s.jsx(ft,{className:`p-6 border-2 ${S.borderColor}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx(S.icon,{className:`h-8 w-8 ${S.textColor}`}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-slate-400",children:"Scanner Status"}),s.jsx("div",{className:`text-2xl font-bold ${S.textColor}`,children:S.label})]})]}),s.jsxs("div",{className:"text-right text-sm text-slate-400 space-y-1",children:[s.jsxs("div",{children:["Last scan: ",s.jsx("span",{className:"text-slate-300",children:A})]}),N.enabled&&N.status!=="complete"&&s.jsxs("div",{children:["Auto-scan: ",s.jsxs("span",{className:"text-slate-300",children:["every ",$," min"]})]}),N.enabled&&N.status==="complete"&&s.jsx("div",{className:"text-emerald-400",children:"Auto-scan paused - all items sliced"})]})]})}),s.jsxs(ft,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Progress"}),s.jsxs("span",{className:"text-sm text-slate-400",children:[N.processedItems," / ",N.totalItems," items (",k,"%)"]})]}),s.jsx("div",{className:"w-full h-3 bg-slate-800 rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${k===100?"bg-gradient-to-r from-emerald-500 to-emerald-400":"bg-gradient-to-r from-indigo-600 to-indigo-400"}`,style:{width:`${k}%`}})})]}),Object.entries(C).map(([B,M])=>s.jsxs(ft,{className:"p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:B}),s.jsx("div",{className:"space-y-2",children:M.map(X=>s.jsx(fN,{item:X},X.hash))})]},B))]})};function fN({item:l}){const r=l.checked,d=l.processed;return s.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${r?"bg-slate-950/30 border-slate-800/50":d?"bg-emerald-500/5 border-emerald-500/10":"bg-slate-950/50 border-slate-800"}`,children:[s.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[r?s.jsx(a2,{className:"h-4 w-4 text-slate-600 flex-shrink-0"}):d?s.jsx(vu,{className:"h-4 w-4 text-emerald-400 flex-shrink-0"}):s.jsx(Vf,{className:"h-4 w-4 text-slate-500 flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:`text-sm font-medium truncate ${r?"line-through text-slate-600":"text-slate-200"}`,children:l.title}),l.description&&s.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:l.description})]})]}),s.jsx("div",{className:"flex-shrink-0 ml-3",children:r?s.jsx(Ia,{variant:"neutral",children:"Skipped"}):d?s.jsx(Ia,{variant:"success",children:l.prdFile||"Processed"}):s.jsx(Ia,{variant:"warning",children:"Pending"})})]})}function hN(l){switch(l){case"complete":return{label:"Complete",icon:vu,textColor:"text-emerald-400",borderColor:"border-emerald-500/20 bg-emerald-500/5"};case"idle":return{label:"Idle",icon:Xx,textColor:"text-blue-400",borderColor:"border-blue-500/20 bg-blue-500/5"};case"scanning":return{label:"Scanning",icon:vn,textColor:"text-indigo-400",borderColor:"border-indigo-500/20 bg-indigo-500/5"};case"disabled":return{label:"Disabled",icon:Dn,textColor:"text-slate-400",borderColor:"border-slate-500/20 bg-slate-500/5"};default:return{label:"No Roadmap",icon:Dn,textColor:"text-slate-500",borderColor:"border-slate-500/20"}}}function mN(l){const r={};for(const d of l){const c=d.section||"General";r[c]||(r[c]=[]),r[c].push(d)}return r}function gN(l){try{const r=new Date(l),c=new Date().getTime()-r.getTime(),f=Math.floor(c/6e4);if(f<1)return"Just now";if(f<60)return`${f} min ago`;const h=Math.floor(f/60);return h<24?`${h} hr ago`:`${Math.floor(h/24)} day(s) ago`}catch{return"Unknown"}}const dt=ze.forwardRef(({className:l="",label:r,error:d,helperText:c,options:f,value:h,onChange:b,children:N,...y},p)=>{const j=ze.useId(),T=y.id??j,_=d?`${T}-error`:void 0,k=!d&&c?`${T}-help`:void 0,S=[_,k].filter(Boolean).join(" ")||void 0,C=A=>{b&&b(A.target.value)};return s.jsxs("div",{className:"w-full",children:[r&&s.jsx("label",{htmlFor:T,className:"block text-sm font-medium text-slate-400 mb-1.5",children:r}),s.jsxs("div",{className:"relative",children:[s.jsx("select",{ref:p,id:T,"aria-describedby":S,"aria-invalid":d?!0:y["aria-invalid"],className:`
385
- w-full appearance-none rounded-lg bg-slate-950 border border-slate-800
386
- px-3 py-2 pr-10 text-sm text-slate-200
387
- focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500
388
- disabled:opacity-50 disabled:cursor-not-allowed
389
- transition-all duration-200
390
- ${d?"border-red-500/50 focus:ring-red-500/50 focus:border-red-500":""}
391
- ${l}
392
- `,value:h,onChange:C,...y,children:f?f.map(A=>s.jsx("option",{value:A.value,children:A.label},A.value)):N}),s.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-slate-500",children:s.jsx(sh,{className:"h-4 w-4"})})]}),d?s.jsx("p",{id:_,className:"mt-1.5 text-xs text-red-400",children:d}):c?s.jsx("p",{id:k,className:"mt-1.5 text-xs text-slate-500",children:c}):null]})});dt.displayName="Select";const ke=ze.forwardRef(({className:l="",label:r,error:d,helperText:c,rightIcon:f,...h},b)=>{const N=ze.useId(),y=h.id??N,p=d?`${y}-error`:void 0,j=!d&&c?`${y}-help`:void 0,T=[p,j].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:"w-full",children:[r&&s.jsx("label",{htmlFor:y,className:"block text-sm font-medium text-slate-400 mb-1.5",children:r}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:b,id:y,"aria-describedby":T,"aria-invalid":d?!0:h["aria-invalid"],className:`
393
- w-full rounded-lg bg-slate-950 border border-slate-800
394
- px-3 py-2 text-sm text-slate-200
395
- placeholder:text-slate-600
396
- focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500
397
- disabled:opacity-50 disabled:cursor-not-allowed
398
- transition-all duration-200
399
- ${d?"border-red-500/50 focus:ring-red-500/50 focus:border-red-500":""}
400
- ${f?"pr-10":""}
401
- ${l}
402
- `,...h}),f&&s.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-slate-500",children:f})]}),d?s.jsx("p",{id:p,className:"mt-1.5 text-xs text-red-400",children:d}):c?s.jsx("p",{id:j,className:"mt-1.5 text-xs text-slate-500",children:c}):null]})});ke.displayName="Input";const hv=({tabs:l,activeTab:r,onChange:d,className:c=""})=>{var y,p;const[f,h]=ze.useState((y=l[0])==null?void 0:y.id),b=r||f,N=j=>{d?d(j):h(j)};return s.jsxs("div",{className:`flex flex-col ${c}`,children:[s.jsx("div",{className:"border-b border-slate-800 mb-6",children:s.jsx("nav",{className:"-mb-px flex space-x-8 overflow-x-auto scrollbar-hide",children:l.map(j=>s.jsx("button",{onClick:()=>N(j.id),className:`
403
- whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm transition-all duration-200
404
- ${b===j.id?"border-indigo-500 text-indigo-400":"border-transparent text-slate-500 hover:text-slate-300 hover:border-slate-700"}
405
- `,children:j.label},j.id))})}),s.jsx("div",{className:"flex-1 animate-in fade-in slide-in-from-bottom-2 duration-300",children:(p=l.find(j=>j.id===b))==null?void 0:p.content})]})};var zs={},_a={},Ji={},Us={},Df={},$g;function xN(){return $g||($g=1,Object.defineProperty(Df,"__esModule",{value:!0})),Df}var Ki={},eu={},Fg;function Fs(){var r,d,c,f,h,mv,N;if(Fg)return eu;Fg=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.CronField=void 0;let l=(N=class{constructor(p,j={rawValue:""}){et(this,h);et(this,r,!1);et(this,d,!1);et(this,c,!1);et(this,f,[]);hg(this,"options",{rawValue:""});if(!Array.isArray(p))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(p.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...j,rawValue:j.rawValue??""},Ce(this,f,p.sort(N.sorter)),Ce(this,c,this.options.wildcard!==void 0?this.options.wildcard:je(this,h,mv).call(this)),Ce(this,r,this.options.rawValue.includes("L")||p.includes("L")),Ce(this,d,this.options.rawValue.includes("?")||p.includes("?"))}static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return J(this,r)}get hasQuestionMarkChar(){return J(this,d)}get isWildcard(){return J(this,c)}get values(){return J(this,f)}static sorter(p,j){const T=typeof p=="number",_=typeof j=="number";return T&&_?p-j:!T&&!_?p.localeCompare(j):T?-1:1}static findNearestValueInList(p,j,T=!1){if(T){for(let _=p.length-1;_>=0;_--)if(p[_]<j)return p[_];return null}for(let _=0;_<p.length;_++)if(p[_]>j)return p[_];return null}findNearestValue(p,j=!1){return this.constructor.findNearestValueInList(this.values,p,j)}serialize(){return{wildcard:J(this,c),values:J(this,f)}}validate(){let p;const j=this.chars.length>0?` or chars ${this.chars.join("")}`:"",T=C=>A=>new RegExp(`^\\d{0,2}${A}$`).test(C),_=C=>(p=C,typeof C=="number"?C>=this.min&&C<=this.max:this.chars.some(T(C)));if(!J(this,f).every(_))throw new Error(`${this.constructor.name} Validation error, got value ${p} expected range ${this.min}-${this.max}${j}`);const S=J(this,f).find((C,A)=>J(this,f).indexOf(C)!==A);if(S)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${S}`)}},r=new WeakMap,d=new WeakMap,c=new WeakMap,f=new WeakMap,h=new WeakSet,mv=function(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(p,j)=>j+this.min).every(p=>J(this,f).includes(p))},N);return eu.CronField=l,eu}var Gg;function vN(){if(Gg)return Ki;Gg=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.CronDayOfMonth=void 0;const l=Fs(),r=1,d=31,c=Object.freeze(["L"]);let f=class extends l.CronField{static get min(){return r}static get max(){return d}static get chars(){return c}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(b,N){super(b,N),this.validate()}get values(){return super.values}};return Ki.CronDayOfMonth=f,Ki}var tu={},Zg;function pN(){if(Zg)return tu;Zg=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.CronDayOfWeek=void 0;const l=Fs(),r=0,d=7,c=Object.freeze(["L"]);let f=class extends l.CronField{static get min(){return r}static get max(){return d}static get chars(){return c}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(b,N){super(b,N),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return tu.CronDayOfWeek=f,tu}var au={},Wg;function yN(){if(Wg)return au;Wg=1,Object.defineProperty(au,"__esModule",{value:!0}),au.CronHour=void 0;const l=Fs(),r=0,d=23,c=Object.freeze([]);let f=class extends l.CronField{static get min(){return r}static get max(){return d}static get chars(){return c}constructor(b,N){super(b,N),this.validate()}get values(){return super.values}};return au.CronHour=f,au}var nu={},Qg;function bN(){if(Qg)return nu;Qg=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.CronMinute=void 0;const l=Fs(),r=0,d=59,c=Object.freeze([]);let f=class extends l.CronField{static get min(){return r}static get max(){return d}static get chars(){return c}constructor(b,N){super(b,N),this.validate()}get values(){return super.values}};return nu.CronMinute=f,nu}var lu={},Af={},Ea={},Ig;function NN(){if(Ig)return Ea;Ig=1,Object.defineProperty(Ea,"__esModule",{value:!0});class l extends Error{}class r extends l{constructor(i){super(`Invalid DateTime: ${i.toMessage()}`)}}class d extends l{constructor(i){super(`Invalid Interval: ${i.toMessage()}`)}}class c extends l{constructor(i){super(`Invalid Duration: ${i.toMessage()}`)}}class f extends l{}class h extends l{constructor(i){super(`Invalid unit ${i}`)}}class b extends l{}class N extends l{constructor(){super("Zone is an abstract class")}}const y="numeric",p="short",j="long",T={year:y,month:y,day:y},_={year:y,month:p,day:y},k={year:y,month:p,day:y,weekday:p},S={year:y,month:j,day:y},C={year:y,month:j,day:y,weekday:j},A={hour:y,minute:y},$={hour:y,minute:y,second:y},B={hour:y,minute:y,second:y,timeZoneName:p},M={hour:y,minute:y,second:y,timeZoneName:j},X={hour:y,minute:y,hourCycle:"h23"},ie={hour:y,minute:y,second:y,hourCycle:"h23"},F={hour:y,minute:y,second:y,hourCycle:"h23",timeZoneName:p},Z={hour:y,minute:y,second:y,hourCycle:"h23",timeZoneName:j},R={year:y,month:y,day:y,hour:y,minute:y},ee={year:y,month:y,day:y,hour:y,minute:y,second:y},O={year:y,month:p,day:y,hour:y,minute:y},ne={year:y,month:p,day:y,hour:y,minute:y,second:y},ae={year:y,month:p,day:y,weekday:p,hour:y,minute:y},he={year:y,month:j,day:y,hour:y,minute:y,timeZoneName:p},pe={year:y,month:j,day:y,hour:y,minute:y,second:y,timeZoneName:p},re={year:y,month:j,day:y,weekday:j,hour:y,minute:y,timeZoneName:j},P={year:y,month:j,day:y,weekday:j,hour:y,minute:y,second:y,timeZoneName:j};class te{get type(){throw new N}get name(){throw new N}get ianaName(){return this.name}get isUniversal(){throw new N}offsetName(i,m){throw new N}formatOffset(i,m){throw new N}offset(i){throw new N}equals(i){throw new N}get isValid(){throw new N}}let de=null;class me extends te{static get instance(){return de===null&&(de=new me),de}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(i,{format:m,locale:v}){return Hn(i,m,v)}formatOffset(i,m){return ss(this.offset(i),m)}offset(i){return-new Date(i).getTimezoneOffset()}equals(i){return i.type==="system"}get isValid(){return!0}}const _e=new Map;function L(g){let i=_e.get(g);return i===void 0&&(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),_e.set(g,i)),i}const le={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ge(g,i){const m=g.format(i).replace(/\u200E/g,""),v=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(m),[,w,D,H,q,Y,fe,ye]=v;return[H,w,D,q,Y,fe,ye]}function ve(g,i){const m=g.formatToParts(i),v=[];for(let w=0;w<m.length;w++){const{type:D,value:H}=m[w],q=le[D];D==="era"?v[q]=H:Oe(q)||(v[q]=parseInt(H,10))}return v}const we=new Map;class xe extends te{static create(i){let m=we.get(i);return m===void 0&&we.set(i,m=new xe(i)),m}static resetCache(){we.clear(),_e.clear()}static isValidSpecifier(i){return this.isValidZone(i)}static isValidZone(i){if(!i)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:i}).format(),!0}catch{return!1}}constructor(i){super(),this.zoneName=i,this.valid=xe.isValidZone(i)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(i,{format:m,locale:v}){return Hn(i,m,v,this.name)}formatOffset(i,m){return ss(this.offset(i),m)}offset(i){if(!this.valid)return NaN;const m=new Date(i);if(isNaN(m))return NaN;const v=L(this.name);let[w,D,H,q,Y,fe,ye]=v.formatToParts?ve(v,m):ge(v,m);q==="BC"&&(w=-Math.abs(w)+1);const $e=Xt({year:w,month:D,day:H,hour:Y===24?0:Y,minute:fe,second:ye,millisecond:0});let De=+m;const yt=De%1e3;return De-=yt>=0?yt:1e3+yt,($e-De)/(60*1e3)}equals(i){return i.type==="iana"&&i.name===this.name}get isValid(){return this.valid}}let Te={};function Ze(g,i={}){const m=JSON.stringify([g,i]);let v=Te[m];return v||(v=new Intl.ListFormat(g,i),Te[m]=v),v}const We=new Map;function Dt(g,i={}){const m=JSON.stringify([g,i]);let v=We.get(m);return v===void 0&&(v=new Intl.DateTimeFormat(g,i),We.set(m,v)),v}const da=new Map;function Ja(g,i={}){const m=JSON.stringify([g,i]);let v=da.get(m);return v===void 0&&(v=new Intl.NumberFormat(g,i),da.set(m,v)),v}const Ka=new Map;function fa(g,i={}){const{base:m,...v}=i,w=JSON.stringify([g,v]);let D=Ka.get(w);return D===void 0&&(D=new Intl.RelativeTimeFormat(g,i),Ka.set(w,D)),D}let ha=null;function yn(){return ha||(ha=new Intl.DateTimeFormat().resolvedOptions().locale,ha)}const $t=new Map;function ua(g){let i=$t.get(g);return i===void 0&&(i=new Intl.DateTimeFormat(g).resolvedOptions(),$t.set(g,i)),i}const en=new Map;function tn(g){let i=en.get(g);if(!i){const m=new Intl.Locale(g);i="getWeekInfo"in m?m.getWeekInfo():m.weekInfo,"minimalDays"in i||(i={...cl,...i}),en.set(g,i)}return i}function an(g){const i=g.indexOf("-x-");i!==-1&&(g=g.substring(0,i));const m=g.indexOf("-u-");if(m===-1)return[g];{let v,w;try{v=Dt(g).resolvedOptions(),w=g}catch{const Y=g.substring(0,m);v=Dt(Y).resolvedOptions(),w=Y}const{numberingSystem:D,calendar:H}=v;return[w,D,H]}}function Ua(g,i,m){return(m||i)&&(g.includes("-u-")||(g+="-u"),m&&(g+=`-ca-${m}`),i&&(g+=`-nu-${i}`)),g}function bn(g){const i=[];for(let m=1;m<=12;m++){const v=Ee.utc(2009,m,1);i.push(g(v))}return i}function Qt(g){const i=[];for(let m=1;m<=7;m++){const v=Ee.utc(2016,11,13+m);i.push(g(v))}return i}function ul(g,i,m,v){const w=g.listingMode();return w==="error"?null:w==="en"?m(i):v(i)}function Zr(g){return g.numberingSystem&&g.numberingSystem!=="latn"?!1:g.numberingSystem==="latn"||!g.locale||g.locale.startsWith("en")||ua(g.locale).numberingSystem==="latn"}class Gs{constructor(i,m,v){this.padTo=v.padTo||0,this.floor=v.floor||!1;const{padTo:w,floor:D,...H}=v;if(!m||Object.keys(H).length>0){const q={useGrouping:!1,...v};v.padTo>0&&(q.minimumIntegerDigits=v.padTo),this.inf=Ja(i,q)}}format(i){if(this.inf){const m=this.floor?Math.floor(i):i;return this.inf.format(m)}else{const m=this.floor?Math.floor(i):as(i,3);return at(m,this.padTo)}}}class kn{constructor(i,m,v){this.opts=v,this.originalZone=void 0;let w;if(this.opts.timeZone)this.dt=i;else if(i.zone.type==="fixed"){const H=-1*(i.offset/60),q=H>=0?`Etc/GMT+${H}`:`Etc/GMT${H}`;i.offset!==0&&xe.create(q).valid?(w=q,this.dt=i):(w="UTC",this.dt=i.offset===0?i:i.setZone("UTC").plus({minutes:i.offset}),this.originalZone=i.zone)}else i.zone.type==="system"?this.dt=i:i.zone.type==="iana"?(this.dt=i,w=i.zone.name):(w="UTC",this.dt=i.setZone("UTC").plus({minutes:i.offset}),this.originalZone=i.zone);const D={...this.opts};D.timeZone=D.timeZone||w,this.dtf=Dt(m,D)}format(){return this.originalZone?this.formatToParts().map(({value:i})=>i).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const i=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?i.map(m=>{if(m.type==="timeZoneName"){const v=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...m,value:v}}else return m}):i}resolvedOptions(){return this.dtf.resolvedOptions()}}class Zs{constructor(i,m,v){this.opts={style:"long",...v},!m&&Xr()&&(this.rtf=fa(i,v))}format(i,m){return this.rtf?this.rtf.format(i,m):wn(m,i,this.opts.numeric,this.opts.style!=="long")}formatToParts(i,m){return this.rtf?this.rtf.formatToParts(i,m):[]}}const cl={firstDay:1,minimalDays:4,weekend:[6,7]};class Qe{static fromOpts(i){return Qe.create(i.locale,i.numberingSystem,i.outputCalendar,i.weekSettings,i.defaultToEN)}static create(i,m,v,w,D=!1){const H=i||ht.defaultLocale,q=H||(D?"en-US":yn()),Y=m||ht.defaultNumberingSystem,fe=v||ht.defaultOutputCalendar,ye=Jr(w)||ht.defaultWeekSettings;return new Qe(q,Y,fe,ye,H)}static resetCache(){ha=null,We.clear(),da.clear(),Ka.clear(),$t.clear(),en.clear()}static fromObject({locale:i,numberingSystem:m,outputCalendar:v,weekSettings:w}={}){return Qe.create(i,m,v,w)}constructor(i,m,v,w,D){const[H,q,Y]=an(i);this.locale=H,this.numberingSystem=m||q||null,this.outputCalendar=v||Y||null,this.weekSettings=w,this.intl=Ua(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=D,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Zr(this)),this.fastNumbersCached}listingMode(){const i=this.isEnglish(),m=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return i&&m?"en":"intl"}clone(i){return!i||Object.getOwnPropertyNames(i).length===0?this:Qe.create(i.locale||this.specifiedLocale,i.numberingSystem||this.numberingSystem,i.outputCalendar||this.outputCalendar,Jr(i.weekSettings)||this.weekSettings,i.defaultToEN||!1)}redefaultToEN(i={}){return this.clone({...i,defaultToEN:!0})}redefaultToSystem(i={}){return this.clone({...i,defaultToEN:!1})}months(i,m=!1){return ul(this,i,Cu,()=>{const v=this.intl==="ja"||this.intl.startsWith("ja-");m&=!v;const w=m?{month:i,day:"numeric"}:{month:i},D=m?"format":"standalone";if(!this.monthsCache[D][i]){const H=v?q=>this.dtFormatter(q,w).format():q=>this.extract(q,w,"month");this.monthsCache[D][i]=bn(H)}return this.monthsCache[D][i]})}weekdays(i,m=!1){return ul(this,i,ar,()=>{const v=m?{weekday:i,year:"numeric",month:"long",day:"numeric"}:{weekday:i},w=m?"format":"standalone";return this.weekdaysCache[w][i]||(this.weekdaysCache[w][i]=Qt(D=>this.extract(D,v,"weekday"))),this.weekdaysCache[w][i]})}meridiems(){return ul(this,void 0,()=>qn,()=>{if(!this.meridiemCache){const i={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ee.utc(2016,11,13,9),Ee.utc(2016,11,13,19)].map(m=>this.extract(m,i,"dayperiod"))}return this.meridiemCache})}eras(i){return ul(this,i,ni,()=>{const m={era:i};return this.eraCache[i]||(this.eraCache[i]=[Ee.utc(-40,1,1),Ee.utc(2017,1,1)].map(v=>this.extract(v,m,"era"))),this.eraCache[i]})}extract(i,m,v){const w=this.dtFormatter(i,m),D=w.formatToParts(),H=D.find(q=>q.type.toLowerCase()===v);return H?H.value:null}numberFormatter(i={}){return new Gs(this.intl,i.forceSimple||this.fastNumbers,i)}dtFormatter(i,m={}){return new kn(i,this.intl,m)}relFormatter(i={}){return new Zs(this.intl,this.isEnglish(),i)}listFormatter(i={}){return Ze(this.intl,i)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ua(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Sn()?tn(this.locale):cl}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(i){return this.locale===i.locale&&this.numberingSystem===i.numberingSystem&&this.outputCalendar===i.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ol=null;class mt extends te{static get utcInstance(){return ol===null&&(ol=new mt(0)),ol}static instance(i){return i===0?mt.utcInstance:new mt(i)}static parseSpecifier(i){if(i){const m=i.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(m)return new mt(ls(m[1],m[2]))}return null}constructor(i){super(),this.fixed=i}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ss(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ss(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(i,m){return ss(this.fixed,m)}get isUniversal(){return!0}offset(){return this.fixed}equals(i){return i.type==="fixed"&&i.fixed===this.fixed}get isValid(){return!0}}class Vt extends te{constructor(i){super(),this.zoneName=i}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function At(g,i){if(Oe(g)||g===null)return i;if(g instanceof te)return g;if(zt(g)){const m=g.toLowerCase();return m==="default"?i:m==="local"||m==="system"?me.instance:m==="utc"||m==="gmt"?mt.utcInstance:mt.parseSpecifier(m)||xe.create(g)}else return ga(g)?mt.instance(g):typeof g=="object"&&"offset"in g&&typeof g.offset=="function"?g:new Vt(g)}const _t={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},oe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ne=_t.hanidec.replace(/[\[|\]]/g,"").split("");function tt(g){let i=parseInt(g,10);if(isNaN(i)){i="";for(let m=0;m<g.length;m++){const v=g.charCodeAt(m);if(g[m].search(_t.hanidec)!==-1)i+=Ne.indexOf(g[m]);else for(const w in oe){const[D,H]=oe[w];v>=D&&v<=H&&(i+=v-D)}}return parseInt(i,10)}else return i}const jt=new Map;function bt(){jt.clear()}function kt({numberingSystem:g},i=""){const m=g||"latn";let v=jt.get(m);v===void 0&&(v=new Map,jt.set(m,v));let w=v.get(i);return w===void 0&&(w=new RegExp(`${_t[m]}${i}`),v.set(i,w)),w}let Nn=()=>Date.now(),Kl="system",dl=null,pu=null,Wr=null,Ws=60,fl,yu=null;class ht{static get now(){return Nn}static set now(i){Nn=i}static set defaultZone(i){Kl=i}static get defaultZone(){return At(Kl,me.instance)}static get defaultLocale(){return dl}static set defaultLocale(i){dl=i}static get defaultNumberingSystem(){return pu}static set defaultNumberingSystem(i){pu=i}static get defaultOutputCalendar(){return Wr}static set defaultOutputCalendar(i){Wr=i}static get defaultWeekSettings(){return yu}static set defaultWeekSettings(i){yu=Jr(i)}static get twoDigitCutoffYear(){return Ws}static set twoDigitCutoffYear(i){Ws=i%100}static get throwOnInvalid(){return fl}static set throwOnInvalid(i){fl=i}static resetCaches(){Qe.resetCache(),xe.resetCache(),Ee.resetCache(),bt()}}class ma{constructor(i,m){this.reason=i,this.explanation=m}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Qr=[0,31,59,90,120,151,181,212,243,273,304,334],Qs=[0,31,60,91,121,152,182,213,244,274,305,335];function na(g,i){return new ma("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${g}, which is invalid`)}function Is(g,i,m){const v=new Date(Date.UTC(g,i-1,m));g<100&&g>=0&&v.setUTCFullYear(v.getUTCFullYear()-1900);const w=v.getUTCDay();return w===0?7:w}function Ir(g,i,m){return m+(ml(g)?Qs:Qr)[i-1]}function nn(g,i){const m=ml(g)?Qs:Qr,v=m.findIndex(D=>D<i),w=i-m[v];return{month:v+1,day:w}}function wt(g,i){return(g-i+7)%7+1}function Bt(g,i=4,m=1){const{year:v,month:w,day:D}=g,H=Ir(v,w,D),q=wt(Is(v,w,D),m);let Y=Math.floor((H-q+14-i)/7),fe;return Y<1?(fe=v-1,Y=gl(fe,i,m)):Y>gl(v,i,m)?(fe=v+1,Y=1):fe=v,{weekYear:fe,weekNumber:Y,weekday:q,...rs(g)}}function zn(g,i=4,m=1){const{weekYear:v,weekNumber:w,weekday:D}=g,H=wt(Is(v,1,i),m),q=sn(v);let Y=w*7+D-H-7+i,fe;Y<1?(fe=v-1,Y+=sn(fe)):Y>q?(fe=v+1,Y-=sn(v)):fe=v;const{month:ye,day:Ue}=nn(fe,Y);return{year:fe,month:ye,day:Ue,...rs(g)}}function es(g){const{year:i,month:m,day:v}=g,w=Ir(i,m,v);return{year:i,ordinal:w,...rs(g)}}function bu(g){const{year:i,ordinal:m}=g,{month:v,day:w}=nn(i,m);return{year:i,month:v,day:w,...rs(g)}}function Nu(g,i){if(!Oe(g.localWeekday)||!Oe(g.localWeekNumber)||!Oe(g.localWeekYear)){if(!Oe(g.weekday)||!Oe(g.weekNumber)||!Oe(g.weekYear))throw new f("Cannot mix locale-based week fields with ISO-based week fields");return Oe(g.localWeekday)||(g.weekday=g.localWeekday),Oe(g.localWeekNumber)||(g.weekNumber=g.localWeekNumber),Oe(g.localWeekYear)||(g.weekYear=g.localWeekYear),delete g.localWeekday,delete g.localWeekNumber,delete g.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Su(g,i=4,m=1){const v=ln(g.weekYear),w=It(g.weekNumber,1,gl(g.weekYear,i,m)),D=It(g.weekday,1,7);return v?w?D?!1:na("weekday",g.weekday):na("week",g.weekNumber):na("weekYear",g.weekYear)}function ts(g){const i=ln(g.year),m=It(g.ordinal,1,sn(g.year));return i?m?!1:na("ordinal",g.ordinal):na("year",g.year)}function Xs(g){const i=ln(g.year),m=It(g.month,1,12),v=It(g.day,1,Ks(g.year,g.month));return i?m?v?!1:na("day",g.day):na("month",g.month):na("year",g.year)}function Un(g){const{hour:i,minute:m,second:v,millisecond:w}=g,D=It(i,0,23)||i===24&&m===0&&v===0&&w===0,H=It(m,0,59),q=It(v,0,59),Y=It(w,0,999);return D?H?q?Y?!1:na("millisecond",w):na("second",v):na("minute",m):na("hour",i)}function Oe(g){return typeof g>"u"}function ga(g){return typeof g=="number"}function ln(g){return typeof g=="number"&&g%1===0}function zt(g){return typeof g=="string"}function ju(g){return Object.prototype.toString.call(g)==="[object Date]"}function Xr(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Sn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function hl(g){return Array.isArray(g)?g:[g]}function wu(g,i,m){if(g.length!==0)return g.reduce((v,w)=>{const D=[i(w),w];return v&&m(v[0],D[0])===v[0]?v:D},null)[1]}function Eu(g,i){return i.reduce((m,v)=>(m[v]=g[v],m),{})}function Ln(g,i){return Object.prototype.hasOwnProperty.call(g,i)}function Jr(g){if(g==null)return null;if(typeof g!="object")throw new b("Week settings must be an object");if(!It(g.firstDay,1,7)||!It(g.minimalDays,1,7)||!Array.isArray(g.weekend)||g.weekend.some(i=>!It(i,1,7)))throw new b("Invalid week settings");return{firstDay:g.firstDay,minimalDays:g.minimalDays,weekend:Array.from(g.weekend)}}function It(g,i,m){return ln(g)&&g>=i&&g<=m}function Js(g,i){return g-i*Math.floor(g/i)}function at(g,i=2){const m=g<0;let v;return m?v="-"+(""+-g).padStart(i,"0"):v=(""+g).padStart(i,"0"),v}function Et(g){if(!(Oe(g)||g===null||g===""))return parseInt(g,10)}function jn(g){if(!(Oe(g)||g===null||g===""))return parseFloat(g)}function Kr(g){if(!(Oe(g)||g===null||g==="")){const i=parseFloat("0."+g)*1e3;return Math.floor(i)}}function as(g,i,m="round"){const v=10**i;switch(m){case"expand":return g>0?Math.ceil(g*v)/v:Math.floor(g*v)/v;case"trunc":return Math.trunc(g*v)/v;case"round":return Math.round(g*v)/v;case"floor":return Math.floor(g*v)/v;case"ceil":return Math.ceil(g*v)/v;default:throw new RangeError(`Value rounding ${m} is out of range`)}}function ml(g){return g%4===0&&(g%100!==0||g%400===0)}function sn(g){return ml(g)?366:365}function Ks(g,i){const m=Js(i-1,12)+1,v=g+(i-m)/12;return m===2?ml(v)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][m-1]}function Xt(g){let i=Date.UTC(g.year,g.month-1,g.day,g.hour,g.minute,g.second,g.millisecond);return g.year<100&&g.year>=0&&(i=new Date(i),i.setUTCFullYear(g.year,g.month-1,g.day)),+i}function er(g,i,m){return-wt(Is(g,1,i),m)+i-1}function gl(g,i=4,m=1){const v=er(g,i,m),w=er(g+1,i,m);return(sn(g)-v+w)/7}function ns(g){return g>99?g:g>ht.twoDigitCutoffYear?1900+g:2e3+g}function Hn(g,i,m,v=null){const w=new Date(g),D={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};v&&(D.timeZone=v);const H={timeZoneName:i,...D},q=new Intl.DateTimeFormat(m,H).formatToParts(w).find(Y=>Y.type.toLowerCase()==="timezonename");return q?q.value:null}function ls(g,i){let m=parseInt(g,10);Number.isNaN(m)&&(m=0);const v=parseInt(i,10)||0,w=m<0||Object.is(m,-0)?-v:v;return m*60+w}function ei(g){const i=Number(g);if(typeof g=="boolean"||g===""||!Number.isFinite(i))throw new b(`Invalid unit value ${g}`);return i}function rn(g,i){const m={};for(const v in g)if(Ln(g,v)){const w=g[v];if(w==null)continue;m[i(v)]=ei(w)}return m}function ss(g,i){const m=Math.trunc(Math.abs(g/60)),v=Math.trunc(Math.abs(g%60)),w=g>=0?"+":"-";switch(i){case"short":return`${w}${at(m,2)}:${at(v,2)}`;case"narrow":return`${w}${m}${v>0?`:${v}`:""}`;case"techie":return`${w}${at(m,2)}${at(v,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function rs(g){return Eu(g,["hour","minute","second","millisecond"])}const Tu=["January","February","March","April","May","June","July","August","September","October","November","December"],tr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vo=["J","F","M","A","M","J","J","A","S","O","N","D"];function Cu(g){switch(g){case"narrow":return[...vo];case"short":return[...tr];case"long":return[...Tu];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const is=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],La=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ti=["M","T","W","T","F","S","S"];function ar(g){switch(g){case"narrow":return[...ti];case"short":return[...La];case"long":return[...is];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qn=["AM","PM"],xl=["Before Christ","Anno Domini"],Mu=["BC","AD"],ai=["B","A"];function ni(g){switch(g){case"narrow":return[...ai];case"short":return[...Mu];case"long":return[...xl];default:return null}}function us(g){return qn[g.hour<12?0:1]}function un(g,i){return ar(i)[g.weekday-1]}function li(g,i){return Cu(i)[g.month-1]}function cs(g,i){return ni(i)[g.year<0?0:1]}function wn(g,i,m="always",v=!1){const w={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},D=["hours","minutes","seconds"].indexOf(g)===-1;if(m==="auto"&&D){const Ue=g==="days";switch(i){case 1:return Ue?"tomorrow":`next ${w[g][0]}`;case-1:return Ue?"yesterday":`last ${w[g][0]}`;case 0:return Ue?"today":`this ${w[g][0]}`}}const H=Object.is(i,-0)||i<0,q=Math.abs(i),Y=q===1,fe=w[g],ye=v?Y?fe[1]:fe[2]||fe[1]:Y?w[g][0]:g;return H?`${q} ${ye} ago`:`in ${q} ${ye}`}function nr(g,i){let m="";for(const v of g)v.literal?m+=v.val:m+=i(v.val);return m}const lr={D:T,DD:_,DDD:S,DDDD:C,t:A,tt:$,ttt:B,tttt:M,T:X,TT:ie,TTT:F,TTTT:Z,f:R,ff:O,fff:he,ffff:re,F:ee,FF:ne,FFF:pe,FFFF:P};class Yt{static create(i,m={}){return new Yt(i,m)}static parseFormat(i){let m=null,v="",w=!1;const D=[];for(let H=0;H<i.length;H++){const q=i.charAt(H);q==="'"?((v.length>0||w)&&D.push({literal:w||/^\s+$/.test(v),val:v===""?"'":v}),m=null,v="",w=!w):w||q===m?v+=q:(v.length>0&&D.push({literal:/^\s+$/.test(v),val:v}),v=q,m=q)}return v.length>0&&D.push({literal:w||/^\s+$/.test(v),val:v}),D}static macroTokenToFormatOpts(i){return lr[i]}constructor(i,m){this.opts=m,this.loc=i,this.systemLoc=null}formatWithSystemDefault(i,m){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(i,{...this.opts,...m}).format()}dtFormatter(i,m={}){return this.loc.dtFormatter(i,{...this.opts,...m})}formatDateTime(i,m){return this.dtFormatter(i,m).format()}formatDateTimeParts(i,m){return this.dtFormatter(i,m).formatToParts()}formatInterval(i,m){return this.dtFormatter(i.start,m).dtf.formatRange(i.start.toJSDate(),i.end.toJSDate())}resolvedOptions(i,m){return this.dtFormatter(i,m).resolvedOptions()}num(i,m=0,v=void 0){if(this.opts.forceSimple)return at(i,m);const w={...this.opts};return m>0&&(w.padTo=m),v&&(w.signDisplay=v),this.loc.numberFormatter(w).format(i)}formatDateTimeFromString(i,m){const v=this.loc.listingMode()==="en",w=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",D=(De,yt)=>this.loc.extract(i,De,yt),H=De=>i.isOffsetFixed&&i.offset===0&&De.allowZ?"Z":i.isValid?i.zone.formatOffset(i.ts,De.format):"",q=()=>v?us(i):D({hour:"numeric",hourCycle:"h12"},"dayperiod"),Y=(De,yt)=>v?li(i,De):D(yt?{month:De}:{month:De,day:"numeric"},"month"),fe=(De,yt)=>v?un(i,De):D(yt?{weekday:De}:{weekday:De,month:"long",day:"numeric"},"weekday"),ye=De=>{const yt=Yt.macroTokenToFormatOpts(De);return yt?this.formatWithSystemDefault(i,yt):De},Ue=De=>v?cs(i,De):D({era:De},"era"),$e=De=>{switch(De){case"S":return this.num(i.millisecond);case"u":case"SSS":return this.num(i.millisecond,3);case"s":return this.num(i.second);case"ss":return this.num(i.second,2);case"uu":return this.num(Math.floor(i.millisecond/10),2);case"uuu":return this.num(Math.floor(i.millisecond/100));case"m":return this.num(i.minute);case"mm":return this.num(i.minute,2);case"h":return this.num(i.hour%12===0?12:i.hour%12);case"hh":return this.num(i.hour%12===0?12:i.hour%12,2);case"H":return this.num(i.hour);case"HH":return this.num(i.hour,2);case"Z":return H({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return H({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return H({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return i.zone.offsetName(i.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return i.zone.offsetName(i.ts,{format:"long",locale:this.loc.locale});case"z":return i.zoneName;case"a":return q();case"d":return w?D({day:"numeric"},"day"):this.num(i.day);case"dd":return w?D({day:"2-digit"},"day"):this.num(i.day,2);case"c":return this.num(i.weekday);case"ccc":return fe("short",!0);case"cccc":return fe("long",!0);case"ccccc":return fe("narrow",!0);case"E":return this.num(i.weekday);case"EEE":return fe("short",!1);case"EEEE":return fe("long",!1);case"EEEEE":return fe("narrow",!1);case"L":return w?D({month:"numeric",day:"numeric"},"month"):this.num(i.month);case"LL":return w?D({month:"2-digit",day:"numeric"},"month"):this.num(i.month,2);case"LLL":return Y("short",!0);case"LLLL":return Y("long",!0);case"LLLLL":return Y("narrow",!0);case"M":return w?D({month:"numeric"},"month"):this.num(i.month);case"MM":return w?D({month:"2-digit"},"month"):this.num(i.month,2);case"MMM":return Y("short",!1);case"MMMM":return Y("long",!1);case"MMMMM":return Y("narrow",!1);case"y":return w?D({year:"numeric"},"year"):this.num(i.year);case"yy":return w?D({year:"2-digit"},"year"):this.num(i.year.toString().slice(-2),2);case"yyyy":return w?D({year:"numeric"},"year"):this.num(i.year,4);case"yyyyyy":return w?D({year:"numeric"},"year"):this.num(i.year,6);case"G":return Ue("short");case"GG":return Ue("long");case"GGGGG":return Ue("narrow");case"kk":return this.num(i.weekYear.toString().slice(-2),2);case"kkkk":return this.num(i.weekYear,4);case"W":return this.num(i.weekNumber);case"WW":return this.num(i.weekNumber,2);case"n":return this.num(i.localWeekNumber);case"nn":return this.num(i.localWeekNumber,2);case"ii":return this.num(i.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(i.localWeekYear,4);case"o":return this.num(i.ordinal);case"ooo":return this.num(i.ordinal,3);case"q":return this.num(i.quarter);case"qq":return this.num(i.quarter,2);case"X":return this.num(Math.floor(i.ts/1e3));case"x":return this.num(i.ts);default:return ye(De)}};return nr(Yt.parseFormat(m),$e)}formatDurationFromString(i,m){const v=this.opts.signMode==="negativeLargestOnly"?-1:1,w=ye=>{switch(ye[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},D=(ye,Ue)=>$e=>{const De=w($e);if(De){const yt=Ue.isNegativeDuration&&De!==Ue.largestUnit?v:1;let Ft;return this.opts.signMode==="negativeLargestOnly"&&De!==Ue.largestUnit?Ft="never":this.opts.signMode==="all"?Ft="always":Ft="auto",this.num(ye.get(De)*yt,$e.length,Ft)}else return $e},H=Yt.parseFormat(m),q=H.reduce((ye,{literal:Ue,val:$e})=>Ue?ye:ye.concat($e),[]),Y=i.shiftTo(...q.map(w).filter(ye=>ye)),fe={isNegativeDuration:Y<0,largestUnit:Object.keys(Y.values)[0]};return nr(H,D(Y,fe))}}const os=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function cn(...g){const i=g.reduce((m,v)=>m+v.source,"");return RegExp(`^${i}$`)}function Vn(...g){return i=>g.reduce(([m,v,w],D)=>{const[H,q,Y]=D(i,w);return[{...m,...H},q||v,Y]},[{},null,1]).slice(0,2)}function Tt(g,...i){if(g==null)return[null,null];for(const[m,v]of i){const w=m.exec(g);if(w)return v(w)}return[null,null]}function En(...g){return(i,m)=>{const v={};let w;for(w=0;w<g.length;w++)v[g[w]]=Et(i[m+w]);return[v,null,m+w]}}const ds=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,fs=`(?:${ds.source}?(?:\\[(${os.source})\\])?)?`,si=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,sr=RegExp(`${si.source}${fs}`),hs=RegExp(`(?:[Tt]${sr.source})?`),ms=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,rr=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ou=/(\d{4})-?(\d{3})/,po=En("weekYear","weekNumber","weekDay"),yo=En("year","ordinal"),bo=/(\d{4})-(\d\d)-(\d\d)/,ir=RegExp(`${si.source} ?(?:${ds.source}|(${os.source}))?`),No=RegExp(`(?: ${ir.source})?`);function vl(g,i,m){const v=g[i];return Oe(v)?m:Et(v)}function So(g,i){return[{year:vl(g,i),month:vl(g,i+1,1),day:vl(g,i+2,1)},null,i+3]}function pl(g,i){return[{hours:vl(g,i,0),minutes:vl(g,i+1,0),seconds:vl(g,i+2,0),milliseconds:Kr(g[i+3])},null,i+4]}function gs(g,i){const m=!g[i]&&!g[i+1],v=ls(g[i+1],g[i+2]),w=m?null:mt.instance(v);return[{},w,i+3]}function yl(g,i){const m=g[i]?xe.create(g[i]):null;return[{},m,i+1]}const jo=RegExp(`^T?${si.source}$`),wo=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Eo(g){const[i,m,v,w,D,H,q,Y,fe]=g,ye=i[0]==="-",Ue=Y&&Y[0]==="-",$e=(De,yt=!1)=>De!==void 0&&(yt||De&&ye)?-De:De;return[{years:$e(jn(m)),months:$e(jn(v)),weeks:$e(jn(w)),days:$e(jn(D)),hours:$e(jn(H)),minutes:$e(jn(q)),seconds:$e(jn(Y),Y==="-0"),milliseconds:$e(Kr(fe),Ue)}]}const To={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function xs(g,i,m,v,w,D,H){const q={year:i.length===2?ns(Et(i)):Et(i),month:tr.indexOf(m)+1,day:Et(v),hour:Et(w),minute:Et(D)};return H&&(q.second=Et(H)),g&&(q.weekday=g.length>3?is.indexOf(g)+1:La.indexOf(g)+1),q}const Co=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Mo(g){const[,i,m,v,w,D,H,q,Y,fe,ye,Ue]=g,$e=xs(i,w,v,m,D,H,q);let De;return Y?De=To[Y]:fe?De=0:De=ls(ye,Ue),[$e,new mt(De)]}function Oo(g){return g.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ru=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ro=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Do=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Du(g){const[,i,m,v,w,D,H,q]=g;return[xs(i,w,v,m,D,H,q),mt.utcInstance]}function Ao(g){const[,i,m,v,w,D,H,q]=g;return[xs(i,q,m,v,w,D,H),mt.utcInstance]}const _o=cn(ms,hs),ko=cn(rr,hs),zo=cn(Ou,hs),Uo=cn(sr),Au=Vn(So,pl,gs,yl),ri=Vn(po,pl,gs,yl),vs=Vn(yo,pl,gs,yl),Lo=Vn(pl,gs,yl);function _u(g){return Tt(g,[_o,Au],[ko,ri],[zo,vs],[Uo,Lo])}function ku(g){return Tt(Oo(g),[Co,Mo])}function zu(g){return Tt(g,[Ru,Du],[Ro,Du],[Do,Ao])}function Uu(g){return Tt(g,[wo,Eo])}const Lu=Vn(pl);function bl(g){return Tt(g,[jo,Lu])}const Ho=cn(bo,No),qo=cn(ir),Vo=Vn(pl,gs,yl);function Hu(g){return Tt(g,[Ho,Au],[qo,Vo])}const ii="Invalid Duration",Nl={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},ps={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Nl},xa=146097/400,on=146097/4800,qu={years:{quarters:4,months:12,weeks:xa/7,days:xa,hours:xa*24,minutes:xa*24*60,seconds:xa*24*60*60,milliseconds:xa*24*60*60*1e3},quarters:{months:3,weeks:xa/28,days:xa/4,hours:xa*24/4,minutes:xa*24*60/4,seconds:xa*24*60*60/4,milliseconds:xa*24*60*60*1e3/4},months:{weeks:on/7,days:on,hours:on*24,minutes:on*24*60,seconds:on*24*60*60,milliseconds:on*24*60*60*1e3},...Nl},Tn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ui=Tn.slice(0).reverse();function Ta(g,i,m=!1){const v={values:m?i.values:{...g.values,...i.values||{}},loc:g.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||g.conversionAccuracy,matrix:i.matrix||g.matrix};return new Pe(v)}function ci(g,i){var m;let v=(m=i.milliseconds)!=null?m:0;for(const w of ui.slice(1))i[w]&&(v+=i[w]*g[w].milliseconds);return v}function oi(g,i){const m=ci(g,i)<0?-1:1;Tn.reduceRight((v,w)=>{if(Oe(i[w]))return v;if(v){const D=i[v]*m,H=g[w][v],q=Math.floor(D/H);i[w]+=q*m,i[v]-=q*H*m}return w},null),Tn.reduce((v,w)=>{if(Oe(i[w]))return v;if(v){const D=i[v]%1;i[v]-=D,i[w]+=D*g[v][w]}return w},null)}function di(g){const i={};for(const[m,v]of Object.entries(g))v!==0&&(i[m]=v);return i}class Pe{constructor(i){const m=i.conversionAccuracy==="longterm"||!1;let v=m?qu:ps;i.matrix&&(v=i.matrix),this.values=i.values,this.loc=i.loc||Qe.create(),this.conversionAccuracy=m?"longterm":"casual",this.invalid=i.invalid||null,this.matrix=v,this.isLuxonDuration=!0}static fromMillis(i,m){return Pe.fromObject({milliseconds:i},m)}static fromObject(i,m={}){if(i==null||typeof i!="object")throw new b(`Duration.fromObject: argument expected to be an object, got ${i===null?"null":typeof i}`);return new Pe({values:rn(i,Pe.normalizeUnit),loc:Qe.fromObject(m),conversionAccuracy:m.conversionAccuracy,matrix:m.matrix})}static fromDurationLike(i){if(ga(i))return Pe.fromMillis(i);if(Pe.isDuration(i))return i;if(typeof i=="object")return Pe.fromObject(i);throw new b(`Unknown duration argument ${i} of type ${typeof i}`)}static fromISO(i,m){const[v]=Uu(i);return v?Pe.fromObject(v,m):Pe.invalid("unparsable",`the input "${i}" can't be parsed as ISO 8601`)}static fromISOTime(i,m){const[v]=bl(i);return v?Pe.fromObject(v,m):Pe.invalid("unparsable",`the input "${i}" can't be parsed as ISO 8601`)}static invalid(i,m=null){if(!i)throw new b("need to specify a reason the Duration is invalid");const v=i instanceof ma?i:new ma(i,m);if(ht.throwOnInvalid)throw new c(v);return new Pe({invalid:v})}static normalizeUnit(i){const m={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[i&&i.toLowerCase()];if(!m)throw new h(i);return m}static isDuration(i){return i&&i.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(i,m={}){const v={...m,floor:m.round!==!1&&m.floor!==!1};return this.isValid?Yt.create(this.loc,v).formatDurationFromString(this,i):ii}toHuman(i={}){if(!this.isValid)return ii;const m=i.showZeros!==!1,v=Tn.map(w=>{const D=this.values[w];return Oe(D)||D===0&&!m?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...i,unit:w.slice(0,-1)}).format(D)}).filter(w=>w);return this.loc.listFormatter({type:"conjunction",style:i.listStyle||"narrow",...i}).format(v)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let i="P";return this.years!==0&&(i+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(i+=this.months+this.quarters*3+"M"),this.weeks!==0&&(i+=this.weeks+"W"),this.days!==0&&(i+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(i+="T"),this.hours!==0&&(i+=this.hours+"H"),this.minutes!==0&&(i+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(i+=as(this.seconds+this.milliseconds/1e3,3)+"S"),i==="P"&&(i+="T0S"),i}toISOTime(i={}){if(!this.isValid)return null;const m=this.toMillis();return m<0||m>=864e5?null:(i={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...i,includeOffset:!1},Ee.fromMillis(m,{zone:"UTC"}).toISOTime(i))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?ci(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(i){if(!this.isValid)return this;const m=Pe.fromDurationLike(i),v={};for(const w of Tn)(Ln(m.values,w)||Ln(this.values,w))&&(v[w]=m.get(w)+this.get(w));return Ta(this,{values:v},!0)}minus(i){if(!this.isValid)return this;const m=Pe.fromDurationLike(i);return this.plus(m.negate())}mapUnits(i){if(!this.isValid)return this;const m={};for(const v of Object.keys(this.values))m[v]=ei(i(this.values[v],v));return Ta(this,{values:m},!0)}get(i){return this[Pe.normalizeUnit(i)]}set(i){if(!this.isValid)return this;const m={...this.values,...rn(i,Pe.normalizeUnit)};return Ta(this,{values:m})}reconfigure({locale:i,numberingSystem:m,conversionAccuracy:v,matrix:w}={}){const H={loc:this.loc.clone({locale:i,numberingSystem:m}),matrix:w,conversionAccuracy:v};return Ta(this,H)}as(i){return this.isValid?this.shiftTo(i).get(i):NaN}normalize(){if(!this.isValid)return this;const i=this.toObject();return oi(this.matrix,i),Ta(this,{values:i},!0)}rescale(){if(!this.isValid)return this;const i=di(this.normalize().shiftToAll().toObject());return Ta(this,{values:i},!0)}shiftTo(...i){if(!this.isValid)return this;if(i.length===0)return this;i=i.map(H=>Pe.normalizeUnit(H));const m={},v={},w=this.toObject();let D;for(const H of Tn)if(i.indexOf(H)>=0){D=H;let q=0;for(const fe in v)q+=this.matrix[fe][H]*v[fe],v[fe]=0;ga(w[H])&&(q+=w[H]);const Y=Math.trunc(q);m[H]=Y,v[H]=(q*1e3-Y*1e3)/1e3}else ga(w[H])&&(v[H]=w[H]);for(const H in v)v[H]!==0&&(m[D]+=H===D?v[H]:v[H]/this.matrix[D][H]);return oi(this.matrix,m),Ta(this,{values:m},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const i={};for(const m of Object.keys(this.values))i[m]=this.values[m]===0?0:-this.values[m];return Ta(this,{values:i},!0)}removeZeros(){if(!this.isValid)return this;const i=di(this.values);return Ta(this,{values:i},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(i){if(!this.isValid||!i.isValid||!this.loc.equals(i.loc))return!1;function m(v,w){return v===void 0||v===0?w===void 0||w===0:v===w}for(const v of Tn)if(!m(this.values[v],i.values[v]))return!1;return!0}}const Sl="Invalid Interval";function Bo(g,i){return!g||!g.isValid?gt.invalid("missing or invalid start"):!i||!i.isValid?gt.invalid("missing or invalid end"):i<g?gt.invalid("end before start",`The end of an interval must be after its start, but you had start=${g.toISO()} and end=${i.toISO()}`):null}class gt{constructor(i){this.s=i.start,this.e=i.end,this.invalid=i.invalid||null,this.isLuxonInterval=!0}static invalid(i,m=null){if(!i)throw new b("need to specify a reason the Interval is invalid");const v=i instanceof ma?i:new ma(i,m);if(ht.throwOnInvalid)throw new d(v);return new gt({invalid:v})}static fromDateTimes(i,m){const v=ya(i),w=ya(m),D=Bo(v,w);return D??new gt({start:v,end:w})}static after(i,m){const v=Pe.fromDurationLike(m),w=ya(i);return gt.fromDateTimes(w,w.plus(v))}static before(i,m){const v=Pe.fromDurationLike(m),w=ya(i);return gt.fromDateTimes(w.minus(v),w)}static fromISO(i,m){const[v,w]=(i||"").split("/",2);if(v&&w){let D,H;try{D=Ee.fromISO(v,m),H=D.isValid}catch{H=!1}let q,Y;try{q=Ee.fromISO(w,m),Y=q.isValid}catch{Y=!1}if(H&&Y)return gt.fromDateTimes(D,q);if(H){const fe=Pe.fromISO(w,m);if(fe.isValid)return gt.after(D,fe)}else if(Y){const fe=Pe.fromISO(v,m);if(fe.isValid)return gt.before(q,fe)}}return gt.invalid("unparsable",`the input "${i}" can't be parsed as ISO 8601`)}static isInterval(i){return i&&i.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(i="milliseconds"){return this.isValid?this.toDuration(i).get(i):NaN}count(i="milliseconds",m){if(!this.isValid)return NaN;const v=this.start.startOf(i,m);let w;return m!=null&&m.useLocaleWeeks?w=this.end.reconfigure({locale:v.locale}):w=this.end,w=w.startOf(i,m),Math.floor(w.diff(v,i).get(i))+(w.valueOf()!==this.end.valueOf())}hasSame(i){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,i):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(i){return this.isValid?this.s>i:!1}isBefore(i){return this.isValid?this.e<=i:!1}contains(i){return this.isValid?this.s<=i&&this.e>i:!1}set({start:i,end:m}={}){return this.isValid?gt.fromDateTimes(i||this.s,m||this.e):this}splitAt(...i){if(!this.isValid)return[];const m=i.map(ya).filter(H=>this.contains(H)).sort((H,q)=>H.toMillis()-q.toMillis()),v=[];let{s:w}=this,D=0;for(;w<this.e;){const H=m[D]||this.e,q=+H>+this.e?this.e:H;v.push(gt.fromDateTimes(w,q)),w=q,D+=1}return v}splitBy(i){const m=Pe.fromDurationLike(i);if(!this.isValid||!m.isValid||m.as("milliseconds")===0)return[];let{s:v}=this,w=1,D;const H=[];for(;v<this.e;){const q=this.start.plus(m.mapUnits(Y=>Y*w));D=+q>+this.e?this.e:q,H.push(gt.fromDateTimes(v,D)),v=D,w+=1}return H}divideEqually(i){return this.isValid?this.splitBy(this.length()/i).slice(0,i):[]}overlaps(i){return this.e>i.s&&this.s<i.e}abutsStart(i){return this.isValid?+this.e==+i.s:!1}abutsEnd(i){return this.isValid?+i.e==+this.s:!1}engulfs(i){return this.isValid?this.s<=i.s&&this.e>=i.e:!1}equals(i){return!this.isValid||!i.isValid?!1:this.s.equals(i.s)&&this.e.equals(i.e)}intersection(i){if(!this.isValid)return this;const m=this.s>i.s?this.s:i.s,v=this.e<i.e?this.e:i.e;return m>=v?null:gt.fromDateTimes(m,v)}union(i){if(!this.isValid)return this;const m=this.s<i.s?this.s:i.s,v=this.e>i.e?this.e:i.e;return gt.fromDateTimes(m,v)}static merge(i){const[m,v]=i.sort((w,D)=>w.s-D.s).reduce(([w,D],H)=>D?D.overlaps(H)||D.abutsStart(H)?[w,D.union(H)]:[w.concat([D]),H]:[w,H],[[],null]);return v&&m.push(v),m}static xor(i){let m=null,v=0;const w=[],D=i.map(Y=>[{time:Y.s,type:"s"},{time:Y.e,type:"e"}]),H=Array.prototype.concat(...D),q=H.sort((Y,fe)=>Y.time-fe.time);for(const Y of q)v+=Y.type==="s"?1:-1,v===1?m=Y.time:(m&&+m!=+Y.time&&w.push(gt.fromDateTimes(m,Y.time)),m=null);return gt.merge(w)}difference(...i){return gt.xor([this].concat(i)).map(m=>this.intersection(m)).filter(m=>m&&!m.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Sl}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(i=T,m={}){return this.isValid?Yt.create(this.s.loc.clone(m),i).formatInterval(this):Sl}toISO(i){return this.isValid?`${this.s.toISO(i)}/${this.e.toISO(i)}`:Sl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Sl}toISOTime(i){return this.isValid?`${this.s.toISOTime(i)}/${this.e.toISOTime(i)}`:Sl}toFormat(i,{separator:m=" – "}={}){return this.isValid?`${this.s.toFormat(i)}${m}${this.e.toFormat(i)}`:Sl}toDuration(i,m){return this.isValid?this.e.diff(this.s,i,m):Pe.invalid(this.invalidReason)}mapEndpoints(i){return gt.fromDateTimes(i(this.s),i(this.e))}}class ys{static hasDST(i=ht.defaultZone){const m=Ee.now().setZone(i).set({month:12});return!i.isUniversal&&m.offset!==m.set({month:6}).offset}static isValidIANAZone(i){return xe.isValidZone(i)}static normalizeZone(i){return At(i,ht.defaultZone)}static getStartOfWeek({locale:i=null,locObj:m=null}={}){return(m||Qe.create(i)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:i=null,locObj:m=null}={}){return(m||Qe.create(i)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:i=null,locObj:m=null}={}){return(m||Qe.create(i)).getWeekendDays().slice()}static months(i="long",{locale:m=null,numberingSystem:v=null,locObj:w=null,outputCalendar:D="gregory"}={}){return(w||Qe.create(m,v,D)).months(i)}static monthsFormat(i="long",{locale:m=null,numberingSystem:v=null,locObj:w=null,outputCalendar:D="gregory"}={}){return(w||Qe.create(m,v,D)).months(i,!0)}static weekdays(i="long",{locale:m=null,numberingSystem:v=null,locObj:w=null}={}){return(w||Qe.create(m,v,null)).weekdays(i)}static weekdaysFormat(i="long",{locale:m=null,numberingSystem:v=null,locObj:w=null}={}){return(w||Qe.create(m,v,null)).weekdays(i,!0)}static meridiems({locale:i=null}={}){return Qe.create(i).meridiems()}static eras(i="short",{locale:m=null}={}){return Qe.create(m,null,"gregory").eras(i)}static features(){return{relative:Xr(),localeWeek:Sn()}}}function la(g,i){const m=w=>w.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),v=m(i)-m(g);return Math.floor(Pe.fromMillis(v).as("days"))}function bs(g,i,m){const v=[["years",(Y,fe)=>fe.year-Y.year],["quarters",(Y,fe)=>fe.quarter-Y.quarter+(fe.year-Y.year)*4],["months",(Y,fe)=>fe.month-Y.month+(fe.year-Y.year)*12],["weeks",(Y,fe)=>{const ye=la(Y,fe);return(ye-ye%7)/7}],["days",la]],w={},D=g;let H,q;for(const[Y,fe]of v)m.indexOf(Y)>=0&&(H=Y,w[Y]=fe(g,i),q=D.plus(w),q>i?(w[Y]--,g=D.plus(w),g>i&&(q=g,w[Y]--,g=D.plus(w))):g=q);return[g,w,q,H]}function Vu(g,i,m,v){let[w,D,H,q]=bs(g,i,m);const Y=i-w,fe=m.filter(Ue=>["hours","minutes","seconds","milliseconds"].indexOf(Ue)>=0);fe.length===0&&(H<i&&(H=w.plus({[q]:1})),H!==w&&(D[q]=(D[q]||0)+Y/(H-w)));const ye=Pe.fromObject(D,v);return fe.length>0?Pe.fromMillis(Y,v).shiftTo(...fe).plus(ye):ye}const Bu="missing Intl.DateTimeFormat.formatToParts support";function Ie(g,i=m=>m){return{regex:g,deser:([m])=>i(tt(m))}}const ur="[  ]",Yu=new RegExp(ur,"g");function jl(g){return g.replace(/\./g,"\\.?").replace(Yu,ur)}function cr(g){return g.replace(/\./g,"").replace(Yu," ").toLowerCase()}function Jt(g,i){return g===null?null:{regex:RegExp(g.map(jl).join("|")),deser:([m])=>g.findIndex(v=>cr(m)===cr(v))+i}}function or(g,i){return{regex:g,deser:([,m,v])=>ls(m,v),groups:i}}function Ns(g){return{regex:g,deser:([i])=>i}}function Bn(g){return g.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function wl(g,i){const m=kt(i),v=kt(i,"{2}"),w=kt(i,"{3}"),D=kt(i,"{4}"),H=kt(i,"{6}"),q=kt(i,"{1,2}"),Y=kt(i,"{1,3}"),fe=kt(i,"{1,6}"),ye=kt(i,"{1,9}"),Ue=kt(i,"{2,4}"),$e=kt(i,"{4,6}"),De=Gt=>({regex:RegExp(Bn(Gt.val)),deser:([Cn])=>Cn,literal:!0}),Ft=(Gt=>{if(g.literal)return De(Gt);switch(Gt.val){case"G":return Jt(i.eras("short"),0);case"GG":return Jt(i.eras("long"),0);case"y":return Ie(fe);case"yy":return Ie(Ue,ns);case"yyyy":return Ie(D);case"yyyyy":return Ie($e);case"yyyyyy":return Ie(H);case"M":return Ie(q);case"MM":return Ie(v);case"MMM":return Jt(i.months("short",!0),1);case"MMMM":return Jt(i.months("long",!0),1);case"L":return Ie(q);case"LL":return Ie(v);case"LLL":return Jt(i.months("short",!1),1);case"LLLL":return Jt(i.months("long",!1),1);case"d":return Ie(q);case"dd":return Ie(v);case"o":return Ie(Y);case"ooo":return Ie(w);case"HH":return Ie(v);case"H":return Ie(q);case"hh":return Ie(v);case"h":return Ie(q);case"mm":return Ie(v);case"m":return Ie(q);case"q":return Ie(q);case"qq":return Ie(v);case"s":return Ie(q);case"ss":return Ie(v);case"S":return Ie(Y);case"SSS":return Ie(w);case"u":return Ns(ye);case"uu":return Ns(q);case"uuu":return Ie(m);case"a":return Jt(i.meridiems(),0);case"kkkk":return Ie(D);case"kk":return Ie(Ue,ns);case"W":return Ie(q);case"WW":return Ie(v);case"E":case"c":return Ie(m);case"EEE":return Jt(i.weekdays("short",!1),1);case"EEEE":return Jt(i.weekdays("long",!1),1);case"ccc":return Jt(i.weekdays("short",!0),1);case"cccc":return Jt(i.weekdays("long",!0),1);case"Z":case"ZZ":return or(new RegExp(`([+-]${q.source})(?::(${v.source}))?`),2);case"ZZZ":return or(new RegExp(`([+-]${q.source})(${v.source})?`),2);case"z":return Ns(/[a-z_+-/]{1,256}?/i);case" ":return Ns(/[^\S\n\r]/);default:return De(Gt)}})(g)||{invalidReason:Bu};return Ft.token=g,Ft}const fi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Pu(g,i,m){const{type:v,value:w}=g;if(v==="literal"){const Y=/^\s+$/.test(w);return{literal:!Y,val:Y?" ":w}}const D=i[v];let H=v;v==="hour"&&(i.hour12!=null?H=i.hour12?"hour12":"hour24":i.hourCycle!=null?i.hourCycle==="h11"||i.hourCycle==="h12"?H="hour12":H="hour24":H=m.hour12?"hour12":"hour24");let q=fi[H];if(typeof q=="object"&&(q=q[D]),q)return{literal:!1,val:q}}function Yn(g){return[`^${g.map(m=>m.regex).reduce((m,v)=>`${m}(${v.source})`,"")}$`,g]}function $u(g,i,m){const v=g.match(i);if(v){const w={};let D=1;for(const H in m)if(Ln(m,H)){const q=m[H],Y=q.groups?q.groups+1:1;!q.literal&&q.token&&(w[q.token.val[0]]=q.deser(v.slice(D,D+Y))),D+=Y}return[v,w]}else return[v,{}]}function Fu(g){const i=D=>{switch(D){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let m=null,v;return Oe(g.z)||(m=xe.create(g.z)),Oe(g.Z)||(m||(m=new mt(g.Z)),v=g.Z),Oe(g.q)||(g.M=(g.q-1)*3+1),Oe(g.h)||(g.h<12&&g.a===1?g.h+=12:g.h===12&&g.a===0&&(g.h=0)),g.G===0&&g.y&&(g.y=-g.y),Oe(g.u)||(g.S=Kr(g.u)),[Object.keys(g).reduce((D,H)=>{const q=i(H);return q&&(D[q]=g[H]),D},{}),m,v]}let dr=null;function Po(){return dr||(dr=Ee.fromMillis(1555555555555)),dr}function $o(g,i){if(g.literal)return g;const m=Yt.macroTokenToFormatOpts(g.val),v=va(m,i);return v==null||v.includes(void 0)?g:v}function Gu(g,i){return Array.prototype.concat(...g.map(m=>$o(m,i)))}class hi{constructor(i,m){if(this.locale=i,this.format=m,this.tokens=Gu(Yt.parseFormat(m),i),this.units=this.tokens.map(v=>wl(v,i)),this.disqualifyingUnit=this.units.find(v=>v.invalidReason),!this.disqualifyingUnit){const[v,w]=Yn(this.units);this.regex=RegExp(v,"i"),this.handlers=w}}explainFromTokens(i){if(this.isValid){const[m,v]=$u(i,this.regex,this.handlers),[w,D,H]=v?Fu(v):[null,null,void 0];if(Ln(v,"a")&&Ln(v,"H"))throw new f("Can't include meridiem when specifying 24-hour format");return{input:i,tokens:this.tokens,regex:this.regex,rawMatches:m,matches:v,result:w,zone:D,specificOffset:H}}else return{input:i,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function mi(g,i,m){return new hi(g,m).explainFromTokens(i)}function gi(g,i,m){const{result:v,zone:w,specificOffset:D,invalidReason:H}=mi(g,i,m);return[v,w,D,H]}function va(g,i){if(!g)return null;const v=Yt.create(i,g).dtFormatter(Po()),w=v.formatToParts(),D=v.resolvedOptions();return w.map(H=>Pu(H,g,D))}const El="Invalid DateTime",ca=864e13;function Ha(g){return new ma("unsupported zone",`the zone "${g.name}" is not supported`)}function Ss(g){return g.weekData===null&&(g.weekData=Bt(g.c)),g.weekData}function Tl(g){return g.localWeekData===null&&(g.localWeekData=Bt(g.c,g.loc.getMinDaysInFirstWeek(),g.loc.getStartOfWeek())),g.localWeekData}function qa(g,i){const m={ts:g.ts,zone:g.zone,c:g.c,o:g.o,loc:g.loc,invalid:g.invalid};return new Ee({...m,...i,old:m})}function fr(g,i,m){let v=g-i*60*1e3;const w=m.offset(v);if(i===w)return[v,i];v-=(w-i)*60*1e3;const D=m.offset(v);return w===D?[v,w]:[g-Math.min(w,D)*60*1e3,Math.max(w,D)]}function Va(g,i){g+=i*60*1e3;const m=new Date(g);return{year:m.getUTCFullYear(),month:m.getUTCMonth()+1,day:m.getUTCDate(),hour:m.getUTCHours(),minute:m.getUTCMinutes(),second:m.getUTCSeconds(),millisecond:m.getUTCMilliseconds()}}function js(g,i,m){return fr(Xt(g),i,m)}function ws(g,i){const m=g.o,v=g.c.year+Math.trunc(i.years),w=g.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,D={...g.c,year:v,month:w,day:Math.min(g.c.day,Ks(v,w))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},H=Pe.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),q=Xt(D);let[Y,fe]=fr(q,m,g.zone);return H!==0&&(Y+=H,fe=g.zone.offset(Y)),{ts:Y,o:fe}}function Ca(g,i,m,v,w,D){const{setZone:H,zone:q}=m;if(g&&Object.keys(g).length!==0||i){const Y=i||q,fe=Ee.fromObject(g,{...m,zone:Y,specificOffset:D});return H?fe:fe.setZone(q)}else return Ee.invalid(new ma("unparsable",`the input "${w}" can't be parsed as ${v}`))}function hr(g,i,m=!0){return g.isValid?Yt.create(Qe.create("en-US"),{allowZ:m,forceSimple:!0}).formatDateTimeFromString(g,i):null}function Kt(g,i,m){const v=g.c.year>9999||g.c.year<0;let w="";if(v&&g.c.year>=0&&(w+="+"),w+=at(g.c.year,v?6:4),m==="year")return w;if(i){if(w+="-",w+=at(g.c.month),m==="month")return w;w+="-"}else if(w+=at(g.c.month),m==="month")return w;return w+=at(g.c.day),w}function mr(g,i,m,v,w,D,H){let q=!m||g.c.millisecond!==0||g.c.second!==0,Y="";switch(H){case"day":case"month":case"year":break;default:if(Y+=at(g.c.hour),H==="hour")break;if(i){if(Y+=":",Y+=at(g.c.minute),H==="minute")break;q&&(Y+=":",Y+=at(g.c.second))}else{if(Y+=at(g.c.minute),H==="minute")break;q&&(Y+=at(g.c.second))}if(H==="second")break;q&&(!v||g.c.millisecond!==0)&&(Y+=".",Y+=at(g.c.millisecond,3))}return w&&(g.isOffsetFixed&&g.offset===0&&!D?Y+="Z":g.o<0?(Y+="-",Y+=at(Math.trunc(-g.o/60)),Y+=":",Y+=at(Math.trunc(-g.o%60))):(Y+="+",Y+=at(Math.trunc(g.o/60)),Y+=":",Y+=at(Math.trunc(g.o%60)))),D&&(Y+="["+g.zone.ianaName+"]"),Y}const Ba={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Zu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},gr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ya=["year","month","day","hour","minute","second","millisecond"],xi=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Wu=["year","ordinal","hour","minute","second","millisecond"];function Cl(g){const i={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[g.toLowerCase()];if(!i)throw new h(g);return i}function vi(g){switch(g.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Cl(g)}}function pa(g){if(dn===void 0&&(dn=ht.now()),g.type!=="iana")return g.offset(dn);const i=g.name;let m=sa.get(i);return m===void 0&&(m=g.offset(dn),sa.set(i,m)),m}function Pn(g,i){const m=At(i.zone,ht.defaultZone);if(!m.isValid)return Ee.invalid(Ha(m));const v=Qe.fromObject(i);let w,D;if(Oe(g.year))w=ht.now();else{for(const Y of Ya)Oe(g[Y])&&(g[Y]=Ba[Y]);const H=Xs(g)||Un(g);if(H)return Ee.invalid(H);const q=pa(m);[w,D]=js(g,q,m)}return new Ee({ts:w,zone:m,loc:v,o:D})}function $n(g,i,m){const v=Oe(m.round)?!0:m.round,w=Oe(m.rounding)?"trunc":m.rounding,D=(q,Y)=>(q=as(q,v||m.calendary?0:2,m.calendary?"round":w),i.loc.clone(m).relFormatter(m).format(q,Y)),H=q=>m.calendary?i.hasSame(g,q)?0:i.startOf(q).diff(g.startOf(q),q).get(q):i.diff(g,q).get(q);if(m.unit)return D(H(m.unit),m.unit);for(const q of m.units){const Y=H(q);if(Math.abs(Y)>=1)return D(Y,q)}return D(g>i?-0:0,m.units[m.units.length-1])}function Es(g){let i={},m;return g.length>0&&typeof g[g.length-1]=="object"?(i=g[g.length-1],m=Array.from(g).slice(0,g.length-1)):m=Array.from(g),[i,m]}let dn;const sa=new Map;class Ee{constructor(i){const m=i.zone||ht.defaultZone;let v=i.invalid||(Number.isNaN(i.ts)?new ma("invalid input"):null)||(m.isValid?null:Ha(m));this.ts=Oe(i.ts)?ht.now():i.ts;let w=null,D=null;if(!v)if(i.old&&i.old.ts===this.ts&&i.old.zone.equals(m))[w,D]=[i.old.c,i.old.o];else{const q=ga(i.o)&&!i.old?i.o:m.offset(this.ts);w=Va(this.ts,q),v=Number.isNaN(w.year)?new ma("invalid input"):null,w=v?null:w,D=v?null:q}this._zone=m,this.loc=i.loc||Qe.create(),this.invalid=v,this.weekData=null,this.localWeekData=null,this.c=w,this.o=D,this.isLuxonDateTime=!0}static now(){return new Ee({})}static local(){const[i,m]=Es(arguments),[v,w,D,H,q,Y,fe]=m;return Pn({year:v,month:w,day:D,hour:H,minute:q,second:Y,millisecond:fe},i)}static utc(){const[i,m]=Es(arguments),[v,w,D,H,q,Y,fe]=m;return i.zone=mt.utcInstance,Pn({year:v,month:w,day:D,hour:H,minute:q,second:Y,millisecond:fe},i)}static fromJSDate(i,m={}){const v=ju(i)?i.valueOf():NaN;if(Number.isNaN(v))return Ee.invalid("invalid input");const w=At(m.zone,ht.defaultZone);return w.isValid?new Ee({ts:v,zone:w,loc:Qe.fromObject(m)}):Ee.invalid(Ha(w))}static fromMillis(i,m={}){if(ga(i))return i<-ca||i>ca?Ee.invalid("Timestamp out of range"):new Ee({ts:i,zone:At(m.zone,ht.defaultZone),loc:Qe.fromObject(m)});throw new b(`fromMillis requires a numerical input, but received a ${typeof i} with value ${i}`)}static fromSeconds(i,m={}){if(ga(i))return new Ee({ts:i*1e3,zone:At(m.zone,ht.defaultZone),loc:Qe.fromObject(m)});throw new b("fromSeconds requires a numerical input")}static fromObject(i,m={}){i=i||{};const v=At(m.zone,ht.defaultZone);if(!v.isValid)return Ee.invalid(Ha(v));const w=Qe.fromObject(m),D=rn(i,vi),{minDaysInFirstWeek:H,startOfWeek:q}=Nu(D,w),Y=ht.now(),fe=Oe(m.specificOffset)?v.offset(Y):m.specificOffset,ye=!Oe(D.ordinal),Ue=!Oe(D.year),$e=!Oe(D.month)||!Oe(D.day),De=Ue||$e,yt=D.weekYear||D.weekNumber;if((De||ye)&&yt)throw new f("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if($e&&ye)throw new f("Can't mix ordinal dates with month/day");const Ft=yt||D.weekday&&!De;let Gt,Cn,fn=Va(Y,fe);Ft?(Gt=xi,Cn=Zu,fn=Bt(fn,H,q)):ye?(Gt=Wu,Cn=gr,fn=es(fn)):(Gt=Ya,Cn=Ba);let xr=!1;for(const Fa of Gt){const vr=D[Fa];Oe(vr)?xr?D[Fa]=Cn[Fa]:D[Fa]=fn[Fa]:xr=!0}const Fn=Ft?Su(D,H,q):ye?ts(D):Xs(D),$a=Fn||Un(D);if($a)return Ee.invalid($a);const Mn=Ft?zn(D,H,q):ye?bu(D):D,[hn,pi]=js(Mn,fe,v),Gn=new Ee({ts:hn,zone:v,o:pi,loc:w});return D.weekday&&De&&i.weekday!==Gn.weekday?Ee.invalid("mismatched weekday",`you can't specify both a weekday of ${D.weekday} and a date of ${Gn.toISO()}`):Gn.isValid?Gn:Ee.invalid(Gn.invalid)}static fromISO(i,m={}){const[v,w]=_u(i);return Ca(v,w,m,"ISO 8601",i)}static fromRFC2822(i,m={}){const[v,w]=ku(i);return Ca(v,w,m,"RFC 2822",i)}static fromHTTP(i,m={}){const[v,w]=zu(i);return Ca(v,w,m,"HTTP",m)}static fromFormat(i,m,v={}){if(Oe(i)||Oe(m))throw new b("fromFormat requires an input string and a format");const{locale:w=null,numberingSystem:D=null}=v,H=Qe.fromOpts({locale:w,numberingSystem:D,defaultToEN:!0}),[q,Y,fe,ye]=gi(H,i,m);return ye?Ee.invalid(ye):Ca(q,Y,v,`format ${m}`,i,fe)}static fromString(i,m,v={}){return Ee.fromFormat(i,m,v)}static fromSQL(i,m={}){const[v,w]=Hu(i);return Ca(v,w,m,"SQL",i)}static invalid(i,m=null){if(!i)throw new b("need to specify a reason the DateTime is invalid");const v=i instanceof ma?i:new ma(i,m);if(ht.throwOnInvalid)throw new r(v);return new Ee({invalid:v})}static isDateTime(i){return i&&i.isLuxonDateTime||!1}static parseFormatForOpts(i,m={}){const v=va(i,Qe.fromObject(m));return v?v.map(w=>w?w.val:null).join(""):null}static expandFormat(i,m={}){return Gu(Yt.parseFormat(i),Qe.fromObject(m)).map(w=>w.val).join("")}static resetCache(){dn=void 0,sa.clear()}get(i){return this[i]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ss(this).weekYear:NaN}get weekNumber(){return this.isValid?Ss(this).weekNumber:NaN}get weekday(){return this.isValid?Ss(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Tl(this).weekday:NaN}get localWeekNumber(){return this.isValid?Tl(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Tl(this).weekYear:NaN}get ordinal(){return this.isValid?es(this.c).ordinal:NaN}get monthShort(){return this.isValid?ys.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ys.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ys.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ys.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const i=864e5,m=6e4,v=Xt(this.c),w=this.zone.offset(v-i),D=this.zone.offset(v+i),H=this.zone.offset(v-w*m),q=this.zone.offset(v-D*m);if(H===q)return[this];const Y=v-H*m,fe=v-q*m,ye=Va(Y,H),Ue=Va(fe,q);return ye.hour===Ue.hour&&ye.minute===Ue.minute&&ye.second===Ue.second&&ye.millisecond===Ue.millisecond?[qa(this,{ts:Y}),qa(this,{ts:fe})]:[this]}get isInLeapYear(){return ml(this.year)}get daysInMonth(){return Ks(this.year,this.month)}get daysInYear(){return this.isValid?sn(this.year):NaN}get weeksInWeekYear(){return this.isValid?gl(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?gl(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(i={}){const{locale:m,numberingSystem:v,calendar:w}=Yt.create(this.loc.clone(i),i).resolvedOptions(this);return{locale:m,numberingSystem:v,outputCalendar:w}}toUTC(i=0,m={}){return this.setZone(mt.instance(i),m)}toLocal(){return this.setZone(ht.defaultZone)}setZone(i,{keepLocalTime:m=!1,keepCalendarTime:v=!1}={}){if(i=At(i,ht.defaultZone),i.equals(this.zone))return this;if(i.isValid){let w=this.ts;if(m||v){const D=i.offset(this.ts),H=this.toObject();[w]=js(H,D,i)}return qa(this,{ts:w,zone:i})}else return Ee.invalid(Ha(i))}reconfigure({locale:i,numberingSystem:m,outputCalendar:v}={}){const w=this.loc.clone({locale:i,numberingSystem:m,outputCalendar:v});return qa(this,{loc:w})}setLocale(i){return this.reconfigure({locale:i})}set(i){if(!this.isValid)return this;const m=rn(i,vi),{minDaysInFirstWeek:v,startOfWeek:w}=Nu(m,this.loc),D=!Oe(m.weekYear)||!Oe(m.weekNumber)||!Oe(m.weekday),H=!Oe(m.ordinal),q=!Oe(m.year),Y=!Oe(m.month)||!Oe(m.day),fe=q||Y,ye=m.weekYear||m.weekNumber;if((fe||H)&&ye)throw new f("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Y&&H)throw new f("Can't mix ordinal dates with month/day");let Ue;D?Ue=zn({...Bt(this.c,v,w),...m},v,w):Oe(m.ordinal)?(Ue={...this.toObject(),...m},Oe(m.day)&&(Ue.day=Math.min(Ks(Ue.year,Ue.month),Ue.day))):Ue=bu({...es(this.c),...m});const[$e,De]=js(Ue,this.o,this.zone);return qa(this,{ts:$e,o:De})}plus(i){if(!this.isValid)return this;const m=Pe.fromDurationLike(i);return qa(this,ws(this,m))}minus(i){if(!this.isValid)return this;const m=Pe.fromDurationLike(i).negate();return qa(this,ws(this,m))}startOf(i,{useLocaleWeeks:m=!1}={}){if(!this.isValid)return this;const v={},w=Pe.normalizeUnit(i);switch(w){case"years":v.month=1;case"quarters":case"months":v.day=1;case"weeks":case"days":v.hour=0;case"hours":v.minute=0;case"minutes":v.second=0;case"seconds":v.millisecond=0;break}if(w==="weeks")if(m){const D=this.loc.getStartOfWeek(),{weekday:H}=this;H<D&&(v.weekNumber=this.weekNumber-1),v.weekday=D}else v.weekday=1;if(w==="quarters"){const D=Math.ceil(this.month/3);v.month=(D-1)*3+1}return this.set(v)}endOf(i,m){return this.isValid?this.plus({[i]:1}).startOf(i,m).minus(1):this}toFormat(i,m={}){return this.isValid?Yt.create(this.loc.redefaultToEN(m)).formatDateTimeFromString(this,i):El}toLocaleString(i=T,m={}){return this.isValid?Yt.create(this.loc.clone(m),i).formatDateTime(this):El}toLocaleParts(i={}){return this.isValid?Yt.create(this.loc.clone(i),i).formatDateTimeParts(this):[]}toISO({format:i="extended",suppressSeconds:m=!1,suppressMilliseconds:v=!1,includeOffset:w=!0,extendedZone:D=!1,precision:H="milliseconds"}={}){if(!this.isValid)return null;H=Cl(H);const q=i==="extended";let Y=Kt(this,q,H);return Ya.indexOf(H)>=3&&(Y+="T"),Y+=mr(this,q,m,v,w,D,H),Y}toISODate({format:i="extended",precision:m="day"}={}){return this.isValid?Kt(this,i==="extended",Cl(m)):null}toISOWeekDate(){return hr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:i=!1,suppressSeconds:m=!1,includeOffset:v=!0,includePrefix:w=!1,extendedZone:D=!1,format:H="extended",precision:q="milliseconds"}={}){return this.isValid?(q=Cl(q),(w&&Ya.indexOf(q)>=3?"T":"")+mr(this,H==="extended",m,i,v,D,q)):null}toRFC2822(){return hr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return hr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Kt(this,!0):null}toSQLTime({includeOffset:i=!0,includeZone:m=!1,includeOffsetSpace:v=!0}={}){let w="HH:mm:ss.SSS";return(m||i)&&(v&&(w+=" "),m?w+="z":i&&(w+="ZZ")),hr(this,w,!0)}toSQL(i={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(i)}`:null}toString(){return this.isValid?this.toISO():El}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(i={}){if(!this.isValid)return{};const m={...this.c};return i.includeConfig&&(m.outputCalendar=this.outputCalendar,m.numberingSystem=this.loc.numberingSystem,m.locale=this.loc.locale),m}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(i,m="milliseconds",v={}){if(!this.isValid||!i.isValid)return Pe.invalid("created by diffing an invalid DateTime");const w={locale:this.locale,numberingSystem:this.numberingSystem,...v},D=hl(m).map(Pe.normalizeUnit),H=i.valueOf()>this.valueOf(),q=H?this:i,Y=H?i:this,fe=Vu(q,Y,D,w);return H?fe.negate():fe}diffNow(i="milliseconds",m={}){return this.diff(Ee.now(),i,m)}until(i){return this.isValid?gt.fromDateTimes(this,i):this}hasSame(i,m,v){if(!this.isValid)return!1;const w=i.valueOf(),D=this.setZone(i.zone,{keepLocalTime:!0});return D.startOf(m,v)<=w&&w<=D.endOf(m,v)}equals(i){return this.isValid&&i.isValid&&this.valueOf()===i.valueOf()&&this.zone.equals(i.zone)&&this.loc.equals(i.loc)}toRelative(i={}){if(!this.isValid)return null;const m=i.base||Ee.fromObject({},{zone:this.zone}),v=i.padding?this<m?-i.padding:i.padding:0;let w=["years","months","days","hours","minutes","seconds"],D=i.unit;return Array.isArray(i.unit)&&(w=i.unit,D=void 0),$n(m,this.plus(v),{...i,numeric:"always",units:w,unit:D})}toRelativeCalendar(i={}){return this.isValid?$n(i.base||Ee.fromObject({},{zone:this.zone}),this,{...i,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...i){if(!i.every(Ee.isDateTime))throw new b("min requires all arguments be DateTimes");return wu(i,m=>m.valueOf(),Math.min)}static max(...i){if(!i.every(Ee.isDateTime))throw new b("max requires all arguments be DateTimes");return wu(i,m=>m.valueOf(),Math.max)}static fromFormatExplain(i,m,v={}){const{locale:w=null,numberingSystem:D=null}=v,H=Qe.fromOpts({locale:w,numberingSystem:D,defaultToEN:!0});return mi(H,i,m)}static fromStringExplain(i,m,v={}){return Ee.fromFormatExplain(i,m,v)}static buildFormatParser(i,m={}){const{locale:v=null,numberingSystem:w=null}=m,D=Qe.fromOpts({locale:v,numberingSystem:w,defaultToEN:!0});return new hi(D,i)}static fromFormatParser(i,m,v={}){if(Oe(i)||Oe(m))throw new b("fromFormatParser requires an input string and a format parser");const{locale:w=null,numberingSystem:D=null}=v,H=Qe.fromOpts({locale:w,numberingSystem:D,defaultToEN:!0});if(!H.equals(m.locale))throw new b(`fromFormatParser called with a locale of ${H}, but the format parser was created for ${m.locale}`);const{result:q,zone:Y,specificOffset:fe,invalidReason:ye}=m.explainFromTokens(i);return ye?Ee.invalid(ye):Ca(q,Y,v,`format ${m.format}`,i,fe)}static get DATE_SHORT(){return T}static get DATE_MED(){return _}static get DATE_MED_WITH_WEEKDAY(){return k}static get DATE_FULL(){return S}static get DATE_HUGE(){return C}static get TIME_SIMPLE(){return A}static get TIME_WITH_SECONDS(){return $}static get TIME_WITH_SHORT_OFFSET(){return B}static get TIME_WITH_LONG_OFFSET(){return M}static get TIME_24_SIMPLE(){return X}static get TIME_24_WITH_SECONDS(){return ie}static get TIME_24_WITH_SHORT_OFFSET(){return F}static get TIME_24_WITH_LONG_OFFSET(){return Z}static get DATETIME_SHORT(){return R}static get DATETIME_SHORT_WITH_SECONDS(){return ee}static get DATETIME_MED(){return O}static get DATETIME_MED_WITH_SECONDS(){return ne}static get DATETIME_MED_WITH_WEEKDAY(){return ae}static get DATETIME_FULL(){return he}static get DATETIME_FULL_WITH_SECONDS(){return pe}static get DATETIME_HUGE(){return re}static get DATETIME_HUGE_WITH_SECONDS(){return P}}function ya(g){if(Ee.isDateTime(g))return g;if(g&&g.valueOf&&ga(g.valueOf()))return Ee.fromJSDate(g);if(g&&typeof g=="object")return Ee.fromObject(g);throw new b(`Unknown datetime argument: ${g}, of type ${typeof g}`)}const Pa="3.7.2";return Ea.DateTime=Ee,Ea.Duration=Pe,Ea.FixedOffsetZone=mt,Ea.IANAZone=xe,Ea.Info=ys,Ea.Interval=gt,Ea.InvalidZone=Vt,Ea.Settings=ht,Ea.SystemZone=me,Ea.VERSION=Pa,Ea.Zone=te,Ea}var Xg;function mh(){return Xg||(Xg=1,(function(l){var h,b,N,y,p,Bf,T,Il;Object.defineProperty(l,"__esModule",{value:!0}),l.CronDate=l.DAYS_IN_MONTH=l.DateMathOp=l.TimeUnit=void 0;const r=NN();var d;(function(S){S.Second="Second",S.Minute="Minute",S.Hour="Hour",S.Day="Day",S.Month="Month",S.Year="Year"})(d||(l.TimeUnit=d={}));var c;(function(S){S.Add="Add",S.Subtract="Subtract"})(c||(l.DateMathOp=c={})),l.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);const k=class k{constructor(C,A){et(this,T);et(this,h);et(this,b,null);et(this,N,null);et(this,y,{add:{[d.Year]:this.addYear.bind(this),[d.Month]:this.addMonth.bind(this),[d.Day]:this.addDay.bind(this),[d.Hour]:this.addHour.bind(this),[d.Minute]:this.addMinute.bind(this),[d.Second]:this.addSecond.bind(this)},subtract:{[d.Year]:this.subtractYear.bind(this),[d.Month]:this.subtractMonth.bind(this),[d.Day]:this.subtractDay.bind(this),[d.Hour]:this.subtractHour.bind(this),[d.Minute]:this.subtractMinute.bind(this),[d.Second]:this.subtractSecond.bind(this)}});const $={zone:A};if(C?C instanceof k?(Ce(this,h,J(C,h)),Ce(this,b,J(C,b)),Ce(this,N,J(C,N))):C instanceof Date?Ce(this,h,r.DateTime.fromJSDate(C,$)):typeof C=="number"?Ce(this,h,r.DateTime.fromMillis(C,$)):(Ce(this,h,r.DateTime.fromISO(C,$)),J(this,h).isValid||Ce(this,h,r.DateTime.fromRFC2822(C,$)),J(this,h).isValid||Ce(this,h,r.DateTime.fromSQL(C,$)),J(this,h).isValid||Ce(this,h,r.DateTime.fromFormat(C,"EEE, d MMM yyyy HH:mm:ss",$))):Ce(this,h,r.DateTime.local()),!J(this,h).isValid)throw new Error(`CronDate: unhandled timestamp: ${C}`);A&&A!==J(this,h).zoneName&&Ce(this,h,J(this,h).setZone(A))}get dstStart(){return J(this,b)}set dstStart(C){Ce(this,b,C)}get dstEnd(){return J(this,N)}set dstEnd(C){Ce(this,N,C)}addYear(){Ce(this,h,J(this,h).plus({years:1}))}addMonth(){Ce(this,h,J(this,h).plus({months:1}).startOf("month"))}addDay(){Ce(this,h,J(this,h).plus({days:1}).startOf("day"))}addHour(){Ce(this,h,J(this,h).plus({hours:1}).startOf("hour"))}addMinute(){Ce(this,h,J(this,h).plus({minutes:1}).startOf("minute"))}addSecond(){Ce(this,h,J(this,h).plus({seconds:1}))}subtractYear(){Ce(this,h,J(this,h).minus({years:1}))}subtractMonth(){Ce(this,h,J(this,h).minus({months:1}).endOf("month").startOf("second"))}subtractDay(){Ce(this,h,J(this,h).minus({days:1}).endOf("day").startOf("second"))}subtractHour(){Ce(this,h,J(this,h).minus({hours:1}).endOf("hour").startOf("second"))}subtractMinute(){Ce(this,h,J(this,h).minus({minutes:1}).endOf("minute").startOf("second"))}subtractSecond(){Ce(this,h,J(this,h).minus({seconds:1}))}addUnit(C){J(this,y).add[C]()}subtractUnit(C){J(this,y).subtract[C]()}invokeDateOperation(C,A){if(C===c.Add){this.addUnit(A);return}if(C===c.Subtract){this.subtractUnit(A);return}throw new Error(`Invalid verb: ${C}`)}getDate(){return J(this,h).day}getFullYear(){return J(this,h).year}getDay(){const C=J(this,h).weekday;return C===7?0:C}getMonth(){return J(this,h).month-1}getHours(){return J(this,h).hour}getMinutes(){return J(this,h).minute}getSeconds(){return J(this,h).second}getMilliseconds(){return J(this,h).millisecond}getUTCOffset(){return J(this,h).offset}setStartOfDay(){Ce(this,h,J(this,h).startOf("day"))}setEndOfDay(){Ce(this,h,J(this,h).endOf("day"))}getTime(){return J(this,h).valueOf()}getUTCDate(){return je(this,T,Il).call(this).day}getUTCFullYear(){return je(this,T,Il).call(this).year}getUTCDay(){const C=je(this,T,Il).call(this).weekday;return C===7?0:C}getUTCMonth(){return je(this,T,Il).call(this).month-1}getUTCHours(){return je(this,T,Il).call(this).hour}getUTCMinutes(){return je(this,T,Il).call(this).minute}getUTCSeconds(){return je(this,T,Il).call(this).second}toISOString(){return J(this,h).toUTC().toISO()}toJSON(){return J(this,h).toJSON()}setDate(C){Ce(this,h,J(this,h).set({day:C}))}setFullYear(C){Ce(this,h,J(this,h).set({year:C}))}setDay(C){Ce(this,h,J(this,h).set({weekday:C}))}setMonth(C){Ce(this,h,J(this,h).set({month:C+1}))}setHours(C){Ce(this,h,J(this,h).set({hour:C}))}setMinutes(C){Ce(this,h,J(this,h).set({minute:C}))}setSeconds(C){Ce(this,h,J(this,h).set({second:C}))}setMilliseconds(C){Ce(this,h,J(this,h).set({millisecond:C}))}toString(){return this.toDate().toString()}toDate(){return J(this,h).toJSDate()}isLastDayOfMonth(){var $;const{day:C,month:A}=J(this,h);if(A===2){const B=je($=k,p,Bf).call($,J(this,h).year);return C===l.DAYS_IN_MONTH[A-1]-(B?0:1)}return C===l.DAYS_IN_MONTH[A-1]}isLastWeekdayOfMonth(){var B;const{day:C,month:A}=J(this,h);let $;return A===2?$=l.DAYS_IN_MONTH[A-1]-(je(B=k,p,Bf).call(B,J(this,h).year)?0:1):$=l.DAYS_IN_MONTH[A-1],C>$-7}applyDateOperation(C,A,$){if(A===d.Month||A===d.Day){this.invokeDateOperation(C,A);return}const B=this.getHours();this.invokeDateOperation(C,A);const M=this.getHours(),X=M-B;X===2?$!==24&&(this.dstStart=M):X===0&&this.getMinutes()===0&&this.getSeconds()===0&&$!==24&&(this.dstEnd=M)}};h=new WeakMap,b=new WeakMap,N=new WeakMap,y=new WeakMap,p=new WeakSet,Bf=function(C){return C%4===0&&C%100!==0||C%400===0},T=new WeakSet,Il=function(){return J(this,h).toUTC()},et(k,p);let f=k;l.CronDate=f,l.default=f})(Af)),Af}var Jg;function SN(){if(Jg)return lu;Jg=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.CronMonth=void 0;const l=mh(),r=Fs(),d=1,c=12,f=Object.freeze([]);let h=class extends r.CronField{static get min(){return d}static get max(){return c}static get chars(){return f}static get daysInMonth(){return l.DAYS_IN_MONTH}constructor(N,y){super(N,y),this.validate()}get values(){return super.values}};return lu.CronMonth=h,lu}var su={},Kg;function jN(){if(Kg)return su;Kg=1,Object.defineProperty(su,"__esModule",{value:!0}),su.CronSecond=void 0;const l=Fs(),r=0,d=59,c=Object.freeze([]);let f=class extends l.CronField{static get min(){return r}static get max(){return d}static get chars(){return c}constructor(b,N){super(b,N),this.validate()}get values(){return super.values}};return su.CronSecond=f,su}var ex;function gh(){return ex||(ex=1,(function(l){var r=Us&&Us.__createBinding||(Object.create?(function(c,f,h,b){b===void 0&&(b=h);var N=Object.getOwnPropertyDescriptor(f,h);(!N||("get"in N?!f.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(c,b,N)}):(function(c,f,h,b){b===void 0&&(b=h),c[b]=f[h]})),d=Us&&Us.__exportStar||function(c,f){for(var h in c)h!=="default"&&!Object.prototype.hasOwnProperty.call(f,h)&&r(f,c,h)};Object.defineProperty(l,"__esModule",{value:!0}),d(xN(),l),d(vN(),l),d(pN(),l),d(Fs(),l),d(yN(),l),d(bN(),l),d(SN(),l),d(jN(),l)})(Us)),Us}var tx;function vv(){var d,c,f,h,b,N,y,p,gv,xv;if(tx)return Ji;tx=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.CronFieldCollection=void 0;const l=gh();let r=(p=class{constructor({second:k,minute:S,hour:C,dayOfMonth:A,month:$,dayOfWeek:B}){et(this,d);et(this,c);et(this,f);et(this,h);et(this,b);et(this,N);if(!k)throw new Error("Validation error, Field second is missing");if(!S)throw new Error("Validation error, Field minute is missing");if(!C)throw new Error("Validation error, Field hour is missing");if(!A)throw new Error("Validation error, Field dayOfMonth is missing");if(!$)throw new Error("Validation error, Field month is missing");if(!B)throw new Error("Validation error, Field dayOfWeek is missing");if($.values.length===1&&!A.hasLastChar&&!(parseInt(A.values[0],10)<=l.CronMonth.daysInMonth[$.values[0]-1]))throw new Error("Invalid explicit day of month definition");Ce(this,d,k),Ce(this,c,S),Ce(this,f,C),Ce(this,b,$),Ce(this,N,B),Ce(this,h,A)}static from(k,S){return new p({second:this.resolveField(l.CronSecond,k.second,S.second),minute:this.resolveField(l.CronMinute,k.minute,S.minute),hour:this.resolveField(l.CronHour,k.hour,S.hour),dayOfMonth:this.resolveField(l.CronDayOfMonth,k.dayOfMonth,S.dayOfMonth),month:this.resolveField(l.CronMonth,k.month,S.month),dayOfWeek:this.resolveField(l.CronDayOfWeek,k.dayOfWeek,S.dayOfWeek)})}static resolveField(k,S,C){return C?C instanceof l.CronField?C:new k(C):S}get second(){return J(this,d)}get minute(){return J(this,c)}get hour(){return J(this,f)}get dayOfMonth(){return J(this,h)}get month(){return J(this,b)}get dayOfWeek(){return J(this,N)}static compactField(k){if(k.length===0)return[];const S=[];let C;return k.forEach((A,$,B)=>{if(C===void 0){C={start:A,count:1};return}const M=B[$-1]||C.start,X=B[$+1];if(A==="L"||A==="W"){S.push(C),S.push({start:A,count:1}),C=void 0;return}if(C.step===void 0&&X!==void 0){const ie=A-M,F=X-A;if(ie<=F){C={...C,count:2,end:A,step:ie};return}C.step=1}A-(C.end??0)===C.step?(C.count++,C.end=A):(C.count===1?S.push({start:C.start,count:1}):C.count===2?(S.push({start:C.start,count:1}),S.push({start:C.end??M,count:1})):S.push(C),C={start:A,count:1})}),C&&S.push(C),S}stringifyField(k){var $;let S=k.max,C=k.values;if(k instanceof l.CronDayOfWeek){S=6;const B=J(this,N).values;C=B[B.length-1]===7?B.slice(0,-1):B}k instanceof l.CronDayOfMonth&&(S=J(this,b).values.length===1?l.CronMonth.daysInMonth[J(this,b).values[0]-1]:k.max);const A=p.compactField(C);if(A.length===1){const B=je($=p,y,gv).call($,k,A[0],S);if(B)return B}return A.map(B=>{var X;const M=B.count===1?B.start.toString():je(X=p,y,xv).call(X,B,S);return k instanceof l.CronDayOfWeek&&k.nthDay>0?`${M}#${k.nthDay}`:M}).join(",")}stringify(k=!1){const S=[];return k&&S.push(this.stringifyField(J(this,d))),S.push(this.stringifyField(J(this,c)),this.stringifyField(J(this,f)),this.stringifyField(J(this,h)),this.stringifyField(J(this,b)),this.stringifyField(J(this,N))),S.join(" ")}serialize(){return{second:J(this,d).serialize(),minute:J(this,c).serialize(),hour:J(this,f).serialize(),dayOfMonth:J(this,h).serialize(),month:J(this,b).serialize(),dayOfWeek:J(this,N).serialize()}}},d=new WeakMap,c=new WeakMap,f=new WeakMap,h=new WeakMap,b=new WeakMap,N=new WeakMap,y=new WeakSet,gv=function(k,S,C){const A=S.step;return A?A===1&&S.start===k.min&&S.end&&S.end>=C?k.hasQuestionMarkChar?"?":"*":A!==1&&S.start===k.min&&S.end&&S.end>=C-A+1?`*/${A}`:null:null},xv=function(k,S){const C=k.step;if(C===1)return`${k.start}-${k.end}`;const A=k.start===0?k.count-1:k.count;if(!C)throw new Error("Unexpected range step");if(!k.end)throw new Error("Unexpected range end");if(C*A>k.end){const $=(M,X)=>{if(typeof k.start!="number")throw new Error("Unexpected range start");return X%C===0?k.start+X:null};if(typeof k.start!="number")throw new Error("Unexpected range start");const B={length:k.end-k.start+1};return Array.from(B,$).filter(M=>M!==null).join(",")}return k.end===S-C+1?`${k.start}/${C}`:`${k.start}-${k.end}/${C}`},et(p,y),p);return Ji.CronFieldCollection=r,Ji}var _f={},ax;function wv(){return ax||(ax=1,(function(l){var f,h,b,N,y,p,j,T,_,Xl,S,qs,pv,yv,bv,Nv,Yf,Sv,jv,qr;Object.defineProperty(l,"__esModule",{value:!0}),l.CronExpression=l.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=l.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const r=mh();l.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",l.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const d=1e4,R=class R{constructor(O,ne){et(this,S);et(this,f);et(this,h);et(this,b);et(this,N);et(this,y);et(this,p);et(this,j,null);et(this,T,!1);Ce(this,f,ne),Ce(this,h,ne.tz),Ce(this,N,ne.startDate?new r.CronDate(ne.startDate,J(this,h)):null),Ce(this,y,ne.endDate?new r.CronDate(ne.endDate,J(this,h)):null);let ae=ne.currentDate??ne.startDate;if(ae){const he=new r.CronDate(ae,J(this,h));J(this,N)&&he.getTime()<J(this,N).getTime()?ae=J(this,N):J(this,y)&&he.getTime()>J(this,y).getTime()&&(ae=J(this,y))}Ce(this,b,new r.CronDate(ae,J(this,h))),Ce(this,p,O)}get fields(){return J(this,p)}static fieldsToExpression(O,ne){return new R(O,ne||{})}next(){return je(this,S,qr).call(this)}prev(){return je(this,S,qr).call(this,!0)}hasNext(){const O=J(this,b);try{return je(this,S,qr).call(this),!0}catch{return!1}finally{Ce(this,b,O)}}hasPrev(){const O=J(this,b);try{return je(this,S,qr).call(this,!0),!0}catch{return!1}finally{Ce(this,b,O)}}take(O){const ne=[];if(O>=0)for(let ae=0;ae<O;ae++)try{ne.push(this.next())}catch{return ne}else for(let ae=0;ae>O;ae--)try{ne.push(this.prev())}catch{return ne}return ne}reset(O){Ce(this,b,new r.CronDate(O||J(this,f).currentDate))}stringify(O=!1){return J(this,p).stringify(O)}includesDate(O){const{second:ne,minute:ae,hour:he,month:pe}=J(this,p),re=new r.CronDate(O,J(this,h));return!(!ne.values.includes(re.getSeconds())||!ae.values.includes(re.getMinutes())||!he.values.includes(re.getHours())||!pe.values.includes(re.getMonth()+1)||!je(this,S,Yf).call(this,re)||J(this,p).dayOfWeek.nthDay>0&&Math.ceil(re.getDate()/7)!==J(this,p).dayOfWeek.nthDay)}toString(){return J(this,f).expression||this.stringify(!0)}[Symbol.iterator](){return{next:()=>({value:je(this,S,qr).call(this),done:!this.hasNext()})}}};f=new WeakMap,h=new WeakMap,b=new WeakMap,N=new WeakMap,y=new WeakMap,p=new WeakMap,j=new WeakMap,T=new WeakMap,_=new WeakSet,Xl=function(O,ne){return ne.some(ae=>ae===O)},S=new WeakSet,qs=function(O,ne){return O[ne?O.length-1:0]},pv=function(O){const ne=`${O.getFullYear()}-${O.getMonth()+1}-${O.getDate()}`;if(J(this,j)===ne)return J(this,T);const ae=new r.CronDate(O);ae.setStartOfDay();const he=new r.CronDate(O);return he.setEndOfDay(),Ce(this,j,ne),Ce(this,T,ae.getUTCOffset()!==he.getUTCOffset()),J(this,T)},yv=function(O,ne,ae){const he=J(this,p).second.values,pe=O.getSeconds(),re=J(this,p).second.findNearestValue(pe,ae);if(re!==null){O.setSeconds(re);return}O.applyDateOperation(ne,r.TimeUnit.Minute,J(this,p).hour.values.length),O.setSeconds(je(this,S,qs).call(this,he,ae))},bv=function(O,ne,ae){const he=J(this,p).minute.values,pe=J(this,p).second.values,re=O.getMinutes(),P=J(this,p).minute.findNearestValue(re,ae);if(P!==null){O.setMinutes(P),O.setSeconds(je(this,S,qs).call(this,pe,ae));return}O.applyDateOperation(ne,r.TimeUnit.Hour,J(this,p).hour.values.length),O.setMinutes(je(this,S,qs).call(this,he,ae)),O.setSeconds(je(this,S,qs).call(this,pe,ae))},Nv=function(O,ne){const ae=ne.isLastWeekdayOfMonth();return O.some(he=>{const pe=parseInt(he.toString().charAt(0),10)%7;if(Number.isNaN(pe))throw new Error(`Invalid last weekday of the month expression: ${he}`);return ne.getDay()===pe&&ae})},Yf=function(O){var te,de,me;const ne=J(this,p).dayOfMonth.isWildcard,ae=!ne,he=J(this,p).dayOfWeek.isWildcard,pe=!he,re=je(te=R,_,Xl).call(te,O.getDate(),J(this,p).dayOfMonth.values)||J(this,p).dayOfMonth.hasLastChar&&O.isLastDayOfMonth(),P=je(de=R,_,Xl).call(de,O.getDay(),J(this,p).dayOfWeek.values)||J(this,p).dayOfWeek.hasLastChar&&je(me=R,_,Nv).call(me,J(this,p).dayOfWeek.values,O);return!!(ae&&pe&&(re||P)||re&&!pe||ne&&!he&&P)},Sv=function(O,ne,ae){var _e,L;const he=J(this,p).hour.values,pe=he,re=O.getHours(),P=je(_e=R,_,Xl).call(_e,re,he),te=O.dstStart===re,de=O.dstEnd===re;if(te)return je(L=R,_,Xl).call(L,re-1,he)?!0:(O.invokeDateOperation(ne,r.TimeUnit.Hour),!1);if(de&&!ae)return O.dstEnd=null,O.applyDateOperation(r.DateMathOp.Add,r.TimeUnit.Hour,pe.length),!1;if(P)return!0;O.dstStart=null;const me=J(this,p).hour.findNearestValue(re,ae);if(me===null)return O.applyDateOperation(ne,r.TimeUnit.Day,pe.length),!1;if(je(this,S,pv).call(this,O)){const le=ae?re-me:me-re;for(let ge=0;ge<le;ge++)O.applyDateOperation(ne,r.TimeUnit.Hour,pe.length)}else O.setHours(me);return O.setMinutes(je(this,S,qs).call(this,J(this,p).minute.values,ae)),O.setSeconds(je(this,S,qs).call(this,J(this,p).second.values,ae)),!1},jv=function(O){if(!J(this,N)&&!J(this,y))return;const ne=O.getTime();if(J(this,N)&&ne<J(this,N).getTime())throw new Error(l.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(J(this,y)&&ne>J(this,y).getTime())throw new Error(l.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)},qr=function(O=!1){var re,P,te;const ne=O?r.DateMathOp.Subtract:r.DateMathOp.Add,ae=new r.CronDate(J(this,b)),he=ae.getTime();let pe=0;for(;++pe<d;){if(je(this,S,jv).call(this,ae),!je(this,S,Yf).call(this,ae)){ae.applyDateOperation(ne,r.TimeUnit.Day,J(this,p).hour.values.length);continue}if(!(J(this,p).dayOfWeek.nthDay<=0||Math.ceil(ae.getDate()/7)===J(this,p).dayOfWeek.nthDay)){ae.applyDateOperation(ne,r.TimeUnit.Day,J(this,p).hour.values.length);continue}if(!je(re=R,_,Xl).call(re,ae.getMonth()+1,J(this,p).month.values)){ae.applyDateOperation(ne,r.TimeUnit.Month,J(this,p).hour.values.length);continue}if(je(this,S,Sv).call(this,ae,ne,O)){if(!je(P=R,_,Xl).call(P,ae.getMinutes(),J(this,p).minute.values)){je(this,S,bv).call(this,ae,ne,O);continue}if(!je(te=R,_,Xl).call(te,ae.getSeconds(),J(this,p).second.values)){je(this,S,yv).call(this,ae,ne,O);continue}if(he===ae.getTime()){(ne==="Add"||ae.getMilliseconds()===0)&&ae.applyDateOperation(ne,r.TimeUnit.Second,J(this,p).hour.values.length);continue}break}}if(pe>d)throw new Error(l.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return ae.getMilliseconds()!==0&&ae.setMilliseconds(0),Ce(this,b,ae),ae},et(R,_);let c=R;l.CronExpression=c,l.default=c})(_f)),_f}var Gc={},nx;function wN(){if(nx)return Gc;nx=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.seededRandom=d;function l(c){let f=2166136261;for(let h=0;h<c.length;h++)f^=c.charCodeAt(h),f=Math.imul(f,16777619);return()=>f>>>0}function r(c){return()=>{let f=c+=1831565813;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296}}function d(c){const f=c?l(c)():Math.floor(Math.random()*1e10);return r(f)}return Gc}var lx;function $f(){var p,j,Ev,Vs,Tv,Cv,Mv,Ov,Rv,Dv,Av,Pf,_v,kv;if(lx)return _a;lx=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.CronExpressionParser=_a.DayOfWeek=_a.Months=_a.CronUnit=_a.PredefinedExpressions=void 0;const l=vv(),r=wv(),d=wN(),c=gh();var f;(function(Z){Z["@yearly"]="0 0 0 1 1 *",Z["@annually"]="0 0 0 1 1 *",Z["@monthly"]="0 0 0 1 * *",Z["@weekly"]="0 0 0 * * 0",Z["@daily"]="0 0 0 * * *",Z["@hourly"]="0 0 * * * *",Z["@minutely"]="0 * * * * *",Z["@secondly"]="* * * * * *",Z["@weekdays"]="0 0 0 * * 1-5",Z["@weekends"]="0 0 0 * * 0,6"})(f||(_a.PredefinedExpressions=f={}));var h;(function(Z){Z.Second="Second",Z.Minute="Minute",Z.Hour="Hour",Z.DayOfMonth="DayOfMonth",Z.Month="Month",Z.DayOfWeek="DayOfWeek"})(h||(_a.CronUnit=h={}));var b;(function(Z){Z[Z.jan=1]="jan",Z[Z.feb=2]="feb",Z[Z.mar=3]="mar",Z[Z.apr=4]="apr",Z[Z.may=5]="may",Z[Z.jun=6]="jun",Z[Z.jul=7]="jul",Z[Z.aug=8]="aug",Z[Z.sep=9]="sep",Z[Z.oct=10]="oct",Z[Z.nov=11]="nov",Z[Z.dec=12]="dec"})(b||(_a.Months=b={}));var N;(function(Z){Z[Z.sun=0]="sun",Z[Z.mon=1]="mon",Z[Z.tue=2]="tue",Z[Z.wed=3]="wed",Z[Z.thu=4]="thu",Z[Z.fri=5]="fri",Z[Z.sat=6]="sat"})(N||(_a.DayOfWeek=N={}));let y=(j=class{static parse(R,ee={}){var ge,ve,we,xe,Te,Ze,We,Dt;const{strict:O=!1,hashSeed:ne}=ee,ae=(0,d.seededRandom)(ne);R=f[R]||R;const he=je(ge=j,p,Ev).call(ge,R,O);if(!(he.dayOfMonth==="*"||he.dayOfWeek==="*"||!O))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const pe=je(ve=j,p,Vs).call(ve,h.Second,he.second,c.CronSecond.constraints,ae),re=je(we=j,p,Vs).call(we,h.Minute,he.minute,c.CronMinute.constraints,ae),P=je(xe=j,p,Vs).call(xe,h.Hour,he.hour,c.CronHour.constraints,ae),te=je(Te=j,p,Vs).call(Te,h.Month,he.month,c.CronMonth.constraints,ae),de=je(Ze=j,p,Vs).call(Ze,h.DayOfMonth,he.dayOfMonth,c.CronDayOfMonth.constraints,ae),{dayOfWeek:me,nthDayOfWeek:_e}=je(We=j,p,_v).call(We,he.dayOfWeek),L=je(Dt=j,p,Vs).call(Dt,h.DayOfWeek,me,c.CronDayOfWeek.constraints,ae),le=new l.CronFieldCollection({second:new c.CronSecond(pe,{rawValue:he.second}),minute:new c.CronMinute(re,{rawValue:he.minute}),hour:new c.CronHour(P,{rawValue:he.hour}),dayOfMonth:new c.CronDayOfMonth(de,{rawValue:he.dayOfMonth}),month:new c.CronMonth(te,{rawValue:he.month}),dayOfWeek:new c.CronDayOfWeek(L,{rawValue:he.dayOfWeek,nthDayOfWeek:_e})});return new r.CronExpression(le,{...ee,expression:R})}},p=new WeakSet,Ev=function(R,ee){if(ee&&!R.length)throw new Error("Invalid cron expression");R=R||"0 * * * * *";const O=R.trim().split(/\s+/);if(ee&&O.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(O.length>6)throw new Error("Invalid cron expression, too many fields");const ne=["*","*","*","*","*","0"];O.length<ne.length&&O.unshift(...ne.slice(O.length));const[ae,he,pe,re,P,te]=O;return{second:ae,minute:he,hour:pe,dayOfMonth:re,month:P,dayOfWeek:te}},Vs=function(R,ee,O,ne){if((R===h.Month||R===h.DayOfWeek)&&(ee=ee.replace(/[a-z]{3}/gi,ae=>{ae=ae.toLowerCase();const he=b[ae]||N[ae];if(he===void 0)throw new Error(`Validation error, cannot resolve alias "${ae}"`);return he.toString()})),!O.validChars.test(ee))throw new Error(`Invalid characters, got value: ${ee}`);return ee=je(this,p,Tv).call(this,ee,O),ee=je(this,p,Cv).call(this,ee,O,ne),je(this,p,Mv).call(this,R,ee,O)},Tv=function(R,ee){return R.replace(/[*?]/g,ee.min+"-"+ee.max)},Cv=function(R,ee,O){const ne=O();return R.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(ae,he,pe,re)=>{if(he&&pe&&re){const P=parseInt(he,10),te=parseInt(pe,10),de=parseInt(re,10);if(P>te)throw new Error(`Invalid range: ${P}-${te}, min > max`);if(de<=0)throw new Error(`Invalid step: ${de}, must be positive`);const me=Math.max(P,ee.min),_e=Math.floor(ne*de),L=[];for(let le=Math.floor(me/de)*de+_e;le<=te;le+=de)le>=me&&L.push(le);return L.join(",")}else if(he&&pe){const P=parseInt(he,10),te=parseInt(pe,10);if(P>te)throw new Error(`Invalid range: ${P}-${te}, min > max`);return String(Math.floor(ne*(te-P+1))+P)}else if(re){const P=parseInt(re,10);if(P<=0)throw new Error(`Invalid step: ${P}, must be positive`);const te=Math.floor(ne*P),de=[];for(let me=Math.floor(ee.min/P)*P+te;me<=ee.max;me+=P)me>=ee.min&&de.push(me);return de.join(",")}else return String(Math.floor(ne*(ee.max-ee.min+1)+ee.min))})},Mv=function(R,ee,O){const ne=[];function ae(pe,re){var P;if(Array.isArray(pe))ne.push(...pe);else if(je(P=j,p,kv).call(P,re,pe))ne.push(pe);else{const te=parseInt(pe.toString(),10);if(!(te>=re.min&&te<=re.max))throw new Error(`Constraint error, got value ${pe} expected range ${re.min}-${re.max}`);ne.push(R===h.DayOfWeek?te%7:pe)}}return ee.split(",").forEach(pe=>{var re;if(!(pe.length>0))throw new Error("Invalid list value format");ae(je(re=j,p,Ov).call(re,R,pe,O),O)}),ne},Ov=function(R,ee,O){var ae,he;const ne=ee.split("/");if(ne.length>2)throw new Error(`Invalid repeat: ${ee}`);return ne.length===2?(isNaN(parseInt(ne[0],10))||(ne[0]=`${ne[0]}-${O.max}`),je(ae=j,p,Pf).call(ae,R,ne[0],parseInt(ne[1],10),O)):je(he=j,p,Pf).call(he,R,ee,1,O)},Rv=function(R,ee,O){if(!(!isNaN(R)&&!isNaN(ee)&&R>=O.min&&ee<=O.max))throw new Error(`Constraint error, got range ${R}-${ee} expected range ${O.min}-${O.max}`);if(R>ee)throw new Error(`Invalid range: ${R}-${ee}, min(${R}) > max(${ee})`)},Dv=function(R){if(!(!isNaN(R)&&R>0))throw new Error(`Constraint error, cannot repeat at every ${R} time.`)},Av=function(R,ee,O,ne){const ae=[];R===h.DayOfWeek&&O%7===0&&ae.push(0);for(let he=ee;he<=O;he+=ne)ae.indexOf(he)===-1&&ae.push(he);return ae},Pf=function(R,ee,O,ne){const ae=ee.split("-");if(ae.length<=1)return isNaN(+ee)?ee:+ee;const[he,pe]=ae.map(re=>parseInt(re,10));return je(this,p,Rv).call(this,he,pe,ne),je(this,p,Dv).call(this,O),je(this,p,Av).call(this,R,he,pe,O)},_v=function(R){const ee=R.split("#");if(ee.length<=1)return{dayOfWeek:ee[0]};const O=+ee[ee.length-1],ne=R.match(/([,-/])/);if(ne!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${ne==null?void 0:ne[0]}\` special characters are incompatible`);if(!(ee.length<=2&&!isNaN(O)&&O>=1&&O<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:ee[0],nthDayOfWeek:O}},kv=function(R,ee){return R.chars.some(O=>ee.toString().includes(O))},et(j,p),j);return _a.CronExpressionParser=y,_a}var xn={};const EN={},TN=Object.freeze(Object.defineProperty({__proto__:null,default:EN},Symbol.toStringTag,{value:"Module"})),sx=fy(TN);var rx;function CN(){var h,b,Ff,zv;if(rx)return xn;rx=1;var l=xn&&xn.__createBinding||(Object.create?(function(p,j,T,_){_===void 0&&(_=T);var k=Object.getOwnPropertyDescriptor(j,T);(!k||("get"in k?!j.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return j[T]}}),Object.defineProperty(p,_,k)}):(function(p,j,T,_){_===void 0&&(_=T),p[_]=j[T]})),r=xn&&xn.__setModuleDefault||(Object.create?(function(p,j){Object.defineProperty(p,"default",{enumerable:!0,value:j})}):function(p,j){p.default=j}),d=xn&&xn.__importStar||(function(){var p=function(j){return p=Object.getOwnPropertyNames||function(T){var _=[];for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(_[_.length]=k);return _},p(j)};return function(j){if(j&&j.__esModule)return j;var T={};if(j!=null)for(var _=p(j),k=0;k<_.length;k++)_[k]!=="default"&&l(T,j,_[k]);return r(T,j),T}})();Object.defineProperty(xn,"__esModule",{value:!0}),xn.CronFileParser=void 0;const c=$f();let f=(b=class{static async parseFile(j){var k;const{readFile:T}=await Promise.resolve().then(()=>d(sx)),_=await T(j,"utf8");return je(k=b,h,Ff).call(k,_)}static parseFileSync(j){var k;const{readFileSync:T}=sx,_=T(j,"utf8");return je(k=b,h,Ff).call(k,_)}},h=new WeakSet,Ff=function(j){var k;const T=j.split(`
406
- `),_={variables:{},expressions:[],errors:{}};for(const S of T){const C=S.trim();if(C.length===0||C.startsWith("#"))continue;const A=C.match(/^(.*)=(.*)$/);if(A){const[,$,B]=A;_.variables[$]=B.replace(/["']/g,"");continue}try{const $=je(k=b,h,zv).call(k,C);_.expressions.push($.interval)}catch($){_.errors[C]=$}}return _},zv=function(j){const T=j.split(" ");return{interval:c.CronExpressionParser.parse(T.slice(0,5).join(" ")),command:T.slice(5,T.length)}},et(b,h),b);return xn.CronFileParser=f,xn}var ix;function MN(){return ix||(ix=1,(function(l){var r=zs&&zs.__createBinding||(Object.create?(function(p,j,T,_){_===void 0&&(_=T);var k=Object.getOwnPropertyDescriptor(j,T);(!k||("get"in k?!j.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return j[T]}}),Object.defineProperty(p,_,k)}):(function(p,j,T,_){_===void 0&&(_=T),p[_]=j[T]})),d=zs&&zs.__exportStar||function(p,j){for(var T in p)T!=="default"&&!Object.prototype.hasOwnProperty.call(j,T)&&r(j,p,T)};Object.defineProperty(l,"__esModule",{value:!0}),l.CronFileParser=l.CronExpressionParser=l.CronExpression=l.CronFieldCollection=l.CronDate=void 0;const c=$f();var f=mh();Object.defineProperty(l,"CronDate",{enumerable:!0,get:function(){return f.CronDate}});var h=vv();Object.defineProperty(l,"CronFieldCollection",{enumerable:!0,get:function(){return h.CronFieldCollection}});var b=wv();Object.defineProperty(l,"CronExpression",{enumerable:!0,get:function(){return b.CronExpression}});var N=$f();Object.defineProperty(l,"CronExpressionParser",{enumerable:!0,get:function(){return N.CronExpressionParser}});var y=CN();Object.defineProperty(l,"CronFileParser",{enumerable:!0,get:function(){return y.CronFileParser}}),d(gh(),l),l.default=c.CronExpressionParser})(zs)),zs}var ON=MN();const Uv=6048e5,RN=864e5,DN=6e4,AN=36e5,ux=Symbol.for("constructDateFrom");function ka(l,r){return typeof l=="function"?l(r):l&&typeof l=="object"&&ux in l?l[ux](r):l instanceof Date?new l.constructor(r):new Date(r)}function Ot(l,r){return ka(r||l,l)}function _N(l,r,d){return ka(l,+Ot(l)+r)}function Zc(l,r,d){return _N(l,r*AN)}let kN={};function go(){return kN}function hu(l,r){var N,y,p,j;const d=go(),c=(r==null?void 0:r.weekStartsOn)??((y=(N=r==null?void 0:r.locale)==null?void 0:N.options)==null?void 0:y.weekStartsOn)??d.weekStartsOn??((j=(p=d.locale)==null?void 0:p.options)==null?void 0:j.weekStartsOn)??0,f=Ot(l,r==null?void 0:r.in),h=f.getDay(),b=(h<c?7:0)+h-c;return f.setDate(f.getDate()-b),f.setHours(0,0,0,0),f}function ro(l,r){return hu(l,{...r,weekStartsOn:1})}function Lv(l,r){const d=Ot(l,r==null?void 0:r.in),c=d.getFullYear(),f=ka(d,0);f.setFullYear(c+1,0,4),f.setHours(0,0,0,0);const h=ro(f),b=ka(d,0);b.setFullYear(c,0,4),b.setHours(0,0,0,0);const N=ro(b);return d.getTime()>=h.getTime()?c+1:d.getTime()>=N.getTime()?c:c-1}function cx(l){const r=Ot(l),d=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return d.setUTCFullYear(r.getFullYear()),+l-+d}function zN(l,...r){const d=ka.bind(null,r.find(c=>typeof c=="object"));return r.map(d)}function ox(l,r){const d=Ot(l,r==null?void 0:r.in);return d.setHours(0,0,0,0),d}function UN(l,r,d){const[c,f]=zN(d==null?void 0:d.in,l,r),h=ox(c),b=ox(f),N=+h-cx(h),y=+b-cx(b);return Math.round((N-y)/RN)}function LN(l,r){const d=Lv(l,r),c=ka(l,0);return c.setFullYear(d,0,4),c.setHours(0,0,0,0),ro(c)}function HN(l,r){let d,c=r==null?void 0:r.in;return l.forEach(f=>{!c&&typeof f=="object"&&(c=ka.bind(null,f));const h=Ot(f,c);(!d||d<h||isNaN(+h))&&(d=h)}),ka(c,d||NaN)}function qN(l,r){let d,c=r==null?void 0:r.in;return l.forEach(f=>{!c&&typeof f=="object"&&(c=ka.bind(null,f));const h=Ot(f,c);(!d||d>h||isNaN(+h))&&(d=h)}),ka(c,d||NaN)}function VN(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function BN(l){return!(!VN(l)&&typeof l!="number"||isNaN(+Ot(l)))}function YN(l){return r=>{const c=(l?Math[l]:Math.trunc)(r);return c===0?0:c}}function PN(l,r){return+Ot(l)-+Ot(r)}function dx(l,r,d){const c=PN(l,r)/DN;return YN(d==null?void 0:d.roundingMethod)(c)}function $N(l,r){const d=Ot(l,r==null?void 0:r.in);return d.setFullYear(d.getFullYear(),0,1),d.setHours(0,0,0,0),d}const FN={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},GN=(l,r,d)=>{let c;const f=FN[l];return typeof f=="string"?c=f:r===1?c=f.one:c=f.other.replace("{{count}}",r.toString()),d!=null&&d.addSuffix?d.comparison&&d.comparison>0?"in "+c:c+" ago":c};function kf(l){return(r={})=>{const d=r.width?String(r.width):l.defaultWidth;return l.formats[d]||l.formats[l.defaultWidth]}}const ZN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},WN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},QN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},IN={date:kf({formats:ZN,defaultWidth:"full"}),time:kf({formats:WN,defaultWidth:"full"}),dateTime:kf({formats:QN,defaultWidth:"full"})},XN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},JN=(l,r,d,c)=>XN[l];function ru(l){return(r,d)=>{const c=d!=null&&d.context?String(d.context):"standalone";let f;if(c==="formatting"&&l.formattingValues){const b=l.defaultFormattingWidth||l.defaultWidth,N=d!=null&&d.width?String(d.width):b;f=l.formattingValues[N]||l.formattingValues[b]}else{const b=l.defaultWidth,N=d!=null&&d.width?String(d.width):l.defaultWidth;f=l.values[N]||l.values[b]}const h=l.argumentCallback?l.argumentCallback(r):r;return f[h]}}const KN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},eS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},aS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},lS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sS=(l,r)=>{const d=Number(l),c=d%100;if(c>20||c<10)switch(c%10){case 1:return d+"st";case 2:return d+"nd";case 3:return d+"rd"}return d+"th"},rS={ordinalNumber:sS,era:ru({values:KN,defaultWidth:"wide"}),quarter:ru({values:eS,defaultWidth:"wide",argumentCallback:l=>l-1}),month:ru({values:tS,defaultWidth:"wide"}),day:ru({values:aS,defaultWidth:"wide"}),dayPeriod:ru({values:nS,defaultWidth:"wide",formattingValues:lS,defaultFormattingWidth:"wide"})};function iu(l){return(r,d={})=>{const c=d.width,f=c&&l.matchPatterns[c]||l.matchPatterns[l.defaultMatchWidth],h=r.match(f);if(!h)return null;const b=h[0],N=c&&l.parsePatterns[c]||l.parsePatterns[l.defaultParseWidth],y=Array.isArray(N)?uS(N,T=>T.test(b)):iS(N,T=>T.test(b));let p;p=l.valueCallback?l.valueCallback(y):y,p=d.valueCallback?d.valueCallback(p):p;const j=r.slice(b.length);return{value:p,rest:j}}}function iS(l,r){for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d)&&r(l[d]))return d}function uS(l,r){for(let d=0;d<l.length;d++)if(r(l[d]))return d}function cS(l){return(r,d={})=>{const c=r.match(l.matchPattern);if(!c)return null;const f=c[0],h=r.match(l.parsePattern);if(!h)return null;let b=l.valueCallback?l.valueCallback(h[0]):h[0];b=d.valueCallback?d.valueCallback(b):b;const N=r.slice(f.length);return{value:b,rest:N}}}const oS=/^(\d+)(th|st|nd|rd)?/i,dS=/\d+/i,fS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hS={any:[/^b/i,/^(a|c)/i]},mS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gS={any:[/1/i,/2/i,/3/i,/4/i]},xS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},pS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},yS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},NS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},SS={ordinalNumber:cS({matchPattern:oS,parsePattern:dS,valueCallback:l=>parseInt(l,10)}),era:iu({matchPatterns:fS,defaultMatchWidth:"wide",parsePatterns:hS,defaultParseWidth:"any"}),quarter:iu({matchPatterns:mS,defaultMatchWidth:"wide",parsePatterns:gS,defaultParseWidth:"any",valueCallback:l=>l+1}),month:iu({matchPatterns:xS,defaultMatchWidth:"wide",parsePatterns:vS,defaultParseWidth:"any"}),day:iu({matchPatterns:pS,defaultMatchWidth:"wide",parsePatterns:yS,defaultParseWidth:"any"}),dayPeriod:iu({matchPatterns:bS,defaultMatchWidth:"any",parsePatterns:NS,defaultParseWidth:"any"})},jS={code:"en-US",formatDistance:GN,formatLong:IN,formatRelative:JN,localize:rS,match:SS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wS(l,r){const d=Ot(l,r==null?void 0:r.in);return UN(d,$N(d))+1}function ES(l,r){const d=Ot(l,r==null?void 0:r.in),c=+ro(d)-+LN(d);return Math.round(c/Uv)+1}function Hv(l,r){var j,T,_,k;const d=Ot(l,r==null?void 0:r.in),c=d.getFullYear(),f=go(),h=(r==null?void 0:r.firstWeekContainsDate)??((T=(j=r==null?void 0:r.locale)==null?void 0:j.options)==null?void 0:T.firstWeekContainsDate)??f.firstWeekContainsDate??((k=(_=f.locale)==null?void 0:_.options)==null?void 0:k.firstWeekContainsDate)??1,b=ka((r==null?void 0:r.in)||l,0);b.setFullYear(c+1,0,h),b.setHours(0,0,0,0);const N=hu(b,r),y=ka((r==null?void 0:r.in)||l,0);y.setFullYear(c,0,h),y.setHours(0,0,0,0);const p=hu(y,r);return+d>=+N?c+1:+d>=+p?c:c-1}function TS(l,r){var N,y,p,j;const d=go(),c=(r==null?void 0:r.firstWeekContainsDate)??((y=(N=r==null?void 0:r.locale)==null?void 0:N.options)==null?void 0:y.firstWeekContainsDate)??d.firstWeekContainsDate??((j=(p=d.locale)==null?void 0:p.options)==null?void 0:j.firstWeekContainsDate)??1,f=Hv(l,r),h=ka((r==null?void 0:r.in)||l,0);return h.setFullYear(f,0,c),h.setHours(0,0,0,0),hu(h,r)}function CS(l,r){const d=Ot(l,r==null?void 0:r.in),c=+hu(d,r)-+TS(d,r);return Math.round(c/Uv)+1}function st(l,r){const d=l<0?"-":"",c=Math.abs(l).toString().padStart(r,"0");return d+c}const Gl={y(l,r){const d=l.getFullYear(),c=d>0?d:1-d;return st(r==="yy"?c%100:c,r.length)},M(l,r){const d=l.getMonth();return r==="M"?String(d+1):st(d+1,2)},d(l,r){return st(l.getDate(),r.length)},a(l,r){const d=l.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return d.toUpperCase();case"aaa":return d;case"aaaaa":return d[0];case"aaaa":default:return d==="am"?"a.m.":"p.m."}},h(l,r){return st(l.getHours()%12||12,r.length)},H(l,r){return st(l.getHours(),r.length)},m(l,r){return st(l.getMinutes(),r.length)},s(l,r){return st(l.getSeconds(),r.length)},S(l,r){const d=r.length,c=l.getMilliseconds(),f=Math.trunc(c*Math.pow(10,d-3));return st(f,r.length)}},Hr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fx={G:function(l,r,d){const c=l.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return d.era(c,{width:"abbreviated"});case"GGGGG":return d.era(c,{width:"narrow"});case"GGGG":default:return d.era(c,{width:"wide"})}},y:function(l,r,d){if(r==="yo"){const c=l.getFullYear(),f=c>0?c:1-c;return d.ordinalNumber(f,{unit:"year"})}return Gl.y(l,r)},Y:function(l,r,d,c){const f=Hv(l,c),h=f>0?f:1-f;if(r==="YY"){const b=h%100;return st(b,2)}return r==="Yo"?d.ordinalNumber(h,{unit:"year"}):st(h,r.length)},R:function(l,r){const d=Lv(l);return st(d,r.length)},u:function(l,r){const d=l.getFullYear();return st(d,r.length)},Q:function(l,r,d){const c=Math.ceil((l.getMonth()+1)/3);switch(r){case"Q":return String(c);case"QQ":return st(c,2);case"Qo":return d.ordinalNumber(c,{unit:"quarter"});case"QQQ":return d.quarter(c,{width:"abbreviated",context:"formatting"});case"QQQQQ":return d.quarter(c,{width:"narrow",context:"formatting"});case"QQQQ":default:return d.quarter(c,{width:"wide",context:"formatting"})}},q:function(l,r,d){const c=Math.ceil((l.getMonth()+1)/3);switch(r){case"q":return String(c);case"qq":return st(c,2);case"qo":return d.ordinalNumber(c,{unit:"quarter"});case"qqq":return d.quarter(c,{width:"abbreviated",context:"standalone"});case"qqqqq":return d.quarter(c,{width:"narrow",context:"standalone"});case"qqqq":default:return d.quarter(c,{width:"wide",context:"standalone"})}},M:function(l,r,d){const c=l.getMonth();switch(r){case"M":case"MM":return Gl.M(l,r);case"Mo":return d.ordinalNumber(c+1,{unit:"month"});case"MMM":return d.month(c,{width:"abbreviated",context:"formatting"});case"MMMMM":return d.month(c,{width:"narrow",context:"formatting"});case"MMMM":default:return d.month(c,{width:"wide",context:"formatting"})}},L:function(l,r,d){const c=l.getMonth();switch(r){case"L":return String(c+1);case"LL":return st(c+1,2);case"Lo":return d.ordinalNumber(c+1,{unit:"month"});case"LLL":return d.month(c,{width:"abbreviated",context:"standalone"});case"LLLLL":return d.month(c,{width:"narrow",context:"standalone"});case"LLLL":default:return d.month(c,{width:"wide",context:"standalone"})}},w:function(l,r,d,c){const f=CS(l,c);return r==="wo"?d.ordinalNumber(f,{unit:"week"}):st(f,r.length)},I:function(l,r,d){const c=ES(l);return r==="Io"?d.ordinalNumber(c,{unit:"week"}):st(c,r.length)},d:function(l,r,d){return r==="do"?d.ordinalNumber(l.getDate(),{unit:"date"}):Gl.d(l,r)},D:function(l,r,d){const c=wS(l);return r==="Do"?d.ordinalNumber(c,{unit:"dayOfYear"}):st(c,r.length)},E:function(l,r,d){const c=l.getDay();switch(r){case"E":case"EE":case"EEE":return d.day(c,{width:"abbreviated",context:"formatting"});case"EEEEE":return d.day(c,{width:"narrow",context:"formatting"});case"EEEEEE":return d.day(c,{width:"short",context:"formatting"});case"EEEE":default:return d.day(c,{width:"wide",context:"formatting"})}},e:function(l,r,d,c){const f=l.getDay(),h=(f-c.weekStartsOn+8)%7||7;switch(r){case"e":return String(h);case"ee":return st(h,2);case"eo":return d.ordinalNumber(h,{unit:"day"});case"eee":return d.day(f,{width:"abbreviated",context:"formatting"});case"eeeee":return d.day(f,{width:"narrow",context:"formatting"});case"eeeeee":return d.day(f,{width:"short",context:"formatting"});case"eeee":default:return d.day(f,{width:"wide",context:"formatting"})}},c:function(l,r,d,c){const f=l.getDay(),h=(f-c.weekStartsOn+8)%7||7;switch(r){case"c":return String(h);case"cc":return st(h,r.length);case"co":return d.ordinalNumber(h,{unit:"day"});case"ccc":return d.day(f,{width:"abbreviated",context:"standalone"});case"ccccc":return d.day(f,{width:"narrow",context:"standalone"});case"cccccc":return d.day(f,{width:"short",context:"standalone"});case"cccc":default:return d.day(f,{width:"wide",context:"standalone"})}},i:function(l,r,d){const c=l.getDay(),f=c===0?7:c;switch(r){case"i":return String(f);case"ii":return st(f,r.length);case"io":return d.ordinalNumber(f,{unit:"day"});case"iii":return d.day(c,{width:"abbreviated",context:"formatting"});case"iiiii":return d.day(c,{width:"narrow",context:"formatting"});case"iiiiii":return d.day(c,{width:"short",context:"formatting"});case"iiii":default:return d.day(c,{width:"wide",context:"formatting"})}},a:function(l,r,d){const f=l.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return d.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"aaa":return d.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return d.dayPeriod(f,{width:"narrow",context:"formatting"});case"aaaa":default:return d.dayPeriod(f,{width:"wide",context:"formatting"})}},b:function(l,r,d){const c=l.getHours();let f;switch(c===12?f=Hr.noon:c===0?f=Hr.midnight:f=c/12>=1?"pm":"am",r){case"b":case"bb":return d.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"bbb":return d.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return d.dayPeriod(f,{width:"narrow",context:"formatting"});case"bbbb":default:return d.dayPeriod(f,{width:"wide",context:"formatting"})}},B:function(l,r,d){const c=l.getHours();let f;switch(c>=17?f=Hr.evening:c>=12?f=Hr.afternoon:c>=4?f=Hr.morning:f=Hr.night,r){case"B":case"BB":case"BBB":return d.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"BBBBB":return d.dayPeriod(f,{width:"narrow",context:"formatting"});case"BBBB":default:return d.dayPeriod(f,{width:"wide",context:"formatting"})}},h:function(l,r,d){if(r==="ho"){let c=l.getHours()%12;return c===0&&(c=12),d.ordinalNumber(c,{unit:"hour"})}return Gl.h(l,r)},H:function(l,r,d){return r==="Ho"?d.ordinalNumber(l.getHours(),{unit:"hour"}):Gl.H(l,r)},K:function(l,r,d){const c=l.getHours()%12;return r==="Ko"?d.ordinalNumber(c,{unit:"hour"}):st(c,r.length)},k:function(l,r,d){let c=l.getHours();return c===0&&(c=24),r==="ko"?d.ordinalNumber(c,{unit:"hour"}):st(c,r.length)},m:function(l,r,d){return r==="mo"?d.ordinalNumber(l.getMinutes(),{unit:"minute"}):Gl.m(l,r)},s:function(l,r,d){return r==="so"?d.ordinalNumber(l.getSeconds(),{unit:"second"}):Gl.s(l,r)},S:function(l,r){return Gl.S(l,r)},X:function(l,r,d){const c=l.getTimezoneOffset();if(c===0)return"Z";switch(r){case"X":return mx(c);case"XXXX":case"XX":return Bs(c);case"XXXXX":case"XXX":default:return Bs(c,":")}},x:function(l,r,d){const c=l.getTimezoneOffset();switch(r){case"x":return mx(c);case"xxxx":case"xx":return Bs(c);case"xxxxx":case"xxx":default:return Bs(c,":")}},O:function(l,r,d){const c=l.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+hx(c,":");case"OOOO":default:return"GMT"+Bs(c,":")}},z:function(l,r,d){const c=l.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+hx(c,":");case"zzzz":default:return"GMT"+Bs(c,":")}},t:function(l,r,d){const c=Math.trunc(+l/1e3);return st(c,r.length)},T:function(l,r,d){return st(+l,r.length)}};function hx(l,r=""){const d=l>0?"-":"+",c=Math.abs(l),f=Math.trunc(c/60),h=c%60;return h===0?d+String(f):d+String(f)+r+st(h,2)}function mx(l,r){return l%60===0?(l>0?"-":"+")+st(Math.abs(l)/60,2):Bs(l,r)}function Bs(l,r=""){const d=l>0?"-":"+",c=Math.abs(l),f=st(Math.trunc(c/60),2),h=st(c%60,2);return d+f+r+h}const gx=(l,r)=>{switch(l){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},qv=(l,r)=>{switch(l){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},MS=(l,r)=>{const d=l.match(/(P+)(p+)?/)||[],c=d[1],f=d[2];if(!f)return gx(l,r);let h;switch(c){case"P":h=r.dateTime({width:"short"});break;case"PP":h=r.dateTime({width:"medium"});break;case"PPP":h=r.dateTime({width:"long"});break;case"PPPP":default:h=r.dateTime({width:"full"});break}return h.replace("{{date}}",gx(c,r)).replace("{{time}}",qv(f,r))},OS={p:qv,P:MS},RS=/^D+$/,DS=/^Y+$/,AS=["D","DD","YY","YYYY"];function _S(l){return RS.test(l)}function kS(l){return DS.test(l)}function zS(l,r,d){const c=US(l,r,d);if(console.warn(c),AS.includes(l))throw new RangeError(c)}function US(l,r,d){const c=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${r}\`) for formatting ${c} to the input \`${d}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const LS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qS=/^'([^]*?)'?$/,VS=/''/g,BS=/[a-zA-Z]/;function Ls(l,r,d){var j,T,_,k;const c=go(),f=c.locale??jS,h=c.firstWeekContainsDate??((T=(j=c.locale)==null?void 0:j.options)==null?void 0:T.firstWeekContainsDate)??1,b=c.weekStartsOn??((k=(_=c.locale)==null?void 0:_.options)==null?void 0:k.weekStartsOn)??0,N=Ot(l,d==null?void 0:d.in);if(!BN(N))throw new RangeError("Invalid time value");let y=r.match(HS).map(S=>{const C=S[0];if(C==="p"||C==="P"){const A=OS[C];return A(S,f.formatLong)}return S}).join("").match(LS).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:YS(S)};if(fx[C])return{isToken:!0,value:S};if(C.match(BS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});f.localize.preprocessor&&(y=f.localize.preprocessor(N,y));const p={firstWeekContainsDate:h,weekStartsOn:b,locale:f};return y.map(S=>{if(!S.isToken)return S.value;const C=S.value;(kS(C)||_S(C))&&zS(C,r,String(l));const A=fx[C[0]];return A(N,C,f.localize,p)}).join("")}function YS(l){const r=l.match(qS);return r?r[1].replace(VS,"'"):l}function PS(l,r){return+Ot(l)>+Ot(r)}function $S(l,r){return+Ot(l)<+Ot(r)}function FS(l,r){const d=Ot(l,r==null?void 0:r.in);return d.setMinutes(0,0,0),d}const zf=av,Wc=[{bg:"bg-indigo-400",border:"border-indigo-400/60"},{bg:"bg-cyan-400",border:"border-cyan-400/60"},{bg:"bg-rose-400",border:"border-rose-400/60"},{bg:"bg-violet-400",border:"border-violet-400/60"},{bg:"bg-amber-400",border:"border-amber-400/60"}],ll=160,Qc=14,GS=10,ZS=7,xx=4,WS=({configs:l,currentProjectId:r,onEditJob:d,queueStatus:c,queueAnalytics:f})=>{const h=U.useMemo(()=>FS(new Date),[]),b=U.useMemo(()=>Zc(h,24),[h]),N=U.useMemo(()=>Zc(h,-24),[h]),y=b,p=U.useMemo(()=>{const X=[];for(let ie=0;ie<=24;ie++)X.push(Zc(h,ie));return X},[h]),j=U.useMemo(()=>{const X=[];return l.forEach(({projectId:ie,config:F})=>{var ee,O,ne,ae,he;const Z={executor:F.executorEnabled!==!1?F.cronSchedule:null,reviewer:F.reviewerEnabled?F.reviewerSchedule:null,qa:F.qa.enabled?F.qa.schedule:null,audit:F.audit.enabled?F.audit.schedule:null,slicer:F.roadmapScanner.enabled?F.roadmapScanner.slicerSchedule:null,analytics:(ee=F.analytics)!=null&&ee.enabled?(O=F.analytics)==null?void 0:O.schedule:null,"pr-resolver":(ne=F.prResolver)!=null&&ne.enabled?F.prResolver.schedule:null,merger:(ae=F.merger)!=null&&ae.enabled?(he=F.merger)==null?void 0:he.schedule:null},R=F.cronScheduleOffset||0;Object.entries(Z).forEach(([pe,re])=>{if(re)try{const P=ON.CronExpressionParser.parse(re,{currentDate:h,endDate:b});for(;P.hasNext();){const te=P.next(),de=new Date(te.getTime());de.setMinutes(de.getMinutes()+R),PS(de,h)&&$S(de,b)&&X.push({projectId:ie,jobType:pe,time:de})}}catch(P){console.error(`Failed to parse cron "${re}" for ${ie}/${pe}`,P)}})}),X},[l,h,b]),T=U.useMemo(()=>{const X=new Set;return l.length===0||(l.every(ie=>ie.config.executorEnabled===!1)&&X.add("executor"),l.every(ie=>!ie.config.reviewerEnabled)&&X.add("reviewer"),l.every(ie=>!ie.config.qa.enabled)&&X.add("qa"),l.every(ie=>!ie.config.audit.enabled)&&X.add("audit"),l.every(ie=>!ie.config.roadmapScanner.enabled)&&X.add("slicer"),l.every(ie=>{var F;return!((F=ie.config.analytics)!=null&&F.enabled)})&&X.add("analytics"),l.every(ie=>{var F;return!((F=ie.config.prResolver)!=null&&F.enabled)})&&X.add("pr-resolver"),l.every(ie=>{var F;return!((F=ie.config.merger)!=null&&F.enabled)})&&X.add("merger")),X},[l]),_=U.useMemo(()=>{const X=new Map;let ie=0;return l.forEach(F=>{F.projectId===r||(X.set(F.projectId,ie%Wc.length),ie++)}),X},[l,r]),k=X=>dx(X,h),S=U.useMemo(()=>{const X=[];for(let ie=0;ie<=24;ie++)X.push(Zc(N,ie));return X},[N]),C=X=>{const ie=qN([HN([X,N]),y]);return dx(ie,N)},A=U.useMemo(()=>{const X=(f==null?void 0:f.recentRuns)??[],ie=new Map;for(const F of X){const Z=F.providerKey||"default",R=new Date(F.startedAt*1e3),ee=F.finishedAt?new Date(F.finishedAt*1e3):new Date;ee<N||R>y||(ie.has(Z)||ie.set(Z,[]),ie.get(Z).push({id:F.id,jobType:F.jobType,status:F.status,projectPath:F.projectPath,startedAt:R,finishedAt:ee,throttledCount:F.throttledCount}))}if(c!=null&&c.running){const F=c.running.providerKey??"default";ie.has(F)||ie.set(F,[]),ie.get(F).push({id:c.running.id,jobType:c.running.jobType,status:"running",projectPath:c.running.projectPath,startedAt:new Date((c.running.dispatchedAt??c.running.enqueuedAt)*1e3),finishedAt:new Date,throttledCount:0})}return Array.from(ie.entries()).sort(([F],[Z])=>F.localeCompare(Z)).map(([F,Z])=>({providerKey:F,runs:Z.sort((R,ee)=>R.startedAt.getTime()-ee.startedAt.getTime())}))},[y,N,f,c]),$=X=>X.split(/[-_]/).map(ie=>ie.charAt(0).toUpperCase()+ie.slice(1)).join(" "),B=l.length>1,M=s.jsx("div",{className:"absolute inset-0 flex pointer-events-none",children:p.map((X,ie)=>s.jsx("div",{className:"h-full border-l border-slate-800/20",style:{width:60}},ie))});return s.jsxs("div",{className:"w-full overflow-hidden rounded-xl border border-slate-800 bg-slate-950/50 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Execution Timeline (Next 24h)"}),s.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Upcoming scheduled runs across projects. Aligned columns = overlap."})]}),B&&s.jsxs("div",{className:"flex flex-wrap gap-2 justify-end max-w-sm",children:[s.jsxs("div",{className:"flex items-center gap-1 mr-1",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-slate-400 shrink-0"}),s.jsx("span",{className:"text-[10px] text-slate-400 font-semibold",children:"current"})]}),l.filter(X=>X.projectId!==r).slice(0,5).map(X=>{const ie=_.get(X.projectId)??0,F=Wc[ie],Z=(X.projectId.split("/").pop()??X.projectId).slice(0,14);return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:`w-2 h-2 rounded-full ${F.bg} shrink-0`}),s.jsx("span",{className:"text-[10px] text-slate-500",title:X.projectId,children:Z})]},X.projectId)})]})]}),s.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:s.jsxs("div",{className:"relative min-w-[1600px]",style:{width:1440+ll},children:[s.jsxs("div",{className:"h-8 border-b border-slate-800 flex",children:[s.jsx("div",{style:{width:ll},className:"shrink-0 border-r border-slate-800"}),s.jsx("div",{className:"flex-1 relative",children:p.map((X,ie)=>s.jsx("div",{className:"absolute top-0 bottom-0 border-l border-slate-800/50 flex flex-col justify-end pb-1 px-1",style:{left:ie*60},children:s.jsx("span",{className:"text-[10px] font-mono text-slate-500",children:Ls(X,"HH:mm")})},ie))})]}),s.jsxs("div",{className:"relative",children:[l.length===0&&s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsx("p",{className:"text-sm text-slate-500 italic",children:"No project data available for timeline."})}),zf.map(X=>{const ie=T.has(X.id),F=j.filter(R=>R.jobType===X.id);if(!B)return s.jsxs("div",{className:`flex border-b border-slate-800/30 ${ie?"opacity-40":""}`,children:[s.jsxs("div",{style:{width:ll},className:"shrink-0 p-3 border-r border-slate-800/50 flex items-center gap-2",children:[s.jsx("div",{className:`w-2 h-2 rounded-full ${X.color.bg} shrink-0`}),s.jsx("span",{className:"text-xs font-semibold text-slate-300",children:X.label})]}),s.jsxs("div",{className:"flex-1 relative h-10",children:[M,F.length===0?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:s.jsx("span",{className:"text-[10px] text-slate-600 italic",children:ie?"Disabled":"No runs in this window"})}):F.map((R,ee)=>s.jsx("button",{type:"button",onClick:()=>d==null?void 0:d(R.projectId,R.jobType),style:{left:k(R.time)-3},className:`absolute top-1/2 -translate-y-1/2 h-4 w-6 rounded border ${X.color.bg} ${X.color.border} opacity-90 hover:opacity-100 hover:scale-110 transition-all cursor-pointer shadow-lg group`,title:`${X.label} at ${Ls(R.time,"HH:mm")}`,children:s.jsx("div",{className:"absolute -top-5 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded bg-slate-800 text-white text-[9px] whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none border border-slate-700 z-10",children:Ls(R.time,"HH:mm")})},ee))]})]},X.id);const Z=l.length*Qc+xx*2;return s.jsxs("div",{className:`flex border-b border-slate-800/30 ${ie?"opacity-40":""}`,children:[s.jsxs("div",{style:{width:ll,height:Z},className:"shrink-0 border-r border-slate-800/50 flex flex-col px-2 py-1",children:[s.jsxs("div",{className:"flex items-center gap-1 mb-0.5",children:[s.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${X.color.bg} shrink-0`}),s.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wide",children:X.label})]}),l.map(R=>{const ee=R.projectId===r,O=(R.projectId.split("/").pop()??R.projectId).slice(0,14),ne=_.get(R.projectId)??0,ae=ee?X.color.bg:Wc[ne].bg;return s.jsxs("div",{style:{height:Qc},className:"flex items-center gap-1 overflow-hidden",children:[s.jsx("div",{className:`w-1 h-1 rounded-full shrink-0 ${ae}`}),s.jsx("span",{className:`text-[9px] truncate ${ee?"text-slate-200 font-semibold":"text-slate-600"}`,title:R.projectId,children:ee?`${O} ★`:O})]},R.projectId)})]}),s.jsxs("div",{className:"flex-1 relative",style:{height:Z},children:[M,l.map((R,ee)=>{const O=R.projectId===r,ne=F.filter(te=>te.projectId===R.projectId),ae=xx+ee*Qc,he=O?GS:ZS,pe=Math.floor((Qc-he)/2),re=_.get(R.projectId)??0,P=O?{bg:X.color.bg,border:X.color.border}:Wc[re];return s.jsxs(ze.Fragment,{children:[ee>0&&s.jsx("div",{className:"absolute left-0 right-0 border-t border-slate-800/20 pointer-events-none",style:{top:ae}}),ne.map((te,de)=>s.jsx("button",{type:"button",onClick:()=>d==null?void 0:d(R.projectId,te.jobType),style:{left:k(te.time)-3,top:ae+pe,height:he},className:`absolute w-6 rounded border ${P.bg} ${P.border} ${O?"opacity-90":"opacity-50"} hover:opacity-100 hover:z-10 transition-all cursor-pointer group`,title:`${R.projectId} · ${X.label} @ ${Ls(te.time,"HH:mm")}`,children:s.jsx("div",{className:"absolute -top-5 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded bg-slate-800 text-white text-[9px] whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none border border-slate-700 z-20",children:Ls(te.time,"HH:mm")})},de))]},R.projectId)}),F.length===0&&!ie&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:s.jsx("span",{className:"text-[10px] text-slate-700 italic",children:"No runs in this window"})})]})]},X.id)})]}),s.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-rose-500/50 z-10 pointer-events-none",style:{left:ll+k(new Date)},children:s.jsx("div",{className:"absolute top-0 h-2 w-2 rounded-full bg-rose-500 -translate-x-1/2"})})]})}),s.jsxs("div",{className:"p-3 bg-slate-900/40 flex items-center gap-4 text-[10px] text-slate-500",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-1.5 h-3 rounded bg-blue-500/50 border border-blue-500"}),s.jsx("span",{children:"Each block = one scheduled run"})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-[1px] h-4 bg-rose-500"}),s.jsx("span",{children:"Current Time"})]}),B&&s.jsx("div",{className:"flex items-center gap-1.5",children:s.jsx("span",{children:"★ = current project  ·  blocks in same column = scheduling overlap"})})]}),A.length>0&&s.jsxs("div",{className:"border-t border-slate-800",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800 flex items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Recent Execution Runs"}),s.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Last 24h of real runs grouped by provider bucket."})]}),s.jsxs("div",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-500",children:[(f==null?void 0:f.recentRuns.length)??0," recorded runs"]})]}),s.jsx("div",{className:"overflow-x-auto custom-scrollbar","data-testid":"provider-execution-timeline",children:s.jsxs("div",{className:"relative min-w-[1600px]",style:{width:1440+ll},children:[s.jsxs("div",{className:"h-8 border-b border-slate-800 flex",children:[s.jsx("div",{style:{width:ll},className:"shrink-0 border-r border-slate-800"}),s.jsx("div",{className:"flex-1 relative flex",children:S.map((X,ie)=>s.jsx("div",{className:"absolute top-0 bottom-0 border-l border-slate-800/50 flex flex-col justify-end pb-1 px-1",style:{left:ie*60},children:s.jsx("span",{className:"text-[10px] font-mono text-slate-500",children:Ls(X,"HH:mm")})},ie))})]}),s.jsx("div",{className:"relative",children:A.map(({providerKey:X,runs:ie})=>s.jsxs("div",{className:"flex border-b border-slate-800/30 min-h-14","data-testid":`provider-execution-lane-${X}`,children:[s.jsxs("div",{style:{width:ll},className:"shrink-0 p-3 border-r border-slate-800/50 flex flex-col justify-center",children:[s.jsx("span",{className:"text-xs font-semibold text-slate-300 truncate",title:X,children:$(X)}),s.jsx("span",{className:"text-[10px] text-slate-500 font-mono truncate",children:X})]}),s.jsxs("div",{className:"flex-1 relative h-14",children:[s.jsx("div",{className:"absolute inset-0 flex pointer-events-none",children:S.map((F,Z)=>s.jsx("div",{className:"h-full border-l border-slate-800/20",style:{width:60}},Z))}),ie.map(F=>{const Z=zf.find(re=>re.id===F.jobType)??zf[0],R=C(F.startedAt),ee=C(F.finishedAt),O=Math.max(ee-R,8),ne=F.status==="running",ae=F.status==="error"||F.status==="failed"||F.status==="errored",he=ne?"bg-green-500":ae?"bg-red-500":Z.color.bg,pe=ne?"border-green-400/60":ae?"border-red-400/60":Z.color.border;return s.jsx("div",{className:`absolute top-1/2 -translate-y-1/2 h-8 rounded border ${he} ${pe} opacity-85 shadow-lg ${ne?"animate-pulse":""}`,style:{left:R,width:O},title:`${X} • ${Z.label} • ${Ls(F.startedAt,"MMM d HH:mm")} • ${F.status}`,"data-testid":"provider-execution-run",children:s.jsxs("div",{className:"h-full px-2 flex items-center justify-between gap-2 text-[10px] text-white/90 overflow-hidden whitespace-nowrap",children:[s.jsx("span",{className:"font-semibold uppercase tracking-wide",children:Z.label}),s.jsx("span",{className:"text-white/70",children:F.status}),F.throttledCount>0&&s.jsxs("span",{className:"text-yellow-100",children:["throttle ",F.throttledCount,"x"]})]})},`${X}-${F.id}-${F.startedAt.getTime()}`)})]})]},X))}),s.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-rose-500/50 z-10 pointer-events-none",style:{left:ll+C(new Date)},children:s.jsx("div",{className:"absolute top-0 h-2 w-2 rounded-full bg-rose-500 -translate-x-1/2"})})]})})]})]})},io=[{label:"Balanced (recommended)",value:"5 */2 * * *",description:"Every 2 hours at minute 5"},{label:"Every 6 hours (very safe)",value:"10 */6 * * *",description:"Every 6 hours at minute 10"},{label:"Every 4 hours",value:"10 */4 * * *",description:"Every 4 hours at minute 10"},{label:"Twice daily",value:"20 2,14 * * *",description:"At 02:20 and 14:20 UTC"},{label:"Daily",value:"30 3 * * *",description:"Once per day at 03:30 UTC"},{label:"Weekdays only",value:"30 9 * * 1-5",description:"At 09:30 UTC, Monday to Friday"},{label:"Weekly (Monday)",value:"40 3 * * 1",description:"At 03:40 UTC every Monday"},{label:"Custom",value:"__custom__",description:"Enter your own cron expression"}],xh=[{id:"night-surge",label:"Night Surge",description:"Dense overnight execution every 2h with daytime reviews.",schedules:{executor:"5 20,22,0,2,4,6 * * *",reviewer:"25 8,14,20 * * *",qa:"45 22,10 * * *",audit:"50 4 * * 1",slicer:"35 19,7 * * *",prResolver:"15 9,15,21 * * *",merger:"55 */4 * * *"},hints:{executor:"8pm–6am every 2h (6 runs)",reviewer:"8:25am, 2:25pm, 8:25pm",qa:"10:45pm & 10:45am",audit:"Mon 4:50am",slicer:"7:35pm & 7:35am",prResolver:"9:15am, 3:15pm, 9:15pm",merger:"Every 4h at :55"}},{id:"always-on",label:"Always On (Recommended)",description:"24/7 with maximum cadence — executor every hour, reviewer every 3h.",schedules:{executor:"5 * * * *",reviewer:"25 */3 * * *",qa:"45 2,10,18 * * *",audit:"50 3 * * 1",slicer:"35 */6 * * *",prResolver:"15 6,14,22 * * *",merger:"55 */4 * * *"},hints:{executor:"Every hour at :05",reviewer:"Every 3h at :25",qa:"2:45am, 10:45am & 6:45pm",audit:"Mon 3:50am",slicer:"Every 6h at :35",prResolver:"6:15am, 2:15pm & 10:15pm",merger:"Every 4h at :55"}},{id:"day-shift",label:"Day Shift",description:"Weekday daytime — hourly executor 8am–8pm, reviews 4x/day.",schedules:{executor:"5 8-20 * * 1-5",reviewer:"25 9,13,17,19 * * 1-5",qa:"45 10,14,18 * * 1-5",audit:"50 9 * * 1",slicer:"35 7 * * 1",prResolver:"15 8,12,16 * * 1-5",merger:"55 */4 * * 1-5"},hints:{executor:"Hourly at :05, 8am–8pm weekdays",reviewer:"9:25am, 1:25pm, 5:25pm, 7:25pm",qa:"10:45am, 2:45pm & 6:45pm weekdays",audit:"Mon 9:50am",slicer:"Mon 7:35am",prResolver:"8:15am, 12:15pm & 4:15pm weekdays",merger:"Every 4h at :55 weekdays"}},{id:"minimal",label:"Minimal",description:"Twice-daily executor and reviewer with weekly heavy jobs.",schedules:{executor:"5 2,14 * * *",reviewer:"25 8,20 * * *",qa:"45 3 * * 0",audit:"50 4 * * 0",slicer:"35 1 * * 1",prResolver:"15 8 * * 1,4",merger:"55 */8 * * *"},hints:{executor:"2:05am & 2:05pm",reviewer:"8:25am & 8:25pm",qa:"Sun 3:45am",audit:"Sun 4:50am",slicer:"Mon 1:35am",prResolver:"Mon & Thu at 8:15am",merger:"Every 8h at :55"}}];function Vr(l){return l?l.trim().replace(/\s+/g," "):""}function Hs(l,r){return Vr(l)===Vr(r)}function Gf(l){if(l)return xh.find(r=>r.id===l)}function Vv(l,r,d,c,f,h,b,N){return Hs(l.schedules.executor,r)&&Hs(l.schedules.reviewer,d)&&Hs(l.schedules.qa,c)&&Hs(l.schedules.audit,f)&&Hs(l.schedules.slicer,h)&&Hs(l.schedules.prResolver,b)&&Hs(l.schedules.merger,N)}function QS(l,r,d,c,f,h,b){return xh.find(N=>Vv(N,l,r,d,c,f,h,b))}function IS(l,r,d,c,f,h,b,N){const y=Gf(l);return y&&Vv(y,r,d,c,f,h,b,N)?y:QS(r,d,c,f,h,b,N)}function ia(l){const r=Vr(l),d=r.split(/\s+/);if(d.length!==5)return r;const[c,f,h,b,N]=d,y=/^\d+$/.test(c),p=io.find(j=>Vr(j.value)===r);if(p)return p.label;if(c==="*/30"&&f==="*")return"Every 30 minutes";if(c==="0"&&f==="*")return"Every hour";if(c.startsWith("*/"))return`Every ${parseInt(c.replace("*/",""),10)} minutes`;if(y&&f.startsWith("*/")&&h==="*"&&b==="*"&&N==="*"){const j=parseInt(f.replace("*/",""),10);return c==="0"?`Every ${j} hours`:`Every ${j} hours at :${c.padStart(2,"0")}`}if(c==="0"&&f.startsWith("*/"))return`Every ${parseInt(f.replace("*/",""),10)} hours`;if(c==="0"&&f.includes("-")){const[j,T]=f.split("-");return`Every hour from ${uu(j)} to ${uu(T)}`}if(y&&f.includes("-")&&h==="*"&&b==="*"&&N==="*"){const[j,T]=f.split("-");return`Every hour from ${cu(j,c)} to ${cu(T,c)}`}if(c==="0"&&f.includes(",")){const j=f.split(",").map(uu);return j.length<=3?`At ${j.join(" and ")}`:`At ${j.slice(0,-1).join(", ")}, and ${j[j.length-1]}`}if(y&&f.includes(",")&&h==="*"&&b==="*"&&(N==="*"||N==="1-5")){const j=f.split(",").map(_=>cu(_,c)),T=N==="1-5"?"Weekdays at ":"At ";return j.length<=3?`${T}${j.join(" and ")}`:`${T}${j.slice(0,-1).join(", ")}, and ${j[j.length-1]}`}return c==="0"&&f!=="*"&&h==="*"&&b==="*"&&N==="*"?`Daily at ${uu(f)}`:y&&f!=="*"&&h==="*"&&b==="*"&&N==="*"?`Daily at ${cu(f,c)}`:c==="0"&&f!=="*"&&h==="*"&&b==="*"&&N==="1-5"?`Weekdays at ${uu(f)}`:y&&f!=="*"&&h==="*"&&b==="*"&&N==="1-5"?`Weekdays at ${cu(f,c)}`:r}function uu(l){const r=parseInt(l,10);return r===0?"12 AM":r<12?`${r} AM`:r===12?"12 PM":`${r-12} PM`}function cu(l,r){const d=r.padStart(2,"0"),c=parseInt(l,10);return Number.isNaN(c)?`${l}:${d}`:c===0?`12:${d} AM`:c<12?`${c}:${d} AM`:c===12?`12:${d} PM`:`${c-12}:${d} PM`}function XS(l){const r=Vr(l),d=io.find(c=>Vr(c.value)===r);return(d==null?void 0:d.value)??"__custom__"}function vx(l){const r=new Date,d=l.getTime()-r.getTime(),c=Math.floor(d/6e4),f=Math.floor(c/60),h=Math.floor(f/24);return c<1?"less than a minute":c<60?`in ${c} minute${c>1?"s":""}`:f<24?`in ${f} hour${f>1?"s":""}`:`in ${h} day${h>1?"s":""}`}const JS=({label:l,value:r,onChange:d,helperText:c,placeholder:f="5 */3 * * *"})=>{const h=XS(r),b=h==="__custom__",N=j=>{j!=="__custom__"&&d(j)},y=j=>{d(j.target.value)},p=io.find(j=>j.value===h);return s.jsxs("div",{className:"space-y-3",children:[s.jsx(dt,{label:l,value:h,onChange:N,options:io.map(j=>({label:j.label,value:j.value})),helperText:b?void 0:(p==null?void 0:p.description)||c}),b&&s.jsxs("div",{className:"space-y-2 mt-2",children:[s.jsx(ke,{label:"Cron Expression",value:r,onChange:y,placeholder:f}),s.jsxs("div",{className:"text-xs text-slate-500 bg-slate-900/40 p-3 rounded-md border border-slate-800/60",children:[s.jsx("strong",{className:"text-slate-400",children:"Format:"})," minute hour day month weekday",s.jsx("br",{}),s.jsx("strong",{className:"text-slate-400",children:"Examples:"})," ",s.jsx("code",{className:"bg-slate-950 px-1 py-0.5 rounded text-indigo-300",children:"0 * * * *"})," (hourly),"," ",s.jsx("code",{className:"bg-slate-950 px-1 py-0.5 rounded text-indigo-300",children:"0 0 * * *"})," (daily at midnight)"]})]})]})},Zl=({id:l,icon:r,title:d,description:c,value:f,onChange:h})=>s.jsxs("div",{id:l,className:"rounded-xl border border-slate-700 bg-slate-800/50 p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"mt-0.5 p-1.5 rounded-md bg-slate-800 text-slate-400",children:s.jsx(r,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-slate-200",children:d}),s.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:c})]})]}),s.jsx(JS,{label:"",value:f,onChange:h})]}),KS=({form:l,scheduleMode:r,selectedTemplateId:d,onFieldChange:c,onSwitchToTemplate:f,onSwitchToCustom:h,onApplyTemplate:b})=>s.jsxs(ft,{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200 mb-1",children:"Job Schedules"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Configure when automated jobs run using a preset template or custom cron expressions"}),s.jsx("p",{className:"text-xs text-slate-500 mt-2 mb-2",children:"This tab only controls cadence. Runtime and provider settings live in the Jobs tab."})]}),s.jsxs("div",{className:"flex rounded-lg border border-slate-700 overflow-hidden shrink-0",children:[s.jsx("button",{type:"button",className:`px-4 py-1.5 text-sm font-medium transition-colors ${r==="template"?"bg-indigo-600 text-white":"bg-slate-800 text-slate-400 hover:text-slate-200"}`,onClick:f,children:"Template"}),s.jsx("button",{type:"button",className:`px-4 py-1.5 text-sm font-medium transition-colors ${r==="custom"?"bg-indigo-600 text-white":"bg-slate-800 text-slate-400 hover:text-slate-200"}`,onClick:h,children:"Custom"})]})]}),r==="template"?s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:xh.map(N=>{const y=d===N.id;return s.jsxs("button",{type:"button",onClick:()=>b(N),className:`text-left p-4 rounded-lg border transition-colors ${y?"border-indigo-500 bg-indigo-950/40":"border-slate-700 bg-slate-800/30 hover:border-slate-600"}`,children:[s.jsx("div",{className:"font-medium text-slate-200 mb-1",children:N.label}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:N.description}),s.jsx("div",{className:"space-y-0.5",children:[["Executor",N.hints.executor],["Reviewer",N.hints.reviewer],["QA",N.hints.qa],["Audit",N.hints.audit],["Planner",N.hints.slicer],["PR Resolver",N.hints.prResolver],["Merger",N.hints.merger]].map(([p,j])=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-slate-500 w-16 shrink-0",children:p}),s.jsx("span",{className:"text-xs text-slate-400",children:j})]},p))})]},N.id)})}):s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(Zl,{id:"job-schedule-executor",icon:vn,title:"PRD Executor",description:"Executes PRDs to generate code and create PRs",value:l.cronSchedule,onChange:N=>c("cronSchedule",N)}),s.jsx(Zl,{id:"job-schedule-reviewer",icon:rh,title:"PR Reviewer",description:"Reviews PRs and provides feedback or automated fixes",value:l.reviewerSchedule,onChange:N=>c("reviewerSchedule",N)}),s.jsx(Zl,{id:"job-schedule-qa",icon:Ix,title:"Quality Assurance",description:"Automated UI testing using Playwright",value:l.qa.schedule,onChange:N=>c("qa",{...l.qa,schedule:N})}),s.jsx(Zl,{id:"job-schedule-audit",icon:$r,title:"Code Audit",description:"Automated code quality and security audits",value:l.audit.schedule,onChange:N=>c("audit",{...l.audit,schedule:N})}),s.jsx(Zl,{id:"job-schedule-slicer",icon:uh,title:"Planner",description:"Generate PRDs from ROADMAP.md or audit findings",value:l.roadmapScanner.slicerSchedule,onChange:N=>c("roadmapScanner",{...l.roadmapScanner,slicerSchedule:N})}),l.analytics&&s.jsx(Zl,{id:"job-schedule-analytics",icon:lh,title:"Analytics",description:"Fetch Amplitude data, analyze with AI, and create issues",value:l.analytics.schedule,onChange:N=>c("analytics",{...l.analytics,schedule:N})}),l.prResolver&&s.jsx(Zl,{id:"job-schedule-pr-resolver",icon:ih,title:"PR Resolver",description:"Rebases PRs and applies review feedback",value:l.prResolver.schedule,onChange:N=>c("prResolver",{...l.prResolver,schedule:N})}),l.merger&&s.jsx(Zl,{id:"job-schedule-merger",icon:ho,title:"Merge Orchestrator",description:"Scans, rebases, and merges approved PRs",value:l.merger.schedule,onChange:N=>c("merger",{...l.merger,schedule:N})})]})]}),du=({label:l,value:r=[],onChange:d,placeholder:c,helpText:f})=>{const[h,b]=ze.useState(""),N=()=>{h.trim()&&!r.includes(h.trim())&&(d([...r,h.trim()]),b(""))},y=j=>{d(r.filter(T=>T!==j))},p=j=>{j.key==="Enter"&&(j.preventDefault(),N())};return s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:l}),s.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:r.map(j=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-slate-800 rounded text-sm text-slate-300",children:[j,s.jsx("button",{type:"button",onClick:()=>y(j),className:"text-slate-500 hover:text-red-400","aria-label":`Remove ${j}`,title:`Remove ${j}`,children:s.jsx(Gr,{className:"h-3 w-3"})})]},j))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:h,onChange:j=>b(j.target.value),onKeyDown:p,placeholder:c,className:"flex-1 bg-slate-800 border border-slate-700 rounded px-3 py-2 text-sm text-slate-200 placeholder-slate-500"}),s.jsx(Ve,{onClick:N,disabled:!h.trim(),"aria-label":`Add ${l.toLowerCase()} value`,children:s.jsx($s,{className:"h-4 w-4"})})]}),f&&s.jsx("p",{className:"text-xs text-slate-500 mt-1",children:f})]})},Wl=({title:l,icon:r,description:d,enabled:c,onToggle:f,expanded:h,onExpandChange:b,scheduleSummary:N,providerLabel:y,children:p,id:j})=>s.jsxs("div",{id:j,className:`border border-slate-800 rounded-xl overflow-hidden transition-all duration-200 ${h?"bg-slate-900/50 ring-1 ring-indigo-500/20":"bg-slate-900/20 hover:bg-slate-900/40"}`,children:[s.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer select-none",onClick:()=>b(!h),children:[s.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[s.jsx("div",{className:`p-2 rounded-lg ${h?"bg-indigo-500/20 text-indigo-400":"bg-slate-800 text-slate-400"}`,children:s.jsx(r,{className:"h-5 w-5"})}),s.jsxs("div",{className:"overflow-hidden",children:[s.jsx("h3",{className:"text-sm font-medium text-slate-200 truncate",children:l}),!h&&s.jsx("p",{className:"text-xs text-slate-500 truncate",children:d})]})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[!h&&s.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[N&&s.jsx(Ia,{variant:"neutral",className:"bg-slate-800/50 text-[10px]",children:N}),y&&s.jsx(Ia,{variant:"info",className:"bg-blue-500/5 text-[10px]",children:y})]}),s.jsx("div",{onClick:T=>T.stopPropagation(),children:s.jsx(Qa,{checked:c,onChange:f})}),s.jsx(sh,{className:`h-5 w-5 text-slate-500 transition-transform duration-300 ${h?"rotate-180 text-indigo-400":""}`})]})]}),s.jsx("div",{className:`grid transition-all duration-300 ease-in-out ${h?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:s.jsx("div",{className:"overflow-hidden",children:s.jsx("div",{className:"p-6 pt-0 space-y-6 border-t border-slate-800/50 mt-2",children:s.jsx("div",{className:"pt-6",children:p})})})})]}),Ql=({summary:l,onOpen:r})=>s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-slate-800 bg-slate-950/50 p-4 md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Cadence"}),s.jsx("div",{className:"mt-1 text-sm font-medium text-slate-200",children:l}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Managed centrally in Automation > Schedules."})]}),s.jsx(Ve,{variant:"outline",size:"sm",onClick:r,className:"border-slate-700 text-slate-300 hover:bg-slate-800",children:"Open Schedules"})]}),ej=({form:l,updateField:r,handleRoadmapToggle:d,presetOptions:c,expandedJob:f,onExpandedJobChange:h,onOpenSchedule:b})=>{var p,j,T,_,k,S,C,A,$,B;const N=(M,X)=>{const ie={...l.jobProviders};X===""?delete ie[M]:ie[M]=X,r("jobProviders",ie)},y=[{label:"Use Global (default)",value:""},...c];return s.jsx("div",{className:"space-y-8",children:s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-slate-800/50",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"Job Configurations"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Enable jobs, choose providers, and tune runtime behavior. Cadence stays in Automation > Schedules."})]}),s.jsx("span",{className:"text-xs text-slate-500",children:"8 total jobs"})]}),s.jsx(Wl,{id:"job-section-executor",title:"PRD Executor",icon:vn,description:"Executes PRDs to generate code and create PRs",enabled:l.executorEnabled,onToggle:M=>r("executorEnabled",M),expanded:f==="executor",onExpandChange:M=>h(M?"executor":null),scheduleSummary:ia(l.cronSchedule),providerLabel:l.jobProviders.executor?(p=c.find(M=>M.value===l.jobProviders.executor))==null?void 0:p.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.cronSchedule),onOpen:()=>b("executor")}),s.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.executor??"",onChange:M=>N("executor",M),options:y}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.maxRuntime),onChange:M=>r("maxRuntime",Number(M.target.value||0)),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"}),helperText:"Maximum runtime for executor tasks"})]})]})}),s.jsx(Wl,{id:"job-section-reviewer",title:"PR Reviewer",icon:rh,description:"Reviews PRs and provides feedback or automated fixes",enabled:l.reviewerEnabled,onToggle:M=>r("reviewerEnabled",M),expanded:f==="reviewer",onExpandChange:M=>h(M?"reviewer":null),scheduleSummary:ia(l.reviewerSchedule),providerLabel:l.jobProviders.reviewer?(j=c.find(M=>M.value===l.jobProviders.reviewer))==null?void 0:j.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.reviewerSchedule),onOpen:()=>b("reviewer")}),s.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.reviewer??"",onChange:M=>N("reviewer",M),options:y}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.reviewerMaxRuntime),onChange:M=>r("reviewerMaxRuntime",Number(M.target.value||0)),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(ke,{label:"Min Review Score",type:"number",min:"0",max:"100",value:String(l.minReviewScore),onChange:M=>r("minReviewScore",Number(M.target.value||0)),helperText:"PRs below this score will be marked as 'Needs Work'"}),s.jsx(ke,{label:"Max Retries",type:"number",value:String(l.reviewerMaxRetries),onChange:M=>r("reviewerMaxRetries",Number(M.target.value||0)),helperText:"Fix attempts after initial review"}),s.jsx(ke,{label:"Retry Delay",type:"number",value:String(l.reviewerRetryDelay),onChange:M=>r("reviewerRetryDelay",Number(M.target.value||0)),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx("div",{className:"md:col-span-2",children:s.jsx(ke,{label:"Max PRs Per Run",type:"number",value:String(l.reviewerMaxPrsPerRun),onChange:M=>r("reviewerMaxPrsPerRun",Number(M.target.value||0)),helperText:"Hard cap on PRs processed per run (0 = unlimited)"})})]})]})}),s.jsx(Wl,{id:"job-section-qa",title:"Quality Assurance",icon:Ix,description:"Automated UI testing using Playwright",enabled:l.qa.enabled,onToggle:M=>r("qa",{...l.qa,enabled:M}),expanded:f==="qa",onExpandChange:M=>h(M?"qa":null),scheduleSummary:ia(l.qa.schedule),providerLabel:l.jobProviders.qa?(T=c.find(M=>M.value===l.jobProviders.qa))==null?void 0:T.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.qa.schedule),onOpen:()=>b("qa")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.qa??"",onChange:M=>N("qa",M),options:y}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.qa.maxRuntime),onChange:M=>r("qa",{...l.qa,maxRuntime:Number(M.target.value||0)}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(dt,{label:"Artifacts",value:l.qa.artifacts,onChange:M=>r("qa",{...l.qa,artifacts:M}),options:[{label:"Screenshots",value:"screenshot"},{label:"Videos",value:"video"},{label:"Both",value:"both"}]}),s.jsx(ke,{label:"Skip Label",value:l.qa.skipLabel,onChange:M=>r("qa",{...l.qa,skipLabel:M.target.value}),helperText:"GitHub label to skip QA"}),s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-slate-800 bg-slate-950/40 mt-1.5",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Auto-install Playwright"}),s.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Install browsers if missing"})]}),s.jsx(Qa,{checked:l.qa.autoInstallPlaywright,onChange:M=>r("qa",{...l.qa,autoInstallPlaywright:M})})]})]}),s.jsx(du,{label:"QA Branch Patterns",value:l.qa.branchPatterns,onChange:M=>r("qa",{...l.qa,branchPatterns:M}),placeholder:"e.g., qa/, test/",helpText:"Branch patterns to match for QA"})]})}),s.jsx(Wl,{id:"job-section-audit",title:"Code Audit",icon:$r,description:"Automated code quality and security audits",enabled:l.audit.enabled,onToggle:M=>r("audit",{...l.audit,enabled:M}),expanded:f==="audit",onExpandChange:M=>h(M?"audit":null),scheduleSummary:ia(l.audit.schedule),providerLabel:l.jobProviders.audit?(_=c.find(M=>M.value===l.jobProviders.audit))==null?void 0:_.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.audit.schedule),onOpen:()=>b("audit")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.audit??"",onChange:M=>N("audit",M),options:y}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.audit.maxRuntime),onChange:M=>r("audit",{...l.audit,maxRuntime:Number(M.target.value||0)}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(dt,{label:"Target Column",value:l.audit.targetColumn,onChange:M=>r("audit",{...l.audit,targetColumn:M}),options:[{value:"Draft",label:"Draft"},{value:"Ready",label:"Ready"},{value:"In Progress",label:"In Progress"},{value:"Review",label:"Review"},{value:"Done",label:"Done"}]})]})]})}),s.jsx(Wl,{id:"job-section-slicer",title:"Planner",icon:uh,description:"Generate one PRD per run using ROADMAP.md or audit findings",enabled:l.roadmapScanner.enabled,onToggle:d,expanded:f==="slicer",onExpandChange:M=>h(M?"slicer":null),scheduleSummary:ia(l.roadmapScanner.slicerSchedule),providerLabel:l.jobProviders.slicer?(k=c.find(M=>M.value===l.jobProviders.slicer))==null?void 0:k.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.roadmapScanner.slicerSchedule),onOpen:()=>b("slicer")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.slicer??"",onChange:M=>N("slicer",M),options:y}),s.jsx(ke,{label:"Roadmap File Path",value:l.roadmapScanner.roadmapPath,onChange:M=>r("roadmapScanner",{...l.roadmapScanner,roadmapPath:M.target.value}),helperText:"Primary planning source (relative to project root)."}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.roadmapScanner.slicerMaxRuntime||""),onChange:M=>r("roadmapScanner",{...l.roadmapScanner,slicerMaxRuntime:Number(M.target.value||0)}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(dt,{label:"Priority Mode",value:l.roadmapScanner.priorityMode||"roadmap-first",onChange:M=>r("roadmapScanner",{...l.roadmapScanner,priorityMode:M==="audit-first"?"audit-first":"roadmap-first"}),options:[{label:"Roadmap first (recommended)",value:"roadmap-first"},{label:"Audit first",value:"audit-first"}]}),s.jsx(dt,{label:"Issue Column",value:l.roadmapScanner.issueColumn||"Ready",onChange:M=>r("roadmapScanner",{...l.roadmapScanner,issueColumn:M==="Draft"?"Draft":"Ready"}),options:[{label:"Ready (default)",value:"Ready"},{label:"Draft",value:"Draft"}]})]})]})}),s.jsx(Wl,{id:"job-section-analytics",title:"Analytics (Amplitude)",icon:lh,description:"Fetch Amplitude data, analyze with AI, and create board issues",enabled:l.analytics.enabled,onToggle:M=>r("analytics",{...l.analytics,enabled:M}),expanded:f==="analytics",onExpandChange:M=>h(M?"analytics":null),scheduleSummary:ia(l.analytics.schedule),providerLabel:l.jobProviders.analytics?(S=c.find(M=>M.value===l.jobProviders.analytics))==null?void 0:S.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.analytics.schedule),onOpen:()=>b("analytics")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.analytics??"",onChange:M=>N("analytics",M),options:y}),s.jsx(ke,{label:"Amplitude API Key",value:((C=l.providerEnv)==null?void 0:C.AMPLITUDE_API_KEY)??"",onChange:M=>r("providerEnv",{...l.providerEnv,AMPLITUDE_API_KEY:M.target.value}),placeholder:"Required"}),s.jsx(ke,{label:"Amplitude Secret Key",type:"password",value:((A=l.providerEnv)==null?void 0:A.AMPLITUDE_SECRET_KEY)??"",onChange:M=>r("providerEnv",{...l.providerEnv,AMPLITUDE_SECRET_KEY:M.target.value}),placeholder:"Required"}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.analytics.maxRuntime),onChange:M=>r("analytics",{...l.analytics,maxRuntime:Number(M.target.value||0)}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(ke,{label:"Lookback Days",type:"number",min:"1",max:"90",value:String(l.analytics.lookbackDays),onChange:M=>r("analytics",{...l.analytics,lookbackDays:Math.max(1,Math.min(90,Number(M.target.value||7)))})}),s.jsx(dt,{label:"Target Column",value:l.analytics.targetColumn,onChange:M=>r("analytics",{...l.analytics,targetColumn:M}),options:[{value:"Draft",label:"Draft"},{value:"Ready",label:"Ready"},{value:"In Progress",label:"In Progress"},{value:"Review",label:"Review"},{value:"Done",label:"Done"}]}),s.jsxs("div",{className:"md:col-span-2",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-1.5",children:"Analysis Prompt (optional)"}),s.jsx("textarea",{rows:4,value:l.analytics.analysisPrompt??"",onChange:M=>r("analytics",{...l.analytics,analysisPrompt:M.target.value}),placeholder:"Custom prompt for AI analysis. Leave empty to use default.",className:"w-full bg-slate-950/50 border border-white/10 text-slate-200 rounded-lg px-3 py-2.5 text-sm placeholder-slate-600 focus:outline-none focus:border-indigo-500/50 focus:ring-1 focus:ring-indigo-500/20 resize-y"})]})]})]})}),s.jsx(Wl,{id:"job-section-pr-resolver",title:"PR Resolver",icon:ih,description:"Repo-wide conflict resolver that rebases PRs and applies feedback",enabled:l.prResolver.enabled,onToggle:M=>r("prResolver",{...l.prResolver,enabled:M}),expanded:f==="pr-resolver",onExpandChange:M=>h(M?"pr-resolver":null),scheduleSummary:ia(l.prResolver.schedule),providerLabel:l.jobProviders["pr-resolver"]?($=c.find(M=>M.value===l.jobProviders["pr-resolver"]))==null?void 0:$.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.prResolver.schedule),onOpen:()=>b("pr-resolver")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders["pr-resolver"]??"",onChange:M=>N("pr-resolver",M),options:y}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.prResolver.maxRuntime),onChange:M=>r("prResolver",{...l.prResolver,maxRuntime:Number(M.target.value||0)}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(ke,{label:"Per-PR Timeout",type:"number",value:String(l.prResolver.perPrTimeout),onChange:M=>r("prResolver",{...l.prResolver,perPrTimeout:Math.max(0,Number(M.target.value||0))}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(ke,{label:"Max PRs Per Run",type:"number",min:"0",value:String(l.prResolver.maxPrsPerRun),onChange:M=>r("prResolver",{...l.prResolver,maxPrsPerRun:Math.max(0,Number(M.target.value||0))})}),s.jsx(ke,{label:"Ready Label",value:l.prResolver.readyLabel,onChange:M=>r("prResolver",{...l.prResolver,readyLabel:M.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-slate-800 bg-slate-950/40",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-slate-200",children:"AI conflict resolution"}),s.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"AI help for non-trivial rebases"})]}),s.jsx(Qa,{checked:l.prResolver.aiConflictResolution,onChange:M=>r("prResolver",{...l.prResolver,aiConflictResolution:M})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-slate-800 bg-slate-950/40",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-slate-200",children:"AI review resolution"}),s.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Implement open review comments"})]}),s.jsx(Qa,{checked:l.prResolver.aiReviewResolution,onChange:M=>r("prResolver",{...l.prResolver,aiReviewResolution:M})})]})]}),s.jsx(du,{label:"PR Resolver Branch Patterns",value:l.prResolver.branchPatterns,onChange:M=>r("prResolver",{...l.prResolver,branchPatterns:M}),placeholder:"e.g., feat/, night-watch/",helpText:"Branch patterns to filter PRs (empty = all)"})]})}),s.jsx(Wl,{id:"job-section-merger",title:"Merge Orchestrator",icon:ho,description:"Repo-wide PR merge coordinator — scans, rebases, and merges",enabled:l.merger.enabled,onToggle:M=>r("merger",{...l.merger,enabled:M}),expanded:f==="merger",onExpandChange:M=>h(M?"merger":null),scheduleSummary:ia(l.merger.schedule),providerLabel:l.jobProviders.merger?(B=c.find(M=>M.value===l.jobProviders.merger))==null?void 0:B.label:"Global",children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ql,{summary:ia(l.merger.schedule),onOpen:()=>b("merger")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Provider",value:l.jobProviders.merger??"",onChange:M=>N("merger",M),options:y}),s.jsx(ke,{label:"Max Runtime",type:"number",value:String(l.merger.maxRuntime),onChange:M=>r("merger",{...l.merger,maxRuntime:Number(M.target.value||0)}),rightIcon:s.jsx("span",{className:"text-xs",children:"sec"})}),s.jsx(dt,{label:"Merge Method",value:l.merger.mergeMethod,onChange:M=>r("merger",{...l.merger,mergeMethod:M}),options:[{label:"Squash",value:"squash"},{label:"Merge",value:"merge"},{label:"Rebase",value:"rebase"}]}),s.jsx(ke,{label:"Min Review Score",type:"number",min:"0",max:"100",value:String(l.merger.minReviewScore),onChange:M=>r("merger",{...l.merger,minReviewScore:Math.max(0,Math.min(100,Number(M.target.value||0)))})}),s.jsx(ke,{label:"Max PRs Per Run",type:"number",min:"0",value:String(l.merger.maxPrsPerRun),onChange:M=>r("merger",{...l.merger,maxPrsPerRun:Math.max(0,Number(M.target.value||0))})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-slate-800 bg-slate-950/40",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Rebase before merge"}),s.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Rebase each PR against its base branch"})]}),s.jsx(Qa,{checked:l.merger.rebaseBeforeMerge,onChange:M=>r("merger",{...l.merger,rebaseBeforeMerge:M})})]}),s.jsx(du,{label:"Merger Branch Patterns",value:l.merger.branchPatterns,onChange:M=>r("merger",{...l.merger,branchPatterns:M}),placeholder:"e.g., feat/, night-watch/"})]})})]})})},Bv="5 * * * *",Yv="25 */3 * * *",tj={enabled:!0,roadmapPath:"ROADMAP.md",autoScanInterval:300,slicerSchedule:"35 */6 * * *",slicerMaxRuntime:600,priorityMode:"roadmap-first",issueColumn:"Ready"},px={enabled:!0,schedule:"45 2,10,18 * * *",maxRuntime:3600,branchPatterns:[],artifacts:"both",skipLabel:"skip-qa",autoInstallPlaywright:!0},aj={enabled:!0,schedule:"50 3 * * 1",maxRuntime:1800,targetColumn:"Draft"},nj={enabled:!1,schedule:"0 6 * * 1",maxRuntime:900,lookbackDays:7,targetColumn:"Draft",analysisPrompt:""},yx={enabled:!0,schedule:"15 6,14,22 * * *",maxRuntime:3600,branchPatterns:[],maxPrsPerRun:0,perPrTimeout:600,aiConflictResolution:!0,aiReviewResolution:!1,readyLabel:"ready-to-merge"},bx={enabled:!1,schedule:"55 */4 * * *",maxRuntime:1800,mergeMethod:"squash",minReviewScore:80,branchPatterns:[],rebaseBeforeMerge:!0,maxPrsPerRun:0};function Br(){return{...tj}}function Pv(){return{...px,branchPatterns:[...px.branchPatterns]}}function $v(){return{...aj}}function vh(){return{...nj}}function mu(){return{...yx,branchPatterns:[...yx.branchPatterns]}}function xo(){return{...bx,branchPatterns:[...bx.branchPatterns]}}const uo=["claude","claude-sonnet-4-6","claude-opus-4-6","codex","glm-47","glm-5"],Fv={claude:{name:"Claude",command:"claude",promptFlag:"-p",autoApproveFlag:"--dangerously-skip-permissions"},"claude-sonnet-4-6":{name:"Claude Sonnet 4.6",command:"claude",promptFlag:"-p",autoApproveFlag:"--dangerously-skip-permissions",modelFlag:"--model",model:"claude-sonnet-4-6"},"claude-opus-4-6":{name:"Claude Opus 4.6",command:"claude",promptFlag:"-p",autoApproveFlag:"--dangerously-skip-permissions",modelFlag:"--model",model:"claude-opus-4-6"},codex:{name:"Codex",command:"codex",subcommand:"exec",autoApproveFlag:"--yolo",workdirFlag:"-C"},"glm-47":{name:"GLM-4.7",command:"claude",promptFlag:"-p",autoApproveFlag:"--dangerously-skip-permissions",modelFlag:"--model",model:"glm-4.7",envVars:{ANTHROPIC_BASE_URL:"https://api.z.ai/api/anthropic",API_TIMEOUT_MS:"3000000",ANTHROPIC_DEFAULT_OPUS_MODEL:"glm-4.7",ANTHROPIC_DEFAULT_SONNET_MODEL:"glm-4.7"}},"glm-5":{name:"GLM-5",command:"claude",promptFlag:"-p",autoApproveFlag:"--dangerously-skip-permissions",modelFlag:"--model",model:"glm-5",envVars:{ANTHROPIC_BASE_URL:"https://api.z.ai/api/anthropic",API_TIMEOUT_MS:"3000000",ANTHROPIC_DEFAULT_OPUS_MODEL:"glm-5",ANTHROPIC_DEFAULT_SONNET_MODEL:"glm-5"}}},lj={enabled:!0,mode:"conservative",maxConcurrency:1,maxWaitTime:7200,priority:{executor:50,reviewer:40,slicer:30,qa:20,audit:10},providerBuckets:{}},sj=["executor","reviewer","qa","audit","slicer","analytics","pr-resolver","merger"],rj=new Set(["overview","schedules","jobs"]),Uf=l=>{if(!l)return null;const r=l==="planner"?"slicer":l;return["executor","reviewer","qa","audit","slicer","analytics","pr-resolver","merger"].includes(r)?r:null},Ic=l=>({cronSchedule:l.cronSchedule||Bv,reviewerSchedule:l.reviewerSchedule||Yv,scheduleBundleId:l.scheduleBundleId??null,cronScheduleOffset:l.cronScheduleOffset??0,schedulingPriority:l.schedulingPriority??3,executorEnabled:l.executorEnabled??!0,reviewerEnabled:l.reviewerEnabled??!1,maxRuntime:l.maxRuntime??3600,reviewerMaxRuntime:l.reviewerMaxRuntime??1800,maxRetries:l.maxRetries??3,reviewerMaxRetries:l.reviewerMaxRetries??2,reviewerRetryDelay:l.reviewerRetryDelay??30,reviewerMaxPrsPerRun:l.reviewerMaxPrsPerRun??0,minReviewScore:l.minReviewScore??70,branchPatterns:l.branchPatterns||[],providerEnv:l.providerEnv||{},jobProviders:l.jobProviders||{},providerPresets:l.providerPresets??{},qa:l.qa||Pv(),audit:l.audit||$v(),analytics:l.analytics||vh(),prResolver:l.prResolver??mu(),merger:l.merger??xo(),roadmapScanner:l.roadmapScanner||Br(),queue:l.queue||lj}),eo=l=>{var r,d;return IS(l.scheduleBundleId,l.cronSchedule,l.reviewerSchedule,l.qa.schedule,l.audit.schedule,l.roadmapScanner.slicerSchedule??Br().slicerSchedule,((r=l.prResolver)==null?void 0:r.schedule)??mu().schedule,((d=l.merger)==null?void 0:d.schedule)??xo().schedule)},Xc=l=>{const r=eo(l);return!l.scheduleBundleId&&r?{form:{...l,scheduleBundleId:r.id},detectedTemplate:r}:{form:l,detectedTemplate:r}},ij=()=>{var kn,Zs,cl,Qe,ol,mt,Vt,At,_t;const l=_n(),{addToast:r,selectedProjectId:d,globalModeLoading:c}=Wt(),[f,h]=U.useState(!1),[b,N]=U.useState(!1),[y,p]=U.useState(!1),[j,T]=U.useState(null),[_,k]=U.useState([]),[S,C]=U.useState(null),[A,$]=U.useState(null),[B,M]=U.useState("overview"),[X,ie]=U.useState(null),[F,Z]=U.useState(null),[R,ee]=U.useState(null),[O,ne]=U.useState("template"),[ae,he]=U.useState(""),[pe,re]=U.useState(!1),[P,te]=U.useState(!1),de=U.useRef(null),me=U.useRef(!1),_e=U.useRef(null),{data:L,loading:le,error:ge,refetch:ve}=pn(rv,[d],{enabled:!c}),{data:we,loading:xe,refetch:Te}=pn(hh,[d],{enabled:!c});U.useEffect(()=>{if(c)return;const oe=()=>{ve(),qg().then(C).catch(()=>{}),H2(24).then($).catch(()=>{}),R2().then(k).catch(()=>{})};oe();const Ne=setInterval(oe,3e4);return()=>clearInterval(Ne)},[d,c,ve]),U.useEffect(()=>{if(!we)return;if(me.current){me.current=!1;return}const{form:oe,detectedTemplate:Ne}=Xc(Ic(we));ee(oe),de.current=oe,ne(Ne?"template":"custom"),he((Ne==null?void 0:Ne.id)??""),re(!1)},[we]),U.useEffect(()=>{!R||!de.current||re(JSON.stringify(R)!==JSON.stringify(de.current))},[R]),U.useEffect(()=>{if(B!=="jobs"||!X)return;const oe=window.setTimeout(()=>{const Ne=document.getElementById(`job-section-${X}`);Ne&&Ne.scrollIntoView({behavior:"smooth",block:"center"})},100);return()=>window.clearTimeout(oe)},[B,X]),U.useEffect(()=>{if(B!=="schedules"||O!=="custom"||!F)return;const oe=F,Ne=window.setTimeout(()=>{const tt=document.getElementById(`job-schedule-${oe}`);tt&&tt.scrollIntoView({behavior:"smooth",block:"center"}),Z(null)},100);return()=>window.clearTimeout(Ne)},[B,O,F]);const Ze=(oe,Ne)=>{ee(tt=>tt&&{...tt,[oe]:Ne})},We=()=>{if(ne("template"),!R)return;const oe=eo(R);if(oe){he(oe.id),Ze("scheduleBundleId",oe.id);return}const Ne=Gf(ae)??Gf("always-on");Ne&&Ja(Ne)},Dt=()=>{ne("custom"),Ze("scheduleBundleId",null),he("")},da=oe=>{const Ne=Uf(oe);Ne&&(O!=="custom"&&Dt(),M("schedules"),Z(Ne))},Ja=oe=>{he(oe.id),ee(Ne=>Ne&&{...Ne,cronSchedule:oe.schedules.executor,reviewerSchedule:oe.schedules.reviewer,scheduleBundleId:oe.id,qa:{...Ne.qa,schedule:oe.schedules.qa},audit:{...Ne.audit,schedule:oe.schedules.audit},roadmapScanner:{...Ne.roadmapScanner,slicerSchedule:oe.schedules.slicer},prResolver:{...Ne.prResolver,schedule:oe.schedules.prResolver},merger:{...Ne.merger,schedule:oe.schedules.merger}})},Ka=async()=>{if(R){te(!0);try{const oe={};for(const bt of sj){const kt=R.jobProviders[bt];typeof kt=="string"&&kt.trim().length>0?oe[bt]=kt:we!=null&&we.jobProviders[bt]&&(oe[bt]=null)}const Ne=await so({cronSchedule:R.cronSchedule,reviewerSchedule:R.reviewerSchedule,scheduleBundleId:O==="template"?R.scheduleBundleId:null,cronScheduleOffset:R.cronScheduleOffset,schedulingPriority:R.schedulingPriority,executorEnabled:R.executorEnabled,reviewerEnabled:R.reviewerEnabled,maxRuntime:R.maxRuntime,reviewerMaxRuntime:R.reviewerMaxRuntime,maxRetries:R.maxRetries,reviewerMaxRetries:R.reviewerMaxRetries,reviewerRetryDelay:R.reviewerRetryDelay,reviewerMaxPrsPerRun:R.reviewerMaxPrsPerRun,minReviewScore:R.minReviewScore,branchPatterns:R.branchPatterns,providerEnv:R.providerEnv,jobProviders:oe,qa:R.qa,audit:R.audit,analytics:R.analytics,prResolver:R.prResolver,merger:R.merger,roadmapScanner:R.roadmapScanner,queue:R.queue}),{form:tt}=Xc(Ic(Ne));ee(tt),de.current=tt,re(!1);let jt="";try{await ou()}catch(bt){jt=bt instanceof Error?bt.message:"Failed to reinstall cron"}r(jt?{title:"Saved (Cron Reinstall Failed)",message:jt,type:"warning"}:{title:"Saved",message:"Configuration updated and cron schedules reinstalled.",type:"success"}),me.current=!0,Te()}catch(oe){r({title:"Save Failed",message:oe instanceof Error?oe.message:"Failed to save configuration",type:"error"})}finally{te(!1)}}},fa=()=>{if(de.current){ee(de.current);const oe=de.current,Ne=eo(oe);ne(Ne?"template":"custom"),he((Ne==null?void 0:Ne.id)??""),re(!1)}},ha=async oe=>{try{const Ne=await dv(oe),{form:tt}=Xc(Ic(Ne));ee(tt),de.current=tt,re(!1);let jt="";try{await ou()}catch(bt){jt=bt instanceof Error?bt.message:"Failed to reinstall cron"}r(jt?{title:"Saved (Cron Reinstall Failed)",message:jt,type:"warning"}:{title:oe?"Roadmap Scanner Enabled":"Roadmap Scanner Disabled",message:`Roadmap scanner has been ${oe?"enabled":"disabled"}.`,type:"success"}),me.current=!0,Te(),ve()}catch(Ne){r({title:"Toggle Failed",message:Ne instanceof Error?Ne.message:"Failed to toggle roadmap scanner",type:"error"})}},yn=async()=>{if(L){h(!0);try{L.paused?(await ou(),r({title:"Schedule Resumed",message:"Cron schedules are active.",type:"success"})):(await uv(),r({title:"Schedule Paused",message:"Cron schedules are deactivated.",type:"info"})),ve()}catch(oe){r({title:"Action Failed",message:oe instanceof Error?oe.message:"Toggle failed",type:"error"})}finally{h(!1)}}},$t=async()=>{if(window.confirm("Are you sure you want to clear all pending jobs?")){N(!0);try{const oe=await q2();r({title:"Queue Cleared",message:`Removed ${oe.cleared} pending jobs.`,type:"success"}),qg().then(C)}catch(oe){r({title:"Clear Failed",message:oe instanceof Error?oe.message:"Failed to clear queue",type:"error"})}finally{N(!1)}}},ua=async oe=>{if(R){te(!0);try{const Ne=await so({queue:{...R.queue,...oe}}),{form:tt}=Xc(Ic(Ne));ee(tt),de.current=tt,re(!1),r({title:"Settings Saved",message:"Queue configuration updated.",type:"success"}),me.current=!0,Te(),ve()}catch(Ne){r({title:"Save Failed",message:Ne instanceof Error?Ne.message:"Save failed",type:"error"})}finally{te(!1)}}},en=async oe=>{const Ne=oe==="planner"?"slicer":oe;T(oe);try{await iv(Ne),r({title:"Job Triggered",message:`${oe} job queued successfully.`,type:"success"})}catch(tt){r({title:"Trigger Failed",message:tt instanceof Error?tt.message:"Failed to trigger job",type:"error"})}finally{T(null)}},tn=oe=>{const Ne=Uf(oe);Ne&&(M("jobs"),ie(Ne))};U.useEffect(()=>{if(!R||_e.current===l.search)return;_e.current=l.search;const oe=new URLSearchParams(l.search),Ne=oe.get("tab"),tt=Ne==="queue"?"overview":Ne,jt=oe.get("mode"),bt=Uf(oe.get("jobType"));if(tt&&rj.has(tt)){if(tt==="jobs"){M("jobs"),bt&&ie(bt);return}if(tt==="schedules"){if(bt){da(bt);return}M("schedules"),jt==="custom"&&O!=="custom"&&Dt(),jt==="template"&&O!=="template"&&We();return}M(tt);return}jt==="custom"&&O!=="custom"&&(M("schedules"),Dt()),jt==="template"&&O!=="template"&&(M("schedules"),We())},[l.search,R,O]);const an=U.useMemo(()=>{const oe={...Fv,...(R==null?void 0:R.providerPresets)??{}};return Object.entries(oe).map(([Ne,tt])=>({label:tt.name||Ne,value:Ne}))},[R==null?void 0:R.providerPresets]);if(le||xe||!R)return s.jsx("div",{className:"flex items-center justify-center min-h-[400px] text-slate-500",children:"Loading automation state..."});if(ge||!L||!we)return s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] space-y-4",children:[s.jsx(Dn,{className:"h-10 w-10 text-red-500"}),s.jsx("div",{className:"text-slate-300 font-medium",children:"Failed to load scheduling data"}),s.jsx(Ve,{onClick:()=>{ve(),Te()},children:"Retry"})]});const Ua=L.paused,bn=R?eo(R):void 0,Qt=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[s.jsxs(ft,{className:"overflow-hidden border-slate-800",children:[s.jsxs("div",{className:"p-5 border-b border-slate-800 flex items-center justify-between bg-slate-900/30",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Lg,{className:"h-5 w-5 text-indigo-400"}),s.jsx("h3",{className:"font-semibold text-slate-200",children:"Execution Queue"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ve,{variant:"ghost",size:"sm",onClick:$t,loading:b,disabled:!(S!=null&&S.items.length),className:"text-slate-500 hover:text-red-400 hover:bg-red-400/10",children:[s.jsx(Fr,{className:"h-4 w-4 mr-1.5"}),"Clear"]}),s.jsx("div",{className:`p-1.5 rounded-lg cursor-pointer hover:bg-slate-800 transition-colors ${y?"text-indigo-400 bg-slate-800":"text-slate-500"}`,onClick:()=>p(!y),title:"Automation Settings",children:s.jsx(zg,{className:"h-5 w-5"})})]})]}),s.jsx("div",{className:`transition-all duration-300 overflow-hidden ${y?"max-h-[500px]":"max-h-0"}`,children:s.jsxs("div",{className:"p-6 bg-slate-950/40 border-b border-slate-800 grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Dispatch Mode",value:((kn=R==null?void 0:R.queue)==null?void 0:kn.mode)||"auto",onChange:oe=>ua({mode:oe}),options:[{label:"Auto (Recommended)",value:"auto"},{label:"Conservative (1 at a time)",value:"conservative"},{label:"Provider-aware",value:"provider-aware"}]}),s.jsx(ke,{label:"Max Concurrency",type:"number",min:"1",max:"20",value:String(((Zs=R==null?void 0:R.queue)==null?void 0:Zs.maxConcurrency)||1),onChange:oe=>ua({maxConcurrency:Number(oe.target.value)})}),s.jsx("div",{className:"md:col-span-2 flex items-center gap-3",children:s.jsx(Qa,{label:"Coordinator Enabled",checked:((cl=R==null?void 0:R.queue)==null?void 0:cl.enabled)??!0,onChange:oe=>ua({enabled:oe})})})]})}),s.jsx("div",{className:"p-0",children:S!=null&&S.items.length?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-[11px] uppercase tracking-wider text-slate-500 font-semibold bg-slate-900/20",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3",children:"Job / Project"}),s.jsx("th",{className:"px-6 py-3",children:"Status"}),s.jsx("th",{className:"px-6 py-3",children:"Wait Time"}),s.jsx("th",{className:"px-6 py-3 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/40",children:S.items.map(oe=>s.jsxs("tr",{className:"hover:bg-slate-800/20 transition-colors group",children:[s.jsxs("td",{className:"px-6 py-4",children:[s.jsx("div",{className:"font-medium text-slate-200",children:oe.jobType}),s.jsx("div",{className:"text-[11px] text-slate-500 truncate max-w-[200px]",title:oe.projectPath,children:oe.projectName||oe.projectPath})]}),s.jsx("td",{className:"px-6 py-4",children:s.jsx(Ia,{variant:oe.status==="running"?"info":"neutral",className:"text-[10px]",children:oe.status})}),s.jsx("td",{className:"px-6 py-4 text-slate-400 font-mono text-xs",children:vx(new Date(oe.enqueuedAt*1e3))}),s.jsx("td",{className:"px-6 py-4 text-right",children:s.jsx("button",{onClick:()=>tn(oe.jobType),className:"opacity-0 group-hover:opacity-100 p-2 text-slate-500 hover:text-indigo-400 transition-all",title:"Configure Job",children:s.jsx(zg,{className:"h-4 w-4"})})})]},oe.id))})]})}):s.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-slate-500 text-sm italic",children:[s.jsx("div",{className:"mb-3 p-3 rounded-full bg-slate-900 border border-slate-800",children:s.jsx(kg,{className:"h-6 w-6 opacity-30"})}),"Queue is empty"]})})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Operational Timeline"}),s.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-2",children:[s.jsx(no,{className:"h-3 w-3 animate-spin-slow"})," Live Update"]})]}),s.jsx(WS,{configs:_,currentProjectId:d??void 0,onEditJob:(oe,Ne)=>tn(Ne),queueStatus:S,queueAnalytics:A})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Execution History (Last 24h)"}),s.jsx(ft,{className:"border-slate-800 overflow-hidden",children:A!=null&&A.recentRuns.length?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-sm",children:[s.jsx("thead",{className:"text-[11px] uppercase tracking-wider text-slate-500 font-semibold bg-slate-900/20",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-4",children:"Job Type"}),s.jsx("th",{className:"px-6 py-4",children:"Status"}),s.jsx("th",{className:"px-6 py-4",children:"Duration"}),s.jsx("th",{className:"px-6 py-4",children:"Started"}),s.jsx("th",{className:"px-6 py-4 text-right",children:"Provider"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/40",children:A.recentRuns.map(oe=>s.jsxs("tr",{className:"hover:bg-slate-800/10 transition-colors",children:[s.jsx("td",{className:"px-6 py-4",children:s.jsx("span",{className:"font-medium text-slate-300 capitalize",children:oe.jobType})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx(Ia,{variant:oe.status==="finished"?"success":oe.status==="failed"?"error":"neutral",className:"text-[10px]",children:oe.status})}),s.jsx("td",{className:"px-6 py-4 text-slate-400",children:oe.durationSeconds?`${oe.durationSeconds}s`:"--"}),s.jsx("td",{className:"px-6 py-4 text-slate-500 text-xs",children:vx(new Date(oe.startedAt*1e3))}),s.jsx("td",{className:"px-6 py-4 text-right text-slate-500 font-mono text-xs",children:oe.providerKey||"default"})]},oe.id))})]})}):s.jsx("div",{className:"py-20 text-center text-slate-500 italic text-sm",children:"No recorded runs in the last 24 hours."})})]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(ft,{className:"p-5 space-y-4 border-slate-800 bg-slate-900/20",children:[s.jsx("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Automation Controls"}),s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-950/40 p-4",children:[s.jsx("div",{className:"text-[10px] text-slate-500 uppercase",children:"Schedule Template"}),s.jsx("div",{className:"mt-1 text-sm font-medium text-slate-200",children:(bn==null?void 0:bn.label)??"Custom"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:(bn==null?void 0:bn.description)??"Custom cron expressions are active for this project."})]}),s.jsx(dt,{label:"Scheduling Priority",value:String(R.schedulingPriority),onChange:oe=>Ze("schedulingPriority",Number(oe)),options:[{label:"1 - Lowest",value:"1"},{label:"2 - Low",value:"2"},{label:"3 - Balanced",value:"3"},{label:"4 - High",value:"4"},{label:"5 - Highest",value:"5"}],helperText:"Higher-priority projects get earlier balanced start slots and win queue tie-breakers first."}),s.jsx(ke,{label:"Extra Start Delay",type:"number",min:"0",max:"59",value:String(R.cronScheduleOffset),onChange:oe=>Ze("cronScheduleOffset",Math.min(59,Math.max(0,Number(oe.target.value||0)))),helperText:"Manual delay in minutes added before cron jobs start. This stacks on top of automatic balancing."})]}),s.jsxs(ft,{className:"p-5 space-y-4 border-slate-800 bg-slate-900/20",children:[s.jsx("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Efficiency Stats"}),s.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[s.jsxs("div",{className:"p-4 rounded-xl border border-slate-800 bg-slate-950/40",children:[s.jsx("div",{className:"text-[10px] text-slate-500 uppercase",children:"Avg Wait Time"}),s.jsxs("div",{className:"text-xl font-bold text-slate-200 mt-1",children:[S!=null&&S.averageWaitSeconds?(S.averageWaitSeconds/60).toFixed(1):"0"," ",s.jsx("span",{className:"text-xs font-normal text-slate-500",children:"min"})]})]}),s.jsxs("div",{className:"p-4 rounded-xl border border-slate-800 bg-slate-950/40",children:[s.jsx("div",{className:"text-[10px] text-slate-500 uppercase",children:"Oldest Pending"}),s.jsxs("div",{className:"text-xl font-bold text-slate-200 mt-1",children:[S!=null&&S.oldestPendingAge?(S.oldestPendingAge/60).toFixed(1):"0"," ",s.jsx("span",{className:"text-xs font-normal text-slate-500",children:"min"})]})]})]})]}),s.jsxs(ft,{className:"divide-y divide-slate-800 border-slate-800",children:[s.jsx("div",{className:"p-4 bg-slate-900/30",children:s.jsx("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-widest",children:"Manual Trigger"})}),s.jsx("div",{className:"p-2 space-y-1",children:[{id:"executor",label:"Run Executor",icon:vn,enabled:(R==null?void 0:R.executorEnabled)!==!1},{id:"reviewer",label:"Run Reviewer",icon:$r,enabled:(R==null?void 0:R.reviewerEnabled)??!1},{id:"qa",label:"Run QA",icon:Lg,enabled:((Qe=R==null?void 0:R.qa)==null?void 0:Qe.enabled)??!1},{id:"audit",label:"Run Audit",icon:kg,enabled:((ol=R==null?void 0:R.audit)==null?void 0:ol.enabled)??!1},{id:"planner",label:"Run Planner",icon:uh,enabled:((mt=R==null?void 0:R.roadmapScanner)==null?void 0:mt.enabled)??!1},{id:"analytics",label:"Run Analytics",icon:lh,enabled:((Vt=R==null?void 0:R.analytics)==null?void 0:Vt.enabled)??!1},{id:"pr-resolver",label:"Run PR Resolver",icon:ih,enabled:((At=R==null?void 0:R.prResolver)==null?void 0:At.enabled)??!1},{id:"merger",label:"Run Merger",icon:ho,enabled:((_t=R==null?void 0:R.merger)==null?void 0:_t.enabled)??!1}].map(oe=>s.jsxs("button",{onClick:()=>en(oe.id),disabled:j===oe.id||!oe.enabled,className:`w-full flex items-center justify-between p-3 rounded-lg text-sm transition-colors group disabled:cursor-not-allowed ${oe.enabled?"text-slate-300 hover:bg-slate-800/40":"text-slate-600 opacity-50"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(oe.icon,{className:`h-4 w-4 ${oe.enabled?"text-slate-500 group-hover:text-indigo-400":"text-slate-700"}`}),oe.label]}),j===oe.id?s.jsx(no,{className:"h-3 w-3 animate-spin text-indigo-400"}):oe.enabled?s.jsx(vn,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-all fill-current text-indigo-400"}):s.jsx("span",{className:"text-[10px] text-slate-600 uppercase tracking-wider",children:"Off"})]},oe.id))})]})]})]}),ul=R?s.jsx(KS,{form:{cronSchedule:R.cronSchedule,reviewerSchedule:R.reviewerSchedule,qa:R.qa,audit:R.audit,analytics:R.analytics,roadmapScanner:{...R.roadmapScanner,slicerSchedule:R.roadmapScanner.slicerSchedule??Br().slicerSchedule},prResolver:R.prResolver,merger:R.merger},scheduleMode:O,selectedTemplateId:ae,onFieldChange:(oe,Ne)=>{Ze(oe,Ne)},onSwitchToTemplate:We,onSwitchToCustom:Dt,onApplyTemplate:Ja}):null,Gs=[{id:"overview",label:"Overview",content:Qt},{id:"schedules",label:"Schedules",content:ul},{id:"jobs",label:"Jobs",content:R?s.jsx(ej,{form:R,updateField:Ze,handleRoadmapToggle:ha,presetOptions:an,expandedJob:X,onExpandedJobChange:ie,onOpenSchedule:da}):null}];return s.jsxs("div",{className:"max-w-6xl mx-auto space-y-6 pb-20",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-slate-100 flex items-center gap-3",children:["Automation",s.jsx(Ia,{variant:Ua?"warning":"success",className:"px-3 py-1 text-xs uppercase tracking-wider",children:Ua?"Paused":"Active"})]}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Manage automation overview, schedules, jobs, and live queue"})]}),s.jsx(Ve,{variant:Ua?"primary":"outline",size:"lg",className:Ua?"bg-emerald-600 hover:bg-emerald-700":"border-slate-700 hover:bg-slate-800",onClick:yn,loading:f,children:Ua?s.jsxs(s.Fragment,{children:[s.jsx(vn,{className:"h-5 w-5 mr-2 fill-current"})," Resume Scheduling"]}):s.jsxs(s.Fragment,{children:[s.jsx(ao,{className:"h-5 w-5 mr-2"})," Pause Scheduling"]})})]}),s.jsx(hv,{tabs:Gs,activeTab:B,onChange:M}),pe&&s.jsx("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-50 w-full max-w-2xl px-4 animate-in fade-in slide-in-from-bottom-4 duration-300",children:s.jsxs("div",{className:"bg-slate-900/90 backdrop-blur-md border border-indigo-500/30 rounded-2xl p-4 shadow-2xl flex items-center justify-between shadow-indigo-500/10",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-lg bg-indigo-500/20 text-indigo-400",children:s.jsx(Ys,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-slate-200",children:"Unsaved changes"}),s.jsx("div",{className:"text-[11px] text-slate-400",children:"Save to apply and reinstall cron schedules"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ve,{variant:"ghost",size:"sm",onClick:fa,className:"text-slate-400",children:[s.jsx(ch,{className:"h-4 w-4 mr-1.5"}),"Reset"]}),s.jsxs(Ve,{variant:"primary",size:"sm",onClick:Ka,loading:P,children:[s.jsx(tv,{className:"h-4 w-4 mr-1.5"}),"Save"]})]})]})})]})},uj=({isOpen:l,onClose:r,title:d,children:c})=>(U.useEffect(()=>{const f=h=>{h.key==="Escape"&&r()};return l&&(document.addEventListener("keydown",f),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",f),document.body.style.overflow="unset"}},[l,r]),l?e1.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[s.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm transition-opacity",onClick:r,"aria-hidden":"true"}),s.jsxs("div",{className:"relative w-full max-w-2xl transform rounded-xl bg-slate-900 border border-slate-800 shadow-2xl transition-all flex flex-col max-h-[90vh]",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800 px-6 py-4",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:d}),s.jsx("button",{onClick:r,className:"rounded-full p-1 text-slate-400 hover:bg-slate-800 hover:text-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-500",children:s.jsx(Gr,{className:"h-5 w-5"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6 text-slate-300",children:c})]})]}),document.body):null),cj=l=>["TOKEN","SECRET","KEY","PASSWORD","AUTH","API_KEY"].some(d=>l.toUpperCase().includes(d)),oj=({value:l,isSensitive:r})=>{const[d,c]=ze.useState(!1);return r?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-slate-300 font-mono",children:d?l:"***********"}),s.jsx("button",{type:"button",onClick:()=>c(!d),className:"text-slate-500 hover:text-slate-300","aria-label":d?"Hide sensitive value":"Show sensitive value",title:d?"Hide sensitive value":"Show sensitive value",children:d?s.jsx(q1,{className:"h-4 w-4"}):s.jsx(rh,{className:"h-4 w-4"})})]}):s.jsx("span",{className:"text-sm text-slate-300 font-mono truncate max-w-xs",children:l})},Gv=({envVars:l,onChange:r,compact:d=!1})=>{const[c,f]=ze.useState(""),[h,b]=ze.useState(""),[N,y]=ze.useState(null),[p,j]=ze.useState(""),{addToast:T}=Wt(),_=()=>{if(c.trim()){if(!/^[A-Z_][A-Z0-9_]*$/.test(c)){T({title:"Invalid Key Format",message:"Key must be uppercase with underscores (e.g., API_KEY)",type:"error"});return}r({...l,[c]:h}),f(""),b("")}},k=B=>{const M={...l};delete M[B],r(M)},S=B=>{y(B),j(l[B]??"")},C=()=>{N&&(r({...l,[N]:p}),y(null),j(""))},A=()=>{y(null),j("")},$=Object.entries(l);return s.jsxs("div",{className:"space-y-4",children:[!d&&s.jsx("div",{className:"text-sm text-slate-400 mb-4",children:"Configure environment variables passed to the provider CLI (API keys, base URLs)"}),s.jsx("div",{className:"space-y-2",children:$.length===0?s.jsx("p",{className:"text-slate-500 text-sm italic",children:"No environment variables configured."}):$.map(([B,M])=>s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-slate-800 bg-slate-950/40",children:[s.jsxs("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm font-mono text-indigo-400 w-48 truncate",children:B}),N===B?s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[s.jsx("input",{type:"text",value:p,onChange:X=>j(X.target.value),className:"flex-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-sm text-slate-200"}),s.jsx("button",{type:"button",onClick:C,className:"p-1 text-green-400 hover:text-green-300","aria-label":`Save ${B} value`,title:`Save ${B} value`,children:s.jsx(b1,{className:"h-4 w-4"})}),s.jsx("button",{type:"button",onClick:A,className:"p-1 text-slate-400 hover:text-slate-300","aria-label":`Cancel editing ${B}`,title:`Cancel editing ${B}`,children:s.jsx(Gr,{className:"h-4 w-4"})})]}):s.jsx(oj,{value:M,isSensitive:cj(B)})]}),N!==B&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>S(B),className:"p-1 text-slate-400 hover:text-slate-200","aria-label":`Edit ${B}`,title:`Edit ${B}`,children:s.jsx(mo,{className:"h-4 w-4"})}),s.jsx("button",{type:"button",onClick:()=>k(B),className:"p-1 text-red-400 hover:text-red-300","aria-label":`Delete ${B}`,title:`Delete ${B}`,children:s.jsx(Fr,{className:"h-4 w-4"})})]})]},B))}),s.jsxs("div",{className:`flex items-end gap-3 ${d?"":"pt-4 border-t border-slate-800"}`,children:[s.jsxs("div",{className:"flex-1",children:[!d&&s.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Key"}),s.jsx("input",{type:"text",value:c,onChange:B=>f(B.target.value.toUpperCase()),placeholder:d?"ENV_VAR_NAME":"e.g., ANTHROPIC_BASE_URL",className:"w-full bg-slate-800 border border-slate-700 rounded px-3 py-2 text-sm text-slate-200 placeholder-slate-500"})]}),s.jsxs("div",{className:"flex-1",children:[!d&&s.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Value"}),s.jsx("input",{type:"text",value:h,onChange:B=>b(B.target.value),placeholder:d?"value":"e.g., https://api.example.com",className:"w-full bg-slate-800 border border-slate-700 rounded px-3 py-2 text-sm text-slate-200 placeholder-slate-500"})]}),s.jsxs(Ve,{onClick:_,disabled:!c.trim(),size:d?"sm":"md",children:[s.jsx($s,{className:"h-4 w-4 mr-1"}),"Add"]})]})]})};function dj(l,r){var d;return!!(l!=null&&l.startsWith("glm-")||(d=r==null?void 0:r.model)!=null&&d.startsWith("glm-"))}function fj(l,r){var d,c;return dj(l,r)?!((c=(d=r==null?void 0:r.envVars)==null?void 0:d.ANTHROPIC_API_KEY)!=null&&c.trim()):!1}const Nx={claude:{name:"Claude",command:"claude",promptFlag:"-p",autoApproveFlag:"--dangerously-skip-permissions"},codex:{name:"Codex",command:"codex",subcommand:"exec",autoApproveFlag:"--yolo",workdirFlag:"-C"},custom:{name:"",command:""}},hj=({isOpen:l,onClose:r,onSave:d,presetId:c,preset:f,isBuiltIn:h,existingIds:b})=>{const[N,y]=ze.useState(""),[p,j]=ze.useState({name:"",command:"",subcommand:"",promptFlag:"",autoApproveFlag:"",workdirFlag:"",modelFlag:"",model:"",envVars:{}}),[T,_]=ze.useState(!1),[k,S]=ze.useState("custom"),[C,A]=ze.useState(null),$=fj(c??N,p);ze.useEffect(()=>{l&&(c&&f?(y(c),j({name:f.name,command:f.command,subcommand:f.subcommand??"",promptFlag:f.promptFlag??"",autoApproveFlag:f.autoApproveFlag??"",workdirFlag:f.workdirFlag??"",modelFlag:f.modelFlag??"",model:f.model??"",envVars:f.envVars??{}}),c==="claude"||f.command==="claude"?S("claude"):c==="codex"||f.command==="codex"?S("codex"):S("custom")):(y(""),j({name:"",command:"",subcommand:"",promptFlag:"",autoApproveFlag:"",workdirFlag:"",modelFlag:"",model:"",envVars:{}}),S("custom")),A(null),_(!!(f!=null&&f.envVars&&Object.keys(f.envVars).length>0)))},[l,c,f]);const B=F=>{if(S(F),F!=="custom"&&Nx[F]){const Z=Nx[F];j(R=>({...R,...Z,envVars:R.envVars})),!c&&!N&&y(F)}},M=(F,Z)=>{j(R=>({...R,[F]:Z})),A(null)},X=()=>{if(!p.name.trim())return A("Name is required"),!1;if(!p.command.trim())return A("Command is required"),!1;if(!c){if(!N.trim())return A("Preset ID is required"),!1;if(!/^[a-z0-9_-]+$/.test(N))return A("Preset ID must be lowercase letters, numbers, hyphens, and underscores only"),!1;if(b.includes(N))return A("A preset with this ID already exists"),!1}return!0},ie=()=>{var Z,R,ee,O,ne,ae;if(!X())return;const F={name:p.name.trim(),command:p.command.trim()};(Z=p.subcommand)!=null&&Z.trim()&&(F.subcommand=p.subcommand.trim()),(R=p.promptFlag)!=null&&R.trim()&&(F.promptFlag=p.promptFlag.trim()),(ee=p.autoApproveFlag)!=null&&ee.trim()&&(F.autoApproveFlag=p.autoApproveFlag.trim()),(O=p.workdirFlag)!=null&&O.trim()&&(F.workdirFlag=p.workdirFlag.trim()),(ne=p.modelFlag)!=null&&ne.trim()&&(F.modelFlag=p.modelFlag.trim()),(ae=p.model)!=null&&ae.trim()&&(F.model=p.model.trim()),p.envVars&&Object.keys(p.envVars).length>0&&(F.envVars=p.envVars),d(c||N,F),r()};return s.jsx(uj,{isOpen:l,onClose:r,title:c?`Edit Preset: ${f==null?void 0:f.name}`:"Add Provider Preset",children:s.jsxs("div",{className:"space-y-6",children:[C&&s.jsx("div",{className:"p-3 rounded-md bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:C}),$&&s.jsx("div",{className:"p-3 rounded-md bg-amber-500/10 border border-amber-500/20 text-amber-300 text-sm",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Ys,{className:"h-4 w-4 shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:"GLM presets require `ANTHROPIC_API_KEY`."}),s.jsx("div",{className:"text-amber-200/80",children:"Add `ANTHROPIC_API_KEY` in Environment Variables before using this preset."})]})]})}),!h&&s.jsx("div",{children:s.jsx(dt,{label:"Template",value:k,onChange:B,options:[{label:"Start from scratch",value:"custom"},{label:"Claude (Anthropic)",value:"claude"},{label:"Codex (OpenAI)",value:"codex"}],helperText:"Start with a pre-configured template or customize from scratch"})}),!c&&s.jsx(ke,{label:"Preset ID",value:N,onChange:F=>y(F.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"")),placeholder:"e.g., my-custom-provider",helperText:"Unique identifier for this preset (lowercase, numbers, hyphens, underscores)"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(ke,{label:"Display Name",value:p.name,onChange:F=>M("name",F.target.value),placeholder:"e.g., My Custom Provider",required:!0}),s.jsx(ke,{label:"Command",value:p.command,onChange:F=>M("command",F.target.value),placeholder:"e.g., claude, codex, npx",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(ke,{label:"Model",value:p.model??"",onChange:F=>M("model",F.target.value),placeholder:"e.g., claude-opus-4-6",helperText:"Default model to use"}),s.jsx(ke,{label:"Model Flag",value:p.modelFlag??"",onChange:F=>M("modelFlag",F.target.value),placeholder:"e.g., --model",helperText:"Flag for specifying the model"})]}),s.jsxs("div",{className:"border-t border-slate-800 pt-4",children:[s.jsxs("button",{type:"button",onClick:()=>_(!T),className:"flex items-center gap-2 text-sm text-slate-400 hover:text-slate-200 transition-colors",children:[T?s.jsx(C1,{className:"h-4 w-4"}):s.jsx(sh,{className:"h-4 w-4"}),"Advanced Options"]}),T&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(ke,{label:"Subcommand",value:p.subcommand??"",onChange:F=>M("subcommand",F.target.value),placeholder:"e.g., exec",helperText:"Subcommand after base command"}),s.jsx(ke,{label:"Prompt Flag",value:p.promptFlag??"",onChange:F=>M("promptFlag",F.target.value),placeholder:"e.g., -p",helperText:"Flag for passing the prompt"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(ke,{label:"Auto-Approve Flag",value:p.autoApproveFlag??"",onChange:F=>M("autoApproveFlag",F.target.value),placeholder:"e.g., --dangerously-skip-permissions",helperText:"Flag to enable auto-approve mode"}),s.jsx(ke,{label:"Workdir Flag",value:p.workdirFlag??"",onChange:F=>M("workdirFlag",F.target.value),placeholder:"e.g., -C",helperText:"Flag for setting working directory"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Environment Variables"}),s.jsx(Gv,{envVars:p.envVars??{},onChange:F=>M("envVars",F),compact:!0})]})]})]}),s.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-slate-800",children:[s.jsx(Ve,{variant:"ghost",onClick:r,children:"Cancel"}),s.jsx(Ve,{onClick:ie,children:c?"Save Changes":"Add Preset"})]})]})})},mj=({form:l,updateField:r,projectName:d,doctorChecks:c,doctorLoading:f})=>s.jsxs("div",{className:"space-y-6",children:[s.jsx(ft,{className:"p-6 space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"Project Configuration"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mt-4",children:[s.jsx(ke,{label:"Project Name",value:d,disabled:!0}),s.jsx(ke,{label:"Default Branch",value:l.defaultBranch,onChange:h=>r("defaultBranch",h.target.value)}),s.jsx(ke,{label:"PRD Directory",value:l.prdDir,onChange:h=>r("prdDir",h.target.value),helperText:"Directory containing PRD files (relative to project root)"}),s.jsx(ke,{label:"Branch Prefix",value:l.branchPrefix,onChange:h=>r("branchPrefix",h.target.value)}),s.jsx(ke,{label:"Templates Directory",value:l.templatesDir,onChange:h=>r("templatesDir",h.target.value),helperText:"Directory for custom template overrides"}),s.jsx(ke,{label:"Max Log Size",type:"number",value:String(l.maxLogSize),onChange:h=>r("maxLogSize",Number(h.target.value||0)),rightIcon:s.jsx("span",{className:"text-xs",children:"bytes"}),helperText:"Maximum size for process log files"})]}),s.jsxs("div",{className:"pt-4 mt-4 border-t border-slate-800 space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-slate-800 bg-slate-900/40 p-4",children:[s.jsx(Qa,{checked:l.gitPushNoVerify,onChange:h=>r("gitPushNoVerify",h),label:"Use --no-verify on automated pushes"}),s.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Project-scoped. Bypasses local pre-push hooks for Night Watch controller and agent pushes in repos whose hooks block automation."})]}),s.jsx(du,{label:"Branch Patterns",value:l.branchPatterns,onChange:h=>r("branchPatterns",h),placeholder:"e.g., feat/",helpText:"Branch patterns matched by reviewer and related automation jobs"}),s.jsx(du,{label:"PRD Priority",value:l.prdPriority,onChange:h=>r("prdPriority",h),placeholder:"e.g., feature-x",helpText:"PRDs matching these names are executed first"})]})]})}),s.jsxs(ft,{className:"divide-y divide-slate-800",children:[s.jsxs("div",{className:"p-4 flex items-center gap-2",children:[s.jsx(Wx,{className:"h-4 w-4 text-indigo-500"}),s.jsx("h3",{className:"text-base font-medium text-slate-200",children:"System Health"})]}),f?s.jsx("div",{className:"p-4 text-sm text-slate-500",children:"Loading health checks..."}):c.map((h,b)=>{const N=h.status==="pass",y=h.status==="warn",p=N?"bg-green-500/10 text-green-400 border-green-500/20":y?"bg-amber-500/10 text-amber-400 border-amber-500/20":"bg-red-500/10 text-red-400 border-red-500/20";return s.jsxs("div",{className:"p-4 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-slate-200",children:h.name}),s.jsx("p",{className:"text-xs text-slate-500",children:h.detail})]}),s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${p}`,children:h.status.toUpperCase()})]},`${h.name}-${b}`)})]})]}),Sx=({presetId:l,preset:r,isBuiltIn:d,onEdit:c,onDelete:f,onReset:h})=>{var p,j,T;const b=r.envVars?Object.keys(r.envVars).length:0,y=(l.startsWith("glm-")||((p=r.model)==null?void 0:p.startsWith("glm-")))&&!((T=(j=r.envVars)==null?void 0:j.ANTHROPIC_API_KEY)!=null&&T.trim());return s.jsxs("div",{className:"flex flex-col p-4 rounded-lg border border-slate-800 bg-slate-950/40 hover:border-slate-700 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-200",children:r.name}),d&&s.jsx(Ia,{variant:"info",className:"text-[10px]",children:"Built-in"}),y&&s.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-amber-900/40 text-amber-400 border border-amber-800/50",title:"GLM presets require ANTHROPIC_API_KEY in env vars",children:[s.jsx(Ys,{className:"h-3 w-3"}),"Missing ANTHROPIC_API_KEY"]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{type:"button",onClick:c,className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-800 rounded transition-colors","aria-label":`Edit ${r.name} preset`,title:"Edit preset",children:s.jsx(mo,{className:"h-4 w-4"})}),d?h&&s.jsx("button",{type:"button",onClick:h,className:"p-1.5 text-slate-400 hover:text-indigo-400 hover:bg-slate-800 rounded transition-colors","aria-label":`Reset ${r.name} to defaults`,title:"Reset to defaults",children:s.jsx(ch,{className:"h-4 w-4"})}):f&&s.jsx("button",{type:"button",onClick:f,className:"p-1.5 text-slate-400 hover:text-red-400 hover:bg-slate-800 rounded transition-colors","aria-label":`Delete ${r.name} preset`,title:"Delete preset",children:s.jsx(Fr,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"Command:"}),s.jsxs("code",{className:"px-2 py-0.5 bg-slate-800 rounded text-xs text-indigo-400 font-mono",children:[r.command,r.subcommand&&` ${r.subcommand}`]})]}),r.model&&s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"Model:"}),s.jsx(Ia,{variant:"neutral",className:"text-[10px] font-mono",children:r.model})]}),s.jsxs("div",{className:"flex items-center gap-3 mt-auto pt-2 border-t border-slate-800/50",children:[s.jsxs("span",{className:"text-xs text-slate-600 font-mono",children:["id: ",l]}),b>0&&s.jsxs("span",{className:"text-xs text-slate-500",children:[b," env var",b!==1?"s":""]})]})]})},Zf={0:"Su",1:"Mo",2:"Tu",3:"We",4:"Th",5:"Fr",6:"Sa"},Wf={executor:"Executor",reviewer:"Reviewer",qa:"QA",audit:"Audit",slicer:"Planner",analytics:"Analytics",planner:"Planner","pr-resolver":"PR Resolver",merger:"Merger"},Lf={label:"",presetId:"",days:[1,2,3,4,5],startTime:"23:00",endTime:"04:00",jobTypes:null,enabled:!0},jx=({override:l,onChange:r,onSave:d,onCancel:c,isNew:f,presetOptions:h})=>{const b=S=>{const C=l.days.includes(S)?l.days.filter(A=>A!==S):[...l.days,S].sort((A,$)=>A-$);r({...l,days:C})},N=()=>{r({...l,days:[1,2,3,4,5]})},y=()=>{r({...l,days:[0,6]})},p=()=>{r({...l,days:[0,1,2,3,4,5,6]})},j=()=>{r({...l,jobTypes:null})},T=S=>{const C=l.jobTypes??[],A=C.includes(S)?C.filter($=>$!==S):[...C,S];r({...l,jobTypes:A.length===0?null:A})},_=l.jobTypes===null||l.jobTypes===void 0,k=l.label.trim().length>0&&l.presetId.trim().length>0&&l.days.length>0&&l.startTime.trim().length>0&&l.endTime.trim().length>0;return s.jsxs("div",{className:"p-4 rounded-md border border-slate-700 bg-slate-900/50 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(ke,{label:"Label",value:l.label,onChange:S=>r({...l,label:S.target.value}),placeholder:"e.g., Night Hours",required:!0}),s.jsx(dt,{label:"Provider",value:l.presetId,onChange:S=>r({...l,presetId:S}),options:h})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Days"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Object.keys(Zf).map(S=>s.jsx("button",{type:"button",onClick:()=>b(S),className:`w-10 h-10 rounded-md text-sm font-medium transition-colors ${l.days.includes(S)?"bg-indigo-600 text-white":"bg-slate-800 text-slate-400 hover:bg-slate-700"}`,children:Zf[S]},S)),s.jsxs("div",{className:"flex gap-1 ml-2",children:[s.jsx("button",{type:"button",onClick:N,className:"px-3 py-2 text-xs rounded-md bg-slate-800 text-slate-400 hover:bg-slate-700 transition-colors",children:"Weekdays"}),s.jsx("button",{type:"button",onClick:y,className:"px-3 py-2 text-xs rounded-md bg-slate-800 text-slate-400 hover:bg-slate-700 transition-colors",children:"Weekend"}),s.jsx("button",{type:"button",onClick:p,className:"px-3 py-2 text-xs rounded-md bg-slate-800 text-slate-400 hover:bg-slate-700 transition-colors",children:"All"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Start Time"}),s.jsx("input",{type:"time",value:l.startTime,onChange:S=>r({...l,startTime:S.target.value}),className:"w-full h-10 px-3 rounded-md bg-slate-800 border border-slate-700 text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"End Time"}),s.jsx("input",{type:"time",value:l.endTime,onChange:S=>r({...l,endTime:S.target.value}),className:"w-full h-10 px-3 rounded-md bg-slate-800 border border-slate-700 text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Job Types"}),s.jsx("button",{type:"button",onClick:j,className:"text-xs text-indigo-400 hover:text-indigo-300 transition-colors",children:_?"All Jobs Selected":"Select All Jobs"})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:Object.keys(Wf).filter(S=>S!=="planner").map(S=>{var A;const C=_||(((A=l.jobTypes)==null?void 0:A.includes(S))??!1);return s.jsx("button",{type:"button",onClick:()=>T(S),className:`px-3 py-1.5 rounded-md text-sm transition-colors ${C?"bg-indigo-600 text-white":"bg-slate-800 text-slate-400 hover:bg-slate-700"}`,disabled:_,children:Wf[S]},S)})}),_&&s.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"This override applies to all job types."})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Qa,{checked:l.enabled,onChange:S=>r({...l,enabled:S}),label:"Enabled"})}),s.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[s.jsx(Ve,{variant:"ghost",onClick:c,children:"Cancel"}),s.jsx(Ve,{onClick:d,disabled:!k,children:f?"Add Override":"Save Changes"})]})]})},gj=({overrides:l,onChange:r,presetOptions:d})=>{const[c,f]=ze.useState(null),[h,b]=ze.useState(!1),[N,y]=ze.useState(Lf),p=()=>{r([...l,N]),y({...Lf}),b(!1)},j=(A,$)=>{const B=[...l];B[A]=$,r(B)},T=A=>{window.confirm("Are you sure you want to delete this schedule override?")&&r(l.filter(($,B)=>B!==A))},_=A=>{const $=[...l];$[A]={...$[A],enabled:!$[A].enabled},r($)},k=A=>A.length===7?"Every day":A.length===5&&A.every($=>$>=1&&$<=5)?"Weekdays":A.length===2&&A.includes(0)&&A.includes(6)?"Weekends":A.map($=>Zf[$]).join(", "),S=A=>!A||A.length===0?"All Jobs":A.map($=>Wf[$]).join(", "),C=A=>{const $=d.find(B=>B.value===A);return($==null?void 0:$.label)||A};return s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"space-y-3",children:l.length===0?s.jsx("p",{className:"text-slate-500 text-sm italic",children:"No schedule overrides configured."}):l.map((A,$)=>s.jsx("div",{children:c===$?s.jsx(jx,{override:A,onChange:B=>j($,B),onSave:()=>f(null),onCancel:()=>f(null),presetOptions:d}):s.jsxs("div",{className:`flex items-start justify-between p-4 rounded-md border bg-slate-950/40 ${A.enabled?"border-slate-800":"border-slate-800/50 opacity-60"}`,children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[s.jsx(Qa,{checked:A.enabled,onChange:()=>_($)}),s.jsx("span",{className:"text-slate-100 font-medium",children:A.label})]}),s.jsxs("div",{className:"text-sm text-slate-400 ml-11",children:[s.jsx("span",{className:"text-indigo-400",children:C(A.presetId)})," · ",k(A.days)," · ",A.startTime," - ",A.endTime," · ",S(A.jobTypes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>f($),className:"p-2 text-slate-400 hover:text-slate-200","aria-label":`Edit ${A.label}`,title:`Edit ${A.label}`,children:s.jsx(mo,{className:"h-4 w-4"})}),s.jsx("button",{type:"button",onClick:()=>T($),className:"p-2 text-red-400 hover:text-red-300","aria-label":`Delete ${A.label}`,title:`Delete ${A.label}`,children:s.jsx(Fr,{className:"h-4 w-4"})})]})]})},$))}),h?s.jsx(jx,{override:N,onChange:y,onSave:p,onCancel:()=>{b(!1),y({...Lf})},isNew:!0,presetOptions:d}):s.jsxs(Ve,{variant:"ghost",onClick:()=>b(!0),children:[s.jsx($s,{className:"h-4 w-4 mr-2"}),"Add Schedule Override"]})]})},xj=({form:l,updateField:r,getAllPresets:d,getPresetOptions:c,handleEditPreset:f,handleDeletePreset:h,handleResetPreset:b,handleAddPreset:N})=>s.jsxs("div",{className:"space-y-6",children:[s.jsx(ft,{className:"p-6 bg-slate-900/60 border-indigo-500/20",children:s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-100",children:"Global AI Provider"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Default preset for all automation tasks"})]}),s.jsx("div",{className:"w-full md:w-72",children:s.jsx(dt,{value:l.provider,onChange:y=>r("provider",y),options:c(l.providerPresets)})})]})}),s.jsxs(ft,{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"Available Presets"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Custom AI models and environment configurations"})]}),s.jsxs(Ve,{onClick:N,variant:"primary",size:"sm",children:[s.jsx($s,{className:"h-4 w-4 mr-2"}),"Add Provider"]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[uo.map(y=>{const j=d()[y];return j?s.jsx(Sx,{presetId:y,preset:j,isBuiltIn:!0,onEdit:()=>f(y),onReset:()=>b(y)},y):null}),Object.entries(l.providerPresets).filter(([y])=>!uo.includes(y)).map(([y,p])=>s.jsx(Sx,{presetId:y,preset:p,isBuiltIn:!1,onEdit:()=>f(y),onDelete:()=>h(y)},y))]})]}),s.jsxs(ft,{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"Reliability & Fallbacks"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Configure automated fallback when a provider is rate-limited"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(dt,{label:"Primary Native Fallback",value:l.primaryFallbackModel,onChange:y=>r("primaryFallbackModel",y),options:[{label:"— None —",value:""},{label:"Claude Sonnet 4.6",value:"sonnet"},{label:"Claude Opus 4.6",value:"opus"}],helperText:"Used only when no primary fallback preset is configured"}),s.jsx(dt,{label:"Secondary Native Fallback",value:l.secondaryFallbackModel,onChange:y=>r("secondaryFallbackModel",y),options:[{label:"— None —",value:""},{label:"Claude Sonnet 4.6",value:"sonnet"},{label:"Claude Opus 4.6",value:"opus"}],helperText:"Tried only if the primary native fallback also rate-limits"}),s.jsx(dt,{label:"Primary Fallback Preset",value:l.primaryFallbackPreset,onChange:y=>r("primaryFallbackPreset",y),options:[{label:"— None —",value:""},...Object.entries(d()).map(([y,p])=>({label:p.name,value:y}))],helperText:"Automatic switch when global provider is throttled"}),s.jsx(dt,{label:"Secondary Fallback Preset",value:l.secondaryFallbackPreset,onChange:y=>r("secondaryFallbackPreset",y),options:[{label:"— None —",value:""},...Object.entries(d()).map(([y,p])=>({label:p.name,value:y}))]})]})]}),s.jsxs(ft,{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"Scheduled Overrides"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Automatically switch providers based on the time of day (e.g. use cheaper models at night)"})]}),s.jsx(gj,{overrides:l.providerScheduleOverrides,onChange:y=>r("providerScheduleOverrides",y),presetOptions:Object.entries(d()).map(([y,p])=>({label:p.name,value:y}))})]}),s.jsxs(ft,{className:"p-6",children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200 mb-2",children:"Global Environment Variables"}),s.jsx("p",{className:"text-sm text-slate-400 mb-4",children:"Variables passed to all provider CLI executions"}),s.jsx(Gv,{envVars:l.providerEnv,onChange:y=>r("providerEnv",y)})]})]});function wx(l){return l.type==="telegram"?`telegram:${l.botToken}:${l.chatId}`:`${l.type}:${l.url}`}const vj=[{label:"Run Started",value:"run_started"},{label:"Run Succeeded",value:"run_succeeded"},{label:"Run Failed",value:"run_failed"},{label:"Run Timeout",value:"run_timeout"},{label:"Review Completed",value:"review_completed"},{label:"PR Auto-Merged",value:"pr_auto_merged"},{label:"Merge Completed",value:"merge_completed"},{label:"Merge Failed",value:"merge_failed"},{label:"Rate Limit Fallback",value:"rate_limit_fallback"},{label:"QA Completed",value:"qa_completed"}],pj=(l,r)=>l.includes(r)?l.filter(d=>d!==r):[...l,r],Ex=({webhook:l,onChange:r,onSave:d,onCancel:c,isNew:f})=>s.jsxs("div",{className:"p-4 rounded-md border border-slate-700 bg-slate-900/50 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(dt,{label:"Type",value:l.type,onChange:h=>{const b=h;r(b==="telegram"?{type:b,botToken:"",chatId:"",events:l.events}:{type:b,url:"",events:l.events})},options:[{label:"Slack",value:"slack"},{label:"Discord",value:"discord"},{label:"Telegram",value:"telegram"}]}),l.type==="telegram"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"relative",children:s.jsx(ke,{label:"Bot Token",type:"password",value:l.botToken||"",onChange:h=>r({...l,botToken:h.target.value}),placeholder:"123456789:ABCdefGHIjklMNOpqrsTUVwxyz"})}),s.jsx(ke,{label:"Chat ID",value:l.chatId||"",onChange:h=>r({...l,chatId:h.target.value}),placeholder:"123456789"})]}):s.jsx("div",{className:"md:col-span-2",children:s.jsx(ke,{label:"Webhook URL",type:"password",value:l.url||"",onChange:h=>r({...l,url:h.target.value}),placeholder:"https://hooks.slack.com/services/..."})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Events"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:vj.map(h=>s.jsx("button",{type:"button",onClick:()=>r({...l,events:pj(l.events,h.value)}),className:`px-3 py-1.5 rounded-md text-sm transition-colors ${l.events.includes(h.value)?"bg-indigo-600 text-white":"bg-slate-800 text-slate-400 hover:bg-slate-700"}`,children:h.label},h.value))})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Ve,{variant:"ghost",onClick:c,children:"Cancel"}),s.jsx(Ve,{onClick:d,disabled:l.events.length===0||(l.type==="telegram"?!l.botToken||!l.chatId:!l.url),children:f?"Add Webhook":"Save Changes"})]})]}),yj=({notifications:l,onChange:r,globalWebhook:d,onSetGlobal:c,onUnsetGlobal:f})=>{const[h,b]=ze.useState(null),[N,y]=ze.useState(!1),[p,j]=ze.useState({type:"slack",url:"",events:[]}),T=()=>{r({webhooks:[...l.webhooks,p]}),j({type:"slack",url:"",events:[]}),y(!1)},_=(S,C)=>{const A=[...l.webhooks];A[S]=C,r({webhooks:A})},k=S=>{r({webhooks:l.webhooks.filter((C,A)=>A!==S)})};return s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"text-sm text-slate-400 mb-4",children:"Receive notifications when events occur via Slack, Discord, or Telegram"}),s.jsx("div",{className:"space-y-3",children:l.webhooks.length===0?s.jsx("p",{className:"text-slate-500 text-sm italic",children:"No webhooks configured."}):l.webhooks.map((S,C)=>s.jsx("div",{children:h===C?s.jsx(Ex,{webhook:S,onChange:A=>_(C,A),onSave:()=>b(null),onCancel:()=>b(null)}):s.jsxs("div",{className:"flex items-center justify-between p-4 rounded-md border border-slate-800 bg-slate-950/40",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-sm font-medium text-slate-200 capitalize",children:S.type}),S.type==="telegram"&&s.jsxs("span",{className:"text-xs text-slate-500",children:["Chat ID: ",S.chatId]})]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:S.events.map(A=>s.jsx("span",{className:"px-2 py-0.5 bg-slate-800 rounded text-xs text-slate-400",children:A.replace("_"," ")},A))})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[c!==void 0&&(()=>{const A=d!=null&&wx(S)===wx(d);return s.jsx("button",{type:"button",onClick:()=>A?f==null?void 0:f():c(S),className:`p-2 transition-colors ${A?"text-indigo-400 hover:text-indigo-300":"text-slate-500 hover:text-slate-300"}`,"aria-label":A?"Global channel (active)":"Set as global channel",title:A?"Global channel (active)":"Set as global channel",children:s.jsx(F1,{className:"h-4 w-4"})})})(),s.jsx("button",{type:"button",onClick:()=>b(C),className:"p-2 text-slate-400 hover:text-slate-200","aria-label":`Edit ${S.type} webhook`,title:`Edit ${S.type} webhook`,children:s.jsx(mo,{className:"h-4 w-4"})}),s.jsx("button",{type:"button",onClick:()=>k(C),className:"p-2 text-red-400 hover:text-red-300","aria-label":`Delete ${S.type} webhook`,title:`Delete ${S.type} webhook`,children:s.jsx(Fr,{className:"h-4 w-4"})})]})]})},C))}),N?s.jsx(Ex,{webhook:p,onChange:j,onSave:T,onCancel:()=>y(!1),isNew:!0}):s.jsxs(Ve,{variant:"ghost",onClick:()=>y(!0),children:[s.jsx($s,{className:"h-4 w-4 mr-2"}),"Add Webhook"]})]})},bj=({form:l,updateField:r,globalWebhook:d,onSetGlobal:c,onUnsetGlobal:f})=>s.jsxs("div",{className:"space-y-6",children:[s.jsxs(ft,{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"Board Provider"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Track PRDs and their status using GitHub Projects or local SQLite"})]}),s.jsx(Qa,{checked:l.boardProvider.enabled,onChange:h=>r("boardProvider",{...l.boardProvider,enabled:h})})]}),l.boardProvider.enabled&&s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 pt-6 border-t border-slate-800",children:[s.jsx(dt,{label:"Board Provider",value:l.boardProvider.provider,onChange:h=>r("boardProvider",{...l.boardProvider,provider:h}),options:[{label:"GitHub Projects",value:"github"},{label:"Local (SQLite)",value:"local"}]}),l.boardProvider.provider==="github"&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{label:"Project Number",type:"number",value:String(l.boardProvider.projectNumber||""),onChange:h=>r("boardProvider",{...l.boardProvider,projectNumber:h.target.value?Number(h.target.value):void 0}),helperText:"GitHub Projects V2 project number"}),s.jsx(ke,{label:"Repository",value:l.boardProvider.repo||"",onChange:h=>r("boardProvider",{...l.boardProvider,repo:h.target.value||void 0}),helperText:"owner/repo (auto-detected if empty)"})]}),l.boardProvider.provider==="local"&&s.jsx("div",{className:"md:col-span-2",children:s.jsx("p",{className:"text-sm text-slate-400",children:"Local board uses SQLite for storage — no additional configuration needed."})})]})]}),s.jsxs(ft,{className:"p-6",children:[s.jsx("h3",{className:"text-lg font-medium text-slate-200 mb-2",children:"Notification Webhooks"}),s.jsx("p",{className:"text-sm text-slate-400 mb-6",children:"Send status updates and job results to custom endpoints or team channels"}),s.jsx(yj,{notifications:l.notifications,onChange:h=>r("notifications",h),globalWebhook:d,onSetGlobal:c,onUnsetGlobal:f})]})]});function Nj(l,r,d,c){const{addToast:f}=Wt(),[h,b]=U.useState(!1),[N,y]=U.useState(null),[p,j]=U.useState(null),[T,_]=U.useState(null),k=U.useCallback(()=>({...Fv,...l}),[l]),S=U.useCallback(F=>{const Z=k();return Object.entries(Z).map(([R,ee])=>({label:ee.name,value:R}))},[k]),C=U.useCallback(F=>{const Z=[];r===F&&Z.push("Global Provider");const R={executor:"Executor",reviewer:"Reviewer",qa:"QA",audit:"Audit",slicer:"Planner",analytics:"Analytics"};for(const[ee,O]of Object.entries(d))O===F&&Z.push(R[ee]??ee);return Z},[r,d]),A=U.useCallback(()=>{y(null),j(null),b(!0)},[]),$=U.useCallback(F=>{const R=k()[F];R&&(y(F),j(R),b(!0))},[k]),B=U.useCallback(async(F,Z)=>{const R=!N,ee={...l,[F]:Z};c("providerPresets",ee);try{await so({providerPresets:{[F]:Z}}),f({title:R?"Preset Added":"Preset Updated",message:R?`${Z.name} has been added. You can now assign it to jobs.`:`${Z.name} has been saved.`,type:"success"})}catch(O){f({title:"Save Failed",message:O instanceof Error?O.message:"Failed to save preset",type:"error"}),c("providerPresets",l)}},[N,l,c,f]),M=U.useCallback(F=>{var ee,O;if(uo.includes(F)){f({title:"Cannot Delete",message:"Built-in presets cannot be deleted.",type:"error"});return}const Z=C(F);if(Z.length>0){_({presetId:F,presetName:((ee=k()[F])==null?void 0:ee.name)??F,references:Z});return}const R={...l};delete R[F],c("providerPresets",R),f({title:"Preset Deleted",message:`${((O=k()[F])==null?void 0:O.name)??F} has been removed.`,type:"success"})},[l,c,f,C,k]),X=U.useCallback(F=>{const Z={...l};delete Z[F],c("providerPresets",Z),f({title:"Preset Reset",message:`${F} has been reset to built-in defaults.`,type:"success"})},[l,c,f]),ie=U.useCallback(()=>{if(!T)return;const{presetId:F}=T,Z={...l};delete Z[F],c("providerPresets",Z);const R={...d};for(const ee of Object.keys(R))R[ee]===F&&delete R[ee];c("jobProviders",R),r===F&&c("provider","claude"),_(null),f({title:"Preset Deleted",message:`${T.presetName} has been removed and all references cleared.`,type:"success"})},[T,l,d,r,c,f]);return{presetModalOpen:h,setPresetModalOpen:b,editingPresetId:N,editingPreset:p,deleteWarning:T,setDeleteWarning:_,getAllPresets:k,getPresetOptions:S,getPresetReferences:C,handleAddPreset:A,handleEditPreset:$,handleSavePreset:B,handleDeletePreset:M,handleResetPreset:X,handleConfirmDelete:ie}}const Sj=["executor","reviewer","qa","audit","slicer","analytics","pr-resolver","merger"],Tx=l=>{const r=l.primaryFallbackModel!==void 0?l.primaryFallbackModel??"":l.claudeModel??"",d=l.secondaryFallbackModel!==void 0?l.secondaryFallbackModel??"":l.primaryFallbackModel!==void 0?l.primaryFallbackModel??"":l.claudeModel??"";return{provider:l.provider,providerLabel:l.providerLabel??"",providerPresets:l.providerPresets??{},defaultBranch:l.defaultBranch,prdDir:l.prdDir||"docs/prds",branchPrefix:l.branchPrefix,branchPatterns:l.branchPatterns||[],gitPushNoVerify:l.gitPushNoVerify??!1,executorEnabled:l.executorEnabled??!0,reviewerEnabled:l.reviewerEnabled,minReviewScore:l.minReviewScore,maxRuntime:l.maxRuntime,reviewerMaxRuntime:l.reviewerMaxRuntime,maxLogSize:l.maxLogSize,cronSchedule:l.cronSchedule||Bv,reviewerSchedule:l.reviewerSchedule||Yv,scheduleBundleId:l.scheduleBundleId??null,cronScheduleOffset:l.cronScheduleOffset??0,schedulingPriority:l.schedulingPriority??3,maxRetries:l.maxRetries??3,reviewerMaxRetries:l.reviewerMaxRetries??2,reviewerRetryDelay:l.reviewerRetryDelay??30,reviewerMaxPrsPerRun:l.reviewerMaxPrsPerRun??0,providerEnv:l.providerEnv||{},notifications:l.notifications||{webhooks:[]},prdPriority:l.prdPriority||[],roadmapScanner:l.roadmapScanner||Br(),templatesDir:l.templatesDir||".night-watch/templates",boardProvider:l.boardProvider||{enabled:!0,provider:"github"},jobProviders:l.jobProviders||{},fallbackOnRateLimit:l.fallbackOnRateLimit??!0,primaryFallbackModel:r,secondaryFallbackModel:d,primaryFallbackPreset:l.primaryFallbackPreset??"",secondaryFallbackPreset:l.secondaryFallbackPreset??"",claudeModel:r,providerScheduleOverrides:l.providerScheduleOverrides??[],qa:l.qa||Pv(),audit:l.audit||$v(),analytics:l.analytics||vh(),prResolver:l.prResolver??mu(),merger:l.merger??xo(),queue:l.queue||{enabled:!0,mode:"conservative",maxConcurrency:1,maxWaitTime:7200,priority:{executor:50,reviewer:40,slicer:30,qa:20,audit:10},providerBuckets:{}}}},jj=()=>{const l=_n(),r=oo(),{addToast:d,projectName:c,selectedProjectId:f,globalModeLoading:h,isGlobalMode:b,removeProjectFromList:N}=Wt(),[y,p]=ze.useState(!1),[j,T]=ze.useState(!1),[_,k]=ze.useState(!1),[S,C]=ze.useState(null),[A,$]=ze.useState(void 0),B=ze.useRef(null),[M,X]=ze.useState(!1),ie=ze.useRef(!1),F=ze.useRef(!1),[Z,R]=ze.useState("project"),ee=ze.useMemo(()=>{const xe=new URLSearchParams(l.search).get("tab");return xe==="jobs"||xe==="schedules"?xe:null},[l.search]),{data:O,loading:ne,error:ae,refetch:he}=pn(hh,[f],{enabled:!h}),{data:pe,loading:re,refetch:P}=pn(D2,[f],{enabled:!h}),te=pe??[],de=(xe,Te)=>{C(Ze=>Ze&&{...Ze,[xe]:Te})},me=Nj((S==null?void 0:S.providerPresets)??{},(S==null?void 0:S.provider)??"claude",(S==null?void 0:S.jobProviders)??{},de);ze.useEffect(()=>{V2().then(xe=>$(xe.webhook)).catch(()=>{})},[f]),ze.useEffect(()=>{ee&&r({pathname:"/scheduling",search:l.search},{replace:!0})},[ee,l.search,r]),ze.useEffect(()=>{if(ee)return;const Te=new URLSearchParams(l.search).get("tab");Te&&R({providers:"ai-providers",runtime:"ai-providers","ai-runtime":"ai-providers",notifications:"integrations",general:"project",advanced:"project"}[Te]??Te)},[ee,l.search]),ze.useEffect(()=>{if(O){if(ie.current){ie.current=!1;return}const xe=Tx(O);C(xe),B.current=xe,X(!1)}},[O]),ze.useEffect(()=>{if(!S||!B.current)return;const xe=JSON.stringify(S),Te=JSON.stringify(B.current);X(xe!==Te)},[S]),ze.useEffect(()=>{S&&F.current&&(F.current=!1,_e())},[S==null?void 0:S.jobProviders]);const _e=async()=>{var Ze,We,Dt,da,Ja,Ka,fa,ha,yn;if(!S)return;const xe=S.cronSchedule!==(O==null?void 0:O.cronSchedule)||S.reviewerSchedule!==(O==null?void 0:O.reviewerSchedule)||S.cronScheduleOffset!==((O==null?void 0:O.cronScheduleOffset)??0)||S.schedulingPriority!==((O==null?void 0:O.schedulingPriority)??3)||S.executorEnabled!==((O==null?void 0:O.executorEnabled)??!0)||S.reviewerEnabled!==((O==null?void 0:O.reviewerEnabled)??!0)||S.queue.enabled!==(((Ze=O==null?void 0:O.queue)==null?void 0:Ze.enabled)??!0)||S.qa.enabled!==((O==null?void 0:O.qa.enabled)??!0)||S.qa.schedule!==(O==null?void 0:O.qa.schedule)||S.audit.enabled!==((O==null?void 0:O.audit.enabled)??!0)||S.audit.schedule!==(O==null?void 0:O.audit.schedule)||S.analytics.enabled!==(((We=O==null?void 0:O.analytics)==null?void 0:We.enabled)??!1)||S.analytics.schedule!==(((Dt=O==null?void 0:O.analytics)==null?void 0:Dt.schedule)??vh().schedule)||S.prResolver.enabled!==(((da=O==null?void 0:O.prResolver)==null?void 0:da.enabled)??mu().enabled)||S.prResolver.schedule!==(((Ja=O==null?void 0:O.prResolver)==null?void 0:Ja.schedule)??mu().schedule)||S.merger.enabled!==(((Ka=O==null?void 0:O.merger)==null?void 0:Ka.enabled)??!1)||S.merger.schedule!==(((fa=O==null?void 0:O.merger)==null?void 0:fa.schedule)??xo().schedule)||S.roadmapScanner.enabled!==(((ha=O==null?void 0:O.roadmapScanner)==null?void 0:ha.enabled)??!0)||(S.roadmapScanner.slicerSchedule||Br().slicerSchedule)!==(((yn=O==null?void 0:O.roadmapScanner)==null?void 0:yn.slicerSchedule)||Br().slicerSchedule),Te={};for(const $t of Sj){const ua=S.jobProviders[$t];typeof ua=="string"&&ua.trim().length>0?Te[$t]=ua:O!=null&&O.jobProviders[$t]&&(Te[$t]=null)}p(!0);try{const $t=S.primaryFallbackModel||null,ua=S.secondaryFallbackModel||null,en=await so({provider:S.provider,providerLabel:S.providerLabel.trim(),providerPresets:Object.keys(S.providerPresets).length>0?S.providerPresets:void 0,defaultBranch:S.defaultBranch,prdDir:S.prdDir,branchPrefix:S.branchPrefix,branchPatterns:S.branchPatterns,gitPushNoVerify:S.gitPushNoVerify,executorEnabled:S.executorEnabled,reviewerEnabled:S.reviewerEnabled,minReviewScore:S.minReviewScore,maxRuntime:S.maxRuntime,reviewerMaxRuntime:S.reviewerMaxRuntime,maxLogSize:S.maxLogSize,cronSchedule:S.cronSchedule,reviewerSchedule:S.reviewerSchedule,scheduleBundleId:S.scheduleBundleId,cronScheduleOffset:S.cronScheduleOffset,schedulingPriority:S.schedulingPriority,maxRetries:S.maxRetries,reviewerMaxRetries:S.reviewerMaxRetries,reviewerRetryDelay:S.reviewerRetryDelay,reviewerMaxPrsPerRun:S.reviewerMaxPrsPerRun,providerEnv:S.providerEnv,notifications:S.notifications,prdPriority:S.prdPriority,roadmapScanner:S.roadmapScanner,templatesDir:S.templatesDir,boardProvider:S.boardProvider,jobProviders:Te,fallbackOnRateLimit:S.fallbackOnRateLimit,primaryFallbackModel:$t,secondaryFallbackModel:ua,primaryFallbackPreset:S.primaryFallbackPreset||void 0,secondaryFallbackPreset:S.secondaryFallbackPreset||void 0,claudeModel:$t,providerScheduleOverrides:S.providerScheduleOverrides,qa:S.qa,audit:S.audit,analytics:S.analytics,prResolver:S.prResolver,merger:S.merger,queue:S.queue}),tn=Tx(en);C(tn),B.current=tn,X(!1);let an="";if(xe)try{await ou()}catch(Ua){an=Ua instanceof Error?Ua.message:"failed to reinstall cron schedules"}d(an?{title:"Settings Saved (Cron Reinstall Failed)",message:an,type:"warning"}:{title:"Settings Saved",message:xe?"Configuration updated and cron schedules reinstalled.":"Configuration updated successfully.",type:"success"}),ie.current=!0,he(),P()}catch($t){d({title:"Save Failed",message:$t instanceof Error?$t.message:"Failed to save configuration",type:"error"})}finally{p(!1)}},L=()=>{B.current&&(C(B.current),X(!1),d({title:"Reset Complete",message:"Unsaved changes were discarded.",type:"info"}))},le=async xe=>{if(!(A!=null&&!window.confirm("Replace existing global channel?")))try{const Te=await Vg({webhook:xe});$(Te.webhook)}catch(Te){d({title:"Failed to set global channel",message:Te instanceof Error?Te.message:"Unknown error",type:"error"})}},ge=async()=>{try{await Vg({webhook:null}),$(null)}catch(xe){d({title:"Failed to unset global channel",message:xe instanceof Error?xe.message:"Unknown error",type:"error"})}},ve=async()=>{if(f){k(!0);try{await M2(f),N(f),T(!1),d({title:"Project Removed",message:"Cron jobs uninstalled and all project data removed from the database.",type:"success"})}catch(xe){d({title:"Remove Failed",message:xe instanceof Error?xe.message:"Failed to remove project",type:"error"})}finally{k(!1)}}};if(ee)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Opening automation..."})});if(ne||!S)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-slate-400",children:"Loading settings..."})});if(ae)return s.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[s.jsx(Dn,{className:"h-12 w-12 text-red-400"}),s.jsx("div",{className:"text-slate-300",children:"Failed to load settings"}),s.jsx("div",{className:"text-sm text-slate-500",children:ae.message}),s.jsx(Ve,{onClick:()=>he(),children:"Retry"})]});const we=[{id:"project",label:"Project",content:s.jsx(mj,{form:S,updateField:de,projectName:c,doctorChecks:te,doctorLoading:re})},{id:"ai-providers",label:"AI Providers",content:s.jsx(xj,{form:S,updateField:de,getAllPresets:me.getAllPresets,getPresetOptions:me.getPresetOptions,handleEditPreset:me.handleEditPreset,handleDeletePreset:me.handleDeletePreset,handleResetPreset:me.handleResetPreset,handleAddPreset:me.handleAddPreset})},{id:"integrations",label:"Integrations",content:s.jsx(bj,{form:S,updateField:de,globalWebhook:A,onSetGlobal:le,onUnsetGlobal:ge})}];return s.jsxs("div",{className:"max-w-4xl mx-auto pb-32",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-slate-100",children:"Settings"}),s.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Configure project automation, providers, and integrations"})]}),M&&s.jsxs(Ia,{variant:"warning",className:"animate-pulse",children:[s.jsx(Ys,{className:"h-3 w-3 mr-1"}),"Unsaved Changes"]})]}),s.jsx(hv,{tabs:we,activeTab:Z,onChange:R}),M&&s.jsx("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-50 w-full max-w-2xl px-4 animate-in fade-in slide-in-from-bottom-4 duration-300",children:s.jsxs("div",{className:"bg-slate-900/90 backdrop-blur-md border border-indigo-500/30 rounded-2xl p-4 shadow-2xl flex items-center justify-between shadow-indigo-500/10",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-lg bg-indigo-500/20 text-indigo-400",children:s.jsx(Dn,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-slate-200",children:"You have unsaved changes"}),s.jsx("div",{className:"text-[11px] text-slate-400",children:"Save your configuration to apply changes"})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(Ve,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-slate-300",onClick:L,children:[s.jsx(ch,{className:"h-4 w-4 mr-2"}),"Discard"]}),s.jsxs(Ve,{size:"sm",className:"bg-indigo-600 hover:bg-indigo-500 shadow-lg shadow-indigo-500/20",onClick:_e,loading:y,children:[s.jsx(tv,{className:"h-4 w-4 mr-2"}),"Save Changes"]})]})]})}),b&&f&&s.jsxs("div",{className:"mt-10 rounded-lg border border-red-900/50 bg-red-950/20 p-6",children:[s.jsx("h3",{className:"text-lg font-medium text-red-400 mb-2",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-slate-400 mb-4",children:"Remove this project from Night Watch. This will uninstall cron jobs and delete all project data from the database. Files on disk will not be touched."}),s.jsxs(Ve,{variant:"secondary",className:"bg-red-600 hover:bg-red-700 text-white",onClick:()=>T(!0),children:[s.jsx(Fr,{className:"h-4 w-4 mr-2"}),"Remove Project"]})]}),j&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm",onClick:()=>!_&&T(!1),"aria-hidden":"true"}),s.jsxs("div",{className:"relative w-full max-w-md transform rounded-xl bg-slate-900 border border-slate-800 shadow-2xl p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Ys,{className:"h-6 w-6 text-red-400"}),s.jsxs("h3",{className:"text-lg font-semibold text-slate-100",children:["Remove ",c,"?"]})]}),s.jsx("p",{className:"text-sm text-slate-300 mb-6",children:"This will uninstall cron jobs and remove all Night Watch data for this project from the database. The project files on disk will not be deleted."}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(Ve,{variant:"ghost",onClick:()=>T(!1),disabled:_,children:"Cancel"}),s.jsx(Ve,{variant:"secondary",className:"bg-red-600 hover:bg-red-700",onClick:ve,loading:_,children:"Remove"})]})]})]}),s.jsx(hj,{isOpen:me.presetModalOpen,onClose:()=>{me.setPresetModalOpen(!1)},onSave:me.handleSavePreset,presetId:me.editingPresetId,preset:me.editingPreset,isBuiltIn:me.editingPresetId?uo.includes(me.editingPresetId):!1,existingIds:Object.keys(me.getAllPresets())}),me.deleteWarning&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm",onClick:()=>me.setDeleteWarning(null),"aria-hidden":"true"}),s.jsxs("div",{className:"relative w-full max-w-md transform rounded-xl bg-slate-900 border border-slate-800 shadow-2xl p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Ys,{className:"h-6 w-6 text-amber-400"}),s.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Cannot Delete Preset"})]}),s.jsxs("p",{className:"text-sm text-slate-300 mb-4",children:[s.jsx("strong",{children:me.deleteWarning.presetName})," is currently assigned to the following jobs:"]}),s.jsx("ul",{className:"list-disc list-inside text-sm text-slate-400 mb-4",children:me.deleteWarning.references.map(xe=>s.jsx("li",{children:xe},xe))}),s.jsx("p",{className:"text-sm text-slate-400 mb-6",children:'Please remove these assignments before deleting the preset, or use "Force Delete" to remove the preset and clear all references.'}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(Ve,{variant:"ghost",onClick:()=>me.setDeleteWarning(null),children:"Cancel"}),s.jsx(Ve,{variant:"secondary",onClick:me.handleConfirmDelete,className:"bg-red-600 hover:bg-red-700",children:"Force Delete"})]})]})]})]})},wj=()=>(J2(),K2(),s.jsx($b,{children:s.jsxs("div",{className:"flex h-screen bg-[#030712] text-slate-300 overflow-hidden relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-full h-96 bg-indigo-900/10 rounded-full blur-[120px] -translate-y-1/2 pointer-events-none z-0"}),s.jsx(W2,{}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0 z-10",children:[s.jsx(Q2,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6 scroll-smooth relative",children:s.jsx("div",{className:"max-w-7xl mx-auto w-full",children:s.jsxs(bb,{children:[s.jsx(sl,{path:"/",element:s.jsx(uN,{})}),s.jsx(sl,{path:"/prs",element:s.jsx(oN,{})}),s.jsx(sl,{path:"/board",element:s.jsx(lN,{})}),s.jsx(sl,{path:"/scheduling",element:s.jsx(ij,{})}),s.jsx(sl,{path:"/logs",element:s.jsx(cN,{})}),s.jsx(sl,{path:"/roadmap",element:s.jsx(dN,{})}),s.jsx(sl,{path:"/settings",element:s.jsx(jj,{})}),s.jsx(sl,{path:"*",element:s.jsx(pb,{to:"/",replace:!0})})]})})})]}),s.jsx(X2,{})]})})),Zv=document.getElementById("root");if(!Zv)throw new Error("Could not find root element to mount to");const Ej=Sy.createRoot(Zv);Ej.render(s.jsx(ze.StrictMode,{children:s.jsx(wj,{})}));